mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 10:26:35 +03:00
10 lines
765 KiB
JavaScript
10 lines
765 KiB
JavaScript
/*!
|
||
* juniper-js
|
||
* Edit and execute code snippets in the browser using Jupyter kernels
|
||
*
|
||
* @author Ines Montani
|
||
* @version 0.0.3
|
||
* @license MIT
|
||
*/
|
||
!function(e){function t(t){for(var n,i,o=t[0],a=t[1],s=0,c=[];s<o.length;s++)i=o[s],r[i]&&c.push(r[i][0]),r[i]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(l&&l(t);c.length;)c.shift()()}var n={},r={2:0};function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(function(t,i){n=r[e]=[t,i]});t.push(n[2]=o);var a,s=document.getElementsByTagName("head")[0],l=document.createElement("script");l.charset="utf-8",l.timeout=120,i.nc&&l.setAttribute("nonce",i.nc),l.src=function(e){return i.p+""+e+".juniper.min.js"}(e),a=function(t){l.onerror=l.onload=null,clearTimeout(c);var n=r[e];if(0!==n){if(n){var i=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src,a=new Error("Loading chunk "+e+" failed.\n("+i+": "+o+")");a.type=i,a.request=o,n[1](a)}r[e]=void 0}};var c=setTimeout(function(){a({type:"timeout",target:l})},12e4);l.onerror=l.onload=a,s.appendChild(l)}return Promise.all(t)},i.m=e,i.c=n,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var o=window.webpackJsonp=window.webpackJsonp||[],a=o.push.bind(o);o.push=t,o=o.slice();for(var s=0;s<o.length;s++)t(o[s]);var l=a;i(i.s=173)}([function(e,t,n){"use strict";var r,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};o=function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),s=r||i||o,l=s&&(r?document.documentMode||6:+(o||i)[1]),c=!o&&/WebKit\//.test(e),u=c&&/Qt\/\d+\.\d+/.test(e),d=!o&&/Chrome\//.test(e),f=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),m=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=/Android/.test(e),y=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=g||/Mac/.test(t),x=/\bCrOS\b/.test(e),w=/win/i.test(t),_=f&&e.match(/Version\/(\d*\.\d*)/);_&&(_=Number(_[1])),_&&_>=15&&(f=!1,c=!0);var k=b&&(u||f&&(null==_||_<12.11)),C=n||s&&l>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var M,L=function(e,t){var n=e.className,r=S(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return T(e).appendChild(t)}function A(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function P(e,t,n,r){var i=A(e,t,n,r);return i.setAttribute("role","presentation"),i}function E(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function D(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function j(e,t){var n=e.className;S(t).test(n)||(e.className+=(n?" ":"")+t)}function N(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!S(n[r]).test(t)&&(t+=" "+n[r]);return t}M=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var I=function(e){e.select()};function R(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function z(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function F(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}g?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(I=function(e){try{e.select()}catch(e){}});var W=function(){this.id=null};function B(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}W.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var H=30,q={toString:function(){return"CodeMirror.Pass"}},U={scroll:!1},K={origin:"*mouse"},V={origin:"+move"};function $(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var G=[""];function J(e){for(;G.length<=e;)G.push(X(G)+" ");return G[e]}function X(e){return e[e.length-1]}function Z(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Y(){}function Q(e,t){var n;return Object.create?n=Object.create(e):(Y.prototype=e,n=new Y),t&&z(t,n),n}var ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function te(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\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 oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function ae(e,t,n){for(;(n<0?t>0:t<e.length)&&oe(e.charAt(t));)t+=n;return t}function se(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function le(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function ce(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function ue(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function de(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function fe(e){if(null==e.parent)return null;for(var t=e.parent,n=B(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function he(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return n+a}function pe(e,t){return t>=e.first&&t<e.first+e.size}function me(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ge(e,t,n){if(void 0===n&&(n=null),!(this instanceof ge))return new ge(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ve(e,t){return e.line-t.line||e.ch-t.ch}function ye(e,t){return e.sticky==t.sticky&&0==ve(e,t)}function be(e){return ge(e.line,e.ch)}function xe(e,t){return ve(e,t)<0?t:e}function we(e,t){return ve(e,t)<0?e:t}function _e(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ke(e,t){if(t.line<e.first)return ge(e.first,0);var n=e.first+e.size-1;return t.line>n?ge(n,le(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?ge(e.line,t):n<0?ge(e.line,0):e}(t,le(e,t.line).text.length)}function Ce(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ke(e,t[r]);return n}var Se=!1,Me=!1;function Le(e,t,n){this.marker=e,this.from=t,this.to=n}function Te(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Oe(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Ae(e,t){if(t.full)return null;var n=pe(e,t.from.line)&&le(e,t.from.line).markedSpans,r=pe(e,t.to.line)&&le(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==ve(t.from,t.to),s=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Le(a,o.from,s?null:o.to))}}return r}(n,i,a),l=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Le(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}(r,o,a),c=1==t.text.length,u=X(t.text).length+(c?i:0);if(s)for(var d=0;d<s.length;++d){var f=s[d];if(null==f.to){var h=Te(l,f.marker);h?c&&(f.to=null==h.to?null:h.to+u):f.to=i}}if(l)for(var p=0;p<l.length;++p){var m=l[p];null!=m.to&&(m.to+=u),null==m.from?Te(s,m.marker)||(m.from=u,c&&(s||(s=[])).push(m)):(m.from+=u,c&&(s||(s=[])).push(m))}s&&(s=Pe(s)),l&&l!=s&&(l=Pe(l));var g=[s];if(!c){var v,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(v||(v=[])).push(new Le(s[b].marker,null,null));for(var x=0;x<y;++x)g.push(v);g.push(l)}return g}function Pe(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ee(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function De(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function je(e){return e.inclusiveLeft?-1:0}function Ne(e){return e.inclusiveRight?1:0}function Ie(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=ve(r.from,i.from)||je(e)-je(t);return o?-o:ve(r.to,i.to)||Ne(e)-Ne(t)||t.id-e.id}function Re(e,t){var n,r=Me&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||Ie(n,i.marker)<0)&&(n=i.marker);return n}function ze(e){return Re(e,!0)}function Fe(e){return Re(e,!1)}function We(e,t,n,r,i){var o=le(e,t),a=Me&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=ve(c.from,n)||je(l.marker)-je(i),d=ve(c.to,r)||Ne(l.marker)-Ne(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ve(c.to,n)>=0:ve(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ve(c.from,r)<=0:ve(c.from,r)<0)))return!0}}}function Be(e){for(var t;t=ze(e);)e=t.find(-1,!0).line;return e}function He(e,t){var n=le(e,t),r=Be(n);return n==r?t:fe(r)}function qe(e,t){if(t>e.lastLine())return t;var n,r=le(e,t);if(!Ue(e,r))return t;for(;n=Fe(r);)r=n.find(1,!0).line;return fe(r)+1}function Ue(e,t){var n=Me&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Ke(e,t,r))return!0}}function Ke(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Ke(e,r.line,Te(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Ke(e,t,i))return!0}function Ve(e){for(var t=0,n=(e=Be(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function $e(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=ze(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=Fe(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function Ge(e){var t=e.display,n=e.doc;t.maxLine=le(n,n.first),t.maxLineLength=$e(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=$e(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var Je=null;function Xe(e,t,n){var r;Je=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:Je=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:Je=i)}return null!=r?r:Je}var Ze=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var c,u=a.length,d=[],f=0;f<u;++f)d.push((c=a.charCodeAt(f))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var h=0,p=l;h<u;++h){var m=d[h];"m"==m?d[h]=p:p=m}for(var g=0,v=l;g<u;++g){var y=d[g];"1"==y&&"r"==v?d[g]="n":n.test(y)&&(v=y,"r"==y&&(d[g]="R"))}for(var b=1,x=d[0];b<u-1;++b){var w=d[b];"+"==w&&"1"==x&&"1"==d[b+1]?d[b]="1":","!=w||x!=d[b+1]||"1"!=x&&"n"!=x||(d[b]=x),x=w}for(var _=0;_<u;++_){var k=d[_];if(","==k)d[_]="N";else if("%"==k){var C=void 0;for(C=_+1;C<u&&"%"==d[C];++C);for(var S=_&&"!"==d[_-1]||C<u&&"1"==d[C]?"1":"N",M=_;M<C;++M)d[M]=S;_=C-1}}for(var L=0,T=l;L<u;++L){var O=d[L];"L"==T&&"1"==O?d[L]="L":n.test(O)&&(T=O)}for(var A=0;A<u;++A)if(t.test(d[A])){var P=void 0;for(P=A+1;P<u&&t.test(d[P]);++P);for(var E="L"==(A?d[A-1]:l),D=E==("L"==(P<u?d[P]:l))?E?"L":"R":l,j=A;j<P;++j)d[j]=D;A=P-1}for(var N,I=[],R=0;R<u;)if(r.test(d[R])){var z=R;for(++R;R<u&&r.test(d[R]);++R);I.push(new o(0,z,R))}else{var F=R,W=I.length;for(++R;R<u&&"L"!=d[R];++R);for(var B=F;B<R;)if(i.test(d[B])){F<B&&I.splice(W,0,new o(1,F,B));var H=B;for(++B;B<R&&i.test(d[B]);++B);I.splice(W,0,new o(2,H,B)),F=B}else++B;F<R&&I.splice(W,0,new o(1,F,R))}return"ltr"==s&&(1==I[0].level&&(N=a.match(/^\s+/))&&(I[0].from=N[0].length,I.unshift(new o(0,0,N[0].length))),1==X(I).level&&(N=a.match(/\s+$/))&&(X(I).to-=N[0].length,I.push(new o(0,u-N[0].length,u)))),"rtl"==s?I.reverse():I}}();function Ye(e,t){var n=e.order;return null==n&&(n=e.order=Ze(e.text,t)),n}var Qe=[],et=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Qe).concat(n)}};function tt(e,t){return e._handlers&&e._handlers[t]||Qe}function nt(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=B(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function rt(e,t){var n=tt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function it(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),rt(e,n||t.type,e,t),ut(t)||t.codemirrorIgnore}function ot(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==B(n,t[r])&&n.push(t[r])}function at(e,t){return tt(e,t).length>0}function st(e){e.prototype.on=function(e,t){et(this,e,t)},e.prototype.off=function(e,t){nt(this,e,t)}}function lt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ct(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ut(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function dt(e){lt(e),ct(e)}function ft(e){return e.target||e.srcElement}function ht(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var pt,mt,gt=function(){if(s&&l<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function vt(e){if(null==pt){var t=A("span","");O(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(pt=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&l<8))}var n=pt?A("span",""):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function yt(e){if(null!=mt)return mt;var t=O(e,document.createTextNode("AخA")),n=M(t,0,1).getBoundingClientRect(),r=M(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(mt=r.right-n.right<3)}var bt,xt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},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)},_t="oncopy"in(bt=A("div"))||(bt.setAttribute("oncopy","return;"),"function"==typeof bt.oncopy),kt=null,Ct={},St={};function Mt(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=Q(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Mt("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Mt("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Lt(e,t){t=Mt(t);var n=Ct[t.name];if(!n)return Lt(e,"text/plain");var r=n(e,t);if(Tt.hasOwnProperty(t.name)){var i=Tt[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Tt={};function Ot(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function At(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Pt(e,t,n){return!e.startState||e.startState(t,n)}var Et=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Et.prototype.eol=function(){return this.pos>=this.string.length},Et.prototype.sol=function(){return this.pos==this.lineStart},Et.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Et.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Et.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Et.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Et.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Et.prototype.skipToEnd=function(){this.pos=this.string.length},Et.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Et.prototype.backUp=function(e){this.pos-=e},Et.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Et.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Et.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Et.prototype.current=function(){return this.string.slice(this.start,this.pos)},Et.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Et.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Et.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Dt=function(e,t){this.state=e,this.lookAhead=t},jt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function Nt(e,t,n,r){var i=[e.state.modeGen],o={};Ut(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,c=0;n.state=!0,Ut(e,t.text,s.mode,n,function(e,t){for(var n=l;c<e;){var r=i[l];r>e&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}},o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function It(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Rt(e,fe(t)),i=t.text.length>e.options.maxHighlightLength&&Ot(e.doc.mode,r.state),o=Nt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Rt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new jt(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=le(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof Dt?c.lookAhead:0)<=o.modeFrontier))return s;var u=F(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}(e,t,n),a=o>r.first&&le(r,o-1).stateAfter,s=a?jt.fromSaved(r,a,o):new jt(r,Pt(r.mode),o);return r.iter(o,t,function(n){zt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()}),n&&(r.modeFrontier=s.line),s}function zt(e,t,n,r){var i=e.doc.mode,o=new Et(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&Ft(i,n.state);!o.eol();)Wt(i,o,n.state),o.start=o.pos}function Ft(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=At(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Wt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=At(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}jt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},jt.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}},jt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},jt.fromSaved=function(e,t,n){return t instanceof Dt?new jt(e,Ot(e.mode,t.state),n,t.lookAhead):new jt(e,Ot(e.mode,t),n)},jt.prototype.save=function(e){var t=!1!==e?Ot(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Dt(t,this.maxLookAhead):t};var Bt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Ht(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=le(a,(t=ke(a,t)).line),c=Rt(e,t.line,n),u=new Et(l.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=Wt(s,u,c.state),r&&o.push(new Bt(u,i,Ot(a.mode,c.state)));return r?o:new Bt(u,i,c.state)}function qt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Ut(e,t,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,d=new Et(t,e.options.tabSize,r),f=e.options.addModeClass&&[null];for(""==t&&qt(Ft(n,r.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(s=!1,a&&zt(e,t,r,d.pos),d.pos=t.length,l=null):l=qt(Wt(n,d,r.state,f),o),f){var h=f[0].name;h&&(l="m-"+(l?h+" "+l:h))}if(!s||u!=l){for(;c<d.start;)i(c=Math.min(d.start,c+5e3),u);u=l}d.start=d.pos}for(;c<d.pos;){var p=Math.min(d.pos,c+5e3);i(p,u),c=p}}var Kt=function(e,t,n){this.text=e,De(this,t),this.height=n?n(this):1};function Vt(e){e.parent=null,Ee(e)}Kt.prototype.lineNo=function(){return fe(this)},st(Kt);var $t={},Gt={};function Jt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Gt:$t;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,t){var n=P("span",null,null,c?"padding-right: .1px":null),r={pre:P("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(s||c)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Yt,yt(e.display.measure)&&(a=Ye(o,e.doc.direction))&&(r.addToken=Qt(r.addToken,a)),r.map=[],tn(o,r,It(e,o,t!=e.display.externalMeasured&&fe(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=N(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=N(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(vt(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(c){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return rt(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=N(r.pre.className,r.textClass||"")),r}function Zt(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Yt(e,t,n,r,i,o,a){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1;if(d.test(t)){c=document.createDocumentFragment();for(var h=0;;){d.lastIndex=h;var p=d.exec(t),m=p?p.index-h:t.length-h;if(m){var g=document.createTextNode(u.slice(h,h+m));s&&l<9?c.appendChild(A("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!p)break;h+=m+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=c.appendChild(A("span",J(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=c.appendChild(A("span","\r"==p[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),s&&l<9?c.appendChild(A("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),s&&l<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||i||f||a){var x=n||"";r&&(x+=r),i&&(x+=i);var w=A("span",[c],x,a);return o&&(w.title=o),e.content.appendChild(w)}e.content.appendChild(c)}}function Qt(e,t){return function(n,r,i,o,a,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var d=void 0,f=0;f<t.length&&!((d=t[f]).to>c&&d.from<=c);f++);if(d.to>=u)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-c),i,o,null,s,l),o=null,r=r.slice(d.to-c),c=d.to}}}function en(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function tn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,u,d,f,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){l=c=u=d=s="",f=null,v=1/0;for(var y=[],b=void 0,x=0;x<r.length;++x){var w=r[x],_=w.marker;"bookmark"==_.type&&w.from==p&&_.widgetNode?y.push(_):w.from<=p&&(null==w.to||w.to>p||_.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),_.className&&(l+=" "+_.className),_.css&&(s=(s?s+";":"")+_.css),_.startStyle&&w.from==p&&(u+=" "+_.startStyle),_.endStyle&&w.to==v&&(b||(b=[])).push(_.endStyle,w.to),_.title&&!d&&(d=_.title),_.collapsed&&(!f||Ie(f.marker,_)<0)&&(f=w)):w.from>p&&v>w.from&&(v=w.from)}if(b)for(var k=0;k<b.length;k+=2)b[k+1]==v&&(c+=" "+b[k]);if(!f||f.from==p)for(var C=0;C<y.length;++C)en(t,0,y[C]);if(f&&(f.from||0)==p){if(en(t,(null==f.to?h+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=h)break;for(var S=Math.min(h,v);;){if(g){var M=p+g.length;if(!f){var L=M>S?g.slice(0,S-p):g;t.addToken(t,L,a?a+l:l,u,p+L.length==v?c:"",d,s)}if(M>=S){g=g.slice(S-p),p=S;break}p=M,u=""}g=i.slice(o,o=n[m++]),a=Jt(n[m++],t.cm.options)}}else for(var T=1;T<n.length;T+=2)t.addToken(t,i.slice(o,o=n[T]),Jt(n[T+1],t.cm.options))}function nn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=Fe(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?fe(X(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Ue(e,t)}function rn(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new nn(e.doc,le(e.doc,o),o);r=o+a.size,i.push(a)}return i}var on=null,an=null;function sn(e,t){var n=tt(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);on?r=on.delayedCallbacks:an?r=an:(r=an=[],setTimeout(ln,0));for(var o=function(e){r.push(function(){return n[e].apply(null,i)})},a=0;a<n.length;++a)o(a)}}function ln(){var e=an;an=null;for(var t=0;t<e.length;++t)e[t]()}function cn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?fn(e,t):"gutter"==o?pn(e,t,n,r):"class"==o?hn(e,t):"widget"==o&&mn(e,t,r)}t.changes=null}function un(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),s&&l<8&&(e.node.style.zIndex=2)),e.node}function dn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Xt(e,t)}function fn(e,t){var n=t.text.className,r=dn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,hn(e,t)):n&&(t.text.className=n)}function hn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=un(t);t.background=r.insertBefore(A("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?un(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function pn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=un(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=un(t),s=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(A("div",me(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.options.gutters.length;++l){var c=e.options.gutters[l],u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(A("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function mn(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild,i=void 0;r;r=i)i=r.nextSibling,"CodeMirror-linewidget"==r.className&&t.node.removeChild(r);vn(e,t,n)}function gn(e,t,n,r){var i=dn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),hn(e,t),pn(e,t,n,r),vn(e,t,r),t.node}function vn(e,t,n){if(yn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)yn(e,t.rest[r],t,n,!1)}function yn(e,t,n,r,i){if(t.widgets)for(var o=un(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=A("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),bn(l,c,n,r),e.display.input.setUneditable(c),i&&l.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),sn(l,"redraw")}}function bn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function xn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!E(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),O(t.display.measure,A("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function wn(e,t){for(var n=ft(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function _n(e){return e.lineSpace.offsetTop}function kn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Cn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=O(e.measure,A("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Sn(e){return H-e.display.nativeBarWidth}function Mn(e){return e.display.scroller.clientWidth-Sn(e)-e.display.barWidth}function Ln(e){return e.display.scroller.clientHeight-Sn(e)-e.display.barHeight}function Tn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(fe(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function On(e,t,n,r){return En(e,Pn(e,t),n,r)}function An(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[sr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Pn(e,t){var n=fe(t),r=An(e,n);r&&!r.text?r=null:r&&r.changes&&(cn(e,r,n,nr(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=fe(t=Be(t)),r=e.display.externalMeasured=new nn(e.doc,t,n);r.lineN=n;var i=r.built=Xt(e,r);return r.text=i.pre,O(e.display.lineMeasure,i.pre),r}(e,t));var i=Tn(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function En(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,i=r&&Mn(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=Nn(t.map,n,r),a=o.node,c=o.start,u=o.end,d=o.collapse;if(3==a.nodeType){for(var f=0;f<4;f++){for(;c&&oe(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&oe(t.line.text.charAt(o.coverStart+u));)++u;if((i=s&&l<9&&0==c&&u==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():In(M(a,c,u).getClientRects(),r)).left||i.right||0==c)break;u=c,c-=1,d="right"}s&&l<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=kt)return kt;var t=O(e,A("span","x")),n=t.getBoundingClientRect(),r=M(t,0,1).getBoundingClientRect();return kt=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var h;c>0&&(d=r="right"),i=e.options.lineWrapping&&(h=a.getClientRects()).length>1?h["right"==r?h.length-1:0]:a.getBoundingClientRect()}if(s&&l<9&&!c&&(!i||!i.left&&!i.right)){var p=a.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+tr(e.display),top:p.top,bottom:p.bottom}:jn}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var x=b?y[b-1]:0,w=y[b],_={left:("right"==d?i.right:i.left)-t.rect.left,right:("left"==d?i.left:i.right)-t.rect.left,top:x,bottom:w};return i.left||i.right||(_.bogus=!0),e.options.singleCursorHeightPerLine||(_.rtop=m,_.rbottom=g),_}(e,t,n,r)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Dn,jn={left:0,right:0,top:0,bottom:0};function Nn(e,t,n){for(var r,i,o,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(i=0,o=1,a="left"):t<l?o=1+(i=t-s):(c==e.length-3||t==l&&e[c+3]>t)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function In(e,t){var n=jn;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Rn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function zn(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Rn(e.display.view[t])}function Fn(e){zn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Wn(){return d&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Bn(){return d&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Hn(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=xn(e.widgets[n]));return t}function qn(e,t,n,r,i){if(!i){var o=Hn(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=Ve(t);if("local"==r?a+=_n(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Bn());var l=s.left+("window"==r?0:Wn());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function Un(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Wn(),i-=Bn();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Kn(e,t,n,r,i){return r||(r=le(e.doc,t.line)),qn(e,r,On(e,r,t.ch,i),n)}function Vn(e,t,n,r,i,o){function a(t,a){var s=En(e,i,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,qn(e,r,s,n)}r=r||le(e.doc,t.line),i||(i=Pn(e,r));var s=Ye(r,e.doc.direction),l=t.ch,c=t.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){var r=1==s[t].level;return a(n?e-1:e,r!=n)}var d=Xe(s,l,c),f=Je,h=u(l,d,"before"==c);return null!=f&&(h.other=u(l,f,"before"!=c)),h}function $n(e,t){var n=0;t=ke(e.doc,t),e.options.lineWrapping||(n=tr(e.display)*t.ch);var r=le(e.doc,t.line),i=Ve(r)+_n(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Gn(e,t,n,r,i){var o=ge(e,t,n);return o.xRel=i,r&&(o.outside=!0),o}function Jn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Gn(r.first,0,null,!0,-1);var i=he(r,n),o=r.first+r.size-1;if(i>o)return Gn(r.first+r.size-1,le(r,o).text.length,null,!0,1);t<0&&(t=0);for(var a=le(r,i);;){var s=Qn(e,a,i,t,n),l=Fe(a),c=l&&l.find(0,!0);if(!l||!(s.ch>c.from.ch||s.ch==c.from.ch&&s.xRel>0))return s;i=fe(a=c.to.line)}}function Xn(e,t,n,r){r-=Hn(t);var i=t.text.length,o=se(function(t){return En(e,n,t-1).bottom<=r},i,0);return{begin:o,end:i=se(function(t){return En(e,n,t).top>r},o,i)}}function Zn(e,t,n,r){return n||(n=Pn(e,t)),Xn(e,t,n,qn(e,t,En(e,n,r),"line").top)}function Yn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Qn(e,t,n,r,i){i-=Ve(t);var o=Pn(e,t),a=Hn(t),s=0,l=t.text.length,c=!0,u=Ye(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?function(e,t,n,r,i,o,a){var s=Xn(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,f=0;f<i.length;f++){var h=i[f];if(!(h.from>=c||h.to<=l)){var p=En(e,r,1!=h.level?Math.min(c,h.to)-1:Math.max(l,h.from)).right,m=p<o?o-p+1e9:p-o;(!u||d>m)&&(u=h,d=m)}}return u||(u=i[i.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}:function(e,t,n,r,i,o,a){var s=se(function(s){var l=i[s],c=1!=l.level;return Yn(Vn(e,ge(n,c?l.to:l.from,c?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=Vn(e,ge(n,c?l.from:l.to,c?"after":"before"),"line",t,r);Yn(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l})(e,t,n,o,u,r,i);s=(c=1!=d.level)?d.from:d.to-1,l=c?d.to:d.from-1}var f,h,p=null,m=null,g=se(function(t){var n=En(e,o,t);return n.top+=a,n.bottom+=a,!!Yn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,m=n),!0)},s,l),v=!1;if(m){var y=r-m.left<m.right-r,b=y==c;g=p+(b?0:1),h=b?"after":"before",f=y?m.left:m.right}else{c||g!=l&&g!=s||g++,h=0==g?"after":g==t.text.length?"before":En(e,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var x=Vn(e,ge(n,g,h),"line",t,o);f=x.left,v=i<x.top||i>=x.bottom}return Gn(n,g=ae(t.text,g,1),h,v,r-f)}function er(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Dn){Dn=A("pre");for(var t=0;t<49;++t)Dn.appendChild(document.createTextNode("x")),Dn.appendChild(A("br"));Dn.appendChild(document.createTextNode("x"))}O(e.measure,Dn);var n=Dn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function tr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t]);O(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function nr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.clientWidth;return{fixedPos:rr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function rr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ir(e){var t=er(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/tr(e.display)-3);return function(i){if(Ue(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function or(e){var t=e.doc,n=ir(e);t.iter(function(e){var t=n(e);t!=e.height&&de(e,t)})}function ar(e,t,n,r){var i=e.display;if(!n&&"true"==ft(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(t){return null}var l,c=Jn(e,o,a);if(r&&1==c.xRel&&(l=le(e.doc,c.line).text).length==c.ch){var u=F(l,l.length,e.options.tabSize)-l.length;c=ge(c.line,Math.max(0,Math.round((o-Cn(e.display).left)/tr(e.display))-u))}return c}function sr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function lr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function cr(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&ur(e,s.head,i),l||fr(e,s,o)}}return r}function ur(e,t,n){var r=Vn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(A("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function dr(e,t){return e.top-t.top||e.left-t.left}function fr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Cn(e.display),s=a.left,l=Math.max(r.sizerWidth,Mn(e)-r.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(r-t)+"px"))}function d(t,n,r){var o,a,d=le(i,t),f=d.text.length;function h(n,r){return Kn(e,ge(t,n),"div",d,r)}function p(t,n,r){var i=Zn(e,d,null,t),o="ltr"==n==("after"==r)?"left":"right";return h("after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),o)[o]}var m=Ye(d,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?f:r,function(e,t,i,d){var g="ltr"==i,v=h(e,g?"left":"right"),y=h(t-1,g?"right":"left"),b=null==n&&0==e,x=null==r&&t==f,w=0==d,_=!m||d==m.length-1;if(y.top-v.top<=3){var k=(c?x:b)&&_,C=(c?b:x)&&w?s:(g?v:y).left,S=k?l:(g?y:v).right;u(C,v.top,S-C,v.bottom)}else{var M,L,T,O;g?(M=c&&b&&w?s:v.left,L=c?l:p(e,i,"before"),T=c?s:p(t,i,"after"),O=c&&x&&_?l:y.right):(M=c?p(e,i,"before"):s,L=!c&&b&&w?l:v.right,T=!c&&x&&_?s:y.left,O=c?p(t,i,"after"):l),u(M,v.top,L-M,v.bottom),v.bottom<y.top&&u(s,v.bottom,null,y.top),u(T,y.top,O-T,y.bottom)}(!o||dr(v,o)<0)&&(o=v),dr(y,o)<0&&(o=y),(!a||dr(v,a)<0)&&(a=v),dr(y,a)<0&&(a=y)}),{start:o,end:a}}var f=t.from(),h=t.to();if(f.line==h.line)d(f.line,f.ch,h.ch);else{var p=le(i,f.line),m=le(i,h.line),g=Be(p)==Be(m),v=d(f.line,f.ch,g?p.text.length+1:null).end,y=d(h.line,g?0:null,h.ch).start;g&&(v.top<y.top-2?(u(v.right,v.top,null,v.bottom),u(s,y.top,y.left,y.bottom)):u(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&u(s,v.bottom,null,y.top)}n.appendChild(o)}function hr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function pr(e){e.state.focused||(e.display.input.focus(),gr(e))}function mr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,vr(e))},100)}function gr(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,j(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),c&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),hr(e))}function vr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(rt(e,"blur",e,t),e.state.focused=!1,L(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function yr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=void 0;if(!i.hidden){if(s&&l<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-n,n=a}else{var c=i.node.getBoundingClientRect();o=c.bottom-c.top}var u=i.line.height-o;if(o<2&&(o=er(t)),(u>.005||u<-.005)&&(de(i.line,o),br(i.line),i.rest))for(var d=0;d<i.rest.length;d++)br(i.rest[d])}}}function br(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function xr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-_n(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=he(t,r),a=he(t,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?(o=s,a=he(t,Ve(le(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(o=he(t,Ve(le(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function wr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=rr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function _r(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=me(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(A("div",[A("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",si(e),!0}return!1}function kr(e,t){var n=e.display,r=er(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Ln(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+kn(n),l=t.top<r,c=t.bottom>s-r;if(t.top<i)a.scrollTop=l?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,f=Mn(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>f+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function Cr(e,t){null!=t&&(Lr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Sr(e){Lr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Mr(e,t,n){null==t&&null==n||Lr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Lr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Tr(e,$n(e,t.from),$n(e,t.to),t.margin))}function Tr(e,t,n,r){var i=kr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Mr(e,i.scrollLeft,i.scrollTop)}function Or(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||ai(e,{top:t}),Ar(e,t,!0),n&&ai(e),ti(e,100))}function Ar(e,t,n){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Pr(e,t,n,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,wr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Er(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+kn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Dr=function(e,t,n){this.cm=n;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),et(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),et(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Dr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Dr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Dr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Dr.prototype.zeroWidthHack=function(){var e=b&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new W,this.disableVert=new W},Dr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)})},Dr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var jr=function(){};function Nr(e,t){t||(t=Er(e));var n=e.display.barWidth,r=e.display.barHeight;Ir(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&yr(e),Ir(e,Er(e)),n=e.display.barWidth,r=e.display.barHeight}function Ir(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}jr.prototype.update=function(){return{bottom:0,right:0}},jr.prototype.setScrollLeft=function(){},jr.prototype.setScrollTop=function(){},jr.prototype.clear=function(){};var Rr={native:Dr,null:jr};function zr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&L(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Rr[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),et(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?Pr(e,t):Or(e,t)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var Fr=0;function Wr(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:++Fr},t=e.curOp,on?on.ops.push(t):t.ownsGroup=on={ops:[t],delayedCallbacks:[]}}function Br(e){!function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{on=null,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)Hr(t[n]);for(var r=0;r<t.length;r++)(i=t[r]).updatedDisplay=i.mustUpdate&&ii(i.cm,i.update);for(var i,o=0;o<t.length;o++)qr(t[o]);for(var a=0;a<t.length;a++)Ur(t[a]);for(var s=0;s<t.length;s++)Kr(t[s])}(e)}(n)}}(e.curOp)}function Hr(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Sn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Sn(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Ge(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ri(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function qr(e){var t=e.cm,n=t.display;e.updatedDisplay&&yr(t),e.barMeasure=Er(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=On(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Mn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Ur(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Pr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==D();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Nr(t,e.barMeasure),e.updatedDisplay&&li(t,e.barMeasure),e.selectionChanged&&hr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&pr(e.cm)}function Kr(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&oi(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Ar(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Pr(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!it(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!m){var o=A("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-_n(e.display))+"px;\n height: "+(t.bottom-t.top+Sn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?ge(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ge(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=Vn(e,t),l=n&&n!=t?Vn(e,n):s,c=kr(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Or(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Pr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}(t,ke(r,e.scrollToPos.from),ke(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||rt(i[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&rt(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&rt(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Vr(e,t){if(e.curOp)return t();Wr(e);try{return t()}finally{Br(e)}}function $r(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Wr(e);try{return t.apply(e,arguments)}finally{Br(e)}}}function Gr(e){return function(){if(this.curOp)return e.apply(this,arguments);Wr(this);try{return e.apply(this,arguments)}finally{Br(this)}}}function Jr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Wr(t);try{return e.apply(this,arguments)}finally{Br(t)}}}function Xr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Me&&He(e.doc,t)<i.viewTo&&Yr(e);else if(n<=i.viewFrom)Me&&qe(e.doc,n+r)>i.viewFrom?Yr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Yr(e);else if(t<=i.viewFrom){var o=Qr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Yr(e)}else if(n>=i.viewTo){var a=Qr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Yr(e)}else{var s=Qr(e,t,t,-1),l=Qr(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(rn(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Yr(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function Zr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[sr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==B(a,n)&&a.push(n)}}}function Yr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Qr(e,t,n,r){var i,o=sr(e,t),a=e.display.view;if(!Me||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;He(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function ei(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function ti(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,R(ni,e))}function ni(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Rt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Ot(t.mode,r.state):null,l=Nt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f];d&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&zt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ti(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Vr(e,function(){for(var t=0;t<i.length;t++)Zr(e,i[t],"text")})}}var ri=function(e,t,n){var r=e.display;this.viewport=t,this.visible=xr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Mn(e),this.force=n,this.dims=nr(e),this.events=[]};function ii(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Yr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==ei(e))return!1;_r(e)&&(Yr(e),t.dims=nr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Me&&(o=He(e.doc,o),a=qe(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=rn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=rn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(sr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(rn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,sr(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=Ve(le(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=ei(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=D();if(!t||!E(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&E(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return l>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return c&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var l=r.view,u=r.viewFrom,d=0;d<l.length;d++){var f=l[d];if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;a!=f.node;)a=s(a);var h=i&&null!=t&&t<=u&&f.lineNumber;f.changes&&(B(f.changes,"gutter")>-1&&(h=!1),cn(e,f,u,n)),h&&(T(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(me(e.options,u)))),a=f.node.nextSibling}else{var p=gn(e,f,u,n);o.insertBefore(p,a)}u+=f.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=D()&&(e.activeElt.focus(),e.anchorNode&&E(document.body,e.anchorNode)&&E(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ti(e,400)),n.updateLineNumbers=null,!0}function oi(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Mn(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+kn(e.display)-Ln(e),n.top)}),t.visible=xr(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ii(e,t);r=!1){yr(e);var i=Er(e);lr(e),Nr(e,i),li(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ai(e,t){var n=new ri(e,t);if(ii(e,n)){yr(e),oi(e,n);var r=Er(e);lr(e),Nr(e,r),li(e,r),n.finish()}}function si(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function li(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+Sn(e)+"px"}function ci(e){var t=e.display.gutters,n=e.options.gutters;T(t);for(var r=0;r<n.length;++r){var i=n[r],o=t.appendChild(A("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",si(e)}function ui(e){var t=B(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}ri.prototype.signal=function(e,t){at(e,t)&&this.events.push(arguments)},ri.prototype.finish=function(){for(var e=0;e<this.events.length;e++)rt.apply(null,this.events[e])};var di=0,fi=null;function hi(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function pi(e,t){var r=hi(t),i=r.x,o=r.y,a=e.display,s=a.scroller,l=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&l||o&&u){if(o&&b&&c)e:for(var d=t.target,h=a.view;d!=s;d=d.parentNode)for(var p=0;p<h.length;p++)if(h[p].node==d){e.display.currentWheelTarget=d;break e}if(i&&!n&&!f&&null!=fi)return o&&u&&Or(e,Math.max(0,s.scrollTop+o*fi)),Pr(e,Math.max(0,s.scrollLeft+i*fi)),(!o||o&&u)&<(t),void(a.wheelStartX=null);if(o&&null!=fi){var m=o*fi,g=e.doc.scrollTop,v=g+a.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):v=Math.min(e.doc.height,v+m+50),ai(e,{top:g,bottom:v})}di<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout(function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(fi=(fi*di+n)/(di+1),++di)}},200)):(a.wheelDX+=i,a.wheelDY+=o))}}s?fi=-.53:n?fi=15:d?fi=-.7:h&&(fi=-1/3);var mi=function(e,t){this.ranges=e,this.primIndex=t};mi.prototype.primary=function(){return this.ranges[this.primIndex]},mi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!ye(n.anchor,r.anchor)||!ye(n.head,r.head))return!1}return!0},mi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new gi(be(this.ranges[t].anchor),be(this.ranges[t].head));return new mi(e,this.primIndex)},mi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},mi.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ve(t,r.from())>=0&&ve(e,r.to())<=0)return n}return-1};var gi=function(e,t){this.anchor=e,this.head=t};function vi(e,t){var n=e[t];e.sort(function(e,t){return ve(e.from(),t.from())}),t=B(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(ve(o.to(),i.from())>=0){var a=we(o.from(),i.from()),s=xe(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;r<=t&&--t,e.splice(--r,2,new gi(l?s:a,l?a:s))}}return new mi(e,t)}function yi(e,t){return new mi([new gi(e,t||e)],0)}function bi(e){return e.text?ge(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function xi(e,t){if(ve(e,t.from)<0)return e;if(ve(e,t.to)<=0)return bi(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=bi(t).ch-t.to.ch),ge(n,r)}function wi(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new gi(xi(i.anchor,t),xi(i.head,t)))}return vi(n,e.sel.primIndex)}function _i(e,t,n){return e.line==t.line?ge(n.line,e.ch-t.ch+n.ch):ge(n.line+(e.line-t.line),e.ch)}function ki(e){e.doc.mode=Lt(e.options,e.doc.modeOption),Ci(e)}function Ci(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ti(e,100),e.state.modeGen++,e.curOp&&Xr(e)}function Si(e,t){return 0==t.from.ch&&0==t.to.ch&&""==X(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Mi(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ee(e),De(e,n);var i=r?r(e):1;i!=e.height&&de(e,i)}(e,n,i,r),sn(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new Kt(c[o],i(o),r));return n}var s=t.from,l=t.to,c=t.text,u=le(e,s.line),d=le(e,l.line),f=X(c),h=i(c.length-1),p=l.line-s.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Si(e,t)){var m=a(0,c.length-1);o(d,d.text,h),p&&e.remove(s.line,p),m.length&&e.insert(s.line,m)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,s.ch)+f+u.text.slice(l.ch),h);else{var g=a(1,c.length-1);g.push(new Kt(f+u.text.slice(l.ch),h,r)),o(u,u.text.slice(0,s.ch)+c[0],i(0)),e.insert(s.line+1,g)}else if(1==c.length)o(u,u.text.slice(0,s.ch)+c[0]+d.text.slice(l.ch),i(0)),e.remove(s.line+1,p);else{o(u,u.text.slice(0,s.ch)+c[0],i(0)),o(d,f+d.text.slice(l.ch),h);var v=a(1,c.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,v)}sn(e,"change",e,t)}function Li(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;a<r.linked.length;++a){var s=r.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;n&&!l||(t(s.doc,l),e(s.doc,r,l))}}}(e,null,!0)}function Ti(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,or(e),ki(e),Oi(e),e.options.lineWrapping||Ge(e),e.options.mode=t.modeOption,Xr(e)}function Oi(e){("rtl"==e.doc.direction?j:L)(e.display.lineDiv,"CodeMirror-rtl")}function Ai(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Pi(e,t){var n={from:be(t.from),to:bi(t),text:ce(e,t.from,t.to)};return Ni(e,n,t.from.line,t.to.line+1),Li(e,function(e){return Ni(e,n,t.from.line,t.to.line+1)},!0),n}function Ei(e){for(;e.length&&X(e).ranges;)e.pop()}function Di(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=function(e,t){return i.lastOp==r?(Ei(e.done),X(e.done)):e.done.length&&!X(e.done).ranges?X(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),X(e.done)):void 0}(i)))a=X(o.changes),0==ve(t.from,t.to)&&0==ve(t.from,a.to)?a.to=bi(t):o.changes.push(Pi(e,t));else{var l=X(i.done);for(l&&l.ranges||ji(e.sel,i.done),o={changes:[Pi(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||rt(e,"historyAdded")}function ji(e,t){var n=X(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ni(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function Ii(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Ri(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Ii(n[i]));return r}(e,t),r=Ae(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else a&&(n[i]=a)}return n}function zi(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?mi.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&B(t,Number(u[1]))>-1&&(X(s)[d]=c[d],delete c[d])}}}return r}function Fi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ve(t,i)<0;o!=ve(n,i)<0?(i=t,t=n):o!=ve(t,n)<0&&(t=n)}return new gi(i,t)}return new gi(n||t,t)}function Wi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ki(e,new mi([Fi(e.sel.primary(),t,n,i)],0),r)}function Bi(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Fi(e.sel.ranges[o],t[o],null,i);Ki(e,vi(r,e.sel.primIndex),n)}function Hi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Ki(e,vi(i,e.sel.primIndex),r)}function qi(e,t,n,r){Ki(e,yi(t,n),r)}function Ui(e,t,n){var r=e.history.done,i=X(r);i&&i.ranges?(r[r.length-1]=t,Vi(e,t,n)):Ki(e,t,n)}function Ki(e,t,n){Vi(e,t,n),function(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,X(i.done),t))?i.done[i.done.length-1]=t:ji(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Ei(i.undone)}(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Vi(e,t,n){(at(e,"beforeSelectionChange")||e.cm&&at(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new gi(ke(e,t[n].anchor),ke(e,t[n].head))},origin:n&&n.origin};return rt(e,"beforeSelectionChange",e,r),e.cm&&rt(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?vi(r.ranges,r.ranges.length-1):t}(e,t,n)),$i(e,Ji(e,t,n&&n.bias||(ve(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),n&&!1===n.scroll||!e.cm||Sr(e.cm)}function $i(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,ot(e.cm)),sn(e,"cursorActivity",e))}function Gi(e){$i(e,Ji(e,e.sel,null,!1))}function Ji(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=Zi(e,a.anchor,s&&s.anchor,n,r),c=Zi(e,a.head,s&&s.head,n,r);(i||l!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new gi(l,c))}return i?vi(i,t.primIndex):t}function Xi(e,t,n,r,i){var o=le(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker;if((null==s.from||(l.inclusiveLeft?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(l.inclusiveRight?s.to>=t.ch:s.to>t.ch))){if(i&&(rt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var c=l.find(r<0?1:-1),u=void 0;if((r<0?l.inclusiveRight:l.inclusiveLeft)&&(c=Yi(e,c,-r,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=ve(c,n))&&(r<0?u<0:u>0))return Xi(e,c,t,r,i)}var d=l.find(r<0?-1:1);return(r<0?l.inclusiveLeft:l.inclusiveRight)&&(d=Yi(e,d,r,d.line==t.line?o:null)),d?Xi(e,d,t,r,i):null}}return t}function Zi(e,t,n,r,i){var o=r||1;return Xi(e,t,n,o,i)||!i&&Xi(e,t,n,o,!0)||Xi(e,t,n,-o,i)||!i&&Xi(e,t,n,-o,!0)||(e.cantEdit=!0,ge(e.first,0))}function Yi(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ke(e,ge(t.line-1)):null:n>0&&t.ch==(r||le(e,t.line)).text.length?t.line<e.first+e.size-1?ge(t.line+1,0):null:new ge(t.line,t.ch+n)}function Qi(e){e.setSelection(ge(e.firstLine(),0),ge(e.lastLine()),U)}function eo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=ke(e,t)),n&&(r.to=ke(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),rt(e,"beforeChange",e,r),e.cm&&rt(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function to(e,t,n){if(e.cm){if(!e.cm.curOp)return $r(e.cm,to)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(at(e,"beforeChange")||e.cm&&at(e.cm,"beforeChange"))||(t=eo(e,t,!0))){var r=Se&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=B(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var c=i[l];if(!(ve(c.to,s.from)<0||ve(c.from,s.to)>0)){var u=[l,1],d=ve(c.from,s.from),f=ve(c.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)no(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else no(e,t)}}function no(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ve(t.from,t.to)){var n=wi(e,t);Di(e,t,n,e.cm?e.cm.curOp.id:NaN),oo(e,t,n,Ae(e,t));var r=[];Li(e,function(e,n){n||-1!=B(r,e.history)||(co(e.history,t),r.push(e.history)),oo(e,t,null,Ae(e,t))})}}function ro(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c<s.length&&(i=s[c],n?!i.ranges||i.equals(e.sel):i.ranges);c++);if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if(ji(i,l),n&&!i.equals(e.sel))return void Ki(e,i,{clearRedo:!1});a=i}var u=[];ji(a,l),l.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var d=at(e,"beforeChange")||e.cm&&at(e.cm,"beforeChange"),f=function(n){var r=i.changes[n];if(r.origin=t,d&&!eo(e,r,!1))return s.length=0,{};u.push(Pi(e,r));var o=n?wi(e,r):X(s);oo(e,r,o,Ri(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:bi(r)});var a=[];Li(e,function(e,t){t||-1!=B(a,e.history)||(co(e.history,r),a.push(e.history)),oo(e,r,null,Ri(e,r))})},h=i.changes.length-1;h>=0;--h){var p=f(h);if(p)return p.v}}}}function io(e,t){if(0!=t&&(e.first+=t,e.sel=new mi(Z(e.sel.ranges,function(e){return new gi(ge(e.anchor.line+t,e.anchor.ch),ge(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Xr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Zr(e.cm,r,"gutter")}}function oo(e,t,n,r){if(e.cm&&!e.cm.curOp)return $r(e.cm,oo)(e,t,n,r);if(t.to.line<e.first)io(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);io(e,i),t={from:ge(e.first,0),to:ge(t.to.line+i,t.to.ch),text:[X(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ge(o,le(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ce(e,t.from,t.to),n||(n=wi(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=fe(Be(le(r,o.line))),r.iter(l,a.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ot(e),Mi(r,t,n,ir(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,function(e){var t=$e(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=le(e,r).stateAfter;if(i&&(!(i instanceof Dt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,o.line),ti(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?Xr(e):o.line!=a.line||1!=t.text.length||Si(e.doc,t)?Xr(e,o.line,a.line+1,c):Zr(e,o.line,"text");var u=at(e,"changes"),d=at(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&sn(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,r):Mi(e,t,r),Vi(e,n,U)}}function ao(e,t,n,r,i){var o;r||(r=n),ve(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),to(e,{from:n,to:r,text:t,origin:i})}function so(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function lo(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)so(o.ranges[s].anchor,t,n,r),so(o.ranges[s].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(n<c.from.line)c.from=ge(c.from.line+r,c.from.ch),c.to=ge(c.to.line+r,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function co(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;lo(e.done,n,r,i),lo(e.undone,n,r,i)}function uo(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=le(e,_e(e,t)):i=fe(t),null==i?null:(r(o,i)&&e.cm&&Zr(e.cm,i,n),o)}function fo(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function ho(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}gi.prototype.from=function(){return we(this.anchor,this.head)},gi.prototype.to=function(){return xe(this.anchor,this.head)},gi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},fo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Vt(i),sn(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},ho.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof fo))){var s=[];this.collapse(s),this.children=[new fo(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var l=new fo(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++r,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new ho(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=B(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new ho(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var po=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function mo(e,t,n){Ve(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Cr(e,n)}po.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=fe(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=xn(this);de(n,Math.max(0,n.height-o)),e&&(Vr(e,function(){mo(e,n,-o),Zr(e,r,"widget")}),sn(e,"lineWidgetCleared",e,this,r))}},po.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=xn(this)-t;i&&(de(r,r.height+i),n&&Vr(n,function(){n.curOp.forceUpdate=!0,mo(n,r,i),sn(n,"lineWidgetChanged",n,e,fe(r))}))},st(po);var go=0,vo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++go};function yo(e,t,n,r,i){if(r&&r.shared)return function(e,t,n,r,i){(r=z(r)).shared=!1;var o=[yo(e,t,n,r,i)],a=o[0],s=r.widgetNode;return Li(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(yo(e,ke(e,t),ke(e,n),r,i));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=X(o)}),new bo(o,a)}(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return $r(e.cm,yo)(e,t,n,r,i);var o=new vo(e,i),a=ve(t,n);if(r&&z(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=P("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(We(e,t.line,t,n,o)||t.line!=n.line&&We(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Me=!0}o.addToHistory&&Di(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&Be(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&de(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Le(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(t){Ue(e,t)&&de(t,0)}),o.clearOnEnter&&et(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Se=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++go,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Xr(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=n.line;u++)Zr(c,u,"text");o.atomic&&Gi(c.doc),sn(c,"markerAdded",c,o)}return o}vo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Wr(e),at(this,"clear")){var n=this.find();n&&sn(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=Te(a.markedSpans,this);e&&!this.collapsed?Zr(e,fe(a),"text"):e&&(null!=s.to&&(i=fe(a)),null!=s.from&&(r=fe(a))),a.markedSpans=Oe(a.markedSpans,s),null==s.from&&this.collapsed&&!Ue(this.doc,a)&&e&&de(a,er(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Be(this.lines[l]),u=$e(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Xr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gi(e.doc)),e&&sn(e,"markerCleared",e,this,r,i),t&&Br(e),this.parent&&this.parent.clear()}},vo.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Te(o.markedSpans,this);if(null!=a.from&&(n=ge(t?o:fe(o),a.from),-1==e))return n;if(null!=a.to&&(r=ge(t?o:fe(o),a.to),1==e))return r}return n&&{from:n,to:r}},vo.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Vr(r,function(){var i=t.line,o=fe(t.line),a=An(r,o);if(a&&(Rn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Ue(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var l=xn(n)-s;l&&de(i,i.height+l)}sn(r,"markerChanged",r,e)})},vo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=B(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},vo.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},st(vo);var bo=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function xo(e){return e.findMarks(ge(e.first,0),e.clipPos(ge(e.lastLine())),function(e){return e.parent})}function wo(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Li(n.primary.doc,function(e){return r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==B(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}bo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sn(this,"clear")}},bo.prototype.find=function(e,t){return this.primary.find(e,t)},st(bo);var _o=0,ko=function e(t,n,r,i,o){if(!(this instanceof e))return new e(t,n,r,i,o);null==r&&(r=0),ho.call(this,[new fo([new Kt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var a=ge(r,0);this.sel=yi(a),this.history=new Ai(null),this.id=++_o,this.modeOption=n,this.lineSep=i,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),Mi(this,{from:a,to:a,text:t}),Ki(this,yi(a),U)};ko.prototype=Q(ho.prototype,{constructor:ko,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ue(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Jr(function(e){var t=ge(this.first,0),n=this.first+this.size-1;to(this,{from:t,to:ge(n,le(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Mr(this.cm,0,0),Ki(this,yi(t),U)}),replaceRange:function(e,t,n,r){ao(this,e,t=ke(this,t),n=n?ke(this,n):t,r)},getRange:function(e,t,n){var r=ce(this,ke(this,e),ke(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(pe(this,e))return le(this,e)},getLineNumber:function(e){return fe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=le(this,e)),Be(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ke(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Jr(function(e,t,n){qi(this,ke(this,"number"==typeof e?ge(e,t||0):e),null,n)}),setSelection:Jr(function(e,t,n){qi(this,ke(this,e),ke(this,t||e),n)}),extendSelection:Jr(function(e,t,n){Wi(this,ke(this,e),t&&ke(this,t),n)}),extendSelections:Jr(function(e,t){Bi(this,Ce(this,e),t)}),extendSelectionsBy:Jr(function(e,t){Bi(this,Ce(this,Z(this.sel.ranges,e)),t)}),setSelections:Jr(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new gi(ke(this,e[i].anchor),ke(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Ki(this,vi(r,t),n)}}),addSelection:Jr(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new gi(ke(this,e),ke(this,t||e))),Ki(this,vi(r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=ce(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=ce(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Jr(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var s=t&&"end"!=t&&function(e,t,n){for(var r=[],i=ge(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],l=_i(s.from,i,o),c=_i(bi(s),i,o);if(i=s.to,o=c,"around"==n){var u=e.sel.ranges[a],d=ve(u.head,u.anchor)<0;r[a]=new gi(d?c:l,d?l:c)}else r[a]=new gi(l,l)}return new mi(r,e.sel.primIndex)}(this,r,t),l=r.length-1;l>=0;l--)to(this,r[l]);s?Ui(this,s):this.cm&&Sr(this.cm)}),undo:Jr(function(){ro(this,"undo")}),redo:Jr(function(){ro(this,"redo")}),undoSelection:Jr(function(){ro(this,"undo",!0)}),redoSelection:Jr(function(){ro(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new Ai(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:zi(this.history.done),undone:zi(this.history.undone)}},setHistory:function(e){var t=this.history=new Ai(this.history.maxGeneration);t.done=zi(e.done.slice(0),null,!0),t.undone=zi(e.undone.slice(0),null,!0)},setGutterMarker:Jr(function(e,t,n){return uo(this,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&re(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Jr(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&uo(t,n,"gutter",function(){return n.gutterMarkers[e]=null,re(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!pe(this,e))return null;if(t=e,!(e=le(this,e)))return null}else if(null==(t=fe(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Jr(function(e,t,n){return uo(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(S(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:Jr(function(e,t,n){return uo(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(S(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),addLineWidget:Jr(function(e,t,n){return function(e,t,n,r){var i=new po(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),uo(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Ue(e,t)){var r=Ve(t)<e.scrollTop;de(t,t.height+xn(i)),r&&Cr(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&sn(o,"lineWidgetAdded",o,i,"number"==typeof t?t:fe(t)),i}(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return yo(this,ke(this,e),ke(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return yo(this,e=ke(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=le(this,(e=ke(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ke(this,e),t=ke(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&i==e.line&&e.ch>=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),ke(this,ge(n,t))},indexFromPos:function(e){var t=(e=ke(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new ko(ue(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new ko(ue(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(ve(o,a)){var s=yo(e,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,xo(this)),r},unlinkDoc:function(e){if(e instanceof ya&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),wo(xo(this));break}if(e.history==this.history){var n=[e.id];Li(e,function(e){return n.push(e.id)},!0),e.history=new Ai(null),e.history.done=zi(this.history.done,n),e.history.undone=zi(this.history.undone,n)}},iterLinkedDocs:function(e){Li(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):xt(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Jr(function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Vr(t=this.cm,function(){Oi(t),Xr(t)}))})}),ko.prototype.eachLine=ko.prototype.iter;var Co=0;function So(e){var t=this;if(Mo(t),!it(t,e)&&!wn(t.display,e)){lt(e),s&&(Co=+new Date);var n=ar(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(e,r){if(!t.options.allowDropFileTypes||-1!=B(t.options.allowDropFileTypes,e.type)){var s=new FileReader;s.onload=$r(t,function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++a==i){var l={from:n=ke(t.doc,n),to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};to(t.doc,l),Ui(t.doc,yi(n,bi(l)))}}),s.readAsText(e)}},c=0;c<i;++c)l(r[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var u=e.dataTransfer.getData("Text");if(u){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),Vi(t.doc,yi(n,n)),d)for(var f=0;f<d.length;++f)ao(t.doc,"",d[f].anchor,d[f].head,"drag");t.replaceSelection(u,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Mo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Lo(e){if(document.getElementsByClassName)for(var t=document.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}var To=!1;function Oo(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}for(var Ao={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Po=0;Po<10;Po++)Ao[Po+48]=Ao[Po+96]=String(Po);for(var Eo=65;Eo<=90;Eo++)Ao[Eo]=String.fromCharCode(Eo);for(var Do=1;Do<=12;Do++)Ao[Do+111]=Ao[Do+63235]="F"+Do;var jo={};function No(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Io(e,t,n,r){var i=(t=Wo(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Io(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Io(e,t.fallthrough[o],n,r);if(a)return a}}}function Ro(e){var t="string"==typeof e?e:Ao[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function zo(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(k?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(k?t.ctrlKey:t.metaKey)&&"Cmd"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Fo(e,t){if(f&&34==e.keyCode&&e.char)return!1;var n=Ao[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),zo(n,e,t))}function Wo(e){return"string"==typeof e?jo[e]:e}function Bo(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&ve(o.from,X(r).to)<=0;){var a=r.pop();if(ve(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Vr(e,function(){for(var t=r.length-1;t>=0;t--)ao(e.doc,"",r[t].from,r[t].to,"+delete");Sr(e)})}function Ho(e,t,n){var r=ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function qo(e,t,n){var r=Ho(e,t.ch,n);return null==r?null:new ge(t.line,r,n<0?"after":"before")}function Uo(e,t,n,r,i){if(e){var o=Ye(n,t.doc.direction);if(o){var a,s=i<0?X(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=Pn(t,n);a=i<0?n.text.length-1:0;var u=En(t,c,a).top;a=se(function(e){return En(t,c,e).top==u},i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Ho(n,a,1))}else a=i<0?s.to:s.from;return new ge(r,a,l)}}return new ge(r,i<0?n.text.length:0,i<0?"before":"after")}jo.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"},jo.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"},jo.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"},jo.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"]},jo.default=b?jo.macDefault:jo.pcDefault;var Ko={selectAll:Qi,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),U)},killLine:function(e){return Bo(e,function(t){if(t.empty()){var n=le(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ge(t.head.line+1,0)}:{from:t.head,to:ge(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Bo(e,function(t){return{from:ge(t.from().line,0),to:ke(e.doc,ge(t.to().line+1,0))}})},delLineLeft:function(e){return Bo(e,function(e){return{from:ge(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return Bo(e,function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}})},delWrappedLineRight:function(e){return Bo(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ge(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ge(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Vo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return $o(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return function(e,t){var n=le(e.doc,t),r=function(e){for(var t;t=Fe(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=fe(r)),Uo(!0,e,n,t,-1)}(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},V)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},V)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?$o(e,t.head):r},V)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=F(e.getLine(o.line),o.ch,r);t.push(J(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Vr(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=le(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ge(i.line,i.ch-1)),i.ch>0)i=new ge(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ge(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=le(e.doc,i.line-1).text;a&&(i=new ge(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ge(i.line-1,a.length-1),i,"+transpose"))}n.push(new gi(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Vr(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Sr(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Vo(e,t){var n=le(e.doc,t),r=Be(n);return r!=n&&(t=fe(r)),Uo(!0,e,r,t,1)}function $o(e,t){var n=Vo(e,t.line),r=le(e.doc,n.line),i=Ye(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return ge(n.line,a?0:o,n.sticky)}return n}function Go(e,t,n){if("string"==typeof t&&!(t=Ko[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=q}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}var Jo=new W;function Xo(e,t,n,r){var i=e.state.keySeq;if(i){if(Ro(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Jo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Zo(e,i+" "+t,n,r))return!0}return Zo(e,t,n,r)}function Zo(e,t,n,r){var i=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Io(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Io(t,e.options.extraKeys,n,e)||Io(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&sn(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(lt(n),hr(e)),!!i}function Yo(e,t){var n=Fo(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?Xo(e,"Shift-"+n,t,function(t){return Go(e,t,!0)})||Xo(e,n,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return Go(e,t)}):Xo(e,n,t,function(t){return Go(e,t)}))}var Qo=null;function ea(e){var t=this;if(t.curOp.focus=D(),!it(t,e)){s&&l<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=Yo(t,e);f&&(Qo=r?n:null,!r&&88==n&&!_t&&(b?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(L(t,"CodeMirror-crosshair"),nt(document,"keyup",n),nt(document,"mouseover",n))}j(t,"CodeMirror-crosshair"),et(document,"keyup",n),et(document,"mouseover",n)}(t)}}function ta(e){16==e.keyCode&&(this.doc.sel.shift=!1),it(this,e)}function na(e){var t=this;if(!(wn(t.display,e)||it(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(f&&n==Qo)return Qo=null,void lt(e);if(!f||e.which&&!(e.which<10)||!Yo(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(e,t,n){return Xo(e,"'"+i+"'",t,function(t){return Go(e,t,!0)})}(t,e)||t.display.input.onKeyPress(e))}}}var ra,ia,oa=function(e,t,n){this.time=e,this.pos=t,this.button=n};function aa(e){var t=this,n=t.display;if(!(it(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,wn(n,e))c||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));else if(!ca(t,e)){var r=ar(t,e),i=ht(e),o=r?function(e,t){var n=+new Date;return ia&&ia.compare(n,e,t)?(ra=ia=null,"triple"):ra&&ra.compare(n,e,t)?(ia=new oa(n,e,t),ra=null,"double"):(ra=new oa(n,e,t),ia=null,"single")}(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),Xo(e,zo(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,function(t){if("string"==typeof t&&(t=Ko[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=q}finally{e.state.suppressEdits=!1}return r})}(t,i,r,o,e)||(1==i?r?function(e,t,n,r){s?setTimeout(R(pr,e),0):e.curOp.focus=D();var i,o=function(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=x?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=b?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(b?n.altKey:n.ctrlKey)),i}(e,n,r),a=e.doc.sel;e.options.dragDrop&>&&!e.isReadOnly()&&"single"==n&&(i=a.contains(t))>-1&&(ve((i=a.ranges[i]).from(),t)<0||t.xRel>0)&&(ve(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,a=$r(e,function(t){c&&(i.scroller.draggable=!1),e.state.draggingText=!1,nt(document,"mouseup",a),nt(document,"mousemove",u),nt(i.scroller,"dragstart",d),nt(i.scroller,"drop",a),o||(lt(t),r.addNew||Wi(e.doc,n,null,null,r.extend),c||s&&9==l?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())}),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};c&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),et(document,"mouseup",a),et(document,"mousemove",u),et(i.scroller,"dragstart",d),et(i.scroller,"drop",a),mr(e),setTimeout(function(){return i.input.focus()},20)}(e,r,t,o):function(e,t,n,r){var i=e.display,o=e.doc;lt(t);var a,s,l=o.sel,c=l.ranges;if(r.addNew&&!r.extend?(s=o.sel.contains(n),a=s>-1?c[s]:new gi(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new gi(n,n)),n=ar(e,t,!0,!0),s=-1;else{var u=sa(e,n,r.unit);a=r.extend?Fi(a,u.anchor,u.head,r.extend):u}r.addNew?-1==s?(s=c.length,Ki(o,vi(c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==r.unit&&!r.extend?(Ki(o,vi(c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Hi(o,s,a,K):(s=0,Ki(o,new mi([a],0),K),l=o.sel);var d=n;function f(t){if(0!=ve(d,t))if(d=t,"rectangle"==r.unit){for(var i=[],c=e.options.tabSize,u=F(le(o,n.line).text,n.ch,c),f=F(le(o,t.line).text,t.ch,c),h=Math.min(u,f),p=Math.max(u,f),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=le(o,m).text,y=$(v,h,c);h==p?i.push(new gi(ge(m,y),ge(m,y))):v.length>y&&i.push(new gi(ge(m,y),ge(m,$(v,p,c))))}i.length||i.push(new gi(n,n)),Ki(o,vi(l.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=a,w=sa(e,t,r.unit),_=x.anchor;ve(w.anchor,_)>0?(b=w.head,_=we(x.from(),w.anchor)):(b=w.anchor,_=xe(x.to(),w.head));var k=l.ranges.slice(0);k[s]=function(e,t){var n=t.anchor,r=t.head,i=le(e.doc,n.line);if(0==ve(n,r)&&n.sticky==r.sticky)return t;var o=Ye(i);if(!o)return t;var a=Xe(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=Xe(o,r.ch,r.sticky),d=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?d<0:d>0}var f=o[c+(l?-1:0)],h=l==(1==f.level),p=h?f.from:f.to,m=h?"after":"before";return n.ch==p&&n.sticky==m?t:new gi(new ge(n.line,p,m),r)}(e,new gi(ke(o,_),b)),Ki(o,vi(k,s),K)}}var h=i.wrapper.getBoundingClientRect(),p=0;function m(t){e.state.selectingText=!1,p=1/0,lt(t),i.input.focus(),nt(document,"mousemove",g),nt(document,"mouseup",v),o.history.lastSelOrigin=null}var g=$r(e,function(t){ht(t)?function t(n){var a=++p,s=ar(e,n,!0,"rectangle"==r.unit);if(s)if(0!=ve(s,d)){e.curOp.focus=D(),f(s);var l=xr(i,o);(s.line>=l.to||s.line<l.from)&&setTimeout($r(e,function(){p==a&&t(n)}),150)}else{var c=n.clientY<h.top?-20:n.clientY>h.bottom?20:0;c&&setTimeout($r(e,function(){p==a&&(i.scroller.scrollTop+=c,t(n))}),50)}}(t):m(t)}),v=$r(e,m);e.state.selectingText=v,et(document,"mousemove",g),et(document,"mouseup",v)}(e,r,t,o)}(t,r,o,e):ft(e)==n.scroller&<(e):2==i?(r&&Wi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):3==i&&(C?ua(t,e):mr(t)))}}function sa(e,t,n){if("char"==n)return new gi(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new gi(ge(t.line,0),ke(e.doc,ge(t.line+1,0)));var r=n(e,t);return new gi(r.from,r.to)}function la(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&<(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!at(e,n))return ut(t);o-=s.top-a.viewOffset;for(var l=0;l<e.options.gutters.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i)return rt(e,n,e,he(e.doc,o),e.options.gutters[l],t),ut(t)}}function ca(e,t){return la(e,t,"gutterClick",!0)}function ua(e,t){wn(e.display,t)||function(e,t){return!!at(e,"gutterContextMenu")&&la(e,t,"gutterContextMenu",!1)}(e,t)||it(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function da(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Fn(e)}oa.prototype.compare=function(e,t,n){return this.time+400>e&&0==ve(t,this.pos)&&n==this.button};var fa={toString:function(){return"CodeMirror.Init"}},ha={},pa={};function ma(e){ci(e),Xr(e),wr(e)}function ga(e,t,n){if(!t!=!(n&&n!=fa)){var r=e.display.dragFunctions,i=t?et:nt;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function va(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(L(e.display.wrapper,"CodeMirror-wrap"),Ge(e)),or(e),Xr(e),Fn(e),setTimeout(function(){return Nr(e)},100)}function ya(e,t){var r=this;if(!(this instanceof ya))return new ya(e,t);this.options=t=t?z(t):{},z(ha,t,!1),ui(t);var i=t.value;"string"==typeof i&&(i=new ko(i,t.mode,null,t.lineSeparator,t.direction)),this.doc=i;var o=new ya.inputStyles[t.inputStyle](this),a=this.display=new function(e,t,r){var i=this;this.input=r,i.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=P("div",null,"CodeMirror-code"),i.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=A("div",null,"CodeMirror-cursors"),i.measure=A("div",null,"CodeMirror-measure"),i.lineMeasure=A("div",null,"CodeMirror-measure"),i.lineSpace=P("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=P("div",[i.lineSpace],"CodeMirror-lines");i.mover=A("div",[o],null,"position: relative"),i.sizer=A("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=A("div",null,null,"position: absolute; height: "+H+"px; width: 1px;"),i.gutters=A("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=A("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=A("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),s&&l<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),c||n&&y||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,r.init(i)}(e,i,o);for(var u in a.wrapper.CodeMirror=this,ci(this),da(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),zr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new W,keySeq:null,specialChars:null},t.autofocus&&!y&&a.input.focus(),s&&l<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(e){var t=e.display;et(t.scroller,"mousedown",$r(e,aa)),et(t.scroller,"dblclick",s&&l<11?$r(e,function(t){if(!it(e,t)){var n=ar(e,t);if(n&&!ca(e,t)&&!wn(e.display,t)){lt(t);var r=e.findWordAt(n);Wi(e.doc,r.anchor,r.head)}}}):function(t){return it(e,t)||lt(t)}),C||et(t.scroller,"contextmenu",function(t){return ua(e,t)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),(r=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}et(t.scroller,"touchstart",function(i){if(!it(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!ca(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),et(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),et(t.scroller,"touchend",function(n){var r=t.activeTouch;if(r&&!wn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!r.prev||o(r,r.prev)?new gi(s,s):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(s):new gi(ge(s.line,0),ke(e.doc,ge(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),lt(n)}i()}),et(t.scroller,"touchcancel",i),et(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Or(e,t.scroller.scrollTop),Pr(e,t.scroller.scrollLeft,!0),rt(e,"scroll",e))}),et(t.scroller,"mousewheel",function(t){return pi(e,t)}),et(t.scroller,"DOMMouseScroll",function(t){return pi(e,t)}),et(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){it(e,t)||dt(t)},over:function(t){it(e,t)||(function(e,t){var n=ar(e,t);if(n){var r=document.createDocumentFragment();ur(e,n,r),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),O(e.display.dragCursor,r)}}(e,t),dt(t))},start:function(t){return function(e,t){if(s&&(!e.state.draggingText||+new Date-Co<100))dt(t);else if(!it(e,t)&&!wn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}(e,t)},drop:$r(e,So),leave:function(t){it(e,t)||Mo(e)}};var a=t.input.getField();et(a,"keyup",function(t){return ta.call(e,t)}),et(a,"keydown",$r(e,ea)),et(a,"keypress",$r(e,na)),et(a,"focus",function(t){return gr(e,t)}),et(a,"blur",function(t){return vr(e,t)})}(this),function(){var e;To||(et(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Lo(Oo)},100))}),et(window,"blur",function(){return Lo(vr)}),To=!0)}(),Wr(this),this.curOp.forceUpdate=!0,Ti(this,i),t.autofocus&&!y||this.hasFocus()?setTimeout(R(gr,this),20):vr(this),pa)pa.hasOwnProperty(u)&&pa[u](r,t[u],fa);_r(this),t.finishInit&&t.finishInit(this);for(var d=0;d<ba.length;++d)ba[d](r);Br(this),c&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}ya.defaults=ha,ya.optionHandlers=pa;var ba=[];function xa(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=Rt(e,t).state:n="prev");var a=e.options.tabSize,s=le(o,t),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==q||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?F(le(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)f+=a,d+="\t";if(f<c&&(d+=J(c-f)),d!=u)return ao(o,d,ge(t,0),ge(t,u.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<u.length){var g=ge(t,u.length);Hi(o,p,new gi(g,g));break}}}ya.defineInitHook=function(e){return ba.push(e)};var wa=null;function _a(e){wa=e}function ka(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a,s=e.state.pasteIncoming||"paste"==i,l=xt(t),c=null;if(s&&r.ranges.length>1)if(wa&&wa.text.join("\n")==t){if(r.ranges.length%wa.text.length==0){c=[];for(var u=0;u<wa.text.length;u++)c.push(o.splitLines(wa.text[u]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=Z(l,function(e){return[e]}));for(var d=r.ranges.length-1;d>=0;d--){var f=r.ranges[d],h=f.from(),p=f.to();f.empty()&&(n&&n>0?h=ge(h.line,h.ch-n):e.state.overwrite&&!s?p=ge(p.line,Math.min(le(o,p.line).text.length,p.ch+X(l).length)):wa&&wa.lineWise&&wa.text.join("\n")==t&&(h=p=ge(h.line,0))),a=e.curOp.updateInput;var m={from:h,to:p,text:c?c[d%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming?"cut":"+input")};to(e.doc,m),sn(e,"inputRead",e,m)}t&&!s&&Sa(e,t),Sr(e),e.curOp.updateInput=a,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Ca(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Vr(t,function(){return ka(t,n,0,null,"paste")}),!0}function Sa(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){a=xa(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(le(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=xa(e,i.head.line,"smart"));a&&sn(e,"electricInput",e,i.head.line)}}}function Ma(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:ge(i,0),head:ge(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function La(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Ta(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return c?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),La(e),t}function Oa(e,t,n,r,i){var o=t,a=n,s=le(e,t.line);function l(r){var o,a;if(null==(o=i?function(e,t,n,r){var i=Ye(t,e.doc.direction);if(!i)return qo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=Xe(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return qo(t,n,r);var s,l=function(e,n){return Ho(t,e instanceof ge?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(s=s||Pn(e,t),Zn(e,t,s,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==r<0,f=l(n,d?1:-1);if(null!=f&&(d?f<=a.to&&f<=u.end:f>=a.from&&f>=u.begin)){var h=d?"before":"after";return new ge(n.line,f,h)}}var p=function(e,t,r){for(var o=function(e,t){return t?new ge(n.line,l(e,1),"before"):new ge(n.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],s=t>0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c<a.to)return o(c,s);if(c=s?a.from:l(a.to,-1),r.begin<=c&&c<r.end)return o(c,s)}},m=p(o+r,r,u);if(m)return m;var g=r>0?u.end:l(u.begin,-1);return null==g||r>0&&g==t.text.length||!(m=p(r>0?0:i.length-1,r,c(g)))?null:m}(e.cm,s,t,n):qo(s,t,n))){if(r||(a=t.line+n)<e.first||a>=e.first+e.size||(t=new ge(a,t.ch,t.sticky),!(s=le(e,a))))return!1;t=Uo(i,e.cm,s,t.line,n)}else t=o;return!0}if("char"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var c=null,u="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||l(!f);f=!1){var h=s.text.charAt(t.ch)||"\n",p=ne(h,d)?"w":u&&"\n"==h?"n":!u||/\s/.test(h)?null:"p";if(!u||f||p||(p="s"),c&&c!=p){n<0&&(n=1,l(),t.sticky="after");break}if(p&&(c=p),n>0&&!l(!f))break}var m=Zi(e,t,o,a,!0);return ye(o,m)&&(m.hitSide=!0),m}function Aa(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*er(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Jn(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Pa=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new W,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ea(e,t){var n=An(e,t.line);if(!n||n.hidden)return null;var r=le(e.doc,t.line),i=Tn(n,r,t.line),o=Ye(r,e.doc.direction),a="left";o&&(a=Xe(o,t.ch)%2?"right":"left");var s=Nn(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Da(e,t){return t&&(e.bad=!0),e}function ja(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Da(e.clipPos(ge(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Na(o,t,n)}}function Na(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!E(r,t))return Da(ge(fe(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?X(e.rest):e.line;return Da(ge(fe(o),o.text.length),i)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?l.map:c[i],a=0;a<o.length;a+=3){var s=o[a+2];if(s==t||s==n){var u=fe(i<0?e.line:e.rest[i]),d=o[a]+r;return(r<0||s!=t)&&(d=o[a+(r?1:0)]),ge(u,d)}}}var d=u(a,s,n);if(d)return Da(d,i);for(var f=s.nextSibling,h=a?a.nodeValue.length-n:0;f;f=f.nextSibling){if(d=u(f,f.firstChild,0))return Da(ge(d.line,d.ch-h),i);h+=f.textContent.length}for(var p=s.previousSibling,m=n;p;p=p.previousSibling){if(d=u(p,p.firstChild,-1))return Da(ge(d.line,d.ch+m),i);m+=p.textContent.length}}Pa.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){if(!it(r,e)){if(r.somethingSelected())_a({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Ma(r);_a({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,U),r.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var o=wa.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=Ta(),s=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),s.value=wa.text.join("\n");var l=document.activeElement;I(s),setTimeout(function(){r.display.lineSpace.removeChild(a),l.focus(),l==i&&n.showPrimarySelection()},50)}}La(i,r.options.spellcheck),et(i,"paste",function(e){it(r,e)||Ca(e,r)||l<=11&&setTimeout($r(r,function(){return t.updateFromDOM()}),20)}),et(i,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),et(i,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),et(i,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),et(i,"touchstart",function(){return n.forceCompositionEnd()}),et(i,"input",function(){t.composing||t.readFromDOMSoon()}),et(i,"copy",o),et(i,"cut",o)},Pa.prototype.prepareSelection=function(){var e=cr(this.cm,!1);return e.focus=this.cm.state.focused,e},Pa.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Pa.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=ja(t,e.anchorNode,e.anchorOffset),s=ja(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=ve(we(a,s),i)||0!=ve(xe(a,s),o)){var l=t.display.view,c=i.line>=t.display.viewFrom&&Ea(t,i)||{node:l[0].measure.map[2],offset:0},u=o.line<t.display.viewTo&&Ea(t,o);if(!u){var d=l[l.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;u={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(c&&u){var h,p=e.rangeCount&&e.getRangeAt(0);try{h=M(c.node,c.offset,u.offset,u.node)}catch(e){}h&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),p&&null==e.anchorNode?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Pa.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Pa.prototype.showMultipleSelections=function(e){O(this.cm.display.cursorDiv,e.cursors),O(this.cm.display.selectionDiv,e.selection)},Pa.prototype.rememberSelection=function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Pa.prototype.selectionInEditor=function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return E(this.div,t)},Pa.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Pa.prototype.blur=function(){this.div.blur()},Pa.prototype.getField=function(){return this.div},Pa.prototype.supportsTouch=function(){return!0},Pa.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Vr(this.cm,function(){return e.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))})},Pa.prototype.selectionChanged=function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Pa.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;if(v&&d&&this.cm.options.gutters.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=ja(t,e.anchorNode,e.anchorOffset),r=ja(t,e.focusNode,e.focusOffset);n&&r&&Vr(t,function(){Ki(t.doc,yi(n,r),U),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Pa.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=ge(a.line-1,le(r.doc,a.line-1).length)),s.ch==le(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=ge(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=sr(r,a.line))?(t=fe(i.view[0].line),n=i.view[0].node):(t=fe(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,c,u=sr(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=fe(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator();function l(){a&&(o+=s,a=!1)}function c(e){e&&(l(),o+=e)}function u(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return void c(n||t.textContent.replace(/\u200b/g,""));var o,d=t.getAttribute("cm-marker");if(d){var f=e.findMarks(ge(r,0),ge(i+1,0),(m=+d,function(e){return e.id==m}));return void(f.length&&(o=f[0].find(0))&&c(ce(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p)$/i.test(t.nodeName);h&&l();for(var p=0;p<t.childNodes.length;p++)u(t.childNodes[p]);h&&(a=!0)}else 3==t.nodeType&&c(t.nodeValue);var m}for(;u(t),t!=n;)t=t.nextSibling;return o}(r,n,c,t,l)),f=ce(r.doc,ge(t,0),ge(l,le(r.doc,l).text.length));d.length>1&&f.length>1;)if(X(d)==X(f))d.pop(),f.pop(),l--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var h=0,p=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);h<v&&m.charCodeAt(h)==g.charCodeAt(h);)++h;for(var y=X(d),b=X(f),x=Math.min(y.length-(1==d.length?h:0),b.length-(1==f.length?h:0));p<x&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==d.length&&1==f.length&&t==a.line)for(;h&&h>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var w=ge(t,h),_=ge(l,f.length?X(f).length-p:0);return d.length>1||d[0]||ve(w,_)?(ao(r.doc,d,w,_,"+input"),!0):void 0},Pa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Pa.prototype.reset=function(){this.forceCompositionEnd()},Pa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Pa.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))},Pa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Vr(this.cm,function(){return Xr(e.cm)})},Pa.prototype.setUneditable=function(e){e.contentEditable="false"},Pa.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||$r(this.cm,ka)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Pa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Pa.prototype.onContextMenu=function(){},Pa.prototype.resetPosition=function(){},Pa.prototype.needsContentAttribute=!0;var Ia=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new W,this.hasSelection=!1,this.composing=null};Ia.prototype.init=function(e){var t=this,n=this,r=this.cm,i=this.wrapper=Ta(),o=this.textarea=i.firstChild;function a(e){if(!it(r,e)){if(r.somethingSelected())_a({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Ma(r);_a({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,U):(n.prevInput="",o.value=t.text.join("\n"),I(o))}"cut"==e.type&&(r.state.cutIncoming=!0)}}e.wrapper.insertBefore(i,e.wrapper.firstChild),g&&(o.style.width="0px"),et(o,"input",function(){s&&l>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),et(o,"paste",function(e){it(r,e)||Ca(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),et(o,"cut",a),et(o,"copy",a),et(e.scroller,"paste",function(t){wn(e,t)||it(r,t)||(r.state.pasteIncoming=!0,n.focus())}),et(e.lineSpace,"selectstart",function(t){wn(e,t)||lt(t)}),et(o,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),et(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ia.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=cr(e);if(e.options.moveInputWithCursor){var i=Vn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Ia.prototype.showSelection=function(e){var t=this.cm.display;O(t.cursorDiv,e.cursors),O(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ia.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&I(this.textarea),s&&l>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&l>=9&&(this.hasSelection=null))}},Ia.prototype.getField=function(){return this.textarea},Ia.prototype.supportsTouch=function(){return!1},Ia.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ia.prototype.blur=function(){this.textarea.blur()},Ia.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ia.prototype.receivedFocus=function(){this.slowPoll()},Ia.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ia.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))})},Ia.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||wt(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(s&&l>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,c=Math.min(r.length,i.length);a<c&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return Vr(t,function(){ka(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ia.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ia.prototype.onKeyPress=function(){s&&l>=9&&(this.hasSelection=null),this.fastPoll()},Ia.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea,o=ar(n,e),a=r.scroller.scrollTop;if(o&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&$r(n,Ki)(n.doc,yi(o),U);var u=i.style.cssText,d=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var h,p=t.wrapper.getBoundingClientRect();i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",c&&(h=window.scrollY),r.input.focus(),c&&window.scrollTo(null,h),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=!0,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),s&&l>=9&&m(),C?(dt(e),et(window,"mouseup",function e(){nt(window,"mouseup",e),setTimeout(g,20)})):setTimeout(g,50)}function m(){if(null!=i.selectionStart){var e=n.somethingSelected(),o=""+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=u,s&&l<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),null!=i.selectionStart){(!s||s&&l<9)&&m();var e=0;r.detectingSelectAll=setTimeout(function o(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?$r(n,Qi)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())},200)}}},Ia.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Ia.prototype.setUneditable=function(){},Ia.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=fa&&i(e,t,n)}:i)}e.defineOption=n,e.Init=fa,n("value","",function(e,t){return e.setValue(t)},!0),n("mode",null,function(e,t){e.doc.modeOption=t,ki(e)},!0),n("indentUnit",2,ki,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(e){Ci(e),Fn(e),Xr(e)},!0),n("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(ge(r,o))}r++});for(var i=n.length-1;i>=0;i--)ao(e.doc,t,n[i],ge(n[i].line,n[i].ch+t.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=fa&&e.refresh()}),n("specialCharPlaceholder",Zt,function(e){return e.refresh()},!0),n("electricChars",!0),n("inputStyle",y?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",function(e){da(e),ma(e)},!0),n("keyMap","default",function(e,t,n){var r=Wo(t),i=n!=fa&&Wo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,va,!0),n("gutters",[],function(e){ui(e.options),ma(e)},!0),n("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?rr(e.display)+"px":"0",e.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(e){return Nr(e)},!0),n("scrollbarStyle","native",function(e){zr(e),Nr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n("lineNumbers",!1,function(e){ui(e.options),ma(e)},!0),n("firstLineNumber",1,ma,!0),n("lineNumberFormatter",function(e){return e},ma,!0),n("showCursorWhenSelecting",!1,lr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("readOnly",!1,function(e,t){"nocursor"==t&&(vr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),n("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),n("dragDrop",!0,ga),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,lr,!0),n("singleCursorHeightPerLine",!0,lr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ci,!0),n("addModeClass",!1,Ci,!0),n("pollInterval",100),n("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),n("historyEventDelay",1250),n("viewportMargin",10,function(e){return e.refresh()},!0),n("maxHighlightLength",1e4,Ci,!0),n("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),n("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),n("autofocus",null),n("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(ya),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&$r(this,t[e])(this,n,i),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"](Wo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Gr(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,Xr(this)}),removeOverlay:Gr(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void Xr(this)}}),indentLine:Gr(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),pe(this.doc,e)&&xa(this,e,t,n)}),indentSelection:Gr(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(xa(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Sr(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)xa(this,l,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&Hi(this.doc,r,new gi(o,c[r].to()),U)}}}),getTokenAt:function(e,t){return Ht(this,e,t)},getLineTokens:function(e,t){return Ht(this,ge(e),t,!0)},getTokenTypeAt:function(e){e=ke(this.doc,e);var t,n=It(this,le(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var s=i[o[t][a]];s&&r.push(s)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var l=0;l<i._global.length;l++){var c=i._global[l];c.pred(o,this)&&-1==B(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return Rt(this,(e=_e(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Vn(this,null==e?n.head:"object"==(void 0===e?"undefined":a(e))?ke(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Kn(this,ke(this.doc,e),t||"page")},coordsChar:function(e,t){return Jn(this,(e=Un(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Un(this,{top:e,left:0},t||"page").top,he(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=le(this.doc,e)}else r=e;return qn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Ve(r):0)},defaultTextHeight:function(){return er(this.display)},defaultCharWidth:function(){return tr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,a,s=this.display,l=(e=Vn(this,ke(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var u=Math.max(s.wrapper.clientHeight,this.doc.height),d=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>u)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=u&&(l=e.bottom),c+t.offsetWidth>d&&(c=d-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(c=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(null!=(a=kr(o=this,{left:c,top:l,right:c+t.offsetWidth,bottom:l+t.offsetHeight})).scrollTop&&Or(o,a.scrollTop),null!=a.scrollLeft&&Pr(o,a.scrollLeft))},triggerOnKeyDown:Gr(ea),triggerOnKeyPress:Gr(na),triggerOnKeyUp:ta,triggerOnMouseDown:Gr(aa),execCommand:function(e){if(Ko.hasOwnProperty(e))return Ko[e].call(null,this)},triggerElectric:Gr(function(e){Sa(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ke(this.doc,e),a=0;a<t&&!(o=Oa(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:Gr(function(e,t){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Oa(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},V)}),deleteH:Gr(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Bo(this,function(n){var i=Oa(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var a=ke(this.doc,e),s=0;s<t;++s){var l=Vn(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Aa(this,l,i,n)).hitSide)break}return a},moveV:Gr(function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return e<0?a.from():a.to();var s=Vn(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var l=Aa(n,s,e,t);return"page"==t&&a==r.sel.primary()&&Cr(n,Kn(n,l,"div").top-s.top),l},V),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=le(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),a=ne(o,i)?function(e){return ne(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ne(e)};n>0&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new gi(ge(e.line,n),ge(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):L(this.display.cursorDiv,"CodeMirror-overwrite"),rt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Gr(function(e,t){Mr(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Sn(this)-this.display.barHeight,width:e.scrollWidth-Sn(this)-this.display.barWidth,clientHeight:Ln(this),clientWidth:Mn(this)}},scrollIntoView:Gr(function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ge(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Lr(e),e.curOp.scrollToPos=t}(this,e):Tr(this,e.from,e.to,e.margin)}),setSize:Gr(function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&zn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Zr(n,i,"widget");break}++i}),this.curOp.forceUpdate=!0,rt(this,"refresh",this)}),operation:function(e){return Vr(this,e)},startOperation:function(){return Wr(this)},endOperation:function(){return Br(this)},refresh:Gr(function(){var e=this.display.cachedTextHeight;Xr(this),this.curOp.forceUpdate=!0,Fn(this),Mr(this,this.doc.scrollLeft,this.doc.scrollTop),si(this),(null==e||Math.abs(e-er(this.display))>.5)&&or(this),rt(this,"refresh",this)}),swapDoc:Gr(function(e){var t=this.doc;return t.cm=null,Ti(this,e),Fn(this),this.display.input.reset(),Mr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sn(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}},st(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(ya);var Ra,za="iter insert remove copy getEditor constructor".split(" ");for(var Fa in ko.prototype)ko.prototype.hasOwnProperty(Fa)&&B(za,Fa)<0&&(ya.prototype[Fa]=function(e){return function(){return e.apply(this.doc,arguments)}}(ko.prototype[Fa]));return st(ko),ya.inputStyles={textarea:Ia,contenteditable:Pa},ya.defineMode=function(e){ya.defaults.mode||"null"==e||(ya.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ct[e]=t}.apply(this,arguments)},ya.defineMIME=function(e,t){St[e]=t},ya.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ya.defineMIME("text/plain","null"),ya.defineExtension=function(e,t){ya.prototype[e]=t},ya.defineDocExtension=function(e,t){ko.prototype[e]=t},ya.fromTextArea=function(e,t){if((t=t?z(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=D();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(et(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(nt(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=ya(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s},(Ra=ya).off=nt,Ra.on=et,Ra.wheelEventPixels=function(e){var t=hi(e);return t.x*=fi,t.y*=fi,t},Ra.Doc=ko,Ra.splitLines=xt,Ra.countColumn=F,Ra.findColumn=$,Ra.isWordChar=te,Ra.Pass=q,Ra.signal=rt,Ra.Line=Kt,Ra.changeEnd=bi,Ra.scrollbarModel=Rr,Ra.Pos=ge,Ra.cmpPos=ve,Ra.modes=Ct,Ra.mimeModes=St,Ra.resolveMode=Mt,Ra.getMode=Lt,Ra.modeExtensions=Tt,Ra.extendMode=function(e,t){z(t,Tt.hasOwnProperty(e)?Tt[e]:Tt[e]={})},Ra.copyState=Ot,Ra.startState=Pt,Ra.innerMode=At,Ra.commands=Ko,Ra.keyMap=jo,Ra.keyName=Fo,Ra.isModifierKey=Ro,Ra.lookupKey=Io,Ra.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Z(n.split(" "),No),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=r):(s=i.slice(0,o+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var c in t)e[c]=t[c];return e},Ra.StringStream=Et,Ra.SharedTextMarker=bo,Ra.TextMarker=vo,Ra.LineWidget=po,Ra.e_preventDefault=lt,Ra.e_stopPropagation=ct,Ra.e_stop=dt,Ra.addClass=j,Ra.contains=E,Ra.rmClass=L,Ra.keyNames=Ao,ya.version="5.35.0",ya},"object"===a(t)&&void 0!==e?e.exports=o():void 0===(i="function"==typeof(r=o)?r.call(t,n,t,e):r)||(e.exports=i)},function(e,t,n){"use strict";e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(3),o=function(){function e(e){this.sender=e}return e.prototype.connect=function(e,t){return r.connect(this,e,t)},e.prototype.disconnect=function(e,t){return r.disconnect(this,e,t)},e.prototype.emit=function(e){r.emit(this,e)},e}();t.Signal=o,function(e){e.disconnectBetween=function(e,t){r.disconnectBetween(e,t)},e.disconnectSender=function(e){r.disconnectSender(e)},e.disconnectReceiver=function(e){r.disconnectReceiver(e)},e.disconnectAll=function(e){r.disconnectAll(e)},e.clearData=function(e){r.disconnectAll(e)},e.getExceptionHandler=function(){return r.exceptionHandler},e.setExceptionHandler=function(e){var t=r.exceptionHandler;return r.exceptionHandler=e,t}}(o=t.Signal||(t.Signal={})),t.Signal=o,function(t){t.exceptionHandler=function(e){console.error(e)},t.connect=function(e,t,i){i=i||void 0;var o=n.get(e.sender);if(o||(o=[],n.set(e.sender,o)),s(o,e,t,i))return!1;var a=i||t,l=r.get(a);l||(l=[],r.set(a,l));var c={signal:e,slot:t,thisArg:i};return o.push(c),l.push(c),!0},t.disconnect=function(e,t,i){i=i||void 0;var o=n.get(e.sender);if(!o||0===o.length)return!1;var a=s(o,e,t,i);if(!a)return!1;var l=i||t,u=r.get(l);return a.signal=null,c(o),c(u),!0},t.disconnectBetween=function(e,t){var o=n.get(e);if(o&&0!==o.length){var a=r.get(t);a&&0!==a.length&&(i.each(a,function(t){t.signal&&t.signal.sender===e&&(t.signal=null)}),c(o),c(a))}},t.disconnectSender=function(e){var t=n.get(e);t&&0!==t.length&&(i.each(t,function(e){if(e.signal){var t=e.thisArg||e.slot;e.signal=null,c(r.get(t))}}),c(t))},t.disconnectReceiver=function(e){var t=r.get(e);t&&0!==t.length&&(i.each(t,function(e){if(e.signal){var t=e.signal.sender;e.signal=null,c(n.get(t))}}),c(t))},t.disconnectAll=function(e){var t=n.get(e);t&&t.length>0&&(i.each(t,function(e){e.signal=null}),c(t));var o=r.get(e);o&&o.length>0&&(i.each(o,function(e){e.signal=null}),c(o))},t.emit=function(e,t){var r=n.get(e.sender);if(r&&0!==r.length)for(var i=0,o=r.length;i<o;++i){var a=r[i];a.signal===e&&l(a,t)}};var n=new WeakMap,r=new WeakMap,o=new Set,a="function"==typeof requestAnimationFrame?requestAnimationFrame:e;function s(e,t,n,r){return i.find(e,function(e){return e.signal===t&&e.slot===n&&e.thisArg===r})}function l(e,n){var r=e.signal,i=e.slot,o=e.thisArg;try{i.call(o,r.sender,n)}catch(e){t.exceptionHandler(e)}}function c(e){0===o.size&&a(u),o.add(e)}function u(){o.forEach(d),o.clear()}function d(e){i.ArrayExt.removeAllWhere(e,f)}function f(e){return null===e.signal}}(r||(r={}))}).call(this,n(20).setImmediate)},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(166)),r(n(165)),r(n(164)),r(n(163)),r(n(162)),r(n(6)),r(n(161)),r(n(160)),r(n(159)),r(n(158)),r(n(157)),r(n(156)),r(n(155)),r(n(154)),r(n(153)),r(n(152))},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(130)),r(n(129)),r(n(128)),r(n(127)),r(n(121)),r(n(115)),r(n(110)),r(n(109)),r(n(108)),r(n(107)),r(n(51)),r(n(106))},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(126)),r(n(125)),r(n(124)),r(n(52)),r(n(123)),r(n(122))},function(e,t,n){"use strict";function r(e){return"function"==typeof e.iter?e.iter():new i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.iter=r,t.each=function(e,t){for(var n,i=0,o=r(e);void 0!==(n=o.next());)if(!1===t(n,i++))return},t.every=function(e,t){for(var n,i=0,o=r(e);void 0!==(n=o.next());)if(!t(n,i++))return!1;return!0},t.some=function(e,t){for(var n,i=0,o=r(e);void 0!==(n=o.next());)if(t(n,i++))return!0;return!1},t.toArray=function(e){for(var t,n=0,i=[],o=r(e);void 0!==(t=o.next());)i[n++]=t;return i};var i=function(){function e(e){this._index=0,this._source=e}return e.prototype.iter=function(){return this},e.prototype.clone=function(){var t=new e(this._source);return t._index=this._index,t},e.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},e}();t.ArrayIterator=i},function(e,t,n){"use strict";var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":i(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=function(){function e(e){this._fn=e}return Object.defineProperty(e.prototype,"isDisposed",{get:function(){return!this._fn},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){if(this._fn){var e=this._fn;this._fn=null,e()}},e}();t.DisposableDelegate=i;var o=function(){function e(){this._disposed=!1,this._items=new Set}return Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._disposed||(this._disposed=!0,this._items.forEach(function(e){e.dispose()}),this._items.clear())},e.prototype.contains=function(e){return this._items.has(e)},e.prototype.add=function(e){this._items.add(e)},e.prototype.remove=function(e){this._items.delete(e)},e.prototype.clear=function(){this._items.clear()},e}();t.DisposableSet=o,function(e){e.from=function(t){var n=new e;return r.each(t,function(e){n.add(e)}),n}}(o=t.DisposableSet||(t.DisposableSet={})),t.DisposableSet=o},function(e,t,n){"use strict"},function(module,exports,__webpack_require__){"use strict";(function(global){var __extends=(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),extendStatics,__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(exports,"__esModule",{value:!0});var coreutils_1=__webpack_require__(4),FETCH,HEADERS,REQUEST,WEBSOCKET,ServerConnection,Private,e;if("undefined"==typeof window){var fetchMod=eval("require")("node-fetch");FETCH=global.fetch||fetchMod,REQUEST=global.Request||fetchMod.Request,HEADERS=global.Headers||fetchMod.Headers,WEBSOCKET=global.WebSocket||eval("require")("ws")}else FETCH=fetch,REQUEST=Request,HEADERS=Headers,WEBSOCKET=WebSocket;!function(e){e.makeSettings=function(e){return Private.makeSettings(e)},e.makeRequest=function(e,t,n){return Private.handleRequest(e,t,n)};var t=function(e){function t(t,n){var r;return n=n||"Invalid response: "+t.status+" "+t.statusText,(r=e.call(this,n)||this).response=t,r}return __extends(t,e),t}(Error);e.ResponseError=t;var n=function(e){function t(t){var n=e.call(this,t.message)||this;return n.stack=t.stack,n}return __extends(t,e),t}(TypeError);e.NetworkError=n,e.defaultSettings={baseUrl:coreutils_1.PageConfig.getBaseUrl(),pageUrl:coreutils_1.PageConfig.getOption("pageUrl"),wsUrl:coreutils_1.PageConfig.getWsUrl(),token:coreutils_1.PageConfig.getToken(),init:{cache:"no-store",credentials:"same-origin"},fetch:FETCH,Headers:HEADERS,Request:REQUEST,WebSocket:WEBSOCKET}}(ServerConnection=exports.ServerConnection||(exports.ServerConnection={})),e=Private||(Private={}),e.makeSettings=function(e){return void 0===e&&(e={}),__assign({},ServerConnection.defaultSettings,e)},e.handleRequest=function(e,t,n){if(0!==e.indexOf(n.baseUrl))throw new Error("Can only be used for notebook server requests");"no-store"===(t.cache||n.init.cache)&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime());var r,i,o=new n.Request(e,__assign({},n.init,t)),a=!1;if(n.token)a=!0,o.headers.append("Authorization","token "+n.token);else if("undefined"!=typeof document&&document.cookie){var s=(r="_xsrf",(i=document.cookie.match("\\b"+r+"=([^;]*)\\b"))?i[1]:void 0);void 0!==s&&(a=!0,o.headers.append("X-XSRFToken",s))}return!o.bodyUsed&&a&&o.headers.set("Content-Type","application/json"),n.fetch.call(null,o).catch(function(e){throw new ServerConnection.NetworkError(e)})}}).call(this,__webpack_require__(7))},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(131)),r(n(50)),r(n(105)),r(n(98)),r(n(10)),r(n(48)),r(n(47)),r(n(46)),r(n(45))},function(e,t,n){"use strict";var r,i=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o,a=n(3),s=n(13),l=n(55),c=n(2),u=n(54),d=function(){function e(e){void 0===e&&(e={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new c.Signal(this),this.node=o.createNode(e),this.addClass("p-Widget")}return e.prototype.dispose=function(){this.isDisposed||(this.setFlag(e.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&e.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),c.Signal.clearData(this),s.MessageLoop.clearData(this),l.AttachedProperty.clearData(this))},Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this.testFlag(e.Flag.IsDisposed)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAttached",{get:function(){return this.testFlag(e.Flag.IsAttached)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isHidden",{get:function(){return this.testFlag(e.Flag.IsHidden)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this.testFlag(e.Flag.IsVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return o.titleProperty.get(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.node.id},set:function(e){this.node.id=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataset",{get:function(){return this.node.dataset},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},set:function(t){if(this._parent!==t){if(t&&this.contains(t))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var n=new e.ChildMessage("child-removed",this);s.MessageLoop.sendMessage(this._parent,n)}this._parent=t,this._parent&&!this._parent.isDisposed&&(n=new e.ChildMessage("child-added",this),s.MessageLoop.sendMessage(this._parent,n)),this.isDisposed||s.MessageLoop.sendMessage(this,e.Msg.ParentChanged)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){return this._layout},set:function(t){if(this._layout!==t){if(this.testFlag(e.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(t.parent)throw new Error("Cannot change layout parent.");this._layout=t,t.parent=this}},enumerable:!0,configurable:!0}),e.prototype.children=function(){return this._layout?this._layout.iter():a.empty()},e.prototype.contains=function(e){for(var t=e;t;t=t._parent)if(t===this)return!0;return!1},e.prototype.hasClass=function(e){return this.node.classList.contains(e)},e.prototype.addClass=function(e){this.node.classList.add(e)},e.prototype.removeClass=function(e){this.node.classList.remove(e)},e.prototype.toggleClass=function(e,t){return!0===t?(this.node.classList.add(e),!0):!1===t?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)},e.prototype.update=function(){s.MessageLoop.postMessage(this,e.Msg.UpdateRequest)},e.prototype.fit=function(){s.MessageLoop.postMessage(this,e.Msg.FitRequest)},e.prototype.activate=function(){s.MessageLoop.postMessage(this,e.Msg.ActivateRequest)},e.prototype.close=function(){s.MessageLoop.sendMessage(this,e.Msg.CloseRequest)},e.prototype.show=function(){if(this.testFlag(e.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||s.MessageLoop.sendMessage(this,e.Msg.BeforeShow),this.clearFlag(e.Flag.IsHidden),this.removeClass("p-mod-hidden"),!this.isAttached||this.parent&&!this.parent.isVisible||s.MessageLoop.sendMessage(this,e.Msg.AfterShow),this.parent)){var t=new e.ChildMessage("child-shown",this);s.MessageLoop.sendMessage(this.parent,t)}},e.prototype.hide=function(){if(!this.testFlag(e.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||s.MessageLoop.sendMessage(this,e.Msg.BeforeHide),this.setFlag(e.Flag.IsHidden),this.addClass("p-mod-hidden"),!this.isAttached||this.parent&&!this.parent.isVisible||s.MessageLoop.sendMessage(this,e.Msg.AfterHide),this.parent)){var t=new e.ChildMessage("child-hidden",this);s.MessageLoop.sendMessage(this.parent,t)}},e.prototype.setHidden=function(e){e?this.hide():this.show()},e.prototype.testFlag=function(e){return 0!=(this._flags&e)},e.prototype.setFlag=function(e){this._flags|=e},e.prototype.clearFlag=function(e){this._flags&=~e},e.prototype.processMessage=function(t){switch(t.type){case"resize":this.notifyLayout(t),this.onResize(t);break;case"update-request":this.notifyLayout(t),this.onUpdateRequest(t);break;case"fit-request":this.notifyLayout(t),this.onFitRequest(t);break;case"before-show":this.notifyLayout(t),this.onBeforeShow(t);break;case"after-show":this.setFlag(e.Flag.IsVisible),this.notifyLayout(t),this.onAfterShow(t);break;case"before-hide":this.notifyLayout(t),this.onBeforeHide(t);break;case"after-hide":this.clearFlag(e.Flag.IsVisible),this.notifyLayout(t),this.onAfterHide(t);break;case"before-attach":this.notifyLayout(t),this.onBeforeAttach(t);break;case"after-attach":this.isHidden||this.parent&&!this.parent.isVisible||this.setFlag(e.Flag.IsVisible),this.setFlag(e.Flag.IsAttached),this.notifyLayout(t),this.onAfterAttach(t);break;case"before-detach":this.notifyLayout(t),this.onBeforeDetach(t);break;case"after-detach":this.clearFlag(e.Flag.IsVisible),this.clearFlag(e.Flag.IsAttached),this.notifyLayout(t),this.onAfterDetach(t);break;case"activate-request":this.notifyLayout(t),this.onActivateRequest(t);break;case"close-request":this.notifyLayout(t),this.onCloseRequest(t);break;case"child-added":this.notifyLayout(t),this.onChildAdded(t);break;case"child-removed":this.notifyLayout(t),this.onChildRemoved(t);break;default:this.notifyLayout(t)}},e.prototype.notifyLayout=function(e){this._layout&&this._layout.processParentMessage(e)},e.prototype.onCloseRequest=function(t){this.parent?this.parent=null:this.isAttached&&e.detach(this)},e.prototype.onResize=function(e){},e.prototype.onUpdateRequest=function(e){},e.prototype.onFitRequest=function(e){},e.prototype.onActivateRequest=function(e){},e.prototype.onBeforeShow=function(e){},e.prototype.onAfterShow=function(e){},e.prototype.onBeforeHide=function(e){},e.prototype.onAfterHide=function(e){},e.prototype.onBeforeAttach=function(e){},e.prototype.onAfterAttach=function(e){},e.prototype.onBeforeDetach=function(e){},e.prototype.onAfterDetach=function(e){},e.prototype.onChildAdded=function(e){},e.prototype.onChildRemoved=function(e){},e}();t.Widget=d,function(e){!function(e){e[e.IsDisposed=1]="IsDisposed",e[e.IsAttached=2]="IsAttached",e[e.IsHidden=4]="IsHidden",e[e.IsVisible=8]="IsVisible",e[e.DisallowLayout=16]="DisallowLayout"}(e.Flag||(e.Flag={})),function(e){e.BeforeShow=new s.Message("before-show"),e.AfterShow=new s.Message("after-show"),e.BeforeHide=new s.Message("before-hide"),e.AfterHide=new s.Message("after-hide"),e.BeforeAttach=new s.Message("before-attach"),e.AfterAttach=new s.Message("after-attach"),e.BeforeDetach=new s.Message("before-detach"),e.AfterDetach=new s.Message("after-detach"),e.ParentChanged=new s.Message("parent-changed"),e.UpdateRequest=new s.ConflatableMessage("update-request"),e.FitRequest=new s.ConflatableMessage("fit-request"),e.ActivateRequest=new s.ConflatableMessage("activate-request"),e.CloseRequest=new s.ConflatableMessage("close-request")}(e.Msg||(e.Msg={}));var t=function(e){function t(t,n){var r=e.call(this,t)||this;return r.child=n,r}return i(t,e),t}(s.Message);e.ChildMessage=t;var n=function(e){function t(t,n){var r=e.call(this,"resize")||this;return r.width=t,r.height=n,r}return i(t,e),t}(s.Message);e.ResizeMessage=n,function(e){e.UnknownSize=new e(-1,-1)}(n=e.ResizeMessage||(e.ResizeMessage={})),e.attach=function(t,n,r){if(void 0===r&&(r=null),t.parent)throw new Error("Cannot attach a child widget.");if(t.isAttached||document.body.contains(t.node))throw new Error("Widget is already attached.");if(!document.body.contains(n))throw new Error("Host is not attached.");s.MessageLoop.sendMessage(t,e.Msg.BeforeAttach),n.insertBefore(t.node,r),s.MessageLoop.sendMessage(t,e.Msg.AfterAttach)},e.detach=function(t){if(t.parent)throw new Error("Cannot detach a child widget.");if(!t.isAttached||!document.body.contains(t.node))throw new Error("Widget is not attached.");s.MessageLoop.sendMessage(t,e.Msg.BeforeDetach),t.node.parentNode.removeChild(t.node),s.MessageLoop.sendMessage(t,e.Msg.AfterDetach)}}(d=t.Widget||(t.Widget={})),t.Widget=d,function(e){e.titleProperty=new l.AttachedProperty({name:"title",create:function(e){return new u.Title({owner:e})}}),e.createNode=function(e){return e.node||document.createElement("div")}}(o||(o={}))},function(e,t,n){"use strict";(function(e,r){var i,o=(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(3),s=n(143),l=function(){function e(e){this.type=e}return Object.defineProperty(e.prototype,"isConflatable",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype.conflate=function(e){return!1},e}();t.Message=l;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),Object.defineProperty(t.prototype,"isConflatable",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.conflate=function(e){return!0},t}(l);t.ConflatableMessage=c,function(t){function n(e,t){var n=o.get(e);n&&0!==n.length?a.every(a.retro(n),function(n){return!n||function(e,t,n){var r=!0;try{r="function"==typeof e?e(t,n):e.messageHook(t,n)}catch(e){c(e)}return r}(n,e,t)})&&p(e,t):p(e,t)}t.sendMessage=n,t.postMessage=function(e,t){t.isConflatable&&a.some(i,function(n){return n.handler===e&&!!n.msg&&n.msg.type===t.type&&!!n.msg.isConflatable&&n.msg.conflate(t)})||function(e,t){i.addLast({handler:e,msg:t}),0===u&&(u=f(m))}(e,t)},t.installMessageHook=function(e,t){var n=o.get(e);n&&-1!==n.indexOf(t)||(n?n.push(t):o.set(e,[t]))},t.removeMessageHook=function(e,t){var n=o.get(e);if(n){var r=n.indexOf(t);-1!==r&&(n[r]=null,g(n))}},t.clearData=function(e){var t=o.get(e);t&&t.length>0&&(a.ArrayExt.fill(t,null),g(t)),a.each(i,function(t){t.handler===e&&(t.handler=null,t.msg=null)})},t.flush=function(){d||0===u||(h(u),d=!0,m(),d=!1)},t.getExceptionHandler=function(){return c},t.setExceptionHandler=function(e){var t=c;return c=e,t};var i=new s.LinkedList,o=new WeakMap,l=new Set,c=function(e){console.error(e)},u=0,d=!1,f="function"==typeof requestAnimationFrame?requestAnimationFrame:e,h="function"==typeof cancelAnimationFrame?cancelAnimationFrame:r;function p(e,t){try{e.processMessage(t)}catch(e){c(e)}}function m(){if(u=0,!i.isEmpty){var e={handler:null,msg:null};for(i.addLast(e);;){var t=i.removeFirst();if(t===e)return;t.handler&&t.msg&&n(t.handler,t.msg)}}}function g(e){0===l.size&&f(v),l.add(e)}function v(){l.forEach(y),l.clear()}function y(e){a.ArrayExt.removeAllWhere(e,b)}function b(e){return null===e}}(t.MessageLoop||(t.MessageLoop={}))}).call(this,n(20).setImmediate,n(20).clearImmediate)},function(e,t,n){"use strict";var r,i,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!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:a}catch(e){r=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var c,u=[],d=!1,f=-1;function h(){d&&c&&(d=!1,c.length?u=c.concat(u):f=-1,u.length&&p())}function p(){if(!d){var e=l(h);d=!0;for(var t=u.length;t;){for(c=u,u=[];++f<t;)c&&c[f].run();f=-1,t=u.length}c=null,d=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function g(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new m(e,t)),1!==u.length||d||l(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(171)),r(n(170)),r(n(169)),r(n(168)),r(n(167)),r(n(148)),r(n(147)),r(n(146)),r(n(144)),r(n(26)),r(n(56)),r(n(141)),r(n(140)),r(n(53)),r(n(139)),r(n(138)),r(n(137)),r(n(136)),r(n(135)),r(n(134)),r(n(133)),r(n(132)),r(n(54)),r(n(12))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"],alias:["objective-c","objc"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.mime==t)return r;if(r.mimes)for(var i=0;i<r.mimes.length;i++)if(r.mimes[i]==t)return r}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.ext)for(var i=0;i<r.ext.length;i++)if(r.ext[i]==t)return r}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.file&&r.file.test(t))return r}var i=t.lastIndexOf("."),o=i>-1&&t.substring(i+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.name.toLowerCase()==t)return r;if(r.alias)for(var i=0;i<r.alias.length;i++)if(r.alias[i].toLowerCase()==t)return r}}},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){var r,i,o={},a=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=r.apply(this,arguments)),i}),s=function(e){var t={};return function(e){if("function"==typeof e)return e();if(void 0===t[e]){var n=function(e){return document.querySelector(e)}.call(this,e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),l=null,c=0,u=[],d=n(93);function f(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=o[r.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](r.parts[a]);for(;a<r.parts.length;a++)i.parts.push(y(r.parts[a],t))}else{var s=[];for(a=0;a<r.parts.length;a++)s.push(y(r.parts[a],t));o[r.id]={id:r.id,refs:1,parts:s}}}}function h(e,t){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],a=t.base?o[0]+t.base:o[0],s={css:o[1],media:o[2],sourceMap:o[3]};r[a]?r[a].parts.push(s):n.push(r[a]={id:a,parts:[s]})}return n}function p(e,t){var n=s(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=u[u.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),u.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=s(e.insertInto+" "+e.insertAt.before);n.insertBefore(t,i)}}function m(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=u.indexOf(e);t>=0&&u.splice(t,1)}function g(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),v(t,e.attrs),p(e,t),t}function v(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function y(e,t){var n,r,i,o;if(t.transform&&e.css){if(!(o=t.transform(e.css)))return function(){};e.css=o}if(t.singleton){var a=c++;n=l||(l=g(t)),r=w.bind(null,n,a,!1),i=w.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),p(e,t),t}(t),r=function(e,t,n){var r=n.css,i=n.sourceMap,o=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||o)&&(r=d(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var a=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,n,t),i=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(t),r=function(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),i=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=h(e,t);return f(n,t),function(e){for(var r=[],i=0;i<n.length;i++){var a=n[i];(s=o[a.id]).refs--,r.push(s)}for(e&&f(h(e,t),t),i=0;i<r.length;i++){var s;if(0===(s=r[i]).refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete o[s.id]}}}};var b,x=(b=[],function(e,t){return b[e]=t,b.filter(Boolean).join("\n")});function w(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=x(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}},function(e,t,n){(t=e.exports=n(44)(!1)).i(n(94),""),t.push([e.i,'/* Basic CodeMirror styles and default Theme */\n\n/* Minimal Juniper style */\n.juniper-cell {\n font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n font-size: 1em;\n line-height: 2;\n border: 1px solid #ccc;\n position: relative;\n}\n\n.juniper-output {\n background: #222;\n color: #eee;\n padding: 2em;\n white-space: pre-wrap;\n}\n\n.juniper-button {\n font-size: 1em;\n position: absolute;\n top: 20px;\n right: 25px;\n}\n\n.CodeMirror {\n padding: 3em 2em 2em;\n font: inherit;\n height: auto;\n}\n\n.jp-OutputArea-output pre {\n font: inherit;\n margin: 0;\n white-space: pre-wrap;\n word-wrap: break-word;\n direction: ltr;\n}\n\n.jp-OutputArea-prompt {\n /* prompts like Out[2]: */\n float: left;\n color: #999;\n margin-right: 0.5em;\n}\n\n/* Ansi Colors for terminal output */\n.jp-OutputArea-output .ansi-green-fg { color: #88ec8e }\n.jp-OutputArea-output .ansi-red-fg { color: #ef6f61 }\n.jp-OutputArea-output .ansi-cyan-fg { color: #a8e9fc }\n.jp-OutputArea-output .ansi-yellow-fg { color: #f6f4a0 }\n.jp-OutputArea-output .ansi-blue-fg { color: #6cc6fc }\n.jp-OutputArea-output .ansi-purple-fg { color: #ee81c2 }\n',""])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4);!function(e){function t(e,t,n,i){return void 0===t&&(t={}),void 0===n&&(n={}),void 0===i&&(i=[]),{header:{username:e.username||"",version:"5.2",session:e.session,msg_id:e.msgId||r.uuid(),msg_type:e.msgType},parent_header:{},channel:e.channel,content:t,metadata:n,buffers:i}}e.createMessage=t,e.createShellMessage=function(e,n,r,i){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=[]),t(e,n,r,i)},e.isStreamMsg=function(e){return"stream"===e.header.msg_type},e.isDisplayDataMsg=function(e){return"display_data"===e.header.msg_type},e.isExecuteInputMsg=function(e){return"execute_input"===e.header.msg_type},e.isExecuteResultMsg=function(e){return"execute_result"===e.header.msg_type},e.isErrorMsg=function(e){return"error"===e.header.msg_type},e.isStatusMsg=function(e){return"status"===e.header.msg_type},e.isClearOutputMsg=function(e){return"clear_output"===e.header.msg_type},e.isCommOpenMsg=function(e){return"comm_open"===e.header.msg_type},e.isCommCloseMsg=function(e){return"comm_close"===e.header.msg_type},e.isCommMsgMsg=function(e){return"comm_msg"===e.header.msg_type},e.isExecuteReplyMsg=function(e){return"execute_reply"===e.header.msg_type},e.isInputRequestMsg=function(e){return"input_request"===e.header.msg_type}}(t.KernelMessage||(t.KernelMessage={}))},function(e,t,n){"use strict";(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(145),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||void 0,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||void 0}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){e.defineMode("markdown",function(t,n){var r=e.getMode(t,"text/html"),i="null"==r.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.emoji&&(n.emoji=!1),void 0===n.fencedCodeBlockHighlighting&&(n.fencedCodeBlockHighlighting=!0),void 0===n.xml&&(n.xml=!0),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var o={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var a in o)o.hasOwnProperty(a)&&n.tokenTypeOverrides[a]&&(o[a]=n.tokenTypeOverrides[a]);var s=/^([*\-_])(?:\s*\1){2,}\s*$/,l=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,u=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ *(?:\={1,}|-{1,})\s*$/,f=/^[^#!\[\]*_\\<>` "'(~:]+/,h=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:\s*\S+(\s*\S*\s*)?$/,m=/[!\"#$%&\'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~—]/;function g(e,t,n){return t.f=t.inline=n,n(e,t)}function v(e,t,n){return t.f=t.block=n,n(e,t)}function y(e){return e.linkTitle=!1,e.linkHref=!1,e.linkText=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,e.f==x&&(e.f=C,e.block=b),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine={stream:null},null}function b(r,i){var a,f=r.column()===i.indentation,m=!(a=i.prevLine.stream)||!/\S/.test(a.string),v=i.indentedCode,y=i.prevLine.hr,b=!1!==i.list,x=(i.listStack[i.listStack.length-1]||0)+3;i.indentedCode=!1;var k=i.indentation;if(null===i.indentationDiff&&(i.indentationDiff=i.indentation,b)){for(i.em=!1,i.strong=!1,i.code=!1,i.strikethrough=!1,i.list=null;k<i.listStack[i.listStack.length-1];)i.listStack.pop(),i.listStack.length?i.indentation=i.listStack[i.listStack.length-1]:i.list=!1;!1!==i.list&&(i.indentationDiff=k-i.listStack[i.listStack.length-1])}var C=!(m||y||i.prevLine.header||b&&v||i.prevLine.fencedCodeEnd),S=(!1===i.list||y||m)&&i.indentation<=x&&r.match(s),M=null;if(i.indentationDiff>=4&&(v||i.prevLine.fencedCodeEnd||i.prevLine.header||m))return r.skipToEnd(),i.indentedCode=!0,o.code;if(r.eatSpace())return null;if(f&&i.indentation<=x&&(M=r.match(u))&&M[1].length<=6)return i.quote=0,i.header=M[1].length,i.thisLine.header=!0,n.highlightFormatting&&(i.formatting="header"),i.f=i.inline,_(i);if(i.indentation<=x&&r.eat(">"))return i.quote=f?1:i.quote+1,n.highlightFormatting&&(i.formatting="quote"),r.eatSpace(),_(i);if(!S&&!i.setext&&f&&i.indentation<=x&&(M=r.match(l))){var L=M[1]?"ol":"ul";return i.indentation=k+r.current().length,i.list=!0,i.quote=0,i.listStack.push(i.indentation),n.taskLists&&r.match(c,!1)&&(i.taskList=!0),i.f=i.inline,n.highlightFormatting&&(i.formatting=["list","list-"+L]),_(i)}return f&&i.indentation<=x&&(M=r.match(h,!0))?(i.quote=0,i.fencedEndRE=new RegExp(M[1]+"+ *$"),i.localMode=n.fencedCodeBlockHighlighting&&function(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}(M[2]),i.localMode&&(i.localState=e.startState(i.localMode)),i.f=i.block=w,n.highlightFormatting&&(i.formatting="code-block"),i.code=-1,_(i)):i.setext||!(C&&b||i.quote||!1!==i.list||i.code||S||p.test(r.string))&&(M=r.lookAhead(1))&&(M=M.match(d))?(i.setext?(i.header=i.setext,i.setext=0,r.skipToEnd(),n.highlightFormatting&&(i.formatting="header")):(i.header="="==M[0].charAt(0)?1:2,i.setext=i.header),i.thisLine.header=!0,i.f=i.inline,_(i)):S?(r.skipToEnd(),i.hr=!0,i.thisLine.hr=!0,o.hr):"["===r.peek()?g(r,i,T):g(r,i,i.inline)}function x(t,n){var o=r.token(t,n.htmlState);if(!i){var a=e.innerMode(r,n.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=C,n.block=b,n.htmlState=null)}return o}function w(e,t){var r,i=t.listStack[t.listStack.length-1]||0,a=t.indentation<i,s=i+3;return t.fencedEndRE&&t.indentation<=s&&(a||e.match(t.fencedEndRE))?(n.highlightFormatting&&(t.formatting="code-block"),a||(r=_(t)),t.localMode=t.localState=null,t.block=b,t.f=C,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,a?v(e,t,t.block):r):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),o.code)}function _(e){var t=[];if(e.formatting){t.push(o.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(o.formatting+"-"+e.formatting[r]),"header"===e.formatting[r]&&t.push(o.formatting+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(o.linkHref,"url"):(e.strong&&t.push(o.strong),e.em&&t.push(o.em),e.strikethrough&&t.push(o.strikethrough),e.emoji&&t.push(o.emoji),e.linkText&&t.push(o.linkText),e.code&&t.push(o.code),e.image&&t.push(o.image),e.imageAltText&&t.push(o.imageAltText,"link"),e.imageMarker&&t.push(o.imageMarker)),e.header&&t.push(o.header,o.header+"-"+e.header),e.quote&&(t.push(o.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.quote+"-"+e.quote):t.push(o.quote+"-"+n.maxBlockquoteDepth)),!1!==e.list){var i=(e.listStack.length-1)%3;i?1===i?t.push(o.list2):t.push(o.list3):t.push(o.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function k(e,t){if(e.match(f,!0))return _(t)}function C(t,i){var a=i.text(t,i);if(void 0!==a)return a;if(i.list)return i.list=null,_(i);if(i.taskList)return" "===t.match(c,!0)[1]?i.taskOpen=!0:i.taskClosed=!0,n.highlightFormatting&&(i.formatting="task"),i.taskList=!1,_(i);if(i.taskOpen=!1,i.taskClosed=!1,i.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(i.formatting="header"),_(i);var s=t.next();if(i.linkTitle){i.linkTitle=!1;var l=s;"("===s&&(l=")");var u="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(t.match(new RegExp(u),!0))return o.linkHref}if("`"===s){var d=i.formatting;n.highlightFormatting&&(i.formatting="code"),t.eatWhile("`");var f=t.current().length;if(0!=i.code||i.quote&&1!=f){if(f==i.code){var h=_(i);return i.code=0,h}return i.formatting=d,_(i)}return i.code=f,_(i)}if(i.code)return _(i);if("\\"===s&&(t.next(),n.highlightFormatting)){var p=_(i),g=o.formatting+"-escape";return p?p+" "+g:g}if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.imageMarker=!0,i.image=!0,n.highlightFormatting&&(i.formatting="image"),_(i);if("["===s&&i.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return i.imageMarker=!1,i.imageAltText=!0,n.highlightFormatting&&(i.formatting="image"),_(i);if("]"===s&&i.imageAltText){n.highlightFormatting&&(i.formatting="image");p=_(i);return i.imageAltText=!1,i.image=!1,i.inline=i.f=M,p}if("["===s&&!i.image)return i.linkText=!0,n.highlightFormatting&&(i.formatting="link"),_(i);if("]"===s&&i.linkText){n.highlightFormatting&&(i.formatting="link");p=_(i);return i.linkText=!1,i.inline=i.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?M:C,p}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=S,n.highlightFormatting&&(i.formatting="link"),(p=_(i))?p+=" ":p="",p+o.linkInline;if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=S,n.highlightFormatting&&(i.formatting="link"),(p=_(i))?p+=" ":p="",p+o.linkEmail;if(n.xml&&"<"===s&&t.match(/^(!--|[a-z]+(?:\s+[a-z_:.\-]+(?:\s*=\s*[^ >]+)?)*\s*>)/i,!1)){var y=t.string.indexOf(">",t.pos);if(-1!=y){var b=t.string.substring(t.start,y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(i.md_inside=!0)}return t.backUp(1),i.htmlState=e.startState(r),v(t,i,x)}if(n.xml&&"<"===s&&t.match(/^\/\w*?>/))return i.md_inside=!1,"tag";if("*"===s||"_"===s){for(var w=1,k=1==t.pos?" ":t.string.charAt(t.pos-2);w<3&&t.eat(s);)w++;var L=t.peek()||" ",T=!/\s/.test(L)&&(!m.test(L)||/\s/.test(k)||m.test(k)),O=!/\s/.test(k)&&(!m.test(k)||/\s/.test(L)||m.test(L)),A=null,P=null;if(w%2&&(i.em||!T||"*"!==s&&O&&!m.test(k)?i.em!=s||!O||"*"!==s&&T&&!m.test(L)||(A=!1):A=!0),w>1&&(i.strong||!T||"*"!==s&&O&&!m.test(k)?i.strong!=s||!O||"*"!==s&&T&&!m.test(L)||(P=!1):P=!0),null!=P||null!=A)return n.highlightFormatting&&(i.formatting=null==A?"strong":null==P?"em":"strong em"),!0===A&&(i.em=s),!0===P&&(i.strong=s),h=_(i),!1===A&&(i.em=!1),!1===P&&(i.strong=!1),h}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return _(i);t.backUp(1)}if(n.strikethrough)if("~"===s&&t.eatWhile(s)){if(i.strikethrough)return n.highlightFormatting&&(i.formatting="strikethrough"),h=_(i),i.strikethrough=!1,h;if(t.match(/^[^\s]/,!1))return i.strikethrough=!0,n.highlightFormatting&&(i.formatting="strikethrough"),_(i)}else if(" "===s&&t.match(/^~~/,!0)){if(" "===t.peek())return _(i);t.backUp(2)}if(n.emoji&&":"===s&&t.match(/^[a-z_\d+-]+:/)){i.emoji=!0,n.highlightFormatting&&(i.formatting="emoji");var E=_(i);return i.emoji=!1,E}return" "===s&&(t.match(/ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),_(i)}function S(e,t){if(">"===e.next()){t.f=t.inline=C,n.highlightFormatting&&(t.formatting="link");var r=_(t);return r?r+=" ":r="",r+o.linkInline}return e.match(/^[^>]+/,!0),o.linkInline}function M(e,t){if(e.eatSpace())return null;var r,i=e.next();return"("===i||"["===i?(t.f=t.inline=(r="("===i?")":"]",function(e,t){if(e.next()===r){t.f=t.inline=C,n.highlightFormatting&&(t.formatting="link-string");var i=_(t);return t.linkHref=!1,i}return e.match(L[r]),t.linkHref=!0,_(t)}),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,_(t)):"error"}var L={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function T(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=O,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,_(t)):g(e,t,C)}function O(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=A,n.highlightFormatting&&(t.formatting="link");var r=_(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function A(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=C,o.linkHref+" url")}var P={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:C,text:k,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(r,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return y(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=x)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==x?{state:e.htmlState,mode:r}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:P}},indent:function(t,n,i){return t.block==x&&r.indent?r.indent(t.htmlState,n,i):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,n,i):e.Pass},blankLine:y,getType:_,closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return P},"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")},"object"==s(t)&&"object"==s(e)?a(n(0),n(29),n(16)):(i=[n(0),n(29),n(16)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function i(e,t,i){var a=e.getLineHandle(t.line),s=t.ch-1,l=i&&i.afterCursor;null==l&&(l=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var c=!l&&s>=0&&r[a.text.charAt(s)]||r[a.text.charAt(++s)];if(!c)return null;var u=">"==c.charAt(1)?1:-1;if(i&&i.strict&&u>0!=(s==t.ch))return null;var d=e.getTokenTypeAt(n(t.line,s+1)),f=o(e,n(t.line,s+(u>0?1:0)),u,d||null,i);return null==f?null:{from:n(t.line,s),to:f&&f.pos,match:f&&f.ch==c.charAt(0),forward:u>0}}function o(e,t,i,o,a){for(var s=a&&a.maxScanLineLength||1e4,l=a&&a.maxScanLines||1e3,c=[],u=a&&a.bracketRegex?a.bracketRegex:/[(){}[\]]/,d=i>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),f=t.line;f!=d;f+=i){var h=e.getLine(f);if(h){var p=i>0?0:h.length-1,m=i>0?h.length:-1;if(!(h.length>s))for(f==t.line&&(p=t.ch-(i<0?1:0));p!=m;p+=i){var g=h.charAt(p);if(u.test(g)&&(void 0===o||e.getTokenTypeAt(n(f,p+1))==o))if(">"==r[g].charAt(1)==i>0)c.push(g);else{if(!c.length)return{pos:n(f,p),ch:g};c.pop()}}}}return f-i!=(i>0?e.lastLine():e.firstLine())&&null}function a(e,r,o){for(var a=e.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=e.listSelections(),c=0;c<l.length;c++){var u=l[c].empty()&&i(e,l[c].head,o);if(u&&e.getLine(u.from.line).length<=a){var d=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";s.push(e.markText(u.from,n(u.from.line,u.from.ch+1),{className:d})),u.to&&e.getLine(u.to.line).length<=a&&s.push(e.markText(u.to,n(u.to.line,u.to.ch+1),{className:d}))}}if(s.length){t&&e.state.focused&&e.focus();var f=function(){e.operation(function(){for(var e=0;e<s.length;e++)s[e].clear()})};if(!r)return f;setTimeout(f,800)}}function l(e){e.operation(function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=a(e,!1,e.state.matchBrackets)})}e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.off("cursorActivity",l),t.state.matchBrackets&&t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null)),n&&(t.state.matchBrackets="object"==(void 0===n?"undefined":s(n))?n:{},t.on("cursorActivity",l))}),e.defineExtension("matchBrackets",function(){a(this,!0)}),e.defineExtension("findMatchingBracket",function(e,t,n){return(n||"boolean"==typeof t)&&(n?(n.strict=t,t=n):t=t?{strict:!0}:null),i(this,e,t)}),e.defineExtension("scanForBracket",function(e,t,n,r){return o(this,e,t,n,r)})},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(34),i=n(0);n(16),n(80),n(79),n(78),n(58),n(59),n(67),n(66),n(21),n(61),n(65),n(64);var o=n(4);!function(e){function t(e){var t="string"==typeof e?e:e.mode||e.name,n="string"!=typeof e?e.mime:t,o="string"!=typeof e?e.ext:[];return i.findModeByName(t||"")||i.findModeByMIME(n||"")||a(o)||i.findModeByMIME(r.IEditorMimeTypeService.defaultMimeType)||i.findModeByMIME("text/plain")}function a(e){if("string"==typeof e)return i.findModeByExtension(name);for(var t=0;t<e.length;t++){var n=i.findModeByExtension(e[t]);if(n)return n}}e.getModeInfo=function(){return i.modeInfo},e.run=function(e,t,n){i.runMode(e,t,n)},e.ensure=function(e){var r=t(e);return i.modes.hasOwnProperty(r.mode)?Promise.resolve(r):new Promise(function(e,t){Promise.all([n.e(0),n.e(1)]).then(function(){var t=[n(174)("./"+r.mode+"/"+r.mode+".js")];(function(){e(r)}).apply(null,t)}).catch(n.oe)})},e.findBest=t,e.findByMIME=function(e){return i.findModeByMIME(e)},e.findByName=function(e){return i.findModeByName(e)},e.findByFileName=function(e){var t=o.PathExt.basename(e);return i.findModeByFileName(t)},e.findByExtension=a}(t.Mode||(t.Mode={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2),o=function(){function e(e){if(void 0===e&&(e={}),this._map=new Map,this._changed=new i.Signal(this),this._isDisposed=!1,this._itemCmp=e.itemCmp||r.itemCmp,e.values)for(var t in e.values)this._map.set(t,e.values[t])}return Object.defineProperty(e.prototype,"type",{get:function(){return"Map"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.set=function(e,t){var n=this._map.get(e);if(void 0===t)throw Error("Cannot set an undefined value, use remove");var r=this._itemCmp;return void 0!==n&&r(n,t)?n:(this._map.set(e,t),this._changed.emit({type:n?"change":"add",key:e,oldValue:n,newValue:t}),n)},e.prototype.get=function(e){return this._map.get(e)},e.prototype.has=function(e){return this._map.has(e)},e.prototype.keys=function(){var e=[];return this._map.forEach(function(t,n){e.push(n)}),e},e.prototype.values=function(){var e=[];return this._map.forEach(function(t,n){e.push(t)}),e},e.prototype.delete=function(e){var t=this._map.get(e);return this._map.delete(e),this._changed.emit({type:"remove",key:e,oldValue:t,newValue:void 0}),t},e.prototype.clear=function(){for(var e=this.keys(),t=0;t<e.length;t++)this.delete(e[t])},e.prototype.dispose=function(){this.isDisposed||(this._isDisposed=!0,i.Signal.clearData(this),this._map.clear())},e}();t.ObservableMap=o,(r||(r={})).itemCmp=function(e,t){return e===t}},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(91)),r(n(43)),r(n(40)),r(n(24)),r(n(42)),r(n(41))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=n(57),o=n(13),a=n(55),s=n(2),l=n(12),c=function(){function e(e){void 0===e&&(e={}),this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}return e.prototype.dispose=function(){this._parent=null,this._disposed=!0,s.Signal.clearData(this),a.AttachedProperty.clearData(this)},Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},set:function(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fitPolicy",{get:function(){return this._fitPolicy},set:function(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){var t=this._parent.node.style;t.minWidth="",t.minHeight="",t.maxWidth="",t.maxHeight="",this._parent.fit()}},enumerable:!0,configurable:!0}),e.prototype.processParentMessage=function(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e)}},e.prototype.init=function(){var e=this;r.each(this,function(t){t.parent=e.parent})},e.prototype.onResize=function(e){r.each(this,function(e){o.MessageLoop.sendMessage(e,l.Widget.ResizeMessage.UnknownSize)})},e.prototype.onUpdateRequest=function(e){r.each(this,function(e){o.MessageLoop.sendMessage(e,l.Widget.ResizeMessage.UnknownSize)})},e.prototype.onBeforeAttach=function(e){r.each(this,function(t){o.MessageLoop.sendMessage(t,e)})},e.prototype.onAfterAttach=function(e){r.each(this,function(t){o.MessageLoop.sendMessage(t,e)})},e.prototype.onBeforeDetach=function(e){r.each(this,function(t){o.MessageLoop.sendMessage(t,e)})},e.prototype.onAfterDetach=function(e){r.each(this,function(t){o.MessageLoop.sendMessage(t,e)})},e.prototype.onBeforeShow=function(e){r.each(this,function(t){t.isHidden||o.MessageLoop.sendMessage(t,e)})},e.prototype.onAfterShow=function(e){r.each(this,function(t){t.isHidden||o.MessageLoop.sendMessage(t,e)})},e.prototype.onBeforeHide=function(e){r.each(this,function(t){t.isHidden||o.MessageLoop.sendMessage(t,e)})},e.prototype.onAfterHide=function(e){r.each(this,function(t){t.isHidden||o.MessageLoop.sendMessage(t,e)})},e.prototype.onChildRemoved=function(e){this.removeWidget(e.child)},e.prototype.onFitRequest=function(e){},e.prototype.onChildShown=function(e){},e.prototype.onChildHidden=function(e){},e}();t.Layout=c,function(e){e.getHorizontalAlignment=function(e){return u.horizontalAlignmentProperty.get(e)},e.setHorizontalAlignment=function(e,t){u.horizontalAlignmentProperty.set(e,t)},e.getVerticalAlignment=function(e){return u.verticalAlignmentProperty.get(e)},e.setVerticalAlignment=function(e,t){u.verticalAlignmentProperty.set(e,t)}}(c=t.Layout||(t.Layout={})),t.Layout=c;var u,d=function(){function e(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute"}return e.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height=""}},Object.defineProperty(e.prototype,"minWidth",{get:function(){return this._minWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minHeight",{get:function(){return this._minHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxWidth",{get:function(){return this._maxWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxHeight",{get:function(){return this._maxHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isHidden",{get:function(){return this.widget.isHidden},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this.widget.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAttached",{get:function(){return this.widget.isAttached},enumerable:!0,configurable:!0}),e.prototype.fit=function(){var e=i.ElementExt.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight},e.prototype.update=function(e,t,n,r){var i=Math.max(this._minWidth,Math.min(n,this._maxWidth)),a=Math.max(this._minHeight,Math.min(r,this._maxHeight));if(i<n)switch(c.getHorizontalAlignment(this.widget)){case"left":break;case"center":e+=(n-i)/2;break;case"right":e+=n-i;break;default:throw"unreachable"}if(a<r)switch(c.getVerticalAlignment(this.widget)){case"top":break;case"center":t+=(r-a)/2;break;case"bottom":t+=r-a;break;default:throw"unreachable"}var s=!1,u=this.widget.node.style;if(this._top!==t&&(this._top=t,u.top=t+"px"),this._left!==e&&(this._left=e,u.left=e+"px"),this._width!==i&&(s=!0,this._width=i,u.width=i+"px"),this._height!==a&&(s=!0,this._height=a,u.height=a+"px"),s){var d=new l.Widget.ResizeMessage(i,a);o.MessageLoop.sendMessage(this.widget,d)}},e}();t.LayoutItem=d,function(e){function t(e){e.parent&&e.parent.layout&&e.parent.update()}e.horizontalAlignmentProperty=new a.AttachedProperty({name:"horizontalAlignment",create:function(){return"center"},changed:t}),e.verticalAlignmentProperty=new a.AttachedProperty({name:"verticalAlignment",create:function(){return"top"},changed:t})}(u||(u={}))},function(e,t,n){"use strict";var r,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};o=function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),s=r||i||o,l=s&&(r?document.documentMode||6:+(o||i)[1]),c=!o&&/WebKit\//.test(e),u=c&&/Qt\/\d+\.\d+/.test(e),d=!o&&/Chrome\//.test(e),f=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),m=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=/Android/.test(e),y=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=g||/Mac/.test(t),x=/\bCrOS\b/.test(e),w=/win/i.test(t),_=f&&e.match(/Version\/(\d*\.\d*)/);_&&(_=Number(_[1])),_&&_>=15&&(f=!1,c=!0);var k=b&&(u||f&&(null==_||_<12.11)),C=n||s&&l>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var M,L=function(e,t){var n=e.className,r=S(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return T(e).appendChild(t)}function A(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function P(e,t,n,r){var i=A(e,t,n,r);return i.setAttribute("role","presentation"),i}function E(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function D(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function j(e,t){var n=e.className;S(t).test(n)||(e.className+=(n?" ":"")+t)}function N(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!S(n[r]).test(t)&&(t+=" "+n[r]);return t}M=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var I=function(e){e.select()};function R(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function z(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function F(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}g?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(I=function(e){try{e.select()}catch(e){}});var W=function(){this.id=null};function B(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}W.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var H=30,q={toString:function(){return"CodeMirror.Pass"}},U={scroll:!1},K={origin:"*mouse"},V={origin:"+move"};function $(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var G=[""];function J(e){for(;G.length<=e;)G.push(X(G)+" ");return G[e]}function X(e){return e[e.length-1]}function Z(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Y(){}function Q(e,t){var n;return Object.create?n=Object.create(e):(Y.prototype=e,n=new Y),t&&z(t,n),n}var ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function te(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\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 oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function ae(e,t,n){for(;(n<0?t>0:t<e.length)&&oe(e.charAt(t));)t+=n;return t}function se(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function le(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function ce(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function ue(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function de(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function fe(e){if(null==e.parent)return null;for(var t=e.parent,n=B(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function he(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return n+a}function pe(e,t){return t>=e.first&&t<e.first+e.size}function me(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ge(e,t,n){if(void 0===n&&(n=null),!(this instanceof ge))return new ge(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ve(e,t){return e.line-t.line||e.ch-t.ch}function ye(e,t){return e.sticky==t.sticky&&0==ve(e,t)}function be(e){return ge(e.line,e.ch)}function xe(e,t){return ve(e,t)<0?t:e}function we(e,t){return ve(e,t)<0?e:t}function _e(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ke(e,t){if(t.line<e.first)return ge(e.first,0);var n=e.first+e.size-1;return t.line>n?ge(n,le(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?ge(e.line,t):n<0?ge(e.line,0):e}(t,le(e,t.line).text.length)}function Ce(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ke(e,t[r]);return n}var Se=!1,Me=!1;function Le(e,t,n){this.marker=e,this.from=t,this.to=n}function Te(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Oe(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Ae(e,t){if(t.full)return null;var n=pe(e,t.from.line)&&le(e,t.from.line).markedSpans,r=pe(e,t.to.line)&&le(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==ve(t.from,t.to),s=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Le(a,o.from,s?null:o.to))}}return r}(n,i,a),l=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Le(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}(r,o,a),c=1==t.text.length,u=X(t.text).length+(c?i:0);if(s)for(var d=0;d<s.length;++d){var f=s[d];if(null==f.to){var h=Te(l,f.marker);h?c&&(f.to=null==h.to?null:h.to+u):f.to=i}}if(l)for(var p=0;p<l.length;++p){var m=l[p];null!=m.to&&(m.to+=u),null==m.from?Te(s,m.marker)||(m.from=u,c&&(s||(s=[])).push(m)):(m.from+=u,c&&(s||(s=[])).push(m))}s&&(s=Pe(s)),l&&l!=s&&(l=Pe(l));var g=[s];if(!c){var v,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(v||(v=[])).push(new Le(s[b].marker,null,null));for(var x=0;x<y;++x)g.push(v);g.push(l)}return g}function Pe(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ee(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function De(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function je(e){return e.inclusiveLeft?-1:0}function Ne(e){return e.inclusiveRight?1:0}function Ie(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=ve(r.from,i.from)||je(e)-je(t);return o?-o:ve(r.to,i.to)||Ne(e)-Ne(t)||t.id-e.id}function Re(e,t){var n,r=Me&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||Ie(n,i.marker)<0)&&(n=i.marker);return n}function ze(e){return Re(e,!0)}function Fe(e){return Re(e,!1)}function We(e,t){var n,r=Me&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Ie(n,o.marker)<0)&&(n=o.marker)}return n}function Be(e,t,n,r,i){var o=le(e,t),a=Me&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=ve(c.from,n)||je(l.marker)-je(i),d=ve(c.to,r)||Ne(l.marker)-Ne(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ve(c.to,n)>=0:ve(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ve(c.from,r)<=0:ve(c.from,r)<0)))return!0}}}function He(e){for(var t;t=ze(e);)e=t.find(-1,!0).line;return e}function qe(e,t){var n=le(e,t),r=He(n);return n==r?t:fe(r)}function Ue(e,t){if(t>e.lastLine())return t;var n,r=le(e,t);if(!Ke(e,r))return t;for(;n=Fe(r);)r=n.find(1,!0).line;return fe(r)+1}function Ke(e,t){var n=Me&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Ve(e,t,r))return!0}}function Ve(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Ve(e,r.line,Te(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Ve(e,t,i))return!0}function $e(e){for(var t=0,n=(e=He(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function Ge(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=ze(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=Fe(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function Je(e){var t=e.display,n=e.doc;t.maxLine=le(n,n.first),t.maxLineLength=Ge(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=Ge(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var Xe=null;function Ze(e,t,n){var r;Xe=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:Xe=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:Xe=i)}return null!=r?r:Xe}var Ye=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var c,u=a.length,d=[],f=0;f<u;++f)d.push((c=a.charCodeAt(f))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var h=0,p=l;h<u;++h){var m=d[h];"m"==m?d[h]=p:p=m}for(var g=0,v=l;g<u;++g){var y=d[g];"1"==y&&"r"==v?d[g]="n":n.test(y)&&(v=y,"r"==y&&(d[g]="R"))}for(var b=1,x=d[0];b<u-1;++b){var w=d[b];"+"==w&&"1"==x&&"1"==d[b+1]?d[b]="1":","!=w||x!=d[b+1]||"1"!=x&&"n"!=x||(d[b]=x),x=w}for(var _=0;_<u;++_){var k=d[_];if(","==k)d[_]="N";else if("%"==k){var C=void 0;for(C=_+1;C<u&&"%"==d[C];++C);for(var S=_&&"!"==d[_-1]||C<u&&"1"==d[C]?"1":"N",M=_;M<C;++M)d[M]=S;_=C-1}}for(var L=0,T=l;L<u;++L){var O=d[L];"L"==T&&"1"==O?d[L]="L":n.test(O)&&(T=O)}for(var A=0;A<u;++A)if(t.test(d[A])){var P=void 0;for(P=A+1;P<u&&t.test(d[P]);++P);for(var E="L"==(A?d[A-1]:l),D=E==("L"==(P<u?d[P]:l))?E?"L":"R":l,j=A;j<P;++j)d[j]=D;A=P-1}for(var N,I=[],R=0;R<u;)if(r.test(d[R])){var z=R;for(++R;R<u&&r.test(d[R]);++R);I.push(new o(0,z,R))}else{var F=R,W=I.length;for(++R;R<u&&"L"!=d[R];++R);for(var B=F;B<R;)if(i.test(d[B])){F<B&&I.splice(W,0,new o(1,F,B));var H=B;for(++B;B<R&&i.test(d[B]);++B);I.splice(W,0,new o(2,H,B)),F=B}else++B;F<R&&I.splice(W,0,new o(1,F,R))}return"ltr"==s&&(1==I[0].level&&(N=a.match(/^\s+/))&&(I[0].from=N[0].length,I.unshift(new o(0,0,N[0].length))),1==X(I).level&&(N=a.match(/\s+$/))&&(X(I).to-=N[0].length,I.push(new o(0,u-N[0].length,u)))),"rtl"==s?I.reverse():I}}();function Qe(e,t){var n=e.order;return null==n&&(n=e.order=Ye(e.text,t)),n}var et=[],tt=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||et).concat(n)}};function nt(e,t){return e._handlers&&e._handlers[t]||et}function rt(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=B(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function it(e,t){var n=nt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function ot(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),it(e,n||t.type,e,t),dt(t)||t.codemirrorIgnore}function at(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==B(n,t[r])&&n.push(t[r])}function st(e,t){return nt(e,t).length>0}function lt(e){e.prototype.on=function(e,t){tt(this,e,t)},e.prototype.off=function(e,t){rt(this,e,t)}}function ct(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ut(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function dt(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ft(e){ct(e),ut(e)}function ht(e){return e.target||e.srcElement}function pt(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var mt,gt,vt=function(){if(s&&l<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function yt(e){if(null==mt){var t=A("span","");O(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(mt=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&l<8))}var n=mt?A("span",""):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function bt(e){if(null!=gt)return gt;var t=O(e,document.createTextNode("AخA")),n=M(t,0,1).getBoundingClientRect(),r=M(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(gt=r.right-n.right<3)}var xt,wt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},_t=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)},kt="oncopy"in(xt=A("div"))||(xt.setAttribute("oncopy","return;"),"function"==typeof xt.oncopy),Ct=null,St={},Mt={};function Lt(e){if("string"==typeof e&&Mt.hasOwnProperty(e))e=Mt[e];else if(e&&"string"==typeof e.name&&Mt.hasOwnProperty(e.name)){var t=Mt[e.name];"string"==typeof t&&(t={name:t}),(e=Q(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Lt("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Lt("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Tt(e,t){t=Lt(t);var n=St[t.name];if(!n)return Tt(e,"text/plain");var r=n(e,t);if(Ot.hasOwnProperty(t.name)){var i=Ot[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Ot={};function At(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Pt(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Et(e,t,n){return!e.startState||e.startState(t,n)}var Dt=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Dt.prototype.eol=function(){return this.pos>=this.string.length},Dt.prototype.sol=function(){return this.pos==this.lineStart},Dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Dt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Dt.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Dt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Dt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Dt.prototype.skipToEnd=function(){this.pos=this.string.length},Dt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Dt.prototype.backUp=function(e){this.pos-=e},Dt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Dt.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Dt.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Dt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Dt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Dt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var jt=function(e,t){this.state=e,this.lookAhead=t},Nt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function It(e,t,n,r){var i=[e.state.modeGen],o={};Kt(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,c=0;n.state=!0,Kt(e,t.text,s.mode,n,function(e,t){for(var n=l;c<e;){var r=i[l];r>e&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}},o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Rt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=zt(e,fe(t)),i=t.text.length>e.options.maxHighlightLength&&At(e.doc.mode,r.state),o=It(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function zt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Nt(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=le(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof jt?c.lookAhead:0)<=o.modeFrontier))return s;var u=F(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}(e,t,n),a=o>r.first&&le(r,o-1).stateAfter,s=a?Nt.fromSaved(r,a,o):new Nt(r,Et(r.mode),o);return r.iter(o,t,function(n){Ft(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()}),n&&(r.modeFrontier=s.line),s}function Ft(e,t,n,r){var i=e.doc.mode,o=new Dt(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&Wt(i,n.state);!o.eol();)Bt(i,o,n.state),o.start=o.pos}function Wt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Pt(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Bt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Pt(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}Nt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Nt.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}},Nt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Nt.fromSaved=function(e,t,n){return t instanceof jt?new Nt(e,At(e.mode,t.state),n,t.lookAhead):new Nt(e,At(e.mode,t),n)},Nt.prototype.save=function(e){var t=!1!==e?At(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new jt(t,this.maxLookAhead):t};var Ht=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function qt(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=le(a,(t=ke(a,t)).line),c=zt(e,t.line,n),u=new Dt(l.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=Bt(s,u,c.state),r&&o.push(new Ht(u,i,At(a.mode,c.state)));return r?o:new Ht(u,i,c.state)}function Ut(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Kt(e,t,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,d=new Dt(t,e.options.tabSize,r),f=e.options.addModeClass&&[null];for(""==t&&Ut(Wt(n,r.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(s=!1,a&&Ft(e,t,r,d.pos),d.pos=t.length,l=null):l=Ut(Bt(n,d,r.state,f),o),f){var h=f[0].name;h&&(l="m-"+(l?h+" "+l:h))}if(!s||u!=l){for(;c<d.start;)i(c=Math.min(d.start,c+5e3),u);u=l}d.start=d.pos}for(;c<d.pos;){var p=Math.min(d.pos,c+5e3);i(p,u),c=p}}var Vt=function(e,t,n){this.text=e,De(this,t),this.height=n?n(this):1};function $t(e){e.parent=null,Ee(e)}Vt.prototype.lineNo=function(){return fe(this)},lt(Vt);var Gt={},Jt={};function Xt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Jt:Gt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var n=P("span",null,null,c?"padding-right: .1px":null),r={pre:P("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(s||c)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Qt,bt(e.display.measure)&&(a=Qe(o,e.doc.direction))&&(r.addToken=en(r.addToken,a)),r.map=[],nn(o,r,Rt(e,o,t!=e.display.externalMeasured&&fe(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=N(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=N(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(yt(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(c){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return it(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=N(r.pre.className,r.textClass||"")),r}function Yt(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Qt(e,t,n,r,i,o,a){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1;if(d.test(t)){c=document.createDocumentFragment();for(var h=0;;){d.lastIndex=h;var p=d.exec(t),m=p?p.index-h:t.length-h;if(m){var g=document.createTextNode(u.slice(h,h+m));s&&l<9?c.appendChild(A("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!p)break;h+=m+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=c.appendChild(A("span",J(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=c.appendChild(A("span","\r"==p[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),s&&l<9?c.appendChild(A("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),s&&l<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||i||f||a){var x=n||"";r&&(x+=r),i&&(x+=i);var w=A("span",[c],x,a);return o&&(w.title=o),e.content.appendChild(w)}e.content.appendChild(c)}}function en(e,t){return function(n,r,i,o,a,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var d=void 0,f=0;f<t.length&&!((d=t[f]).to>c&&d.from<=c);f++);if(d.to>=u)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-c),i,o,null,s,l),o=null,r=r.slice(d.to-c),c=d.to}}}function tn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,u,d,f,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){l=c=u=d=s="",f=null,v=1/0;for(var y=[],b=void 0,x=0;x<r.length;++x){var w=r[x],_=w.marker;"bookmark"==_.type&&w.from==p&&_.widgetNode?y.push(_):w.from<=p&&(null==w.to||w.to>p||_.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),_.className&&(l+=" "+_.className),_.css&&(s=(s?s+";":"")+_.css),_.startStyle&&w.from==p&&(u+=" "+_.startStyle),_.endStyle&&w.to==v&&(b||(b=[])).push(_.endStyle,w.to),_.title&&!d&&(d=_.title),_.collapsed&&(!f||Ie(f.marker,_)<0)&&(f=w)):w.from>p&&v>w.from&&(v=w.from)}if(b)for(var k=0;k<b.length;k+=2)b[k+1]==v&&(c+=" "+b[k]);if(!f||f.from==p)for(var C=0;C<y.length;++C)tn(t,0,y[C]);if(f&&(f.from||0)==p){if(tn(t,(null==f.to?h+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=h)break;for(var S=Math.min(h,v);;){if(g){var M=p+g.length;if(!f){var L=M>S?g.slice(0,S-p):g;t.addToken(t,L,a?a+l:l,u,p+L.length==v?c:"",d,s)}if(M>=S){g=g.slice(S-p),p=S;break}p=M,u=""}g=i.slice(o,o=n[m++]),a=Xt(n[m++],t.cm.options)}}else for(var T=1;T<n.length;T+=2)t.addToken(t,i.slice(o,o=n[T]),Xt(n[T+1],t.cm.options))}function rn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=Fe(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?fe(X(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Ke(e,t)}function on(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new rn(e.doc,le(e.doc,o),o);r=o+a.size,i.push(a)}return i}var an=null,sn=null;function ln(e,t){var n=nt(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);an?r=an.delayedCallbacks:sn?r=sn:(r=sn=[],setTimeout(cn,0));for(var o=function(e){r.push(function(){return n[e].apply(null,i)})},a=0;a<n.length;++a)o(a)}}function cn(){var e=sn;sn=null;for(var t=0;t<e.length;++t)e[t]()}function un(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?hn(e,t):"gutter"==o?mn(e,t,n,r):"class"==o?pn(e,t):"widget"==o&&gn(e,t,r)}t.changes=null}function dn(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),s&&l<8&&(e.node.style.zIndex=2)),e.node}function fn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Zt(e,t)}function hn(e,t){var n=t.text.className,r=fn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,pn(e,t)):n&&(t.text.className=n)}function pn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=dn(t);t.background=r.insertBefore(A("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?dn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function mn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=dn(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=dn(t),s=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(A("div",me(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.options.gutters.length;++l){var c=e.options.gutters[l],u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(A("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function gn(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild,i=void 0;r;r=i)i=r.nextSibling,"CodeMirror-linewidget"==r.className&&t.node.removeChild(r);yn(e,t,n)}function vn(e,t,n,r){var i=fn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),pn(e,t),mn(e,t,n,r),yn(e,t,r),t.node}function yn(e,t,n){if(bn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)bn(e,t.rest[r],t,n,!1)}function bn(e,t,n,r,i){if(t.widgets)for(var o=dn(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=A("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),xn(l,c,n,r),e.display.input.setUneditable(c),i&&l.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),ln(l,"redraw")}}function xn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function wn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!E(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),O(t.display.measure,A("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function _n(e,t){for(var n=ht(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function kn(e){return e.lineSpace.offsetTop}function Cn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Sn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=O(e.measure,A("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Mn(e){return H-e.display.nativeBarWidth}function Ln(e){return e.display.scroller.clientWidth-Mn(e)-e.display.barWidth}function Tn(e){return e.display.scroller.clientHeight-Mn(e)-e.display.barHeight}function On(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(fe(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function An(e,t,n,r){return Dn(e,En(e,t),n,r)}function Pn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[lr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function En(e,t){var n=fe(t),r=Pn(e,n);r&&!r.text?r=null:r&&r.changes&&(un(e,r,n,rr(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=fe(t=He(t)),r=e.display.externalMeasured=new rn(e.doc,t,n);r.lineN=n;var i=r.built=Zt(e,r);return r.text=i.pre,O(e.display.lineMeasure,i.pre),r}(e,t));var i=On(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Dn(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,i=r&&Ln(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=In(t.map,n,r),a=o.node,c=o.start,u=o.end,d=o.collapse;if(3==a.nodeType){for(var f=0;f<4;f++){for(;c&&oe(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&oe(t.line.text.charAt(o.coverStart+u));)++u;if((i=s&&l<9&&0==c&&u==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Rn(M(a,c,u).getClientRects(),r)).left||i.right||0==c)break;u=c,c-=1,d="right"}s&&l<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Ct)return Ct;var t=O(e,A("span","x")),n=t.getBoundingClientRect(),r=M(t,0,1).getBoundingClientRect();return Ct=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var h;c>0&&(d=r="right"),i=e.options.lineWrapping&&(h=a.getClientRects()).length>1?h["right"==r?h.length-1:0]:a.getBoundingClientRect()}if(s&&l<9&&!c&&(!i||!i.left&&!i.right)){var p=a.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+nr(e.display),top:p.top,bottom:p.bottom}:Nn}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var x=b?y[b-1]:0,w=y[b],_={left:("right"==d?i.right:i.left)-t.rect.left,right:("left"==d?i.left:i.right)-t.rect.left,top:x,bottom:w};return i.left||i.right||(_.bogus=!0),e.options.singleCursorHeightPerLine||(_.rtop=m,_.rbottom=g),_}(e,t,n,r)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var jn,Nn={left:0,right:0,top:0,bottom:0};function In(e,t,n){for(var r,i,o,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(i=0,o=1,a="left"):t<l?o=1+(i=t-s):(c==e.length-3||t==l&&e[c+3]>t)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function Rn(e,t){var n=Nn;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function zn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Fn(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)zn(e.display.view[t])}function Wn(e){Fn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Bn(){return d&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Hn(){return d&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function qn(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=wn(e.widgets[n]));return t}function Un(e,t,n,r,i){if(!i){var o=qn(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=$e(t);if("local"==r?a+=kn(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Hn());var l=s.left+("window"==r?0:Bn());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function Kn(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Bn(),i-=Hn();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Vn(e,t,n,r,i){return r||(r=le(e.doc,t.line)),Un(e,r,An(e,r,t.ch,i),n)}function $n(e,t,n,r,i,o){function a(t,a){var s=Dn(e,i,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,Un(e,r,s,n)}r=r||le(e.doc,t.line),i||(i=En(e,r));var s=Qe(r,e.doc.direction),l=t.ch,c=t.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){var r=1==s[t].level;return a(n?e-1:e,r!=n)}var d=Ze(s,l,c),f=Xe,h=u(l,d,"before"==c);return null!=f&&(h.other=u(l,f,"before"!=c)),h}function Gn(e,t){var n=0;t=ke(e.doc,t),e.options.lineWrapping||(n=nr(e.display)*t.ch);var r=le(e.doc,t.line),i=$e(r)+kn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Jn(e,t,n,r,i){var o=ge(e,t,n);return o.xRel=i,r&&(o.outside=!0),o}function Xn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Jn(r.first,0,null,!0,-1);var i=he(r,n),o=r.first+r.size-1;if(i>o)return Jn(r.first+r.size-1,le(r,o).text.length,null,!0,1);t<0&&(t=0);for(var a=le(r,i);;){var s=er(e,a,i,t,n),l=We(a,s.ch+(s.xRel>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=le(r,i=c.line)}}function Zn(e,t,n,r){r-=qn(t);var i=t.text.length,o=se(function(t){return Dn(e,n,t-1).bottom<=r},i,0);return{begin:o,end:i=se(function(t){return Dn(e,n,t).top>r},o,i)}}function Yn(e,t,n,r){return n||(n=En(e,t)),Zn(e,t,n,Un(e,t,Dn(e,n,r),"line").top)}function Qn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,i){i-=$e(t);var o=En(e,t),a=qn(t),s=0,l=t.text.length,c=!0,u=Qe(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?function(e,t,n,r,i,o,a){var s=Zn(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,f=0;f<i.length;f++){var h=i[f];if(!(h.from>=c||h.to<=l)){var p=Dn(e,r,1!=h.level?Math.min(c,h.to)-1:Math.max(l,h.from)).right,m=p<o?o-p+1e9:p-o;(!u||d>m)&&(u=h,d=m)}}return u||(u=i[i.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}:function(e,t,n,r,i,o,a){var s=se(function(s){var l=i[s],c=1!=l.level;return Qn($n(e,ge(n,c?l.to:l.from,c?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=$n(e,ge(n,c?l.from:l.to,c?"after":"before"),"line",t,r);Qn(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l})(e,t,n,o,u,r,i);s=(c=1!=d.level)?d.from:d.to-1,l=c?d.to:d.from-1}var f,h,p=null,m=null,g=se(function(t){var n=Dn(e,o,t);return n.top+=a,n.bottom+=a,!!Qn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,m=n),!0)},s,l),v=!1;if(m){var y=r-m.left<m.right-r,b=y==c;g=p+(b?0:1),h=b?"after":"before",f=y?m.left:m.right}else{c||g!=l&&g!=s||g++,h=0==g?"after":g==t.text.length?"before":Dn(e,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var x=$n(e,ge(n,g,h),"line",t,o);f=x.left,v=i<x.top||i>=x.bottom}return Jn(n,g=ae(t.text,g,1),h,v,r-f)}function tr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==jn){jn=A("pre");for(var t=0;t<49;++t)jn.appendChild(document.createTextNode("x")),jn.appendChild(A("br"));jn.appendChild(document.createTextNode("x"))}O(e.measure,jn);var n=jn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function nr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t]);O(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function rr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.clientWidth;return{fixedPos:ir(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ir(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function or(e){var t=tr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/nr(e.display)-3);return function(i){if(Ke(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function ar(e){var t=e.doc,n=or(e);t.iter(function(e){var t=n(e);t!=e.height&&de(e,t)})}function sr(e,t,n,r){var i=e.display;if(!n&&"true"==ht(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(t){return null}var l,c=Xn(e,o,a);if(r&&1==c.xRel&&(l=le(e.doc,c.line).text).length==c.ch){var u=F(l,l.length,e.options.tabSize)-l.length;c=ge(c.line,Math.max(0,Math.round((o-Sn(e.display).left)/nr(e.display))-u))}return c}function lr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function cr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ur(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&dr(e,s.head,i),l||hr(e,s,o)}}return r}function dr(e,t,n){var r=$n(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(A("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function fr(e,t){return e.top-t.top||e.left-t.left}function hr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Sn(e.display),s=a.left,l=Math.max(r.sizerWidth,Ln(e)-r.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(r-t)+"px"))}function d(t,n,r){var o,a,d=le(i,t),f=d.text.length;function h(n,r){return Vn(e,ge(t,n),"div",d,r)}function p(t,n,r){var i=Yn(e,d,null,t),o="ltr"==n==("after"==r)?"left":"right";return h("after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),o)[o]}var m=Qe(d,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?f:r,function(e,t,i,d){var g="ltr"==i,v=h(e,g?"left":"right"),y=h(t-1,g?"right":"left"),b=null==n&&0==e,x=null==r&&t==f,w=0==d,_=!m||d==m.length-1;if(y.top-v.top<=3){var k=(c?x:b)&&_,C=(c?b:x)&&w?s:(g?v:y).left,S=k?l:(g?y:v).right;u(C,v.top,S-C,v.bottom)}else{var M,L,T,O;g?(M=c&&b&&w?s:v.left,L=c?l:p(e,i,"before"),T=c?s:p(t,i,"after"),O=c&&x&&_?l:y.right):(M=c?p(e,i,"before"):s,L=!c&&b&&w?l:v.right,T=!c&&x&&_?s:y.left,O=c?p(t,i,"after"):l),u(M,v.top,L-M,v.bottom),v.bottom<y.top&&u(s,v.bottom,null,y.top),u(T,y.top,O-T,y.bottom)}(!o||fr(v,o)<0)&&(o=v),fr(y,o)<0&&(o=y),(!a||fr(v,a)<0)&&(a=v),fr(y,a)<0&&(a=y)}),{start:o,end:a}}var f=t.from(),h=t.to();if(f.line==h.line)d(f.line,f.ch,h.ch);else{var p=le(i,f.line),m=le(i,h.line),g=He(p)==He(m),v=d(f.line,f.ch,g?p.text.length+1:null).end,y=d(h.line,g?0:null,h.ch).start;g&&(v.top<y.top-2?(u(v.right,v.top,null,v.bottom),u(s,y.top,y.left,y.bottom)):u(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&u(s,v.bottom,null,y.top)}n.appendChild(o)}function pr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function mr(e){e.state.focused||(e.display.input.focus(),vr(e))}function gr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,yr(e))},100)}function vr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(it(e,"focus",e,t),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),c&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),pr(e))}function yr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(it(e,"blur",e,t),e.state.focused=!1,L(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function br(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=void 0;if(!i.hidden){if(s&&l<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-n,n=a}else{var c=i.node.getBoundingClientRect();o=c.bottom-c.top}var u=i.line.height-o;if(o<2&&(o=tr(t)),(u>.005||u<-.005)&&(de(i.line,o),xr(i.line),i.rest))for(var d=0;d<i.rest.length;d++)xr(i.rest[d])}}}function xr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function wr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-kn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=he(t,r),a=he(t,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?(o=s,a=he(t,$e(le(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(o=he(t,$e(le(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function _r(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ir(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function kr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=me(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(A("div",[A("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",li(e),!0}return!1}function Cr(e,t){var n=e.display,r=tr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Tn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Cn(n),l=t.top<r,c=t.bottom>s-r;if(t.top<i)a.scrollTop=l?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,f=Ln(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>f+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function Sr(e,t){null!=t&&(Tr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Mr(e){Tr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Lr(e,t,n){null==t&&null==n||Tr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Tr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Or(e,Gn(e,t.from),Gn(e,t.to),t.margin))}function Or(e,t,n,r){var i=Cr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Lr(e,i.scrollLeft,i.scrollTop)}function Ar(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||si(e,{top:t}),Pr(e,t,!0),n&&si(e),ni(e,100))}function Pr(e,t,n){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Er(e,t,n,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,_r(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Dr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Cn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Mn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var jr=function(e,t,n){this.cm=n;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),tt(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),tt(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};jr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},jr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},jr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},jr.prototype.zeroWidthHack=function(){var e=b&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new W,this.disableVert=new W},jr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)})},jr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Nr=function(){};function Ir(e,t){t||(t=Dr(e));var n=e.display.barWidth,r=e.display.barHeight;Rr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&br(e),Rr(e,Dr(e)),n=e.display.barWidth,r=e.display.barHeight}function Rr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Nr.prototype.update=function(){return{bottom:0,right:0}},Nr.prototype.setScrollLeft=function(){},Nr.prototype.setScrollTop=function(){},Nr.prototype.clear=function(){};var zr={native:jr,null:Nr};function Fr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&L(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new zr[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),tt(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?Er(e,t):Ar(e,t)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var Wr=0;function Br(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:++Wr},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function Hr(e){!function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{an=null,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)qr(t[n]);for(var r=0;r<t.length;r++)(i=t[r]).updatedDisplay=i.mustUpdate&&oi(i.cm,i.update);for(var i,o=0;o<t.length;o++)Ur(t[o]);for(var a=0;a<t.length;a++)Kr(t[a]);for(var s=0;s<t.length;s++)Vr(t[s])}(e)}(n)}}(e.curOp)}function qr(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Mn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Mn(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Je(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ii(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ur(e){var t=e.cm,n=t.display;e.updatedDisplay&&br(t),e.barMeasure=Dr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=An(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Mn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ln(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Kr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Er(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==D();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ir(t,e.barMeasure),e.updatedDisplay&&ci(t,e.barMeasure),e.selectionChanged&&pr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&mr(e.cm)}function Vr(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&ai(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Pr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Er(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!ot(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!m){var o=A("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-kn(e.display))+"px;\n height: "+(t.bottom-t.top+Mn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?ge(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ge(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=$n(e,t),l=n&&n!=t?$n(e,n):s,c=Cr(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Ar(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Er(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}(t,ke(r,e.scrollToPos.from),ke(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||it(i[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&it(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&it(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function $r(e,t){if(e.curOp)return t();Br(e);try{return t()}finally{Hr(e)}}function Gr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Br(e);try{return t.apply(e,arguments)}finally{Hr(e)}}}function Jr(e){return function(){if(this.curOp)return e.apply(this,arguments);Br(this);try{return e.apply(this,arguments)}finally{Hr(this)}}}function Xr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Br(t);try{return e.apply(this,arguments)}finally{Hr(t)}}}function Zr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Me&&qe(e.doc,t)<i.viewTo&&Qr(e);else if(n<=i.viewFrom)Me&&Ue(e.doc,n+r)>i.viewFrom?Qr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Qr(e);else if(t<=i.viewFrom){var o=ei(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Qr(e)}else if(n>=i.viewTo){var a=ei(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Qr(e)}else{var s=ei(e,t,t,-1),l=ei(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(on(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Qr(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function Yr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[lr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==B(a,n)&&a.push(n)}}}function Qr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ei(e,t,n,r){var i,o=lr(e,t),a=e.display.view;if(!Me||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;qe(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function ti(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function ni(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,R(ri,e))}function ri(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=zt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?At(t.mode,r.state):null,l=It(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f];d&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&Ft(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ni(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&$r(e,function(){for(var t=0;t<i.length;t++)Yr(e,i[t],"text")})}}var ii=function(e,t,n){var r=e.display;this.viewport=t,this.visible=wr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ln(e),this.force=n,this.dims=rr(e),this.events=[]};function oi(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Qr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==ti(e))return!1;kr(e)&&(Qr(e),t.dims=rr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Me&&(o=qe(e.doc,o),a=Ue(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(lr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(on(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,lr(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=$e(le(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=ti(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=D();if(!t||!E(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&E(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return l>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return c&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var l=r.view,u=r.viewFrom,d=0;d<l.length;d++){var f=l[d];if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;a!=f.node;)a=s(a);var h=i&&null!=t&&t<=u&&f.lineNumber;f.changes&&(B(f.changes,"gutter")>-1&&(h=!1),un(e,f,u,n)),h&&(T(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(me(e.options,u)))),a=f.node.nextSibling}else{var p=vn(e,f,u,n);o.insertBefore(p,a)}u+=f.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=D()&&(e.activeElt.focus(),e.anchorNode&&E(document.body,e.anchorNode)&&E(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ni(e,400)),n.updateLineNumbers=null,!0}function ai(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ln(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Cn(e.display)-Tn(e),n.top)}),t.visible=wr(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&oi(e,t);r=!1){br(e);var i=Dr(e);cr(e),Ir(e,i),ci(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function si(e,t){var n=new ii(e,t);if(oi(e,n)){br(e),ai(e,n);var r=Dr(e);cr(e),Ir(e,r),ci(e,r),n.finish()}}function li(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function ci(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+Mn(e)+"px"}function ui(e){var t=e.display.gutters,n=e.options.gutters;T(t);for(var r=0;r<n.length;++r){var i=n[r],o=t.appendChild(A("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",li(e)}function di(e){var t=B(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}ii.prototype.signal=function(e,t){st(e,t)&&this.events.push(arguments)},ii.prototype.finish=function(){for(var e=0;e<this.events.length;e++)it.apply(null,this.events[e])};var fi=0,hi=null;function pi(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function mi(e,t){var r=pi(t),i=r.x,o=r.y,a=e.display,s=a.scroller,l=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&l||o&&u){if(o&&b&&c)e:for(var d=t.target,h=a.view;d!=s;d=d.parentNode)for(var p=0;p<h.length;p++)if(h[p].node==d){e.display.currentWheelTarget=d;break e}if(i&&!n&&!f&&null!=hi)return o&&u&&Ar(e,Math.max(0,s.scrollTop+o*hi)),Er(e,Math.max(0,s.scrollLeft+i*hi)),(!o||o&&u)&&ct(t),void(a.wheelStartX=null);if(o&&null!=hi){var m=o*hi,g=e.doc.scrollTop,v=g+a.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):v=Math.min(e.doc.height,v+m+50),si(e,{top:g,bottom:v})}fi<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout(function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(hi=(hi*fi+n)/(fi+1),++fi)}},200)):(a.wheelDX+=i,a.wheelDY+=o))}}s?hi=-.53:n?hi=15:d?hi=-.7:h&&(hi=-1/3);var gi=function(e,t){this.ranges=e,this.primIndex=t};gi.prototype.primary=function(){return this.ranges[this.primIndex]},gi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!ye(n.anchor,r.anchor)||!ye(n.head,r.head))return!1}return!0},gi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new vi(be(this.ranges[t].anchor),be(this.ranges[t].head));return new gi(e,this.primIndex)},gi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},gi.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ve(t,r.from())>=0&&ve(e,r.to())<=0)return n}return-1};var vi=function(e,t){this.anchor=e,this.head=t};function yi(e,t){var n=e[t];e.sort(function(e,t){return ve(e.from(),t.from())}),t=B(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(ve(o.to(),i.from())>=0){var a=we(o.from(),i.from()),s=xe(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;r<=t&&--t,e.splice(--r,2,new vi(l?s:a,l?a:s))}}return new gi(e,t)}function bi(e,t){return new gi([new vi(e,t||e)],0)}function xi(e){return e.text?ge(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function wi(e,t){if(ve(e,t.from)<0)return e;if(ve(e,t.to)<=0)return xi(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=xi(t).ch-t.to.ch),ge(n,r)}function _i(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new vi(wi(i.anchor,t),wi(i.head,t)))}return yi(n,e.sel.primIndex)}function ki(e,t,n){return e.line==t.line?ge(n.line,e.ch-t.ch+n.ch):ge(n.line+(e.line-t.line),e.ch)}function Ci(e){e.doc.mode=Tt(e.options,e.doc.modeOption),Si(e)}function Si(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ni(e,100),e.state.modeGen++,e.curOp&&Zr(e)}function Mi(e,t){return 0==t.from.ch&&0==t.to.ch&&""==X(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Li(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ee(e),De(e,n);var i=r?r(e):1;i!=e.height&&de(e,i)}(e,n,i,r),ln(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new Vt(c[o],i(o),r));return n}var s=t.from,l=t.to,c=t.text,u=le(e,s.line),d=le(e,l.line),f=X(c),h=i(c.length-1),p=l.line-s.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Mi(e,t)){var m=a(0,c.length-1);o(d,d.text,h),p&&e.remove(s.line,p),m.length&&e.insert(s.line,m)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,s.ch)+f+u.text.slice(l.ch),h);else{var g=a(1,c.length-1);g.push(new Vt(f+u.text.slice(l.ch),h,r)),o(u,u.text.slice(0,s.ch)+c[0],i(0)),e.insert(s.line+1,g)}else if(1==c.length)o(u,u.text.slice(0,s.ch)+c[0]+d.text.slice(l.ch),i(0)),e.remove(s.line+1,p);else{o(u,u.text.slice(0,s.ch)+c[0],i(0)),o(d,f+d.text.slice(l.ch),h);var v=a(1,c.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,v)}ln(e,"change",e,t)}function Ti(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;a<r.linked.length;++a){var s=r.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;n&&!l||(t(s.doc,l),e(s.doc,r,l))}}}(e,null,!0)}function Oi(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ar(e),Ci(e),Ai(e),e.options.lineWrapping||Je(e),e.options.mode=t.modeOption,Zr(e)}function Ai(e){("rtl"==e.doc.direction?j:L)(e.display.lineDiv,"CodeMirror-rtl")}function Pi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ei(e,t){var n={from:be(t.from),to:xi(t),text:ce(e,t.from,t.to)};return Ii(e,n,t.from.line,t.to.line+1),Ti(e,function(e){return Ii(e,n,t.from.line,t.to.line+1)},!0),n}function Di(e){for(;e.length&&X(e).ranges;)e.pop()}function ji(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return i.lastOp==r?(Di(e.done),X(e.done)):e.done.length&&!X(e.done).ranges?X(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),X(e.done)):void 0}(i)))a=X(o.changes),0==ve(t.from,t.to)&&0==ve(t.from,a.to)?a.to=xi(t):o.changes.push(Ei(e,t));else{var l=X(i.done);for(l&&l.ranges||Ni(e.sel,i.done),o={changes:[Ei(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||it(e,"historyAdded")}function Ni(e,t){var n=X(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ii(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function Ri(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function zi(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Ri(n[i]));return r}(e,t),r=Ae(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else a&&(n[i]=a)}return n}function Fi(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?gi.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&B(t,Number(u[1]))>-1&&(X(s)[d]=c[d],delete c[d])}}}return r}function Wi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ve(t,i)<0;o!=ve(n,i)<0?(i=t,t=n):o!=ve(t,n)<0&&(t=n)}return new vi(i,t)}return new vi(n||t,t)}function Bi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Vi(e,new gi([Wi(e.sel.primary(),t,n,i)],0),r)}function Hi(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Wi(e.sel.ranges[o],t[o],null,i);Vi(e,yi(r,e.sel.primIndex),n)}function qi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Vi(e,yi(i,e.sel.primIndex),r)}function Ui(e,t,n,r){Vi(e,bi(t,n),r)}function Ki(e,t,n){var r=e.history.done,i=X(r);i&&i.ranges?(r[r.length-1]=t,$i(e,t,n)):Vi(e,t,n)}function Vi(e,t,n){$i(e,t,n),function(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,X(i.done),t))?i.done[i.done.length-1]=t:Ni(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Di(i.undone)}(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function $i(e,t,n){(st(e,"beforeSelectionChange")||e.cm&&st(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new vi(ke(e,t[n].anchor),ke(e,t[n].head))},origin:n&&n.origin};return it(e,"beforeSelectionChange",e,r),e.cm&&it(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?yi(r.ranges,r.ranges.length-1):t}(e,t,n)),Gi(e,Xi(e,t,n&&n.bias||(ve(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),n&&!1===n.scroll||!e.cm||Mr(e.cm)}function Gi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,at(e.cm)),ln(e,"cursorActivity",e))}function Ji(e){Gi(e,Xi(e,e.sel,null,!1))}function Xi(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=Yi(e,a.anchor,s&&s.anchor,n,r),c=Yi(e,a.head,s&&s.head,n,r);(i||l!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new vi(l,c))}return i?yi(i,t.primIndex):t}function Zi(e,t,n,r,i){var o=le(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker;if((null==s.from||(l.inclusiveLeft?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(l.inclusiveRight?s.to>=t.ch:s.to>t.ch))){if(i&&(it(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var c=l.find(r<0?1:-1),u=void 0;if((r<0?l.inclusiveRight:l.inclusiveLeft)&&(c=Qi(e,c,-r,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=ve(c,n))&&(r<0?u<0:u>0))return Zi(e,c,t,r,i)}var d=l.find(r<0?-1:1);return(r<0?l.inclusiveLeft:l.inclusiveRight)&&(d=Qi(e,d,r,d.line==t.line?o:null)),d?Zi(e,d,t,r,i):null}}return t}function Yi(e,t,n,r,i){var o=r||1;return Zi(e,t,n,o,i)||!i&&Zi(e,t,n,o,!0)||Zi(e,t,n,-o,i)||!i&&Zi(e,t,n,-o,!0)||(e.cantEdit=!0,ge(e.first,0))}function Qi(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ke(e,ge(t.line-1)):null:n>0&&t.ch==(r||le(e,t.line)).text.length?t.line<e.first+e.size-1?ge(t.line+1,0):null:new ge(t.line,t.ch+n)}function eo(e){e.setSelection(ge(e.firstLine(),0),ge(e.lastLine()),U)}function to(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=ke(e,t)),n&&(r.to=ke(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),it(e,"beforeChange",e,r),e.cm&&it(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function no(e,t,n){if(e.cm){if(!e.cm.curOp)return Gr(e.cm,no)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(st(e,"beforeChange")||e.cm&&st(e.cm,"beforeChange"))||(t=to(e,t,!0))){var r=Se&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=B(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var c=i[l];if(!(ve(c.to,s.from)<0||ve(c.from,s.to)>0)){var u=[l,1],d=ve(c.from,s.from),f=ve(c.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)ro(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else ro(e,t)}}function ro(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ve(t.from,t.to)){var n=_i(e,t);ji(e,t,n,e.cm?e.cm.curOp.id:NaN),ao(e,t,n,Ae(e,t));var r=[];Ti(e,function(e,n){n||-1!=B(r,e.history)||(uo(e.history,t),r.push(e.history)),ao(e,t,null,Ae(e,t))})}}function io(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c<s.length&&(i=s[c],n?!i.ranges||i.equals(e.sel):i.ranges);c++);if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if(Ni(i,l),n&&!i.equals(e.sel))return void Vi(e,i,{clearRedo:!1});a=i}var u=[];Ni(a,l),l.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var d=st(e,"beforeChange")||e.cm&&st(e.cm,"beforeChange"),f=function(n){var r=i.changes[n];if(r.origin=t,d&&!to(e,r,!1))return s.length=0,{};u.push(Ei(e,r));var o=n?_i(e,r):X(s);ao(e,r,o,zi(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:xi(r)});var a=[];Ti(e,function(e,t){t||-1!=B(a,e.history)||(uo(e.history,r),a.push(e.history)),ao(e,r,null,zi(e,r))})},h=i.changes.length-1;h>=0;--h){var p=f(h);if(p)return p.v}}}}function oo(e,t){if(0!=t&&(e.first+=t,e.sel=new gi(Z(e.sel.ranges,function(e){return new vi(ge(e.anchor.line+t,e.anchor.ch),ge(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Zr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Yr(e.cm,r,"gutter")}}function ao(e,t,n,r){if(e.cm&&!e.cm.curOp)return Gr(e.cm,ao)(e,t,n,r);if(t.to.line<e.first)oo(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);oo(e,i),t={from:ge(e.first,0),to:ge(t.to.line+i,t.to.ch),text:[X(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ge(o,le(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ce(e,t.from,t.to),n||(n=_i(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=fe(He(le(r,o.line))),r.iter(l,a.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&at(e),Li(r,t,n,or(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,function(e){var t=Ge(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=le(e,r).stateAfter;if(i&&(!(i instanceof jt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,o.line),ni(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?Zr(e):o.line!=a.line||1!=t.text.length||Mi(e.doc,t)?Zr(e,o.line,a.line+1,c):Yr(e,o.line,"text");var u=st(e,"changes"),d=st(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&ln(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,r):Li(e,t,r),$i(e,n,U)}}function so(e,t,n,r,i){var o;r||(r=n),ve(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),no(e,{from:n,to:r,text:t,origin:i})}function lo(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function co(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)lo(o.ranges[s].anchor,t,n,r),lo(o.ranges[s].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(n<c.from.line)c.from=ge(c.from.line+r,c.from.ch),c.to=ge(c.to.line+r,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function uo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;co(e.done,n,r,i),co(e.undone,n,r,i)}function fo(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=le(e,_e(e,t)):i=fe(t),null==i?null:(r(o,i)&&e.cm&&Yr(e.cm,i,n),o)}function ho(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function po(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}vi.prototype.from=function(){return we(this.anchor,this.head)},vi.prototype.to=function(){return xe(this.anchor,this.head)},vi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ho.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,$t(i),ln(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},po.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ho))){var s=[];this.collapse(s),this.children=[new ho(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var l=new ho(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++r,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new po(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=B(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new po(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var mo=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function go(e,t,n){$e(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sr(e,n)}mo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=fe(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=wn(this);de(n,Math.max(0,n.height-o)),e&&($r(e,function(){go(e,n,-o),Yr(e,r,"widget")}),ln(e,"lineWidgetCleared",e,this,r))}},mo.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=wn(this)-t;i&&(de(r,r.height+i),n&&$r(n,function(){n.curOp.forceUpdate=!0,go(n,r,i),ln(n,"lineWidgetChanged",n,e,fe(r))}))},lt(mo);var vo=0,yo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++vo};function bo(e,t,n,r,i){if(r&&r.shared)return function(e,t,n,r,i){(r=z(r)).shared=!1;var o=[bo(e,t,n,r,i)],a=o[0],s=r.widgetNode;return Ti(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(bo(e,ke(e,t),ke(e,n),r,i));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=X(o)}),new xo(o,a)}(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Gr(e.cm,bo)(e,t,n,r,i);var o=new yo(e,i),a=ve(t,n);if(r&&z(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=P("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Be(e,t.line,t,n,o)||t.line!=n.line&&Be(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Me=!0}o.addToHistory&&ji(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&He(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&de(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Le(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(t){Ke(e,t)&&de(t,0)}),o.clearOnEnter&&tt(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Se=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++vo,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Zr(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=n.line;u++)Yr(c,u,"text");o.atomic&&Ji(c.doc),ln(c,"markerAdded",c,o)}return o}yo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Br(e),st(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=Te(a.markedSpans,this);e&&!this.collapsed?Yr(e,fe(a),"text"):e&&(null!=s.to&&(i=fe(a)),null!=s.from&&(r=fe(a))),a.markedSpans=Oe(a.markedSpans,s),null==s.from&&this.collapsed&&!Ke(this.doc,a)&&e&&de(a,tr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=He(this.lines[l]),u=Ge(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Zr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ji(e.doc)),e&&ln(e,"markerCleared",e,this,r,i),t&&Hr(e),this.parent&&this.parent.clear()}},yo.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Te(o.markedSpans,this);if(null!=a.from&&(n=ge(t?o:fe(o),a.from),-1==e))return n;if(null!=a.to&&(r=ge(t?o:fe(o),a.to),1==e))return r}return n&&{from:n,to:r}},yo.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&$r(r,function(){var i=t.line,o=fe(t.line),a=Pn(r,o);if(a&&(zn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Ke(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var l=wn(n)-s;l&&de(i,i.height+l)}ln(r,"markerChanged",r,e)})},yo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=B(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},yo.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},lt(yo);var xo=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function wo(e){return e.findMarks(ge(e.first,0),e.clipPos(ge(e.lastLine())),function(e){return e.parent})}function _o(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Ti(n.primary.doc,function(e){return r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==B(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}xo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ln(this,"clear")}},xo.prototype.find=function(e,t){return this.primary.find(e,t)},lt(xo);var ko=0,Co=function e(t,n,r,i,o){if(!(this instanceof e))return new e(t,n,r,i,o);null==r&&(r=0),po.call(this,[new ho([new Vt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var a=ge(r,0);this.sel=bi(a),this.history=new Pi(null),this.id=++ko,this.modeOption=n,this.lineSep=i,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),Li(this,{from:a,to:a,text:t}),Vi(this,bi(a),U)};Co.prototype=Q(po.prototype,{constructor:Co,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ue(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Xr(function(e){var t=ge(this.first,0),n=this.first+this.size-1;no(this,{from:t,to:ge(n,le(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Lr(this.cm,0,0),Vi(this,bi(t),U)}),replaceRange:function(e,t,n,r){so(this,e,t=ke(this,t),n=n?ke(this,n):t,r)},getRange:function(e,t,n){var r=ce(this,ke(this,e),ke(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(pe(this,e))return le(this,e)},getLineNumber:function(e){return fe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=le(this,e)),He(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ke(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Xr(function(e,t,n){Ui(this,ke(this,"number"==typeof e?ge(e,t||0):e),null,n)}),setSelection:Xr(function(e,t,n){Ui(this,ke(this,e),ke(this,t||e),n)}),extendSelection:Xr(function(e,t,n){Bi(this,ke(this,e),t&&ke(this,t),n)}),extendSelections:Xr(function(e,t){Hi(this,Ce(this,e),t)}),extendSelectionsBy:Xr(function(e,t){Hi(this,Ce(this,Z(this.sel.ranges,e)),t)}),setSelections:Xr(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new vi(ke(this,e[i].anchor),ke(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Vi(this,yi(r,t),n)}}),addSelection:Xr(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new vi(ke(this,e),ke(this,t||e))),Vi(this,yi(r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=ce(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=ce(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Xr(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var s=t&&"end"!=t&&function(e,t,n){for(var r=[],i=ge(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],l=ki(s.from,i,o),c=ki(xi(s),i,o);if(i=s.to,o=c,"around"==n){var u=e.sel.ranges[a],d=ve(u.head,u.anchor)<0;r[a]=new vi(d?c:l,d?l:c)}else r[a]=new vi(l,l)}return new gi(r,e.sel.primIndex)}(this,r,t),l=r.length-1;l>=0;l--)no(this,r[l]);s?Ki(this,s):this.cm&&Mr(this.cm)}),undo:Xr(function(){io(this,"undo")}),redo:Xr(function(){io(this,"redo")}),undoSelection:Xr(function(){io(this,"undo",!0)}),redoSelection:Xr(function(){io(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new Pi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Fi(this.history.done),undone:Fi(this.history.undone)}},setHistory:function(e){var t=this.history=new Pi(this.history.maxGeneration);t.done=Fi(e.done.slice(0),null,!0),t.undone=Fi(e.undone.slice(0),null,!0)},setGutterMarker:Xr(function(e,t,n){return fo(this,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&re(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Xr(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&fo(t,n,"gutter",function(){return n.gutterMarkers[e]=null,re(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!pe(this,e))return null;if(t=e,!(e=le(this,e)))return null}else if(null==(t=fe(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Xr(function(e,t,n){return fo(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(S(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:Xr(function(e,t,n){return fo(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(S(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),addLineWidget:Xr(function(e,t,n){return function(e,t,n,r){var i=new mo(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),fo(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Ke(e,t)){var r=$e(t)<e.scrollTop;de(t,t.height+wn(i)),r&&Sr(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&ln(o,"lineWidgetAdded",o,i,"number"==typeof t?t:fe(t)),i}(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return bo(this,ke(this,e),ke(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return bo(this,e=ke(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=le(this,(e=ke(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ke(this,e),t=ke(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&i==e.line&&e.ch>=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),ke(this,ge(n,t))},indexFromPos:function(e){var t=(e=ke(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Co(ue(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Co(ue(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(ve(o,a)){var s=bo(e,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,wo(this)),r},unlinkDoc:function(e){if(e instanceof ba&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),_o(wo(this));break}if(e.history==this.history){var n=[e.id];Ti(e,function(e){return n.push(e.id)},!0),e.history=new Pi(null),e.history.done=Fi(this.history.done,n),e.history.undone=Fi(this.history.undone,n)}},iterLinkedDocs:function(e){Ti(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):wt(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Xr(function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&$r(t=this.cm,function(){Ai(t),Zr(t)}))})}),Co.prototype.eachLine=Co.prototype.iter;var So=0;function Mo(e){var t=this;if(Lo(t),!ot(t,e)&&!_n(t.display,e)){ct(e),s&&(So=+new Date);var n=sr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(e,r){if(!t.options.allowDropFileTypes||-1!=B(t.options.allowDropFileTypes,e.type)){var s=new FileReader;s.onload=Gr(t,function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++a==i){var l={from:n=ke(t.doc,n),to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};no(t.doc,l),Ki(t.doc,bi(n,xi(l)))}}),s.readAsText(e)}},c=0;c<i;++c)l(r[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var u=e.dataTransfer.getData("Text");if(u){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),$i(t.doc,bi(n,n)),d)for(var f=0;f<d.length;++f)so(t.doc,"",d[f].anchor,d[f].head,"drag");t.replaceSelection(u,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Lo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function To(e){if(document.getElementsByClassName)for(var t=document.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}var Oo=!1;function Ao(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}for(var Po={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Eo=0;Eo<10;Eo++)Po[Eo+48]=Po[Eo+96]=String(Eo);for(var Do=65;Do<=90;Do++)Po[Do]=String.fromCharCode(Do);for(var jo=1;jo<=12;jo++)Po[jo+111]=Po[jo+63235]="F"+jo;var No={};function Io(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Ro(e,t,n,r){var i=(t=Bo(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Ro(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Ro(e,t.fallthrough[o],n,r);if(a)return a}}}function zo(e){var t="string"==typeof e?e:Po[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Fo(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(k?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(k?t.ctrlKey:t.metaKey)&&"Cmd"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Wo(e,t){if(f&&34==e.keyCode&&e.char)return!1;var n=Po[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Fo(n,e,t))}function Bo(e){return"string"==typeof e?No[e]:e}function Ho(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&ve(o.from,X(r).to)<=0;){var a=r.pop();if(ve(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}$r(e,function(){for(var t=r.length-1;t>=0;t--)so(e.doc,"",r[t].from,r[t].to,"+delete");Mr(e)})}function qo(e,t,n){var r=ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Uo(e,t,n){var r=qo(e,t.ch,n);return null==r?null:new ge(t.line,r,n<0?"after":"before")}function Ko(e,t,n,r,i){if(e){var o=Qe(n,t.doc.direction);if(o){var a,s=i<0?X(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=En(t,n);a=i<0?n.text.length-1:0;var u=Dn(t,c,a).top;a=se(function(e){return Dn(t,c,e).top==u},i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=qo(n,a,1))}else a=i<0?s.to:s.from;return new ge(r,a,l)}}return new ge(r,i<0?n.text.length:0,i<0?"before":"after")}No.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"},No.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"},No.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"},No.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"]},No.default=b?No.macDefault:No.pcDefault;var Vo={selectAll:eo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),U)},killLine:function(e){return Ho(e,function(t){if(t.empty()){var n=le(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ge(t.head.line+1,0)}:{from:t.head,to:ge(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ho(e,function(t){return{from:ge(t.from().line,0),to:ke(e.doc,ge(t.to().line+1,0))}})},delLineLeft:function(e){return Ho(e,function(e){return{from:ge(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return Ho(e,function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}})},delWrappedLineRight:function(e){return Ho(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ge(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ge(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return $o(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Go(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return function(e,t){var n=le(e.doc,t),r=function(e){for(var t;t=Fe(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=fe(r)),Ko(!0,e,n,t,-1)}(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},V)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},V)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Go(e,t.head):r},V)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=F(e.getLine(o.line),o.ch,r);t.push(J(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return $r(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=le(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ge(i.line,i.ch-1)),i.ch>0)i=new ge(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ge(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=le(e.doc,i.line-1).text;a&&(i=new ge(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ge(i.line-1,a.length-1),i,"+transpose"))}n.push(new vi(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return $r(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Mr(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function $o(e,t){var n=le(e.doc,t),r=He(n);return r!=n&&(t=fe(r)),Ko(!0,e,r,t,1)}function Go(e,t){var n=$o(e,t.line),r=le(e.doc,n.line),i=Qe(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return ge(n.line,a?0:o,n.sticky)}return n}function Jo(e,t,n){if("string"==typeof t&&!(t=Vo[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=q}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}var Xo=new W;function Zo(e,t,n,r){var i=e.state.keySeq;if(i){if(zo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Xo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Yo(e,i+" "+t,n,r))return!0}return Yo(e,t,n,r)}function Yo(e,t,n,r){var i=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Ro(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Ro(t,e.options.extraKeys,n,e)||Ro(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&ln(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(ct(n),pr(e)),!!i}function Qo(e,t){var n=Wo(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?Zo(e,"Shift-"+n,t,function(t){return Jo(e,t,!0)})||Zo(e,n,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return Jo(e,t)}):Zo(e,n,t,function(t){return Jo(e,t)}))}var ea=null;function ta(e){var t=this;if(t.curOp.focus=D(),!ot(t,e)){s&&l<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=Qo(t,e);f&&(ea=r?n:null,!r&&88==n&&!kt&&(b?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(L(t,"CodeMirror-crosshair"),rt(document,"keyup",n),rt(document,"mouseover",n))}j(t,"CodeMirror-crosshair"),tt(document,"keyup",n),tt(document,"mouseover",n)}(t)}}function na(e){16==e.keyCode&&(this.doc.sel.shift=!1),ot(this,e)}function ra(e){var t=this;if(!(_n(t.display,e)||ot(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(f&&n==ea)return ea=null,void ct(e);if(!f||e.which&&!(e.which<10)||!Qo(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(e,t,n){return Zo(e,"'"+i+"'",t,function(t){return Jo(e,t,!0)})}(t,e)||t.display.input.onKeyPress(e))}}}var ia,oa,aa=function(e,t,n){this.time=e,this.pos=t,this.button=n};function sa(e){var t=this,n=t.display;if(!(ot(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,_n(n,e))c||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));else if(!ua(t,e)){var r=sr(t,e),i=pt(e),o=r?function(e,t){var n=+new Date;return oa&&oa.compare(n,e,t)?(ia=oa=null,"triple"):ia&&ia.compare(n,e,t)?(oa=new aa(n,e,t),ia=null,"double"):(ia=new aa(n,e,t),oa=null,"single")}(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),Zo(e,Fo(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,function(t){if("string"==typeof t&&(t=Vo[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=q}finally{e.state.suppressEdits=!1}return r})}(t,i,r,o,e)||(1==i?r?function(e,t,n,r){s?setTimeout(R(mr,e),0):e.curOp.focus=D();var i,o=function(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=x?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=b?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(b?n.altKey:n.ctrlKey)),i}(e,n,r),a=e.doc.sel;e.options.dragDrop&&vt&&!e.isReadOnly()&&"single"==n&&(i=a.contains(t))>-1&&(ve((i=a.ranges[i]).from(),t)<0||t.xRel>0)&&(ve(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,a=Gr(e,function(t){c&&(i.scroller.draggable=!1),e.state.draggingText=!1,rt(i.wrapper.ownerDocument,"mouseup",a),rt(i.wrapper.ownerDocument,"mousemove",u),rt(i.scroller,"dragstart",d),rt(i.scroller,"drop",a),o||(ct(t),r.addNew||Bi(e.doc,n,null,null,r.extend),c||s&&9==l?setTimeout(function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()},20):i.input.focus())}),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};c&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),tt(i.wrapper.ownerDocument,"mouseup",a),tt(i.wrapper.ownerDocument,"mousemove",u),tt(i.scroller,"dragstart",d),tt(i.scroller,"drop",a),gr(e),setTimeout(function(){return i.input.focus()},20)}(e,r,t,o):function(e,t,n,r){var i=e.display,o=e.doc;ct(t);var a,s,l=o.sel,c=l.ranges;if(r.addNew&&!r.extend?(s=o.sel.contains(n),a=s>-1?c[s]:new vi(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new vi(n,n)),n=sr(e,t,!0,!0),s=-1;else{var u=la(e,n,r.unit);a=r.extend?Wi(a,u.anchor,u.head,r.extend):u}r.addNew?-1==s?(s=c.length,Vi(o,yi(c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==r.unit&&!r.extend?(Vi(o,yi(c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):qi(o,s,a,K):(s=0,Vi(o,new gi([a],0),K),l=o.sel);var d=n;function f(t){if(0!=ve(d,t))if(d=t,"rectangle"==r.unit){for(var i=[],c=e.options.tabSize,u=F(le(o,n.line).text,n.ch,c),f=F(le(o,t.line).text,t.ch,c),h=Math.min(u,f),p=Math.max(u,f),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=le(o,m).text,y=$(v,h,c);h==p?i.push(new vi(ge(m,y),ge(m,y))):v.length>y&&i.push(new vi(ge(m,y),ge(m,$(v,p,c))))}i.length||i.push(new vi(n,n)),Vi(o,yi(l.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=a,w=la(e,t,r.unit),_=x.anchor;ve(w.anchor,_)>0?(b=w.head,_=we(x.from(),w.anchor)):(b=w.anchor,_=xe(x.to(),w.head));var k=l.ranges.slice(0);k[s]=function(e,t){var n=t.anchor,r=t.head,i=le(e.doc,n.line);if(0==ve(n,r)&&n.sticky==r.sticky)return t;var o=Qe(i);if(!o)return t;var a=Ze(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=Ze(o,r.ch,r.sticky),d=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?d<0:d>0}var f=o[c+(l?-1:0)],h=l==(1==f.level),p=h?f.from:f.to,m=h?"after":"before";return n.ch==p&&n.sticky==m?t:new vi(new ge(n.line,p,m),r)}(e,new vi(ke(o,_),b)),Vi(o,yi(k,s),K)}}var h=i.wrapper.getBoundingClientRect(),p=0;function m(t){e.state.selectingText=!1,p=1/0,ct(t),i.input.focus(),rt(i.wrapper.ownerDocument,"mousemove",g),rt(i.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var g=Gr(e,function(t){0!==t.buttons&&pt(t)?function t(n){var a=++p,s=sr(e,n,!0,"rectangle"==r.unit);if(s)if(0!=ve(s,d)){e.curOp.focus=D(),f(s);var l=wr(i,o);(s.line>=l.to||s.line<l.from)&&setTimeout(Gr(e,function(){p==a&&t(n)}),150)}else{var c=n.clientY<h.top?-20:n.clientY>h.bottom?20:0;c&&setTimeout(Gr(e,function(){p==a&&(i.scroller.scrollTop+=c,t(n))}),50)}}(t):m(t)}),v=Gr(e,m);e.state.selectingText=v,tt(i.wrapper.ownerDocument,"mousemove",g),tt(i.wrapper.ownerDocument,"mouseup",v)}(e,r,t,o)}(t,r,o,e):ht(e)==n.scroller&&ct(e):2==i?(r&&Bi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):3==i&&(C?da(t,e):gr(t)))}}function la(e,t,n){if("char"==n)return new vi(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new vi(ge(t.line,0),ke(e.doc,ge(t.line+1,0)));var r=n(e,t);return new vi(r.from,r.to)}function ca(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ct(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!st(e,n))return dt(t);o-=s.top-a.viewOffset;for(var l=0;l<e.options.gutters.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i)return it(e,n,e,he(e.doc,o),e.options.gutters[l],t),dt(t)}}function ua(e,t){return ca(e,t,"gutterClick",!0)}function da(e,t){_n(e.display,t)||function(e,t){return!!st(e,"gutterContextMenu")&&ca(e,t,"gutterContextMenu",!1)}(e,t)||ot(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function fa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Wn(e)}aa.prototype.compare=function(e,t,n){return this.time+400>e&&0==ve(t,this.pos)&&n==this.button};var ha={toString:function(){return"CodeMirror.Init"}},pa={},ma={};function ga(e){ui(e),Zr(e),_r(e)}function va(e,t,n){if(!t!=!(n&&n!=ha)){var r=e.display.dragFunctions,i=t?tt:rt;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function ya(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(L(e.display.wrapper,"CodeMirror-wrap"),Je(e)),ar(e),Zr(e),Wn(e),setTimeout(function(){return Ir(e)},100)}function ba(e,t){var r=this;if(!(this instanceof ba))return new ba(e,t);this.options=t=t?z(t):{},z(pa,t,!1),di(t);var i=t.value;"string"==typeof i&&(i=new Co(i,t.mode,null,t.lineSeparator,t.direction)),this.doc=i;var o=new ba.inputStyles[t.inputStyle](this),a=this.display=new function(e,t,r){var i=this;this.input=r,i.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=P("div",null,"CodeMirror-code"),i.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=A("div",null,"CodeMirror-cursors"),i.measure=A("div",null,"CodeMirror-measure"),i.lineMeasure=A("div",null,"CodeMirror-measure"),i.lineSpace=P("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=P("div",[i.lineSpace],"CodeMirror-lines");i.mover=A("div",[o],null,"position: relative"),i.sizer=A("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=A("div",null,null,"position: absolute; height: "+H+"px; width: 1px;"),i.gutters=A("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=A("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=A("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),s&&l<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),c||n&&y||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,r.init(i)}(e,i,o);for(var u in a.wrapper.CodeMirror=this,ui(this),fa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Fr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new W,keySeq:null,specialChars:null},t.autofocus&&!y&&a.input.focus(),s&&l<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(e){var t=e.display;tt(t.scroller,"mousedown",Gr(e,sa)),tt(t.scroller,"dblclick",s&&l<11?Gr(e,function(t){if(!ot(e,t)){var n=sr(e,t);if(n&&!ua(e,t)&&!_n(e.display,t)){ct(t);var r=e.findWordAt(n);Bi(e.doc,r.anchor,r.head)}}}):function(t){return ot(e,t)||ct(t)}),C||tt(t.scroller,"contextmenu",function(t){return da(e,t)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),(r=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}tt(t.scroller,"touchstart",function(i){if(!ot(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!ua(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),tt(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),tt(t.scroller,"touchend",function(n){var r=t.activeTouch;if(r&&!_n(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!r.prev||o(r,r.prev)?new vi(s,s):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(s):new vi(ge(s.line,0),ke(e.doc,ge(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),ct(n)}i()}),tt(t.scroller,"touchcancel",i),tt(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ar(e,t.scroller.scrollTop),Er(e,t.scroller.scrollLeft,!0),it(e,"scroll",e))}),tt(t.scroller,"mousewheel",function(t){return mi(e,t)}),tt(t.scroller,"DOMMouseScroll",function(t){return mi(e,t)}),tt(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){ot(e,t)||ft(t)},over:function(t){ot(e,t)||(function(e,t){var n=sr(e,t);if(n){var r=document.createDocumentFragment();dr(e,n,r),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),O(e.display.dragCursor,r)}}(e,t),ft(t))},start:function(t){return function(e,t){if(s&&(!e.state.draggingText||+new Date-So<100))ft(t);else if(!ot(e,t)&&!_n(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}(e,t)},drop:Gr(e,Mo),leave:function(t){ot(e,t)||Lo(e)}};var a=t.input.getField();tt(a,"keyup",function(t){return na.call(e,t)}),tt(a,"keydown",Gr(e,ta)),tt(a,"keypress",Gr(e,ra)),tt(a,"focus",function(t){return vr(e,t)}),tt(a,"blur",function(t){return yr(e,t)})}(this),function(){var e;Oo||(tt(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,To(Ao)},100))}),tt(window,"blur",function(){return To(yr)}),Oo=!0)}(),Br(this),this.curOp.forceUpdate=!0,Oi(this,i),t.autofocus&&!y||this.hasFocus()?setTimeout(R(vr,this),20):yr(this),ma)ma.hasOwnProperty(u)&&ma[u](r,t[u],ha);kr(this),t.finishInit&&t.finishInit(this);for(var d=0;d<xa.length;++d)xa[d](r);Hr(this),c&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}ba.defaults=pa,ba.optionHandlers=ma;var xa=[];function wa(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=zt(e,t).state:n="prev");var a=e.options.tabSize,s=le(o,t),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==q||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?F(le(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)f+=a,d+="\t";if(f<c&&(d+=J(c-f)),d!=u)return so(o,d,ge(t,0),ge(t,u.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<u.length){var g=ge(t,u.length);qi(o,p,new vi(g,g));break}}}ba.defineInitHook=function(e){return xa.push(e)};var _a=null;function ka(e){_a=e}function Ca(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a,s=e.state.pasteIncoming||"paste"==i,l=wt(t),c=null;if(s&&r.ranges.length>1)if(_a&&_a.text.join("\n")==t){if(r.ranges.length%_a.text.length==0){c=[];for(var u=0;u<_a.text.length;u++)c.push(o.splitLines(_a.text[u]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=Z(l,function(e){return[e]}));for(var d=r.ranges.length-1;d>=0;d--){var f=r.ranges[d],h=f.from(),p=f.to();f.empty()&&(n&&n>0?h=ge(h.line,h.ch-n):e.state.overwrite&&!s?p=ge(p.line,Math.min(le(o,p.line).text.length,p.ch+X(l).length)):_a&&_a.lineWise&&_a.text.join("\n")==t&&(h=p=ge(h.line,0))),a=e.curOp.updateInput;var m={from:h,to:p,text:c?c[d%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming?"cut":"+input")};no(e.doc,m),ln(e,"inputRead",e,m)}t&&!s&&Ma(e,t),Mr(e),e.curOp.updateInput=a,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Sa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||$r(t,function(){return Ca(t,n,0,null,"paste")}),!0}function Ma(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){a=wa(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(le(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=wa(e,i.head.line,"smart"));a&&ln(e,"electricInput",e,i.head.line)}}}function La(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:ge(i,0),head:ge(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Ta(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Oa(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return c?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),Ta(e),t}function Aa(e,t,n,r,i){var o=t,a=n,s=le(e,t.line);function l(r){var o,a;if(null==(o=i?function(e,t,n,r){var i=Qe(t,e.doc.direction);if(!i)return Uo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=Ze(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Uo(t,n,r);var s,l=function(e,n){return qo(t,e instanceof ge?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(s=s||En(e,t),Yn(e,t,s,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==r<0,f=l(n,d?1:-1);if(null!=f&&(d?f<=a.to&&f<=u.end:f>=a.from&&f>=u.begin)){var h=d?"before":"after";return new ge(n.line,f,h)}}var p=function(e,t,r){for(var o=function(e,t){return t?new ge(n.line,l(e,1),"before"):new ge(n.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],s=t>0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c<a.to)return o(c,s);if(c=s?a.from:l(a.to,-1),r.begin<=c&&c<r.end)return o(c,s)}},m=p(o+r,r,u);if(m)return m;var g=r>0?u.end:l(u.begin,-1);return null==g||r>0&&g==t.text.length||!(m=p(r>0?0:i.length-1,r,c(g)))?null:m}(e.cm,s,t,n):Uo(s,t,n))){if(r||(a=t.line+n)<e.first||a>=e.first+e.size||(t=new ge(a,t.ch,t.sticky),!(s=le(e,a))))return!1;t=Ko(i,e.cm,s,t.line,n)}else t=o;return!0}if("char"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var c=null,u="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||l(!f);f=!1){var h=s.text.charAt(t.ch)||"\n",p=ne(h,d)?"w":u&&"\n"==h?"n":!u||/\s/.test(h)?null:"p";if(!u||f||p||(p="s"),c&&c!=p){n<0&&(n=1,l(),t.sticky="after");break}if(p&&(c=p),n>0&&!l(!f))break}var m=Yi(e,t,o,a,!0);return ye(o,m)&&(m.hitSide=!0),m}function Pa(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*tr(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Xn(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Ea=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new W,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Da(e,t){var n=Pn(e,t.line);if(!n||n.hidden)return null;var r=le(e.doc,t.line),i=On(n,r,t.line),o=Qe(r,e.doc.direction),a="left";o&&(a=Ze(o,t.ch)%2?"right":"left");var s=In(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function ja(e,t){return t&&(e.bad=!0),e}function Na(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return ja(e.clipPos(ge(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Ia(o,t,n)}}function Ia(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!E(r,t))return ja(ge(fe(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?X(e.rest):e.line;return ja(ge(fe(o),o.text.length),i)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?l.map:c[i],a=0;a<o.length;a+=3){var s=o[a+2];if(s==t||s==n){var u=fe(i<0?e.line:e.rest[i]),d=o[a]+r;return(r<0||s!=t)&&(d=o[a+(r?1:0)]),ge(u,d)}}}var d=u(a,s,n);if(d)return ja(d,i);for(var f=s.nextSibling,h=a?a.nodeValue.length-n:0;f;f=f.nextSibling){if(d=u(f,f.firstChild,0))return ja(ge(d.line,d.ch-h),i);h+=f.textContent.length}for(var p=s.previousSibling,m=n;p;p=p.previousSibling){if(d=u(p,p.firstChild,-1))return ja(ge(d.line,d.ch+m),i);m+=p.textContent.length}}Ea.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){if(!ot(r,e)){if(r.somethingSelected())ka({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=La(r);ka({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,U),r.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var o=_a.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=Oa(),s=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),s.value=_a.text.join("\n");var l=document.activeElement;I(s),setTimeout(function(){r.display.lineSpace.removeChild(a),l.focus(),l==i&&n.showPrimarySelection()},50)}}Ta(i,r.options.spellcheck),tt(i,"paste",function(e){ot(r,e)||Sa(e,r)||l<=11&&setTimeout(Gr(r,function(){return t.updateFromDOM()}),20)}),tt(i,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),tt(i,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),tt(i,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),tt(i,"touchstart",function(){return n.forceCompositionEnd()}),tt(i,"input",function(){t.composing||t.readFromDOMSoon()}),tt(i,"copy",o),tt(i,"cut",o)},Ea.prototype.prepareSelection=function(){var e=ur(this.cm,!1);return e.focus=this.cm.state.focused,e},Ea.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ea.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ea.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=Na(t,e.anchorNode,e.anchorOffset),s=Na(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=ve(we(a,s),i)||0!=ve(xe(a,s),o)){var l=t.display.view,c=i.line>=t.display.viewFrom&&Da(t,i)||{node:l[0].measure.map[2],offset:0},u=o.line<t.display.viewTo&&Da(t,o);if(!u){var d=l[l.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;u={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(c&&u){var h,p=e.rangeCount&&e.getRangeAt(0);try{h=M(c.node,c.offset,u.offset,u.node)}catch(e){}h&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),p&&null==e.anchorNode?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ea.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Ea.prototype.showMultipleSelections=function(e){O(this.cm.display.cursorDiv,e.cursors),O(this.cm.display.selectionDiv,e.selection)},Ea.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ea.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return E(this.div,t)},Ea.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ea.prototype.blur=function(){this.div.blur()},Ea.prototype.getField=function(){return this.div},Ea.prototype.supportsTouch=function(){return!0},Ea.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():$r(this.cm,function(){return e.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))})},Ea.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ea.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&d&&this.cm.options.gutters.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Na(t,e.anchorNode,e.anchorOffset),r=Na(t,e.focusNode,e.focusOffset);n&&r&&$r(t,function(){Vi(t.doc,bi(n,r),U),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Ea.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=ge(a.line-1,le(r.doc,a.line-1).length)),s.ch==le(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=ge(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=lr(r,a.line))?(t=fe(i.view[0].line),n=i.view[0].node):(t=fe(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,c,u=lr(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=fe(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function u(e){e&&(c(),o+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var o,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(ge(r,0),ge(i+1,0),(g=+f,function(e){return e.id==g}));return void(h.length&&(o=h[0].find(0))&&u(ce(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&c();for(var m=0;m<t.childNodes.length;m++)d(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),p&&(a=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var g}for(;d(t),t!=n;)t=t.nextSibling,l=!1;return o}(r,n,c,t,l)),f=ce(r.doc,ge(t,0),ge(l,le(r.doc,l).text.length));d.length>1&&f.length>1;)if(X(d)==X(f))d.pop(),f.pop(),l--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var h=0,p=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);h<v&&m.charCodeAt(h)==g.charCodeAt(h);)++h;for(var y=X(d),b=X(f),x=Math.min(y.length-(1==d.length?h:0),b.length-(1==f.length?h:0));p<x&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==d.length&&1==f.length&&t==a.line)for(;h&&h>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var w=ge(t,h),_=ge(l,f.length?X(f).length-p:0);return d.length>1||d[0]||ve(w,_)?(so(r.doc,d,w,_,"+input"),!0):void 0},Ea.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ea.prototype.reset=function(){this.forceCompositionEnd()},Ea.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ea.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))},Ea.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||$r(this.cm,function(){return Zr(e.cm)})},Ea.prototype.setUneditable=function(e){e.contentEditable="false"},Ea.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Gr(this.cm,Ca)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ea.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ea.prototype.onContextMenu=function(){},Ea.prototype.resetPosition=function(){},Ea.prototype.needsContentAttribute=!0;var Ra=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new W,this.hasSelection=!1,this.composing=null};Ra.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ot(r,e)){if(r.somethingSelected())ka({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=La(r);ka({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,U):(n.prevInput="",i.value=t.text.join("\n"),I(i))}"cut"==e.type&&(r.state.cutIncoming=!0)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),tt(i,"input",function(){s&&l>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),tt(i,"paste",function(e){ot(r,e)||Sa(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),tt(i,"cut",o),tt(i,"copy",o),tt(e.scroller,"paste",function(t){_n(e,t)||ot(r,t)||(r.state.pasteIncoming=!0,n.focus())}),tt(e.lineSpace,"selectstart",function(t){_n(e,t)||ct(t)}),tt(i,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),tt(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ra.prototype.createField=function(e){this.wrapper=Oa(),this.textarea=this.wrapper.firstChild},Ra.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ur(e);if(e.options.moveInputWithCursor){var i=$n(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Ra.prototype.showSelection=function(e){var t=this.cm.display;O(t.cursorDiv,e.cursors),O(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ra.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&I(this.textarea),s&&l>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&l>=9&&(this.hasSelection=null))}},Ra.prototype.getField=function(){return this.textarea},Ra.prototype.supportsTouch=function(){return!1},Ra.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ra.prototype.blur=function(){this.textarea.blur()},Ra.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ra.prototype.receivedFocus=function(){this.slowPoll()},Ra.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ra.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))})},Ra.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||_t(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(s&&l>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,c=Math.min(r.length,i.length);a<c&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return $r(t,function(){Ca(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ra.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ra.prototype.onKeyPress=function(){s&&l>=9&&(this.hasSelection=null),this.fastPoll()},Ra.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea,o=sr(n,e),a=r.scroller.scrollTop;if(o&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Gr(n,Vi)(n.doc,bi(o),U);var u=i.style.cssText,d=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var h,p=t.wrapper.getBoundingClientRect();i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",c&&(h=window.scrollY),r.input.focus(),c&&window.scrollTo(null,h),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=!0,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),s&&l>=9&&m(),C?(ft(e),tt(window,"mouseup",function e(){rt(window,"mouseup",e),setTimeout(g,20)})):setTimeout(g,50)}function m(){if(null!=i.selectionStart){var e=n.somethingSelected(),o=""+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=u,s&&l<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),null!=i.selectionStart){(!s||s&&l<9)&&m();var e=0;r.detectingSelectAll=setTimeout(function o(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?Gr(n,eo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())},200)}}},Ra.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Ra.prototype.setUneditable=function(){},Ra.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=ha&&i(e,t,n)}:i)}e.defineOption=n,e.Init=ha,n("value","",function(e,t){return e.setValue(t)},!0),n("mode",null,function(e,t){e.doc.modeOption=t,Ci(e)},!0),n("indentUnit",2,Ci,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(e){Si(e),Wn(e),Zr(e)},!0),n("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(ge(r,o))}r++});for(var i=n.length-1;i>=0;i--)so(e.doc,t,n[i],ge(n[i].line,n[i].ch+t.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=ha&&e.refresh()}),n("specialCharPlaceholder",Yt,function(e){return e.refresh()},!0),n("electricChars",!0),n("inputStyle",y?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",function(e){fa(e),ga(e)},!0),n("keyMap","default",function(e,t,n){var r=Bo(t),i=n!=ha&&Bo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,ya,!0),n("gutters",[],function(e){di(e.options),ga(e)},!0),n("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?ir(e.display)+"px":"0",e.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(e){return Ir(e)},!0),n("scrollbarStyle","native",function(e){Fr(e),Ir(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n("lineNumbers",!1,function(e){di(e.options),ga(e)},!0),n("firstLineNumber",1,ga,!0),n("lineNumberFormatter",function(e){return e},ga,!0),n("showCursorWhenSelecting",!1,cr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("readOnly",!1,function(e,t){"nocursor"==t&&(yr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),n("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),n("dragDrop",!0,va),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,cr,!0),n("singleCursorHeightPerLine",!0,cr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Si,!0),n("addModeClass",!1,Si,!0),n("pollInterval",100),n("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),n("historyEventDelay",1250),n("viewportMargin",10,function(e){return e.refresh()},!0),n("maxHighlightLength",1e4,Si,!0),n("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),n("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),n("autofocus",null),n("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(ba),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&Gr(this,t[e])(this,n,i),it(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Bo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Jr(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,Zr(this)}),removeOverlay:Jr(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void Zr(this)}}),indentLine:Jr(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),pe(this.doc,e)&&wa(this,e,t,n)}),indentSelection:Jr(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(wa(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Mr(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)wa(this,l,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&qi(this.doc,r,new vi(o,c[r].to()),U)}}}),getTokenAt:function(e,t){return qt(this,e,t)},getLineTokens:function(e,t){return qt(this,ge(e),t,!0)},getTokenTypeAt:function(e){e=ke(this.doc,e);var t,n=Rt(this,le(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var s=i[o[t][a]];s&&r.push(s)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var l=0;l<i._global.length;l++){var c=i._global[l];c.pred(o,this)&&-1==B(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return zt(this,(e=_e(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return $n(this,null==e?n.head:"object"==(void 0===e?"undefined":a(e))?ke(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Vn(this,ke(this.doc,e),t||"page")},coordsChar:function(e,t){return Xn(this,(e=Kn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Kn(this,{top:e,left:0},t||"page").top,he(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=le(this.doc,e)}else r=e;return Un(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-$e(r):0)},defaultTextHeight:function(){return tr(this.display)},defaultCharWidth:function(){return nr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,a,s=this.display,l=(e=$n(this,ke(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var u=Math.max(s.wrapper.clientHeight,this.doc.height),d=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>u)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=u&&(l=e.bottom),c+t.offsetWidth>d&&(c=d-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(c=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(null!=(a=Cr(o=this,{left:c,top:l,right:c+t.offsetWidth,bottom:l+t.offsetHeight})).scrollTop&&Ar(o,a.scrollTop),null!=a.scrollLeft&&Er(o,a.scrollLeft))},triggerOnKeyDown:Jr(ta),triggerOnKeyPress:Jr(ra),triggerOnKeyUp:na,triggerOnMouseDown:Jr(sa),execCommand:function(e){if(Vo.hasOwnProperty(e))return Vo[e].call(null,this)},triggerElectric:Jr(function(e){Ma(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ke(this.doc,e),a=0;a<t&&!(o=Aa(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:Jr(function(e,t){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Aa(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},V)}),deleteH:Jr(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Ho(this,function(n){var i=Aa(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var a=ke(this.doc,e),s=0;s<t;++s){var l=$n(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Pa(this,l,i,n)).hitSide)break}return a},moveV:Jr(function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return e<0?a.from():a.to();var s=$n(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var l=Pa(n,s,e,t);return"page"==t&&a==r.sel.primary()&&Sr(n,Vn(n,l,"div").top-s.top),l},V),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=le(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),a=ne(o,i)?function(e){return ne(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ne(e)};n>0&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new vi(ge(e.line,n),ge(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):L(this.display.cursorDiv,"CodeMirror-overwrite"),it(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Jr(function(e,t){Lr(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Mn(this)-this.display.barHeight,width:e.scrollWidth-Mn(this)-this.display.barWidth,clientHeight:Tn(this),clientWidth:Ln(this)}},scrollIntoView:Jr(function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ge(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Tr(e),e.curOp.scrollToPos=t}(this,e):Or(this,e.from,e.to,e.margin)}),setSize:Jr(function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Fn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Yr(n,i,"widget");break}++i}),this.curOp.forceUpdate=!0,it(this,"refresh",this)}),operation:function(e){return $r(this,e)},startOperation:function(){return Br(this)},endOperation:function(){return Hr(this)},refresh:Jr(function(){var e=this.display.cachedTextHeight;Zr(this),this.curOp.forceUpdate=!0,Wn(this),Lr(this,this.doc.scrollLeft,this.doc.scrollTop),li(this),(null==e||Math.abs(e-tr(this.display))>.5)&&ar(this),it(this,"refresh",this)}),swapDoc:Jr(function(e){var t=this.doc;return t.cm=null,Oi(this,e),Wn(this),this.display.input.reset(),Lr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(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}},lt(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(ba);var za,Fa="iter insert remove copy getEditor constructor".split(" ");for(var Wa in Co.prototype)Co.prototype.hasOwnProperty(Wa)&&B(Fa,Wa)<0&&(ba.prototype[Wa]=function(e){return function(){return e.apply(this.doc,arguments)}}(Co.prototype[Wa]));return lt(Co),ba.inputStyles={textarea:Ra,contenteditable:Ea},ba.defineMode=function(e){ba.defaults.mode||"null"==e||(ba.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),St[e]=t}.apply(this,arguments)},ba.defineMIME=function(e,t){Mt[e]=t},ba.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ba.defineMIME("text/plain","null"),ba.defineExtension=function(e,t){ba.prototype[e]=t},ba.defineDocExtension=function(e,t){Co.prototype[e]=t},ba.fromTextArea=function(e,t){if((t=t?z(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=D();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(tt(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(rt(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=ba(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s},(za=ba).off=rt,za.on=tt,za.wheelEventPixels=function(e){var t=pi(e);return t.x*=hi,t.y*=hi,t},za.Doc=Co,za.splitLines=wt,za.countColumn=F,za.findColumn=$,za.isWordChar=te,za.Pass=q,za.signal=it,za.Line=Vt,za.changeEnd=xi,za.scrollbarModel=zr,za.Pos=ge,za.cmpPos=ve,za.modes=St,za.mimeModes=Mt,za.resolveMode=Lt,za.getMode=Tt,za.modeExtensions=Ot,za.extendMode=function(e,t){z(t,Ot.hasOwnProperty(e)?Ot[e]:Ot[e]={})},za.copyState=At,za.startState=Et,za.innerMode=Pt,za.commands=Vo,za.keyMap=No,za.keyName=Wo,za.isModifierKey=zo,za.lookupKey=Ro,za.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Z(n.split(" "),Io),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=r):(s=i.slice(0,o+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var c in t)e[c]=t[c];return e},za.StringStream=Dt,za.SharedTextMarker=xo,za.TextMarker=yo,za.LineWidget=mo,za.e_preventDefault=ct,za.e_stopPropagation=ut,za.e_stop=ft,za.addClass=j,za.contains=E,za.rmClass=L,za.keyNames=Po,ba.version="5.38.0",ba},"object"===a(t)&&void 0!==e?e.exports=o():void 0===(i="function"==typeof(r=o)?r.call(t,n,t,e):r)||(e.exports=i)},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<e.start)&&(i.streamSeen=e,i.basePos=i.overlayPos=e.start),e.start==i.basePos&&(i.baseCur=t.token(e,i.base),i.basePos=e.pos),e.start==i.overlayPos&&(e.pos=e.start,i.overlayCur=n.token(e,i.overlay),i.overlayPos=e.pos),e.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||r&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:t.indent&&function(e,n){return t.indent(e.base,n)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){var i,o;return t.blankLine&&(i=t.blankLine(e.base)),n.blankLine&&(o=n.blankLine(e.overlay)),null==o?i:r&&null!=i?i+" "+o:o}}}},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",function(r,i){var o,a,s=r.indentUnit,l={},c=i.htmlMode?t:n;for(var u in c)l[u]=c[u];for(var u in i)l[u]=i[u];function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return"<"==r?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(h("atom","]]>")):null:e.match("--")?n(h("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(function e(t){return function(n,r){for(var i;null!=(i=n.next());){if("<"==i)return r.tokenize=e(t+1),r.tokenize(n,r);if(">"==i){if(1==t){r.tokenize=d;break}return r.tokenize=e(t-1),r.tokenize(n,r)}}return"meta"}}(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=h("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function f(e,t){var n,r,i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=d,o=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return o="equals",null;if("<"==i){t.tokenize=d,t.state=g,t.tagName=t.tagStart=null;var a=t.tokenize(e,t);return a?a+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(n=i,(r=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=f;break}return"string"}).isInAttribute=!0,r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function p(e){e.context&&(e.context=e.context.prev)}function m(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;p(e)}}function g(e,t,n){return"openTag"==e?(n.tagStart=t.column(),v):"closeTag"==e?y:g}function v(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",w):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",w(e,t,n)):(a="error",v)}function y(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&p(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",b):(a="tag error",x)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",b(e,t,n)):(a="error",x)}function b(e,t,n){return"endTag"!=e?(a="error",b):(p(n),g)}function x(e,t,n){return a="error",b(e,0,n)}function w(e,t,n){if("word"==e)return a="attribute",_;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?m(n,r):(m(n,r),n.context=new function(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}(n,r,i==n.indented)),g}return a="error",w}function _(e,t,n){return"equals"==e?k:(l.allowMissing||(a="error"),w(e,0,n))}function k(e,t,n){return"string"==e?C:"word"==e&&l.allowUnquoted?(a="string",w):(a="error",w(e,0,n))}function C(e,t,n){return"string"==e?C:w(e,0,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:g,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])for(;i;){if(i.tagName==o[2]){i=i.prev;break}if(!l.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(o)for(;i;){var a=l.contextGrabbers[i.tagName];if(!a||!a.hasOwnProperty(o[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+s:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==k&&(e.state=w)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e){void 0===e&&(e={}),this.trusted=!!e.trusted,this._data=e.data||{},this._metadata=e.metadata||{},this._callback=e.callback||r.noOp}return Object.defineProperty(e.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return this._metadata},enumerable:!0,configurable:!0}),e.prototype.setData=function(e){this._data=e.data||this._data,this._metadata=e.metadata||this._metadata,this._callback(e)},e}();t.MimeModel=i,(r||(r={})).noOp=function(){}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=/(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[{}$]|[{}]|(?:\n\s*)+|@@\d+@@|\\\\(?:\(|\)|\[|\]))/i;function i(e,t,n,r,i){var o=i.slice(e,t+1).join("").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");for(navigator&&"Microsoft Internet Explorer"===navigator.appName&&(o=o.replace(/(%[^\n]*)\n/g,"$1<br/>\n"));t>e;)i[t]="",t--;return i[e]="@@"+r.length+"@@",n&&(o=n(o)),r.push(o),i}t.removeMath=function(e){var t,n=[],o=null,a=null,s=null,l=0;/`/.test(e)?(e=e.replace(/~/g,"~T").replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm,function(e){return e.replace(/\$/g,"~D")}),t=function(e){return e.replace(/~([TD])/g,function(e,t){return"T"===t?"~":"$"})}):t=function(e){return e};for(var c=e.replace(/\r\n?/g,"\n").split(r),u=1,d=c.length;u<d;u+=2){var f=c[u];"@"===f.charAt(0)?(c[u]="@@"+n.length+"@@",n.push(f)):null!==o?f===a?l?s=u:(c=i(o,u,t,n,c),o=null,a=null,s=null):f.match(/\n.*\n/)?(null!==s&&(c=i(o,u=s,t,n,c)),o=null,a=null,s=null,l=0):"{"===f?l++:"}"===f&&l&&l--:"$"===f||"$$"===f?(o=u,a=f,l=0):"\\\\("===f||"\\\\["===f?(o=u,a="("===f.slice(-1)?"\\\\)":"\\\\]",l=0):"begin"===f.substr(1,5)&&(o=u,a="\\end"+f.substr(6),l=0)}return null!==o&&null!==s&&(c=i(o,s,t,n,c),o=null,a=null,s=null),{text:t(c.join("")),math:n}},t.replaceMath=function(e,t){return e.replace(/@@(\d+)@@/g,function(e,n){var r=t[n];return"\\\\("===r.substr(0,3)&&"\\\\)"===r.substr(r.length-3)?r="\\("+r.substring(3,r.length-3)+"\\)":"\\\\["===r.substr(0,3)&&"\\\\]"===r.substr(r.length-3)&&(r="\\["+r.substring(3,r.length-3)+"\\]"),r})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=n(23),o=function(){function e(){}return e.prototype.getMimeTypeByLanguage=function(e){var t=e.file_extension||"";return i.Mode.findBest(e.codemirror_mode||{mimetype:e.mimetype,name:e.name,ext:[t.split(".").slice(-1)[0]]}).mime},e.prototype.getMimeTypeByFilePath=function(e){var t=r.PathExt.extname(e);return".ipy"===t?"text/x-python":".md"===t?"text/x-ipythongfm":(i.Mode.findByFileName(e)||i.Mode.findBest("")).mime},e}();t.CodeMirrorMimeTypeService=o},function(e,t,n){"use strict"},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0});var i=n(5);n(85),r(n(84)),r(n(83)),r(n(82)),r(n(81)),t.IEditorServices=new i.Token("@jupyterlab/codeeditor:IEditorServices")},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(5),a=n(3),s=n(8),l=n(2),c=n(9),u=n(34),d=n(4),f=n(23);n(77),n(22),n(76),n(75),n(9),n(9),n(74),n(73),n(9);var h,p="jp-CodeMirrorEditor",m=function(){function e(e){var t=this;this.edgeRequested=new l.Signal(this),this.selectionMarkers={},this._keydownHandlers=new Array,this._changeGuard=!1,this._uuid="",this._needsRefresh=!1,this._isDisposed=!1,this._lastChange=null,this._timer=-1;var n=this.host=e.host;n.classList.add(p),n.classList.add("jp-Editor"),n.addEventListener("focus",this,!0),n.addEventListener("blur",this,!0),n.addEventListener("scroll",this,!0),this._uuid=e.uuid||d.uuid();var o=e.selectionStyle||{};this._selectionStyle=r({},u.CodeEditor.defaultSelectionStyle,o);var s=this._model=e.model,c=this._editor=i(n,{});h.handleConfig(c,e.config||{}),c.getDoc().setValue(s.value.text),this._onMimeTypeChanged(),this._onCursorActivity(),this._timer=window.setInterval(function(){t._checkSync()},3e3),s.value.changed.connect(this._onValueChanged,this),s.mimeTypeChanged.connect(this._onMimeTypeChanged,this),s.selections.changed.connect(this._onSelectionsChanged,this),i.on(c,"keydown",function(e,n){-1===a.ArrayExt.findFirstIndex(t._keydownHandlers,function(e){return!0===e(t,n)&&(n.preventDefault(),!0)})&&t.onKeydown(n)}),i.on(c,"cursorActivity",function(){return t._onCursorActivity()}),i.on(c.getDoc(),"beforeChange",function(e,n){t._beforeDocChanged(e,n)}),i.on(c.getDoc(),"change",function(e,n){"setValue"===n.origin&&t.hasFocus()&&t.refresh(),t._lastChange=n}),c.getWrapperElement().addEventListener("paste",function(){t.hasFocus()&&t.refresh()})}return Object.defineProperty(e.prototype,"uuid",{get:function(){return this._uuid},set:function(e){this._uuid=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionStyle",{get:function(){return this._selectionStyle},set:function(e){this._selectionStyle=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"editor",{get:function(){return this._editor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"doc",{get:function(){return this._editor.getDoc()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.doc.lineCount()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){return this._model},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineHeight",{get:function(){return this._editor.defaultTextHeight()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"charWidth",{get:function(){return this._editor.defaultCharWidth()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(this._isDisposed=!0,this.host.removeEventListener("focus",this,!0),this.host.removeEventListener("blur",this,!0),this.host.removeEventListener("scroll",this,!0),this._keydownHandlers.length=0,window.clearInterval(this._timer),l.Signal.clearData(this))},e.prototype.getOption=function(e){return h.getOption(this.editor,e)},e.prototype.setOption=function(e,t){h.setOption(this.editor,e,t)},e.prototype.getLine=function(e){return this.doc.getLine(e)},e.prototype.getOffsetAt=function(e){return this.doc.indexFromPos({ch:e.column,line:e.line})},e.prototype.getPositionAt=function(e){var t=this.doc.posFromIndex(e),n=t.ch;return{line:t.line,column:n}},e.prototype.undo=function(){this.doc.undo()},e.prototype.redo=function(){this.doc.redo()},e.prototype.clearHistory=function(){this.doc.clearHistory()},e.prototype.focus=function(){this._editor.focus()},e.prototype.hasFocus=function(){return this._editor.getWrapperElement().contains(document.activeElement)},e.prototype.blur=function(){this._editor.getInputField().blur()},e.prototype.refresh=function(){this._editor.refresh(),this._needsRefresh=!1},e.prototype.resizeToFit=function(){this.hasFocus()?this.refresh():this._needsRefresh=!0,this._clearHover()},e.prototype.addKeydownHandler=function(e){var t=this;return this._keydownHandlers.push(e),new s.DisposableDelegate(function(){a.ArrayExt.removeAllWhere(t._keydownHandlers,function(t){return t===e})})},e.prototype.setSize=function(e){e?this._editor.setSize(e.width,e.height):this._editor.setSize(null,null),this._needsRefresh=!1},e.prototype.revealPosition=function(e){var t=this._toCodeMirrorPosition(e);this._editor.scrollIntoView(t)},e.prototype.revealSelection=function(e){var t=this._toCodeMirrorRange(e);this._editor.scrollIntoView(t)},e.prototype.getCoordinateForPosition=function(e){var t=this._toCodeMirrorPosition(e);return this.editor.charCoords(t,"page")},e.prototype.getPositionForCoordinate=function(e){return this._toPosition(this.editor.coordsChar(e))||null},e.prototype.getCursorPosition=function(){var e=this.doc.getCursor();return this._toPosition(e)},e.prototype.setCursorPosition=function(e){var t=this._toCodeMirrorPosition(e);this.doc.setCursor(t),this.editor.hasFocus()||this.model.selections.set(this.uuid,this.getSelections())},e.prototype.getSelection=function(){return this.getSelections()[0]},e.prototype.setSelection=function(e){this.setSelections([e])},e.prototype.getSelections=function(){var e=this,t=this.doc.listSelections();if(t.length>0)return t.map(function(t){return e._toSelection(t)});var n=this.doc.getCursor();return[this._toSelection({anchor:n,head:n})]},e.prototype.setSelections=function(e){var t=this._toCodeMirrorSelections(e);this.doc.setSelections(t,0)},e.prototype.newIndentedLine=function(){this.execCommand("newlineAndIndent")},e.prototype.execCommand=function(e){this._editor.execCommand(e)},e.prototype.onKeydown=function(e){var t=this.getCursorPosition(),n=t.line,r=t.column;if(0===n&&0===r&&38===e.keyCode)return e.shiftKey||this.edgeRequested.emit("top"),!1;var i=this.lineCount-1,o=this.getLine(i).length;return n===i&&r===o&&40===e.keyCode&&(e.shiftKey||this.edgeRequested.emit("bottom"),!1)},e.prototype._toCodeMirrorSelections=function(e){var t=this;if(e.length>0)return e.map(function(e){return t._toCodeMirrorSelection(e)});var n={line:0,ch:0};return[{anchor:n,head:n}]},e.prototype._onMimeTypeChanged=function(){var e=this._model.mimeType,t=this._editor;f.Mode.ensure(e).then(function(e){t.setOption("mode",e.mime)});var n=t.getOption("extraKeys")||{};"text/plain"!==e&&"text/x-ipythongfm"!==e?n.Backspace="delSpaceToPrevTabStop":delete n.Backspace,t.setOption("extraKeys",n)},e.prototype._onSelectionsChanged=function(e,t){var n=t.key;n!==this.uuid&&(this._cleanSelections(n),"remove"!==t.type&&t.newValue&&this._markSelections(n,t.newValue))},e.prototype._cleanSelections=function(e){var t=this.selectionMarkers[e];t&&t.forEach(function(e){e.clear()}),delete this.selectionMarkers[e]},e.prototype._markSelections=function(e,t){var n,i=this,a=[];e===this._hoverId&&this._clearHover(),this._model.modelDB.collaborators&&(n=this._model.modelDB.collaborators.get(e)),t.forEach(function(e){if(o.JSONExt.deepEqual(e.start,e.end)){if(n){var t=i._getCaret(n);a.push(i.doc.setBookmark(i._toCodeMirrorPosition(e.end),{widget:t}))}}else{var s,l=i._toCodeMirrorSelection(e),c=l.anchor,u=l.head;s=n?i._toTextMarkerOptions(r({},e.style,{color:n.color})):i._toTextMarkerOptions(e.style),a.push(i.doc.markText(c,u,s))}}),this.selectionMarkers[e]=a},e.prototype._onCursorActivity=function(){if(this._editor.hasFocus()){var e=this.getSelections();this.model.selections.set(this.uuid,e)}},e.prototype._toSelection=function(e){return{uuid:this.uuid,start:this._toPosition(e.anchor),end:this._toPosition(e.head),style:this.selectionStyle}},e.prototype._toTextMarkerOptions=function(e){var t="background-color: rgba( "+parseInt(e.color.slice(1,3),16)+", "+parseInt(e.color.slice(3,5),16)+", "+parseInt(e.color.slice(5,7),16)+", 0.15)";return{className:e.className,title:e.displayName,css:t}},e.prototype._toCodeMirrorSelection=function(e){var t=e.start.line<e.end.line||e.start.line===e.end.line&&e.start.column<=e.end.column,n=t?e.start:e.end,r=t?e.end:e.start;return{anchor:this._toCodeMirrorPosition(n),head:this._toCodeMirrorPosition(r)}},e.prototype._toCodeMirrorRange=function(e){return{from:this._toCodeMirrorPosition(e.start),to:this._toCodeMirrorPosition(e.end)}},e.prototype._toPosition=function(e){return{line:e.line,column:e.ch}},e.prototype._toCodeMirrorPosition=function(e){return{line:e.line,ch:e.column}},e.prototype._onValueChanged=function(e,t){if(!this._changeGuard){this._changeGuard=!0;var n=this.doc;switch(t.type){case"insert":var r=n.posFromIndex(t.start);n.replaceRange(t.value,r,r);break;case"remove":var i=n.posFromIndex(t.start),o=n.posFromIndex(t.end);n.replaceRange("",i,o);break;case"set":n.setValue(t.value)}this._changeGuard=!1}},e.prototype._beforeDocChanged=function(e,t){if(!this._changeGuard){this._changeGuard=!0;var n=this._model.value,r=e.indexFromPos(t.from),i=e.indexFromPos(t.to),o=t.text.join("\n");i!==r&&n.remove(r,i),o&&n.insert(r,o),this._changeGuard=!1}},e.prototype.handleEvent=function(e){switch(e.type){case"focus":this._evtFocus(e);break;case"blur":this._evtBlur(e);break;case"scroll":this._evtScroll()}},e.prototype._evtFocus=function(e){this._needsRefresh&&this.refresh(),this.host.classList.add("jp-mod-focused")},e.prototype._evtBlur=function(e){this.host.classList.remove("jp-mod-focused")},e.prototype._evtScroll=function(){this._clearHover()},e.prototype._clearHover=function(){this._caretHover&&(window.clearTimeout(this._hoverTimeout),document.body.removeChild(this._caretHover),this._caretHover=null)},e.prototype._getCaret=function(e){var t=this,n=e?e.displayName:"Anonymous",r=e?e.color:this._selectionStyle.color,i=document.createElement("span");return i.className="jp-CollaboratorCursor",i.style.borderBottomColor=r,i.onmouseenter=function(){t._clearHover(),t._hoverId=e.sessionId;var o=i.getBoundingClientRect(),a=document.createElement("div");a.className="jp-CollaboratorCursor-hover",a.style.left=String(o.left)+"px",a.style.top=String(o.bottom)+"px",a.textContent=n,a.style.backgroundColor=r,a.onmouseenter=function(){window.clearTimeout(t._hoverTimeout)},a.onmouseleave=function(){t._hoverTimeout=window.setTimeout(function(){t._clearHover()},1e3)},t._caretHover=a,document.body.appendChild(a)},i.onmouseleave=function(){t._hoverTimeout=window.setTimeout(function(){t._clearHover()},1e3)},i},e.prototype._checkSync=function(){var e=this._lastChange;if(e){this._lastChange=null;var t=this._editor,n=t.getDoc();n.getValue()!==this._model.value.text&&(c.showDialog({title:"Code Editor out of Sync",body:"Please open your browser JavaScript console for bug report instructions"}),console.log("Please paste the following to https://github.com/jupyterlab/jupyterlab/issues/2951"),console.log(JSON.stringify({model:this._model.value.text,view:n.getValue(),selections:this.getSelections(),cursor:this.getCursorPosition(),lineSep:t.getOption("lineSeparator"),mode:t.getOption("mode"),change:e})))}},e}();t.CodeMirrorEditor=m,function(e){e.defaultConfig=r({},u.CodeEditor.defaultConfig,{mode:"null",theme:"jupyter",smartIndent:!0,electricChars:!0,keyMap:"default",extraKeys:null,gutters:Object.freeze([]),fixedGutter:!0,showCursorWhenSelecting:!1,coverGutterNextToScrollbar:!1,dragDrop:!0,lineSeparator:null,scrollbarStyle:"native",lineWiseCopyCut:!0,scrollPastEnd:!1}),e.addCommand=function(e,t){i.commands[e]=t}}(m=t.CodeMirrorEditor||(t.CodeMirrorEditor={})),t.CodeMirrorEditor=m,function(e){function t(e,t){return e.line===t.line&&e.ch===t.ch}function n(e,t){switch(t){case"lineWrap":return e.getOption("lineWrapping");case"insertSpaces":return!e.getOption("indentWithTabs");case"tabSize":return e.getOption("indentUnit");case"autoClosingBrackets":return e.getOption("autoCloseBrackets");default:return e.getOption(t)}}e.handleConfig=function(t,n){var i,o=r({},m.defaultConfig,n);for(i in o)e.setOption(t,i,o[i])},e.indentMoreOrinsertTab=function(e){var n=e.getDoc(),r=n.getCursor("from");if(t(r,n.getCursor("to"))){var o=n.getLine(r.line).slice(0,r.ch);/^\s*$/.test(o)?i.commands.indentMore(e):i.commands.insertSoftTab(e)}else i.commands.indentMore(e)},e.delSpaceToPrevTabStop=function(e){var n=e.getDoc(),r=n.getCursor("from");if(t(r,n.getCursor("to"))){var o=n.getCursor(),a=e.getOption("tabSize"),s=o.ch-(Math.ceil(o.ch/a)-1)*a;r={ch:o.ch-s,line:o.line},null!==n.getRange(r,o).match(/^\ +$/)?n.replaceRange("",r,o):i.commands.delCharBefore(e)}else for(var l=n.listSelections(),c=l.length-1;c>=0;c--){var u=l[c].head,d=l[c].anchor;n.replaceRange("",i.Pos(u.line,u.ch),i.Pos(d.line,d.ch))}},e.posEq=t,e.getOption=n,e.setOption=function(e,t,r){if(n(e,t)!==r)switch(t){case"lineWrap":e.setOption("lineWrapping",r);break;case"tabSize":e.setOption("indentUnit",r);break;case"insertSpaces":e.setOption("indentWithTabs",!r);break;case"autoClosingBrackets":e.setOption("autoCloseBrackets",r);break;case"readOnly":e.getWrapperElement().classList.toggle("jp-mod-readOnly",r),e.setOption(t,r);break;default:e.setOption(t,r)}}}(h||(h={})),m.addCommand("delSpaceToPrevTabStop",h.delSpaceToPrevTabStop),m.addCommand("indentMoreOrinsertTab",h.indentMoreOrinsertTab)},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(35),o=function(e){void 0===e&&(e={});var t=this;this.newInlineEditor=function(e){return e.host.dataset.type="inline",new i.CodeMirrorEditor(r({},e,{config:r({},t.inlineCodeMirrorConfig,e.config||{})}))},this.newDocumentEditor=function(e){return e.host.dataset.type="document",new i.CodeMirrorEditor(r({},e,{config:r({},t.documentCodeMirrorConfig,e.config||{})}))},this.inlineCodeMirrorConfig=r({},i.CodeMirrorEditor.defaultConfig,{extraKeys:{"Cmd-Right":"goLineRight",End:"goLineRight","Cmd-Left":"goLineLeft",Tab:"indentMoreOrinsertTab","Shift-Tab":"indentLess","Cmd-/":"toggleComment","Ctrl-/":"toggleComment"}},e),this.documentCodeMirrorConfig=r({},i.CodeMirrorEditor.defaultConfig,{extraKeys:{Tab:"indentMoreOrinsertTab","Shift-Tab":"indentLess","Shift-Enter":function(){}},lineNumbers:!0,scrollPastEnd:!0},e)};t.CodeMirrorEditorFactory=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(88),o=n(87),a=n(86),s=n(4),l=n(31);t.renderHTML=function(e){var t=e.host,n=e.source,i=e.trusted,o=e.sanitizer,a=e.resolver,s=e.linkHandler,l=e.shouldTypeset,c=e.latexTypesetter;return n?(i||(n=o.sanitize(n)),t.innerHTML=n,t.getElementsByTagName("script").length>0&&console.warn("JupyterLab does not execute inline JavaScript in HTML output"),r.handleDefaults(t),(a?r.handleUrls(t,a,s):Promise.resolve(void 0)).then(function(){l&&c&&c.typeset(t)})):(t.textContent="",Promise.resolve(void 0))},t.renderImage=function(e){var t=e.host,n=e.mimeType,r=e.source,i=e.width,o=e.height,a=e.unconfined;t.textContent="";var s=document.createElement("img");return s.src="data:"+n+";base64,"+r,"number"==typeof o&&(s.height=o),"number"==typeof i&&(s.width=i),!0===a&&s.classList.add("jp-mod-unconfined"),t.appendChild(s),Promise.resolve(void 0)},t.renderLatex=function(e){var t=e.host,n=e.source,r=e.shouldTypeset,i=e.latexTypesetter;return t.textContent=n,r&&i&&i.typeset(t),Promise.resolve(void 0)},t.renderMarkdown=function(e){var t=e.host,n=e.source,i=e.trusted,o=e.sanitizer,a=e.resolver,s=e.linkHandler,c=e.latexTypesetter,u=e.shouldTypeset;if(!n)return t.textContent="",Promise.resolve(void 0);var d=l.removeMath(n);return r.renderMarked(d.text).then(function(e){return e=l.replaceMath(e,d.math),i||(e=o.sanitize(e)),t.innerHTML=e,t.getElementsByTagName("script").length>0&&console.warn("JupyterLab does not execute inline JavaScript in HTML output"),r.handleDefaults(t),r.headerAnchors(t),a?r.handleUrls(t,a,s):Promise.resolve(void 0)}).then(function(){u&&c&&c.typeset(t)})},t.renderSVG=function(e){var t=e.host,n=e.source,r=e.trusted,i=e.unconfined;if(!n)return t.textContent="",Promise.resolve(void 0);if(!r)return t.textContent="Cannot display an untrusted SVG. Maybe you need to run the cell?",Promise.resolve(void 0);var o=new Image;return o.src="data:image/svg+xml,"+n,t.appendChild(o),!0===i&&t.classList.add("jp-mod-unconfined"),Promise.resolve()},t.renderText=function(e){var t=e.host,n=e.source,r=new i.default;r.escape_for_html=!0,r.use_classes=!0;var o=r.ansi_to_html(n);return t.innerHTML="<pre>"+o+"</pre>",Promise.resolve(void 0)},function(e){function t(e,t,n){var r=e.getAttribute(t);return r&&"data:"!==s.URLExt.parse(r).protocol?(e.setAttribute(t,""),n.resolveUrl(r).then(function(e){return n.getDownloadUrl(e)}).then(function(n){n+=(/\?/.test(n)?"&":"?")+(new Date).getTime(),e.setAttribute(t,n)}).catch(function(n){e.setAttribute(t,"")})):Promise.resolve(void 0)}function n(e,t,n){var r=e.getAttribute("href");if(!r||-1!==r.indexOf("://")&&0===r.indexOf("//"))return Promise.resolve(void 0);var i=e.hash;if(i){if(i===r)return e.target="_self",Promise.resolve(void 0);r=r.replace(i,"")}return t.resolveUrl(r).then(function(r){return n&&s.URLExt.isLocal(r)&&n.handleLink(e,r),t.getDownloadUrl(r)}).then(function(t){e.href=t+i}).catch(function(t){e.href=""})}e.renderMarked=function(e){return r||(r=!0,o.setOptions({gfm:!0,sanitize:!1,tables:!0,langPrefix:"cm-s-"+a.CodeMirrorEditor.defaultConfig.theme+" language-",highlight:function(e,t,n){var r=function(e,t){return n&&n(e,t),t};return t?(a.Mode.ensure(t).then(function(n){var i=document.createElement("div");if(!n)return console.log("No CodeMirror mode: "+t),r(null,e);try{return a.Mode.run(e,n.mime,i),r(null,i.innerHTML)}catch(n){return console.log("Failed to highlight "+t+" code",n),r(n,e)}}).catch(function(n){return console.log("No CodeMirror mode: "+t),console.log("Require CodeMirror mode error: "+n),r(null,e)}),e):r(null,e)}})),new Promise(function(t,n){o(e,function(e,r){e?n(e):t(r)})})},e.handleDefaults=function(e){for(var t=e.getElementsByTagName("a"),n=0;n<t.length;n++){var r=t[n].href;s.URLExt.isLocal(r)?t[n].target="_self":t[n].target="_blank"}var i=e.getElementsByTagName("img");for(n=0;n<i.length;n++)i[n].alt||(i[n].alt="Image")},e.handleUrls=function(e,r,i){for(var o=[],a=e.querySelectorAll("*[src]"),s=0;s<a.length;s++)o.push(t(a[s],"src",r));var l=e.getElementsByTagName("a");for(s=0;s<l.length;s++)o.push(n(l[s],r,i));var c=e.getElementsByTagName("link");for(s=0;s<c.length;s++)o.push(t(c[s],"href",r));return Promise.all(o).then(function(){})},e.headerAnchors=function(e){for(var t=0,n=["h1","h2","h3","h4","h5","h6"];t<n.length;t++)for(var r=n[t],i=e.getElementsByTagName(r),o=0;o<i.length;o++){var a=i[o];a.id=a.innerHTML.replace(/ /g,"-");var s=document.createElement("a");s.target="_self",s.textContent="¶",s.href="#"+a.id,s.classList.add("jp-InternalAnchorLink"),a.appendChild(s)}};var r=!1}(r||(r={}))},function(e,t,n){"use strict";var r,i=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(15),a=n(37),s=function(e){function t(t){var n=e.call(this)||this;return n.mimeType=t.mimeType,n.sanitizer=t.sanitizer,n.resolver=t.resolver,n.linkHandler=t.linkHandler,n.latexTypesetter=t.latexTypesetter,n.node.dataset.mimeType=n.mimeType,n}return i(t,e),t.prototype.renderModel=function(e){return this.toggleClass("jp-mod-trusted",e.trusted),this.render(e)},t}(o.Widget);t.RenderedCommon=s;var l=function(e){function t(t){var n=e.call(this,t)||this;return n.addClass("jp-RenderedHTMLCommon"),n}return i(t,e),t}(s);t.RenderedHTMLCommon=l;var c=function(e){function t(t){var n=e.call(this,t)||this;return n.addClass("jp-RenderedHTML"),n}return i(t,e),t.prototype.render=function(e){return a.renderHTML({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter})},t.prototype.onAfterAttach=function(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)},t}(l);t.RenderedHTML=c;var u=function(e){function t(t){var n=e.call(this,t)||this;return n.addClass("jp-RenderedLatex"),n}return i(t,e),t.prototype.render=function(e){return a.renderLatex({host:this.node,source:String(e.data[this.mimeType]),shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter})},t.prototype.onAfterAttach=function(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)},t}(s);t.RenderedLatex=u;var d=function(e){function t(t){var n=e.call(this,t)||this;return n.addClass("jp-RenderedImage"),n}return i(t,e),t.prototype.render=function(e){var t=e.metadata[this.mimeType];return a.renderImage({host:this.node,mimeType:this.mimeType,source:String(e.data[this.mimeType]),width:t&&t.width,height:t&&t.height,unconfined:t&&t.unconfined})},t}(s);t.RenderedImage=d;var f=function(e){function t(t){var n=e.call(this,t)||this;return n.addClass("jp-RenderedMarkdown"),n}return i(t,e),t.prototype.render=function(e){return a.renderMarkdown({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter})},t.prototype.onAfterAttach=function(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)},t}(l);t.RenderedMarkdown=f;var h=function(e){function t(t){var n=e.call(this,t)||this;return n.addClass("jp-RenderedSVG"),n}return i(t,e),t.prototype.render=function(e){var t=e.metadata[this.mimeType];return a.renderSVG({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,unconfined:t&&t.unconfined})},t.prototype.onAfterAttach=function(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)},t}(s);t.RenderedSVG=h;var p=function(e){function t(t){var n=e.call(this,t)||this;return n.addClass("jp-RenderedText"),n}return i(t,e),t.prototype.render=function(e){return a.renderText({host:this.node,source:String(e.data[this.mimeType])})},t}(s);t.RenderedText=p;var m=function(e){function t(t){var n=e.call(this,t)||this;return n.addClass("jp-RenderedJavaScript"),n}return i(t,e),t.prototype.render=function(e){return a.renderText({host:this.node,source:"JavaScript output is disabled in JupyterLab"})},t}(s);t.RenderedJavaScript=m},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),n(90),r(n(89)),r(n(31)),r(n(30)),r(n(71)),r(n(70)),r(n(37)),r(n(38))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(3),o=n(2),a=function(){function e(e){void 0===e&&(e={});var t=this;this._array=[],this._isDisposed=!1,this._changed=new o.Signal(this),void 0!==e.values&&i.each(e.values,function(e){t._array.push(e)}),this._itemCmp=e.itemCmp||r.itemCmp}return Object.defineProperty(e.prototype,"type",{get:function(){return"List"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._array.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,o.Signal.clearData(this),this.clear())},e.prototype.iter=function(){return new i.ArrayIterator(this._array)},e.prototype.get=function(e){return this._array[e]},e.prototype.set=function(e,t){var n=this._array[e];if(void 0===t)throw new Error("Cannot set an undefined item");(0,this._itemCmp)(n,t)||(this._array[e]=t,this._changed.emit({type:"set",oldIndex:e,newIndex:e,oldValues:[n],newValues:[t]}))},e.prototype.push=function(e){var t=this._array.push(e);return this._changed.emit({type:"add",oldIndex:-1,newIndex:this.length-1,oldValues:[],newValues:[e]}),t},e.prototype.insert=function(e,t){i.ArrayExt.insert(this._array,e,t),this._changed.emit({type:"add",oldIndex:-1,newIndex:e,oldValues:[],newValues:[t]})},e.prototype.removeValue=function(e){var t=this._itemCmp,n=i.ArrayExt.findFirstIndex(this._array,function(n){return t(n,e)});return this.remove(n),n},e.prototype.remove=function(e){var t=i.ArrayExt.removeAt(this._array,e);if(void 0!==t)return this._changed.emit({type:"remove",oldIndex:e,newIndex:-1,newValues:[],oldValues:[t]}),t},e.prototype.clear=function(){var e=this._array.slice();this._array.length=0,this._changed.emit({type:"remove",oldIndex:0,newIndex:0,newValues:[],oldValues:e})},e.prototype.move=function(e,t){if(!(this.length<=1||e===t)){var n=[this._array[e]];i.ArrayExt.move(this._array,e,t),this._changed.emit({type:"move",oldIndex:e,newIndex:t,oldValues:n,newValues:n})}},e.prototype.pushAll=function(e){var t=this,n=this.length;return i.each(e,function(e){t._array.push(e)}),this._changed.emit({type:"add",oldIndex:-1,newIndex:n,oldValues:[],newValues:i.toArray(e)}),this.length},e.prototype.insertAll=function(e,t){var n=this,r=e;i.each(t,function(t){i.ArrayExt.insert(n._array,e++,t)}),this._changed.emit({type:"add",oldIndex:-1,newIndex:r,oldValues:[],newValues:i.toArray(t)})},e.prototype.removeRange=function(e,t){for(var n=this._array.slice(e,t),r=e;r<t;r++)i.ArrayExt.removeAt(this._array,e);return this._changed.emit({type:"remove",oldIndex:e,newIndex:-1,oldValues:n,newValues:[]}),this.length},e}();t.ObservableList=a,(r||(r={})).itemCmp=function(e,t){return e===t}},function(e,t,n){"use strict";var r,i=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),a=function(e){function t(t){var n=e.call(this)||this;return n._inCompound=!1,n._isUndoable=!0,n._madeCompoundChange=!1,n._index=-1,n._stack=[],n._serializer=t,n.changed.connect(n._onListChanged,n),n}return i(t,e),Object.defineProperty(t.prototype,"canRedo",{get:function(){return this._index<this._stack.length-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canUndo",{get:function(){return this._index>=0},enumerable:!0,configurable:!0}),t.prototype.beginCompoundOperation=function(e){this._inCompound=!0,this._isUndoable=!1!==e,this._madeCompoundChange=!1},t.prototype.endCompoundOperation=function(){this._inCompound=!1,this._isUndoable=!0,this._madeCompoundChange&&this._index++},t.prototype.undo=function(){if(this.canUndo){var e=this._stack[this._index];this._isUndoable=!1;for(var t=0,n=e.reverse();t<n.length;t++){var r=n[t];this._undoChange(r)}this._isUndoable=!0,this._index--}},t.prototype.redo=function(){if(this.canRedo){this._index++;var e=this._stack[this._index];this._isUndoable=!1;for(var t=0,n=e;t<n.length;t++){var r=n[t];this._redoChange(r)}this._isUndoable=!0}},t.prototype.clearUndo=function(){this._index=-1,this._stack=[]},t.prototype._onListChanged=function(e,t){if(!this.isDisposed&&this._isUndoable){this._inCompound&&this._madeCompoundChange||(this._stack=this._stack.slice(0,this._index+1));var n=this._copyChange(t);this._stack[this._index+1]?this._stack[this._index+1].push(n):this._stack.push([n]),this._inCompound?this._madeCompoundChange=!0:this._index++}},t.prototype._undoChange=function(e){var t=this,n=0,r=this._serializer;switch(e.type){case"add":o.each(e.newValues,function(){t.remove(e.newIndex)});break;case"set":n=e.oldIndex,o.each(e.oldValues,function(e){t.set(n++,r.fromJSON(e))});break;case"remove":n=e.oldIndex,o.each(e.oldValues,function(e){t.insert(n++,r.fromJSON(e))});break;case"move":this.move(e.newIndex,e.oldIndex);break;default:return}},t.prototype._redoChange=function(e){var t=this,n=0,r=this._serializer;switch(e.type){case"add":n=e.newIndex,o.each(e.newValues,function(e){t.insert(n++,r.fromJSON(e))});break;case"set":n=e.newIndex,o.each(e.newValues,function(n){t.set(e.newIndex++,r.fromJSON(n))});break;case"remove":o.each(e.oldValues,function(){t.remove(e.oldIndex)});break;case"move":this.move(e.oldIndex,e.newIndex);break;default:return}},t.prototype._copyChange=function(e){var t=this,n=[];o.each(e.oldValues,function(e){n.push(t._serializer.toJSON(e))});var r=[];return o.each(e.newValues,function(e){r.push(t._serializer.toJSON(e))}),{type:e.type,oldIndex:e.oldIndex,newIndex:e.newIndex,oldValues:n,newValues:r}},t}(n(40).ObservableList);t.ObservableUndoableList=a,function(e){var t=function(){function e(){}return e.prototype.toJSON=function(e){return e},e.prototype.fromJSON=function(e){return e},e}();e.IdentitySerializer=t}(a=t.ObservableUndoableList||(t.ObservableUndoableList={})),t.ObservableUndoableList=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(){function e(e){void 0===e&&(e=""),this._text="",this._isDisposed=!1,this._changed=new r.Signal(this),this._text=e}return Object.defineProperty(e.prototype,"type",{get:function(){return"String"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(e){e.length===this._text.length&&e===this._text||(this._text=e,this._changed.emit({type:"set",start:0,end:e.length,value:e}))},enumerable:!0,configurable:!0}),e.prototype.insert=function(e,t){this._text=this._text.slice(0,e)+t+this._text.slice(e),this._changed.emit({type:"insert",start:e,end:e+t.length,value:t})},e.prototype.remove=function(e,t){var n=this._text.slice(e,t);this._text=this._text.slice(0,e)+this._text.slice(t),this._changed.emit({type:"remove",start:e,end:t,value:n})},e.prototype.clear=function(){this.text=""},Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this.clear())},e}();t.ObservableString=i},function(e,t,n){"use strict";var r,i=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),a=n(13),s=function(e){function t(t){return void 0===t&&(t={}),e.call(this,{itemCmp:o.JSONExt.deepEqual,values:t.values})||this}return i(t,e),t.prototype.toJSON=function(){for(var e=Object.create(null),t=0,n=this.keys();t<n.length;t++){var r=n[t],i=this.get(r);void 0!==i&&(e[r]=o.JSONExt.deepCopy(i))}return e},t}(n(24).ObservableMap);t.ObservableJSON=s,function(e){var t=function(e){function t(t){var n=e.call(this,"jsonvalue-changed")||this;return n.args=t,n}return i(t,e),t}(a.Message);e.ChangeMessage=t}(s=t.ObservableJSON||(t.ObservableJSON={})),t.ObservableJSON=s},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n,r=e[1]||"",i=e[3];if(!i)return r;if(t&&"function"==typeof btoa){var o=(n=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */"),a=i.sources.map(function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"});return[r].concat(a).concat([o]).join("\n")}return[r].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(4),o=n(10),a=function(){function e(e){void 0===e&&(e={}),this.serverSettings=e.serverSettings||o.ServerConnection.makeSettings()}return e.prototype.fetch=function(e){var t=this.serverSettings,n=t.baseUrl+t.pageUrl,i=r.url(n,e);return o.ServerConnection.makeRequest(i,{},t).then(function(e){if(200!==e.status)throw new o.ServerConnection.ResponseError(e);return e.json()})},e.prototype.save=function(e,t){var n=this.serverSettings,i=n.baseUrl+n.pageUrl,a=r.url(i,e),s={body:JSON.stringify(t),method:"PUT"};return o.ServerConnection.makeRequest(a,s,n).then(function(e){if(204!==e.status)throw new o.ServerConnection.ResponseError(e)})},e}();t.WorkspaceManager=a,(r||(r={})).url=function(e,t){return i.URLExt.join(e,"api/workspaces",t)}},function(e,t,n){"use strict"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(4),o=n(10),a=function(){function e(e){void 0===e&&(e={}),this.serverSettings=e.serverSettings||o.ServerConnection.makeSettings()}return e.prototype.fetch=function(e){var t=this.serverSettings,n=t.baseUrl+t.pageUrl,i=r.url(n,e);return o.ServerConnection.makeRequest(i,{},t).then(function(e){if(200!==e.status)throw new o.ServerConnection.ResponseError(e);return e.json()})},e.prototype.save=function(e,t){var n=this.serverSettings,i=n.baseUrl+n.pageUrl,a=r.url(i,e),s={body:t,method:"PUT"};return o.ServerConnection.makeRequest(a,s,n).then(function(e){if(204!==e.status)throw new o.ServerConnection.ResponseError(e)})},e}();t.SettingManager=a,(r||(r={})).url=function(e,t){return i.URLExt.join(e,"api/settings",t)}},function(e,t,n){"use strict"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(104);!function(e){e.findById=function(e,t){return r.DefaultKernel.findById(e,t)},e.getSpecs=function(e){return r.DefaultKernel.getSpecs(e)},e.listRunning=function(e){return r.DefaultKernel.listRunning(e)},e.startNew=function(e){return void 0===e&&(e={}),r.DefaultKernel.startNew(e)},e.connectTo=function(e,t){return r.DefaultKernel.connectTo(e,t)},e.shutdown=function(e,t){return r.DefaultKernel.shutdown(e,t)},e.shutdownAll=function(e){return r.DefaultKernel.shutdownAll(e)}}(t.Kernel||(t.Kernel={}))},function(e,t,n){"use strict"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(119);!function(e){function t(e){if("undefined"!=typeof document){var t=document.createElement("a");return t.href=e,t}return r(e)}function n(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[].slice.call(e,0).join("/");return(n=(n=(n=n.replace(/:\//g,"://")).replace(/([^:\s])\/+/g,"$1/")).replace(/\/(\?|&|#[^!])/g,"$1")).replace(/(\?.+)\?/g,"$1&")}e.parse=t,e.join=n,e.encodeParts=function(e){return n.apply(void 0,e.split("/").map(encodeURIComponent))},e.objectToQueryString=function(e){var t=Object.keys(e);return t.length?"?"+t.map(function(t){var n=encodeURIComponent(String(e[t]));return t+(n?"="+n:"")}).join("&"):""},e.queryStringToObject=function(e){return e.replace(/^\?/,"").split("&").reduce(function(e,t){var n=t.split("="),r=n[0],i=n[1];return e[r]=decodeURIComponent(i||""),e},{})},e.isLocal=function(e){var n=t(e).protocol;return 0!==e.toLowerCase().indexOf(n)&&0!==e.indexOf("//")}}(t.URLExt||(t.URLExt={}))},function(e,t,n){"use strict"},function(e,t,n){"use strict";var r,i=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),a=n(13),s=n(26),l=n(12),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._widgets=[],t}return i(t,e),t.prototype.dispose=function(){for(;this._widgets.length>0;)this._widgets.pop().dispose();e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return o.iter(this._widgets)},t.prototype.addWidget=function(e){this.insertWidget(this._widgets.length,e)},t.prototype.insertWidget=function(e,t){t.parent=this.parent;var n=this._widgets.indexOf(t),r=Math.max(0,Math.min(e,this._widgets.length));if(-1===n)return o.ArrayExt.insert(this._widgets,r,t),void(this.parent&&this.attachWidget(r,t));r===this._widgets.length&&r--,n!==r&&(o.ArrayExt.move(this._widgets,n,r),this.parent&&this.moveWidget(n,r,t))},t.prototype.removeWidget=function(e){this.removeWidgetAt(this._widgets.indexOf(e))},t.prototype.removeWidgetAt=function(e){var t=o.ArrayExt.removeAt(this._widgets,e);t&&this.parent&&this.detachWidget(e,t)},t.prototype.init=function(){var t=this;e.prototype.init.call(this),o.each(this,function(e,n){t.attachWidget(n,e)})},t.prototype.attachWidget=function(e,t){var n=this.parent.node.children[e];this.parent.isAttached&&a.MessageLoop.sendMessage(t,l.Widget.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,n),this.parent.isAttached&&a.MessageLoop.sendMessage(t,l.Widget.Msg.AfterAttach)},t.prototype.moveWidget=function(e,t,n){this.parent.isAttached&&a.MessageLoop.sendMessage(n,l.Widget.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&a.MessageLoop.sendMessage(n,l.Widget.Msg.AfterDetach);var r=this.parent.node.children[t];this.parent.isAttached&&a.MessageLoop.sendMessage(n,l.Widget.Msg.BeforeAttach),this.parent.node.insertBefore(n.node,r),this.parent.isAttached&&a.MessageLoop.sendMessage(n,l.Widget.Msg.AfterAttach)},t.prototype.detachWidget=function(e,t){this.parent.isAttached&&a.MessageLoop.sendMessage(t,l.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&a.MessageLoop.sendMessage(t,l.Widget.Msg.AfterDetach)},t}(s.Layout);t.PanelLayout=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(){function e(e){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new r.Signal(this),this.owner=e.owner,void 0!==e.label&&(this._label=e.label),void 0!==e.mnemonic&&(this._mnemonic=e.mnemonic),void 0!==e.icon&&(this._iconClass=e.icon),void 0!==e.iconClass&&(this._iconClass=e.iconClass),void 0!==e.iconLabel&&(this._iconLabel=e.iconLabel),void 0!==e.caption&&(this._caption=e.caption),void 0!==e.className&&(this._className=e.className),void 0!==e.closable&&(this._closable=e.closable),this._dataset=e.dataset||{}}return Object.defineProperty(e.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"label",{get:function(){return this._label},set:function(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mnemonic",{get:function(){return this._mnemonic},set:function(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icon",{get:function(){return this.iconClass},set:function(e){this.iconClass=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconClass",{get:function(){return this._iconClass},set:function(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconLabel",{get:function(){return this._iconLabel},set:function(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"caption",{get:function(){return this._caption},set:function(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"className",{get:function(){return this._className},set:function(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"closable",{get:function(){return this._closable},set:function(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataset",{get:function(){return this._dataset},set:function(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),e}();t.Title=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e){this._pid=r.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}return e.prototype.get=function(e){var t=r.ensureMap(e);return this._pid in t?t[this._pid]:t[this._pid]=this._createValue(e)},e.prototype.set=function(e,t){var n,i=r.ensureMap(e);n=this._pid in i?i[this._pid]:i[this._pid]=this._createValue(e);var o=this._coerceValue(e,t);this._maybeNotify(e,n,i[this._pid]=o)},e.prototype.coerce=function(e){var t,n=r.ensureMap(e);t=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e);var i=this._coerceValue(e,t);this._maybeNotify(e,t,n[this._pid]=i)},e.prototype._createValue=function(e){return(0,this._create)(e)},e.prototype._coerceValue=function(e,t){var n=this._coerce;return n?n(e,t):t},e.prototype._compareValue=function(e,t){var n=this._compare;return n?n(e,t):e===t},e.prototype._maybeNotify=function(e,t,n){var r=this._changed;r&&!this._compareValue(t,n)&&r(e,t,n)},e}();t.AttachedProperty=i,(i=t.AttachedProperty||(t.AttachedProperty={})).clearData=function(e){r.ownerData.delete(e)},t.AttachedProperty=i,function(e){var t;e.ownerData=new WeakMap,e.nextPID=(t=0,function(){return"pid-"+(""+Math.random()).slice(2)+"-"+t++}),e.ensureMap=function(t){var n=e.ownerData.get(t);return n||(n=Object.create(null),e.ownerData.set(t,n),n)}}(r||(r={}))},function(e,t,n){"use strict"},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(151)),r(n(150)),r(n(149))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){e.defineMode("javascript",function(t,n){var r,i,o=t.indentUnit,a=n.statementIndent,l=n.jsonld,c=n.json||l,u=n.typescript,d=n.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),h=/[+\-*&%=<>!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(e,t,n){return r=e,i=n,t}function g(e,t){var n,r=e.next();if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){var r,i=!1;if(l&&"@"==e.peek()&&e.match(p))return t.tokenize=g,m("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=n||i);)i=!i&&"\\"==r;return i||(t.tokenize=g),m("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return m("number","number");if("."==r&&e.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return m(r);if("="==r&&e.eat(">"))return m("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),m("number","number");if("0"==r&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),m("number","number");if("0"==r&&e.eat(/b/i))return e.eatWhile(/[01]/i),m("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),m("number","number");if("/"==r)return e.eat("*")?(t.tokenize=v,v(e,t)):e.eat("/")?(e.skipToEnd(),m("comment","comment")):He(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),m("regexp","string-2")):(e.eat("="),m("operator","operator",e.current()));if("`"==r)return t.tokenize=y,y(e,t);if("#"==r)return e.skipToEnd(),m("error","error");if(h.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),m("operator","operator",e.current());if(d.test(r)){e.eatWhile(d);var i=e.current();if("."!=t.lastType){if(f.propertyIsEnumerable(i)){var o=f[i];return m(o.type,o.style,i)}if("async"==i&&e.match(/^(\s|\/\*.*?\*\/)*[\(\w]/,!1))return m("async","keyword",i)}return m("variable","variable",i)}}function v(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=g;break}r="*"==n}return m("comment","comment")}function y(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=g;break}r=!r&&"\\"==n}return m("quasi","string-2",e.current())}var b="([{}])";function x(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),l=b.indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(d.test(s))o=!0;else{if(/["'\/]/.test(s))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function _(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function k(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}var C={state:null,column:null,marked:null,cc:null};function S(){for(var e=arguments.length-1;e>=0;e--)C.cc.push(arguments[e])}function M(){return S.apply(null,arguments),!0}function L(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var r=C.state;if(C.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function T(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}var O={name:"this",next:{name:"arguments"}};function A(){C.state.context={prev:C.state.context,vars:C.state.localVars},C.state.localVars=O}function P(){C.state.localVars=C.state.context.vars,C.state.context=C.state.context.prev}function E(e,t){var n=function(){var n=C.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new _(r,C.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function D(){var e=C.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function j(e){return function t(n){return n==e?M():";"==e?S():M(t)}}function N(e,t){return"var"==e?M(E("vardef",t.length),pe,j(";"),D):"keyword a"==e?M(E("form"),z,N,D):"keyword b"==e?M(E("form"),N,D):"keyword d"==e?C.stream.match(/^\s*$/,!1)?M():M(E("stat"),W,j(";"),D):"debugger"==e?M(j(";")):"{"==e?M(E("}"),ne,D):";"==e?M():"if"==e?("else"==C.state.lexical.info&&C.state.cc[C.state.cc.length-1]==D&&C.state.cc.pop()(),M(E("form"),z,N,D,be)):"function"==e?M(Se):"for"==e?M(E("form"),xe,N,D):"class"==e||u&&"interface"==t?(C.marked="keyword",M(E("form"),Te,D)):"variable"==e?u&&"declare"==t?(C.marked="keyword",M(N)):u&&("module"==t||"enum"==t||"type"==t)&&C.stream.match(/^\s*\w/,!1)?(C.marked="keyword","enum"==t?M(We):"type"==t?M(ae,j("operator"),ae,j(";")):M(E("form"),me,j("{"),E("}"),ne,D,D)):u&&"namespace"==t?(C.marked="keyword",M(E("form"),I,ne,D)):M(E("stat"),J):"switch"==e?M(E("form"),z,j("{"),E("}","switch"),ne,D,D):"case"==e?M(I,j(":")):"default"==e?M(j(":")):"catch"==e?M(E("form"),A,j("("),Me,j(")"),N,D,P):"export"==e?M(E("stat"),Ee,D):"import"==e?M(E("stat"),je,D):"async"==e?M(N):"@"==t?M(I,N):S(E("stat"),I,j(";"),D)}function I(e,t){return F(e,t,!1)}function R(e,t){return F(e,t,!0)}function z(e){return"("!=e?S():M(E(")"),I,j(")"),D)}function F(e,t,n){if(C.state.fatArrowAt==C.stream.start){var r=n?V:K;if("("==e)return M(A,E(")"),ee(Me,")"),D,j("=>"),r,P);if("variable"==e)return S(A,me,j("=>"),r,P)}var i=n?H:B;return w.hasOwnProperty(e)?M(i):"function"==e?M(Se,i):"class"==e||u&&"interface"==t?(C.marked="keyword",M(E("form"),Le,D)):"keyword c"==e||"async"==e?M(n?R:I):"("==e?M(E(")"),W,j(")"),D,i):"operator"==e||"spread"==e?M(n?R:I):"["==e?M(E("]"),Fe,D,i):"{"==e?te(Z,"}",null,i):"quasi"==e?S(q,i):"new"==e?M(function(e){return function(t){return"."==t?M(e?G:$):"variable"==t&&u?M(de,e?H:B):S(e?R:I)}}(n)):"import"==e?M(I):M()}function W(e){return e.match(/[;\}\)\],]/)?S():S(I)}function B(e,t){return","==e?M(I):H(e,t,!1)}function H(e,t,n){var r=0==n?B:H,i=0==n?I:R;return"=>"==e?M(A,n?V:K,P):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?M(r):u&&"<"==t&&C.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?M(E(">"),ee(ae,">"),D,r):"?"==t?M(I,j(":"),i):M(i):"quasi"==e?S(q,r):";"!=e?"("==e?te(R,")","call",r):"."==e?M(X,r):"["==e?M(E("]"),W,j("]"),D,r):u&&"as"==t?(C.marked="keyword",M(ae,r)):"regexp"==e?(C.state.lastType=C.marked="operator",C.stream.backUp(C.stream.pos-C.stream.start-1),M(i)):void 0:void 0}function q(e,t){return"quasi"!=e?S():"${"!=t.slice(t.length-2)?M(q):M(I,U)}function U(e){if("}"==e)return C.marked="string-2",C.state.tokenize=y,M(q)}function K(e){return x(C.stream,C.state),S("{"==e?N:I)}function V(e){return x(C.stream,C.state),S("{"==e?N:R)}function $(e,t){if("target"==t)return C.marked="keyword",M(B)}function G(e,t){if("target"==t)return C.marked="keyword",M(H)}function J(e){return":"==e?M(D,N):S(B,j(";"),D)}function X(e){if("variable"==e)return C.marked="property",M()}function Z(e,t){if("async"==e)return C.marked="property",M(Z);if("variable"==e||"keyword"==C.style){return C.marked="property","get"==t||"set"==t?M(Y):(u&&C.state.fatArrowAt==C.stream.start&&(n=C.stream.match(/^\s*:\s*/,!1))&&(C.state.fatArrowAt=C.stream.pos+n[0].length),M(Q));var n}else{if("number"==e||"string"==e)return C.marked=l?"property":C.style+" property",M(Q);if("jsonld-keyword"==e)return M(Q);if(u&&T(t))return C.marked="keyword",M(Z);if("["==e)return M(I,re,j("]"),Q);if("spread"==e)return M(R,Q);if("*"==t)return C.marked="keyword",M(Z);if(":"==e)return S(Q)}}function Y(e){return"variable"!=e?S(Q):(C.marked="property",M(Se))}function Q(e){return":"==e?M(R):"("==e?S(Se):void 0}function ee(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=C.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),M(function(n,r){return n==t||r==t?S():S(e)},r)}return i==t||o==t?M():M(j(t))}return function(n,i){return n==t||i==t?M():S(e,r)}}function te(e,t,n){for(var r=3;r<arguments.length;r++)C.cc.push(arguments[r]);return M(E(t,n),ee(e,t),D)}function ne(e){return"}"==e?M():S(N,ne)}function re(e,t){if(u){if(":"==e)return M(ae);if("?"==t)return M(re)}}function ie(e){if(u&&":"==e)return C.stream.match(/^\s*\w+\s+is\b/,!1)?M(I,oe,ae):M(ae)}function oe(e,t){if("is"==t)return C.marked="keyword",M()}function ae(e,t){return"variable"==e||"void"==t?"keyof"==t?(C.marked="keyword",M(ae)):(C.marked="type",M(ue)):"string"==e||"number"==e||"atom"==e?M(ue):"["==e?M(E("]"),ee(ae,"]",","),D,ue):"{"==e?M(E("}"),ee(le,"}",",;"),D,ue):"("==e?M(ee(ce,")"),se):void 0}function se(e){if("=>"==e)return M(ae)}function le(e,t){return"variable"==e||"keyword"==C.style?(C.marked="property",M(le)):"?"==t?M(le):":"==e?M(ae):"["==e?M(I,re,j("]"),le):void 0}function ce(e){return"variable"==e?M(ce):":"==e?M(ae):void 0}function ue(e,t){return"<"==t?M(E(">"),ee(ae,">"),D,ue):"|"==t||"."==e||"&"==t?M(ae):"["==e?M(j("]"),ue):"extends"==t||"implements"==t?(C.marked="keyword",M(ae)):void 0}function de(e,t){if("<"==t)return M(E(">"),ee(ae,">"),D,ue)}function fe(){return S(ae,he)}function he(e,t){if("="==t)return M(ae)}function pe(e,t){return"enum"==t?(C.marked="keyword",M(We)):S(me,re,ve,ye)}function me(e,t){return u&&T(t)?(C.marked="keyword",M(me)):"variable"==e?(L(t),M()):"spread"==e?M(me):"["==e?te(me,"]"):"{"==e?te(ge,"}"):void 0}function ge(e,t){return"variable"!=e||C.stream.match(/^\s*:/,!1)?("variable"==e&&(C.marked="property"),"spread"==e?M(me):"}"==e?S():M(j(":"),me,ve)):(L(t),M(ve))}function ve(e,t){if("="==t)return M(R)}function ye(e){if(","==e)return M(pe)}function be(e,t){if("keyword b"==e&&"else"==t)return M(E("form","else"),N,D)}function xe(e,t){return"await"==t?M(xe):"("==e?M(E(")"),we,j(")"),D):void 0}function we(e){return"var"==e?M(pe,j(";"),ke):";"==e?M(ke):"variable"==e?M(_e):S(I,j(";"),ke)}function _e(e,t){return"in"==t||"of"==t?(C.marked="keyword",M(I)):M(B,ke)}function ke(e,t){return";"==e?M(Ce):"in"==t||"of"==t?(C.marked="keyword",M(I)):S(I,j(";"),Ce)}function Ce(e){")"!=e&&M(I)}function Se(e,t){return"*"==t?(C.marked="keyword",M(Se)):"variable"==e?(L(t),M(Se)):"("==e?M(A,E(")"),ee(Me,")"),D,ie,N,P):u&&"<"==t?M(E(">"),ee(fe,">"),D,Se):void 0}function Me(e,t){return"@"==t&&M(I,Me),"spread"==e?M(Me):u&&T(t)?(C.marked="keyword",M(Me)):S(me,re,ve)}function Le(e,t){return"variable"==e?Te(e,t):Oe(e,t)}function Te(e,t){if("variable"==e)return L(t),M(Oe)}function Oe(e,t){return"<"==t?M(E(">"),ee(fe,">"),D,Oe):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(C.marked="keyword"),M(u?ae:I,Oe)):"{"==e?M(E("}"),Ae,D):void 0}function Ae(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&T(t))&&C.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(C.marked="keyword",M(Ae)):"variable"==e||"keyword"==C.style?(C.marked="property",M(u?Pe:Se,Ae)):"["==e?M(I,re,j("]"),u?Pe:Se,Ae):"*"==t?(C.marked="keyword",M(Ae)):";"==e?M(Ae):"}"==e?M():"@"==t?M(I,Ae):void 0}function Pe(e,t){return"?"==t?M(Pe):":"==e?M(ae,ve):"="==t?M(R):S(Se)}function Ee(e,t){return"*"==t?(C.marked="keyword",M(ze,j(";"))):"default"==t?(C.marked="keyword",M(I,j(";"))):"{"==e?M(ee(De,"}"),ze,j(";")):S(N)}function De(e,t){return"as"==t?(C.marked="keyword",M(j("variable"))):"variable"==e?S(R,De):void 0}function je(e){return"string"==e?M():"("==e?S(I):S(Ne,Ie,ze)}function Ne(e,t){return"{"==e?te(Ne,"}"):("variable"==e&&L(t),"*"==t&&(C.marked="keyword"),M(Re))}function Ie(e){if(","==e)return M(Ne,Ie)}function Re(e,t){if("as"==t)return C.marked="keyword",M(Ne)}function ze(e,t){if("from"==t)return C.marked="keyword",M(I)}function Fe(e){return"]"==e?M():S(ee(R,"]"))}function We(){return S(E("form"),me,j("{"),E("}"),ee(Be,"}"),D,D)}function Be(){return S(me,ve)}function He(e,t,n){return t.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return D.lex=!0,{startState:function(e){var t={tokenize:g,lastType:"sof",cc:[],lexical:new _((e||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==s(n.globalVars)&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),x(e,t)),t.tokenize!=v&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",function(e,t,n,r,i){var o=e.cc;for(C.state=e,C.stream=i,C.marked=null,C.cc=o,C.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():c?I:N)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return C.marked?C.marked:"variable"==n&&k(e,r)?"variable-2":t}}(t,n,r,i,e))},indent:function(t,r){if(t.tokenize==v)return e.Pass;if(t.tokenize!=g)return 0;var i,s=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==D)l=l.prev;else if(u!=be)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(i=t.cc[t.cc.length-1])&&(i==B||i==H)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,f=s==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info+1:0):"form"==d&&"{"==s?l.indented:"form"==d?l.indented+o:"stat"==d?l.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||h.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,r)?a||o:0):"switch"!=l.info||f||0==n.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:o):l.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:c?null:"/*",blockCommentEnd:c?null:"*/",blockCommentContinue:c?null:" * ",lineComment:c?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:c?"json":"javascript",jsonldMode:l,jsonMode:c,expressionAllowed:He,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=I&&t!=R||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){function t(e){for(var t={},n=0;n<e.length;++n)t[e[n].toLowerCase()]=!0;return t}e.defineMode("css",function(t,n){var r=n.inline;n.propertyKeywords||(n=e.resolveMode("text/css"));var i,o,a=t.indentUnit,l=n.tokenHooks,c=n.documentTypes||{},u=n.mediaTypes||{},d=n.mediaFeatures||{},f=n.mediaValueKeywords||{},h=n.propertyKeywords||{},p=n.nonStandardPropertyKeywords||{},m=n.fontProperties||{},g=n.counterDescriptors||{},v=n.colorKeywords||{},y=n.valueKeywords||{},b=n.allowNested,x=n.lineComment,w=!0===n.supportsAtComponent;function _(e,t){return i=t,e}function k(e){return function(t,n){for(var r,i=!1;null!=(r=t.next());){if(r==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==r}return(r==e||!i&&")"!=e)&&(n.tokenize=null),_("string","string")}}function C(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=k(")"),_(null,"(")}function S(e,t,n){this.type=e,this.indent=t,this.prev=n}function M(e,t,n,r){return e.context=new S(n,t.indentation()+(!1===r?0:a),e.context),n}function L(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function T(e,t,n){return P[n.context.type](e,t,n)}function O(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return T(e,t,n)}function A(e){var t=e.current().toLowerCase();o=y.hasOwnProperty(t)?"atom":v.hasOwnProperty(t)?"keyword":"variable"}var P={top:function(e,t,n){if("{"==e)return M(n,t,"block");if("}"==e&&n.context.prev)return L(n);if(w&&/@component/i.test(e))return M(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return M(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return M(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return M(n,t,"at");if("hash"==e)o="builtin";else if("word"==e)o="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return M(n,t,"interpolation");if(":"==e)return"pseudo";if(b&&"("==e)return M(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return h.hasOwnProperty(r)?(o="property","maybeprop"):p.hasOwnProperty(r)?(o="string-2","maybeprop"):b?(o=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==e?"block":b||"hash"!=e&&"qualifier"!=e?P.top(e,t,n):(o="error","block")},maybeprop:function(e,t,n){return":"==e?M(n,t,"prop"):T(e,t,n)},prop:function(e,t,n){if(";"==e)return L(n);if("{"==e&&b)return M(n,t,"propBlock");if("}"==e||"{"==e)return O(e,t,n);if("("==e)return M(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)A(t);else if("interpolation"==e)return M(n,t,"interpolation")}else o+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?L(n):"word"==e?(o="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?O(e,t,n):")"==e?L(n):"("==e?M(n,t,"parens"):"interpolation"==e?M(n,t,"interpolation"):("word"==e&&A(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(o="variable-3",n.context.type):T(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&c.hasOwnProperty(t.current())?(o="tag",n.context.type):P.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return M(n,t,"atBlock_parens");if("}"==e||";"==e)return O(e,t,n);if("{"==e)return L(n)&&M(n,t,b?"block":"top");if("interpolation"==e)return M(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();o="only"==r||"not"==r||"and"==r||"or"==r?"keyword":u.hasOwnProperty(r)?"attribute":d.hasOwnProperty(r)?"property":f.hasOwnProperty(r)?"keyword":h.hasOwnProperty(r)?"property":p.hasOwnProperty(r)?"string-2":y.hasOwnProperty(r)?"atom":v.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?O(e,t,n):"{"==e?L(n)&&M(n,t,b?"block":"top",!1):("word"==e&&(o="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?L(n):"{"==e||"}"==e?O(e,t,n,2):P.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?M(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(o="variable","restricted_atBlock_before"):T(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,L(n)):"word"==e?(o="@font-face"==n.stateArg&&!m.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!g.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(o="variable","keyframes"):"{"==e?M(n,t,"top"):T(e,t,n)},at:function(e,t,n){return";"==e?L(n):"{"==e||"}"==e?O(e,t,n):("word"==e?o="tag":"hash"==e&&(o="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?L(n):"{"==e||";"==e?O(e,t,n):("word"==e?o="variable":"variable"!=e&&"("!=e&&")"!=e&&(o="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new S(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||function(e,t){var n=e.next();if(l[n]){var r=l[n](e,t);if(!1!==r)return r}return"@"==n?(e.eatWhile(/[\w\\\-]/),_("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?_(null,"compare"):'"'==n||"'"==n?(t.tokenize=k(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),_("atom","hash")):"!"==n?(e.match(/^\s*\w*/),_("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),_("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?_(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?_("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?_(null,n):("u"==n||"U"==n)&&e.match(/rl(-prefix)?\(/i)||("d"==n||"D"==n)&&e.match("omain(",!0,!0)||("r"==n||"R"==n)&&e.match("egexp(",!0,!0)?(e.backUp(1),t.tokenize=C,_("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),_("property","word")):_(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),_("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?_("variable-2","variable-definition"):_("variable-2","variable")):e.match(/^\w+-/)?_("meta","meta"):void 0})(e,t);return n&&"object"==(void 0===n?"undefined":s(n))&&(i=n[1],n=n[0]),o=n,"comment"!=i&&(t.state=P[t.state](i,e,t)),o},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-a)):i=(n=n.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:x,fold:"brace"}});var n=["domain","regexp","url","url-prefix"],r=t(n),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=t(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],l=t(a),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=t(d),h=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=t(h),m=t(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),v=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=t(v),b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],x=t(b),w=n.concat(i).concat(a).concat(c).concat(d).concat(h).concat(v).concat(b);function _(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.registerHelper("hintWords","css",w),e.defineMIME("text/css",{documentTypes:r,mediaTypes:o,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:g,colorKeywords:y,valueKeywords:x,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=_,_(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:y,valueKeywords:x,fontProperties:m,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=_,_(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:y,valueKeywords:x,fontProperties:m,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=_,_(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:o,mediaFeatures:l,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:g,colorKeywords:y,valueKeywords:x,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=_,_(e,t))}},name:"css",helperType:"gss"})},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){e.multiplexingMode=function(t){var n=Array.prototype.slice.call(arguments,1);function r(e,t,n,r){if("string"==typeof t){var i=e.indexOf(t,n);return r&&i>-1?i+t.length:i}var o=t.exec(n?e.slice(n):e);return o?o.index+n+(r?o[0].length:0):-1}return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(n){return{outer:e.copyState(t,n.outer),innerActive:n.innerActive,inner:n.innerActive&&e.copyState(n.innerActive.mode,n.inner)}},token:function(i,o){if(o.innerActive){var a=o.innerActive;if(c=i.string,!a.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);if((d=a.close?r(c,a.close,i.pos,a.parseDelimiters):-1)==i.pos&&!a.parseDelimiters)return i.match(a.close),o.innerActive=o.inner=null,a.delimStyle&&a.delimStyle+" "+a.delimStyle+"-close";d>-1&&(i.string=c.slice(0,d));var s=a.mode.token(i,o.inner);return d>-1&&(i.string=c),d==i.pos&&a.parseDelimiters&&(o.innerActive=o.inner=null),a.innerStyle&&(s=s?s+" "+a.innerStyle:a.innerStyle),s}for(var l=1/0,c=i.string,u=0;u<n.length;++u){var d,f=n[u];if((d=r(c,f.open,i.pos))==i.pos)return f.parseDelimiters||i.match(f.open),o.innerActive=f,o.inner=e.startState(f.mode,t.indent?t.indent(o.outer,""):0),f.delimStyle&&f.delimStyle+" "+f.delimStyle+"-open";-1!=d&&d<l&&(l=d)}l!=1/0&&(i.string=c.slice(0,l));var h=t.token(i,o.outer);return l!=1/0&&(i.string=c),h},indent:function(n,r){var i=n.innerActive?n.innerActive.mode:t;return i.indent?i.indent(n.innerActive?n.inner:n.outer,r):e.Pass},blankLine:function(r){var i=r.innerActive?r.innerActive.mode:t;if(i.blankLine&&i.blankLine(r.innerActive?r.inner:r.outer),r.innerActive)"\n"===r.innerActive.close&&(r.innerActive=r.inner=null);else for(var o=0;o<n.length;++o){var a=n[o];"\n"===a.open&&(r.innerActive=a,r.inner=e.startState(a.mode,i.indent?i.indent(r.outer,""):0))}},electricChars:t.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:t}}}}},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){function t(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.info=r,this.align=i,this.prev=o}function n(e,n,r,i){var o=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=r&&(o=e.context.indented),e.context=new t(o,n,r,i,null,e.context)}function r(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function i(e,t,n){return"variable"==t.prevToken||"type"==t.prevToken||!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,n))||!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0}function o(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function a(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function s(e,t){return"function"==typeof e?e(t):e.propertyIsEnumerable(t)}e.defineMode("clike",function(a,l){var c,u,d=a.indentUnit,f=l.statementIndentUnit||d,h=l.dontAlignCalls,p=l.keywords||{},m=l.types||{},g=l.builtin||{},v=l.blockKeywords||{},y=l.defKeywords||{},b=l.atoms||{},x=l.hooks||{},w=l.multiLineStrings,_=!1!==l.indentStatements,k=!1!==l.indentSwitch,C=l.namespaceSeparator,S=l.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,M=l.numberStart||/[\d\.]/,L=l.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,T=l.isOperatorChar||/[+\-*&%=<>!?|\/]/,O=l.isIdentifierChar||/[\w\$_\xa1-\uffff]/;function A(e,t){var n,r=e.next();if(x[r]){var i=x[r](e,t);if(!1!==i)return i}if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){for(var r,i=!1,o=!1;null!=(r=e.next());){if(r==n&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i&&!w)&&(t.tokenize=null),"string"}),t.tokenize(e,t);if(S.test(r))return c=r,null;if(M.test(r)){if(e.backUp(1),e.match(L))return"number";e.next()}if("/"==r){if(e.eat("*"))return t.tokenize=P,P(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(T.test(r)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(T););return"operator"}if(e.eatWhile(O),C)for(;e.match(C);)e.eatWhile(O);var o=e.current();return s(p,o)?(s(v,o)&&(c="newstatement"),s(y,o)&&(u=!0),"keyword"):s(m,o)?"type":s(g,o)?(s(v,o)&&(c="newstatement"),"builtin"):s(b,o)?"atom":"variable"}function P(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function E(e,t){l.typeFirstDefinitions&&e.eol()&&o(t.context)&&(t.typeAtEndOfLine=i(e,t,e.pos))}return{startState:function(e){return{tokenize:null,context:new t((e||0)-d,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var a=t.context;if(e.sol()&&(null==a.align&&(a.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return E(e,t),null;c=u=null;var s=(t.tokenize||A)(e,t);if("comment"==s||"meta"==s)return s;if(null==a.align&&(a.align=!0),";"==c||":"==c||","==c&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)r(t);else if("{"==c)n(t,e.column(),"}");else if("["==c)n(t,e.column(),"]");else if("("==c)n(t,e.column(),")");else if("}"==c){for(;"statement"==a.type;)a=r(t);for("}"==a.type&&(a=r(t));"statement"==a.type;)a=r(t)}else c==a.type?r(t):_&&(("}"==a.type||"top"==a.type)&&";"!=c||"statement"==a.type&&"newstatement"==c)&&n(t,e.column(),"statement",e.current());if("variable"==s&&("def"==t.prevToken||l.typeFirstDefinitions&&i(e,t,e.start)&&o(t.context)&&e.match(/^\s*\(/,!1))&&(s="def"),x.token){var d=x.token(e,t,s);void 0!==d&&(s=d)}return"def"==s&&!1===l.styleDefs&&(s="variable"),t.startOfLine=!1,t.prevToken=u?"def":s||c,E(e,t),s},indent:function(t,n){if(t.tokenize!=A&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var r=t.context,i=n&&n.charAt(0);if("statement"==r.type&&"}"==i&&(r=r.prev),l.dontIndentStatements)for(;"statement"==r.type&&l.dontIndentStatements.test(r.info);)r=r.prev;if(x.indent){var o=x.indent(t,r,n);if("number"==typeof o)return o}var a=i==r.type,s=r.prev&&"switch"==r.prev.info;if(l.allmanIndentation&&/[{(]/.test(i)){for(;"top"!=r.type&&"}"!=r.type;)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==i?0:f):!r.align||h&&")"==r.type?")"!=r.type||a?r.indented+(a?0:d)+(a||!s||/^(?:case|default)\b/.test(n)?0:d):r.indented+f:r.column+(a?0:1)},electricInput:k?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});var l="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",c="int long char short double float unsigned signed void size_t ptrdiff_t";function u(e,t){if(!t.startOfLine)return!1;for(var n,r=null;n=e.peek();){if("\\"==n&&e.match(/^.$/)){r=u;break}if("/"==n&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=r,"meta"}function d(e,t){return"type"==t.prevToken&&"type"}function f(e){return e.eatWhile(/[\w\.']/),"number"}function h(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);return!!n&&(t.cpp11RawStringDelim=n[1],t.tokenize=m,m(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function p(e,t){for(var n;null!=(n=e.next());)if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function m(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");return e.match(new RegExp(".*?\\)"+n+'"'))?t.tokenize=null:e.skipToEnd(),"string"}function g(t,n){"string"==typeof t&&(t=[t]);var r=[];function i(e){if(e)for(var t in e)e.hasOwnProperty(t)&&r.push(t)}i(n.keywords),i(n.types),i(n.builtin),i(n.atoms),r.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],r));for(var o=0;o<t.length;++o)e.defineMIME(t[o],n)}function v(e,t){for(var n=!1;!e.eol();){if(!n&&e.match('"""')){t.tokenize=null;break}n="\\"==e.next()&&!n}return"string"}g(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:a(l),types:a(c+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:a("case do else for if switch while struct"),defKeywords:a("struct"),typeFirstDefinitions:!0,atoms:a("NULL true false"),hooks:{"#":u,"*":d},modeProps:{fold:["brace","include"]}}),g(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:a(l+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:a(c+" bool wchar_t"),blockKeywords:a("catch class do else finally for if struct switch try while"),defKeywords:a("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:a("true false NULL"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,hooks:{"#":u,"*":d,u:h,U:h,L:h,R:h,0:f,1:f,2:f,3:f,4:f,5:f,6:f,7:f,8:f,9:f,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&(r=e.current(),(i=/(\w+)::~?(\w+)$/.exec(r))&&i[1]==i[2]))return"def";var r,i}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),g("text/x-java",{name:"clike",keywords:a("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:a("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:a("catch class do else finally for if switch try while"),defKeywords:a("class interface enum @interface"),typeFirstDefinitions:!0,atoms:a("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return!e.match("interface",!1)&&(e.eatWhile(/[\w\$_]/),"meta")}},modeProps:{fold:["brace","import"]}}),g("text/x-csharp",{name:"clike",keywords:a("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:a("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:a("catch class do else finally for foreach if struct switch try while"),defKeywords:a("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=p,p(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),g("text/x-scala",{name:"clike",keywords:a("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:a("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:a("catch class enum do else finally for forSome if match switch try while"),defKeywords:a("class enum def object package trait type val var"),atoms:a("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=v,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,n){var r=n.context;return!("}"!=r.type||!r.align||!e.eat(">"))&&(n.context=new t(r.indented,r.column,r.type,r.info,null,r.prev),"operator")},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=function e(t){return function(n,r){for(var i;i=n.next();){if("*"==i&&n.eat("/")){if(1==t){r.tokenize=null;break}return r.tokenize=e(t-1),r.tokenize(n,r)}if("/"==i&&n.eat("*"))return r.tokenize=e(t+1),r.tokenize(n,r)}return"comment"}}(1),t.tokenize(e,t))}},modeProps:{closeBrackets:{triples:'"'}}}),g("text/x-kotlin",{name:"clike",keywords:a("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"),types:a("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:a("catch class do else finally for if where try while enum"),defKeywords:a("class val var object interface fun"),atoms:a("true false null this"),hooks:{'"':function(e,t){var n;return t.tokenize=(n=e.match('""'),function(e,t){for(var r,i=!1,o=!1;!e.eol();){if(!n&&!i&&e.match('"')){o=!0;break}if(n&&e.match('"""')){o=!0;break}r=e.next(),!i&&"$"==r&&e.match("{")&&e.skipTo("}"),i=!i&&"\\"==r&&!n}return!o&&n||(t.tokenize=null),"string"}),t.tokenize(e,t)}},modeProps:{closeBrackets:{triples:'"'}}}),g(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:a("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:a("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:a("for while do if else struct"),builtin:a("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:a("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":u},modeProps:{fold:["brace","include"]}}),g("text/x-nesc",{name:"clike",keywords:a(l+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:a(c),blockKeywords:a("case do else for if switch while struct"),atoms:a("null true false"),hooks:{"#":u},modeProps:{fold:["brace","include"]}}),g("text/x-objectivec",{name:"clike",keywords:a(l+"inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:a(c),atoms:a("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":u,indent:function(e,t,n){if("statement"==t.type&&/^@\w/.test(n))return t.indented}},modeProps:{fold:"brace"}}),g("text/x-squirrel",{name:"clike",keywords:a("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:a(c),blockKeywords:a("case catch class else for foreach if switch try while"),defKeywords:a("function local class"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"#":u},modeProps:{fold:["brace","include"]}});var y=null;g("text/x-ceylon",{name:"clike",keywords:a("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:a("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:a("class dynamic function interface module object package value"),builtin:a("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:a("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=function e(t){return function(n,r){for(var i,o=!1,a=!1;!n.eol();){if(!o&&n.match('"')&&("single"==t||n.match('""'))){a=!0;break}if(!o&&n.match("``")){y=e(t),a=!0;break}i=n.next(),o="single"==t&&!o&&"\\"==i}return a&&(r.tokenize=null),"string"}}(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!y||!e.match("`"))&&(t.tokenize=y,y=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,n){if(("variable"==n||"type"==n)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){e.defineMode("stex",function(){function e(e,t){e.cmdState.push(t)}function t(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function n(e,t,n){return function(){this.name=e,this.bracketNo=0,this.style=t,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};function i(e,t){e.f=t}function o(n,o){var l;if(n.match(/^\\[a-zA-Z@]+/)){var c=n.current().slice(1);return e(o,l=new(l=r[c]||r.DEFAULT)),i(o,s),l.style}if(n.match(/^\\[$&%#{}_]/))return"tag";if(n.match(/^\\[,;!\/\\]/))return"tag";if(n.match("\\["))return i(o,function(e,t){return a(e,t,"\\]")}),"keyword";if(n.match("\\("))return i(o,function(e,t){return a(e,t,"\\)")}),"keyword";if(n.match("$$"))return i(o,function(e,t){return a(e,t,"$$")}),"keyword";if(n.match("$"))return i(o,function(e,t){return a(e,t,"$")}),"keyword";var u=n.next();return"%"==u?(n.skipToEnd(),"comment"):"}"==u||"]"==u?(l=t(o))?(l.closeBracket(u),i(o,s),"bracket"):"error":"{"==u||"["==u?(e(o,l=new(l=r.DEFAULT)),"bracket"):/\d/.test(u)?(n.eatWhile(/[\w.%]/),"atom"):(n.eatWhile(/[\w\-_]/),"begin"==(l=function(e){for(var t=o.cmdState,n=t.length-1;n>=0;n--){var r=t[n];if("DEFAULT"!=r.name)return r}return{styleIdentifier:function(){return null}}}()).name&&(l.argument=n.current()),l.styleIdentifier())}function a(e,t,n){if(e.eatSpace())return null;if(e.match(n))return i(t,o),"keyword";if(e.match(/^\\[a-zA-Z@]+/))return"tag";if(e.match(/^[a-zA-Z]+/))return"variable-2";if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/]/))return"tag";if(e.match(/^[\^_&]/))return"tag";if(e.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(e.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=e.next();return"{"==r||"}"==r||"["==r||"]"==r||"("==r||")"==r?"bracket":"%"==r?(e.skipToEnd(),"comment"):"error"}function s(e,n){var r=e.peek();return"{"==r||"["==r?(t(n).openBracket(r),e.eat(r),i(n,o),"bracket"):/[ \t\r]/.test(r)?(e.eat(r),null):(i(n,o),function(e){var t=n.cmdState.pop();t&&t.closeBracket()}(),o(e,n))}return r.importmodule=n("importmodule","tag",["string","builtin"]),r.documentclass=n("documentclass","tag",["","atom"]),r.usepackage=n("usepackage","tag",["atom"]),r.begin=n("begin","tag",["atom"]),r.end=n("end","tag",["atom"]),r.label=n("label","tag",["atom"]),r.ref=n("ref","tag",["atom"]),r.eqref=n("eqref","tag",["atom"]),r.cite=n("cite","tag",["atom"]),r.bibitem=n("bibitem","tag",["atom"]),r.Bibitem=n("Bibitem","tag",["atom"]),r.RBibitem=n("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:o}},copyState:function(e){return{cmdState:e.cmdState.slice(),f:e.f}},token:function(e,t){return t.f(e,t)},blankLine:function(e){e.f=o,e.cmdState.length=0},lineComment:"%"}}),e.defineMIME("text/x-stex","stex"),e.defineMIME("text/x-latex","stex")},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var n,r=t(["and","or","not","is"]),i=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],o=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];function a(e){return e.scopes[e.scopes.length-1]}e.registerHelper("hintWords","python",i.concat(o)),e.defineMode("python",function(n,s){for(var l="error",c=s.delimiters||s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,u=[s.singleOperators,s.doubleOperators,s.doubleDelimiters,s.tripleDelimiters,s.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@])/],d=0;d<u.length;d++)u[d]||u.splice(d--,1);var f=s.hangingIndent||n.indentUnit,h=i,p=o;void 0!=s.extra_keywords&&(h=h.concat(s.extra_keywords)),void 0!=s.extra_builtins&&(p=p.concat(s.extra_builtins));var m=!(s.version&&Number(s.version)<3);if(m){var g=s.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;h=h.concat(["nonlocal","False","True","None","async","await"]),p=p.concat(["ascii","bytes","exec","print"]);var v=new RegExp("^(([rbuf]|(br))?('{3}|\"{3}|['\"]))","i")}else g=s.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/,h=h.concat(["exec","print"]),p=p.concat(["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"]),v=new RegExp("^(([rubf]|(ur)|(br))?('{3}|\"{3}|['\"]))","i");var y=t(h),b=t(p);function x(e,t){var n=e.sol()&&"\\"!=t.lastToken;if(n&&(t.indent=e.indentation()),n&&"py"==a(t).type){var r=a(t).offset;if(e.eatSpace()){var i=e.indentation();return i>r?_(t):i<r&&k(e,t)&&"#"!=e.peek()&&(t.errorToken=!0),null}var o=w(e,t);return r>0&&k(e,t)&&(o+=" "+l),o}return w(e,t)}function w(e,t){if(e.eatSpace())return null;if(e.match(/^#.*/))return"comment";if(e.match(/^[0-9\.]/,!1)){var n=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(n=!0),e.match(/^[\d_]+\.\d*/)&&(n=!0),e.match(/^\.\d+/)&&(n=!0),n)return e.eat(/J/i),"number";var i=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(i=!0),e.match(/^0b[01_]+/i)&&(i=!0),e.match(/^0o[0-7_]+/i)&&(i=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),i=!0),e.match(/^0(?![\dx])/i)&&(i=!0),i)return e.eat(/L/i),"number"}if(e.match(v))return t.tokenize=function(e){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var t=1==e.length,n="string";function r(r,i){for(;!r.eol();)if(r.eatWhile(/[^'"\\]/),r.eat("\\")){if(r.next(),t&&r.eol())return n}else{if(r.match(e))return i.tokenize=x,n;r.eat(/['"]/)}if(t){if(s.singleLineStringErrors)return l;i.tokenize=x}return n}return r.isString=!0,r}(e.current()),t.tokenize(e,t);for(var o=0;o<u.length;o++)if(e.match(u[o]))return"operator";return e.match(c)?"punctuation":"."==t.lastToken&&e.match(g)?"property":e.match(y)||e.match(r)?"keyword":e.match(b)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(g)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),l)}function _(e){for(;"py"!=a(e).type;)e.scopes.pop();e.scopes.push({offset:a(e).offset+n.indentUnit,type:"py",align:null})}function k(e,t){for(var n=e.indentation();t.scopes.length>1&&a(t).offset>n;){if("py"!=a(t).type)return!0;t.scopes.pop()}return a(t).offset!=n}return{startState:function(e){return{tokenize:x,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=function(e,t){e.sol()&&(t.beginningOfLine=!0);var n=t.tokenize(e,t),r=e.current();if(t.beginningOfLine&&"@"==r)return e.match(g,!1)?"meta":m?"operator":l;/\S/.test(r)&&(t.beginningOfLine=!1),"variable"!=n&&"builtin"!=n||"meta"!=t.lastToken||(n="meta"),"pass"!=r&&"return"!=r||(t.dedent+=1),"lambda"==r&&(t.lambda=!0),":"!=r||t.lambda||"py"!=a(t).type||_(t);var i=1==r.length?"[({".indexOf(r):-1;if(-1!=i&&function(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+f,type:n,align:r})}(e,t,"])}".slice(i,i+1)),-1!=(i="])}".indexOf(r))){if(a(t).type!=r)return l;t.indent=t.scopes.pop().offset-f}return t.dedent>0&&e.eol()&&"py"==a(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),n}(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+l:r},indent:function(t,n){if(t.tokenize!=x)return t.tokenize.isString?e.Pass:0;var r=a(t),i=r.type==n.charAt(0);return null!=r.align?r.align-(i?1:0):r.offset-(i?f:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}}),e.defineMIME("text/x-python","python"),e.defineMIME("text/x-cython",{name:"python",extra_keywords:(n="by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE",n.split(" "))})},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){e.defineMode("sql",function(t,n){var r=n.client||{},i=n.atoms||{false:!0,true:!0,null:!0},o=n.builtin||{},a=n.keywords||{},s=n.operatorChars||/^[*+\-%<>!=&|~^]/,l=n.support||{},c=n.hooks||{},u=n.dateSQL||{date:!0,time:!0,timestamp:!0},d=!1!==n.backslashStringEscapes;function f(e,t){var n,h=e.next();if(c[h]){var p=c[h](e,t);if(!1!==p)return p}if(l.hexNumber&&("0"==h&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==h||"X"==h)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(l.binaryNumber&&(("b"==h||"B"==h)&&e.match(/^'[01]+'/)||"0"==h&&e.match(/^b[01]+/)))return"number";if(h.charCodeAt(0)>47&&h.charCodeAt(0)<58)return e.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/),l.decimallessFloat&&e.match(/^\.(?!\.)/),"number";if("?"==h&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==h||'"'==h&&l.doubleQuote)return t.tokenize=(n=h,function(e,t){for(var r,i=!1;null!=(r=e.next());){if(r==n&&!i){t.tokenize=f;break}i=d&&!i&&"\\"==r}return"string"}),t.tokenize(e,t);if((l.nCharCast&&("n"==h||"N"==h)||l.charsetCast&&"_"==h&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(h))return null;if(l.commentSlashSlash&&"/"==h&&e.eat("/"))return e.skipToEnd(),"comment";if(l.commentHash&&"#"==h||"-"==h&&e.eat("-")&&(!l.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==h&&e.eat("*"))return t.tokenize=function e(t){return function(n,r){var i=n.match(/^.*?(\/\*|\*\/)/);return i?"/*"==i[1]?r.tokenize=e(t+1):r.tokenize=t>1?e(t-1):f:n.skipToEnd(),"comment"}}(1),t.tokenize(e,t);if("."!=h){if(s.test(h))return e.eatWhile(s),null;if("{"==h&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var m=e.current().toLowerCase();return u.hasOwnProperty(m)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":i.hasOwnProperty(m)?"atom":o.hasOwnProperty(m)?"builtin":a.hasOwnProperty(m)?"keyword":r.hasOwnProperty(m)?"string-2":null}return l.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":e.match(/^\.+/)?null:l.ODBCdotTable&&e.match(/^[\w\d_]+/)?"variable-2":void 0}function h(e,t,n){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:n}}return{startState:function(){return{tokenize:f,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),t.tokenize==f&&e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==n)return n;t.context&&null==t.context.align&&(t.context.align=!0);var r=e.current();return"("==r?h(e,t,")"):"["==r?h(e,t,"]"):t.context&&t.context.type==r&&function(e){e.indent=e.context.indent,e.context=e.context.prev}(t),n},indent:function(n,r){var i=n.context;if(!i)return e.Pass;var o=r.charAt(0)==i.type;return i.align?i.col+(o?0:1):i.indent+(o?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:l.commentSlashSlash?"//":l.commentHash?"#":"--"}}),function(){function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function n(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function r(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}var i="alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit ";function o(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}e.defineMIME("text/x-sql",{name:"sql",keywords:o(i+"begin"),builtin:o("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:o("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:o(i+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare exec"),builtin:o("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,backslashStringEscapes:!1,dateSQL:o("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":n}}),e.defineMIME("text/x-mysql",{name:"sql",client:o("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:o(i+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:o("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-mariadb",{name:"sql",client:o("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:o(i+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:o("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-sqlite",{name:"sql",client:o("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"),keywords:o(i+"abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"),builtin:o("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"),atoms:o("null current_date current_time current_timestamp"),operatorChars:/^[*+\-%<>!=&|/~]/,dateSQL:o("date time timestamp datetime"),support:o("decimallessFloat zerolessFloat"),identifierQuote:'"',hooks:{"@":n,":":n,"?":n,$:n,'"':function(e){for(var t;null!=(t=e.next());)if('"'==t&&!e.eat('"'))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null},"`":t}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:o("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:o("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:o("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:o("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:o("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:o("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:o("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:o("date time timestamp"),support:o("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:o("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:o("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:o("date timestamp"),support:o("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-pgsql",{name:"sql",client:o("source"),keywords:o(i+"a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lc_collate lc_ctype lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict restricted result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat attach path depends detach zone"),builtin:o("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),e.defineMIME("text/x-gql",{name:"sql",keywords:o("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:o("false true"),builtin:o("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/}),e.defineMIME("text/x-gpsql",{name:"sql",client:o("source"),keywords:o("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"),builtin:o("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),e.defineMIME("text/x-sparksql",{name:"sql",keywords:o("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"),builtin:o("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"),atoms:o("false true null"),operatorChars:/^[*+\-%<>!=~&|^]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable doubleQuote zerolessFloat")}),e.defineMIME("text/x-esper",{name:"sql",client:o("source"),keywords:o("alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"),builtin:{},atoms:o("false true null"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:o("time"),support:o("decimallessFloat zerolessFloat binaryNumber hexNumber")})}()},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){e.defineMode("shell",function(){var e={};function t(t,n){for(var r=n.split(" "),i=0;i<r.length;i++)e[r[i]]=t}function n(e,t){var a="("==e?")":"{"==e?"}":e;return function(s,l){for(var c,u=!1;null!=(c=s.next());){if(c===a&&!u){l.tokens.shift();break}if("$"===c&&!u&&"'"!==e&&s.peek()!=a){u=!0,s.backUp(1),l.tokens.unshift(i);break}if(!u&&e!==a&&c===e)return l.tokens.unshift(n(e,t)),o(s,l);if(!u&&/['"]/.test(c)&&!/['"]/.test(e)){l.tokens.unshift(r(c,"string")),s.backUp(1);break}u=!u&&"\\"===c}return t}}function r(e,t){return function(r,i){return i.tokens[0]=n(e,t),r.next(),o(r,i)}}t("atom","true false"),t("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function"),t("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep hg kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo svn tee telnet top touch vi vim wall wc wget who write yes zsh");var i=function(e,t){t.tokens.length>1&&e.eat("$");var r=e.next();return/['"({]/.test(r)?(t.tokens[0]=n(r,"("==r?"quote":"{"==r?"def":"string"),o(e,t)):(/\d/.test(r)||e.eatWhile(/\w/),t.tokens.shift(),"def")};function o(t,r){return(r.tokens[0]||function(t,r){if(t.eatSpace())return null;var a=t.sol(),s=t.next();if("\\"===s)return t.next(),null;if("'"===s||'"'===s||"`"===s)return r.tokens.unshift(n(s,"`"===s?"quote":"string")),o(t,r);if("#"===s)return a&&t.eat("!")?(t.skipToEnd(),"meta"):(t.skipToEnd(),"comment");if("$"===s)return r.tokens.unshift(i),o(t,r);if("+"===s||"="===s)return"operator";if("-"===s)return t.eat("-"),t.eatWhile(/\w/),"attribute";if(/\d/.test(s)&&(t.eatWhile(/\d/),t.eol()||!/\w/.test(t.peek())))return"number";t.eatWhile(/[\w-]/);var l=t.current();return"="===t.peek()&&/\w+/.test(l)?"def":e.hasOwnProperty(l)?e[l]:null})(t,r)}return{startState:function(){return{tokens:[]}},token:function(e,t){return o(e,t)},closeBrackets:"()[]{}''\"\"``",lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell"),e.defineMIME("application/x-sh","shell")},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){e.registerHelper("wordChars","r",/[\w.]/),e.defineMode("r",function(e){function t(e){for(var t=e.split(" "),n={},r=0;r<t.length;++r)n[t[r]]=!0;return n}var n,r=t("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"),i=t("list quote bquote eval return call parse deparse"),o=t("if else repeat while function for in next break"),a=t("if else repeat while function for"),s=/[+\-*\/^<>=!&|~$:]/;function l(e,t){n=null;var c,u=e.next();if("#"==u)return e.skipToEnd(),"comment";if("0"==u&&e.eat("x"))return e.eatWhile(/[\da-f]/i),"number";if("."==u&&e.eat(/\d/))return e.match(/\d*(?:e[+\-]?\d+)?/),"number";if(/\d/.test(u))return e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/),"number";if("'"==u||'"'==u)return t.tokenize=(c=u,function(e,t){if(e.eat("\\")){var n=e.next();return"x"==n?e.match(/^[a-f0-9]{2}/i):("u"==n||"U"==n)&&e.eat("{")&&e.skipTo("}")?e.next():"u"==n?e.match(/^[a-f0-9]{4}/i):"U"==n?e.match(/^[a-f0-9]{8}/i):/[0-7]/.test(n)&&e.match(/^[0-7]{1,2}/),"string-2"}for(var r;null!=(r=e.next());){if(r==c){t.tokenize=l;break}if("\\"==r){e.backUp(1);break}}return"string"}),"string";if("`"==u)return e.match(/[^`]+`/),"variable-3";if("."==u&&e.match(/.[.\d]+/))return"keyword";if(/[\w\.]/.test(u)&&"_"!=u){e.eatWhile(/[\w\.]/);var d=e.current();return r.propertyIsEnumerable(d)?"atom":o.propertyIsEnumerable(d)?(a.propertyIsEnumerable(d)&&!e.match(/\s*if(\s+|$)/,!1)&&(n="block"),"keyword"):i.propertyIsEnumerable(d)?"builtin":"variable"}return"%"==u?(e.skipTo("%")&&e.next(),"operator variable-2"):"<"==u&&e.eat("-")||"<"==u&&e.match("<-")||"-"==u&&e.match(/>>?/)?"operator arrow":"="==u&&t.ctx.argList?"arg-is":s.test(u)?"$"==u?"operator dollar":(e.eatWhile(s),"operator"):/[\(\){}\[\];]/.test(u)?(n=u,";"==u?"semi":null):null}function c(e,t,n){e.ctx={type:t,indent:e.indent,flags:0,column:n.column(),prev:e.ctx}}function u(e,t){var n=e.ctx;e.ctx={type:n.type,indent:n.indent,flags:n.flags|t,column:n.column,prev:n.prev}}function d(e){e.indent=e.ctx.indent,e.ctx=e.ctx.prev}return{startState:function(){return{tokenize:l,ctx:{type:"top",indent:-e.indentUnit,flags:2},indent:0,afterIdent:!1}},token:function(e,t){if(e.sol()&&(0==(3&t.ctx.flags)&&(t.ctx.flags|=2),4&t.ctx.flags&&d(t),t.indent=e.indentation()),e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"!=r&&0==(2&t.ctx.flags)&&u(t,1),";"!=n&&"{"!=n&&"}"!=n||"block"!=t.ctx.type||d(t),"{"==n?c(t,"}",e):"("==n?(c(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):"["==n?c(t,"]",e):"block"==n?c(t,"block",e):n==t.ctx.type?d(t):"block"==t.ctx.type&&"comment"!=r&&u(t,4),t.afterIdent="variable"==r||"keyword"==r,r},indent:function(t,n){if(t.tokenize!=l)return 0;var r=n&&n.charAt(0),i=t.ctx,o=r==i.type;return 4&i.flags&&(i=i.prev),"block"==i.type?i.indent+("{"==r?0:e.indentUnit):1&i.flags?i.column+(o?0:1):i.indent+(o?0:e.indentUnit)},lineComment:"#"}}),e.defineMIME("text/x-rsrc","r")},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){e.defineMode("julia",function(e,t){function n(e,t){return void 0===t&&(t="\\b"),new RegExp("^(("+e.join(")|(")+"))"+t)}var r=t.operators||n(["[<>]:","[<>=]=","<<=?",">>>?=?","=>","->","\\/\\/","[\\\\%*+\\-<>!=\\/^|&\\u00F7\\u22BB]=?","\\?","\\$","~",":","\\u00D7","\\u2208","\\u2209","\\u220B","\\u220C","\\u2218","\\u221A","\\u221B","\\u2229","\\u222A","\\u2260","\\u2264","\\u2265","\\u2286","\\u2288","\\u228A","\\u22C5","\\b(in|isa)\\b(?!.?\\()"],""),i=t.delimiters||/^[;,()[\]{}]/,o=t.identifiers||/^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/,a=n(["\\\\[0-7]{1,3}","\\\\x[A-Fa-f0-9]{1,2}","\\\\[abefnrtv0%?'\"\\\\]","([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])"],"'"),s=n(["begin","function","type","struct","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"]),l=n(["end","else","elseif","catch","finally"]),c=n(["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","where","macro","module","baremodule","struct","type","mutable","immutable","quote","typealias","abstract","primitive","bitstype"]),u=n(["true","false","nothing","NaN","Inf"]),d=/^@[_A-Za-z][\w]*/,f=/^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/,h=/^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/;function p(e){return m(e,"[")}function m(e,t){var n=g(e),r=g(e,1);return void 0===t&&(t="("),n===t||r===t&&"for"===n}function g(e,t){return void 0===t&&(t=0),e.scopes.length<=t?null:e.scopes[e.scopes.length-(t+1)]}function v(e,t){if(e.match(/^#=/,!1))return t.tokenize=x,t.tokenize(e,t);var n=t.leavingExpr;if(e.sol()&&(n=!1),t.leavingExpr=!1,n&&e.match(/^'+/))return"operator";if(e.match(/\.{4,}/))return"error";if(e.match(/\.{1,3}/))return"operator";if(e.eatSpace())return null;var a=e.peek();if("#"===a)return e.skipToEnd(),"comment";"["===a&&t.scopes.push("["),"("===a&&t.scopes.push("(");var _,k=g(t);if(p(t)&&"]"===a&&("for"===k&&t.scopes.pop(),t.scopes.pop(),t.leavingExpr=!0),m(t)&&")"===a&&("for"===k&&t.scopes.pop(),t.scopes.pop(),t.leavingExpr=!0),p(t)){if("end"==t.lastToken&&e.match(/^:/))return"operator";if(e.match(/^end/))return"number"}if((_=e.match(s,!1))&&t.scopes.push(_[0]),e.match(l,!1)&&t.scopes.pop(),e.match(/^::(?![:\$])/))return t.tokenize=b,t.tokenize(e,t);if(!n&&e.match(f)||e.match(/:([<>]:|<<=?|>>>?=?|->|\/\/|\.{2,3}|[\.\\%*+\-<>!\/^|&]=?|[~\?\$])/))return"builtin";if(e.match(r))return"operator";if(e.match(/^\.?\d/,!1)){var C=RegExp(/^im\b/),S=!1;if(e.match(/^\d*\.(?!\.)\d*([Eef][\+\-]?\d+)?/i)&&(S=!0),e.match(/^\d+\.(?!\.)\d*/)&&(S=!0),e.match(/^\.\d+/)&&(S=!0),e.match(/^0x\.[0-9a-f]+p[\+\-]?\d+/i)&&(S=!0),e.match(/^0x[0-9a-f]+/i)&&(S=!0),e.match(/^0b[01]+/i)&&(S=!0),e.match(/^0o[0-7]+/i)&&(S=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(S=!0),e.match(/^0(?![\dx])/i)&&(S=!0),S)return e.match(C),t.leavingExpr=!0,"number"}if(e.match(/^'/))return t.tokenize=w,t.tokenize(e,t);if(e.match(h))return t.tokenize=function(e){return'"""'===e.substr(-3)?e='"""':'"'===e.substr(-1)&&(e='"'),function(t,n){if(t.eat("\\"))t.next();else{if(t.match(e))return n.tokenize=v,n.leavingExpr=!0,"string";t.eat(/[`"]/)}return t.eatWhile(/[^\\`"]/),"string"}}(e.current()),t.tokenize(e,t);if(e.match(d))return"meta";if(e.match(i))return null;if(e.match(c))return"keyword";if(e.match(u))return"builtin";var M=t.isDefinition||"function"==t.lastToken||"macro"==t.lastToken||"type"==t.lastToken||"struct"==t.lastToken||"immutable"==t.lastToken;return e.match(o)?M?"."===e.peek()?(t.isDefinition=!0,"variable"):(t.isDefinition=!1,"def"):e.match(/^({[^}]*})*\(/,!1)?(t.tokenize=y,t.tokenize(e,t)):(t.leavingExpr=!0,"variable"):(e.next(),"error")}function y(e,t){var n=e.match(/^(\(\s*)/);if(n&&(t.firstParenPos<0&&(t.firstParenPos=t.scopes.length),t.scopes.push("("),t.charsAdvanced+=n[1].length),"("==g(t)&&e.match(/^\)/)&&(t.scopes.pop(),t.charsAdvanced+=1,t.scopes.length<=t.firstParenPos)){var r=e.match(/^(\s*where\s+[^\s=]+)*\s*?=(?!=)/,!1);return e.backUp(t.charsAdvanced),t.firstParenPos=-1,t.charsAdvanced=0,t.tokenize=v,r?"def":"builtin"}if(e.match(/^$/g,!1)){for(e.backUp(t.charsAdvanced);t.scopes.length>t.firstParenPos;)t.scopes.pop();return t.firstParenPos=-1,t.charsAdvanced=0,t.tokenize=v,"builtin"}return t.charsAdvanced+=e.match(/^([^()]*)/)[1].length,t.tokenize(e,t)}function b(e,t){return e.match(/.*?(?=,|;|{|}|\(|\)|=|$|\s)/),e.match(/^{/)?t.nestedLevels++:e.match(/^}/)&&t.nestedLevels--,t.nestedLevels>0?e.match(/.*?(?={|})/)||e.next():0==t.nestedLevels&&(t.tokenize=v),"builtin"}function x(e,t){return e.match(/^#=/)&&t.nestedLevels++,e.match(/.*?(?=(#=|=#))/)||e.skipToEnd(),e.match(/^=#/)&&(t.nestedLevels--,0==t.nestedLevels&&(t.tokenize=v)),"comment"}function w(e,t){var n,r=!1;if(e.match(a))r=!0;else if(n=e.match(/\\u([a-f0-9]{1,4})(?=')/i))((i=parseInt(n[1],16))<=55295||i>=57344)&&(r=!0,e.next());else if(n=e.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)){var i;(i=parseInt(n[1],16))<=1114111&&(r=!0,e.next())}return r?(t.leavingExpr=!0,t.tokenize=v,"string"):(e.match(/^[^']+(?=')/)||e.skipToEnd(),e.match(/^'/)&&(t.tokenize=v),"error")}return{startState:function(){return{tokenize:v,scopes:[],lastToken:null,leavingExpr:!1,isDefinition:!1,nestedLevels:0,charsAdvanced:0,firstParenPos:-1}},token:function(e,t){var n=t.tokenize(e,t),r=e.current();return r&&n&&(t.lastToken=r),n},indent:function(t,n){var r=0;return"]"!==n&&")"!==n&&"end"!==n&&"else"!==n&&"catch"!==n&&"elseif"!==n&&"finally"!==n||(r=-1),(t.scopes.length+r)*e.indentUnit},electricInput:/\b(end|else|catch|finally)\b/,blockCommentStart:"#=",blockCommentEnd:"=#",lineComment:"#",fold:"indent"}}),e.defineMIME("text/x-julia","julia")},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",function(n,r){var i=0,o={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var o=e.pos;e.eatWhile("`");var a=1+e.pos-o;return n.code?a===i&&(n.code=!1):(i=a,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,!1!==r.gitHubSpice)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:function(e){return e.code=!1,null}},a={taskLists:!0,strikethrough:!0,emoji:!0};for(var s in r)a[s]=r[s];return a.name="markdown",e.overlayMode(e.getMode(n,a),o)},"markdown"),e.defineMIME("text/x-gfm","gfm")},"object"==s(t)&&"object"==s(e)?a(n(0),n(21),n(28)):(i=[n(0),n(21),n(28)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";var r,i=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=n(15),s=n(15),l=n(11),c="jp-OutputArea",u="jp-OutputPrompt",d="jp-Stdin",f=function(e){function t(n){var r=e.call(this)||this;r.outputLengthChanged=new o.Signal(r),r._onIOPub=function(e){var t,n,i=r.model,o=e.header.msg_type,a=(e.content.transient||{}).display_id;switch(o){case"execute_result":case"display_data":case"stream":case"error":(t=e.content).output_type=o,i.add(t);break;case"clear_output":var s=e.content.wait;i.clear(s);break;case"update_display_data":if((t=e.content).output_type="display_data",n=r._displayIdMap.get(a))for(var l=0,c=n;l<c.length;l++){var u=c[l];i.set(u,t)}}a&&"display_data"===o&&((n=r._displayIdMap.get(a)||[]).push(i.length-1),r._displayIdMap.set(a,n))},r._onExecuteReply=function(e){var t=r.model,n=e.content,i=n&&n.payload;if(i&&i.length){var o=i.filter(function(e){return"page"===e.source});if(o.length){var a={output_type:"display_data",data:JSON.parse(JSON.stringify(o[0])).data,metadata:{}};t.add(a)}}},r._minHeightTimeout=null,r._future=null,r._displayIdMap=new Map;var i=r.model=n.model;r.addClass(c),r.rendermime=n.rendermime,r.contentFactory=n.contentFactory||t.defaultContentFactory,r.layout=new a.PanelLayout;for(var s=0;s<i.length;s++){var l=i.get(s);r._insertOutput(s,l)}return i.changed.connect(r.onModelChanged,r),r}return i(t,e),Object.defineProperty(t.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"future",{get:function(){return this._future},set:function(e){var t=this;if(this.model.isDisposed)throw Error("Model is disposed");this._future!==e&&(this._future&&this._future.dispose(),this._future=e,this.model.clear(),this.widgets.length&&(this._clear(),this.outputLengthChanged.emit(this.model.length)),e.onIOPub=this._onIOPub,e.onReply=this._onExecuteReply,e.onStdin=function(n){l.KernelMessage.isInputRequestMsg(n)&&t.onInputRequest(n,e)})},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this._future&&this._future.dispose(),this._future=null,this._displayIdMap.clear(),e.prototype.dispose.call(this)},t.prototype.onModelChanged=function(e,t){var n;switch(t.type){case"add":n=this._modelToLayoutIndex(t.newIndex),this._insertOutput(n,t.newValues[0]),this.outputLengthChanged.emit(this.model.length);break;case"remove":this.widgets.length&&(this._clear(),this.outputLengthChanged.emit(this.model.length));break;case"set":n=this._modelToLayoutIndex(t.newIndex),this._setOutput(n,t.newValues[0]),this.outputLengthChanged.emit(this.model.length)}},t.prototype._clear=function(){var e=this;if(this.widgets.length){for(var t=this.widgets.length,n=0;n<t;n++){var r=this.widgets[0];r.parent=null,r.dispose()}this._displayIdMap.clear();var i=this.node.getBoundingClientRect();this.node.style.minHeight=i.height+"px",this._minHeightTimeout&&clearTimeout(this._minHeightTimeout),this._minHeightTimeout=window.setTimeout(function(){e.isDisposed||(e.node.style.minHeight="")},50)}},t.prototype.onInputRequest=function(e,t){var n=this.contentFactory,r=e.content.prompt,i=e.content.password,o=new a.Panel;o.addClass("jp-OutputArea-child"),o.addClass("jp-OutputArea-stdin-item");var s=n.createOutputPrompt();s.addClass("jp-OutputArea-prompt"),o.addWidget(s);var l=n.createStdin({prompt:r,password:i,future:t});l.addClass("jp-OutputArea-output"),o.addWidget(l),this.layout.addWidget(o)},t.prototype._setOutput=function(e,t){var n=this.layout,r=n.widgets[e].widgets[1];r.renderModel?r.renderModel(t):(n.widgets[e].dispose(),this._insertOutput(e,t))},t.prototype._insertOutput=function(e,t){var n=this.createOutputItem(t);n.toggleClass("jp-OutputArea-executeResult",null!==t.executionCount),this.layout.insertWidget(e,n)},t.prototype._modelToLayoutIndex=function(e){var t,n=this.widgets,r=-1;for(t=0;t<n.length&&(n[t].hasClass("jp-OutputArea-stdin-item")||++r!==e);t++);return t},t.prototype.createOutputItem=function(e){var t=new a.Panel;t.addClass("jp-OutputArea-child");var n=this.contentFactory.createOutputPrompt();n.executionCount=e.executionCount,n.addClass("jp-OutputArea-prompt"),t.addWidget(n);var r=this.createRenderedMimetype(e);return r.addClass("jp-OutputArea-output"),t.addWidget(r),t},t.prototype.createRenderedMimetype=function(e){var t,n=this.rendermime.preferredMimeType(e.data,!e.trusted);if(n){var r,i=e.metadata,o=i[n];r=o&&void 0!==o.isolated?o.isolated:i.isolated;var a=this.rendermime.createRenderer(n);!0===r&&(a=new m.IsolatedRenderer(a)),a.renderModel(e),t=a}else t=new s.Widget;return t},t}(s.Widget);t.OutputArea=f;var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.onInputRequest=function(e,t){},t.prototype.createOutputItem=function(e){var t=this.createRenderedMimetype(e);return t.addClass("jp-OutputArea-output"),t},t}(f);t.SimplifiedOutputArea=h,function(e){e.execute=function(e,t,n){var r={code:e,stop_on_error:!0};if(!n.kernel)return Promise.reject("Session has no kernel.");var i=n.kernel.requestExecute(r,!1);return t.future=i,i.done};var t=function(){function e(){}return e.prototype.createOutputPrompt=function(){return new p},e.prototype.createStdin=function(e){return new g(e)},e}();e.ContentFactory=t,e.defaultContentFactory=new t}(f=t.OutputArea||(t.OutputArea={})),t.OutputArea=f;var p=function(e){function t(){var t=e.call(this)||this;return t._executionCount=null,t.addClass(u),t}return i(t,e),Object.defineProperty(t.prototype,"executionCount",{get:function(){return this._executionCount},set:function(e){this._executionCount=e,this.node.textContent=null===e?"":"Out["+e+"]:"},enumerable:!0,configurable:!0}),t}(s.Widget);t.OutputPrompt=p;var m,g=function(e){function t(t){var n=e.call(this,{node:m.createInputWidgetNode(t.prompt,t.password)})||this;return n._future=null,n._input=null,n.addClass(d),n._input=n.node.getElementsByTagName("input")[0],n._input.focus(),n._future=t.future,n}return i(t,e),t.prototype.handleEvent=function(e){var t=this._input;if("keydown"===e.type&&13===e.keyCode){this._future.sendInputReply({value:t.value});var n=document.createElement("span");n.className="jp-Stdin-rendered","password"===t.type?n.textContent=Array(t.value.length+1).join("·"):n.textContent=t.value,t.parentElement.replaceChild(n,t)}},t.prototype.onAfterAttach=function(e){this._input.addEventListener("keydown",this),this.update()},t.prototype.onUpdateRequest=function(e){this._input.focus()},t.prototype.onBeforeDetach=function(e){this._input.removeEventListener("keydown",this)},t}(s.Widget);t.Stdin=g,function(e){e.createInputWidgetNode=function(e,t){var n=document.createElement("div"),r=document.createElement("pre");r.className="jp-Stdin-prompt",r.textContent=e;var i=document.createElement("input");return i.className="jp-Stdin-input",t&&(i.type="password"),n.appendChild(r),r.appendChild(i),n};var t=function(e){function t(t){var n=e.call(this,{node:document.createElement("iframe")})||this;n.addClass("jp-mod-isolated"),n._wrapped=t;var r=n.node;return r.frameBorder="0",r.scrolling="auto",r.addEventListener("load",function(){r.contentDocument.open(),r.contentDocument.write(n._wrapped.node.innerHTML),r.contentDocument.close();var e=r.contentDocument.body;r.style.height=e.scrollHeight+"px"}),n}return i(t,e),t.prototype.renderModel=function(e){var t=this;return this._wrapped.renderModel(e).then(function(){var e=t.node.contentWindow;e&&e.location.reload()})},t}(s.Widget);e.IsolatedRenderer=t}(m||(m={}))},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=n(9),a=n(5),s=n(30);t.IRenderMimeRegistry=new a.Token("@jupyterlab/rendermime:IRenderMimeRegistry"),t.ILatexTypesetter=new a.Token("@jupyterlab/rendermime:ILatexTypesetter");var l,c=function(){function e(e){if(void 0===e&&(e={}),this._id=0,this._ranks={},this._types=null,this._factories={},this.resolver=e.resolver||null,this.linkHandler=e.linkHandler||null,this.latexTypesetter=e.latexTypesetter||null,this.sanitizer=e.sanitizer||o.defaultSanitizer,e.initialFactories)for(var t=0,n=e.initialFactories;t<n.length;t++){var r=n[t];this.addFactory(r)}}return Object.defineProperty(e.prototype,"mimeTypes",{get:function(){return this._types||(this._types=l.sortedTypes(this._ranks))},enumerable:!0,configurable:!0}),e.prototype.preferredMimeType=function(e,t){if(t)for(var n=0,r=this.mimeTypes;n<r.length;n++)if((a=r[n])in e&&this._factories[a].safe)return a;for(var i=0,o=this.mimeTypes;i<o.length;i++){var a;if((a=o[i])in e)return a}},e.prototype.createRenderer=function(e){if(!(e in this._factories))throw new Error("No factory for mime type: '"+e+"'");return this._factories[e].createRenderer({mimeType:e,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,latexTypesetter:this.latexTypesetter})},e.prototype.createModel=function(e){return void 0===e&&(e={}),new s.MimeModel(e)},e.prototype.clone=function(t){void 0===t&&(t={});var n=new e({resolver:t.resolver||this.resolver||void 0,sanitizer:t.sanitizer||this.sanitizer||void 0,linkHandler:t.linkHandler||this.linkHandler||void 0,latexTypesetter:t.latexTypesetter||this.latexTypesetter});return n._factories=r({},this._factories),n._ranks=r({},this._ranks),n._id=this._id,n},e.prototype.getFactory=function(e){return this._factories[e]},e.prototype.addFactory=function(e,t){void 0===t&&void 0===(t=e.defaultRank)&&(t=100);for(var n=0,r=e.mimeTypes;n<r.length;n++){var i=r[n];this._factories[i]=e,this._ranks[i]={rank:t,id:this._id++}}this._types=null},e.prototype.removeMimeType=function(e){delete this._factories[e],delete this._ranks[e],this._types=null},e.prototype.getRank=function(e){var t=this._ranks[e];return t&&t.rank},e.prototype.setRank=function(e,t){if(this._ranks[e]){var n=this._id++;this._ranks[e]={rank:t,id:n},this._types=null}},e}();t.RenderMimeRegistry=c,function(e){var t=function(){function e(e){this._session=e.session,this._contents=e.contents}return e.prototype.resolveUrl=function(e){if(i.URLExt.isLocal(e)){var t=i.PathExt.dirname(this._session.path);e=i.PathExt.resolve(t,e)}return Promise.resolve(e)},e.prototype.getDownloadUrl=function(e){return i.URLExt.isLocal(e)?this._contents.getDownloadUrl(e):Promise.resolve(e)},e}();e.UrlResolver=t}(c=t.RenderMimeRegistry||(t.RenderMimeRegistry={})),t.RenderMimeRegistry=c,(l||(l={})).sortedTypes=function(e){return Object.keys(e).sort(function(t,n){var r=e[t],i=e[n];return r.rank!==i.rank?r.rank-i.rank:r.id-i.id})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(5),o=n(2),a=n(4),s=n(25),l=function(){function e(e){this._changed=new o.Signal(this),this._raw={};var t=r.getBundleOptions(e),n=t.data,i=t.metadata,l=t.trusted;this._data=new s.ObservableJSON({values:n}),this._rawData=n,this._metadata=new s.ObservableJSON({values:i}),this._rawMetadata=i,this.trusted=l;var c=e.value;for(var u in c)switch(u){case"data":case"metadata":break;default:this._raw[u]=r.extract(c,u)}this.type=c.output_type,a.nbformat.isExecuteResult(c)?this.executionCount=c.execution_count:this.executionCount=null}return Object.defineProperty(e.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._data.dispose(),this._metadata.dispose(),o.Signal.clearData(this)},Object.defineProperty(e.prototype,"data",{get:function(){return this._rawData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return this._rawMetadata},enumerable:!0,configurable:!0}),e.prototype.setData=function(e){e.data&&(this._updateObservable(this._data,e.data),this._rawData=e.data),e.metadata&&(this._updateObservable(this._metadata,e.metadata),this._rawMetadata=e.metadata),this._changed.emit(void 0)},e.prototype.toJSON=function(){var e={};for(var t in this._raw)e[t]=r.extract(this._raw,t);switch(this.type){case"display_data":case"execute_result":case"update_display_data":e.data=this.data,e.metadata=this.metadata}return delete e.transient,e},e.prototype._updateObservable=function(e,t){for(var n=e.keys(),r=Object.keys(t),i=0,o=n;i<o.length;i++){var a=o[i];-1===r.indexOf(a)&&e.delete(a)}for(var s=0,l=r;s<l.length;s++){a=l[s];var c=e.get(a),u=t[a];c!==u&&e.set(a,u)}},e}();t.OutputModel=l,function(e){e.getData=function(e){return r.getData(e)},e.getMetadata=function(e){return r.getMetadata(e)}}(l=t.OutputModel||(t.OutputModel={})),t.OutputModel=l,function(e){function t(e){var t={};if(a.nbformat.isExecuteResult(e)||a.nbformat.isDisplayData(e)||a.nbformat.isDisplayUpdate(e))t=e.data;else if(a.nbformat.isStream(e))"stderr"===e.name?t["application/vnd.jupyter.stderr"]=e.text:t["application/vnd.jupyter.stdout"]=e.text;else if(a.nbformat.isError(e)){var n=e.traceback.join("\n");t["application/vnd.jupyter.stderr"]=n||e.ename+": "+e.evalue}return function(e){var t=Object.create(null);for(var n in e){var r=e[n];i.JSONExt.isArray(r)?r=r.join("\n"):i.JSONExt.isPrimitive(r)||(r=JSON.parse(JSON.stringify(r))),t[n]=r}return t}(t)}function n(e){var t=Object.create(null);if(a.nbformat.isExecuteResult(e)||a.nbformat.isDisplayData(e))for(var n in e.metadata)t[n]=r(e.metadata,n);return t}function r(e,t){var n=e[t];return i.JSONExt.isPrimitive(n)?n:JSON.parse(JSON.stringify(n))}e.getData=t,e.getMetadata=n,e.getBundleOptions=function(e){return{data:t(e.value),metadata:n(e.value),trusted:!!e.trusted}},e.extract=r}(r||(r={}))},function(e,t,n){var r=n(18);"string"==typeof r&&(r=[[e.i,r,""]]);n(17)(r,{singleton:!0,insertAt:"top",attrs:{"data-added-by":"juniper"},hmr:!0,transform:void 0,insertInto:void 0}),r.locals&&(e.exports=r.locals)},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){var t=e.commands,n=e.Pos;function r(t,r){t.extendSelectionsBy(function(i){return t.display.shift||t.doc.extend||i.empty()?function(t,r,i){if(i<0&&0==r.ch)return t.clipPos(n(r.line-1));var o=t.getLine(r.line);if(i>0&&r.ch>=o.length)return t.clipPos(n(r.line+1,0));for(var a,s="start",l=r.ch,c=i<0?0:o.length,u=0;l!=c;l+=i,u++){var d=o.charAt(i<0?l-1:l),f="_"!=d&&e.isWordChar(d)?"w":"o";if("w"==f&&d.toUpperCase()==d&&(f="W"),"start"==s)"o"!=f&&(s="in",a=f);else if("in"==s&&a!=f){if("w"==a&&"W"==f&&i<0&&l--,"W"==a&&"w"==f&&i>0){a="w";continue}break}}return n(r.line,l)}(t.doc,i.head,r):r<0?i.from():i.to()})}function i(t,r){if(t.isReadOnly())return e.Pass;t.operation(function(){for(var e=t.listSelections().length,i=[],o=-1,a=0;a<e;a++){var s=t.listSelections()[a].head;if(!(s.line<=o)){var l=n(s.line+(r?0:1),0);t.replaceRange("\n",l,null,"+insertLine"),t.indentLine(l.line,null,!0),i.push({head:l,anchor:l}),o=s.line+1}}t.setSelections(i)}),t.execCommand("indentAuto")}function o(t,r){for(var i=r.ch,o=i,a=t.getLine(r.line);i&&e.isWordChar(a.charAt(i-1));)--i;for(;o<a.length&&e.isWordChar(a.charAt(o));)++o;return{from:n(r.line,i),to:n(r.line,o),word:a.slice(i,o)}}function a(e,t){for(var n=e.listSelections(),r=[],i=0;i<n.length;i++){var o=n[i],a=e.findPosV(o.anchor,t,"line",o.anchor.goalColumn),s=e.findPosV(o.head,t,"line",o.head.goalColumn);a.goalColumn=null!=o.anchor.goalColumn?o.anchor.goalColumn:e.cursorCoords(o.anchor,"div").left,s.goalColumn=null!=o.head.goalColumn?o.head.goalColumn:e.cursorCoords(o.head,"div").left;var l={anchor:a,head:s};r.push(o),r.push(l)}e.setSelections(r)}t.goSubwordLeft=function(e){r(e,-1)},t.goSubwordRight=function(e){r(e,1)},t.scrollLineUp=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},t.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},t.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],i=0;i<t.length;i++)for(var o=t[i].from(),a=t[i].to(),s=o.line;s<=a.line;++s)a.line>o.line&&s==a.line&&0==a.ch||r.push({anchor:s==o.line?o:n(s,0),head:s==a.line?a:n(s)});e.setSelections(r,0)},t.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},t.selectLine=function(e){for(var t=e.listSelections(),r=[],i=0;i<t.length;i++){var o=t[i];r.push({anchor:n(o.from().line,0),head:n(o.to().line+1,0)})}e.setSelections(r)},t.insertLineAfter=function(e){return i(e,!1)},t.insertLineBefore=function(e){return i(e,!0)},t.selectNextOccurrence=function(t){var r=t.getCursor("from"),i=t.getCursor("to"),a=t.state.sublimeFindFullWord==t.doc.sel;if(0==e.cmpPos(r,i)){var s=o(t,r);if(!s.word)return;t.setSelection(s.from,s.to),a=!0}else{var l=t.getRange(r,i),c=a?new RegExp("\\b"+l+"\\b"):l,u=t.getSearchCursor(c,i),d=u.findNext();if(d||(d=(u=t.getSearchCursor(c,n(t.firstLine(),0))).findNext()),!d||function(e,t,n){for(var r=0;r<e.length;r++)if(e[r].from()==t&&e[r].to()==n)return!0;return!1}(t.listSelections(),u.from(),u.to()))return e.Pass;t.addSelection(u.from(),u.to())}a&&(t.state.sublimeFindFullWord=t.doc.sel)},t.addCursorToPrevLine=function(e){a(e,-1)},t.addCursorToNextLine=function(e){a(e,1)};var s="(){}[]";function l(t){for(var r=t.listSelections(),i=[],o=0;o<r.length;o++){var a=r[o],l=a.head,c=t.scanForBracket(l,-1);if(!c)return!1;for(;;){var u=t.scanForBracket(l,1);if(!u)return!1;if(u.ch==s.charAt(s.indexOf(c.ch)+1)){var d=n(c.pos.line,c.pos.ch+1);if(0!=e.cmpPos(d,a.from())||0!=e.cmpPos(u.pos,a.to())){i.push({anchor:d,head:u.pos});break}if(!(c=t.scanForBracket(c.pos,-1)))return!1}l=n(u.pos.line,u.pos.ch+1)}}return t.setSelections(i),!0}function c(t,r){if(t.isReadOnly())return e.Pass;for(var i,o=t.listSelections(),a=[],s=0;s<o.length;s++){var l=o[s];if(!l.empty()){for(var c=l.from().line,u=l.to().line;s<o.length-1&&o[s+1].from().line==u;)u=o[++s].to().line;o[s].to().ch||u--,a.push(c,u)}}a.length?i=!0:a.push(t.firstLine(),t.lastLine()),t.operation(function(){for(var e=[],o=0;o<a.length;o+=2){var s=a[o],l=a[o+1],c=n(s,0),u=n(l),d=t.getRange(c,u,!1);r?d.sort():d.sort(function(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return n!=r&&(e=n,t=r),e<t?-1:e==t?0:1}),t.replaceRange(d,c,u),i&&e.push({anchor:c,head:n(l+1,0)})}i&&t.setSelections(e,0)})}function u(t,n){t.operation(function(){for(var r=t.listSelections(),i=[],a=[],s=0;s<r.length;s++)(c=r[s]).empty()?(i.push(s),a.push("")):a.push(n(t.getRange(c.from(),c.to())));var l;for(t.replaceSelections(a,"around","case"),s=i.length-1;s>=0;s--){var c=r[i[s]];if(!(l&&e.cmpPos(c.head,l)>0)){var u=o(t,c.head);l=u.from,t.replaceRange(n(u.word),u.from,u.to)}}})}function d(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var i=o(t,n);if(!i.word)return;n=i.from,r=i.to}return{from:n,to:r,query:t.getRange(n,r),word:i}}function f(e,t){var r=d(e);if(r){var i=r.query,o=e.getSearchCursor(i,t?r.to:r.from);(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(i,t?n(e.firstLine(),0):e.clipPos(n(e.lastLine()))),(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):r.word&&e.setSelection(r.from,r.to))}}t.selectScope=function(e){l(e)||e.execCommand("selectAll")},t.selectBetweenBrackets=function(t){if(!l(t))return e.Pass},t.goToBracket=function(t){t.extendSelectionsBy(function(r){var i=t.scanForBracket(r.head,1);if(i&&0!=e.cmpPos(i.pos,r.head))return i.pos;var o=t.scanForBracket(r.head,-1);return o&&n(o.pos.line,o.pos.ch+1)||r.head})},t.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.firstLine()-1,a=[],s=0;s<r.length;s++){var l=r[s],c=l.from().line-1,u=l.to().line;a.push({anchor:n(l.anchor.line-1,l.anchor.ch),head:n(l.head.line-1,l.head.ch)}),0!=l.to().ch||l.empty()||--u,c>o?i.push(c,u):i.length&&(i[i.length-1]=u),o=u}t.operation(function(){for(var e=0;e<i.length;e+=2){var r=i[e],o=i[e+1],s=t.getLine(r);t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),o>t.lastLine()?t.replaceRange("\n"+s,n(t.lastLine()),null,"+swapLine"):t.replaceRange(s+"\n",n(o,0),null,"+swapLine")}t.setSelections(a),t.scrollIntoView()})},t.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.lastLine()+1,a=r.length-1;a>=0;a--){var s=r[a],l=s.to().line+1,c=s.from().line;0!=s.to().ch||s.empty()||l--,l<o?i.push(l,c):i.length&&(i[i.length-1]=c),o=c}t.operation(function(){for(var e=i.length-2;e>=0;e-=2){var r=i[e],o=i[e+1],a=t.getLine(r);r==t.lastLine()?t.replaceRange("",n(r-1),n(r),"+swapLine"):t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),t.replaceRange(a+"\n",n(o,0),null,"+swapLine")}t.scrollIntoView()})},t.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},t.joinLines=function(e){for(var t=e.listSelections(),r=[],i=0;i<t.length;i++){for(var o=t[i],a=o.from(),s=a.line,l=o.to().line;i<t.length-1&&t[i+1].from().line==l;)l=t[++i].to().line;r.push({start:s,end:l,anchor:!o.empty()&&a})}e.operation(function(){for(var t=0,i=[],o=0;o<r.length;o++){for(var a,s=r[o],l=s.anchor&&n(s.anchor.line-t,s.anchor.ch),c=s.start;c<=s.end;c++){var u=c-t;c==s.end&&(a=n(u,e.getLine(u).length+1)),u<e.lastLine()&&(e.replaceRange(" ",n(u),n(u+1,/^\s*/.exec(e.getLine(u+1))[0].length)),++t)}i.push({anchor:l||a,head:a})}e.setSelections(i,0)})},t.duplicateLine=function(e){e.operation(function(){for(var t=e.listSelections().length,r=0;r<t;r++){var i=e.listSelections()[r];i.empty()?e.replaceRange(e.getLine(i.head.line)+"\n",n(i.head.line,0)):e.replaceRange(e.getRange(i.from(),i.to()),i.from())}e.scrollIntoView()})},t.sortLines=function(e){c(e,!0)},t.sortLinesInsensitive=function(e){c(e,!1)},t.nextBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},t.prevBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},t.toggleBookmark=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var i=t[r].from(),o=t[r].to(),a=t[r].empty()?e.findMarksAt(i):e.findMarks(i,o),s=0;s<a.length;s++)if(a[s].sublimeBookmark){a[s].clear();for(var l=0;l<n.length;l++)n[l]==a[s]&&n.splice(l--,1);break}s==a.length&&n.push(e.markText(i,o,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},t.clearBookmarks=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},t.selectBookmarks=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var i=t[r].find();i?n.push({anchor:i.from,head:i.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)},t.smartBackspace=function(t){if(t.somethingSelected())return e.Pass;t.operation(function(){for(var r=t.listSelections(),i=t.getOption("indentUnit"),o=r.length-1;o>=0;o--){var a=r[o].head,s=t.getRange({line:a.line,ch:0},a),l=e.countColumn(s,null,t.getOption("tabSize")),c=t.findPosH(a,-1,"char",!1);if(s&&!/\S/.test(s)&&l%i==0){var u=new n(a.line,e.findColumn(s,l-i,i));u.ch!=a.ch&&(c=u)}t.replaceRange("",c,a,"+delete")}})},t.delLineRight=function(e){e.operation(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange("",t[r].anchor,n(t[r].to().line),"+delete");e.scrollIntoView()})},t.upcaseAtCursor=function(e){u(e,function(e){return e.toUpperCase()})},t.downcaseAtCursor=function(e){u(e,function(e){return e.toLowerCase()})},t.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},t.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},t.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i)}},t.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},t.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},t.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},t.findUnder=function(e){f(e,!0)},t.findUnderPrevious=function(e){f(e,!1)},t.findAllUnder=function(e){var t=d(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],i=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&i++;e.setSelections(r,i)}};var h=e.keyMap;h.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F9:"sortLines","Cmd-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(h.macSublime),h.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Ctrl-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(h.pcSublime);var p=h.default==h.macDefault;h.sublime=p?h.macSublime:h.pcSublime},"object"==s(t)&&"object"==s(e)?a(n(0),n(33),n(22)):(i=[n(0),n(33),n(22)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){var t=e.Pos;function n(e,t){return e.line==t.line&&e.ch==t.ch}var r=[];function i(e){r.push(e),r.length>50&&r.shift()}function o(e){return r[r.length-(e?Math.min(e,1):1)]||""}var a=null;function s(e,t,o,s,l){null==l&&(l=e.getRange(t,o)),"grow"==s&&a&&a.cm==e&&n(t,a.pos)&&e.isClean(a.gen)?function(e){if(!r.length)return i(e);r[r.length-1]+=e}(l):!1!==s&&i(l),e.replaceRange("",t,o,"+delete"),a="grow"==s?{cm:e,pos:t,gen:e.changeGeneration()}:null}function l(e,t,n){return e.findPosH(t,n,"char",!0)}function c(e,t,n){return e.findPosH(t,n,"word",!0)}function u(e,t,n){return e.findPosV(t,n,"line",e.doc.sel.goalColumn)}function d(e,t,n){return e.findPosV(t,n,"page",e.doc.sel.goalColumn)}function f(e,n,r){for(var i=n.line,o=e.getLine(i),a=/\S/.test(r<0?o.slice(0,n.ch):o.slice(n.ch)),s=e.firstLine(),l=e.lastLine();;){if((i+=r)<s||i>l)return e.clipPos(t(i-r,r<0?0:null));if(o=e.getLine(i),/\S/.test(o))a=!0;else if(a)return t(i,0)}}function h(e,n,r){for(var i=n.line,o=n.ch,a=e.getLine(n.line),s=!1;;){var l=a.charAt(o+(r<0?-1:0));if(l){if(s&&/[!?.]/.test(l))return t(i,o+(r>0?1:0));s||(s=/\w/.test(l)),o+=r}else{if(i==(r<0?e.firstLine():e.lastLine()))return t(i,o);if(a=e.getLine(i+r),!/\S/.test(a))return t(i,o);i+=r,o=r<0?a.length:0}}}function p(e,r,i){var o;if(e.findMatchingBracket&&(o=e.findMatchingBracket(r,{strict:!0}))&&o.match&&(o.forward?1:-1)==i)return i>0?t(o.to.line,o.to.ch+1):o.to;for(var a=!0;;a=!1){var s=e.getTokenAt(r),l=t(r.line,i<0?s.start:s.end);if(!(a&&i>0&&s.end==r.ch)&&/\w/.test(s.string))return l;var c=e.findPosH(l,i,"char");if(n(l,c))return r;r=c}}function m(e,t){var n=e.state.emacsPrefix;return n?(C(e),"-"==n?-1:Number(n)):t?null:1}function g(e){var t="string"==typeof e?function(t){t.execCommand(e)}:e;return function(e){var n=m(e);t(e);for(var r=1;r<n;++r)t(e)}}function v(e,t,r,i){var o=m(e);o<0&&(i=-i,o=-o);for(var a=0;a<o;++a){var s=r(e,t,i);if(n(s,t))break;t=s}return t}function y(e,t){var n=function(n){n.extendSelection(v(n,n.getCursor(),e,t))};return n.motion=!0,n}function b(e,t,n,r){for(var i,o=e.listSelections(),a=o.length;a--;)s(e,i=o[a].head,v(e,i,t,n),r)}function x(e,t){if(e.somethingSelected()){for(var n,r=e.listSelections(),i=r.length;i--;)s(e,(n=r[i]).anchor,n.head,t);return!0}}function w(e,t){e.state.emacsPrefix?"-"!=t&&(e.state.emacsPrefix+=t):(e.state.emacsPrefix=t,e.on("keyHandled",k),e.on("inputRead",S))}var _={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0};function k(e,t){e.state.emacsPrefixMap||_.hasOwnProperty(t)||C(e)}function C(e){e.state.emacsPrefix=null,e.off("keyHandled",k),e.off("inputRead",S)}function S(e,t){var n=m(e);if(n>1&&"+input"==t.origin){for(var r=t.text.join("\n"),i="",o=1;o<n;++o)i+=r;e.replaceSelection(i)}}function M(e,t){("string"!=typeof t||!/^\d$/.test(t)&&"Ctrl-U"!=t)&&(e.removeKeyMap(P),e.state.emacsPrefixMap=!1,e.off("keyHandled",M),e.off("inputRead",M))}function L(e){e.setCursor(e.getCursor()),e.setExtending(!e.getExtending()),e.on("change",function(){e.setExtending(!1)})}function T(e){e.setExtending(!1),e.setCursor(e.getCursor())}function O(e,t){var n=e.getCursor(),r=e.findPosH(n,1,"word");e.replaceRange(t(e.getRange(n,r)),n,r),e.setCursor(r)}e.emacs={kill:s,killRegion:x,repeated:g};var A=e.keyMap.emacs=e.normalizeKeyMap({"Ctrl-W":function(e){s(e,e.getCursor("start"),e.getCursor("end"),!0)},"Ctrl-K":g(function(e){var n=e.getCursor(),r=e.clipPos(t(n.line)),i=e.getRange(n,r);/\S/.test(i)||(i+="\n",r=t(n.line+1,0)),s(e,n,r,"grow",i)}),"Alt-W":function(e){i(e.getSelection()),T(e)},"Ctrl-Y":function(e){var t=e.getCursor();e.replaceRange(o(m(e)),t,t,"paste"),e.setSelection(t,e.getCursor())},"Alt-Y":function(e){e.replaceSelection((r.length>1&&r.pop(),o()),"around","paste")},"Ctrl-Space":L,"Ctrl-Shift-2":L,"Ctrl-F":y(l,1),"Ctrl-B":y(l,-1),Right:y(l,1),Left:y(l,-1),"Ctrl-D":function(e){b(e,l,1,!1)},Delete:function(e){x(e,!1)||b(e,l,1,!1)},"Ctrl-H":function(e){b(e,l,-1,!1)},Backspace:function(e){x(e,!1)||b(e,l,-1,!1)},"Alt-F":y(c,1),"Alt-B":y(c,-1),"Alt-D":function(e){b(e,c,1,"grow")},"Alt-Backspace":function(e){b(e,c,-1,"grow")},"Ctrl-N":y(u,1),"Ctrl-P":y(u,-1),Down:y(u,1),Up:y(u,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":y(d,-1),"Ctrl-V":y(d,1),PageUp:y(d,-1),PageDown:y(d,1),"Ctrl-Up":y(f,-1),"Ctrl-Down":y(f,1),"Alt-A":y(h,-1),"Alt-E":y(h,1),"Alt-K":function(e){b(e,h,1,"grow")},"Ctrl-Alt-K":function(e){b(e,p,1,"grow")},"Ctrl-Alt-Backspace":function(e){b(e,p,-1,"grow")},"Ctrl-Alt-F":y(p,1),"Ctrl-Alt-B":y(p,-1),"Shift-Ctrl-Alt-2":function(e){var t=e.getCursor();e.setSelection(v(e,t,p,1),t)},"Ctrl-Alt-T":function(e){var t=p(e,e.getCursor(),-1),n=p(e,t,1),r=p(e,n,1),i=p(e,r,-1);e.replaceRange(e.getRange(i,r)+e.getRange(n,i)+e.getRange(t,n),t,r)},"Ctrl-Alt-U":g(function(e){for(var n=e.getCursor(),r=n.line,i=n.ch,o=[];r>=e.firstLine();){for(var a=e.getLine(r),s=null==i?a.length:i;s>0;)if(")"==(i=a.charAt(--s)))o.push("(");else if("]"==i)o.push("[");else if("}"==i)o.push("{");else if(/[\(\{\[]/.test(i)&&(!o.length||o.pop()!=i))return e.extendSelection(t(r,s));--r,i=null}}),"Alt-Space":function(e){for(var n=e.getCursor(),r=n.ch,i=n.ch,o=e.getLine(n.line);r&&/\s/.test(o.charAt(r-1));)--r;for(;i<o.length&&/\s/.test(o.charAt(i));)++i;e.replaceRange(" ",t(n.line,r),t(n.line,i))},"Ctrl-O":g(function(e){e.replaceSelection("\n","start")}),"Ctrl-T":g(function(e){e.execCommand("transposeChars")}),"Alt-C":g(function(e){O(e,function(e){var t=e.search(/\w/);return-1==t?e:e.slice(0,t)+e.charAt(t).toUpperCase()+e.slice(t+1).toLowerCase()})}),"Alt-U":g(function(e){O(e,function(e){return e.toUpperCase()})}),"Alt-L":g(function(e){O(e,function(e){return e.toLowerCase()})}),"Alt-;":"toggleComment","Ctrl-/":g("undo"),"Shift-Ctrl--":g("undo"),"Ctrl-Z":g("undo"),"Cmd-Z":g("undo"),"Shift-Alt-,":"goDocStart","Shift-Alt-.":"goDocEnd","Ctrl-S":"findPersistentNext","Ctrl-R":"findPersistentPrev","Ctrl-G":function(e){e.execCommand("clearSearch"),T(e)},"Shift-Alt-5":"replace","Alt-/":"autocomplete",Enter:"newlineAndIndent","Ctrl-J":g(function(e){e.replaceSelection("\n","end")}),Tab:"indentAuto","Alt-G G":function(e){var t=m(e,!0);if(null!=t&&t>0)return e.setCursor(t-1);!function(e,t,n){e.openDialog?e.openDialog(t+': <input type="text" style="width: 10em"/>',n,{bottom:!0}):n(prompt(t,""))}(e,"Goto line",function(t){var n;t&&!isNaN(n=Number(t))&&n==(0|n)&&n>0&&e.setCursor(n-1)})},"Ctrl-X Tab":function(e){e.indentSelection(m(e,!0)||e.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(e){e.setSelection(e.getCursor("head"),e.getCursor("anchor"))},"Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X U":g("undo"),"Ctrl-X K":"close","Ctrl-X Delete":function(e){s(e,e.getCursor(),h(e,e.getCursor(),1),"grow")},"Ctrl-X H":"selectAll","Ctrl-Q Tab":g("insertTab"),"Ctrl-U":function(e){e.state.emacsPrefixMap=!0,e.addKeyMap(P),e.on("keyHandled",M),e.on("inputRead",M)}}),P={"Ctrl-G":C};function E(e){P[e]=function(t){w(t,e)},A["Ctrl-"+e]=function(t){w(t,e)},_["Ctrl-"+e]=!0}for(var D=0;D<10;++D)E(String(D));E("-")},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){function t(t,r){e.changeEnd(r).line==t.lastLine()&&n(t)}function n(e){var t="";e.lineCount()>1&&(t=e.display.scroller.clientHeight-30-e.getLineHandle(e.lastLine()).height+"px"),e.state.scrollPastEndPadding!=t&&(e.state.scrollPastEndPadding=t,e.display.lineSpace.parentNode.style.paddingBottom=t,e.off("refresh",n),e.setSize(),e.on("refresh",n))}e.defineOption("scrollPastEnd",!1,function(r,i,o){o&&o!=e.Init&&(r.off("change",t),r.off("refresh",n),r.display.lineSpace.parentNode.style.paddingBottom="",r.state.scrollPastEndPadding=null),i&&(r.on("change",t),r.on("refresh",n),n(r))})},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){var t={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==(void 0===e?"undefined":s(e))&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(o(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(i))});var i={Backspace:function(t){var i=l(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var o=r(i,"pairs"),a=t.listSelections(),s=0;s<a.length;s++){if(!a[s].empty())return e.Pass;var c=u(t,a[s].head);if(!c||o.indexOf(c)%2!=0)return e.Pass}for(s=a.length-1;s>=0;s--){var d=a[s].head;t.replaceRange("",n(d.line,d.ch-1),n(d.line,d.ch+1),"+delete")}},Enter:function(t){var n=l(t),i=n&&r(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a<o.length;a++){if(!o[a].empty())return e.Pass;var s=u(t,o[a].head);if(!s||i.indexOf(s)%2!=0)return e.Pass}t.operation(function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),t.execCommand("goCharLeft"),o=t.listSelections();for(var n=0;n<o.length;n++){var r=o[n].head.line;t.indentLine(r,null,!0),t.indentLine(r+1,null,!0)}})}};function o(e){for(var t=0;t<e.length;t++){var n=e.charAt(t),r="'"+n+"'";i[r]||(i[r]=a(n))}}function a(t){return function(i){return function(t,i){var o=l(t);if(!o||t.getOption("disableInput"))return e.Pass;var a=r(o,"pairs"),s=a.indexOf(i);if(-1==s)return e.Pass;for(var u,f=r(o,"triples"),h=a.charAt(s+1)==i,p=t.listSelections(),m=s%2==0,g=0;g<p.length;g++){var v,y=p[g],b=y.head,x=t.getRange(b,n(b.line,b.ch+1));if(m&&!y.empty())v="surround";else if(!h&&m||x!=i)if(h&&b.ch>1&&f.indexOf(i)>=0&&t.getRange(n(b.line,b.ch-2),b)==i+i){if(b.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(b.line,b.ch-2))))return e.Pass;v="addFour"}else if(h){var w=0==b.ch?" ":t.getRange(n(b.line,b.ch-1),b);if(e.isWordChar(x)||w==i||e.isWordChar(w))return e.Pass;v="both"}else{if(!m||t.getLine(b.line).length!=b.ch&&!c(x,a)&&!/\s/.test(x))return e.Pass;v="both"}else v=h&&d(t,b)?"both":f.indexOf(i)>=0&&t.getRange(b,n(b.line,b.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=v)return e.Pass}else u=v}var _=s%2?a.charAt(s-1):i,k=s%2?i:a.charAt(s+1);t.operation(function(){if("skip"==u)t.execCommand("goCharRight");else if("skipThree"==u)for(var r=0;r<3;r++)t.execCommand("goCharRight");else if("surround"==u){var i=t.getSelections();for(r=0;r<i.length;r++)i[r]=_+i[r]+k;t.replaceSelections(i,"around"),i=t.listSelections().slice();for(r=0;r<i.length;r++)i[r]=(o=i[r],a=e.cmpPos(o.anchor,o.head)>0,{anchor:new n(o.anchor.line,o.anchor.ch+(a?-1:1)),head:new n(o.head.line,o.head.ch+(a?1:-1))});t.setSelections(i)}else"both"==u?(t.replaceSelection(_+k,null),t.triggerElectric(_+k),t.execCommand("goCharLeft")):"addFour"==u&&(t.replaceSelection(_+_+_+_,"before"),t.execCommand("goCharRight"));var o,a})}(i,t)}}function l(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function c(e,t){var n=t.lastIndexOf(e);return n>-1&&n%2==1}function u(e,t){var r=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==r.length?r:null}function d(e,t){var r=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(r.type)&&r.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}o(t.pairs+"`")},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){var t={},n=/[^\s\u00a0]/,r=e.Pos;function i(e){var t=e.search(n);return-1==t?0:t}function o(e,t){var n=e.getMode();return!1!==n.useInnerComments&&n.innerMode?e.getModeAt(t):n}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=t);for(var n=1/0,i=this.listSelections(),o=null,a=i.length-1;a>=0;a--){var s=i[a].from(),l=i[a].to();s.line>=n||(l.line>=n&&(l=r(n,0)),n=s.line,null==o?this.uncomment(s,l,e)?o="un":(this.lineComment(s,l,e),o="line"):"un"==o?this.uncomment(s,l,e):this.lineComment(s,l,e))}}),e.defineExtension("lineComment",function(e,a,s){s||(s=t);var l=this,c=o(l,e),u=l.getLine(e.line);if(null!=u&&(d=e,f=u,!/\bstring\b/.test(l.getTokenTypeAt(r(d.line,0)))||/^[\'\"\`]/.test(f))){var d,f,h=s.lineComment||c.lineComment;if(h){var p=Math.min(0!=a.ch||a.line==e.line?a.line+1:a.line,l.lastLine()+1),m=null==s.padding?" ":s.padding,g=s.commentBlankLines||e.line==a.line;l.operation(function(){if(s.indent){for(var t=null,o=e.line;o<p;++o){var a=(c=l.getLine(o)).slice(0,i(c));(null==t||t.length>a.length)&&(t=a)}for(o=e.line;o<p;++o){var c=l.getLine(o),u=t.length;(g||n.test(c))&&(c.slice(0,u)!=t&&(u=i(c)),l.replaceRange(t+h+m,r(o,0),r(o,u)))}}else for(o=e.line;o<p;++o)(g||n.test(l.getLine(o)))&&l.replaceRange(h+m,r(o,0))})}else(s.blockCommentStart||c.blockCommentStart)&&(s.fullLines=!0,l.blockComment(e,a,s))}}),e.defineExtension("blockComment",function(e,i,a){a||(a=t);var s=this,l=o(s,e),c=a.blockCommentStart||l.blockCommentStart,u=a.blockCommentEnd||l.blockCommentEnd;if(c&&u){if(!/\bcomment\b/.test(s.getTokenTypeAt(r(e.line,0)))){var d=Math.min(i.line,s.lastLine());d!=e.line&&0==i.ch&&n.test(s.getLine(d))&&--d;var f=null==a.padding?" ":a.padding;e.line>d||s.operation(function(){if(0!=a.fullLines){var t=n.test(s.getLine(d));s.replaceRange(f+u,r(d)),s.replaceRange(c+f,r(e.line,0));var o=a.blockCommentLead||l.blockCommentLead;if(null!=o)for(var h=e.line+1;h<=d;++h)(h!=d||t)&&s.replaceRange(o+f,r(h,0))}else s.replaceRange(u,i),s.replaceRange(c,e)})}}else(a.lineComment||l.lineComment)&&0!=a.fullLines&&s.lineComment(e,i,a)}),e.defineExtension("uncomment",function(e,i,a){a||(a=t);var s,l=this,c=o(l,e),u=Math.min(0!=i.ch||i.line==e.line?i.line:i.line-1,l.lastLine()),d=Math.min(e.line,u),f=a.lineComment||c.lineComment,h=[],p=null==a.padding?" ":a.padding;e:if(f){for(var m=d;m<=u;++m){var g=l.getLine(m),v=g.indexOf(f);if(v>-1&&!/comment/.test(l.getTokenTypeAt(r(m,v+1)))&&(v=-1),-1==v&&n.test(g))break e;if(v>-1&&n.test(g.slice(0,v)))break e;h.push(g)}if(l.operation(function(){for(var e=d;e<=u;++e){var t=h[e-d],n=t.indexOf(f),i=n+f.length;n<0||(t.slice(i,i+p.length)==p&&(i+=p.length),s=!0,l.replaceRange("",r(e,n),r(e,i)))}}),s)return!0}var y=a.blockCommentStart||c.blockCommentStart,b=a.blockCommentEnd||c.blockCommentEnd;if(!y||!b)return!1;var x=a.blockCommentLead||c.blockCommentLead,w=l.getLine(d),_=w.indexOf(y);if(-1==_)return!1;var k=u==d?w:l.getLine(u),C=k.indexOf(b,u==d?_+y.length:0),S=r(d,_+1),M=r(u,C+1);if(-1==C||!/comment/.test(l.getTokenTypeAt(S))||!/comment/.test(l.getTokenTypeAt(M))||l.getRange(S,M,"\n").indexOf(b)>-1)return!1;var L=w.lastIndexOf(y,e.ch),T=-1==L?-1:w.slice(0,e.ch).indexOf(b,L+y.length);if(-1!=L&&-1!=T&&T+b.length!=e.ch)return!1;T=k.indexOf(b,i.ch);var O=k.slice(i.ch).lastIndexOf(y,T-i.ch);return L=-1==T||-1==O?-1:i.ch+O,(-1==T||-1==L||L==i.ch)&&(l.operation(function(){l.replaceRange("",r(u,C-(p&&k.slice(C-p.length,C)==p?p.length:0)),r(u,C+b.length));var e=_+y.length;if(p&&w.slice(e,e+p.length)==p&&(e+=p.length),l.replaceRange("",r(d,_),r(d,e)),x)for(var t=d+1;t<=u;++t){var i=l.getLine(t),o=i.indexOf(x);if(-1!=o&&!n.test(i.slice(0,o))){var a=o+x.length;p&&i.slice(a,a+p.length)==p&&(a+=p.length),l.replaceRange("",r(t,o),r(t,a))}}}),!0)})},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);n(62),n(68),n(60),r.defineMode("ipythongfm",function(e,t){var n=r.getMode(e,"gfm"),i=r.getMode(e,"stex");return r.multiplexingMode(n,{open:"$$",close:"$$",mode:i,delimStyle:"delimit"},{open:"$",close:"$",mode:i,delimStyle:"delimit"},{open:"\\(",close:"\\)",mode:i,delimStyle:"delimit"},{open:"\\[",close:"\\]",mode:i,delimStyle:"delimit"})},"gfm"),r.defineMIME("text/x-ipythongfm","ipythongfm"),r.modeInfo.push({ext:[],mime:"text/x-ipythongfm",mode:"ipythongfm",name:"ipythongfm"})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);n(16),n(63),r.defineMode("ipython",function(e,t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return n.name="python",n.singleOperators=new RegExp("^[\\+\\-\\*/%&|@\\^~<>!\\?]"),n.identifiers=new RegExp("^[_A-Za-z¡-][_A-Za-z0-9¡-]*"),r.getMode(e,n)},"python"),r.defineMIME("text/x-ipython","ipython"),r.modeInfo.push({ext:[],mime:"text/x-ipython",mode:"ipython",name:"ipython"})},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){e.runMode=function(t,n,r,i){var o=e.getMode(e.defaults,n),a=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9);if(r.appendChild){var s=i&&i.tabSize||e.defaults.tabSize,l=r,c=0;l.innerHTML="",r=function(e,t){if("\n"==e)return l.appendChild(document.createTextNode(a?"\r":e)),void(c=0);for(var n="",r=0;;){var i=e.indexOf("\t",r);if(-1==i){n+=e.slice(r),c+=e.length-r;break}c+=i-r,n+=e.slice(r,i);var o=s-c%s;c+=o;for(var u=0;u<o;++u)n+=" ";r=i+1}if(t){var d=l.appendChild(document.createElement("span"));d.className="cm-"+t.replace(/ +/g," cm-"),d.appendChild(document.createTextNode(n))}else l.appendChild(document.createTextNode(n))}}for(var u=e.splitLines(t),d=i&&i.state||e.startState(o),f=0,h=u.length;f<h;++f){f&&r("\n");var p=new e.StringStream(u[f]);for(!p.string&&o.blankLine&&o.blankLine(d);!p.eol();){var m=o.token(p,d);r(p.current(),m,f,p.start,d),p.start=p.pos}}}},"object"==s(t)&&"object"==s(e)?a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(t.IEditorMimeTypeService||(t.IEditorMimeTypeService={})).defaultMimeType="text/plain"},function(e,t,n){"use strict";var r,i=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){var n=e.call(this)||this;return(n.editor=t.factory({host:n.node,model:t.model,uuid:t.uuid,config:t.config,selectionStyle:t.selectionStyle})).model.selections.changed.connect(n._onSelectionsChanged,n),n}return i(t,e),Object.defineProperty(t.prototype,"model",{get:function(){return this.editor.model},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(e.prototype.dispose.call(this),this.editor.dispose())},t.prototype.onActivateRequest=function(e){this.editor.focus()},t.prototype.onAfterAttach=function(t){e.prototype.onAfterAttach.call(this,t),this.isVisible&&this.update()},t.prototype.onAfterShow=function(e){this.update()},t.prototype.onResize=function(e){e.width>=0&&e.height>=0?this.editor.setSize(e):this.isVisible&&this.editor.resizeToFit()},t.prototype.onUpdateRequest=function(e){this.editor.refresh()},t.prototype._onSelectionsChanged=function(){var e=this.editor.getSelection(),t=e.start,n=e.end;t.column!==n.column||t.line!==n.line?this.addClass("jp-mod-has-primary-selection"):this.removeClass("jp-mod-has-primary-selection")},t}(n(15).Widget);t.CodeEditorWrapper=o},function(e,t,n){"use strict"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=n(25);!function(e){e.defaultSelectionStyle={className:"",displayName:"",color:"black"};var t=function(){function e(e){this._isDisposed=!1,this._mimeTypeChanged=new r.Signal(this),(e=e||{}).modelDB?this.modelDB=e.modelDB:this.modelDB=new i.ModelDB;var t=this.modelDB.createString("value");t.text=t.text||e.value||"";var n=this.modelDB.createValue("mimeType");n.set(e.mimeType||"text/plain"),n.changed.connect(this._onMimeTypeChanged,this),this.modelDB.createMap("selections")}return Object.defineProperty(e.prototype,"mimeTypeChanged",{get:function(){return this._mimeTypeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.modelDB.get("value")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selections",{get:function(){return this.modelDB.get("selections")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mimeType",{get:function(){return this.modelDB.getValue("mimeType")},set:function(e){this.mimeType!==e&&this.modelDB.setValue("mimeType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this))},e.prototype._onMimeTypeChanged=function(e,t){this._mimeTypeChanged.emit({name:"mimeType",oldValue:t.oldValue,newValue:t.newValue})},e}();e.Model=t,e.defaultConfig={lineNumbers:!1,lineWrap:!0,readOnly:!1,tabSize:4,insertSpaces:!0,matchBrackets:!0,autoClosingBrackets:!0}}(t.CodeEditor||(t.CodeEditor={}))},function(e,t,n){var r=n(18);"string"==typeof r&&(r=[[e.i,r,""]]);n(17)(r,{singleton:!0,insertAt:"top",attrs:{"data-added-by":"juniper"},hmr:!0,transform:void 0,insertInto:void 0}),r.locals&&(e.exports=r.locals)},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0});var i=n(36),o=n(32);n(72),r(n(23)),r(n(35)),r(n(36)),r(n(32)),t.editorServices={factoryService:new i.CodeMirrorEditorFactory,mimeTypeService:new o.CodeMirrorMimeTypeService}},function(e,t,n){"use strict";(function(r){var i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(r){var a={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:b,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:b,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:b,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};function s(e){this.tokens=[],this.tokens.links={},this.options=e||w.defaults,this.rules=a.normal,this.options.gfm&&(this.options.tables?this.rules=a.tables:this.rules=a.gfm)}a._label=/(?:\\[\[\]]|[^\[\]])+/,a._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,a.def=m(a.def).replace("label",a._label).replace("title",a._title).getRegex(),a.bullet=/(?:[*+-]|\d+\.)/,a.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,a.item=m(a.item,"gm").replace(/bull/g,a.bullet).getRegex(),a.list=m(a.list).replace(/bull/g,a.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+a.def.source+")").getRegex(),a._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",a.html=m(a.html).replace("comment",/<!--[\s\S]*?-->/).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/<tag(?:"[^"]*"|'[^']*'|\s[^'"\/>\s]*)*?\/?>/).replace(/tag/g,a._tag).getRegex(),a.paragraph=m(a.paragraph).replace("hr",a.hr).replace("heading",a.heading).replace("lheading",a.lheading).replace("tag","<"+a._tag).getRegex(),a.blockquote=m(a.blockquote).replace("paragraph",a.paragraph).getRegex(),a.normal=x({},a),a.gfm=x({},a.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),a.gfm.paragraph=m(a.paragraph).replace("(?!","(?!"+a.gfm.fences.source.replace("\\1","\\2")+"|"+a.list.source.replace("\\1","\\3")+"|").getRegex(),a.tables=x({},a.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),s.rules=a,s.lex=function(e,t){return new s(t).lex(e)},s.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},s.prototype.token=function(e,t){var n,r,i,o,s,l,c,u,d,f,h;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),l={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u<l.align.length;u++)/^ *-+: *$/.test(l.align[u])?l.align[u]="right":/^ *:-+: *$/.test(l.align[u])?l.align[u]="center":/^ *:-+ *$/.test(l.align[u])?l.align[u]="left":l.align[u]=null;for(u=0;u<l.cells.length;u++)l.cells[u]=l.cells[u].split(/ *\| */);this.tokens.push(l)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),h=(o=i[2]).length>1,this.tokens.push({type:"list_start",ordered:h,start:h?+o:""}),n=!1,f=(i=i[0].match(this.rules.item)).length,u=0;u<f;u++)c=(l=i[u]).length,~(l=l.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(c-=l.length,l=this.options.pedantic?l.replace(/^ {1,4}/gm,""):l.replace(new RegExp("^ {1,"+c+"}","gm"),"")),this.options.smartLists&&u!==f-1&&(o===(s=a.bullet.exec(i[u+1])[0])||o.length>1&&s.length>1||(e=i.slice(u+1).join("\n")+e,u=f-1)),r=n||/\n\n(?!\s*$)/.test(l),u!==f-1&&(n="\n"===l.charAt(l.length-1),r||(r=n)),this.tokens.push({type:r?"loose_item_start":"list_item_start"}),this.token(l,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),d=i[1].toLowerCase(),this.tokens.links[d]||(this.tokens.links[d]={href:i[2],title:i[3]});else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),l={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<l.align.length;u++)/^ *-+: *$/.test(l.align[u])?l.align[u]="right":/^ *:-+: *$/.test(l.align[u])?l.align[u]="center":/^ *:-+ *$/.test(l.align[u])?l.align[u]="left":l.align[u]=null;for(u=0;u<l.cells.length;u++)l.cells[u]=l.cells[u].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(l)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var l={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:b,tag:/^<!--[\s\S]*?-->|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:b,text:/^[\s\S]+?(?=[\\<!\[`*]|\b_| {2,}\n|$)/};function c(e,t){if(this.options=t||w.defaults,this.links=e,this.rules=l.normal,this.renderer=this.options.renderer||new u,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=l.breaks:this.rules=l.gfm:this.options.pedantic&&(this.rules=l.pedantic)}function u(e){this.options=e||{}}function d(){}function f(e){this.tokens=[],this.token=null,this.options=e||w.defaults,this.options.renderer=this.options.renderer||new u,this.renderer=this.options.renderer,this.renderer.options=this.options}function h(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function p(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function m(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function g(e,t){return v[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?v[" "+e]=e+"/":v[" "+e]=e.replace(/[^/]*$/,"")),e=v[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}l._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,l._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,l.autolink=m(l.autolink).replace("scheme",l._scheme).replace("email",l._email).getRegex(),l._inside=/(?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,l._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,l.link=m(l.link).replace("inside",l._inside).replace("href",l._href).getRegex(),l.reflink=m(l.reflink).replace("inside",l._inside).getRegex(),l.normal=x({},l),l.pedantic=x({},l.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),l.gfm=x({},l.normal,{escape:m(l.escape).replace("])","~|])").getRegex(),url:m(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",l._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:m(l.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),l.breaks=x({},l.gfm,{br:m(l.br).replace("{2,}","*").getRegex(),text:m(l.gfm.text).replace("{2,}","*").getRegex()}),c.rules=l,c.output=function(e,t,n){return new c(t,n).output(e)},c.prototype.output=function(e){for(var t,n,r,i,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),r="@"===i[2]?"mailto:"+(n=h(this.mangle(i[1]))):n=h(i[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(i[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):h(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,o+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(h(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),o+=this.renderer.text(h(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else i[0]=this.rules._backpedal.exec(i[0])[0],e=e.substring(i[0].length),"@"===i[2]?r="mailto:"+(n=h(i[0])):(n=h(i[0]),r="www."===i[1]?"http://"+n:n),o+=this.renderer.link(r,null,n);return o},c.prototype.outputLink=function(e,t){var n=h(t.href),r=t.title?h(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,h(e[1]))},c.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},c.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i<r;i++)t=e.charCodeAt(i),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},u.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+h(t,!0)+'">'+(n?e:h(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:h(e,!0))+"\n</code></pre>"},u.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},u.prototype.html=function(e){return e},u.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},u.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},u.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},u.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},u.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},u.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},u.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},u.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},u.prototype.strong=function(e){return"<strong>"+e+"</strong>"},u.prototype.em=function(e){return"<em>"+e+"</em>"},u.prototype.codespan=function(e){return"<code>"+e+"</code>"},u.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},u.prototype.del=function(e){return"<del>"+e+"</del>"},u.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(p(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!y.test(e)&&(e=g(this.options.baseUrl,e));var i='<a href="'+e+'"';return t&&(i+=' title="'+t+'"'),i+">"+n+"</a>"},u.prototype.image=function(e,t,n){this.options.baseUrl&&!y.test(e)&&(e=g(this.options.baseUrl,e));var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+(this.options.xhtml?"/>":">")},u.prototype.text=function(e){return e},d.prototype.strong=d.prototype.em=d.prototype.codespan=d.prototype.del=d.prototype.text=function(e){return e},d.prototype.link=d.prototype.image=function(e,t,n){return""+n},d.prototype.br=function(){return""},f.parse=function(e,t){return new f(t).parse(e)},f.prototype.parse=function(e){this.inline=new c(e.links,this.options),this.inlineText=new c(e.links,x({},this.options,{renderer:new d})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},f.prototype.next=function(){return this.token=this.tokens.pop()},f.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},f.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},f.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,p(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i="",o="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(i+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});o+=this.renderer.tablerow(n)}return this.renderer.table(i,o);case"blockquote_start":for(o="";"blockquote_end"!==this.next().type;)o+=this.tok();return this.renderer.blockquote(o);case"list_start":o="";for(var a=this.token.ordered,s=this.token.start;"list_end"!==this.next().type;)o+=this.tok();return this.renderer.list(o,a,s);case"list_item_start":for(o="";"list_item_end"!==this.next().type;)o+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(o);case"loose_item_start":for(o="";"list_item_end"!==this.next().type;)o+=this.tok();return this.renderer.listitem(o);case"html":var l=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(l);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}};var v={},y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(){}function x(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function w(e,t,n){if(void 0===e||null===e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(n||"function"==typeof t){n||(n=t,t=null);var r,i,o=(t=x({},w.defaults,t||{})).highlight,a=0;try{r=s.lex(e,t)}catch(e){return n(e)}i=r.length;var l=function(e){if(e)return t.highlight=o,n(e);var i;try{i=f.parse(r,t)}catch(t){e=t}return t.highlight=o,e?n(e):n(null,i)};if(!o||o.length<3)return l();if(delete t.highlight,!i)return l();for(;a<r.length;a++)!function(e){"code"!==e.type?--i||l():o(e.text,e.lang,function(t,n){return t?l(t):null==n||n===e.text?--i||l():(e.text=n,e.escaped=!0,void(--i||l()))})}(r[a])}else try{return t&&(t=x({},w.defaults,t)),f.parse(s.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||w.defaults).silent)return"<p>An error occurred:</p><pre>"+h(e.message+"",!0)+"</pre>";throw e}}b.exec=b,w.options=w.setOptions=function(e){return x(w.defaults,e),w},w.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new u,xhtml:!1,baseUrl:null},w.Parser=f,w.parser=f.parse,w.Renderer=u,w.TextRenderer=d,w.Lexer=s,w.lexer=s.lex,w.InlineLexer=c,w.inlineLexer=c.output,w.parse=w,void 0!==e&&"object"===o(t)?e.exports=w:void 0===(i=function(){return w}.call(t,n,t,e))||(e.exports=i)}("undefined"!=typeof window&&window)}).call(this,n(7))},function(e,t,n){"use strict";var r,i;"function"==typeof Symbol&&Symbol.iterator,void 0===(i="function"==typeof(r=function(e){var t=function(){function e(){this.VERSION="3.0.0",this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.htmlFormatter={transform:function(e,t){var n=e.text;if(0===n.length)return n;if(t._escape_for_html&&(n=t.old_escape_for_html(n)),!e.bold&&null===e.fg&&null===e.bg)return n;var r=[],i=[],o=e.fg,a=e.bg;e.bold&&r.push("font-weight:bold"),t._use_classes?(o&&("truecolor"!==o.class_name?i.push(o.class_name+"-fg"):r.push("color:rgb("+o.rgb.join(",")+")")),a&&("truecolor"!==a.class_name?i.push(a.class_name+"-bg"):r.push("background-color:rgb("+a.rgb.join(",")+")"))):(o&&r.push("color:rgb("+o.rgb.join(",")+")"),a&&r.push("background-color:rgb("+a.rgb+")"));var s="",l="";return i.length&&(s=' class="'+i.join(" ")+'"'),r.length&&(l=' style="'+r.join(";")+'"'),"<span"+l+s+">"+n+"</span>"},compose:function(e,t){return e.join("")}},this.textFormatter={transform:function(e,t){return e.text},compose:function(e,t){return e.join("")}},this.setup_256_palette(),this._use_classes=!1,this._escape_for_html=!0,this.bold=!1,this.fg=this.bg=null,this._buffer=""}return Object.defineProperty(e.prototype,"use_classes",{get:function(){return this._use_classes},set:function(e){this._use_classes=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"escape_for_html",{get:function(){return this._escape_for_html},set:function(e){this._escape_for_html=e},enumerable:!0,configurable:!0}),e.prototype.setup_256_palette=function(){var e=this;this.palette_256=[],this.ansi_colors.forEach(function(t){t.forEach(function(t){e.palette_256.push(t)})});for(var t=[0,95,135,175,215,255],n=0;n<6;++n)for(var r=0;r<6;++r)for(var i=0;i<6;++i){var o={rgb:[t[n],t[r],t[i]],class_name:"truecolor"};this.palette_256.push(o)}for(var a=8,s=0;s<24;++s,a+=10){var l={rgb:[a,a,a],class_name:"truecolor"};this.palette_256.push(l)}},e.prototype.old_escape_for_html=function(e){return e.replace(/[&<>]/gm,function(e){return"&"===e?"&":"<"===e?"<":">"===e?">":void 0})},e.prototype.old_linkify=function(e){return e.replace(/(https?:\/\/[^\s]+)/gm,function(e){return'<a href="'+e+'">'+e+"</a>"})},e.prototype.detect_incomplete_ansi=function(e){return!/.*?[\x40-\x7e]/.test(e)},e.prototype.detect_incomplete_link=function(e){for(var t=!1,n=e.length-1;n>0;n--)if(/\s|\x1B/.test(e[n])){t=!0;break}if(!t)return/(https?:\/\/[^\s]+)/.test(e)?0:-1;var r=e.substr(n+1,4);return 0===r.length?-1:0==="http".indexOf(r)?n+1:void 0},e.prototype.ansi_to=function(e,t){var n=this._buffer+e;this._buffer="";var r=n.split(/\x1B\[/);1===r.length&&r.push(""),this.handle_incomplete_sequences(r);for(var i=this.with_state(r.shift()),o=new Array(r.length),a=0,s=r.length;a<s;++a)o[a]=t.transform(this.process_ansi(r[a]),this);return i.text.length>0&&o.unshift(t.transform(i,this)),t.compose(o,this)},e.prototype.ansi_to_html=function(e){return this.ansi_to(e,this.htmlFormatter)},e.prototype.ansi_to_text=function(e){return this.ansi_to(e,this.textFormatter)},e.prototype.with_state=function(e){return{bold:this.bold,fg:this.fg,bg:this.bg,text:e}},e.prototype.handle_incomplete_sequences=function(e){var t=e[e.length-1];t.length>0&&this.detect_incomplete_ansi(t)?(this._buffer="["+t,e.pop(),e.push("")):(""===t.slice(-1)&&(this._buffer="",console.log("raw",e),e.pop(),e.push(t.substr(0,t.length-1)),console.log(e),console.log(t)),2===e.length&&""===e[1]&&""===e[0].slice(-1)&&(this._buffer="",t=e.shift(),e.unshift(t.substr(0,t.length-1))))},e.prototype.process_ansi=function(e){this._sgr_regex||(this._sgr_regex=((r=["\n ^ # beginning of line\n ([!<-?]?) # a private-mode char (!, <, =, >, ?)\n ([d;]*) # any digits or semicolons\n ([ -/]? # an intermediate modifier\n [@-~]) # the command\n ([sS]*) # any text following this CSI sequence\n "]).raw=["\n ^ # beginning of line\n ([!\\x3c-\\x3f]?) # a private-mode char (!, <, =, >, ?)\n ([\\d;]*) # any digits or semicolons\n ([\\x20-\\x2f]? # an intermediate modifier\n [\\x40-\\x7e]) # the command\n ([\\s\\S]*) # any text following this CSI sequence\n "],function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=e.raw[0].replace(/^\s+|\s+\n|\s+#[\s\S]+?\n/gm,"");return new RegExp(r,"m")}(r)));var t=e.match(this._sgr_regex);if(!t)return this.with_state(e);var n=t[4];if(""!==t[1]||"m"!==t[3])return this.with_state(n);for(var r,i=t[2].split(";");i.length>0;){var o=i.shift(),a=parseInt(o,10);if(isNaN(a)||0===a)this.fg=this.bg=null,this.bold=!1;else if(1===a)this.bold=!0;else if(22===a)this.bold=!1;else if(39===a)this.fg=null;else if(49===a)this.bg=null;else if(a>=30&&a<38)this.fg=this.ansi_colors[0][a-30];else if(a>=40&&a<48)this.bg=this.ansi_colors[0][a-40];else if(a>=90&&a<98)this.fg=this.ansi_colors[1][a-90];else if(a>=100&&a<108)this.bg=this.ansi_colors[1][a-100];else if((38===a||48===a)&&i.length>0){var s=38===a,l=i.shift();if("5"===l&&i.length>0){var c=parseInt(i.shift(),10);c>=0&&c<=255&&(s?this.fg=this.palette_256[c]:this.bg=this.palette_256[c])}if("2"===l&&i.length>2){var u=parseInt(i.shift(),10),d=parseInt(i.shift(),10),f=parseInt(i.shift(),10);if(u>=0&&u<=255&&d>=0&&d<=255&&f>=0&&f<=255){var h={rgb:[u,d,f],class_name:"truecolor"};s?this.fg=h:this.bg=h}}}}return this.with_state(n)},e}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=t})?r.apply(t,[t]):r)||(e.exports=i)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(38);t.htmlRendererFactory={safe:!0,mimeTypes:["text/html"],defaultRank:50,createRenderer:function(e){return new r.RenderedHTML(e)}},t.imageRendererFactory={safe:!0,mimeTypes:["image/bmp","image/png","image/jpeg","image/gif"],defaultRank:90,createRenderer:function(e){return new r.RenderedImage(e)}},t.latexRendererFactory={safe:!0,mimeTypes:["text/latex"],defaultRank:70,createRenderer:function(e){return new r.RenderedLatex(e)}},t.markdownRendererFactory={safe:!0,mimeTypes:["text/markdown"],defaultRank:60,createRenderer:function(e){return new r.RenderedMarkdown(e)}},t.svgRendererFactory={safe:!1,mimeTypes:["image/svg+xml"],defaultRank:80,createRenderer:function(e){return new r.RenderedSVG(e)}},t.textRendererFactory={safe:!0,mimeTypes:["text/plain","application/vnd.jupyter.stdout","application/vnd.jupyter.stderr"],defaultRank:120,createRenderer:function(e){return new r.RenderedText(e)}},t.javaScriptRendererFactory={safe:!1,mimeTypes:["text/javascript","application/javascript"],defaultRank:110,createRenderer:function(e){return new r.RenderedJavaScript(e)}},t.standardRendererFactories=[t.htmlRendererFactory,t.markdownRendererFactory,t.latexRendererFactory,t.svgRendererFactory,t.imageRendererFactory,t.javaScriptRendererFactory,t.textRendererFactory]},function(e,t,n){var r=n(18);"string"==typeof r&&(r=[[e.i,r,""]]);n(17)(r,{singleton:!0,insertAt:"top",attrs:{"data-added-by":"juniper"},hmr:!0,transform:void 0,insertInto:void 0}),r.locals&&(e.exports=r.locals)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8),i=n(2),o=n(5),a=n(24),s=n(43),l=n(42),c=n(41),u=function(){function e(e){void 0===e&&(e=null),this._value=null,this._changed=new i.Signal(this),this._isDisposed=!1,this._value=e}return Object.defineProperty(e.prototype,"type",{get:function(){return"Value"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),e.prototype.get=function(){return this._value},e.prototype.set=function(e){var t=this._value;o.JSONExt.deepEqual(t,e)||(this._value=e,this._changed.emit({oldValue:t,newValue:e}))},e.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,i.Signal.clearData(this),this._value=null)},e}();t.ObservableValue=u,function(e){var t=function(){};e.IChangedArgs=t}(u=t.ObservableValue||(t.ObservableValue={})),t.ObservableValue=u;var d=function(){function e(e){void 0===e&&(e={}),this.isPrepopulated=!1,this.isCollaborative=!1,this.connected=Promise.resolve(void 0),this._toDispose=!1,this._isDisposed=!1,this._disposables=new r.DisposableSet,this._basePath=e.basePath||"",e.baseDB?this._db=e.baseDB:(this._db=new a.ObservableMap,this._toDispose=!0)}return Object.defineProperty(e.prototype,"basePath",{get:function(){return this._basePath},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),e.prototype.get=function(e){return this._db.get(this._resolvePath(e))},e.prototype.has=function(e){return this._db.has(this._resolvePath(e))},e.prototype.createString=function(e){var t=new l.ObservableString;return this._disposables.add(t),this.set(e,t),t},e.prototype.createList=function(e){var t=new c.ObservableUndoableList(new c.ObservableUndoableList.IdentitySerializer);return this._disposables.add(t),this.set(e,t),t},e.prototype.createMap=function(e){var t=new s.ObservableJSON;return this._disposables.add(t),this.set(e,t),t},e.prototype.createValue=function(e){var t=new u;return this._disposables.add(t),this.set(e,t),t},e.prototype.getValue=function(e){var t=this.get(e);if(!t||"Value"!==t.type)throw Error("Can only call getValue for an ObservableValue");return t.get()},e.prototype.setValue=function(e,t){var n=this.get(e);if(!n||"Value"!==n.type)throw Error("Can only call setValue on an ObservableValue");n.set(t)},e.prototype.view=function(t){var n=new e({basePath:t,baseDB:this});return this._disposables.add(n),n},e.prototype.set=function(e,t){this._db.set(this._resolvePath(e),t)},e.prototype.dispose=function(){this.isDisposed||(this._isDisposed=!0,this._toDispose&&this._db.dispose(),this._disposables.dispose())},e.prototype._resolvePath=function(e){return this._basePath&&(e=this._basePath+"."+e),e},e}();t.ModelDB=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=n(2),o=n(4),a=n(25),s=n(39),l=function(){function e(t){void 0===t&&(t={});var n=this;this.clearNext=!1,this.list=null,this._trusted=!1,this._isDisposed=!1,this._stateChanged=new i.Signal(this),this._changed=new i.Signal(this),this._modelDB=null,this._serialized=null,this._changeGuard=!1,this._trusted=!!t.trusted,this.contentFactory=t.contentFactory||e.defaultContentFactory,this.list=new a.ObservableList,t.values&&r.each(t.values,function(e){n._add(e)}),this.list.changed.connect(this._onListChanged,this),t.modelDB&&(this._modelDB=t.modelDB,this._serialized=this._modelDB.createValue("outputs"),this._serialized.get()?this.fromJSON(this._serialized.get()):this._serialized.set(this.toJSON()),this._serialized.changed.connect(this._onSerializedChanged,this))}return Object.defineProperty(e.prototype,"stateChanged",{get:function(){return this._stateChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.list?this.list.length:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trusted",{get:function(){return this._trusted},set:function(e){if(e!==this._trusted)for(var t=this._trusted=e,n=0;n<this.list.length;n++){var r=this.list.get(n),i=r.toJSON();r.dispose(),r=this._createItem({value:i,trusted:t}),this.list.set(n,r)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(this._isDisposed=!0,this.list.dispose(),i.Signal.clearData(this))},e.prototype.get=function(e){return this.list.get(e)},e.prototype.set=function(e,t){this._normalize(t);var n=this._createItem({value:t,trusted:this._trusted});this.list.set(e,n)},e.prototype.add=function(e){return this.clearNext&&(this.clear(),this.clearNext=!1),this._add(e)},e.prototype.clear=function(e){void 0===e&&(e=!1),this._lastStream="",e?this.clearNext=!0:(r.each(this.list,function(e){e.dispose()}),this.list.clear())},e.prototype.fromJSON=function(e){var t=this;this.clear(),r.each(e,function(e){t._add(e)})},e.prototype.toJSON=function(){return r.toArray(r.map(this.list,function(e){return e.toJSON()}))},e.prototype._add=function(e){var t=this._trusted;if(this._normalize(e),o.nbformat.isStream(e)&&this._lastStream&&e.name===this._lastName){this._lastStream+=e.text,e.text=this._lastStream,this._removeOverwrittenChars(e);var n=this._createItem({value:e,trusted:t}),r=this.length-1;return this.list.get(r).dispose(),this.list.set(r,n),r}o.nbformat.isStream(e)&&this._removeOverwrittenChars(e);var i=this._createItem({value:e,trusted:t});return o.nbformat.isStream(e)?(this._lastStream=e.text,this._lastName=e.name):this._lastStream="",this.list.push(i)},e.prototype._normalize=function(e){o.nbformat.isStream(e)&&Array.isArray(e.text)&&(e.text=e.text.join("\n"))},e.prototype._fixBackspace=function(e){var t=e;do{t=(e=t).replace(/[^\n]\x08/gm,"")}while(t.length<e.length);return e},e.prototype._fixCarriageReturn=function(e){var t=e;t=t.replace(/\r\r+\n/gm,"\r\n");do{t=t.replace(/^[^\n]*(?:\r(?!\n))+/gm,"")}while(t.search(/\r(?!\n)/)>-1);do{t=t.replace(/\r\n/gm,"\n")}while(t.indexOf("\r\n")>-1);return t},e.prototype._removeOverwrittenChars=function(e){var t=e.text;e.text=this._fixCarriageReturn(this._fixBackspace(t))},e.prototype._createItem=function(e){var t=this.contentFactory.createOutputModel(e);return t.changed.connect(this._onGenericChange,this),t.changed.connect(this._onGenericChange,this),t},e.prototype._onListChanged=function(e,t){this._serialized&&!this._changeGuard&&(this._changeGuard=!0,this._serialized.set(this.toJSON()),this._changeGuard=!1),this._changed.emit(t),this._stateChanged.emit(void 0)},e.prototype._onSerializedChanged=function(e,t){this._changeGuard||(this._changeGuard=!0,this.fromJSON(t.newValue),this._changeGuard=!1)},e.prototype._onGenericChange=function(){this._stateChanged.emit(void 0)},e}();t.OutputAreaModel=l,function(e){var t=function(){function e(){}return e.prototype.createOutputModel=function(e){return new s.OutputModel(e)},e}();e.ContentFactory=t,e.defaultContentFactory=new t}(l=t.OutputAreaModel||(t.OutputAreaModel={})),t.OutputAreaModel=l},function(e,t,n){"use strict";e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var i,o=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?e:(i=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:r+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")})}},function(e,t,n){(e.exports=n(44)(!1)).push([e.i,"/* BASICS */\n\n.CodeMirror {\n /* Set height, width, borders, and global font properties here */\n font-family: monospace;\n height: 300px;\n direction: ltr;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre {\n padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n border-right: 1px solid #ddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n padding: 0 3px 0 5px;\n min-width: 20px;\n text-align: right;\n color: #999;\n white-space: nowrap;\n}\n\n.CodeMirror-guttermarker { color: black; }\n.CodeMirror-guttermarker-subtle { color: #999; }\n\n/* CURSOR */\n\n.CodeMirror-cursor {\n border-left: 1px solid black;\n border-right: none;\n width: 0;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n border-left: 1px solid silver;\n}\n.cm-fat-cursor .CodeMirror-cursor {\n width: auto;\n border: 0 !important;\n background: #7e7;\n}\n.cm-fat-cursor div.CodeMirror-cursors {\n z-index: 1;\n}\n.cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n}\n.cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #7e7;\n}\n@-moz-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@-webkit-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n\n/* Can style cursor different in overwrite (non-insert) mode */\n.CodeMirror-overwrite .CodeMirror-cursor {}\n\n.cm-tab { display: inline-block; text-decoration: inherit; }\n\n.CodeMirror-rulers {\n position: absolute;\n left: 0; right: 0; top: -50px; bottom: -20px;\n overflow: hidden;\n}\n.CodeMirror-ruler {\n border-left: 1px solid #ccc;\n top: 0; bottom: 0;\n position: absolute;\n}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-link {text-decoration: underline;}\n.cm-strikethrough {text-decoration: line-through;}\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable,\n.cm-s-default .cm-punctuation,\n.cm-s-default .cm-property,\n.cm-s-default .cm-operator {}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-s-default .cm-error {color: #f00;}\n.cm-invalidchar {color: #f00;}\n\n.CodeMirror-composing { border-bottom: 2px solid; }\n\n/* Default styles for common addons */\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\n.CodeMirror-activeline-background {background: #e8f2ff;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n position: relative;\n overflow: hidden;\n}\n\n.CodeMirror-scroll {\n overflow: scroll !important; /* Things will break if this is overridden */\n /* 30px is the magic margin used to hide the element's real scrollbars */\n /* See overflow: hidden in .CodeMirror */\n margin-bottom: -30px; margin-right: -30px;\n padding-bottom: 30px;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n}\n.CodeMirror-sizer {\n position: relative;\n border-right: 30px solid transparent;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n}\n.CodeMirror-vscrollbar {\n right: 0; top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n bottom: 0; left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n right: 0; bottom: 0;\n}\n.CodeMirror-gutter-filler {\n left: 0; bottom: 0;\n}\n\n.CodeMirror-gutters {\n position: absolute; left: 0; top: 0;\n min-height: 100%;\n z-index: 3;\n}\n.CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -30px;\n}\n.CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n}\n.CodeMirror-gutter-background {\n position: absolute;\n top: 0; bottom: 0;\n z-index: 4;\n}\n.CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n}\n.CodeMirror-gutter-wrapper ::selection { background-color: transparent }\n.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }\n\n.CodeMirror-lines {\n cursor: text;\n min-height: 1px; /* prevents collapsing before first draw */\n}\n.CodeMirror pre {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n}\n.CodeMirror-wrap pre {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n}\n\n.CodeMirror-linebackground {\n position: absolute;\n left: 0; right: 0; top: 0; bottom: 0;\n z-index: 0;\n}\n\n.CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.1px; /* Force widget margins to stay inside of the container */\n}\n\n.CodeMirror-widget {}\n\n.CodeMirror-rtl pre { direction: rtl; }\n\n.CodeMirror-code {\n outline: none;\n}\n\n/* Force content-box sizing for the elements where we expect it */\n.CodeMirror-scroll,\n.CodeMirror-sizer,\n.CodeMirror-gutter,\n.CodeMirror-gutters,\n.CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n}\n\n.CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n}\n\n.CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n}\n.CodeMirror-measure pre { position: static; }\n\ndiv.CodeMirror-cursors {\n visibility: hidden;\n position: relative;\n z-index: 3;\n}\ndiv.CodeMirror-dragcursors {\n visibility: visible;\n}\n\n.CodeMirror-focused div.CodeMirror-cursors {\n visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n.CodeMirror-crosshair { cursor: crosshair; }\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\n\n.cm-searching {\n background-color: #ffa;\n background-color: rgba(255, 255, 0, .4);\n}\n\n/* Used to force a border model for a node */\n.cm-force-border { padding-right: .1px; }\n\n@media print {\n /* Hide the cursor when printing */\n .CodeMirror div.CodeMirror-cursors {\n visibility: hidden;\n }\n}\n\n/* See issue #2901 */\n.cm-tab-wrap-hack:after { content: ''; }\n\n/* Help users use markselection to safely style text background */\nspan.CodeMirror-selectedtext { background: none; }\n",""])},function(e,t,n){var r=n(18);"string"==typeof r&&(r=[[e.i,r,""]]);n(17)(r,{singleton:!0,insertAt:"top",attrs:{"data-added-by":"juniper"},hmr:!0,transform:void 0,insertInto:void 0}),r.locals&&(e.exports=r.locals)},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),n(95),r(n(92)),r(n(69))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=n(10),o=function(){function e(e){void 0===e&&(e={}),this.serverSettings=e.serverSettings||i.ServerConnection.makeSettings()}return Object.defineProperty(e.prototype,"isAvailable",{get:function(){return"true"===r.PageConfig.getOption("buildAvailable").toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shouldCheck",{get:function(){return"true"===r.PageConfig.getOption("buildCheck").toLowerCase()},enumerable:!0,configurable:!0}),e.prototype.getStatus=function(){var e=this.serverSettings.baseUrl,t=r.URLExt.join(e,"lab/api/build"),n=this.serverSettings;return i.ServerConnection.makeRequest(t,{},n).then(function(e){if(200!==e.status)throw new i.ServerConnection.ResponseError(e);return e.json()}).then(function(e){if("string"!=typeof e.status)throw new Error("Invalid data");if("string"!=typeof e.message)throw new Error("Invalid data");return e})},e.prototype.build=function(){var e=this.serverSettings.baseUrl,t=r.URLExt.join(e,"lab/api/build"),n=this.serverSettings;return i.ServerConnection.makeRequest(t,{method:"POST"},n).then(function(e){if(400===e.status)throw new i.ServerConnection.ResponseError(e,"Build aborted");if(200!==e.status)throw new i.ServerConnection.ResponseError(e,"Build failed with ${response.status)`, please run `jupyter lab build` on the server for full output")})},e.prototype.cancel=function(){var e=this.serverSettings.baseUrl,t=r.URLExt.join(e,"lab/api/build"),n=this.serverSettings;return i.ServerConnection.makeRequest(t,{method:"DELETE"},n).then(function(e){if(204!==e.status)throw new i.ServerConnection.ResponseError(e)})},e}();t.BuildManager=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=n(97),o=n(50),a=n(48),s=n(47),l=n(46),c=n(10),u=n(45),d=function(){function e(e){void 0===e&&(e={});var t=this;this._isDisposed=!1,this._specsChanged=new r.Signal(this),this._isReady=!1,this.serverSettings=e.serverSettings||c.ServerConnection.makeSettings(),this.contents=new o.ContentsManager(e),this.sessions=new a.SessionManager(e),this.settings=new s.SettingManager(e),this.terminals=new l.TerminalManager(e),this.builder=new i.BuildManager(e),this.workspaces=new u.WorkspaceManager(e),this.sessions.specsChanged.connect(function(e,n){t._specsChanged.emit(n)}),this._readyPromise=this.sessions.ready.then(function(){if(t.terminals.isAvailable())return t.terminals.ready}),this._readyPromise.then(function(){t._isReady=!0})}return Object.defineProperty(e.prototype,"specsChanged",{get:function(){return this._specsChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this.contents.dispose(),this.sessions.dispose(),this.terminals.dispose())},Object.defineProperty(e.prototype,"specs",{get:function(){return this.sessions.specs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isReady",{get:function(){return this._isReady},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return this._readyPromise},enumerable:!0,configurable:!0}),e}();t.ServiceManager=d},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=n(5),a=n(2),s=n(11),l=n(49),c=function(){function e(e){void 0===e&&(e={});var t=this;this._models=[],this._kernels=new Set,this._specs=null,this._isDisposed=!1,this._modelsTimer=-1,this._specsTimer=-1,this._isReady=!1,this._specsChanged=new a.Signal(this),this._runningChanged=new a.Signal(this),this.serverSettings=e.serverSettings||s.ServerConnection.makeSettings(),this._readyPromise=this._refreshSpecs().then(function(){return t._refreshRunning()}),this._modelsTimer=setInterval(function(){"undefined"!=typeof document&&document.hidden||t._refreshRunning()},1e4),this._specsTimer=setInterval(function(){"undefined"!=typeof document&&document.hidden||t._refreshSpecs()},61e3)}return Object.defineProperty(e.prototype,"specsChanged",{get:function(){return this._specsChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"runningChanged",{get:function(){return this._runningChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(this._isDisposed=!0,clearInterval(this._modelsTimer),clearInterval(this._specsTimer),a.Signal.clearData(this),this._models=[])},Object.defineProperty(e.prototype,"specs",{get:function(){return this._specs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isReady",{get:function(){return this._isReady},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return this._readyPromise},enumerable:!0,configurable:!0}),e.prototype.running=function(){return i.iter(this._models)},e.prototype.refreshSpecs=function(){return this._refreshSpecs()},e.prototype.refreshRunning=function(){return this._refreshRunning()},e.prototype.startNew=function(e){var t=this;void 0===e&&(e={});var n=r({},e,{serverSettings:this.serverSettings});return l.Kernel.startNew(n).then(function(e){return t._onStarted(e),e})},e.prototype.findById=function(e){return l.Kernel.findById(e,this.serverSettings)},e.prototype.connectTo=function(e){var t=this;return l.Kernel.connectTo(e,this.serverSettings).then(function(e){return t._onStarted(e),e})},e.prototype.shutdown=function(e){var t=this,n=i.ArrayExt.findFirstIndex(this._models,function(t){return t.id===e});if(-1!==n)return this._models.splice(n,1),this._runningChanged.emit(this._models.slice()),l.Kernel.shutdown(e,this.serverSettings).then(function(){var n=[];t._kernels.forEach(function(t){t.id===e&&(t.dispose(),n.push(t))}),n.forEach(function(e){t._kernels.delete(e)})})},e.prototype.shutdownAll=function(){var e=this,t=this._models;return t.length>0&&(this._models=[],this._runningChanged.emit([])),this._refreshRunning().then(function(){return Promise.all(t.map(function(t){return l.Kernel.shutdown(t.id,e.serverSettings).then(function(){var t=[];e._kernels.forEach(function(e){e.dispose(),t.push(e)}),t.forEach(function(t){e._kernels.delete(t)})})})).then(function(){})})},e.prototype._onTerminated=function(e){var t=i.ArrayExt.findFirstIndex(this._models,function(t){return t.id===e});-1!==t&&(this._models.splice(t,1),this._runningChanged.emit(this._models.slice()))},e.prototype._onStarted=function(e){var t=this,n=e.id;this._kernels.add(e),-1===i.ArrayExt.findFirstIndex(this._models,function(e){return e.id===n})&&(this._models.push(e.model),this._runningChanged.emit(this._models.slice())),e.terminated.connect(function(){t._onTerminated(n)})},e.prototype._refreshSpecs=function(){var e=this;return l.Kernel.getSpecs(this.serverSettings).then(function(t){o.JSONExt.deepEqual(t,e._specs)||(e._specs=t,e._specsChanged.emit(t))})},e.prototype._refreshRunning=function(){var e=this;return l.Kernel.listRunning(this.serverSettings).then(function(t){if(e._isReady=!0,!o.JSONExt.deepEqual(t,e._models)){var n=t.map(function(e){return e.id}),r=[];e._kernels.forEach(function(e){-1===n.indexOf(e.id)&&(e.dispose(),r.push(e))}),r.forEach(function(t){e._kernels.delete(t)}),e._models=t.slice(),e._runningChanged.emit(t)}})},e}();t.KernelManager=c},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var i=["username","version","session","msg_id","msg_type"],o={stream:{name:"string",text:"string"},display_data:{data:"object",metadata:"object"},execute_input:{code:"string",execution_count:"number"},execute_result:{execution_count:"number",data:"object",metadata:"object"},error:{ename:"string",evalue:"string",traceback:"object"},status:{execution_state:"string"},clear_output:{wait:"boolean"},comm_open:{comm_id:"string",target_name:"string",data:"object"},comm_msg:{comm_id:"string",data:"object"},comm_close:{comm_id:"string"},shutdown_reply:{restart:"boolean"}};function a(e,t,n){if(!e.hasOwnProperty(t))throw Error("Missing property '"+t+"'");if(void 0!==n){var i=!0,o=e[t];switch(n){case"array":i=Array.isArray(o);break;case"object":i=void 0!==o;break;default:i=(void 0===o?"undefined":r(o))===n}if(!i)throw new Error("Property '"+t+"' is not of type '"+n)}}function s(e){var t=e.spec;if(!t)throw new Error("Invalid kernel spec");return a(e,"name","string"),a(e,"resources","object"),a(t,"language","string"),a(t,"display_name","string"),a(t,"argv","array"),{name:e.name,resources:e.resources,language:t.language,display_name:t.display_name,argv:t.argv}}t.validateMessage=function(e){a(e,"metadata","object"),a(e,"content","object"),a(e,"channel","string"),function(e){for(var t=0;t<i.length;t++)a(e,i[t],"string")}(e.header),"iopub"===e.channel&&function(e){if("iopub"===e.channel){var t=o[e.header.msg_type];if(void 0===t)return;for(var n=Object.keys(t),r=e.content,i=0;i<n.length;i++)a(r,n[i],t[n[i]])}}(e)},t.validateModel=function(e){a(e,"name","string"),a(e,"id","string")},t.validateSpecModel=s,t.validateSpecModels=function(e){if(!e.hasOwnProperty("kernelspecs"))throw new Error("No kernelspecs found");for(var t=Object.keys(e.kernelspecs),n=Object.create(null),r=e.default,i=0;i<t.length;i++){var o=e.kernelspecs[t[i]];try{n[t[i]]=s(o)}catch(e){console.warn("Removing errant kernel spec: "+t[i])}}if(!(t=Object.keys(n)).length)throw new Error("No valid kernelspecs found");return r&&"string"==typeof r&&r in n||(r=t[0],console.warn("Default kernel not found, using '"+t[0]+"'")),{default:r,kernelspecs:n}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserialize=function(e){return"string"==typeof e?JSON.parse(e):function(e){var t=new DataView(e),n=t.getUint32(0),r=[];if(n<2)throw new Error("Invalid incoming Kernel Message");for(var i=1;i<=n;i++)r.push(t.getUint32(4*i));var o=new Uint8Array(e.slice(r[0],r[1])),a=JSON.parse(new TextDecoder("utf8").decode(o));a.buffers=[];for(i=1;i<n;i++){var s=r[i],l=r[i+1]||e.byteLength;a.buffers.push(new DataView(e.slice(s,l)))}return a}(e)},t.serialize=function(e){return e.buffers&&e.buffers.length?function(e){var t=[],n=[],r=new TextEncoder("utf8"),i=[];void 0!==e.buffers&&(i=e.buffers,delete e.buffers);var o=r.encode(JSON.stringify(e));n.push(o.buffer);for(var a=0;a<i.length;a++){var s=i[a];n.push(s instanceof ArrayBuffer?s:s.buffer)}var l=n.length;t.push(4*(l+1));for(a=0;a+1<n.length;a++)t.push(t[t.length-1]+n[a].byteLength);var c=new Uint8Array(t[t.length-1]+n[n.length-1].byteLength),u=new DataView(c.buffer);u.setUint32(0,l);for(a=0;a<t.length;a++)u.setUint32(4*(a+1),t[a]);for(a=0;a<n.length;a++)c.set(new Uint8Array(n[a]),t[a]);return c.buffer}(e):JSON.stringify(e)}},function(e,t,n){"use strict";(function(e){var r,i=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o,a=n(5),s=n(8),l=n(19),c=function(e){function t(t,n,r,i,s){var l=e.call(this,t)||this;return l._status=0,l._stdin=o.noOp,l._iopub=o.noOp,l._reply=o.noOp,l._done=new a.PromiseDelegate,l._hooks=new o.HookList,l._disposeOnDone=!0,l._msg=n,r||l._setFlag(o.KernelFutureFlag.GotReply),l._disposeOnDone=i,l._kernel=s,l}return i(t,e),Object.defineProperty(t.prototype,"msg",{get:function(){return this._msg},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"done",{get:function(){return this._done.promise},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onReply",{get:function(){return this._reply},set:function(e){this._reply=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onIOPub",{get:function(){return this._iopub},set:function(e){this._iopub=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onStdin",{get:function(){return this._stdin},set:function(e){this._stdin=e},enumerable:!0,configurable:!0}),t.prototype.registerMessageHook=function(e){this._hooks.add(e)},t.prototype.removeMessageHook=function(e){this.isDisposed||this._hooks.remove(e)},t.prototype.sendInputReply=function(e){this._kernel.sendInputReply(e)},t.prototype.dispose=function(){this._stdin=o.noOp,this._iopub=o.noOp,this._reply=o.noOp,this._testFlag(o.KernelFutureFlag.IsDone)||this._done.reject(new Error("Canceled")),e.prototype.dispose.call(this)},t.prototype.handleMsg=function(e){switch(e.channel){case"shell":this._handleReply(e);break;case"stdin":this._handleStdin(e);break;case"iopub":this._handleIOPub(e)}},t.prototype._handleReply=function(e){var t=this._reply;t&&t(e),this._replyMsg=e,this._setFlag(o.KernelFutureFlag.GotReply),this._testFlag(o.KernelFutureFlag.GotIdle)&&this._handleDone()},t.prototype._handleStdin=function(e){var t=this._stdin;t&&t(e)},t.prototype._handleIOPub=function(e){var t=this._hooks.process(e),n=this._iopub;t&&n&&n(e),l.KernelMessage.isStatusMsg(e)&&"idle"===e.content.execution_state&&(this._setFlag(o.KernelFutureFlag.GotIdle),this._testFlag(o.KernelFutureFlag.GotReply)&&this._handleDone())},t.prototype._handleDone=function(){this._testFlag(o.KernelFutureFlag.IsDone)||(this._setFlag(o.KernelFutureFlag.IsDone),this._done.resolve(this._replyMsg),this._disposeOnDone&&this.dispose())},t.prototype._testFlag=function(e){return 0!=(this._status&e)},t.prototype._setFlag=function(e){this._status|=e},t}(s.DisposableDelegate);t.KernelFutureHandler=c,function(t){t.noOp=function(){};var n="function"==typeof requestAnimationFrame?requestAnimationFrame:e,r=function(){function e(){this._hooks=[]}return e.prototype.add=function(e){this.remove(e),this._hooks.push(e)},e.prototype.remove=function(e){var t=this._hooks.indexOf(e);t>=0&&(this._hooks[t]=null,this._scheduleCompact())},e.prototype.process=function(e){for(var t,n=this._hooks.length-1;n>=0;n--){var r=this._hooks[n];if(null!==r){try{t=r(e)}catch(e){t=!0,console.error(e)}if(!1===t)return!1}}return!0},e.prototype._scheduleCompact=function(){var e=this;this._cleanupScheduled||(this._cleanupScheduled=!0,n(function(){e._cleanupScheduled=!1,e._compact()}))},e.prototype._compact=function(){for(var e=0,t=0,n=this._hooks.length;t<n;t++){var r=this._hooks[t];null===this._hooks[t]?e++:this._hooks[t-e]=r}this._hooks.length-=e},e}();t.HookList=r,function(e){e[e.GotReply=1]="GotReply",e[e.GotIdle=2]="GotIdle",e[e.IsDone=4]="IsDone",e[e.DisposeOnDone=8]="DisposeOnDone"}(t.KernelFutureFlag||(t.KernelFutureFlag={}))}(o||(o={}))}).call(this,n(20).setImmediate)},function(e,t,n){"use strict";var r,i=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),a=n(19),s=function(e){function t(t,n,r,i){var o=e.call(this,i)||this;return o._target="",o._id="",o._id=n,o._target=t,o._kernel=r,o}return i(t,e),Object.defineProperty(t.prototype,"commId",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"targetName",{get:function(){return this._target},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onClose",{get:function(){return this._onClose},set:function(e){this._onClose=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onMsg",{get:function(){return this._onMsg},set:function(e){this._onMsg=e},enumerable:!0,configurable:!0}),t.prototype.open=function(e,t,n){if(void 0===n&&(n=[]),this.isDisposed||this._kernel.isDisposed)throw new Error("Cannot open");var r={msgType:"comm_open",channel:"shell",username:this._kernel.username,session:this._kernel.clientId},i={comm_id:this._id,target_name:this._target,data:e||{}},o=a.KernelMessage.createShellMessage(r,i,t,n);return this._kernel.sendShellMessage(o,!1,!0)},t.prototype.send=function(e,t,n,r){if(void 0===n&&(n=[]),void 0===r&&(r=!0),this.isDisposed||this._kernel.isDisposed)throw new Error("Cannot send");var i={msgType:"comm_msg",channel:"shell",username:this._kernel.username,session:this._kernel.clientId},o={comm_id:this._id,data:e},s=a.KernelMessage.createShellMessage(i,o,t,n);return this._kernel.sendShellMessage(s,!1,!0)},t.prototype.close=function(e,t,n){if(void 0===n&&(n=[]),this.isDisposed||this._kernel.isDisposed)throw new Error("Cannot close");var r={msgType:"comm_msg",channel:"shell",username:this._kernel.username,session:this._kernel.clientId},i={comm_id:this._id,data:e||{}},o=a.KernelMessage.createShellMessage(r,i,t,n),s=this._kernel.sendShellMessage(o,!1,!0);r.channel="iopub";var l=this._onClose;return l&&l(a.KernelMessage.createMessage(r,i,t,n)),this.dispose(),s},t}(o.DisposableDelegate);t.CommHandler=s},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(4),a=n(3),s=n(5),l=n(8),c=n(2),u=n(11),d=n(103),f=n(19),h=n(102),p=n(101),m=n(100),g="api/kernels",v="api/kernelspecs",y=function(){function e(e,t){var n=this;this._createSocket=function(){var e=n.serverSettings,t=o.URLExt.join(e.wsUrl,g,encodeURIComponent(n._id)),r=t.replace(/^((?:\w+:)?\/\/)(?:[^@\/]+@)/,"$1");console.log("Starting WebSocket:",r);var i=o.URLExt.join(t,"channels?session_id="+encodeURIComponent(n._clientId)),a=e.token;""!==a&&(i=i+"&token="+encodeURIComponent(a)),n._connectionPromise=new s.PromiseDelegate,n._wsStopped=!1,n._ws=new e.WebSocket(i),n._ws.binaryType="arraybuffer",n._ws.onmessage=n._onWSMessage,n._ws.onopen=n._onWSOpen,n._ws.onclose=n._onWSClose,n._ws.onerror=n._onWSClose},this._onWSOpen=function(e){n._reconnectAttempt=0,n._isReady=!0,n._updateStatus("connected"),n.requestKernelInfo().then(function(){n._connectionPromise.resolve(void 0)}).catch(function(e){n._connectionPromise.reject(e)}),n._isReady=!1},this._onWSMessage=function(e){if(!n._wsStopped){var t=p.deserialize(e.data);try{m.validateMessage(t)}catch(e){return void console.error("Invalid message: "+e.message)}var r=!1;if(t.parent_header&&"iopub"===t.channel)switch(t.header.msg_type){case"display_data":case"update_display_data":case"execute_result":var i=(t.content.transient||{}).display_id;i&&(r=n._handleDisplayId(i,t))}if(!r&&t.parent_header){var o=t.parent_header,a=n._futures&&n._futures.get(o.msg_id);if(a)a.handleMsg(t);else{var s=o.session===n.clientId;"iopub"!==t.channel&&s&&n._unhandledMessage.emit(t)}}if("iopub"===t.channel){switch(t.header.msg_type){case"status":n._updateStatus(t.content.execution_state);break;case"comm_open":n._handleCommOpen(t);break;case"comm_msg":n._handleCommMsg(t);break;case"comm_close":n._handleCommClose(t)}n._iopubMessage.emit(t)}}},this._onWSClose=function(e){if(!n._wsStopped&&n._ws)if(n._ws.onclose=n._noOp,n._ws.onerror=n._noOp,n._ws=null,n._reconnectAttempt<n._reconnectLimit){n._updateStatus("reconnecting");var t=Math.pow(2,n._reconnectAttempt);console.error("Connection lost, reconnecting in "+t+" seconds."),setTimeout(n._createSocket,1e3*t),n._reconnectAttempt+=1}else n._updateStatus("dead"),n._connectionPromise.reject(new Error("Could not establish connection"))},this._id="",this._name="",this._status="unknown",this._clientId="",this._isDisposed=!1,this._wsStopped=!1,this._ws=null,this._username="",this._reconnectLimit=7,this._reconnectAttempt=0,this._isReady=!1,this._targetRegistry=Object.create(null),this._info=null,this._pendingMessages=[],this._statusChanged=new c.Signal(this),this._iopubMessage=new c.Signal(this),this._unhandledMessage=new c.Signal(this),this._displayIdToParentIds=new Map,this._msgIdToDisplayIds=new Map,this._terminated=new c.Signal(this),this._noOp=function(){},this._name=e.name,this._id=t,this.serverSettings=e.serverSettings||u.ServerConnection.makeSettings(),this._clientId=e.clientId||o.uuid(),this._username=e.username||"",this._futures=new Map,this._commPromises=new Map,this._createSocket(),i.runningKernels.push(this)}return Object.defineProperty(e.prototype,"terminated",{get:function(){return this._terminated},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"statusChanged",{get:function(){return this._statusChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iopubMessage",{get:function(){return this._iopubMessage},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"unhandledMessage",{get:function(){return this._unhandledMessage},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){return{name:this.name,id:this.id}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"username",{get:function(){return this._username},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clientId",{get:function(){return this._clientId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"info",{get:function(){return this._info},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isReady",{get:function(){return this._isReady},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return this._connectionPromise.promise},enumerable:!0,configurable:!0}),e.prototype.getSpec=function(){var e=this;return this._specPromise?this._specPromise:(this._specPromise=i.findSpecs(this.serverSettings).then(function(t){return t.kernelspecs[e._name]}),this._specPromise)},e.prototype.clone=function(){return new e({name:this._name,username:this._username,serverSettings:this.serverSettings},this._id)},e.prototype.dispose=function(){this.isDisposed||(this._isDisposed=!0,this._terminated.emit(void 0),this._status="dead",this._clearSocket(),this._futures.forEach(function(e,t){e.dispose()}),this._commPromises.forEach(function(e,t){e.then(function(e){e.dispose()})}),this._displayIdToParentIds.clear(),this._msgIdToDisplayIds.clear(),a.ArrayExt.removeFirstOf(i.runningKernels,this),c.Signal.clearData(this))},e.prototype.sendShellMessage=function(e,t,n){var r=this;if(void 0===t&&(t=!1),void 0===n&&(n=!0),"dead"===this.status)throw new Error("Kernel is dead");this._isReady&&this._ws?this._ws.send(p.serialize(e)):this._pendingMessages.push(e);var i=new h.KernelFutureHandler(function(){var t=e.header.msg_id;r._futures.delete(t);var n=r._msgIdToDisplayIds.get(t);n&&(n.forEach(function(e){var n=r._displayIdToParentIds.get(e);if(n){var i=n.indexOf(t);if(-1===i)return;1===n.length?r._displayIdToParentIds.delete(e):(n.splice(i,1),r._displayIdToParentIds.set(e,n))}}),r._msgIdToDisplayIds.delete(t))},e,t,n,this);return this._futures.set(e.header.msg_id,i),i},e.prototype.interrupt=function(){return i.interruptKernel(this,this.serverSettings)},e.prototype.restart=function(){return i.restartKernel(this,this.serverSettings)},e.prototype.handleRestart=function(){this._clearState(),this._updateStatus("restarting"),this._clearSocket()},e.prototype.reconnect=function(){return this._clearSocket(),this._updateStatus("reconnecting"),this._createSocket(),this._connectionPromise.promise},e.prototype.shutdown=function(){var e=this;return"dead"===this.status?Promise.reject(new Error("Kernel is dead")):i.shutdownKernel(this.id,this.serverSettings).then(function(){e._clearState(),e._clearSocket()})},e.prototype.requestKernelInfo=function(){var e=this,t={msgType:"kernel_info_request",channel:"shell",username:this._username,session:this._clientId},n=f.KernelMessage.createShellMessage(t);return i.handleShellMessage(this,n).then(function(t){return e._info=t.content,t})},e.prototype.requestComplete=function(e){var t={msgType:"complete_request",channel:"shell",username:this._username,session:this._clientId},n=f.KernelMessage.createShellMessage(t,e);return i.handleShellMessage(this,n)},e.prototype.requestInspect=function(e){var t={msgType:"inspect_request",channel:"shell",username:this._username,session:this._clientId},n=f.KernelMessage.createShellMessage(t,e);return i.handleShellMessage(this,n)},e.prototype.requestHistory=function(e){var t={msgType:"history_request",channel:"shell",username:this._username,session:this._clientId},n=f.KernelMessage.createShellMessage(t,e);return i.handleShellMessage(this,n)},e.prototype.requestExecute=function(e,t){void 0===t&&(t=!0);var n={msgType:"execute_request",channel:"shell",username:this._username,session:this._clientId};e=r({},{silent:!1,store_history:!0,user_expressions:{},allow_stdin:!0,stop_on_error:!1},e);var i=f.KernelMessage.createShellMessage(n,e);return this.sendShellMessage(i,!0,t)},e.prototype.requestIsComplete=function(e){var t={msgType:"is_complete_request",channel:"shell",username:this._username,session:this._clientId},n=f.KernelMessage.createShellMessage(t,e);return i.handleShellMessage(this,n)},e.prototype.requestCommInfo=function(e){var t={msgType:"comm_info_request",channel:"shell",username:this._username,session:this._clientId},n=f.KernelMessage.createShellMessage(t,e);return i.handleShellMessage(this,n)},e.prototype.sendInputReply=function(e){if("dead"===this.status)throw new Error("Kernel is dead");var t={msgType:"input_reply",channel:"stdin",username:this._username,session:this._clientId},n=f.KernelMessage.createMessage(t,e);this._isReady&&this._ws?this._ws.send(p.serialize(n)):this._pendingMessages.push(n)},e.prototype.registerMessageHook=function(e,t){var n=this,r=this._futures&&this._futures.get(e);return r&&r.registerMessageHook(t),new l.DisposableDelegate(function(){(r=n._futures&&n._futures.get(e))&&r.removeMessageHook(t)})},e.prototype.registerCommTarget=function(e,t){var n=this;return this._targetRegistry[e]=t,new l.DisposableDelegate(function(){n.isDisposed||delete n._targetRegistry[e]})},e.prototype.connectToComm=function(e,t){var n=this,r=t||o.uuid();if(this._commPromises.has(r))return this._commPromises.get(r);var i=Promise.resolve(void 0).then(function(){return new d.CommHandler(e,r,n,function(){n._unregisterComm(r)})});return this._commPromises.set(r,i),i},e.prototype._handleDisplayId=function(e,t){var n=this,r=t.parent_header.msg_id,i=this._displayIdToParentIds.get(e);if(i){var o={header:s.JSONExt.deepCopy(t.header),parent_header:s.JSONExt.deepCopy(t.parent_header),metadata:s.JSONExt.deepCopy(t.metadata),content:s.JSONExt.deepCopy(t.content),channel:t.channel,buffers:t.buffers?t.buffers.slice():[]};o.header.msg_type="update_display_data",i.map(function(e){var t=n._futures&&n._futures.get(e);t&&t.handleMsg(o)})}if("update_display_data"===t.header.msg_type)return!0;-1===(i=this._displayIdToParentIds.get(e)||[]).indexOf(r)&&i.push(r),this._displayIdToParentIds.set(e,i);var a=this._msgIdToDisplayIds.get(r)||[];return-1===a.indexOf(r)&&a.push(r),this._msgIdToDisplayIds.set(r,a),!1},e.prototype._clearSocket=function(){this._wsStopped=!0,this._isReady=!1,null!==this._ws&&(this._ws.onopen=this._noOp,this._ws.onclose=this._noOp,this._ws.onerror=this._noOp,this._ws.onmessage=this._noOp,this._ws.close(),this._ws=null)},e.prototype._updateStatus=function(e){switch(e){case"starting":case"idle":case"busy":case"connected":this._isReady=!0;break;case"restarting":case"reconnecting":case"dead":this._isReady=!1;break;default:return void console.error("invalid kernel status:",e)}e!==this._status&&(this._status=e,i.logKernelStatus(this),this._statusChanged.emit(e),"dead"===e&&this.dispose()),this._isReady&&this._sendPending()},e.prototype._sendPending=function(){for(;this._ws&&this._pendingMessages.length>0;){var e=p.serialize(this._pendingMessages[0]);this._ws.send(e),this._pendingMessages.shift()}},e.prototype._clearState=function(){this._isReady=!1,this._pendingMessages=[],this._futures.forEach(function(e,t){e.dispose()}),this._commPromises.forEach(function(e,t){e.then(function(e){e.dispose()})}),this._futures=new Map,this._commPromises=new Map,this._displayIdToParentIds.clear(),this._msgIdToDisplayIds.clear()},e.prototype._handleCommOpen=function(e){var t=this,n=e.content;if(!this.isDisposed){var r=i.loadObject(n.target_name,n.target_module,this._targetRegistry).then(function(r){var i,o=new d.CommHandler(n.target_name,n.comm_id,t,function(){t._unregisterComm(n.comm_id)});try{i=r(o,e)}catch(e){throw o.close(),console.error("Exception opening new comm"),e}return Promise.resolve(i).then(function(){if(!t.isDisposed)return o})});this._commPromises.set(n.comm_id,r)}},e.prototype._handleCommClose=function(e){var t=this,n=e.content,r=this._commPromises.get(n.comm_id);r?r.then(function(n){if(n){t._unregisterComm(n.commId);try{var r=n.onClose;r&&r(e),n.dispose()}catch(t){console.error("Exception closing comm: ",t,t.stack,e)}}}):console.error("Comm not found for comm id "+n.comm_id)},e.prototype._handleCommMsg=function(e){var t=e.content,n=this._commPromises.get(t.comm_id);n&&n.then(function(t){if(t)try{var n=t.onMsg;n&&n(e)}catch(t){console.error("Exception handling comm msg: ",t,t.stack,e)}})},e.prototype._unregisterComm=function(e){this._commPromises.delete(e)},e}();t.DefaultKernel=y,function(e){e.findById=function(e,t){return i.findById(e,t)},e.getSpecs=function(e){return i.getSpecs(e)},e.listRunning=function(e){return i.listRunning(e)},e.startNew=function(e){return i.startNew(e)},e.connectTo=function(e,t){return i.connectTo(e,t)},e.shutdown=function(e,t){return i.shutdownKernel(e,t)},e.shutdownAll=function(e){return i.shutdownAll(e)}}(y=t.DefaultKernel||(t.DefaultKernel={})),t.DefaultKernel=y,function(e){function t(t){t=t||u.ServerConnection.makeSettings();var n=o.URLExt.join(t.baseUrl,v),r=u.ServerConnection.makeRequest(n,{},t).then(function(e){if(200!==e.status)throw new u.ServerConnection.ResponseError(e);return e.json()}).then(function(e){return m.validateSpecModels(e)});return e.specs[t.baseUrl]=r,r}function n(e){e=e||u.ServerConnection.makeSettings();var t=o.URLExt.join(e.baseUrl,g);return u.ServerConnection.makeRequest(t,{},e).then(function(e){if(200!==e.status)throw new u.ServerConnection.ResponseError(e);return e.json()}).then(function(e){if(!Array.isArray(e))throw new Error("Invalid kernel list");for(var t=0;t<e.length;t++)m.validateModel(e[t]);return i(e)})}function i(t){return a.each(e.runningKernels,function(e){a.find(t,function(t){return e.id===t.id})||"dead"===e.status||e.dispose()}),t}function s(t,n){n=n||u.ServerConnection.makeSettings();var r=o.URLExt.join(n.baseUrl,g,encodeURIComponent(t));return u.ServerConnection.makeRequest(r,{method:"DELETE"},n).then(function(n){if(404===n.status)n.json().then(function(e){var n=e.message||'The kernel "'+t+'"" does not exist on the server';console.warn(n)});else if(204!==n.status)throw new u.ServerConnection.ResponseError(n);!function(t){a.each(a.toArray(e.runningKernels),function(e){e.id===t&&e.dispose()})}(t)})}function l(e,t){t=t||u.ServerConnection.makeSettings();var n=o.URLExt.join(t.baseUrl,g,encodeURIComponent(e));return u.ServerConnection.makeRequest(n,{},t).then(function(e){if(200!==e.status)throw new u.ServerConnection.ResponseError(e);return e.json()}).then(function(e){return m.validateModel(e),e})}e.runningKernels=[],e.specs=Object.create(null),e.findById=function(t,n){var r=a.find(e.runningKernels,function(e){return e.id===t});return r?Promise.resolve(r.model):l(t,n).catch(function(){throw new Error("No running kernel with id: "+t)})},e.findSpecs=function(n){return n=n||u.ServerConnection.makeSettings(),e.specs[n.baseUrl]||t(n)},e.getSpecs=t,e.listRunning=n,e.updateRunningKernels=i,e.startNew=function(e){var t=e.serverSettings||u.ServerConnection.makeSettings(),n=o.URLExt.join(t.baseUrl,g),i={method:"POST",body:JSON.stringify({name:e.name})};return u.ServerConnection.makeRequest(n,i,t).then(function(e){if(201!==e.status)throw new u.ServerConnection.ResponseError(e);return e.json()}).then(function(n){return m.validateModel(n),new y(r({},e,{name:n.name,serverSettings:t}),n.id)})},e.connectTo=function(t,n){var r=n||u.ServerConnection.makeSettings(),i=a.find(e.runningKernels,function(e){return e.id===t.id});return i?Promise.resolve(i.clone()):Promise.resolve(new y({name:t.name,serverSettings:r},t.id))},e.restartKernel=function(t,n){if("dead"===t.status)return Promise.reject(new Error("Kernel is dead"));n=n||u.ServerConnection.makeSettings();var r=o.URLExt.join(n.baseUrl,g,encodeURIComponent(t.id),"restart");return a.each(e.runningKernels,function(e){e.id===t.id&&e.handleRestart()}),u.ServerConnection.makeRequest(r,{method:"POST"},n).then(function(e){if(200!==e.status)throw new u.ServerConnection.ResponseError(e);return e.json()}).then(function(n){return m.validateModel(n),a.each(e.runningKernels,function(e){e!==t&&e.id===t.id&&e.reconnect()}),t.reconnect()})},e.interruptKernel=function(e,t){if("dead"===e.status)return Promise.reject(new Error("Kernel is dead"));t=t||u.ServerConnection.makeSettings();var n=o.URLExt.join(t.baseUrl,g,encodeURIComponent(e.id),"interrupt");return u.ServerConnection.makeRequest(n,{method:"POST"},t).then(function(e){if(204!==e.status)throw new u.ServerConnection.ResponseError(e)})},e.shutdownKernel=s,e.shutdownAll=function(e){return n(e=e||u.ServerConnection.makeSettings()).then(function(t){a.each(t,function(t){s(t.id,e)})})},e.getKernelModel=l,e.logKernelStatus=function(e){switch(e.status){case"idle":case"busy":case"unknown":return;default:console.log("Kernel: "+e.status+" ("+e.id+")")}},e.handleShellMessage=function(e,t){var n;try{n=e.sendShellMessage(t,!0)}catch(e){return Promise.reject(e)}return new Promise(function(e){n.onReply=e})},e.loadObject=function(e,t,n){return new Promise(function(r,i){if(t){if("undefined"==typeof requirejs)throw new Error("requirejs not found");requirejs([t],function(n){void 0===n[e]?i(new Error("Object '"+e+"' not found in module '"+t+"'")):r(n[e])},i)}else n&&n[e]?r(n[e]):i(new Error("Object '"+e+"' not found in registry"))})}}(i||(i={}))},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(49)),r(n(99)),r(n(19))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uuid=function(e){void 0===e&&(e=32);for(var t=new Array(e),n="0123456789abcdef".length,r=0;r<e;r++)t[r]="0123456789abcdef".charAt(Math.floor(Math.random()*n));return t.join("")}},function(e,t,n){"use strict"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){var t="𝐚".length>1;e.jsIndexToCharIndex=function(e,n){if(t)return e;for(var r=e,i=0;i+1<n.length&&i<e;i++){var o=n.charCodeAt(i);if(o>=55296&&o<=56319){var a=n.charCodeAt(i+1);a>=56320&&a<=57343&&(r--,i++)}}return r},e.charIndexToJsIndex=function(e,n){if(t)return e;for(var r=e,i=0;i+1<n.length&&i<r;i++){var o=n.charCodeAt(i);if(o>=55296&&o<=56319){var a=n.charCodeAt(i+1);a>=56320&&a<=57343&&(r++,i++)}}return r}}(t.Text||(t.Text={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2);t.IStateDB=new r.Token("@jupyterlab/coreutils:IStateDB");var o=function(){function e(e){var t=this;this.maxLength=2e3,this._changed=new i.Signal(this);var n=e.namespace,r=e.transform;this.namespace=n,this._ready=r?r.then(function(e){var n=e.contents;switch(e.type){case"cancel":return;case"clear":return void t._clear();case"merge":return void t._merge(n||{});case"overwrite":return void t._overwrite(n||{});default:return}}):Promise.resolve(void 0)}return Object.defineProperty(e.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),e.prototype.clear=function(e){var t=this;return void 0===e&&(e=!1),this._ready.then(function(){t._clear(),e||t._changed.emit({id:null,type:"clear"})})},e.prototype.fetch=function(e){var t=this;return this._ready.then(function(){var n=t.namespace+":"+e,r=window.localStorage.getItem(n);if(r)return JSON.parse(r).v})},e.prototype.fetchNamespace=function(e){var t=this;return this._ready.then(function(){for(var n=window.localStorage,r=t.namespace+":"+e+":",i=[],o=n.length;o;){var a=n.key(--o);if(a&&0===a.indexOf(r)){var s=n.getItem(a);try{var l=JSON.parse(s);i.push({id:a.replace(t.namespace+":",""),value:l?l.v:void 0})}catch(e){console.warn(e),n.removeItem(a)}}}return i})},e.prototype.remove=function(e){var t=this;return this._ready.then(function(){window.localStorage.removeItem(t.namespace+":"+e),t._changed.emit({id:e,type:"remove"})})},e.prototype.save=function(e,t){var n=this;return this._ready.then(function(){n._save(e,t),n._changed.emit({id:e,type:"save"})})},e.prototype.toJSON=function(){var e=this;return this._ready.then(function(){for(var t=window.localStorage,n=e.namespace+":",r={},i=t.length;i;){var o=t.key(--i);if(o&&0===o.indexOf(n)){var a=t.getItem(o);try{var s=JSON.parse(a);s&&(r[o.replace(n,"")]=s.v)}catch(e){console.warn(e),t.removeItem(o)}}}return r})},e.prototype._clear=function(){for(var e=window.localStorage,t=this.namespace+":",n=e.length;n;){var r=e.key(--n);r&&0===r.indexOf(t)&&e.removeItem(r)}},e.prototype._merge=function(e){var t=this;Object.keys(e).forEach(function(n){t._save(n,e[n])})},e.prototype._overwrite=function(e){this._clear(),this._merge(e)},e.prototype._save=function(e,t){var n=this.namespace+":"+e,r={v:t},i=JSON.stringify(r),o=i.length,a=this.maxLength;if(o>a)throw new Error("Data length ("+o+") exceeds maximum ("+a+")");window.localStorage.setItem(n,i)},e}();t.StateDB=o},function(e,t,n){"use strict"},function(e,t,n){"use strict";"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 n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){return e&&"object"===(void 0===e?"undefined":r(e))&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t,n){"use strict";(function(e,r){var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=/%[sdj%]/g;t.format=function(e){if(!y(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(l(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,a=String(e).replace(o,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),s=r[n];n<i;s=r[++n])g(s)||!w(s)?a+=" "+s:a+=" "+l(s);return a},t.deprecate=function(n,i){if(b(e.process))return function(){return t.deprecate(n,i).apply(this,arguments)};if(!0===r.noDeprecation)return n;var o=!1;return function(){if(!o){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?console.trace(i):console.error(i),o=!0}return n.apply(this,arguments)}};var a,s={};function l(e,n){var r={seen:[],stylize:u};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(n)?r.showHidden=n:n&&t._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=c),d(r,e,r.depth)}function c(e,t){var n=l.styles[t];return n?"["+l.colors[n][0]+"m"+e+"["+l.colors[n][1]+"m":e}function u(e,t){return e}function d(e,n,r){if(e.customInspect&&n&&C(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return y(i)||(i=d(e,i,r)),i}var o=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(y(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return v(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}(e,n);if(o)return o;var a=Object.keys(n),s=function(e){var t={};return a.forEach(function(e,n){t[e]=!0}),t}();if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),k(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(C(n)){var l=n.name?": "+n.name:"";return e.stylize("[Function"+l+"]","special")}if(x(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(_(n))return e.stylize(Date.prototype.toString.call(n),"date");if(k(n))return f(n)}var c,u="",w=!1,S=["{","}"];return p(n)&&(w=!0,S=["[","]"]),C(n)&&(u=" [Function"+(n.name?": "+n.name:"")+"]"),x(n)&&(u=" "+RegExp.prototype.toString.call(n)),_(n)&&(u=" "+Date.prototype.toUTCString.call(n)),k(n)&&(u=" "+f(n)),0!==a.length||w&&0!=n.length?r<0?x(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),c=w?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a<s;++a)T(t,String(a))?o.push(h(e,t,n,r,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(e,t,n,r,i,!0))}),o}(e,n,r,s,a):a.map(function(t){return h(e,n,r,s,t,w)}),e.seen.pop(),function(e,t,n){return e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(c,u,S)):S[0]+u+S[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,i,o){var a,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),T(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=g(n)?d(e,l.value,null):d(e,l.value,n-1)).indexOf("\n")>-1&&(s=o?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")),b(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function g(e){return null===e}function v(e){return"number"==typeof e}function y(e){return"string"==typeof e}function b(e){return void 0===e}function x(e){return w(e)&&"[object RegExp]"===S(e)}function w(e){return"object"===(void 0===e?"undefined":i(e))&&null!==e}function _(e){return w(e)&&"[object Date]"===S(e)}function k(e){return w(e)&&("[object Error]"===S(e)||e instanceof Error)}function C(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function M(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(b(a)&&(a=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!s[e])if(new RegExp("\\b"+e+"\\b","i").test(a)){var n=r.pid;s[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else s[e]=function(){};return s[e]},t.inspect=l,l.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]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=m,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=y,t.isSymbol=function(e){return"symbol"===(void 0===e?"undefined":i(e))},t.isUndefined=b,t.isRegExp=x,t.isObject=w,t.isDate=_,t.isError=k,t.isFunction=C,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===(void 0===e?"undefined":i(e))||void 0===e},t.isBuffer=n(112);var L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(n=[M((e=new Date).getHours()),M(e.getMinutes()),M(e.getSeconds())].join(":"),[e.getDate(),L[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(111),t._extend=function(e,t){if(!t||!w(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,n(7),n(14))},function(e,t,n){"use strict";(function(t){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=n(113),o=function(e){return"string"==typeof e};function a(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];i&&"."!==i&&(".."===i?n.length&&".."!==n[n.length-1]?n.pop():t&&n.push(".."):n.push(i))}return n}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,l={};function c(e){return s.exec(e).slice(1)}l.resolve=function(){for(var e="",n=!1,r=arguments.length-1;r>=-1&&!n;r--){var i=r>=0?arguments[r]:t.cwd();if(!o(i))throw new TypeError("Arguments to path.resolve must be strings");i&&(e=i+"/"+e,n="/"===i.charAt(0))}return e=a(e.split("/"),!n).join("/"),(n?"/":"")+e||"."},l.normalize=function(e){var t=l.isAbsolute(e),n="/"===e.substr(-1);return(e=a(e.split("/"),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},l.isAbsolute=function(e){return"/"===e.charAt(0)},l.join=function(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];if(!o(n))throw new TypeError("Arguments to path.join must be strings");n&&(e+=e?"/"+n:n)}return l.normalize(e)},l.relative=function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n+1)}e=l.resolve(e).substr(1),t=l.resolve(t).substr(1);for(var r=n(e.split("/")),i=n(t.split("/")),o=Math.min(r.length,i.length),a=o,s=0;s<o;s++)if(r[s]!==i[s]){a=s;break}var c=[];for(s=a;s<r.length;s++)c.push("..");return(c=c.concat(i.slice(a))).join("/")},l._makeLong=function(e){return e},l.dirname=function(e){var t=c(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},l.basename=function(e,t){var n=c(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},l.extname=function(e){return c(e)[3]},l.format=function(e){if(!i.isObject(e))throw new TypeError("Parameter 'pathObject' must be an object, not "+(void 0===e?"undefined":r(e)));var t=e.root||"";if(!o(t))throw new TypeError("'pathObject.root' must be a string or undefined, not "+r(e.root));return(e.dir?e.dir+l.sep:"")+(e.base||"")},l.parse=function(e){if(!o(e))throw new TypeError("Parameter 'pathString' must be a string, not "+(void 0===e?"undefined":r(e)));var t=c(e);if(!t||4!==t.length)throw new TypeError("Invalid path '"+e+"'");return t[1]=t[1]||"",t[2]=t[2]||"",t[3]=t[3]||"",{root:t[0],dir:t[0]+t[1].slice(0,t[1].length-1),base:t[2],ext:t[3],name:t[2].slice(0,t[2].length-t[3].length)}},l.sep="/",l.delimiter=":",e.exports=l}).call(this,n(14))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(114);!function(e){function t(e){return 0===e.indexOf("/")&&(e=e.slice(1)),e}e.join=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return"."===r.join.apply(r,e)?"":t(r.join.apply(r,e))},e.basename=function(e,t){return r.basename(e,t)},e.dirname=function(e){var n=t(r.dirname(e));return"."===n?"":n},e.extname=function(e){return r.extname(e)},e.normalize=function(e){return""===e?"":t(r.normalize(e))},e.resolve=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t(r.resolve.apply(r,e))},e.relative=function(e,n){return t(r.relative(e,n))},e.normalizeExtension=function(e){return e.length>0&&0!==e.indexOf(".")&&(e="."+e),e},e.removeSlash=t}(t.PathExt||(t.PathExt={}))},function(e,t,n){"use strict";(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(e){return r.exec(e).slice(1)};function o(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}t.resolve=function(){for(var t="",r=!1,i=arguments.length-1;i>=-1&&!r;i--){var a=i>=0?arguments[i]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,r="/"===a.charAt(0))}return t=n(o(t.split("/"),function(e){return!!e}),!r).join("/"),(r?"/":"")+t||"."},t.normalize=function(e){var r=t.isAbsolute(e),i="/"===a(e,-1);return(e=n(o(e.split("/"),function(e){return!!e}),!r).join("/"))||r||(e="."),e&&i&&(e+="/"),(r?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(o(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,l=0;l<a;l++)if(i[l]!==o[l]){s=l;break}var c=[];for(l=s;l<i.length;l++)c.push("..");return(c=c.concat(o.slice(s))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=i(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=i(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return i(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n(14))},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function i(e){return decodeURIComponent(e.replace(/\+/g," "))}t.stringify=function(e,t){t=t||"";var n=[];for(var i in"string"!=typeof t&&(t="?"),e)r.call(e,i)&&n.push(encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return n.length?t+n.join("&"):""},t.parse=function(e){for(var t,n=/([^=?&]+)=?([^&]*)/g,r={};t=n.exec(e);r[i(t[1])]=i(t[2]));return r}},function(e,t,n){"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},function(e,t,n){"use strict";(function(t){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=n(118),o=n(117),a=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,l=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],c={hash:1,query:1};function u(e){var n,i={},o=void 0===(e=e||t.location||{})?"undefined":r(e);if("blob:"===e.protocol)i=new f(unescape(e.pathname),{});else if("string"===o)for(n in i=new f(e,{}),c)delete i[n];else if("object"===o){for(n in e)n in c||(i[n]=e[n]);void 0===i.slashes&&(i.slashes=s.test(e.href))}return i}function d(e){var t=a.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function f(e,t,n){if(!(this instanceof f))return new f(e,t,n);var a,s,c,h,p,m,g=l.slice(),v=void 0===t?"undefined":r(t),y=this,b=0;for("object"!==v&&"string"!==v&&(n=t,t=null),n&&"function"!=typeof n&&(n=o.parse),t=u(t),a=!(s=d(e||"")).protocol&&!s.slashes,y.slashes=s.slashes||a&&t.slashes,y.protocol=s.protocol||t.protocol||"",e=s.rest,s.slashes||(g[2]=[/(.*)/,"pathname"]);b<g.length;b++)c=(h=g[b])[0],m=h[1],c!=c?y[m]=e:"string"==typeof c?~(p=e.indexOf(c))&&("number"==typeof h[2]?(y[m]=e.slice(0,p),e=e.slice(p+h[2])):(y[m]=e.slice(p),e=e.slice(0,p))):(p=c.exec(e))&&(y[m]=p[1],e=e.slice(0,p.index)),y[m]=y[m]||a&&h[3]&&t[m]||"",h[4]&&(y[m]=y[m].toLowerCase());n&&(y.query=n(y.query)),a&&t.slashes&&"/"!==y.pathname.charAt(0)&&(""!==y.pathname||""!==t.pathname)&&(y.pathname=function(e,t){for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,i=n[r-1],o=!1,a=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),a++):a&&(0===r&&(o=!0),n.splice(r,1),a--);return o&&n.unshift(""),"."!==i&&".."!==i||n.push(""),n.join("/")}(y.pathname,t.pathname)),i(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(h=y.auth.split(":"),y.username=h[0]||"",y.password=h[1]||""),y.origin=y.protocol&&y.host&&"file:"!==y.protocol?y.protocol+"//"+y.host:"null",y.href=y.toString()}f.prototype={set:function(e,t,n){var r=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||o.parse)(t)),r[e]=t;break;case"port":r[e]=t,i(t,r.protocol)?t&&(r.host=r.hostname+":"+t):(r.host=r.hostname,r[e]="");break;case"hostname":r[e]=t,r.port&&(t+=":"+r.port),r.host=t;break;case"host":r[e]=t,/:\d+$/.test(t)?(t=t.split(":"),r.port=t.pop(),r.hostname=t.join(":")):(r.hostname=t,r.port="");break;case"protocol":r.protocol=t.toLowerCase(),r.slashes=!n;break;case"pathname":r.pathname=t.length&&"/"!==t.charAt(0)?"/"+t:t;break;default:r[e]=t}for(var a=0;a<l.length;a++){var s=l[a];s[4]&&(r[s[1]]=r[s[1]].toLowerCase())}return r.origin=r.protocol&&r.host&&"file:"!==r.protocol?r.protocol+"//"+r.host:"null",r.href=r.toString(),r},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,n=this,i=n.protocol;i&&":"!==i.charAt(i.length-1)&&(i+=":");var a=i+(n.slashes?"//":"");return n.username&&(a+=n.username,n.password&&(a+=":"+n.password),a+="@"),a+=n.host+n.pathname,(t="object"===r(n.query)?e(n.query):n.query)&&(a+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(a+=n.hash),a}},f.extractProtocol=d,f.location=u,f.qs=o,e.exports=f}).call(this,n(7))},function(e,t,n){"use strict";function r(e){return"number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}e.exports=function(e,t){t||(t={});var n={bools:{},strings:{},unknownFn:null};"function"==typeof t.unknown&&(n.unknownFn=t.unknown),"boolean"==typeof t.boolean&&t.boolean?n.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(e){n.bools[e]=!0});var i={};Object.keys(t.alias||{}).forEach(function(e){i[e]=[].concat(t.alias[e]),i[e].forEach(function(t){i[t]=[e].concat(i[e].filter(function(e){return t!==e}))})}),[].concat(t.string).filter(Boolean).forEach(function(e){n.strings[e]=!0,i[e]&&(n.strings[i[e]]=!0)});var o=t.default||{},a={_:[]};Object.keys(n.bools).forEach(function(e){l(e,void 0!==o[e]&&o[e])});var s=[];function l(e,t,o){if(!o||!n.unknownFn||function(e,t){return n.allBools&&/^--[^=]+$/.test(t)||n.strings[e]||n.bools[e]||i[e]}(e,o)||!1!==n.unknownFn(o)){var s=!n.strings[e]&&r(t)?Number(t):t;c(a,e.split("."),s),(i[e]||[]).forEach(function(e){c(a,e.split("."),s)})}}function c(e,t,r){var i=e;t.slice(0,-1).forEach(function(e){void 0===i[e]&&(i[e]={}),i=i[e]});var o=t[t.length-1];void 0===i[o]||n.bools[o]||"boolean"==typeof i[o]?i[o]=r:Array.isArray(i[o])?i[o].push(r):i[o]=[i[o],r]}function u(e){return i[e].some(function(e){return n.bools[e]})}-1!==e.indexOf("--")&&(s=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var d=0;d<e.length;d++){var f=e[d];if(/^--.+=/.test(f)){var h=f.match(/^--([^=]+)=([\s\S]*)$/),p=h[1],m=h[2];n.bools[p]&&(m="false"!==m),l(p,m,f)}else if(/^--no-.+/.test(f))l(p=f.match(/^--no-(.+)/)[1],!1,f);else if(/^--.+/.test(f))p=f.match(/^--(.+)/)[1],void 0===(b=e[d+1])||/^-/.test(b)||n.bools[p]||n.allBools||i[p]&&u(p)?/^(true|false)$/.test(b)?(l(p,"true"===b,f),d++):l(p,!n.strings[p]||"",f):(l(p,b,f),d++);else if(/^-[^-]+/.test(f)){for(var g=f.slice(1,-1).split(""),v=!1,y=0;y<g.length;y++){var b;if("-"!==(b=f.slice(y+2))){if(/[A-Za-z]/.test(g[y])&&/=/.test(b)){l(g[y],b.split("=")[1],f),v=!0;break}if(/[A-Za-z]/.test(g[y])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(b)){l(g[y],b,f),v=!0;break}if(g[y+1]&&g[y+1].match(/\W/)){l(g[y],f.slice(y+2),f),v=!0;break}l(g[y],!n.strings[g[y]]||"",f)}else l(g[y],b,f)}p=f.slice(-1)[0],v||"-"===p||(!e[d+1]||/^(-|--)[^-]/.test(e[d+1])||n.bools[p]||i[p]&&u(p)?e[d+1]&&/true|false/.test(e[d+1])?(l(p,"true"===e[d+1],f),d++):l(p,!n.strings[p]||"",f):(l(p,e[d+1],f),d++))}else if(n.unknownFn&&!1===n.unknownFn(f)||a._.push(n.strings._||!r(f)?f:Number(f)),t.stopEarly){a._.push.apply(a._,e.slice(d+1));break}}return Object.keys(o).forEach(function(e){var t,n,r;t=a,n=e.split("."),r=t,n.slice(0,-1).forEach(function(e){r=r[e]||{}}),n[n.length-1]in r||(c(a,e.split("."),o[e]),(i[e]||[]).forEach(function(t){c(a,t.split("."),o[e])}))}),t["--"]?(a["--"]=new Array,s.forEach(function(e){a["--"].push(e)})):s.forEach(function(e){a._.push(e)}),a}},function(module,exports,__webpack_require__){"use strict";(function(process){Object.defineProperty(exports,"__esModule",{value:!0});var coreutils_1=__webpack_require__(5),minimist=__webpack_require__(120),url_1=__webpack_require__(51),PageConfig,Private;!function(PageConfig){function getOption(name){if(configData)return configData[name]||Private.getBodyData(name);configData=Object.create(null);var found=!1;if("undefined"!=typeof document){var el=document.getElementById("jupyter-config-data");el&&(configData=JSON.parse(el.textContent||""),found=!0)}if(!found&&void 0!==process)try{var cli=minimist(process.argv.slice(2));if("jupyter-config-data"in cli){var path=__webpack_require__(116),fullPath=path.resolve(cli["jupyter-config-data"]);configData=eval("require")(fullPath)}}catch(e){console.error(e)}if(coreutils_1.JSONExt.isObject(configData))for(var key in configData)configData[key]=String(configData[key]).split("'").join('"');else configData=Object.create(null);return configData[name]||""}function setOption(e,t){var n=getOption(e);return configData[e]=t,n}function getBaseUrl(){var e=getOption("baseUrl");return e&&"/"!==e||(e="undefined"==typeof location?"http://localhost:8888/":location.origin+"/"),url_1.URLExt.parse(e).toString()}function getTreeUrl(){return url_1.URLExt.join(getBaseUrl(),getOption("pageUrl"),"tree")}function getWsUrl(e){var t=getOption("wsUrl");return t||(0!==(e=e||getBaseUrl()).indexOf("http")&&(e="undefined"!=typeof location?url_1.URLExt.join(location.origin,e):url_1.URLExt.join("http://localhost:8888/",e)),t="ws"+e.slice(4)),url_1.URLExt.parse(t).toString()}function getToken(){return getOption("token")||Private.getBodyData("jupyterApiToken")}PageConfig.getOption=getOption,PageConfig.setOption=setOption,PageConfig.getBaseUrl=getBaseUrl,PageConfig.getTreeUrl=getTreeUrl,PageConfig.getWsUrl=getWsUrl,PageConfig.getToken=getToken;var configData=null}(PageConfig=exports.PageConfig||(exports.PageConfig={})),(Private||(Private={})).getBodyData=function(e){if("undefined"==typeof document||!document.body)return"";var t=document.body.dataset[e];return void 0===t?"":decodeURIComponent(t)}}).call(this,__webpack_require__(14))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(52);(t.UUID||(t.UUID={})).uuid4=function(){for(var e=new Uint8Array(16),t=new Array(256),n=0;n<16;++n)t[n]="0"+n.toString(16);for(n=16;n<256;++n)t[n]=n.toString(16);return function(){return r.Random.getRandomValues(e),e[6]=64|15&e[6],e[8]=128|63&e[8],t[e[0]]+t[e[1]]+t[e[2]]+t[e[3]]+"-"+t[e[4]]+t[e[5]]+"-"+t[e[6]]+t[e[7]]+"-"+t[e[8]]+t[e[9]]+"-"+t[e[10]]+t[e[11]]+t[e[12]]+t[e[13]]+t[e[14]]+t[e[15]]}}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){this.name=e,this._tokenStructuralPropertyT=null};t.Token=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){var e=this;this.promise=new Promise(function(t,n){e._resolve=t,e._reject=n})}return e.prototype.resolve=function(e){(0,this._resolve)(e)},e.prototype.reject=function(e){(0,this._reject)(e)},e}();t.PromiseDelegate=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this._types=[],this._values=[]}return e.prototype.types=function(){return this._types.slice()},e.prototype.hasData=function(e){return-1!==this._types.indexOf(e)},e.prototype.getData=function(e){var t=this._types.indexOf(e);return-1!==t?this._values[t]:void 0},e.prototype.setData=function(e,t){this.clearData(e),this._types.push(e),this._values.push(t)},e.prototype.clearData=function(e){var t=this._types.indexOf(e);-1!==t&&(this._types.splice(t,1),this._values.splice(t,1))},e.prototype.clear=function(){this._types.length=0,this._values.length=0},e}();t.MimeData=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){function t(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e}function n(e){return Array.isArray(e)}e.emptyObject=Object.freeze({}),e.emptyArray=Object.freeze([]),e.isPrimitive=t,e.isArray=n,e.isObject=function(e){return!t(e)&&!n(e)},e.deepEqual=function e(r,i){if(r===i)return!0;if(t(r)||t(i))return!1;var o=n(r),a=n(i);return o===a&&(o&&a?function(t,n){if(t===n)return!0;if(t.length!==n.length)return!1;for(var r=0,i=t.length;r<i;++r)if(!e(t[r],n[r]))return!1;return!0}(r,i):function(t,n){if(t===n)return!0;for(var r in t)if(!(r in n))return!1;for(var r in n)if(!(r in t))return!1;for(var r in t)if(!e(t[r],n[r]))return!1;return!0}(r,i))},e.deepCopy=function e(r){return t(r)?r:n(r)?function(t){for(var n=new Array(t.length),r=0,i=t.length;r<i;++r)n[r]=e(t[r]);return n}(r):function(t){var n={};for(var r in t)n[r]=e(t[r]);return n}(r)}}(t.JSONExt||(t.JSONExt={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5);!function(e){e.MAJOR_VERSION=4,e.MINOR_VERSION=2,e.validateMimeValue=function(e,t){var n="application/json"===e||/^application\/(.*?)+\+json$/.test(e),i=function(e){return"[object String]"===Object.prototype.toString.call(e)};if(Array.isArray(t)){if(n)return!1;var o=!0;return t.forEach(function(e){i(e)||(o=!1)}),o}return i(t)?!n:!!n&&r.JSONExt.isObject(t)},e.isRaw=function(e){return"raw"===e.cell_type},e.isMarkdown=function(e){return"markdown"===e.cell_type},e.isCode=function(e){return"code"===e.cell_type},e.isExecuteResult=function(e){return"execute_result"===e.output_type},e.isDisplayData=function(e){return"display_data"===e.output_type},e.isDisplayUpdate=function(e){return"update_display_data"===e.output_type},e.isStream=function(e){return"stream"===e.output_type},e.isError=function(e){return"error"===e.output_type}}(t.nbformat||(t.nbformat={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.CODE_BLOCK_MARKER="```";var t=[".markdown",".mdown",".mkdn",".md",".mkd",".mdwn",".mdtxt",".mdtext",".text",".txt",".Rmd"],n=function(e){this.startLine=e,this.code="",this.endLine=-1};e.MarkdownCodeBlock=n,e.isMarkdown=function(e){return t.indexOf(e)>-1},e.findMarkdownCodeBlocks=function(t){if(!t||""===t)return[];for(var r=t.split("\n"),i=[],o=null,a=0;a<r.length;a++){var s=r[a],l=0===s.indexOf(e.CODE_BLOCK_MARKER),c=null!=o;if(l||c)if(c)o&&(l?(o.endLine=a-1,i.push(o),o=null):o.code+=s+"\n");else{o=new n(a);var u=s.indexOf(e.CODE_BLOCK_MARKER),d=s.lastIndexOf(e.CODE_BLOCK_MARKER);u!==d&&(o.code=s.substring(u+e.CODE_BLOCK_MARKER.length,d),o.endLine=a,i.push(o),o=null)}}return i}}(t.MarkdownCodeBlocks||(t.MarkdownCodeBlocks={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.remove=function(e){return Promise.reject(new Error("Removing has not been implemented."))},e.prototype.save=function(e,t){return Promise.reject(new Error("Saving has not been implemented."))},e}();t.DataConnector=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(){function e(e){this._timer=-1,this._timeout=-1,this._isDisposed=!1,this._activityStopped=new r.Signal(this),e.signal.connect(this._onSignalFired,this),this._timeout=e.timeout||1e3}return Object.defineProperty(e.prototype,"activityStopped",{get:function(){return this._activityStopped},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"timeout",{get:function(){return this._timeout},set:function(e){this._timeout=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this))},e.prototype._onSignalFired=function(e,t){var n=this;clearTimeout(this._timer),this._sender=e,this._args=t,this._timer=window.setTimeout(function(){n._activityStopped.emit({sender:n._sender,args:n._args})},this._timeout)},e}();t.ActivityMonitor=i},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=n(11),a="api/config";(t.ConfigSection||(t.ConfigSection={})).create=function(e){var t=new s(e);return t.load().then(function(){return t})};var s=function(){function e(e){this._url="unknown";var t=this.serverSettings=e.serverSettings||o.ServerConnection.makeSettings();this._url=i.URLExt.join(t.baseUrl,a,encodeURIComponent(e.name))}return Object.defineProperty(e.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),e.prototype.load=function(){var e=this;return o.ServerConnection.makeRequest(this._url,{},this.serverSettings).then(function(e){if(200!==e.status)throw new o.ServerConnection.ResponseError(e);return e.json()}).then(function(t){e._data=t})},e.prototype.update=function(e){var t=this;this._data=r({},this._data,e);var n={method:"PATCH",body:JSON.stringify(e)};return o.ServerConnection.makeRequest(this._url,n,this.serverSettings).then(function(e){if(200!==e.status)throw new o.ServerConnection.ResponseError(e);return e.json()}).then(function(e){return t._data=e,t._data})},e}(),l=function(){function e(e){this._className="",this._section=e.section,this._defaults=e.defaults||{},this._className=e.className||""}return e.prototype.get=function(e){var t=this._classData();return e in t?t[e]:this._defaults[e]},e.prototype.set=function(e,t){var n={};if(n[e]=t,this._className){var r={};return r[this._className]=n,this._section.update(r)}return this._section.update(n)},e.prototype._classData=function(){var e=this._section.data;return this._className&&this._className in e?e[this._className]:e},e}();t.ConfigWithDefaults=l},function(e,t,n){"use strict"},function(e,t,n){"use strict"},function(e,t,n){"use strict"},function(e,t,n){"use strict"},function(e,t,n){"use strict"},function(e,t,n){"use strict"},function(e,t,n){"use strict";var r,i=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),a=n(13),s=n(26),l=n(12),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._widget=null,t}return i(t,e),t.prototype.dispose=function(){if(this._widget){var t=this._widget;this._widget=null,t.dispose()}e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"widget",{get:function(){return this._widget},set:function(e){this._widget!==e&&(this._widget&&this._widget.dispose(),this._widget=e,this.parent&&e&&this.attachWidget(e))},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return this._widget?o.once(this._widget):o.empty()},t.prototype.removeWidget=function(e){this._widget===e&&(this._widget=null,this.parent&&this.detachWidget(e))},t.prototype.init=function(){var t=this;e.prototype.init.call(this),o.each(this,function(e){t.attachWidget(e)})},t.prototype.attachWidget=function(e){this.parent.isAttached&&a.MessageLoop.sendMessage(e,l.Widget.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&a.MessageLoop.sendMessage(e,l.Widget.Msg.AfterAttach)},t.prototype.detachWidget=function(e){this.parent.isAttached&&a.MessageLoop.sendMessage(e,l.Widget.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&a.MessageLoop.sendMessage(e,l.Widget.Msg.AfterDetach)},t}(s.Layout);t.SingletonLayout=c},function(e,t,n){"use strict"},function(e,t,n){"use strict";var r,i=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o,a=n(53),s=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.addClass("p-Panel"),n.layout=o.createLayout(t),n}return i(t,e),Object.defineProperty(t.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),t.prototype.addWidget=function(e){this.layout.addWidget(e)},t.prototype.insertWidget=function(e,t){this.layout.insertWidget(e,t)},t}(n(12).Widget);t.Panel=s,(o||(o={})).createLayout=function(e){return e.layout||new a.PanelLayout}},function(e,t,n){"use strict"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(3),o=function(){function e(){this._first=null,this._last=null,this._length=0}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this._length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"first",{get:function(){return this._first?this._first.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){return this._last?this._last.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstNode",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastNode",{get:function(){return this._last},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return new e.ForwardValueIterator(this._first)},e.prototype.retro=function(){return new e.RetroValueIterator(this._last)},e.prototype.nodes=function(){return new e.ForwardNodeIterator(this._first)},e.prototype.retroNodes=function(){return new e.RetroNodeIterator(this._last)},e.prototype.addFirst=function(e){var t=new r.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._length++,t},e.prototype.addLast=function(e){var t=new r.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t,this._last=t):(this._first=t,this._last=t),this._length++,t},e.prototype.insertBefore=function(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof r.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");var n=new r.LinkedListNode(this,e),i=t,o=i.prev;return n.next=i,n.prev=o,i.prev=n,o.next=n,this._length++,n},e.prototype.insertAfter=function(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof r.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");var n=new r.LinkedListNode(this,e),i=t,o=i.next;return n.next=o,n.prev=i,i.next=n,o.prev=n,this._length++,n},e.prototype.removeFirst=function(){var e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._length--,e.value},e.prototype.removeLast=function(){var e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._length--,e.value},e.prototype.removeNode=function(e){if(!(e instanceof r.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");var t=e;t===this._first&&t===this._last?(this._first=null,this._last=null):t===this._first?(this._first=t.next,this._first.prev=null):t===this._last?(this._last=t.prev,this._last.next=null):(t.next.prev=t.prev,t.prev.next=t.next),t.list=null,t.next=null,t.prev=null,this._length--},e.prototype.clear=function(){for(var e=this._first;e;){var t=e.next;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._length=0},e}();t.LinkedList=o,function(e){e.from=function(t){var n=new e;return i.each(t,function(e){n.addLast(e)}),n};var t=function(){function e(e){this._node=e}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._node)},e.prototype.next=function(){if(this._node){var e=this._node;return this._node=e.next,e.value}},e}();e.ForwardValueIterator=t;var n=function(){function e(e){this._node=e}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._node)},e.prototype.next=function(){if(this._node){var e=this._node;return this._node=e.prev,e.value}},e}();e.RetroValueIterator=n;var r=function(){function e(e){this._node=e}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._node)},e.prototype.next=function(){if(this._node){var e=this._node;return this._node=e.next,e}},e}();e.ForwardNodeIterator=r;var o=function(){function e(e){this._node=e}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._node)},e.prototype.next=function(){if(this._node){var e=this._node;return this._node=e.prev,e}},e}();e.RetroNodeIterator=o}(o=t.LinkedList||(t.LinkedList={})),t.LinkedList=o,function(e){var t=function(e,t){this.list=null,this.next=null,this.prev=null,this.list=e,this.value=t};(r||(r={})).LinkedListNode=t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(142))},function(e,t,n){"use strict"},function(e,t,n){"use strict";(function(e,t){!function(e,n){if(!e.setImmediate){var r,i,o,a,s,l=1,c={},u=!1,d=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){p(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){o.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(i=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)},f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return c[l]=i,r(l),l++},f.clearImmediate=h}function h(e){delete c[e]}function p(e){if(u)setTimeout(p,0,e);else{var t=c[e];if(t){u=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{h(e),u=!1}}}}}("undefined"==typeof self?void 0===e?void 0:e:self)}).call(this,n(7),n(14))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=n(2),o=function(){function e(){this._counter=0,this._widgets=[],this._activeWidget=null,this._currentWidget=null,this._numbers=new Map,this._nodes=new Map,this._activeChanged=new i.Signal(this),this._currentChanged=new i.Signal(this)}return e.prototype.dispose=function(){var e=this;this._counter<0||(this._counter=-1,i.Signal.clearData(this),r.each(this._widgets,function(t){t.node.removeEventListener("focus",e,!0),t.node.removeEventListener("blur",e,!0)}),this._activeWidget=null,this._currentWidget=null,this._nodes.clear(),this._numbers.clear(),this._widgets.length=0)},Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeChanged",{get:function(){return this._activeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._counter<0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentWidget",{get:function(){return this._currentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeWidget",{get:function(){return this._activeWidget},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),e.prototype.focusNumber=function(e){var t=this._numbers.get(e);return void 0===t?-1:t},e.prototype.has=function(e){return this._numbers.has(e)},e.prototype.add=function(e){if(!this._numbers.has(e)){var t=e.node.contains(document.activeElement),n=t?this._counter++:-1;this._widgets.push(e),this._numbers.set(e,n),this._nodes.set(e.node,e),e.node.addEventListener("focus",this,!0),e.node.addEventListener("blur",this,!0),e.disposed.connect(this._onWidgetDisposed,this),t&&this._setWidgets(e,e)}},e.prototype.remove=function(e){var t=this;if(this._numbers.has(e)&&(e.disposed.disconnect(this._onWidgetDisposed,this),e.node.removeEventListener("focus",this,!0),e.node.removeEventListener("blur",this,!0),r.ArrayExt.removeFirstOf(this._widgets,e),this._nodes.delete(e.node),this._numbers.delete(e),this._currentWidget===e)){var n=r.filter(this._widgets,function(e){return-1!==t._numbers.get(e)}),i=r.max(n,function(e,n){return t._numbers.get(e)-t._numbers.get(n)})||null;this._setWidgets(i,null)}},e.prototype.handleEvent=function(e){switch(e.type){case"focus":this._evtFocus(e);break;case"blur":this._evtBlur(e)}},e.prototype._setWidgets=function(e,t){var n=this._currentWidget;this._currentWidget=e;var r=this._activeWidget;this._activeWidget=t,n!==e&&this._currentChanged.emit({oldValue:n,newValue:e}),r!==t&&this._activeChanged.emit({oldValue:r,newValue:t})},e.prototype._evtFocus=function(e){var t=this._nodes.get(e.currentTarget);t!==this._currentWidget&&this._numbers.set(t,this._counter++),this._setWidgets(t,t)},e.prototype._evtBlur=function(e){var t=this._nodes.get(e.currentTarget),n=e.relatedTarget;n&&(t.node.contains(n)||r.find(this._widgets,function(e){return e.node.contains(n)}))||this._setWidgets(this._currentWidget,null)},e.prototype._onWidgetDisposed=function(e){this.remove(e)},e}();t.FocusTracker=o},function(e,t,n){"use strict"},function(e,t,n){"use strict"},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.calculateSpecificity=function(e){if(e in r.specificityCache)return r.specificityCache[e];var t=r.calculateSingle(e);return r.specificityCache[e]=t},e.isValid=function(e){if(e in r.validityCache)return r.validityCache[e];var t=!0;try{r.testElem.querySelector(e)}catch(e){t=!1}return r.validityCache[e]=t},e.matches=function(e,t){return r.protoMatchFunc.call(e,t)}}(t.Selector||(t.Selector={})),function(e){var t;e.specificityCache=Object.create(null),e.validityCache=Object.create(null),e.testElem=document.createElement("div"),e.protoMatchFunc=(t=Element.prototype).matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector||function(e){var t=this.ownerDocument.querySelectorAll(e);return-1!==Array.prototype.indexOf.call(t,this)},e.calculateSingle=function(e){var t=0,u=0,d=0;function f(t){var n=e.match(t);return null!==n&&(e=e.slice(n[0].length),!0)}for(e=(e=e.split(",",1)[0]).replace(c," $1 ");e.length>0;)if(f(n))t++;else if(f(r))u++;else if(f(i))u++;else if(f(a))d++;else if(f(s))u++;else if(f(o))d++;else if(!f(l))return 0;return(t=Math.min(t,255))<<16|(u=Math.min(u,255))<<8|Math.min(d,255)};var n=/^#[^\s\+>~#\.\[:]+/,r=/^\.[^\s\+>~#\.\[:]+/,i=/^\[[^\]]+\]/,o=/^[^\s\+>~#\.\[:]+/,a=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,s=/^:[^\s\+>~#\.\[:]+/,l=/^[\s\+>~\*]+/,c=/:not\(([^\)]+)\)/g}(r||(r={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.IS_MAC=!!navigator.platform.match(/Mac/i),e.IS_WIN=!!navigator.platform.match(/Win/i),e.IS_IE=/Trident/.test(navigator.userAgent),e.IS_EDGE=/Edge/.test(navigator.userAgent)}(t.Platform||(t.Platform={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.boxSizing=function(e){var t=window.getComputedStyle(e),n=parseFloat(t.borderTopWidth)||0,r=parseFloat(t.borderLeftWidth)||0,i=parseFloat(t.borderRightWidth)||0,o=parseFloat(t.borderBottomWidth)||0,a=parseFloat(t.paddingTop)||0,s=parseFloat(t.paddingLeft)||0,l=parseFloat(t.paddingRight)||0,c=parseFloat(t.paddingBottom)||0;return{borderTop:n,borderLeft:r,borderRight:i,borderBottom:o,paddingTop:a,paddingLeft:s,paddingRight:l,paddingBottom:c,horizontalSum:r+s+l+i,verticalSum:n+a+c+o}},e.sizeLimits=function(e){var t=window.getComputedStyle(e),n=parseFloat(t.minWidth)||0,r=parseFloat(t.minHeight)||0,i=parseFloat(t.maxWidth)||1/0,o=parseFloat(t.maxHeight)||1/0;return{minWidth:n,minHeight:r,maxWidth:i=Math.max(n,i),maxHeight:o=Math.max(r,o)}},e.hitTest=function(e,t,n){var r=e.getBoundingClientRect();return t>=r.left&&t<r.right&&n>=r.top&&n<r.bottom},e.scrollIntoViewIfNeeded=function(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.top<=n.top&&r.bottom>=n.bottom||(r.top<n.top&&r.height<=n.height?e.scrollTop-=n.top-r.top:r.bottom>n.bottom&&r.height>=n.height?e.scrollTop-=n.top-r.top:r.top<n.top&&r.height>n.height?e.scrollTop-=n.bottom-r.bottom:r.bottom>n.bottom&&r.height<n.height&&(e.scrollTop-=n.bottom-r.bottom))}}(t.ElementExt||(t.ElementExt={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new i(e.map(r.iter))};var i=function(){function e(e){this._source=e}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._source.map(function(e){return e.clone()}))},e.prototype.next=function(){for(var e=new Array(this._source.length),t=0,n=this._source.length;t<n;++t){var r=this._source[t].next();if(void 0===r)return;e[t]=r}return e},e}();t.ZipIterator=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6);t.take=function(e,t){return new i(r.iter(e),t)};var i=function(){function e(e,t){this._source=e,this._count=t}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._source.clone(),this._count)},e.prototype.next=function(){if(!(this._count<=0)){var e=this._source.next();if(void 0!==e)return this._count--,e}},e}();t.TakeIterator=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){function t(e,t,n){void 0===n&&(n=0);for(var r=new Array(t.length),i=0,o=n,a=t.length;i<a;++i,++o){if(-1===(o=e.indexOf(t[i],o)))return null;r[i]=o}return r}e.findIndices=t,e.matchSumOfSquares=function(e,n,r){void 0===r&&(r=0);var i=t(e,n,r);if(!i)return null;for(var o=0,a=0,s=i.length;a<s;++a){var l=i[a]-r;o+=l*l}return{score:o,indices:i}},e.matchSumOfDeltas=function(e,n,r){void 0===r&&(r=0);var i=t(e,n,r);if(!i)return null;for(var o=0,a=r-1,s=0,l=i.length;s<l;++s){var c=i[s];o+=c-a-1,a=c}return{score:o,indices:i}},e.highlight=function(e,t,n){for(var r=[],i=0,o=0,a=t.length;i<a;){for(var s=t[i],l=t[i];++i<a&&t[i]===l+1;)l++;o<s&&r.push(e.slice(o,s)),s<l+1&&r.push(n(e.slice(s,l+1))),o=l+1}return o<e.length&&r.push(e.slice(o)),r}}(t.StringExt||(t.StringExt={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6);t.stride=function(e,t){return new i(r.iter(e),t)};var i=function(){function e(e,t){this._source=e,this._step=t}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._source.clone(),this._step)},e.prototype.next=function(){for(var e=this._source.next(),t=this._step-1;t>0;--t)this._source.next();return e},e}();t.StrideIterator=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6);t.topologicSort=function(e){var t=[],n=new Set,i=new Map;return r.each(e,function(e){var t=e[0],n=e[1],r=i.get(n);r?r.push(t):i.set(n,[t])}),i.forEach(function(e,t){o(t)}),t;function o(e){if(!n.has(e)){n.add(e);var r=i.get(e);r&&r.forEach(o),t.push(e)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retro=function(e){return"function"==typeof e.retro?e.retro():new r(e)};var r=function(){function e(e){this._source=e,this._index=e.length-1}return e.prototype.iter=function(){return this},e.prototype.clone=function(){var t=new e(this._source);return t._index=this._index,t},e.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},e}();t.RetroArrayIterator=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeat=function(e,t){return new r(e,t)},t.once=function(e){return new r(e,1)};var r=function(){function e(e,t){this._value=e,this._count=t}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._value,this._count)},e.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},e}();t.RepeatIterator=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6);t.reduce=function(e,t,n){var i=0,o=r.iter(e),a=o.next();if(void 0===a&&void 0===n)throw new TypeError("Reduce of empty iterable with no initial value.");if(void 0===a)return n;var s,l,c=o.next();if(void 0===c&&void 0===n)return a;if(void 0===c)return t(n,a,i++);for(s=t(void 0===n?a:t(n,a,i++),c,i++);void 0!==(l=o.next());)s=t(s,l,i++);return s}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.range=function(e,t,n){return void 0===t?new i(0,e,1):new i(e,t,void 0===n?1:n)};var r,i=function(){function e(e,t,n){this._index=0,this._start=e,this._stop=t,this._step=n,this._length=r.rangeLength(e,t,n)}return e.prototype.iter=function(){return this},e.prototype.clone=function(){var t=new e(this._start,this._stop,this._step);return t._index=this._index,t},e.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},e}();t.RangeIterator=i,(r||(r={})).rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0?0:e<t&&n<0?0:Math.ceil((t-e)/n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6);t.map=function(e,t){return new i(r.iter(e),t)};var i=function(){function e(e,t){this._index=0,this._source=e,this._fn=t}return e.prototype.iter=function(){return this},e.prototype.clone=function(){var t=new e(this._source.clone(),this._fn);return t._index=this._index,t},e.prototype.next=function(){var e=this._source.next();if(void 0!==e)return this._fn.call(void 0,e,this._index++)},e}();t.MapIterator=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6);t.find=function(e,t){for(var n,i=0,o=r.iter(e);void 0!==(n=o.next());)if(t(n,i++))return n},t.min=function(e,t){var n=r.iter(e),i=n.next();if(void 0!==i){for(var o=i;void 0!==(i=n.next());)t(i,o)<0&&(o=i);return o}},t.max=function(e,t){var n=r.iter(e),i=n.next();if(void 0!==i){for(var o=i;void 0!==(i=n.next());)t(i,o)>0&&(o=i);return o}},t.minmax=function(e,t){var n=r.iter(e),i=n.next();if(void 0!==i){for(var o=i,a=i;void 0!==(i=n.next());)t(i,o)<0?o=i:t(i,a)>0&&(a=i);return[o,a]}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6);t.filter=function(e,t){return new i(r.iter(e),t)};var i=function(){function e(e,t){this._index=0,this._source=e,this._fn=t}return e.prototype.iter=function(){return this},e.prototype.clone=function(){var t=new e(this._source.clone(),this._fn);return t._index=this._index,t},e.prototype.next=function(){for(var e,t=this._fn,n=this._source;void 0!==(e=n.next());)if(t(e,this._index++))return e},e}();t.FilterIterator=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.empty=function(){return new r};var r=function(){function e(){}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e},e.prototype.next=function(){},e}();t.EmptyIterator=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6);t.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new i(r.iter(e.map(r.iter)))};var i=function(){function e(e){this._cloned=!1,this._source=e,this._active=void 0}return e.prototype.iter=function(){return this},e.prototype.clone=function(){var t=new e(this._source.clone());return t._active=this._active&&this._active.clone(),t._cloned=!0,this._cloned=!0,t},e.prototype.next=function(){if(void 0===this._active){var e=this._source.next();if(void 0===e)return;this._active=this._cloned?e.clone():e}var t=this._active.next();return void 0!==t?t:(this._active=void 0,this.next())},e}();t.ChainIterator=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){function t(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var i,o=e.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),i=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))<n?r+1+(o-n):r-n+1;for(var a=0;a<i;++a){var s=(n+a)%o;if(e[s]===t)return s}return-1}function n(e,t,n,r){void 0===n&&(n=-1),void 0===r&&(r=0);var i,o=e.length;if(0===o)return-1;i=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(r=r<0?Math.max(0,r+o):Math.min(r,o-1))?n+1+(o-r):n-r+1;for(var a=0;a<i;++a){var s=(n-a+o)%o;if(e[s]===t)return s}return-1}function r(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var i,o=e.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),i=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))<n?r+1+(o-n):r-n+1;for(var a=0;a<i;++a){var s=(n+a)%o;if(t(e[s],s))return s}return-1}function i(e,t,n,r){void 0===n&&(n=-1),void 0===r&&(r=0);var i,o=e.length;if(0===o)return-1;i=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(r=r<0?Math.max(0,r+o):Math.min(r,o-1))?n+1+(o-r):n-r+1;for(var a=0;a<i;++a){var s=(n-a+o)%o;if(t(e[s],s))return s}return-1}function o(e,t,n){void 0===t&&(t=0),void 0===n&&(n=-1);var r=e.length;if(!(r<=1))for(t=t<0?Math.max(0,t+r):Math.min(t,r-1),n=n<0?Math.max(0,n+r):Math.min(n,r-1);t<n;){var i=e[t],o=e[n];e[t++]=o,e[n--]=i}}function a(e,t){var n=e.length;if(t<0&&(t+=n),!(t<0||t>=n)){for(var r=e[t],i=t+1;i<n;++i)e[i-1]=e[i];return e.length=n-1,r}}e.firstIndexOf=t,e.lastIndexOf=n,e.findFirstIndex=r,e.findLastIndex=i,e.findFirstValue=function(e,t,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var o=r(e,t,n,i);return-1!==o?e[o]:void 0},e.findLastValue=function(e,t,n,r){void 0===n&&(n=-1),void 0===r&&(r=0);var o=i(e,t,n,r);return-1!==o?e[o]:void 0},e.lowerBound=function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=-1);var o=e.length;if(0===o)return 0;for(var a=r=r<0?Math.max(0,r+o):Math.min(r,o-1),s=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))-r+1;s>0;){var l=s>>1,c=a+l;n(e[c],t)<0?(a=c+1,s-=l+1):s=l}return a},e.upperBound=function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=-1);var o=e.length;if(0===o)return 0;for(var a=r=r<0?Math.max(0,r+o):Math.min(r,o-1),s=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))-r+1;s>0;){var l=s>>1,c=a+l;n(e[c],t)>0?s=l:(a=c+1,s-=l+1)}return a},e.move=function(e,t,n){var r=e.length;if(!(r<=1)&&(t=t<0?Math.max(0,t+r):Math.min(t,r-1))!==(n=n<0?Math.max(0,n+r):Math.min(n,r-1))){for(var i=e[t],o=t<n?1:-1,a=t;a!==n;a+=o)e[a]=e[a+o];e[n]=i}},e.reverse=o,e.rotate=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var i=e.length;if(!(i<=1||(n=n<0?Math.max(0,n+i):Math.min(n,i-1))>=(r=r<0?Math.max(0,r+i):Math.min(r,i-1)))){var a=r-n+1;if(t>0?t%=a:t<0&&(t=(t%a+a)%a),0!==t){var s=n+t;o(e,n,s-1),o(e,s,r),o(e,n,r)}}},e.fill=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var i=e.length;if(0!==i){var o;n=n<0?Math.max(0,n+i):Math.min(n,i-1),o=(r=r<0?Math.max(0,r+i):Math.min(r,i-1))<n?r+1+(i-n):r-n+1;for(var a=0;a<o;++a)e[(n+a)%i]=t}},e.insert=function(e,t,n){var r=e.length;t=t<0?Math.max(0,t+r):Math.min(t,r);for(var i=r;i>t;--i)e[i]=e[i-1];e[t]=n},e.removeAt=a,e.removeFirstOf=function(e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=-1);var o=t(e,n,r,i);return-1!==o&&a(e,o),o},e.removeLastOf=function(e,t,r,i){void 0===r&&(r=-1),void 0===i&&(i=0);var o=n(e,t,r,i);return-1!==o&&a(e,o),o},e.removeAllOf=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var i=e.length;if(0===i)return 0;n=n<0?Math.max(0,n+i):Math.min(n,i-1),r=r<0?Math.max(0,r+i):Math.min(r,i-1);for(var o=0,a=0;a<i;++a)n<=r&&a>=n&&a<=r&&e[a]===t?o++:r<n&&(a<=r||a>=n)&&e[a]===t?o++:o>0&&(e[a-o]=e[a]);return o>0&&(e.length=i-o),o},e.removeFirstWhere=function(e,t,n,i){var o;void 0===n&&(n=0),void 0===i&&(i=-1);var s=r(e,t,n,i);return-1!==s&&(o=a(e,s)),{index:s,value:o}},e.removeLastWhere=function(e,t,n,r){var o;void 0===n&&(n=-1),void 0===r&&(r=0);var s=i(e,t,n,r);return-1!==s&&(o=a(e,s)),{index:s,value:o}},e.removeAllWhere=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var i=e.length;if(0===i)return 0;n=n<0?Math.max(0,n+i):Math.min(n,i-1),r=r<0?Math.max(0,r+i):Math.min(r,i-1);for(var o=0,a=0;a<i;++a)n<=r&&a>=n&&a<=r&&t(e[a],a)?o++:r<n&&(a<=r||a>=n)&&t(e[a],a)?o++:o>0&&(e[a-o]=e[a]);return o>0&&(e.length=i-o),o}}(t.ArrayExt||(t.ArrayExt={}))},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(3),a=n(8),s=n(57),l=n(56),c=function(){function e(e){this._idTick=0,this._items=[],this.menu=new l.Menu(e)}return e.prototype.addItem=function(e){var t=this,n=i.createItem(e,this._idTick++);return this._items.push(n),new a.DisposableDelegate(function(){o.ArrayExt.removeFirstOf(t._items,n)})},e.prototype.open=function(e){var t=this;if(this.menu.clearItems(),0===this._items.length)return!1;var n=i.matchItems(this._items,e);return!(!n||0===n.length||(o.each(n,function(e){t.menu.addItem(e)}),this.menu.open(e.clientX,e.clientY),0))},e}();t.ContextMenu=c,function(e){function t(e,t){var n=s.Selector.calculateSpecificity(e.selector),r=s.Selector.calculateSpecificity(t.selector);if(n!==r)return r-n;var i=e.rank,o=t.rank;return i!==o?i<o?-1:1:e.id-t.id}e.createItem=function(e,t){var n=function(e){if(-1!==e.indexOf(","))throw new Error("Selector cannot contain commas: "+e);if(!s.Selector.isValid(e))throw new Error("Invalid selector: "+e);return e}(e.selector),i=void 0!==e.rank?e.rank:1/0;return r({},e,{selector:n,rank:i,id:t})},e.matchItems=function(e,n){var r=n.target;if(!r)return null;var i=n.currentTarget;if(!i)return null;if(!(i.contains(r)||(r=document.elementFromPoint(n.clientX,n.clientY))&&i.contains(r)))return null;for(var o=[],a=e.slice();null!==r;){for(var l=[],c=0,u=a.length;c<u;++c){var d=a[c];d&&s.Selector.matches(r,d.selector)&&(l.push(d),a[c]=null)}if(0!==l.length&&(l.sort(t),o.push.apply(o,l)),r===i)break;r=r.parentElement}return o}}(i||(i={}))},function(e,t,n){"use strict"},function(e,t,n){"use strict"},function(e,t,n){"use strict"},function(e,t,n){"use strict"},function(e,t,n){"use strict";(function(e){var r,i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(e){function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var n,r=t(["and","or","not","is"]),i=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],o=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];function a(e){return e.scopes[e.scopes.length-1]}e.registerHelper("hintWords","python",i.concat(o)),e.defineMode("python",function(n,s){for(var l="error",c=s.delimiters||s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,u=[s.singleOperators,s.doubleOperators,s.doubleDelimiters,s.tripleDelimiters,s.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@])/],d=0;d<u.length;d++)u[d]||u.splice(d--,1);var f=s.hangingIndent||n.indentUnit,h=i,p=o;void 0!=s.extra_keywords&&(h=h.concat(s.extra_keywords)),void 0!=s.extra_builtins&&(p=p.concat(s.extra_builtins));var m=!(s.version&&Number(s.version)<3);if(m){var g=s.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;h=h.concat(["nonlocal","False","True","None","async","await"]),p=p.concat(["ascii","bytes","exec","print"]);var v=new RegExp("^(([rbuf]|(br)|(fr))?('{3}|\"{3}|['\"]))","i")}else g=s.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/,h=h.concat(["exec","print"]),p=p.concat(["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"]),v=new RegExp("^(([rubf]|(ur)|(br))?('{3}|\"{3}|['\"]))","i");var y=t(h),b=t(p);function x(e,t){var n=e.sol()&&"\\"!=t.lastToken;if(n&&(t.indent=e.indentation()),n&&"py"==a(t).type){var r=a(t).offset;if(e.eatSpace()){var i=e.indentation();return i>r?_(t):i<r&&k(e,t)&&"#"!=e.peek()&&(t.errorToken=!0),null}var o=w(e,t);return r>0&&k(e,t)&&(o+=" "+l),o}return w(e,t)}function w(e,t){if(e.eatSpace())return null;if(e.match(/^#.*/))return"comment";if(e.match(/^[0-9\.]/,!1)){var n=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(n=!0),e.match(/^[\d_]+\.\d*/)&&(n=!0),e.match(/^\.\d+/)&&(n=!0),n)return e.eat(/J/i),"number";var i=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(i=!0),e.match(/^0b[01_]+/i)&&(i=!0),e.match(/^0o[0-7_]+/i)&&(i=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),i=!0),e.match(/^0(?![\dx])/i)&&(i=!0),i)return e.eat(/L/i),"number"}if(e.match(v))return-1!==e.current().toLowerCase().indexOf("f")?(t.tokenize=function(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";function i(t,n){return t.match(e)?(n.tokenize=o,r):t.match("{")?"punctuation":t.match("}")?(n.tokenize=o,"punctuation"):w(t,n)}function o(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\{\}\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return r}else{if(o.match(e))return a.tokenize=t,r;if(o.match("{{"))return r;if(o.match("{",!1))return a.tokenize=i,o.current()?r:(o.next(),"punctuation");if(o.match("}}"))return r;if(o.match("}"))return l;o.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;a.tokenize=t}return r}return o.isString=!0,o}(e.current(),t.tokenize),t.tokenize(e,t)):(t.tokenize=function(e){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var t=1==e.length,n="string";function r(r,i){for(;!r.eol();)if(r.eatWhile(/[^'"\\]/),r.eat("\\")){if(r.next(),t&&r.eol())return n}else{if(r.match(e))return i.tokenize=x,n;r.eat(/['"]/)}if(t){if(s.singleLineStringErrors)return l;i.tokenize=x}return n}return r.isString=!0,r}(e.current()),t.tokenize(e,t));for(var o=0;o<u.length;o++)if(e.match(u[o]))return"operator";return e.match(c)?"punctuation":"."==t.lastToken&&e.match(g)?"property":e.match(y)||e.match(r)?"keyword":e.match(b)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(g)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),l)}function _(e){for(;"py"!=a(e).type;)e.scopes.pop();e.scopes.push({offset:a(e).offset+n.indentUnit,type:"py",align:null})}function k(e,t){for(var n=e.indentation();t.scopes.length>1&&a(t).offset>n;){if("py"!=a(t).type)return!0;t.scopes.pop()}return a(t).offset!=n}return{startState:function(e){return{tokenize:x,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=function(e,t){e.sol()&&(t.beginningOfLine=!0);var n=t.tokenize(e,t),r=e.current();if(t.beginningOfLine&&"@"==r)return e.match(g,!1)?"meta":m?"operator":l;if(/\S/.test(r)&&(t.beginningOfLine=!1),"variable"!=n&&"builtin"!=n||"meta"!=t.lastToken||(n="meta"),"pass"!=r&&"return"!=r||(t.dedent+=1),"lambda"==r&&(t.lambda=!0),":"!=r||t.lambda||"py"!=a(t).type||_(t),1==r.length&&!/string|comment/.test(n)){var i="[({".indexOf(r);if(-1!=i&&function(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+f,type:n,align:r})}(e,t,"])}".slice(i,i+1)),-1!=(i="])}".indexOf(r))){if(a(t).type!=r)return l;t.indent=t.scopes.pop().offset-f}}return t.dedent>0&&e.eol()&&"py"==a(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),n}(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+l:r},indent:function(t,n){if(t.tokenize!=x)return t.tokenize.isString?e.Pass:0;var r=a(t),i=r.type==n.charAt(0);return null!=r.align?r.align-(i?1:0):r.offset-(i?f:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}}),e.defineMIME("text/x-python","python"),e.defineMIME("text/x-cython",{name:"python",extra_keywords:(n="by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE",n.split(" "))})},"object"==s(t)&&"object"==s(e)?a(n(27)):(i=[n(27)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}).call(this,n(1)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=c(n(27)),o=(c(n(172)),n(15)),a=n(11),s=n(96),l=n(39);function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._kernel=null,this._renderers=null,this._fromStorage=!1,this.selector=n.selector||"[data-executable]",this.repo=n.repo,this.branch=n.branch||"master",this.url=n.url||"https://mybinder.org",this.serverSettings=n.serverSettings||{},this.kernelType=n.kernelType||"python3",this.defaultLang=n.language||"python",this.defaultTheme=n.theme||"default",this.isolateCells=void 0==n.isolateCells||n.isolateCells,this.useBinder=void 0==n.useBinder||n.useBinder,this.useStorage=void 0==n.useStorage||n.useStorage,this.storageKey=n.storageKey||"juniper",this.storageExpire=n.storageExpire||1440,this.eventName=n.eventName||"juniper",this.msgLoading=n.msgLoading||"Loading...",this.msgError=n.msgError||"Connecting failed. Please reload and try again.";var r=n.classNames||{};this.classNames={cell:r.cell||"juniper-cell",input:r.input||"juniper-input",button:r.button||"juniper-button",output:r.output||"juniper-output"},n.noAutoInit||[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(document.querySelectorAll(this.selector))).forEach(function(e){return t.renderCell(e)})}return r(e,[{key:"getKernel",value:function(){var e=this;if(this.useStorage&&"undefined"!=typeof window){var t=window.localStorage.getItem(this.storageKey);if(t){this._fromStorage=!0;var n=JSON.parse(t),r=n.settings,i=n.timestamp;if(i&&(new Date).getTime()<i)return this.requestKernel(r);window.localStorage.removeItem(this.storageKey)}}return this.useBinder?this.requestBinder(this.repo,this.branch,this.url).then(function(t){return e.requestKernel(t)}):this.requestKernel(this.serverSettings)}},{key:"requestBinder",value:function(e,t,n){var r=this,i=n+"/build/gh/"+e+"/"+t;return this._event("building",{binderUrl:i}),new Promise(function(e,t){var n=new EventSource(i);n.onerror=function(e){n.close(),r._event("failed"),t(new Error(e))};var o=null;n.onmessage=function(i){var a=i.data,s=JSON.parse(a);if(s.phase&&s.phase!=o&&(o=s.phase.toLowerCase(),r._event("ready"==o?"server-ready":o)),"failed"==s.phase)n.close(),t(new Error(s));else if("ready"==s.phase){n.close();var l={baseUrl:s.url,wsUrl:"ws"+s.url.slice(4),token:s.token};e(l)}}})}},{key:"requestKernel",value:function(e){var t=this;if(this.useStorage&&"undefined"!=typeof window){var n=(new Date).getTime()+60*this.storageExpire*1e3,r=JSON.stringify({settings:e,timestamp:n});window.localStorage.setItem(this.storageKey,r)}var i=a.ServerConnection.makeSettings(e);return a.Kernel.startNew({type:this.kernelType,serverSettings:i}).then(function(e){return t._event("ready"),e})}},{key:"renderCell",value:function(e){var t=this,n=new s.OutputArea({model:new s.OutputAreaModel({trusted:!0}),rendermime:new l.RenderMimeRegistry({initialFactories:this.getRenderers()})}),r=this._$("div",this.classNames.cell);e.replaceWith(r);var a=this._$("div",this.classNames.input);r.appendChild(a);var c=this._$("button",this.classNames.button,"run");r.appendChild(c);var u=this._$("div",this.classNames.output);r.appendChild(u),o.Widget.attach(n,u);var d=new i.default(a,{value:e.textContent.trim(),mode:e.getAttribute("data-language")||this.defaultLang,theme:e.getAttribute("data-theme")||this.defaultTheme}),f=function(e){return t.execute(n,d.getValue())};d.setOption("extraKeys",{"Shift-Enter":f}),c.addEventListener("click",f)}},{key:"render",value:function(e,t){e.future=this._kernel.requestExecute({code:t}),e.model.add({output_type:"stream",name:"loading",text:this.msgLoading}),e.model.clear(!0)}},{key:"execute",value:function(e,t){var n=this;if(this._event("executing"),this._kernel)return this.isolateCells?void this._kernel.restart().then(function(){return n.render(e,t)}).catch(function(){n._event("failed"),n._kernel=null,e.model.clear(),e.model.add({output_type:"stream",name:"failure",text:n.msgError})}):void this.render(e,t);this._event("requesting-kernel");var r=this.url.split("//")[1],i=this._fromStorage?"Reconnecting to":"Launching";e.model.clear(),e.model.add({output_type:"stream",name:"stdout",text:i+" Docker container on "+r+"..."}),new Promise(function(e,t){return n.getKernel().then(e).catch(t)}).then(function(r){n._kernel=r,n.render(e,t)}).catch(function(){n._event("failed"),n._kernel=null,n.useStorage&&"undefined"!=typeof window&&(n._fromStorage=!1,window.localStorage.removeItem(n.storageKey)),e.model.clear(),e.model.add({output_type:"stream",name:"failure",text:n.msgError})})}},{key:"getRenderers",value:function(){return this._renderers||(this._renderers=l.standardRendererFactories.filter(function(e){return!e.mimeTypes.includes("text/latex")||"undefined"!=typeof window&&window.MathJax})),this._renderers}},{key:"_event",value:function(e,t){var n=new CustomEvent(this.eventName,{detail:{status:e,data:t}});document.dispatchEvent(n)}},{key:"_$",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=document.createElement(e);return r.className=t,r.textContent=n,r}}]),e}();"undefined"!=typeof window&&(window.Juniper=u,window.CodeMirror=i.default),t.default=u}]);
|