You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
402 KiB
JavaScript

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

var cceditorapp=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=32)}([function(t,e,n){t.exports=function(){"use strict";var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),i=/MSIE \d/.test(t),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),s=i||r||o,a=s&&(i?document.documentMode||6:+(o||r)[1]),l=!o&&/WebKit\//.test(t),c=l&&/Qt\/\d+\.\d+/.test(t),u=!o&&/Chrome\//.test(t),d=/Opera\//.test(t),h=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),p=/PhantomJS/.test(t),m=!o&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t),g=/Android/.test(t),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=m||/Mac/.test(e),x=/\bCrOS\b/.test(t),b=/win/i.test(e),w=d&&t.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(d=!1,l=!0);var C=y&&(c||d&&(null==w||w<12.11)),_=n||s&&a>=9;function k(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var S,T=function(t,e){var n=t.className,i=k(e).exec(n);if(i){var r=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function M(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function A(t,e){return M(t).appendChild(e)}function L(t,e,n,i){var r=document.createElement(t);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof e)r.appendChild(document.createTextNode(e));else if(e)for(var o=0;o<e.length;++o)r.appendChild(e[o]);return r}function I(t,e,n,i){var r=L(t,e,n,i);return r.setAttribute("role","presentation"),r}function E(t,e){if(3==e.nodeType&&(e=e.parentNode),t.contains)return t.contains(e);do{if(11==e.nodeType&&(e=e.host),e==t)return!0}while(e=e.parentNode)}function D(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function N(t,e){var n=t.className;k(e).test(n)||(t.className+=(n?" ":"")+e)}function O(t,e){for(var n=t.split(" "),i=0;i<n.length;i++)n[i]&&!k(n[i]).test(e)&&(e+=" "+n[i]);return e}S=document.createRange?function(t,e,n,i){var r=document.createRange();return r.setEnd(i||t,n),r.setStart(t,e),r}:function(t,e,n){var i=document.body.createTextRange();try{i.moveToElementText(t.parentNode)}catch(t){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",e),i};var P=function(t){t.select()};function H(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function F(t,e,n){for(var i in e||(e={}),t)!t.hasOwnProperty(i)||!1===n&&e.hasOwnProperty(i)||(e[i]=t[i]);return e}function W(t,e,n,i,r){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var o=i||0,s=r||0;;){var a=t.indexOf("\t",o);if(a<0||a>=e)return s+(e-o);s+=a-o,s+=n-s%n,o=a+1}}m?P=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:s&&(P=function(t){try{t.select()}catch(t){}});var z=function(){this.id=null};function R(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}z.prototype.set=function(t,e){clearTimeout(this.id),this.id=setTimeout(e,t)};var B=30,j={toString:function(){return"CodeMirror.Pass"}},q={scroll:!1},$={origin:"*mouse"},U={origin:"+move"};function G(t,e,n){for(var i=0,r=0;;){var o=t.indexOf("\t",i);-1==o&&(o=t.length);var s=o-i;if(o==t.length||r+s>=e)return i+Math.min(s,e-r);if(r+=o-i,i=o+1,(r+=n-r%n)>=e)return i}}var V=[""];function X(t){for(;V.length<=t;)V.push(K(V)+" ");return V[t]}function K(t){return t[t.length-1]}function Y(t,e){for(var n=[],i=0;i<t.length;i++)n[i]=e(t[i],i);return n}function Q(){}function J(t,e){var n;return Object.create?n=Object.create(t):(Q.prototype=t,n=new Q),e&&F(e,n),n}var Z=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function tt(t){return/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||Z.test(t))}function et(t,e){return e?!!(e.source.indexOf("\\w")>-1&&tt(t))||e.test(t):tt(t)}function nt(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var it=/[\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 rt(t){return t.charCodeAt(0)>=768&&it.test(t)}function ot(t,e,n){for(;(n<0?e>0:e<t.length)&&rt(t.charAt(e));)e+=n;return e}function st(t,e,n){for(;;){if(Math.abs(e-n)<=1)return t(e)?e:n;var i=Math.floor((e+n)/2);t(i)?n=i:e=i}}function at(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(e<o){n=r;break}e-=o}return n.lines[e]}function lt(t,e,n){var i=[],r=e.line;return t.iter(e.line,n.line+1,function(t){var o=t.text;r==n.line&&(o=o.slice(0,n.ch)),r==e.line&&(o=o.slice(e.ch)),i.push(o),++r}),i}function ct(t,e,n){var i=[];return t.iter(e,n,function(t){i.push(t.text)}),i}function ut(t,e){var n=e-t.height;if(n)for(var i=t;i;i=i.parent)i.height+=n}function dt(t){if(null==t.parent)return null;for(var e=t.parent,n=R(e.lines,t),i=e.parent;i;e=i,i=i.parent)for(var r=0;i.children[r]!=e;++r)n+=i.children[r].chunkSize();return n+e.first}function ht(t,e){var n=t.first;t:do{for(var i=0;i<t.children.length;++i){var r=t.children[i],o=r.height;if(e<o){t=r;continue t}e-=o,n+=r.chunkSize()}return n}while(!t.lines);for(var s=0;s<t.lines.length;++s){var a=t.lines[s],l=a.height;if(e<l)break;e-=l}return n+s}function ft(t,e){return e>=t.first&&e<t.first+t.size}function pt(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function mt(t,e,n){if(void 0===n&&(n=null),!(this instanceof mt))return new mt(t,e,n);this.line=t,this.ch=e,this.sticky=n}function gt(t,e){return t.line-e.line||t.ch-e.ch}function vt(t,e){return t.sticky==e.sticky&&0==gt(t,e)}function yt(t){return mt(t.line,t.ch)}function xt(t,e){return gt(t,e)<0?e:t}function bt(t,e){return gt(t,e)<0?t:e}function wt(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function Ct(t,e){if(e.line<t.first)return mt(t.first,0);var n=t.first+t.size-1;return e.line>n?mt(n,at(t,n).text.length):function(t,e){var n=t.ch;return null==n||n>e?mt(t.line,e):n<0?mt(t.line,0):t}(e,at(t,e.line).text.length)}function _t(t,e){for(var n=[],i=0;i<e.length;i++)n[i]=Ct(t,e[i]);return n}var kt=!1,St=!1;function Tt(t,e,n){this.marker=t,this.from=e,this.to=n}function Mt(t,e){if(t)for(var n=0;n<t.length;++n){var i=t[n];if(i.marker==e)return i}}function At(t,e){for(var n,i=0;i<t.length;++i)t[i]!=e&&(n||(n=[])).push(t[i]);return n}function Lt(t,e){if(e.full)return null;var n=ft(t,e.from.line)&&at(t,e.from.line).markedSpans,i=ft(t,e.to.line)&&at(t,e.to.line).markedSpans;if(!n&&!i)return null;var r=e.from.ch,o=e.to.ch,s=0==gt(e.from,e.to),a=function(t,e,n){var i;if(t)for(var r=0;r<t.length;++r){var o=t[r],s=o.marker,a=null==o.from||(s.inclusiveLeft?o.from<=e:o.from<e);if(a||o.from==e&&"bookmark"==s.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(s.inclusiveRight?o.to>=e:o.to>e);(i||(i=[])).push(new Tt(s,o.from,l?null:o.to))}}return i}(n,r,s),l=function(t,e,n){var i;if(t)for(var r=0;r<t.length;++r){var o=t[r],s=o.marker,a=null==o.to||(s.inclusiveRight?o.to>=e:o.to>e);if(a||o.from==e&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=e:o.from<e);(i||(i=[])).push(new Tt(s,l?null:o.from-e,null==o.to?null:o.to-e))}}return i}(i,o,s),c=1==e.text.length,u=K(e.text).length+(c?r:0);if(a)for(var d=0;d<a.length;++d){var h=a[d];if(null==h.to){var f=Mt(l,h.marker);f?c&&(h.to=null==f.to?null:f.to+u):h.to=r}}if(l)for(var p=0;p<l.length;++p){var m=l[p];if(null!=m.to&&(m.to+=u),null==m.from){var g=Mt(a,m.marker);g||(m.from=u,c&&(a||(a=[])).push(m))}else m.from+=u,c&&(a||(a=[])).push(m)}a&&(a=It(a)),l&&l!=a&&(l=It(l));var v=[a];if(!c){var y,x=e.text.length-2;if(x>0&&a)for(var b=0;b<a.length;++b)null==a[b].to&&(y||(y=[])).push(new Tt(a[b].marker,null,null));for(var w=0;w<x;++w)v.push(y);v.push(l)}return v}function It(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&t.splice(e--,1)}return t.length?t:null}function Et(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function Dt(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function Nt(t){return t.inclusiveLeft?-1:0}function Ot(t){return t.inclusiveRight?1:0}function Pt(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var i=t.find(),r=e.find(),o=gt(i.from,r.from)||Nt(t)-Nt(e);if(o)return-o;var s=gt(i.to,r.to)||Ot(t)-Ot(e);return s||e.id-t.id}function Ht(t,e){var n,i=St&&t.markedSpans;if(i)for(var r=void 0,o=0;o<i.length;++o)(r=i[o]).marker.collapsed&&null==(e?r.from:r.to)&&(!n||Pt(n,r.marker)<0)&&(n=r.marker);return n}function Ft(t){return Ht(t,!0)}function Wt(t){return Ht(t,!1)}function zt(t,e,n,i,r){var o=at(t,e),s=St&&o.markedSpans;if(s)for(var a=0;a<s.length;++a){var l=s[a];if(l.marker.collapsed){var c=l.marker.find(0),u=gt(c.from,n)||Nt(l.marker)-Nt(r),d=gt(c.to,i)||Ot(l.marker)-Ot(r);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?gt(c.to,n)>=0:gt(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?gt(c.from,i)<=0:gt(c.from,i)<0)))return!0}}}function Rt(t){for(var e;e=Ft(t);)t=e.find(-1,!0).line;return t}function Bt(t,e){var n=at(t,e),i=Rt(n);return n==i?e:dt(i)}function jt(t,e){if(e>t.lastLine())return e;var n,i=at(t,e);if(!qt(t,i))return e;for(;n=Wt(i);)i=n.find(1,!0).line;return dt(i)+1}function qt(t,e){var n=St&&e.markedSpans;if(n)for(var i=void 0,r=0;r<n.length;++r)if((i=n[r]).marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&$t(t,e,i))return!0}}function $t(t,e,n){if(null==n.to){var i=n.marker.find(1,!0);return $t(t,i.line,Mt(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var r=void 0,o=0;o<e.markedSpans.length;++o)if((r=e.markedSpans[o]).marker.collapsed&&!r.marker.widgetNode&&r.from==n.to&&(null==r.to||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&$t(t,e,r))return!0}function Ut(t){for(var e=0,n=(t=Rt(t)).parent,i=0;i<n.lines.length;++i){var r=n.lines[i];if(r==t)break;e+=r.height}for(var o=n.parent;o;o=(n=o).parent)for(var s=0;s<o.children.length;++s){var a=o.children[s];if(a==n)break;e+=a.height}return e}function Gt(t){if(0==t.height)return 0;for(var e,n=t.text.length,i=t;e=Ft(i);){var r=e.find(0,!0);i=r.from.line,n+=r.from.ch-r.to.ch}for(i=t;e=Wt(i);){var o=e.find(0,!0);n-=i.text.length-o.from.ch,i=o.to.line,n+=i.text.length-o.to.ch}return n}function Vt(t){var e=t.display,n=t.doc;e.maxLine=at(n,n.first),e.maxLineLength=Gt(e.maxLine),e.maxLineChanged=!0,n.iter(function(t){var n=Gt(t);n>e.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)})}var Xt=null;function Kt(t,e,n){var i;Xt=null;for(var r=0;r<t.length;++r){var o=t[r];if(o.from<e&&o.to>e)return r;o.to==e&&(o.from!=o.to&&"before"==n?i=r:Xt=r),o.from==e&&(o.from!=o.to&&"before"!=n?i=r:Xt=r)}return null!=i?i:Xt}var Yt=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,r=/[LRr]/,o=/[Lb1n]/,s=/[1n]/;function a(t,e,n){this.level=t,this.from=e,this.to=n}return function(l,c){var u,d="ltr"==c?"L":"R";if(0==l.length||"ltr"==c&&!n.test(l))return!1;for(var h=l.length,f=[],p=0;p<h;++p)f.push((u=l.charCodeAt(p))<=247?t.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?e.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":8204==u?"b":"L");for(var m=0,g=d;m<h;++m){var v=f[m];"m"==v?f[m]=g:g=v}for(var y=0,x=d;y<h;++y){var b=f[y];"1"==b&&"r"==x?f[y]="n":r.test(b)&&(x=b,"r"==b&&(f[y]="R"))}for(var w=1,C=f[0];w<h-1;++w){var _=f[w];"+"==_&&"1"==C&&"1"==f[w+1]?f[w]="1":","!=_||C!=f[w+1]||"1"!=C&&"n"!=C||(f[w]=C),C=_}for(var k=0;k<h;++k){var S=f[k];if(","==S)f[k]="N";else if("%"==S){var T=void 0;for(T=k+1;T<h&&"%"==f[T];++T);for(var M=k&&"!"==f[k-1]||T<h&&"1"==f[T]?"1":"N",A=k;A<T;++A)f[A]=M;k=T-1}}for(var L=0,I=d;L<h;++L){var E=f[L];"L"==I&&"1"==E?f[L]="L":r.test(E)&&(I=E)}for(var D=0;D<h;++D)if(i.test(f[D])){var N=void 0;for(N=D+1;N<h&&i.test(f[N]);++N);for(var O="L"==(D?f[D-1]:d),P="L"==(N<h?f[N]:d),H=O==P?O?"L":"R":d,F=D;F<N;++F)f[F]=H;D=N-1}for(var W,z=[],R=0;R<h;)if(o.test(f[R])){var B=R;for(++R;R<h&&o.test(f[R]);++R);z.push(new a(0,B,R))}else{var j=R,q=z.length;for(++R;R<h&&"L"!=f[R];++R);for(var $=j;$<R;)if(s.test(f[$])){j<$&&z.splice(q,0,new a(1,j,$));var U=$;for(++$;$<R&&s.test(f[$]);++$);z.splice(q,0,new a(2,U,$)),j=$}else++$;j<R&&z.splice(q,0,new a(1,j,R))}return 1==z[0].level&&(W=l.match(/^\s+/))&&(z[0].from=W[0].length,z.unshift(new a(0,0,W[0].length))),1==K(z).level&&(W=l.match(/\s+$/))&&(K(z).to-=W[0].length,z.push(new a(0,h-W[0].length,h))),"rtl"==c?z.reverse():z}}();function Qt(t,e){var n=t.order;return null==n&&(n=t.order=Yt(t.text,e)),n}function Jt(t,e,n){var i=ot(t.text,e+n,n);return i<0||i>t.text.length?null:i}function Zt(t,e,n){var i=Jt(t,e.ch,n);return null==i?null:new mt(e.line,i,n<0?"after":"before")}function te(t,e,n,i,r){if(t){var o=Qt(n,e.doc.direction);if(o){var s,a=r<0?K(o):o[0],l=r<0==(1==a.level),c=l?"after":"before";if(a.level>0){var u=Pn(e,n);s=r<0?n.text.length-1:0;var d=Hn(e,u,s).top;s=st(function(t){return Hn(e,u,t).top==d},r<0==(1==a.level)?a.from:a.to-1,s),"before"==c&&(s=Jt(n,s,1))}else s=r<0?a.to:a.from;return new mt(i,s,c)}}return new mt(i,r<0?n.text.length:0,r<0?"before":"after")}function ee(t,e,n,i){var r=Qt(e,t.doc.direction);if(!r)return Zt(e,n,i);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=Kt(r,n.ch,n.sticky),s=r[o];if("ltr"==t.doc.direction&&s.level%2==0&&(i>0?s.to>n.ch:s.from<n.ch))return Zt(e,n,i);var a,l=function(t,n){return Jt(e,t instanceof mt?t.ch:t,n)},c=function(n){return t.options.lineWrapping?(a=a||Pn(t,e),ti(t,e,a,n)):{begin:0,end:e.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==t.doc.direction||1==s.level){var d=1==s.level==i<0,h=l(n,d?1:-1);if(null!=h&&(d?h<=s.to&&h<=u.end:h>=s.from&&h>=u.begin)){var f=d?"before":"after";return new mt(n.line,h,f)}}var p=function(t,e,i){for(var o=function(t,e){return e?new mt(n.line,l(t,1),"before"):new mt(n.line,t,"after")};t>=0&&t<r.length;t+=e){var s=r[t],a=e>0==(1!=s.level),c=a?i.begin:l(i.end,-1);if(s.from<=c&&c<s.to)return o(c,a);if(c=a?s.from:l(s.to,-1),i.begin<=c&&c<i.end)return o(c,a)}},m=p(o+i,i,u);if(m)return m;var g=i>0?u.end:l(u.begin,-1);return null==g||i>0&&g==e.text.length||!(m=p(i>0?0:r.length-1,i,c(g)))?null:m}var ne=[],ie=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var i=t._handlers||(t._handlers={});i[e]=(i[e]||ne).concat(n)}};function re(t,e){return t._handlers&&t._handlers[e]||ne}function oe(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var i=t._handlers,r=i&&i[e];if(r){var o=R(r,n);o>-1&&(i[e]=r.slice(0,o).concat(r.slice(o+1)))}}}function se(t,e){var n=re(t,e);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,i)}function ae(t,e,n){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),se(t,n||e.type,t,e),fe(e)||e.codemirrorIgnore}function le(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),i=0;i<e.length;++i)-1==R(n,e[i])&&n.push(e[i])}function ce(t,e){return re(t,e).length>0}function ue(t){t.prototype.on=function(t,e){ie(this,t,e)},t.prototype.off=function(t,e){oe(this,t,e)}}function de(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function he(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function fe(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function pe(t){de(t),he(t)}function me(t){return t.target||t.srcElement}function ge(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var ve,ye,xe=function(){if(s&&a<9)return!1;var t=L("div");return"draggable"in t||"dragDrop"in t}();function be(t){if(null==ve){var e=L("span","");A(t,L("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(ve=e.offsetWidth<=1&&e.offsetHeight>2&&!(s&&a<8))}var n=ve?L("span",""):L("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function we(t){if(null!=ye)return ye;var e=A(t,document.createTextNode("AخA")),n=S(e,0,1).getBoundingClientRect(),i=S(e,1,2).getBoundingClientRect();return M(t),!(!n||n.left==n.right)&&(ye=i.right-n.right<3)}var Ce,_e=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],i=t.length;e<=i;){var r=t.indexOf("\n",e);-1==r&&(r=t.length);var o=t.slice(e,"\r"==t.charAt(r-1)?r-1:r),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),e+=s+1):(n.push(o),e=r+1)}return n}:function(t){return t.split(/\r\n?|\n/)},ke=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Se="oncopy"in(Ce=L("div"))||(Ce.setAttribute("oncopy","return;"),"function"==typeof Ce.oncopy),Te=null,Me={},Ae={};function Le(t){if("string"==typeof t&&Ae.hasOwnProperty(t))t=Ae[t];else if(t&&"string"==typeof t.name&&Ae.hasOwnProperty(t.name)){var e=Ae[t.name];"string"==typeof e&&(e={name:e}),(t=J(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Le("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Le("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Ie(t,e){e=Le(e);var n=Me[e.name];if(!n)return Ie(t,"text/plain");var i=n(t,e);if(Ee.hasOwnProperty(e.name)){var r=Ee[e.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=e.name,e.helperType&&(i.helperType=e.helperType),e.modeProps)for(var s in e.modeProps)i[s]=e.modeProps[s];return i}var Ee={};function De(t,e){var n=Ee.hasOwnProperty(t)?Ee[t]:Ee[t]={};F(e,n)}function Ne(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var i in e){var r=e[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function Oe(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Pe(t,e,n){return!t.startState||t.startState(e,n)}var He=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};He.prototype.eol=function(){return this.pos>=this.string.length},He.prototype.sol=function(){return this.pos==this.lineStart},He.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},He.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},He.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},He.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},He.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},He.prototype.skipToEnd=function(){this.pos=this.string.length},He.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},He.prototype.backUp=function(t){this.pos-=t},He.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=W(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},He.prototype.indentation=function(){return W(this.string,null,this.tabSize)-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},He.prototype.match=function(t,e,n){if("string"!=typeof t){var i=this.string.slice(this.pos).match(t);return i&&i.index>0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}var r=function(t){return n?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);if(r(o)==r(t))return!1!==e&&(this.pos+=t.length),!0},He.prototype.current=function(){return this.string.slice(this.start,this.pos)},He.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},He.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)};var Fe=function(t,e){this.state=t,this.lookAhead=e},We=function(t,e,n,i){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=i||0};function ze(t,e,n,i){var r=[t.state.modeGen],o={};Xe(t,e.text,t.doc.mode,n,function(t,e){return r.push(t,e)},o,i);for(var s=n.state,a=function(i){var s=t.state.overlays[i],a=1,l=0;n.state=!0,Xe(t,e.text,s.mode,n,function(t,e){for(var n=a;l<t;){var i=r[a];i>t&&r.splice(a,1,t,r[a+1],i),a+=2,l=Math.min(t,i)}if(e)if(s.opaque)r.splice(n,a-n,t,"overlay "+e),a=n+2;else for(;n<a;n+=2){var o=r[n+1];r[n+1]=(o?o+" ":"")+"overlay "+e}},o)},l=0;l<t.state.overlays.length;++l)a(l);return n.state=s,{styles:r,classes:o.bgClass||o.textClass?o:null}}function Re(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var i=Be(t,dt(e)),r=e.text.length>t.options.maxHighlightLength&&Ne(t.doc.mode,i.state),o=ze(t,e,i);r&&(i.state=r),e.stateAfter=i.save(!r),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function Be(t,e,n){var i=t.doc,r=t.display;if(!i.mode.startState)return new We(i,!0,e);var o=function(t,e,n){for(var i,r,o=t.doc,s=n?-1:e-(t.doc.mode.innerMode?1e3:100),a=e;a>s;--a){if(a<=o.first)return o.first;var l=at(o,a-1),c=l.stateAfter;if(c&&(!n||a+(c instanceof Fe?c.lookAhead:0)<=o.modeFrontier))return a;var u=W(l.text,null,t.options.tabSize);(null==r||i>u)&&(r=a-1,i=u)}return r}(t,e,n),s=o>i.first&&at(i,o-1).stateAfter,a=s?We.fromSaved(i,s,o):new We(i,Pe(i.mode),o);return i.iter(o,e,function(n){je(t,n.text,a);var i=a.line;n.stateAfter=i==e-1||i%5==0||i>=r.viewFrom&&i<r.viewTo?a.save():null,a.nextLine()}),n&&(i.modeFrontier=a.line),a}function je(t,e,n,i){var r=t.doc.mode,o=new He(e,t.options.tabSize,n);for(o.start=o.pos=i||0,""==e&&qe(r,n.state);!o.eol();)$e(r,o,n.state),o.start=o.pos}function qe(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){var n=Oe(t,e);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function $e(t,e,n,i){for(var r=0;r<10;r++){i&&(i[0]=Oe(t,n).mode);var o=t.token(e,n);if(e.pos>e.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}We.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},We.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},We.fromSaved=function(t,e,n){return e instanceof Fe?new We(t,Ne(t.mode,e.state),n,e.lookAhead):new We(t,Ne(t.mode,e),n)},We.prototype.save=function(t){var e=!1!==t?Ne(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Fe(e,this.maxLookAhead):e};var Ue=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function Ge(t,e,n,i){var r,o=t.doc,s=o.mode;e=Ct(o,e);var a,l=at(o,e.line),c=Be(t,e.line,n),u=new He(l.text,t.options.tabSize,c);for(i&&(a=[]);(i||u.pos<e.ch)&&!u.eol();)u.start=u.pos,r=$e(s,u,c.state),i&&a.push(new Ue(u,r,Ne(o.mode,c.state)));return i?a:new Ue(u,r,c.state)}function Ve(t,e){if(t)for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";null==e[i]?e[i]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(e[i])||(e[i]+=" "+n[2])}return t}function Xe(t,e,n,i,r,o,s){var a=n.flattenSpans;null==a&&(a=t.options.flattenSpans);var l,c=0,u=null,d=new He(e,t.options.tabSize,i),h=t.options.addModeClass&&[null];for(""==e&&Ve(qe(n,i.state),o);!d.eol();){if(d.pos>t.options.maxHighlightLength?(a=!1,s&&je(t,e,i,d.pos),d.pos=e.length,l=null):l=Ve($e(n,d,i.state,h),o),h){var f=h[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||u!=l){for(;c<d.start;)c=Math.min(d.start,c+5e3),r(c,u);u=l}d.start=d.pos}for(;c<d.pos;){var p=Math.min(d.pos,c+5e3);r(p,u),c=p}}var Ke=function(t,e,n){this.text=t,Dt(this,e),this.height=n?n(this):1};function Ye(t){t.parent=null,Et(t)}Ke.prototype.lineNo=function(){return dt(this)},ue(Ke);var Qe={},Je={};function Ze(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?Je:Qe;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function tn(t,e){var n=I("span",null,null,l?"padding-right: .1px":null),i={pre:I("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:(s||l)&&t.getOption("lineWrapping")};e.measure={};for(var r=0;r<=(e.rest?e.rest.length:0);r++){var o=r?e.rest[r-1]:e.line,a=void 0;i.pos=0,i.addToken=nn,we(t.display.measure)&&(a=Qt(o,t.doc.direction))&&(i.addToken=rn(i.addToken,a)),i.map=[];var c=e!=t.display.externalMeasured&&dt(o);sn(o,i,Re(t,o,c)),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=O(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=O(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(be(t.display.measure))),0==r?(e.measure.map=i.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(i.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var u=i.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return se(t,"renderLine",t,e.line,i.pre),i.pre.className&&(i.textClass=O(i.pre.className,i.textClass||"")),i}function en(t){var e=L("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function nn(t,e,n,i,r,o,l){if(e){var c,u=t.splitSpaces?function(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,i="",r=0;r<t.length;r++){var o=t.charAt(r);" "!=o||!n||r!=t.length-1&&32!=t.charCodeAt(r+1)||(o=" "),i+=o,n=" "==o}return i}(e,t.trailingSpace):e,d=t.cm.state.specialChars,h=!1;if(d.test(e)){c=document.createDocumentFragment();for(var f=0;;){d.lastIndex=f;var p=d.exec(e),m=p?p.index-f:e.length-f;if(m){var g=document.createTextNode(u.slice(f,f+m));s&&a<9?c.appendChild(L("span",[g])):c.appendChild(g),t.map.push(t.pos,t.pos+m,g),t.col+=m,t.pos+=m}if(!p)break;f+=m+1;var v=void 0;if("\t"==p[0]){var y=t.cm.options.tabSize,x=y-t.col%y;(v=c.appendChild(L("span",X(x),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),t.col+=x}else"\r"==p[0]||"\n"==p[0]?((v=c.appendChild(L("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),t.col+=1):((v=t.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),s&&a<9?c.appendChild(L("span",[v])):c.appendChild(v),t.col+=1);t.map.push(t.pos,t.pos+1,v),t.pos++}}else t.col+=e.length,c=document.createTextNode(u),t.map.push(t.pos,t.pos+e.length,c),s&&a<9&&(h=!0),t.pos+=e.length;if(t.trailingSpace=32==u.charCodeAt(e.length-1),n||i||r||h||l){var b=n||"";i&&(b+=i),r&&(b+=r);var w=L("span",[c],b,l);return o&&(w.title=o),t.content.appendChild(w)}t.content.appendChild(c)}}function rn(t,e){return function(n,i,r,o,s,a,l){r=r?r+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+i.length;;){for(var d=void 0,h=0;h<e.length&&!((d=e[h]).to>c&&d.from<=c);h++);if(d.to>=u)return t(n,i,r,o,s,a,l);t(n,i.slice(0,d.to-c),r,o,null,a,l),o=null,i=i.slice(d.to-c),c=d.to}}}function on(t,e,n,i){var r=!i&&n.widgetNode;r&&t.map.push(t.pos,t.pos+e,r),!i&&t.cm.display.input.needsContentAttribute&&(r||(r=t.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(t.cm.display.input.setUneditable(r),t.content.appendChild(r)),t.pos+=e,t.trailingSpace=!1}function sn(t,e,n){var i=t.markedSpans,r=t.text,o=0;if(i)for(var s,a,l,c,u,d,h,f=r.length,p=0,m=1,g="",v=0;;){if(v==p){l=c=u=d=a="",h=null,v=1/0;for(var y=[],x=void 0,b=0;b<i.length;++b){var w=i[b],C=w.marker;"bookmark"==C.type&&w.from==p&&C.widgetNode?y.push(C):w.from<=p&&(null==w.to||w.to>p||C.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),C.className&&(l+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&w.from==p&&(u+=" "+C.startStyle),C.endStyle&&w.to==v&&(x||(x=[])).push(C.endStyle,w.to),C.title&&!d&&(d=C.title),C.collapsed&&(!h||Pt(h.marker,C)<0)&&(h=w)):w.from>p&&v>w.from&&(v=w.from)}if(x)for(var _=0;_<x.length;_+=2)x[_+1]==v&&(c+=" "+x[_]);if(!h||h.from==p)for(var k=0;k<y.length;++k)on(e,0,y[k]);if(h&&(h.from||0)==p){if(on(e,(null==h.to?f+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=f)break;for(var S=Math.min(f,v);;){if(g){var T=p+g.length;if(!h){var M=T>S?g.slice(0,S-p):g;e.addToken(e,M,s?s+l:l,u,p+M.length==v?c:"",d,a)}if(T>=S){g=g.slice(S-p),p=S;break}p=T,u=""}g=r.slice(o,o=n[m++]),s=Ze(n[m++],e.cm.options)}}else for(var A=1;A<n.length;A+=2)e.addToken(e,r.slice(o,o=n[A]),Ze(n[A+1],e.cm.options))}function an(t,e,n){this.line=e,this.rest=function(t){for(var e,n;e=Wt(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}(e),this.size=this.rest?dt(K(this.rest))-n+1:1,this.node=this.text=null,this.hidden=qt(t,e)}function ln(t,e,n){for(var i,r=[],o=e;o<n;o=i){var s=new an(t.doc,at(t.doc,o),o);i=o+s.size,r.push(s)}return r}var cn=null,un=null;function dn(t,e){var n=re(t,e);if(n.length){var i,r=Array.prototype.slice.call(arguments,2);cn?i=cn.delayedCallbacks:un?i=un:(i=un=[],setTimeout(hn,0));for(var o=function(t){i.push(function(){return n[t].apply(null,r)})},s=0;s<n.length;++s)o(s)}}function hn(){var t=un;un=null;for(var e=0;e<t.length;++e)t[e]()}function fn(t,e,n,i){for(var r=0;r<e.changes.length;r++){var o=e.changes[r];"text"==o?gn(t,e):"gutter"==o?yn(t,e,n,i):"class"==o?vn(t,e):"widget"==o&&xn(t,e,i)}e.changes=null}function pn(t){return t.node==t.text&&(t.node=L("div",null,null,"position: relative"),t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text),t.node.appendChild(t.text),s&&a<8&&(t.node.style.zIndex=2)),t.node}function mn(t,e){var n=t.display.externalMeasured;return n&&n.line==e.line?(t.display.externalMeasured=null,e.measure=n.measure,n.built):tn(t,e)}function gn(t,e){var n=e.text.className,i=mn(t,e);e.text==e.node&&(e.node=i.pre),e.text.parentNode.replaceChild(i.pre,e.text),e.text=i.pre,i.bgClass!=e.bgClass||i.textClass!=e.textClass?(e.bgClass=i.bgClass,e.textClass=i.textClass,vn(t,e)):n&&(e.text.className=n)}function vn(t,e){!function(t,e){var n=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),e.background)n?e.background.className=n:(e.background.parentNode.removeChild(e.background),e.background=null);else if(n){var i=pn(e);e.background=i.insertBefore(L("div",null,n),i.firstChild),t.display.input.setUneditable(e.background)}}(t,e),e.line.wrapClass?pn(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var n=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=n||""}function yn(t,e,n,i){if(e.gutter&&(e.node.removeChild(e.gutter),e.gutter=null),e.gutterBackground&&(e.node.removeChild(e.gutterBackground),e.gutterBackground=null),e.line.gutterClass){var r=pn(e);e.gutterBackground=L("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(t.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),t.display.input.setUneditable(e.gutterBackground),r.insertBefore(e.gutterBackground,e.text)}var o=e.line.gutterMarkers;if(t.options.lineNumbers||o){var s=pn(e),a=e.gutter=L("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(t.display.input.setUneditable(a),s.insertBefore(a,e.text),e.line.gutterClass&&(a.className+=" "+e.line.gutterClass),!t.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(e.lineNumber=a.appendChild(L("div",pt(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<t.options.gutters.length;++l){var c=t.options.gutters[l],u=o.hasOwnProperty(c)&&o[c];u&&a.appendChild(L("div",[u],"CodeMirror-gutter-elt","left: "+i.gutterLeft[c]+"px; width: "+i.gutterWidth[c]+"px"))}}}function xn(t,e,n){e.alignable&&(e.alignable=null);for(var i=e.node.firstChild,r=void 0;i;i=r)r=i.nextSibling,"CodeMirror-linewidget"==i.className&&e.node.removeChild(i);wn(t,e,n)}function bn(t,e,n,i){var r=mn(t,e);return e.text=e.node=r.pre,r.bgClass&&(e.bgClass=r.bgClass),r.textClass&&(e.textClass=r.textClass),vn(t,e),yn(t,e,n,i),wn(t,e,i),e.node}function wn(t,e,n){if(Cn(t,e.line,e,n,!0),e.rest)for(var i=0;i<e.rest.length;i++)Cn(t,e.rest[i],e,n,!1)}function Cn(t,e,n,i,r){if(e.widgets)for(var o=pn(n),s=0,a=e.widgets;s<a.length;++s){var l=a[s],c=L("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),_n(l,c,n,i),t.display.input.setUneditable(c),r&&l.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),dn(l,"redraw")}}function _n(t,e,n,i){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var r=i.wrapperWidth;e.style.left=i.fixedPos+"px",t.coverGutter||(r-=i.gutterTotalWidth,e.style.paddingLeft=i.gutterTotalWidth+"px"),e.style.width=r+"px"}t.coverGutter&&(e.style.zIndex=5,e.style.position="relative",t.noHScroll||(e.style.marginLeft=-i.gutterTotalWidth+"px"))}function kn(t){if(null!=t.height)return t.height;var e=t.doc.cm;if(!e)return 0;if(!E(document.body,t.node)){var n="position: relative;";t.coverGutter&&(n+="margin-left: -"+e.display.gutters.offsetWidth+"px;"),t.noHScroll&&(n+="width: "+e.display.wrapper.clientWidth+"px;"),A(e.display.measure,L("div",[t.node],null,n))}return t.height=t.node.parentNode.offsetHeight}function Sn(t,e){for(var n=me(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function Tn(t){return t.lineSpace.offsetTop}function Mn(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function An(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=A(t.measure,L("pre","x")),n=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(t.cachedPaddingH=i),i}function Ln(t){return B-t.display.nativeBarWidth}function In(t){return t.display.scroller.clientWidth-Ln(t)-t.display.barWidth}function En(t){return t.display.scroller.clientHeight-Ln(t)-t.display.barHeight}function Dn(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var i=0;i<t.rest.length;i++)if(t.rest[i]==e)return{map:t.measure.maps[i],cache:t.measure.caches[i]};for(var r=0;r<t.rest.length;r++)if(dt(t.rest[r])>n)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}function Nn(t,e,n,i){return Hn(t,Pn(t,e),n,i)}function On(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[ci(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function Pn(t,e){var n=dt(e),i=On(t,n);i&&!i.text?i=null:i&&i.changes&&(fn(t,i,n,ri(t)),t.curOp.forceUpdate=!0),i||(i=function(t,e){var n=dt(e=Rt(e)),i=t.display.externalMeasured=new an(t.doc,e,n);i.lineN=n;var r=i.built=tn(t,i);return i.text=r.pre,A(t.display.lineMeasure,r.pre),i}(t,e));var r=Dn(i,e,n);return{line:e,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function Hn(t,e,n,i,r){e.before&&(n=-1);var o,l=n+(i||"");return e.cache.hasOwnProperty(l)?o=e.cache[l]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(function(t,e,n){var i=t.options.lineWrapping,r=i&&In(t);if(!e.measure.heights||i&&e.measure.width!=r){var o=e.measure.heights=[];if(i){e.measure.width=r;for(var s=e.text.firstChild.getClientRects(),a=0;a<s.length-1;a++){var l=s[a],c=s[a+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(t,e.view,e.rect),e.hasHeights=!0),(o=function(t,e,n,i){var r,o=zn(e.map,n,i),l=o.node,c=o.start,u=o.end,d=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;c&&rt(e.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&rt(e.line.text.charAt(o.coverStart+u));)++u;if((r=s&&a<9&&0==c&&u==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():Rn(S(l,c,u).getClientRects(),i)).left||r.right||0==c)break;u=c,c-=1,d="right"}s&&a<11&&(r=function(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(t){if(null!=Te)return Te;var e=A(t,L("span","x")),n=e.getBoundingClientRect(),i=S(e,0,1).getBoundingClientRect();return Te=Math.abs(n.left-i.left)>1}(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*i,bottom:e.bottom*i}}(t.display.measure,r))}else{var f;c>0&&(d=i="right"),r=t.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==i?f.length-1:0]:l.getBoundingClientRect()}if(s&&a<9&&!c&&(!r||!r.left&&!r.right)){var p=l.parentNode.getClientRects()[0];r=p?{left:p.left,right:p.left+ii(t.display),top:p.top,bottom:p.bottom}:Wn}for(var m=r.top-e.rect.top,g=r.bottom-e.rect.top,v=(m+g)/2,y=e.view.measure.heights,x=0;x<y.length-1&&!(v<y[x]);x++);var b=x?y[x-1]:0,w=y[x],C={left:("right"==d?r.right:r.left)-e.rect.left,right:("left"==d?r.left:r.right)-e.rect.left,top:b,bottom:w};return r.left||r.right||(C.bogus=!0),t.options.singleCursorHeightPerLine||(C.rtop=m,C.rbottom=g),C}(t,e,n,i)).bogus||(e.cache[l]=o)),{left:o.left,right:o.right,top:r?o.rtop:o.top,bottom:r?o.rbottom:o.bottom}}var Fn,Wn={left:0,right:0,top:0,bottom:0};function zn(t,e,n){for(var i,r,o,s,a,l,c=0;c<t.length;c+=3)if(a=t[c],l=t[c+1],e<a?(r=0,o=1,s="left"):e<l?o=1+(r=e-a):(c==t.length-3||e==l&&t[c+3]>e)&&(r=(o=l-a)-1,e>=l&&(s="right")),null!=r){if(i=t[c+2],a==l&&n==(i.insertLeft?"left":"right")&&(s=n),"left"==n&&0==r)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)i=t[2+(c-=3)],s="left";if("right"==n&&r==l-a)for(;c<t.length-3&&t[c+3]==t[c+4]&&!t[c+5].insertLeft;)i=t[(c+=3)+2],s="right";break}return{node:i,start:r,end:o,collapse:s,coverStart:a,coverEnd:l}}function Rn(t,e){var n=Wn;if("left"==e)for(var i=0;i<t.length&&(n=t[i]).left==n.right;i++);else for(var r=t.length-1;r>=0&&(n=t[r]).left==n.right;r--);return n}function Bn(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e<t.rest.length;e++)t.measure.caches[e]={}}function jn(t){t.display.externalMeasure=null,M(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)Bn(t.display.view[e])}function qn(t){jn(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function $n(){return u&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Un(){return u&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Gn(t,e,n,i,r){if(!r&&e.widgets)for(var o=0;o<e.widgets.length;++o)if(e.widgets[o].above){var s=kn(e.widgets[o]);n.top+=s,n.bottom+=s}if("line"==i)return n;i||(i="local");var a=Ut(e);if("local"==i?a+=Tn(t.display):a-=t.display.viewOffset,"page"==i||"window"==i){var l=t.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==i?0:Un());var c=l.left+("window"==i?0:$n());n.left+=c,n.right+=c}return n.top+=a,n.bottom+=a,n}function Vn(t,e,n){if("div"==n)return e;var i=e.left,r=e.top;if("page"==n)i-=$n(),r-=Un();else if("local"==n||!n){var o=t.display.sizer.getBoundingClientRect();i+=o.left,r+=o.top}var s=t.display.lineSpace.getBoundingClientRect();return{left:i-s.left,top:r-s.top}}function Xn(t,e,n,i,r){return i||(i=at(t.doc,e.line)),Gn(t,i,Nn(t,i,e.ch,r),n)}function Kn(t,e,n,i,r,o){function s(e,s){var a=Hn(t,r,e,s?"right":"left",o);return s?a.left=a.right:a.right=a.left,Gn(t,i,a,n)}i=i||at(t.doc,e.line),r||(r=Pn(t,i));var a=Qt(i,t.doc.direction),l=e.ch,c=e.sticky;if(l>=i.text.length?(l=i.text.length,c="before"):l<=0&&(l=0,c="after"),!a)return s("before"==c?l-1:l,"before"==c);function u(t,e,n){var i=a[e],r=i.level%2!=0;return s(n?t-1:t,r!=n)}var d=Kt(a,l,c),h=Xt,f=u(l,d,"before"==c);return null!=h&&(f.other=u(l,h,"before"!=c)),f}function Yn(t,e){var n=0;e=Ct(t.doc,e),t.options.lineWrapping||(n=ii(t.display)*e.ch);var i=at(t.doc,e.line),r=Ut(i)+Tn(t.display);return{left:n,right:n,top:r,bottom:r+i.height}}function Qn(t,e,n,i,r){var o=mt(t,e,n);return o.xRel=r,i&&(o.outside=!0),o}function Jn(t,e,n){var i=t.doc;if((n+=t.display.viewOffset)<0)return Qn(i.first,0,null,!0,-1);var r=ht(i,n),o=i.first+i.size-1;if(r>o)return Qn(i.first+i.size-1,at(i,o).text.length,null,!0,1);e<0&&(e=0);for(var s=at(i,r);;){var a=ei(t,s,r,e,n),l=Wt(s),c=l&&l.find(0,!0);if(!l||!(a.ch>c.from.ch||a.ch==c.from.ch&&a.xRel>0))return a;r=dt(s=c.to.line)}}function Zn(t,e,n,i){var r=function(i){return Gn(t,e,Hn(t,n,i),"line")},o=e.text.length,s=st(function(t){return r(t-1).bottom<=i},o,0);return o=st(function(t){return r(t).top>i},s,o),{begin:s,end:o}}function ti(t,e,n,i){var r=Gn(t,e,Hn(t,n,i),"line").top;return Zn(t,e,n,r)}function ei(t,e,n,i,r){r-=Ut(e);var o,s=0,a=e.text.length,l=Pn(t,e),c=Qt(e,t.doc.direction);if(c){var u;t.options.lineWrapping&&(u=Zn(t,e,l,r),s=u.begin,a=u.end),o=new mt(n,Math.floor(s+(a-s)/2));var d,h,f=Kn(t,o,"line",e,l).left,p=f<i?1:-1,m=f-i,g=Math.ceil((a-s)/4);t:do{d=m,h=o;for(var v=0;v<g;++v){var y=o;if(null==(o=ee(t,e,o,p))||o.ch<s||a<=("before"==o.sticky?o.ch-1:o.ch)){o=y;break t}}if(m=Kn(t,o,"line",e,l).left-i,g>1){var x=Math.abs(m-d)/g;g=Math.min(g,Math.ceil(Math.abs(m)/x)),p=m<0?1:-1}}while(0!=m&&(g>1||p<0!=m<0&&Math.abs(m)<=Math.abs(d)));if(Math.abs(m)>Math.abs(d)){if(m<0==d<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=h}}else{var b=st(function(n){var o=Gn(t,e,Hn(t,l,n),"line");return o.top>r?(a=Math.min(n,a),!0):!(o.bottom<=r)&&(o.left>i||!(o.right<i)&&i-o.left<o.right-i)},s,a);b=ot(e.text,b,1),o=new mt(n,b,b==a?"before":"after")}var w=Kn(t,o,"line",e,l);return(r<w.top||w.bottom<r)&&(o.outside=!0),o.xRel=i<w.left?-1:i>w.right?1:0,o}function ni(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==Fn){Fn=L("pre");for(var e=0;e<49;++e)Fn.appendChild(document.createTextNode("x")),Fn.appendChild(L("br"));Fn.appendChild(document.createTextNode("x"))}A(t.measure,Fn);var n=Fn.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),M(t.measure),n||1}function ii(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=L("span","xxxxxxxxxx"),n=L("pre",[e]);A(t.measure,n);var i=e.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(t.cachedCharWidth=r),r||10}function ri(t){for(var e=t.display,n={},i={},r=e.gutters.clientLeft,o=e.gutters.firstChild,s=0;o;o=o.nextSibling,++s)n[t.options.gutters[s]]=o.offsetLeft+o.clientLeft+r,i[t.options.gutters[s]]=o.clientWidth;return{fixedPos:oi(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:e.wrapper.clientWidth}}function oi(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function si(t){var e=ni(t.display),n=t.options.lineWrapping,i=n&&Math.max(5,t.display.scroller.clientWidth/ii(t.display)-3);return function(r){if(qt(t.doc,r))return 0;var o=0;if(r.widgets)for(var s=0;s<r.widgets.length;s++)r.widgets[s].height&&(o+=r.widgets[s].height);return n?o+(Math.ceil(r.text.length/i)||1)*e:o+e}}function ai(t){var e=t.doc,n=si(t);e.iter(function(t){var e=n(t);e!=t.height&&ut(t,e)})}function li(t,e,n,i){var r=t.display;if(!n&&"true"==me(e).getAttribute("cm-not-content"))return null;var o,s,a=r.lineSpace.getBoundingClientRect();try{o=e.clientX-a.left,s=e.clientY-a.top}catch(e){return null}var l,c=Jn(t,o,s);if(i&&1==c.xRel&&(l=at(t.doc,c.line).text).length==c.ch){var u=W(l,l.length,t.options.tabSize)-l.length;c=mt(c.line,Math.max(0,Math.round((o-An(t.display).left)/ii(t.display))-u))}return c}function ci(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,i=0;i<n.length;i++)if((e-=n[i].size)<0)return i}function ui(t){t.display.input.showSelection(t.display.input.prepareSelection())}function di(t,e){for(var n=t.doc,i={},r=i.cursors=document.createDocumentFragment(),o=i.selection=document.createDocumentFragment(),s=0;s<n.sel.ranges.length;s++)if(!1!==e||s!=n.sel.primIndex){var a=n.sel.ranges[s];if(!(a.from().line>=t.display.viewTo||a.to().line<t.display.viewFrom)){var l=a.empty();(l||t.options.showCursorWhenSelecting)&&hi(t,a.head,r),l||fi(t,a,o)}}return i}function hi(t,e,n){var i=Kn(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),r=n.appendChild(L("div"," ","CodeMirror-cursor"));if(r.style.left=i.left+"px",r.style.top=i.top+"px",r.style.height=Math.max(0,i.bottom-i.top)*t.options.cursorHeight+"px",i.other){var o=n.appendChild(L("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=i.other.left+"px",o.style.top=i.other.top+"px",o.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function fi(t,e,n){var i=t.display,r=t.doc,o=document.createDocumentFragment(),s=An(t.display),a=s.left,l=Math.max(i.sizerWidth,In(t)-i.sizer.offsetLeft)-s.right;function c(t,e,n,i){e<0&&(e=0),e=Math.round(e),i=Math.round(i),o.appendChild(L("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(i-e)+"px"))}function u(e,n,i){var o,s,u=at(r,e),d=u.text.length;function h(n,i){return Xn(t,mt(e,n),"div",u,i)}return function(t,e,n,i){if(!t)return i(e,n,"ltr");for(var r=!1,o=0;o<t.length;++o){var s=t[o];(s.from<n&&s.to>e||e==n&&s.to==e)&&(i(Math.max(s.from,e),Math.min(s.to,n),1==s.level?"rtl":"ltr"),r=!0)}r||i(e,n,"ltr")}(Qt(u,r.direction),n||0,null==i?d:i,function(t,e,r){var u,f,p,m=h(t,"left");if(t==e)u=m,f=p=m.left;else{if(u=h(e-1,"right"),"rtl"==r){var g=m;m=u,u=g}f=m.left,p=u.right}null==n&&0==t&&(f=a),u.top-m.top>3&&(c(f,m.top,null,m.bottom),f=a,m.bottom<u.top&&c(f,m.bottom,null,u.top)),null==i&&e==d&&(p=l),(!o||m.top<o.top||m.top==o.top&&m.left<o.left)&&(o=m),(!s||u.bottom>s.bottom||u.bottom==s.bottom&&u.right>s.right)&&(s=u),f<a+1&&(f=a),c(f,u.top,p-f,u.bottom)}),{start:o,end:s}}var d=e.from(),h=e.to();if(d.line==h.line)u(d.line,d.ch,h.ch);else{var f=at(r,d.line),p=at(r,h.line),m=Rt(f)==Rt(p),g=u(d.line,d.ch,m?f.text.length+1:null).end,v=u(h.line,m?0:null,h.ch).start;m&&(g.top<v.top-2?(c(g.right,g.top,null,g.bottom),c(a,v.top,v.left,v.bottom)):c(g.right,g.top,v.left-g.right,g.bottom)),g.bottom<v.top&&c(a,g.bottom,null,v.top)}n.appendChild(o)}function pi(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="",t.options.cursorBlinkRate>0?e.blinker=setInterval(function(){return e.cursorDiv.style.visibility=(n=!n)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function mi(t){t.state.focused||(t.display.input.focus(),vi(t))}function gi(t){t.state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,yi(t))},100)}function vi(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(se(t,"focus",t,e),t.state.focused=!0,N(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),pi(t))}function yi(t,e){t.state.delayingBlurEvent||(t.state.focused&&(se(t,"blur",t,e),t.state.focused=!1,T(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function xi(t){for(var e=t.display,n=e.lineDiv.offsetTop,i=0;i<e.view.length;i++){var r=e.view[i],o=void 0;if(!r.hidden){if(s&&a<8){var l=r.node.offsetTop+r.node.offsetHeight;o=l-n,n=l}else{var c=r.node.getBoundingClientRect();o=c.bottom-c.top}var u=r.line.height-o;if(o<2&&(o=ni(e)),(u>.005||u<-.005)&&(ut(r.line,o),bi(r.line),r.rest))for(var d=0;d<r.rest.length;d++)bi(r.rest[d])}}}function bi(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e)t.widgets[e].height=t.widgets[e].node.parentNode.offsetHeight}function wi(t,e,n){var i=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;i=Math.floor(i-Tn(t));var r=n&&null!=n.bottom?n.bottom:i+t.wrapper.clientHeight,o=ht(e,i),s=ht(e,r);if(n&&n.ensure){var a=n.ensure.from.line,l=n.ensure.to.line;a<o?(o=a,s=ht(e,Ut(at(e,a))+t.wrapper.clientHeight)):Math.min(l,e.lastLine())>=s&&(o=ht(e,Ut(at(e,l))-t.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function Ci(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var i=oi(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,o=i+"px",s=0;s<n.length;s++)if(!n[s].hidden){t.options.fixedGutter&&(n[s].gutter&&(n[s].gutter.style.left=o),n[s].gutterBackground&&(n[s].gutterBackground.style.left=o));var a=n[s].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=o}t.options.fixedGutter&&(e.gutters.style.left=i+r+"px")}}function _i(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=pt(t.options,e.first+e.size-1),i=t.display;if(n.length!=i.lineNumChars){var r=i.measure.appendChild(L("div",[L("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=r.firstChild.offsetWidth,s=r.offsetWidth-o;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-s)+1,i.lineNumWidth=i.lineNumInnerWidth+s,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",lr(t),!0}return!1}function ki(t,e){var n=t.display,i=ni(t.display);e.top<0&&(e.top=0);var r=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=En(t),s={};e.bottom-e.top>o&&(e.bottom=e.top+o);var a=t.doc.height+Mn(n),l=e.top<i,c=e.bottom>a-i;if(e.top<r)s.scrollTop=l?0:e.top;else if(e.bottom>r+o){var u=Math.min(e.top,(c?a:e.bottom)-o);u!=r&&(s.scrollTop=u)}var d=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft,h=In(t)-(t.options.fixedGutter?n.gutters.offsetWidth:0),f=e.right-e.left>h;return f&&(e.right=e.left+h),e.left<10?s.scrollLeft=0:e.left<d?s.scrollLeft=Math.max(0,e.left-(f?0:10)):e.right>h+d-3&&(s.scrollLeft=e.right+(f?0:10)-h),s}function Si(t,e){null!=e&&(Ai(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Ti(t){Ai(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Mi(t,e,n){null==e&&null==n||Ai(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Ai(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=Yn(t,e.from),i=Yn(t,e.to);Li(t,n,i,e.margin)}}function Li(t,e,n,i){var r=ki(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-i,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+i});Mi(t,r.scrollLeft,r.scrollTop)}function Ii(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||ar(t,{top:e}),Ei(t,e,!0),n&&ar(t),nr(t,100))}function Ei(t,e,n){e=Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function Di(t,e,n,i){e=Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!i||(t.doc.scrollLeft=e,Ci(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function Ni(t){var e=t.display,n=e.gutters.offsetWidth,i=Math.round(t.doc.height+Mn(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Ln(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var Oi=function(t,e,n){this.cm=n;var i=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");t(i),t(r),ie(i,"scroll",function(){i.clientHeight&&e(i.scrollTop,"vertical")}),ie(r,"scroll",function(){r.clientWidth&&e(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Oi.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,i=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?i+"px":"0";var r=t.viewHeight-(e?i:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:e?i:0}},Oi.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Oi.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Oi.prototype.zeroWidthHack=function(){var t=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},Oi.prototype.enableZeroWidthBar=function(t,e,n){t.style.pointerEvents="auto",e.set(1e3,function i(){var r=t.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);o!=t?t.style.pointerEvents="none":e.set(1e3,i)})},Oi.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var Pi=function(){};function Hi(t,e){e||(e=Ni(t));var n=t.display.barWidth,i=t.display.barHeight;Fi(t,e);for(var r=0;r<4&&n!=t.display.barWidth||i!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&xi(t),Fi(t,Ni(t)),n=t.display.barWidth,i=t.display.barHeight}function Fi(t,e){var n=t.display,i=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}Pi.prototype.update=function(){return{bottom:0,right:0}},Pi.prototype.setScrollLeft=function(){},Pi.prototype.setScrollTop=function(){},Pi.prototype.clear=function(){};var Wi={native:Oi,null:Pi};function zi(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&T(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Wi[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ie(e,"mousedown",function(){t.state.focused&&setTimeout(function(){return t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?Di(t,e):Ii(t,e)},t),t.display.scrollbars.addClass&&N(t.display.wrapper,t.display.scrollbars.addClass)}var Ri=0;function Bi(t){var e;t.curOp={cm:t,viewChanged:!1,startHeight:t.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:++Ri},e=t.curOp,cn?cn.ops.push(e):e.ownsGroup=cn={ops:[e],delayedCallbacks:[]}}function ji(t){var e=t.curOp;!function(t,e){var n=t.ownsGroup;if(n)try{!function(t){var e=t.delayedCallbacks,n=0;do{for(;n<e.length;n++)e[n].call(null);for(var i=0;i<t.ops.length;i++){var r=t.ops[i];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(n<e.length)}(n)}finally{cn=null,e(n)}}(e,function(t){for(var e=0;e<t.ops.length;e++)t.ops[e].cm.curOp=null;!function(t){for(var e=t.ops,n=0;n<e.length;n++)qi(e[n]);for(var i=0;i<e.length;i++)(r=e[i]).updatedDisplay=r.mustUpdate&&or(r.cm,r.update);for(var r,o=0;o<e.length;o++)$i(e[o]);for(var s=0;s<e.length;s++)Ui(e[s]);for(var a=0;a<e.length;a++)Gi(e[a])}(t)})}function qi(t){var e=t.cm,n=e.display;!function(t){var e=t.display;!e.scrollbarsClipped&&e.scroller.offsetWidth&&(e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth,e.heightForcer.style.height=Ln(t)+"px",e.sizer.style.marginBottom=-e.nativeBarWidth+"px",e.sizer.style.borderRightWidth=Ln(t)+"px",e.scrollbarsClipped=!0)}(e),t.updateMaxLine&&Vt(e),t.mustUpdate=t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new rr(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function $i(t){var e=t.cm,n=e.display;t.updatedDisplay&&xi(e),t.barMeasure=Ni(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=Nn(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Ln(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-In(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection(t.focus))}function Ui(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<e.doc.scrollLeft&&Di(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0),e.display.maxLineChanged=!1);var n=t.focus&&t.focus==D()&&(!document.hasFocus||document.hasFocus());t.preparedSelection&&e.display.input.showSelection(t.preparedSelection,n),(t.updatedDisplay||t.startHeight!=e.doc.height)&&Hi(e,t.barMeasure),t.updatedDisplay&&cr(e,t.barMeasure),t.selectionChanged&&pi(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),n&&mi(t.cm)}function Gi(t){var e=t.cm,n=e.display,i=e.doc;if(t.updatedDisplay&&sr(e,t.update),null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=t.scrollTop&&Ei(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&Di(e,t.scrollLeft,!0,!0),t.scrollToPos){var r=function(t,e,n,i){var r;null==i&&(i=0),t.options.lineWrapping||e!=n||(e=e.ch?mt(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e,n="before"==e.sticky?mt(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var s=!1,a=Kn(t,e),l=n&&n!=e?Kn(t,n):a;r={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-i,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+i};var c=ki(t,r),u=t.doc.scrollTop,d=t.doc.scrollLeft;if(null!=c.scrollTop&&(Ii(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(s=!0)),null!=c.scrollLeft&&(Di(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-d)>1&&(s=!0)),!s)break}return r}(e,Ct(i,t.scrollToPos.from),Ct(i,t.scrollToPos.to),t.scrollToPos.margin);!function(t,e){if(!ae(t,"scrollCursorIntoView")){var n=t.display,i=n.sizer.getBoundingClientRect(),r=null;if(e.top+i.top<0?r=!0:e.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!p){var o=L("div","",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Tn(t.display))+"px;\n height: "+(e.bottom-e.top+Ln(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(r),t.display.lineSpace.removeChild(o)}}}(e,r)}var o=t.maybeHiddenMarkers,s=t.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||se(o[a],"hide");if(s)for(var l=0;l<s.length;++l)s[l].lines.length&&se(s[l],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=e.display.scroller.scrollTop),t.changeObjs&&se(e,"changes",e,t.changeObjs),t.update&&t.update.finish()}function Vi(t,e){if(t.curOp)return e();Bi(t);try{return e()}finally{ji(t)}}function Xi(t,e){return function(){if(t.curOp)return e.apply(t,arguments);Bi(t);try{return e.apply(t,arguments)}finally{ji(t)}}}function Ki(t){return function(){if(this.curOp)return t.apply(this,arguments);Bi(this);try{return t.apply(this,arguments)}finally{ji(this)}}}function Yi(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Bi(e);try{return t.apply(this,arguments)}finally{ji(e)}}}function Qi(t,e,n,i){null==e&&(e=t.doc.first),null==n&&(n=t.doc.first+t.doc.size),i||(i=0);var r=t.display;if(i&&n<r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>e)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)St&&Bt(t.doc,e)<r.viewTo&&Zi(t);else if(n<=r.viewFrom)St&&jt(t.doc,n+i)>r.viewFrom?Zi(t):(r.viewFrom+=i,r.viewTo+=i);else if(e<=r.viewFrom&&n>=r.viewTo)Zi(t);else if(e<=r.viewFrom){var o=tr(t,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):Zi(t)}else if(n>=r.viewTo){var s=tr(t,e,e,-1);s?(r.view=r.view.slice(0,s.index),r.viewTo=s.lineN):Zi(t)}else{var a=tr(t,e,e,-1),l=tr(t,n,n+i,1);a&&l?(r.view=r.view.slice(0,a.index).concat(ln(t,a.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):Zi(t)}var c=r.externalMeasured;c&&(n<c.lineN?c.lineN+=i:e<c.lineN+c.size&&(r.externalMeasured=null))}function Ji(t,e,n){t.curOp.viewChanged=!0;var i=t.display,r=t.display.externalMeasured;if(r&&e>=r.lineN&&e<r.lineN+r.size&&(i.externalMeasured=null),!(e<i.viewFrom||e>=i.viewTo)){var o=i.view[ci(t,e)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==R(s,n)&&s.push(n)}}}function Zi(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function tr(t,e,n,i){var r,o=ci(t,e),s=t.display.view;if(!St||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var a=t.display.viewFrom,l=0;l<o;l++)a+=s[l].size;if(a!=e){if(i>0){if(o==s.length-1)return null;r=a+s[o].size-e,o++}else r=a-e;e+=r,n+=r}for(;Bt(t.doc,n)!=n;){if(o==(i<0?0:s.length-1))return null;n+=i*s[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function er(t){for(var e=t.display.view,n=0,i=0;i<e.length;i++){var r=e[i];r.hidden||r.node&&!r.changes||++n}return n}function nr(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,H(ir,t))}function ir(t){var e=t.doc;if(!(e.highlightFrontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,i=Be(t,e.highlightFrontier),r=[];e.iter(i.line,Math.min(e.first+e.size,t.display.viewTo+500),function(o){if(i.line>=t.display.viewFrom){var s=o.styles,a=o.text.length>t.options.maxHighlightLength?Ne(e.mode,i.state):null,l=ze(t,o,i,!0);a&&(i.state=a),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!s||s.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!d&&h<s.length;++h)d=s[h]!=o.styles[h];d&&r.push(i.line),o.stateAfter=i.save(),i.nextLine()}else o.text.length<=t.options.maxHighlightLength&&je(t,o.text,i),o.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>n)return nr(t,t.options.workDelay),!0}),e.highlightFrontier=i.line,e.modeFrontier=Math.max(e.modeFrontier,i.line),r.length&&Vi(t,function(){for(var e=0;e<r.length;e++)Ji(t,r[e],"text")})}}var rr=function(t,e,n){var i=t.display;this.viewport=e,this.visible=wi(i,t.doc,e),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=In(t),this.force=n,this.dims=ri(t),this.events=[]};function or(t,e){var n=t.display,i=t.doc;if(e.editorIsHidden)return Zi(t),!1;if(!e.force&&e.visible.from>=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==er(t))return!1;_i(t)&&(Zi(t),e.dims=ri(t));var r=i.first+i.size,o=Math.max(e.visible.from-t.options.viewportMargin,i.first),s=Math.min(r,e.visible.to+t.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(i.first,n.viewFrom)),n.viewTo>s&&n.viewTo-s<20&&(s=Math.min(r,n.viewTo)),St&&(o=Bt(t.doc,o),s=jt(t.doc,s));var a=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;!function(t,e,n){var i=t.display;0==i.view.length||e>=i.viewTo||n<=i.viewFrom?(i.view=ln(t,e,n),i.viewFrom=e):(i.viewFrom>e?i.view=ln(t,e,i.viewFrom).concat(i.view):i.viewFrom<e&&(i.view=i.view.slice(ci(t,e))),i.viewFrom=e,i.viewTo<n?i.view=i.view.concat(ln(t,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,ci(t,n)))),i.viewTo=n}(t,o,s),n.viewOffset=Ut(at(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var c=er(t);if(!a&&0==c&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(t){if(t.hasFocus())return null;var e=D();if(!e||!E(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&E(t.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}(t);return c>4&&(n.lineDiv.style.display="none"),function(t,e,n){var i=t.display,r=t.options.lineNumbers,o=i.lineDiv,s=o.firstChild;function a(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=i.view,u=i.viewFrom,d=0;d<c.length;d++){var h=c[d];if(h.hidden);else if(h.node&&h.node.parentNode==o){for(;s!=h.node;)s=a(s);var f=r&&null!=e&&e<=u&&h.lineNumber;h.changes&&(R(h.changes,"gutter")>-1&&(f=!1),fn(t,h,u,n)),f&&(M(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(pt(t.options,u)))),s=h.node.nextSibling}else{var p=bn(t,h,u,n);o.insertBefore(p,s)}u+=h.size}for(;s;)s=a(s)}(t,n.updateLineNumbers,e.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(t){if(t&&t.activeElt&&t.activeElt!=D()&&(t.activeElt.focus(),t.anchorNode&&E(document.body,t.anchorNode)&&E(document.body,t.focusNode))){var e=window.getSelection(),n=document.createRange();n.setEnd(t.anchorNode,t.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(t.focusNode,t.focusOffset)}}(u),M(n.cursorDiv),M(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,nr(t,400)),n.updateLineNumbers=null,!0}function sr(t,e){for(var n=e.viewport,i=!0;(i&&t.options.lineWrapping&&e.oldDisplayWidth!=In(t)||(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Mn(t.display)-En(t),n.top)}),e.visible=wi(t.display,t.doc,n),!(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)))&&or(t,e);i=!1){xi(t);var r=Ni(t);ui(t),Hi(t,r),cr(t,r),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function ar(t,e){var n=new rr(t,e);if(or(t,n)){xi(t),sr(t,n);var i=Ni(t);ui(t),Hi(t,i),cr(t,i),n.finish()}}function lr(t){var e=t.display.gutters.offsetWidth;t.display.sizer.style.marginLeft=e+"px"}function cr(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+Ln(t)+"px"}function ur(t){var e=t.display.gutters,n=t.options.gutters;M(e);for(var i=0;i<n.length;++i){var r=n[i],o=e.appendChild(L("div",null,"CodeMirror-gutter "+r));"CodeMirror-linenumbers"==r&&(t.display.lineGutter=o,o.style.width=(t.display.lineNumWidth||1)+"px")}e.style.display=i?"":"none",lr(t)}function dr(t){var e=R(t.gutters,"CodeMirror-linenumbers");-1==e&&t.lineNumbers?t.gutters=t.gutters.concat(["CodeMirror-linenumbers"]):e>-1&&!t.lineNumbers&&(t.gutters=t.gutters.slice(0),t.gutters.splice(e,1))}rr.prototype.signal=function(t,e){ce(t,e)&&this.events.push(arguments)},rr.prototype.finish=function(){for(var t=0;t<this.events.length;t++)se.apply(null,this.events[t])};var hr=0,fr=null;function pr(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function mr(t){var e=pr(t);return e.x*=fr,e.y*=fr,e}function gr(t,e){var i=pr(e),r=i.x,o=i.y,s=t.display,a=s.scroller,c=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&c||o&&u){if(o&&y&&l)t:for(var h=e.target,f=s.view;h!=a;h=h.parentNode)for(var p=0;p<f.length;p++)if(f[p].node==h){t.display.currentWheelTarget=h;break t}if(r&&!n&&!d&&null!=fr)return o&&u&&Ii(t,Math.max(0,a.scrollTop+o*fr)),Di(t,Math.max(0,a.scrollLeft+r*fr)),(!o||o&&u)&&de(e),void(s.wheelStartX=null);if(o&&null!=fr){var m=o*fr,g=t.doc.scrollTop,v=g+s.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):v=Math.min(t.doc.height,v+m+50),ar(t,{top:g,bottom:v})}hr<20&&(null==s.wheelStartX?(s.wheelStartX=a.scrollLeft,s.wheelStartY=a.scrollTop,s.wheelDX=r,s.wheelDY=o,setTimeout(function(){if(null!=s.wheelStartX){var t=a.scrollLeft-s.wheelStartX,e=a.scrollTop-s.wheelStartY,n=e&&s.wheelDY&&e/s.wheelDY||t&&s.wheelDX&&t/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(fr=(fr*hr+n)/(hr+1),++hr)}},200)):(s.wheelDX+=r,s.wheelDY+=o))}}s?fr=-.53:n?fr=15:u?fr=-.7:h&&(fr=-1/3);var vr=function(t,e){this.ranges=t,this.primIndex=e};vr.prototype.primary=function(){return this.ranges[this.primIndex]},vr.prototype.equals=function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var e=0;e<this.ranges.length;e++){var n=this.ranges[e],i=t.ranges[e];if(!vt(n.anchor,i.anchor)||!vt(n.head,i.head))return!1}return!0},vr.prototype.deepCopy=function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new yr(yt(this.ranges[e].anchor),yt(this.ranges[e].head));return new vr(t,this.primIndex)},vr.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},vr.prototype.contains=function(t,e){e||(e=t);for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(gt(e,i.from())>=0&&gt(t,i.to())<=0)return n}return-1};var yr=function(t,e){this.anchor=t,this.head=e};function xr(t,e){var n=t[e];t.sort(function(t,e){return gt(t.from(),e.from())}),e=R(t,n);for(var i=1;i<t.length;i++){var r=t[i],o=t[i-1];if(gt(o.to(),r.from())>=0){var s=bt(o.from(),r.from()),a=xt(o.to(),r.to()),l=o.empty()?r.from()==r.head:o.from()==o.head;i<=e&&--e,t.splice(--i,2,new yr(l?a:s,l?s:a))}}return new vr(t,e)}function br(t,e){return new vr([new yr(t,e||t)],0)}function wr(t){return t.text?mt(t.from.line+t.text.length-1,K(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Cr(t,e){if(gt(t,e.from)<0)return t;if(gt(t,e.to)<=0)return wr(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,i=t.ch;return t.line==e.to.line&&(i+=wr(e).ch-e.to.ch),mt(n,i)}function _r(t,e){for(var n=[],i=0;i<t.sel.ranges.length;i++){var r=t.sel.ranges[i];n.push(new yr(Cr(r.anchor,e),Cr(r.head,e)))}return xr(n,t.sel.primIndex)}function kr(t,e,n){return t.line==e.line?mt(n.line,t.ch-e.ch+n.ch):mt(n.line+(t.line-e.line),t.ch)}function Sr(t){t.doc.mode=Ie(t.options,t.doc.modeOption),Tr(t)}function Tr(t){t.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),t.doc.modeFrontier=t.doc.highlightFrontier=t.doc.first,nr(t,100),t.state.modeGen++,t.curOp&&Qi(t)}function Mr(t,e){return 0==e.from.ch&&0==e.to.ch&&""==K(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function Ar(t,e,n,i){function r(t){return n?n[t]:null}function o(t,n,r){!function(t,e,n,i){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Et(t),Dt(t,n);var r=i?i(t):1;r!=t.height&&ut(t,r)}(t,n,r,i),dn(t,"change",t,e)}function s(t,e){for(var n=[],o=t;o<e;++o)n.push(new Ke(c[o],r(o),i));return n}var a=e.from,l=e.to,c=e.text,u=at(t,a.line),d=at(t,l.line),h=K(c),f=r(c.length-1),p=l.line-a.line;if(e.full)t.insert(0,s(0,c.length)),t.remove(c.length,t.size-c.length);else if(Mr(t,e)){var m=s(0,c.length-1);o(d,d.text,f),p&&t.remove(a.line,p),m.length&&t.insert(a.line,m)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,a.ch)+h+u.text.slice(l.ch),f);else{var g=s(1,c.length-1);g.push(new Ke(h+u.text.slice(l.ch),f,i)),o(u,u.text.slice(0,a.ch)+c[0],r(0)),t.insert(a.line+1,g)}else if(1==c.length)o(u,u.text.slice(0,a.ch)+c[0]+d.text.slice(l.ch),r(0)),t.remove(a.line+1,p);else{o(u,u.text.slice(0,a.ch)+c[0],r(0)),o(d,h+d.text.slice(l.ch),f);var v=s(1,c.length-1);p>1&&t.remove(a.line+1,p-1),t.insert(a.line+1,v)}dn(t,"change",t,e)}function Lr(t,e,n){!function t(i,r,o){if(i.linked)for(var s=0;s<i.linked.length;++s){var a=i.linked[s];if(a.doc!=r){var l=o&&a.sharedHist;n&&!l||(e(a.doc,l),t(a.doc,i,l))}}}(t,null,!0)}function Ir(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e,e.cm=t,ai(t),Sr(t),Er(t),t.options.lineWrapping||Vt(t),t.options.mode=e.modeOption,Qi(t)}function Er(t){("rtl"==t.doc.direction?N:T)(t.display.lineDiv,"CodeMirror-rtl")}function Dr(t){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=t||1}function Nr(t,e){var n={from:yt(e.from),to:wr(e),text:lt(t,e.from,e.to)};return Wr(t,n,e.from.line,e.to.line+1),Lr(t,function(t){return Wr(t,n,e.from.line,e.to.line+1)},!0),n}function Or(t){for(;t.length;){var e=K(t);if(!e.ranges)break;t.pop()}}function Pr(t,e,n,i){var r=t.history;r.undone.length=0;var o,s,a=+new Date;if((r.lastOp==i||r.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&t.cm&&r.lastModTime>a-t.cm.options.historyEventDelay||"*"==e.origin.charAt(0)))&&(o=function(t,e){return e?(Or(t.done),K(t.done)):t.done.length&&!K(t.done).ranges?K(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),K(t.done)):void 0}(r,r.lastOp==i)))s=K(o.changes),0==gt(e.from,e.to)&&0==gt(e.from,s.to)?s.to=wr(e):o.changes.push(Nr(t,e));else{var l=K(r.done);for(l&&l.ranges||Fr(t.sel,r.done),o={changes:[Nr(t,e)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=e.origin,s||se(t,"historyAdded")}function Hr(t,e,n,i){var r=t.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||function(t,e,n,i){var r=e.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}(t,o,K(r.done),e))?r.done[r.done.length-1]=e:Fr(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&Or(r.undone)}function Fr(t,e){var n=K(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Wr(t,e,n,i){var r=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,i),function(n){n.markedSpans&&((r||(r=e["spans_"+t.id]={}))[o]=n.markedSpans),++o})}function zr(t){if(!t)return null;for(var e,n=0;n<t.length;++n)t[n].marker.explicitlyCleared?e||(e=t.slice(0,n)):e&&e.push(t[n]);return e?e.length?e:null:t}function Rr(t,e){var n=function(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var i=[],r=0;r<e.text.length;++r)i.push(zr(n[r]));return i}(t,e),i=Lt(t,e);if(!n)return i;if(!i)return n;for(var r=0;r<n.length;++r){var o=n[r],s=i[r];if(o&&s)t:for(var a=0;a<s.length;++a){for(var l=s[a],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue t;o.push(l)}else s&&(n[r]=s)}return n}function Br(t,e,n){for(var i=[],r=0;r<t.length;++r){var o=t[r];if(o.ranges)i.push(n?vr.prototype.deepCopy.call(o):o);else{var s=o.changes,a=[];i.push({changes:a});for(var l=0;l<s.length;++l){var c=s[l],u=void 0;if(a.push({from:c.from,to:c.to,text:c.text}),e)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&R(e,Number(u[1]))>-1&&(K(a)[d]=c[d],delete c[d])}}}return i}function jr(t,e,n,i){if(i){var r=t.anchor;if(n){var o=gt(e,r)<0;o!=gt(n,r)<0?(r=e,e=n):o!=gt(e,n)<0&&(e=n)}return new yr(r,e)}return new yr(n||e,e)}function qr(t,e,n,i,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),Xr(t,new vr([jr(t.sel.primary(),e,n,r)],0),i)}function $r(t,e,n){for(var i=[],r=t.cm&&(t.cm.display.shift||t.extend),o=0;o<t.sel.ranges.length;o++)i[o]=jr(t.sel.ranges[o],e[o],null,r);var s=xr(i,t.sel.primIndex);Xr(t,s,n)}function Ur(t,e,n,i){var r=t.sel.ranges.slice(0);r[e]=n,Xr(t,xr(r,t.sel.primIndex),i)}function Gr(t,e,n,i){Xr(t,br(e,n),i)}function Vr(t,e,n){var i=t.history.done,r=K(i);r&&r.ranges?(i[i.length-1]=e,Kr(t,e,n)):Xr(t,e,n)}function Xr(t,e,n){Kr(t,e,n),Hr(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function Kr(t,e,n){(ce(t,"beforeSelectionChange")||t.cm&&ce(t.cm,"beforeSelectionChange"))&&(e=function(t,e,n){var i={ranges:e.ranges,update:function(e){this.ranges=[];for(var n=0;n<e.length;n++)this.ranges[n]=new yr(Ct(t,e[n].anchor),Ct(t,e[n].head))},origin:n&&n.origin};return se(t,"beforeSelectionChange",t,i),t.cm&&se(t.cm,"beforeSelectionChange",t.cm,i),i.ranges!=e.ranges?xr(i.ranges,i.ranges.length-1):e}(t,e,n));var i=n&&n.bias||(gt(e.primary().head,t.sel.primary().head)<0?-1:1);Yr(t,Jr(t,e,i,!0)),n&&!1===n.scroll||!t.cm||Ti(t.cm)}function Yr(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=t.cm.curOp.selectionChanged=!0,le(t.cm)),dn(t,"cursorActivity",t))}function Qr(t){Yr(t,Jr(t,t.sel,null,!1))}function Jr(t,e,n,i){for(var r,o=0;o<e.ranges.length;o++){var s=e.ranges[o],a=e.ranges.length==t.sel.ranges.length&&t.sel.ranges[o],l=to(t,s.anchor,a&&a.anchor,n,i),c=to(t,s.head,a&&a.head,n,i);(r||l!=s.anchor||c!=s.head)&&(r||(r=e.ranges.slice(0,o)),r[o]=new yr(l,c))}return r?xr(r,e.primIndex):e}function Zr(t,e,n,i,r){var o=at(t,e.line);if(o.markedSpans)for(var s=0;s<o.markedSpans.length;++s){var a=o.markedSpans[s],l=a.marker;if((null==a.from||(l.inclusiveLeft?a.from<=e.ch:a.from<e.ch))&&(null==a.to||(l.inclusiveRight?a.to>=e.ch:a.to>e.ch))){if(r&&(se(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var c=l.find(i<0?1:-1),u=void 0;if((i<0?l.inclusiveRight:l.inclusiveLeft)&&(c=eo(t,c,-i,c&&c.line==e.line?o:null)),c&&c.line==e.line&&(u=gt(c,n))&&(i<0?u<0:u>0))return Zr(t,c,e,i,r)}var d=l.find(i<0?-1:1);return(i<0?l.inclusiveLeft:l.inclusiveRight)&&(d=eo(t,d,i,d.line==e.line?o:null)),d?Zr(t,d,e,i,r):null}}return e}function to(t,e,n,i,r){var o=i||1,s=Zr(t,e,n,o,r)||!r&&Zr(t,e,n,o,!0)||Zr(t,e,n,-o,r)||!r&&Zr(t,e,n,-o,!0);return s||(t.cantEdit=!0,mt(t.first,0))}function eo(t,e,n,i){return n<0&&0==e.ch?e.line>t.first?Ct(t,mt(e.line-1)):null:n>0&&e.ch==(i||at(t,e.line)).text.length?e.line<t.first+t.size-1?mt(e.line+1,0):null:new mt(e.line,e.ch+n)}function no(t){t.setSelection(mt(t.firstLine(),0),mt(t.lastLine()),q)}function io(t,e,n){var i={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return i.canceled=!0}};return n&&(i.update=function(e,n,r,o){e&&(i.from=Ct(t,e)),n&&(i.to=Ct(t,n)),r&&(i.text=r),void 0!==o&&(i.origin=o)}),se(t,"beforeChange",t,i),t.cm&&se(t.cm,"beforeChange",t.cm,i),i.canceled?null:{from:i.from,to:i.to,text:i.text,origin:i.origin}}function ro(t,e,n){if(t.cm){if(!t.cm.curOp)return Xi(t.cm,ro)(t,e,n);if(t.cm.state.suppressEdits)return}if(!(ce(t,"beforeChange")||t.cm&&ce(t.cm,"beforeChange"))||(e=io(t,e,!0))){var i=kt&&!n&&function(t,e,n){var i=null;if(t.iter(e.line,n.line+1,function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var n=t.markedSpans[e].marker;!n.readOnly||i&&-1!=R(i,n)||(i||(i=[])).push(n)}}),!i)return null;for(var r=[{from:e,to:n}],o=0;o<i.length;++o)for(var s=i[o],a=s.find(0),l=0;l<r.length;++l){var c=r[l];if(!(gt(c.to,a.from)<0||gt(c.from,a.to)>0)){var u=[l,1],d=gt(c.from,a.from),h=gt(c.to,a.to);(d<0||!s.inclusiveLeft&&!d)&&u.push({from:c.from,to:a.from}),(h>0||!s.inclusiveRight&&!h)&&u.push({from:a.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}(t,e.from,e.to);if(i)for(var r=i.length-1;r>=0;--r)oo(t,{from:i[r].from,to:i[r].to,text:r?[""]:e.text});else oo(t,e)}}function oo(t,e){if(1!=e.text.length||""!=e.text[0]||0!=gt(e.from,e.to)){var n=_r(t,e);Pr(t,e,n,t.cm?t.cm.curOp.id:NaN),lo(t,e,n,Lt(t,e));var i=[];Lr(t,function(t,n){n||-1!=R(i,t.history)||(fo(t.history,e),i.push(t.history)),lo(t,e,null,Lt(t,e))})}}function so(t,e,n){if(!t.cm||!t.cm.state.suppressEdits||n){for(var i,r=t.history,o=t.sel,s="undo"==e?r.done:r.undone,a="undo"==e?r.undone:r.done,l=0;l<s.length&&(i=s[l],n?!i.ranges||i.equals(t.sel):i.ranges);l++);if(l!=s.length){for(r.lastOrigin=r.lastSelOrigin=null;(i=s.pop()).ranges;){if(Fr(i,a),n&&!i.equals(t.sel))return void Xr(t,i,{clearRedo:!1});o=i}var c=[];Fr(o,a),a.push({changes:c,generation:r.generation}),r.generation=i.generation||++r.maxGeneration;for(var u=ce(t,"beforeChange")||t.cm&&ce(t.cm,"beforeChange"),d=function(n){var r=i.changes[n];if(r.origin=e,u&&!io(t,r,!1))return s.length=0,{};c.push(Nr(t,r));var o=n?_r(t,r):K(s);lo(t,r,o,Rr(t,r)),!n&&t.cm&&t.cm.scrollIntoView({from:r.from,to:wr(r)});var a=[];Lr(t,function(t,e){e||-1!=R(a,t.history)||(fo(t.history,r),a.push(t.history)),lo(t,r,null,Rr(t,r))})},h=i.changes.length-1;h>=0;--h){var f=d(h);if(f)return f.v}}}}function ao(t,e){if(0!=e&&(t.first+=e,t.sel=new vr(Y(t.sel.ranges,function(t){return new yr(mt(t.anchor.line+e,t.anchor.ch),mt(t.head.line+e,t.head.ch))}),t.sel.primIndex),t.cm)){Qi(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,i=n.viewFrom;i<n.viewTo;i++)Ji(t.cm,i,"gutter")}}function lo(t,e,n,i){if(t.cm&&!t.cm.curOp)return Xi(t.cm,lo)(t,e,n,i);if(e.to.line<t.first)ao(t,e.text.length-1-(e.to.line-e.from.line));else if(!(e.from.line>t.lastLine())){if(e.from.line<t.first){var r=e.text.length-1-(t.first-e.from.line);ao(t,r),e={from:mt(t.first,0),to:mt(e.to.line+r,e.to.ch),text:[K(e.text)],origin:e.origin}}var o=t.lastLine();e.to.line>o&&(e={from:e.from,to:mt(o,at(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=lt(t,e.from,e.to),n||(n=_r(t,e)),t.cm?function(t,e,n){var i=t.doc,r=t.display,o=e.from,s=e.to,a=!1,l=o.line;t.options.lineWrapping||(l=dt(Rt(at(i,o.line))),i.iter(l,s.line+1,function(t){if(t==r.maxLine)return a=!0,!0})),i.sel.contains(e.from,e.to)>-1&&le(t),Ar(i,e,n,si(t)),t.options.lineWrapping||(i.iter(l,o.line+e.text.length,function(t){var e=Gt(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,a=!1)}),a&&(t.curOp.updateMaxLine=!0)),function(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontier<e-10)){for(var n=t.first,i=e-1;i>n;i--){var r=at(t,i).stateAfter;if(r&&(!(r instanceof Fe)||i+r.lookAhead<e)){n=i+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}}(i,o.line),nr(t,400);var c=e.text.length-(s.line-o.line)-1;e.full?Qi(t):o.line!=s.line||1!=e.text.length||Mr(t.doc,e)?Qi(t,o.line,s.line+1,c):Ji(t,o.line,"text");var u=ce(t,"changes"),d=ce(t,"change");if(d||u){var h={from:o,to:s,text:e.text,removed:e.removed,origin:e.origin};d&&dn(t,"change",t,h),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(h)}t.display.selForContextMenu=null}(t.cm,e,i):Ar(t,e,i),Kr(t,n,q)}}function co(t,e,n,i,r){if(i||(i=n),gt(i,n)<0){var o=i;i=n,n=o}"string"==typeof e&&(e=t.splitLines(e)),ro(t,{from:n,to:i,text:e,origin:r})}function uo(t,e,n,i){n<t.line?t.line+=i:e<t.line&&(t.line=e,t.ch=0)}function ho(t,e,n,i){for(var r=0;r<t.length;++r){var o=t[r],s=!0;if(o.ranges){o.copied||((o=t[r]=o.deepCopy()).copied=!0);for(var a=0;a<o.ranges.length;a++)uo(o.ranges[a].anchor,e,n,i),uo(o.ranges[a].head,e,n,i)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(n<c.from.line)c.from=mt(c.from.line+i,c.from.ch),c.to=mt(c.to.line+i,c.to.ch);else if(e<=c.to.line){s=!1;break}}s||(t.splice(0,r+1),r=0)}}}function fo(t,e){var n=e.from.line,i=e.to.line,r=e.text.length-(i-n)-1;ho(t.done,n,i,r),ho(t.undone,n,i,r)}function po(t,e,n,i){var r=e,o=e;return"number"==typeof e?o=at(t,wt(t,e)):r=dt(e),null==r?null:(i(o,r)&&t.cm&&Ji(t.cm,r,n),o)}function mo(t){this.lines=t,this.parent=null;for(var e=0,n=0;n<t.length;++n)t[n].parent=this,e+=t[n].height;this.height=e}function go(t){this.children=t;for(var e=0,n=0,i=0;i<t.length;++i){var r=t[i];e+=r.chunkSize(),n+=r.height,r.parent=this}this.size=e,this.height=n,this.parent=null}yr.prototype.from=function(){return bt(this.anchor,this.head)},yr.prototype.to=function(){return xt(this.anchor,this.head)},yr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},mo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=t,i=t+e;n<i;++n){var r=this.lines[n];this.height-=r.height,Ye(r),dn(r,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){this.height+=n,this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var i=0;i<e.length;++i)e[i].parent=this},iterN:function(t,e,n){for(var i=t+e;t<i;++t)if(n(this.lines[t]))return!0}},go.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var n=0;n<this.children.length;++n){var i=this.children[n],r=i.chunkSize();if(t<r){var o=Math.min(e,r-t),s=i.height;if(i.removeInner(t,o),this.height-=s-i.height,r==o&&(this.children.splice(n--,1),i.parent=null),0==(e-=o))break;t=0}else t-=r}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof mo))){var a=[];this.collapse(a),this.children=[new mo(a)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e<this.children.length;++e)this.children[e].collapse(t)},insertInner:function(t,e,n){this.size+=e.length,this.height+=n;for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(t<=o){if(r.insertInner(t,e,n),r.lines&&r.lines.length>50){for(var s=r.lines.length%25+25,a=s;a<r.lines.length;){var l=new mo(r.lines.slice(a,a+=25));r.height-=l.height,this.children.splice(++i,0,l),l.parent=this}r.lines=r.lines.slice(0,s),this.maybeSpill()}break}t-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=t.children.splice(t.children.length-5,5),n=new go(e);if(t.parent){t.size-=n.size,t.height-=n.height;var i=R(t.parent.children,t);t.parent.children.splice(i+1,0,n)}else{var r=new go(t.children);r.parent=t,t.children=[r,n],t=r}n.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(t<o){var s=Math.min(e,o-t);if(r.iterN(t,s,n))return!0;if(0==(e-=s))break;t=0}else t-=o}}};var vo=function(t,e,n){if(n)for(var i in n)n.hasOwnProperty(i)&&(this[i]=n[i]);this.doc=t,this.node=e};function yo(t,e,n){Ut(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&Si(t,n)}vo.prototype.clear=function(){var t=this.doc.cm,e=this.line.widgets,n=this.line,i=dt(n);if(null!=i&&e){for(var r=0;r<e.length;++r)e[r]==this&&e.splice(r--,1);e.length||(n.widgets=null);var o=kn(this);ut(n,Math.max(0,n.height-o)),t&&(Vi(t,function(){yo(t,n,-o),Ji(t,i,"widget")}),dn(t,"lineWidgetCleared",t,this,i))}},vo.prototype.changed=function(){var t=this,e=this.height,n=this.doc.cm,i=this.line;this.height=null;var r=kn(this)-e;r&&(ut(i,i.height+r),n&&Vi(n,function(){n.curOp.forceUpdate=!0,yo(n,i,r),dn(n,"lineWidgetChanged",n,t,dt(i))}))},ue(vo);var xo=0,bo=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++xo};function wo(t,e,n,i,r){if(i&&i.shared)return function(t,e,n,i,r){(i=F(i)).shared=!1;var o=[wo(t,e,n,i,r)],s=o[0],a=i.widgetNode;return Lr(t,function(t){a&&(i.widgetNode=a.cloneNode(!0)),o.push(wo(t,Ct(t,e),Ct(t,n),i,r));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;s=K(o)}),new Co(o,s)}(t,e,n,i,r);if(t.cm&&!t.cm.curOp)return Xi(t.cm,wo)(t,e,n,i,r);var o=new bo(t,r),s=gt(e,n);if(i&&F(i,o,!1),s>0||0==s&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=I("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(zt(t,e.line,e,n,o)||e.line!=n.line&&zt(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");St=!0}o.addToHistory&&Pr(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var a,l=e.line,c=t.cm;if(t.iter(l,n.line+1,function(t){c&&o.collapsed&&!c.options.lineWrapping&&Rt(t)==c.display.maxLine&&(a=!0),o.collapsed&&l!=e.line&&ut(t,0),function(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t)}(t,new Tt(o,l==e.line?e.ch:null,l==n.line?n.ch:null)),++l}),o.collapsed&&t.iter(e.line,n.line+1,function(e){qt(t,e)&&ut(e,0)}),o.clearOnEnter&&ie(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(kt=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++xo,o.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),o.collapsed)Qi(c,e.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=e.line;u<=n.line;u++)Ji(c,u,"text");o.atomic&&Qr(c.doc),dn(c,"markerAdded",c,o)}return o}bo.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Bi(t),ce(this,"clear")){var n=this.find();n&&dn(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;o<this.lines.length;++o){var s=this.lines[o],a=Mt(s.markedSpans,this);t&&!this.collapsed?Ji(t,dt(s),"text"):t&&(null!=a.to&&(r=dt(s)),null!=a.from&&(i=dt(s))),s.markedSpans=At(s.markedSpans,a),null==a.from&&this.collapsed&&!qt(this.doc,s)&&t&&ut(s,ni(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Rt(this.lines[l]),u=Gt(c);u>t.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&Qi(t,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Qr(t.doc)),t&&dn(t,"markerCleared",t,this,i,r),e&&ji(t),this.parent&&this.parent.clear()}},bo.prototype.find=function(t,e){var n,i;null==t&&"bookmark"==this.type&&(t=1);for(var r=0;r<this.lines.length;++r){var o=this.lines[r],s=Mt(o.markedSpans,this);if(null!=s.from&&(n=mt(e?o:dt(o),s.from),-1==t))return n;if(null!=s.to&&(i=mt(e?o:dt(o),s.to),1==t))return i}return n&&{from:n,to:i}},bo.prototype.changed=function(){var t=this,e=this.find(-1,!0),n=this,i=this.doc.cm;e&&i&&Vi(i,function(){var r=e.line,o=dt(e.line),s=On(i,o);if(s&&(Bn(s),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!qt(n.doc,r)&&null!=n.height){var a=n.height;n.height=null;var l=kn(n)-a;l&&ut(r,r.height+l)}dn(i,"markerChanged",i,t)})},bo.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=R(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},bo.prototype.detachLine=function(t){if(this.lines.splice(R(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},ue(bo);var Co=function(t,e){this.markers=t,this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};function _o(t){return t.findMarks(mt(t.first,0),t.clipPos(mt(t.lastLine())),function(t){return t.parent})}function ko(t){for(var e=function(e){var n=t[e],i=[n.primary.doc];Lr(n.primary.doc,function(t){return i.push(t)});for(var r=0;r<n.markers.length;r++){var o=n.markers[r];-1==R(i,o.doc)&&(o.parent=null,n.markers.splice(r--,1))}},n=0;n<t.length;n++)e(n)}Co.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();dn(this,"clear")}},Co.prototype.find=function(t,e){return this.primary.find(t,e)},ue(Co);var So=0,To=function(t,e,n,i,r){if(!(this instanceof To))return new To(t,e,n,i,r);null==n&&(n=0),go.call(this,[new mo([new Ke("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=mt(n,0);this.sel=br(o),this.history=new Dr(null),this.id=++So,this.modeOption=e,this.lineSep=i,this.direction="rtl"==r?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),Ar(this,{from:o,to:o,text:t}),Xr(this,br(o),q)};To.prototype=J(go.prototype,{constructor:To,iter:function(t,e,n){n?this.iterN(t-this.first,e-t,n):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var n=0,i=0;i<e.length;++i)n+=e[i].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=ct(this,this.first,this.first+this.size);return!1===t?e:e.join(t||this.lineSeparator())},setValue:Yi(function(t){var e=mt(this.first,0),n=this.first+this.size-1;ro(this,{from:e,to:mt(n,at(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&Mi(this.cm,0,0),Xr(this,br(e),q)}),replaceRange:function(t,e,n,i){e=Ct(this,e),n=n?Ct(this,n):e,co(this,t,e,n,i)},getRange:function(t,e,n){var i=lt(this,Ct(this,t),Ct(this,e));return!1===n?i:i.join(n||this.lineSeparator())},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){if(ft(this,t))return at(this,t)},getLineNumber:function(t){return dt(t)},getLineHandleVisualStart:function(t){return"number"==typeof t&&(t=at(this,t)),Rt(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return Ct(this,t)},getCursor:function(t){var e=this.sel.primary();return null==t||"head"==t?e.head:"anchor"==t?e.anchor:"end"==t||"to"==t||!1===t?e.to():e.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Yi(function(t,e,n){Gr(this,Ct(this,"number"==typeof t?mt(t,e||0):t),null,n)}),setSelection:Yi(function(t,e,n){Gr(this,Ct(this,t),Ct(this,e||t),n)}),extendSelection:Yi(function(t,e,n){qr(this,Ct(this,t),e&&Ct(this,e),n)}),extendSelections:Yi(function(t,e){$r(this,_t(this,t),e)}),extendSelectionsBy:Yi(function(t,e){var n=Y(this.sel.ranges,t);$r(this,_t(this,n),e)}),setSelections:Yi(function(t,e,n){if(t.length){for(var i=[],r=0;r<t.length;r++)i[r]=new yr(Ct(this,t[r].anchor),Ct(this,t[r].head));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),Xr(this,xr(i,e),n)}}),addSelection:Yi(function(t,e,n){var i=this.sel.ranges.slice(0);i.push(new yr(Ct(this,t),Ct(this,e||t))),Xr(this,xr(i,i.length-1),n)}),getSelection:function(t){for(var e,n=this.sel.ranges,i=0;i<n.length;i++){var r=lt(this,n[i].from(),n[i].to());e=e?e.concat(r):r}return!1===t?e:e.join(t||this.lineSeparator())},getSelections:function(t){for(var e=[],n=this.sel.ranges,i=0;i<n.length;i++){var r=lt(this,n[i].from(),n[i].to());!1!==t&&(r=r.join(t||this.lineSeparator())),e[i]=r}return e},replaceSelection:function(t,e,n){for(var i=[],r=0;r<this.sel.ranges.length;r++)i[r]=t;this.replaceSelections(i,e,n||"+input")},replaceSelections:Yi(function(t,e,n){for(var i=[],r=this.sel,o=0;o<r.ranges.length;o++){var s=r.ranges[o];i[o]={from:s.from(),to:s.to(),text:this.splitLines(t[o]),origin:n}}for(var a=e&&"end"!=e&&function(t,e,n){for(var i=[],r=mt(t.first,0),o=r,s=0;s<e.length;s++){var a=e[s],l=kr(a.from,r,o),c=kr(wr(a),r,o);if(r=a.to,o=c,"around"==n){var u=t.sel.ranges[s],d=gt(u.head,u.anchor)<0;i[s]=new yr(d?c:l,d?l:c)}else i[s]=new yr(l,l)}return new vr(i,t.sel.primIndex)}(this,i,e),l=i.length-1;l>=0;l--)ro(this,i[l]);a?Vr(this,a):this.cm&&Ti(this.cm)}),undo:Yi(function(){so(this,"undo")}),redo:Yi(function(){so(this,"redo")}),undoSelection:Yi(function(){so(this,"undo",!0)}),redoSelection:Yi(function(){so(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,i=0;i<t.done.length;i++)t.done[i].ranges||++e;for(var r=0;r<t.undone.length;r++)t.undone[r].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){this.history=new Dr(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){return t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:Br(this.history.done),undone:Br(this.history.undone)}},setHistory:function(t){var e=this.history=new Dr(this.history.maxGeneration);e.done=Br(t.done.slice(0),null,!0),e.undone=Br(t.undone.slice(0),null,!0)},setGutterMarker:Yi(function(t,e,n){return po(this,t,"gutter",function(t){var i=t.gutterMarkers||(t.gutterMarkers={});return i[e]=n,!n&&nt(i)&&(t.gutterMarkers=null),!0})}),clearGutter:Yi(function(t){var e=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[t]&&po(e,n,"gutter",function(){return n.gutterMarkers[t]=null,nt(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(t){var e;if("number"==typeof t){if(!ft(this,t))return null;if(e=t,!(t=at(this,t)))return null}else if(null==(e=dt(t)))return null;return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},addLineClass:Yi(function(t,e,n){return po(this,t,"gutter"==e?"gutter":"class",function(t){var i="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[i]){if(k(n).test(t[i]))return!1;t[i]+=" "+n}else t[i]=n;return!0})}),removeLineClass:Yi(function(t,e,n){return po(this,t,"gutter"==e?"gutter":"class",function(t){var i="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",r=t[i];if(!r)return!1;if(null==n)t[i]=null;else{var o=r.match(k(n));if(!o)return!1;var s=o.index+o[0].length;t[i]=r.slice(0,o.index)+(o.index&&s!=r.length?" ":"")+r.slice(s)||null}return!0})}),addLineWidget:Yi(function(t,e,n){return function(t,e,n,i){var r=new vo(t,n,i),o=t.cm;return o&&r.noHScroll&&(o.display.alignWidgets=!0),po(t,e,"widget",function(e){var n=e.widgets||(e.widgets=[]);if(null==r.insertAt?n.push(r):n.splice(Math.min(n.length-1,Math.max(0,r.insertAt)),0,r),r.line=e,o&&!qt(t,e)){var i=Ut(e)<t.scrollTop;ut(e,e.height+kn(r)),i&&Si(o,r.height),o.curOp.forceUpdate=!0}return!0}),dn(o,"lineWidgetAdded",o,r,"number"==typeof e?e:dt(e)),r}(this,t,e,n)}),removeLineWidget:function(t){t.clear()},markText:function(t,e,n){return wo(this,Ct(this,t),Ct(this,e),n,n&&n.type||"range")},setBookmark:function(t,e){var n={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared,handleMouseEvents:e&&e.handleMouseEvents};return wo(this,t=Ct(this,t),t,n,"bookmark")},findMarksAt:function(t){var e=[],n=at(this,(t=Ct(this,t)).line).markedSpans;if(n)for(var i=0;i<n.length;++i){var r=n[i];(null==r.from||r.from<=t.ch)&&(null==r.to||r.to>=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=Ct(this,t),e=Ct(this,e);var i=[],r=t.line;return this.iter(t.line,e.line+1,function(o){var s=o.markedSpans;if(s)for(var a=0;a<s.length;a++){var l=s[a];null!=l.to&&r==t.line&&t.ch>=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r}),i},getAllMarks:function(){var t=[];return this.iter(function(e){var n=e.markedSpans;if(n)for(var i=0;i<n.length;++i)null!=n[i].from&&t.push(n[i].marker)}),t},posFromIndex:function(t){var e,n=this.first,i=this.lineSeparator().length;return this.iter(function(r){var o=r.text.length+i;if(o>t)return e=t,!0;t-=o,++n}),Ct(this,mt(n,e))},indexFromPos:function(t){var e=(t=Ct(this,t)).ch;if(t.line<this.first||t.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,t.line,function(t){e+=t.text.length+n}),e},copy:function(t){var e=new To(ct(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return e.scrollTop=this.scrollTop,e.scrollLeft=this.scrollLeft,e.sel=this.sel,e.extend=!1,t&&(e.history.undoDepth=this.history.undoDepth,e.setHistory(this.getHistory())),e},linkedDoc:function(t){t||(t={});var e=this.first,n=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from),null!=t.to&&t.to<n&&(n=t.to);var i=new To(ct(this,e,n),t.mode||this.modeOption,e,this.lineSep,this.direction);return t.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:t.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],function(t,e){for(var n=0;n<e.length;n++){var i=e[n],r=i.find(),o=t.clipPos(r.from),s=t.clipPos(r.to);if(gt(o,s)){var a=wo(t,o,s,i.primary,i.primary.type);i.markers.push(a),a.parent=i}}}(i,_o(this)),i},unlinkDoc:function(t){if(t instanceof xs&&(t=t.doc),this.linked)for(var e=0;e<this.linked.length;++e){var n=this.linked[e];if(n.doc==t){this.linked.splice(e,1),t.unlinkDoc(this),ko(_o(this));break}}if(t.history==this.history){var i=[t.id];Lr(t,function(t){return i.push(t.id)},!0),t.history=new Dr(null),t.history.done=Br(this.history.done,i),t.history.undone=Br(this.history.undone,i)}},iterLinkedDocs:function(t){Lr(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):_e(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Yi(function(t){var e;"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter(function(t){return t.order=null}),this.cm&&Vi(e=this.cm,function(){Er(e),Qi(e)}))})}),To.prototype.eachLine=To.prototype.iter;var Mo=0;function Ao(t){var e=this;if(Lo(e),!ae(e,t)&&!Sn(e.display,t)){de(t),s&&(Mo=+new Date);var n=li(e,t,!0),i=t.dataTransfer.files;if(n&&!e.isReadOnly())if(i&&i.length&&window.FileReader&&window.File)for(var r=i.length,o=Array(r),a=0,l=function(t,i){if(!e.options.allowDropFileTypes||-1!=R(e.options.allowDropFileTypes,t.type)){var s=new FileReader;s.onload=Xi(e,function(){var t=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(t)&&(t=""),o[i]=t,++a==r){var l={from:n=Ct(e.doc,n),to:n,text:e.doc.splitLines(o.join(e.doc.lineSeparator())),origin:"paste"};ro(e.doc,l),Vr(e.doc,br(n,wr(l)))}}),s.readAsText(t)}},c=0;c<r;++c)l(i[c],c);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-1)return e.state.draggingText(t),void setTimeout(function(){return e.display.input.focus()},20);try{var u=t.dataTransfer.getData("Text");if(u){var d;if(e.state.draggingText&&!e.state.draggingText.copy&&(d=e.listSelections()),Kr(e.doc,br(n,n)),d)for(var h=0;h<d.length;++h)co(e.doc,"",d[h].anchor,d[h].head,"drag");e.replaceSelection(u,"around","paste"),e.display.input.focus()}}catch(t){}}}}function Lo(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function Io(t){if(document.getElementsByClassName)for(var e=document.getElementsByClassName("CodeMirror"),n=0;n<e.length;n++){var i=e[n].CodeMirror;i&&t(i)}}var Eo=!1;function Do(){var t;Eo||(ie(window,"resize",function(){null==t&&(t=setTimeout(function(){t=null,Io(No)},100))}),ie(window,"blur",function(){return Io(yi)}),Eo=!0)}function No(t){var e=t.display;e.lastWrapHeight==e.wrapper.clientHeight&&e.lastWrapWidth==e.wrapper.clientWidth||(e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize())}for(var Oo={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Po=0;Po<10;Po++)Oo[Po+48]=Oo[Po+96]=String(Po);for(var Ho=65;Ho<=90;Ho++)Oo[Ho]=String.fromCharCode(Ho);for(var Fo=1;Fo<=12;Fo++)Oo[Fo+111]=Oo[Fo+63235]="F"+Fo;var Wo={};function zo(t){var e,n,i,r,o=t.split(/-(?!$)/);t=o[o.length-1];for(var s=0;s<o.length-1;s++){var a=o[s];if(/^(cmd|meta|m)$/i.test(a))r=!0;else if(/^a(lt)?$/i.test(a))e=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);i=!0}}return e&&(t="Alt-"+t),n&&(t="Ctrl-"+t),r&&(t="Cmd-"+t),i&&(t="Shift-"+t),t}function Ro(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==i){delete t[n];continue}for(var r=Y(n.split(" "),zo),o=0;o<r.length;o++){var s=void 0,a=void 0;o==r.length-1?(a=r.join(" "),s=i):(a=r.slice(0,o+1).join(" "),s="...");var l=e[a];if(l){if(l!=s)throw new Error("Inconsistent bindings for "+a)}else e[a]=s}delete t[n]}for(var c in e)t[c]=e[c];return t}function Bo(t,e,n,i){var r=(e=Uo(e)).call?e.call(t,i):e[t];if(!1===r)return"nothing";if("..."===r)return"multi";if(null!=r&&n(r))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return Bo(t,e.fallthrough,n,i);for(var o=0;o<e.fallthrough.length;o++){var s=Bo(t,e.fallthrough[o],n,i);if(s)return s}}}function jo(t){var e="string"==typeof t?t:Oo[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function qo(t,e,n){var i=t;return e.altKey&&"Alt"!=i&&(t="Alt-"+t),(C?e.metaKey:e.ctrlKey)&&"Ctrl"!=i&&(t="Ctrl-"+t),(C?e.ctrlKey:e.metaKey)&&"Cmd"!=i&&(t="Cmd-"+t),!n&&e.shiftKey&&"Shift"!=i&&(t="Shift-"+t),t}function $o(t,e){if(d&&34==t.keyCode&&t.char)return!1;var n=Oo[t.keyCode];return null!=n&&!t.altGraphKey&&qo(n,t,e)}function Uo(t){return"string"==typeof t?Wo[t]:t}function Go(t,e){for(var n=t.doc.sel.ranges,i=[],r=0;r<n.length;r++){for(var o=e(n[r]);i.length&&gt(o.from,K(i).to)<=0;){var s=i.pop();if(gt(s.from,o.from)<0){o.from=s.from;break}}i.push(o)}Vi(t,function(){for(var e=i.length-1;e>=0;e--)co(t.doc,"",i[e].from,i[e].to,"+delete");Ti(t)})}Wo.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"},Wo.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"},Wo.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"},Wo.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"]},Wo.default=y?Wo.macDefault:Wo.pcDefault;var Vo={selectAll:no,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),q)},killLine:function(t){return Go(t,function(e){if(e.empty()){var n=at(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:mt(e.head.line+1,0)}:{from:e.head,to:mt(e.head.line,n)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){return Go(t,function(e){return{from:mt(e.from().line,0),to:Ct(t.doc,mt(e.to().line+1,0))}})},delLineLeft:function(t){return Go(t,function(t){return{from:mt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(t){return Go(t,function(e){var n=t.charCoords(e.head,"div").top+5,i=t.coordsChar({left:0,top:n},"div");return{from:i,to:e.from()}})},delWrappedLineRight:function(t){return Go(t,function(e){var n=t.charCoords(e.head,"div").top+5,i=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:e.from(),to:i}})},undo:function(t){return t.undo()},redo:function(t){return t.redo()},undoSelection:function(t){return t.undoSelection()},redoSelection:function(t){return t.redoSelection()},goDocStart:function(t){return t.extendSelection(mt(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(mt(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy(function(e){return Xo(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy(function(e){return Ko(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy(function(e){return function(t,e){var n=at(t.doc,e),i=function(t){for(var e;e=Wt(t);)t=e.find(1,!0).line;return t}(n);return i!=n&&(e=dt(i)),te(!0,t,n,e,-1)}(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy(function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")},U)},goLineLeft:function(t){return t.extendSelectionsBy(function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")},U)},goLineLeftSmart:function(t){return t.extendSelectionsBy(function(e){var n=t.cursorCoords(e.head,"div").top+5,i=t.coordsChar({left:0,top:n},"div");return i.ch<t.getLine(i.line).search(/\S/)?Ko(t,e.head):i},U)},goLineUp:function(t){return t.moveV(-1,"line")},goLineDown:function(t){return t.moveV(1,"line")},goPageUp:function(t){return t.moveV(-1,"page")},goPageDown:function(t){return t.moveV(1,"page")},goCharLeft:function(t){return t.moveH(-1,"char")},goCharRight:function(t){return t.moveH(1,"char")},goColumnLeft:function(t){return t.moveH(-1,"column")},goColumnRight:function(t){return t.moveH(1,"column")},goWordLeft:function(t){return t.moveH(-1,"word")},goGroupRight:function(t){return t.moveH(1,"group")},goGroupLeft:function(t){return t.moveH(-1,"group")},goWordRight:function(t){return t.moveH(1,"word")},delCharBefore:function(t){return t.deleteH(-1,"char")},delCharAfter:function(t){return t.deleteH(1,"char")},delWordBefore:function(t){return t.deleteH(-1,"word")},delWordAfter:function(t){return t.deleteH(1,"word")},delGroupBefore:function(t){return t.deleteH(-1,"group")},delGroupAfter:function(t){return t.deleteH(1,"group")},indentAuto:function(t){return t.indentSelection("smart")},indentMore:function(t){return t.indentSelection("add")},indentLess:function(t){return t.indentSelection("subtract")},insertTab:function(t){return t.replaceSelection("\t")},insertSoftTab:function(t){for(var e=[],n=t.listSelections(),i=t.options.tabSize,r=0;r<n.length;r++){var o=n[r].from(),s=W(t.getLine(o.line),o.ch,i);e.push(X(i-s%i))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){return Vi(t,function(){for(var e=t.listSelections(),n=[],i=0;i<e.length;i++)if(e[i].empty()){var r=e[i].head,o=at(t.doc,r.line).text;if(o)if(r.ch==o.length&&(r=new mt(r.line,r.ch-1)),r.ch>0)r=new mt(r.line,r.ch+1),t.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),mt(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var s=at(t.doc,r.line-1).text;s&&(r=new mt(r.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+s.charAt(s.length-1),mt(r.line-1,s.length-1),r,"+transpose"))}n.push(new yr(r,r))}t.setSelections(n)})},newlineAndIndent:function(t){return Vi(t,function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var i=0;i<e.length;i++)t.indentLine(e[i].from().line,null,!0);Ti(t)})},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function Xo(t,e){var n=at(t.doc,e),i=Rt(n);return i!=n&&(e=dt(i)),te(!0,t,i,e,1)}function Ko(t,e){var n=Xo(t,e.line),i=at(t.doc,n.line),r=Qt(i,t.doc.direction);if(!r||0==r[0].level){var o=Math.max(0,i.text.search(/\S/)),s=e.line==n.line&&e.ch<=o&&e.ch;return mt(n.line,s?0:o,n.sticky)}return n}function Yo(t,e,n){if("string"==typeof e&&!(e=Vo[e]))return!1;t.display.input.ensurePolled();var i=t.display.shift,r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),r=e(t)!=j}finally{t.display.shift=i,t.state.suppressEdits=!1}return r}var Qo=new z;function Jo(t,e,n,i){var r=t.state.keySeq;if(r){if(jo(e))return"handled";Qo.set(50,function(){t.state.keySeq==r&&(t.state.keySeq=null,t.display.input.reset())}),e=r+" "+e}var o=function(t,e,n){for(var i=0;i<t.state.keyMaps.length;i++){var r=Bo(e,t.state.keyMaps[i],n,t);if(r)return r}return t.options.extraKeys&&Bo(e,t.options.extraKeys,n,t)||Bo(e,t.options.keyMap,n,t)}(t,e,i);return"multi"==o&&(t.state.keySeq=e),"handled"==o&&dn(t,"keyHandled",t,e,n),"handled"!=o&&"multi"!=o||(de(n),pi(t)),r&&!o&&/\'$/.test(e)?(de(n),!0):!!o}function Zo(t,e){var n=$o(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?Jo(t,"Shift-"+n,e,function(e){return Yo(t,e,!0)})||Jo(t,n,e,function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return Yo(t,e)}):Jo(t,n,e,function(e){return Yo(t,e)}))}var ts=null;function es(t){var e=this;if(e.curOp.focus=D(),!ae(e,t)){s&&a<11&&27==t.keyCode&&(t.returnValue=!1);var n=t.keyCode;e.display.shift=16==n||t.shiftKey;var i=Zo(e,t);d&&(ts=i?n:null,!i&&88==n&&!Se&&(y?t.metaKey:t.ctrlKey)&&e.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||function(t){var e=t.display.lineDiv;function n(t){18!=t.keyCode&&t.altKey||(T(e,"CodeMirror-crosshair"),oe(document,"keyup",n),oe(document,"mouseover",n))}N(e,"CodeMirror-crosshair"),ie(document,"keyup",n),ie(document,"mouseover",n)}(e)}}function ns(t){16==t.keyCode&&(this.doc.sel.shift=!1),ae(this,t)}function is(t){var e=this;if(!(Sn(e.display,t)||ae(e,t)||t.ctrlKey&&!t.altKey||y&&t.metaKey)){var n=t.keyCode,i=t.charCode;if(d&&n==ts)return ts=null,void de(t);if(!d||t.which&&!(t.which<10)||!Zo(e,t)){var r=String.fromCharCode(null==i?n:i);"\b"!=r&&(function(t,e,n){return Jo(t,"'"+n+"'",e,function(e){return Yo(t,e,!0)})}(e,t,r)||e.display.input.onKeyPress(t))}}}var rs,os,ss=function(t,e,n){this.time=t,this.pos=e,this.button=n};function as(t){var e=this,n=e.display;if(!(ae(e,t)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=t.shiftKey,Sn(n,t))l||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));else if(!us(e,t)){var i=li(e,t),r=ge(t),o=i?function(t,e){var n=+new Date;return os&&os.compare(n,t,e)?(rs=os=null,"triple"):rs&&rs.compare(n,t,e)?(os=new ss(n,t,e),rs=null,"double"):(rs=new ss(n,t,e),os=null,"single")}(i,r):"single";window.focus(),1==r&&e.state.selectingText&&e.state.selectingText(t),i&&function(t,e,n,i,r){var o="Click";return"double"==i?o="Double"+o:"triple"==i&&(o="Triple"+o),Jo(t,qo(o=(1==e?"Left":2==e?"Middle":"Right")+o,r),r,function(e){if("string"==typeof e&&(e=Vo[e]),!e)return!1;var i=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),i=e(t,n)!=j}finally{t.state.suppressEdits=!1}return i})}(e,r,i,o,t)||(1==r?i?function(t,e,n,i){s?setTimeout(H(mi,t),0):t.curOp.focus=D();var r,o=function(t,e,n){var i=t.getOption("configureMouse"),r=i?i(t,e,n):{};if(null==r.unit){var o=x?n.shiftKey&&n.metaKey:n.altKey;r.unit=o?"rectangle":"single"==e?"char":"double"==e?"word":"line"}return(null==r.extend||t.doc.extend)&&(r.extend=t.doc.extend||n.shiftKey),null==r.addNew&&(r.addNew=y?n.metaKey:n.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=!(y?n.altKey:n.ctrlKey)),r}(t,n,i),c=t.doc.sel;t.options.dragDrop&&xe&&!t.isReadOnly()&&"single"==n&&(r=c.contains(e))>-1&&(gt((r=c.ranges[r]).from(),e)<0||e.xRel>0)&&(gt(r.to(),e)>0||e.xRel<0)?function(t,e,n,i){var r=t.display,o=!1,c=Xi(t,function(e){l&&(r.scroller.draggable=!1),t.state.draggingText=!1,oe(document,"mouseup",c),oe(document,"mousemove",u),oe(r.scroller,"dragstart",d),oe(r.scroller,"drop",c),o||(de(e),i.addNew||qr(t.doc,n,null,null,i.extend),l||s&&9==a?setTimeout(function(){document.body.focus(),r.input.focus()},20):r.input.focus())}),u=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},d=function(){return o=!0};l&&(r.scroller.draggable=!0),t.state.draggingText=c,c.copy=!i.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),ie(document,"mouseup",c),ie(document,"mousemove",u),ie(r.scroller,"dragstart",d),ie(r.scroller,"drop",c),gi(t),setTimeout(function(){return r.input.focus()},20)}(t,i,e,o):function(t,e,n,i){var r=t.display,o=t.doc;de(e);var s,a,l=o.sel,c=l.ranges;if(i.addNew&&!i.extend?(a=o.sel.contains(n),s=a>-1?c[a]:new yr(n,n)):(s=o.sel.primary(),a=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(s=new yr(n,n)),n=li(t,e,!0,!0),a=-1;else{var u=ls(t,n,i.unit);s=i.extend?jr(s,u.anchor,u.head,i.extend):u}i.addNew?-1==a?(a=c.length,Xr(o,xr(c.concat([s]),a),{scroll:!1,origin:"*mouse"})):c.length>1&&c[a].empty()&&"char"==i.unit&&!i.extend?(Xr(o,xr(c.slice(0,a).concat(c.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Ur(o,a,s,$):(a=0,Xr(o,new vr([s],0),$),l=o.sel);var d=n,h=r.wrapper.getBoundingClientRect(),f=0;function p(e){var c=++f,u=li(t,e,!0,"rectangle"==i.unit);if(u)if(0!=gt(u,d)){t.curOp.focus=D(),function(e){if(0!=gt(d,e))if(d=e,"rectangle"==i.unit){for(var r=[],c=t.options.tabSize,u=W(at(o,n.line).text,n.ch,c),h=W(at(o,e.line).text,e.ch,c),f=Math.min(u,h),p=Math.max(u,h),m=Math.min(n.line,e.line),g=Math.min(t.lastLine(),Math.max(n.line,e.line));m<=g;m++){var v=at(o,m).text,y=G(v,f,c);f==p?r.push(new yr(mt(m,y),mt(m,y))):v.length>y&&r.push(new yr(mt(m,y),mt(m,G(v,p,c))))}r.length||r.push(new yr(n,n)),Xr(o,xr(l.ranges.slice(0,a).concat(r),a),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var x,b=s,w=ls(t,e,i.unit),C=b.anchor;gt(w.anchor,C)>0?(x=w.head,C=bt(b.from(),w.anchor)):(x=w.anchor,C=xt(b.to(),w.head));var _=l.ranges.slice(0);_[a]=new yr(Ct(o,C),x),Xr(o,xr(_,a),$)}}(u);var m=wi(r,o);(u.line>=m.to||u.line<m.from)&&setTimeout(Xi(t,function(){f==c&&p(e)}),150)}else{var g=e.clientY<h.top?-20:e.clientY>h.bottom?20:0;g&&setTimeout(Xi(t,function(){f==c&&(r.scroller.scrollTop+=g,p(e))}),50)}}function m(e){t.state.selectingText=!1,f=1/0,de(e),r.input.focus(),oe(document,"mousemove",g),oe(document,"mouseup",v),o.history.lastSelOrigin=null}var g=Xi(t,function(t){ge(t)?p(t):m(t)}),v=Xi(t,m);t.state.selectingText=v,ie(document,"mousemove",g),ie(document,"mouseup",v)}(t,i,e,o)}(e,i,o,t):me(t)==n.scroller&&de(t):2==r?(i&&qr(e.doc,i),setTimeout(function(){return n.input.focus()},20)):3==r&&(_?ds(e,t):gi(e)))}}function ls(t,e,n){if("char"==n)return new yr(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new yr(mt(e.line,0),Ct(t.doc,mt(e.line+1,0)));var i=n(t,e);return new yr(i.from,i.to)}function cs(t,e,n,i){var r,o;try{r=e.clientX,o=e.clientY}catch(e){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;i&&de(e);var s=t.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!ce(t,n))return fe(e);o-=a.top-s.viewOffset;for(var l=0;l<t.options.gutters.length;++l){var c=s.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=r){var u=ht(t.doc,o),d=t.options.gutters[l];return se(t,n,t,u,d,e),fe(e)}}}function us(t,e){return cs(t,e,"gutterClick",!0)}function ds(t,e){Sn(t.display,e)||function(t,e){return!!ce(t,"gutterContextMenu")&&cs(t,e,"gutterContextMenu",!1)}(t,e)||ae(t,e,"contextmenu")||t.display.input.onContextMenu(e)}function hs(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),qn(t)}ss.prototype.compare=function(t,e,n){return this.time+400>t&&0==gt(e,this.pos)&&n==this.button};var fs={toString:function(){return"CodeMirror.Init"}},ps={},ms={};function gs(t){ur(t),Qi(t),Ci(t)}function vs(t,e,n){var i=n&&n!=fs;if(!e!=!i){var r=t.display.dragFunctions,o=e?ie:oe;o(t.display.scroller,"dragstart",r.start),o(t.display.scroller,"dragenter",r.enter),o(t.display.scroller,"dragover",r.over),o(t.display.scroller,"dragleave",r.leave),o(t.display.scroller,"drop",r.drop)}}function ys(t){t.options.lineWrapping?(N(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(T(t.display.wrapper,"CodeMirror-wrap"),Vt(t)),ai(t),Qi(t),qn(t),setTimeout(function(){return Hi(t)},100)}function xs(t,e){var i=this;if(!(this instanceof xs))return new xs(t,e);this.options=e=e?F(e):{},F(ps,e,!1),dr(e);var r=e.value;"string"==typeof r&&(r=new To(r,e.mode,null,e.lineSeparator,e.direction)),this.doc=r;var o=new xs.inputStyles[e.inputStyle](this),c=this.display=new function(t,e,i){var r=this;this.input=i,r.scrollbarFiller=L("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=L("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=I("div",null,"CodeMirror-code"),r.selectionDiv=L("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=L("div",null,"CodeMirror-cursors"),r.measure=L("div",null,"CodeMirror-measure"),r.lineMeasure=L("div",null,"CodeMirror-measure"),r.lineSpace=I("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var o=I("div",[r.lineSpace],"CodeMirror-lines");r.mover=L("div",[o],null,"position: relative"),r.sizer=L("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=L("div",null,null,"position: absolute; height: "+B+"px; width: 1px;"),r.gutters=L("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=L("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=L("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),s&&a<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),l||n&&v||(r.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(r.wrapper):t(r.wrapper)),r.viewFrom=r.viewTo=e.first,r.reportedViewFrom=r.reportedViewTo=e.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,i.init(r)}(t,r,o);for(var u in c.wrapper.CodeMirror=this,ur(this),hs(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),zi(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 z,keySeq:null,specialChars:null},e.autofocus&&!v&&c.input.focus(),s&&a<11&&setTimeout(function(){return i.display.input.reset(!0)},20),function(t){var e=t.display;ie(e.scroller,"mousedown",Xi(t,as)),ie(e.scroller,"dblclick",s&&a<11?Xi(t,function(e){if(!ae(t,e)){var n=li(t,e);if(n&&!us(t,e)&&!Sn(t.display,e)){de(e);var i=t.findWordAt(n);qr(t.doc,i.anchor,i.head)}}}):function(e){return ae(t,e)||de(e)}),_||ie(e.scroller,"contextmenu",function(e){return ds(t,e)});var n,i={end:0};function r(){e.activeTouch&&(n=setTimeout(function(){return e.activeTouch=null},1e3),(i=e.activeTouch).end=+new Date)}function o(t,e){if(null==e.left)return!0;var n=e.left-t.left,i=e.top-t.top;return n*n+i*i>400}ie(e.scroller,"touchstart",function(r){if(!ae(t,r)&&!function(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}(r)){e.input.ensurePolled(),clearTimeout(n);var o=+new Date;e.activeTouch={start:o,moved:!1,prev:o-i.end<=300?i:null},1==r.touches.length&&(e.activeTouch.left=r.touches[0].pageX,e.activeTouch.top=r.touches[0].pageY)}}),ie(e.scroller,"touchmove",function(){e.activeTouch&&(e.activeTouch.moved=!0)}),ie(e.scroller,"touchend",function(n){var i=e.activeTouch;if(i&&!Sn(e,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var s,a=t.coordsChar(e.activeTouch,"page");s=!i.prev||o(i,i.prev)?new yr(a,a):!i.prev.prev||o(i,i.prev.prev)?t.findWordAt(a):new yr(mt(a.line,0),Ct(t.doc,mt(a.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),de(n)}r()}),ie(e.scroller,"touchcancel",r),ie(e.scroller,"scroll",function(){e.scroller.clientHeight&&(Ii(t,e.scroller.scrollTop),Di(t,e.scroller.scrollLeft,!0),se(t,"scroll",t))}),ie(e.scroller,"mousewheel",function(e){return gr(t,e)}),ie(e.scroller,"DOMMouseScroll",function(e){return gr(t,e)}),ie(e.wrapper,"scroll",function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0}),e.dragFunctions={enter:function(e){ae(t,e)||pe(e)},over:function(e){ae(t,e)||(function(t,e){var n=li(t,e);if(n){var i=document.createDocumentFragment();hi(t,n,i),t.display.dragCursor||(t.display.dragCursor=L("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),A(t.display.dragCursor,i)}}(t,e),pe(e))},start:function(e){return function(t,e){if(s&&(!t.state.draggingText||+new Date-Mo<100))pe(e);else if(!ae(t,e)&&!Sn(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!h)){var n=L("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(t,e)},drop:Xi(t,Ao),leave:function(e){ae(t,e)||Lo(t)}};var l=e.input.getField();ie(l,"keyup",function(e){return ns.call(t,e)}),ie(l,"keydown",Xi(t,es)),ie(l,"keypress",Xi(t,is)),ie(l,"focus",function(e){return vi(t,e)}),ie(l,"blur",function(e){return yi(t,e)})}(this),Do(),Bi(this),this.curOp.forceUpdate=!0,Ir(this,r),e.autofocus&&!v||this.hasFocus()?setTimeout(H(vi,this),20):yi(this),ms)ms.hasOwnProperty(u)&&ms[u](i,e[u],fs);_i(this),e.finishInit&&e.finishInit(this);for(var f=0;f<bs.length;++f)bs[f](i);ji(this),l&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(c.lineDiv).textRendering&&(c.lineDiv.style.textRendering="auto")}xs.defaults=ps,xs.optionHandlers=ms;var bs=[];function ws(t,e,n,i){var r,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=Be(t,e).state:n="prev");var s=t.options.tabSize,a=at(o,e),l=W(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==n&&((c=o.mode.indent(r,a.text.slice(u.length),a.text))==j||c>150)){if(!i)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>o.first?W(at(o,e-1).text,null,s):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",h=0;if(t.options.indentWithTabs)for(var f=Math.floor(c/s);f;--f)h+=s,d+="\t";if(h<c&&(d+=X(c-h)),d!=u)return co(o,d,mt(e,0),mt(e,u.length),"+input"),a.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==e&&m.head.ch<u.length){var g=mt(e,u.length);Ur(o,p,new yr(g,g));break}}}xs.defineInitHook=function(t){return bs.push(t)};var Cs=null;function _s(t){Cs=t}function ks(t,e,n,i,r){var o=t.doc;t.display.shift=!1,i||(i=o.sel);var s,a=t.state.pasteIncoming||"paste"==r,l=_e(e),c=null;if(a&&i.ranges.length>1)if(Cs&&Cs.text.join("\n")==e){if(i.ranges.length%Cs.text.length==0){c=[];for(var u=0;u<Cs.text.length;u++)c.push(o.splitLines(Cs.text[u]))}}else l.length==i.ranges.length&&t.options.pasteLinesPerSelection&&(c=Y(l,function(t){return[t]}));for(var d=i.ranges.length-1;d>=0;d--){var h=i.ranges[d],f=h.from(),p=h.to();h.empty()&&(n&&n>0?f=mt(f.line,f.ch-n):t.state.overwrite&&!a?p=mt(p.line,Math.min(at(o,p.line).text.length,p.ch+K(l).length)):Cs&&Cs.lineWise&&Cs.text.join("\n")==e&&(f=p=mt(f.line,0))),s=t.curOp.updateInput;var m={from:f,to:p,text:c?c[d%c.length]:l,origin:r||(a?"paste":t.state.cutIncoming?"cut":"+input")};ro(t.doc,m),dn(t,"inputRead",t,m)}e&&!a&&Ts(t,e),Ti(t),t.curOp.updateInput=s,t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=!1}function Ss(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Vi(e,function(){return ks(e,n,0,null,"paste")}),!0}function Ts(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=t.getModeAt(r.head),s=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(e.indexOf(o.electricChars.charAt(a))>-1){s=ws(t,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(at(t.doc,r.head.line).text.slice(0,r.head.ch))&&(s=ws(t,r.head.line,"smart"));s&&dn(t,"electricInput",t,r.head.line)}}}function Ms(t){for(var e=[],n=[],i=0;i<t.doc.sel.ranges.length;i++){var r=t.doc.sel.ranges[i].head.line,o={anchor:mt(r,0),head:mt(r+1,0)};n.push(o),e.push(t.getRange(o.anchor,o.head))}return{text:e,ranges:n}}function As(t,e){t.setAttribute("autocorrect","off"),t.setAttribute("autocapitalize","off"),t.setAttribute("spellcheck",!!e)}function Ls(){var t=L("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),e=L("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?t.style.width="1000px":t.setAttribute("wrap","off"),m&&(t.style.border="1px solid black"),As(t),e}function Is(t,e,n,i,r){var o=e,s=n,a=at(t,e.line);function l(i){var o,s;if(null==(o=r?ee(t.cm,a,e,n):Zt(a,e,n))){if(i||((s=e.line+n)<t.first||s>=t.first+t.size||(e=new mt(s,e.ch,e.sticky),!(a=at(t,s)))))return!1;e=te(r,t.cm,a,e.line,n)}else e=o;return!0}if("char"==i)l();else if("column"==i)l(!0);else if("word"==i||"group"==i)for(var c=null,u="group"==i,d=t.cm&&t.cm.getHelper(e,"wordChars"),h=!0;!(n<0)||l(!h);h=!1){var f=a.text.charAt(e.ch)||"\n",p=et(f,d)?"w":u&&"\n"==f?"n":!u||/\s/.test(f)?null:"p";if(!u||h||p||(p="s"),c&&c!=p){n<0&&(n=1,l(),e.sticky="after");break}if(p&&(c=p),n>0&&!l(!h))break}var m=to(t,e,o,s,!0);return vt(o,m)&&(m.hitSide=!0),m}function Es(t,e,n,i){var r,o,s=t.doc,a=e.left;if("page"==i){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*ni(t.display),3);r=(n>0?e.bottom:e.top)+n*c}else"line"==i&&(r=n>0?e.bottom+3:e.top-3);for(;(o=Jn(t,a,r)).outside;){if(n<0?r<=0:r>=s.height){o.hitSide=!0;break}r+=5*n}return o}var Ds=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ns(t,e){var n=On(t,e.line);if(!n||n.hidden)return null;var i=at(t.doc,e.line),r=Dn(n,i,e.line),o=Qt(i,t.doc.direction),s="left";if(o){var a=Kt(o,e.ch);s=a%2?"right":"left"}var l=zn(r.map,e.ch,s);return l.offset="right"==l.collapse?l.end:l.start,l}function Os(t,e){return e&&(t.bad=!0),t}function Ps(t,e,n){var i;if(e==t.display.lineDiv){if(!(i=t.display.lineDiv.childNodes[n]))return Os(t.clipPos(mt(t.display.viewTo-1)),!0);e=null,n=0}else for(i=e;;i=i.parentNode){if(!i||i==t.display.lineDiv)return null;if(i.parentNode&&i.parentNode==t.display.lineDiv)break}for(var r=0;r<t.display.view.length;r++){var o=t.display.view[r];if(o.node==i)return Hs(o,e,n)}}function Hs(t,e,n){var i=t.text.firstChild,r=!1;if(!e||!E(i,e))return Os(mt(dt(t.line),0),!0);if(e==i&&(r=!0,e=i.childNodes[n],n=0,!e)){var o=t.rest?K(t.rest):t.line;return Os(mt(dt(o),o.text.length),r)}var s=3==e.nodeType?e:null,a=e;for(s||1!=e.childNodes.length||3!=e.firstChild.nodeType||(s=e.firstChild,n&&(n=s.nodeValue.length));a.parentNode!=i;)a=a.parentNode;var l=t.measure,c=l.maps;function u(e,n,i){for(var r=-1;r<(c?c.length:0);r++)for(var o=r<0?l.map:c[r],s=0;s<o.length;s+=3){var a=o[s+2];if(a==e||a==n){var u=dt(r<0?t.line:t.rest[r]),d=o[s]+i;return(i<0||a!=e)&&(d=o[s+(i?1:0)]),mt(u,d)}}}var d=u(s,a,n);if(d)return Os(d,r);for(var h=a.nextSibling,f=s?s.nodeValue.length-n:0;h;h=h.nextSibling){if(d=u(h,h.firstChild,0))return Os(mt(d.line,d.ch-f),r);f+=h.textContent.length}for(var p=a.previousSibling,m=n;p;p=p.previousSibling){if(d=u(p,p.firstChild,-1))return Os(mt(d.line,d.ch+m),r);m+=p.textContent.length}}Ds.prototype.init=function(t){var e=this,n=this,i=n.cm,r=n.div=t.lineDiv;function o(t){if(!ae(i,t)){if(i.somethingSelected())_s({lineWise:!1,text:i.getSelections()}),"cut"==t.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var e=Ms(i);_s({lineWise:!0,text:e.text}),"cut"==t.type&&i.operation(function(){i.setSelections(e.ranges,0,q),i.replaceSelection("",null,"cut")})}if(t.clipboardData){t.clipboardData.clearData();var o=Cs.text.join("\n");if(t.clipboardData.setData("Text",o),t.clipboardData.getData("Text")==o)return void t.preventDefault()}var s=Ls(),a=s.firstChild;i.display.lineSpace.insertBefore(s,i.display.lineSpace.firstChild),a.value=Cs.text.join("\n");var l=document.activeElement;P(a),setTimeout(function(){i.display.lineSpace.removeChild(s),l.focus(),l==r&&n.showPrimarySelection()},50)}}As(r,i.options.spellcheck),ie(r,"paste",function(t){ae(i,t)||Ss(t,i)||a<=11&&setTimeout(Xi(i,function(){return e.updateFromDOM()}),20)}),ie(r,"compositionstart",function(t){e.composing={data:t.data,done:!1}}),ie(r,"compositionupdate",function(t){e.composing||(e.composing={data:t.data,done:!1})}),ie(r,"compositionend",function(t){e.composing&&(t.data!=e.composing.data&&e.readFromDOMSoon(),e.composing.done=!0)}),ie(r,"touchstart",function(){return n.forceCompositionEnd()}),ie(r,"input",function(){e.composing||e.readFromDOMSoon()}),ie(r,"copy",o),ie(r,"cut",o)},Ds.prototype.prepareSelection=function(){var t=di(this.cm,!1);return t.focus=this.cm.state.focused,t},Ds.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},Ds.prototype.showPrimarySelection=function(){var t=window.getSelection(),e=this.cm,i=e.doc.sel.primary(),r=i.from(),o=i.to();if(e.display.viewTo==e.display.viewFrom||r.line>=e.display.viewTo||o.line<e.display.viewFrom)t.removeAllRanges();else{var s=Ps(e,t.anchorNode,t.anchorOffset),a=Ps(e,t.focusNode,t.focusOffset);if(!s||s.bad||!a||a.bad||0!=gt(bt(s,a),r)||0!=gt(xt(s,a),o)){var l=e.display.view,c=r.line>=e.display.viewFrom&&Ns(e,r)||{node:l[0].measure.map[2],offset:0},u=o.line<e.display.viewTo&&Ns(e,o);if(!u){var d=l[l.length-1].measure,h=d.maps?d.maps[d.maps.length-1]:d.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(c&&u){var f,p=t.rangeCount&&t.getRangeAt(0);try{f=S(c.node,c.offset,u.offset,u.node)}catch(t){}f&&(!n&&e.state.focused?(t.collapse(c.node,c.offset),f.collapsed||(t.removeAllRanges(),t.addRange(f))):(t.removeAllRanges(),t.addRange(f)),p&&null==t.anchorNode?t.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else t.removeAllRanges()}}},Ds.prototype.startGracePeriod=function(){var t=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){t.gracePeriod=!1,t.selectionChanged()&&t.cm.operation(function(){return t.cm.curOp.selectionChanged=!0})},20)},Ds.prototype.showMultipleSelections=function(t){A(this.cm.display.cursorDiv,t.cursors),A(this.cm.display.selectionDiv,t.selection)},Ds.prototype.rememberSelection=function(){var t=window.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},Ds.prototype.selectionInEditor=function(){var t=window.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return E(this.div,e)},Ds.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ds.prototype.blur=function(){this.div.blur()},Ds.prototype.getField=function(){return this.div},Ds.prototype.supportsTouch=function(){return!0},Ds.prototype.receivedFocus=function(){var t=this;this.selectionInEditor()?this.pollSelection():Vi(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))})},Ds.prototype.selectionChanged=function(){var t=window.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},Ds.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var t=window.getSelection(),e=this.cm;if(g&&u&&this.cm.options.gutters.length&&function(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}(t.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Ps(e,t.anchorNode,t.anchorOffset),i=Ps(e,t.focusNode,t.focusOffset);n&&i&&Vi(e,function(){Xr(e.doc,br(n,i),q),(n.bad||i.bad)&&(e.curOp.selectionChanged=!0)})}}},Ds.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t,e,n,i=this.cm,r=i.display,o=i.doc.sel.primary(),s=o.from(),a=o.to();if(0==s.ch&&s.line>i.firstLine()&&(s=mt(s.line-1,at(i.doc,s.line-1).length)),a.ch==at(i.doc,a.line).text.length&&a.line<i.lastLine()&&(a=mt(a.line+1,0)),s.line<r.viewFrom||a.line>r.viewTo-1)return!1;s.line==r.viewFrom||0==(t=ci(i,s.line))?(e=dt(r.view[0].line),n=r.view[0].node):(e=dt(r.view[t].line),n=r.view[t-1].node.nextSibling);var l,c,u=ci(i,a.line);if(u==r.view.length-1?(l=r.viewTo-1,c=r.lineDiv.lastChild):(l=dt(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;for(var d=i.doc.splitLines(function(t,e,n,i,r){var o="",s=!1,a=t.doc.lineSeparator();function l(){s&&(o+=a,s=!1)}function c(t){t&&(l(),o+=t)}function u(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(null!=n)return void c(n||e.textContent.replace(/\u200b/g,""));var o,d=e.getAttribute("cm-marker");if(d){var h=t.findMarks(mt(i,0),mt(r+1,0),(m=+d,function(t){return t.id==m}));return void(h.length&&(o=h[0].find())&&c(lt(t.doc,o.from,o.to).join(a)))}if("false"==e.getAttribute("contenteditable"))return;var f=/^(pre|div|p)$/i.test(e.nodeName);f&&l();for(var p=0;p<e.childNodes.length;p++)u(e.childNodes[p]);f&&(s=!0)}else 3==e.nodeType&&c(e.nodeValue);var m}for(;u(e),e!=n;)e=e.nextSibling;return o}(i,n,c,e,l)),h=lt(i.doc,mt(e,0),mt(l,at(i.doc,l).text.length));d.length>1&&h.length>1;)if(K(d)==K(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),e++}for(var f=0,p=0,m=d[0],g=h[0],v=Math.min(m.length,g.length);f<v&&m.charCodeAt(f)==g.charCodeAt(f);)++f;for(var y=K(d),x=K(h),b=Math.min(y.length-(1==d.length?f:0),x.length-(1==h.length?f:0));p<b&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1);)++p;if(1==d.length&&1==h.length&&e==s.line)for(;f&&f>s.ch&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1);)f--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var w=mt(e,f),C=mt(l,h.length?K(h).length-p:0);return d.length>1||d[0]||gt(w,C)?(co(i.doc,d,w,C,"+input"),!0):void 0},Ds.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ds.prototype.reset=function(){this.forceCompositionEnd()},Ds.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ds.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()},80))},Ds.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Vi(this.cm,function(){return Qi(t.cm)})},Ds.prototype.setUneditable=function(t){t.contentEditable="false"},Ds.prototype.onKeyPress=function(t){0!=t.charCode&&(t.preventDefault(),this.cm.isReadOnly()||Xi(this.cm,ks)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Ds.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Ds.prototype.onContextMenu=function(){},Ds.prototype.resetPosition=function(){},Ds.prototype.needsContentAttribute=!0;var Fs=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};Fs.prototype.init=function(t){var e=this,n=this,i=this.cm,r=this.wrapper=Ls(),o=this.textarea=r.firstChild;function l(t){if(!ae(i,t)){if(i.somethingSelected())_s({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var e=Ms(i);_s({lineWise:!0,text:e.text}),"cut"==t.type?i.setSelections(e.ranges,null,q):(n.prevInput="",o.value=e.text.join("\n"),P(o))}"cut"==t.type&&(i.state.cutIncoming=!0)}}t.wrapper.insertBefore(r,t.wrapper.firstChild),m&&(o.style.width="0px"),ie(o,"input",function(){s&&a>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()}),ie(o,"paste",function(t){ae(i,t)||Ss(t,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),ie(o,"cut",l),ie(o,"copy",l),ie(t.scroller,"paste",function(e){Sn(t,e)||ae(i,e)||(i.state.pasteIncoming=!0,n.focus())}),ie(t.lineSpace,"selectstart",function(e){Sn(t,e)||de(e)}),ie(o,"compositionstart",function(){var t=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:i.markText(t,i.getCursor("to"),{className:"CodeMirror-composing"})}}),ie(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Fs.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,i=di(t);if(t.options.moveInputWithCursor){var r=Kn(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),s=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+s.top-o.top)),i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+s.left-o.left))}return i},Fs.prototype.showSelection=function(t){var e=this.cm,n=e.display;A(n.cursorDiv,t.cursors),A(n.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},Fs.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&P(this.textarea),s&&a>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null))}},Fs.prototype.getField=function(){return this.textarea},Fs.prototype.supportsTouch=function(){return!1},Fs.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||D()!=this.textarea))try{this.textarea.focus()}catch(t){}},Fs.prototype.blur=function(){this.textarea.blur()},Fs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Fs.prototype.receivedFocus=function(){this.slowPoll()},Fs.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){t.poll(),t.cm.state.focused&&t.slowPoll()})},Fs.prototype.fastPoll=function(){var t=!1,e=this;e.pollingFast=!0,e.polling.set(20,function n(){var i=e.poll();i||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))})},Fs.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!e.state.focused||ke(n)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==i&&!e.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===r||y&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(i.length,r.length);l<c&&i.charCodeAt(l)==r.charCodeAt(l);)++l;return Vi(e,function(){ks(e,r.slice(l),i.length-l,null,t.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Fs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Fs.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},Fs.prototype.onContextMenu=function(t){var e=this,n=e.cm,i=n.display,r=e.textarea,o=li(n,t),c=i.scroller.scrollTop;if(o&&!d){var u=n.options.resetSelectionOnContextMenu;u&&-1==n.doc.sel.contains(o)&&Xi(n,Xr)(n.doc,br(o),q);var h=r.style.cssText,f=e.wrapper.style.cssText;e.wrapper.style.cssText="position: absolute";var p,m=e.wrapper.getBoundingClientRect();if(r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-m.top-5)+"px; left: "+(t.clientX-m.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);",l&&(p=window.scrollY),i.input.focus(),l&&window.scrollTo(null,p),i.input.reset(),n.somethingSelected()||(r.value=e.prevInput=" "),e.contextMenuPending=!0,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),s&&a>=9&&v(),_){pe(t);var g=function(){oe(window,"mouseup",g),setTimeout(y,20)};ie(window,"mouseup",g)}else setTimeout(y,50)}function v(){if(null!=r.selectionStart){var t=n.somethingSelected(),o=""+(t?r.value:"");r.value="⇚",r.value=o,e.prevInput=t?"":"",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function y(){if(e.contextMenuPending=!1,e.wrapper.style.cssText=f,r.style.cssText=h,s&&a<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=r.selectionStart){(!s||s&&a<9)&&v();var t=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&""==e.prevInput?Xi(n,no)(n):t++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},Fs.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t},Fs.prototype.setUneditable=function(){},Fs.prototype.needsContentAttribute=!1,function(t){var e=t.optionHandlers;function n(n,i,r,o){t.defaults[n]=i,r&&(e[n]=o?function(t,e,n){n!=fs&&r(t,e,n)}:r)}t.defineOption=n,t.Init=fs,n("value","",function(t,e){return t.setValue(e)},!0),n("mode",null,function(t,e){t.doc.modeOption=e,Sr(t)},!0),n("indentUnit",2,Sr,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(t){Tr(t),qn(t),Qi(t)},!0),n("lineSeparator",null,function(t,e){if(t.doc.lineSep=e,e){var n=[],i=t.doc.first;t.doc.iter(function(t){for(var r=0;;){var o=t.text.indexOf(e,r);if(-1==o)break;r=o+e.length,n.push(mt(i,o))}i++});for(var r=n.length-1;r>=0;r--)co(t.doc,e,n[r],mt(n[r].line,n[r].ch+e.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=fs&&t.refresh()}),n("specialCharPlaceholder",en,function(t){return t.refresh()},!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(t,e){return t.getInputField().spellcheck=e},!0),n("rtlMoveVisually",!b),n("wholeLineUpdateBefore",!0),n("theme","default",function(t){hs(t),gs(t)},!0),n("keyMap","default",function(t,e,n){var i=Uo(e),r=n!=fs&&Uo(n);r&&r.detach&&r.detach(t,i),i.attach&&i.attach(t,r||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,ys,!0),n("gutters",[],function(t){dr(t.options),gs(t)},!0),n("fixedGutter",!0,function(t,e){t.display.gutters.style.left=e?oi(t.display)+"px":"0",t.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(t){return Hi(t)},!0),n("scrollbarStyle","native",function(t){zi(t),Hi(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0),n("lineNumbers",!1,function(t){dr(t.options),gs(t)},!0),n("firstLineNumber",1,gs,!0),n("lineNumberFormatter",function(t){return t},gs,!0),n("showCursorWhenSelecting",!1,ui,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("readOnly",!1,function(t,e){"nocursor"==e&&(yi(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)}),n("disableInput",!1,function(t,e){e||t.display.input.reset()},!0),n("dragDrop",!0,vs),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ui,!0),n("singleCursorHeightPerLine",!0,ui,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Tr,!0),n("addModeClass",!1,Tr,!0),n("pollInterval",100),n("undoDepth",200,function(t,e){return t.doc.history.undoDepth=e}),n("historyEventDelay",1250),n("viewportMargin",10,function(t){return t.refresh()},!0),n("maxHighlightLength",1e4,Tr,!0),n("moveInputWithCursor",!0,function(t,e){e||t.display.input.resetPosition()}),n("tabindex",null,function(t,e){return t.display.input.getField().tabIndex=e||""}),n("autofocus",null),n("direction","ltr",function(t,e){return t.doc.setDirection(e)},!0)}(xs),function(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var i=this.options,r=i[t];i[t]==n&&"mode"!=t||(i[t]=n,e.hasOwnProperty(t)&&Xi(this,e[t])(this,n,r),se(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](Uo(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;n<e.length;++n)if(e[n]==t||e[n].name==t)return e.splice(n,1),!0},addOverlay:Ki(function(e,n){var i=e.token?e:t.getMode(this.options,e);if(i.startState)throw new Error("Overlays may not be stateful.");!function(t,e,n){for(var i=0,r=n(e);i<t.length&&n(t[i])<=r;)i++;t.splice(i,0,e)}(this.state.overlays,{mode:i,modeSpec:e,opaque:n&&n.opaque,priority:n&&n.priority||0},function(t){return t.priority}),this.state.modeGen++,Qi(this)}),removeOverlay:Ki(function(t){for(var e=this.state.overlays,n=0;n<e.length;++n){var i=e[n].modeSpec;if(i==t||"string"==typeof t&&i.name==t)return e.splice(n,1),this.state.modeGen++,void Qi(this)}}),indentLine:Ki(function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),ft(this.doc,t)&&ws(this,t,e,n)}),indentSelection:Ki(function(t){for(var e=this.doc.sel.ranges,n=-1,i=0;i<e.length;i++){var r=e[i];if(r.empty())r.head.line>n&&(ws(this,r.head.line,t,!0),n=r.head.line,i==this.doc.sel.primIndex&&Ti(this));else{var o=r.from(),s=r.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l<n;++l)ws(this,l,t);var c=this.doc.sel.ranges;0==o.ch&&e.length==c.length&&c[i].from().ch>0&&Ur(this.doc,i,new yr(o,c[i].to()),q)}}}),getTokenAt:function(t,e){return Ge(this,t,e)},getLineTokens:function(t,e){return Ge(this,mt(t),e,!0)},getTokenTypeAt:function(t){t=Ct(this.doc,t);var e,n=Re(this,at(this.doc,t.line)),i=0,r=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var s=i+r>>1;if((s?n[2*s-1]:0)>=o)r=s;else{if(!(n[2*s+1]<o)){e=n[2*s+2];break}i=s+1}}var a=e?e.indexOf("overlay "):-1;return a<0?e:0==a?null:e.slice(0,a-1)},getModeAt:function(e){var n=this.doc.mode;return n.innerMode?t.innerMode(n,this.getTokenAt(e).state).mode:n},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var i=[];if(!n.hasOwnProperty(e))return i;var r=n[e],o=this.getModeAt(t);if("string"==typeof o[e])r[o[e]]&&i.push(r[o[e]]);else if(o[e])for(var s=0;s<o[e].length;s++){var a=r[o[e][s]];a&&i.push(a)}else o.helperType&&r[o.helperType]?i.push(r[o.helperType]):r[o.name]&&i.push(r[o.name]);for(var l=0;l<r._global.length;l++){var c=r._global[l];c.pred(o,this)&&-1==R(i,c.val)&&i.push(c.val)}return i},getStateAfter:function(t,e){var n=this.doc;return Be(this,(t=wt(n,null==t?n.first+n.size-1:t))+1,e).state},cursorCoords:function(t,e){var n=this.doc.sel.primary();return Kn(this,null==t?n.head:"object"==typeof t?Ct(this.doc,t):t?n.from():n.to(),e||"page")},charCoords:function(t,e){return Xn(this,Ct(this.doc,t),e||"page")},coordsChar:function(t,e){return Jn(this,(t=Vn(this,t,e||"page")).left,t.top)},lineAtHeight:function(t,e){return t=Vn(this,{top:t,left:0},e||"page").top,ht(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e,n){var i,r=!1;if("number"==typeof t){var o=this.doc.first+this.doc.size-1;t<this.doc.first?t=this.doc.first:t>o&&(t=o,r=!0),i=at(this.doc,t)}else i=t;return Gn(this,i,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-Ut(i):0)},defaultTextHeight:function(){return ni(this.display)},defaultCharWidth:function(){return ii(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,i,r){var o,s,a,l=this.display,c=(t=Kn(this,Ct(this.doc,t))).bottom,u=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),l.sizer.appendChild(e),"over"==i)c=t.top;else if("above"==i||"near"==i){var d=Math.max(l.wrapper.clientHeight,this.doc.height),h=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==i||t.bottom+e.offsetHeight>d)&&t.top>e.offsetHeight?c=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=d&&(c=t.bottom),u+e.offsetWidth>h&&(u=h-e.offsetWidth)}e.style.top=c+"px",e.style.left=e.style.right="","right"==r?(u=l.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?u=0:"middle"==r&&(u=(l.sizer.clientWidth-e.offsetWidth)/2),e.style.left=u+"px"),n&&(o=this,s={left:u,top:c,right:u+e.offsetWidth,bottom:c+e.offsetHeight},null!=(a=ki(o,s)).scrollTop&&Ii(o,a.scrollTop),null!=a.scrollLeft&&Di(o,a.scrollLeft))},triggerOnKeyDown:Ki(es),triggerOnKeyPress:Ki(is),triggerOnKeyUp:ns,triggerOnMouseDown:Ki(as),execCommand:function(t){if(Vo.hasOwnProperty(t))return Vo[t].call(null,this)},triggerElectric:Ki(function(t){Ts(this,t)}),findPosH:function(t,e,n,i){var r=1;e<0&&(r=-1,e=-e);for(var o=Ct(this.doc,t),s=0;s<e&&!(o=Is(this.doc,o,r,n,i)).hitSide;++s);return o},moveH:Ki(function(t,e){var n=this;this.extendSelectionsBy(function(i){return n.display.shift||n.doc.extend||i.empty()?Is(n.doc,i.head,t,e,n.options.rtlMoveVisually):t<0?i.from():i.to()},U)}),deleteH:Ki(function(t,e){var n=this.doc.sel,i=this.doc;n.somethingSelected()?i.replaceSelection("",null,"+delete"):Go(this,function(n){var r=Is(i,n.head,t,e,!1);return t<0?{from:r,to:n.head}:{from:n.head,to:r}})}),findPosV:function(t,e,n,i){var r=1,o=i;e<0&&(r=-1,e=-e);for(var s=Ct(this.doc,t),a=0;a<e;++a){var l=Kn(this,s,"div");if(null==o?o=l.left:l.left=o,(s=Es(this,l,r,n)).hitSide)break}return s},moveV:Ki(function(t,e){var n=this,i=this.doc,r=[],o=!this.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy(function(s){if(o)return t<0?s.from():s.to();var a=Kn(n,s.head,"div");null!=s.goalColumn&&(a.left=s.goalColumn),r.push(a.left);var l=Es(n,a,t,e);return"page"==e&&s==i.sel.primary()&&Si(n,Xn(n,l,"div").top-a.top),l},U),r.length)for(var s=0;s<i.sel.ranges.length;s++)i.sel.ranges[s].goalColumn=r[s]}),findWordAt:function(t){var e=this.doc,n=at(e,t.line).text,i=t.ch,r=t.ch;if(n){var o=this.getHelper(t,"wordChars");"before"!=t.sticky&&r!=n.length||!i?++r:--i;for(var s=n.charAt(i),a=et(s,o)?function(t){return et(t,o)}:/\s/.test(s)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!et(t)};i>0&&a(n.charAt(i-1));)--i;for(;r<n.length&&a(n.charAt(r));)++r}return new yr(mt(t.line,i),mt(t.line,r))},toggleOverwrite:function(t){null!=t&&t==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?N(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),se(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Ki(function(t,e){Mi(this,t,e)}),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Ln(this)-this.display.barHeight,width:t.scrollWidth-Ln(this)-this.display.barWidth,clientHeight:En(this),clientWidth:In(this)}},scrollIntoView:Ki(function(t,e){null==t?(t={from:this.doc.sel.primary().head,to:null},null==e&&(e=this.options.cursorScrollMargin)):"number"==typeof t?t={from:mt(t,0),to:null}:null==t.from&&(t={from:t,to:null}),t.to||(t.to=t.from),t.margin=e||0,null!=t.from.line?function(t,e){Ai(t),t.curOp.scrollToPos=e}(this,t):Li(this,t.from,t.to,t.margin)}),setSize:Ki(function(t,e){var n=this,i=function(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t};null!=t&&(this.display.wrapper.style.width=i(t)),null!=e&&(this.display.wrapper.style.height=i(e)),this.options.lineWrapping&&jn(this);var r=this.display.viewFrom;this.doc.iter(r,this.display.viewTo,function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){Ji(n,r,"widget");break}++r}),this.curOp.forceUpdate=!0,se(this,"refresh",this)}),operation:function(t){return Vi(this,t)},startOperation:function(){return Bi(this)},endOperation:function(){return ji(this)},refresh:Ki(function(){var t=this.display.cachedTextHeight;Qi(this),this.curOp.forceUpdate=!0,qn(this),Mi(this,this.doc.scrollLeft,this.doc.scrollTop),lr(this),(null==t||Math.abs(t-ni(this.display))>.5)&&ai(this),se(this,"refresh",this)}),swapDoc:Ki(function(t){var e=this.doc;return e.cm=null,Ir(this,t),qn(this),this.display.input.reset(),Mi(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,dn(this,"swapDoc",this,e),e}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ue(t),t.registerHelper=function(e,i,r){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][i]=r},t.registerGlobalHelper=function(e,i,r,o){t.registerHelper(e,i,o),n[e]._global.push({pred:r,val:o})}}(xs);var Ws,zs="iter insert remove copy getEditor constructor".split(" ");for(var Rs in To.prototype)To.prototype.hasOwnProperty(Rs)&&R(zs,Rs)<0&&(xs.prototype[Rs]=function(t){return function(){return t.apply(this.doc,arguments)}}(To.prototype[Rs]));return ue(To),xs.inputStyles={textarea:Fs,contenteditable:Ds},xs.defineMode=function(t){xs.defaults.mode||"null"==t||(xs.defaults.mode=t),function(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Me[t]=e}.apply(this,arguments)},xs.defineMIME=function(t,e){Ae[t]=e},xs.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),xs.defineMIME("text/plain","null"),xs.defineExtension=function(t,e){xs.prototype[t]=e},xs.defineDocExtension=function(t,e){To.prototype[t]=e},xs.fromTextArea=function(t,e){if((e=e?F(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=D();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function i(){t.value=a.getValue()}var r;if(t.form&&(ie(t.form,"submit",i),!e.leaveSubmitMethodAlone)){var o=t.form;r=o.submit;try{var s=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=s}}catch(t){}}e.finishInit=function(e){e.save=i,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,i(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(oe(t.form,"submit",i),"function"==typeof t.form.submit&&(t.form.submit=r))}},t.style.display="none";var a=xs(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},e);return a},(Ws=xs).off=oe,Ws.on=ie,Ws.wheelEventPixels=mr,Ws.Doc=To,Ws.splitLines=_e,Ws.countColumn=W,Ws.findColumn=G,Ws.isWordChar=tt,Ws.Pass=j,Ws.signal=se,Ws.Line=Ke,Ws.changeEnd=wr,Ws.scrollbarModel=Wi,Ws.Pos=mt,Ws.cmpPos=gt,Ws.modes=Me,Ws.mimeModes=Ae,Ws.resolveMode=Le,Ws.getMode=Ie,Ws.modeExtensions=Ee,Ws.extendMode=De,Ws.copyState=Ne,Ws.startState=Pe,Ws.innerMode=Oe,Ws.commands=Vo,Ws.keyMap=Wo,Ws.keyName=$o,Ws.isModifierKey=jo,Ws.lookupKey=Bo,Ws.normalizeKeyMap=Ro,Ws.StringStream=He,Ws.SharedTextMarker=Co,Ws.TextMarker=bo,Ws.LineWidget=vo,Ws.e_preventDefault=de,Ws.e_stopPropagation=he,Ws.e_stop=pe,Ws.addClass=N,Ws.contains=E,Ws.rmClass=T,Ws.keyNames=Oo,xs.version="5.28.0",xs}()},function(t,e,n){var i,r,o={},s=(i=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=i.apply(this,arguments)),r}),a=function(t){var e={};return function(t){if("function"==typeof t)return t();if(void 0===e[t]){var n=function(t){return document.querySelector(t)}.call(this,t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}}(),l=null,c=0,u=[],d=n(22);function h(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=o[i.id];if(r){r.refs++;for(var s=0;s<r.parts.length;s++)r.parts[s](i.parts[s]);for(;s<i.parts.length;s++)r.parts.push(y(i.parts[s],e))}else{var a=[];for(s=0;s<i.parts.length;s++)a.push(y(i.parts[s],e));o[i.id]={id:i.id,refs:1,parts:a}}}}function f(t,e){for(var n=[],i={},r=0;r<t.length;r++){var o=t[r],s=e.base?o[0]+e.base:o[0],a={css:o[1],media:o[2],sourceMap:o[3]};i[s]?i[s].parts.push(a):n.push(i[s]={id:s,parts:[a]})}return n}function p(t,e){var n=a(t.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 i=u[u.length-1];if("top"===t.insertAt)i?i.nextSibling?n.insertBefore(e,i.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),u.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.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 r=a(t.insertInto+" "+t.insertAt.before);n.insertBefore(e,r)}}function m(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=u.indexOf(t);e>=0&&u.splice(e,1)}function g(t){var e=document.createElement("style");return t.attrs.type="text/css",v(e,t.attrs),p(t,e),e}function v(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function y(t,e){var n,i,r,o;if(e.transform&&t.css){if(!(o=e.transform(t.css)))return function(){};t.css=o}if(e.singleton){var s=c++;n=l||(l=g(e)),i=w.bind(null,n,s,!1),r=w.bind(null,n,s,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",v(e,t.attrs),p(t,e),e}(e),i=function(t,e,n){var i=n.css,r=n.sourceMap,o=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||o)&&(i=d(i));r&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var s=new Blob([i],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}.bind(null,n,e),r=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(e),i=function(t,e){var n=e.css,i=e.media;i&&t.setAttribute("media",i);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){m(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=s()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=f(t,e);return h(n,e),function(t){for(var i=[],r=0;r<n.length;r++){var s=n[r];(a=o[s.id]).refs--,i.push(a)}t&&h(f(t,e),e);for(r=0;r<i.length;r++){var a;if(0===(a=i[r]).refs){for(var l=0;l<a.parts.length;l++)a.parts[l]();delete o[a.id]}}}};var x,b=(x=[],function(t,e){return x[t]=e,x.filter(Boolean).join("\n")});function w(t,e,n,i){var r=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=b(e,r);else{var o=document.createTextNode(r),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(o,s[e]):t.appendChild(o)}}},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var r=(s=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),o=i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"});return[n].concat(o).concat([r]).join("\n")}var s;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},r=0;r<this.length;r++){var o=this[r][0];"number"==typeof o&&(i[o]=!0)}for(r=0;r<t.length;r++){var s=t[r];"number"==typeof s[0]&&i[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),e.push(s))}},e}},function(t,e,n){var i;!function(e,n){"use strict";"object"==typeof t&&"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,function(n,r){"use strict";var o=[],s=n.document,a=Object.getPrototypeOf,l=o.slice,c=o.concat,u=o.push,d=o.indexOf,h={},f=h.toString,p=h.hasOwnProperty,m=p.toString,g=m.call(Object),v={},y=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},x=function(t){return null!=t&&t===t.window},b={type:!0,src:!0,noModule:!0};function w(t,e,n){var i,r=(e=e||s).createElement("script");if(r.text=t,n)for(i in b)n[i]&&(r[i]=n[i]);e.head.appendChild(r).parentNode.removeChild(r)}function C(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?h[f.call(t)]||"object":typeof t}var _=function(t,e){return new _.fn.init(t,e)},k=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function S(t){var e=!!t&&"length"in t&&t.length,n=C(t);return!y(t)&&!x(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}_.fn=_.prototype={jquery:"3.3.1",constructor:_,length:0,toArray:function(){return l.call(this)},get:function(t){return null==t?l.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=_.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return _.each(this,t)},map:function(t){return this.pushStack(_.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:o.sort,splice:o.splice},_.extend=_.fn.extend=function(){var t,e,n,i,r,o,s=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[a]||{},a++),"object"==typeof s||y(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)n=s[e],s!==(i=t[e])&&(c&&i&&(_.isPlainObject(i)||(r=Array.isArray(i)))?(r?(r=!1,o=n&&Array.isArray(n)?n:[]):o=n&&_.isPlainObject(n)?n:{},s[e]=_.extend(c,o,i)):void 0!==i&&(s[e]=i));return s},_.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==f.call(t))&&(!(e=a(t))||"function"==typeof(n=p.call(e,"constructor")&&e.constructor)&&m.call(n)===g)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t){w(t)},each:function(t,e){var n,i=0;if(S(t))for(n=t.length;i<n&&!1!==e.call(t[i],i,t[i]);i++);else for(i in t)if(!1===e.call(t[i],i,t[i]))break;return t},trim:function(t){return null==t?"":(t+"").replace(k,"")},makeArray:function(t,e){var n=e||[];return null!=t&&(S(Object(t))?_.merge(n,"string"==typeof t?[t]:t):u.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:d.call(e,t,n)},merge:function(t,e){for(var n=+e.length,i=0,r=t.length;i<n;i++)t[r++]=e[i];return t.length=r,t},grep:function(t,e,n){for(var i=[],r=0,o=t.length,s=!n;r<o;r++)!e(t[r],r)!==s&&i.push(t[r]);return i},map:function(t,e,n){var i,r,o=0,s=[];if(S(t))for(i=t.length;o<i;o++)null!=(r=e(t[o],o,n))&&s.push(r);else for(o in t)null!=(r=e(t[o],o,n))&&s.push(r);return c.apply([],s)},guid:1,support:v}),"function"==typeof Symbol&&(_.fn[Symbol.iterator]=o[Symbol.iterator]),_.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){h["[object "+e+"]"]=e.toLowerCase()});var T=function(t){var e,n,i,r,o,s,a,l,c,u,d,h,f,p,m,g,v,y,x,b="sizzle"+1*new Date,w=t.document,C=0,_=0,k=st(),S=st(),T=st(),M=function(t,e){return t===e&&(d=!0),0},A={}.hasOwnProperty,L=[],I=L.pop,E=L.push,D=L.push,N=L.slice,O=function(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",H="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",W="\\["+H+"*("+F+")(?:"+H+"*([*^$|!~]?=)"+H+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+H+"*\\]",z=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",R=new RegExp(H+"+","g"),B=new RegExp("^"+H+"+|((?:^|[^\\\\])(?:\\\\.)*)"+H+"+$","g"),j=new RegExp("^"+H+"*,"+H+"*"),q=new RegExp("^"+H+"*([>+~]|"+H+")"+H+"*"),$=new RegExp("="+H+"*([^\\]'\"]*?)"+H+"*\\]","g"),U=new RegExp(z),G=new RegExp("^"+F+"$"),V={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+H+"*(even|odd|(([+-]|)(\\d*)n|)"+H+"*(?:([+-]|)"+H+"*(\\d+)|))"+H+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+H+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+H+"*((?:-\\d)?\\d*)"+H+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,J=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+H+"?|("+H+")|.)","ig"),tt=function(t,e,n){var i="0x"+e-65536;return i!=i||n?e:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},et=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,nt=function(t,e){return e?"\0"===t?"<22>":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},it=function(){h()},rt=yt(function(t){return!0===t.disabled&&("form"in t||"label"in t)},{dir:"parentNode",next:"legend"});try{D.apply(L=N.call(w.childNodes),w.childNodes),L[w.childNodes.length].nodeType}catch(t){D={apply:L.length?function(t,e){E.apply(t,N.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}function ot(t,e,i,r){var o,a,c,u,d,p,v,y=e&&e.ownerDocument,C=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==C&&9!==C&&11!==C)return i;if(!r&&((e?e.ownerDocument||e:w)!==f&&h(e),e=e||f,m)){if(11!==C&&(d=Q.exec(t)))if(o=d[1]){if(9===C){if(!(c=e.getElementById(o)))return i;if(c.id===o)return i.push(c),i}else if(y&&(c=y.getElementById(o))&&x(e,c)&&c.id===o)return i.push(c),i}else{if(d[2])return D.apply(i,e.getElementsByTagName(t)),i;if((o=d[3])&&n.getElementsByClassName&&e.getElementsByClassName)return D.apply(i,e.getElementsByClassName(o)),i}if(n.qsa&&!T[t+" "]&&(!g||!g.test(t))){if(1!==C)y=e,v=t;else if("object"!==e.nodeName.toLowerCase()){for((u=e.getAttribute("id"))?u=u.replace(et,nt):e.setAttribute("id",u=b),a=(p=s(t)).length;a--;)p[a]="#"+u+" "+vt(p[a]);v=p.join(","),y=J.test(t)&&mt(e.parentNode)||e}if(v)try{return D.apply(i,y.querySelectorAll(v)),i}catch(t){}finally{u===b&&e.removeAttribute("id")}}}return l(t.replace(B,"$1"),e,i,r)}function st(){var t=[];return function e(n,r){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function at(t){return t[b]=!0,t}function lt(t){var e=f.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ct(t,e){for(var n=t.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=e}function ut(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function dt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ht(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function ft(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&rt(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function pt(t){return at(function(e){return e=+e,at(function(n,i){for(var r,o=t([],n.length,e),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))})})}function mt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=ot.support={},o=ot.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},h=ot.setDocument=function(t){var e,r,s=t?t.ownerDocument||t:w;return s!==f&&9===s.nodeType&&s.documentElement?(p=(f=s).documentElement,m=!o(f),w!==f&&(r=f.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",it,!1):r.attachEvent&&r.attachEvent("onunload",it)),n.attributes=lt(function(t){return t.className="i",!t.getAttribute("className")}),n.getElementsByTagName=lt(function(t){return t.appendChild(f.createComment("")),!t.getElementsByTagName("*").length}),n.getElementsByClassName=Y.test(f.getElementsByClassName),n.getById=lt(function(t){return p.appendChild(t).id=b,!f.getElementsByName||!f.getElementsByName(b).length}),n.getById?(i.filter.ID=function(t){var e=t.replace(Z,tt);return function(t){return t.getAttribute("id")===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n=e.getElementById(t);return n?[n]:[]}}):(i.filter.ID=function(t){var e=t.replace(Z,tt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n,i,r,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(r=e.getElementsByName(t),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),i.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},i.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&m)return e.getElementsByClassName(t)},v=[],g=[],(n.qsa=Y.test(f.querySelectorAll))&&(lt(function(t){p.appendChild(t).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+H+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+H+"*(?:value|"+P+")"),t.querySelectorAll("[id~="+b+"-]").length||g.push("~="),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]")}),lt(function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=f.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+H+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),p.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=Y.test(y=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&lt(function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),v.push("!=",z)}),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),e=Y.test(p.compareDocumentPosition),x=e||Y.test(p.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},M=e?function(t,e){if(t===e)return d=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===i?t===f||t.ownerDocument===w&&x(w,t)?-1:e===f||e.ownerDocument===w&&x(w,e)?1:u?O(u,t)-O(u,e):0:4&i?-1:1)}:function(t,e){if(t===e)return d=!0,0;var n,i=0,r=t.parentNode,o=e.parentNode,s=[t],a=[e];if(!r||!o)return t===f?-1:e===f?1:r?-1:o?1:u?O(u,t)-O(u,e):0;if(r===o)return ut(t,e);for(n=t;n=n.parentNode;)s.unshift(n);for(n=e;n=n.parentNode;)a.unshift(n);for(;s[i]===a[i];)i++;return i?ut(s[i],a[i]):s[i]===w?-1:a[i]===w?1:0},f):f},ot.matches=function(t,e){return ot(t,null,null,e)},ot.matchesSelector=function(t,e){if((t.ownerDocument||t)!==f&&h(t),e=e.replace($,"='$1']"),n.matchesSelector&&m&&!T[e+" "]&&(!v||!v.test(e))&&(!g||!g.test(e)))try{var i=y.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){}return ot(e,f,null,[t]).length>0},ot.contains=function(t,e){return(t.ownerDocument||t)!==f&&h(t),x(t,e)},ot.attr=function(t,e){(t.ownerDocument||t)!==f&&h(t);var r=i.attrHandle[e.toLowerCase()],o=r&&A.call(i.attrHandle,e.toLowerCase())?r(t,e,!m):void 0;return void 0!==o?o:n.attributes||!m?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},ot.escape=function(t){return(t+"").replace(et,nt)},ot.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ot.uniqueSort=function(t){var e,i=[],r=0,o=0;if(d=!n.detectDuplicates,u=!n.sortStable&&t.slice(0),t.sort(M),d){for(;e=t[o++];)e===t[o]&&(r=i.push(o));for(;r--;)t.splice(i[r],1)}return u=null,t},r=ot.getText=function(t){var e,n="",i=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=r(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[i++];)n+=r(e);return n},(i=ot.selectors={cacheLength:50,createPseudo:at,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Z,tt),t[3]=(t[3]||t[4]||t[5]||"").replace(Z,tt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ot.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ot.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return V.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&U.test(n)&&(e=s(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Z,tt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=k[t+" "];return e||(e=new RegExp("(^|"+H+")"+t+"("+H+"|$)"))&&k(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(i){var r=ot.attr(i,t);return null==r?"!="===e:!e||(r+="","="===e?r===n:"!="===e?r!==n:"^="===e?n&&0===r.indexOf(n):"*="===e?n&&r.indexOf(n)>-1:"$="===e?n&&r.slice(-n.length)===n:"~="===e?(" "+r.replace(R," ")+" ").indexOf(n)>-1:"|="===e&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,l){var c,u,d,h,f,p,m=o!==s?"nextSibling":"previousSibling",g=e.parentNode,v=a&&e.nodeName.toLowerCase(),y=!l&&!a,x=!1;if(g){if(o){for(;m;){for(h=e;h=h[m];)if(a?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;p=m="only"===t&&!p&&"nextSibling"}return!0}if(p=[s?g.firstChild:g.lastChild],s&&y){for(x=(f=(c=(u=(d=(h=g)[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]||[])[0]===C&&c[1])&&c[2],h=f&&g.childNodes[f];h=++f&&h&&h[m]||(x=f=0)||p.pop();)if(1===h.nodeType&&++x&&h===e){u[t]=[C,f,x];break}}else if(y&&(x=f=(c=(u=(d=(h=e)[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]||[])[0]===C&&c[1]),!1===x)for(;(h=++f&&h&&h[m]||(x=f=0)||p.pop())&&((a?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++x||(y&&((u=(d=h[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]=[C,x]),h!==e)););return(x-=r)===i||x%i==0&&x/i>=0}}},PSEUDO:function(t,e){var n,r=i.pseudos[t]||i.setFilters[t.toLowerCase()]||ot.error("unsupported pseudo: "+t);return r[b]?r(e):r.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?at(function(t,n){for(var i,o=r(t,e),s=o.length;s--;)t[i=O(t,o[s])]=!(n[i]=o[s])}):function(t){return r(t,0,n)}):r}},pseudos:{not:at(function(t){var e=[],n=[],i=a(t.replace(B,"$1"));return i[b]?at(function(t,e,n,r){for(var o,s=i(t,null,r,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))}):function(t,r,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}}),has:at(function(t){return function(e){return ot(t,e).length>0}}),contains:at(function(t){return t=t.replace(Z,tt),function(e){return(e.textContent||e.innerText||r(e)).indexOf(t)>-1}}),lang:at(function(t){return G.test(t||"")||ot.error("unsupported lang: "+t),t=t.replace(Z,tt).toLowerCase(),function(e){var n;do{if(n=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===p},focus:function(t){return t===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:ft(!1),disabled:ft(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!i.pseudos.empty(t)},header:function(t){return K.test(t.nodeName)},input:function(t){return X.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:pt(function(){return[0]}),last:pt(function(t,e){return[e-1]}),eq:pt(function(t,e,n){return[n<0?n+e:n]}),even:pt(function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t}),odd:pt(function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t}),lt:pt(function(t,e,n){for(var i=n<0?n+e:n;--i>=0;)t.push(i);return t}),gt:pt(function(t,e,n){for(var i=n<0?n+e:n;++i<e;)t.push(i);return t})}}).pseudos.nth=i.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[e]=dt(e);for(e in{submit:!0,reset:!0})i.pseudos[e]=ht(e);function gt(){}function vt(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e].value;return i}function yt(t,e,n){var i=e.dir,r=e.next,o=r||i,s=n&&"parentNode"===o,a=_++;return e.first?function(e,n,r){for(;e=e[i];)if(1===e.nodeType||s)return t(e,n,r);return!1}:function(e,n,l){var c,u,d,h=[C,a];if(l){for(;e=e[i];)if((1===e.nodeType||s)&&t(e,n,l))return!0}else for(;e=e[i];)if(1===e.nodeType||s)if(u=(d=e[b]||(e[b]={}))[e.uniqueID]||(d[e.uniqueID]={}),r&&r===e.nodeName.toLowerCase())e=e[i]||e;else{if((c=u[o])&&c[0]===C&&c[1]===a)return h[2]=c[2];if(u[o]=h,h[2]=t(e,n,l))return!0}return!1}}function xt(t){return t.length>1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function bt(t,e,n,i,r){for(var o,s=[],a=0,l=t.length,c=null!=e;a<l;a++)(o=t[a])&&(n&&!n(o,i,r)||(s.push(o),c&&e.push(a)));return s}function wt(t,e,n,i,r,o){return i&&!i[b]&&(i=wt(i)),r&&!r[b]&&(r=wt(r,o)),at(function(o,s,a,l){var c,u,d,h=[],f=[],p=s.length,m=o||function(t,e,n){for(var i=0,r=e.length;i<r;i++)ot(t,e[i],n);return n}(e||"*",a.nodeType?[a]:a,[]),g=!t||!o&&e?m:bt(m,h,t,a,l),v=n?r||(o?t:p||i)?[]:s:g;if(n&&n(g,v,a,l),i)for(c=bt(v,f),i(c,[],a,l),u=c.length;u--;)(d=c[u])&&(v[f[u]]=!(g[f[u]]=d));if(o){if(r||t){if(r){for(c=[],u=v.length;u--;)(d=v[u])&&c.push(g[u]=d);r(null,v=[],c,l)}for(u=v.length;u--;)(d=v[u])&&(c=r?O(o,d):h[u])>-1&&(o[c]=!(s[c]=d))}}else v=bt(v===s?v.splice(p,v.length):v),r?r(null,s,v,l):D.apply(s,v)})}function Ct(t){for(var e,n,r,o=t.length,s=i.relative[t[0].type],a=s||i.relative[" "],l=s?1:0,u=yt(function(t){return t===e},a,!0),d=yt(function(t){return O(e,t)>-1},a,!0),h=[function(t,n,i){var r=!s&&(i||n!==c)||((e=n).nodeType?u(t,n,i):d(t,n,i));return e=null,r}];l<o;l++)if(n=i.relative[t[l].type])h=[yt(xt(h),n)];else{if((n=i.filter[t[l].type].apply(null,t[l].matches))[b]){for(r=++l;r<o&&!i.relative[t[r].type];r++);return wt(l>1&&xt(h),l>1&&vt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(B,"$1"),n,l<r&&Ct(t.slice(l,r)),r<o&&Ct(t=t.slice(r)),r<o&&vt(t))}h.push(n)}return xt(h)}return gt.prototype=i.filters=i.pseudos,i.setFilters=new gt,s=ot.tokenize=function(t,e){var n,r,o,s,a,l,c,u=S[t+" "];if(u)return e?0:u.slice(0);for(a=t,l=[],c=i.preFilter;a;){for(s in n&&!(r=j.exec(a))||(r&&(a=a.slice(r[0].length)||a),l.push(o=[])),n=!1,(r=q.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(B," ")}),a=a.slice(n.length)),i.filter)!(r=V[s].exec(a))||c[s]&&!(r=c[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return e?a.length:a?ot.error(t):S(t,l).slice(0)},a=ot.compile=function(t,e){var n,r=[],o=[],a=T[t+" "];if(!a){for(e||(e=s(t)),n=e.length;n--;)(a=Ct(e[n]))[b]?r.push(a):o.push(a);(a=T(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,s,a,l,u){var d,p,g,v=0,y="0",x=o&&[],b=[],w=c,_=o||r&&i.find.TAG("*",u),k=C+=null==w?1:Math.random()||.1,S=_.length;for(u&&(c=s===f||s||u);y!==S&&null!=(d=_[y]);y++){if(r&&d){for(p=0,s||d.ownerDocument===f||(h(d),a=!m);g=t[p++];)if(g(d,s||f,a)){l.push(d);break}u&&(C=k)}n&&((d=!g&&d)&&v--,o&&x.push(d))}if(v+=y,n&&y!==v){for(p=0;g=e[p++];)g(x,b,s,a);if(o){if(v>0)for(;y--;)x[y]||b[y]||(b[y]=I.call(l));b=bt(b)}D.apply(l,b),u&&!o&&b.length>0&&v+e.length>1&&ot.uniqueSort(l)}return u&&(C=k,c=w),x};return n?at(o):o}(o,r))).selector=t}return a},l=ot.select=function(t,e,n,r){var o,l,c,u,d,h="function"==typeof t&&t,f=!r&&s(t=h.selector||t);if(n=n||[],1===f.length){if((l=f[0]=f[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===e.nodeType&&m&&i.relative[l[1].type]){if(!(e=(i.find.ID(c.matches[0].replace(Z,tt),e)||[])[0]))return n;h&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(o=V.needsContext.test(t)?0:l.length;o--&&(c=l[o],!i.relative[u=c.type]);)if((d=i.find[u])&&(r=d(c.matches[0].replace(Z,tt),J.test(l[0].type)&&mt(e.parentNode)||e))){if(l.splice(o,1),!(t=r.length&&vt(l)))return D.apply(n,r),n;break}}return(h||a(t,f))(r,e,!m,n,!e||J.test(t)&&mt(e.parentNode)||e),n},n.sortStable=b.split("").sort(M).join("")===b,n.detectDuplicates=!!d,h(),n.sortDetached=lt(function(t){return 1&t.compareDocumentPosition(f.createElement("fieldset"))}),lt(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||ct("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),n.attributes&&lt(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||ct("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),lt(function(t){return null==t.getAttribute("disabled")})||ct(P,function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null}),ot}(n);_.find=T,_.expr=T.selectors,_.expr[":"]=_.expr.pseudos,_.uniqueSort=_.unique=T.uniqueSort,_.text=T.getText,_.isXMLDoc=T.isXML,_.contains=T.contains,_.escapeSelector=T.escape;var M=function(t,e,n){for(var i=[],r=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&_(t).is(n))break;i.push(t)}return i},A=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},L=_.expr.match.needsContext;function I(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var E=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(t,e,n){return y(e)?_.grep(t,function(t,i){return!!e.call(t,i,t)!==n}):e.nodeType?_.grep(t,function(t){return t===e!==n}):"string"!=typeof e?_.grep(t,function(t){return d.call(e,t)>-1!==n}):_.filter(e,t,n)}_.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?_.find.matchesSelector(i,t)?[i]:[]:_.find.matches(t,_.grep(e,function(t){return 1===t.nodeType}))},_.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!=typeof t)return this.pushStack(_(t).filter(function(){for(e=0;e<i;e++)if(_.contains(r[e],this))return!0}));for(n=this.pushStack([]),e=0;e<i;e++)_.find(t,r[e],n);return i>1?_.uniqueSort(n):n},filter:function(t){return this.pushStack(D(this,t||[],!1))},not:function(t){return this.pushStack(D(this,t||[],!0))},is:function(t){return!!D(this,"string"==typeof t&&L.test(t)?_(t):t||[],!1).length}});var N,O=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||N,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:O.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof _?e[0]:e,_.merge(this,_.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:s,!0)),E.test(i[1])&&_.isPlainObject(e))for(i in e)y(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(r=s.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):y(t)?void 0!==n.ready?n.ready(t):t(_):_.makeArray(t,this)}).prototype=_.fn,N=_(s);var P=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function F(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}_.fn.extend({has:function(t){var e=_(t,this),n=e.length;return this.filter(function(){for(var t=0;t<n;t++)if(_.contains(this,e[t]))return!0})},closest:function(t,e){var n,i=0,r=this.length,o=[],s="string"!=typeof t&&_(t);if(!L.test(t))for(;i<r;i++)for(n=this[i];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&_.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?_.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?d.call(_(t),this[0]):d.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),_.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return M(t,"parentNode")},parentsUntil:function(t,e,n){return M(t,"parentNode",n)},next:function(t){return F(t,"nextSibling")},prev:function(t){return F(t,"previousSibling")},nextAll:function(t){return M(t,"nextSibling")},prevAll:function(t){return M(t,"previousSibling")},nextUntil:function(t,e,n){return M(t,"nextSibling",n)},prevUntil:function(t,e,n){return M(t,"previousSibling",n)},siblings:function(t){return A((t.parentNode||{}).firstChild,t)},children:function(t){return A(t.firstChild)},contents:function(t){return I(t,"iframe")?t.contentDocument:(I(t,"template")&&(t=t.content||t),_.merge([],t.childNodes))}},function(t,e){_.fn[t]=function(n,i){var r=_.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=_.filter(i,r)),this.length>1&&(H[t]||_.uniqueSort(r),P.test(t)&&r.reverse()),this.pushStack(r)}});var W=/[^\x20\t\r\n\f]+/g;function z(t){return t}function R(t){throw t}function B(t,e,n,i){var r;try{t&&y(r=t.promise)?r.call(t).done(e).fail(n):t&&y(r=t.then)?r.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}_.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return _.each(t.match(W)||[],function(t,n){e[n]=!0}),e}(t):_.extend({},t);var e,n,i,r,o=[],s=[],a=-1,l=function(){for(r=r||t.once,i=e=!0;s.length;a=-1)for(n=s.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&t.stopOnFalse&&(a=o.length,n=!1);t.memory||(n=!1),e=!1,r&&(o=n?[]:"")},c={add:function(){return o&&(n&&!e&&(a=o.length-1,s.push(n)),function e(n){_.each(n,function(n,i){y(i)?t.unique&&c.has(i)||o.push(i):i&&i.length&&"string"!==C(i)&&e(i)})}(arguments),n&&!e&&l()),this},remove:function(){return _.each(arguments,function(t,e){for(var n;(n=_.inArray(e,o,n))>-1;)o.splice(n,1),n<=a&&a--}),this},has:function(t){return t?_.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=s=[],n||e||(o=n=""),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=[t,(n=n||[]).slice?n.slice():n],s.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},_.extend({Deferred:function(t){var e=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return _.Deferred(function(n){_.each(e,function(e,i){var r=y(t[i[4]])&&t[i[4]];o[i[1]](function(){var t=r&&r.apply(this,arguments);t&&y(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,r?[t]:arguments)})}),t=null}).promise()},then:function(t,i,r){var o=0;function s(t,e,i,r){return function(){var a=this,l=arguments,c=function(){var n,c;if(!(t<o)){if((n=i.apply(a,l))===e.promise())throw new TypeError("Thenable self-resolution");c=n&&("object"==typeof n||"function"==typeof n)&&n.then,y(c)?r?c.call(n,s(o,e,z,r),s(o,e,R,r)):(o++,c.call(n,s(o,e,z,r),s(o,e,R,r),s(o,e,z,e.notifyWith))):(i!==z&&(a=void 0,l=[n]),(r||e.resolveWith)(a,l))}},u=r?c:function(){try{c()}catch(n){_.Deferred.exceptionHook&&_.Deferred.exceptionHook(n,u.stackTrace),t+1>=o&&(i!==R&&(a=void 0,l=[n]),e.rejectWith(a,l))}};t?u():(_.Deferred.getStackHook&&(u.stackTrace=_.Deferred.getStackHook()),n.setTimeout(u))}}return _.Deferred(function(n){e[0][3].add(s(0,n,y(r)?r:z,n.notifyWith)),e[1][3].add(s(0,n,y(t)?t:z)),e[2][3].add(s(0,n,y(i)?i:R))}).promise()},promise:function(t){return null!=t?_.extend(t,r):r}},o={};return _.each(e,function(t,n){var s=n[2],a=n[5];r[n[1]]=s.add,a&&s.add(function(){i=a},e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),s.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=s.fireWith}),r.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,i=Array(n),r=l.call(arguments),o=_.Deferred(),s=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?l.call(arguments):n,--e||o.resolveWith(i,r)}};if(e<=1&&(B(t,o.done(s(n)).resolve,o.reject,!e),"pending"===o.state()||y(r[n]&&r[n].then)))return o.then();for(;n--;)B(r[n],s(n),o.reject);return o.promise()}});var j=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&j.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},_.readyException=function(t){n.setTimeout(function(){throw t})};var q=_.Deferred();function $(){s.removeEventListener("DOMContentLoaded",$),n.removeEventListener("load",$),_.ready()}_.fn.ready=function(t){return q.then(t).catch(function(t){_.readyException(t)}),this},_.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==t&&--_.readyWait>0||q.resolveWith(s,[_]))}}),_.ready.then=q.then,"complete"===s.readyState||"loading"!==s.readyState&&!s.documentElement.doScroll?n.setTimeout(_.ready):(s.addEventListener("DOMContentLoaded",$),n.addEventListener("load",$));var U=function(t,e,n,i,r,o,s){var a=0,l=t.length,c=null==n;if("object"===C(n))for(a in r=!0,n)U(t,e,a,n[a],!0,o,s);else if(void 0!==i&&(r=!0,y(i)||(s=!0),c&&(s?(e.call(t,i),e=null):(c=e,e=function(t,e,n){return c.call(_(t),n)})),e))for(;a<l;a++)e(t[a],n,s?i:i.call(t[a],a,e(t[a],n)));return r?t:c?e.call(t):l?e(t[0],n):o},G=/^-ms-/,V=/-([a-z])/g;function X(t,e){return e.toUpperCase()}function K(t){return t.replace(G,"ms-").replace(V,X)}var Y=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function Q(){this.expando=_.expando+Q.uid++}Q.uid=1,Q.prototype={cache:function(t){var e=t[this.expando];return e||(e={},Y(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var i,r=this.cache(t);if("string"==typeof e)r[K(e)]=n;else for(i in e)r[K(i)]=e[i];return r},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][K(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,i=t[this.expando];if(void 0!==i){if(void 0!==e){n=(e=Array.isArray(e)?e.map(K):(e=K(e))in i?[e]:e.match(W)||[]).length;for(;n--;)delete i[e[n]]}(void 0===e||_.isEmptyObject(i))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!_.isEmptyObject(e)}};var J=new Q,Z=new Q,tt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,et=/[A-Z]/g;function nt(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(et,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(i))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:tt.test(t)?JSON.parse(t):t)}(n)}catch(t){}Z.set(t,e,n)}else n=void 0;return n}_.extend({hasData:function(t){return Z.hasData(t)||J.hasData(t)},data:function(t,e,n){return Z.access(t,e,n)},removeData:function(t,e){Z.remove(t,e)},_data:function(t,e,n){return J.access(t,e,n)},_removeData:function(t,e){J.remove(t,e)}}),_.fn.extend({data:function(t,e){var n,i,r,o=this[0],s=o&&o.attributes;if(void 0===t){if(this.length&&(r=Z.get(o),1===o.nodeType&&!J.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(i=s[n].name).indexOf("data-")&&(i=K(i.slice(5)),nt(o,i,r[i]));J.set(o,"hasDataAttrs",!0)}return r}return"object"==typeof t?this.each(function(){Z.set(this,t)}):U(this,function(e){var n;if(o&&void 0===e)return void 0!==(n=Z.get(o,t))?n:void 0!==(n=nt(o,t))?n:void 0;this.each(function(){Z.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){Z.remove(this,t)})}}),_.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=J.get(t,e),n&&(!i||Array.isArray(n)?i=J.access(t,e,_.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=_.queue(t,e),i=n.length,r=n.shift(),o=_._queueHooks(t,e);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,function(){_.dequeue(t,e)},o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return J.get(t,n)||J.access(t,n,{empty:_.Callbacks("once memory").add(function(){J.remove(t,[e+"queue",n])})})}}),_.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?_.queue(this[0],t):void 0===e?this:this.each(function(){var n=_.queue(this,t,e);_._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&_.dequeue(this,t)})},dequeue:function(t){return this.each(function(){_.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,r=_.Deferred(),o=this,s=this.length,a=function(){--i||r.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";s--;)(n=J.get(o[s],t+"queueHooks"))&&n.empty&&(i++,n.empty.add(a));return a(),r.promise(e)}});var it=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,rt=new RegExp("^(?:([+-])=|)("+it+")([a-z%]*)$","i"),ot=["Top","Right","Bottom","Left"],st=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&_.contains(t.ownerDocument,t)&&"none"===_.css(t,"display")},at=function(t,e,n,i){var r,o,s={};for(o in e)s[o]=t.style[o],t.style[o]=e[o];for(o in r=n.apply(t,i||[]),e)t.style[o]=s[o];return r};function lt(t,e,n,i){var r,o,s=20,a=i?function(){return i.cur()}:function(){return _.css(t,e,"")},l=a(),c=n&&n[3]||(_.cssNumber[e]?"":"px"),u=(_.cssNumber[e]||"px"!==c&&+l)&&rt.exec(_.css(t,e));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;s--;)_.style(t,e,u+c),(1-o)*(1-(o=a()/l||.5))<=0&&(s=0),u/=o;u*=2,_.style(t,e,u+c),n=n||[]}return n&&(u=+u||+l||0,r=n[1]?u+(n[1]+1)*n[2]:+n[2],i&&(i.unit=c,i.start=u,i.end=r)),r}var ct={};function ut(t){var e,n=t.ownerDocument,i=t.nodeName,r=ct[i];return r||(e=n.body.appendChild(n.createElement(i)),r=_.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),ct[i]=r,r)}function dt(t,e){for(var n,i,r=[],o=0,s=t.length;o<s;o++)(i=t[o]).style&&(n=i.style.display,e?("none"===n&&(r[o]=J.get(i,"display")||null,r[o]||(i.style.display="")),""===i.style.display&&st(i)&&(r[o]=ut(i))):"none"!==n&&(r[o]="none",J.set(i,"display",n)));for(o=0;o<s;o++)null!=r[o]&&(t[o].style.display=r[o]);return t}_.fn.extend({show:function(){return dt(this,!0)},hide:function(){return dt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){st(this)?_(this).show():_(this).hide()})}});var ht=/^(?:checkbox|radio)$/i,ft=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,pt=/^$|^module$|\/(?:java|ecma)script/i,mt={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function gt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&I(t,e)?_.merge([t],n):n}function vt(t,e){for(var n=0,i=t.length;n<i;n++)J.set(t[n],"globalEval",!e||J.get(e[n],"globalEval"))}mt.optgroup=mt.option,mt.tbody=mt.tfoot=mt.colgroup=mt.caption=mt.thead,mt.th=mt.td;var yt,xt,bt=/<|&#?\w+;/;function wt(t,e,n,i,r){for(var o,s,a,l,c,u,d=e.createDocumentFragment(),h=[],f=0,p=t.length;f<p;f++)if((o=t[f])||0===o)if("object"===C(o))_.merge(h,o.nodeType?[o]:o);else if(bt.test(o)){for(s=s||d.appendChild(e.createElement("div")),a=(ft.exec(o)||["",""])[1].toLowerCase(),l=mt[a]||mt._default,s.innerHTML=l[1]+_.htmlPrefilter(o)+l[2],u=l[0];u--;)s=s.lastChild;_.merge(h,s.childNodes),(s=d.firstChild).textContent=""}else h.push(e.createTextNode(o));for(d.textContent="",f=0;o=h[f++];)if(i&&_.inArray(o,i)>-1)r&&r.push(o);else if(c=_.contains(o.ownerDocument,o),s=gt(d.appendChild(o),"script"),c&&vt(s),n)for(u=0;o=s[u++];)pt.test(o.type||"")&&n.push(o);return d}yt=s.createDocumentFragment().appendChild(s.createElement("div")),(xt=s.createElement("input")).setAttribute("type","radio"),xt.setAttribute("checked","checked"),xt.setAttribute("name","t"),yt.appendChild(xt),v.checkClone=yt.cloneNode(!0).cloneNode(!0).lastChild.checked,yt.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!yt.cloneNode(!0).lastChild.defaultValue;var Ct=s.documentElement,_t=/^key/,kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,St=/^([^.]*)(?:\.(.+)|)/;function Tt(){return!0}function Mt(){return!1}function At(){try{return s.activeElement}catch(t){}}function Lt(t,e,n,i,r,o){var s,a;if("object"==typeof e){for(a in"string"!=typeof n&&(i=i||n,n=void 0),e)Lt(t,a,n,i,e[a],o);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=Mt;else if(!r)return t;return 1===o&&(s=r,(r=function(t){return _().off(t),s.apply(this,arguments)}).guid=s.guid||(s.guid=_.guid++)),t.each(function(){_.event.add(this,e,r,i,n)})}_.event={global:{},add:function(t,e,n,i,r){var o,s,a,l,c,u,d,h,f,p,m,g=J.get(t);if(g)for(n.handler&&(n=(o=n).handler,r=o.selector),r&&_.find.matchesSelector(Ct,r),n.guid||(n.guid=_.guid++),(l=g.events)||(l=g.events={}),(s=g.handle)||(s=g.handle=function(e){return void 0!==_&&_.event.triggered!==e.type?_.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(W)||[""]).length;c--;)f=m=(a=St.exec(e[c])||[])[1],p=(a[2]||"").split(".").sort(),f&&(d=_.event.special[f]||{},f=(r?d.delegateType:d.bindType)||f,d=_.event.special[f]||{},u=_.extend({type:f,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&_.expr.match.needsContext.test(r),namespace:p.join(".")},o),(h=l[f])||((h=l[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,i,p,s)||t.addEventListener&&t.addEventListener(f,s)),d.add&&(d.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),r?h.splice(h.delegateCount++,0,u):h.push(u),_.event.global[f]=!0)},remove:function(t,e,n,i,r){var o,s,a,l,c,u,d,h,f,p,m,g=J.hasData(t)&&J.get(t);if(g&&(l=g.events)){for(c=(e=(e||"").match(W)||[""]).length;c--;)if(f=m=(a=St.exec(e[c])||[])[1],p=(a[2]||"").split(".").sort(),f){for(d=_.event.special[f]||{},h=l[f=(i?d.delegateType:d.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=h.length;o--;)u=h[o],!r&&m!==u.origType||n&&n.guid!==u.guid||a&&!a.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(h.splice(o,1),u.selector&&h.delegateCount--,d.remove&&d.remove.call(t,u));s&&!h.length&&(d.teardown&&!1!==d.teardown.call(t,p,g.handle)||_.removeEvent(t,f,g.handle),delete l[f])}else for(f in l)_.event.remove(t,f+e[c],n,i,!0);_.isEmptyObject(l)&&J.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,o,s,a=_.event.fix(t),l=new Array(arguments.length),c=(J.get(this,"events")||{})[a.type]||[],u=_.event.special[a.type]||{};for(l[0]=a,e=1;e<arguments.length;e++)l[e]=arguments[e];if(a.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,a)){for(s=_.event.handlers.call(this,a,c),e=0;(r=s[e++])&&!a.isPropagationStopped();)for(a.currentTarget=r.elem,n=0;(o=r.handlers[n++])&&!a.isImmediatePropagationStopped();)a.rnamespace&&!a.rnamespace.test(o.namespace)||(a.handleObj=o,a.data=o.data,void 0!==(i=((_.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,l))&&!1===(a.result=i)&&(a.preventDefault(),a.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,a),a.result}},handlers:function(t,e){var n,i,r,o,s,a=[],l=e.delegateCount,c=t.target;if(l&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(o=[],s={},n=0;n<l;n++)void 0===s[r=(i=e[n]).selector+" "]&&(s[r]=i.needsContext?_(r,this).index(c)>-1:_.find(r,this,null,[c]).length),s[r]&&o.push(i);o.length&&a.push({elem:c,handlers:o})}return c=this,l<e.length&&a.push({elem:c,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(_.Event.prototype,t,{enumerable:!0,configurable:!0,get:y(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[_.expando]?t:new _.Event(t)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==At()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===At()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&I(this,"input"))return this.click(),!1},_default:function(t){return I(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},_.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},_.Event=function(t,e){if(!(this instanceof _.Event))return new _.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Tt:Mt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&_.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[_.expando]=!0},_.Event.prototype={constructor:_.Event,isDefaultPrevented:Mt,isPropagationStopped:Mt,isImmediatePropagationStopped:Mt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Tt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Tt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Tt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},_.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(t){var e=t.button;return null==t.which&&_t.test(t.type)?null!=t.charCode?t.charCode:t.keyCode:!t.which&&void 0!==e&&kt.test(t.type)?1&e?1:2&e?3:4&e?2:0:t.which}},_.event.addProp),_.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){_.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=t.relatedTarget,r=t.handleObj;return i&&(i===this||_.contains(this,i))||(t.type=r.origType,n=r.handler.apply(this,arguments),t.type=e),n}}}),_.fn.extend({on:function(t,e,n,i){return Lt(this,t,e,n,i)},one:function(t,e,n,i){return Lt(this,t,e,n,i,1)},off:function(t,e,n){var i,r;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,_(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof t){for(r in t)this.off(r,e,t[r]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=Mt),this.each(function(){_.event.remove(this,t,n,e)})}});var It=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Et=/<script|<style|<link/i,Dt=/checked\s*(?:[^=]|=\s*.checked.)/i,Nt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ot(t,e){return I(t,"table")&&I(11!==e.nodeType?e:e.firstChild,"tr")&&_(t).children("tbody")[0]||t}function Pt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Ht(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Ft(t,e){var n,i,r,o,s,a,l,c;if(1===e.nodeType){if(J.hasData(t)&&(o=J.access(t),s=J.set(e,o),c=o.events))for(r in delete s.handle,s.events={},c)for(n=0,i=c[r].length;n<i;n++)_.event.add(e,r,c[r][n]);Z.hasData(t)&&(a=Z.access(t),l=_.extend({},a),Z.set(e,l))}}function Wt(t,e,n,i){e=c.apply([],e);var r,o,s,a,l,u,d=0,h=t.length,f=h-1,p=e[0],m=y(p);if(m||h>1&&"string"==typeof p&&!v.checkClone&&Dt.test(p))return t.each(function(r){var o=t.eq(r);m&&(e[0]=p.call(this,r,o.html())),Wt(o,e,n,i)});if(h&&(o=(r=wt(e,t[0].ownerDocument,!1,t,i)).firstChild,1===r.childNodes.length&&(r=o),o||i)){for(a=(s=_.map(gt(r,"script"),Pt)).length;d<h;d++)l=r,d!==f&&(l=_.clone(l,!0,!0),a&&_.merge(s,gt(l,"script"))),n.call(t[d],l,d);if(a)for(u=s[s.length-1].ownerDocument,_.map(s,Ht),d=0;d<a;d++)l=s[d],pt.test(l.type||"")&&!J.access(l,"globalEval")&&_.contains(u,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?_._evalUrl&&_._evalUrl(l.src):w(l.textContent.replace(Nt,""),u,l))}return t}function zt(t,e,n){for(var i,r=e?_.filter(e,t):t,o=0;null!=(i=r[o]);o++)n||1!==i.nodeType||_.cleanData(gt(i)),i.parentNode&&(n&&_.contains(i.ownerDocument,i)&&vt(gt(i,"script")),i.parentNode.removeChild(i));return t}_.extend({htmlPrefilter:function(t){return t.replace(It,"<$1></$2>")},clone:function(t,e,n){var i,r,o,s,a,l,c,u=t.cloneNode(!0),d=_.contains(t.ownerDocument,t);if(!(v.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||_.isXMLDoc(t)))for(s=gt(u),i=0,r=(o=gt(t)).length;i<r;i++)a=o[i],l=s[i],void 0,"input"===(c=l.nodeName.toLowerCase())&&ht.test(a.type)?l.checked=a.checked:"input"!==c&&"textarea"!==c||(l.defaultValue=a.defaultValue);if(e)if(n)for(o=o||gt(t),s=s||gt(u),i=0,r=o.length;i<r;i++)Ft(o[i],s[i]);else Ft(t,u);return(s=gt(u,"script")).length>0&&vt(s,!d&&gt(t,"script")),u},cleanData:function(t){for(var e,n,i,r=_.event.special,o=0;void 0!==(n=t[o]);o++)if(Y(n)){if(e=n[J.expando]){if(e.events)for(i in e.events)r[i]?_.event.remove(n,i):_.removeEvent(n,i,e.handle);n[J.expando]=void 0}n[Z.expando]&&(n[Z.expando]=void 0)}}}),_.fn.extend({detach:function(t){return zt(this,t,!0)},remove:function(t){return zt(this,t)},text:function(t){return U(this,function(t){return void 0===t?_.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return Wt(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ot(this,t).appendChild(t)})},prepend:function(){return Wt(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Ot(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return Wt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return Wt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(_.cleanData(gt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return _.clone(this,t,e)})},html:function(t){return U(this,function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Et.test(t)&&!mt[(ft.exec(t)||["",""])[1].toLowerCase()]){t=_.htmlPrefilter(t);try{for(;n<i;n++)1===(e=this[n]||{}).nodeType&&(_.cleanData(gt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=[];return Wt(this,arguments,function(e){var n=this.parentNode;_.inArray(this,t)<0&&(_.cleanData(gt(this)),n&&n.replaceChild(e,this))},t)}}),_.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){_.fn[t]=function(t){for(var n,i=[],r=_(t),o=r.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),_(r[s])[e](n),u.apply(i,n.get());return this.pushStack(i)}});var Rt=new RegExp("^("+it+")(?!px)[a-z%]+$","i"),Bt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=n),e.getComputedStyle(t)},jt=new RegExp(ot.join("|"),"i");function qt(t,e,n){var i,r,o,s,a=t.style;return(n=n||Bt(t))&&(""!==(s=n.getPropertyValue(e)||n[e])||_.contains(t.ownerDocument,t)||(s=_.style(t,e)),!v.pixelBoxStyles()&&Rt.test(s)&&jt.test(e)&&(i=a.width,r=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=i,a.minWidth=r,a.maxWidth=o)),void 0!==s?s+"":s}function $t(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(u){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",Ct.appendChild(c).appendChild(u);var t=n.getComputedStyle(u);i="1%"!==t.top,l=12===e(t.marginLeft),u.style.right="60%",a=36===e(t.right),r=36===e(t.width),u.style.position="absolute",o=36===u.offsetWidth||"absolute",Ct.removeChild(c),u=null}}function e(t){return Math.round(parseFloat(t))}var i,r,o,a,l,c=s.createElement("div"),u=s.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===u.style.backgroundClip,_.extend(v,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o}}))}();var Ut=/^(none|table(?!-c[ea]).+)/,Gt=/^--/,Vt={position:"absolute",visibility:"hidden",display:"block"},Xt={letterSpacing:"0",fontWeight:"400"},Kt=["Webkit","Moz","ms"],Yt=s.createElement("div").style;function Qt(t){var e=_.cssProps[t];return e||(e=_.cssProps[t]=function(t){if(t in Yt)return t;for(var e=t[0].toUpperCase()+t.slice(1),n=Kt.length;n--;)if((t=Kt[n]+e)in Yt)return t}(t)||t),e}function Jt(t,e,n){var i=rt.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function Zt(t,e,n,i,r,o){var s="width"===e?1:0,a=0,l=0;if(n===(i?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(l+=_.css(t,n+ot[s],!0,r)),i?("content"===n&&(l-=_.css(t,"padding"+ot[s],!0,r)),"margin"!==n&&(l-=_.css(t,"border"+ot[s]+"Width",!0,r))):(l+=_.css(t,"padding"+ot[s],!0,r),"padding"!==n?l+=_.css(t,"border"+ot[s]+"Width",!0,r):a+=_.css(t,"border"+ot[s]+"Width",!0,r));return!i&&o>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-a-.5))),l}function te(t,e,n){var i=Bt(t),r=qt(t,e,i),o="border-box"===_.css(t,"boxSizing",!1,i),s=o;if(Rt.test(r)){if(!n)return r;r="auto"}return s=s&&(v.boxSizingReliable()||r===t.style[e]),("auto"===r||!parseFloat(r)&&"inline"===_.css(t,"display",!1,i))&&(r=t["offset"+e[0].toUpperCase()+e.slice(1)],s=!0),(r=parseFloat(r)||0)+Zt(t,e,n||(o?"border":"content"),s,i,r)+"px"}function ee(t,e,n,i,r){return new ee.prototype.init(t,e,n,i,r)}_.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=qt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,s,a=K(e),l=Gt.test(e),c=t.style;if(l||(e=Qt(a)),s=_.cssHooks[e]||_.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(r=s.get(t,!1,i))?r:c[e];"string"===(o=typeof n)&&(r=rt.exec(n))&&r[1]&&(n=lt(t,e,r),o="number"),null!=n&&n==n&&("number"===o&&(n+=r&&r[3]||(_.cssNumber[a]?"":"px")),v.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),s&&"set"in s&&void 0===(n=s.set(t,n,i))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,i){var r,o,s,a=K(e);return Gt.test(e)||(e=Qt(a)),(s=_.cssHooks[e]||_.cssHooks[a])&&"get"in s&&(r=s.get(t,!0,n)),void 0===r&&(r=qt(t,e,i)),"normal"===r&&e in Xt&&(r=Xt[e]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),_.each(["height","width"],function(t,e){_.cssHooks[e]={get:function(t,n,i){if(n)return!Ut.test(_.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?te(t,e,i):at(t,Vt,function(){return te(t,e,i)})},set:function(t,n,i){var r,o=Bt(t),s="border-box"===_.css(t,"boxSizing",!1,o),a=i&&Zt(t,e,i,s,o);return s&&v.scrollboxSize()===o.position&&(a-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-Zt(t,e,"border",!1,o)-.5)),a&&(r=rt.exec(n))&&"px"!==(r[3]||"px")&&(t.style[e]=n,n=_.css(t,e)),Jt(0,n,a)}}}),_.cssHooks.marginLeft=$t(v.reliableMarginLeft,function(t,e){if(e)return(parseFloat(qt(t,"marginLeft"))||t.getBoundingClientRect().left-at(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}))+"px"}),_.each({margin:"",padding:"",border:"Width"},function(t,e){_.cssHooks[t+e]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[t+ot[i]+e]=o[i]||o[i-2]||o[0];return r}},"margin"!==t&&(_.cssHooks[t+e].set=Jt)}),_.fn.extend({css:function(t,e){return U(this,function(t,e,n){var i,r,o={},s=0;if(Array.isArray(e)){for(i=Bt(t),r=e.length;s<r;s++)o[e[s]]=_.css(t,e[s],!1,i);return o}return void 0!==n?_.style(t,e,n):_.css(t,e)},t,e,arguments.length>1)}}),_.Tween=ee,ee.prototype={constructor:ee,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||_.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(_.cssNumber[n]?"":"px")},cur:function(){var t=ee.propHooks[this.prop];return t&&t.get?t.get(this):ee.propHooks._default.get(this)},run:function(t){var e,n=ee.propHooks[this.prop];return this.options.duration?this.pos=e=_.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ee.propHooks._default.set(this),this}},ee.prototype.init.prototype=ee.prototype,ee.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=_.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){_.fx.step[t.prop]?_.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[_.cssProps[t.prop]]&&!_.cssHooks[t.prop]?t.elem[t.prop]=t.now:_.style(t.elem,t.prop,t.now+t.unit)}}},ee.propHooks.scrollTop=ee.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},_.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},_.fx=ee.prototype.init,_.fx.step={};var ne,ie,re=/^(?:toggle|show|hide)$/,oe=/queueHooks$/;function se(){ie&&(!1===s.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(se):n.setTimeout(se,_.fx.interval),_.fx.tick())}function ae(){return n.setTimeout(function(){ne=void 0}),ne=Date.now()}function le(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)r["margin"+(n=ot[i])]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function ce(t,e,n){for(var i,r=(ue.tweeners[e]||[]).concat(ue.tweeners["*"]),o=0,s=r.length;o<s;o++)if(i=r[o].call(n,e,t))return i}function ue(t,e,n){var i,r,o=0,s=ue.prefilters.length,a=_.Deferred().always(function(){delete l.elem}),l=function(){if(r)return!1;for(var e=ne||ae(),n=Math.max(0,c.startTime+c.duration-e),i=1-(n/c.duration||0),o=0,s=c.tweens.length;o<s;o++)c.tweens[o].run(i);return a.notifyWith(t,[c,i,n]),i<1&&s?n:(s||a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c]),!1)},c=a.promise({elem:t,props:_.extend({},e),opts:_.extend(!0,{specialEasing:{},easing:_.easing._default},n),originalProperties:e,originalOptions:n,startTime:ne||ae(),duration:n.duration,tweens:[],createTween:function(e,n){var i=_.Tween(t,c.opts,e,n,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(i),i},stop:function(e){var n=0,i=e?c.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)c.tweens[n].run(1);return e?(a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c,e])):a.rejectWith(t,[c,e]),this}}),u=c.props;for(!function(t,e){var n,i,r,o,s;for(n in t)if(r=e[i=K(n)],o=t[n],Array.isArray(o)&&(r=o[1],o=t[n]=o[0]),n!==i&&(t[i]=o,delete t[n]),(s=_.cssHooks[i])&&"expand"in s)for(n in o=s.expand(o),delete t[i],o)n in t||(t[n]=o[n],e[n]=r);else e[i]=r}(u,c.opts.specialEasing);o<s;o++)if(i=ue.prefilters[o].call(c,t,u,c.opts))return y(i.stop)&&(_._queueHooks(c.elem,c.opts.queue).stop=i.stop.bind(i)),i;return _.map(u,ce,c),y(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),_.fx.timer(_.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}_.Animation=_.extend(ue,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return lt(n.elem,t,rt.exec(e),n),n}]},tweener:function(t,e){y(t)?(e=t,t=["*"]):t=t.match(W);for(var n,i=0,r=t.length;i<r;i++)n=t[i],ue.tweeners[n]=ue.tweeners[n]||[],ue.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var i,r,o,s,a,l,c,u,d="width"in e||"height"in e,h=this,f={},p=t.style,m=t.nodeType&&st(t),g=J.get(t,"fxshow");for(i in n.queue||(null==(s=_._queueHooks(t,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,h.always(function(){h.always(function(){s.unqueued--,_.queue(t,"fx").length||s.empty.fire()})})),e)if(r=e[i],re.test(r)){if(delete e[i],o=o||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!g||void 0===g[i])continue;m=!0}f[i]=g&&g[i]||_.style(t,i)}if((l=!_.isEmptyObject(e))||!_.isEmptyObject(f))for(i in d&&1===t.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(c=g&&g.display)&&(c=J.get(t,"display")),"none"===(u=_.css(t,"display"))&&(c?u=c:(dt([t],!0),c=t.style.display||c,u=_.css(t,"display"),dt([t]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===_.css(t,"float")&&(l||(h.done(function(){p.display=c}),null==c&&(u=p.display,c="none"===u?"":u)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",h.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]})),l=!1,f)l||(g?"hidden"in g&&(m=g.hidden):g=J.access(t,"fxshow",{display:c}),o&&(g.hidden=!m),m&&dt([t],!0),h.done(function(){for(i in m||dt([t]),J.remove(t,"fxshow"),f)_.style(t,i,f[i])})),l=ce(m?g[i]:0,i,h),i in g||(g[i]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?ue.prefilters.unshift(t):ue.prefilters.push(t)}}),_.speed=function(t,e,n){var i=t&&"object"==typeof t?_.extend({},t):{complete:n||!n&&e||y(t)&&t,duration:t,easing:n&&e||e&&!y(e)&&e};return _.fx.off?i.duration=0:"number"!=typeof i.duration&&(i.duration in _.fx.speeds?i.duration=_.fx.speeds[i.duration]:i.duration=_.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){y(i.old)&&i.old.call(this),i.queue&&_.dequeue(this,i.queue)},i},_.fn.extend({fadeTo:function(t,e,n,i){return this.filter(st).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var r=_.isEmptyObject(t),o=_.speed(e,n,i),s=function(){var e=ue(this,_.extend({},t),o);(r||J.get(this,"finish"))&&e.stop(!0)};return s.finish=s,r||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(t,e,n){var i=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&!1!==t&&this.queue(t||"fx",[]),this.each(function(){var e=!0,r=null!=t&&t+"queueHooks",o=_.timers,s=J.get(this);if(r)s[r]&&s[r].stop&&i(s[r]);else for(r in s)s[r]&&s[r].stop&&oe.test(r)&&i(s[r]);for(r=o.length;r--;)o[r].elem!==this||null!=t&&o[r].queue!==t||(o[r].anim.stop(n),e=!1,o.splice(r,1));!e&&n||_.dequeue(this,t)})},finish:function(t){return!1!==t&&(t=t||"fx"),this.each(function(){var e,n=J.get(this),i=n[t+"queue"],r=n[t+"queueHooks"],o=_.timers,s=i?i.length:0;for(n.finish=!0,_.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<s;e++)i[e]&&i[e].finish&&i[e].finish.call(this);delete n.finish})}}),_.each(["toggle","show","hide"],function(t,e){var n=_.fn[e];_.fn[e]=function(t,i,r){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(le(e,!0),t,i,r)}}),_.each({slideDown:le("show"),slideUp:le("hide"),slideToggle:le("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){_.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}}),_.timers=[],_.fx.tick=function(){var t,e=0,n=_.timers;for(ne=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||_.fx.stop(),ne=void 0},_.fx.timer=function(t){_.timers.push(t),_.fx.start()},_.fx.interval=13,_.fx.start=function(){ie||(ie=!0,se())},_.fx.stop=function(){ie=null},_.fx.speeds={slow:600,fast:200,_default:400},_.fn.delay=function(t,e){return t=_.fx&&_.fx.speeds[t]||t,e=e||"fx",this.queue(e,function(e,i){var r=n.setTimeout(e,t);i.stop=function(){n.clearTimeout(r)}})},function(){var t=s.createElement("input"),e=s.createElement("select").appendChild(s.createElement("option"));t.type="checkbox",v.checkOn=""!==t.value,v.optSelected=e.selected,(t=s.createElement("input")).value="t",t.type="radio",v.radioValue="t"===t.value}();var de,he=_.expr.attrHandle;_.fn.extend({attr:function(t,e){return U(this,_.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){_.removeAttr(this,t)})}}),_.extend({attr:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?_.prop(t,e,n):(1===o&&_.isXMLDoc(t)||(r=_.attrHooks[e.toLowerCase()]||(_.expr.match.bool.test(e)?de:void 0)),void 0!==n?null===n?void _.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:null==(i=_.find.attr(t,e))?void 0:i)},attrHooks:{type:{set:function(t,e){if(!v.radioValue&&"radio"===e&&I(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(W);if(r&&1===t.nodeType)for(;n=r[i++];)t.removeAttribute(n)}}),de={set:function(t,e,n){return!1===e?_.removeAttr(t,n):t.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),function(t,e){var n=he[e]||_.find.attr;he[e]=function(t,e,i){var r,o,s=e.toLowerCase();return i||(o=he[s],he[s]=r,r=null!=n(t,e,i)?s:null,he[s]=o),r}});var fe=/^(?:input|select|textarea|button)$/i,pe=/^(?:a|area)$/i;function me(t){return(t.match(W)||[]).join(" ")}function ge(t){return t.getAttribute&&t.getAttribute("class")||""}function ve(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(W)||[]}_.fn.extend({prop:function(t,e){return U(this,_.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[_.propFix[t]||t]})}}),_.extend({prop:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&_.isXMLDoc(t)||(e=_.propFix[e]||e,r=_.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=_.find.attr(t,"tabindex");return e?parseInt(e,10):fe.test(t.nodeName)||pe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(_.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){_.propFix[this.toLowerCase()]=this}),_.fn.extend({addClass:function(t){var e,n,i,r,o,s,a,l=0;if(y(t))return this.each(function(e){_(this).addClass(t.call(this,e,ge(this)))});if((e=ve(t)).length)for(;n=this[l++];)if(r=ge(n),i=1===n.nodeType&&" "+me(r)+" "){for(s=0;o=e[s++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");r!==(a=me(i))&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,i,r,o,s,a,l=0;if(y(t))return this.each(function(e){_(this).removeClass(t.call(this,e,ge(this)))});if(!arguments.length)return this.attr("class","");if((e=ve(t)).length)for(;n=this[l++];)if(r=ge(n),i=1===n.nodeType&&" "+me(r)+" "){for(s=0;o=e[s++];)for(;i.indexOf(" "+o+" ")>-1;)i=i.replace(" "+o+" "," ");r!==(a=me(i))&&n.setAttribute("class",a)}return this},toggleClass:function(t,e){var n=typeof t,i="string"===n||Array.isArray(t);return"boolean"==typeof e&&i?e?this.addClass(t):this.removeClass(t):y(t)?this.each(function(n){_(this).toggleClass(t.call(this,n,ge(this),e),e)}):this.each(function(){var e,r,o,s;if(i)for(r=0,o=_(this),s=ve(t);e=s[r++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==n||((e=ge(this))&&J.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":J.get(this,"__className__")||""))})},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+me(ge(n))+" ").indexOf(e)>-1)return!0;return!1}});var ye=/\r/g;_.fn.extend({val:function(t){var e,n,i,r=this[0];return arguments.length?(i=y(t),this.each(function(n){var r;1===this.nodeType&&(null==(r=i?t.call(this,n,_(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=_.map(r,function(t){return null==t?"":t+""})),(e=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))})):r?(e=_.valHooks[r.type]||_.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(ye,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(t){var e=_.find.attr(t,"value");return null!=e?e:me(_.text(t))}},select:{get:function(t){var e,n,i,r=t.options,o=t.selectedIndex,s="select-one"===t.type,a=s?null:[],l=s?o+1:r.length;for(i=o<0?l:s?o:0;i<l;i++)if(((n=r[i]).selected||i===o)&&!n.disabled&&(!n.parentNode.disabled||!I(n.parentNode,"optgroup"))){if(e=_(n).val(),s)return e;a.push(e)}return a},set:function(t,e){for(var n,i,r=t.options,o=_.makeArray(e),s=r.length;s--;)((i=r[s]).selected=_.inArray(_.valHooks.option.get(i),o)>-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),_.each(["radio","checkbox"],function(){_.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=_.inArray(_(t).val(),e)>-1}},v.checkOn||(_.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}),v.focusin="onfocusin"in n;var xe=/^(?:focusinfocus|focusoutblur)$/,be=function(t){t.stopPropagation()};_.extend(_.event,{trigger:function(t,e,i,r){var o,a,l,c,u,d,h,f,m=[i||s],g=p.call(t,"type")?t.type:t,v=p.call(t,"namespace")?t.namespace.split("."):[];if(a=f=l=i=i||s,3!==i.nodeType&&8!==i.nodeType&&!xe.test(g+_.event.triggered)&&(g.indexOf(".")>-1&&(g=(v=g.split(".")).shift(),v.sort()),u=g.indexOf(":")<0&&"on"+g,(t=t[_.expando]?t:new _.Event(g,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),e=null==e?[t]:_.makeArray(e,[t]),h=_.event.special[g]||{},r||!h.trigger||!1!==h.trigger.apply(i,e))){if(!r&&!h.noBubble&&!x(i)){for(c=h.delegateType||g,xe.test(c+g)||(a=a.parentNode);a;a=a.parentNode)m.push(a),l=a;l===(i.ownerDocument||s)&&m.push(l.defaultView||l.parentWindow||n)}for(o=0;(a=m[o++])&&!t.isPropagationStopped();)f=a,t.type=o>1?c:h.bindType||g,(d=(J.get(a,"events")||{})[t.type]&&J.get(a,"handle"))&&d.apply(a,e),(d=u&&a[u])&&d.apply&&Y(a)&&(t.result=d.apply(a,e),!1===t.result&&t.preventDefault());return t.type=g,r||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(m.pop(),e)||!Y(i)||u&&y(i[g])&&!x(i)&&((l=i[u])&&(i[u]=null),_.event.triggered=g,t.isPropagationStopped()&&f.addEventListener(g,be),i[g](),t.isPropagationStopped()&&f.removeEventListener(g,be),_.event.triggered=void 0,l&&(i[u]=l)),t.result}},simulate:function(t,e,n){var i=_.extend(new _.Event,n,{type:t,isSimulated:!0});_.event.trigger(i,null,e)}}),_.fn.extend({trigger:function(t,e){return this.each(function(){_.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return _.event.trigger(t,e,n,!0)}}),v.focusin||_.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){_.event.simulate(e,t.target,_.event.fix(t))};_.event.special[e]={setup:function(){var i=this.ownerDocument||this,r=J.access(i,e);r||i.addEventListener(t,n,!0),J.access(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this,r=J.access(i,e)-1;r?J.access(i,e,r):(i.removeEventListener(t,n,!0),J.remove(i,e))}}});var we=n.location,Ce=Date.now(),_e=/\?/;_.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||_.error("Invalid XML: "+t),e};var ke=/\[\]$/,Se=/\r?\n/g,Te=/^(?:submit|button|image|reset|file)$/i,Me=/^(?:input|select|textarea|keygen)/i;function Ae(t,e,n,i){var r;if(Array.isArray(e))_.each(e,function(e,r){n||ke.test(t)?i(t,r):Ae(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,n,i)});else if(n||"object"!==C(e))i(t,e);else for(r in e)Ae(t+"["+r+"]",e[r],n,i)}_.param=function(t,e){var n,i=[],r=function(t,e){var n=y(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(t)||t.jquery&&!_.isPlainObject(t))_.each(t,function(){r(this.name,this.value)});else for(n in t)Ae(n,t[n],e,r);return i.join("&")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=_.prop(this,"elements");return t?_.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!_(this).is(":disabled")&&Me.test(this.nodeName)&&!Te.test(t)&&(this.checked||!ht.test(t))}).map(function(t,e){var n=_(this).val();return null==n?null:Array.isArray(n)?_.map(n,function(t){return{name:e.name,value:t.replace(Se,"\r\n")}}):{name:e.name,value:n.replace(Se,"\r\n")}}).get()}});var Le=/%20/g,Ie=/#.*$/,Ee=/([?&])_=[^&]*/,De=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ne=/^(?:GET|HEAD)$/,Oe=/^\/\//,Pe={},He={},Fe="*/".concat("*"),We=s.createElement("a");function ze(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,r=0,o=e.toLowerCase().match(W)||[];if(y(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Re(t,e,n,i){var r={},o=t===He;function s(a){var l;return r[a]=!0,_.each(t[a]||[],function(t,a){var c=a(e,n,i);return"string"!=typeof c||o||r[c]?o?!(l=c):void 0:(e.dataTypes.unshift(c),s(c),!1)}),l}return s(e.dataTypes[0])||!r["*"]&&s("*")}function Be(t,e){var n,i,r=_.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&_.extend(!0,t,i),t}We.href=we.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:we.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(we.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Fe,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Be(Be(t,_.ajaxSettings),e):Be(_.ajaxSettings,t)},ajaxPrefilter:ze(Pe),ajaxTransport:ze(He),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,r,o,a,l,c,u,d,h,f,p=_.ajaxSetup({},e),m=p.context||p,g=p.context&&(m.nodeType||m.jquery)?_(m):_.event,v=_.Deferred(),y=_.Callbacks("once memory"),x=p.statusCode||{},b={},w={},C="canceled",k={readyState:0,getResponseHeader:function(t){var e;if(u){if(!a)for(a={};e=De.exec(o);)a[e[1].toLowerCase()]=e[2];e=a[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(t,e){return null==u&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,b[t]=e),this},overrideMimeType:function(t){return null==u&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)k.always(t[k.status]);else for(e in t)x[e]=[x[e],t[e]];return this},abort:function(t){var e=t||C;return i&&i.abort(e),S(0,e),this}};if(v.promise(k),p.url=((t||p.url||we.href)+"").replace(Oe,we.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(W)||[""],null==p.crossDomain){c=s.createElement("a");try{c.href=p.url,c.href=c.href,p.crossDomain=We.protocol+"//"+We.host!=c.protocol+"//"+c.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=_.param(p.data,p.traditional)),Re(Pe,p,e,k),u)return k;for(h in(d=_.event&&p.global)&&0==_.active++&&_.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ne.test(p.type),r=p.url.replace(Ie,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Le,"+")):(f=p.url.slice(r.length),p.data&&(p.processData||"string"==typeof p.data)&&(r+=(_e.test(r)?"&":"?")+p.data,delete p.data),!1===p.cache&&(r=r.replace(Ee,"$1"),f=(_e.test(r)?"&":"?")+"_="+Ce+++f),p.url=r+f),p.ifModified&&(_.lastModified[r]&&k.setRequestHeader("If-Modified-Since",_.lastModified[r]),_.etag[r]&&k.setRequestHeader("If-None-Match",_.etag[r])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&k.setRequestHeader("Content-Type",p.contentType),k.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Fe+"; q=0.01":""):p.accepts["*"]),p.headers)k.setRequestHeader(h,p.headers[h]);if(p.beforeSend&&(!1===p.beforeSend.call(m,k,p)||u))return k.abort();if(C="abort",y.add(p.complete),k.done(p.success),k.fail(p.error),i=Re(He,p,e,k)){if(k.readyState=1,d&&g.trigger("ajaxSend",[k,p]),u)return k;p.async&&p.timeout>0&&(l=n.setTimeout(function(){k.abort("timeout")},p.timeout));try{u=!1,i.send(b,S)}catch(t){if(u)throw t;S(-1,t)}}else S(-1,"No Transport");function S(t,e,s,a){var c,h,f,b,w,C=e;u||(u=!0,l&&n.clearTimeout(l),i=void 0,o=a||"",k.readyState=t>0?4:0,c=t>=200&&t<300||304===t,s&&(b=function(t,e,n){for(var i,r,o,s,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){l.unshift(r);break}if(l[0]in n)o=l[0];else{for(r in n){if(!l[0]||t.converters[r+" "+l[0]]){o=r;break}s||(s=r)}o=o||s}if(o)return o!==l[0]&&l.unshift(o),n[o]}(p,k,s)),b=function(t,e,n,i){var r,o,s,a,l,c={},u=t.dataTypes.slice();if(u[1])for(s in t.converters)c[s.toLowerCase()]=t.converters[s];for(o=u.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!l&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(s=c[l+" "+o]||c["* "+o]))for(r in c)if((a=r.split(" "))[1]===o&&(s=c[l+" "+a[0]]||c["* "+a[0]])){!0===s?s=c[r]:!0!==c[r]&&(o=a[0],u.unshift(a[1]));break}if(!0!==s)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}(p,b,k,c),c?(p.ifModified&&((w=k.getResponseHeader("Last-Modified"))&&(_.lastModified[r]=w),(w=k.getResponseHeader("etag"))&&(_.etag[r]=w)),204===t||"HEAD"===p.type?C="nocontent":304===t?C="notmodified":(C=b.state,h=b.data,c=!(f=b.error))):(f=C,!t&&C||(C="error",t<0&&(t=0))),k.status=t,k.statusText=(e||C)+"",c?v.resolveWith(m,[h,C,k]):v.rejectWith(m,[k,C,f]),k.statusCode(x),x=void 0,d&&g.trigger(c?"ajaxSuccess":"ajaxError",[k,p,c?h:f]),y.fireWith(m,[k,C]),d&&(g.trigger("ajaxComplete",[k,p]),--_.active||_.event.trigger("ajaxStop")))}return k},getJSON:function(t,e,n){return _.get(t,e,n,"json")},getScript:function(t,e){return _.get(t,void 0,e,"script")}}),_.each(["get","post"],function(t,e){_[e]=function(t,n,i,r){return y(n)&&(r=r||i,i=n,n=void 0),_.ajax(_.extend({url:t,type:e,dataType:r,data:n,success:i},_.isPlainObject(t)&&t))}}),_._evalUrl=function(t){return _.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},_.fn.extend({wrapAll:function(t){var e;return this[0]&&(y(t)&&(t=t.call(this[0])),e=_(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return y(t)?this.each(function(e){_(this).wrapInner(t.call(this,e))}):this.each(function(){var e=_(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=y(t);return this.each(function(n){_(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){_(this).replaceWith(this.childNodes)}),this}}),_.expr.pseudos.hidden=function(t){return!_.expr.pseudos.visible(t)},_.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},_.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var je={0:200,1223:204},qe=_.ajaxSettings.xhr();v.cors=!!qe&&"withCredentials"in qe,v.ajax=qe=!!qe,_.ajaxTransport(function(t){var e,i;if(v.cors||qe&&!t.crossDomain)return{send:function(r,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(s,r[s]);e=function(t){return function(){e&&(e=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(je[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),i=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout(function(){e&&i()})},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}}),_.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return _.globalEval(t),t}}}),_.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),_.ajaxTransport("script",function(t){var e,n;if(t.crossDomain)return{send:function(i,r){e=_("<script>").prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&r("error"===t.type?404:200,t.type)}),s.head.appendChild(e[0])},abort:function(){n&&n()}}});var $e,Ue=[],Ge=/(=)\?(?=&|$)|\?\?/;_.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ue.pop()||_.expando+"_"+Ce++;return this[t]=!0,t}}),_.ajaxPrefilter("json jsonp",function(t,e,i){var r,o,s,a=!1!==t.jsonp&&(Ge.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ge.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=y(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Ge,"$1"+r):!1!==t.jsonp&&(t.url+=(_e.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return s||_.error(r+" was not called"),s[0]},t.dataTypes[0]="json",o=n[r],n[r]=function(){s=arguments},i.always(function(){void 0===o?_(n).removeProp(r):n[r]=o,t[r]&&(t.jsonpCallback=e.jsonpCallback,Ue.push(r)),s&&y(o)&&o(s[0]),s=o=void 0}),"script"}),v.createHTMLDocument=(($e=s.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===$e.childNodes.length),_.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(v.createHTMLDocument?((i=(e=s.implementation.createHTMLDocument("")).createElement("base")).href=s.location.href,e.head.appendChild(i)):e=s),r=E.exec(t),o=!n&&[],r?[e.createElement(r[1])]:(r=wt([t],e,o),o&&o.length&&_(o).remove(),_.merge([],r.childNodes)));var i,r,o},_.fn.load=function(t,e,n){var i,r,o,s=this,a=t.indexOf(" ");return a>-1&&(i=me(t.slice(a)),t=t.slice(0,a)),y(e)?(n=e,e=void 0):e&&"object"==typeof e&&(r="POST"),s.length>0&&_.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done(function(t){o=arguments,s.html(i?_("<div>").append(_.parseHTML(t)).find(i):t)}).always(n&&function(t,e){s.each(function(){n.apply(this,o||[t.responseText,e,t])})}),this},_.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){_.fn[e]=function(t){return this.on(e,t)}}),_.expr.pseudos.animated=function(t){return _.grep(_.timers,function(e){return t===e.elem}).length},_.offset={setOffset:function(t,e,n){var i,r,o,s,a,l,c=_.css(t,"position"),u=_(t),d={};"static"===c&&(t.style.position="relative"),a=u.offset(),o=_.css(t,"top"),l=_.css(t,"left"),("absolute"===c||"fixed"===c)&&(o+l).indexOf("auto")>-1?(s=(i=u.position()).top,r=i.left):(s=parseFloat(o)||0,r=parseFloat(l)||0),y(e)&&(e=e.call(t,n,_.extend({},a))),null!=e.top&&(d.top=e.top-a.top+s),null!=e.left&&(d.left=e.left-a.left+r),"using"in e?e.using.call(t,d):u.css(d)}},_.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){_.offset.setOffset(this,t,e)});var e,n,i=this[0];return i?i.getClientRects().length?(e=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,i=this[0],r={top:0,left:0};if("fixed"===_.css(i,"position"))e=i.getBoundingClientRect();else{for(e=this.offset(),n=i.ownerDocument,t=i.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===_.css(t,"position");)t=t.parentNode;t&&t!==i&&1===t.nodeType&&((r=_(t).offset()).top+=_.css(t,"borderTopWidth",!0),r.left+=_.css(t,"borderLeftWidth",!0))}return{top:e.top-r.top-_.css(i,"marginTop",!0),left:e.left-r.left-_.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===_.css(t,"position");)t=t.offsetParent;return t||Ct})}}),_.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var n="pageYOffset"===e;_.fn[t]=function(i){return U(this,function(t,i,r){var o;if(x(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===r)return o?o[e]:t[i];o?o.scrollTo(n?o.pageXOffset:r,n?r:o.pageYOffset):t[i]=r},t,i,arguments.length)}}),_.each(["top","left"],function(t,e){_.cssHooks[e]=$t(v.pixelPosition,function(t,n){if(n)return n=qt(t,e),Rt.test(n)?_(t).position()[e]+"px":n})}),_.each({Height:"height",Width:"width"},function(t,e){_.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,i){_.fn[i]=function(r,o){var s=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===o?"margin":"border");return U(this,function(e,n,r){var o;return x(e)?0===i.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===r?_.css(e,n,a):_.style(e,n,r,a)},e,s?r:void 0,s)}})}),_.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){_.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}),_.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),_.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}}),_.proxy=function(t,e){var n,i,r;if("string"==typeof e&&(n=t[e],e=t,t=n),y(t))return i=l.call(arguments,2),(r=function(){return t.apply(e||this,i.concat(l.call(arguments)))}).guid=t.guid=t.guid||_.guid++,r},_.holdReady=function(t){t?_.readyWait++:_.ready(!0)},_.isArray=Array.isArray,_.parseJSON=JSON.parse,_.nodeName=I,_.isFunction=y,_.isWindow=x,_.camelCase=K,_.type=C,_.now=Date.now,_.isNumeric=function(t){var e=_.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},void 0===(i=function(){return _}.apply(e,[]))||(t.exports=i);var Ve=n.jQuery,Xe=n.$;return _.noConflict=function(t){return n.$===_&&(n.$=Xe),t&&n.jQuery===_&&(n.jQuery=Ve),_},r||(n.jQuery=n.$=_),_})},function(t,e,n){!function(t){"use strict";function e(e,n,r,o){if(r&&r.call){var s=r;r=null}else var s=i(e,r,"rangeFinder");"number"==typeof n&&(n=t.Pos(n,0));var a=i(e,r,"minFoldSize");function l(t){var i=s(e,n);if(!i||i.to.line-i.from.line<a)return null;for(var r=e.findMarksAt(i.from),l=0;l<r.length;++l)if(r[l].__isFold&&"fold"!==o){if(!t)return null;i.cleared=!0,r[l].clear()}return i}var c=l(!0);if(i(e,r,"scanUp"))for(;!c&&n.line>e.firstLine();)n=t.Pos(n.line-1,0),c=l(!1);if(c&&!c.cleared&&"unfold"!==o){var u=function(t,e){var n=i(t,e,"widget");if("string"==typeof n){var r=document.createTextNode(n);(n=document.createElement("span")).appendChild(r),n.className="CodeMirror-foldmarker"}else n&&(n=n.cloneNode(!0));return n}(e,r);t.on(u,"mousedown",function(e){d.clear(),t.e_preventDefault(e)});var d=e.markText(c.from,c.to,{replacedWith:u,clearOnEnter:i(e,r,"clearOnEnter"),__isFold:!0});d.on("clear",function(n,i){t.signal(e,"unfold",e,n,i)}),t.signal(e,"fold",e,c.from,c.to)}}t.newFoldFunction=function(t,n){return function(i,r){e(i,r,{rangeFinder:t,widget:n})}},t.defineExtension("foldCode",function(t,n,i){e(this,t,n,i)}),t.defineExtension("isFolded",function(t){for(var e=this.findMarksAt(t),n=0;n<e.length;++n)if(e[n].__isFold)return!0}),t.commands.toggleFold=function(t){t.foldCode(t.getCursor())},t.commands.fold=function(t){t.foldCode(t.getCursor(),null,"fold")},t.commands.unfold=function(t){t.foldCode(t.getCursor(),null,"unfold")},t.commands.foldAll=function(e){e.operation(function(){for(var n=e.firstLine(),i=e.lastLine();n<=i;n++)e.foldCode(t.Pos(n,0),null,"fold")})},t.commands.unfoldAll=function(e){e.operation(function(){for(var n=e.firstLine(),i=e.lastLine();n<=i;n++)e.foldCode(t.Pos(n,0),null,"unfold")})},t.registerHelper("fold","combine",function(){var t=Array.prototype.slice.call(arguments,0);return function(e,n){for(var i=0;i<t.length;++i){var r=t[i](e,n);if(r)return r}}}),t.registerHelper("fold","auto",function(t,e){for(var n=t.getHelpers(e,"fold"),i=0;i<n.length;i++){var r=n[i](t,e);if(r)return r}});var n={rangeFinder:t.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function i(t,e,i){if(e&&void 0!==e[i])return e[i];var r=t.options.foldOptions;return r&&void 0!==r[i]?r[i]:n[i]}t.defineOption("foldOptions",null),t.defineExtension("foldOption",function(t,e){return i(this,t,e)})}(n(0))},function(t,e,n){!function(t){"use strict";t.defineMode("markdown",function(e,n){var i=t.getMode(e,"text/html"),r="null"==i.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.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 s in o)o.hasOwnProperty(s)&&n.tokenTypeOverrides[s]&&(o[s]=n.tokenTypeOverrides[s]);var a=/^([*\-_])(?:\s*\1){2,}\s*$/,l=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/,u=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ *(?:\={1,}|-{1,})\s*$/,h=/^[^#!\[\]*_\\<>` "'(~:]+/,f=new RegExp("^("+(!0===n.fencedCodeBlocks?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),p=/[!\"#$%&\'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~—]/;function m(t,e,n){return e.f=e.inline=n,n(t,e)}function g(t){return!t||!/\S/.test(t.string)}function v(t){return t.linkTitle=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==x&&(t.f=_,t.block=y),t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine=null,null}function y(i,r){var s,h=i.sol(),p=!1!==r.list,v=r.indentedCode;if(r.indentedCode=!1,null===r.indentationDiff&&(s=r.indentation,r.indentationDiff=r.indentation,p)){for(r.list=null;s<r.listStack[r.listStack.length-1];)r.listStack.pop(),r.listStack.length?r.indentation=r.listStack[r.listStack.length-1]:r.list=!1;!1!==r.list&&(r.indentationDiff=s-r.listStack[r.listStack.length-1])}var y=null;if(r.indentationDiff>=4&&(v||g(r.prevLine)))return i.skipToEnd(),r.indentedCode=!0,o.code;if(i.eatSpace())return null;if((y=i.match(u))&&y[1].length<=6)return r.header=y[1].length,n.highlightFormatting&&(r.formatting="header"),r.f=r.inline,w(r);if(!(g(r.prevLine)||r.quote||p||v)&&(y=i.match(d)))return r.header="="==y[0].charAt(0)?1:2,n.highlightFormatting&&(r.formatting="header"),r.f=r.inline,w(r);if(i.eat(">"))return r.quote=h?1:r.quote+1,n.highlightFormatting&&(r.formatting="quote"),i.eatSpace(),w(r);if("["===i.peek())return m(i,r,M);if(i.match(a,!0))return r.hr=!0,o.hr;if(y=i.match(l)){var x=y[1]?"ol":"ul";return r.indentation=s+i.current().length,r.list=!0,r.listStack.push(r.indentation),n.taskLists&&i.match(c,!1)&&(r.taskList=!0),r.f=r.inline,n.highlightFormatting&&(r.formatting=["list","list-"+x]),w(r)}return n.fencedCodeBlocks&&(y=i.match(f,!0))?(r.fencedChars=y[1],r.localMode=function(n){if(t.findModeByName){var i=t.findModeByName(n);i&&(n=i.mime||i.mimes[0])}var r=t.getMode(e,n);return"null"==r.name?null:r}(y[2]),r.localMode&&(r.localState=t.startState(r.localMode)),r.f=r.block=b,n.highlightFormatting&&(r.formatting="code-block"),r.code=-1,w(r)):m(i,r,r.inline)}function x(e,n){var o=i.token(e,n.htmlState);if(!r){var s=t.innerMode(i,n.htmlState);("xml"==s.mode.name&&null===s.state.tagStart&&!s.state.context&&s.state.tokenize.isInText||n.md_inside&&e.current().indexOf(">")>-1)&&(n.f=_,n.block=y,n.htmlState=null)}return o}function b(t,e){if(e.fencedChars&&t.match(e.fencedChars)){n.highlightFormatting&&(e.formatting="code-block");var i=w(e);return e.localMode=e.localState=null,e.block=y,e.f=_,e.fencedChars=null,e.code=0,i}return e.fencedChars&&t.skipTo(e.fencedChars)?"comment":e.localMode?e.localMode.token(t,e.localState):(t.skipToEnd(),o.code)}function w(t){var e=[];if(t.formatting){e.push(o.formatting),"string"==typeof t.formatting&&(t.formatting=[t.formatting]);for(var i=0;i<t.formatting.length;i++)e.push(o.formatting+"-"+t.formatting[i]),"header"===t.formatting[i]&&e.push(o.formatting+"-"+t.formatting[i]+"-"+t.header),"quote"===t.formatting[i]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=t.quote?e.push(o.formatting+"-"+t.formatting[i]+"-"+t.quote):e.push("error"))}if(t.taskOpen)return e.push("meta"),e.length?e.join(" "):null;if(t.taskClosed)return e.push("property"),e.length?e.join(" "):null;if(t.linkHref?e.push(o.linkHref,"url"):(t.strong&&e.push(o.strong),t.em&&e.push(o.em),t.strikethrough&&e.push(o.strikethrough),t.emoji&&e.push(o.emoji),t.linkText&&e.push(o.linkText),t.code&&e.push(o.code),t.image&&e.push(o.image),t.imageAltText&&e.push(o.imageAltText,"link"),t.imageMarker&&e.push(o.imageMarker)),t.header&&e.push(o.header,o.header+"-"+t.header),t.quote&&(e.push(o.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=t.quote?e.push(o.quote+"-"+t.quote):e.push(o.quote+"-"+n.maxBlockquoteDepth)),!1!==t.list){var r=(t.listStack.length-1)%3;r?1===r?e.push(o.list2):e.push(o.list3):e.push(o.list1)}return t.trailingSpaceNewLine?e.push("trailing-space-new-line"):t.trailingSpace&&e.push("trailing-space-"+(t.trailingSpace%2?"a":"b")),e.length?e.join(" "):null}function C(t,e){if(t.match(h,!0))return w(e)}function _(e,r){var s=r.text(e,r);if(void 0!==s)return s;if(r.list)return r.list=null,w(r);if(r.taskList){var a="x"!==e.match(c,!0)[1];return a?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,w(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&e.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),w(r);var l=e.next();if(r.linkTitle){r.linkTitle=!1;var u=l;"("===l&&(u=")");var d="^\\s*(?:[^"+(u=(u+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(e.match(new RegExp(d),!0))return o.linkHref}if("`"===l){var h=r.formatting;n.highlightFormatting&&(r.formatting="code"),e.eatWhile("`");var f=e.current().length;if(0==r.code)return r.code=f,w(r);if(f==r.code){var m=w(r);return r.code=0,m}return r.formatting=h,w(r)}if(r.code)return w(r);if("\\"===l&&(e.next(),n.highlightFormatting)){var g=w(r),v=o.formatting+"-escape";return g?g+" "+v:v}if("!"===l&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return r.imageMarker=!0,r.image=!0,n.highlightFormatting&&(r.formatting="image"),w(r);if("["===l&&r.imageMarker&&e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return r.imageMarker=!1,r.imageAltText=!0,n.highlightFormatting&&(r.formatting="image"),w(r);if("]"===l&&r.imageAltText){n.highlightFormatting&&(r.formatting="image");var g=w(r);return r.imageAltText=!1,r.image=!1,r.inline=r.f=S,g}if("["===l&&!r.image)return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),w(r);if("]"===l&&r.linkText){n.highlightFormatting&&(r.formatting="link");var g=w(r);return r.linkText=!1,r.inline=r.f=e.match(/\(.*?\)| ?\[.*?\]/,!1)?S:_,g}if("<"===l&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=k,n.highlightFormatting&&(r.formatting="link");var g=w(r);return g?g+=" ":g="",g+o.linkInline}if("<"===l&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=k,n.highlightFormatting&&(r.formatting="link");var g=w(r);return g?g+=" ":g="",g+o.linkEmail}if("<"===l&&e.match(/^(!--|[a-z]+(?:\s+[a-z_:.\-]+(?:\s*=\s*[^ >]+)?)*\s*>)/i,!1)){var y=e.string.indexOf(">",e.pos);if(-1!=y){var b=e.string.substring(e.start,y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(r.md_inside=!0)}return e.backUp(1),r.htmlState=t.startState(i),function(t,e,n){return e.f=e.block=n,n(t,e)}(e,r,x)}if("<"===l&&e.match(/^\/\w*?>/))return r.md_inside=!1,"tag";if("*"===l||"_"===l){for(var C=1,T=1==e.pos?" ":e.string.charAt(e.pos-2);C<3&&e.eat(l);)C++;var M=e.peek()||" ",A=!/\s/.test(M)&&(!p.test(M)||/\s/.test(T)||p.test(T)),L=!/\s/.test(T)&&(!p.test(T)||/\s/.test(M)||p.test(M)),I=null,E=null;if(C%2&&(r.em||!A||"*"!==l&&L&&!p.test(T)?r.em!=l||!L||"*"!==l&&A&&!p.test(M)||(I=!1):I=!0),C>1&&(r.strong||!A||"*"!==l&&L&&!p.test(T)?r.strong!=l||!L||"*"!==l&&A&&!p.test(M)||(E=!1):E=!0),null!=E||null!=I){n.highlightFormatting&&(r.formatting=null==I?"strong":null==E?"em":"strong em"),!0===I&&(r.em=l),!0===E&&(r.strong=l);var m=w(r);return!1===I&&(r.em=!1),!1===E&&(r.strong=!1),m}}else if(" "===l&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return w(r);e.backUp(1)}if(n.strikethrough)if("~"===l&&e.eatWhile(l)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var m=w(r);return r.strikethrough=!1,m}if(e.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),w(r)}else if(" "===l&&e.match(/^~~/,!0)){if(" "===e.peek())return w(r);e.backUp(2)}if(n.emoji&&":"===l&&e.match(/^[a-z_\d+-]+:/)){r.emoji=!0,n.highlightFormatting&&(r.formatting="emoji");var D=w(r);return r.emoji=!1,D}return" "===l&&(e.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),w(r)}function k(t,e){var i=t.next();if(">"===i){e.f=e.inline=_,n.highlightFormatting&&(e.formatting="link");var r=w(e);return r?r+=" ":r="",r+o.linkInline}return t.match(/^[^>]+/,!0),o.linkInline}function S(t,e){if(t.eatSpace())return null;var i,r=t.next();return"("===r||"["===r?(e.f=e.inline=(i="("===r?")":"]",function(t,e){var r=t.next();if(r===i){e.f=e.inline=_,n.highlightFormatting&&(e.formatting="link-string");var o=w(e);return e.linkHref=!1,o}return t.match(T[i]),e.linkHref=!0,w(e)}),n.highlightFormatting&&(e.formatting="link-string"),e.linkHref=!0,w(e)):"error"}var T={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function M(t,e){return t.match(/^([^\]\\]|\\.)*\]:/,!1)?(e.f=A,t.next(),n.highlightFormatting&&(e.formatting="link"),e.linkText=!0,w(e)):m(t,e,_)}function A(t,e){if(t.match(/^\]:/,!0)){e.f=e.inline=L,n.highlightFormatting&&(e.formatting="link");var i=w(e);return e.linkText=!1,i}return t.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function L(t,e){return t.eatSpace()?null:(t.match(/^[^\s]+/,!0),void 0===t.peek()?e.linkTitle=!0:t.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),e.f=e.inline=_,o.linkHref+" url")}var I={startState:function(){return{f:y,prevLine:null,thisLine:null,block:y,htmlState:null,indentation:0,inline:_,text:C,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedChars:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&t.copyState(i,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?t.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkText:e.linkText,linkTitle:e.linkTitle,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,emoji:e.emoji,header:e.header,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedChars:e.fencedChars}},token:function(t,e){if(e.formatting=!1,t!=e.thisLine){if(e.header=0,e.hr=!1,t.match(/^\s*$/,!0))return v(e),null;if(e.prevLine=e.thisLine,e.thisLine=t,e.taskList=!1,e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.f=e.block,e.f!=x){var n=t.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(e.indentation=n,e.indentationDiff=null,n>0)return null}}return e.f(t,e)},innerMode:function(t){return t.block==x?{state:t.htmlState,mode:i}:t.localState?{state:t.localState,mode:t.localMode}:{state:t,mode:I}},indent:function(e,n,r){return e.block==x?i.indent(e.htmlState,n,r):e.localState?e.localMode.indent(e.localState,n,r):t.Pass},blankLine:v,getType:w,closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return I},"xml"),t.defineMIME("text/x-markdown","markdown")}(n(0),n(29),n(28))},function(t,e,n){var i=n(7),r=n(3);function o(t){if(ret={},t.indexOf("#")>=0){var e=t.split("#",2);ret.base=e[0],ret.fragment=e[1]}else ret.base=t,ret.fragment="";return ret}t.exports=class{constructor(t){this.elt=t,this.url=null,this.video=null,this.iframe=null,this.interval=null,this.pageNumber=null;var e=this;r(t).bind("control",function(t,n){"toggle"==n?e.toggle():"jumpback"==n?e.jumpback():"jumpforward"==n&&e.jumpforward()})}_clear(){null!==this.video&&(this.video.pause(),this.elt.removeChild(this.video),this.video=null),null!==this.iframe&&(this.elt.removeChild(this.iframe),this.iframe=null),null!==this.interval&&(window.clearInterval(this.interval),this.interval=null),this.pageNumber=null,this.elt.innerHTML=""}set src(t){var e=o(t),n=this.url?o(this.url):null,r={video:{pattern:/\.(mp4|webm)$/,viewer:function(r){if(this.video&&n&&n.base==e.base){var o=function(t){var e=t.match("t=([^&,]*)");if(e)return i.timecode_to_seconds(e[1])}(e.fragment);if(o)return this.video.currentTime=o,void this.video.play();console.log("ccframe, bad timecode?",e.fragment)}this._clear(),this.video=document.createElement("video"),this.video.setAttribute("autoplay",""),this.video.setAttribute("controls",""),this.elt.appendChild(this.video),this.video.src=t,this.video.addEventListener("timeupdate",this._timeupdate.bind(this))}},local_pdf:{pattern:function(t){return!(!t.match(/\.pdf$/i)||null!=t.match(/^https?:/))},viewer:function(e){this._clear(),this.iframe=document.createElement("iframe"),this.elt.appendChild(this.iframe),this.iframe.src="/lib/generic/web/viewer.html?file="+t,this.iframe.addEventListener("load",this._load.bind(this))}}};for(var s in this.url=t,r){var a=r[s],l=a.pattern instanceof RegExp?a.pattern.exec(e.base):a.pattern.call(this,e.base);if(l)return a.viewer.call(this,l),this}return function(){n&&n.base==e.base?this.iframe.contentWindow.location.hash=e.fragment:(this._clear(),this.iframe=document.createElement("iframe"),this.elt.appendChild(this.iframe),this.iframe.src=t,this.iframe.addEventListener("load",this._load.bind(this)))}.call(this),this}get src(){return this.url}_load(t){if(this.iframe.contentDocument){this.iframe.contentDocument.querySelector("video");var e=this.iframe.contentDocument.querySelector("input#pageNumber");this.pageNumberInput=e,this.pageNumber=e&&e.value,e&&(this.interval=function(){this.pageNumberInput.value!=this.pageNumber&&(this.pageNumber=this.pageNumberInput.value)},window.setInterval(this.interval.bind(this),1e3))}if(this.iframe.contentWindow){var n=this;this.iframe.contentWindow.addEventListener("hashchange",function(){r(n.elt).trigger("hashchange",n.iframe.contentWindow.location.hash)})}}_timeupdate(t){if(this.video){var e="#t="+i.seconds_to_timecode(this.video.currentTime);r(this.elt).trigger("hashchange",e)}}toggle(){null!==this.video&&(this.video.paused?this.video.play():this.video.pause())}jumpforward(){null!==this.video&&(this.video.currentTime+=5)}jumpback(){null!==this.video&&(this.video.currentTime-=5)}get currentTime(){if(null!==this.video)return this.video.currentTime}set currentTime(t){null!==this.video&&(this.video.currentTime=t)}get fragment(){return null!==this.pageNumber?"#page="+this.pageNumber:this.video?"#t="+i.seconds_to_timecode(this.video.currentTime):this.iframe.contentWindow.location.hash}set fragment(t){}}},function(t,e){function n(t,e){e=e?formats[e]:formats.html5;var n,i,r,o,s=Math.floor(t/3600);return t-=3600*s,r=(t-=60*(n=Math.floor(t/60)))-(i=Math.floor(t)),o=(s<10?"0":"")+s+":",o+=(n<10?"0":"")+n+":",o+=(i<10?"0":"")+i,(r>0||e.alwaysFract)&&(o+="."+function(t,e){for(;t.length<e;)t+="0";return t}(r.toString().substring(2,5),3)),o}formats={html5:{alwaysFract:!0}};var i=/(?:(\d\d):)?(\d\d):(\d\d)(?:[.,](\d{1,3}))?/;t.exports={pattern:i,seconds_to_timecode:n,timecode_to_seconds:function(t){var e=t.match(i);if(e)return(e[1]?3600*parseInt(e[1]):0)+60*parseInt(e[2])+parseInt(e[3])+(e[4]?parseFloat("0."+e[4]):0)},seconds_to_timecode:n}},function(t,e,n){(t.exports=n(2)(!1)).push([t.i,".notie-container {\n font-size: 1.6rem;\n height: auto;\n left: 0;\n position: fixed;\n text-align: center;\n width: 100%;\n z-index: 2147483647;\n box-sizing: border-box;\n -o-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.5);\n -ms-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.5);\n -moz-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.5);\n -webkit-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.5);\n box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.5); }\n @media screen and (max-width: 900px) {\n .notie-container {\n font-size: 1.4rem; } }\n @media screen and (max-width: 750px) {\n .notie-container {\n font-size: 1.2rem; } }\n @media screen and (max-width: 400px) {\n .notie-container {\n font-size: 1rem; } }\n\n.notie-background-success {\n background-color: #57BF57; }\n\n.notie-background-warning {\n background-color: #D6A14D; }\n\n.notie-background-error {\n background-color: #E1715B; }\n\n.notie-background-info {\n background-color: #4D82D6; }\n\n.notie-background-neutral {\n background-color: #A0A0A0; }\n\n.notie-background-overlay {\n background-color: #FFFFFF; }\n\n.notie-textbox {\n color: #FFFFFF;\n padding: 20px; }\n\n.notie-textbox-inner {\n margin: 0 auto;\n max-width: 900px; }\n\n.notie-overlay {\n height: 100%;\n left: 0;\n opacity: 0;\n position: fixed;\n top: 0;\n width: 100%;\n z-index: 2147483646; }\n\n.notie-button {\n color: #FFFFFF;\n padding: 10px;\n cursor: pointer; }\n\n.notie-element {\n color: #FFFFFF;\n padding: 10px; }\n\n.notie-element-half {\n display: inline-block;\n width: 50%;\n box-sizing: border-box; }\n\n.notie-element-third {\n display: inline-block;\n width: 33.3333%;\n box-sizing: border-box; }\n\n.notie-alert {\n cursor: pointer; }\n\n.notie-input-field {\n background-color: #FFFFFF;\n border: 0;\n font-family: inherit;\n font-size: inherit;\n outline: 0;\n padding: 10px;\n text-align: center;\n width: 100%;\n box-sizing: border-box; }\n\n.notie-select-choice-repeated {\n border-bottom: 1px solid rgba(255, 255, 255, 0.2);\n box-sizing: border-box; }\n\n.notie-date-selector-inner {\n margin: 0 auto;\n max-width: 900px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none; }\n .notie-date-selector-inner [contenteditable], .notie-date-selector-inner [contenteditable]:focus {\n outline: 0px solid transparent; }\n\n.notie-date-selector-up {\n transform: rotate(180deg); }\n",""])},function(t,e,n){var i=n(8);"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(1)(i,r);i.locals&&(t.exports=i.locals)},function(t,e,n){(t.exports=n(2)(!1)).push([t.i,".lm_goldenlayout{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAGFBMVEX29vb19fXw8PDy8vL09PTz8/Pv7+/x8fGKuegbAAAAyUlEQVR42pXRQQ7CMBRDwST9pfe/MahEmgURbt7WmpVb6+vG0dd9REnn66xRy/qXiCgmEIIJhGACIZhACCYQgvlDCDFIEAwSBIMEwSBBMEgQDBIEgwTBIEEwCJEMQiSDENFMQmQzCZEbNyGemd6KeGZ6u4hnXe2qbdLHFjhf1XqNLXHev4wdMd9nspiEiWISJgqECQJhgkCYIBAmCIQJAmGCQJggECYJhAkCEUMEwhCBMEQgDJEIQ2RSg0iEIRJhiB/S+rrjqvXQ3paIJUgPBXxiAAAAAElFTkSuQmCC)}.lm_content{background:#e1e1e1;border:1px solid #cccccc}.lm_dragProxy .lm_content{box-shadow:2px 2px 4px rgba(0,0,0,0.2);box-sizing:border-box}.lm_dropTargetIndicator{box-shadow:inset 0 0 30px rgba(0,0,0,0.4);outline:1px dashed #cccccc;margin:1px;transition:all 200ms ease}.lm_dropTargetIndicator .lm_inner{background:#000000;opacity:.1}.lm_splitter{background:#999999;opacity:.001;transition:opacity 200ms ease}.lm_splitter:hover,.lm_splitter.lm_dragging{background:#bbbbbb;opacity:1}.lm_header{height:20px}.lm_header.lm_selectable{cursor:pointer}.lm_header .lm_tab{font-family:Arial,sans-serif;font-size:12px;color:#888888;background:#fafafa;margin-right:2px;padding-bottom:4px;border:1px solid #cccccc;border-bottom:none}.lm_header .lm_tab .lm_title{padding-top:1px}.lm_header .lm_tab .lm_close_tab{width:11px;height:11px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAIklEQVR4nGNgYGD4z4Ad/Mdg4ODDBXCZRFgCp5EEHQMXBwAQAgz0SVCcggAAAABJRU5ErkJggg==);background-position:center center;background-repeat:no-repeat;right:6px;top:4px;opacity:.4}.lm_header .lm_tab .lm_close_tab:hover{opacity:1}.lm_header .lm_tab.lm_active{border-bottom:none;box-shadow:2px -2px 2px -2px rgba(0,0,0,0.2);padding-bottom:5px}.lm_header .lm_tab.lm_active .lm_close_tab{opacity:1}.lm_dragProxy.lm_bottom .lm_header .lm_tab.lm_active,.lm_stack.lm_bottom .lm_header .lm_tab.lm_active{box-shadow:2px 2px 2px -2px rgba(0,0,0,0.2)}.lm_selected .lm_header{background-color:#452500}.lm_tab:hover,.lm_tab.lm_active{background:#e1e1e1;color:#777777}.lm_header .lm_controls .lm_tabdropdown:before{color:#000000}.lm_controls>li{position:relative;background-position:center center;background-repeat:no-repeat;opacity:.4;transition:opacity 300ms ease}.lm_controls>li:hover{opacity:1}.lm_controls .lm_popout{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAANUlEQVR4nI2QMQoAMAwCz5L/f9mOzZIaN0E9UDyZhaaQz6atgBHgambEJ5wBKoS0WaIvfT+6K2MIECN19MAAAAAASUVORK5CYII=)}.lm_controls .lm_maximise{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAIklEQVR4nGNkYGD4z0AAMBFSAAOETPpPlEmDUREjAxHhBABPvAQLFv3qngAAAABJRU5ErkJggg==)}.lm_controls .lm_close{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAKUlEQVR4nGNgYGD4z4Af/Mdg4FKASwCnDf8JKSBoAtEmEXQTQd8RDCcA6+4Q8OvIgasAAAAASUVORK5CYII=)}.lm_maximised .lm_header{background-color:#ffffff}.lm_maximised .lm_controls .lm_maximise{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAJklEQVR4nGP8//8/AyHARFDFUFbEwsDAwMDIyIgzHP7//89IlEkApSkHEScJTKoAAAAASUVORK5CYII=)}.lm_transition_indicator{background-color:#000000;border:1px dashed #555555}.lm_popin{cursor:pointer}.lm_popin .lm_bg{background:#000000;opacity:.7}.lm_popin .lm_icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAJCAYAAADpeqZqAAAAWklEQVR4nJWOyw3AIAxDHcQC7L8jbwT3AlJBfNp3SiI7dtRaLSlKKeoA1oEsKSQZCEluexw8Tm3ohk+E7bnOUHUGcNh+HwbBygw4AZ7FN/Lt84p0l+yTflV8AKQyLdcCRJi/AAAAAElFTkSuQmCC);background-position:center center;background-repeat:no-repeat;opacity:.7}.lm_popin:hover .lm_icon{opacity:1}",""])},function(t,e,n){var i=n(10);"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(1)(i,r);i.locals&&(t.exports=i.locals)},function(t,e,n){(t.exports=n(2)(!1)).push([t.i,".lm_root{position:relative}.lm_row>.lm_item{float:left}.lm_content{overflow:hidden;position:relative}.lm_dragging,.lm_dragging *{cursor:move !important;user-select:none}.lm_maximised{position:absolute;top:0;left:0;z-index:40}.lm_maximise_placeholder{display:none}.lm_splitter{position:relative;z-index:20}.lm_splitter:hover,.lm_splitter.lm_dragging{background:orange}.lm_splitter.lm_vertical .lm_drag_handle{width:100%;position:absolute;cursor:ns-resize}.lm_splitter.lm_horizontal{float:left;height:100%}.lm_splitter.lm_horizontal .lm_drag_handle{height:100%;position:absolute;cursor:ew-resize}.lm_header{overflow:visible;position:relative;z-index:1}.lm_header [class^=lm_]{box-sizing:content-box !important}.lm_header .lm_controls{position:absolute;right:3px}.lm_header .lm_controls>li{cursor:pointer;float:left;width:18px;height:18px;text-align:center}.lm_header ul{margin:0;padding:0;list-style-type:none}.lm_header .lm_tabs{position:absolute}.lm_header .lm_tab{cursor:pointer;float:left;height:14px;margin-top:1px;padding:0 10px 5px;padding-right:25px;position:relative}.lm_header .lm_tab i{width:2px;height:19px;position:absolute}.lm_header .lm_tab i.lm_left{top:0;left:-2px}.lm_header .lm_tab i.lm_right{top:0;right:-2px}.lm_header .lm_tab .lm_title{display:inline-block;overflow:hidden;text-overflow:ellipsis}.lm_header .lm_tab .lm_close_tab{width:14px;height:14px;position:absolute;top:0;right:0;text-align:center}.lm_stack.lm_left .lm_header,.lm_stack.lm_right .lm_header{height:100%}.lm_dragProxy.lm_left .lm_header,.lm_dragProxy.lm_right .lm_header,.lm_stack.lm_left .lm_header,.lm_stack.lm_right .lm_header{width:20px;float:left;vertical-align:top}.lm_dragProxy.lm_left .lm_header .lm_tabs,.lm_dragProxy.lm_right .lm_header .lm_tabs,.lm_stack.lm_left .lm_header .lm_tabs,.lm_stack.lm_right .lm_header .lm_tabs{transform-origin:left top;top:0;width:1000px}.lm_dragProxy.lm_left .lm_header .lm_controls,.lm_dragProxy.lm_right .lm_header .lm_controls,.lm_stack.lm_left .lm_header .lm_controls,.lm_stack.lm_right .lm_header .lm_controls{bottom:0}.lm_dragProxy.lm_left .lm_items,.lm_dragProxy.lm_right .lm_items,.lm_stack.lm_left .lm_items,.lm_stack.lm_right .lm_items{float:left}.lm_dragProxy.lm_left .lm_header .lm_tabs,.lm_stack.lm_left .lm_header .lm_tabs{transform:rotate(-90deg) scaleX(-1);left:0}.lm_dragProxy.lm_left .lm_header .lm_tabs .lm_tab,.lm_stack.lm_left .lm_header .lm_tabs .lm_tab{transform:scaleX(-1);margin-top:1px}.lm_dragProxy.lm_left .lm_header .lm_tabdropdown_list,.lm_stack.lm_left .lm_header .lm_tabdropdown_list{top:initial;right:initial;left:20px}.lm_dragProxy.lm_right .lm_content{float:left}.lm_dragProxy.lm_right .lm_header .lm_tabs,.lm_stack.lm_right .lm_header .lm_tabs{transform:rotate(90deg) scaleX(1);left:100%;margin-left:0}.lm_dragProxy.lm_right .lm_header .lm_controls,.lm_stack.lm_right .lm_header .lm_controls{left:3px}.lm_dragProxy.lm_right .lm_header .lm_tabdropdown_list,.lm_stack.lm_right .lm_header .lm_tabdropdown_list{top:initial;right:20px}.lm_dragProxy.lm_bottom .lm_header .lm_tab,.lm_stack.lm_bottom .lm_header .lm_tab{margin-top:0;border-top:none}.lm_dragProxy.lm_bottom .lm_header .lm_controls,.lm_stack.lm_bottom .lm_header .lm_controls{top:3px}.lm_dragProxy.lm_bottom .lm_header .lm_tabdropdown_list,.lm_stack.lm_bottom .lm_header .lm_tabdropdown_list{top:initial;bottom:20px}.lm_drop_tab_placeholder{float:left;width:100px;height:10px;visibility:hidden}.lm_header .lm_controls .lm_tabdropdown:before{content:'';width:0;height:0;vertical-align:middle;display:inline-block;border-top:5px dashed;border-right:5px solid transparent;border-left:5px solid transparent;color:white}.lm_header .lm_tabdropdown_list{position:absolute;top:20px;right:0;z-index:5;overflow:hidden}.lm_header .lm_tabdropdown_list .lm_tab{clear:both;padding-right:10px;margin:0}.lm_header .lm_tabdropdown_list .lm_tab .lm_title{width:100px}.lm_header .lm_tabdropdown_list .lm_close_tab{display:none !important}.lm_dragProxy{position:absolute;top:0;left:0;z-index:30}.lm_dragProxy .lm_header{background:transparent}.lm_dragProxy .lm_content{border-top:none;overflow:hidden}.lm_dropTargetIndicator{display:none;position:absolute;z-index:20}.lm_dropTargetIndicator .lm_inner{width:100%;height:100%;position:relative;top:0;left:0}.lm_transition_indicator{display:none;width:20px;height:20px;position:absolute;top:0;left:0;z-index:20}.lm_popin{width:20px;height:20px;position:absolute;bottom:0;right:0;z-index:9999}.lm_popin>*{width:100%;height:100%;position:absolute;top:0;left:0}.lm_popin>.lm_bg{z-index:10}.lm_popin>.lm_icon{z-index:20}",""])},function(t,e,n){var i=n(12);"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(1)(i,r);i.locals&&(t.exports=i.locals)},function(t,e,n){t.exports=function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";(function(t){var n,i,r,o,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};o=function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"===s(Symbol.iterator)?function(t){return void 0===t?"undefined":s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":s(t)},r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o={top:"top",bottom:"bottom"},a={alertTime:3,dateMonths:["January","February","March","April","May","June","July","August","September","October","November","December"],overlayClickDismiss:!0,overlayOpacity:.75,transitionCurve:"ease",transitionDuration:.3,transitionSelector:"all",classes:{container:"notie-container",textbox:"notie-textbox",textboxInner:"notie-textbox-inner",button:"notie-button",element:"notie-element",elementHalf:"notie-element-half",elementThird:"notie-element-third",overlay:"notie-overlay",backgroundSuccess:"notie-background-success",backgroundWarning:"notie-background-warning",backgroundError:"notie-background-error",backgroundInfo:"notie-background-info",backgroundNeutral:"notie-background-neutral",backgroundOverlay:"notie-background-overlay",alert:"notie-alert",inputField:"notie-input-field",selectChoiceRepeated:"notie-select-choice-repeated",dateSelectorInner:"notie-date-selector-inner",dateSelectorUp:"notie-date-selector-up"},ids:{overlay:"notie-overlay"},positions:{alert:o.top,force:o.top,confirm:o.top,input:o.top,select:o.bottom,date:o.top}},l=e.setOptions=function(t){a=r({},a,t,{classes:r({},a.classes,t.classes),ids:r({},a.ids,t.ids),positions:r({},a.positions,t.positions)})},c=function(){return new Promise(function(t){return setTimeout(t,0)})},u=function(t){return new Promise(function(e){return setTimeout(e,1e3*t)})},d=function(){document.activeElement&&document.activeElement.blur()},h=function(){var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,n="x"===t?e:3&e|8;return n.toString(16)});return"notie-"+t},f={1:a.classes.backgroundSuccess,success:a.classes.backgroundSuccess,2:a.classes.backgroundWarning,warning:a.classes.backgroundWarning,3:a.classes.backgroundError,error:a.classes.backgroundError,4:a.classes.backgroundInfo,info:a.classes.backgroundInfo,5:a.classes.backgroundNeutral,neutral:a.classes.backgroundNeutral},p=function(){return a.transitionSelector+" "+a.transitionDuration+"s "+a.transitionCurve},m=function(t){return 13===t.keyCode},g=function(t){return 27===t.keyCode},v=function(t,e){t.classList.add(a.classes.container),t.style[e]="-10000px",document.body.appendChild(t),t.style[e]="-"+t.offsetHeight+"px",t.listener&&window.addEventListener("keydown",t.listener),c().then(function(){t.style.transition=p(),t.style[e]=0})},y=function(t,e){var n=document.getElementById(t);n&&(n.style[e]="-"+n.offsetHeight+"px",n.listener&&window.removeEventListener("keydown",n.listener),u(a.transitionDuration).then(function(){n.parentNode&&n.parentNode.removeChild(n)}))},x=function(t,e){var n=document.createElement("div");n.id=a.ids.overlay,n.classList.add(a.classes.overlay),n.classList.add(a.classes.backgroundOverlay),n.style.opacity=0,t&&a.overlayClickDismiss&&(n.onclick=function(){y(t.id,e),b()}),document.body.appendChild(n),c().then(function(){n.style.transition=p(),n.style.opacity=a.overlayOpacity})},b=function(){var t=document.getElementById(a.ids.overlay);t.style.opacity=0,u(a.transitionDuration).then(function(){t.parentNode&&t.parentNode.removeChild(t)})},w=e.hideAlerts=function(t){var e=document.getElementsByClassName(a.classes.alert);if(e.length){for(var n=0;n<e.length;n++){var i=e[n];y(i.id,i.position)}t&&u(a.transitionDuration).then(function(){return t()})}},C=e.alert=function(t){var e=t.type,n=void 0===e?4:e,i=t.text,r=t.time,o=void 0===r?a.alertTime:r,s=t.stay,l=void 0!==s&&s,c=t.position,p=void 0===c?a.positions.alert||p.top:c;d(),w();var x=document.createElement("div"),b=h();x.id=b,x.position=p,x.classList.add(a.classes.textbox),x.classList.add(f[n]),x.classList.add(a.classes.alert),x.innerHTML='<div class="'+a.classes.textboxInner+'">'+i+"</div>",x.onclick=function(){return y(b,p)},x.listener=function(t){(m(t)||g(t))&&w()},v(x,p),o&&o<1&&(o=1),!l&&o&&u(o).then(function(){return y(b,p)})},_=e.force=function(t,e){var n=t.type,i=void 0===n?5:n,r=t.text,o=t.buttonText,s=void 0===o?"OK":o,l=t.callback,c=t.position,u=void 0===c?a.positions.force||u.top:c;d(),w();var p=document.createElement("div"),g=h();p.id=g;var C=document.createElement("div");C.classList.add(a.classes.textbox),C.classList.add(a.classes.backgroundInfo),C.innerHTML='<div class="'+a.classes.textboxInner+'">'+r+"</div>";var _=document.createElement("div");_.classList.add(a.classes.button),_.classList.add(f[i]),_.innerHTML=s,_.onclick=function(){y(g,u),b(),l?l():e&&e()},p.appendChild(C),p.appendChild(_),p.listener=function(t){m(t)&&_.click()},v(p,u),x()},k=e.confirm=function(t,e,n){var i=t.text,r=t.submitText,o=void 0===r?"Yes":r,s=t.cancelText,l=void 0===s?"Cancel":s,c=t.submitCallback,u=t.cancelCallback,f=t.position,p=void 0===f?a.positions.confirm||p.top:f;d(),w();var C=document.createElement("div"),_=h();C.id=_;var k=document.createElement("div");k.classList.add(a.classes.textbox),k.classList.add(a.classes.backgroundInfo),k.innerHTML='<div class="'+a.classes.textboxInner+'">'+i+"</div>";var S=document.createElement("div");S.classList.add(a.classes.button),S.classList.add(a.classes.elementHalf),S.classList.add(a.classes.backgroundSuccess),S.innerHTML=o,S.onclick=function(){y(_,p),b(),c?c():e&&e()};var T=document.createElement("div");T.classList.add(a.classes.button),T.classList.add(a.classes.elementHalf),T.classList.add(a.classes.backgroundError),T.innerHTML=l,T.onclick=function(){y(_,p),b(),u?u():n&&n()},C.appendChild(k),C.appendChild(S),C.appendChild(T),C.listener=function(t){m(t)?S.click():g(t)&&T.click()},v(C,p),x(C,p)},S=function(t,e,n){var r=t.text,o=t.submitText,s=void 0===o?"Submit":o,l=t.cancelText,c=void 0===l?"Cancel":l,u=t.submitCallback,f=t.cancelCallback,p=t.position,C=void 0===p?a.positions.input||C.top:p,_=function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(t,["text","submitText","cancelText","submitCallback","cancelCallback","position"]);d(),w();var k=document.createElement("div"),S=h();k.id=S;var T=document.createElement("div");T.classList.add(a.classes.textbox),T.classList.add(a.classes.backgroundInfo),T.innerHTML='<div class="'+a.classes.textboxInner+'">'+r+"</div>";var M=document.createElement("input");M.classList.add(a.classes.inputField),M.setAttribute("autocapitalize",_.autocapitalize||"none"),M.setAttribute("autocomplete",_.autocomplete||"off"),M.setAttribute("autocorrect",_.autocorrect||"off"),M.setAttribute("autofocus",_.autofocus||"true"),M.setAttribute("inputmode",_.inputmode||"verbatim"),M.setAttribute("max",_.max||""),M.setAttribute("maxlength",_.maxlength||""),M.setAttribute("min",_.min||""),M.setAttribute("minlength",_.minlength||""),M.setAttribute("placeholder",_.placeholder||""),M.setAttribute("spellcheck",_.spellcheck||"default"),M.setAttribute("step",_.step||"any"),M.setAttribute("type",_.type||"text"),M.value=_.value||"",_.allowed&&(M.oninput=function(){var t=void 0;if(Array.isArray(_.allowed)){for(var e="",n=_.allowed,r=0;r<n.length;r++)"an"===n[r]?e+="0-9a-zA-Z":"a"===n[r]?e+="a-zA-Z":"n"===n[r]&&(e+="0-9"),"s"===n[r]&&(e+=" ");t=new RegExp("[^"+e+"]","g")}else"object"===i(_.allowed)&&(t=_.allowed);M.value=M.value.replace(t,"")});var A=document.createElement("div");A.classList.add(a.classes.button),A.classList.add(a.classes.elementHalf),A.classList.add(a.classes.backgroundSuccess),A.innerHTML=s,A.onclick=function(){y(S,C),b(),u?u(M.value):e&&e(M.value)};var L=document.createElement("div");L.classList.add(a.classes.button),L.classList.add(a.classes.elementHalf),L.classList.add(a.classes.backgroundError),L.innerHTML=c,L.onclick=function(){y(S,C),b(),f?f(M.value):n&&n(M.value)},k.appendChild(T),k.appendChild(M),k.appendChild(A),k.appendChild(L),k.listener=function(t){m(t)?A.click():g(t)&&L.click()},v(k,C),M.focus(),x(k,C)};e.input=S;var T=e.select=function(t,e){var n=t.text,i=t.cancelText,r=void 0===i?"Cancel":i,o=t.cancelCallback,s=t.choices,l=t.position,c=void 0===l?a.positions.select||c.top:l;d(),w();var u=document.createElement("div"),p=h();u.id=p;var m=document.createElement("div");m.classList.add(a.classes.textbox),m.classList.add(a.classes.backgroundInfo),m.innerHTML='<div class="'+a.classes.textboxInner+'">'+n+"</div>",u.appendChild(m),s.forEach(function(t,e){var n=t.type,i=void 0===n?1:n,r=t.text,o=t.handler,l=document.createElement("div");l.classList.add(f[i]),l.classList.add(a.classes.button),l.classList.add(a.classes.selectChoice);var d=s[e+1];d&&!d.type&&(d.type=1),d&&d.type===i&&l.classList.add(a.classes.selectChoiceRepeated),l.innerHTML=r,l.onclick=function(){y(p,c),b(),o()},u.appendChild(l)});var C=document.createElement("div");C.classList.add(a.classes.backgroundNeutral),C.classList.add(a.classes.button),C.innerHTML=r,C.onclick=function(){y(p,c),b(),o?o():e&&e()},u.appendChild(C),u.listener=function(t){g(t)&&C.click()},v(u,c),x(u,c)},M=e.date=function(t,e,n){var i=t.value,r=void 0===i?new Date:i,o=t.submitText,s=void 0===o?"OK":o,l=t.cancelText,c=void 0===l?"Cancel":l,u=t.submitCallback,f=t.cancelCallback,p=t.position,C=void 0===p?a.positions.date||C.top:p;d(),w();var _="&#9662",k=document.createElement("div"),S=document.createElement("div"),T=document.createElement("div"),M=function(t){k.innerHTML=a.dateMonths[t.getMonth()],S.innerHTML=t.getDate(),T.innerHTML=t.getFullYear()},A=function(t){M(r)},L=function(t){var e=new Date(r.getFullYear(),r.getMonth()+t+1,0).getDate();r.getDate()>e&&r.setDate(e),r.setMonth(r.getMonth()+t),M(r)},I=function(t){r.setDate(r.getDate()+t),M(r)},E=function(t){var e=r.getFullYear()+t;e<0?r.setFullYear(0):r.setFullYear(r.getFullYear()+t),M(r)},D=document.createElement("div"),N=h();D.id=N;var O=document.createElement("div");O.classList.add(a.classes.backgroundInfo);var P=document.createElement("div");P.classList.add(a.classes.dateSelectorInner);var H=document.createElement("div");H.classList.add(a.classes.button),H.classList.add(a.classes.elementThird),H.classList.add(a.classes.dateSelectorUp),H.innerHTML=_;var F=document.createElement("div");F.classList.add(a.classes.button),F.classList.add(a.classes.elementThird),F.classList.add(a.classes.dateSelectorUp),F.innerHTML=_;var W=document.createElement("div");W.classList.add(a.classes.button),W.classList.add(a.classes.elementThird),W.classList.add(a.classes.dateSelectorUp),W.innerHTML=_,k.classList.add(a.classes.element),k.classList.add(a.classes.elementThird),k.innerHTML=a.dateMonths[r.getMonth()],S.classList.add(a.classes.element),S.classList.add(a.classes.elementThird),S.setAttribute("contentEditable",!0),S.addEventListener("input",function(t){var e=new Date(r.getFullYear(),r.getMonth()+1,0).getDate(),n=t.target.textContent.replace(/^0+/,"").replace(/[^\d]/g,"").slice(0,2);Number(n)>e&&(n=e.toString()),t.target.textContent=n,Number(n)<1&&(n="1"),r.setDate(Number(n))}),S.addEventListener("blur",A),S.innerHTML=r.getDate(),T.classList.add(a.classes.element),T.classList.add(a.classes.elementThird),T.setAttribute("contentEditable",!0),T.addEventListener("input",function(t){var e=t.target.textContent.replace(/^0+/,"").replace(/[^\d]/g,"").slice(0,4);t.target.textContent=e,r.setFullYear(Number(e))}),T.addEventListener("blur",A),T.innerHTML=r.getFullYear();var z=document.createElement("div");z.classList.add(a.classes.button),z.classList.add(a.classes.elementThird),z.innerHTML=_;var R=document.createElement("div");R.classList.add(a.classes.button),R.classList.add(a.classes.elementThird),R.innerHTML=_;var B=document.createElement("div");B.classList.add(a.classes.button),B.classList.add(a.classes.elementThird),B.innerHTML=_,H.onclick=function(){return L(1)},F.onclick=function(){return I(1)},W.onclick=function(){return E(1)},z.onclick=function(){return L(-1)},R.onclick=function(){return I(-1)},B.onclick=function(){return E(-1)};var j=document.createElement("div");j.classList.add(a.classes.button),j.classList.add(a.classes.elementHalf),j.classList.add(a.classes.backgroundSuccess),j.innerHTML=s,j.onclick=function(){y(N,C),b(),u?u(r):e&&e(r)};var q=document.createElement("div");q.classList.add(a.classes.button),q.classList.add(a.classes.elementHalf),q.classList.add(a.classes.backgroundError),q.innerHTML=c,q.onclick=function(){y(N,C),b(),f?f(r):n&&n(r)},P.appendChild(H),P.appendChild(F),P.appendChild(W),P.appendChild(k),P.appendChild(S),P.appendChild(T),P.appendChild(z),P.appendChild(R),P.appendChild(B),O.appendChild(P),D.appendChild(O),D.appendChild(j),D.appendChild(q),D.listener=function(t){m(t)?j.click():g(t)&&q.click()},v(D,C),x(D,C)};e.default={alert:C,force:_,confirm:k,input:S,select:T,date:M,setOptions:l,hideAlerts:w}}])},"object"===s(e)&&"object"===s(t)?t.exports=o():(i=[],void 0===(r="function"==typeof(n=o)?n.apply(e,i):n)||(t.exports=r))}).call(e,n(0)(t))}])},function(t,e){function n(t){return(t=t||"").replace(/^["(']/,"").replace(/["(']$/,"")}t.exports={trim_quotes:n,trim_brackets:function(t){return t.replace(/^\[(.+)\]:?$/,"$1")},trim_parentheses:function(t){return t.replace(/^\((.+)\)$/,"$1")},extract_reflink_definitions:function(t){var e={};return t.replace(/^\[([^\]]+)\]:\s+([^ \n]+)(?: +("[^"]*"|\'[^"]*\'|\([^\)]*\)|.*))?$/gm,function(t,i,r,o){var s={label:i,url:r,title:n(o)};e[i.toLowerCase()]=s}),e},xpandRefLink:function(t,e){if(t.indexOf("#")>=0){var n=t.split("#",2),i=n[0],r=n[1];if(void 0!==(o=e[i.toLowerCase()]))return{href:o.url+"#"+r,title:o.title}}else{var o;if(void 0!==(o=e[t.toLowerCase()]))return{href:o.url,title:o.title}}return{href:t}},compactRefLink:function(t,e){var n,i="";if(t.indexOf("#")>=0){var r=t.split("#",2);n=r[0],i=r[1]}else n=t;for(var o in e){var s=e[o];if(s.url==n)return s.label+(i?"#"+i:"")}return t}}},function(t,e,n){(t.exports=n(2)(!1)).push([t.i,"body {\n margin: 0;\n padding: 0;\n overflow: hidden;\n}\n\n.cceditor {\n width: 100%; height: 100%;\n}\n\n.CodeMirror {\n position: absolute;\n left: 0; right: 0;\n width: 100%; height: 100%;\n font-size: 12px;\n}\n\n.CodeMirror * { box-sizing: content-box }\n\n.ccframe iframe {\n border: none;\n width: 100%;\n height: 100%;\n}\n.ccframe video {\n width: 100%;\n height: 100%; \n}",""])},function(t,e,n){var i=n(16);"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(1)(i,r);i.locals&&(t.exports=i.locals)},function(t,e,n){(t.exports=n(2)(!1)).push([t.i,'.CodeMirror-foldmarker {\n color: blue;\n text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;\n font-family: arial;\n line-height: .3;\n cursor: pointer;\n}\n.CodeMirror-foldgutter {\n width: .7em;\n}\n.CodeMirror-foldgutter-open,\n.CodeMirror-foldgutter-folded {\n cursor: pointer;\n}\n.CodeMirror-foldgutter-open:after {\n content: "\\25BE";\n}\n.CodeMirror-foldgutter-folded:after {\n content: "\\25B8";\n}\n',""])},function(t,e,n){var i=n(18);"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(1)(i,r);i.locals&&(t.exports=i.locals)},function(t,e,n){(t.exports=n(2)(!1)).push([t.i,"/* BASICS */\n\n.CodeMirror {\n /* Set height, width, borders, and global font properties here */\n font-family: monospace;\n height: 300px;\n color: black;\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\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: #0f0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}\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 background: white;\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 overflow: auto;\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: #ffa;\n background: 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(t,e,n){var i=n(20);"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(1)(i,r);i.locals&&(t.exports=i.locals)},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,i=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var r,o=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?t:(r=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:i+o.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}},function(t,e,n){(t.exports=n(2)(!1)).push([t.i,"/* Based on Sublime Text's Monokai theme */\n\n.cm-s-monokai.CodeMirror { background: #272822; color: #f8f8f2; }\n.cm-s-monokai div.CodeMirror-selected { background: #49483E; }\n.cm-s-monokai .CodeMirror-line::selection, .cm-s-monokai .CodeMirror-line > span::selection, .cm-s-monokai .CodeMirror-line > span > span::selection { background: rgba(73, 72, 62, .99); }\n.cm-s-monokai .CodeMirror-line::-moz-selection, .cm-s-monokai .CodeMirror-line > span::-moz-selection, .cm-s-monokai .CodeMirror-line > span > span::-moz-selection { background: rgba(73, 72, 62, .99); }\n.cm-s-monokai .CodeMirror-gutters { background: #272822; border-right: 0px; }\n.cm-s-monokai .CodeMirror-guttermarker { color: white; }\n.cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; }\n.cm-s-monokai .CodeMirror-linenumber { color: #d0d0d0; }\n.cm-s-monokai .CodeMirror-cursor { border-left: 1px solid #f8f8f0; }\n\n.cm-s-monokai span.cm-comment { color: #75715e; }\n.cm-s-monokai span.cm-atom { color: #ae81ff; }\n.cm-s-monokai span.cm-number { color: #ae81ff; }\n\n.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute { color: #a6e22e; }\n.cm-s-monokai span.cm-keyword { color: #f92672; }\n.cm-s-monokai span.cm-builtin { color: #66d9ef; }\n.cm-s-monokai span.cm-string { color: #e6db74; }\n\n.cm-s-monokai span.cm-variable { color: #f8f8f2; }\n.cm-s-monokai span.cm-variable-2 { color: #9effff; }\n.cm-s-monokai span.cm-variable-3, .cm-s-monokai span.cm-type { color: #66d9ef; }\n.cm-s-monokai span.cm-def { color: #fd971f; }\n.cm-s-monokai span.cm-bracket { color: #f8f8f2; }\n.cm-s-monokai span.cm-tag { color: #f92672; }\n.cm-s-monokai span.cm-header { color: #ae81ff; }\n.cm-s-monokai span.cm-link { color: #ae81ff; }\n.cm-s-monokai span.cm-error { background: #f92672; color: #f8f8f0; }\n\n.cm-s-monokai .CodeMirror-activeline-background { background: #373831; }\n.cm-s-monokai .CodeMirror-matchingbracket {\n text-decoration: underline;\n color: white !important;\n}\n",""])},function(t,e,n){var i=n(23);"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(1)(i,r);i.locals&&(t.exports=i.locals)},function(t,e,n){!function(t){"use strict";t.registerHelper("fold","markdown",function(e,n){var i=100;function r(n){var i=e.getTokenTypeAt(t.Pos(n,0));return i&&/\bheader\b/.test(i)}function o(t,e,n){var o=e&&e.match(/^#+/);return o&&r(t)?o[0].length:(o=n&&n.match(/^[=\-]+\s*$/))&&r(t+1)?"="==n[0]?1:2:i}var s=e.getLine(n.line),a=e.getLine(n.line+1),l=o(n.line,s,a);if(l!==i){for(var c=e.lastLine(),u=n.line,d=e.getLine(u+2);u<c&&!(o(u+1,a,d)<=l);)++u,a=d,d=e.getLine(u+2);return{from:t.Pos(n.line,s.length),to:t.Pos(u,e.getLine(u).length)}}})}(n(0))},function(t,e,n){!function(t){"use strict";t.defineOption("foldGutter",!1,function(e,n,i){var r;i&&i!=t.Init&&(e.clearGutter(e.state.foldGutter.options.gutter),e.state.foldGutter=null,e.off("gutterClick",s),e.off("change",a),e.off("viewportChange",l),e.off("fold",c),e.off("unfold",c),e.off("swapDoc",a)),n&&(e.state.foldGutter=new function(t){this.options=t,this.from=this.to=0}((!0===(r=n)&&(r={}),null==r.gutter&&(r.gutter="CodeMirror-foldgutter"),null==r.indicatorOpen&&(r.indicatorOpen="CodeMirror-foldgutter-open"),null==r.indicatorFolded&&(r.indicatorFolded="CodeMirror-foldgutter-folded"),r)),o(e),e.on("gutterClick",s),e.on("change",a),e.on("viewportChange",l),e.on("fold",c),e.on("unfold",c),e.on("swapDoc",a))});var e=t.Pos;function n(t,n){for(var i=t.findMarks(e(n,0),e(n+1,0)),r=0;r<i.length;++r)if(i[r].__isFold&&i[r].find().from.line==n)return i[r]}function i(t){if("string"==typeof t){var e=document.createElement("div");return e.className=t+" CodeMirror-guttermarker-subtle",e}return t.cloneNode(!0)}function r(t,r,o){var s=t.state.foldGutter.options,a=r,l=t.foldOption(s,"minFoldSize"),c=t.foldOption(s,"rangeFinder");t.eachLine(r,o,function(r){var o=null;if(n(t,a))o=i(s.indicatorFolded);else{var u=e(a,0),d=c&&c(t,u);d&&d.to.line-d.from.line>=l&&(o=i(s.indicatorOpen))}t.setGutterMarker(r,s.gutter,o),++a})}function o(t){var e=t.getViewport(),n=t.state.foldGutter;n&&(t.operation(function(){r(t,e.from,e.to)}),n.from=e.from,n.to=e.to)}function s(t,i,r){var o=t.state.foldGutter;if(o){var s=o.options;if(r==s.gutter){var a=n(t,i);a?a.clear():t.foldCode(e(i,0),s.rangeFinder)}}}function a(t){var e=t.state.foldGutter;if(e){var n=e.options;e.from=e.to=0,clearTimeout(e.changeUpdate),e.changeUpdate=setTimeout(function(){o(t)},n.foldOnChangeTimeSpan||600)}}function l(t){var e=t.state.foldGutter;if(e){var n=e.options;clearTimeout(e.changeUpdate),e.changeUpdate=setTimeout(function(){var n=t.getViewport();e.from==e.to||n.from-e.to>20||e.from-n.to>20?o(t):t.operation(function(){n.from<e.from&&(r(t,n.from,e.from),e.from=n.from),n.to>e.to&&(r(t,e.to,n.to),e.to=n.to)})},n.updateViewportTimeSpan||400)}}function c(t,e){var n=t.state.foldGutter;if(n){var i=e.line;i>=n.from&&i<n.to&&r(t,i,i+1)}}}(n(0),n(4))},function(t,e,n){!function(t){"use strict";t.overlayMode=function(e,n,i){return{startState:function(){return{base:t.startState(e),overlay:t.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(i){return{base:t.copyState(e,i.base),overlay:t.copyState(n,i.overlay),basePos:i.basePos,baseCur:null,overlayPos:i.overlayPos,overlayCur:null}},token:function(t,r){return(t!=r.streamSeen||Math.min(r.basePos,r.overlayPos)<t.start)&&(r.streamSeen=t,r.basePos=r.overlayPos=t.start),t.start==r.basePos&&(r.baseCur=e.token(t,r.base),r.basePos=t.pos),t.start==r.overlayPos&&(t.pos=t.start,r.overlayCur=n.token(t,r.overlay),r.overlayPos=t.pos),t.pos=Math.min(r.basePos,r.overlayPos),null==r.overlayCur?r.baseCur:null!=r.baseCur&&r.overlay.combineTokens||i&&null==r.overlay.combineTokens?r.baseCur+" "+r.overlayCur:r.overlayCur},indent:e.indent&&function(t,n){return e.indent(t.base,n)},electricChars:e.electricChars,innerMode:function(t){return{state:t.base,mode:e}},blankLine:function(t){var r,o;return e.blankLine&&(r=e.blankLine(t.base)),n.blankLine&&(o=n.blankLine(t.overlay)),null==o?r:i&&null!=r?r+" "+o:o}}}}(n(0))},function(t,e,n){!function(t){"use strict";t.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{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"]},{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",mime:"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:"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"],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",mime:"application/x-httpd-php",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",mime:"text/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:"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"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{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 e=0;e<t.modeInfo.length;e++){var n=t.modeInfo[e];n.mimes&&(n.mime=n.mimes[0])}t.findModeByMIME=function(e){e=e.toLowerCase();for(var n=0;n<t.modeInfo.length;n++){var i=t.modeInfo[n];if(i.mime==e)return i;if(i.mimes)for(var r=0;r<i.mimes.length;r++)if(i.mimes[r]==e)return i}return/\+xml$/.test(e)?t.findModeByMIME("application/xml"):/\+json$/.test(e)?t.findModeByMIME("application/json"):void 0},t.findModeByExtension=function(e){for(var n=0;n<t.modeInfo.length;n++){var i=t.modeInfo[n];if(i.ext)for(var r=0;r<i.ext.length;r++)if(i.ext[r]==e)return i}},t.findModeByFileName=function(e){for(var n=0;n<t.modeInfo.length;n++){var i=t.modeInfo[n];if(i.file&&i.file.test(e))return i}var r=e.lastIndexOf("."),o=r>-1&&e.substring(r+1,e.length);if(o)return t.findModeByExtension(o)},t.findModeByName=function(e){e=e.toLowerCase();for(var n=0;n<t.modeInfo.length;n++){var i=t.modeInfo[n];if(i.name.toLowerCase()==e)return i;if(i.alias)for(var r=0;r<i.alias.length;r++)if(i.alias[r].toLowerCase()==e)return i}}}(n(0))},function(t,e,n){!function(t){"use strict";var e={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,caseFold:!1};t.defineMode("xml",function(i,r){var o,s,a=i.indentUnit,l={},c=r.htmlMode?e:n;for(var u in c)l[u]=c[u];for(var u in r)l[u]=r[u];function d(t,e){function n(n){return e.tokenize=n,n(t,e)}var i=t.next();return"<"==i?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(f("atom","]]>")):null:t.match("--")?n(f("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(function t(e){return function(n,i){for(var r;null!=(r=n.next());){if("<"==r)return i.tokenize=t(e+1),i.tokenize(n,i);if(">"==r){if(1==e){i.tokenize=d;break}return i.tokenize=t(e-1),i.tokenize(n,i)}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=f("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",e.tokenize=h,"tag bracket"):"&"==i?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function h(t,e){var n,i,r=t.next();if(">"==r||"/"==r&&t.eat(">"))return e.tokenize=d,o=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return o="equals",null;if("<"==r){e.tokenize=d,e.state=g,e.tagName=e.tagStart=null;var s=e.tokenize(t,e);return s?s+" tag error":"tag error"}return/[\'\"]/.test(r)?(e.tokenize=(n=r,(i=function(t,e){for(;!t.eol();)if(t.next()==n){e.tokenize=h;break}return"string"}).isInAttribute=!0,i),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(t,e){return function(n,i){for(;!n.eol();){if(n.match(e)){i.tokenize=d;break}n.next()}return t}}function p(t){t.context&&(t.context=t.context.prev)}function m(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(e))return;p(t)}}function g(t,e,n){return"openTag"==t?(n.tagStart=e.column(),v):"closeTag"==t?y:g}function v(t,e,n){return"word"==t?(n.tagName=e.current(),s="tag",w):(s="error",v)}function y(t,e,n){if("word"==t){var i=e.current();return n.context&&n.context.tagName!=i&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&p(n),n.context&&n.context.tagName==i||!1===l.matchClosing?(s="tag",x):(s="tag error",b)}return s="error",b}function x(t,e,n){return"endTag"!=t?(s="error",x):(p(n),g)}function b(t,e,n){return s="error",x(t,0,n)}function w(t,e,n){if("word"==t)return s="attribute",C;if("endTag"==t||"selfcloseTag"==t){var i=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(i)?m(n,i):(m(n,i),n.context=new function(t,e,n){this.prev=t.context,this.tagName=e,this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}(n,i,r==n.indented)),g}return s="error",w}function C(t,e,n){return"equals"==t?_:(l.allowMissing||(s="error"),w(t,0,n))}function _(t,e,n){return"string"==t?k:"word"==t&&l.allowUnquoted?(s="string",w):(s="error",w(t,0,n))}function k(t,e,n){return"string"==t?k:w(t,0,n)}return d.isInText=!0,{startState:function(t){var e={tokenize:d,state:g,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;o=null;var n=e.tokenize(t,e);return(n||o)&&"comment"!=n&&(s=null,e.state=e.state(o||n,t,e),s&&(n="error"==s?n+" error":s)),n},indent:function(e,n,i){var r=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+a;if(r&&r.noIndent)return t.Pass;if(e.tokenize!=h&&e.tokenize!=d)return i?i.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+a*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])for(;r;){if(r.tagName==o[2]){r=r.prev;break}if(!l.implicitlyClosed.hasOwnProperty(r.tagName))break;r=r.prev}else if(o)for(;r;){var s=l.contextGrabbers[r.tagName];if(!s||!s.hasOwnProperty(o[2]))break;r=r.prev}for(;r&&r.prev&&!r.startOfLine;)r=r.prev;return r?r.indent+a:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==_&&(t.state=w)}}}),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(0))},function(t,e,n){var i=n(0),r=(n(7),n(6));function o(t,e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.onload=function(){n.status>=200&&n.status<400?e(null,n.responseText):e("server error",null)},n.onerror=function(){e("connection error",null)},n.send()}n(5),n(0),n(27),n(5),n(4),n(26),n(25),n(24),n(21),n(19),n(17);t.exports={CodeMirror:i,CCEditor:class{constructor(t,e){this.opts=e||{},this.elt=t,this.editorelt=document.createElement("div"),this.editorelt.classList.add("cceditor"),this.elt.appendChild(this.editorelt),this.editor=i(this.editorelt,{mode:"text/x-markdown",lineNumbers:!0,lineWrapping:!0,foldGutter:!0,value:"",gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]}),this.current_href=void 0,this.players_by_target={},this.default_player=void 0,this.document=document,this.window=window,this.elt.addEventListener("click",this.clicker.bind(this)),this.elt.addEventListener("touchend",this.clicker.bind(this)),window.addEventListener("hashchange",this.hashchange.bind(this)),this.hashchange(),this.setup_keys()}clicker(t){this.opts.click&&this.opts.click.call(this,t.target.textContent,t.target.classList)}hashchange(){var t=window.location.hash;if(t){var e=t.match(/^#(.+)/);if(null!==e){var n=e[1];n!==current_href&&(current_href=n,o(n,function(t,e){t?console.log("cceditor.hashchange: ERROR",t):editor.setValue(e)}))}}}display_link(t,e){e=e||"",this.opts.click&&this.opts.click.call(this,t,e)}make_player_cell(){var t=document.createElement("div");return t.classList.add("cceditor_cell"),this.elt.appendChild(t),new r(t)}player_for_target(t){if(t){var e=this.players_by_target[t];void 0===e&&(e=this.make_player_cell(),this.players_by_target[t]=e)}else{if(document.getElementById("cceditor_default_player"))return this.default_player;(e=this.default_player=this.make_player_cell()).elt.id="cceditor_default_player"}return e}do_save(){var t=this,e=this.editor;console.log("cceditor: do_save",e,this.current_href);var n=e.getValue();this.current_href&&function(t,e,n){var i=new XMLHttpRequest;i.open("POST",t,!0),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),i.onload=function(){if(i.readyState==XMLHttpRequest.DONE&&i.status>=200&&i.status<400){var t=i.responseText;n(null,t)}else n("server error")},i.onerror=function(){n("connection error")};var r="";for(var o in e)e.hasOwnProperty(o)&&(r+=(r?"&":"")+o+"="+encodeURIComponent(e[o]));i.send(r)}(this.current_href,{text:n},function(e,n){e?(console.log("cceditor: post ERROR",e),t.opts.notie&&t.opts.notie.alert({text:"Error saving",type:"error"})):t.opts.notie&&t.opts.notie.alert({text:"Saved",type:"success"})})}setup_keys(){var t=this;this.editor.setOption("extraKeys",{"Ctrl-Down":function(e){t.opts.ctrlKey&&t.opts.ctrlKey.call(t,"down")},"Ctrl-Up":function(e){t.opts.ctrlKey&&t.opts.ctrlKey.call(t,"up")},"Ctrl-Left":function(e){t.opts.ctrlKey&&t.opts.ctrlKey.call(t,"left")},"Ctrl-Right":function(e){t.opts.ctrlKey&&t.opts.ctrlKey.call(t,"right")},"Ctrl-S":function(e){t.do_save()}})}set src(t){if(t!==this.current_href){this.current_href=t;var e=this;o(t,function(t,n){t?console.log("cceditor: ERROR",t):e.editor.setValue(n)})}}get src(){return this.current_href}getValue(){return this.editor.getValue()}replaceSelection(t){this.editor.replaceSelection(t)}},parse_fragment:function(t){if(ret={},t.indexOf("#")>=0){var e=t.split("#",2);ret.base=e[0],ret.fragment=e[1]}else ret.base=t,ret.fragment="";return ret}}},function(t,e,n){var i,r,o,s;o=window.$,(s={config:{},container:{},controls:{},errors:{},items:{},utils:{}}).utils.F=function(){},s.utils.extend=function(t,e){t.prototype=s.utils.createObject(e.prototype),t.prototype.contructor=t},s.utils.createObject=function(t){return"function"==typeof Object.create?Object.create(t):(s.utils.F.prototype=t,new s.utils.F)},s.utils.objectKeys=function(t){var e,n;if("function"==typeof Object.keys)return Object.keys(t);for(n in e=[],t)e.push(n);return e},s.utils.getHashValue=function(t){var e=location.hash.match(new RegExp(t+"=([^&]*)"));return e?e[1]:null},s.utils.getQueryStringParam=function(t){if(window.location.hash)return s.utils.getHashValue(t);if(!window.location.search)return null;var e,n,i=window.location.search.substr(1).split("&"),r={};for(n=0;n<i.length;n++)r[(e=i[n].split("="))[0]]=e[1];return r[t]||null},s.utils.copy=function(t,e){for(var n in e)t[n]=e[n];return t},s.utils.animFrame=function(t){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)})(function(){t()})},s.utils.indexOf=function(t,e){if(!(e instanceof Array))throw new Error("Haystack is not an Array");if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1},"function"!=typeof/./&&"object"!=typeof Int8Array?s.utils.isFunction=function(t){return"function"==typeof t||!1}:s.utils.isFunction=function(t){return"[object Function]"===toString.call(t)},s.utils.fnBind=function(t,e,n){if(void 0!==Function.prototype.bind)return Function.prototype.bind.apply(t,[e].concat(n||[]));var i=function(){var r=(n||[]).concat(Array.prototype.slice.call(arguments,0));if(!(this instanceof i))return t.apply(e,r);t.apply(this,r)};return i.prototype=t.prototype,i},s.utils.removeFromArray=function(t,e){var n=s.utils.indexOf(t,e);if(-1===n)throw new Error("Can't remove item from array. Item is not in the array");e.splice(n,1)},s.utils.now=function(){return"function"==typeof Date.now?Date.now():(new Date).getTime()},s.utils.getUniqueId=function(){return(1e15*Math.random()).toString(36).replace(".","")},s.utils.filterXss=function(t,e){var n=t.replace(/javascript/gi,"j&#97;vascript").replace(/expression/gi,"expr&#101;ssion").replace(/onload/gi,"onlo&#97;d").replace(/script/gi,"&#115;cript").replace(/onerror/gi,"on&#101;rror");return!0===e?n:n.replace(/>/g,"&gt;").replace(/</g,"&lt;")},s.utils.stripTags=function(t){return o.trim(t.replace(/(<([^>]+)>)/gi,""))},s.utils.EventEmitter=function(){this._mSubscriptions={},this._mSubscriptions[s.utils.EventEmitter.ALL_EVENT]=[],this.on=function(t,e,n){if(!s.utils.isFunction(e))throw new Error("Tried to listen to event "+t+" with non-function callback "+e);this._mSubscriptions[t]||(this._mSubscriptions[t]=[]),this._mSubscriptions[t].push({fn:e,ctx:n})},this.emit=function(t){var e,n,i;i=Array.prototype.slice.call(arguments,1);var r=this._mSubscriptions[t];if(r)for(r=r.slice(),e=0;e<r.length;e++)n=r[e].ctx||{},r[e].fn.apply(n,i);i.unshift(t);var o=this._mSubscriptions[s.utils.EventEmitter.ALL_EVENT].slice();for(e=0;e<o.length;e++)n=o[e].ctx||{},o[e].fn.apply(n,i)},this.unbind=function(t,e,n){if(!this._mSubscriptions[t])throw new Error("No subscribtions to unsubscribe for event "+t);var i,r=!1;for(i=0;i<this._mSubscriptions[t].length;i++)e&&this._mSubscriptions[t][i].fn!==e||n&&n!==this._mSubscriptions[t][i].ctx||(this._mSubscriptions[t].splice(i,1),r=!0);if(!1===r)throw new Error("Nothing to unbind for "+t)},this.off=this.unbind,this.trigger=this.emit},s.utils.EventEmitter.ALL_EVENT="__all",s.utils.DragListener=function(t,e){s.utils.EventEmitter.call(this),this._eElement=o(t),this._oDocument=o(document),this._eBody=o(document.body),this._nButtonCode=e||0,this._nDelay=200,this._nDistance=10,this._nX=0,this._nY=0,this._nOriginalX=0,this._nOriginalY=0,this._bDragging=!1,this._fMove=s.utils.fnBind(this.onMouseMove,this),this._fUp=s.utils.fnBind(this.onMouseUp,this),this._fDown=s.utils.fnBind(this.onMouseDown,this),this._eElement.on("mousedown touchstart",this._fDown)},s.utils.DragListener.timeout=null,s.utils.copy(s.utils.DragListener.prototype,{destroy:function(){this._eElement.unbind("mousedown touchstart",this._fDown),this._oDocument.unbind("mouseup touchend",this._fUp),this._eElement=null,this._oDocument=null,this._eBody=null},onMouseDown:function(t){if(t.preventDefault(),0==t.button||"touchstart"===t.type){var e=this._getCoordinates(t);this._nOriginalX=e.x,this._nOriginalY=e.y,this._oDocument.on("mousemove touchmove",this._fMove),this._oDocument.one("mouseup touchend",this._fUp),this._timeout=setTimeout(s.utils.fnBind(this._startDrag,this),this._nDelay)}},onMouseMove:function(t){if(null!=this._timeout){t.preventDefault();var e=this._getCoordinates(t);this._nX=e.x-this._nOriginalX,this._nY=e.y-this._nOriginalY,!1===this._bDragging&&(Math.abs(this._nX)>this._nDistance||Math.abs(this._nY)>this._nDistance)&&(clearTimeout(this._timeout),this._startDrag()),this._bDragging&&this.emit("drag",this._nX,this._nY,t)}},onMouseUp:function(t){null!=this._timeout&&(clearTimeout(this._timeout),this._eBody.removeClass("lm_dragging"),this._eElement.removeClass("lm_dragging"),this._oDocument.find("iframe").css("pointer-events",""),this._oDocument.unbind("mousemove touchmove",this._fMove),this._oDocument.unbind("mouseup touchend",this._fUp),!0===this._bDragging&&(this._bDragging=!1,this.emit("dragStop",t,this._nOriginalX+this._nX)))},_startDrag:function(){this._bDragging=!0,this._eBody.addClass("lm_dragging"),this._eElement.addClass("lm_dragging"),this._oDocument.find("iframe").css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)},_getCoordinates:function(t){return{x:(t=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0]:t).pageX,y:t.pageY}}}),s.LayoutManager=function(t,e){if(!o||"function"!=typeof o.noConflict){var n="jQuery is missing as dependency for GoldenLayout. ";throw n+='Please either expose $ on GoldenLayout\'s scope (e.g. window) or add "jquery" to ',n+="your paths when using RequireJS/AMD",new Error(n)}s.utils.EventEmitter.call(this),this.isInitialised=!1,this._isFullPage=!1,this._resizeTimeoutId=null,this._components={"lm-react-component":s.utils.ReactComponentHandler},this._itemAreas=[],this._resizeFunction=s.utils.fnBind(this._onResize,this),this._unloadFunction=s.utils.fnBind(this._onUnload,this),this._maximisedItem=null,this._maximisePlaceholder=o('<div class="lm_maximise_place"></div>'),this._creationTimeoutPassed=!1,this._subWindowsCreated=!1,this._dragSources=[],this._updatingColumnsResponsive=!1,this._firstLoad=!0,this.width=null,this.height=null,this.root=null,this.openPopouts=[],this.selectedItem=null,this.isSubWindow=!1,this.eventHub=new s.utils.EventHub(this),this.config=this._createConfig(t),this.container=e,this.dropTargetIndicator=null,this.transitionIndicator=null,this.tabDropPlaceholder=o('<div class="lm_drop_tab_placeholder"></div>'),!0===this.isSubWindow&&o("body").css("visibility","hidden"),this._typeToItem={column:s.utils.fnBind(s.items.RowOrColumn,this,[!0]),row:s.utils.fnBind(s.items.RowOrColumn,this,[!1]),stack:s.items.Stack,component:s.items.Component}},s.LayoutManager.__lm=s,s.LayoutManager.minifyConfig=function(t){return(new s.utils.ConfigMinifier).minifyConfig(t)},s.LayoutManager.unminifyConfig=function(t){return(new s.utils.ConfigMinifier).unminifyConfig(t)},s.utils.copy(s.LayoutManager.prototype,{registerComponent:function(t,e){if("function"!=typeof e)throw new Error("Please register a constructor function");if(void 0!==this._components[t])throw new Error("Component "+t+" is already registered");this._components[t]=e},toConfig:function(t){var e,n,i;if(!1===this.isInitialised)throw new Error("Can't create config, layout not yet initialised");if(t&&!(t instanceof s.items.AbstractContentItem))throw new Error("Root must be a ContentItem");for((e={settings:s.utils.copy({},this.config.settings),dimensions:s.utils.copy({},this.config.dimensions),labels:s.utils.copy({},this.config.labels)}).content=[],(n=function(t,e){var i,r;for(i in e.config)"content"!==i&&(t[i]=e.config[i]);if(e.contentItems.length)for(t.content=[],r=0;r<e.contentItems.length;r++)t.content[r]={},n(t.content[r],e.contentItems[r])})(e,t?{contentItems:[t]}:this.root),this._$reconcilePopoutWindows(),e.openPopouts=[],i=0;i<this.openPopouts.length;i++)e.openPopouts.push(this.openPopouts[i].toConfig());return e.maximisedItemId=this._maximisedItem?"__glMaximised":null,e},getComponent:function(t){if(void 0===this._components[t])throw new s.errors.ConfigurationError('Unknown component "'+t+'"');return this._components[t]},init:function(){if(!1===this._subWindowsCreated&&(this._createSubWindows(),this._subWindowsCreated=!0),"loading"!==document.readyState&&null!==document.body){if(!0===this.isSubWindow&&!1===this._creationTimeoutPassed)return setTimeout(s.utils.fnBind(this.init,this),7),void(this._creationTimeoutPassed=!0);!0===this.isSubWindow&&this._adjustToWindowMode(),this._setContainer(),this.dropTargetIndicator=new s.controls.DropTargetIndicator(this.container),this.transitionIndicator=new s.controls.TransitionIndicator,this.updateSize(),this._create(this.config),this._bindEvents(),this.isInitialised=!0,this._adjustColumnsResponsive(),this.emit("initialised")}else o(document).ready(s.utils.fnBind(this.init,this))},updateSize:function(t,e){2===arguments.length?(this.width=t,this.height=e):(this.width=this.container.width(),this.height=this.container.height()),!0===this.isInitialised&&(this.root.callDownwards("setSize",[this.width,this.height]),this._maximisedItem&&(this._maximisedItem.element.width(this.container.width()),this._maximisedItem.element.height(this.container.height()),this._maximisedItem.callDownwards("setSize")),this._adjustColumnsResponsive())},destroy:function(){!1!==this.isInitialised&&(this._onUnload(),o(window).off("resize",this._resizeFunction),o(window).off("unload beforeunload",this._unloadFunction),this.root.callDownwards("_$destroy",[],!0),this.root.contentItems=[],this.tabDropPlaceholder.remove(),this.dropTargetIndicator.destroy(),this.transitionIndicator.destroy(),this.eventHub.destroy(),this._dragSources.forEach(function(t){t._dragListener.destroy(),t._element=null,t._itemConfig=null,t._dragListener=null}),this._dragSources=[])},createContentItem:function(t,e){var n;if("string"!=typeof t.type)throw new s.errors.ConfigurationError("Missing parameter 'type'",t);if("react-component"===t.type&&(t.type="component",t.componentName="lm-react-component"),!this._typeToItem[t.type])throw n="Unknown type '"+t.type+"'. Valid types are "+s.utils.objectKeys(this._typeToItem).join(","),new s.errors.ConfigurationError(n);return"component"!==t.type||e instanceof s.items.Stack||!e||!0===this.isSubWindow&&e instanceof s.items.Root||(t={type:"stack",width:t.width,height:t.height,content:[t]}),new this._typeToItem[t.type](this,t,e)},createPopout:function(t,e,n,i){var r,o,a,l,c,u,d=t,h=t instanceof s.items.AbstractContentItem,f=this;if(n=n||null,h){for(d=this.toConfig(t).content,n=s.utils.getUniqueId(),l=t.parent,c=t;1===l.contentItems.length&&!l.isRoot;)l=l.parent,c=c.parent;l.addId(n),isNaN(i)&&(i=s.utils.indexOf(c,l.contentItems))}else d instanceof Array||(d=[d]);return!e&&h&&(r=window.screenX||window.screenLeft,o=window.screenY||window.screenTop,e={left:r+(a=t.element.offset()).left,top:o+a.top,width:t.element.width(),height:t.element.height()}),e||h||(e={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),h&&t.remove(),(u=new s.controls.BrowserPopout(d,e,n,i,this)).on("initialised",function(){f.emit("windowOpened",u)}),u.on("closed",function(){f._$reconcilePopoutWindows()}),this.openPopouts.push(u),u},createDragSource:function(t,e){this.config.settings.constrainDragToContainer=!1;var n=new s.controls.DragSource(o(t),e,this);return this._dragSources.push(n),n},selectItem:function(t,e){if(!0!==this.config.settings.selectionEnabled)throw new Error("Please set selectionEnabled to true to use this feature");t!==this.selectedItem&&(null!==this.selectedItem&&this.selectedItem.deselect(),t&&!0!==e&&t.select(),this.selectedItem=t,this.emit("selectionChanged",t))},_$maximiseItem:function(t){null!==this._maximisedItem&&this._$minimiseItem(this._maximisedItem),this._maximisedItem=t,this._maximisedItem.addId("__glMaximised"),t.element.addClass("lm_maximised"),t.element.after(this._maximisePlaceholder),this.root.element.prepend(t.element),t.element.width(this.container.width()),t.element.height(this.container.height()),t.callDownwards("setSize"),this._maximisedItem.emit("maximised"),this.emit("stateChanged")},_$minimiseItem:function(t){t.element.removeClass("lm_maximised"),t.removeId("__glMaximised"),this._maximisePlaceholder.after(t.element),this._maximisePlaceholder.remove(),t.parent.callDownwards("setSize"),this._maximisedItem=null,t.emit("minimised"),this.emit("stateChanged")},_$closeWindow:function(){window.setTimeout(function(){window.close()},1)},_$getArea:function(t,e){var n,i,r=1/0,o=null;for(n=0;n<this._itemAreas.length;n++)t>(i=this._itemAreas[n]).x1&&t<i.x2&&e>i.y1&&e<i.y2&&r>i.surface&&(r=i.surface,o=i);return o},_$createRootItemAreas:function(){var t={y2:0,x2:0,y1:"y2",x1:"x2"};for(var e in t){var n=this.root._$getArea();n.side=e,n[e]=t[e]?n[t[e]]-50:50,n.surface=(n.x2-n.x1)*(n.y2-n.y1),this._itemAreas.push(n)}},_$calculateItemAreas:function(){var t,e,n=this._getAllContentItems();if(this._itemAreas=[],1!==n.length){for(this._$createRootItemAreas(),t=0;t<n.length;t++)if(n[t].isStack&&null!==(e=n[t]._$getArea()))if(e instanceof Array)this._itemAreas=this._itemAreas.concat(e);else{this._itemAreas.push(e);var i={};s.utils.copy(i,e),s.utils.copy(i,e.contentItem._contentAreaDimensions.header.highlightArea),i.surface=(i.x2-i.x1)*(i.y2-i.y1),this._itemAreas.push(i)}}else this._itemAreas.push(this.root._$getArea())},_$normalizeContentItem:function(t,e){if(!t)throw new Error("No content item defined");if(s.utils.isFunction(t)&&(t=t()),t instanceof s.items.AbstractContentItem)return t;if(o.isPlainObject(t)&&t.type){var n=this.createContentItem(t,e);return n.callDownwards("_$init"),n}throw new Error("Invalid contentItem")},_$reconcilePopoutWindows:function(){var t,e=[];for(t=0;t<this.openPopouts.length;t++)!1===this.openPopouts[t].getWindow().closed?e.push(this.openPopouts[t]):this.emit("windowClosed",this.openPopouts[t]);this.openPopouts.length!==e.length&&(this.emit("stateChanged"),this.openPopouts=e)},_getAllContentItems:function(){var t=[],e=function(n){if(t.push(n),n.contentItems instanceof Array)for(var i=0;i<n.contentItems.length;i++)e(n.contentItems[i])};return e(this.root),t},_bindEvents:function(){this._isFullPage&&o(window).resize(this._resizeFunction),o(window).on("unload beforeunload",this._unloadFunction)},_onResize:function(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=setTimeout(s.utils.fnBind(this.updateSize,this),100)},_createConfig:function(t){var e=s.utils.getQueryStringParam("gl-window");e&&(this.isSubWindow=!0,t=localStorage.getItem(e),t=JSON.parse(t),t=(new s.utils.ConfigMinifier).unminifyConfig(t),localStorage.removeItem(e)),t=o.extend(!0,{},s.config.defaultConfig,t);var n=function(t){for(var e in t)"props"!==e&&"object"==typeof t[e]?n(t[e]):"type"===e&&"react-component"===t[e]&&(t.type="component",t.componentName="lm-react-component")};return n(t),!1===t.settings.hasHeaders&&(t.dimensions.headerHeight=0),t},_adjustToWindowMode:function(){var t=o('<div class="lm_popin" title="'+this.config.labels.popin+'"><div class="lm_icon"></div><div class="lm_bg"></div></div>');t.click(s.utils.fnBind(function(){this.emit("popIn")},this)),document.title=s.utils.stripTags(this.config.content[0].title),o("head").append(o("body link, body style, template, .gl_keep")),this.container=o("body").html("").css("visibility","visible").append(t),document.body.offsetHeight,window.__glInstance=this},_createSubWindows:function(){var t,e;for(t=0;t<this.config.openPopouts.length;t++)e=this.config.openPopouts[t],this.createPopout(e.content,e.dimensions,e.parentId,e.indexInParent)},_setContainer:function(){var t=o(this.container||"body");if(0===t.length)throw new Error("GoldenLayout container not found");if(t.length>1)throw new Error("GoldenLayout more than one container element specified");t[0]===document.body&&(this._isFullPage=!0,o("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"})),this.container=t},_create:function(t){var e;if(!(t.content instanceof Array))throw e=void 0===t.content?"Missing setting 'content' on top level of configuration":"Configuration parameter 'content' must be an array",new s.errors.ConfigurationError(e,t);if(t.content.length>1)throw e="Top level content can't contain more then one element.",new s.errors.ConfigurationError(e,t);this.root=new s.items.Root(this,{content:t.content},this.container),this.root.callDownwards("_$init"),"__glMaximised"===t.maximisedItemId&&this.root.getItemsById(t.maximisedItemId)[0].toggleMaximise()},_onUnload:function(){if(!0===this.config.settings.closePopoutsOnUnload)for(var t=0;t<this.openPopouts.length;t++)this.openPopouts[t].close()},_adjustColumnsResponsive:function(){if(this._useResponsiveLayout()&&!this._updatingColumnsResponsive&&this.config.dimensions&&this.config.dimensions.minItemWidth&&0!==this.root.contentItems.length&&this.root.contentItems[0].isRow){this._firstLoad=!1;var t=this.root.contentItems[0].contentItems.length;if(!(t<=1)){var e=this.config.dimensions.minItemWidth;if(!(t*e<=this.width)){this._updatingColumnsResponsive=!0;for(var n=t-Math.max(Math.floor(this.width/e),1),i=this.root.contentItems[0],r=this._findAllStackContainers()[0],o=0;o<n;o++){var s=i.contentItems[i.contentItems.length-1];this._addChildContentItemsToContainer(r,s)}this._updatingColumnsResponsive=!1}}}else this._firstLoad=!1},_useResponsiveLayout:function(){return this.config.settings&&("always"==this.config.settings.responsiveMode||"onload"==this.config.settings.responsiveMode&&this._firstLoad)},_addChildContentItemsToContainer:function(t,e){"stack"===e.type?e.contentItems.forEach(function(n){t.addChild(n),e.removeChild(n,!0)}):e.contentItems.forEach(s.utils.fnBind(function(e){this._addChildContentItemsToContainer(t,e)},this))},_findAllStackContainers:function(){var t=[];return this._findAllStackContainersRecursive(t,this.root),t},_findAllStackContainersRecursive:function(t,e){e.contentItems.forEach(s.utils.fnBind(function(e){"stack"==e.type?t.push(e):e.isComponent||this._findAllStackContainersRecursive(t,e)},this))}}),i=[n(3)],void 0===(r=function(t){return o=t,s.LayoutManager}.apply(e,i))||(t.exports=r),s.config.itemDefaultConfig={isClosable:!0,reorderEnabled:!0,title:""},s.config.defaultConfig={openPopouts:[],settings:{hasHeaders:!0,constrainDragToContainer:!0,reorderEnabled:!0,selectionEnabled:!1,popoutWholeStack:!1,blockedPopoutsThrowError:!0,closePopoutsOnUnload:!0,showPopoutIcon:!0,showMaximiseIcon:!0,showCloseIcon:!0,responsiveMode:"onload",tabOverlapAllowance:0,reorderOnTabMenuClick:!0,tabControlOffset:10},dimensions:{borderWidth:5,borderGrabWidth:15,minItemHeight:10,minItemWidth:10,headerHeight:20,dragProxyWidth:300,dragProxyHeight:200},labels:{close:"close",maximise:"maximise",minimise:"minimise",popout:"open in new window",popin:"pop in",tabDropdown:"additional tabs"}},s.container.ItemContainer=function(t,e,n){s.utils.EventEmitter.call(this),this.width=null,this.height=null,this.title=t.componentName,this.parent=e,this.layoutManager=n,this.isHidden=!1,this._config=t,this._element=o(['<div class="lm_item_container">','<div class="lm_content"></div>',"</div>"].join("")),this._contentElement=this._element.find(".lm_content")},s.utils.copy(s.container.ItemContainer.prototype,{getElement:function(){return this._contentElement},hide:function(){this.emit("hide"),this.isHidden=!0,this._element.hide()},show:function(){this.emit("show"),this.isHidden=!1,this._element.show(),0==this.height&&0==this.width||this.emit("shown")},setSize:function(t,e){for(var n,i,r,o,s=this.parent,a=this;!s.isColumn&&!s.isRow;)if(a=s,(s=s.parent).isRoot)return!1;for(n=("height"==(i=s.isColumn?"height":"width")?e:t)/(this[i]*(1/(a.config[i]/100)))*100,r=(a.config[i]-n)/(s.contentItems.length-1),o=0;o<s.contentItems.length;o++)s.contentItems[o]===a?s.contentItems[o].config[i]=n:s.contentItems[o].config[i]+=r;return s.callDownwards("setSize"),!0},close:function(){this._config.isClosable&&(this.emit("close"),this.parent.close())},getState:function(){return this._config.componentState},extendState:function(t){this.setState(o.extend(!0,this.getState(),t))},setState:function(t){this._config.componentState=t,this.parent.emitBubblingEvent("stateChanged")},setTitle:function(t){this.parent.setTitle(t)},_$setSize:function(t,e){if(t!==this.width||e!==this.height){this.width=t,this.height=e;var n=this._contentElement[0],i=n.offsetWidth-n.clientWidth,r=n.offsetHeight-n.clientHeight;this._contentElement.width(this.width-i).height(this.height-r),this.emit("resize")}}}),s.controls.BrowserPopout=function(t,e,n,i,r){s.utils.EventEmitter.call(this),this.isInitialised=!1,this._config=t,this._dimensions=e,this._parentId=n,this._indexInParent=i,this._layoutManager=r,this._popoutWindow=null,this._id=null,this._createWindow()},s.utils.copy(s.controls.BrowserPopout.prototype,{toConfig:function(){if(!1===this.isInitialised)throw new Error("Can't create config, layout not yet initialised");return{dimensions:{width:this.getGlInstance().width,height:this.getGlInstance().height,left:this._popoutWindow.screenX||this._popoutWindow.screenLeft,top:this._popoutWindow.screenY||this._popoutWindow.screenTop},content:this.getGlInstance().toConfig().content,parentId:this._parentId,indexInParent:this._indexInParent}},getGlInstance:function(){return this._popoutWindow.__glInstance},getWindow:function(){return this._popoutWindow},close:function(){if(this.getGlInstance())this.getGlInstance()._$closeWindow();else try{this.getWindow().close()}catch(t){}},popIn:function(){var t,e;this._indexInParent,this._parentId&&(t=o.extend(!0,{},this.getGlInstance().toConfig()).content[0],(e=this._layoutManager.root.getItemsById(this._parentId)[0])||(e=this._layoutManager.root.contentItems.length>0?this._layoutManager.root.contentItems[0]:this._layoutManager.root)),e.addChild(t,this._indexInParent),this.close()},_createWindow:function(){var t,e=this._createUrl(),n=Math.floor(1e6*Math.random()).toString(36),i=this._serializeWindowOptions({width:this._dimensions.width,height:this._dimensions.height,innerWidth:this._dimensions.width,innerHeight:this._dimensions.height,menubar:"no",toolbar:"no",location:"no",personalbar:"no",resizable:"yes",scrollbars:"no",status:"no"});if(this._popoutWindow=window.open(e,n,i),this._popoutWindow)o(this._popoutWindow).on("load",s.utils.fnBind(this._positionWindow,this)).on("unload beforeunload",s.utils.fnBind(this._onClose,this)),t=setInterval(s.utils.fnBind(function(){this._popoutWindow.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),clearInterval(t))},this),10);else if(!0===this._layoutManager.config.settings.blockedPopoutsThrowError){var r=new Error("Popout blocked");throw r.type="popoutBlocked",r}},_serializeWindowOptions:function(t){var e,n=[];for(e in t)n.push(e+"="+t[e]);return n.join(",")},_createUrl:function(){var t,e={content:this._config},n="gl-window-config-"+s.utils.getUniqueId();e=(new s.utils.ConfigMinifier).minifyConfig(e);try{localStorage.setItem(n,JSON.stringify(e))}catch(t){throw new Error("Error while writing to localStorage "+t.toString())}return 1===(t=document.location.href.split("?")).length?t[0]+"?gl-window="+n:document.location.href+"&gl-window="+n},_positionWindow:function(){this._popoutWindow.moveTo(this._dimensions.left,this._dimensions.top),this._popoutWindow.focus()},_onInitialised:function(){this.isInitialised=!0,this.getGlInstance().on("popIn",this.popIn,this),this.emit("initialised")},_onClose:function(){setTimeout(s.utils.fnBind(this.emit,this,["closed"]),50)}}),s.controls.DragProxy=function(t,e,n,i,r,a){s.utils.EventEmitter.call(this),this._dragListener=n,this._layoutManager=i,this._contentItem=r,this._originalParent=a,this._area=null,this._lastValidArea=null,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this.element=o(s.controls.DragProxy._template),a&&a._side&&(this._sided=a._sided,this.element.addClass("lm_"+a._side),["right","bottom"].indexOf(a._side)>=0&&this.element.find(".lm_content").after(this.element.find(".lm_header"))),this.element.css({left:t,top:e}),this.element.find(".lm_tab").attr("title",s.utils.stripTags(this._contentItem.config.title)),this.element.find(".lm_title").html(this._contentItem.config.title),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(r.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),this._setDimensions(),o(document.body).append(this.element);var l=this._layoutManager.container.offset();this._minX=l.left,this._minY=l.top,this._maxX=this._layoutManager.container.width()+this._minX,this._maxY=this._layoutManager.container.height()+this._minY,this._width=this.element.width(),this._height=this.element.height(),this._setDropPosition(t,e)},s.controls.DragProxy._template='<div class="lm_dragProxy"><div class="lm_header"><ul class="lm_tabs"><li class="lm_tab lm_active"><i class="lm_left"></i><span class="lm_title"></span><i class="lm_right"></i></li></ul></div><div class="lm_content"></div></div>',s.utils.copy(s.controls.DragProxy.prototype,{_onDrag:function(t,e,n){var i=(n=n.originalEvent&&n.originalEvent.touches?n.originalEvent.touches[0]:n).pageX,r=n.pageY;(i>this._minX&&i<this._maxX&&r>this._minY&&r<this._maxY||!0!==this._layoutManager.config.settings.constrainDragToContainer)&&this._setDropPosition(i,r)},_setDropPosition:function(t,e){this.element.css({left:t,top:e}),this._area=this._layoutManager._$getArea(t,e),null!==this._area&&(this._lastValidArea=this._area,this._area.contentItem._$highlightDropZone(t,e,this._area))},_onDrop:function(){this._layoutManager.dropTargetIndicator.hide(),null!==this._area?this._area.contentItem._$onDrop(this._contentItem,this._area):null!==this._lastValidArea?this._lastValidArea.contentItem._$onDrop(this._contentItem,this._lastValidArea):this._originalParent?this._originalParent.addChild(this._contentItem):this._contentItem._$destroy(),this.element.remove(),this._layoutManager.emit("itemDropped",this._contentItem)},_updateTree:function(){this._contentItem.parent&&this._contentItem.parent.removeChild(this._contentItem,!0),this._contentItem._$setParent(this)},_setDimensions:function(){var t=this._layoutManager.config.dimensions,e=t.dragProxyWidth,n=t.dragProxyHeight;this.element.width(e),this.element.height(n),e-=this._sided?t.headerHeight:0,n-=this._sided?0:t.headerHeight,this.childElementContainer.width(e),this.childElementContainer.height(n),this._contentItem.element.width(e),this._contentItem.element.height(n),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}),s.controls.DragSource=function(t,e,n){this._element=t,this._itemConfig=e,this._layoutManager=n,this._dragListener=null,this._createDragListener()},s.utils.copy(s.controls.DragSource.prototype,{_createDragListener:function(){null!==this._dragListener&&this._dragListener.destroy(),this._dragListener=new s.utils.DragListener(this._element),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this)},_onDragStart:function(t,e){var n=this._itemConfig;s.utils.isFunction(n)&&(n=n());var i=this._layoutManager._$normalizeContentItem(o.extend(!0,{},n)),r=new s.controls.DragProxy(t,e,this._dragListener,this._layoutManager,i,null);this._layoutManager.transitionIndicator.transitionElements(this._element,r.element)}}),s.controls.DropTargetIndicator=function(){this.element=o(s.controls.DropTargetIndicator._template),o(document.body).append(this.element)},s.controls.DropTargetIndicator._template='<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>',s.utils.copy(s.controls.DropTargetIndicator.prototype,{destroy:function(){this.element.remove()},highlight:function(t,e,n,i){this.highlightArea({x1:t,y1:e,x2:n,y2:i})},highlightArea:function(t){this.element.css({left:t.x1,top:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}).show()},hide:function(){this.element.hide()}}),s.controls.Header=function(t,e){s.utils.EventEmitter.call(this),this.layoutManager=t,this.element=o(s.controls.Header._template),!0===this.layoutManager.config.settings.selectionEnabled&&(this.element.addClass("lm_selectable"),this.element.on("click touchstart",s.utils.fnBind(this._onHeaderClick,this))),this.tabsContainer=this.element.find(".lm_tabs"),this.tabDropdownContainer=this.element.find(".lm_tabdropdown_list"),this.tabDropdownContainer.hide(),this.controlsContainer=this.element.find(".lm_controls"),this.parent=e,this.parent.on("resize",this._updateTabSizes,this),this.tabs=[],this.activeContentItem=null,this.closeButton=null,this.tabDropdownButton=null,this.hideAdditionalTabsDropdown=s.utils.fnBind(this._hideAdditionalTabsDropdown,this),o(document).mouseup(this.hideAdditionalTabsDropdown),this._lastVisibleTabIndex=-1,this._tabControlOffset=this.layoutManager.config.settings.tabControlOffset,this._createControls()},s.controls.Header._template=['<div class="lm_header">','<ul class="lm_tabs"></ul>','<ul class="lm_controls"></ul>','<ul class="lm_tabdropdown_list"></ul>',"</div>"].join(""),s.utils.copy(s.controls.Header.prototype,{createTab:function(t,e){var n,i;for(i=0;i<this.tabs.length;i++)if(this.tabs[i].contentItem===t)return;if(n=new s.controls.Tab(this,t),0===this.tabs.length)return this.tabs.push(n),void this.tabsContainer.append(n.element);void 0===e&&(e=this.tabs.length),e>0?this.tabs[e-1].element.after(n.element):this.tabs[0].element.before(n.element),this.tabs.splice(e,0,n),this._updateTabSizes()},removeTab:function(t){for(var e=0;e<this.tabs.length;e++)if(this.tabs[e].contentItem===t)return this.tabs[e]._$destroy(),void this.tabs.splice(e,1);throw new Error("contentItem is not controlled by this header")},setActiveContentItem:function(t){var e,n,i,r;for(e=0;e<this.tabs.length;e++)i=this.tabs[e].contentItem===t,this.tabs[e].setActive(i),!0===i&&(this.activeContentItem=t,this.parent.config.activeItemIndex=e);if(this.layoutManager.config.settings.reorderOnTabMenuClick&&-1!==this._lastVisibleTabIndex&&this.parent.config.activeItemIndex>this._lastVisibleTabIndex){for(r=this.tabs[this.parent.config.activeItemIndex],n=this.parent.config.activeItemIndex;n>0;n--)this.tabs[n]=this.tabs[n-1];this.tabs[0]=r,this.parent.config.activeItemIndex=0}this._updateTabSizes(),this.parent.emitBubblingEvent("stateChanged")},position:function(t){var e=this.parent._header.show;return e&&!this.parent._side&&(e="top"),void 0!==t&&this.parent._header.show!=t&&(this.parent._header.show=t,this.parent._setupHeaderPosition()),e},_$setClosable:function(t){return!(!this.closeButton||!this._isClosable()||(this.closeButton.element[t?"show":"hide"](),0))},_$destroy:function(){this.emit("destroy",this);for(var t=0;t<this.tabs.length;t++)this.tabs[t]._$destroy();o(document).off("mouseup",this.hideAdditionalTabsDropdown),this.element.remove()},_getHeaderSetting:function(t){if(t in this.parent._header)return this.parent._header[t]},_createControls:function(){var t,e,n,i,r,o,a,l,c;c=s.utils.fnBind(this._showAdditionalTabsDropdown,this),l=this.layoutManager.config.labels.tabDropdown,this.tabDropdownButton=new s.controls.HeaderButton(this,l,"lm_tabdropdown",c),this.tabDropdownButton.element.hide(),this._getHeaderSetting("popout")&&(e=s.utils.fnBind(this._onPopoutClick,this),n=this._getHeaderSetting("popout"),new s.controls.HeaderButton(this,n,"lm_popout",e)),this._getHeaderSetting("maximise")&&(o=s.utils.fnBind(this.parent.toggleMaximise,this.parent),i=this._getHeaderSetting("maximise"),r=this._getHeaderSetting("minimise"),a=new s.controls.HeaderButton(this,i,"lm_maximise",o),this.parent.on("maximised",function(){a.element.attr("title",r)}),this.parent.on("minimised",function(){a.element.attr("title",i)})),this._isClosable()&&(t=s.utils.fnBind(this.parent.remove,this.parent),n=this._getHeaderSetting("close"),this.closeButton=new s.controls.HeaderButton(this,n,"lm_close",t))},_showAdditionalTabsDropdown:function(){this.tabDropdownContainer.show()},_hideAdditionalTabsDropdown:function(t){this.tabDropdownContainer.hide()},_isClosable:function(){return this.parent.config.isClosable&&this.layoutManager.config.settings.showCloseIcon},_onPopoutClick:function(){!0===this.layoutManager.config.settings.popoutWholeStack?this.parent.popout():this.activeContentItem.popout()},_onHeaderClick:function(t){t.target===this.element[0]&&this.parent.select()},_updateTabSizes:function(t){if(0!==this.tabs.length){this.tabDropdownButton.element.toggle(!0===t);var e=function(t){return t?"width":"height"};this.element.css(e(!this.parent._sided),""),this.element[e(this.parent._sided)](this.layoutManager.config.dimensions.headerHeight);var n,i,r,o,s=this.element.outerWidth()-this.controlsContainer.outerWidth()-this._tabControlOffset,a=0,l=0,c=0,u=this.layoutManager.config.settings.tabOverlapAllowance,d=!1,h=this.activeContentItem?this.tabs.indexOf(this.activeContentItem.tab):0,f=this.tabs[h];for(this.parent._sided&&(s=this.element.outerHeight()-this.controlsContainer.outerHeight()-this._tabControlOffset),this._lastVisibleTabIndex=-1,i=0;i<this.tabs.length;i++)if(n=this.tabs[i].element,this.tabsContainer.append(n),a+=n.outerWidth()+parseInt(n.css("margin-right"),10),(l=h<=i?a:a+f.element.outerWidth()+parseInt(f.element.css("margin-right"),10))>s){if(d)i===h&&(n.css({"z-index":"auto","margin-left":""}),this.tabsContainer.append(n));else if((c=h>0&&h<=i?(l-s)/(i-1):(l-s)/i)<u){for(r=0;r<=i;r++)o=r!==h&&0!==r?"-"+c+"px":"",this.tabs[r].element.css({"z-index":i-r,"margin-left":o});this._lastVisibleTabIndex=i,this.tabsContainer.append(n)}else d=!0;if(d&&i!==h){if(!t)return void this._updateTabSizes(!0);n.css({"z-index":"auto","margin-left":""}),this.tabDropdownContainer.append(n)}}else this._lastVisibleTabIndex=i,n.css({"z-index":"auto","margin-left":""}),this.tabsContainer.append(n)}}}),s.controls.HeaderButton=function(t,e,n,i){this._header=t,this.element=o('<li class="'+n+'" title="'+e+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=i,this.element.on("click touchstart",this._action),this._header.controlsContainer.append(this.element)},s.utils.copy(s.controls.HeaderButton.prototype,{_$destroy:function(){this.element.off(),this.element.remove()}}),s.controls.Splitter=function(t,e,n){this._isVertical=t,this._size=e,this._grabSize=n<e?e:n,this.element=this._createElement(),this._dragListener=new s.utils.DragListener(this.element)},s.utils.copy(s.controls.Splitter.prototype,{on:function(t,e,n){this._dragListener.on(t,e,n)},_$destroy:function(){this.element.remove()},_createElement:function(){var t=o('<div class="lm_drag_handle"></div>'),e=o('<div class="lm_splitter"></div>');e.append(t);var n=this._grabSize-this._size,i=n/2;return this._isVertical?(t.css("top",-i),t.css("height",this._size+n),e.addClass("lm_vertical"),e.height(this._size)):(t.css("left",-i),t.css("width",this._size+n),e.addClass("lm_horizontal"),e.width(this._size)),e}}),s.controls.Tab=function(t,e){this.header=t,this.contentItem=e,this.element=o(s.controls.Tab._template),this.titleElement=this.element.find(".lm_title"),this.closeElement=this.element.find(".lm_close_tab"),this.closeElement[e.config.isClosable?"show":"hide"](),this.isActive=!1,this.setTitle(e.config.title),this.contentItem.on("titleChanged",this.setTitle,this),this._layoutManager=this.contentItem.layoutManager,!0===this._layoutManager.config.settings.reorderEnabled&&!0===e.config.reorderEnabled&&(this._dragListener=new s.utils.DragListener(this.element),this._dragListener.on("dragStart",this._onDragStart,this),this.contentItem.on("destroy",this._dragListener.destroy,this._dragListener)),this._onTabClickFn=s.utils.fnBind(this._onTabClick,this),this._onCloseClickFn=s.utils.fnBind(this._onCloseClick,this),this.element.on("mousedown touchstart",this._onTabClickFn),this.contentItem.config.isClosable?(this.closeElement.on("click touchstart",this._onCloseClickFn),this.closeElement.on("mousedown",this._onCloseMousedown)):this.closeElement.remove(),this.contentItem.tab=this,this.contentItem.emit("tab",this),this.contentItem.layoutManager.emit("tabCreated",this),this.contentItem.isComponent&&(this.contentItem.container.tab=this,this.contentItem.container.emit("tab",this))},s.controls.Tab._template='<li class="lm_tab"><i class="lm_left"></i><span class="lm_title"></span><div class="lm_close_tab"></div><i class="lm_right"></i></li>',s.utils.copy(s.controls.Tab.prototype,{setTitle:function(t){this.element.attr("title",s.utils.stripTags(t)),this.titleElement.html(t)},setActive:function(t){t!==this.isActive&&(this.isActive=t,t?this.element.addClass("lm_active"):this.element.removeClass("lm_active"))},_$destroy:function(){this.element.off("mousedown touchstart",this._onTabClickFn),this.closeElement.off("click touchstart",this._onCloseClickFn),this._dragListener&&(this.contentItem.off("destroy",this._dragListener.destroy,this._dragListener),this._dragListener.off("dragStart",this._onDragStart),this._dragListener=null),this.element.remove()},_onDragStart:function(t,e){!0===this.contentItem.parent.isMaximised&&this.contentItem.parent.toggleMaximise(),new s.controls.DragProxy(t,e,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)},_onTabClick:function(t){if(0===t.button||"touchstart"===t.type){var e=this.header.parent.getActiveContentItem();this.contentItem!==e&&this.header.parent.setActiveContentItem(this.contentItem)}else 1===t.button&&this.contentItem.config.isClosable&&this._onCloseClick(t)},_onCloseClick:function(t){t.stopPropagation(),this.header.parent.removeChild(this.contentItem)},_onCloseMousedown:function(t){t.stopPropagation()}}),s.controls.TransitionIndicator=function(){this._element=o('<div class="lm_transition_indicator"></div>'),o(document.body).append(this._element),this._toElement=null,this._fromDimensions=null,this._totalAnimationDuration=200,this._animationStartTime=null},s.utils.copy(s.controls.TransitionIndicator.prototype,{destroy:function(){this._element.remove()},transitionElements:function(t,e){},_nextAnimationFrame:function(){var t,e=this._measure(this._toElement),n=(s.utils.now()-this._animationStartTime)/this._totalAnimationDuration,i={};if(n>=1)this._element.hide();else{for(t in e.opacity=0,this._fromDimensions)i[t]=this._fromDimensions[t]+(e[t]-this._fromDimensions[t])*n;this._element.css(i),s.utils.animFrame(s.utils.fnBind(this._nextAnimationFrame,this))}},_measure:function(t){var e=t.offset();return{left:e.left,top:e.top,width:t.outerWidth(),height:t.outerHeight()}}}),s.errors.ConfigurationError=function(t,e){Error.call(this),this.name="Configuration Error",this.message=t,this.node=e},s.errors.ConfigurationError.prototype=new Error,s.items.AbstractContentItem=function(t,e,n){s.utils.EventEmitter.call(this),this.config=this._extendItemNode(e),this.type=e.type,this.contentItems=[],this.parent=n,this.isInitialised=!1,this.isMaximised=!1,this.isRoot=!1,this.isRow=!1,this.isColumn=!1,this.isStack=!1,this.isComponent=!1,this.layoutManager=t,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(s.utils.EventEmitter.ALL_EVENT,this._propagateEvent,this),e.content&&this._createContentItems(e)},s.utils.copy(s.items.AbstractContentItem.prototype,{setSize:function(){throw new Error("Abstract Method")},callDownwards:function(t,e,n,i){var r;for(!0!==n&&!0!==i&&this[t].apply(this,e||[]),r=0;r<this.contentItems.length;r++)this.contentItems[r].callDownwards(t,e,n);!0===n&&!0!==i&&this[t].apply(this,e||[])},removeChild:function(t,e){var n=s.utils.indexOf(t,this.contentItems);if(-1===n)throw new Error("Can't remove child item. Unknown content item");!0!==e&&this.contentItems[n]._$destroy(),this.contentItems.splice(n,1),this.config.content.splice(n,1),this.contentItems.length>0?this.callDownwards("setSize"):this instanceof s.items.Root||!0!==this.config.isClosable||this.parent.removeChild(this)},addChild:function(t,e){void 0===e&&(e=this.contentItems.length),this.contentItems.splice(e,0,t),void 0===this.config.content&&(this.config.content=[]),this.config.content.splice(e,0,t.config),t.parent=this,!0===t.parent.isInitialised&&!1===t.isInitialised&&t._$init()},replaceChild:function(t,e,n){e=this.layoutManager._$normalizeContentItem(e);var i=s.utils.indexOf(t,this.contentItems),r=t.element[0].parentNode;if(-1===i)throw new Error("Can't replace child. oldChild is not child of this");r.replaceChild(e.element[0],t.element[0]),!0===n&&(t.parent=null,t._$destroy()),this.contentItems[i]=e,e.parent=this,this.isStack&&(this.header.tabs[i].contentItem=e),!0===e.parent.isInitialised&&!1===e.isInitialised&&e._$init(),this.callDownwards("setSize")},remove:function(){this.parent.removeChild(this)},popout:function(){var t=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),t},toggleMaximise:function(t){t&&t.preventDefault(),!0===this.isMaximised?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")},select:function(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))},deselect:function(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))},setTitle:function(t){this.config.title=t,this.emit("titleChanged",t),this.emit("stateChanged")},hasId:function(t){return!!this.config.id&&("string"==typeof this.config.id?this.config.id===t:this.config.id instanceof Array?-1!==s.utils.indexOf(t,this.config.id):void 0)},addId:function(t){this.hasId(t)||(this.config.id?"string"==typeof this.config.id?this.config.id=[this.config.id,t]:this.config.id instanceof Array&&this.config.id.push(t):this.config.id=t)},removeId:function(t){if(!this.hasId(t))throw new Error("Id not found");if("string"==typeof this.config.id)delete this.config.id;else if(this.config.id instanceof Array){var e=s.utils.indexOf(t,this.config.id);this.config.id.splice(e,1)}},getItemsByFilter:function(t){var e=[],n=function(i){for(var r=0;r<i.contentItems.length;r++)!0===t(i.contentItems[r])&&e.push(i.contentItems[r]),n(i.contentItems[r])};return n(this),e},getItemsById:function(t){return this.getItemsByFilter(function(e){return e.config.id instanceof Array?-1!==s.utils.indexOf(t,e.config.id):e.config.id===t})},getItemsByType:function(t){return this._$getItemsByProperty("type",t)},getComponentsByName:function(t){var e,n=this._$getItemsByProperty("componentName",t),i=[];for(e=0;e<n.length;e++)i.push(n[e].instance);return i},_$getItemsByProperty:function(t,e){return this.getItemsByFilter(function(n){return n[t]===e})},_$setParent:function(t){this.parent=t},_$highlightDropZone:function(t,e,n){this.layoutManager.dropTargetIndicator.highlightArea(n)},_$onDrop:function(t){this.addChild(t)},_$hide:function(){this._callOnActiveComponents("hide"),this.element.hide(),this.layoutManager.updateSize()},_$show:function(){this._callOnActiveComponents("show"),this.element.show(),this.layoutManager.updateSize()},_callOnActiveComponents:function(t){var e,n,i=this.getItemsByType("stack");for(n=0;n<i.length;n++)(e=i[n].getActiveContentItem())&&e.isComponent&&e.container[t]()},_$destroy:function(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")},_$getArea:function(t){var e=(t=t||this.element).offset(),n=t.width(),i=t.height();return{x1:e.left,y1:e.top,x2:e.left+n,y2:e.top+i,surface:n*i,contentItem:this}},_$init:function(){var t;for(this.setSize(),t=0;t<this.contentItems.length;t++)this.childElementContainer.append(this.contentItems[t].element);this.isInitialised=!0,this.emitBubblingEvent("itemCreated"),this.emitBubblingEvent(this.type+"Created")},emitBubblingEvent:function(t){var e=new s.utils.BubblingEvent(t,this);this.emit(t,e)},_createContentItems:function(t){var e,n;if(!(t.content instanceof Array))throw new s.errors.ConfigurationError("content must be an Array",t);for(n=0;n<t.content.length;n++)e=this.layoutManager.createContentItem(t.content[n],this),this.contentItems.push(e)},_extendItemNode:function(t){for(var e in s.config.itemDefaultConfig)void 0===t[e]&&(t[e]=s.config.itemDefaultConfig[e]);return t},_propagateEvent:function(t,e){e instanceof s.utils.BubblingEvent&&!1===e.isPropagationStopped&&!0===this.isInitialised&&(!1===this.isRoot&&this.parent?this.parent.emit.apply(this.parent,Array.prototype.slice.call(arguments,0)):this._scheduleEventPropagationToLayoutManager(t,e))},_scheduleEventPropagationToLayoutManager:function(t,e){-1===s.utils.indexOf(t,this._throttledEvents)?this.layoutManager.emit(t,e.origin):!0!==this._pendingEventPropagations[t]&&(this._pendingEventPropagations[t]=!0,s.utils.animFrame(s.utils.fnBind(this._propagateEventToLayoutManager,this,[t,e])))},_propagateEventToLayoutManager:function(t,e){this._pendingEventPropagations[t]=!1,this.layoutManager.emit(t,e)}}),s.items.Component=function(t,e,n){s.items.AbstractContentItem.call(this,t,e,n);var i=t.getComponent(this.config.componentName),r=o.extend(!0,{},this.config.componentState||{});r.componentName=this.config.componentName,this.componentName=this.config.componentName,""===this.config.title&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new s.container.ItemContainer(this.config,this,t),this.instance=new i(this.container,r),this.element=this.container._element},s.utils.extend(s.items.Component,s.items.AbstractContentItem),s.utils.copy(s.items.Component.prototype,{close:function(){this.parent.removeChild(this)},setSize:function(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())},_$init:function(){s.items.AbstractContentItem.prototype._$init.call(this),this.container.emit("open")},_$hide:function(){this.container.hide(),s.items.AbstractContentItem.prototype._$hide.call(this)},_$show:function(){this.container.show(),s.items.AbstractContentItem.prototype._$show.call(this)},_$shown:function(){this.container.shown(),s.items.AbstractContentItem.prototype._$shown.call(this)},_$destroy:function(){this.container.emit("destroy",this),s.items.AbstractContentItem.prototype._$destroy.call(this)},_$getArea:function(){return null}}),s.items.Root=function(t,e,n){s.items.AbstractContentItem.call(this,t,e,null),this.isRoot=!0,this.type="root",this.element=o('<div class="lm_goldenlayout lm_item lm_root"></div>'),this.childElementContainer=this.element,this._containerElement=n,this._containerElement.append(this.element)},s.utils.extend(s.items.Root,s.items.AbstractContentItem),s.utils.copy(s.items.Root.prototype,{addChild:function(t){if(this.contentItems.length>0)throw new Error("Root node can only have a single child");t=this.layoutManager._$normalizeContentItem(t,this),this.childElementContainer.append(t.element),s.items.AbstractContentItem.prototype.addChild.call(this,t),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")},setSize:function(t,e){t=void 0===t?this._containerElement.width():t,e=void 0===e?this._containerElement.height():e,this.element.width(t),this.element.height(e),this.contentItems[0]&&(this.contentItems[0].element.width(t),this.contentItems[0].element.height(e))},_$highlightDropZone:function(t,e,n){this.layoutManager.tabDropPlaceholder.remove(),s.items.AbstractContentItem.prototype._$highlightDropZone.apply(this,arguments)},_$onDrop:function(t,e){var n;if(t.isComponent&&((n=this.layoutManager.createContentItem({type:"stack",header:t.config.header||{}},this))._$init(),n.addChild(t),t=n),this.contentItems.length){var i="x"==e.side[0]?"row":"column",r="x"==e.side[0]?"width":"height",o="2"==e.side[1],a=this.contentItems[0];if(!a instanceof s.items.RowOrColumn||a.type!=i){var l=this.layoutManager.createContentItem({type:i},this);this.replaceChild(a,l),l.addChild(t,o?0:void 0,!0),l.addChild(a,o?void 0:0,!0),a.config[r]=50,t.config[r]=50,l.callDownwards("setSize")}else{var c=a.contentItems[o?0:a.contentItems.length-1];a.addChild(t,o?0:void 0,!0),c.config[r]*=.5,t.config[r]=c.config[r],a.callDownwards("setSize")}}else this.addChild(t)}}),s.items.RowOrColumn=function(t,e,n,i){s.items.AbstractContentItem.call(this,e,n,i),this.isRow=!t,this.isColumn=t,this.element=o('<div class="lm_item lm_'+(t?"column":"row")+'"></div>'),this.childElementContainer=this.element,this._splitterSize=e.config.dimensions.borderWidth,this._splitterGrabSize=e.config.dimensions.borderGrabWidth,this._isColumn=t,this._dimension=t?"height":"width",this._splitter=[],this._splitterPosition=null,this._splitterMinPosition=null,this._splitterMaxPosition=null},s.utils.extend(s.items.RowOrColumn,s.items.AbstractContentItem),s.utils.copy(s.items.RowOrColumn.prototype,{addChild:function(t,e,n){var i,r,o,a;if(t=this.layoutManager._$normalizeContentItem(t,this),void 0===e&&(e=this.contentItems.length),this.contentItems.length>0?(a=this._createSplitter(Math.max(0,e-1)).element,e>0?(this.contentItems[e-1].element.after(a),a.after(t.element)):(this.contentItems[0].element.before(a),a.before(t.element))):this.childElementContainer.append(t.element),s.items.AbstractContentItem.prototype.addChild.call(this,t,e),i=1/this.contentItems.length*100,!0!==n){for(o=0;o<this.contentItems.length;o++)this.contentItems[o]===t?t.config[this._dimension]=i:(r=this.contentItems[o].config[this._dimension]*=(100-i)/100,this.contentItems[o].config[this._dimension]=r);this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}else this.emitBubblingEvent("stateChanged")},removeChild:function(t,e){var n,i,r=t.config[this._dimension],o=s.utils.indexOf(t,this.contentItems),a=Math.max(o-1,0);if(-1===o)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[a]&&(this._splitter[a]._$destroy(),this._splitter.splice(a,1)),n=0;n<this.contentItems.length;n++)this.contentItems[n]!==t&&(this.contentItems[n].config[this._dimension]+=r/(this.contentItems.length-1));s.items.AbstractContentItem.prototype.removeChild.call(this,t,e),1===this.contentItems.length&&!0===this.config.isClosable?(i=this.contentItems[0],this.contentItems=[],this.parent.replaceChild(this,i,!0)):(this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"))},replaceChild:function(t,e){var n=t.config[this._dimension];s.items.AbstractContentItem.prototype.replaceChild.call(this,t,e),e.config[this._dimension]=n,this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")},setSize:function(){this.contentItems.length>0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")},_$init:function(){var t;if(!0!==this.isInitialised)for(s.items.AbstractContentItem.prototype._$init.call(this),t=0;t<this.contentItems.length-1;t++)this.contentItems[t].element.after(this._createSplitter(t).element)},_setAbsoluteSizes:function(){var t,e=this._calculateAbsoluteSizes();for(t=0;t<this.contentItems.length;t++)e.additionalPixel-t>0&&e.itemSizes[t]++,this._isColumn?(this.contentItems[t].element.width(e.totalWidth),this.contentItems[t].element.height(e.itemSizes[t])):(this.contentItems[t].element.width(e.itemSizes[t]),this.contentItems[t].element.height(e.totalHeight))},_calculateAbsoluteSizes:function(){var t,e,n=(this.contentItems.length-1)*this._splitterSize,i=this.element.width(),r=this.element.height(),o=0,s=[];for(this._isColumn?r-=n:i-=n,t=0;t<this.contentItems.length;t++)o+=e=this._isColumn?Math.floor(r*(this.contentItems[t].config.height/100)):Math.floor(i*(this.contentItems[t].config.width/100)),s.push(e);return{itemSizes:s,additionalPixel:Math.floor((this._isColumn?r:i)-o),totalWidth:i,totalHeight:r}},_calculateRelativeSizes:function(){var t,e=0,n=[],i=this._isColumn?"height":"width";for(t=0;t<this.contentItems.length;t++)void 0!==this.contentItems[t].config[i]?e+=this.contentItems[t].config[i]:n.push(this.contentItems[t]);if(100!==Math.round(e))if(Math.round(e)<100&&n.length>0){for(t=0;t<n.length;t++)n[t].config[i]=(100-e)/n.length;this._respectMinItemWidth()}else{if(Math.round(e)>100)for(t=0;t<n.length;t++)n[t].config[i]=50,e+=50;for(t=0;t<this.contentItems.length;t++)this.contentItems[t].config[i]=this.contentItems[t].config[i]/e*100;this._respectMinItemWidth()}else this._respectMinItemWidth()},_respectMinItemWidth:function(){var t,e,n,i,r=this.layoutManager.config.dimensions&&this.layoutManager.config.dimensions.minItemWidth||0,o=[],s=0,a=0,l=0,c=0,u=[];if(!(this._isColumn||!r||this.contentItems.length<=1)){t=this._calculateAbsoluteSizes();for(var d=0;d<this.contentItems.length;d++)this.contentItems[d],(c=t.itemSizes[d])<r?(a+=r-c,i={width:r}):(s+=c-r,i={width:c},o.push(i)),u.push(i);if(!(0===a||a>s)){for(e=a/s,l=a,d=0;d<o.length;d++)i=o[d],l-=n=Math.round((i.width-r)*e),i.width-=n;for(0!==l&&(u[u.length-1].width-=l),d=0;d<this.contentItems.length;d++)this.contentItems[d].config.width=u[d].width/t.totalWidth*100}}},_createSplitter:function(t){var e;return(e=new s.controls.Splitter(this._isColumn,this._splitterSize,this._splitterGrabSize)).on("drag",s.utils.fnBind(this._onSplitterDrag,this,[e]),this),e.on("dragStop",s.utils.fnBind(this._onSplitterDragStop,this,[e]),this),e.on("dragStart",s.utils.fnBind(this._onSplitterDragStart,this,[e]),this),this._splitter.splice(t,0,e),e},_getItemsForSplitter:function(t){var e=s.utils.indexOf(t,this._splitter);return{before:this.contentItems[e],after:this.contentItems[e+1]}},_getMinimumDimensions:function(t){for(var e=0,n=0,i=0;i<t.length;++i)e=Math.max(t[i].minWidth||0,e),n=Math.max(t[i].minHeight||0,n);return{horizontal:e,vertical:n}},_onSplitterDragStart:function(t){var e=this._getItemsForSplitter(t),n=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],i=this._getMinimumDimensions(e.before.config.content),r=this._isColumn?i.vertical:i.horizontal,o=this._getMinimumDimensions(e.after.config.content),s=this._isColumn?o.vertical:o.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(e.before.element[this._dimension]()-(r||n)),this._splitterMaxPosition=e.after.element[this._dimension]()-(s||n)},_onSplitterDrag:function(t,e,n){var i=this._isColumn?n:e;i>this._splitterMinPosition&&i<this._splitterMaxPosition&&(this._splitterPosition=i,t.element.css(this._isColumn?"top":"left",i))},_onSplitterDragStop:function(t){var e=this._getItemsForSplitter(t),n=e.before.element[this._dimension](),i=e.after.element[this._dimension](),r=(this._splitterPosition+n)/(n+i),o=e.before.config[this._dimension]+e.after.config[this._dimension];e.before.config[this._dimension]=r*o,e.after.config[this._dimension]=(1-r)*o,t.element.css({top:0,left:0}),s.utils.animFrame(s.utils.fnBind(this.callDownwards,this,["setSize"]))}}),s.items.Stack=function(t,e,n){s.items.AbstractContentItem.call(this,t,e,n),this.element=o('<div class="lm_item lm_stack"></div>'),this._activeContentItem=null;var i=t.config;this._header={show:!0===i.settings.hasHeaders&&!1!==e.hasHeaders,popout:i.settings.showPopoutIcon&&i.labels.popout,maximise:i.settings.showMaximiseIcon&&i.labels.maximise,close:i.settings.showCloseIcon&&i.labels.close,minimise:i.labels.minimise},i.header&&s.utils.copy(this._header,i.header),e.header&&s.utils.copy(this._header,e.header),e.content&&e.content[0]&&e.content[0].header&&s.utils.copy(this._header,e.content[0].header),this._dropZones={},this._dropSegment=null,this._contentAreaDimensions=null,this._dropIndex=null,this.isStack=!0,this.childElementContainer=o('<div class="lm_items"></div>'),this.header=new s.controls.Header(t,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()},s.utils.extend(s.items.Stack,s.items.AbstractContentItem),s.utils.copy(s.items.Stack.prototype,{setSize:function(){var t,e=this._header.show?this.layoutManager.config.dimensions.headerHeight:0,n=this.element.width()-(this._sided?e:0),i=this.element.height()-(this._sided?0:e);for(this.childElementContainer.width(n),this.childElementContainer.height(i),t=0;t<this.contentItems.length;t++)this.contentItems[t].element.width(n).height(i);this.emit("resize"),this.emitBubblingEvent("stateChanged")},_$init:function(){var t,e;if(!0!==this.isInitialised){for(s.items.AbstractContentItem.prototype._$init.call(this),t=0;t<this.contentItems.length;t++)this.header.createTab(this.contentItems[t]),this.contentItems[t]._$hide();if(this.contentItems.length>0){if(!(e=this.contentItems[this.config.activeItemIndex||0]))throw new Error("Configured activeItemIndex out of bounds");this.setActiveContentItem(e)}}},setActiveContentItem:function(t){if(-1===s.utils.indexOf(t,this.contentItems))throw new Error("contentItem is not a child of this stack");null!==this._activeContentItem&&this._activeContentItem._$hide(),this._activeContentItem=t,this.header.setActiveContentItem(t),t._$show(),this.emit("activeContentItemChanged",t),this.layoutManager.emit("activeContentItemChanged",t),this.emitBubblingEvent("stateChanged")},getActiveContentItem:function(){return this.header.activeContentItem},addChild:function(t,e){t=this.layoutManager._$normalizeContentItem(t,this),s.items.AbstractContentItem.prototype.addChild.call(this,t,e),this.childElementContainer.append(t.element),this.header.createTab(t,e),this.setActiveContentItem(t),this.callDownwards("setSize"),this._$validateClosability(),this.emitBubblingEvent("stateChanged")},removeChild:function(t,e){var n=s.utils.indexOf(t,this.contentItems);s.items.AbstractContentItem.prototype.removeChild.call(this,t,e),this.header.removeTab(t),this.header.activeContentItem===t&&(this.contentItems.length>0?this.setActiveContentItem(this.contentItems[Math.max(n-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")},_$validateClosability:function(){var t,e,n;for(t=this.header._isClosable(),n=0,e=this.contentItems.length;n<e&&t;n++)t=this.contentItems[n].config.isClosable;this.header._$setClosable(t)},_$destroy:function(){s.items.AbstractContentItem.prototype._$destroy.call(this),this.header._$destroy()},_$onDrop:function(t){if("header"===this._dropSegment)return this._resetHeaderDropZone(),void this.addChild(t,this._dropIndex);if("body"!==this._dropSegment){var e,n,i,r="top"===this._dropSegment||"bottom"===this._dropSegment,o="left"===this._dropSegment||"right"===this._dropSegment,a="top"===this._dropSegment||"left"===this._dropSegment,l=r&&this.parent.isColumn||o&&this.parent.isRow,c=r?"column":"row",u=r?"height":"width";t.isComponent&&((n=this.layoutManager.createContentItem({type:"stack",header:t.config.header||{}},this))._$init(),n.addChild(t),t=n),l?(e=s.utils.indexOf(this,this.parent.contentItems),this.parent.addChild(t,a?e:e+1,!0),this.config[u]*=.5,t.config[u]=this.config[u],this.parent.callDownwards("setSize")):(c=r?"column":"row",i=this.layoutManager.createContentItem({type:c},this),this.parent.replaceChild(this,i),i.addChild(t,a?0:void 0,!0),i.addChild(this,a?void 0:0,!0),this.config[u]=50,t.config[u]=50,i.callDownwards("setSize"))}else this.addChild(t)},_$highlightDropZone:function(t,e){var n,i;for(n in this._contentAreaDimensions)if((i=this._contentAreaDimensions[n].hoverArea).x1<t&&i.x2>t&&i.y1<e&&i.y2>e)return void("header"===n?(this._dropSegment="header",this._highlightHeaderDropZone(this._sided?e:t)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(n)))},_$getArea:function(){if(!1===this.element.is(":visible"))return null;var t=s.items.AbstractContentItem.prototype._$getArea,e=t.call(this,this.header.element),n=t.call(this,this.childElementContainer),i=n.x2-n.x1,r=n.y2-n.y1;return this._contentAreaDimensions={header:{hoverArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},highlightArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}},this._activeContentItem&&!1===this._activeContentItem.isComponent?e:0===this.contentItems.length?(this._contentAreaDimensions.body={hoverArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2}},t.call(this,this.element)):(this._contentAreaDimensions.left={hoverArea:{x1:n.x1,y1:n.y1,x2:n.x1+.25*i,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x1+.5*i,y2:n.y2}},this._contentAreaDimensions.top={hoverArea:{x1:n.x1+.25*i,y1:n.y1,x2:n.x1+.75*i,y2:n.y1+.5*r},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y1+.5*r}},this._contentAreaDimensions.right={hoverArea:{x1:n.x1+.75*i,y1:n.y1,x2:n.x2,y2:n.y2},highlightArea:{x1:n.x1+.5*i,y1:n.y1,x2:n.x2,y2:n.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:n.x1+.25*i,y1:n.y1+.5*r,x2:n.x1+.75*i,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1+.5*r,x2:n.x2,y2:n.y2}},t.call(this,this.element))},_highlightHeaderDropZone:function(t){var e,n,i,r,o,s,a,l,c=this.header.tabs.length,u=!1;if(0===c)return a=this.header.element.offset(),void this.layoutManager.dropTargetIndicator.highlightArea({x1:a.left,x2:a.left+100,y1:a.top+this.header.element.height()-20,y2:a.top+this.header.element.height()});for(e=0;e<c;e++)if(o=(n=this.header.tabs[e].element).offset(),this._sided?(r=o.top,i=o.left,l=n.height()):(r=o.left,i=o.top,l=n.width()),t>r&&t<r+l){u=!0;break}if(!(!1===u&&t<r)){if(t<r+l/2?(this._dropIndex=e,n.before(this.layoutManager.tabDropPlaceholder)):(this._dropIndex=Math.min(e+1,c),n.after(this.layoutManager.tabDropPlaceholder)),this._sided)return placeHolderTop=this.layoutManager.tabDropPlaceholder.offset().top,void this.layoutManager.dropTargetIndicator.highlightArea({x1:i,x2:i+n.innerHeight(),y1:placeHolderTop,y2:placeHolderTop+this.layoutManager.tabDropPlaceholder.width()});s=this.layoutManager.tabDropPlaceholder.offset().left,this.layoutManager.dropTargetIndicator.highlightArea({x1:s,x2:s+this.layoutManager.tabDropPlaceholder.width(),y1:i,y2:i+n.innerHeight()})}},_resetHeaderDropZone:function(){this.layoutManager.tabDropPlaceholder.remove()},_setupHeaderPosition:function(){var t=["right","left","bottom"].indexOf(this._header.show)>=0&&this._header.show;if(this.header.element.toggle(!!this._header.show),this._side=t,this._sided=["right","left"].indexOf(this._side)>=0,this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer){var e=["right","bottom"].indexOf(this._side)>=0?"before":"after";this.header.element[e](this.childElementContainer),this.callDownwards("setSize")}},_highlightBodyDropZone:function(t){var e=this._contentAreaDimensions[t].highlightArea;this.layoutManager.dropTargetIndicator.highlightArea(e),this._dropSegment=t}}),s.utils.BubblingEvent=function(t,e){this.name=t,this.origin=e,this.isPropagationStopped=!1},s.utils.BubblingEvent.prototype.stopPropagation=function(){this.isPropagationStopped=!0},s.utils.ConfigMinifier=function(){if(this._keys=["settings","hasHeaders","constrainDragToContainer","selectionEnabled","dimensions","borderWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","content","componentName","componentState","id","width","type","height","isClosable","title","popoutWholeStack","openPopouts","parentId","activeItemIndex","reorderEnabled","borderGrabWidth"],this._keys.length>36)throw new Error("Too many keys in config minifier map");this._values=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"]},s.utils.copy(s.utils.ConfigMinifier.prototype,{minifyConfig:function(t){var e={};return this._nextLevel(t,e,"_min"),e},unminifyConfig:function(t){var e={};return this._nextLevel(t,e,"_max"),e},_nextLevel:function(t,e,n){var i,r;for(i in t)t instanceof Array&&(i=parseInt(i,10)),t.hasOwnProperty(i)&&(r=this[n](i,this._keys),"object"==typeof t[i]?(e[r]=t[i]instanceof Array?[]:{},this._nextLevel(t[i],e[r],n)):e[r]=this[n](t[i],this._values))},_min:function(t,e){if("string"==typeof t&&1===t.length)return"___"+t;var n=s.utils.indexOf(t,e);return-1===n?t:n.toString(36)},_max:function(t,e){return"string"==typeof t&&1===t.length?e[parseInt(t,36)]:"string"==typeof t&&"___"===t.substr(0,3)?t[3]:t}}),s.utils.EventHub=function(t){s.utils.EventEmitter.call(this),this._layoutManager=t,this._dontPropagateToParent=null,this._childEventSource=null,this.on(s.utils.EventEmitter.ALL_EVENT,s.utils.fnBind(this._onEventFromThis,this)),this._boundOnEventFromChild=s.utils.fnBind(this._onEventFromChild,this),o(window).on("gl_child_event",this._boundOnEventFromChild)},s.utils.EventHub.prototype._onEventFromThis=function(){var t=Array.prototype.slice.call(arguments);this._layoutManager.isSubWindow&&t[0]!==this._dontPropagateToParent&&this._propagateToParent(t),this._propagateToChildren(t),this._dontPropagateToParent=null,this._childEventSource=null},s.utils.EventHub.prototype._$onEventFromParent=function(t){this._dontPropagateToParent=t[0],this.emit.apply(this,t)},s.utils.EventHub.prototype._onEventFromChild=function(t){this._childEventSource=t.originalEvent.__gl,this.emit.apply(this,t.originalEvent.__glArgs)},s.utils.EventHub.prototype._propagateToParent=function(t){var e;document.createEvent?(e=window.opener.document.createEvent("HTMLEvents")).initEvent("gl_child_event",!0,!0):(e=window.opener.document.createEventObject()).eventType="gl_child_event",e.eventName="gl_child_event",e.__glArgs=t,e.__gl=this._layoutManager,document.createEvent?window.opener.dispatchEvent(e):window.opener.fireEvent("on"+e.eventType,e)},s.utils.EventHub.prototype._propagateToChildren=function(t){var e,n;for(n=0;n<this._layoutManager.openPopouts.length;n++)(e=this._layoutManager.openPopouts[n].getGlInstance())&&e!==this._childEventSource&&e.eventHub._$onEventFromParent(t)},s.utils.EventHub.prototype.destroy=function(){o(window).off("gl_child_event",this._boundOnEventFromChild)},s.utils.ReactComponentHandler=function(t,e){this._reactComponent=null,this._originalComponentWillUpdate=null,this._container=t,this._initialState=e,this._reactClass=this._getReactClass(),this._container.on("open",this._render,this),this._container.on("destroy",this._destroy,this)},s.utils.copy(s.utils.ReactComponentHandler.prototype,{_render:function(){this._reactComponent=ReactDOM.render(this._getReactComponent(),this._container.getElement()[0]),this._originalComponentWillUpdate=this._reactComponent.componentWillUpdate||function(){},this._reactComponent.componentWillUpdate=this._onUpdate.bind(this),this._container.getState()&&this._reactComponent.setState(this._container.getState())},_destroy:function(){ReactDOM.unmountComponentAtNode(this._container.getElement()[0]),this._container.off("open",this._render,this),this._container.off("destroy",this._destroy,this)},_onUpdate:function(t,e){this._container.setState(e),this._originalComponentWillUpdate.call(this._reactComponent,t,e)},_getReactClass:function(){var t,e=this._container._config.component;if(!e)throw new Error("No react component name. type: react-component needs a field `component`");if(!(t=this._container.layoutManager.getComponent(e)))throw new Error('React component "'+e+'" not found. Please register all components with GoldenLayout using `registerComponent(name, component)`');return t},_getReactComponent:function(){var t={glEventHub:this._container.layoutManager.eventHub,glContainer:this._container},e=o.extend(t,this._container._config.props);return React.createElement(this._reactClass,e)}})},function(t,e,n){var i=n(31),r=n(30),o=n(6),s=n(3),a=n(15),l=n(14);n(13),n(11),n(9);var c={content:[{type:"row",content:[{type:"stack",id:"editorstack",content:[{type:"component",componentName:"cceditor",componentState:{href:"/index.md",target:"editor"}}]}]}]};t.exports={CCEditorApp:class{constructor(t){var e=this;void 0===t&&(t={});var n=t.layout||c,u={};this.frames_by_target=u,this.layout=new i(n,t.elt),this.active_stack=null,this.layout.on("stackCreated",function(t){var n=document.createElement("li");n.classList.add("hash"),n.textContent="#",n.style.width="auto",n.style.border="1px solid black",n.style.fontFamily="monospace",n.style.fontSize="10px",n.style.padding="0 10px 0px 10px",n.addEventListener("click",function(){e.set_active_stack(t,n)}),t.header.controlsContainer.prepend(n),t.on("activeContentItemChanged",function(n){e.set_active_stack(t)})}),this.layout.registerComponent("cceditor",function(t,n){window.setTimeout(function(){var i=new r.CCEditor(t.getElement()[0],{click:function(t,n){var i,r;if(n.contains("cm-link")){i=a.trim_parentheses(a.trim_brackets(t));var o=this.editor.getValue(),s=a.extract_reflink_definitions(o),l=a.xpandRefLink(i,s);i=l.href,r=l.title}else{var c=t.match(/^\((.+?)(?: *(?:\"(.+)\")?\))$/);c&&(i=c[1],r=c[2]||"")}if(i)if(i.match(/\.md$/)&&!r){var d=e.find_editor(i);d?d.parent.setActiveContentItem(d):e.get_editor_stack().addChild({type:"component",componentName:"cceditor",componentState:{href:i,target:"editor"}})}else{r=r||"link";var h=e.layout.root.getItemsById("linkstack");if(h.length>0){h=h[0];var f=e.find_frame_by_target(r);if(f){var p=u[r];p?(p.src=i,f.parent.setActiveContentItem(f)):console.log("cceditorapp: no ccframe in frames_by_target for target",r)}else h.addChild({type:"component",componentName:"ccframe",componentState:{href:i,target:r}})}else e.layout.root.contentItems[0].addChild({type:"column",content:[{type:"stack",id:"linkstack",content:[{type:"component",componentName:"ccframe",componentState:{href:i,target:r}}]}]})}},ctrlKey:function(t){if(e.active_stack){var n=e.active_stack.getActiveContentItem(),o=n.container.getState();if(n=n.container.getElement(),"up"==t)n.trigger("control","toggle");else if("left"==t)n.trigger("control","jumpback");else if("right"==t)n.trigger("control","jumpforward");else if("down"==t){var s=i.getValue(),l=a.extract_reflink_definitions(s),c=o.href;o.hash&&(c=r.parse_fragment(o.href).base+o.hash),c=a.compactRefLink(c,l),i.replaceSelection("["+c+"]\n")}}},notie:l});t.setTitle(n.href),u[n.target]=i,i.src=n.href},10)}),this.layout.registerComponent("testComponent",function(t,e){t.getElement().html("<h2>"+e.label+"</h2>")}),this.layout.registerComponent("ccframe",function(t,e){var n=t.getElement()[0],i=new o(n);n.classList.add("ccframe"),s(n).on("hashchange",function(e,n){t.extendState({hash:n});var i=function(t){for(;"stack"!==t.type&&t.parent;)t=t.parent;if("stack"==t.type)return t}(t);if(i){var r=i.header.controlsContainer.find(".hash");r&&(r[0].textContent=n)}});var a=e.href;e.hash&&(a=r.parse_fragment(e.href).base+e.hash),i.src=a,t.setTitle(e.target),u[e.target]=i}),this.layout.init()}set_active_stack(t,e){this.active_stack!=t&&(this.active_stack&&(this.active_stack.header.controlsContainer.find(".hash")[0].style.opacity=.4),this.active_stack=t,this.active_stack&&(this.active_stack.header.controlsContainer.find(".hash")[0].style.opacity=1))}get_editor_stack(t){if(void 0===t&&(t=this.layout.root),"component"===t.type&&"cceditor"==t.componentName&&t.parent&&"stack"==t.parent.type)return t.parent;for(var e=0,n=t.contentItems.length;e<n;e++){var i=this.get_editor_stack(t.contentItems[e]);if(i)return i}}find_editor(t,e){if(void 0===e&&(e=this.layout.root),"component"===e.type&&"cceditor"==e.componentName&&e.config.componentState.href==t)return e;for(var n=0,i=e.contentItems.length;n<i;n++){var r=this.find_editor(t,e.contentItems[n]);if(r)return r}}find_frame_by_target(t,e){if(void 0===e&&(e=this.layout.root),"component"===e.type&&"ccframe"==e.componentName&&e.config.componentState.target==t)return e;for(var n=0,i=e.contentItems.length;n<i;n++){var r=this.find_frame_by_target(t,e.contentItems[n]);if(r)return r}}},CodeMirror:r.CodeMirror,CCEditor:r.CCEditor,gl:i,notie:l}}]);