1
0
mirror of https://github.com/pdemian/human2regex.git synced 2025-05-16 04:20:35 -07:00
human2regex/docs/bundle.min.js
2020-11-02 01:26:44 -05:00

31 lines
420 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";function r(e){return e&&0===e.length}function i(e){return null==e?[]:Object.keys(e)}function o(e){for(var t=[],n=Object.keys(e),r=0;r<n.length;r++)t.push(e[n[r]]);return t}function a(e,t){for(var n=[],r=i(e),o=0;o<r.length;o++){var a=r[o];n.push(t.call(null,e[a],a))}return n}function s(e,t){for(var n=[],r=0;r<e.length;r++)n.push(t.call(null,e[r],r));return n}function u(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];Array.isArray(r)?t=t.concat(u(r)):t.push(r)}return t}function l(e){return r(e)?void 0:e[0]}function c(e){var t=e&&e.length;return t?e[t-1]:void 0}function f(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)t.call(null,e[n],n);else{if(!I(e))throw Error("non exhaustive match");var r=i(e);for(n=0;n<r.length;n++){var o=r[n],a=e[o];t.call(null,a,o)}}}function h(e){return"string"==typeof e}function p(e){return void 0===e}function d(e){return e instanceof Function}function g(e,t){return void 0===t&&(t=1),e.slice(t,e.length)}function m(e,t){return void 0===t&&(t=1),e.slice(0,e.length-t)}function v(e,t){var n=[];if(Array.isArray(e))for(var r=0;r<e.length;r++){var i=e[r];t.call(null,i)&&n.push(i)}return n}function y(e,t){return v(e,(function(e){return!t(e)}))}function b(e,t){for(var n=Object.keys(e),r={},i=0;i<n.length;i++){var o=n[i],a=e[o];t(a)&&(r[o]=a)}return r}function T(e,t){return!!I(e)&&e.hasOwnProperty(t)}function x(e,t){return void 0!==C(e,(function(e){return e===t}))}function O(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t}function S(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function C(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t.call(null,r))return r}}function E(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];t.call(null,i)&&n.push(i)}return n}function w(e,t,n){for(var r=Array.isArray(e),a=r?e:o(e),s=r?[]:i(e),u=n,l=0;l<a.length;l++)u=t.call(null,u,a[l],r?l:s[l]);return u}function k(e){return y(e,(function(e){return null==e}))}function N(e,t){void 0===t&&(t=function(e){return e});var n=[];return w(e,(function(e,r){var i=t(r);return x(n,i)?e:(n.push(i),e.concat(r))}),[])}function A(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=[null],i=r.concat(t);return Function.bind.apply(e,i)}function L(e){return Array.isArray(e)}function R(e){return e instanceof RegExp}function I(e){return e instanceof Object}function M(e,t){for(var n=0;n<e.length;n++)if(!t(e[n],n))return!1;return!0}function P(e,t){return y(e,(function(e){return x(t,e)}))}function _(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return!0;return!1}function j(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}function D(e,t){var n=O(e);return n.sort((function(e,n){return t(e)-t(n)})),n}function F(e,t){if(e.length!==t.length)throw Error("can't zipObject with different number of keys and values!");for(var n={},r=0;r<e.length;r++)n[e[r]]=t[r];return n}function U(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++)for(var o=t[r],a=i(o),s=0;s<a.length;s++){var u=a[s];e[u]=o[u]}return e}function W(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++)for(var o=t[r],a=i(o),s=0;s<a.length;s++){var u=a[s];T(e,u)||(e[u]=o[u])}return e}function H(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return W.apply(null,[{}].concat(e))}function B(e,t){var n={};return f(e,(function(e){var r=t(e),i=n[r];i?i.push(e):n[r]=[e]})),n}function z(e,t){for(var n=S(e),r=i(t),o=0;o<r.length;o++){var a=r[o],s=t[a];n[a]=s}return n}function G(){}function V(e){return e}function K(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(void 0!==r?r:void 0)}return t}function q(e){console&&console.error&&console.error("Error: "+e)}function $(e){console&&console.warn&&console.warn("Warning: "+e)}function Y(){return"function"==typeof Map}function X(e,t){t.forEach((function(t){var n=t.prototype;Object.getOwnPropertyNames(n).forEach((function(r){if("constructor"!==r){var i=Object.getOwnPropertyDescriptor(n,r);i&&(i.get||i.set)?Object.defineProperty(e.prototype,r,i):e.prototype[r]=t.prototype[r]}}))}))}function Z(e){function t(){}t.prototype=e;var n=new t;function r(){return typeof n.bar}return r(),r(),e}function J(e){return e[e.length-1]}function Q(e){var t=(new Date).getTime(),n=e();return{time:(new Date).getTime()-t,value:n}}n.d(t,"A",(function(){return r})),n.d(t,"G",(function(){return i})),n.d(t,"U",(function(){return o})),n.d(t,"J",(function(){return a})),n.d(t,"I",(function(){return s})),n.d(t,"t",(function(){return u})),n.d(t,"s",(function(){return l})),n.d(t,"H",(function(){return c})),n.d(t,"u",(function(){return f})),n.d(t,"E",(function(){return h})),n.d(t,"F",(function(){return p})),n.d(t,"B",(function(){return d})),n.d(t,"m",(function(){return g})),n.d(t,"n",(function(){return m})),n.d(t,"p",(function(){return v})),n.d(t,"P",(function(){return y})),n.d(t,"N",(function(){return b})),n.d(t,"w",(function(){return T})),n.d(t,"j",(function(){return x})),n.d(t,"g",(function(){return O})),n.d(t,"h",(function(){return S})),n.d(t,"q",(function(){return C})),n.d(t,"r",(function(){return E})),n.d(t,"O",(function(){return w})),n.d(t,"i",(function(){return k})),n.d(t,"T",(function(){return N})),n.d(t,"y",(function(){return L})),n.d(t,"D",(function(){return R})),n.d(t,"C",(function(){return I})),n.d(t,"o",(function(){return M})),n.d(t,"l",(function(){return P})),n.d(t,"Q",(function(){return _})),n.d(t,"x",(function(){return j})),n.d(t,"f",(function(){return U})),n.d(t,"k",(function(){return H})),n.d(t,"v",(function(){return B})),n.d(t,"K",(function(){return z})),n.d(t,"b",(function(){return G})),n.d(t,"a",(function(){return V})),n.d(t,"L",(function(){return K})),n.d(t,"c",(function(){return q})),n.d(t,"d",(function(){return $})),n.d(t,"z",(function(){return Y})),n.d(t,"e",(function(){return X})),n.d(t,"S",(function(){return Z})),n.d(t,"M",(function(){return J})),n.d(t,"R",(function(){return Q}))},function(e,t,n){var r,i,o;"undefined"!=typeof self&&self,i=[],void 0===(o="function"==typeof(r=function(){function e(){}e.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},e.prototype.restoreState=function(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx},e.prototype.pattern=function(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");var t=this.disjunction();this.consumeChar("/");for(var n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":s(n,"global");break;case"i":s(n,"ignoreCase");break;case"m":s(n,"multiLine");break;case"u":s(n,"unicode");break;case"y":s(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}},e.prototype.disjunction=function(){var e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}},e.prototype.alternative=function(){for(var e=[],t=this.idx;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}},e.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},e.prototype.assertion=function(){var e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":var t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead"}u(t);var n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}!function(){throw Error("Internal Error - Should never get here!")}()},e.prototype.quantifier=function(e){var t,n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":var r=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:r,atMost:r};break;case",":t=this.isDigit()?{atLeast:r,atMost:this.integerIncludingZero()}:{atLeast:r,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;u(t)}if(!0!==e||void 0!==t)return u(t),"?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t},e.prototype.atom=function(){var e,t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),u(e),e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e},e.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[o("\n"),o("\r"),o("\u2028"),o("\u2029")]}},e.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.decimalEscapeAtom=function(){return{type:"GroupBackReference",value:this.positiveInteger()}},e.prototype.characterClassEscape=function(){var e,t=!1;switch(this.popChar()){case"d":e=l;break;case"D":e=l,t=!0;break;case"s":e=f;break;case"S":e=f,t=!0;break;case"w":e=c;break;case"W":e=c,t=!0}return u(e),{type:"Set",value:e,complement:t}},e.prototype.controlEscapeAtom=function(){var e;switch(this.popChar()){case"f":e=o("\f");break;case"n":e=o("\n");break;case"r":e=o("\r");break;case"t":e=o("\t");break;case"v":e=o("\v")}return u(e),{type:"Character",value:e}},e.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}},e.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:o("\0")}},e.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},e.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},e.prototype.identityEscapeAtom=function(){return{type:"Character",value:o(this.popChar())}},e.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:o(this.popChar())}}},e.prototype.characterClass=function(){var e=[],t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){var n=this.classAtom();if("Character"===n.type&&this.isRangeDash()){this.consumeChar("-");var r=this.classAtom();if("Character"===r.type){if(r.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:r.value})}else a(n.value,e),e.push(o("-")),a(r.value,e)}else a(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:t,value:e}},e.prototype.classAtom=function(){switch(this.peekChar()){case"]":case"\n":case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},e.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:o("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.group=function(){var e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++}var t=this.disjunction();this.consumeChar(")");var n={type:"Group",capturing:e,value:t};return e&&(n.idx=this.groupIdx),n},e.prototype.positiveInteger=function(){var e=this.popChar();if(!1===i.test(e))throw Error("Expecting a positive integer");for(;r.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)},e.prototype.integerIncludingZero=function(){var e=this.popChar();if(!1===r.test(e))throw Error("Expecting an integer");for(;r.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)},e.prototype.patternCharacter=function(){var e=this.popChar();switch(e){case"\n":case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:o(e)}}},e.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},e.prototype.isRangeDash=function(){return"-"===this.peekChar()&&this.isClassAtom(1)},e.prototype.isDigit=function(){return r.test(this.peekChar(0))},e.prototype.isClassAtom=function(e){switch(void 0===e&&(e=0),this.peekChar(e)){case"]":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},e.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},e.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},e.prototype.isAssertion=function(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return"?"===this.peekChar(1)&&("="===this.peekChar(2)||"!"===this.peekChar(2));default:return!1}},e.prototype.isQuantifier=function(){var e=this.saveState();try{return void 0!==this.quantifier(!0)}catch(e){return!1}finally{this.restoreState(e)}},e.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},e.prototype.parseHexDigits=function(e){for(var t="",r=0;r<e;r++){var i=this.popChar();if(!1===n.test(i))throw Error("Expecting a HexDecimal digits");t+=i}return{type:"Character",value:parseInt(t,16)}},e.prototype.peekChar=function(e){return void 0===e&&(e=0),this.input[this.idx+e]},e.prototype.popChar=function(){var e=this.peekChar(0);return this.consumeChar(),e},e.prototype.consumeChar=function(e){if(void 0!==e&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++},e.prototype.loc=function(e){return{begin:e,end:this.idx}};var t,n=/[0-9a-fA-F]/,r=/[0-9]/,i=/[1-9]/;function o(e){return e.charCodeAt(0)}function a(e,t){void 0!==e.length?e.forEach((function(e){t.push(e)})):t.push(e)}function s(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t]=!0}function u(e){if(void 0===e)throw Error("Internal Error - Should never get here!")}var l=[];for(t=o("0");t<=o("9");t++)l.push(t);var c=[o("_")].concat(l);for(t=o("a");t<=o("z");t++)c.push(t);for(t=o("A");t<=o("Z");t++)c.push(t);var f=[o(" "),o("\f"),o("\n"),o("\r"),o("\t"),o("\v"),o("\t"),o(" "),o(""),o(" "),o(""),o(""),o(""),o(""),o(""),o(""),o(""),o(""),o(""),o(""),o("\u2028"),o("\u2029"),o(""),o(""),o(" "),o("\ufeff")];function h(){}return h.prototype.visitChildren=function(e){for(var t in e){var n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach((function(e){this.visit(e)}),this))}},h.prototype.visit=function(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)},h.prototype.visitPattern=function(e){},h.prototype.visitFlags=function(e){},h.prototype.visitDisjunction=function(e){},h.prototype.visitAlternative=function(e){},h.prototype.visitStartAnchor=function(e){},h.prototype.visitEndAnchor=function(e){},h.prototype.visitWordBoundary=function(e){},h.prototype.visitNonWordBoundary=function(e){},h.prototype.visitLookahead=function(e){},h.prototype.visitNegativeLookahead=function(e){},h.prototype.visitCharacter=function(e){},h.prototype.visitSet=function(e){},h.prototype.visitGroup=function(e){},h.prototype.visitGroupBackReference=function(e){},h.prototype.visitQuantifier=function(e){},{RegExpParser:e,BaseRegExpVisitor:h,VERSION:"0.5.0"}})?r.apply(t,i):r)||(e.exports=o)},function(e,t,n){"use strict";
/*! Copyright (c) 2020 Patrick Demian; Licensed under MIT */Object.defineProperty(t,"__esModule",{value:!0}),t.CommonError=t.regexEscape=t.removeQuotes=t.findLastIndex=t.last=t.first=t.isSingleRegexCharacter=t.combineFlags=t.hasFlag=t.makeFlag=t.usefulConditional=t.unusedParameter=void 0,t.unusedParameter=function(e,t){},t.usefulConditional=function(e,t){return Boolean(e)},t.makeFlag=function(e){return 1<<e},t.hasFlag=function(e,t){return 0!=(e&t)},t.combineFlags=function(e,t){return e|t},t.isSingleRegexCharacter=function(e){return e.startsWith("\\u")&&6===e.length||e.startsWith("\\U")&&8===e.length||e.startsWith("\\")&&2===e.length||1===e.length},t.first=function(e){return e[0]},t.last=function(e){return e[e.length-1]},t.findLastIndex=function(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]===t)return n;return-1},t.removeQuotes=function(e){return e.substring(1,e.length-1)},t.regexEscape=function(e){return e.replace("\\","\\\\").replace(/([=:\-\.\[\]\^\|\(\)\*\+\?\{\}\$\/])/g,"\\$1")};class r{constructor(e,t,n,r,i){this.type=e,this.start_line=t,this.start_column=n,this.length=r,this.message=i}static fromLexError(e){return new r("Lexer Error",e.line,e.column,e.length,e.message)}static fromParseError(e){var t,n,i;return new r("Parser Error",null!==(t=e.token.startLine)&&void 0!==t?t:NaN,null!==(n=e.token.startColumn)&&void 0!==n?n:NaN,null!==(i=e.token.endOffset)&&void 0!==i?i:NaN-e.token.startOffset,e.name+": "+e.message)}static fromSemanticError(e){return new r("Semantic Error",e.startLine,e.startColumn,e.length,e.message)}toString(){return`${this.type} @ ${this.start_line} ${this.start_column}: ${this.message}`}}t.CommonError=r},function(e,t,n){"use strict";n.r(t),n.d(t,"VERSION",(function(){return r})),n.d(t,"CstParser",(function(){return rn})),n.d(t,"EmbeddedActionsParser",(function(){return on})),n.d(t,"ParserDefinitionErrorType",(function(){return Jt})),n.d(t,"EMPTY_ALT",(function(){return tn})),n.d(t,"Lexer",(function(){return $})),n.d(t,"LexerDefinitionErrorType",(function(){return V})),n.d(t,"createToken",(function(){return J})),n.d(t,"createTokenInstance",(function(){return ee})),n.d(t,"EOF",(function(){return Q})),n.d(t,"tokenLabel",(function(){return Y})),n.d(t,"tokenMatcher",(function(){return te})),n.d(t,"tokenName",(function(){return X})),n.d(t,"defaultGrammarResolverErrorProvider",(function(){return Ae})),n.d(t,"defaultGrammarValidatorErrorProvider",(function(){return Le})),n.d(t,"defaultParserErrorProvider",(function(){return Ne})),n.d(t,"EarlyExitException",(function(){return vt})),n.d(t,"isRecognitionException",(function(){return pt})),n.d(t,"MismatchedTokenException",(function(){return dt})),n.d(t,"NotAllInputParsedException",(function(){return mt})),n.d(t,"NoViableAltException",(function(){return gt})),n.d(t,"defaultLexerErrorProvider",(function(){return K})),n.d(t,"Alternation",(function(){return he})),n.d(t,"Alternative",(function(){return ae})),n.d(t,"NonTerminal",(function(){return ie})),n.d(t,"Option",(function(){return se})),n.d(t,"Repetition",(function(){return ce})),n.d(t,"RepetitionMandatory",(function(){return ue})),n.d(t,"RepetitionMandatoryWithSeparator",(function(){return le})),n.d(t,"RepetitionWithSeparator",(function(){return fe})),n.d(t,"Rule",(function(){return oe})),n.d(t,"Terminal",(function(){return pe})),n.d(t,"serializeGrammar",(function(){return de})),n.d(t,"serializeProduction",(function(){return ge})),n.d(t,"GAstVisitor",(function(){return ye})),n.d(t,"assignOccurrenceIndices",(function(){return ft})),n.d(t,"resolveGrammar",(function(){return lt})),n.d(t,"validateGrammar",(function(){return ct})),n.d(t,"clearCache",(function(){return vn})),n.d(t,"createSyntaxDiagramsCode",(function(){return an})),n.d(t,"generateParserFactory",(function(){return gn})),n.d(t,"generateParserModule",(function(){return mn})),n.d(t,"Parser",(function(){return yn}));var r="7.0.2",i=n(0),o=n(1),a={},s=new o.RegExpParser;function u(e){var t=e.toString();if(a.hasOwnProperty(t))return a[t];var n=s.pattern(t);return a[t]=n,n}var l,c=(l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),f='Unable to use "first char" lexer optimizations:\n';function h(e,t){void 0===t&&(t=!1);try{var n=u(e);return function e(t,n,r){switch(t.type){case"Disjunction":for(var o=0;o<t.value.length;o++)e(t.value[o],n,r);break;case"Alternative":var a=t.value;for(o=0;o<a.length;o++){var s=a[o];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var u=s;switch(u.type){case"Character":p(u.value,n,r);break;case"Set":if(!0===u.complement)throw Error("Complement Sets are not supported for first char optimization");Object(i.u)(u.value,(function(e){if("number"==typeof e)p(e,n,r);else{var t=e;if(!0===r)for(var i=t.from;i<=t.to;i++)p(i,n,r);else{for(i=t.from;i<=t.to&&i<P;i++)p(i,n,r);if(t.to>=P)for(var o=t.from>=P?t.from:P,a=t.to,s=_(o),u=_(a),l=s;l<=u;l++)n[l]=l}}}));break;case"Group":e(u.value,n,r);break;default:throw Error("Non Exhaustive Match")}var l=void 0!==u.quantifier&&0===u.quantifier.atLeast;if("Group"===u.type&&!1===g(u)||"Group"!==u.type&&!1===l)break}break;default:throw Error("non exhaustive match!")}return Object(i.U)(n)}(n.value,{},n.flags.ignoreCase)}catch(n){if("Complement Sets are not supported for first char optimization"===n.message)t&&Object(i.d)(f+"\tUnable to optimize: < "+e.toString()+" >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var r="";t&&(r="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Object(i.c)(f+"\n\tFailed parsing: < "+e.toString()+" >\n\tUsing the regexp-to-ast library version: "+o.VERSION+"\n\tPlease open an issue at: https://github.com/bd82/regexp-to-ast/issues"+r)}}return[]}function p(e,t,n){var r=_(e);t[r]=r,!0===n&&function(e,t){var n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){var i=_(r.charCodeAt(0));t[i]=i}else{var o=n.toLowerCase();if(o!==n){i=_(o.charCodeAt(0));t[i]=i}}}(e,t)}function d(e,t){return Object(i.q)(e.value,(function(e){if("number"==typeof e)return Object(i.j)(t,e);var n=e;return void 0!==Object(i.q)(t,(function(e){return n.from<=e&&e<=n.to}))}))}function g(e){return!(!e.quantifier||0!==e.quantifier.atLeast)||!!e.value&&(Object(i.y)(e.value)?Object(i.o)(e.value,g):g(e.value))}var m=function(e){function t(t){var n=e.call(this)||this;return n.targetCharCodes=t,n.found=!1,n}return c(t,e),t.prototype.visitChildren=function(t){if(!0!==this.found){switch(t.type){case"Lookahead":return void this.visitLookahead(t);case"NegativeLookahead":return void this.visitNegativeLookahead(t)}e.prototype.visitChildren.call(this,t)}},t.prototype.visitCharacter=function(e){Object(i.j)(this.targetCharCodes,e.value)&&(this.found=!0)},t.prototype.visitSet=function(e){e.complement?void 0===d(e,this.targetCharCodes)&&(this.found=!0):void 0!==d(e,this.targetCharCodes)&&(this.found=!0)},t}(o.BaseRegExpVisitor);function v(e,t){if(t instanceof RegExp){var n=u(t),r=new m(e);return r.visit(n),r.found}return void 0!==Object(i.q)(t,(function(t){return Object(i.j)(e,t.charCodeAt(0))}))}var y=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b="PATTERN",T="boolean"==typeof new RegExp("(?:)").sticky;function x(e,t){var n,r=(t=Object(i.k)(t,{useSticky:T,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(e,t){return t()}})).tracer;r("initCharCodeToOptimizedIndexMap",(function(){!function(){if(Object(i.A)(j)){j=new Array(65536);for(var e=0;e<65536;e++)j[e]=e>255?255+~~(e/255):e}}()})),r("Reject Lexer.NA",(function(){n=Object(i.P)(e,(function(e){return e[b]===$.NA}))}));var o,a,s,u,l,c,p,d,g,m,y,x=!1;r("Transform Patterns",(function(){x=!1,o=Object(i.I)(n,(function(e){var n=e[b];if(Object(i.D)(n)){var r=n.source;return 1!==r.length||"^"===r||"$"===r||"."===r||n.ignoreCase?2!==r.length||"\\"!==r[0]||Object(i.j)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],r[1])?t.useSticky?w(n):E(n):r[1]:r}if(Object(i.B)(n))return x=!0,{exec:n};if(Object(i.w)(n,"exec"))return x=!0,n;if("string"==typeof n){if(1===n.length)return n;var o=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),a=new RegExp(o);return t.useSticky?w(a):E(a)}throw Error("non exhaustive match")}))})),r("misc mapping",(function(){a=Object(i.I)(n,(function(e){return e.tokenTypeIdx})),s=Object(i.I)(n,(function(e){var t=e.GROUP;if(t!==$.SKIPPED){if(Object(i.E)(t))return t;if(Object(i.F)(t))return!1;throw Error("non exhaustive match")}})),u=Object(i.I)(n,(function(e){var t=e.LONGER_ALT;if(t)return Object(i.x)(n,t)})),l=Object(i.I)(n,(function(e){return e.PUSH_MODE})),c=Object(i.I)(n,(function(e){return Object(i.w)(e,"POP_MODE")}))})),r("Line Terminator Handling",(function(){var e=I(t.lineTerminatorCharacters);p=Object(i.I)(n,(function(e){return!1})),"onlyOffset"!==t.positionTracking&&(p=Object(i.I)(n,(function(t){return Object(i.w)(t,"LINE_BREAKS")?t.LINE_BREAKS:!1===R(t,e)?v(e,t.PATTERN):void 0})))})),r("Misc Mapping #2",(function(){d=Object(i.I)(n,N),g=Object(i.I)(o,A),m=Object(i.O)(n,(function(e,t){var n=t.GROUP;return Object(i.E)(n)&&n!==$.SKIPPED&&(e[n]=[]),e}),{}),y=Object(i.I)(o,(function(e,t){return{pattern:o[t],longerAlt:u[t],canLineTerminator:p[t],isCustom:d[t],short:g[t],group:s[t],push:l[t],pop:c[t],tokenTypeIdx:a[t],tokenType:n[t]}}))}));var O=!0,S=[];return t.safeMode||r("First Char Optimization",(function(){S=Object(i.O)(n,(function(e,n,r){if("string"==typeof n.PATTERN){var o=_(n.PATTERN.charCodeAt(0));M(e,o,y[r])}else if(Object(i.y)(n.START_CHARS_HINT)){var a;Object(i.u)(n.START_CHARS_HINT,(function(t){var n=_("string"==typeof t?t.charCodeAt(0):t);a!==n&&(a=n,M(e,n,y[r]))}))}else if(Object(i.D)(n.PATTERN))if(n.PATTERN.unicode)O=!1,t.ensureOptimizations&&Object(i.c)(f+"\tUnable to analyze < "+n.PATTERN.toString()+" > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var s=h(n.PATTERN,t.ensureOptimizations);Object(i.A)(s)&&(O=!1),Object(i.u)(s,(function(t){M(e,t,y[r])}))}else t.ensureOptimizations&&Object(i.c)(f+"\tTokenType: <"+n.name+"> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),O=!1;return e}),[])})),r("ArrayPacking",(function(){S=Object(i.L)(S)})),{emptyGroups:m,patternIdxToConfig:y,charCodeToPatternIdxToConfig:S,hasCustom:x,canBeOptimized:O}}function O(e,t){var n=[],r=function(e){var t=Object(i.p)(e,(function(e){return!Object(i.w)(e,b)})),n=Object(i.I)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:V.MISSING_PATTERN,tokenTypes:[e]}})),r=Object(i.l)(e,t);return{errors:n,valid:r}}(e);n=n.concat(r.errors);var a=function(e){var t=Object(i.p)(e,(function(e){var t=e[b];return!(Object(i.D)(t)||Object(i.B)(t)||Object(i.w)(t,"exec")||Object(i.E)(t))})),n=Object(i.I)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:V.INVALID_PATTERN,tokenTypes:[e]}})),r=Object(i.l)(e,t);return{errors:n,valid:r}}(r.valid),s=a.valid;return n=(n=(n=(n=(n=n.concat(a.errors)).concat(function(e){var t=[],n=Object(i.p)(e,(function(e){return Object(i.D)(e[b])}));return t=(t=(t=(t=(t=t.concat(function(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return y(t,e),t.prototype.visitEndAnchor=function(e){this.found=!0},t}(o.BaseRegExpVisitor),n=Object(i.p)(e,(function(e){var n=e[b];try{var r=u(n),i=new t;return i.visit(r),i.found}catch(e){return S.test(n.source)}}));return Object(i.I)(n,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:V.EOI_ANCHOR_FOUND,tokenTypes:[e]}}))}(n))).concat(function(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return y(t,e),t.prototype.visitStartAnchor=function(e){this.found=!0},t}(o.BaseRegExpVisitor),n=Object(i.p)(e,(function(e){var n=e[b];try{var r=u(n),i=new t;return i.visit(r),i.found}catch(e){return C.test(n.source)}}));return Object(i.I)(n,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:V.SOI_ANCHOR_FOUND,tokenTypes:[e]}}))}(n))).concat(function(e){var t=Object(i.p)(e,(function(e){var t=e[b];return t instanceof RegExp&&(t.multiline||t.global)}));return Object(i.I)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:V.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}}))}(n))).concat(function(e){var t=[],n=Object(i.I)(e,(function(n){return Object(i.O)(e,(function(e,r){return n.PATTERN.source!==r.PATTERN.source||Object(i.j)(t,r)||r.PATTERN===$.NA||(t.push(r),e.push(r)),e}),[])}));n=Object(i.i)(n);var r=Object(i.p)(n,(function(e){return e.length>1}));return Object(i.I)(r,(function(e){var t=Object(i.I)(e,(function(e){return e.name}));return{message:"The same RegExp pattern ->"+Object(i.s)(e).PATTERN+"<-has been used in all of the following Token Types: "+t.join(", ")+" <-",type:V.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}))}(n))).concat(function(e){var t=Object(i.p)(e,(function(e){return e[b].test("")}));return Object(i.I)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:V.EMPTY_MATCH_PATTERN,tokenTypes:[e]}}))}(n))}(s))).concat(function(e){var t=Object(i.p)(e,(function(e){if(!Object(i.w)(e,"GROUP"))return!1;var t=e.GROUP;return t!==$.SKIPPED&&t!==$.NA&&!Object(i.E)(t)}));return Object(i.I)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:V.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}}))}(s))).concat(function(e,t){var n=Object(i.p)(e,(function(e){return void 0!==e.PUSH_MODE&&!Object(i.j)(t,e.PUSH_MODE)}));return Object(i.I)(n,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+e.PUSH_MODE+"<-which does not exist",type:V.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}}))}(s,t))).concat(function(e){var t=[],n=Object(i.O)(e,(function(e,t,n){var r,o=t.PATTERN;return o===$.NA||(Object(i.E)(o)?e.push({str:o,idx:n,tokenType:t}):Object(i.D)(o)&&(r=o,void 0===Object(i.q)([".","\\","[","]","|","^","$","(",")","?","*","+","{"],(function(e){return-1!==r.source.indexOf(e)})))&&e.push({str:o.source,idx:n,tokenType:t})),e}),[]);return Object(i.u)(e,(function(e,r){Object(i.u)(n,(function(n){var o=n.str,a=n.idx,s=n.tokenType;if(r<a&&function(e,t){if(Object(i.D)(t)){var n=t.exec(e);return null!==n&&0===n.index}if(Object(i.B)(t))return t(e,0,[],{});if(Object(i.w)(t,"exec"))return t.exec(e,0,[],{});if("string"==typeof t)return t===e;throw Error("non exhaustive match")}(o,e.PATTERN)){var u="Token: ->"+s.name+"<- can never be matched.\nBecause it appears AFTER the Token Type ->"+e.name+"<-in the lexer's definition.\nSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNREACHABLE";t.push({message:u,type:V.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}}))})),t}(s))}var S=/[^\\][\$]/;var C=/[^\\[][\^]|^\^/;function E(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:"+e.source+")",t)}function w(e){var t=e.ignoreCase?"iy":"y";return new RegExp(""+e.source,t)}function k(e,t,n){var r=[],o=!1,a=Object(i.i)(Object(i.t)(Object(i.J)(e.modes,(function(e){return e})))),s=Object(i.P)(a,(function(e){return e[b]===$.NA})),u=I(n);return t&&Object(i.u)(s,(function(e){var t=R(e,u);if(!1!==t){var n={message:function(e,t){if(t.issue===V.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <"+e.name+"> Token Type\n\t Root cause: "+t.errMsg+".\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(t.issue===V.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the <line_breaks> option.\n\tThe problem is in the <"+e.name+"> Token Type\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}(e,t),type:t.issue,tokenType:e};r.push(n)}else Object(i.w)(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(o=!0):v(u,e.PATTERN)&&(o=!0)})),t&&!o&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:V.NO_LINE_BREAKS_FLAGS}),r}function N(e){var t=e.PATTERN;if(Object(i.D)(t))return!1;if(Object(i.B)(t))return!0;if(Object(i.w)(t,"exec"))return!0;if(Object(i.E)(t))return!1;throw Error("non exhaustive match")}function A(e){return!(!Object(i.E)(e)||1!==e.length)&&e.charCodeAt(0)}var L={test:function(e){for(var t=e.length,n=this.lastIndex;n<t;n++){var r=e.charCodeAt(n);if(10===r)return this.lastIndex=n+1,!0;if(13===r)return 10===e.charCodeAt(n+1)?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function R(e,t){if(Object(i.w)(e,"LINE_BREAKS"))return!1;if(Object(i.D)(e.PATTERN)){try{v(t,e.PATTERN)}catch(e){return{issue:V.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}if(Object(i.E)(e.PATTERN))return!1;if(N(e))return{issue:V.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function I(e){return Object(i.I)(e,(function(e){return Object(i.E)(e)&&e.length>0?e.charCodeAt(0):e}))}function M(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}var P=256;function _(e){return e<P?e:j[e]}var j=[];function D(e,t){var n=e.tokenTypeIdx;return n===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[n]}function F(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}var U=1,W={};function H(e){var t=function(e){var t=Object(i.g)(e),n=e,r=!0;for(;r;){n=Object(i.i)(Object(i.t)(Object(i.I)(n,(function(e){return e.CATEGORIES}))));var o=Object(i.l)(n,t);t=t.concat(o),Object(i.A)(o)?r=!1:n=o}return t}(e);!function(e){Object(i.u)(e,(function(e){var t;B(e)||(W[U]=e,e.tokenTypeIdx=U++),z(e)&&!Object(i.y)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),z(e)||(e.CATEGORIES=[]),t=e,Object(i.w)(t,"categoryMatches")||(e.categoryMatches=[]),function(e){return Object(i.w)(e,"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})}))}(t),function(e){Object(i.u)(e,(function(e){!function e(t,n){Object(i.u)(t,(function(e){n.categoryMatchesMap[e.tokenTypeIdx]=!0})),Object(i.u)(n.CATEGORIES,(function(r){var o=t.concat(n);Object(i.j)(o,r)||e(o,r)}))}([],e)}))}(t),function(e){Object(i.u)(e,(function(e){e.categoryMatches=[],Object(i.u)(e.categoryMatchesMap,(function(t,n){e.categoryMatches.push(W[n].tokenTypeIdx)}))}))}(t),Object(i.u)(t,(function(e){e.isParent=e.categoryMatches.length>0}))}function B(e){return Object(i.w)(e,"tokenTypeIdx")}function z(e){return Object(i.w)(e,"CATEGORIES")}function G(e){return Object(i.w)(e,"tokenTypeIdx")}var V,K={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,n,r,i){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+", skipped "+n+" characters."}};!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"}(V||(V={}));var q={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:K,traceInitPerf:!1,skipValidations:!1};Object.freeze(q);var $=function(){function e(e,t){var n=this;if(void 0===t&&(t=q),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=Object(i.K)(q,t);var r=this.config.traceInitPerf;!0===r?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof r&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(function(){var r,o=!0;n.TRACE_INIT("Lexer Config handling",(function(){if(n.config.lineTerminatorsPattern===q.lineTerminatorsPattern)n.config.lineTerminatorsPattern=L;else if(n.config.lineTerminatorCharacters===q.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');n.trackStartLines=/full|onlyStart/i.test(n.config.positionTracking),n.trackEndLines=/full/i.test(n.config.positionTracking),Object(i.y)(e)?((r={modes:{}}).modes.defaultMode=Object(i.g)(e),r.defaultMode="defaultMode"):(o=!1,r=Object(i.h)(e))})),!1===n.config.skipValidations&&(n.TRACE_INIT("performRuntimeChecks",(function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(function(e,t,n){var r=[];return Object(i.w)(e,"defaultMode")||r.push({message:"A MultiMode Lexer cannot be initialized without a <defaultMode> property in its definition\n",type:V.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object(i.w)(e,"modes")||r.push({message:"A MultiMode Lexer cannot be initialized without a <modes> property in its definition\n",type:V.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object(i.w)(e,"modes")&&Object(i.w)(e,"defaultMode")&&!Object(i.w)(e.modes,e.defaultMode)&&r.push({message:"A MultiMode Lexer cannot be initialized with a defaultMode: <"+e.defaultMode+">which does not exist\n",type:V.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object(i.w)(e,"modes")&&Object(i.u)(e.modes,(function(e,t){Object(i.u)(e,(function(e,n){Object(i.F)(e)&&r.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:<"+t+"> at index: <"+n+">\n",type:V.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})}))})),r}(r,n.trackStartLines,n.config.lineTerminatorCharacters))})),n.TRACE_INIT("performWarningRuntimeChecks",(function(){n.lexerDefinitionWarning=n.lexerDefinitionWarning.concat(k(r,n.trackStartLines,n.config.lineTerminatorCharacters))}))),r.modes=r.modes?r.modes:{},Object(i.u)(r.modes,(function(e,t){r.modes[t]=Object(i.P)(e,(function(e){return Object(i.F)(e)}))}));var s=Object(i.G)(r.modes);if(Object(i.u)(r.modes,(function(e,r){n.TRACE_INIT("Mode: <"+r+"> processing",(function(){var o;(n.modes.push(r),!1===n.config.skipValidations&&n.TRACE_INIT("validatePatterns",(function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(O(e,s))})),Object(i.A)(n.lexerDefinitionErrors))&&(H(e),n.TRACE_INIT("analyzeTokenTypes",(function(){o=x(e,{lineTerminatorCharacters:n.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:n.TRACE_INIT.bind(n)})})),n.patternIdxToConfig[r]=o.patternIdxToConfig,n.charCodeToPatternIdxToConfig[r]=o.charCodeToPatternIdxToConfig,n.emptyGroups=Object(i.K)(n.emptyGroups,o.emptyGroups),n.hasCustom=o.hasCustom||n.hasCustom,n.canModeBeOptimized[r]=o.canBeOptimized)}))})),n.defaultMode=r.defaultMode,!Object(i.A)(n.lexerDefinitionErrors)&&!n.config.deferDefinitionErrorsHandling){var u=Object(i.I)(n.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+u)}Object(i.u)(n.lexerDefinitionWarning,(function(e){Object(i.d)(e.message)})),n.TRACE_INIT("Choosing sub-methods implementations",(function(){if(T?(n.chopInput=i.a,n.match=n.matchWithTest):(n.updateLastIndex=i.b,n.match=n.matchWithExec),o&&(n.handleModes=i.b),!1===n.trackStartLines&&(n.computeNewColumn=i.a),!1===n.trackEndLines&&(n.updateTokenEndLineColumnLocation=i.b),/full/i.test(n.config.positionTracking))n.createTokenInstance=n.createFullToken;else if(/onlyStart/i.test(n.config.positionTracking))n.createTokenInstance=n.createStartOnlyToken;else{if(!/onlyOffset/i.test(n.config.positionTracking))throw Error('Invalid <positionTracking> config option: "'+n.config.positionTracking+'"');n.createTokenInstance=n.createOffsetOnlyToken}n.hasCustom?(n.addToken=n.addTokenUsingPush,n.handlePayload=n.handlePayloadWithCustom):(n.addToken=n.addTokenUsingMemberAccess,n.handlePayload=n.handlePayloadNoCustom)})),n.TRACE_INIT("Failed Optimization Warnings",(function(){var e=Object(i.O)(n.canModeBeOptimized,(function(e,t,n){return!1===t&&e.push(n),e}),[]);if(t.ensureOptimizations&&!Object(i.A)(e))throw Error("Lexer Modes: < "+e.join(", ")+' > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.')})),n.TRACE_INIT("clearRegExpParserCache",(function(){a={}})),n.TRACE_INIT("toFastProperties",(function(){Object(i.S)(n)}))}))}return e.prototype.tokenize=function(e,t){if(void 0===t&&(t=this.defaultMode),!Object(i.A)(this.lexerDefinitionErrors)){var n=Object(i.I)(this.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+n)}return this.tokenizeInternal(e,t)},e.prototype.tokenizeInternal=function(e,t){var n,r,o,a,s,u,l,c,f,h,p,d,g,m,v,y,b,T=this,x=e,O=x.length,S=0,C=0,E=this.hasCustom?0:Math.floor(e.length/10),w=new Array(E),k=[],N=this.trackStartLines?1:void 0,A=this.trackStartLines?1:void 0,L=(v=this.emptyGroups,y={},b=Object(i.G)(v),Object(i.u)(b,(function(e){var t=v[e];if(!Object(i.y)(t))throw Error("non exhaustive match");y[e]=[]})),y),R=this.trackStartLines,I=this.config.lineTerminatorsPattern,M=0,P=[],j=[],D=[],F=[];Object.freeze(F);var U=void 0;function W(){return P}function H(e){var t=_(e),n=j[t];return void 0===n?F:n}var B,z=function(e){if(1===D.length&&void 0===e.tokenType.PUSH_MODE){var t=T.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);k.push({offset:e.startOffset,line:void 0!==e.startLine?e.startLine:void 0,column:void 0!==e.startColumn?e.startColumn:void 0,length:e.image.length,message:t})}else{D.pop();var n=Object(i.H)(D);P=T.patternIdxToConfig[n],j=T.charCodeToPatternIdxToConfig[n],M=P.length;var r=T.canModeBeOptimized[n]&&!1===T.config.safeMode;U=j&&r?H:W}};function G(e){D.push(e),j=this.charCodeToPatternIdxToConfig[e],P=this.patternIdxToConfig[e],M=P.length,M=P.length;var t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;U=j&&t?H:W}for(G.call(this,t);S<O;){s=null;var V=x.charCodeAt(S),K=U(V),q=K.length;for(n=0;n<q;n++){var $=(B=K[n]).pattern;if(u=null,!1!==(ie=B.short)?V===ie&&(s=$):!0===B.isCustom?null!==(m=$.exec(x,S,w,L))?(s=m[0],void 0!==m.payload&&(u=m.payload)):s=null:(this.updateLastIndex($,S),s=this.match($,e,S)),null!==s){if(void 0!==(a=B.longerAlt)){var Y=P[a],X=Y.pattern;l=null,!0===Y.isCustom?null!==(m=X.exec(x,S,w,L))?(o=m[0],void 0!==m.payload&&(l=m.payload)):o=null:(this.updateLastIndex(X,S),o=this.match(X,e,S)),o&&o.length>s.length&&(s=o,u=l,B=Y)}break}}if(null!==s){if(c=s.length,void 0!==(f=B.group)&&(h=B.tokenTypeIdx,p=this.createTokenInstance(s,S,h,B.tokenType,N,A,c),this.handlePayload(p,u),!1===f?C=this.addToken(w,C,p):L[f].push(p)),e=this.chopInput(e,c),S+=c,A=this.computeNewColumn(A,c),!0===R&&!0===B.canLineTerminator){var Z=0,J=void 0,Q=void 0;I.lastIndex=0;do{!0===(J=I.test(s))&&(Q=I.lastIndex-1,Z++)}while(!0===J);0!==Z&&(N+=Z,A=c-Q,this.updateTokenEndLineColumnLocation(p,f,Q,Z,N,A,c))}this.handleModes(B,z,G,p)}else{for(var ee=S,te=N,ne=A,re=!1;!re&&S<O;)for(x.charCodeAt(S),e=this.chopInput(e,1),S++,r=0;r<M;r++){var ie,oe=P[r];$=oe.pattern;if(!1!==(ie=oe.short)?x.charCodeAt(S)===ie&&(re=!0):!0===oe.isCustom?re=null!==$.exec(x,S,w,L):(this.updateLastIndex($,S),re=null!==$.exec(e)),!0===re)break}d=S-ee,g=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(x,ee,d,te,ne),k.push({offset:ee,line:te,column:ne,length:d,message:g})}}return this.hasCustom||(w.length=C),{tokens:w,groups:L,errors:k}},e.prototype.handleModes=function(e,t,n,r){if(!0===e.pop){var i=e.push;t(r),void 0!==i&&n.call(this,i)}else void 0!==e.push&&n.call(this,e.push)},e.prototype.chopInput=function(e,t){return e.substring(t)},e.prototype.updateLastIndex=function(e,t){e.lastIndex=t},e.prototype.updateTokenEndLineColumnLocation=function(e,t,n,r,i,o,a){var s,u;void 0!==t&&(u=(s=n===a-1)?-1:0,1===r&&!0===s||(e.endLine=i+u,e.endColumn=o-1-u))},e.prototype.computeNewColumn=function(e,t){return e+t},e.prototype.createTokenInstance=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return null},e.prototype.createOffsetOnlyToken=function(e,t,n,r){return{image:e,startOffset:t,tokenTypeIdx:n,tokenType:r}},e.prototype.createStartOnlyToken=function(e,t,n,r,i,o){return{image:e,startOffset:t,startLine:i,startColumn:o,tokenTypeIdx:n,tokenType:r}},e.prototype.createFullToken=function(e,t,n,r,i,o,a){return{image:e,startOffset:t,endOffset:t+a-1,startLine:i,endLine:i,startColumn:o,endColumn:o+a-1,tokenTypeIdx:n,tokenType:r}},e.prototype.addToken=function(e,t,n){return 666},e.prototype.addTokenUsingPush=function(e,t,n){return e.push(n),t},e.prototype.addTokenUsingMemberAccess=function(e,t,n){return e[t]=n,++t},e.prototype.handlePayload=function(e,t){},e.prototype.handlePayloadNoCustom=function(e,t){},e.prototype.handlePayloadWithCustom=function(e,t){null!==t&&(e.payload=t)},e.prototype.match=function(e,t,n){return null},e.prototype.matchWithTest=function(e,t,n){return!0===e.test(t)?t.substring(n,e.lastIndex):null},e.prototype.matchWithExec=function(e,t){var n=e.exec(t);return null!==n?n[0]:n},e.prototype.TRACE_INIT=function(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(n+"--\x3e <"+e+">");var r=Object(i.R)(t),o=r.time,a=r.value,s=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(n+"<-- <"+e+"> time: "+o+"ms"),this.traceInitIndent--,a}return t()},e.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",e.NA=/NOT_APPLICABLE/,e}();function Y(e){return Z(e)?e.LABEL:e.name}function X(e){return e.name}function Z(e){return Object(i.E)(e.LABEL)&&""!==e.LABEL}function J(e){return function(e){var t=e.pattern,n={};n.name=e.name,Object(i.F)(t)||(n.PATTERN=t);if(Object(i.w)(e,"parent"))throw"The parent property is no longer supported.\nSee: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.";Object(i.w)(e,"categories")&&(n.CATEGORIES=e.categories);H([n]),Object(i.w)(e,"label")&&(n.LABEL=e.label);Object(i.w)(e,"group")&&(n.GROUP=e.group);Object(i.w)(e,"pop_mode")&&(n.POP_MODE=e.pop_mode);Object(i.w)(e,"push_mode")&&(n.PUSH_MODE=e.push_mode);Object(i.w)(e,"longer_alt")&&(n.LONGER_ALT=e.longer_alt);Object(i.w)(e,"line_breaks")&&(n.LINE_BREAKS=e.line_breaks);Object(i.w)(e,"start_chars_hint")&&(n.START_CHARS_HINT=e.start_chars_hint);return n}(e)}var Q=J({name:"EOF",pattern:$.NA});function ee(e,t,n,r,i,o,a,s){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:o,startColumn:a,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function te(e,t){return D(e,t)}H([Q]);var ne=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),re=function(){function e(e){this.definition=e}return e.prototype.accept=function(e){e.visit(this),Object(i.u)(this.definition,(function(t){t.accept(e)}))},e}(),ie=function(e){function t(t){var n=e.call(this,[])||this;return n.idx=1,Object(i.f)(n,Object(i.N)(t,(function(e){return void 0!==e}))),n}return ne(t,e),Object.defineProperty(t.prototype,"definition",{get:function(){return void 0!==this.referencedRule?this.referencedRule.definition:[]},set:function(e){},enumerable:!1,configurable:!0}),t.prototype.accept=function(e){e.visit(this)},t}(re),oe=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.orgText="",Object(i.f)(n,Object(i.N)(t,(function(e){return void 0!==e}))),n}return ne(t,e),t}(re),ae=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.ignoreAmbiguities=!1,Object(i.f)(n,Object(i.N)(t,(function(e){return void 0!==e}))),n}return ne(t,e),t}(re),se=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(i.f)(n,Object(i.N)(t,(function(e){return void 0!==e}))),n}return ne(t,e),t}(re),ue=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(i.f)(n,Object(i.N)(t,(function(e){return void 0!==e}))),n}return ne(t,e),t}(re),le=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(i.f)(n,Object(i.N)(t,(function(e){return void 0!==e}))),n}return ne(t,e),t}(re),ce=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(i.f)(n,Object(i.N)(t,(function(e){return void 0!==e}))),n}return ne(t,e),t}(re),fe=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(i.f)(n,Object(i.N)(t,(function(e){return void 0!==e}))),n}return ne(t,e),t}(re),he=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,n.ignoreAmbiguities=!1,n.hasPredicates=!1,Object(i.f)(n,Object(i.N)(t,(function(e){return void 0!==e}))),n}return ne(t,e),t}(re),pe=function(){function e(e){this.idx=1,Object(i.f)(this,Object(i.N)(e,(function(e){return void 0!==e})))}return e.prototype.accept=function(e){e.visit(this)},e}();function de(e){return Object(i.I)(e,ge)}function ge(e){function t(e){return Object(i.I)(e,ge)}if(e instanceof ie)return{type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};if(e instanceof ae)return{type:"Alternative",definition:t(e.definition)};if(e instanceof se)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof ue)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof le)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:ge(new pe({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof fe)return{type:"RepetitionWithSeparator",idx:e.idx,separator:ge(new pe({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ce)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof he)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof pe){var n={type:"Terminal",name:e.terminalType.name,label:Y(e.terminalType),idx:e.idx},r=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(n.pattern=Object(i.D)(r)?r.source:r),n}if(e instanceof oe)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}var me=function(){function e(){}return e.prototype.walk=function(e,t){var n=this;void 0===t&&(t=[]),Object(i.u)(e.definition,(function(r,o){var a=Object(i.m)(e.definition,o+1);if(r instanceof ie)n.walkProdRef(r,a,t);else if(r instanceof pe)n.walkTerminal(r,a,t);else if(r instanceof ae)n.walkFlat(r,a,t);else if(r instanceof se)n.walkOption(r,a,t);else if(r instanceof ue)n.walkAtLeastOne(r,a,t);else if(r instanceof le)n.walkAtLeastOneSep(r,a,t);else if(r instanceof fe)n.walkManySep(r,a,t);else if(r instanceof ce)n.walkMany(r,a,t);else{if(!(r instanceof he))throw Error("non exhaustive match");n.walkOr(r,a,t)}}))},e.prototype.walkTerminal=function(e,t,n){},e.prototype.walkProdRef=function(e,t,n){},e.prototype.walkFlat=function(e,t,n){var r=t.concat(n);this.walk(e,r)},e.prototype.walkOption=function(e,t,n){var r=t.concat(n);this.walk(e,r)},e.prototype.walkAtLeastOne=function(e,t,n){var r=[new se({definition:e.definition})].concat(t,n);this.walk(e,r)},e.prototype.walkAtLeastOneSep=function(e,t,n){var r=ve(e,t,n);this.walk(e,r)},e.prototype.walkMany=function(e,t,n){var r=[new se({definition:e.definition})].concat(t,n);this.walk(e,r)},e.prototype.walkManySep=function(e,t,n){var r=ve(e,t,n);this.walk(e,r)},e.prototype.walkOr=function(e,t,n){var r=this,o=t.concat(n);Object(i.u)(e.definition,(function(e){var t=new ae({definition:[e]});r.walk(t,o)}))},e}();function ve(e,t,n){return[new se({definition:[new pe({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}var ye=function(){function e(){}return e.prototype.visit=function(e){var t=e;switch(t.constructor){case ie:return this.visitNonTerminal(t);case ae:return this.visitAlternative(t);case se:return this.visitOption(t);case ue:return this.visitRepetitionMandatory(t);case le:return this.visitRepetitionMandatoryWithSeparator(t);case fe:return this.visitRepetitionWithSeparator(t);case ce:return this.visitRepetition(t);case he:return this.visitAlternation(t);case pe:return this.visitTerminal(t);case oe:return this.visitRule(t);default:throw Error("non exhaustive match")}},e.prototype.visitNonTerminal=function(e){},e.prototype.visitAlternative=function(e){},e.prototype.visitOption=function(e){},e.prototype.visitRepetition=function(e){},e.prototype.visitRepetitionMandatory=function(e){},e.prototype.visitRepetitionMandatoryWithSeparator=function(e){},e.prototype.visitRepetitionWithSeparator=function(e){},e.prototype.visitAlternation=function(e){},e.prototype.visitTerminal=function(e){},e.prototype.visitRule=function(e){},e}(),be=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Te(e,t){return void 0===t&&(t=[]),!!(e instanceof se||e instanceof ce||e instanceof fe)||(e instanceof he?Object(i.Q)(e.definition,(function(e){return Te(e,t)})):!(e instanceof ie&&Object(i.j)(t,e))&&(e instanceof re&&(e instanceof ie&&t.push(e),Object(i.o)(e.definition,(function(e){return Te(e,t)})))))}function xe(e){if(e instanceof ie)return"SUBRULE";if(e instanceof se)return"OPTION";if(e instanceof he)return"OR";if(e instanceof ue)return"AT_LEAST_ONE";if(e instanceof le)return"AT_LEAST_ONE_SEP";if(e instanceof fe)return"MANY_SEP";if(e instanceof ce)return"MANY";if(e instanceof pe)return"CONSUME";throw Error("non exhaustive match")}var Oe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.separator="-",t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return be(t,e),t.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},t.prototype.visitTerminal=function(e){var t=e.terminalType.name+this.separator+"Terminal";Object(i.w)(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitNonTerminal=function(e){var t=e.nonTerminalName+this.separator+"Terminal";Object(i.w)(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitOption=function(e){this.dslMethods.option.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.dslMethods.repetitionWithSeparator.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.dslMethods.repetitionMandatory.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)},t.prototype.visitRepetition=function(e){this.dslMethods.repetition.push(e)},t.prototype.visitAlternation=function(e){this.dslMethods.alternation.push(e)},t}(ye),Se=new Oe;function Ce(e){if(e instanceof ie)return Ce(e.referencedRule);if(e instanceof pe)return[e.terminalType];if(function(e){return e instanceof ae||e instanceof se||e instanceof ce||e instanceof ue||e instanceof le||e instanceof fe||e instanceof pe||e instanceof oe}(e))return function(e){var t,n=[],r=e.definition,o=0,a=r.length>o,s=!0;for(;a&&s;)t=r[o],s=Te(t),n=n.concat(Ce(t)),o+=1,a=r.length>o;return Object(i.T)(n)}(e);if(function(e){return e instanceof he}(e))return function(e){var t=Object(i.I)(e.definition,(function(e){return Ce(e)}));return Object(i.T)(Object(i.t)(t))}(e);throw Error("non exhaustive match")}var Ee="_~IN~_",we=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ke=function(e){function t(t){var n=e.call(this)||this;return n.topProd=t,n.follows={},n}return we(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},t.prototype.walkTerminal=function(e,t,n){},t.prototype.walkProdRef=function(e,t,n){var r,i,o=(r=e.referencedRule,i=e.idx,r.name+i+Ee+this.topProd.name),a=t.concat(n),s=Ce(new ae({definition:a}));this.follows[o]=s},t}(me);var Ne={buildMismatchTokenMessage:function(e){var t=e.expected,n=e.actual;e.previous,e.ruleName;return"Expecting "+(Z(t)?"--\x3e "+Y(t)+" <--":"token of type --\x3e "+t.name+" <--")+" but found --\x3e '"+n.image+"' <--"},buildNotAllInputParsedMessage:function(e){var t=e.firstRedundant;e.ruleName;return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage:function(e){var t=e.expectedPathsPerAlt,n=e.actual,r=(e.previous,e.customUserDescription),o=(e.ruleName,"\nbut found: '"+Object(i.s)(n).image+"'");if(r)return"Expecting: "+r+o;var a=Object(i.O)(t,(function(e,t){return e.concat(t)}),[]),s=Object(i.I)(a,(function(e){return"["+Object(i.I)(e,(function(e){return Y(e)})).join(", ")+"]"}));return"Expecting: "+("one of these possible Token sequences:\n"+Object(i.I)(s,(function(e,t){return" "+(t+1)+". "+e})).join("\n"))+o},buildEarlyExitMessage:function(e){var t=e.expectedIterationPaths,n=e.actual,r=e.customUserDescription,o=(e.ruleName,"\nbut found: '"+Object(i.s)(n).image+"'");return r?"Expecting: "+r+o:"Expecting: "+("expecting at least one iteration which starts with one of these possible Token sequences::\n <"+Object(i.I)(t,(function(e){return"["+Object(i.I)(e,(function(e){return Y(e)})).join(",")+"]"})).join(" ,")+">")+o}};Object.freeze(Ne);var Ae={buildRuleNotFoundError:function(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"}},Le={buildDuplicateFoundError:function(e,t){var n,r=e.name,o=Object(i.s)(t),a=o.idx,s=xe(o),u=(n=o)instanceof pe?n.terminalType.name:n instanceof ie?n.nonTerminalName:"",l="->"+s+(a>0?a:"")+"<- "+(u?"with argument: ->"+u+"<-":"")+"\n appears more than once ("+t.length+" times) in the top level rule: ->"+r+"<-. \n For further details see: https://sap.github.io/chevrotain/docs/FAQ.html#NUMERICAL_SUFFIXES \n ";return l=(l=l.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildNamespaceConflictError:function(e){return"Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+e.name+">.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter."},buildAlternationPrefixAmbiguityError:function(e){var t=Object(i.I)(e.prefixPath,(function(e){return Y(e)})).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return"Ambiguous alternatives: <"+e.ambiguityIndices.join(" ,")+"> due to common lookahead prefix\nin <OR"+n+"> inside <"+e.topLevelRule.name+"> Rule,\n<"+t+"> may appears as a prefix path in all these alternatives.\nSee: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details."},buildAlternationAmbiguityError:function(e){var t=Object(i.I)(e.prefixPath,(function(e){return Y(e)})).join(", "),n=0===e.alternation.idx?"":e.alternation.idx,r="Ambiguous Alternatives Detected: <"+e.ambiguityIndices.join(" ,")+"> in <OR"+n+"> inside <"+e.topLevelRule.name+"> Rule,\n<"+t+"> may appears as a prefix path in all these alternatives.\n";return r+="See: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(e){var t=xe(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),"The repetition <"+t+"> within Rule <"+e.topLevelRule.name+"> can never consume any tokens.\nThis could lead to an infinite loop."},buildTokenNameError:function(e){return"Invalid Grammar Token name: ->"+e.tokenType.name+"<- it must match the pattern: ->"+e.expectedPattern.toString()+"<-"},buildEmptyAlternationError:function(e){return"Ambiguous empty alternative: <"+(e.emptyChoiceIdx+1)+"> in <OR"+e.alternation.idx+"> inside <"+e.topLevelRule.name+"> Rule.\nOnly the last alternative may be an empty alternative."},buildTooManyAlternativesError:function(e){return"An Alternation cannot have more than 256 alternatives:\n<OR"+e.alternation.idx+"> inside <"+e.topLevelRule.name+"> Rule.\n has "+(e.alternation.definition.length+1)+" alternatives."},buildLeftRecursionError:function(e){var t=e.topLevelRule.name;return"Left Recursion found in grammar.\nrule: <"+t+"> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n "+(t+" --\x3e "+i.I(e.leftRecursionPath,(function(e){return e.name})).concat([t]).join(" --\x3e "))+"\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring."},buildInvalidRuleNameError:function(e){return"Invalid grammar rule name: ->"+e.topLevelRule.name+"<- it must match the pattern: ->"+e.expectedPattern.toString()+"<-"},buildDuplicateRuleNameError:function(e){return"Duplicate definition, rule: ->"+(e.topLevelRule instanceof oe?e.topLevelRule.name:e.topLevelRule)+"<- is already defined in the grammar: ->"+e.grammarName+"<-"}},Re=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var Ie=function(e){function t(t,n){var r=e.call(this)||this;return r.nameToTopRule=t,r.errMsgProvider=n,r.errors=[],r}return Re(t,e),t.prototype.resolveRefs=function(){var e=this;Object(i.u)(Object(i.U)(this.nameToTopRule),(function(t){e.currTopLevel=t,t.accept(e)}))},t.prototype.visitNonTerminal=function(e){var t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Jt.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}},t}(ye),Me=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pe=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.path=n,r.nextTerminalName="",r.nextTerminalOccurrence=0,r.nextTerminalName=r.path.lastTok.name,r.nextTerminalOccurrence=r.path.lastTokOccurrence,r}return Me(t,e),t.prototype.walkTerminal=function(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){var r=t.concat(n),i=new ae({definition:r});this.possibleTokTypes=Ce(i),this.found=!0}},t}(function(e){function t(t,n){var r=e.call(this)||this;return r.topProd=t,r.path=n,r.possibleTokTypes=[],r.nextProductionName="",r.nextProductionOccurrence=0,r.found=!1,r.isAtEndOfPath=!1,r}return Me(t,e),t.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Object(i.g)(this.path.ruleStack).reverse(),this.occurrenceStack=Object(i.g)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},t.prototype.walk=function(t,n){void 0===n&&(n=[]),this.found||e.prototype.walk.call(this,t,n)},t.prototype.walkProdRef=function(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){var r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}},t.prototype.updateExpectedNext=function(){Object(i.A)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},t}(me)),_e=function(e){function t(t,n){var r=e.call(this)||this;return r.topRule=t,r.occurrence=n,r.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},r}return Me(t,e),t.prototype.startWalking=function(){return this.walk(this.topRule),this.result},t}(me),je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Me(t,e),t.prototype.walkMany=function(t,n,r){if(t.idx===this.occurrence){var o=Object(i.s)(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof pe&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkMany.call(this,t,n,r)},t}(_e),De=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Me(t,e),t.prototype.walkManySep=function(t,n,r){if(t.idx===this.occurrence){var o=Object(i.s)(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof pe&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkManySep.call(this,t,n,r)},t}(_e),Fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Me(t,e),t.prototype.walkAtLeastOne=function(t,n,r){if(t.idx===this.occurrence){var o=Object(i.s)(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof pe&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkAtLeastOne.call(this,t,n,r)},t}(_e),Ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Me(t,e),t.prototype.walkAtLeastOneSep=function(t,n,r){if(t.idx===this.occurrence){var o=Object(i.s)(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof pe&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkAtLeastOneSep.call(this,t,n,r)},t}(_e);function We(e,t,n){void 0===n&&(n=[]),n=Object(i.g)(n);var r=[],o=0;function a(a){var s=We(a.concat(Object(i.m)(e,o+1)),t,n);return r.concat(s)}for(;n.length<t&&o<e.length;){var s=e[o];if(s instanceof ae)return a(s.definition);if(s instanceof ie)return a(s.definition);if(s instanceof se)r=a(s.definition);else{if(s instanceof ue)return a(u=s.definition.concat([new ce({definition:s.definition})]));if(s instanceof le)return a(u=[new ae({definition:s.definition}),new ce({definition:[new pe({terminalType:s.separator})].concat(s.definition)})]);if(s instanceof fe){var u=s.definition.concat([new ce({definition:[new pe({terminalType:s.separator})].concat(s.definition)})]);r=a(u)}else if(s instanceof ce){u=s.definition.concat([new ce({definition:s.definition})]);r=a(u)}else{if(s instanceof he)return Object(i.u)(s.definition,(function(e){!1===Object(i.A)(e.definition)&&(r=a(e.definition))})),r;if(!(s instanceof pe))throw Error("non exhaustive match");n.push(s.terminalType)}}o++}return r.push({partialPath:n,suffixDef:Object(i.m)(e,o)}),r}function He(e,t,n,r){var o=["EXIT_NONE_TERMINAL"],a=!1,s=t.length,u=s-r-1,l=[],c=[];for(c.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!Object(i.A)(c);){var f=c.pop();if("EXIT_ALTERNATIVE"!==f){var h=f.def,p=f.idx,d=f.ruleStack,g=f.occurrenceStack;if(!Object(i.A)(h)){var m=h[0];if("EXIT_NONE_TERMINAL"===m){var v={idx:p,def:Object(i.m)(h),ruleStack:Object(i.n)(d),occurrenceStack:Object(i.n)(g)};c.push(v)}else if(m instanceof pe)if(p<s-1){var y=p+1;if(n(t[y],m.terminalType)){v={idx:y,def:Object(i.m)(h),ruleStack:d,occurrenceStack:g};c.push(v)}}else{if(p!==s-1)throw Error("non exhaustive match");l.push({nextTokenType:m.terminalType,nextTokenOccurrence:m.idx,ruleStack:d,occurrenceStack:g}),a=!0}else if(m instanceof ie){var b=Object(i.g)(d);b.push(m.nonTerminalName);var T=Object(i.g)(g);T.push(m.idx);v={idx:p,def:m.definition.concat(o,Object(i.m)(h)),ruleStack:b,occurrenceStack:T};c.push(v)}else if(m instanceof se){var x={idx:p,def:Object(i.m)(h),ruleStack:d,occurrenceStack:g};c.push(x),c.push("EXIT_ALTERNATIVE");var O={idx:p,def:m.definition.concat(Object(i.m)(h)),ruleStack:d,occurrenceStack:g};c.push(O)}else if(m instanceof ue){var S=new ce({definition:m.definition,idx:m.idx});v={idx:p,def:m.definition.concat([S],Object(i.m)(h)),ruleStack:d,occurrenceStack:g};c.push(v)}else if(m instanceof le){var C=new pe({terminalType:m.separator});S=new ce({definition:[C].concat(m.definition),idx:m.idx}),v={idx:p,def:m.definition.concat([S],Object(i.m)(h)),ruleStack:d,occurrenceStack:g};c.push(v)}else if(m instanceof fe){x={idx:p,def:Object(i.m)(h),ruleStack:d,occurrenceStack:g};c.push(x),c.push("EXIT_ALTERNATIVE");C=new pe({terminalType:m.separator});var E=new ce({definition:[C].concat(m.definition),idx:m.idx});O={idx:p,def:m.definition.concat([E],Object(i.m)(h)),ruleStack:d,occurrenceStack:g};c.push(O)}else if(m instanceof ce){x={idx:p,def:Object(i.m)(h),ruleStack:d,occurrenceStack:g};c.push(x),c.push("EXIT_ALTERNATIVE");E=new ce({definition:m.definition,idx:m.idx}),O={idx:p,def:m.definition.concat([E],Object(i.m)(h)),ruleStack:d,occurrenceStack:g};c.push(O)}else if(m instanceof he)for(var w=m.definition.length-1;w>=0;w--){var k={idx:p,def:m.definition[w].definition.concat(Object(i.m)(h)),ruleStack:d,occurrenceStack:g};c.push(k),c.push("EXIT_ALTERNATIVE")}else if(m instanceof ae)c.push({idx:p,def:m.definition.concat(Object(i.m)(h)),ruleStack:d,occurrenceStack:g});else{if(!(m instanceof oe))throw Error("non exhaustive match");c.push(Be(m,p,d,g))}}}else a&&Object(i.H)(c).idx<=u&&c.pop()}return l}function Be(e,t,n,r){var o=Object(i.g)(n);o.push(e.name);var a=Object(i.g)(r);return a.push(1),{idx:t,def:e.definition,ruleStack:o,occurrenceStack:a}}var ze,Ge=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"}(ze||(ze={}));var Ve=function(e){function t(t,n,r){var i=e.call(this)||this;return i.topProd=t,i.targetOccurrence=n,i.targetProdType=r,i}return Ge(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},t.prototype.checkIsTarget=function(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=n.concat(r),!0)},t.prototype.walkOption=function(t,n,r){this.checkIsTarget(t,ze.OPTION,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkAtLeastOne=function(t,n,r){this.checkIsTarget(t,ze.REPETITION_MANDATORY,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkAtLeastOneSep=function(t,n,r){this.checkIsTarget(t,ze.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkMany=function(t,n,r){this.checkIsTarget(t,ze.REPETITION,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkManySep=function(t,n,r){this.checkIsTarget(t,ze.REPETITION_WITH_SEPARATOR,n,r)||e.prototype.walkOption.call(this,t,n,r)},t}(me),Ke=function(e){function t(t,n,r){var i=e.call(this)||this;return i.targetOccurrence=t,i.targetProdType=n,i.targetRef=r,i.result=[],i}return Ge(t,e),t.prototype.checkIsTarget=function(e,t){e.idx!==this.targetOccurrence||this.targetProdType!==t||void 0!==this.targetRef&&e!==this.targetRef||(this.result=e.definition)},t.prototype.visitOption=function(e){this.checkIsTarget(e,ze.OPTION)},t.prototype.visitRepetition=function(e){this.checkIsTarget(e,ze.REPETITION)},t.prototype.visitRepetitionMandatory=function(e){this.checkIsTarget(e,ze.REPETITION_MANDATORY)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.checkIsTarget(e,ze.REPETITION_MANDATORY_WITH_SEPARATOR)},t.prototype.visitRepetitionWithSeparator=function(e){this.checkIsTarget(e,ze.REPETITION_WITH_SEPARATOR)},t.prototype.visitAlternation=function(e){this.checkIsTarget(e,ze.ALTERNATION)},t}(ye);function qe(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=[];return t}function $e(e){for(var t=[""],n=0;n<e.length;n++){for(var r=e[n],i=[],o=0;o<t.length;o++){var a=t[o];i.push(a+"_"+r.tokenTypeIdx);for(var s=0;s<r.categoryMatches.length;s++){var u="_"+r.categoryMatches[s];i.push(a+u)}}t=i}return t}function Ye(e,t,n){for(var r=0;r<e.length;r++)if(r!==n)for(var i=e[r],o=0;o<t.length;o++){if(!0===i[t[o]])return!1}return!0}function Xe(e,t){for(var n=Object(i.I)(e,(function(e){return We([e],1)})),r=qe(n.length),o=Object(i.I)(n,(function(e){var t={};return Object(i.u)(e,(function(e){var n=$e(e.partialPath);Object(i.u)(n,(function(e){t[e]=!0}))})),t})),a=n,s=1;s<=t;s++){var u=a;a=qe(u.length);for(var l=function(e){for(var n=u[e],l=0;l<n.length;l++){var c=n[l].partialPath,f=n[l].suffixDef,h=$e(c);if(Ye(o,h,e)||Object(i.A)(f)||c.length===t){var p=r[e];if(!1===Qe(p,c)){p.push(c);for(var d=0;d<h.length;d++){var g=h[d];o[e][g]=!0}}}else{var m=We(f,s+1,c);a[e]=a[e].concat(m),Object(i.u)(m,(function(t){var n=$e(t.partialPath);Object(i.u)(n,(function(t){o[e][t]=!0}))}))}}},c=0;c<u.length;c++)l(c)}return r}function Ze(e,t,n,r){var i=new Ke(e,ze.ALTERNATION,r);return t.accept(i),Xe(i.result,n)}function Je(e,t,n,r){var i=new Ke(e,n);t.accept(i);var o=i.result,a=new Ve(t,e,n).startWalking();return Xe([new ae({definition:o}),new ae({definition:a})],r)}function Qe(e,t){e:for(var n=0;n<e.length;n++){var r=e[n];if(r.length===t.length){for(var i=0;i<r.length;i++){var o=t[i],a=r[i];if(!1===(o===a||void 0!==a.categoryMatchesMap[o.tokenTypeIdx]))continue e}return!0}}return!1}function et(e){return Object(i.o)(e,(function(e){return Object(i.o)(e,(function(e){return Object(i.o)(e,(function(e){return Object(i.A)(e.categoryMatches)}))}))}))}var tt=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function nt(e,t,n,r,o){var a=i.I(e,(function(e){return function(e,t){var n=new ot;e.accept(n);var r=n.allProductions,o=i.v(r,rt),a=i.N(o,(function(e){return e.length>1}));return i.I(i.U(a),(function(n){var r=i.s(n),o=t.buildDuplicateFoundError(e,n),a=xe(r),s={message:o,type:Jt.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:a,occurrence:r.idx},u=it(r);return u&&(s.parameter=u),s}))}(e,r)})),s=i.I(e,(function(e){return function e(t,n,r,o){void 0===o&&(o=[]);var a=[],s=function e(t){var n=[];if(i.A(t))return n;var r=i.s(t);if(r instanceof ie)n.push(r.referencedRule);else if(r instanceof ae||r instanceof se||r instanceof ue||r instanceof le||r instanceof fe||r instanceof ce)n=n.concat(e(r.definition));else if(r instanceof he)n=i.t(i.I(r.definition,(function(t){return e(t.definition)})));else if(!(r instanceof pe))throw Error("non exhaustive match");var o=Te(r),a=t.length>1;if(o&&a){var s=i.m(t);return n.concat(e(s))}return n}(n.definition);if(i.A(s))return[];var u=t.name;i.j(s,t)&&a.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:o}),type:Jt.LEFT_RECURSION,ruleName:u});var l=i.l(s,o.concat([t])),c=i.I(l,(function(n){var a=i.g(o);return a.push(n),e(t,n,r,a)}));return a.concat(i.t(c))}(e,e,r)})),u=[],l=[],c=[];Object(i.o)(s,i.A)&&(u=Object(i.I)(e,(function(e){return function(e,t){var n=new st;e.accept(n);var r=n.alternations;return i.O(r,(function(n,r){var o=i.n(r.definition),a=i.I(o,(function(n,o){var a=He([n],[],null,1);return i.A(a)?{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:r,emptyChoiceIdx:o}),type:Jt.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:r.idx,alternative:o+1}:null}));return n.concat(i.i(a))}),[])}(e,r)})),l=Object(i.I)(e,(function(e){return function(e,t,n){var r=new st;e.accept(r);var o=r.alternations;return o=Object(i.P)(o,(function(e){return!0===e.ignoreAmbiguities})),i.O(o,(function(r,o){var a=o.idx,s=o.maxLookahead||t,u=Ze(a,e,s,o),l=function(e,t,n,r){var o=[],a=Object(i.O)(e,(function(n,r,a){return!0===t.definition[a].ignoreAmbiguities||Object(i.u)(r,(function(r){var s=[a];Object(i.u)(e,(function(e,n){a!==n&&Qe(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&s.push(n)})),s.length>1&&!Qe(o,r)&&(o.push(r),n.push({alts:s,path:r}))})),n}),[]);return i.I(a,(function(e){var o=Object(i.I)(e.alts,(function(e){return e+1}));return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:o,prefixPath:e.path}),type:Jt.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:[e.alts]}}))}(u,o,e,n),c=function(e,t,n,r){var o=[],a=Object(i.O)(e,(function(e,t,n){var r=Object(i.I)(t,(function(e){return{idx:n,path:e}}));return e.concat(r)}),[]);return Object(i.u)(a,(function(e){if(!0!==t.definition[e.idx].ignoreAmbiguities){var s=e.idx,u=e.path,l=Object(i.r)(a,(function(e){return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx<s&&(n=e.path,r=u,n.length<r.length&&Object(i.o)(n,(function(e,t){var n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]})));var n,r})),c=Object(i.I)(l,(function(e){var i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:Jt.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}}));o=o.concat(c)}})),o}(u,o,e,n);return r.concat(l,c)}),[])}(e,t,r)})),c=function(e,t,n){var r=[];return Object(i.u)(e,(function(e){var o=new ut;e.accept(o);var a=o.allProductions;Object(i.u)(a,(function(o){var a=function(e){if(e instanceof se)return ze.OPTION;if(e instanceof ce)return ze.REPETITION;if(e instanceof ue)return ze.REPETITION_MANDATORY;if(e instanceof le)return ze.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof fe)return ze.REPETITION_WITH_SEPARATOR;if(e instanceof he)return ze.ALTERNATION;throw Error("non exhaustive match")}(o),s=o.maxLookahead||t,u=Je(o.idx,e,a,s)[0];if(Object(i.A)(Object(i.t)(u))){var l=n.buildEmptyRepetitionError({topLevelRule:e,repetition:o});r.push({message:l,type:Jt.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}}))})),r}(e,t,r));var f=function(e,t,n){var r=[],o=Object(i.I)(t,(function(e){return e.name}));return Object(i.u)(e,(function(e){var t=e.name;if(Object(i.j)(o,t)){var a=n.buildNamespaceConflictError(e);r.push({message:a,type:Jt.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}})),r}(e,n,r),h=i.I(n,(function(e){return function(e,t){var n=[];e.name.match(at)||n.push({message:t.buildTokenNameError({tokenType:e,expectedPattern:at}),type:Jt.INVALID_TOKEN_NAME});return n}(e,r)})),p=Object(i.I)(e,(function(e){return function(e,t){var n=new st;e.accept(n);var r=n.alternations;return i.O(r,(function(n,r){return r.definition.length>255&&n.push({message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:r}),type:Jt.TOO_MANY_ALTS,ruleName:e.name,occurrence:r.idx}),n}),[])}(e,r)})),d=Object(i.I)(e,(function(e){return function(e,t){var n=[],r=e.name;r.match(at)||n.push({message:t.buildInvalidRuleNameError({topLevelRule:e,expectedPattern:at}),type:Jt.INVALID_RULE_NAME,ruleName:r});return n}(e,r)})),g=Object(i.I)(e,(function(t){return function(e,t,n,r){var o=[];if(Object(i.O)(t,(function(t,n){return n.name===e.name?t+1:t}),0)>1){var a=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});o.push({message:a,type:Jt.DUPLICATE_RULE_NAME,ruleName:e.name})}return o}(t,e,o,r)}));return i.t(a.concat(h,c,s,u,l,f,p,d,g))}function rt(e){return xe(e)+"_#_"+e.idx+"_#_"+it(e)}function it(e){return e instanceof pe?e.terminalType.name:e instanceof ie?e.nonTerminalName:""}var ot=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return tt(t,e),t.prototype.visitNonTerminal=function(e){this.allProductions.push(e)},t.prototype.visitOption=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t.prototype.visitAlternation=function(e){this.allProductions.push(e)},t.prototype.visitTerminal=function(e){this.allProductions.push(e)},t}(ye),at=/^[a-zA-Z_]\w*$/;var st=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.alternations=[],t}return tt(t,e),t.prototype.visitAlternation=function(e){this.alternations.push(e)},t}(ye);var ut=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return tt(t,e),t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t}(ye);function lt(e){e=Object(i.k)(e,{errMsgProvider:Ae});var t,n,r,o={};return Object(i.u)(e.rules,(function(e){o[e.name]=e})),t=o,n=e.errMsgProvider,(r=new Ie(t,n)).resolveRefs(),r.errors}function ct(e){return nt((e=Object(i.k)(e,{errMsgProvider:Le})).rules,e.maxLookahead,e.tokenTypes,e.errMsgProvider,e.grammarName)}function ft(e){Object(i.u)(e.rules,(function(e){var t=new Oe;e.accept(t),Object(i.u)(t.dslMethods,(function(e){Object(i.u)(e,(function(e,t){e.idx=t+1}))}))}))}var ht=["MismatchedTokenException","NoViableAltException","EarlyExitException","NotAllInputParsedException"];function pt(e){return Object(i.j)(ht,e.name)}function dt(e,t,n){this.name="MismatchedTokenException",this.message=e,this.token=t,this.previousToken=n,this.resyncedTokens=[]}function gt(e,t,n){this.name="NoViableAltException",this.message=e,this.token=t,this.previousToken=n,this.resyncedTokens=[]}function mt(e,t){this.name="NotAllInputParsedException",this.message=e,this.token=t,this.resyncedTokens=[]}function vt(e,t,n){this.name="EarlyExitException",this.message=e,this.token=t,this.previousToken=n,this.resyncedTokens=[]}Object.freeze(ht),dt.prototype=Error.prototype,gt.prototype=Error.prototype,mt.prototype=Error.prototype,vt.prototype=Error.prototype;var yt={};function bt(e){this.name="InRuleRecoveryException",this.message=e}bt.prototype=Error.prototype;var Tt=function(){function e(){}return e.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object(i.w)(e,"recoveryEnabled")?e.recoveryEnabled:Qt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=xt)},e.prototype.getTokenToInsert=function(e){var t=ee(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},e.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},e.prototype.tryInRepetitionRecovery=function(e,t,n,r){for(var o=this,a=this.findReSyncTokenType(),s=this.exportLexerState(),u=[],l=!1,c=this.LA(1),f=this.LA(1),h=function(){var e=o.LA(0),t=new dt(o.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:c,previous:e,ruleName:o.getCurrRuleFullName()}),c,o.LA(0));t.resyncedTokens=Object(i.n)(u),o.SAVE_ERROR(t)};!l;){if(this.tokenMatcher(f,r))return void h();if(n.call(this))return h(),void e.apply(this,t);this.tokenMatcher(f,a)?l=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,u))}this.importLexerState(s)},e.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,n){return!1!==n&&(void 0!==e&&void 0!==t&&(!this.tokenMatcher(this.LA(1),e)&&(!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))))},e.prototype.getFollowsForInRuleRecovery=function(e,t){var n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)},e.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new bt("sad sad panda")},e.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},e.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var n=this;if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(Object(i.A)(t))return!1;var r=this.LA(1);return void 0!==Object(i.q)(t,(function(e){return n.tokenMatcher(r,e)}))},e.prototype.canRecoverWithSingleTokenDeletion=function(e){return this.tokenMatcher(this.LA(2),e)},e.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(t);return Object(i.j)(n,e)},e.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),n=2;;){var r=t.tokenType;if(Object(i.j)(e,r))return r;t=this.LA(n),n++}},e.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return yt;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}},e.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return Object(i.I)(t,(function(r,i){return 0===i?yt:{ruleName:e.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:e.shortRuleNameToFullName(t[i-1])}}))},e.prototype.flattenFollowSet=function(){var e=this,t=Object(i.I)(this.buildFullFollowKeyStack(),(function(t){return e.getFollowSetFromFollowKey(t)}));return Object(i.t)(t)},e.prototype.getFollowSetFromFollowKey=function(e){if(e===yt)return[Q];var t=e.ruleName+e.idxInCallingRule+Ee+e.inRule;return this.resyncFollows[t]},e.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,Q)||t.push(e),t},e.prototype.reSyncTo=function(e){for(var t=[],n=this.LA(1);!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return Object(i.n)(t)},e.prototype.attemptInRepetitionRecovery=function(e,t,n,r,i,o,a){},e.prototype.getCurrentGrammarPath=function(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:Object(i.g)(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}},e.prototype.getHumanReadableRuleStack=function(){var e=this;return Object(i.I)(this.RULE_STACK,(function(t){return e.shortRuleNameToFullName(t)}))},e}();function xt(e,t,n,r,i,o,a){var s=this.getKeyForAutomaticLookahead(r,i),u=this.firstAfterRepMap[s];if(void 0===u){var l=this.getCurrRuleFullName();u=new o(this.getGAstProductions()[l],i).startWalking(),this.firstAfterRepMap[s]=u}var c=u.token,f=u.occurrence,h=u.isEndOfRule;1===this.RULE_STACK.length&&h&&void 0===c&&(c=Q,f=1),this.shouldInRepetitionRecoveryBeTried(c,f,a)&&this.tryInRepetitionRecovery(e,t,n,c)}function Ot(e,t,n){return n|t|e}var St=function(){function e(){}return e.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=Object(i.w)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Qt.dynamicTokensEnabled,this.maxLookahead=Object(i.w)(e,"maxLookahead")?e.maxLookahead:Qt.maxLookahead,this.lookAheadFuncsCache=Object(i.z)()?new Map:[],Object(i.z)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},e.prototype.preComputeLookaheadFunctions=function(e){var t=this;Object(i.u)(e,(function(e){t.TRACE_INIT(e.name+" Rule Lookahead",(function(){var n=function(e){Se.reset(),e.accept(Se);var t=Se.dslMethods;return Se.reset(),t}(e),r=n.alternation,o=n.repetition,a=n.option,s=n.repetitionMandatory,u=n.repetitionMandatoryWithSeparator,l=n.repetitionWithSeparator;Object(i.u)(r,(function(n){var r=0===n.idx?"":n.idx;t.TRACE_INIT(""+xe(n)+r,(function(){var r,i,o,a,s,u,l,c=(r=n.idx,i=e,o=n.maxLookahead||t.maxLookahead,a=n.hasPredicates,s=t.dynamicTokensEnabled,u=t.lookAheadBuilderForAlternatives,l=Ze(r,i,o),u(l,a,et(l)?F:D,s)),f=Ot(t.fullRuleNameToShort[e.name],256,n.idx);t.setLaFuncCache(f,c)}))})),Object(i.u)(o,(function(n){t.computeLookaheadFunc(e,n.idx,768,ze.REPETITION,n.maxLookahead,xe(n))})),Object(i.u)(a,(function(n){t.computeLookaheadFunc(e,n.idx,512,ze.OPTION,n.maxLookahead,xe(n))})),Object(i.u)(s,(function(n){t.computeLookaheadFunc(e,n.idx,1024,ze.REPETITION_MANDATORY,n.maxLookahead,xe(n))})),Object(i.u)(u,(function(n){t.computeLookaheadFunc(e,n.idx,1536,ze.REPETITION_MANDATORY_WITH_SEPARATOR,n.maxLookahead,xe(n))})),Object(i.u)(l,(function(n){t.computeLookaheadFunc(e,n.idx,1280,ze.REPETITION_WITH_SEPARATOR,n.maxLookahead,xe(n))}))}))}))},e.prototype.computeLookaheadFunc=function(e,t,n,r,i,o){var a=this;this.TRACE_INIT(""+o+(0===t?"":t),(function(){var o=function(e,t,n,r,i,o){var a=Je(e,t,i,n),s=et(a)?F:D;return o(a[0],s,r)}(t,e,i||a.maxLookahead,a.dynamicTokensEnabled,r,a.lookAheadBuilderForOptional),s=Ot(a.fullRuleNameToShort[e.name],n,t);a.setLaFuncCache(s,o)}))},e.prototype.lookAheadBuilderForOptional=function(e,t,n){return function(e,t,n){var r=Object(i.o)(e,(function(e){return 1===e.length})),o=e.length;if(r&&!n){var a=Object(i.t)(e);if(1===a.length&&Object(i.A)(a[0].categoryMatches)){var s=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}var u=Object(i.O)(a,(function(e,t,n){return e[t.tokenTypeIdx]=!0,Object(i.u)(t.categoryMatches,(function(t){e[t]=!0})),e}),[]);return function(){var e=this.LA(1);return!0===u[e.tokenTypeIdx]}}return function(){e:for(var n=0;n<o;n++){for(var r=e[n],i=r.length,a=0;a<i;a++){var s=this.LA(a+1);if(!1===t(s,r[a]))continue e}return!0}return!1}}(e,t,n)},e.prototype.lookAheadBuilderForAlternatives=function(e,t,n,r){return function(e,t,n,r){var o=e.length,a=Object(i.o)(e,(function(e){return Object(i.o)(e,(function(e){return 1===e.length}))}));if(t)return function(t){for(var r=Object(i.I)(t,(function(e){return e.GATE})),a=0;a<o;a++){var s=e[a],u=s.length,l=r[a];if(void 0===l||!1!==l.call(this))e:for(var c=0;c<u;c++){for(var f=s[c],h=f.length,p=0;p<h;p++){var d=this.LA(p+1);if(!1===n(d,f[p]))continue e}return a}}};if(a&&!r){var s=Object(i.I)(e,(function(e){return Object(i.t)(e)})),u=Object(i.O)(s,(function(e,t,n){return Object(i.u)(t,(function(t){Object(i.w)(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),Object(i.u)(t.categoryMatches,(function(t){Object(i.w)(e,t)||(e[t]=n)}))})),e}),[]);return function(){var e=this.LA(1);return u[e.tokenTypeIdx]}}return function(){for(var t=0;t<o;t++){var r=e[t],i=r.length;e:for(var a=0;a<i;a++){for(var s=r[a],u=s.length,l=0;l<u;l++){var c=this.LA(l+1);if(!1===n(c,s[l]))continue e}return t}}}}(e,t,n,r)},e.prototype.getKeyForAutomaticLookahead=function(e,t){return Ot(this.getLastExplicitRuleShortName(),e,t)},e.prototype.getLaFuncFromCache=function(e){},e.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},e.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},e.prototype.setLaFuncCache=function(e,t){},e.prototype.setLaFuncCacheUsingMap=function(e,t){this.lookAheadFuncsCache.set(e,t)},e.prototype.setLaFuncUsingObj=function(e,t){this.lookAheadFuncsCache[e]=t},e}();function Ct(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset==!0&&(e.endOffset=t.endOffset)}function Et(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset==!0&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}var wt,kt=/^\s*function\s*(\S*)\s*\(/;function Nt(e){var t=e.name;return t||e.toString().match(kt)[1]}function At(e,t){var n=Object.getOwnPropertyDescriptor(e,"name");return!(!Object(i.F)(n)&&!n.configurable)&&(Object.defineProperty(e,"name",{enumerable:!1,configurable:!0,writable:!1,value:t}),!0)}function Lt(e,t){for(var n=Object(i.G)(e),r=n.length,o=0;o<r;o++)for(var a=e[n[o]],s=a.length,u=0;u<s;u++){var l=a[u];void 0===l.tokenTypeIdx&&this[l.name](l.children,t)}}function Rt(e,t){var n=function(){};return At(n,e+"BaseSemantics"),(n.prototype={visit:function(e,t){if(Object(i.y)(e)&&(e=e[0]),!Object(i.F)(e))return this[e.name](e.children,t)},validateVisitor:function(){var e=function(e,t){var n=function(e,t){var n=Object(i.I)(t,(function(t){if(!Object(i.B)(e[t]))return{msg:"Missing visitor method: <"+t+"> on "+Nt(e.constructor)+" CST Visitor.",type:wt.MISSING_METHOD,methodName:t}}));return Object(i.i)(n)}(e,t),r=function(e,t){var n=[];for(var r in e)at.test(r)&&Object(i.B)(e[r])&&!Object(i.j)(It,r)&&!Object(i.j)(t,r)&&n.push({msg:"Redundant visitor method: <"+r+"> on "+Nt(e.constructor)+" CST Visitor\nThere is no Grammar Rule corresponding to this method's name.\nFor utility methods on visitor classes use methods names that do not match /"+at.source+"/.",type:wt.REDUNDANT_METHOD,methodName:r});return n}(e,t);return n.concat(r)}(this,t);if(!Object(i.A)(e)){var n=Object(i.I)(e,(function(e){return e.msg}));throw Error("Errors Detected in CST Visitor <"+Nt(this.constructor)+">:\n\t"+n.join("\n\n").replace(/\n/g,"\n\t"))}}}).constructor=n,n._RULE_NAMES=t,n}!function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"}(wt||(wt={}));var It=["constructor","visit","validateVisitor"];var Mt=function(){function e(){}return e.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object(i.w)(e,"nodeLocationTracking")?e.nodeLocationTracking:Qt.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Et,this.setNodeLocationFromNode=Et,this.cstPostRule=i.b,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=i.b,this.setNodeLocationFromNode=i.b,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Ct,this.setNodeLocationFromNode=Ct,this.cstPostRule=i.b,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=i.b,this.setNodeLocationFromNode=i.b,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error('Invalid <nodeLocationTracking> config option: "'+e.nodeLocationTracking+'"');this.setNodeLocationFromToken=i.b,this.setNodeLocationFromNode=i.b,this.cstPostRule=i.b,this.setInitialNodeLocation=i.b}else this.cstInvocationStateUpdate=i.b,this.cstFinallyStateUpdate=i.b,this.cstPostTerminal=i.b,this.cstPostNonTerminal=i.b,this.cstPostRule=i.b},e.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},e.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},e.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.cstInvocationStateUpdate=function(e,t){var n={name:e,children:{}};this.setInitialNodeLocation(n),this.CST_STACK.push(n)},e.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},e.prototype.cstPostRuleFull=function(e){var t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==!0?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)},e.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==!0?n.endOffset=t.endOffset:n.startOffset=NaN},e.prototype.cstPostTerminal=function(e,t){var n,r,i,o=this.CST_STACK[this.CST_STACK.length-1];r=t,i=e,void 0===(n=o).children[i]?n.children[i]=[r]:n.children[i].push(r),this.setNodeLocationFromToken(o.location,t)},e.prototype.cstPostNonTerminal=function(e,t){var n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)},e.prototype.getBaseCstVisitorConstructor=function(){if(Object(i.F)(this.baseCstVisitorConstructor)){var e=Rt(this.className,Object(i.G)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},e.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(Object(i.F)(this.baseCstVisitorWithDefaultsConstructor)){var e=function(e,t,n){var r=function(){};At(r,e+"BaseSemanticsWithDefaults");var o=Object.create(n.prototype);return Object(i.u)(t,(function(e){o[e]=Lt})),(r.prototype=o).constructor=r,r}(this.className,Object(i.G)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},e.prototype.getLastExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-1]},e.prototype.getPreviousExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-2]},e.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},e}(),Pt=function(){function e(){}return e.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(e.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(!0!==this.selfAnalysisDone)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!1,configurable:!0}),e.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Zt},e.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Zt:this.tokVector[t]},e.prototype.consumeToken=function(){this.currIdx++},e.prototype.exportLexerState=function(){return this.currIdx},e.prototype.importLexerState=function(e){this.currIdx=e},e.prototype.resetLexerState=function(){this.currIdx=-1},e.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},e.prototype.getLexerPosition=function(){return this.exportLexerState()},e}(),_t=function(){function e(){}return e.prototype.ACTION=function(e){return e.call(this)},e.prototype.consume=function(e,t,n){return this.consumeInternal(t,e,n)},e.prototype.subrule=function(e,t,n){return this.subruleInternal(t,e,n)},e.prototype.option=function(e,t){return this.optionInternal(t,e)},e.prototype.or=function(e,t){return this.orInternal(t,e)},e.prototype.many=function(e,t){return this.manyInternal(e,t)},e.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},e.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},e.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},e.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},e.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},e.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},e.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},e.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},e.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},e.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},e.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},e.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},e.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},e.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},e.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},e.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},e.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},e.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},e.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},e.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},e.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},e.prototype.OPTION=function(e){return this.optionInternal(e,0)},e.prototype.OPTION1=function(e){return this.optionInternal(e,1)},e.prototype.OPTION2=function(e){return this.optionInternal(e,2)},e.prototype.OPTION3=function(e){return this.optionInternal(e,3)},e.prototype.OPTION4=function(e){return this.optionInternal(e,4)},e.prototype.OPTION5=function(e){return this.optionInternal(e,5)},e.prototype.OPTION6=function(e){return this.optionInternal(e,6)},e.prototype.OPTION7=function(e){return this.optionInternal(e,7)},e.prototype.OPTION8=function(e){return this.optionInternal(e,8)},e.prototype.OPTION9=function(e){return this.optionInternal(e,9)},e.prototype.OR=function(e){return this.orInternal(e,0)},e.prototype.OR1=function(e){return this.orInternal(e,1)},e.prototype.OR2=function(e){return this.orInternal(e,2)},e.prototype.OR3=function(e){return this.orInternal(e,3)},e.prototype.OR4=function(e){return this.orInternal(e,4)},e.prototype.OR5=function(e){return this.orInternal(e,5)},e.prototype.OR6=function(e){return this.orInternal(e,6)},e.prototype.OR7=function(e){return this.orInternal(e,7)},e.prototype.OR8=function(e){return this.orInternal(e,8)},e.prototype.OR9=function(e){return this.orInternal(e,9)},e.prototype.MANY=function(e){this.manyInternal(0,e)},e.prototype.MANY1=function(e){this.manyInternal(1,e)},e.prototype.MANY2=function(e){this.manyInternal(2,e)},e.prototype.MANY3=function(e){this.manyInternal(3,e)},e.prototype.MANY4=function(e){this.manyInternal(4,e)},e.prototype.MANY5=function(e){this.manyInternal(5,e)},e.prototype.MANY6=function(e){this.manyInternal(6,e)},e.prototype.MANY7=function(e){this.manyInternal(7,e)},e.prototype.MANY8=function(e){this.manyInternal(8,e)},e.prototype.MANY9=function(e){this.manyInternal(9,e)},e.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},e.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},e.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},e.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},e.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},e.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},e.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},e.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},e.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},e.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},e.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},e.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},e.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},e.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},e.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},e.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},e.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},e.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},e.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},e.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},e.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},e.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},e.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},e.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},e.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},e.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},e.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},e.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},e.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},e.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},e.prototype.RULE=function(e,t,n){if(void 0===n&&(n=en),Object(i.j)(this.definedRulesNames,e)){var r={message:Le.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Jt.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(r)}this.definedRulesNames.push(e);var o=this.defineRule(e,t,n);return this[e]=o,o},e.prototype.OVERRIDE_RULE=function(e,t,n){void 0===n&&(n=en);var r,o,a,s,u,l=[];l=l.concat((r=e,o=this.definedRulesNames,a=this.className,u=[],i.j(o,r)||(s="Invalid rule override, rule: ->"+r+"<- cannot be overridden in the grammar: ->"+a+"<-as it is not defined in any of the super grammars ",u.push({message:s,type:Jt.INVALID_RULE_OVERRIDE,ruleName:r})),u)),this.definitionErrors.push.apply(this.definitionErrors,l);var c=this.defineRule(e,t,n);return this[e]=c,c},e.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var n=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if(pt(e))return!1;throw e}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}},e.prototype.getGAstProductions=function(){return this.gastProductionsCache},e.prototype.getSerializedGastProductions=function(){return de(Object(i.U)(this.gastProductionsCache))},e}(),jt=function(){function e(){}return e.prototype.initRecognizerEngine=function(e,t){if(this.className=Nt(this.constructor),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=F,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Object(i.w)(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Object(i.y)(e)){if(Object(i.A)(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Object(i.y)(e))this.tokensMap=Object(i.O)(e,(function(e,t){return e[t.name]=t,e}),{});else if(Object(i.w)(e,"modes")&&Object(i.o)(Object(i.t)(Object(i.U)(e.modes)),G)){var n=Object(i.t)(Object(i.U)(e.modes)),r=Object(i.T)(n);this.tokensMap=Object(i.O)(r,(function(e,t){return e[t.name]=t,e}),{})}else{if(!Object(i.C)(e))throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object(i.h)(e)}this.tokensMap.EOF=Q;var o=Object(i.o)(Object(i.U)(e),(function(e){return Object(i.A)(e.categoryMatches)}));this.tokenMatcher=o?F:D,H(Object(i.U)(this.tokensMap))},e.prototype.defineRule=function(e,t,n){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+"> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var r,o=Object(i.w)(n,"resyncEnabled")?n.resyncEnabled:en.resyncEnabled,a=Object(i.w)(n,"recoveryValueFunc")?n.recoveryValueFunc:en.recoveryValueFunc,s=this.ruleShortNameIdx<<12;function u(e){try{if(!0===this.outputCst){t.apply(this,e);var n=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(n),n}return t.apply(this,e)}catch(e){return this.invokeRuleCatch(e,o,a)}finally{this.ruleFinallyStateUpdate()}}this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;return(r=function(t,n){return void 0===t&&(t=0),this.ruleInvocationStateUpdate(s,e,t),u.call(this,n)}).ruleName=e,r.originalGrammarAction=t,r},e.prototype.invokeRuleCatch=function(e,t,n){var r=1===this.RULE_STACK.length,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(pt(e)){var o=e;if(i){var a,s=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(s))return o.resyncedTokens=this.reSyncTo(s),this.outputCst?((a=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,a):n();throw this.outputCst&&((a=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,o.partialCstResult=a),o}if(r)return this.moveToTerminatedState(),n();throw o}throw e},e.prototype.optionInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)},e.prototype.optionInternalLogic=function(e,t,n){var r,i,o=this,a=this.getLaFuncFromCache(n);if(void 0!==e.DEF){if(r=e.DEF,void 0!==(i=e.GATE)){var s=a;a=function(){return i.call(o)&&s.call(o)}}}else r=e;if(!0===a.call(this))return r.call(this)},e.prototype.atLeastOneInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,t,n)},e.prototype.atLeastOneInternalLogic=function(e,t,n){var r,i,o=this,a=this.getLaFuncFromCache(n);if(void 0!==t.DEF){if(r=t.DEF,void 0!==(i=t.GATE)){var s=a;a=function(){return i.call(o)&&s.call(o)}}}else r=t;if(!0!==a.call(this))throw this.raiseEarlyExitException(e,ze.REPETITION_MANDATORY,t.ERR_MSG);for(var u=this.doSingleRepetition(r);!0===a.call(this)&&!0===u;)u=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],a,1024,e,Fe)},e.prototype.atLeastOneSepFirstInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,t,n)},e.prototype.atLeastOneSepFirstInternalLogic=function(e,t,n){var r=this,i=t.DEF,o=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,ze.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);i.call(this);for(var a=function(){return r.tokenMatcher(r.LA(1),o)};!0===this.tokenMatcher(this.LA(1),o);)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Ue],a,1536,e,Ue)},e.prototype.manyInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)},e.prototype.manyInternalLogic=function(e,t,n){var r,i,o=this,a=this.getLaFuncFromCache(n);if(void 0!==t.DEF){if(r=t.DEF,void 0!==(i=t.GATE)){var s=a;a=function(){return i.call(o)&&s.call(o)}}}else r=t;for(var u=!0;!0===a.call(this)&&!0===u;)u=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],a,768,e,je,u)},e.prototype.manySepFirstInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,t,n)},e.prototype.manySepFirstInternalLogic=function(e,t,n){var r=this,i=t.DEF,o=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){i.call(this);for(var a=function(){return r.tokenMatcher(r.LA(1),o)};!0===this.tokenMatcher(this.LA(1),o);)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,De],a,1280,e,De)}},e.prototype.repetitionSepSecondInternal=function(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,1536,e,i)},e.prototype.doSingleRepetition=function(e){var t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t},e.prototype.orInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(256,t),r=Object(i.y)(e)?e:e.DEF,o=this.getLaFuncFromCache(n).call(this,r);if(void 0!==o)return r[o].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)},e.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new mt(t,e))}},e.prototype.subruleInternal=function(e,t,n){var r;try{var i=void 0!==n?n.ARGS:void 0;return r=e.call(this,t,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){this.subruleInternalError(t,n,e.ruleName)}},e.prototype.subruleInternalError=function(e,t,n){throw pt(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e},e.prototype.consumeInternal=function(e,t,n){var r;try{var i=this.LA(1);!0===this.tokenMatcher(i,e)?(this.consumeToken(),r=i):this.consumeInternalError(e,i,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r},e.prototype.consumeInternalError=function(e,t,n){var r,i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new dt(r,t,i))},e.prototype.consumeInternalRecovery=function(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;var r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw"InRuleRecoveryException"===e.name?n:e}},e.prototype.saveRecogState=function(){var e=this.errors,t=Object(i.g)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}},e.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},e.prototype.ruleInvocationStateUpdate=function(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t,e)},e.prototype.isBackTracking=function(){return 0!==this.isBackTrackingStack.length},e.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},e.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},e.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),Q)},e.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},e}(),Dt=function(){function e(){}return e.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=Object(i.w)(e,"errorMessageProvider")?e.errorMessageProvider:Qt.errorMessageProvider},e.prototype.SAVE_ERROR=function(e){if(pt(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Object(i.g)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(e.prototype,"errors",{get:function(){return Object(i.g)(this._errors)},set:function(e){this._errors=e},enumerable:!1,configurable:!0}),e.prototype.raiseEarlyExitException=function(e,t,n){for(var r=this.getCurrRuleFullName(),i=Je(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],o=[],a=1;a<=this.maxLookahead;a++)o.push(this.LA(a));var s=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:o,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new vt(s,this.LA(1),this.LA(0)))},e.prototype.raiseNoAltException=function(e,t){for(var n=this.getCurrRuleFullName(),r=Ze(e,this.getGAstProductions()[n],this.maxLookahead),i=[],o=1;o<=this.maxLookahead;o++)i.push(this.LA(o));var a=this.LA(0),s=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:a,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new gt(s,this.LA(1),a))},e}(),Ft=function(){function e(){}return e.prototype.initContentAssist=function(){},e.prototype.computeContentAssist=function(e,t){var n=this.gastProductionsCache[e];if(Object(i.F)(n))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return He([n],t,this.tokenMatcher,this.maxLookahead)},e.prototype.getNextPossibleTokenTypes=function(e){var t=Object(i.s)(e.ruleStack),n=this.getGAstProductions()[t];return new Pe(n,e).startWalking()},e}(),Ut={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Ut);var Wt=Math.pow(2,8)-1,Ht=J({name:"RECORDING_PHASE_TOKEN",pattern:$.NA});H([Ht]);var Bt=ee(Ht,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(Bt);var zt={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",children:{}},Gt=function(){function e(){}return e.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},e.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(function(){for(var t=function(t){var n=t>0?t:"";e["CONSUME"+n]=function(e,n){return this.consumeInternalRecord(e,t,n)},e["SUBRULE"+n]=function(e,n){return this.subruleInternalRecord(e,t,n)},e["OPTION"+n]=function(e){return this.optionInternalRecord(e,t)},e["OR"+n]=function(e){return this.orInternalRecord(e,t)},e["MANY"+n]=function(e){this.manyInternalRecord(t,e)},e["MANY_SEP"+n]=function(e){this.manySepFirstInternalRecord(t,e)},e["AT_LEAST_ONE"+n]=function(e){this.atLeastOneInternalRecord(t,e)},e["AT_LEAST_ONE_SEP"+n]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}},n=0;n<10;n++)t(n);e.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},e.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},e.option=function(e,t){return this.optionInternalRecord(t,e)},e.or=function(e,t){return this.orInternalRecord(t,e)},e.many=function(e,t){this.manyInternalRecord(e,t)},e.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD}))},e.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",(function(){for(var t=0;t<10;t++){var n=t>0?t:"";delete e["CONSUME"+n],delete e["SUBRULE"+n],delete e["OPTION"+n],delete e["OR"+n],delete e["MANY"+n],delete e["MANY_SEP"+n],delete e["AT_LEAST_ONE"+n],delete e["AT_LEAST_ONE_SEP"+n]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA}))},e.prototype.ACTION_RECORD=function(e){},e.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},e.prototype.LA_RECORD=function(e){return Zt},e.prototype.topLevelRuleRecord=function(e,t){try{var n=new oe({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}},e.prototype.optionInternalRecord=function(e,t){return Vt.call(this,se,e,t)},e.prototype.atLeastOneInternalRecord=function(e,t){Vt.call(this,ue,t,e)},e.prototype.atLeastOneSepFirstInternalRecord=function(e,t){Vt.call(this,le,t,e,!0)},e.prototype.manyInternalRecord=function(e,t){Vt.call(this,ce,t,e)},e.prototype.manySepFirstInternalRecord=function(e,t){Vt.call(this,fe,t,e,!0)},e.prototype.orInternalRecord=function(e,t){return Kt.call(this,e,t)},e.prototype.subruleInternalRecord=function(e,t,n){if($t(t),!e||!1===Object(i.w)(e,"ruleName")){var r=new Error("<SUBRULE"+qt(t)+"> argument is invalid expecting a Parser method reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw r.KNOWN_RECORDER_ERROR=!0,r}var o=Object(i.M)(this.recordingProdStack),a=e.ruleName,s=new ie({idx:t,nonTerminalName:a,referencedRule:void 0});return o.definition.push(s),this.outputCst?zt:Ut},e.prototype.consumeInternalRecord=function(e,t,n){if($t(t),!B(e)){var r=new Error("<CONSUME"+qt(t)+"> argument is invalid expecting a TokenType reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw r.KNOWN_RECORDER_ERROR=!0,r}var o=Object(i.M)(this.recordingProdStack),a=new pe({idx:t,terminalType:e});return o.definition.push(a),Bt},e}();function Vt(e,t,n,r){void 0===r&&(r=!1),$t(n);var o=Object(i.M)(this.recordingProdStack),a=Object(i.B)(t)?t:t.DEF,s=new e({definition:[],idx:n});return r&&(s.separator=t.SEP),Object(i.w)(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),o.definition.push(s),this.recordingProdStack.pop(),Ut}function Kt(e,t){var n=this;$t(t);var r=Object(i.M)(this.recordingProdStack),o=!1===Object(i.y)(e),a=!1===o?e:e.DEF,s=new he({definition:[],idx:t,ignoreAmbiguities:o&&!0===e.IGNORE_AMBIGUITIES});Object(i.w)(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD);var u=Object(i.Q)(a,(function(e){return Object(i.B)(e.GATE)}));return s.hasPredicates=u,r.definition.push(s),Object(i.u)(a,(function(e){var t=new ae({definition:[]});s.definition.push(t),Object(i.w)(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object(i.w)(e,"GATE")&&(t.ignoreAmbiguities=!0),n.recordingProdStack.push(t),e.ALT.call(n),n.recordingProdStack.pop()})),Ut}function qt(e){return 0===e?"":""+e}function $t(e){if(e<0||e>Wt){var t=new Error("Invalid DSL Method idx value: <"+e+">\n\tIdx value must be a none negative value smaller than "+(Wt+1));throw t.KNOWN_RECORDER_ERROR=!0,t}}var Yt=function(){function e(){}return e.prototype.initPerformanceTracer=function(e){if(Object(i.w)(e,"traceInitPerf")){var t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Qt.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(n+"--\x3e <"+e+">");var r=Object(i.R)(t),o=r.time,a=r.value,s=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(n+"<-- <"+e+"> time: "+o+"ms"),this.traceInitIndent--,a}return t()},e}(),Xt=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zt=ee(Q,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Zt);var Jt,Qt=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Ne,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),en=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});function tn(e){return void 0===e&&(e=void 0),function(){return e}}!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"}(Jt||(Jt={}));var nn=function(){function e(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;if(this.initErrorHandler(t),this.initLexerAdapter(),this.initLooksAhead(t),this.initRecognizerEngine(e,t),this.initRecoverable(t),this.initTreeBuilder(t),this.initContentAssist(),this.initGastRecorder(t),this.initPerformanceTracer(t),Object(i.w)(t,"ignoredIssues"))throw new Error("The <ignoredIssues> IParserConfig property has been deprecated.\n\tPlease use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Object(i.w)(t,"skipValidations")?t.skipValidations:Qt.skipValidations}return e.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")},e.prototype.performSelfAnalysis=function(){var t=this;this.TRACE_INIT("performSelfAnalysis",(function(){var n;t.selfAnalysisDone=!0;var r=t.className;t.TRACE_INIT("toFastProps",(function(){Object(i.S)(t)})),t.TRACE_INIT("Grammar Recording",(function(){try{t.enableRecording(),Object(i.u)(t.definedRulesNames,(function(e){var n=t[e].originalGrammarAction,r=void 0;t.TRACE_INIT(e+" Rule",(function(){r=t.topLevelRuleRecord(e,n)})),t.gastProductionsCache[e]=r}))}finally{t.disableRecording()}}));var o=[];if(t.TRACE_INIT("Grammar Resolving",(function(){o=lt({rules:Object(i.U)(t.gastProductionsCache)}),t.definitionErrors.push.apply(t.definitionErrors,o)})),t.TRACE_INIT("Grammar Validations",(function(){if(Object(i.A)(o)&&!1===t.skipValidations){var e=ct({rules:Object(i.U)(t.gastProductionsCache),maxLookahead:t.maxLookahead,tokenTypes:Object(i.U)(t.tokensMap),errMsgProvider:Le,grammarName:r});t.definitionErrors.push.apply(t.definitionErrors,e)}})),Object(i.A)(t.definitionErrors)&&(t.recoveryEnabled&&t.TRACE_INIT("computeAllProdsFollows",(function(){var e,n,r=(e=Object(i.U)(t.gastProductionsCache),n={},Object(i.u)(e,(function(e){var t=new ke(e).startWalking();Object(i.f)(n,t)})),n);t.resyncFollows=r})),t.TRACE_INIT("ComputeLookaheadFunctions",(function(){t.preComputeLookaheadFunctions(Object(i.U)(t.gastProductionsCache))}))),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!Object(i.A)(t.definitionErrors))throw n=Object(i.I)(t.definitionErrors,(function(e){return e.message})),new Error("Parser Definition Errors detected:\n "+n.join("\n-------------------------------\n"))}))},e.DEFER_DEFINITION_ERRORS_HANDLING=!1,e}();Object(i.e)(nn,[Tt,St,Mt,Pt,jt,_t,Dt,Ft,Gt,Yt]);var rn=function(e){function t(t,n){void 0===n&&(n=Qt);var r=Object(i.h)(n);return r.outputCst=!0,e.call(this,t,r)||this}return Xt(t,e),t}(nn),on=function(e){function t(t,n){void 0===n&&(n=Qt);var r=Object(i.h)(n);return r.outputCst=!1,e.call(this,t,r)||this}return Xt(t,e),t}(nn);function an(e,t){var n=void 0===t?{}:t,i=n.resourceBase,o=void 0===i?"https://unpkg.com/chevrotain@"+r+"/diagrams/":i,a=n.css;return'\n\x3c!-- This is a generated file --\x3e\n<!DOCTYPE html>\n<meta charset="utf-8">\n<style>\n body {\n background-color: hsl(30, 20%, 95%)\n }\n</style>\n\n'+("\n<link rel='stylesheet' href='"+(void 0===a?"https://unpkg.com/chevrotain@"+r+"/diagrams/diagrams.css":a)+"'>\n")+("\n<script src='"+o+"vendor/railroad-diagrams.js'><\/script>\n<script src='"+o+"src/diagrams_builder.js'><\/script>\n<script src='"+o+"src/diagrams_behavior.js'><\/script>\n<script src='"+o+"src/main.js'><\/script>\n")+'\n<div id="diagrams" align="center"></div> \n'+("\n<script>\n window.serializedGrammar = "+JSON.stringify(e,null," ")+";\n<\/script>\n")+'\n<script>\n var diagramsDiv = document.getElementById("diagrams");\n main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);\n<\/script>\n'}var sn="\n";function un(e){var t;return"\nfunction "+e.name+"(tokenVocabulary, config) {\n // invoke super constructor\n // No support for embedded actions currently, so we can 'hardcode'\n // The use of CstParser.\n chevrotain.CstParser.call(this, tokenVocabulary, config)\n\n const $ = this\n\n "+(t=e.rules,Object(i.I)(t,(function(e){return r=dn(n=1,'$.RULE("'+(t=e).name+'", function() {')+sn,r+=pn(t.definition,n+1),r+=dn(n+1,"})")+sn;var t,n,r})).join("\n")+"\n\n // very important to call this after all the rules have been defined.\n // otherwise the parser may not work correctly as it will lack information\n // derived during the self analysis phase.\n this.performSelfAnalysis(this)\n}\n\n// inheritance as implemented in javascript in the previous decade... :(\n")+e.name+".prototype = Object.create(chevrotain.CstParser.prototype)\n"+e.name+".prototype.constructor = "+e.name+" \n "}function ln(e,t){var n=dn(t,"$.OR"+e.idx+"([")+sn,r=Object(i.I)(e.definition,(function(e){return function(e,t){var n=dn(t,"{")+sn;return n+=dn(t+1,"ALT: function() {")+sn,n+=pn(e.definition,t+1),n+=dn(t+1,"}")+sn,n+=dn(t,"}")}(e,t+1)}));return n+=r.join(",\n"),n+=sn+dn(t,"])\n")}function cn(e,t){if(e instanceof ie)return function(e,t){return dn(t,"$.SUBRULE"+e.idx+"($."+e.nonTerminalName+")"+sn)}(e,t);if(e instanceof se)return fn("OPTION",e,t);if(e instanceof ue)return fn("AT_LEAST_ONE",e,t);if(e instanceof le)return fn("AT_LEAST_ONE_SEP",e,t);if(e instanceof fe)return fn("MANY_SEP",e,t);if(e instanceof ce)return fn("MANY",e,t);if(e instanceof he)return ln(e,t);if(e instanceof pe)return function(e,t){var n=e.terminalType.name;return dn(t,"$.CONSUME"+e.idx+"(this.tokensMap."+n+")"+sn)}(e,t);if(e instanceof ae)return pn(e.definition,t);throw Error("non exhaustive match")}function fn(e,t,n){var r=dn(n,"$."+(e+t.idx)+"(");return t.separator?(r+="{\n",r+=dn(n+1,"SEP: this.tokensMap."+t.separator.name)+","+sn,r+="DEF: "+hn(t.definition,n+2)+sn,r+=dn(n,"}")+sn):r+=hn(t.definition,n+1),r+=dn(n,")")+sn}function hn(e,t){var n="function() {\n";return n+=pn(e,t),n+=dn(t,"}")+sn}function pn(e,t){var n="";return Object(i.u)(e,(function(e){n+=cn(e,t+1)})),n}function dn(e,t){return Array(4*e+1).join(" ")+t}function gn(e){var t=function(e){return" \n"+un(e)+"\nreturn new "+e.name+"(tokenVocabulary, config) \n"}({name:e.name,rules:e.rules}),r=new Function("tokenVocabulary","config","chevrotain",t);return function(t){return r(e.tokenVocabulary,t,n(3))}}function mn(e){return function(e){return"\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['chevrotain'], factory);\n } else if (typeof module === 'object' && module.exports) {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory(require('chevrotain'));\n } else {\n // Browser globals (root is window)\n root.returnExports = factory(root.b);\n }\n}(typeof self !== 'undefined' ? self : this, function (chevrotain) {\n\n"+un(e)+"\n \nreturn {\n "+e.name+": "+e.name+" \n}\n}));\n"}({name:e.name,rules:e.rules})}function vn(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n\t It performs no action other than printing this message.\n\t Please avoid using it as it will be completely removed in the future")}var yn=function(){throw new Error("The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.\t\nSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_7-0-0")}},function(e,t,n){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),u=!o&&/WebKit\//.test(e),l=u&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),f=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),d=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),m=/Android/.test(e),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),T=/win/i.test(t),x=f&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(f=!1,u=!0);var O=y&&(l||f&&(null==x||x<12.11)),S=n||a&&s>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E,w=function(e,t){var n=e.className,r=C(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function k(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function N(e,t){return k(e).appendChild(t)}function A(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function L(e,t,n,r){var i=A(e,t,n,r);return i.setAttribute("role","presentation"),i}function R(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function I(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function M(e,t){var n=e.className;C(t).test(n)||(e.className+=(n?" ":"")+t)}function P(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!C(n[r]).test(t)&&(t+=" "+n[r]);return t}E=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var _=function(e){e.select()};function j(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function D(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function F(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}g?_=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(_=function(e){try{e.select()}catch(e){}});var U=function(){this.id=null,this.f=null,this.time=0,this.handler=j(this.onTimeout,this)};function W(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}U.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},U.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var H={toString:function(){return"CodeMirror.Pass"}},B={scroll:!1},z={origin:"*mouse"},G={origin:"+move"};function V(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var K=[""];function q(e){for(;K.length<=e;)K.push($(K)+" ");return K[e]}function $(e){return e[e.length-1]}function Y(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function X(){}function Z(e,t){var n;return Object.create?n=Object.create(e):(X.prototype=e,n=new X),t&&D(t,n),n}var J=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Q(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Q(e))||t.test(e):Q(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function re(e){return e.charCodeAt(0)>=768&&ne.test(e)}function ie(e,t,n){for(;(n<0?t>0:t<e.length)&&re(e.charAt(t));)t+=n;return t}function oe(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}var ae=null;function se(e,t,n){var r;ae=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ae=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ae=i)}return null!=r?r:ae}var ue=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,s){var u="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var l,c=a.length,f=[],h=0;h<c;++h)f.push((l=a.charCodeAt(h))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(l):1424<=l&&l<=1524?"R":1536<=l&&l<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(l-1536):1774<=l&&l<=2220?"r":8192<=l&&l<=8203?"w":8204==l?"b":"L");for(var p=0,d=u;p<c;++p){var g=f[p];"m"==g?f[p]=d:d=g}for(var m=0,v=u;m<c;++m){var y=f[m];"1"==y&&"r"==v?f[m]="n":n.test(y)&&(v=y,"r"==y&&(f[m]="R"))}for(var b=1,T=f[0];b<c-1;++b){var x=f[b];"+"==x&&"1"==T&&"1"==f[b+1]?f[b]="1":","!=x||T!=f[b+1]||"1"!=T&&"n"!=T||(f[b]=T),T=x}for(var O=0;O<c;++O){var S=f[O];if(","==S)f[O]="N";else if("%"==S){var C=void 0;for(C=O+1;C<c&&"%"==f[C];++C);for(var E=O&&"!"==f[O-1]||C<c&&"1"==f[C]?"1":"N",w=O;w<C;++w)f[w]=E;O=C-1}}for(var k=0,N=u;k<c;++k){var A=f[k];"L"==N&&"1"==A?f[k]="L":n.test(A)&&(N=A)}for(var L=0;L<c;++L)if(t.test(f[L])){var R=void 0;for(R=L+1;R<c&&t.test(f[R]);++R);for(var I="L"==(L?f[L-1]:u),M=I==("L"==(R<c?f[R]:u))?I?"L":"R":u,P=L;P<R;++P)f[P]=M;L=R-1}for(var _,j=[],D=0;D<c;)if(r.test(f[D])){var F=D;for(++D;D<c&&r.test(f[D]);++D);j.push(new o(0,F,D))}else{var U=D,W=j.length,H="rtl"==s?1:0;for(++D;D<c&&"L"!=f[D];++D);for(var B=U;B<D;)if(i.test(f[B])){U<B&&(j.splice(W,0,new o(1,U,B)),W+=H);var z=B;for(++B;B<D&&i.test(f[B]);++B);j.splice(W,0,new o(2,z,B)),W+=H,U=B}else++B;U<D&&j.splice(W,0,new o(1,U,D))}return"ltr"==s&&(1==j[0].level&&(_=a.match(/^\s+/))&&(j[0].from=_[0].length,j.unshift(new o(0,0,_[0].length))),1==$(j).level&&(_=a.match(/\s+$/))&&($(j).to-=_[0].length,j.push(new o(0,c-_[0].length,c)))),"rtl"==s?j.reverse():j}}();function le(e,t){var n=e.order;return null==n&&(n=e.order=ue(e.text,t)),n}var ce=[],fe=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ce).concat(n)}};function he(e,t){return e._handlers&&e._handlers[t]||ce}function pe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=W(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function de(e,t){var n=he(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function ge(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),de(e,n||t.type,e,t),xe(t)||t.codemirrorIgnore}function me(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==W(n,t[r])&&n.push(t[r])}function ve(e,t){return he(e,t).length>0}function ye(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){pe(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Te(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function xe(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Oe(e){be(e),Te(e)}function Se(e){return e.target||e.srcElement}function Ce(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Ee,we,ke=function(){if(a&&s<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function Ne(e){if(null==Ee){var t=A("span","");N(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ee=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Ee?A("span",""):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ae(e){if(null!=we)return we;var t=N(e,document.createTextNode("AخA")),n=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return k(e),!(!n||n.left==n.right)&&(we=r.right-n.right<3)}var Le,Re=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ie=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Me="oncopy"in(Le=A("div"))||(Le.setAttribute("oncopy","return;"),"function"==typeof Le.oncopy),Pe=null,_e={},je={};function De(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),_e[e]=t}function Fe(e){if("string"==typeof e&&je.hasOwnProperty(e))e=je[e];else if(e&&"string"==typeof e.name&&je.hasOwnProperty(e.name)){var t=je[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Fe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Fe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ue(e,t){t=Fe(t);var n=_e[t.name];if(!n)return Ue(e,"text/plain");var r=n(e,t);if(We.hasOwnProperty(t.name)){var i=We[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var We={};function He(e,t){D(t,We.hasOwnProperty(e)?We[e]:We[e]={})}function Be(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function ze(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ge(e,t,n){return!e.startState||e.startState(t,n)}var Ve=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ke(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function qe(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i})),r}function $e(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Ye(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Xe(e){if(null==e.parent)return null;for(var t=e.parent,n=W(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Ze(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return n+a}function Je(e,t){return t>=e.first&&t<e.first+e.size}function Qe(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,n){if(void 0===n&&(n=null),!(this instanceof et))return new et(e,t,n);this.line=e,this.ch=t,this.sticky=n}function tt(e,t){return e.line-t.line||e.ch-t.ch}function nt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function rt(e){return et(e.line,e.ch)}function it(e,t){return tt(e,t)<0?t:e}function ot(e,t){return tt(e,t)<0?e:t}function at(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function st(e,t){if(t.line<e.first)return et(e.first,0);var n=e.first+e.size-1;return t.line>n?et(n,Ke(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,Ke(e,t.line).text.length)}function ut(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=st(e,t[r]);return n}Ve.prototype.eol=function(){return this.pos>=this.string.length},Ve.prototype.sol=function(){return this.pos==this.lineStart},Ve.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ve.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ve.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ve.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ve.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ve.prototype.skipToEnd=function(){this.pos=this.string.length},Ve.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ve.prototype.backUp=function(e){this.pos-=e},Ve.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Ve.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Ve.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ve.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ve.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ve.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ve.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var lt=function(e,t){this.state=e,this.lookAhead=t},ct=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ft(e,t,n,r){var i=[e.state.modeGen],o={};Tt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],u=1,l=0;n.state=!0,Tt(e,t.text,s.mode,n,(function(e,t){for(var n=u;l<e;){var r=i[u];r>e&&i.splice(u,1,e,i[u+1],r),u+=2,l=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,u-n,e,"overlay "+t),u=n+2;else for(;n<u;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},u=0;u<e.state.overlays.length;++u)s(u);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function ht(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=pt(e,Xe(t)),i=t.text.length>e.options.maxHighlightLength&&Be(e.doc.mode,r.state),o=ft(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function pt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new ct(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var u=Ke(o,s-1),l=u.stateAfter;if(l&&(!n||s+(l instanceof lt?l.lookAhead:0)<=o.modeFrontier))return s;var c=F(u.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}(e,t,n),a=o>r.first&&Ke(r,o-1).stateAfter,s=a?ct.fromSaved(r,a,o):new ct(r,Ge(r.mode),o);return r.iter(o,t,(function(n){dt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function dt(e,t,n,r){var i=e.doc.mode,o=new Ve(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&gt(i,n.state);!o.eol();)mt(i,o,n.state),o.start=o.pos}function gt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=ze(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function mt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=ze(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}ct.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ct.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ct.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ct.fromSaved=function(e,t,n){return t instanceof lt?new ct(e,Be(e.mode,t.state),n,t.lookAhead):new ct(e,Be(e.mode,t),n)},ct.prototype.save=function(e){var t=!1!==e?Be(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new lt(t,this.maxLookAhead):t};var vt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,r){var i,o,a=e.doc,s=a.mode,u=Ke(a,(t=st(a,t)).line),l=pt(e,t.line,n),c=new Ve(u.text,e.options.tabSize,l);for(r&&(o=[]);(r||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=mt(s,c,l.state),r&&o.push(new vt(c,i,Be(a.mode,l.state)));return r?o:new vt(c,i,l.state)}function bt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Tt(e,t,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var u,l=0,c=null,f=new Ve(t,e.options.tabSize,r),h=e.options.addModeClass&&[null];for(""==t&&bt(gt(n,r.state),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(s=!1,a&&dt(e,t,r,f.pos),f.pos=t.length,u=null):u=bt(mt(n,f,r.state,h),o),h){var p=h[0].name;p&&(u="m-"+(u?p+" "+u:p))}if(!s||c!=u){for(;l<f.start;)i(l=Math.min(f.start,l+5e3),c);c=u}f.start=f.pos}for(;l<f.pos;){var d=Math.min(f.pos,l+5e3);i(d,c),l=d}}var xt=!1,Ot=!1;function St(e,t,n){this.marker=e,this.from=t,this.to=n}function Ct(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Et(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function wt(e,t){if(t.full)return null;var n=Je(e,t.from.line)&&Ke(e,t.from.line).markedSpans,r=Je(e,t.to.line)&&Ke(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==tt(t.from,t.to),s=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new St(a,o.from,s?null:o.to))}}return r}(n,i,a),u=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new St(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}(r,o,a),l=1==t.text.length,c=$(t.text).length+(l?i:0);if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null==h.to){var p=Ct(u,h.marker);p?l&&(h.to=null==p.to?null:p.to+c):h.to=i}}if(u)for(var d=0;d<u.length;++d){var g=u[d];null!=g.to&&(g.to+=c),null==g.from?Ct(s,g.marker)||(g.from=c,l&&(s||(s=[])).push(g)):(g.from+=c,l&&(s||(s=[])).push(g))}s&&(s=kt(s)),u&&u!=s&&(u=kt(u));var m=[s];if(!l){var v,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(v||(v=[])).push(new St(s[b].marker,null,null));for(var T=0;T<y;++T)m.push(v);m.push(u)}return m}function kt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Nt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function At(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Lt(e){return e.inclusiveLeft?-1:0}function Rt(e){return e.inclusiveRight?1:0}function It(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=tt(r.from,i.from)||Lt(e)-Lt(t);if(o)return-o;var a=tt(r.to,i.to)||Rt(e)-Rt(t);return a||t.id-e.id}function Mt(e,t){var n,r=Ot&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||It(n,i.marker)<0)&&(n=i.marker);return n}function Pt(e){return Mt(e,!0)}function _t(e){return Mt(e,!1)}function jt(e,t){var n,r=Ot&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||It(n,o.marker)<0)&&(n=o.marker)}return n}function Dt(e,t,n,r,i){var o=Ke(e,t),a=Ot&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var u=a[s];if(u.marker.collapsed){var l=u.marker.find(0),c=tt(l.from,n)||Lt(u.marker)-Lt(i),f=tt(l.to,r)||Rt(u.marker)-Rt(i);if(!(c>=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?tt(l.to,n)>=0:tt(l.to,n)>0)||c>=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?tt(l.from,r)<=0:tt(l.from,r)<0)))return!0}}}function Ft(e){for(var t;t=Pt(e);)e=t.find(-1,!0).line;return e}function Ut(e,t){var n=Ke(e,t),r=Ft(n);return n==r?t:Xe(r)}function Wt(e,t){if(t>e.lastLine())return t;var n,r=Ke(e,t);if(!Ht(e,r))return t;for(;n=_t(r);)r=n.find(1,!0).line;return Xe(r)+1}function Ht(e,t){var n=Ot&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Bt(e,t,r))return!0}}function Bt(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Bt(e,r.line,Ct(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Bt(e,t,i))return!0}function zt(e){for(var t=0,n=(e=Ft(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function Gt(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Pt(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=_t(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function Vt(e){var t=e.display,n=e.doc;t.maxLine=Ke(n,n.first),t.maxLineLength=Gt(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=Gt(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Kt=function(e,t,n){this.text=e,At(this,t),this.height=n?n(this):1};function qt(e){e.parent=null,Nt(e)}Kt.prototype.lineNo=function(){return Xe(this)},ye(Kt);var $t={},Yt={};function Xt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Yt:$t;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var n=L("span",null,null,u?"padding-right: .1px":null),r={pre:L("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Qt,Ae(e.display.measure)&&(a=le(o,e.doc.direction))&&(r.addToken=en(r.addToken,a)),r.map=[],nn(o,r,ht(e,o,t!=e.display.externalMeasured&&Xe(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=P(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=P(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ne(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(u){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return de(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=P(r.pre.className,r.textClass||"")),r}function Jt(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Qt(e,t,n,r,i,o,u){if(t){var l,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(t,e.trailingSpace):t,f=e.cm.state.specialChars,h=!1;if(f.test(t)){l=document.createDocumentFragment();for(var p=0;;){f.lastIndex=p;var d=f.exec(t),g=d?d.index-p:t.length-p;if(g){var m=document.createTextNode(c.slice(p,p+g));a&&s<9?l.appendChild(A("span",[m])):l.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!d)break;p+=g+1;var v=void 0;if("\t"==d[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=l.appendChild(A("span",q(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==d[0]||"\n"==d[0]?((v=l.appendChild(A("span","\r"==d[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",d[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(d[0])).setAttribute("cm-text",d[0]),a&&s<9?l.appendChild(A("span",[v])):l.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,l=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,l),a&&s<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||h||o||u){var T=n||"";r&&(T+=r),i&&(T+=i);var x=A("span",[l],T,o);if(u)for(var O in u)u.hasOwnProperty(O)&&"style"!=O&&"class"!=O&&x.setAttribute(O,u[O]);return e.content.appendChild(x)}e.content.appendChild(l)}}function en(e,t){return function(n,r,i,o,a,s,u){i=i?i+" cm-force-border":"cm-force-border";for(var l=n.pos,c=l+r.length;;){for(var f=void 0,h=0;h<t.length&&!((f=t[h]).to>l&&f.from<=l);h++);if(f.to>=c)return e(n,r,i,o,a,s,u);e(n,r.slice(0,f.to-l),i,o,null,s,u),o=null,r=r.slice(f.to-l),l=f.to}}}function tn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,u,l,c,f,h,p=i.length,d=0,g=1,m="",v=0;;){if(v==d){u=l=c=s="",h=null,f=null,v=1/0;for(var y=[],b=void 0,T=0;T<r.length;++T){var x=r[T],O=x.marker;if("bookmark"==O.type&&x.from==d&&O.widgetNode)y.push(O);else if(x.from<=d&&(null==x.to||x.to>d||O.collapsed&&x.to==d&&x.from==d)){if(null!=x.to&&x.to!=d&&v>x.to&&(v=x.to,l=""),O.className&&(u+=" "+O.className),O.css&&(s=(s?s+";":"")+O.css),O.startStyle&&x.from==d&&(c+=" "+O.startStyle),O.endStyle&&x.to==v&&(b||(b=[])).push(O.endStyle,x.to),O.title&&((h||(h={})).title=O.title),O.attributes)for(var S in O.attributes)(h||(h={}))[S]=O.attributes[S];O.collapsed&&(!f||It(f.marker,O)<0)&&(f=x)}else x.from>d&&v>x.from&&(v=x.from)}if(b)for(var C=0;C<b.length;C+=2)b[C+1]==v&&(l+=" "+b[C]);if(!f||f.from==d)for(var E=0;E<y.length;++E)tn(t,0,y[E]);if(f&&(f.from||0)==d){if(tn(t,(null==f.to?p+1:f.to)-d,f.marker,null==f.from),null==f.to)return;f.to==d&&(f=!1)}}if(d>=p)break;for(var w=Math.min(p,v);;){if(m){var k=d+m.length;if(!f){var N=k>w?m.slice(0,w-d):m;t.addToken(t,N,a?a+u:u,c,d+N.length==v?l:"",s,h)}if(k>=w){m=m.slice(w-d),d=w;break}d=k,c=""}m=i.slice(o,o=n[g++]),a=Xt(n[g++],t.cm.options)}}else for(var A=1;A<n.length;A+=2)t.addToken(t,i.slice(o,o=n[A]),Xt(n[A+1],t.cm.options))}function rn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=_t(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Xe($(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Ht(e,t)}function on(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new rn(e.doc,Ke(e.doc,o),o);r=o+a.size,i.push(a)}return i}var an=null,sn=null;function un(e,t){var n=he(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);an?r=an.delayedCallbacks:sn?r=sn:(r=sn=[],setTimeout(ln,0));for(var o=function(e){r.push((function(){return n[e].apply(null,i)}))},a=0;a<n.length;++a)o(a)}}function ln(){var e=sn;sn=null;for(var t=0;t<e.length;++t)e[t]()}function cn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?pn(e,t):"gutter"==o?gn(e,t,n,r):"class"==o?dn(e,t):"widget"==o&&mn(e,t,r)}t.changes=null}function fn(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function hn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Zt(e,t)}function pn(e,t){var n=t.text.className,r=hn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,dn(e,t)):n&&(t.text.className=n)}function dn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=fn(t);t.background=r.insertBefore(A("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?fn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function gn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=fn(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=fn(t),s=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(A("div",Qe(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var u=0;u<e.display.gutterSpecs.length;++u){var l=e.display.gutterSpecs[u].className,c=o.hasOwnProperty(l)&&o[l];c&&s.appendChild(A("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[l]+"px; width: "+r.gutterWidth[l]+"px"))}}}function mn(e,t,n){t.alignable&&(t.alignable=null);for(var r=C("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);yn(e,t,n)}function vn(e,t,n,r){var i=hn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),dn(e,t),gn(e,t,n,r),yn(e,t,r),t.node}function yn(e,t,n){if(bn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)bn(e,t.rest[r],t,n,!1)}function bn(e,t,n,r,i){if(t.widgets)for(var o=fn(n),a=0,s=t.widgets;a<s.length;++a){var u=s[a],l=A("div",[u.node],"CodeMirror-linewidget"+(u.className?" "+u.className:""));u.handleMouseEvents||l.setAttribute("cm-ignore-events","true"),Tn(u,l,n,r),e.display.input.setUneditable(l),i&&u.above?o.insertBefore(l,n.gutter||n.text):o.appendChild(l),un(u,"redraw")}}function Tn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function xn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!R(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),N(t.display.measure,A("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function On(e,t){for(var n=Se(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Sn(e){return e.lineSpace.offsetTop}function Cn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function En(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=N(e.measure,A("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function wn(e){return 50-e.display.nativeBarWidth}function kn(e){return e.display.scroller.clientWidth-wn(e)-e.display.barWidth}function Nn(e){return e.display.scroller.clientHeight-wn(e)-e.display.barHeight}function An(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(Xe(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ln(e,t,n,r){return Mn(e,In(e,t),n,r)}function Rn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[cr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function In(e,t){var n=Xe(t),r=Rn(e,n);r&&!r.text?r=null:r&&r.changes&&(cn(e,r,n,or(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=Xe(t=Ft(t)),r=e.display.externalMeasured=new rn(e.doc,t,n);r.lineN=n;var i=r.built=Zt(e,r);return r.text=i.pre,N(e.display.lineMeasure,i.pre),r}(e,t));var i=An(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Mn(e,t,n,r,i){t.before&&(n=-1);var o,u=n+(r||"");return t.cache.hasOwnProperty(u)?o=t.cache[u]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,i=r&&kn(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var u=a[s],l=a[s+1];Math.abs(u.bottom-l.bottom)>2&&o.push((u.bottom+l.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=jn(t.map,n,r),u=o.node,l=o.start,c=o.end,f=o.collapse;if(3==u.nodeType){for(var h=0;h<4;h++){for(;l&&re(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+c<o.coverEnd&&re(t.line.text.charAt(o.coverStart+c));)++c;if((i=a&&s<9&&0==l&&c==o.coverEnd-o.coverStart?u.parentNode.getBoundingClientRect():Dn(E(u,l,c).getClientRects(),r)).left||i.right||0==l)break;c=l,l-=1,f="right"}a&&s<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Pe)return Pe;var t=N(e,A("span","x")),n=t.getBoundingClientRect(),r=E(t,0,1).getBoundingClientRect();return Pe=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var p;l>0&&(f=r="right"),i=e.options.lineWrapping&&(p=u.getClientRects()).length>1?p["right"==r?p.length-1:0]:u.getBoundingClientRect()}if(a&&s<9&&!l&&(!i||!i.left&&!i.right)){var d=u.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+ir(e.display),top:d.top,bottom:d.bottom}:_n}for(var g=i.top-t.rect.top,m=i.bottom-t.rect.top,v=(g+m)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var T=b?y[b-1]:0,x=y[b],O={left:("right"==f?i.right:i.left)-t.rect.left,right:("left"==f?i.left:i.right)-t.rect.left,top:T,bottom:x};return i.left||i.right||(O.bogus=!0),e.options.singleCursorHeightPerLine||(O.rtop=g,O.rbottom=m),O}(e,t,n,r)).bogus||(t.cache[u]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Pn,_n={left:0,right:0,top:0,bottom:0};function jn(e,t,n){for(var r,i,o,a,s,u,l=0;l<e.length;l+=3)if(s=e[l],u=e[l+1],t<s?(i=0,o=1,a="left"):t<u?o=1+(i=t-s):(l==e.length-3||t==u&&e[l+3]>t)&&(i=(o=u-s)-1,t>=u&&(a="right")),null!=i){if(r=e[l+2],s==u&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[2+(l-=3)],a="left";if("right"==n&&i==u-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)r=e[(l+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:u}}function Dn(e,t){var n=_n;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Fn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Un(e){e.display.externalMeasure=null,k(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Fn(e.display.view[t])}function Wn(e){Un(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Hn(){return c&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Bn(){return c&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function zn(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=xn(e.widgets[n]));return t}function Gn(e,t,n,r,i){if(!i){var o=zn(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=zt(t);if("local"==r?a+=Sn(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Bn());var u=s.left+("window"==r?0:Hn());n.left+=u,n.right+=u}return n.top+=a,n.bottom+=a,n}function Vn(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Hn(),i-=Bn();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Kn(e,t,n,r,i){return r||(r=Ke(e.doc,t.line)),Gn(e,r,Ln(e,r,t.ch,i),n)}function qn(e,t,n,r,i,o){function a(t,a){var s=Mn(e,i,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,Gn(e,r,s,n)}r=r||Ke(e.doc,t.line),i||(i=In(e,r));var s=le(r,e.doc.direction),u=t.ch,l=t.sticky;if(u>=r.text.length?(u=r.text.length,l="before"):u<=0&&(u=0,l="after"),!s)return a("before"==l?u-1:u,"before"==l);function c(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var f=se(s,u,l),h=ae,p=c(u,f,"before"==l);return null!=h&&(p.other=c(u,h,"before"!=l)),p}function $n(e,t){var n=0;t=st(e.doc,t),e.options.lineWrapping||(n=ir(e.display)*t.ch);var r=Ke(e.doc,t.line),i=zt(r)+Sn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Yn(e,t,n,r,i){var o=et(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Xn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Yn(r.first,0,null,-1,-1);var i=Ze(r,n),o=r.first+r.size-1;if(i>o)return Yn(r.first+r.size-1,Ke(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Ke(r,i);;){var s=er(e,a,i,t,n),u=jt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!u)return s;var l=u.find(1);if(l.line==i)return l;a=Ke(r,i=l.line)}}function Zn(e,t,n,r){r-=zn(t);var i=t.text.length,o=oe((function(t){return Mn(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=oe((function(t){return Mn(e,n,t).top>r}),o,i)}}function Jn(e,t,n,r){return n||(n=In(e,t)),Zn(e,t,n,Gn(e,t,Mn(e,n,r),"line").top)}function Qn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,i){i-=zt(t);var o=In(e,t),a=zn(t),s=0,u=t.text.length,l=!0,c=le(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?nr:tr)(e,t,n,o,c,r,i);s=(l=1!=f.level)?f.from:f.to-1,u=l?f.to:f.from-1}var h,p,d=null,g=null,m=oe((function(t){var n=Mn(e,o,t);return n.top+=a,n.bottom+=a,!!Qn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(d=t,g=n),!0)}),s,u),v=!1;if(g){var y=r-g.left<g.right-r,b=y==l;m=d+(b?0:1),p=b?"after":"before",h=y?g.left:g.right}else{l||m!=u&&m!=s||m++,p=0==m?"after":m==t.text.length?"before":Mn(e,o,m-(l?1:0)).bottom+a<=i==l?"after":"before";var T=qn(e,et(n,m,p),"line",t,o);h=T.left,v=i<T.top?-1:i>=T.bottom?1:0}return Yn(n,m=ie(t.text,m,1),p,v,r-h)}function tr(e,t,n,r,i,o,a){var s=oe((function(s){var u=i[s],l=1!=u.level;return Qn(qn(e,et(n,l?u.to:u.from,l?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),u=i[s];if(s>0){var l=1!=u.level,c=qn(e,et(n,l?u.from:u.to,l?"after":"before"),"line",t,r);Qn(c,o,a,!0)&&c.top>a&&(u=i[s-1])}return u}function nr(e,t,n,r,i,o,a){var s=Zn(e,t,r,a),u=s.begin,l=s.end;/\s/.test(t.text.charAt(l-1))&&l--;for(var c=null,f=null,h=0;h<i.length;h++){var p=i[h];if(!(p.from>=l||p.to<=u)){var d=Mn(e,r,1!=p.level?Math.min(l,p.to)-1:Math.max(u,p.from)).right,g=d<o?o-d+1e9:d-o;(!c||f>g)&&(c=p,f=g)}}return c||(c=i[i.length-1]),c.from<u&&(c={from:u,to:c.to,level:c.level}),c.to>l&&(c={from:c.from,to:l,level:c.level}),c}function rr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Pn){Pn=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Pn.appendChild(document.createTextNode("x")),Pn.appendChild(A("br"));Pn.appendChild(document.createTextNode("x"))}N(e.measure,Pn);var n=Pn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),k(e.measure),n||1}function ir(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t],"CodeMirror-line-like");N(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function or(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:ar(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ar(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sr(e){var t=rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/ir(e.display)-3);return function(i){if(Ht(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function ur(e){var t=e.doc,n=sr(e);t.iter((function(e){var t=n(e);t!=e.height&&Ye(e,t)}))}function lr(e,t,n,r){var i=e.display;if(!n&&"true"==Se(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(e){return null}var u,l=Xn(e,o,a);if(r&&l.xRel>0&&(u=Ke(e.doc,l.line).text).length==l.ch){var c=F(u,u.length,e.options.tabSize)-u.length;l=et(l.line,Math.max(0,Math.round((o-En(e.display).left)/ir(e.display))-c))}return l}function cr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function fr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Ot&&Ut(e.doc,t)<i.viewTo&&pr(e);else if(n<=i.viewFrom)Ot&&Wt(e.doc,n+r)>i.viewFrom?pr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)pr(e);else if(t<=i.viewFrom){var o=dr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):pr(e)}else if(n>=i.viewTo){var a=dr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):pr(e)}else{var s=dr(e,t,t,-1),u=dr(e,n,n+r,1);s&&u?(i.view=i.view.slice(0,s.index).concat(on(e,s.lineN,u.lineN)).concat(i.view.slice(u.index)),i.viewTo+=r):pr(e)}var l=i.externalMeasured;l&&(n<l.lineN?l.lineN+=r:t<l.lineN+l.size&&(i.externalMeasured=null))}function hr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[cr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==W(a,n)&&a.push(n)}}}function pr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function dr(e,t,n,r){var i,o=cr(e,t),a=e.display.view;if(!Ot||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,u=0;u<o;u++)s+=a[u].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;Ut(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function gr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function mr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function vr(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();(u||e.options.showCursorWhenSelecting)&&yr(e,s.head,i),u||Tr(e,s,o)}}return r}function yr(e,t,n){var r=qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(A("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function br(e,t){return e.top-t.top||e.left-t.left}function Tr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=En(e.display),s=a.left,u=Math.max(r.sizerWidth,kn(e)-r.sizer.offsetLeft)-a.right,l="ltr"==i.direction;function c(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?u-e:n)+"px;\n height: "+(r-t)+"px"))}function f(t,n,r){var o,a,f=Ke(i,t),h=f.text.length;function p(n,r){return Kn(e,et(t,n),"div",f,r)}function d(t,n,r){var i=Jn(e,f,null,t),o="ltr"==n==("after"==r)?"left":"right";return p("after"==r?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}var g=le(f,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(g,n||0,null==r?h:r,(function(e,t,i,f){var m="ltr"==i,v=p(e,m?"left":"right"),y=p(t-1,m?"right":"left"),b=null==n&&0==e,T=null==r&&t==h,x=0==f,O=!g||f==g.length-1;if(y.top-v.top<=3){var S=(l?T:b)&&O,C=(l?b:T)&&x?s:(m?v:y).left,E=S?u:(m?y:v).right;c(C,v.top,E-C,v.bottom)}else{var w,k,N,A;m?(w=l&&b&&x?s:v.left,k=l?u:d(e,i,"before"),N=l?s:d(t,i,"after"),A=l&&T&&O?u:y.right):(w=l?d(e,i,"before"):s,k=!l&&b&&x?u:v.right,N=!l&&T&&O?s:y.left,A=l?d(t,i,"after"):u),c(w,v.top,k-w,v.bottom),v.bottom<y.top&&c(s,v.bottom,null,y.top),c(N,y.top,A-N,y.bottom)}(!o||br(v,o)<0)&&(o=v),br(y,o)<0&&(o=y),(!a||br(v,a)<0)&&(a=v),br(y,a)<0&&(a=y)})),{start:o,end:a}}var h=t.from(),p=t.to();if(h.line==p.line)f(h.line,h.ch,p.ch);else{var d=Ke(i,h.line),g=Ke(i,p.line),m=Ft(d)==Ft(g),v=f(h.line,h.ch,m?d.text.length+1:null).end,y=f(p.line,m?0:null,p.ch).start;m&&(v.top<y.top-2?(c(v.right,v.top,null,v.bottom),c(s,y.top,y.left,y.bottom)):c(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&c(s,v.bottom,null,y.top)}n.appendChild(o)}function xr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||Er(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Or(e){e.state.focused||(e.display.input.focus(),Cr(e))}function Sr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Er(e))}),100)}function Cr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(de(e,"focus",e,t),e.state.focused=!0,M(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),u&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),xr(e))}function Er(e,t){e.state.delayingBlurEvent||(e.state.focused&&(de(e,"blur",e,t),e.state.focused=!1,w(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function wr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=e.options.lineWrapping,u=void 0,l=0;if(!i.hidden){if(a&&s<8){var c=i.node.offsetTop+i.node.offsetHeight;u=c-n,n=c}else{var f=i.node.getBoundingClientRect();u=f.bottom-f.top,!o&&i.text.firstChild&&(l=i.text.firstChild.getBoundingClientRect().right-f.left-1)}var h=i.line.height-u;if((h>.005||h<-.005)&&(Ye(i.line,u),kr(i.line),i.rest))for(var p=0;p<i.rest.length;p++)kr(i.rest[p]);if(l>e.display.sizerWidth){var d=Math.ceil(l/ir(e.display));d>e.display.maxLineLength&&(e.display.maxLineLength=d,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function kr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Nr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Sn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=Ze(t,r),a=Ze(t,i);if(n&&n.ensure){var s=n.ensure.from.line,u=n.ensure.to.line;s<o?(o=s,a=Ze(t,zt(Ke(t,s))+e.wrapper.clientHeight)):Math.min(u,t.lastLine())>=a&&(o=Ze(t,zt(Ke(t,u))-e.wrapper.clientHeight),a=u)}return{from:o,to:Math.max(a,o+1)}}function Ar(e,t){var n=e.display,r=rr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Nn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Cn(n),u=t.top<r,l=t.bottom>s-r;if(t.top<i)a.scrollTop=u?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(l?s:t.bottom)-o);c!=i&&(a.scrollTop=c)}var f=e.options.fixedGutter?0:n.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-f,p=kn(e)-n.gutters.offsetWidth,d=t.right-t.left>p;return d&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.left<h?a.scrollLeft=Math.max(0,t.left+f-(d?0:10)):t.right>p+h-3&&(a.scrollLeft=t.right+(d?0:10)-p),a}function Lr(e,t){null!=t&&(Mr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Rr(e){Mr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ir(e,t,n){null==t&&null==n||Mr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Mr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Pr(e,$n(e,t.from),$n(e,t.to),t.margin))}function Pr(e,t,n,r){var i=Ar(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Ir(e,i.scrollLeft,i.scrollTop)}function _r(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||ui(e,{top:t}),jr(e,t,!0),n&&ui(e),ri(e,100))}function jr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Dr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,fi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Fr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Cn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+wn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Ur=function(e,t,n){this.cm=n;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),fe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),fe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ur.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Ur.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ur.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ur.prototype.zeroWidthHack=function(){var e=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new U,this.disableVert=new U},Ur.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},Ur.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Wr=function(){};function Hr(e,t){t||(t=Fr(e));var n=e.display.barWidth,r=e.display.barHeight;Br(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&wr(e),Br(e,Fr(e)),n=e.display.barWidth,r=e.display.barHeight}function Br(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Wr.prototype.update=function(){return{bottom:0,right:0}},Wr.prototype.setScrollLeft=function(){},Wr.prototype.setScrollTop=function(){},Wr.prototype.clear=function(){};var zr={native:Ur,null:Wr};function Gr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&w(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new zr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Dr(e,t):_r(e,t)}),e),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)}var Vr=0;function Kr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Vr},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function qr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{an=null,t(n)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)$r(t[n]);for(var r=0;r<t.length;r++)Yr(t[r]);for(var i=0;i<t.length;i++)Xr(t[i]);for(var o=0;o<t.length;o++)Zr(t[o]);for(var a=0;a<t.length;a++)Jr(t[a])}(e)}))}function $r(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=wn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=wn(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Vt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new oi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Yr(e){e.updatedDisplay=e.mustUpdate&&ai(e.cm,e.update)}function Xr(e){var t=e.cm,n=t.display;e.updatedDisplay&&wr(t),e.barMeasure=Fr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ln(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+wn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-kn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Zr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Dr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==I();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Hr(t,e.barMeasure),e.updatedDisplay&&ci(t,e.barMeasure),e.selectionChanged&&xr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Or(e.cm)}function Jr(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&si(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&jr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Dr(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!ge(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!d){var o=A("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Sn(e.display))+"px;\n height: "+(t.bottom-t.top+wn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=qn(e,t),u=n&&n!=t?qn(e,n):s,l=Ar(e,i={left:Math.min(s.left,u.left),top:Math.min(s.top,u.top)-r,right:Math.max(s.left,u.left),bottom:Math.max(s.bottom,u.bottom)+r}),c=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=l.scrollTop&&(_r(e,l.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=l.scrollLeft&&(Dr(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}(t,st(r,e.scrollToPos.from),st(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||de(i[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&de(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&de(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Qr(e,t){if(e.curOp)return t();Kr(e);try{return t()}finally{qr(e)}}function ei(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Kr(e);try{return t.apply(e,arguments)}finally{qr(e)}}}function ti(e){return function(){if(this.curOp)return e.apply(this,arguments);Kr(this);try{return e.apply(this,arguments)}finally{qr(this)}}}function ni(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Kr(t);try{return e.apply(this,arguments)}finally{qr(t)}}}function ri(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,j(ii,e))}function ii(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=pt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Be(t.mode,r.state):null,u=ft(e,o,r,!0);s&&(r.state=s),o.styles=u.styles;var l=o.styleClasses,c=u.classes;c?o.styleClasses=c:l&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||l!=c&&(!l||!c||l.bgClass!=c.bgClass||l.textClass!=c.textClass),h=0;!f&&h<a.length;++h)f=a[h]!=o.styles[h];f&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&dt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ri(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Qr(e,(function(){for(var t=0;t<i.length;t++)hr(e,i[t],"text")}))}}var oi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Nr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=kn(e),this.force=n,this.dims=or(e),this.events=[]};function ai(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return pr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==gr(e))return!1;hi(e)&&(pr(e),t.dims=or(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Ot&&(o=Ut(e.doc,o),a=Wt(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(cr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(on(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,cr(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=zt(Ke(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=gr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=I();if(!t||!R(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&R(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return l>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return u&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var l=r.view,c=r.viewFrom,f=0;f<l.length;f++){var h=l[f];if(h.hidden);else if(h.node&&h.node.parentNode==o){for(;a!=h.node;)a=s(a);var p=i&&null!=t&&t<=c&&h.lineNumber;h.changes&&(W(h.changes,"gutter")>-1&&(p=!1),cn(e,h,c,n)),p&&(k(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(Qe(e.options,c)))),a=h.node.nextSibling}else{var d=vn(e,h,c,n);o.insertBefore(d,a)}c+=h.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=I()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&R(document.body,e.anchorNode)&&R(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(c),k(n.cursorDiv),k(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ri(e,400)),n.updateLineNumbers=null,!0}function si(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=kn(e))r&&(t.visible=Nr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Cn(e.display)-Nn(e),n.top)}),t.visible=Nr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ai(e,t))break;wr(e);var i=Fr(e);mr(e),Hr(e,i),ci(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ui(e,t){var n=new oi(e,t);if(ai(e,n)){wr(e),si(e,n);var r=Fr(e);mr(e),Hr(e,r),ci(e,r),n.finish()}}function li(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ci(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+wn(e)+"px"}function fi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ar(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var u=0;u<s.length;u++)s[u].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function hi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Qe(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(A("div",[A("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",li(e.display),!0}return!1}function pi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function di(e){var t=e.gutters,n=e.gutterSpecs;k(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,s=t.appendChild(A("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",li(e)}function gi(e){di(e.display),fr(e),fi(e)}function mi(e,t,r,i){var o=this;this.input=r,o.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=L("div",null,"CodeMirror-code"),o.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=A("div",null,"CodeMirror-cursors"),o.measure=A("div",null,"CodeMirror-measure"),o.lineMeasure=A("div",null,"CodeMirror-measure"),o.lineSpace=L("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var l=L("div",[o.lineSpace],"CodeMirror-lines");o.mover=A("div",[l],null,"position: relative"),o.sizer=A("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=A("div",null,null,"position: absolute; height: 50px; width: 1px;"),o.gutters=A("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=A("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=A("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),u||n&&v||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=pi(i.gutters,i.lineNumbers),di(o),r.init(o)}oi.prototype.signal=function(e,t){ve(e,t)&&this.events.push(arguments)},oi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)de.apply(null,this.events[e])};var vi=0,yi=null;function bi(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function Ti(e){var t=bi(e);return t.x*=yi,t.y*=yi,t}function xi(e,t){var r=bi(t),i=r.x,o=r.y,a=e.display,s=a.scroller,l=s.scrollWidth>s.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&l||o&&c){if(o&&y&&u)e:for(var h=t.target,p=a.view;h!=s;h=h.parentNode)for(var d=0;d<p.length;d++)if(p[d].node==h){e.display.currentWheelTarget=h;break e}if(i&&!n&&!f&&null!=yi)return o&&c&&_r(e,Math.max(0,s.scrollTop+o*yi)),Dr(e,Math.max(0,s.scrollLeft+i*yi)),(!o||o&&c)&&be(t),void(a.wheelStartX=null);if(o&&null!=yi){var g=o*yi,m=e.doc.scrollTop,v=m+a.wrapper.clientHeight;g<0?m=Math.max(0,m+g-50):v=Math.min(e.doc.height,v+g+50),ui(e,{top:m,bottom:v})}vi<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(yi=(yi*vi+n)/(vi+1),++vi)}}),200)):(a.wheelDX+=i,a.wheelDY+=o))}}a?yi=-.53:n?yi=15:c?yi=-.7:h&&(yi=-1/3);var Oi=function(e,t){this.ranges=e,this.primIndex=t};Oi.prototype.primary=function(){return this.ranges[this.primIndex]},Oi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!nt(n.anchor,r.anchor)||!nt(n.head,r.head))return!1}return!0},Oi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Si(rt(this.ranges[t].anchor),rt(this.ranges[t].head));return new Oi(e,this.primIndex)},Oi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Oi.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(tt(t,r.from())>=0&&tt(e,r.to())<=0)return n}return-1};var Si=function(e,t){this.anchor=e,this.head=t};function Ci(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=W(t,i);for(var o=1;o<t.length;o++){var a=t[o],s=t[o-1],u=tt(s.to(),a.from());if(r&&!a.empty()?u>0:u>=0){var l=ot(s.from(),a.from()),c=it(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new Si(f?c:l,f?l:c))}}return new Oi(t,n)}function Ei(e,t){return new Oi([new Si(e,t||e)],0)}function wi(e){return e.text?et(e.from.line+e.text.length-1,$(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function ki(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return wi(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=wi(t).ch-t.to.ch),et(n,r)}function Ni(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Si(ki(i.anchor,t),ki(i.head,t)))}return Ci(e.cm,n,e.sel.primIndex)}function Ai(e,t,n){return e.line==t.line?et(n.line,e.ch-t.ch+n.ch):et(n.line+(e.line-t.line),e.ch)}function Li(e){e.doc.mode=Ue(e.options,e.doc.modeOption),Ri(e)}function Ri(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ri(e,100),e.state.modeGen++,e.curOp&&fr(e)}function Ii(e,t){return 0==t.from.ch&&0==t.to.ch&&""==$(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Mi(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Nt(e),At(e,n);var i=r?r(e):1;i!=e.height&&Ye(e,i)}(e,n,i,r),un(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new Kt(l[o],i(o),r));return n}var s=t.from,u=t.to,l=t.text,c=Ke(e,s.line),f=Ke(e,u.line),h=$(l),p=i(l.length-1),d=u.line-s.line;if(t.full)e.insert(0,a(0,l.length)),e.remove(l.length,e.size-l.length);else if(Ii(e,t)){var g=a(0,l.length-1);o(f,f.text,p),d&&e.remove(s.line,d),g.length&&e.insert(s.line,g)}else if(c==f)if(1==l.length)o(c,c.text.slice(0,s.ch)+h+c.text.slice(u.ch),p);else{var m=a(1,l.length-1);m.push(new Kt(h+c.text.slice(u.ch),p,r)),o(c,c.text.slice(0,s.ch)+l[0],i(0)),e.insert(s.line+1,m)}else if(1==l.length)o(c,c.text.slice(0,s.ch)+l[0]+f.text.slice(u.ch),i(0)),e.remove(s.line+1,d);else{o(c,c.text.slice(0,s.ch)+l[0],i(0)),o(f,h+f.text.slice(u.ch),p);var v=a(1,l.length-1);d>1&&e.remove(s.line+1,d-1),e.insert(s.line+1,v)}un(e,"change",e,t)}function Pi(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;a<r.linked.length;++a){var s=r.linked[a];if(s.doc!=i){var u=o&&s.sharedHist;n&&!u||(t(s.doc,u),e(s.doc,r,u))}}}(e,null,!0)}function _i(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ur(e),Li(e),ji(e),e.options.lineWrapping||Vt(e),e.options.mode=t.modeOption,fr(e)}function ji(e){("rtl"==e.doc.direction?M:w)(e.display.lineDiv,"CodeMirror-rtl")}function Di(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Fi(e,t){var n={from:rt(t.from),to:wi(t),text:qe(e,t.from,t.to)};return zi(e,n,t.from.line,t.to.line+1),Pi(e,(function(e){return zi(e,n,t.from.line,t.to.line+1)}),!0),n}function Ui(e){for(;e.length&&$(e).ranges;)e.pop()}function Wi(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Ui(e.done),$(e.done)):e.done.length&&!$(e.done).ranges?$(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),$(e.done)):void 0}(i,i.lastOp==r)))a=$(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,a.to)?a.to=wi(t):o.changes.push(Fi(e,t));else{var u=$(i.done);for(u&&u.ranges||Bi(e.sel,i.done),o={changes:[Fi(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||de(e,"historyAdded")}function Hi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,$(i.done),t))?i.done[i.done.length-1]=t:Bi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Ui(i.undone)}function Bi(e,t){var n=$(t);n&&n.ranges&&n.equals(e)||t.push(e)}function zi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Gi(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Vi(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Gi(n[i]));return r}(e,t),r=wt(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var s=0;s<a.length;++s){for(var u=a[s],l=0;l<o.length;++l)if(o[l].marker==u.marker)continue e;o.push(u)}else a&&(n[i]=a)}return n}function Ki(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?Oi.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];r.push({changes:s});for(var u=0;u<a.length;++u){var l=a[u],c=void 0;if(s.push({from:l.from,to:l.to,text:l.text}),t)for(var f in l)(c=f.match(/^spans_(\d+)$/))&&W(t,Number(c[1]))>-1&&($(s)[f]=l[f],delete l[f])}}}return r}function qi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=tt(t,i)<0;o!=tt(n,i)<0?(i=t,t=n):o!=tt(t,n)<0&&(t=n)}return new Si(i,t)}return new Si(n||t,t)}function $i(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Qi(e,new Oi([qi(e.sel.primary(),t,n,i)],0),r)}function Yi(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=qi(e.sel.ranges[o],t[o],null,i);Qi(e,Ci(e.cm,r,e.sel.primIndex),n)}function Xi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Qi(e,Ci(e.cm,i,e.sel.primIndex),r)}function Zi(e,t,n,r){Qi(e,Ei(t,n),r)}function Ji(e,t,n){var r=e.history.done,i=$(r);i&&i.ranges?(r[r.length-1]=t,eo(e,t,n)):Qi(e,t,n)}function Qi(e,t,n){eo(e,t,n),Hi(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function eo(e,t,n){(ve(e,"beforeSelectionChange")||e.cm&&ve(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new Si(st(e,t[n].anchor),st(e,t[n].head))},origin:n&&n.origin};return de(e,"beforeSelectionChange",e,r),e.cm&&de(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Ci(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);to(e,ro(e,t,r,!0)),n&&!1===n.scroll||!e.cm||Rr(e.cm)}function to(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,me(e.cm)),un(e,"cursorActivity",e))}function no(e){to(e,ro(e,e.sel,null,!1))}function ro(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],u=oo(e,a.anchor,s&&s.anchor,n,r),l=oo(e,a.head,s&&s.head,n,r);(i||u!=a.anchor||l!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Si(u,l))}return i?Ci(e.cm,i,t.primIndex):t}function io(e,t,n,r,i){var o=Ke(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],u=s.marker,l="selectLeft"in u?!u.selectLeft:u.inclusiveLeft,c="selectRight"in u?!u.selectRight:u.inclusiveRight;if((null==s.from||(l?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(c?s.to>=t.ch:s.to>t.ch))){if(i&&(de(u,"beforeCursorEnter"),u.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!u.atomic)continue;if(n){var f=u.find(r<0?1:-1),h=void 0;if((r<0?c:l)&&(f=ao(e,f,-r,f&&f.line==t.line?o:null)),f&&f.line==t.line&&(h=tt(f,n))&&(r<0?h<0:h>0))return io(e,f,t,r,i)}var p=u.find(r<0?-1:1);return(r<0?l:c)&&(p=ao(e,p,r,p.line==t.line?o:null)),p?io(e,p,t,r,i):null}}return t}function oo(e,t,n,r,i){var o=r||1,a=io(e,t,n,o,i)||!i&&io(e,t,n,o,!0)||io(e,t,n,-o,i)||!i&&io(e,t,n,-o,!0);return a||(e.cantEdit=!0,et(e.first,0))}function ao(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?st(e,et(t.line-1)):null:n>0&&t.ch==(r||Ke(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+n)}function so(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),B)}function uo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=st(e,t)),n&&(r.to=st(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),de(e,"beforeChange",e,r),e.cm&&de(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function lo(e,t,n){if(e.cm){if(!e.cm.curOp)return ei(e.cm,lo)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"))||(t=uo(e,t,!0))){var r=xt&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=W(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),u=0;u<i.length;++u){var l=i[u];if(!(tt(l.to,s.from)<0||tt(l.from,s.to)>0)){var c=[u,1],f=tt(l.from,s.from),h=tt(l.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&c.push({from:l.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&c.push({from:s.to,to:l.to}),i.splice.apply(i,c),u+=c.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)co(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else co(e,t)}}function co(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Ni(e,t);Wi(e,t,n,e.cm?e.cm.curOp.id:NaN),po(e,t,n,wt(e,t));var r=[];Pi(e,(function(e,n){n||-1!=W(r,e.history)||(yo(e.history,t),r.push(e.history)),po(e,t,null,wt(e,t))}))}}function fo(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,u="undo"==t?o.undone:o.done,l=0;l<s.length&&(i=s[l],n?!i.ranges||i.equals(e.sel):i.ranges);l++);if(l!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if(Bi(i,u),n&&!i.equals(e.sel))return void Qi(e,i,{clearRedo:!1});a=i}var c=[];Bi(a,u),u.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var f=ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"),h=function(n){var r=i.changes[n];if(r.origin=t,f&&!uo(e,r,!1))return s.length=0,{};c.push(Fi(e,r));var o=n?Ni(e,r):$(s);po(e,r,o,Vi(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:wi(r)});var a=[];Pi(e,(function(e,t){t||-1!=W(a,e.history)||(yo(e.history,r),a.push(e.history)),po(e,r,null,Vi(e,r))}))},p=i.changes.length-1;p>=0;--p){var d=h(p);if(d)return d.v}}}}function ho(e,t){if(0!=t&&(e.first+=t,e.sel=new Oi(Y(e.sel.ranges,(function(e){return new Si(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){fr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)hr(e.cm,r,"gutter")}}function po(e,t,n,r){if(e.cm&&!e.cm.curOp)return ei(e.cm,po)(e,t,n,r);if(t.to.line<e.first)ho(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);ho(e,i),t={from:et(e.first,0),to:et(t.to.line+i,t.to.ch),text:[$(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:et(o,Ke(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qe(e,t.from,t.to),n||(n=Ni(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,u=o.line;e.options.lineWrapping||(u=Xe(Ft(Ke(r,o.line))),r.iter(u,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&me(e),Mi(r,t,n,sr(e)),e.options.lineWrapping||(r.iter(u,o.line+t.text.length,(function(e){var t=Gt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=Ke(e,r).stateAfter;if(i&&(!(i instanceof lt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,o.line),ri(e,400);var l=t.text.length-(a.line-o.line)-1;t.full?fr(e):o.line!=a.line||1!=t.text.length||Ii(e.doc,t)?fr(e,o.line,a.line+1,l):hr(e,o.line,"text");var c=ve(e,"changes"),f=ve(e,"change");if(f||c){var h={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&un(e,"change",e,h),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}(e.cm,t,r):Mi(e,t,r),eo(e,n,B),e.cantEdit&&oo(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function go(e,t,n,r,i){var o;r||(r=n),tt(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),lo(e,{from:n,to:r,text:t,origin:i})}function mo(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function vo(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)mo(o.ranges[s].anchor,t,n,r),mo(o.ranges[s].head,t,n,r)}else{for(var u=0;u<o.changes.length;++u){var l=o.changes[u];if(n<l.from.line)l.from=et(l.from.line+r,l.from.ch),l.to=et(l.to.line+r,l.to.ch);else if(t<=l.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function yo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;vo(e.done,n,r,i),vo(e.undone,n,r,i)}function bo(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Ke(e,at(e,t)):i=Xe(t),null==i?null:(r(o,i)&&e.cm&&hr(e.cm,i,n),o)}function To(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function xo(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Si.prototype.from=function(){return ot(this.anchor,this.head)},Si.prototype.to=function(){return it(this.anchor,this.head)},Si.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},To.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,qt(i),un(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},xo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof To))){var s=[];this.collapse(s),this.children=[new To(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var u=new To(i.lines.slice(s,s+=25));i.height-=u.height,this.children.splice(++r,0,u),u.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new xo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=W(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new xo(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var Oo=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function So(e,t,n){zt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Lr(e,n)}Oo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Xe(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=xn(this);Ye(n,Math.max(0,n.height-o)),e&&(Qr(e,(function(){So(e,n,-o),hr(e,r,"widget")})),un(e,"lineWidgetCleared",e,this,r))}},Oo.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=xn(this)-t;i&&(Ht(this.doc,r)||Ye(r,r.height+i),n&&Qr(n,(function(){n.curOp.forceUpdate=!0,So(n,r,i),un(n,"lineWidgetChanged",n,e,Xe(r))})))},ye(Oo);var Co=0,Eo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Co};function wo(e,t,n,r,i){if(r&&r.shared)return function(e,t,n,r,i){(r=D(r)).shared=!1;var o=[wo(e,t,n,r,i)],a=o[0],s=r.widgetNode;return Pi(e,(function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(wo(e,st(e,t),st(e,n),r,i));for(var u=0;u<e.linked.length;++u)if(e.linked[u].isParent)return;a=$(o)})),new ko(o,a)}(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return ei(e.cm,wo)(e,t,n,r,i);var o=new Eo(e,i),a=tt(t,n);if(r&&D(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=L("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Dt(e,t.line,t,n,o)||t.line!=n.line&&Dt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ot=!0}o.addToHistory&&Wi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,u=t.line,l=e.cm;if(e.iter(u,n.line+1,(function(e){l&&o.collapsed&&!l.options.lineWrapping&&Ft(e)==l.display.maxLine&&(s=!0),o.collapsed&&u!=t.line&&Ye(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new St(o,u==t.line?t.ch:null,u==n.line?n.ch:null)),++u})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Ht(e,t)&&Ye(t,0)})),o.clearOnEnter&&fe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(xt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Co,o.atomic=!0),l){if(s&&(l.curOp.updateMaxLine=!0),o.collapsed)fr(l,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)hr(l,c,"text");o.atomic&&no(l.doc),un(l,"markerAdded",l,o)}return o}Eo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Kr(e),ve(this,"clear")){var n=this.find();n&&un(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=Ct(a.markedSpans,this);e&&!this.collapsed?hr(e,Xe(a),"text"):e&&(null!=s.to&&(i=Xe(a)),null!=s.from&&(r=Xe(a))),a.markedSpans=Et(a.markedSpans,s),null==s.from&&this.collapsed&&!Ht(this.doc,a)&&e&&Ye(a,rr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var u=0;u<this.lines.length;++u){var l=Ft(this.lines[u]),c=Gt(l);c>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&fr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&no(e.doc)),e&&un(e,"markerCleared",e,this,r,i),t&&qr(e),this.parent&&this.parent.clear()}},Eo.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Ct(o.markedSpans,this);if(null!=a.from&&(n=et(t?o:Xe(o),a.from),-1==e))return n;if(null!=a.to&&(r=et(t?o:Xe(o),a.to),1==e))return r}return n&&{from:n,to:r}},Eo.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Qr(r,(function(){var i=t.line,o=Xe(t.line),a=Rn(r,o);if(a&&(Fn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Ht(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var u=xn(n)-s;u&&Ye(i,i.height+u)}un(r,"markerChanged",r,e)}))},Eo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=W(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Eo.prototype.detachLine=function(e){if(this.lines.splice(W(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(Eo);var ko=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function No(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function Ao(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Pi(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==W(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}ko.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();un(this,"clear")}},ko.prototype.find=function(e,t){return this.primary.find(e,t)},ye(ko);var Lo=0,Ro=function(e,t,n,r,i){if(!(this instanceof Ro))return new Ro(e,t,n,r,i);null==n&&(n=0),xo.call(this,[new To([new Kt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=et(n,0);this.sel=Ei(o),this.history=new Di(null),this.id=++Lo,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Mi(this,{from:o,to:o,text:e}),Qi(this,Ei(o),B)};Ro.prototype=Z(xo.prototype,{constructor:Ro,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=$e(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ni((function(e){var t=et(this.first,0),n=this.first+this.size-1;lo(this,{from:t,to:et(n,Ke(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ir(this.cm,0,0),Qi(this,Ei(t),B)})),replaceRange:function(e,t,n,r){go(this,e,t=st(this,t),n=n?st(this,n):t,r)},getRange:function(e,t,n){var r=qe(this,st(this,e),st(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Je(this,e))return Ke(this,e)},getLineNumber:function(e){return Xe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ke(this,e)),Ft(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ni((function(e,t,n){Zi(this,st(this,"number"==typeof e?et(e,t||0):e),null,n)})),setSelection:ni((function(e,t,n){Zi(this,st(this,e),st(this,t||e),n)})),extendSelection:ni((function(e,t,n){$i(this,st(this,e),t&&st(this,t),n)})),extendSelections:ni((function(e,t){Yi(this,ut(this,e),t)})),extendSelectionsBy:ni((function(e,t){Yi(this,ut(this,Y(this.sel.ranges,e)),t)})),setSelections:ni((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Si(st(this,e[i].anchor),st(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Qi(this,Ci(this.cm,r,t),n)}})),addSelection:ni((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Si(st(this,e),st(this,t||e))),Qi(this,Ci(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=qe(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=qe(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:ni((function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var s=t&&"end"!=t&&function(e,t,n){for(var r=[],i=et(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],u=Ai(s.from,i,o),l=Ai(wi(s),i,o);if(i=s.to,o=l,"around"==n){var c=e.sel.ranges[a],f=tt(c.head,c.anchor)<0;r[a]=new Si(f?l:u,f?u:l)}else r[a]=new Si(u,u)}return new Oi(r,e.sel.primIndex)}(this,r,t),u=r.length-1;u>=0;u--)lo(this,r[u]);s?Ji(this,s):this.cm&&Rr(this.cm)})),undo:ni((function(){fo(this,"undo")})),redo:ni((function(){fo(this,"redo")})),undoSelection:ni((function(){fo(this,"undo",!0)})),redoSelection:ni((function(){fo(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Di(this.history.maxGeneration),Pi(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ki(this.history.done),undone:Ki(this.history.undone)}},setHistory:function(e){var t=this.history=new Di(this.history.maxGeneration);t.done=Ki(e.done.slice(0),null,!0),t.undone=Ki(e.undone.slice(0),null,!0)},setGutterMarker:ni((function(e,t,n){return bo(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&te(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:ni((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&bo(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,te(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Je(this,e))return null;if(t=e,!(e=Ke(this,e)))return null}else if(null==(t=Xe(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ni((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(C(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:ni((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(C(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:ni((function(e,t,n){return function(e,t,n,r){var i=new Oo(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),bo(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Ht(e,t)){var r=zt(t)<e.scrollTop;Ye(t,t.height+xn(i)),r&&Lr(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&un(o,"lineWidgetAdded",o,i,"number"==typeof t?t:Xe(t)),i}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return wo(this,st(this,e),st(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return wo(this,e=st(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Ke(this,(e=st(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=st(this,e),t=st(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var u=a[s];null!=u.to&&i==e.line&&e.ch>=u.to||null==u.from&&i!=e.line||null!=u.from&&i==t.line&&u.from>=t.ch||n&&!n(u.marker)||r.push(u.marker.parent||u.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n})),st(this,et(n,t))},indexFromPos:function(e){var t=(e=st(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Ro($e(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Ro($e(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(tt(o,a)){var s=wo(e,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,No(this)),r},unlinkDoc:function(e){if(e instanceof ka&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ao(No(this));break}if(e.history==this.history){var n=[e.id];Pi(e,(function(e){return n.push(e.id)}),!0),e.history=new Di(null),e.history.done=Ki(this.history.done,n),e.history.undone=Ki(this.history.undone,n)}},iterLinkedDocs:function(e){Pi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Re(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ni((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Qr(t=this.cm,(function(){ji(t),fr(t)})))}))}),Ro.prototype.eachLine=Ro.prototype.iter;var Io=0;function Mo(e){var t=this;if(Po(t),!ge(t,e)&&!On(t.display,e)){be(e),a&&(Io=+new Date);var n=lr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),s=0,u=function(){++s==i&&ei(t,(function(){var e={from:n=st(t.doc,n),to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};lo(t.doc,e),Ji(t.doc,Ei(st(t.doc,n),st(t.doc,wi(e))))}))()},l=function(e,n){if(t.options.allowDropFileTypes&&-1==W(t.options.allowDropFileTypes,e.type))u();else{var r=new FileReader;r.onerror=function(){return u()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),u()},r.readAsText(e)}},c=0;c<r.length;c++)l(r[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),eo(t.doc,Ei(n,n)),h)for(var p=0;p<h.length;++p)go(t.doc,"",h[p].anchor,h[p].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Po(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function _o(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var jo=!1;function Do(){var e;jo||(fe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,_o(Fo)}),100))})),fe(window,"blur",(function(){return _o(Er)})),jo=!0)}function Fo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Uo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Wo=0;Wo<10;Wo++)Uo[Wo+48]=Uo[Wo+96]=String(Wo);for(var Ho=65;Ho<=90;Ho++)Uo[Ho]=String.fromCharCode(Ho);for(var Bo=1;Bo<=12;Bo++)Uo[Bo+111]=Uo[Bo+63235]="F"+Bo;var zo={};function Go(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Vo(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Y(n.split(" "),Go),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=r):(s=i.slice(0,o+1).join(" "),a="...");var u=t[s];if(u){if(u!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var l in t)e[l]=t[l];return e}function Ko(e,t,n,r){var i=(t=Xo(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Ko(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Ko(e,t.fallthrough[o],n,r);if(a)return a}}}function qo(e){var t="string"==typeof e?e:Uo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function $o(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(O?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(O?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Yo(e,t){if(f&&34==e.keyCode&&e.char)return!1;var n=Uo[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),$o(n,e,t))}function Xo(e){return"string"==typeof e?zo[e]:e}function Zo(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&tt(o.from,$(r).to)<=0;){var a=r.pop();if(tt(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Qr(e,(function(){for(var t=r.length-1;t>=0;t--)go(e.doc,"",r[t].from,r[t].to,"+delete");Rr(e)}))}function Jo(e,t,n){var r=ie(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Qo(e,t,n){var r=Jo(e,t.ch,n);return null==r?null:new et(t.line,r,n<0?"after":"before")}function ea(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=le(n,t.doc.direction);if(o){var a,s=i<0?$(o):o[0],u=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var l=In(t,n);a=i<0?n.text.length-1:0;var c=Mn(t,l,a).top;a=oe((function(e){return Mn(t,l,e).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==u&&(a=Jo(n,a,1))}else a=i<0?s.to:s.from;return new et(r,a,u)}}return new et(r,i<0?n.text.length:0,i<0?"before":"after")}zo.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"},zo.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"},zo.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"},zo.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"]},zo.default=y?zo.macDefault:zo.pcDefault;var ta={selectAll:so,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),B)},killLine:function(e){return Zo(e,(function(t){if(t.empty()){var n=Ke(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Zo(e,(function(t){return{from:et(t.from().line,0),to:st(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Zo(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Zo(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Zo(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return na(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ra(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=Ke(e.doc,t),r=function(e){for(var t;t=_t(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=Xe(r)),ea(!0,e,n,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),G)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),G)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ra(e,t.head):r}),G)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=F(e.getLine(o.line),o.ch,r);t.push(q(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Qr(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=Ke(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new et(i.line,i.ch-1)),i.ch>0)i=new et(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),et(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Ke(e.doc,i.line-1).text;a&&(i=new et(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),et(i.line-1,a.length-1),i,"+transpose"))}n.push(new Si(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Qr(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Rr(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function na(e,t){var n=Ke(e.doc,t),r=Ft(n);return r!=n&&(t=Xe(r)),ea(!0,e,r,t,1)}function ra(e,t){var n=na(e,t.line),r=Ke(e.doc,n.line),i=le(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return et(n.line,a?0:o,n.sticky)}return n}function ia(e,t,n){if("string"==typeof t&&!(t=ta[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=H}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}var oa=new U;function aa(e,t,n,r){var i=e.state.keySeq;if(i){if(qo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:oa.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),sa(e,i+" "+t,n,r))return!0}return sa(e,t,n,r)}function sa(e,t,n,r){var i=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Ko(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Ko(t,e.options.extraKeys,n,e)||Ko(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&un(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(be(n),xr(e)),!!i}function ua(e,t){var n=Yo(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?aa(e,"Shift-"+n,t,(function(t){return ia(e,t,!0)}))||aa(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ia(e,t)})):aa(e,n,t,(function(t){return ia(e,t)})))}var la=null;function ca(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=I(),ge(t,e)))){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=ua(t,e);f&&(la=i?r:null,i||88!=r||Me||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!y&&!i&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(w(t,"CodeMirror-crosshair"),pe(document,"keyup",n),pe(document,"mouseover",n))}M(t,"CodeMirror-crosshair"),fe(document,"keyup",n),fe(document,"mouseover",n)}(t)}}function fa(e){16==e.keyCode&&(this.doc.sel.shift=!1),ge(this,e)}function ha(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||On(t.display,e)||ge(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(f&&n==la)return la=null,void be(e);if(!f||e.which&&!(e.which<10)||!ua(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(e,t,n){return aa(e,"'"+n+"'",t,(function(t){return ia(e,t,!0)}))}(t,e,i)||t.display.input.onKeyPress(e))}}}var pa,da,ga=function(e,t,n){this.time=e,this.pos=t,this.button=n};function ma(e){var t=this,n=t.display;if(!(ge(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,On(n,e))u||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!ba(t,e)){var r=lr(t,e),i=Ce(e),o=r?function(e,t){var n=+new Date;return da&&da.compare(n,e,t)?(pa=da=null,"triple"):pa&&pa.compare(n,e,t)?(da=new ga(n,e,t),pa=null,"double"):(pa=new ga(n,e,t),da=null,"single")}(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),aa(e,$o(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=ta[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=H}finally{e.state.suppressEdits=!1}return r}))}(t,i,r,o,e)||(1==i?r?function(e,t,n,r){a?setTimeout(j(Or,e),0):e.curOp.focus=I();var i,o=function(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=y?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?n.altKey:n.ctrlKey)),i}(e,n,r),l=e.doc.sel;e.options.dragDrop&&ke&&!e.isReadOnly()&&"single"==n&&(i=l.contains(t))>-1&&(tt((i=l.ranges[i]).from(),t)<0||t.xRel>0)&&(tt(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,l=ei(e,(function(t){u&&(i.scroller.draggable=!1),e.state.draggingText=!1,pe(i.wrapper.ownerDocument,"mouseup",l),pe(i.wrapper.ownerDocument,"mousemove",c),pe(i.scroller,"dragstart",f),pe(i.scroller,"drop",l),o||(be(t),r.addNew||$i(e.doc,n,null,null,r.extend),u&&!h||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return o=!0};u&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),fe(i.wrapper.ownerDocument,"mouseup",l),fe(i.wrapper.ownerDocument,"mousemove",c),fe(i.scroller,"dragstart",f),fe(i.scroller,"drop",l),Sr(e),setTimeout((function(){return i.input.focus()}),20)}(e,r,t,o):function(e,t,n,r){var i=e.display,o=e.doc;be(t);var a,s,u=o.sel,l=u.ranges;if(r.addNew&&!r.extend?(s=o.sel.contains(n),a=s>-1?l[s]:new Si(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new Si(n,n)),n=lr(e,t,!0,!0),s=-1;else{var c=va(e,n,r.unit);a=r.extend?qi(a,c.anchor,c.head,r.extend):c}r.addNew?-1==s?(s=l.length,Qi(o,Ci(e,l.concat([a]),s),{scroll:!1,origin:"*mouse"})):l.length>1&&l[s].empty()&&"char"==r.unit&&!r.extend?(Qi(o,Ci(e,l.slice(0,s).concat(l.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Xi(o,s,a,z):(s=0,Qi(o,new Oi([a],0),z),u=o.sel);var f=n;function h(t){if(0!=tt(f,t))if(f=t,"rectangle"==r.unit){for(var i=[],l=e.options.tabSize,c=F(Ke(o,n.line).text,n.ch,l),h=F(Ke(o,t.line).text,t.ch,l),p=Math.min(c,h),d=Math.max(c,h),g=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));g<=m;g++){var v=Ke(o,g).text,y=V(v,p,l);p==d?i.push(new Si(et(g,y),et(g,y))):v.length>y&&i.push(new Si(et(g,y),et(g,V(v,d,l))))}i.length||i.push(new Si(n,n)),Qi(o,Ci(e,u.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,T=a,x=va(e,t,r.unit),O=T.anchor;tt(x.anchor,O)>0?(b=x.head,O=ot(T.from(),x.anchor)):(b=x.anchor,O=it(T.to(),x.head));var S=u.ranges.slice(0);S[s]=function(e,t){var n=t.anchor,r=t.head,i=Ke(e.doc,n.line);if(0==tt(n,r)&&n.sticky==r.sticky)return t;var o=le(i);if(!o)return t;var a=se(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var u,l=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==l||l==o.length)return t;if(r.line!=n.line)u=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=se(o,r.ch,r.sticky),f=c-a||(r.ch-n.ch)*(1==s.level?-1:1);u=c==l-1||c==l?f<0:f>0}var h=o[l+(u?-1:0)],p=u==(1==h.level),d=p?h.from:h.to,g=p?"after":"before";return n.ch==d&&n.sticky==g?t:new Si(new et(n.line,d,g),r)}(e,new Si(st(o,O),b)),Qi(o,Ci(e,S,s),z)}}var p=i.wrapper.getBoundingClientRect(),d=0;function g(t){e.state.selectingText=!1,d=1/0,t&&(be(t),i.input.focus()),pe(i.wrapper.ownerDocument,"mousemove",m),pe(i.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var m=ei(e,(function(t){0!==t.buttons&&Ce(t)?function t(n){var a=++d,s=lr(e,n,!0,"rectangle"==r.unit);if(s)if(0!=tt(s,f)){e.curOp.focus=I(),h(s);var u=Nr(i,o);(s.line>=u.to||s.line<u.from)&&setTimeout(ei(e,(function(){d==a&&t(n)})),150)}else{var l=n.clientY<p.top?-20:n.clientY>p.bottom?20:0;l&&setTimeout(ei(e,(function(){d==a&&(i.scroller.scrollTop+=l,t(n))})),50)}}(t):g(t)})),v=ei(e,g);e.state.selectingText=v,fe(i.wrapper.ownerDocument,"mousemove",m),fe(i.wrapper.ownerDocument,"mouseup",v)}(e,r,t,o)}(t,r,o,e):Se(e)==n.scroller&&be(e):2==i?(r&&$i(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(S?t.display.input.onContextMenu(e):Sr(t)))}}function va(e,t,n){if("char"==n)return new Si(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Si(et(t.line,0),st(e.doc,et(t.line+1,0)));var r=n(e,t);return new Si(r.from,r.to)}function ya(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&be(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!ve(e,n))return xe(t);o-=s.top-a.viewOffset;for(var u=0;u<e.display.gutterSpecs.length;++u){var l=a.gutters.childNodes[u];if(l&&l.getBoundingClientRect().right>=i)return de(e,n,e,Ze(e.doc,o),e.display.gutterSpecs[u].className,t),xe(t)}}function ba(e,t){return ya(e,t,"gutterClick",!0)}function Ta(e,t){On(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&ya(e,t,"gutterContextMenu",!1)}(e,t)||ge(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function xa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Wn(e)}ga.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var Oa={toString:function(){return"CodeMirror.Init"}},Sa={},Ca={};function Ea(e,t,n){if(!t!=!(n&&n!=Oa)){var r=e.display.dragFunctions,i=t?fe:pe;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function wa(e){e.options.lineWrapping?(M(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(w(e.display.wrapper,"CodeMirror-wrap"),Vt(e)),ur(e),fr(e),Wn(e),setTimeout((function(){return Hr(e)}),100)}function ka(e,t){var n=this;if(!(this instanceof ka))return new ka(e,t);this.options=t=t?D(t):{},D(Sa,t,!1);var r=t.value;"string"==typeof r?r=new Ro(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new ka.inputStyles[t.inputStyle](this),o=this.display=new mi(e,r,i,t);for(var l in o.wrapper.CodeMirror=this,xa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Gr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new U,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;fe(t.scroller,"mousedown",ei(e,ma)),fe(t.scroller,"dblclick",a&&s<11?ei(e,(function(t){if(!ge(e,t)){var n=lr(e,t);if(n&&!ba(e,t)&&!On(e.display,t)){be(t);var r=e.findWordAt(n);$i(e.doc,r.anchor,r.head)}}})):function(t){return ge(e,t)||be(t)}),fe(t.scroller,"contextmenu",(function(t){return Ta(e,t)})),fe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||Ta(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}fe(t.scroller,"touchstart",(function(i){if(!ge(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!ba(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!On(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!r.prev||o(r,r.prev)?new Si(s,s):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(s):new Si(et(s.line,0),st(e.doc,et(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),be(n)}i()})),fe(t.scroller,"touchcancel",i),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(_r(e,t.scroller.scrollTop),Dr(e,t.scroller.scrollLeft,!0),de(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return xi(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return xi(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ge(e,t)||Oe(t)},over:function(t){ge(e,t)||(function(e,t){var n=lr(e,t);if(n){var r=document.createDocumentFragment();yr(e,n,r),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),N(e.display.dragCursor,r)}}(e,t),Oe(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Io<100))Oe(t);else if(!ge(e,t)&&!On(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}(e,t)},drop:ei(e,Mo),leave:function(t){ge(e,t)||Po(e)}};var u=t.input.getField();fe(u,"keyup",(function(t){return fa.call(e,t)})),fe(u,"keydown",ei(e,ca)),fe(u,"keypress",ei(e,ha)),fe(u,"focus",(function(t){return Cr(e,t)})),fe(u,"blur",(function(t){return Er(e,t)}))}(this),Do(),Kr(this),this.curOp.forceUpdate=!0,_i(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Cr(n)}),20):Er(this),Ca)Ca.hasOwnProperty(l)&&Ca[l](this,t[l],Oa);hi(this),t.finishInit&&t.finishInit(this);for(var c=0;c<Na.length;++c)Na[c](this);qr(this),u&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}ka.defaults=Sa,ka.optionHandlers=Ca;var Na=[];function Aa(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=pt(e,t).state:n="prev");var a=e.options.tabSize,s=Ke(o,t),u=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var l,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((l=o.mode.indent(i,s.text.slice(c.length),s.text))==H||l>150)){if(!r)return;n="prev"}}else l=0,n="not";"prev"==n?l=t>o.first?F(Ke(o,t-1).text,null,a):0:"add"==n?l=u+e.options.indentUnit:"subtract"==n?l=u-e.options.indentUnit:"number"==typeof n&&(l=u+n),l=Math.max(0,l);var f="",h=0;if(e.options.indentWithTabs)for(var p=Math.floor(l/a);p;--p)h+=a,f+="\t";if(h<l&&(f+=q(l-h)),f!=c)return go(o,f,et(t,0),et(t,c.length),"+input"),s.stateAfter=null,!0;for(var d=0;d<o.sel.ranges.length;d++){var g=o.sel.ranges[d];if(g.head.line==t&&g.head.ch<c.length){var m=et(t,c.length);Xi(o,d,new Si(m,m));break}}}ka.defineInitHook=function(e){return Na.push(e)};var La=null;function Ra(e){La=e}function Ia(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,s="paste"==i||e.state.pasteIncoming>a,u=Re(t),l=null;if(s&&r.ranges.length>1)if(La&&La.text.join("\n")==t){if(r.ranges.length%La.text.length==0){l=[];for(var c=0;c<La.text.length;c++)l.push(o.splitLines(La.text[c]))}}else u.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(l=Y(u,(function(e){return[e]})));for(var f=e.curOp.updateInput,h=r.ranges.length-1;h>=0;h--){var p=r.ranges[h],d=p.from(),g=p.to();p.empty()&&(n&&n>0?d=et(d.line,d.ch-n):e.state.overwrite&&!s?g=et(g.line,Math.min(Ke(o,g.line).text.length,g.ch+$(u).length)):s&&La&&La.lineWise&&La.text.join("\n")==u.join("\n")&&(d=g=et(d.line,0)));var m={from:d,to:g,text:l?l[h%l.length]:u,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};lo(e.doc,m),un(e,"inputRead",e,m)}t&&!s&&Pa(e,t),Rr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ma(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Qr(t,(function(){return Ia(t,n,0,null,"paste")})),!0}function Pa(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){a=Aa(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ke(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Aa(e,i.head.line,"smart"));a&&un(e,"electricInput",e,i.head.line)}}}function _a(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:et(i,0),head:et(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function ja(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Da(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return u?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),ja(e),t}function Fa(e,t,n,r,i){var o=t,a=n,s=Ke(e,t.line),u=i&&"rtl"==e.direction?-n:n;function l(o){var a,l;if("codepoint"==r){var c=s.text.charCodeAt(t.ch+(r>0?0:-1));a=isNaN(c)?null:new et(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(c>=55296&&c<56320?2:1))),-n)}else a=i?function(e,t,n,r){var i=le(t,e.doc.direction);if(!i)return Qo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=se(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Qo(t,n,r);var s,u=function(e,n){return Jo(t,e instanceof et?e.ch:e,n)},l=function(n){return e.options.lineWrapping?(s=s||In(e,t),Jn(e,t,s,n)):{begin:0,end:t.text.length}},c=l("before"==n.sticky?u(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var f=1==a.level==r<0,h=u(n,f?1:-1);if(null!=h&&(f?h<=a.to&&h<=c.end:h>=a.from&&h>=c.begin)){var p=f?"before":"after";return new et(n.line,h,p)}}var d=function(e,t,r){for(var o=function(e,t){return t?new et(n.line,u(e,1),"before"):new et(n.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],s=t>0==(1!=a.level),l=s?r.begin:u(r.end,-1);if(a.from<=l&&l<a.to)return o(l,s);if(l=s?a.from:u(a.to,-1),r.begin<=l&&l<r.end)return o(l,s)}},g=d(o+r,r,c);if(g)return g;var m=r>0?c.end:u(c.begin,-1);return null==m||r>0&&m==t.text.length||!(g=d(r>0?0:i.length-1,r,l(m)))?null:g}(e.cm,s,t,n):Qo(s,t,n);if(null==a){if(o||(l=t.line+u)<e.first||l>=e.first+e.size||(t=new et(l,t.ch,t.sticky),!(s=Ke(e,l))))return!1;t=ea(i,e.cm,s,t.line,u)}else t=a;return!0}if("char"==r||"codepoint"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var c=null,f="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||l(!p);p=!1){var d=s.text.charAt(t.ch)||"\n",g=ee(d,h)?"w":f&&"\n"==d?"n":!f||/\s/.test(d)?null:"p";if(!f||p||g||(g="s"),c&&c!=g){n<0&&(n=1,l(),t.sticky="after");break}if(g&&(c=g),n>0&&!l(!p))break}var m=oo(e,t,o,a,!0);return nt(o,m)&&(m.hitSide=!0),m}function Ua(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var u=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(u-.5*rr(e.display),3);i=(n>0?t.bottom:t.top)+n*l}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Xn(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Wa=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new U,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ha(e,t){var n=Rn(e,t.line);if(!n||n.hidden)return null;var r=Ke(e.doc,t.line),i=An(n,r,t.line),o=le(r,e.doc.direction),a="left";o&&(a=se(o,t.ch)%2?"right":"left");var s=jn(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Ba(e,t){return t&&(e.bad=!0),e}function za(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Ba(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Ga(o,t,n)}}function Ga(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!R(r,t))return Ba(et(Xe(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?$(e.rest):e.line;return Ba(et(Xe(o),o.text.length),i)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var u=e.measure,l=u.maps;function c(t,n,r){for(var i=-1;i<(l?l.length:0);i++)for(var o=i<0?u.map:l[i],a=0;a<o.length;a+=3){var s=o[a+2];if(s==t||s==n){var c=Xe(i<0?e.line:e.rest[i]),f=o[a]+r;return(r<0||s!=t)&&(f=o[a+(r?1:0)]),et(c,f)}}}var f=c(a,s,n);if(f)return Ba(f,i);for(var h=s.nextSibling,p=a?a.nodeValue.length-n:0;h;h=h.nextSibling){if(f=c(h,h.firstChild,0))return Ba(et(f.line,f.ch-p),i);p+=h.textContent.length}for(var d=s.previousSibling,g=n;d;d=d.previousSibling){if(f=c(d,d.firstChild,-1))return Ba(et(f.line,f.ch+g),i);g+=d.textContent.length}}Wa.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(o(e)&&!ge(r,e)){if(r.somethingSelected())Ra({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=_a(r);Ra({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,B),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=La.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=Da(),u=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),u.value=La.text.join("\n");var l=document.activeElement;_(u),setTimeout((function(){r.display.lineSpace.removeChild(s),l.focus(),l==i&&n.showPrimarySelection()}),50)}}ja(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),fe(i,"paste",(function(e){!o(e)||ge(r,e)||Ma(e,r)||s<=11&&setTimeout(ei(r,(function(){return t.updateFromDOM()})),20)})),fe(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),fe(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),fe(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),fe(i,"touchstart",(function(){return n.forceCompositionEnd()})),fe(i,"input",(function(){t.composing||t.readFromDOMSoon()})),fe(i,"copy",a),fe(i,"cut",a)},Wa.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Wa.prototype.prepareSelection=function(){var e=vr(this.cm,!1);return e.focus=document.activeElement==this.div,e},Wa.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Wa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Wa.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=za(t,e.anchorNode,e.anchorOffset),s=za(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=tt(ot(a,s),i)||0!=tt(it(a,s),o)){var u=t.display.view,l=i.line>=t.display.viewFrom&&Ha(t,i)||{node:u[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Ha(t,o);if(!c){var f=u[u.length-1].measure,h=f.maps?f.maps[f.maps.length-1]:f.map;c={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(l&&c){var p,d=e.rangeCount&&e.getRangeAt(0);try{p=E(l.node,l.offset,c.offset,c.node)}catch(e){}p&&(!n&&t.state.focused?(e.collapse(l.node,l.offset),p.collapsed||(e.removeAllRanges(),e.addRange(p))):(e.removeAllRanges(),e.addRange(p)),d&&null==e.anchorNode?e.addRange(d):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Wa.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Wa.prototype.showMultipleSelections=function(e){N(this.cm.display.cursorDiv,e.cursors),N(this.cm.display.selectionDiv,e.selection)},Wa.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Wa.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return R(this.div,t)},Wa.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Wa.prototype.blur=function(){this.div.blur()},Wa.prototype.getField=function(){return this.div},Wa.prototype.supportsTouch=function(){return!0},Wa.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Qr(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Wa.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Wa.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(m&&c&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=za(t,e.anchorNode,e.anchorOffset),r=za(t,e.focusNode,e.focusOffset);n&&r&&Qr(t,(function(){Qi(t.doc,Ei(n,r),B),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Wa.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=et(a.line-1,Ke(r.doc,a.line-1).length)),s.ch==Ke(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=et(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=cr(r,a.line))?(t=Xe(i.view[0].line),n=i.view[0].node):(t=Xe(i.view[e].line),n=i.view[e-1].node.nextSibling);var u,l,c=cr(r,s.line);if(c==i.view.length-1?(u=i.viewTo-1,l=i.lineDiv.lastChild):(u=Xe(i.view[c+1].line)-1,l=i.view[c+1].node.previousSibling),!n)return!1;for(var f=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),u=!1;function l(){a&&(o+=s,u&&(o+=s),a=u=!1)}function c(e){e&&(l(),o+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void c(n);var o,h=t.getAttribute("cm-marker");if(h){var p=e.findMarks(et(r,0),et(i+1,0),(m=+h,function(e){return e.id==m}));return void(p.length&&(o=p[0].find(0))&&c(qe(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var d=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;d&&l();for(var g=0;g<t.childNodes.length;g++)f(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(u=!0),d&&(a=!0)}else 3==t.nodeType&&c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var m}for(;f(t),t!=n;)t=t.nextSibling,u=!1;return o}(r,n,l,t,u)),h=qe(r.doc,et(t,0),et(u,Ke(r.doc,u).text.length));f.length>1&&h.length>1;)if($(f)==$(h))f.pop(),h.pop(),u--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),t++}for(var p=0,d=0,g=f[0],m=h[0],v=Math.min(g.length,m.length);p<v&&g.charCodeAt(p)==m.charCodeAt(p);)++p;for(var y=$(f),b=$(h),T=Math.min(y.length-(1==f.length?p:0),b.length-(1==h.length?p:0));d<T&&y.charCodeAt(y.length-d-1)==b.charCodeAt(b.length-d-1);)++d;if(1==f.length&&1==h.length&&t==a.line)for(;p&&p>a.ch&&y.charCodeAt(y.length-d-1)==b.charCodeAt(b.length-d-1);)p--,d++;f[f.length-1]=y.slice(0,y.length-d).replace(/^\u200b+/,""),f[0]=f[0].slice(p).replace(/\u200b+$/,"");var x=et(t,p),O=et(u,h.length?$(h).length-d:0);return f.length>1||f[0]||tt(x,O)?(go(r.doc,f,x,O,"+input"),!0):void 0},Wa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Wa.prototype.reset=function(){this.forceCompositionEnd()},Wa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Wa.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Wa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Qr(this.cm,(function(){return fr(e.cm)}))},Wa.prototype.setUneditable=function(e){e.contentEditable="false"},Wa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ei(this.cm,Ia)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Wa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Wa.prototype.onContextMenu=function(){},Wa.prototype.resetPosition=function(){},Wa.prototype.needsContentAttribute=!0;var Va=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new U,this.hasSelection=!1,this.composing=null};Va.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ge(r,e)){if(r.somethingSelected())Ra({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=_a(r);Ra({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,B):(n.prevInput="",i.value=t.text.join("\n"),_(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),fe(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),fe(i,"paste",(function(e){ge(r,e)||Ma(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),fe(i,"cut",o),fe(i,"copy",o),fe(e.scroller,"paste",(function(t){if(!On(e,t)&&!ge(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),fe(e.lineSpace,"selectstart",(function(t){On(e,t)||be(t)})),fe(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Va.prototype.createField=function(e){this.wrapper=Da(),this.textarea=this.wrapper.firstChild},Va.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Va.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=vr(e);if(e.options.moveInputWithCursor){var i=qn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Va.prototype.showSelection=function(e){var t=this.cm.display;N(t.cursorDiv,e.cursors),N(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Va.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&_(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Va.prototype.getField=function(){return this.textarea},Va.prototype.supportsTouch=function(){return!1},Va.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||I()!=this.textarea))try{this.textarea.focus()}catch(e){}},Va.prototype.blur=function(){this.textarea.blur()},Va.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Va.prototype.receivedFocus=function(){this.slowPoll()},Va.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Va.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Va.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ie(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var u=0,l=Math.min(r.length,i.length);u<l&&r.charCodeAt(u)==i.charCodeAt(u);)++u;return Qr(t,(function(){Ia(t,i.slice(u),r.length-u,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Va.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Va.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Va.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=lr(n,e),l=r.scroller.scrollTop;if(o&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ei(n,Qi)(n.doc,Ei(o),B);var c,h=i.style.cssText,p=t.wrapper.style.cssText,d=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",u&&(c=window.scrollY),r.input.focus(),u&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&m(),S){Oe(e);var g=function(){pe(window,"mouseup",g),setTimeout(v,20)};fe(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var e=n.somethingSelected(),o=""+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=h,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),null!=i.selectionStart)){(!a||a&&s<9)&&m();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?ei(n,so)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},Va.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Va.prototype.setUneditable=function(){},Va.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Oa&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Oa,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Li(e)}),!0),n("indentUnit",2,Li,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Ri(e),Wn(e),fr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(et(r,o))}r++}));for(var i=n.length-1;i>=0;i--)go(e.doc,t,n[i],et(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Oa&&e.refresh()})),n("specialCharPlaceholder",Jt,(function(e){return e.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(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!T),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){xa(e),gi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Xo(t),i=n!=Oa&&Xo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,wa,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=pi(t,e.options.lineNumbers),gi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ar(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Hr(e)}),!0),n("scrollbarStyle","native",(function(e){Gr(e),Hr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=pi(e.options.gutters,t),gi(e)}),!0),n("firstLineNumber",1,gi,!0),n("lineNumberFormatter",(function(e){return e}),gi,!0),n("showCursorWhenSelecting",!1,mr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Er(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Ea),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,mr,!0),n("singleCursorHeightPerLine",!0,mr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ri,!0),n("addModeClass",!1,Ri,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Ri,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(ka),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&ei(this,t[e])(this,n,i),de(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:ti((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,fr(this)})),removeOverlay:ti((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void fr(this)}})),indentLine:ti((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Je(this.doc,e)&&Aa(this,e,t,n)})),indentSelection:ti((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Aa(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Rr(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var u=s;u<n;++u)Aa(this,u,e);var l=this.doc.sel.ranges;0==o.ch&&t.length==l.length&&l[r].from().ch>0&&Xi(this.doc,r,new Si(o,l[r].to()),B)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e);var t,n=ht(this,Ke(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var s=i[o[t][a]];s&&r.push(s)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var u=0;u<i._global.length;u++){var l=i._global[u];l.pred(o,this)&&-1==W(r,l.val)&&r.push(l.val)}return r},getStateAfter:function(e,t){var n=this.doc;return pt(this,(e=at(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return qn(this,null==e?n.head:"object"==typeof e?st(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Kn(this,st(this.doc,e),t||"page")},coordsChar:function(e,t){return Xn(this,(e=Vn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Vn(this,{top:e,left:0},t||"page").top,Ze(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=Ke(this.doc,e)}else r=e;return Gn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-zt(r):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,a,s,u=this.display,l=(e=qn(this,st(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),u.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var f=Math.max(u.wrapper.clientHeight,this.doc.height),h=Math.max(u.sizer.clientWidth,u.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(l=e.bottom),c+t.offsetWidth>h&&(c=h-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(c=u.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(u.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(o=this,a={left:c,top:l,right:c+t.offsetWidth,bottom:l+t.offsetHeight},null!=(s=Ar(o,a)).scrollTop&&_r(o,s.scrollTop),null!=s.scrollLeft&&Dr(o,s.scrollLeft))},triggerOnKeyDown:ti(ca),triggerOnKeyPress:ti(ha),triggerOnKeyUp:fa,triggerOnMouseDown:ti(ma),execCommand:function(e){if(ta.hasOwnProperty(e))return ta[e].call(null,this)},triggerElectric:ti((function(e){Pa(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=st(this.doc,e),a=0;a<t&&!(o=Fa(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:ti((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Fa(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),G)})),deleteH:ti((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Zo(this,(function(n){var i=Fa(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var a=st(this.doc,e),s=0;s<t;++s){var u=qn(this,a,"div");if(null==o?o=u.left:u.left=o,(a=Ua(this,u,i,n)).hitSide)break}return a},moveV:ti((function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var s=qn(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var u=Ua(n,s,e,t);return"page"==t&&a==r.sel.primary()&&Lr(n,Kn(n,u,"div").top-s.top),u}),G),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(e){var t=Ke(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),a=ee(o,i)?function(e){return ee(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};n>0&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new Si(et(e.line,n),et(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?M(this.display.cursorDiv,"CodeMirror-overwrite"):w(this.display.cursorDiv,"CodeMirror-overwrite"),de(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==I()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ti((function(e,t){Ir(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-wn(this)-this.display.barHeight,width:e.scrollWidth-wn(this)-this.display.barWidth,clientHeight:Nn(this),clientWidth:kn(this)}},scrollIntoView:ti((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Mr(e),e.curOp.scrollToPos=t}(this,e):Pr(this,e.from,e.to,e.margin)})),setSize:ti((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Un(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){hr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,de(this,"refresh",this)})),operation:function(e){return Qr(this,e)},startOperation:function(){return Kr(this)},endOperation:function(){return qr(this)},refresh:ti((function(){var e=this.display.cachedTextHeight;fr(this),this.curOp.forceUpdate=!0,Wn(this),Ir(this,this.doc.scrollLeft,this.doc.scrollTop),li(this.display),(null==e||Math.abs(e-rr(this.display))>.5||this.options.lineWrapping)&&ur(this),de(this,"refresh",this)})),swapDoc:ti((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),_i(this,e),Wn(this),this.display.input.reset(),Ir(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,un(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ye(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(ka);var Ka="iter insert remove copy getEditor constructor".split(" ");for(var qa in Ro.prototype)Ro.prototype.hasOwnProperty(qa)&&W(Ka,qa)<0&&(ka.prototype[qa]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ro.prototype[qa]));return ye(Ro),ka.inputStyles={textarea:Va,contenteditable:Wa},ka.defineMode=function(e){ka.defaults.mode||"null"==e||(ka.defaults.mode=e),De.apply(this,arguments)},ka.defineMIME=function(e,t){je[e]=t},ka.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),ka.defineMIME("text/plain","null"),ka.defineExtension=function(e,t){ka.prototype[e]=t},ka.defineDocExtension=function(e,t){Ro.prototype[e]=t},ka.fromTextArea=function(e,t){if((t=t?D(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=I();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(fe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(pe(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=ka((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=pe,e.on=fe,e.wheelEventPixels=Ti,e.Doc=Ro,e.splitLines=Re,e.countColumn=F,e.findColumn=V,e.isWordChar=Q,e.Pass=H,e.signal=de,e.Line=Kt,e.changeEnd=wi,e.scrollbarModel=zr,e.Pos=et,e.cmpPos=tt,e.modes=_e,e.mimeModes=je,e.resolveMode=Fe,e.getMode=Ue,e.modeExtensions=We,e.extendMode=He,e.copyState=Be,e.startState=Ge,e.innerMode=ze,e.commands=ta,e.keyMap=zo,e.keyName=Yo,e.isModifierKey=qo,e.lookupKey=Ko,e.normalizeKeyMap=Vo,e.StringStream=Ve,e.SharedTextMarker=ko,e.TextMarker=Eo,e.LineWidget=Oo,e.e_preventDefault=be,e.e_stopPropagation=Te,e.e_stop=Oe,e.addClass=M,e.contains=R,e.rmClass=w,e.keyNames=Uo}(ka),ka.version="5.58.2",ka}()},function(e,t,n){"use strict";
/*! Copyright (c) 2020 Patrick Demian; Licensed under MIT */Object.defineProperty(t,"__esModule",{value:!0}),t.AllTokens=t.Outdent=t.Indent=t.StringLiteral=t.NumberLiteral=t.Identifier=t.MultilineComment=t.SingleLineComment=t.WS=t.EndOfLine=t.OrMore=t.CaseSensitive=t.CaseInsensitive=t.CarriageReturn=t.Newline=t.Repeat=t.Called=t.Create=t.To=t.From=t.Exclusive=t.Inclusive=t.Exactly=t.Times=t.A=t.Group=t.Linefeed=t.Tab=t.Between=t.Not=t.Matching=t.Exact=t.Multiline=t.Global=t.Using=t.Number=t.Whitespace=t.Character=t.Digit=t.Word=t.And=t.Or=t.Anything=t.Then=t.Match=t.Optional=t.Ten=t.Nine=t.Eight=t.Seven=t.Six=t.Five=t.Four=t.Three=t.Two=t.One=t.Zero=void 0;const r=n(3);t.Zero=r.createToken({name:"Zero",pattern:/zero/i}),t.One=r.createToken({name:"One",pattern:/one/i}),t.Two=r.createToken({name:"Two",pattern:/two/i}),t.Three=r.createToken({name:"Three",pattern:/three/i}),t.Four=r.createToken({name:"Four",pattern:/four/i}),t.Five=r.createToken({name:"Five",pattern:/five/i}),t.Six=r.createToken({name:"Six",pattern:/six/i}),t.Seven=r.createToken({name:"Seven",pattern:/seven/i}),t.Eight=r.createToken({name:"Eight",pattern:/eight/i}),t.Nine=r.createToken({name:"Nine",pattern:/nine/i}),t.Ten=r.createToken({name:"Ten",pattern:/ten/i}),t.Optional=r.createToken({name:"Optional",pattern:/optional(ly)?/i}),t.Match=r.createToken({name:"Match",pattern:/match(es)?/i}),t.Then=r.createToken({name:"Then",pattern:/then/i}),t.Anything=r.createToken({name:"Anything",pattern:/(any thing|any|anything)(s)?/i}),t.Or=r.createToken({name:"Or",pattern:/or/i}),t.And=r.createToken({name:"And",pattern:/and|,/i}),t.Word=r.createToken({name:"WordSpecifier",pattern:/word(s)?/i}),t.Digit=r.createToken({name:"DigitSpecifier",pattern:/digit(s)?/i}),t.Character=r.createToken({name:"CharacterSpecifier",pattern:/character(s)?/i}),t.Whitespace=r.createToken({name:"WhitespaceSpecifier",pattern:/(white space|whitespace)(s)?/i}),t.Number=r.createToken({name:"NumberSpecifier",pattern:/number(s)?/i}),t.Using=r.createToken({name:"Using",pattern:/using/i}),t.Global=r.createToken({name:"Global",pattern:/global/i}),t.Multiline=r.createToken({name:"Multiline",pattern:/(multi line|multiline)/i}),t.Exact=r.createToken({name:"Exact",pattern:/exact/i}),t.Matching=r.createToken({name:"Matching",pattern:/matching/i}),t.Not=r.createToken({name:"Not",pattern:/not/i}),t.Between=r.createToken({name:"Between",pattern:/between/i}),t.Tab=r.createToken({name:"Tab",pattern:/tab/i}),t.Linefeed=r.createToken({name:"Linefeed",pattern:/(line feed|linefeed)/i}),t.Group=r.createToken({name:"Group",pattern:/group/i}),t.A=r.createToken({name:"A",pattern:/a(n)?/i}),t.Times=r.createToken({name:"Times",pattern:/times/i}),t.Exactly=r.createToken({name:"Exactly",pattern:/exact(ly)?/i}),t.Inclusive=r.createToken({name:"Inclusive",pattern:/inclusive(ly)?/i}),t.Exclusive=r.createToken({name:"Exclusive",pattern:/exclusive(ly)?/i}),t.From=r.createToken({name:"From",pattern:/from/i}),t.To=r.createToken({name:"To",pattern:/(to|through|thru|\-|\.\.|\.\.\.)/i}),t.Create=r.createToken({name:"Create",pattern:/create(s)?/i}),t.Called=r.createToken({name:"Called",pattern:/name(d)?|call(ed)?/i}),t.Repeat=r.createToken({name:"Repeat",pattern:/repeat(s|ing)?/i}),t.Newline=r.createToken({name:"Newline",pattern:/(new line|newline)/i}),t.CarriageReturn=r.createToken({name:"CarriageReturn",pattern:/carriage return/i}),t.CaseInsensitive=r.createToken({name:"CaseInsensitive",pattern:/case insensitive/i}),t.CaseSensitive=r.createToken({name:"CaseSensitive",pattern:/case sensitive/i}),t.OrMore=r.createToken({name:"OrMore",pattern:/\+|or more/i}),t.EndOfLine=r.createToken({name:"EOL",pattern:/\n/}),t.WS=r.createToken({name:"Whitespace",pattern:/[^\S\n]+/,start_chars_hint:[" ","\r"],group:r.Lexer.SKIPPED}),t.SingleLineComment=r.createToken({name:"SingleLineComment",pattern:/(#|\/\/).*/,group:r.Lexer.SKIPPED}),t.MultilineComment=r.createToken({name:"MultiLineComment",pattern:/\/\*(.*)\*\//,line_breaks:!0,group:r.Lexer.SKIPPED}),t.Identifier=r.createToken({name:"Identifier",pattern:/[a-z]\w*/i}),t.NumberLiteral=r.createToken({name:"NumberLiteral",pattern:/-?\d+/}),t.StringLiteral=r.createToken({name:"StringLiteral",pattern:/"(?:[^\\"]|\\(?:[bfnrtv"\\/]|u[0-9a-f]{4}|U[0-9a-f]{8}))*"/i}),t.Indent=r.createToken({name:"Indent"}),t.Outdent=r.createToken({name:"Outdent"}),t.AllTokens=[t.Zero,t.One,t.Two,t.Three,t.Four,t.Five,t.Six,t.Seven,t.Eight,t.Nine,t.Ten,t.Optional,t.Matching,t.Match,t.Then,t.Anything,t.And,t.Word,t.Digit,t.Character,t.Whitespace,t.Number,t.Using,t.Global,t.Multiline,t.Exact,t.Not,t.Between,t.Tab,t.Linefeed,t.Group,t.A,t.Times,t.Exactly,t.Inclusive,t.Exclusive,t.From,t.Create,t.Called,t.Repeat,t.Newline,t.CarriageReturn,t.CaseInsensitive,t.CaseSensitive,t.OrMore,t.Or,t.To,t.EndOfLine,t.Indent,t.WS,t.SingleLineComment,t.MultilineComment,t.Identifier,t.NumberLiteral,t.StringLiteral]},function(e,t,n){"use strict";
/*! Copyright (c) 2020 Patrick Demian; Licensed under MIT */Object.defineProperty(t,"__esModule",{value:!0}),t.RegularExpressionCST=t.GroupStatementCST=t.RepeatStatementCST=t.MatchStatementCST=t.CountSubStatementCST=t.UsingStatementCST=t.MatchSubStatementCST=t.StatementCST=t.MatchStatementValue=t.MatchSubStatementValue=t.MatchSubStatementType=t.UsingFlags=t.H2RCST=t.RegexDialect=void 0;const r=n(2);var i,o;!function(e){e[e.JS=0]="JS",e[e.PCRE=1]="PCRE",e[e.DotNet=2]="DotNet",e[e.Java=3]="Java"}(t.RegexDialect||(t.RegexDialect={}));class a{constructor(e){this.tokens=e}error(e){var t,n,i;const o=r.first(this.tokens),a=r.last(this.tokens);return{startLine:null!==(t=o.startLine)&&void 0!==t?t:NaN,startColumn:null!==(n=o.startColumn)&&void 0!==n?n:NaN,length:(null!==(i=a.endOffset)&&void 0!==i?i:a.startOffset)-o.startOffset,message:e}}}t.H2RCST=a,function(e){e[e.Multiline=r.makeFlag(0)]="Multiline",e[e.Global=r.makeFlag(1)]="Global",e[e.Sensitive=r.makeFlag(2)]="Sensitive",e[e.Insensitive=r.makeFlag(3)]="Insensitive",e[e.Exact=r.makeFlag(4)]="Exact"}(i=t.UsingFlags||(t.UsingFlags={})),function(e){e[e.SingleString=0]="SingleString",e[e.Between=1]="Between",e[e.Anything=2]="Anything",e[e.Word=3]="Word",e[e.Digit=4]="Digit",e[e.Character=5]="Character",e[e.Whitespace=6]="Whitespace",e[e.Number=7]="Number",e[e.Tab=8]="Tab",e[e.Linefeed=9]="Linefeed",e[e.Newline=10]="Newline",e[e.CarriageReturn=11]="CarriageReturn"}(o=t.MatchSubStatementType||(t.MatchSubStatementType={}));t.MatchSubStatementValue=class{constructor(e,t=null,n=null){this.type=e,this.from=t,this.to=n}};t.MatchStatementValue=class{constructor(e,t){this.optional=e,this.statement=t}};class s extends a{}t.StatementCST=s;t.MatchSubStatementCST=class extends a{constructor(e,t,n=!1,r){super(e),this.count=t,this.invert=n,this.values=r}validate(e){let t=[];this.count&&(t=t.concat(this.count.validate(e)));for(const e of this.values)if(e.type===o.Between){let n=e.from,i=e.to;r.isSingleRegexCharacter(n)?(n.startsWith("\\u")||n.startsWith("\\U")||n.startsWith("\\"))&&(n=JSON.parse(`"${r.regexEscape(n)}"`)):t.push(this.error("Between statement must begin with a single character")),r.isSingleRegexCharacter(i)?(i.startsWith("\\u")||i.startsWith("\\U")||i.startsWith("\\"))&&(i=JSON.parse(`"${r.regexEscape(i)}"`)):t.push(this.error("Between statement must end with a single character")),n.charCodeAt(0)>=i.charCodeAt(0)&&t.push(this.error("Between statement range invalid"))}return t}toRegex(e){const t=[];for(const e of this.values)switch(e.type){case o.SingleString:{const n=r.regexEscape(r.removeQuotes(e.from));t.push(this.invert?`(?:(?!${n}))`:n);break}case o.Between:t.push(this.invert?`[^${e.from}-${e.to}]`:`[${e.from}-${e.to}]`);break;case o.Word:t.push(this.invert?"\\W+":"\\w+");break;case o.Digit:t.push(this.invert?"\\D":"\\d");break;case o.Character:t.push(this.invert?"\\W":"\\w");break;case o.Whitespace:t.push(this.invert?"\\S":"\\s");break;case o.Number:t.push(this.invert?"\\D+":"\\d+");break;case o.Tab:t.push(this.invert?"[^\\t]":"\\t");break;case o.Newline:case o.Linefeed:t.push(this.invert?"[^\\n]":"\\n");break;case o.CarriageReturn:t.push(this.invert?"[^\\r]":"\\r");break;default:t.push(this.invert?"[^.]":".")}let n="";return n=1===t.length?t[0]:t.every(r.isSingleRegexCharacter)?"["+t.join("")+"]":"(?:"+t.join("|")+")",this.count&&(n+=this.count.toRegex(e)),n}};t.UsingStatementCST=class extends a{constructor(e,t){super(e),this.flags=t}validate(e){r.unusedParameter(e,"Using Statement does not change based on language");const t=[];let n=this.flags[0];for(let e=1;e<this.flags.length;e++)r.hasFlag(n,this.flags[e])&&t.push(this.error("Duplicate modifier: "+o[this.flags[e]])),n=r.combineFlags(n,this.flags[e]);return r.hasFlag(n,i.Sensitive)&&r.hasFlag(n,i.Insensitive)&&t.push(this.error("Cannot be both case sensitive and insensitive")),t}toRegex(e){r.unusedParameter(e,"Using Statement does not change based on language");let t="",n=!1;for(const e of this.flags)r.hasFlag(e,i.Multiline)?t+="m":r.hasFlag(e,i.Global)?t+="g":r.hasFlag(e,i.Insensitive)?t+="i":r.hasFlag(e,i.Exact)&&(n=!0);return n?"/^{regex}$/"+t:"/{regex}/"+t}};t.CountSubStatementCST=class extends a{constructor(e,t,n=null,r=null){super(e),this.from=t,this.to=n,this.opt=r}validate(e){r.unusedParameter(e,"Count does not need checking");const t=[];return this.from<0?t.push(this.error("Value cannot be negative")):null!==this.to&&("exclusive"===this.opt&&this.to-1<=this.from||this.to<=this.from)&&t.push(this.error("Values must be in range of eachother")),t}toRegex(e){r.unusedParameter(e,"Count does not change from language");const t=this.from;let n=this.to;if(null===n){if(1===t)return"+"===this.opt?"+":"*";if(0===t)return"+"===this.opt?"*":"{0}"}return null!==n?("exclusive"===this.opt&&n--,`{${t},${n}}`):"+"===this.opt?`{${t},}`:`{${t}}`}};t.MatchStatementCST=class extends s{constructor(e,t){super(e),this.matches=t}validate(e){let t=[];for(const n of this.matches)t=t.concat(n.statement.validate(e));return t}toRegex(e){return this.matches.map(t=>t.statement.toRegex(e)+(t.optional?"?":"")).join("")}};t.RepeatStatementCST=class extends s{constructor(e,t,n,r){super(e),this.optional=t,this.count=n,this.statements=r}validate(e){let t=[];null!==this.count&&(t=t.concat(this.count.validate(e)));for(const n of this.statements)t=t.concat(n.validate(e));return t}toRegex(e){let t="("+this.statements.map(t=>t.toRegex(e)).join("")+")";return this.count?t+=this.count.toRegex(e):t+="*",this.optional&&(t+="?"),t}};t.GroupStatementCST=class extends s{constructor(e,t,n,r){super(e),this.optional=t,this.name=n,this.statements=r}validate(e){let t=[];for(const n of this.statements)t=t.concat(n.validate(e));return t}toRegex(e){let t="(";return null!==this.name&&(t+=`?<${this.name}>`),t+=this.statements.map(t=>t.toRegex(e)).join(""),t+=this.optional?")?":")",t}};t.RegularExpressionCST=class extends a{constructor(e,t,n){super(e),this.usings=t,this.statements=n}validate(e){let t=this.usings.validate(e);for(const n of this.statements)t=t.concat(n.validate(e));return t}toRegex(e){const t=this.usings.toRegex(e),n=this.statements.map(t=>t.toRegex(e)).join("");return t.replace("{regex}",n)}}},function(e,t,n){"use strict";
/*! Copyright (c) 2020 Patrick Demian; Licensed under MIT */var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8),o=n(9),a=n(6),s=n(2),u=r(n(10)),l=r(n(4));n(11),n(12),n(13),n(14),n(15),n(16),n(17),u.default((function(){l.default.defineSimpleMode("human2regex",{start:[{token:"number",regex:/zero/i},{token:"number",regex:/one/i},{token:"number",regex:/two/i},{token:"number",regex:/three/i},{token:"number",regex:/four/i},{token:"number",regex:/five/i},{token:"number",regex:/six/i},{token:"number",regex:/seven/i},{token:"number",regex:/eight/i},{token:"number",regex:/nine/i},{token:"number",regex:/ten/i},{token:"qualifier",regex:/optional(ly)?/i},{token:"builtin",regex:/matching/i},{token:"keyword",regex:/match(es)?/i},{token:"operator",regex:/then/i},{token:"builtin",regex:/(any thing|any|anything)(s)?/i},{token:"operator",regex:/or/i},{token:"operator",regex:/and|,/i},{token:"builtin",regex:/word(s)?/i},{token:"builtin",regex:/digit(s)?/i},{token:"builtin",regex:/character(s)?/i},{token:"builtin",regex:/(white space|whitespace)(s)?/i},{token:"builtin",regex:/number(s)?/i},{token:"keyword",regex:/using/i},{token:"builtin",regex:/global/i},{token:"builtin",regex:/(multi line|multiline)/i},{token:"builtin",regex:/exact/i},{token:"operator",regex:/not/i},{token:"operator",regex:/between/i},{token:"builtin",regex:/tab/i},{token:"builtin",regex:/(line feed|linefeed)/i},{token:"keyword",regex:/group/i},{token:"keyword",regex:/a(n)?/i},{token:"keyword",regex:/times/i},{token:"keyword",regex:/exact(ly)?/i},{token:"keyword",regex:/inclusive(ly)?/i},{token:"keyword",regex:/exclusive(ly)?/i},{token:"keyword",regex:/from/i},{token:"keyword",regex:/(to|through|thru|\-|\.\.|\.\.\.)/i},{token:"keyword",regex:/create(s)?/i},{token:"keyword",regex:/name(d)?|call(ed)?/i},{token:"keyword",regex:/repeat(s|ing)?/i},{token:"builtin",regex:/(new line|newline)/i},{token:"builtin",regex:/carriage return/i},{token:"builtin",regex:/case insensitive/i},{token:"builtin",regex:/case sensitive/i},{token:"operator",regex:/\+|or more/i},{token:"variable",regex:/[a-z]\w*/i},{token:"number",regex:/-?\d+/},{token:"string",regex:/"(?:[^\\"]|\\(?:[bfnrtv"\\/]|u[0-9a-f]{4}|U[0-9a-f]{8}))*"/i},{token:"comment",regex:/(#|\/\/).*/},{token:"comment",regex:/\/\*/,next:"comment"}],comment:[{regex:/.*?\*\//,token:"comment",next:"start"},{regex:/.*/,token:"comment"}],meta:{dontIndentStates:["comment"],lineComment:"//",blockComment:["/*","*/"]}});const e=u.default("#regex"),t=u.default("#dialect"),n=u.default("#clip"),r=u.default("#human"),c=u.default("#errors");if(!e.length||!r.length)return;const f=new i.Human2RegexLexer(new i.Human2RegexLexerOptions(!0)),h=new o.Human2RegexParser(new o.Human2RegexParserOptions(!0));let p="",d=a.RegexDialect.JS;function g(t){c.empty(),c.append("Compiling...");const n=[],r=f.tokenize(t);if(r.errors.map(s.CommonError.fromLexError).forEach(e=>n.push(e)),0===n.length){h.input=r.tokens;const t=h.parse();if(h.errors.map(s.CommonError.fromParseError).forEach(e=>n.push(e)),0===n.length){t.validate(d).map(s.CommonError.fromSemanticError).forEach(e=>n.push(e)),0===n.length&&(p=t.toRegex(d),e.attr("value",p))}}c.empty();for(const e of n)c.append(e.toString()+"\n")}t.on("change",()=>{d=function(e){switch(e){case"dotnet":return a.RegexDialect.DotNet;case"java":return a.RegexDialect.Java;case"pcre":return a.RegexDialect.PCRE;default:return a.RegexDialect.JS}}(u.default("#dialect option:selected").val())}),n.on("click",()=>{e[0].select(),window.isSecureContext&&s.usefulConditional(navigator.clipboard,"clipboard may be undefined")&&s.usefulConditional(navigator.clipboard.writeText,"writeText may be undefined")?navigator.clipboard.writeText(p):document.execCommand("copy")});const m=l.default.fromTextArea(r[0],{mode:{name:"human2regex"},lineNumbers:!1,indentUnit:4,viewportMargin:1/0});m.on("change",(e,t)=>{s.unusedParameter(e,"Instance is not required, we have a reference already"),s.unusedParameter(t,"Change is not required, we want the full value"),g(m.getValue())}),g(m.getValue());for(const e of u.default("code"))l.default.runMode(e.innerText,{name:"human2regex"},e)}))},function(e,t,n){"use strict";
/*! Copyright (c) 2020 Patrick Demian; Licensed under MIT */Object.defineProperty(t,"__esModule",{value:!0}),t.Human2RegexLexer=t.Human2RegexLexerOptions=t.IndentType=void 0;const r=n(3),i=n(2),o=n(5);var a;!function(e){e[e.Tabs=0]="Tabs",e[e.Spaces=1]="Spaces",e[e.Both=2]="Both"}(a=t.IndentType||(t.IndentType={}));class s{constructor(e=!1,t=a.Both,n=4){this.skip_validations=e,this.type=t,this.spaces_per_tab=n}}t.Human2RegexLexerOptions=s;class u{constructor(e=new s){if(u.already_init)throw new Error("Only 1 instance of Human2RegexLexer allowed");u.already_init=!0,this.setOptions(e)}setOptions(e){this.options=e;let t=null;if(this.options.type===a.Tabs)t=/\t/y;else{let e=` {${this.options.spaces_per_tab}}`;this.options.type===a.Both&&(e+="|\\t"),t=new RegExp(e,"y")}o.Indent.PATTERN=t,this.lexer=new r.Lexer(o.AllTokens,{ensureOptimizations:!0,skipValidations:e.skip_validations})}lexError(e){var t,n,r;return{offset:e.startOffset,line:null!==(t=e.startLine)&&void 0!==t?t:NaN,column:null!==(n=e.startColumn)&&void 0!==n?n:NaN,length:null!==(r=e.endOffset)&&void 0!==r?r:NaN-e.startOffset,message:"Unexpected indentation found"}}tokenize(e){var t,n,a,s,u,l,c,f,h,p,d,g,m,v;const y=this.lexer.tokenize(e);if(0===y.tokens.length)return y;const b=[],T=[0];let x=0,O=!0,S=!1;for(let e=0;e<y.tokens.length;e++)if(y.tokens[e].tokenType===o.EndOfLine)0===b.length||b[b.length-1].tokenType===o.EndOfLine||(O=!0,b.push(y.tokens[e]));else if(y.tokens[e].tokenType===o.Indent){S=!0,x=1;const u=y.tokens[e];let l=y.tokens[e].image.length;for(;y.tokens.length>e&&y.tokens[e+1].tokenType===o.Indent;)x++,e++,l+=y.tokens[e].image.length;if(u.endOffset=u.startOffset+l,u.endColumn=y.tokens[e].endColumn,y.tokens.length>e&&y.tokens[e+1].tokenType===o.EndOfLine);else if(!O||x>i.last(T)+1)y.errors.push(this.lexError(u));else if(x>i.last(T))T.push(x),b.push(u);else if(x<i.last(T)){const e=i.findLastIndex(T,x);if(e<0)y.errors.push(this.lexError(u));else{const i=T.length-e-1;for(let e=0;e<i;e++)T.pop(),b.push(r.createTokenInstance(o.Outdent,"",u.startOffset,u.startOffset+l,null!==(t=u.startLine)&&void 0!==t?t:NaN,null!==(n=u.endLine)&&void 0!==n?n:NaN,null!==(a=u.startColumn)&&void 0!==a?a:NaN,(null!==(s=u.startColumn)&&void 0!==s?s:NaN)+l))}}}else{if(O&&!S){const t=y.tokens[e];for(;T.length>1;)T.pop(),b.push(r.createTokenInstance(o.Outdent,"",t.startOffset,t.startOffset,null!==(u=t.startLine)&&void 0!==u?u:NaN,NaN,null!==(l=t.startColumn)&&void 0!==l?l:NaN,NaN))}O=!1,S=!1,b.push(y.tokens[e])}const C=i.last(b);for(C.tokenType!==o.EndOfLine&&b.push(r.createTokenInstance(o.EndOfLine,"\n",null!==(c=C.endOffset)&&void 0!==c?c:NaN,null!==(f=C.endOffset)&&void 0!==f?f:NaN,null!==(h=C.startLine)&&void 0!==h?h:NaN,NaN,null!==(p=C.startColumn)&&void 0!==p?p:NaN,NaN));T.length>1;)T.pop(),b.push(r.createTokenInstance(o.Outdent,"",null!==(d=C.endOffset)&&void 0!==d?d:NaN,null!==(g=C.endOffset)&&void 0!==g?g:NaN,null!==(m=C.startLine)&&void 0!==m?m:NaN,NaN,null!==(v=C.startColumn)&&void 0!==v?v:NaN,NaN));return y.tokens=b,y}}t.Human2RegexLexer=u,u.already_init=!1},function(e,t,n){"use strict";
/*! Copyright (c) 2020 Patrick Demian; Licensed under MIT */var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Human2RegexParser=t.Human2RegexParserOptions=void 0;const a=n(3),s=o(n(5)),u=n(6),l=n(2);class c{constructor(e=!1){this.skip_validations=e}}t.Human2RegexParserOptions=c;class f{constructor(e,t){this.token=e,this.value=t}}class h{constructor(e,t){this.tokens=e,this.value=t}}class p extends a.EmbeddedActionsParser{constructor(e=new c){if(super(s.AllTokens,{recoveryEnabled:!1,maxLookahead:2,skipValidations:e.skip_validations}),this.options=e,p.already_init)throw new Error("Only 1 instance of Human2RegexParser allowed");p.already_init=!0;const t=this;let n=null;const r=t.RULE("NumberSubStatement",()=>t.OR(n||(n=[{ALT:()=>new f(t.CONSUME(s.Zero),0)},{ALT:()=>new f(t.CONSUME(s.One),1)},{ALT:()=>new f(t.CONSUME(s.Two),2)},{ALT:()=>new f(t.CONSUME(s.Three),3)},{ALT:()=>new f(t.CONSUME(s.Four),4)},{ALT:()=>new f(t.CONSUME(s.Five),5)},{ALT:()=>new f(t.CONSUME(s.Six),6)},{ALT:()=>new f(t.CONSUME(s.Seven),7)},{ALT:()=>new f(t.CONSUME(s.Eight),8)},{ALT:()=>new f(t.CONSUME(s.Nine),9)},{ALT:()=>new f(t.CONSUME(s.Ten),10)},{ALT:()=>{const e=t.CONSUME(s.NumberLiteral);return new f(e,parseInt(e.image))}}]))),i=t.RULE("CountSubStatement",()=>t.OR([{ALT:()=>{const e=[];e.push(t.CONSUME(s.Between));const n=t.SUBRULE4(r);t.OR3([{ALT:()=>t.CONSUME2(s.To)},{ALT:()=>t.CONSUME(s.And)}]);const i=t.SUBRULE5(r);e.push(i.token),t.OPTION4(()=>e.push(t.CONSUME3(s.Times)));const o=t.OPTION5(()=>t.OR4([{ALT:()=>(e.push(t.CONSUME(s.Inclusive)),"inclusive")},{ALT:()=>(e.push(t.CONSUME(s.Exclusive)),"exclusive")}]));return new u.CountSubStatementCST(e,n.value,i.value,o)}},{ALT:()=>{const e=[];t.OPTION2(()=>e.push(t.CONSUME(s.From)));const n=t.SUBRULE2(r),i=t.OR2([{ALT:()=>new f(t.CONSUME(s.OrMore),[null,"+"])},{ALT:()=>{t.CONSUME(s.To);const e=t.SUBRULE3(r);return new f(e.token,[e.value,null])}}]);return e.push(i.token),t.OPTION3(()=>e.push(t.CONSUME2(s.Times))),new u.CountSubStatementCST(e,n.value,i.value?i.value[0]:null,i.value?i.value[1]:null)}},{ALT:()=>{const e=[];t.OPTION(()=>e.push(t.CONSUME(s.Exactly)));const n=t.SUBRULE(r);return e.push(n.token),t.OPTION6(()=>e.push(t.CONSUME(s.Times))),new u.CountSubStatementCST(e,n.value)}}]));let o=null;const a=t.RULE("MatchSubStatement",()=>{let e=null,n=!1;const r=[];let a=null,c=null,f=u.MatchSubStatementType.Anything;const h=[];return e=t.OPTION(()=>{const e=t.SUBRULE(i);return l.usefulConditional(e.tokens,"due to how chevrotain works, the first run produces a null value")&&h.push(l.first(e.tokens)),e}),n=t.OPTION2(()=>(h.push(t.CONSUME(s.Not)),!0)),t.AT_LEAST_ONE_SEP({SEP:s.Or,DEF:()=>{t.OPTION3(()=>t.CONSUME(s.A)),r.push(t.OR(o||(o=[{ALT:()=>{t.OPTION4(()=>t.CONSUME(s.From)),a=t.CONSUME2(s.StringLiteral).image,t.CONSUME(s.To);const e=t.CONSUME3(s.StringLiteral);return h.push(e),c=e.image,f=u.MatchSubStatementType.Between,new u.MatchSubStatementValue(f,a,c)}},{ALT:()=>{t.CONSUME(s.Between),a=t.CONSUME4(s.StringLiteral).image,t.CONSUME(s.And);const e=t.CONSUME5(s.StringLiteral);return c=e.image,h.push(e),f=u.MatchSubStatementType.Between,new u.MatchSubStatementValue(f,a,c)}},{ALT:()=>{const e=t.CONSUME(s.StringLiteral);return h.push(e),a=e.image,f=u.MatchSubStatementType.SingleString,new u.MatchSubStatementValue(f,a)}},{ALT:()=>(h.push(t.CONSUME(s.Anything)),f=u.MatchSubStatementType.Anything,new u.MatchSubStatementValue(f))},{ALT:()=>(h.push(t.CONSUME(s.Word)),f=u.MatchSubStatementType.Word,new u.MatchSubStatementValue(f))},{ALT:()=>(h.push(t.CONSUME(s.Digit)),f=u.MatchSubStatementType.Digit,new u.MatchSubStatementValue(f))},{ALT:()=>(h.push(t.CONSUME(s.Character)),f=u.MatchSubStatementType.Character,new u.MatchSubStatementValue(f))},{ALT:()=>(h.push(t.CONSUME(s.Whitespace)),f=u.MatchSubStatementType.Whitespace,new u.MatchSubStatementValue(f))},{ALT:()=>(h.push(t.CONSUME(s.Number)),f=u.MatchSubStatementType.Number,new u.MatchSubStatementValue(f))},{ALT:()=>(h.push(t.CONSUME(s.Tab)),f=u.MatchSubStatementType.Tab,new u.MatchSubStatementValue(f))},{ALT:()=>(h.push(t.CONSUME(s.Linefeed)),f=u.MatchSubStatementType.Linefeed,new u.MatchSubStatementValue(f))},{ALT:()=>(h.push(t.CONSUME(s.Newline)),f=u.MatchSubStatementType.Newline,new u.MatchSubStatementValue(f))},{ALT:()=>(h.push(t.CONSUME(s.CarriageReturn)),f=u.MatchSubStatementType.CarriageReturn,new u.MatchSubStatementValue(f))}])))}}),new u.MatchSubStatementCST(h,e,n,r)}),d=t.RULE("MatchStatement",()=>{let e=!1;const n=[],r=[];return t.OPTION(()=>{r.push(t.CONSUME(s.Optional)),e=!0}),r.push(t.CONSUME(s.Match)),n.push(new u.MatchStatementValue(e,t.SUBRULE(a))),t.MANY(()=>{t.OR([{ALT:()=>{t.OPTION2(()=>t.CONSUME2(s.And)),t.CONSUME(s.Then)}},{ALT:()=>t.CONSUME(s.And)}]),e=!1,t.OPTION3(()=>{t.CONSUME2(s.Optional),e=!0}),n.push(new u.MatchStatementValue(e,t.SUBRULE2(a)))}),r.push(t.CONSUME(s.EndOfLine)),new u.MatchStatementCST(r,n)});let g=null;const m=t.RULE("UsingStatement",()=>{const e=[],n=[t.CONSUME(s.Using)];return t.AT_LEAST_ONE_SEP({SEP:s.And,DEF:()=>{e.push(t.OR(g||(g=[{ALT:()=>(t.CONSUME(s.Multiline),u.UsingFlags.Multiline)},{ALT:()=>(t.CONSUME(s.Global),u.UsingFlags.Global)},{ALT:()=>(t.CONSUME(s.CaseInsensitive),u.UsingFlags.Insensitive)},{ALT:()=>(t.CONSUME(s.CaseSensitive),u.UsingFlags.Sensitive)},{ALT:()=>(t.CONSUME(s.Exact),u.UsingFlags.Exact)}]))),t.OPTION(()=>t.CONSUME(s.Matching))}}),n.push(t.CONSUME(s.EndOfLine)),new h(n,e)}),v=t.RULE("GroupStatement",()=>{const e=[];let n=!1,r=null;const i=[];return e.push(t.OR([{ALT:()=>{n=!0;const e=t.CONSUME(s.Optional);return t.CONSUME(s.Create),t.CONSUME(s.A),e}},{ALT:()=>{const e=t.CONSUME2(s.Create);return t.CONSUME2(s.A),t.OPTION2(()=>{t.CONSUME2(s.Optional),n=!0}),e}}])),t.CONSUME(s.Group),t.OPTION(()=>{t.CONSUME(s.Called),r=t.CONSUME(s.Identifier).image}),e.push(t.CONSUME2(s.EndOfLine)),t.CONSUME(s.Indent),t.AT_LEAST_ONE(()=>{i.push(t.SUBRULE(b))}),t.CONSUME(s.Outdent),new u.GroupStatementCST(e,n,r,i)}),y=t.RULE("RepeatStatement",()=>{const e=[];let n=!1,r=null;const o=[];return t.OPTION3(()=>{e.push(t.CONSUME(s.Optional)),n=!0}),e.push(t.CONSUME(s.Repeat)),t.OPTION(()=>r=t.SUBRULE(i)),t.CONSUME3(s.EndOfLine),t.CONSUME(s.Indent),t.AT_LEAST_ONE(()=>{o.push(t.SUBRULE(b))}),e.push(t.CONSUME(s.Outdent)),new u.RepeatStatementCST(e,n,r,o)}),b=t.RULE("Statement",()=>t.OR([{ALT:()=>t.SUBRULE(d)},{ALT:()=>t.SUBRULE(v)},{ALT:()=>t.SUBRULE(y)}])),T=t.RULE("Regex",()=>{let e=[],n=[];const r=[];return t.MANY(()=>{const r=t.SUBRULE(m);e=e.concat(r.tokens),n=n.concat(r.value)}),t.MANY2(()=>r.push(t.SUBRULE(b))),new u.RegularExpressionCST([],new u.UsingStatementCST(e,n),r)});this.performSelfAnalysis(),this.parse=T}setOptions(e){l.unusedParameter(e,"skip_validations is not valid to change once we've already initialized")}}t.Human2RegexParser=p,p.already_init=!1},function(e,t,n){var r;
/*!
* jQuery JavaScript Library v3.5.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2020-05-04T22:49Z
*/!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,(function(n,i){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,u=o.flat?function(e){return o.flat.call(e)}:function(e){return o.concat.apply([],e)},l=o.push,c=o.indexOf,f={},h=f.toString,p=f.hasOwnProperty,d=p.toString,g=d.call(Object),m={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},y=function(e){return null!=e&&e===e.window},b=n.document,T={type:!0,src:!0,nonce:!0,noModule:!0};function x(e,t,n){var r,i,o=(n=n||b).createElement("script");if(o.text=e,t)for(r in T)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function O(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[h.call(e)]||"object":typeof e}var S=function(e,t){return new S.fn.init(e,t)};function C(e){var t=!!e&&"length"in e&&e.length,n=O(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}S.fn=S.prototype={jquery:"3.5.1",constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:l,sort:o.sort,splice:o.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+("3.5.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==h.call(e))&&(!(t=a(e))||"function"==typeof(n=p.call(t,"constructor")&&t.constructor)&&d.call(n)===g)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){x(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(C(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(C(Object(e))?S.merge(n,"string"==typeof e?[e]:e):l.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:c.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(C(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return u(a)},guid:1,support:m}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=o[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){f["[object "+t+"]"]=t.toLowerCase()}));var E=
/*!
* Sizzle CSS Selector Engine v2.3.5
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2020-03-14
*/
function(e){var t,n,r,i,o,a,s,u,l,c,f,h,p,d,g,m,v,y,b,T="sizzle"+1*new Date,x=e.document,O=0,S=0,C=ue(),E=ue(),w=ue(),k=ue(),N=function(e,t){return e===t&&(f=!0),0},A={}.hasOwnProperty,L=[],R=L.pop,I=L.push,M=L.push,P=L.slice,_=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},j="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",D="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+D+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",U="\\["+D+"*("+F+")(?:"+D+"*([*^$|!~]?=)"+D+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+D+"*\\]",W=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+U+")*)|.*)\\)|)",H=new RegExp(D+"+","g"),B=new RegExp("^"+D+"+|((?:^|[^\\\\])(?:\\\\.)*)"+D+"+$","g"),z=new RegExp("^"+D+"*,"+D+"*"),G=new RegExp("^"+D+"*([>+~]|"+D+")"+D+"*"),V=new RegExp(D+"|>"),K=new RegExp(W),q=new RegExp("^"+F+"$"),$={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+D+"*(even|odd|(([+-]|)(\\d*)n|)"+D+"*(?:([+-]|)"+D+"*(\\d+)|))"+D+"*\\)|)","i"),bool:new RegExp("^(?:"+j+")$","i"),needsContext:new RegExp("^"+D+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+D+"*((?:-\\d)?\\d*)"+D+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+D+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"<22>":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){h()},ae=Te((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{M.apply(L=P.call(x.childNodes),x.childNodes),L[x.childNodes.length].nodeType}catch(e){M={apply:L.length?function(e,t){I.apply(e,P.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,i){var o,s,l,c,f,d,v,y=t&&t.ownerDocument,x=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==x&&9!==x&&11!==x)return r;if(!i&&(h(t),t=t||p,g)){if(11!==x&&(f=Q.exec(e)))if(o=f[1]){if(9===x){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(y&&(l=y.getElementById(o))&&b(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return M.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return M.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!k[e+" "]&&(!m||!m.test(e))&&(1!==x||"object"!==t.nodeName.toLowerCase())){if(v=e,y=t,1===x&&(V.test(e)||G.test(e))){for((y=ee.test(e)&&ve(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,ie):t.setAttribute("id",c=T)),s=(d=a(e)).length;s--;)d[s]=(c?"#"+c:":scope")+" "+be(d[s]);v=d.join(",")}try{return M.apply(r,y.querySelectorAll(v)),r}catch(t){k(e,!0)}finally{c===T&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ue(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function le(e){return e[T]=!0,e}function ce(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function he(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function pe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function de(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ge(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function me(e){return le((function(t){return t=+t,le((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},h=se.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:x;return a!=p&&9===a.nodeType&&a.documentElement?(d=(p=a).documentElement,g=!o(p),x!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce((function(e){return d.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ce((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=J.test(p.getElementsByClassName),n.getById=ce((function(e){return d.appendChild(e).id=T,!p.getElementsByName||!p.getElementsByName(T).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],m=[],(n.qsa=J.test(p.querySelectorAll))&&(ce((function(e){var t;d.appendChild(e).innerHTML="<a id='"+T+"'></a><select id='"+T+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+D+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+D+"*(?:value|"+j+")"),e.querySelectorAll("[id~="+T+"-]").length||m.push("~="),(t=p.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||m.push("\\["+D+"*name"+D+"*="+D+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+T+"+*").length||m.push(".#.+[+~]"),e.querySelectorAll("\\\f"),m.push("[\\r\\n\\f]")})),ce((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+D+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),d.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")}))),(n.matchesSelector=J.test(y=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ce((function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),v.push("!=",W)})),m=m.length&&new RegExp(m.join("|")),v=v.length&&new RegExp(v.join("|")),t=J.test(d.compareDocumentPosition),b=t||J.test(d.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},N=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==p||e.ownerDocument==x&&b(x,e)?-1:t==p||t.ownerDocument==x&&b(x,t)?1:c?_(c,e)-_(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==p?-1:t==p?1:i?-1:o?1:c?_(c,e)-_(c,t):0;if(i===o)return he(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?he(a[r],s[r]):a[r]==x?-1:s[r]==x?1:0},p):p},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(h(e),n.matchesSelector&&g&&!k[t+" "]&&(!v||!v.test(t))&&(!m||!m.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){k(t,!0)}return se(t,p,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!=p&&h(e),b(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=p&&h(e);var i=r.attrHandle[t.toLowerCase()],o=i&&A.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(N),f){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=se.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=se.selectors={cacheLength:50,createPseudo:le,match:$,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return $.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&K.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=new RegExp("(^|"+D+")"+e+"("+D+"|$)"))&&C(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=se.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(H," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,h,p,d,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!u&&!s,b=!1;if(m){if(o){for(;g;){for(h=t;h=h[g];)if(s?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[a?m.firstChild:m.lastChild],a&&y){for(b=(p=(l=(c=(f=(h=m)[T]||(h[T]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]||[])[0]===O&&l[1])&&l[2],h=p&&m.childNodes[p];h=++p&&h&&h[g]||(b=p=0)||d.pop();)if(1===h.nodeType&&++b&&h===t){c[e]=[O,p,b];break}}else if(y&&(b=p=(l=(c=(f=(h=t)[T]||(h[T]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]||[])[0]===O&&l[1]),!1===b)for(;(h=++p&&h&&h[g]||(b=p=0)||d.pop())&&((s?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++b||(y&&((c=(f=h[T]||(h[T]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]=[O,b]),h!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return i[T]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?le((function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=_(e,o[a])]=!(n[r]=o[a])})):function(e){return i(e,0,n)}):i}},pseudos:{not:le((function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[T]?le((function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:le((function(e){return function(t){return se(e,t).length>0}})),contains:le((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}})),lang:le((function(e){return q.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:me((function(){return[0]})),last:me((function(e,t){return[t-1]})),eq:me((function(e,t,n){return[n<0?n+t:n]})),even:me((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:me((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:me((function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e})),gt:me((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=pe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=de(t);function ye(){}function be(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Te(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=S++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,h=[O,s];if(u){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,u))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(c=(f=t[T]||(t[T]={}))[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===O&&l[1]===s)return h[2]=l[2];if(c[o]=h,h[2]=e(t,n,u))return!0}return!1}}function xe(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function Oe(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Se(e,t,n,r,i,o){return r&&!r[T]&&(r=Se(r)),i&&!i[T]&&(i=Se(i,o)),le((function(o,a,s,u){var l,c,f,h=[],p=[],d=a.length,g=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:Oe(g,h,e,s,u),v=n?i||(o?e:d||r)?[]:a:m;if(n&&n(m,v,s,u),r)for(l=Oe(v,p),r(l,[],s,u),c=l.length;c--;)(f=l[c])&&(v[p[c]]=!(m[p[c]]=f));if(o){if(i||e){if(i){for(l=[],c=v.length;c--;)(f=v[c])&&l.push(m[c]=f);i(null,v=[],l,u)}for(c=v.length;c--;)(f=v[c])&&(l=i?_(o,f):h[c])>-1&&(o[l]=!(a[l]=f))}}else v=Oe(v===a?v.splice(d,v.length):v),i?i(null,a,v,u):M.apply(a,v)}))}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=Te((function(e){return e===t}),s,!0),f=Te((function(e){return _(t,e)>-1}),s,!0),h=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u<o;u++)if(n=r.relative[e[u].type])h=[Te(xe(h),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[T]){for(i=++u;i<o&&!r.relative[e[i].type];i++);return Se(u>1&&xe(h),u>1&&be(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u<i&&Ce(e.slice(u,i)),i<o&&Ce(e=e.slice(i)),i<o&&be(e))}h.push(n)}return xe(h)}return ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,a=se.tokenize=function(e,t){var n,i,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=r.preFilter;s;){for(a in n&&!(i=z.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),n=!1,(i=G.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(B," ")}),s=s.slice(n.length)),r.filter)!(i=$[a].exec(s))||l[a]&&!(i=l[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?se.error(e):E(e,u).slice(0)},s=se.compile=function(e,t){var n,i=[],o=[],s=w[e+" "];if(!s){for(t||(t=a(e)),n=t.length;n--;)(s=Ce(t[n]))[T]?i.push(s):o.push(s);(s=w(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,u,c){var f,d,m,v=0,y="0",b=o&&[],T=[],x=l,S=o||i&&r.find.TAG("*",c),C=O+=null==x?1:Math.random()||.1,E=S.length;for(c&&(l=a==p||a||c);y!==E&&null!=(f=S[y]);y++){if(i&&f){for(d=0,a||f.ownerDocument==p||(h(f),s=!g);m=e[d++];)if(m(f,a||p,s)){u.push(f);break}c&&(O=C)}n&&((f=!m&&f)&&v--,o&&b.push(f))}if(v+=y,n&&y!==v){for(d=0;m=t[d++];)m(b,T,a,s);if(o){if(v>0)for(;y--;)b[y]||T[y]||(T[y]=R.call(u));T=Oe(T)}M.apply(u,T),c&&!o&&T.length>0&&v+t.length>1&&se.uniqueSort(u)}return c&&(O=C,l=x),b};return n?le(o):o}(o,i))).selector=e}return s},u=se.select=function(e,t,n,i){var o,u,l,c,f,h="function"==typeof e&&e,p=!i&&a(e=h.selector||e);if(n=n||[],1===p.length){if((u=p[0]=p[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(te,ne),t)||[])[0]))return n;h&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=$.needsContext.test(e)?0:u.length;o--&&(l=u[o],!r.relative[c=l.type]);)if((f=r.find[c])&&(i=f(l.matches[0].replace(te,ne),ee.test(u[0].type)&&ve(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&be(u)))return M.apply(n,i),n;break}}return(h||s(e,p))(i,t,!g,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},n.sortStable=T.split("").sort(N).join("")===T,n.detectDuplicates=!!f,h(),n.sortDetached=ce((function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))})),ce((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||fe("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ce((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||fe("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ce((function(e){return null==e.getAttribute("disabled")}))||fe(j,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),se}(n);S.find=E,S.expr=E.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=E.uniqueSort,S.text=E.getText,S.isXMLDoc=E.isXML,S.contains=E.contains,S.escapeSelector=E.escape;var w=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},k=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},N=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var L=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function R(e,t,n){return v(t)?S.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?S.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?S.grep(e,(function(e){return c.call(t,e)>-1!==n})):S.filter(t,e,n)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,(function(e){return 1===e.nodeType})))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter((function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0})));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return r>1?S.uniqueSort(n):n},filter:function(e){return this.pushStack(R(this,e||[],!1))},not:function(e){return this.pushStack(R(this,e||[],!0))},is:function(e){return!!R(this,"string"==typeof e&&N.test(e)?S(e):e||[],!1).length}});var I,M=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||I,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:M.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:b,!0)),L.test(r[1])&&S.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=b.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,I=S(b);var P=/^(?:parents|prev(?:Until|All))/,_={children:!0,contents:!0,next:!0,prev:!0};function j(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0}))},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!N.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?c.call(S(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return w(e,"parentNode")},parentsUntil:function(e,t,n){return w(e,"parentNode",n)},next:function(e){return j(e,"nextSibling")},prev:function(e){return j(e,"previousSibling")},nextAll:function(e){return w(e,"nextSibling")},prevAll:function(e){return w(e,"previousSibling")},nextUntil:function(e,t,n){return w(e,"nextSibling",n)},prevUntil:function(e,t,n){return w(e,"previousSibling",n)},siblings:function(e){return k((e.parentNode||{}).firstChild,e)},children:function(e){return k(e.firstChild)},contents:function(e){return null!=e.contentDocument&&a(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},(function(e,t){S.fn[e]=function(n,r){var i=S.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=S.filter(r,i)),this.length>1&&(_[e]||S.uniqueSort(i),P.test(e)&&i.reverse()),this.pushStack(i)}}));var D=/[^\x20\t\r\n\f]+/g;function F(e){return e}function U(e){throw e}function W(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return S.each(e.match(D)||[],(function(e,n){t[n]=!0})),t}(e):S.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s<o.length;)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){S.each(n,(function(n,r){v(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==O(r)&&t(r)}))}(arguments),n&&!t&&u()),this},remove:function(){return S.each(arguments,(function(e,t){for(var n;(n=S.inArray(t,o,n))>-1;)o.splice(n,1),n<=s&&s--})),this},has:function(e){return e?S.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},S.extend({Deferred:function(e){var t=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return S.Deferred((function(n){S.each(t,(function(t,r){var i=v(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&v(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(e,r,i){var o=0;function a(e,t,r,i){return function(){var s=this,u=arguments,l=function(){var n,l;if(!(e<o)){if((n=r.apply(s,u))===t.promise())throw new TypeError("Thenable self-resolution");l=n&&("object"==typeof n||"function"==typeof n)&&n.then,v(l)?i?l.call(n,a(o,t,F,i),a(o,t,U,i)):(o++,l.call(n,a(o,t,F,i),a(o,t,U,i),a(o,t,F,t.notifyWith))):(r!==F&&(s=void 0,u=[n]),(i||t.resolveWith)(s,u))}},c=i?l:function(){try{l()}catch(n){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(n,c.stackTrace),e+1>=o&&(r!==U&&(s=void 0,u=[n]),t.rejectWith(s,u))}};e?c():(S.Deferred.getStackHook&&(c.stackTrace=S.Deferred.getStackHook()),n.setTimeout(c))}}return S.Deferred((function(n){t[0][3].add(a(0,n,v(i)?i:F,n.notifyWith)),t[1][3].add(a(0,n,v(e)?e:F)),t[2][3].add(a(0,n,v(r)?r:U))})).promise()},promise:function(e){return null!=e?S.extend(e,i):i}},o={};return S.each(t,(function(e,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add((function(){r=s}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith})),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=s.call(arguments),o=S.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?s.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(W(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||v(i[n]&&i[n].then)))return o.then();for(;n--;)W(i[n],a(n),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&H.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){n.setTimeout((function(){throw e}))};var B=S.Deferred();function z(){b.removeEventListener("DOMContentLoaded",z),n.removeEventListener("load",z),S.ready()}S.fn.ready=function(e){return B.then(e).catch((function(e){S.readyException(e)})),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||B.resolveWith(b,[S]))}}),S.ready.then=B.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?n.setTimeout(S.ready):(b.addEventListener("DOMContentLoaded",z),n.addEventListener("load",z));var G=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===O(n))for(s in i=!0,n)G(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},V=/^-ms-/,K=/-([a-z])/g;function q(e,t){return t.toUpperCase()}function $(e){return e.replace(V,"ms-").replace(K,q)}var Y=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function X(){this.expando=S.expando+X.uid++}X.uid=1,X.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Y(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[$(t)]=n;else for(r in t)i[$(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][$(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map($):(t=$(t))in r?[t]:t.match(D)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Z=new X,J=new X,Q=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ee=/[A-Z]/g;function te(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ee,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Q.test(e)?JSON.parse(e):e)}(n)}catch(e){}J.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return J.hasData(e)||Z.hasData(e)},data:function(e,t,n){return J.access(e,t,n)},removeData:function(e,t){J.remove(e,t)},_data:function(e,t,n){return Z.access(e,t,n)},_removeData:function(e,t){Z.remove(e,t)}}),S.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=J.get(o),1===o.nodeType&&!Z.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=$(r.slice(5)),te(o,r,i[r]));Z.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){J.set(this,e)})):G(this,(function(t){var n;if(o&&void 0===t)return void 0!==(n=J.get(o,e))||void 0!==(n=te(o,e))?n:void 0;this.each((function(){J.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){J.remove(this,e)}))}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Z.get(e,t),n&&(!r||Array.isArray(n)?r=Z.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){S.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Z.get(e,n)||Z.access(e,n,{empty:S.Callbacks("once memory").add((function(){Z.remove(e,[t+"queue",n])}))})}}),S.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?S.queue(this[0],e):void 0===t?this:this.each((function(){var n=S.queue(this,e,t);S._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&S.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){S.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=Z.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ne=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,re=new RegExp("^(?:([+-])=|)("+ne+")([a-z%]*)$","i"),ie=["Top","Right","Bottom","Left"],oe=b.documentElement,ae=function(e){return S.contains(e.ownerDocument,e)},se={composed:!0};oe.getRootNode&&(ae=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(se)===e.ownerDocument});var ue=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ae(e)&&"none"===S.css(e,"display")};function le(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&re.exec(S.css(e,t));if(c&&c[3]!==l){for(u/=2,l=l||c[3],c=+u||1;a--;)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ce={};function fe(e){var t,n=e.ownerDocument,r=e.nodeName,i=ce[r];return i||(t=n.body.appendChild(n.createElement(r)),i=S.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),ce[r]=i,i)}function he(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=Z.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ue(r)&&(i[o]=fe(r))):"none"!==n&&(i[o]="none",Z.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}S.fn.extend({show:function(){return he(this,!0)},hide:function(){return he(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){ue(this)?S(this).show():S(this).hide()}))}});var pe,de,ge=/^(?:checkbox|radio)$/i,me=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ve=/^$|^module$|\/(?:java|ecma)script/i;pe=b.createDocumentFragment().appendChild(b.createElement("div")),(de=b.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),pe.appendChild(de),m.checkClone=pe.cloneNode(!0).cloneNode(!0).lastChild.checked,pe.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!pe.cloneNode(!0).lastChild.defaultValue,pe.innerHTML="<option></option>",m.option=!!pe.lastChild;var ye={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 be(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function Te(e,t){for(var n=0,r=e.length;n<r;n++)Z.set(e[n],"globalEval",!t||Z.get(t[n],"globalEval"))}ye.tbody=ye.tfoot=ye.colgroup=ye.caption=ye.thead,ye.th=ye.td,m.option||(ye.optgroup=ye.option=[1,"<select multiple='multiple'>","</select>"]);var xe=/<|&#?\w+;/;function Oe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),h=[],p=0,d=e.length;p<d;p++)if((o=e[p])||0===o)if("object"===O(o))S.merge(h,o.nodeType?[o]:o);else if(xe.test(o)){for(a=a||f.appendChild(t.createElement("div")),s=(me.exec(o)||["",""])[1].toLowerCase(),u=ye[s]||ye._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];c--;)a=a.lastChild;S.merge(h,a.childNodes),(a=f.firstChild).textContent=""}else h.push(t.createTextNode(o));for(f.textContent="",p=0;o=h[p++];)if(r&&S.inArray(o,r)>-1)i&&i.push(o);else if(l=ae(o),a=be(f.appendChild(o),"script"),l&&Te(a),n)for(c=0;o=a[c++];)ve.test(o.type||"")&&n.push(o);return f}var Se=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function ke(){return!1}function Ne(e,t){return e===function(){try{return b.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each((function(){S.event.add(this,t,i,r,n)}))}function Le(e,t,n){n?(Z.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var r,i,o=Z.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=s.call(arguments),Z.set(this,t,o),r=n(this,t),this[t](),o!==(i=Z.get(this,t))||r?Z.set(this,t,!1):i={},o!==i)return e.stopImmediatePropagation(),e.preventDefault(),i.value}else o.length&&(Z.set(this,t,{value:S.event.trigger(S.extend(o[0],S.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Z.get(e,t)&&S.event.add(e,t,we)}S.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,h,p,d,g,m=Z.get(e);if(Y(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(oe,i),n.guid||(n.guid=S.guid++),(u=m.events)||(u=m.events=Object.create(null)),(a=m.handle)||(a=m.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(D)||[""]).length;l--;)p=g=(s=Ee.exec(t[l])||[])[1],d=(s[2]||"").split(".").sort(),p&&(f=S.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=S.event.special[p]||{},c=S.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:d.join(".")},o),(h=u[p])||((h=u[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,d,a)||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,c):h.push(c),S.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,h,p,d,g,m=Z.hasData(e)&&Z.get(e);if(m&&(u=m.events)){for(l=(t=(t||"").match(D)||[""]).length;l--;)if(p=g=(s=Ee.exec(t[l])||[])[1],d=(s[2]||"").split(".").sort(),p){for(f=S.event.special[p]||{},h=u[p=(r?f.delegateType:f.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;o--;)c=h[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(h.splice(o,1),c.selector&&h.delegateCount--,f.remove&&f.remove.call(e,c));a&&!h.length&&(f.teardown&&!1!==f.teardown.call(e,d,m.handle)||S.removeEvent(e,p,m.handle),delete u[p])}else for(p in u)S.event.remove(e,p+t[l],n,r,!0);S.isEmptyObject(u)&&Z.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Z.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(a=S.event.handlers.call(this,u,l),t=0;(i=a[t++])&&!u.isPropagationStopped();)for(u.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?S(i,this).index(l)>-1:S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(e,t){Object.defineProperty(S.Event.prototype,e,{enumerable:!0,configurable:!0,get:v(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return ge.test(t.type)&&t.click&&A(t,"input")&&Le(t,"click",we),!1},trigger:function(e){var t=this||e;return ge.test(t.type)&&t.click&&A(t,"input")&&Le(t,"click"),!0},_default:function(e){var t=e.target;return ge.test(t.type)&&t.click&&A(t,"input")&&Z.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:ke,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:ke,isPropagationStopped:ke,isImmediatePropagationStopped:ke,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.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,code:!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(e){var t=e.button;return null==e.which&&Se.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Ce.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},(function(e,t){S.event.special[e]={setup:function(){return Le(this,e,Ne),!1},trigger:function(){return Le(this,e),!0},delegateType:t}})),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){S.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||S.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}})),S.fn.extend({on:function(e,t,n,r){return Ae(this,e,t,n,r)},one:function(e,t,n,r){return Ae(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=ke),this.each((function(){S.event.remove(this,e,n,t)}))}});var Re=/<script|<style|<link/i,Ie=/checked\s*(?:[^=]|=\s*.checked.)/i,Me=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Pe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function _e(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function je(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function De(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Z.hasData(e)&&(s=Z.get(e).events))for(i in Z.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);J.hasData(e)&&(o=J.access(e),a=S.extend({},o),J.set(t,a))}}function Fe(e,t){var n=t.nodeName.toLowerCase();"input"===n&&ge.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Ue(e,t,n,r){t=u(t);var i,o,a,s,l,c,f=0,h=e.length,p=h-1,d=t[0],g=v(d);if(g||h>1&&"string"==typeof d&&!m.checkClone&&Ie.test(d))return e.each((function(i){var o=e.eq(i);g&&(t[0]=d.call(this,i,o.html())),Ue(o,t,n,r)}));if(h&&(o=(i=Oe(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=(a=S.map(be(i,"script"),_e)).length;f<h;f++)l=i,f!==p&&(l=S.clone(l,!0,!0),s&&S.merge(a,be(l,"script"))),n.call(e[f],l,f);if(s)for(c=a[a.length-1].ownerDocument,S.map(a,je),f=0;f<s;f++)l=a[f],ve.test(l.type||"")&&!Z.access(l,"globalEval")&&S.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?S._evalUrl&&!l.noModule&&S._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")},c):x(l.textContent.replace(Me,""),l,c))}return e}function We(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(be(r)),r.parentNode&&(n&&ae(r)&&Te(be(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=ae(e);if(!(m.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=be(s),r=0,i=(o=be(e)).length;r<i;r++)Fe(o[r],a[r]);if(t)if(n)for(o=o||be(e),a=a||be(s),r=0,i=o.length;r<i;r++)De(o[r],a[r]);else De(e,s);return(a=be(s,"script")).length>0&&Te(a,!u&&be(e,"script")),s},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[Z.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Z.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),S.fn.extend({detach:function(e){return We(this,e,!0)},remove:function(e){return We(this,e)},text:function(e){return G(this,(function(e){return void 0===e?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Ue(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Pe(this,e).appendChild(e)}))},prepend:function(){return Ue(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Pe(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Ue(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Ue(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(be(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return S.clone(this,e,t)}))},html:function(e){return G(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Re.test(e)&&!ye[(me.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(be(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return Ue(this,arguments,(function(t){var n=this.parentNode;S.inArray(this,e)<0&&(S.cleanData(be(this)),n&&n.replaceChild(t,this))}),e)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){S.fn[e]=function(e){for(var n,r=[],i=S(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),S(i[a])[t](n),l.apply(r,n.get());return this.pushStack(r)}}));var He=new RegExp("^("+ne+")(?!px)[a-z%]+$","i"),Be=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=n),t.getComputedStyle(e)},ze=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ge=new RegExp(ie.join("|"),"i");function Ve(e,t,n){var r,i,o,a,s=e.style;return(n=n||Be(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ae(e)||(a=S.style(e,t)),!m.pixelBoxStyles()&&He.test(a)&&Ge.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Ke(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",oe.appendChild(l).appendChild(c);var e=n.getComputedStyle(c);r="1%"!==e.top,u=12===t(e.marginLeft),c.style.right="60%",a=36===t(e.right),i=36===t(e.width),c.style.position="absolute",o=12===t(c.offsetWidth/3),oe.removeChild(l),c=null}}function t(e){return Math.round(parseFloat(e))}var r,i,o,a,s,u,l=b.createElement("div"),c=b.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",m.clearCloneStyle="content-box"===c.style.backgroundClip,S.extend(m,{boxSizingReliable:function(){return e(),i},pixelBoxStyles:function(){return e(),a},pixelPosition:function(){return e(),r},reliableMarginLeft:function(){return e(),u},scrollboxSize:function(){return e(),o},reliableTrDimensions:function(){var e,t,r,i;return null==s&&(e=b.createElement("table"),t=b.createElement("tr"),r=b.createElement("div"),e.style.cssText="position:absolute;left:-11111px",t.style.height="1px",r.style.height="9px",oe.appendChild(e).appendChild(t).appendChild(r),i=n.getComputedStyle(t),s=parseInt(i.height)>3,oe.removeChild(e)),s}}))}();var qe=["Webkit","Moz","ms"],$e=b.createElement("div").style,Ye={};function Xe(e){var t=S.cssProps[e]||Ye[e];return t||(e in $e?e:Ye[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=qe.length;n--;)if((e=qe[n]+t)in $e)return e}(e)||e)}var Ze=/^(none|table(?!-c[ea]).+)/,Je=/^--/,Qe={position:"absolute",visibility:"hidden",display:"block"},et={letterSpacing:"0",fontWeight:"400"};function tt(e,t,n){var r=re.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function nt(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ie[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ie[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ie[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ie[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ie[a]+"Width",!0,i):s+=S.css(e,"border"+ie[a]+"Width",!0,i));return!r&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function rt(e,t,n){var r=Be(e),i=(!m.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Ve(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(He.test(a)){if(!n)return a;a="auto"}return(!m.boxSizingReliable()&&i||!m.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+nt(e,t,n||(i?"border":"content"),o,r,a)+"px"}function it(e,t,n,r,i){return new it.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ve(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=$(t),u=Je.test(t),l=e.style;if(u||(t=Xe(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=re.exec(n))&&i[1]&&(n=le(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),m.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=$(t);return Je.test(t)||(t=Xe(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Ve(e,t,r)),"normal"===i&&t in et&&(i=et[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],(function(e,t){S.cssHooks[t]={get:function(e,n,r){if(n)return!Ze.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?rt(e,t,r):ze(e,Qe,(function(){return rt(e,t,r)}))},set:function(e,n,r){var i,o=Be(e),a=!m.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===S.css(e,"boxSizing",!1,o),u=r?nt(e,t,r,s,o):0;return s&&a&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-nt(e,t,"border",!1,o)-.5)),u&&(i=re.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=S.css(e,t)),tt(0,n,u)}}})),S.cssHooks.marginLeft=Ke(m.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Ve(e,"marginLeft"))||e.getBoundingClientRect().left-ze(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(e,t){S.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+ie[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(S.cssHooks[e+t].set=tt)})),S.fn.extend({css:function(e,t){return G(this,(function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Be(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)}),e,t,arguments.length>1)}}),S.Tween=it,it.prototype={constructor:it,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=it.propHooks[this.prop];return e&&e.get?e.get(this):it.propHooks._default.get(this)},run:function(e){var t,n=it.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):it.propHooks._default.set(this),this}},it.prototype.init.prototype=it.prototype,it.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}},it.propHooks.scrollTop=it.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=it.prototype.init,S.fx.step={};var ot,at,st=/^(?:toggle|show|hide)$/,ut=/queueHooks$/;function lt(){at&&(!1===b.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(lt):n.setTimeout(lt,S.fx.interval),S.fx.tick())}function ct(){return n.setTimeout((function(){ot=void 0})),ot=Date.now()}function ft(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ie[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ht(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function pt(e,t,n){var r,i,o=0,a=pt.prefilters.length,s=S.Deferred().always((function(){delete u.elem})),u=function(){if(i)return!1;for(var t=ot||ct(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,a=l.tweens.length;o<a;o++)l.tweens[o].run(r);return s.notifyWith(e,[l,r,n]),r<1&&a?n:(a||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:S.extend({},t),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},n),originalProperties:t,originalOptions:n,startTime:ot||ct(),duration:n.duration,tweens:[],createTween:function(t,n){var r=S.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=$(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);o<a;o++)if(r=pt.prefilters[o].call(l,e,c,l.opts))return v(r.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return S.map(c,ht,l),v(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(pt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return le(n.elem,e,re.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(D);for(var n,r=0,i=e.length;r<i;r++)n=e[r],pt.tweeners[n]=pt.tweeners[n]||[],pt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,h=this,p={},d=e.style,g=e.nodeType&&ue(e),m=Z.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,h.always((function(){h.always((function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()}))}))),t)if(i=t[r],st.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;g=!0}p[r]=m&&m[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(p))for(r in f&&1===e.nodeType&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],null==(l=m&&m.display)&&(l=Z.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(he([e],!0),l=e.style.display||l,c=S.css(e,"display"),he([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(h.done((function(){d.display=l})),null==l&&(c=d.display,l="none"===c?"":c)),d.display="inline-block")),n.overflow&&(d.overflow="hidden",h.always((function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}))),u=!1,p)u||(m?"hidden"in m&&(g=m.hidden):m=Z.access(e,"fxshow",{display:l}),o&&(m.hidden=!g),g&&he([e],!0),h.done((function(){for(r in g||he([e]),Z.remove(e,"fxshow"),p)S.style(e,r,p[r])}))),u=ht(g?m[r]:0,r,h),r in m||(m[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?pt.prefilters.unshift(e):pt.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ue).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=S.isEmptyObject(e),o=S.speed(t,n,r),a=function(){var t=pt(this,S.extend({},e),o);(i||Z.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",o=S.timers,a=Z.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&ut.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||S.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=Z.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=S.timers,a=r?r.length:0;for(n.finish=!0,S.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),S.each(["toggle","show","hide"],(function(e,t){var n=S.fn[t];S.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ft(t,!0),e,r,i)}})),S.each({slideDown:ft("show"),slideUp:ft("hide"),slideToggle:ft("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){S.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(ot=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),ot=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){at||(at=!0,lt())},S.fx.stop=function(){at=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(e,t){return e=S.fx&&S.fx.speeds[e]||e,t=t||"fx",this.queue(t,(function(t,r){var i=n.setTimeout(t,e);r.stop=function(){n.clearTimeout(i)}}))},function(){var e=b.createElement("input"),t=b.createElement("select").appendChild(b.createElement("option"));e.type="checkbox",m.checkOn=""!==e.value,m.optSelected=t.selected,(e=b.createElement("input")).value="t",e.type="radio",m.radioValue="t"===e.value}();var dt,gt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return G(this,S.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){S.removeAttr(this,e)}))}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!m.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(D);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=gt[t]||S.find.attr;gt[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=gt[a],gt[a]=i,i=null!=n(e,t,r)?a:null,gt[a]=o),i}}));var mt=/^(?:input|select|textarea|button)$/i,vt=/^(?:a|area)$/i;function yt(e){return(e.match(D)||[]).join(" ")}function bt(e){return e.getAttribute&&e.getAttribute("class")||""}function Tt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(D)||[]}S.fn.extend({prop:function(e,t){return G(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[S.propFix[e]||e]}))}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):mt.test(e.nodeName)||vt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(v(e))return this.each((function(t){S(this).addClass(e.call(this,t,bt(this)))}));if((t=Tt(e)).length)for(;n=this[u++];)if(i=bt(n),r=1===n.nodeType&&" "+yt(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=yt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(v(e))return this.each((function(t){S(this).removeClass(e.call(this,t,bt(this)))}));if(!arguments.length)return this.attr("class","");if((t=Tt(e)).length)for(;n=this[u++];)if(i=bt(n),r=1===n.nodeType&&" "+yt(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=yt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):v(e)?this.each((function(n){S(this).toggleClass(e.call(this,n,bt(this),t),t)})):this.each((function(){var t,i,o,a;if(r)for(i=0,o=S(this),a=Tt(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=bt(this))&&Z.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Z.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+yt(bt(n))+" ").indexOf(t)>-1)return!0;return!1}});var xt=/\r/g;S.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=v(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,S(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=S.map(i,(function(e){return null==e?"":e+""}))),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=S.valHooks[i.type]||S.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(xt,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:yt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=S.makeArray(t),a=i.length;a--;)((r=i[a]).selected=S.inArray(S.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},m.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),m.focusin="onfocusin"in n;var Ot=/^(?:focusinfocus|focusoutblur)$/,St=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,r,i){var o,a,s,u,l,c,f,h,d=[r||b],g=p.call(e,"type")?e.type:e,m=p.call(e,"namespace")?e.namespace.split("."):[];if(a=h=s=r=r||b,3!==r.nodeType&&8!==r.nodeType&&!Ot.test(g+S.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),l=g.indexOf(":")<0&&"on"+g,(e=e[S.expando]?e:new S.Event(g,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=m.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:S.makeArray(t,[e]),f=S.event.special[g]||{},i||!f.trigger||!1!==f.trigger.apply(r,t))){if(!i&&!f.noBubble&&!y(r)){for(u=f.delegateType||g,Ot.test(u+g)||(a=a.parentNode);a;a=a.parentNode)d.push(a),s=a;s===(r.ownerDocument||b)&&d.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=d[o++])&&!e.isPropagationStopped();)h=a,e.type=o>1?u:f.bindType||g,(c=(Z.get(a,"events")||Object.create(null))[e.type]&&Z.get(a,"handle"))&&c.apply(a,t),(c=l&&a[l])&&c.apply&&Y(a)&&(e.result=c.apply(a,t),!1===e.result&&e.preventDefault());return e.type=g,i||e.isDefaultPrevented()||f._default&&!1!==f._default.apply(d.pop(),t)||!Y(r)||l&&v(r[g])&&!y(r)&&((s=r[l])&&(r[l]=null),S.event.triggered=g,e.isPropagationStopped()&&h.addEventListener(g,St),r[g](),e.isPropagationStopped()&&h.removeEventListener(g,St),S.event.triggered=void 0,s&&(r[l]=s)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each((function(){S.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),m.focusin||S.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){S.event.simulate(t,e.target,S.event.fix(e))};S.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=Z.access(r,t);i||r.addEventListener(e,n,!0),Z.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=Z.access(r,t)-1;i?Z.access(r,t,i):(r.removeEventListener(e,n,!0),Z.remove(r,t))}}}));var Ct=n.location,Et={guid:Date.now()},wt=/\?/;S.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+e),t};var kt=/\[\]$/,Nt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Lt=/^(?:input|select|textarea|keygen)/i;function Rt(e,t,n,r){var i;if(Array.isArray(t))S.each(t,(function(t,i){n||kt.test(e)?r(e,i):Rt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==O(t))r(e,t);else for(i in t)Rt(e+"["+i+"]",t[i],n,r)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,(function(){i(this.name,this.value)}));else for(n in e)Rt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Lt.test(this.nodeName)&&!At.test(e)&&(this.checked||!ge.test(e))})).map((function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,(function(e){return{name:t.name,value:e.replace(Nt,"\r\n")}})):{name:t.name,value:n.replace(Nt,"\r\n")}})).get()}});var It=/%20/g,Mt=/#.*$/,Pt=/([?&])_=[^&]*/,_t=/^(.*?):[ \t]*([^\r\n]*)$/gm,jt=/^(?:GET|HEAD)$/,Dt=/^\/\//,Ft={},Ut={},Wt="*/".concat("*"),Ht=b.createElement("a");function Bt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(D)||[];if(v(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function zt(e,t,n,r){var i={},o=e===Ut;function a(s){var u;return i[s]=!0,S.each(e[s]||[],(function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)})),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Gt(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Ht.href=Ct.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Wt,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":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Gt(Gt(e,S.ajaxSettings),t):Gt(S.ajaxSettings,e)},ajaxPrefilter:Bt(Ft),ajaxTransport:Bt(Ut),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,i,o,a,s,u,l,c,f,h,p=S.ajaxSetup({},t),d=p.context||p,g=p.context&&(d.nodeType||d.jquery)?S(d):S.event,m=S.Deferred(),v=S.Callbacks("once memory"),y=p.statusCode||{},T={},x={},O="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(l){if(!a)for(a={};t=_t.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(e,t){return null==l&&(e=x[e.toLowerCase()]=x[e.toLowerCase()]||e,T[e]=t),this},overrideMimeType:function(e){return null==l&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)C.always(e[C.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||O;return r&&r.abort(t),E(0,t),this}};if(m.promise(C),p.url=((e||p.url||Ct.href)+"").replace(Dt,Ct.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(D)||[""],null==p.crossDomain){u=b.createElement("a");try{u.href=p.url,u.href=u.href,p.crossDomain=Ht.protocol+"//"+Ht.host!=u.protocol+"//"+u.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=S.param(p.data,p.traditional)),zt(Ft,p,t,C),l)return C;for(f in(c=S.event&&p.global)&&0==S.active++&&S.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!jt.test(p.type),i=p.url.replace(Mt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(It,"+")):(h=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(wt.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(Pt,"$1"),h=(wt.test(i)?"&":"?")+"_="+Et.guid+++h),p.url=i+h),p.ifModified&&(S.lastModified[i]&&C.setRequestHeader("If-Modified-Since",S.lastModified[i]),S.etag[i]&&C.setRequestHeader("If-None-Match",S.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||t.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Wt+"; q=0.01":""):p.accepts["*"]),p.headers)C.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(!1===p.beforeSend.call(d,C,p)||l))return C.abort();if(O="abort",v.add(p.complete),C.done(p.success),C.fail(p.error),r=zt(Ut,p,t,C)){if(C.readyState=1,c&&g.trigger("ajaxSend",[C,p]),l)return C;p.async&&p.timeout>0&&(s=n.setTimeout((function(){C.abort("timeout")}),p.timeout));try{l=!1,r.send(T,E)}catch(e){if(l)throw e;E(-1,e)}}else E(-1,"No Transport");function E(e,t,a,u){var f,h,b,T,x,O=t;l||(l=!0,s&&n.clearTimeout(s),r=void 0,o=u||"",C.readyState=e>0?4:0,f=e>=200&&e<300||304===e,a&&(T=function(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(p,C,a)),!f&&S.inArray("script",p.dataTypes)>-1&&(p.converters["text script"]=function(){}),T=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(p,T,C,f),f?(p.ifModified&&((x=C.getResponseHeader("Last-Modified"))&&(S.lastModified[i]=x),(x=C.getResponseHeader("etag"))&&(S.etag[i]=x)),204===e||"HEAD"===p.type?O="nocontent":304===e?O="notmodified":(O=T.state,h=T.data,f=!(b=T.error))):(b=O,!e&&O||(O="error",e<0&&(e=0))),C.status=e,C.statusText=(t||O)+"",f?m.resolveWith(d,[h,O,C]):m.rejectWith(d,[C,O,b]),C.statusCode(y),y=void 0,c&&g.trigger(f?"ajaxSuccess":"ajaxError",[C,p,f?h:b]),v.fireWith(d,[C,O]),c&&(g.trigger("ajaxComplete",[C,p]),--S.active||S.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],(function(e,t){S[t]=function(e,n,r,i){return v(n)&&(i=i||r,r=n,n=void 0),S.ajax(S.extend({url:e,type:t,dataType:i,data:n,success:r},S.isPlainObject(e)&&e))}})),S.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return v(e)?this.each((function(t){S(this).wrapInner(e.call(this,t))})):this.each((function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=v(e);return this.each((function(n){S(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Kt=S.ajaxSettings.xhr();m.cors=!!Kt&&"withCredentials"in Kt,m.ajax=Kt=!!Kt,S.ajaxTransport((function(e){var t,r;if(m.cors||Kt&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),r=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout((function(){t&&r()}))},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),S.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),S.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=S("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),b.head.appendChild(t[0])},abort:function(){n&&n()}}}));var qt,$t=[],Yt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=$t.pop()||S.expando+"_"+Et.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",(function(e,t,r){var i,o,a,s=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Yt,"$1"+i):!1!==e.jsonp&&(e.url+=(wt.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||S.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=n[i],n[i]=function(){a=arguments},r.always((function(){void 0===o?S(n).removeProp(i):n[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,$t.push(i)),a&&v(o)&&o(a[0]),a=o=void 0})),"script"})),m.createHTMLDocument=((qt=b.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===qt.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(m.createHTMLDocument?((r=(t=b.implementation.createHTMLDocument("")).createElement("base")).href=b.location.href,t.head.appendChild(r)):t=b),o=!n&&[],(i=L.exec(e))?[t.createElement(i[1])]:(i=Oe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=yt(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)})).always(n&&function(e,t){a.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},S.expr.pseudos.animated=function(e){return S.grep(S.timers,(function(t){return e===t.elem})).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&(o+u).indexOf("auto")>-1?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){S.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||oe}))}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;S.fn[e]=function(r){return G(this,(function(e,r,i){var o;if(y(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i}),e,r,arguments.length)}})),S.each(["top","left"],(function(e,t){S.cssHooks[t]=Ke(m.pixelPosition,(function(e,n){if(n)return n=Ve(e,t),He.test(n)?S(e).position()[t]+"px":n}))})),S.each({Height:"height",Width:"width"},(function(e,t){S.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){S.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return G(this,(function(t,n,i){var o;return y(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?S.css(t,n,s):S.style(t,n,i,s)}),t,a?i:void 0,a)}}))})),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){S.fn[t]=function(e){return this.on(t,e)}})),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),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(e,t){S.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}));var Xt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=v,S.isWindow=y,S.camelCase=$,S.type=O,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Xt,"")},void 0===(r=function(){return S}.apply(t,[]))||(e.exports=r);var Zt=n.jQuery,Jt=n.$;return S.noConflict=function(e){return n.$===S&&(n.$=Jt),e&&n.jQuery===S&&(n.jQuery=Zt),S},void 0===i&&(n.jQuery=n.$=S),S}))},function(e,t,n){!function(e){"use strict";function t(e,t){if(!e.hasOwnProperty(t))throw new Error("Undefined state "+t+" in simple mode")}function n(e,t){if(!e)return/(?:)/;var n="";return e instanceof RegExp?(e.ignoreCase&&(n="i"),e=e.source):e=String(e),new RegExp((!1===t?"":"^")+"(?:"+e+")",n)}function r(e,r){(e.next||e.push)&&t(r,e.next||e.push),this.regex=n(e.regex),this.token=function(e){if(!e)return null;if(e.apply)return e;if("string"==typeof e)return e.replace(/\./g," ");for(var t=[],n=0;n<e.length;n++)t.push(e[n]&&e[n].replace(/\./g," "));return t}(e.token),this.data=e}function i(e,t){return function(n,r){if(r.pending){var i=r.pending.shift();return 0==r.pending.length&&(r.pending=null),n.pos+=i.text.length,i.token}if(r.local){if(r.local.end&&n.match(r.local.end)){var o=r.local.endToken||null;return r.local=r.localState=null,o}var s;return o=r.local.mode.token(n,r.localState),r.local.endScan&&(s=r.local.endScan.exec(n.current()))&&(n.pos=n.start+s.index),o}for(var u=e[r.state],l=0;l<u.length;l++){var c=u[l],f=(!c.data.sol||n.sol())&&n.match(c.regex);if(f){c.data.next?r.state=c.data.next:c.data.push?((r.stack||(r.stack=[])).push(r.state),r.state=c.data.push):c.data.pop&&r.stack&&r.stack.length&&(r.state=r.stack.pop()),c.data.mode&&a(t,r,c.data.mode,c.token),c.data.indent&&r.indent.push(n.indentation()+t.indentUnit),c.data.dedent&&r.indent.pop();var h=c.token;if(h&&h.apply&&(h=h(f)),f.length>2&&c.token&&"string"!=typeof c.token){r.pending=[];for(var p=2;p<f.length;p++)f[p]&&r.pending.push({text:f[p],token:c.token[p-1]});return n.backUp(f[0].length-(f[1]?f[1].length:0)),h[0]}return h&&h.join?h[0]:h}}return n.next(),null}}function o(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=0;for(var r in e)if(e.hasOwnProperty(r)){if(!t.hasOwnProperty(r)||!o(e[r],t[r]))return!1;n++}for(var r in t)t.hasOwnProperty(r)&&n--;return 0==n}function a(t,r,i,a){var s;if(i.persistent)for(var u=r.persistentStates;u&&!s;u=u.next)(i.spec?o(i.spec,u.spec):i.mode==u.mode)&&(s=u);var l=s?s.mode:i.mode||e.getMode(t,i.spec),c=s?s.state:e.startState(l);i.persistent&&!s&&(r.persistentStates={mode:l,spec:i.spec,state:c,next:r.persistentStates}),r.localState=c,r.local={mode:l,end:i.end&&n(i.end),endScan:i.end&&!1!==i.forceEnd&&n(i.end,!1),endToken:a&&a.join?a[a.length-1]:a}}function s(t,n){return function(r,i,o){if(r.local&&r.local.mode.indent)return r.local.mode.indent(r.localState,i,o);if(null==r.indent||r.local||n.dontIndentStates&&function(e,t){for(var n=0;n<t.length;n++)if(t[n]===e)return!0}(r.state,n.dontIndentStates)>-1)return e.Pass;var a=r.indent.length-1,s=t[r.state];e:for(;;){for(var u=0;u<s.length;u++){var l=s[u];if(l.data.dedent&&!1!==l.data.dedentIfLineStart){var c=l.regex.exec(i);if(c&&c[0]){a--,(l.next||l.push)&&(s=t[l.next||l.push]),i=i.slice(c[0].length);continue e}}}break}return a<0?0:r.indent[a]}}e.defineSimpleMode=function(t,n){e.defineMode(t,(function(t){return e.simpleMode(t,n)}))},e.simpleMode=function(n,o){t(o,"start");var a={},u=o.meta||{},l=!1;for(var c in o)if(c!=u&&o.hasOwnProperty(c))for(var f=a[c]=[],h=o[c],p=0;p<h.length;p++){var d=h[p];f.push(new r(d,o)),(d.indent||d.dedent)&&(l=!0)}var g={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:l?[]:null}},copyState:function(t){var n={state:t.state,pending:t.pending,local:t.local,localState:null,indent:t.indent&&t.indent.slice(0)};t.localState&&(n.localState=e.copyState(t.local.mode,t.localState)),t.stack&&(n.stack=t.stack.slice(0));for(var r=t.persistentStates;r;r=r.next)n.persistentStates={mode:r.mode,spec:r.spec,state:r.state==t.localState?n.localState:e.copyState(r.mode,r.state),next:n.persistentStates};return n},token:i(a,n),innerMode:function(e){return e.local&&{mode:e.local.mode,state:e.localState}},indent:s(a,u)};if(u)for(var m in u)u.hasOwnProperty(m)&&(g[m]=u[m]);return g}}(n(4))},function(e,t,n){!function(e){"use strict";e.runMode=function(t,n,r,i){var o=e.getMode(e.defaults,n),a=i&&i.tabSize||e.defaults.tabSize;if(r.appendChild){var s=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9),u=r,l=0;u.innerHTML="",r=function(e,t){if("\n"==e)return u.appendChild(document.createTextNode(s?"\r":e)),void(l=0);for(var n="",r=0;;){var i=e.indexOf("\t",r);if(-1==i){n+=e.slice(r),l+=e.length-r;break}l+=i-r,n+=e.slice(r,i);var o=a-l%a;l+=o;for(var c=0;c<o;++c)n+=" ";r=i+1}if(t){var f=u.appendChild(document.createElement("span"));f.className="cm-"+t.replace(/ +/g," cm-"),f.appendChild(document.createTextNode(n))}else u.appendChild(document.createTextNode(n))}}for(var c=e.splitLines(t),f=i&&i.state||e.startState(o),h=0,p=c.length;h<p;++h){h&&r("\n");var d=new e.StringStream(c[h],null,{lookAhead:function(e){return c[h+e]},baseToken:function(){}});for(!d.string&&o.blankLine&&o.blankLine(f);!d.eol();){var g=o.token(d,f);r(d.current(),g,h,d.start,f),d.start=d.pos}}}}(n(4))},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)}]);