diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5b80c3a6d5..6964297101 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,25 @@
+
+# 4.4.0 (2017-05-23)
+
+
+### Bug Fixes
+
+* fix sidebar viewport for android ([#37](https://github.com/alfa-laboratory/arui-feather/issues/37)) ([c2d884e](https://github.com/alfa-laboratory/arui-feather/commit/c2d884e))
+* **package.json:** add babel-runtime dependency ([c4472bc](https://github.com/alfa-laboratory/arui-feather/commit/c4472bc))
+* **playground:** fix url of playground ([#31](https://github.com/alfa-laboratory/arui-feather/issues/31)) ([5608be5](https://github.com/alfa-laboratory/arui-feather/commit/5608be5))
+* **popup:** replace deprecated debounce decorator ([#30](https://github.com/alfa-laboratory/arui-feather/issues/30)) ([5e1d640](https://github.com/alfa-laboratory/arui-feather/commit/5e1d640))
+
+
+### Features
+
+* add styleguide for input and for calendarInput ([#34](https://github.com/alfa-laboratory/arui-feather/issues/34)) ([44756f4](https://github.com/alfa-laboratory/arui-feather/commit/44756f4))
+* change react-textarea-autosize version ([#29](https://github.com/alfa-laboratory/arui-feather/issues/29)) ([07c8360](https://github.com/alfa-laboratory/arui-feather/commit/07c8360))
+* fix fonts for styleguide ([#33](https://github.com/alfa-laboratory/arui-feather/issues/33)) ([7067f46](https://github.com/alfa-laboratory/arui-feather/commit/7067f46))
+* **playground:** add share example functionality ([#23](https://github.com/alfa-laboratory/arui-feather/issues/23)) ([49cc2ed](https://github.com/alfa-laboratory/arui-feather/commit/49cc2ed))
+* **slide-down:** add component ([#27](https://github.com/alfa-laboratory/arui-feather/issues/27)) ([2e5d959](https://github.com/alfa-laboratory/arui-feather/commit/2e5d959))
+
+
+
# 4.3.0 (2017-05-11)
diff --git a/arui-demo/styleguide/build/1.58624158.js b/arui-demo/styleguide/build/1.58624158.js
deleted file mode 100644
index 37b57c63cb..0000000000
--- a/arui-demo/styleguide/build/1.58624158.js
+++ /dev/null
@@ -1,7 +0,0 @@
-webpackJsonp([1],{85:function(e,t,r){!function(t,r){e.exports=r()}(this,function(){"use strict";function classTest(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function removeChildren(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function removeChildrenAndAdd(e,t){return removeChildren(e).appendChild(t)}function elt(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=r-a%r,o=s+1}}function indexOf(e,t){for(var r=0;r=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function spaceStr(e){for(;E.length<=e;)E.push(lst(E)+" ");return E[e]}function lst(e){return e[e.length-1]}function map(e,t){for(var r=[],n=0;n""&&(e.toUpperCase()!=e.toLowerCase()||I.test(e))}function isWordChar(e,t){return t?!!(t.source.indexOf("\\w")>-1&&isWordCharBasic(e))||t.test(e):isWordCharBasic(e)}function isEmpty(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function isExtendingChar(e){return e.charCodeAt(0)>=768&&F.test(e)}function skipExtendingChars(e,t,r){for(;(r<0?t>0:t=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t=e.first&&tr?Pos(r,getLine(e,r).text.length):clipToLen(t,getLine(e,t.line).text.length)}function clipToLen(e,t){var r=e.ch;return null==r||r>t?Pos(e.line,t):r<0?Pos(e.line,0):e}function clipPosArray(e,t){for(var r=[],n=0;n=t:o.to>t);(n||(n=[])).push(new MarkedSpan(a,o.from,l?null:o.to))}}return n}function markedSpansAfter(e,t,r){var n;if(e)for(var i=0;i=t:o.to>t);if(s||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var x=0;x0)){var u=[l,1],d=cmp(c.from,s.from),p=cmp(c.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(p>0||!a.inclusiveRight&&!p)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}function detachMarkedSpans(e){var t=e.markedSpans;if(t){for(var r=0;r=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?cmp(c.to,r)>=0:cmp(c.to,r)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?cmp(c.from,n)<=0:cmp(c.from,n)<0)))return!0}}}function visualLine(e){for(var t;t=collapsedSpanAtStart(e);)e=t.find(-1,!0).line;return e}function visualLineEnd(e){for(var t;t=collapsedSpanAtEnd(e);)e=t.find(1,!0).line;return e}function visualLineContinued(e){for(var t,r;t=collapsedSpanAtEnd(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function visualLineNo(e,t){var r=getLine(e,t),n=visualLine(r);return r==n?t:lineNo(n)}function visualLineEndNo(e,t){if(t>e.lastLine())return t;var r,n=getLine(e,t);if(!lineIsHidden(e,n))return t;for(;r=collapsedSpanAtEnd(n);)n=r.find(1,!0).line;return lineNo(n)+1}function lineIsHidden(e,t){var r=z&&t.markedSpans;if(r)for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function iterateBidiSections(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;ot||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function getBidiPartAt(e,t,r){var n;R=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:R=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:R=i)}return null!=n?n:R}function getOrder(e,t){var r=e.order;return null==r&&(r=e.order=V(e.text,t)),r}function moveCharLogically(e,t,r){var n=skipExtendingChars(e.text,t+r,r);return n<0||n>e.text.length?null:n}function moveLogically(e,t,r){var n=moveCharLogically(e,t.ch,r);return null==n?null:new Pos(t.line,n,r<0?"after":"before")}function endOfLine(e,t,r,n,i){if(e){var o=getOrder(r,t.doc.direction);if(o){var a,s=i<0?lst(o):o[0],l=i<0==(1==s.level),c=l?"after":"before";if(s.level>0){var u=prepareMeasureForLine(t,r);a=i<0?r.text.length-1:0;var d=measureCharPrepared(t,u,a).top;a=findFirst(function(e){return measureCharPrepared(t,u,e).top==d},i<0==(1==s.level)?s.from:s.to-1,a),"before"==c&&(a=moveCharLogically(r,a,1))}else a=i<0?s.to:s.from;return new Pos(n,a,c)}}return new Pos(n,i<0?r.text.length:0,i<0?"before":"after")}function moveVisually(e,t,r,n){var i=getOrder(t,e.doc.direction);if(!i)return moveLogically(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=getBidiPartAt(i,r.ch,r.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from=a.from&&p>=u.begin)){var f=d?"before":"after";return new Pos(r.line,p,f)}}var h=function(e,t,n){for(var o=function(e,t){return t?new Pos(r.line,l(e,1),"before"):new Pos(r.line,e,"after")};e>=0&&e0==(1!=a.level),c=s?n.begin:l(n.end,-1);if(a.from<=c&&c0?u.end:l(u.begin,-1);return null==m||n>0&&m==t.text.length||!(g=h(n>0?0:i.length-1,n,c(m)))?null:g}function getHandlers(e,t){return e._handlers&&e._handlers[t]||j}function off(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=indexOf(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function signal(e,t){var r=getHandlers(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function eventMixin(e){e.prototype.on=function(e,t){G(this,e,t)},e.prototype.off=function(e,t){off(this,e,t)}}function e_preventDefault(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function e_stopPropagation(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function e_defaultPrevented(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function e_stop(e){e_preventDefault(e),e_stopPropagation(e)}function e_target(e){return e.target||e.srcElement}function e_button(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}function zeroWidthElement(e){if(null==O){var t=elt("span","");removeChildrenAndAdd(e,elt("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(O=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var r=O?elt("span",""):elt("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function hasBadBidiRects(e){if(null!=P)return P;var t=removeChildrenAndAdd(e,document.createTextNode("AخA")),r=w(t,0,1).getBoundingClientRect(),n=w(t,1,2).getBoundingClientRect();return removeChildren(e),!(!r||r.left==r.right)&&(P=n.right-r.right<3)}function hasBadZoomedRects(e){if(null!=q)return q;var t=removeChildrenAndAdd(e,elt("span","x")),r=t.getBoundingClientRect(),n=w(t,0,1).getBoundingClientRect();return q=Math.abs(r.left-n.left)>1}function defineMode(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),X[e]=t}function defineMIME(e,t){Y[e]=t}function resolveMode(e){if("string"==typeof e&&Y.hasOwnProperty(e))e=Y[e];else if(e&&"string"==typeof e.name&&Y.hasOwnProperty(e.name)){var t=Y[e.name];"string"==typeof t&&(t={name:t}),e=createObj(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return resolveMode("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return resolveMode("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function getMode(e,t){t=resolveMode(t);var r=X[t.name];if(!r)return getMode(e,"text/plain");var n=r(e,t);if(Z.hasOwnProperty(t.name)){var i=Z[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}function extendMode(e,t){var r=Z.hasOwnProperty(e)?Z[e]:Z[e]={};copyObj(t,r)}function copyState(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function innerMode(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),r&&r.mode!=e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function startState(e,t,r){return!e.startState||e.startState(t,r)}function highlightLine(e,t,r,n){var i=[e.state.modeGen],o={};runMode(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var a=function(r){var n=e.state.overlays[r],a=1,s=0;runMode(e,t.text,n.mode,!0,function(e,t){for(var r=a;se&&i.splice(a,1,e,i[a+1],o),a+=2,s=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;re.options.maxHighlightLength?copyState(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function getStateBefore(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=findStartLine(e,t,r),a=o>n.first&&getLine(n,o-1).stateAfter;return a=a?copyState(n.mode,a):startState(n.mode),n.iter(o,t,function(r){processLine(e,r.text,a);var s=o==t-1||o%5==0||o>=i.viewFrom&&ot.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function takeToken(e,t,r,n){var i,o=function(e){return{start:d.start,end:d.pos,string:d.current(),type:i||null,state:e?copyState(a.mode,u):u}},a=e.doc,s=a.mode;t=clipPos(a,t);var l,c=getLine(a,t.line),u=getStateBefore(e,t.line,r),d=new Q(c.text,e.options.tabSize);for(n&&(l=[]);(n||d.pose.options.maxHighlightLength?(s=!1,a&&processLine(e,t,n,d.pos),d.pos=t.length,l=null):l=extractLineClasses(readToken(r,d,n,p),o),p){var f=p[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||u!=l){for(;ca;--s){if(s<=o.first)return o.first;var l=getLine(o,s-1);if(l.stateAfter&&(!r||s<=o.frontier))return s;var c=countColumn(l.text,null,e.options.tabSize);(null==i||n>c)&&(i=s-1,n=c)}return i}function updateLine(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),detachMarkedSpans(e),attachMarkedSpans(e,r);var i=n?n(e):1;i!=e.height&&updateLineHeight(e,i)}function cleanUpLine(e){e.parent=null,detachMarkedSpans(e)}function interpretTokenStyle(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?re:te;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function buildLineContent(e,t){var r=eltP("span",null,null,l?"padding-right: .1px":null),n={pre:eltP("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(a||l)&&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,s=void 0;n.pos=0,n.addToken=buildToken,hasBadBidiRects(e.display.measure)&&(s=getOrder(o,e.doc.direction))&&(n.addToken=buildTokenBadBidi(n.addToken,s)),n.map=[];var c=t!=e.display.externalMeasured&&lineNo(o);insertLineContent(o,n,getLineStyles(e,o,c)),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=joinClasses(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=joinClasses(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(zeroWidthElement(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var u=n.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return signal(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=joinClasses(n.pre.className,n.textClass||"")),n}function defaultSpecialCharPlaceholder(e){var t=elt("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function buildToken(e,t,r,n,i,o,l){if(t){var c,u=e.splitSpaces?splitSpaces(t,e.trailingSpace):t,d=e.cm.state.specialChars,p=!1;if(d.test(t)){c=document.createDocumentFragment();for(var f=0;;){d.lastIndex=f;var h=d.exec(t),g=h?h.index-f:t.length-f;if(g){var m=document.createTextNode(u.slice(f,f+g));a&&s<9?c.appendChild(elt("span",[m])):c.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!h)break;f+=g+1;var v=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;v=c.appendChild(elt("span",spaceStr(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?(v=c.appendChild(elt("span","\r"==h[0]?"␍":"","cm-invalidchar")),v.setAttribute("cm-text",h[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(h[0]),v.setAttribute("cm-text",h[0]),a&&s<9?c.appendChild(elt("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(p=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||n||i||p||l){var x=r||"";n&&(x+=n),i&&(x+=i);var C=elt("span",[c],x,l);return o&&(C.title=o),e.content.appendChild(C)}e.content.appendChild(c)}}function splitSpaces(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;ic&&d.from<=c));p++);if(d.to>=u)return e(r,n,i,o,a,s,l);e(r,n.slice(0,d.to-c),i,o,null,s,l),o=null,n=n.slice(d.to-c),c=d.to}}}function buildCollapsedSpan(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function insertLineContent(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,s,l,c,u,d,p,f=i.length,h=0,g=1,m="",v=0;;){if(v==h){l=c=u=d=s="",p=null,v=1/0;for(var y=[],b=void 0,x=0;xh||w.collapsed&&C.to==h&&C.from==h)?(null!=C.to&&C.to!=h&&v>C.to&&(v=C.to,c=""),w.className&&(l+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&C.from==h&&(u+=" "+w.startStyle),w.endStyle&&C.to==v&&(b||(b=[])).push(w.endStyle,C.to),w.title&&!d&&(d=w.title),w.collapsed&&(!p||compareCollapsedMarkers(p.marker,w)<0)&&(p=C)):C.from>h&&v>C.from&&(v=C.from)}if(b)for(var S=0;S=f)break;for(var L=Math.min(f,v);;){if(m){var M=h+m.length;if(!p){var T=M>L?m.slice(0,L-h):m;t.addToken(t,T,a?a+l:l,u,h+T.length==v?c:"",d,s)}if(M>=L){m=m.slice(L-h),h=L;break}h=M,u=""}m=i.slice(o,o=r[g++]),a=interpretTokenStyle(r[g++],t.cm.options)}}else for(var O=1;O2&&o.push((l.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}function mapFromLineView(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function updateExternalMeasurement(e,t){t=visualLine(t);var r=lineNo(t),n=e.display.externalMeasured=new LineView(e.doc,t,r);n.lineN=r;var i=n.built=buildLineContent(e,n);return n.text=i.pre,removeChildrenAndAdd(e.display.lineMeasure,i.pre),n}function measureChar(e,t,r,n){return measureCharPrepared(e,prepareMeasureForLine(e,t),r,n)}function findViewForLine(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(o=l-s,i=o-1,t>=l&&(a="right")),null!=i){if(n=e[c+2],s==l&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[(c-=3)+2],a="left";if("right"==r&&i==l-s)for(;c=0&&(r=e[i]).left==r.right;i--);return r}function measureCharInner(e,t,r,n){var i,o=nodeAndOffsetInLineMap(t.map,r,n),l=o.node,c=o.start,u=o.end,d=o.collapse;if(3==l.nodeType){for(var p=0;p<4;p++){for(;c&&isExtendingChar(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u0&&(d=n="right");var f;i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==n?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+charWidth(e.display),top:h.top,bottom:h.bottom}:oe}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=n.text.length?(s=n.text.length,l="before"):s<=0&&(s=0,l="after"),!a)return get("before"==l?s-1:s,"before"==l);var c=getBidiPartAt(a,s,l),u=R,d=getBidi(s,c,"before"==l);return null!=u&&(d.other=getBidi(s,u,"before"!=l)),d}function estimateCoords(e,t){var r=0;t=clipPos(e.doc,t),e.options.lineWrapping||(r=charWidth(e.display)*t.ch);var n=getLine(e.doc,t.line),i=heightAtLine(n)+paddingTop(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function PosWithInfo(e,t,r,n,i){var o=Pos(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function coordsChar(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return PosWithInfo(n.first,0,null,!0,-1);var i=lineAtHeight(n,r),o=n.first+n.size-1;if(i>o)return PosWithInfo(n.first+n.size-1,getLine(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=getLine(n,i);;){var s=coordsCharInner(e,a,i,t,r),l=collapsedSpanAtEnd(a),c=l&&l.find(0,!0);if(!l||!(s.ch>c.from.ch||s.ch==c.from.ch&&s.xRel>0))return s;i=lineNo(a=c.to.line)}}function wrappedLineExtent(e,t,r,n){var i=function(n){return intoCoordSystem(e,t,measureCharPrepared(e,r,n),"line")},o=t.text.length,a=findFirst(function(e){return i(e-1).bottom<=n},o,0);return o=findFirst(function(e){return i(e).top>n},a,o),{begin:a,end:o}}function wrappedLineExtentChar(e,t,r,n){var i=intoCoordSystem(e,t,measureCharPrepared(e,r,n),"line").top;return wrappedLineExtent(e,t,r,i)}function coordsCharInner(e,t,r,n,i){i-=heightAtLine(t);var o,a=0,s=t.text.length,l=prepareMeasureForLine(e,t),c=getOrder(t,e.doc.direction);if(c){if(e.options.lineWrapping){var u;u=wrappedLineExtent(e,t,l,i),a=u.begin,s=u.end,u}o=new Pos(r,a);var d,p,f=cursorCoords(e,o,"line",t,l).left,h=fMath.abs(d)){if(g<0==d<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=p}}else{var m=findFirst(function(r){var o=intoCoordSystem(e,t,measureCharPrepared(e,l,r),"line");return o.top>i?(s=Math.min(r,s),!0):!(o.bottom<=i)&&(o.left>n||!(o.rightv.right?1:0,o}function textHeight(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ee){ee=elt("pre");for(var t=0;t<49;++t)ee.appendChild(document.createTextNode("x")),ee.appendChild(elt("br"));ee.appendChild(document.createTextNode("x"))}removeChildrenAndAdd(e.measure,ee);var r=ee.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),removeChildren(e.measure),r||1}function charWidth(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=elt("span","xxxxxxxxxx"),r=elt("pre",[t]);removeChildrenAndAdd(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function getDimensions(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:compensateForHScroll(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function compensateForHScroll(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function estimateHeight(e){var t=textHeight(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/charWidth(e.display)-3);return function(i){if(lineIsHidden(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n=e.display.viewTo||s.to().line3&&(add(d,f.top,null,f.bottom),d=s,f.bottoma.bottom||c.bottom==a.bottom&&c.right>a.right)&&(a=c),d0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ensureFocus(e){e.state.focused||(e.display.input.focus(),onFocus(e))}function delayBlurEvent(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,onBlur(e))},100)}function onFocus(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(signal(e,"focus",e,t),e.state.focused=!0,addClass(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),restartBlink(e))}function onBlur(e,t){e.state.delayingBlurEvent||(e.state.focused&&(signal(e,"blur",e,t),e.state.focused=!1,L(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function updateHeightsInViewport(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n.001||u<-.001)&&(updateLineHeight(i.line,o),updateWidgetHeight(i.line),i.rest))for(var d=0;d=a&&(o=lineAtHeight(t,heightAtLine(getLine(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function alignHorizontally(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=compensateForHScroll(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!h){var o=elt("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-paddingTop(e.display))+"px;\n height: "+(t.bottom-t.top+scrollGap(e)+r.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)}}}function scrollPosIntoView(e,t,r,n){null==n&&(n=0);for(var i,o=0;o<5;o++){var a=!1,s=cursorCoords(e,t),l=r&&r!=t?cursorCoords(e,r):s;i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-n,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+n};var c=calculateScrollPos(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(updateScrollTop(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(setScrollLeft(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function scrollIntoView(e,t){var r=calculateScrollPos(e,t);null!=r.scrollTop&&updateScrollTop(e,r.scrollTop),null!=r.scrollLeft&&setScrollLeft(e,r.scrollLeft)}function calculateScrollPos(e,t){var r=e.display,n=textHeight(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=displayHeight(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+paddingVert(r),l=t.tops-n;if(t.topi+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,p=displayWidth(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),f=t.right-t.left>p;return f&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.leftp+d-3&&(a.scrollLeft=t.right+(f?0:10)-p),a}function addToScrollTop(e,t){null!=t&&(resolveScrollToPos(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function ensureCursorVisible(e){resolveScrollToPos(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?Pos(t.line,t.ch-1):t,n=Pos(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin}}function scrollToCoords(e,t,r){null==t&&null==r||resolveScrollToPos(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function scrollToRange(e,t){resolveScrollToPos(e),e.curOp.scrollToPos=t}function resolveScrollToPos(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=estimateCoords(e,t.from),n=estimateCoords(e,t.to);scrollToCoordsRange(e,r,n,t.margin)}}function scrollToCoordsRange(e,t,r,n){var i=calculateScrollPos(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});scrollToCoords(e,i.scrollLeft,i.scrollTop)}function updateScrollTop(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||updateDisplaySimple(e,{top:t}),setScrollTop(e,t,!0),r&&updateDisplaySimple(e),startWorker(e,100))}function setScrollTop(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function setScrollLeft(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,alignHorizontally(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function measureForScrollbars(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+paddingVert(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+scrollGap(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function updateScrollbars(e,t){t||(t=measureForScrollbars(e));var r=e.display.barWidth,n=e.display.barHeight;updateScrollbarsInner(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&updateHeightsInViewport(e),updateScrollbarsInner(e,measureForScrollbars(e)),r=e.display.barWidth,n=e.display.barHeight}function updateScrollbarsInner(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function initScrollbars(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&L(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new le[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),G(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?setScrollLeft(e,t):updateScrollTop(e,t)},e),e.display.scrollbars.addClass&&addClass(e.display.wrapper,e.display.scrollbars.addClass)}function startOperation(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ce},pushOperation(e.curOp)}function endOperation(e){var t=e.curOp;finishOperation(t,function(e){for(var t=0;t=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ue(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function endOperation_W1(e){e.updatedDisplay=e.mustUpdate&&updateDisplayIfNeeded(e.cm,e.update)}function endOperation_R2(e){var t=e.cm,r=t.display;e.updatedDisplay&&updateHeightsInViewport(t),e.barMeasure=measureForScrollbars(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=measureChar(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+scrollGap(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-displayWidth(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function endOperation_W2(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeftt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)z&&visualLineNo(e.doc,t)i.viewFrom?resetView(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)resetView(e);else if(t<=i.viewFrom){var o=viewCuttingPoint(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):resetView(e)}else if(r>=i.viewTo){var a=viewCuttingPoint(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):resetView(e)}else{var s=viewCuttingPoint(e,t,t,-1),l=viewCuttingPoint(e,r,r+n,1);s&&l?(i.view=i.view.slice(0,s.index).concat(buildViewArray(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=n):resetView(e)}var c=i.externalMeasured;c&&(r=i.lineN&&t=n.viewTo)){var o=n.view[findViewIndex(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);indexOf(a,r)==-1&&a.push(r)}}}function resetView(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function viewCuttingPoint(e,t,r,n){var i,o=findViewIndex(e,t),a=e.display.view;if(!z||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;visualLineNo(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function adjustView(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=buildViewArray(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=buildViewArray(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,findViewIndex(e,r)))),n.viewTo=r}function countDirtyView(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo)){var r=+new Date+e.options.workTime,n=copyState(t.mode,getStateBefore(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength,l=highlightLine(e,o,s?copyState(t.mode,n):n,!0);
-o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),p=0;!d&&pr)return startWorker(e,e.options.workDelay),!0}),i.length&&runInOp(e,function(){for(var t=0;t=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==countDirtyView(e))return!1;maybeUpdateLineNumberWidth(e)&&(resetView(e),t.dims=getDimensions(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFroma&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),z&&(o=visualLineNo(e.doc,o),a=visualLineEndNo(e.doc,a));var s=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;adjustView(e,o,a),r.viewOffset=heightAtLine(getLine(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var l=countDirtyView(e);if(!s&&0==l&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=selectionSnapshot(e);return l>4&&(r.lineDiv.style.display="none"),patchDisplay(e,r.updateLineNumbers,t.dims),l>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,restoreSelection(c),removeChildren(r.cursorDiv),removeChildren(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,startWorker(e,400)),r.updateLineNumbers=null,!0}function postUpdateDisplay(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=displayWidth(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+paddingVert(e.display)-displayHeight(e),r.top)}),t.visible=visibleLines(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&updateDisplayIfNeeded(e,t);n=!1){updateHeightsInViewport(e);var i=measureForScrollbars(e);updateSelection(e),updateScrollbars(e,i),setDocumentHeight(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function updateDisplaySimple(e,t){var r=new ue(e,t);if(updateDisplayIfNeeded(e,r)){updateHeightsInViewport(e),postUpdateDisplay(e,r);var n=measureForScrollbars(e);updateSelection(e),updateScrollbars(e,n),setDocumentHeight(e,n),r.finish()}}function patchDisplay(e,t,r){function rm(t){var r=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,a=o.firstChild,s=n.view,c=n.viewFrom,u=0;u-1&&(p=!1),updateLineForChanges(e,d,c,r)),p&&(removeChildren(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(lineNumberFor(e.options,c)))),a=d.node.nextSibling}else{var f=buildLineElement(e,d,c,r);o.insertBefore(f,a)}c+=d.size}for(;a;)a=rm(a)}function updateGutterSpace(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function setDocumentHeight(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+scrollGap(e)+"px"}function updateGutters(e){var t=e.display.gutters,r=e.options.gutters;removeChildren(t);for(var n=0;n-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function wheelEventDelta(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function wheelEventPixels(e){var t=wheelEventDelta(e);return t.x*=pe,t.y*=pe,t}function onScrollWheel(e,t){var n=wheelEventDelta(t),i=n.x,o=n.y,a=e.display,s=a.scroller,c=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&c||o&&u){if(o&&y&&l)e:for(var p=t.target,f=a.view;p!=s;p=p.parentNode)for(var h=0;h=0){var a=minPos(o.from(),i.from()),s=maxPos(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new he(l?s:a,l?a:s))}}return new fe(e,t)}function simpleSelection(e,t){return new fe([new he(e,t||e)],0)}function changeEnd(e){return e.text?Pos(e.from.line+e.text.length-1,lst(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function adjustForChange(e,t){if(cmp(e,t.from)<0)return e;if(cmp(e,t.to)<=0)return changeEnd(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=changeEnd(t).ch-t.to.ch),Pos(r,n)}function computeSelAfterChange(e,t){for(var r=[],n=0;n1&&e.remove(i.line+1,d-1),e.insert(i.line+1,h)}signalLater(e,"change",e,t)}function linkedDocs(e,t,r){function propagate(e,n,i){if(e.linked)for(var o=0;o1&&!e.done[e.done.length-2].ranges?(e.done.pop(),lst(e.done)):void 0}function addChangeToHistory(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=lastChangeEvent(i,i.lastOp==n)))a=lst(o.changes),0==cmp(t.from,t.to)&&0==cmp(t.from,a.to)?a.to=changeEnd(t):o.changes.push(historyChangeFromChange(e,t));else{var l=lst(i.done);for(l&&l.ranges||pushSelectionToHistory(e.sel,i.done),o={changes:[historyChangeFromChange(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||signal(e,"historyAdded")}function selectionEventCanBeMerged(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function addSelectionToHistory(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||selectionEventCanBeMerged(e,o,lst(i.done),t))?i.done[i.done.length-1]=t:pushSelectionToHistory(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&clearSelectionEvents(i.undone)}function pushSelectionToHistory(e,t){var r=lst(t);r&&r.ranges&&r.equals(e)||t.push(e)}function attachLocalSpans(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function removeClearedSpans(e){if(!e)return null;for(var t,r=0;r-1&&(lst(s)[d]=c[d],delete c[d])}}}return n}function extendRange(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=cmp(r,i)<0;o!=cmp(n,i)<0?(i=r,r=n):o!=cmp(r,n)<0&&(r=n)}return new he(i,r)}return new he(n||r,r)}function extendSelection(e,t,r,n){setSelection(e,new fe([extendRange(e,e.sel.primary(),t,r)],0),n)}function extendSelections(e,t,r){for(var n=[],i=0;i=t.ch:s.to>t.ch))){if(i&&(signal(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(r){var c=l.find(n<0?1:-1),u=void 0;if((n<0?l.inclusiveRight:l.inclusiveLeft)&&(c=movePos(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=cmp(c,r))&&(n<0?u<0:u>0))return skipAtomicInner(e,c,t,n,i)}var d=l.find(n<0?-1:1);return(n<0?l.inclusiveLeft:l.inclusiveRight)&&(d=movePos(e,d,n,d.line==t.line?o:null)),d?skipAtomicInner(e,d,t,n,i):null}}return t}function skipAtomic(e,t,r,n,i){var o=n||1,a=skipAtomicInner(e,t,r,o,i)||!i&&skipAtomicInner(e,t,r,o,!0)||skipAtomicInner(e,t,r,-o,i)||!i&&skipAtomicInner(e,t,r,-o,!0);return a?a:(e.cantEdit=!0,Pos(e.first,0))}function movePos(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?clipPos(e,Pos(t.line-1)):null:r>0&&t.ch==(n||getLine(e,t.line)).text.length?t.line=0;--i)makeChangeInner(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else makeChangeInner(e,t)}}function makeChangeInner(e,t){if(1!=t.text.length||""!=t.text[0]||0!=cmp(t.from,t.to)){var r=computeSelAfterChange(e,t);addChangeToHistory(e,t,r,e.cm?e.cm.curOp.id:NaN),makeChangeSingleDoc(e,t,r,stretchSpansOverChange(e,t));var n=[];linkedDocs(e,function(e,r){r||indexOf(n,e.history)!=-1||(rebaseHist(e.history,t),n.push(e.history)),makeChangeSingleDoc(e,t,null,stretchSpansOverChange(e,t))})}}function makeChangeFromHistory(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,l=0;l=0;--p){var f=d(p);if(f)return f.v}}}}function shiftDoc(e,t){if(0!=t&&(e.first+=t,e.sel=new fe(map(e.sel.ranges,function(e){return new he(Pos(e.anchor.line+t,e.anchor.ch),Pos(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){regChange(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.lineo&&(t={from:t.from,to:Pos(o,getLine(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=getBetween(e,t.from,t.to),r||(r=computeSelAfterChange(e,t)),e.cm?makeChangeSingleDocInEditor(e.cm,t,n):updateDoc(e,t,n),setSelectionNoUndo(e,r,D)}}function makeChangeSingleDocInEditor(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=lineNo(visualLine(getLine(n,o.line))),n.iter(l,a.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),n.sel.contains(t.from,t.to)>-1&&signalCursorActivity(e),updateDoc(n,t,r,estimateHeight(e)),e.options.lineWrapping||(n.iter(l,o.line+t.text.length,function(e){var t=lineLength(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,o.line),startWorker(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?regChange(e):o.line!=a.line||1!=t.text.length||isWholeLineUpdate(e.doc,t)?regChange(e,o.line,a.line+1,c):regLineChange(e,o.line,"text");var u=hasHandler(e,"changes"),d=hasHandler(e,"change");if(d||u){var p={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&signalLater(e,"change",e,p),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function replaceRange(e,t,r,n,i){if(n||(n=r),cmp(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),makeChange(e,{from:r,to:n,text:t,origin:i})}function rebaseHistSelSingle(e,t,r,n){r0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=eltP("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(conflictingCollapsedRange(e,t.line,t,r,o)||t.line!=r.line&&conflictingCollapsedRange(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");seeCollapsedSpans()}o.addToHistory&&addChangeToHistory(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,r.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&visualLine(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&updateLineHeight(e,0),addMarkedSpan(e,new MarkedSpan(o,l==t.line?t.ch:null,l==r.line?r.ch:null)),++l}),o.collapsed&&e.iter(t.line,r.line+1,function(t){lineIsHidden(e,t)&&updateLineHeight(t,0)}),o.clearOnEnter&&G(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(seeReadOnlySpans(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ye,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)regChange(c,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=r.line;u++)regLineChange(c,u,"text");o.atomic&&reCheckSelection(c.doc),signalLater(c,"markerAdded",c,o)}return o}function markTextShared(e,t,r,n,i){n=copyObj(n),n.shared=!1;var o=[markText(e,t,r,n,i)],a=o[0],s=n.widgetNode;return linkedDocs(e,function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(markText(e,clipPos(e,t),clipPos(e,r),n,i));for(var l=0;l-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var u=e.dataTransfer.getData("Text");if(u){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),setSelectionNoUndo(t.doc,simpleSelection(r,r)),d)for(var p=0;p=0;t--)replaceRange(e.doc,"",n[t].from,n[t].to,"+delete");ensureCursorVisible(e)})}function lineStart(e,t){var r=getLine(e.doc,t),n=visualLine(r);return n!=r&&(t=lineNo(n)),endOfLine(!0,e,n,t,1)}function lineEnd(e,t){var r=getLine(e.doc,t),n=visualLineEnd(r);return n!=r&&(t=lineNo(n)),endOfLine(!0,e,r,t,-1)}function lineStartSmart(e,t){var r=lineStart(e,t.line),n=getLine(e.doc,r.line),i=getOrder(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return Pos(r.line,a?0:o,r.sticky)}return r}function doHandleBinding(e,t,r){if("string"==typeof t&&(t=De[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=A}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function lookupKeyForEditor(e,t,r){for(var n=0;ni-400&&0==cmp(Ae.pos,r)?n="triple":Ne&&Ne.time>i-400&&0==cmp(Ne.pos,r)?(n="double",Ae={time:i,pos:r}):(n="single",Ne={time:i,pos:r});var o,s=e.doc.sel,l=y?t.metaKey:t.ctrlKey;e.options.dragDrop&&_&&!e.isReadOnly()&&"single"==n&&(o=s.contains(r))>-1&&(cmp((o=s.ranges[o]).from(),r)<0||r.xRel>0)&&(cmp(o.to(),r)>0||r.xRel<0)?leftButtonStartDrag(e,t,r,l):leftButtonSelect(e,t,r,n,l)}function leftButtonStartDrag(e,t,r,n){var i=e.display,o=!1,c=operation(e,function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,off(document,"mouseup",c),off(document,"mousemove",u),off(i.scroller,"dragstart",d),off(i.scroller,"drop",c),o||(e_preventDefault(t),n||extendSelection(e.doc,r),l||a&&9==s?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())}),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=c,c.copy=y?t.altKey:t.ctrlKey,i.scroller.dragDrop&&i.scroller.dragDrop(),G(document,"mouseup",c),G(document,"mousemove",u),G(i.scroller,"dragstart",d),G(i.scroller,"drop",c),delayBlurEvent(e),setTimeout(function(){return i.input.focus()},20)}function leftButtonSelect(e,t,r,n,i){function extendTo(t){if(0!=cmp(f,t))if(f=t,"rect"==n){for(var i=[],o=e.options.tabSize,u=countColumn(getLine(a,r.line).text,r.ch,o),d=countColumn(getLine(a,t.line).text,t.ch,o),p=Math.min(u,d),h=Math.max(u,d),g=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=m;g++){var v=getLine(a,g).text,y=findColumn(v,p,o);p==h?i.push(new he(Pos(g,y),Pos(g,y))):v.length>y&&i.push(new he(Pos(g,y),Pos(g,findColumn(v,h,o))))}i.length||i.push(new he(r,r)),setSelection(a,normalizeSelection(c.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=s,x=b.anchor,C=t;if("single"!=n){var w;w="double"==n?e.findWordAt(t):new he(Pos(t.line,0),clipPos(a,Pos(t.line+1,0))),cmp(w.anchor,x)>0?(C=w.head,x=minPos(b.from(),w.anchor)):(C=w.anchor,x=maxPos(b.to(),w.head))}var S=c.ranges.slice(0);S[l]=new he(clipPos(a,x),C),setSelection(a,normalizeSelection(S,l),H)}}function extend(t){var r=++g,i=posFromMouse(e,t,!0,"rect"==n);if(i)if(0!=cmp(i,f)){e.curOp.focus=activeElt(),extendTo(i);var s=visibleLines(o,a);(i.line>=s.to||i.lineh.bottom?20:0;l&&setTimeout(operation(e,function(){g==r&&(o.scroller.scrollTop+=l,extend(t))}),50)}}function done(t){e.state.selectingText=!1,g=1/0,e_preventDefault(t),o.input.focus(),off(document,"mousemove",m),off(document,"mouseup",v),a.history.lastSelOrigin=null}var o=e.display,a=e.doc;e_preventDefault(t);var s,l,c=a.sel,u=c.ranges;if(i&&!t.shiftKey?(l=a.sel.contains(r),s=l>-1?u[l]:new he(r,r)):(s=a.sel.primary(),l=a.sel.primIndex),b?t.shiftKey&&t.metaKey:t.altKey)n="rect",i||(s=new he(r,r)),r=posFromMouse(e,t,!0,!0),l=-1;else if("double"==n){var d=e.findWordAt(r);s=e.display.shift||a.extend?extendRange(a,s,d.anchor,d.head):d}else if("triple"==n){var p=new he(Pos(r.line,0),clipPos(a,Pos(r.line+1,0)));s=e.display.shift||a.extend?extendRange(a,s,p.anchor,p.head):p}else s=extendRange(a,s,r);i?l==-1?(l=u.length,setSelection(a,normalizeSelection(u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"single"==n&&!t.shiftKey?(setSelection(a,normalizeSelection(u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=a.sel):replaceOneSelection(a,l,s,H):(l=0,setSelection(a,new fe([s],0),H),c=a.sel);var f=r,h=o.wrapper.getBoundingClientRect(),g=0,m=operation(e,function(e){e_button(e)?extend(e):done(e)}),v=operation(e,done);e.state.selectingText=v,G(document,"mousemove",m),G(document,"mouseup",v)}function gutterEvent(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&e_preventDefault(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!hasHandler(e,r))return e_defaultPrevented(t);o-=s.top-a.viewOffset;for(var l=0;l=i){var u=lineAtHeight(e.doc,o),d=e.options.gutters[l];return signal(e,r,e,u,d,t),e_defaultPrevented(t)}}}function clickInGutter(e,t){return gutterEvent(e,t,"gutterClick",!0)}function onContextMenu(e,t){eventInWidget(e.display,t)||contextMenuInGutter(e,t)||signalDOMEvent(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function contextMenuInGutter(e,t){return!!hasHandler(e,"gutterContextMenu")&&gutterEvent(e,t,"gutterContextMenu",!1)}function themeChanged(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),clearCaches(e)}function defineOptions(e){function option(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=Ee&&i(e,t,r)}:i)}var t=e.optionHandlers;e.defineOption=option,e.Init=Ee,option("value","",function(e,t){return e.setValue(t)},!0),option("mode",null,function(e,t){e.doc.modeOption=t,loadMode(e)},!0),option("indentUnit",2,loadMode,!0),option("indentWithTabs",!1),option("smartIndent",!0),option("tabSize",4,function(e){resetModeState(e),clearCaches(e),regChange(e)},!0),option("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,r.push(Pos(n,o))}n++});for(var i=r.length-1;i>=0;i--)replaceRange(e.doc,t,r[i],Pos(r[i].line,r[i].ch+t.length))}}),option("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Ee&&e.refresh()}),option("specialCharPlaceholder",defaultSpecialCharPlaceholder,function(e){return e.refresh()},!0),option("electricChars",!0),option("inputStyle",v?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),option("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),option("rtlMoveVisually",!x),option("wholeLineUpdateBefore",!0),option("theme","default",function(e){themeChanged(e),guttersChanged(e)},!0),option("keyMap","default",function(e,t,r){var n=getKeyMap(t),i=r!=Ee&&getKeyMap(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),option("extraKeys",null),option("lineWrapping",!1,wrappingChanged,!0),option("gutters",[],function(e){setGuttersForLineNumbers(e.options),guttersChanged(e)},!0),option("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?compensateForHScroll(e.display)+"px":"0",e.refresh()},!0),option("coverGutterNextToScrollbar",!1,function(e){return updateScrollbars(e)},!0),option("scrollbarStyle","native",function(e){initScrollbars(e),updateScrollbars(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),option("lineNumbers",!1,function(e){setGuttersForLineNumbers(e.options),guttersChanged(e)},!0),option("firstLineNumber",1,guttersChanged,!0),option("lineNumberFormatter",function(e){return e},guttersChanged,!0),option("showCursorWhenSelecting",!1,updateSelection,!0),option("resetSelectionOnContextMenu",!0),option("lineWiseCopyCut",!0),option("readOnly",!1,function(e,t){"nocursor"==t?(onBlur(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),option("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),option("dragDrop",!0,dragDropChanged),option("allowDropFileTypes",null),option("cursorBlinkRate",530),option("cursorScrollMargin",0),option("cursorHeight",1,updateSelection,!0),option("singleCursorHeightPerLine",!0,updateSelection,!0),option("workTime",100),option("workDelay",100),option("flattenSpans",!0,resetModeState,!0),option("addModeClass",!1,resetModeState,!0),option("pollInterval",100),option("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),option("historyEventDelay",1250),option("viewportMargin",10,function(e){return e.refresh()},!0),option("maxHighlightLength",1e4,resetModeState,!0),option("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),option("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),option("autofocus",null),option("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}function guttersChanged(e){updateGutters(e),regChange(e),alignHorizontally(e)}function dragDropChanged(e,t,r){var n=r&&r!=Ee;if(!t!=!n){var i=e.display.dragFunctions,o=t?G:off;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function wrappingChanged(e){e.options.lineWrapping?(addClass(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(L(e.display.wrapper,"CodeMirror-wrap"),findMaxLine(e)),estimateLineHeights(e),regChange(e),clearCaches(e),setTimeout(function(){return updateScrollbars(e)},100)}function CodeMirror$1(e,t){var r=this;if(!(this instanceof CodeMirror$1))return new CodeMirror$1(e,t);this.options=t=t?copyObj(t):{},copyObj(Ie,t,!1),setGuttersForLineNumbers(t);var n=t.value;"string"==typeof n&&(n=new we(n,t.mode,null,t.lineSeparator,t.direction)),this.doc=n;var i=new CodeMirror$1.inputStyles[t.inputStyle](this),o=this.display=new Display(e,n,i);o.wrapper.CodeMirror=this,updateGutters(this),themeChanged(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),initScrollbars(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 T,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout(function(){return r.display.input.reset(!0)},20),registerEventHandlers(this),ensureGlobalHandlers(),startOperation(this),this.curOp.forceUpdate=!0,attachDoc(this,n),t.autofocus&&!v||this.hasFocus()?setTimeout(bind(onFocus,this),20):onBlur(this);for(var c in Fe)Fe.hasOwnProperty(c)&&Fe[c](r,t[c],Ee);maybeUpdateLineNumberWidth(this),t.finishInit&&t.finishInit(this);for(var u=0;u400}var t=e.display;G(t.scroller,"mousedown",operation(e,onMouseDown)),a&&s<11?G(t.scroller,"dblclick",operation(e,function(t){if(!signalDOMEvent(e,t)){var r=posFromMouse(e,t);if(r&&!clickInGutter(e,t)&&!eventInWidget(e.display,t)){e_preventDefault(t);var n=e.findWordAt(r);extendSelection(e.doc,n.anchor,n.head)}}})):G(t.scroller,"dblclick",function(t){return signalDOMEvent(e,t)||e_preventDefault(t)}),k||G(t.scroller,"contextmenu",function(t){return onContextMenu(e,t)});var r,n={end:0};G(t.scroller,"touchstart",function(i){if(!signalDOMEvent(e,i)&&!isMouseLikeTouchEvent(i)){t.input.ensurePolled(),clearTimeout(r);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),G(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),G(t.scroller,"touchend",function(r){var n=t.activeTouch;if(n&&!eventInWidget(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var i,o=e.coordsChar(t.activeTouch,"page");i=!n.prev||farAway(n,n.prev)?new he(o,o):!n.prev.prev||farAway(n,n.prev.prev)?e.findWordAt(o):new he(Pos(o.line,0),clipPos(e.doc,Pos(o.line+1,0))),e.setSelection(i.anchor,i.head),e.focus(),e_preventDefault(r)}finishTouch()}),G(t.scroller,"touchcancel",finishTouch),G(t.scroller,"scroll",function(){t.scroller.clientHeight&&(updateScrollTop(e,t.scroller.scrollTop),setScrollLeft(e,t.scroller.scrollLeft,!0),signal(e,"scroll",e))}),G(t.scroller,"mousewheel",function(t){return onScrollWheel(e,t)}),G(t.scroller,"DOMMouseScroll",function(t){return onScrollWheel(e,t)}),G(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){signalDOMEvent(e,t)||e_stop(t)},over:function(t){signalDOMEvent(e,t)||(onDragOver(e,t),e_stop(t))},start:function(t){return onDragStart(e,t)},drop:operation(e,onDrop),leave:function(t){signalDOMEvent(e,t)||clearDragCursor(e)}};var i=t.input.getField();G(i,"keyup",function(t){return onKeyUp.call(e,t)}),G(i,"keydown",operation(e,onKeyDown)),G(i,"keypress",operation(e,onKeyPress)),G(i,"focus",function(t){return onFocus(e,t)}),G(i,"blur",function(t){return onBlur(e,t)})}function indentLine(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=getStateBefore(e,t):r="prev");var a=e.options.tabSize,s=getLine(o,t),l=countColumn(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&(c=o.mode.indent(i,s.text.slice(u.length),s.text),c==A||c>150)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?countColumn(getLine(o,t-1).text,null,a):0:"add"==r?c=l+e.options.indentUnit:"subtract"==r?c=l-e.options.indentUnit:"number"==typeof r&&(c=l+r),c=Math.max(0,c);var d="",p=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)p+=a,d+="\t";if(p1)if(ze&&ze.text.join("\n")==t){if(n.ranges.length%ze.text.length==0){l=[];for(var c=0;c=0;d--){var p=n.ranges[d],f=p.from(),h=p.to();p.empty()&&(r&&r>0?f=Pos(f.line,f.ch-r):e.state.overwrite&&!a?h=Pos(h.line,Math.min(getLine(o,h.line).text.length,h.ch+lst(s).length)):ze&&ze.lineWise&&ze.text.join("\n")==t&&(f=h=Pos(f.line,0))),u=e.curOp.updateInput;var g={from:f,to:h,text:l?l[d%l.length]:s,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};makeChange(e.doc,g),signalLater(e,"inputRead",e,g)}t&&!a&&triggerElectric(e,t),ensureCursorVisible(e),e.curOp.updateInput=u,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function handlePaste(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||runInOp(t,function(){return applyTextInput(t,r,0,null,"paste")}),!0}function triggerElectric(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=indentLine(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(getLine(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=indentLine(e,i.head.line,"smart"));a&&signalLater(e,"electricInput",e,i.head.line)}}}function copyableRanges(e){for(var t=[],r=[],n=0;n=e.first+e.size)&&(t=new Pos(n,t.ch,t.sticky),s=getLine(e,n))}function moveOnce(n){var o;if(o=i?moveVisually(e.cm,s,t,r):moveLogically(s,t,r),null==o){if(n||!findNextLine())return!1;t=endOfLine(i,e.cm,s,t.line,r)}else t=o;return!0}var o=t,a=r,s=getLine(e,t.line);if("char"==n)moveOnce();else if("column"==n)moveOnce(!0);else if("word"==n||"group"==n)for(var l=null,c="group"==n,u=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(r<0)||moveOnce(!d);d=!1){var p=s.text.charAt(t.ch)||"\n",f=isWordChar(p,u)?"w":c&&"\n"==p?"n":!c||/\s/.test(p)?null:"p";if(!c||d||f||(f="s"),l&&l!=f){r<0&&(r=1,moveOnce(),t.sticky="after");break}if(f&&(l=f),r>0&&!moveOnce(!d))break}var h=skipAtomic(e,t,o,a,!0);return equalCursorPos(o,h)&&(h.hitSide=!0),h}function findPosV(e,t,r,n){var i,o=e.doc,a=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(s-.5*textHeight(e.display),3);i=(r>0?t.bottom:t.top)+r*l}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var c;c=coordsChar(e,a,i),c.outside;){if(r<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*r}return c}function posToDOM(e,t){var r=findViewForLine(e,t.line);if(!r||r.hidden)return null;var n=getLine(e.doc,t.line),i=mapFromLineView(r,n,t.line),o=getOrder(n,e.doc.direction),a="left";if(o){var s=getBidiPartAt(o,t.ch);a=s%2?"right":"left"}var l=nodeAndOffsetInLineMap(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function isInGutter(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function badPos(e,t){return t&&(e.bad=!0),e}function domTextBetween(e,t,r,n,i){function recognizeMarker(e){return function(t){return t.id==e}}function close(){a&&(o+=s,a=!1)}function addText(e){e&&(close(),o+=e)}function walk(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void addText(r||t.textContent.replace(/\u200b/g,""));var o,l=t.getAttribute("cm-marker");if(l){var c=e.findMarks(Pos(n,0),Pos(i+1,0),recognizeMarker(+l));return void(c.length&&(o=c[0].find())&&addText(getBetween(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var u=/^(pre|div|p)$/i.test(t.nodeName);u&&close();for(var d=0;d=15&&(d=!1,l=!0);var w,S=y&&(c||d&&(null==C||C<12.11)),k=r||a&&s>=9,L=function(e,t){var r=e.className,n=classTest(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};w=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var M=function(e){e.select()};g?M=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(M=function(e){try{e.select()}catch(e){}});var T=function(){this.id=null};T.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var O,P,N=30,A={toString:function(){return"CodeMirror.Pass"}},D={scroll:!1},H={origin:"*mouse"},W={origin:"+move"},E=[""],I=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,F=/[\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]/,B=!1,z=!1,R=null,V=function(){function charType(r){return r<=247?e.charAt(r):1424<=r&&r<=1524?"R":1536<=r&&r<=1785?t.charAt(r-1536):1774<=r&&r<=2220?"r":8192<=r&&r<=8203?"w":8204==r?"b":"L"}function BidiSpan(e,t,r){this.level=e,this.from=t,this.to=r}var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,i=/[LRr]/,o=/[Lb1n]/,a=/[1n]/;return function(e,t){var s="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var l=e.length,c=[],u=0;u=this.string.length},Q.prototype.sol=function(){return this.pos==this.lineStart},Q.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Q.prototype.next=function(){if(this.post},Q.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},Q.prototype.skipToEnd=function(){this.pos=this.string.length},Q.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Q.prototype.backUp=function(e){this.pos-=e},Q.prototype.column=function(){return this.lastColumnPos0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return t!==!1&&(this.pos+=e.length),!0},Q.prototype.current=function(){return this.string.slice(this.start,this.pos)},Q.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};var J=function(e,t,r){this.text=e,attachMarkedSpans(this,t),this.height=r?r(this):1};J.prototype.lineNo=function(){return lineNo(this)},eventMixin(J);var ee,te={},re={},ne=null,ie=null,oe={left:0,right:0,top:0,bottom:0},ae=function(e,t,r){this.cm=r;var n=this.vert=elt("div",[elt("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=elt("div",[elt("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),G(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),G(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ae.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},ae.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ae.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ae.prototype.zeroWidthHack=function(){var e=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new T,this.disableVert=new T},ae.prototype.enableZeroWidthBar=function(e,t,r){function maybeDisable(){var n=e.getBoundingClientRect(),i="vert"==r?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,maybeDisable)}e.style.pointerEvents="auto",t.set(1e3,maybeDisable)},ae.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var se=function(){};se.prototype.update=function(){return{bottom:0,right:0}},se.prototype.setScrollLeft=function(){},se.prototype.setScrollTop=function(){},se.prototype.clear=function(){};var le={native:ae,null:se},ce=0,ue=function(e,t,r){var n=e.display;this.viewport=t,this.visible=visibleLines(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=displayWidth(e),this.force=r,this.dims=getDimensions(e),this.events=[]};ue.prototype.signal=function(e,t){hasHandler(e,t)&&this.events.push(arguments)},ue.prototype.finish=function(){for(var e=this,t=0;t=0&&cmp(e,i.to())<=0)return n}return-1};var he=function(e,t){this.anchor=e,this.head=t};he.prototype.from=function(){return minPos(this.anchor,this.head)},he.prototype.to=function(){return maxPos(this.anchor,this.head)},he.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};var ge=function(e){var t=this;this.lines=e,this.parent=null;for(var r=0,n=0;n1||!(this.children[0]instanceof ge))){var l=[];this.collapse(l),this.children=[new ge(l)],this.children[0].parent=this}},me.prototype.collapse=function(e){for(var t=this,r=0;r50){for(var s=o.lines.length%25+25,l=s;l10);e.parent.maybeSpill()}},me.prototype.iterN=function(e,t,r){for(var n=this,i=0;it.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&®Change(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&reCheckSelection(t.doc)),t&&signalLater(t,"markerCleared",t,this,i,o),r&&endOperation(t),this.parent&&this.parent.clear()}},be.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o=0;c--)makeChange(n,i[c]);l?setSelectionReplaceHistory(this,l):this.cm&&ensureCursorVisible(this.cm)}),undo:docMethodOp(function(){makeChangeFromHistory(this,"undo")}),redo:docMethodOp(function(){makeChangeFromHistory(this,"redo")}),undoSelection:docMethodOp(function(){makeChangeFromHistory(this,"undo",!0)}),redoSelection:docMethodOp(function(){makeChangeFromHistory(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=clipPos(this,e),t=clipPos(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||r&&!r(l.marker)||n.push(l.marker.parent||l.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne?(t=e,!0):(e-=o,void++r)}),clipPos(this,Pos(r,t))},indexFromPos:function(e){e=clipPos(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.to0)i=new Pos(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Pos(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=getLine(e.doc,i.line-1).text;a&&(i=new Pos(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),Pos(i.line-1,a.length-1),i,"+transpose"))}r.push(new he(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return runInOp(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;nn&&(indentLine(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&ensureCursorVisible(t));else{var a=o.from(),s=o.to(),l=Math.max(n,a.line);n=Math.min(t.lastLine(),s.line-(s.ch?0:1))+1;for(var c=l;c0&&replaceOneSelection(t.doc,i,new he(a,u[i].to()),D)}}}),getTokenAt:function(e,t){return takeToken(this,e,t)},getLineTokens:function(e,t){return takeToken(this,Pos(e),t,!0)},getTokenTypeAt:function(e){e=clipPos(this.doc,e);var t,r=getLineStyles(this,getLine(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{
-if(!(r[2*a+1]o&&(e=o,i=!0),n=getLine(this.doc,e)}else n=e;return intoCoordSystem(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-heightAtLine(n):0)},defaultTextHeight:function(){return textHeight(this.display)},defaultCharWidth:function(){return charWidth(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=cursorCoords(this,clipPos(this.doc,e));var a=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),r&&scrollIntoView(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:methodOp(onKeyDown),triggerOnKeyPress:methodOp(onKeyPress),triggerOnKeyUp:onKeyUp,execCommand:function(e){if(De.hasOwnProperty(e))return De[e].call(null,this)},triggerElectric:methodOp(function(e){triggerElectric(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var a=clipPos(this.doc,e),s=0;s0&&s(r.charAt(n-1));)--n;for(;i.5)&&estimateLineHeights(this),signal(this,"refresh",this)}),swapDoc:methodOp(function(e){var t=this.doc;return t.cm=null,attachDoc(this,e),clearCaches(this),this.display.input.reset(),scrollToCoords(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,signalLater(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},eventMixin(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}},Ve=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new T,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ve.prototype.init=function(e){function onCopyCut(e){if(!signalDOMEvent(n,e)){if(n.somethingSelected())setLastCopied({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=copyableRanges(n);setLastCopied({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,D),n.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var o=ze.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=hiddenTextarea(),s=a.firstChild;n.display.lineSpace.insertBefore(a,n.display.lineSpace.firstChild),s.value=ze.text.join("\n");var l=document.activeElement;M(s),setTimeout(function(){n.display.lineSpace.removeChild(a),l.focus(),l==i&&r.showPrimarySelection()},50)}}var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;disableBrowserMagic(i,n.options.spellcheck),G(i,"paste",function(e){signalDOMEvent(n,e)||handlePaste(e,n)||s<=11&&setTimeout(operation(n,function(){return t.updateFromDOM()}),20)}),G(i,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),G(i,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),G(i,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),G(i,"touchstart",function(){return r.forceCompositionEnd()}),G(i,"input",function(){t.composing||t.readFromDOMSoon()}),G(i,"copy",onCopyCut),G(i,"cut",onCopyCut)},Ve.prototype.prepareSelection=function(){var e=prepareSelection(this.cm,!1);return e.focus=this.cm.state.focused,e},Ve.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ve.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line=t.display.viewFrom&&posToDOM(t,i)||{node:l[0].measure.map[2],offset:0},u=o.linee.firstLine()&&(n=Pos(n.line-1,getLine(e.doc,n.line-1).length)),i.ch==getLine(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,a,s;n.line==t.viewFrom||0==(o=findViewIndex(e,n.line))?(a=lineNo(t.view[0].line),s=t.view[0].node):(a=lineNo(t.view[o].line),s=t.view[o-1].node.nextSibling);var l,c,u=findViewIndex(e,i.line);if(u==t.view.length-1?(l=t.viewTo-1,c=t.lineDiv.lastChild):(l=lineNo(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling),!s)return!1;for(var d=e.doc.splitLines(domTextBetween(e,s,c,a,l)),p=getBetween(e.doc,Pos(a,0),Pos(l,getLine(e.doc,l).text.length));d.length>1&&p.length>1;)if(lst(d)==lst(p))d.pop(),p.pop(),l--;else{if(d[0]!=p[0])break;d.shift(),p.shift(),a++}for(var f=0,h=0,g=d[0],m=p[0],v=Math.min(g.length,m.length);fn.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)f--,h++;d[d.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var C=Pos(a,f),w=Pos(l,p.length?lst(p).length-h:0);return d.length>1||d[0]||cmp(C,w)?(replaceRange(e.doc,d,C,w,"+input"),!0):void 0},Ve.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ve.prototype.reset=function(){this.forceCompositionEnd()},Ve.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ve.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))},Ve.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||runInOp(this.cm,function(){return regChange(e.cm)})},Ve.prototype.setUneditable=function(e){e.contentEditable="false"},Ve.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||operation(this.cm,applyTextInput)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ve.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ve.prototype.onContextMenu=function(){},Ve.prototype.resetPosition=function(){},Ve.prototype.needsContentAttribute=!0;var je=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new T,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};je.prototype.init=function(e){function prepareCopyCut(e){if(!signalDOMEvent(n,e)){if(n.somethingSelected())setLastCopied({lineWise:!1,text:n.getSelections()}),r.inaccurateSelection&&(r.prevInput="",r.inaccurateSelection=!1,o.value=ze.text.join("\n"),M(o));else{if(!n.options.lineWiseCopyCut)return;var t=copyableRanges(n);setLastCopied({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,D):(r.prevInput="",o.value=t.text.join("\n"),M(o))}"cut"==e.type&&(n.state.cutIncoming=!0)}}var t=this,r=this,n=this.cm,i=this.wrapper=hiddenTextarea(),o=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),g&&(o.style.width="0px"),G(o,"input",function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),G(o,"paste",function(e){signalDOMEvent(n,e)||handlePaste(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())}),G(o,"cut",prepareCopyCut),G(o,"copy",prepareCopyCut),G(e.scroller,"paste",function(t){eventInWidget(e,t)||signalDOMEvent(n,t)||(n.state.pasteIncoming=!0,r.focus())}),G(e.lineSpace,"selectstart",function(t){eventInWidget(e,t)||e_preventDefault(t)}),G(o,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),G(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},je.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=prepareSelection(e);if(e.options.moveInputWithCursor){var i=cursorCoords(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},je.prototype.showSelection=function(e){var t=this.cm,r=t.display;removeChildrenAndAdd(r.cursorDiv,e.cursors),removeChildrenAndAdd(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},je.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=$&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var l=t?"-":r||n.getSelection();this.textarea.value=l,n.state.focused&&M(this.textarea),a&&s>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},je.prototype.getField=function(){return this.textarea},je.prototype.supportsTouch=function(){return!1},je.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||activeElt()!=this.textarea))try{this.textarea.focus()}catch(e){}},je.prototype.blur=function(){this.textarea.blur()},je.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},je.prototype.receivedFocus=function(){this.slowPoll()},je.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},je.prototype.fastPoll=function(){function p(){var r=t.poll();r||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,p))}var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,p)},je.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||K(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(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||n||(n=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(n.length,i.length);l1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},je.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},je.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},je.prototype.onContextMenu=function(e){function prepareSelectAllHack(){if(null!=i.selectionStart){var e=r.somethingSelected(),o=""+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function rehide(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=p,a&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=c),null!=i.selectionStart){(!a||a&&s<9)&&prepareSelectAllHack();var e=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?operation(r,selectAll)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}var t=this,r=t.cm,n=r.display,i=t.textarea,o=posFromMouse(r,e),c=n.scroller.scrollTop;if(o&&!d){var u=r.options.resetSelectionOnContextMenu;u&&r.doc.sel.contains(o)==-1&&operation(r,setSelection)(r.doc,simpleSelection(o),D);var p=i.style.cssText,f=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var h=t.wrapper.getBoundingClientRect();i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var g;if(l&&(g=window.scrollY),n.input.focus(),l&&window.scrollTo(null,g),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=!0,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),a&&s>=9&&prepareSelectAllHack(),k){e_stop(e);var m=function(){off(window,"mouseup",m),setTimeout(rehide,20)};G(window,"mouseup",m)}else setTimeout(rehide,50)}},je.prototype.readOnlyChanged=function(e){e||this.reset()},je.prototype.setUneditable=function(){},je.prototype.needsContentAttribute=!1,defineOptions(CodeMirror$1),Re(CodeMirror$1);var Ge="iter insert remove copy getEditor constructor".split(" ");for(var _e in we.prototype)we.prototype.hasOwnProperty(_e)&&indexOf(Ge,_e)<0&&(CodeMirror$1.prototype[_e]=function(e){return function(){return e.apply(this.doc,arguments)}}(we.prototype[_e]));return eventMixin(we),CodeMirror$1.inputStyles={textarea:je,contenteditable:Ve},CodeMirror$1.defineMode=function(e){CodeMirror$1.defaults.mode||"null"==e||(CodeMirror$1.defaults.mode=e),defineMode.apply(this,arguments)},CodeMirror$1.defineMIME=defineMIME,CodeMirror$1.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),CodeMirror$1.defineMIME("text/plain","null"),CodeMirror$1.defineExtension=function(e,t){CodeMirror$1.prototype[e]=t},CodeMirror$1.defineDocExtension=function(e,t){we.prototype[e]=t},CodeMirror$1.fromTextArea=fromTextArea,addLegacyProps(CodeMirror$1),CodeMirror$1.version="5.26.0",CodeMirror$1})},257:function(e,t,r){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(t,r){function readRegexp(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function ret(e,t,r){return n=e,i=r,t}function tokenBase(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=tokenString(r),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return ret("number","number");if("."==r&&e.match(".."))return ret("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return ret(r);if("="==r&&e.eat(">"))return ret("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),ret("number","number");if("0"==r&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),ret("number","number");if("0"==r&&e.eat(/b/i))return e.eatWhile(/[01]/i),ret("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),ret("number","number");if("/"==r)return e.eat("*")?(t.tokenize=tokenComment,tokenComment(e,t)):e.eat("/")?(e.skipToEnd(),ret("comment","comment")):expressionAllowed(e,t,1)?(readRegexp(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),ret("regexp","string-2")):(e.eatWhile(p),ret("operator","operator",e.current()));if("`"==r)return t.tokenize=tokenQuasi,tokenQuasi(e,t);if("#"==r)return e.skipToEnd(),ret("error","error");if(p.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||e.eatWhile(p),ret("operator","operator",e.current());if(u.test(r)){e.eatWhile(u);var n=e.current(),i=d.propertyIsEnumerable(n)&&d[n];return i&&"."!=t.lastType?ret(i.type,i.style,n):ret("variable","variable",n)}}function tokenString(e){return function(t,r){var n,i=!1;if(s&&"@"==t.peek()&&t.match(f))return r.tokenize=tokenBase,ret("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=tokenBase),ret("string","string")}}function tokenComment(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=tokenBase;break}n="*"==r}return ret("comment","comment")}function tokenQuasi(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=tokenBase;break}n=!n&&"\\"==r}return ret("quasi","string-2",e.current())}function findFatArrow(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(c){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var s=e.string.charAt(a),l=h.indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(u.test(s))o=!0;else{if(/["'\/]/.test(s))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}function JSLexical(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function inScope(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function parseJS(e,t,r,n,i){var o=e.cc;for(m.state=e,m.stream=i,m.marked=null,m.cc=o,m.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():l?expression:statement;if(a(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return m.marked?m.marked:"variable"==r&&inScope(e,n)?"variable-2":t}}}function pass(){for(var e=arguments.length-1;e>=0;e--)m.cc.push(arguments[e])}function cont(){return pass.apply(null,arguments),!0}function register(e){function inList(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var t=m.state;if(m.marked="def",t.context){if(inList(t.localVars))return;t.localVars={name:e,next:t.localVars}}else{if(inList(t.globalVars))return;r.globalVars&&(t.globalVars={name:e,next:t.globalVars})}}function pushcontext(){m.state.context={prev:m.state.context,vars:m.state.localVars},m.state.localVars=v}function popcontext(){m.state.localVars=m.state.context.vars,m.state.context=m.state.context.prev}function pushlex(e,t){var r=function(){var r=m.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new JSLexical(n,m.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function poplex(){var e=m.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function expect(e){function exp(t){return t==e?cont():";"==e?pass():cont(exp)}return exp}function statement(e,t){return"var"==e?cont(pushlex("vardef",t.length),vardef,expect(";"),poplex):"keyword a"==e?cont(pushlex("form"),parenExpr,statement,poplex):"keyword b"==e?cont(pushlex("form"),statement,poplex):"{"==e?cont(pushlex("}"),block,poplex):";"==e?cont():"if"==e?("else"==m.state.lexical.info&&m.state.cc[m.state.cc.length-1]==poplex&&m.state.cc.pop()(),cont(pushlex("form"),parenExpr,statement,poplex,maybeelse)):"function"==e?cont(functiondef):"for"==e?cont(pushlex("form"),forspec,statement,poplex):"variable"==e?c&&"type"==t?(m.marked="keyword",cont(typeexpr,expect("operator"),typeexpr,expect(";"))):cont(pushlex("stat"),maybelabel):"switch"==e?cont(pushlex("form"),parenExpr,expect("{"),pushlex("}","switch"),block,poplex,poplex):"case"==e?cont(expression,expect(":")):"default"==e?cont(expect(":")):"catch"==e?cont(pushlex("form"),pushcontext,expect("("),funarg,expect(")"),statement,poplex,popcontext):"class"==e?cont(pushlex("form"),className,poplex):"export"==e?cont(pushlex("stat"),afterExport,poplex):"import"==e?cont(pushlex("stat"),afterImport,poplex):"module"==e?cont(pushlex("form"),pattern,expect("{"),pushlex("}"),block,poplex,poplex):"async"==e?cont(statement):"@"==t?cont(expression,statement):pass(pushlex("stat"),expression,expect(";"),poplex)}function expression(e){return expressionInner(e,!1)}function expressionNoComma(e){return expressionInner(e,!0)}function parenExpr(e){return"("!=e?pass():cont(pushlex(")"),expression,expect(")"),poplex)}function expressionInner(e,t){if(m.state.fatArrowAt==m.stream.start){var r=t?arrowBodyNoComma:arrowBody;if("("==e)return cont(pushcontext,pushlex(")"),commasep(pattern,")"),poplex,expect("=>"),r,popcontext);if("variable"==e)return pass(pushcontext,pattern,expect("=>"),r,popcontext)}var n=t?maybeoperatorNoComma:maybeoperatorComma;return g.hasOwnProperty(e)?cont(n):"function"==e?cont(functiondef,n):"class"==e?cont(pushlex("form"),classExpression,poplex):"keyword c"==e||"async"==e?cont(t?maybeexpressionNoComma:maybeexpression):"("==e?cont(pushlex(")"),maybeexpression,expect(")"),poplex,n):"operator"==e||"spread"==e?cont(t?expressionNoComma:expression):"["==e?cont(pushlex("]"),arrayLiteral,poplex,n):"{"==e?contCommasep(objprop,"}",null,n):"quasi"==e?pass(quasi,n):"new"==e?cont(maybeTarget(t)):cont()}function maybeexpression(e){return e.match(/[;\}\)\],]/)?pass():pass(expression)}function maybeexpressionNoComma(e){return e.match(/[;\}\)\],]/)?pass():pass(expressionNoComma)}function maybeoperatorComma(e,t){
-return","==e?cont(expression):maybeoperatorNoComma(e,t,!1)}function maybeoperatorNoComma(e,t,r){var n=0==r?maybeoperatorComma:maybeoperatorNoComma,i=0==r?expression:expressionNoComma;return"=>"==e?cont(pushcontext,r?arrowBodyNoComma:arrowBody,popcontext):"operator"==e?/\+\+|--/.test(t)?cont(n):"?"==t?cont(expression,expect(":"),i):cont(i):"quasi"==e?pass(quasi,n):";"!=e?"("==e?contCommasep(expressionNoComma,")","call",n):"."==e?cont(property,n):"["==e?cont(pushlex("]"),maybeexpression,expect("]"),poplex,n):void 0:void 0}function quasi(e,t){return"quasi"!=e?pass():"${"!=t.slice(t.length-2)?cont(quasi):cont(expression,continueQuasi)}function continueQuasi(e){if("}"==e)return m.marked="string-2",m.state.tokenize=tokenQuasi,cont(quasi)}function arrowBody(e){return findFatArrow(m.stream,m.state),pass("{"==e?statement:expression)}function arrowBodyNoComma(e){return findFatArrow(m.stream,m.state),pass("{"==e?statement:expressionNoComma)}function maybeTarget(e){return function(t){return"."==t?cont(e?targetNoComma:target):pass(e?expressionNoComma:expression)}}function target(e,t){if("target"==t)return m.marked="keyword",cont(maybeoperatorComma)}function targetNoComma(e,t){if("target"==t)return m.marked="keyword",cont(maybeoperatorNoComma)}function maybelabel(e){return":"==e?cont(poplex,statement):pass(maybeoperatorComma,expect(";"),poplex)}function property(e){if("variable"==e)return m.marked="property",cont()}function objprop(e,t){return"async"==e?(m.marked="property",cont(objprop)):"variable"==e||"keyword"==m.style?(m.marked="property",cont("get"==t||"set"==t?getterSetter:afterprop)):"number"==e||"string"==e?(m.marked=s?"property":m.style+" property",cont(afterprop)):"jsonld-keyword"==e?cont(afterprop):"modifier"==e?cont(objprop):"["==e?cont(expression,expect("]"),afterprop):"spread"==e?cont(expression):":"==e?pass(afterprop):void 0}function getterSetter(e){return"variable"!=e?pass(afterprop):(m.marked="property",cont(functiondef))}function afterprop(e){return":"==e?cont(expressionNoComma):"("==e?pass(functiondef):void 0}function commasep(e,t,r){function proceed(n,i){if(r?r.indexOf(n)>-1:","==n){var o=m.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),cont(function(r,n){return r==t||n==t?pass():pass(e)},proceed)}return n==t||i==t?cont():cont(expect(t))}return function(r,n){return r==t||n==t?cont():pass(e,proceed)}}function contCommasep(e,t,r){for(var n=3;n"==e)return cont(typeexpr)}function typeprop(e,t){return"variable"==e||"keyword"==m.style?(m.marked="property",cont(typeprop)):"?"==t?cont(typeprop):":"==e?cont(typeexpr):"["==e?cont(expression,maybetype,expect("]"),typeprop):void 0}function typearg(e){return"variable"==e?cont(typearg):":"==e?cont(typeexpr):void 0}function afterType(e,t){return"<"==t?cont(pushlex(">"),commasep(typeexpr,">"),poplex,afterType):"|"==t||"."==e?cont(typeexpr):"["==e?cont(expect("]"),afterType):"extends"==t?cont(typeexpr):void 0}function vardef(){return pass(pattern,maybetype,maybeAssign,vardefCont)}function pattern(e,t){return"modifier"==e?cont(pattern):"variable"==e?(register(t),cont()):"spread"==e?cont(pattern):"["==e?contCommasep(pattern,"]"):"{"==e?contCommasep(proppattern,"}"):void 0}function proppattern(e,t){return"variable"!=e||m.stream.match(/^\s*:/,!1)?("variable"==e&&(m.marked="property"),"spread"==e?cont(pattern):"}"==e?pass():cont(expect(":"),pattern,maybeAssign)):(register(t),cont(maybeAssign))}function maybeAssign(e,t){if("="==t)return cont(expressionNoComma)}function vardefCont(e){if(","==e)return cont(vardef)}function maybeelse(e,t){if("keyword b"==e&&"else"==t)return cont(pushlex("form","else"),statement,poplex)}function forspec(e){if("("==e)return cont(pushlex(")"),forspec1,expect(")"),poplex)}function forspec1(e){return"var"==e?cont(vardef,expect(";"),forspec2):";"==e?cont(forspec2):"variable"==e?cont(formaybeinof):pass(expression,expect(";"),forspec2)}function formaybeinof(e,t){return"in"==t||"of"==t?(m.marked="keyword",cont(expression)):cont(maybeoperatorComma,forspec2)}function forspec2(e,t){return";"==e?cont(forspec3):"in"==t||"of"==t?(m.marked="keyword",cont(expression)):pass(expression,expect(";"),forspec3)}function forspec3(e){")"!=e&&cont(expression)}function functiondef(e,t){return"*"==t?(m.marked="keyword",cont(functiondef)):"variable"==e?(register(t),cont(functiondef)):"("==e?cont(pushcontext,pushlex(")"),commasep(funarg,")"),poplex,maybetype,statement,popcontext):c&&"<"==t?cont(pushlex(">"),commasep(typeexpr,">"),poplex,functiondef):void 0}function funarg(e){return"spread"==e?cont(funarg):pass(pattern,maybetype,maybeAssign)}function classExpression(e,t){return"variable"==e?className(e,t):classNameAfter(e,t)}function className(e,t){if("variable"==e)return register(t),cont(classNameAfter)}function classNameAfter(e,t){return"<"==t?cont(pushlex(">"),commasep(typeexpr,">"),poplex,classNameAfter):"extends"==t||"implements"==t||c&&","==e?cont(c?typeexpr:expression,classNameAfter):"{"==e?cont(pushlex("}"),classBody,poplex):void 0}function classBody(e,t){return"variable"==e||"keyword"==m.style?("async"==t||"static"==t||"get"==t||"set"==t||c&&("public"==t||"private"==t||"protected"==t||"readonly"==t||"abstract"==t))&&m.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(m.marked="keyword",cont(classBody)):(m.marked="property",cont(c?classfield:functiondef,classBody)):"["==e?cont(expression,expect("]"),c?classfield:functiondef,classBody):"*"==t?(m.marked="keyword",cont(classBody)):";"==e?cont(classBody):"}"==e?cont():"@"==t?cont(expression,classBody):void 0}function classfield(e,t){return"?"==t?cont(classfield):":"==e?cont(typeexpr,maybeAssign):"="==t?cont(expressionNoComma):pass(functiondef)}function afterExport(e,t){return"*"==t?(m.marked="keyword",cont(maybeFrom,expect(";"))):"default"==t?(m.marked="keyword",cont(expression,expect(";"))):"{"==e?cont(commasep(exportField,"}"),maybeFrom,expect(";")):pass(statement)}function exportField(e,t){return"as"==t?(m.marked="keyword",cont(expect("variable"))):"variable"==e?pass(expressionNoComma,exportField):void 0}function afterImport(e){return"string"==e?cont():pass(importSpec,maybeMoreImports,maybeFrom)}function importSpec(e,t){return"{"==e?contCommasep(importSpec,"}"):("variable"==e&®ister(t),"*"==t&&(m.marked="keyword"),cont(maybeAs))}function maybeMoreImports(e){if(","==e)return cont(importSpec,maybeMoreImports)}function maybeAs(e,t){if("as"==t)return m.marked="keyword",cont(importSpec)}function maybeFrom(e,t){if("from"==t)return m.marked="keyword",cont(expression)}function arrayLiteral(e){return"]"==e?cont():pass(commasep(expressionNoComma,"]"))}function isContinuedStatement(e,t){return"operator"==e.lastType||","==e.lastType||p.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var n,i,o=t.indentUnit,a=r.statementIndent,s=r.jsonld,l=r.json||s,c=r.typescript,u=r.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function kw(e){return{type:e,style:"keyword"}}var e=kw("keyword a"),t=kw("keyword b"),r=kw("keyword c"),n=kw("operator"),i={type:"atom",style:"atom"},o={if:kw("if"),while:e,with:e,else:t,do:t,try:t,finally:t,return:r,break:r,continue:r,new:kw("new"),delete:r,throw:r,debugger:r,var:kw("var"),const:kw("var"),let:kw("var"),function:kw("function"),catch:kw("catch"),for:kw("for"),switch:kw("switch"),case:kw("case"),default:kw("default"),in:n,typeof:n,instanceof:n,true:i,false:i,null:i,undefined:i,NaN:i,Infinity:i,this:kw("this"),class:kw("class"),super:kw("atom"),yield:r,export:kw("export"),import:kw("import"),extends:r,await:r,async:kw("async")};if(c){var a={type:"variable",style:"variable-3"},s={interface:kw("class"),implements:r,namespace:r,module:kw("module"),enum:kw("module"),public:kw("modifier"),private:kw("modifier"),protected:kw("modifier"),abstract:kw("modifier"),as:n,string:a,number:a,boolean:a,any:a};for(var l in s)o[l]=s[l]}return o}(),p=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,h="([{}])",g={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},m={state:null,column:null,marked:null,cc:null},v={name:"this",next:{name:"arguments"}};return poplex.lex=!0,{startState:function(e){var t={tokenize:tokenBase,lastType:"sof",cc:[],lexical:new JSLexical((e||0)-o,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),findFatArrow(e,t)),t.tokenize!=tokenComment&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",parseJS(t,r,n,i,e))},indent:function(t,n){if(t.tokenize==tokenComment)return e.Pass;if(t.tokenize!=tokenBase)return 0;var i,s=n&&n.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(n))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==poplex)l=l.prev;else if(u!=maybeelse)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(i=t.cc[t.cc.length-1])&&(i==maybeoperatorComma||i==maybeoperatorNoComma)&&!/^[,\.=+\-*:?[\(]/.test(n));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,p=s==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info+1:0):"form"==d&&"{"==s?l.indented:"form"==d?l.indented+o:"stat"==d?l.indented+(isContinuedStatement(t,n)?a||o:0):"switch"!=l.info||p||0==r.doubleIndentSwitch?l.align?l.column+(p?0:1):l.indented+(p?0:o):l.indented+(/^(?:case|default)\b/.test(n)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:expressionAllowed,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=expression&&t!=expressionNoComma||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},334:function(e,t,r){!function(e){e(r(85),r(335),r(333))}(function(e){"use strict";function Context(e,t,r,n){this.state=e,this.mode=t,this.depth=r,this.prev=n}function copyContext(t){return new Context(e.copyState(t.mode,t.state),t.mode,t.depth,t.prev&©Context(t.prev))}e.defineMode("jsx",function(t,r){function flatXMLIndent(e){var t=e.tagName;e.tagName=null;var r=n.indent(e,"");return e.tagName=t,r}function token(e,t){return t.context.mode==n?xmlToken(e,t,t.context):jsToken(e,t,t.context)}function xmlToken(r,o,a){if(2==a.depth)return r.match(/^.*?\*\//)?a.depth=1:r.skipToEnd(),"comment";if("{"==r.peek()){n.skipAttribute(a.state);var s=flatXMLIndent(a.state),l=a.state.context;if(l&&r.match(/^[^>]*>\s*$/,!1)){for(;l.prev&&!l.startOfLine;)l=l.prev;l.startOfLine?s-=t.indentUnit:a.prev.state.lexical&&(s=a.prev.state.lexical.indented)}else 1==a.depth&&(s+=t.indentUnit);return o.context=new Context(e.startState(i,s),i,0,o.context),null}if(1==a.depth){if("<"==r.peek())return n.skipAttribute(a.state),o.context=new Context(e.startState(n,flatXMLIndent(a.state)),n,0,o.context),null;if(r.match("//"))return r.skipToEnd(),"comment";if(r.match("/*"))return a.depth=2,token(r,o)}var c,u=n.token(r,a.state),d=r.current();return/\btag\b/.test(u)?/>$/.test(d)?a.state.context?a.depth=0:o.context=o.context.prev:/^-1&&r.backUp(d.length-c),u}function jsToken(t,r,o){if("<"==t.peek()&&i.expressionAllowed(t,o.state))return i.skipExpression(o.state),r.context=new Context(e.startState(n,i.indent(o.state,"")),n,0,r.context),null;var a=i.token(t,o.state);if(!a&&null!=o.depth){var s=t.current();"{"==s?o.depth++:"}"==s&&0==--o.depth&&(r.context=r.context.prev)}return a}var n=e.getMode(t,{name:"xml",allowMissing:!0,multilineTagIndentPastTag:!1}),i=e.getMode(t,r&&r.base||"javascript");return{startState:function(){return{context:new Context(e.startState(i),i)}},copyState:function(e){return{context:copyContext(e.context)}},token:token,indent:function(e,t,r){return e.context.mode.indent(e.context.state,t,r)},innerMode:function(e){return e.context}}},"xml","javascript"),e.defineMIME("text/jsx","jsx"),e.defineMIME("text/typescript-jsx",{name:"jsx",base:{name:"javascript",typescript:!0}})})},335:function(e,t,r){!function(e){e(r(85))}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(n,i){function inText(e,t){function chain(r){return t.tokenize=r,r(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?chain(inBlock("atom","]]>")):null:e.match("--")?chain(inBlock("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),chain(doctype(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=inBlock("meta","?>"),"meta"):(c=e.eat("/")?"closeTag":"openTag",t.tokenize=inTag,"tag bracket");if("&"==r){var n;return n=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),n?"atom":"error"}return e.eatWhile(/[^&<]/),null}function inTag(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=inText,c=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return c="equals",null;if("<"==r){t.tokenize=inText,t.state=baseState,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=inAttribute(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function inAttribute(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=inTag;break}return"string"};return t.isInAttribute=!0,t}function inBlock(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=inText;break}r.next()}return e}}function doctype(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=doctype(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=inText;break}return r.tokenize=doctype(e-1),r.tokenize(t,r)}}return"meta"}}function Context(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(a.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function popContext(e){e.context&&(e.context=e.context.prev)}function maybePopContext(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!a.contextGrabbers.hasOwnProperty(r)||!a.contextGrabbers[r].hasOwnProperty(t))return;popContext(e)}}function baseState(e,t,r){return"openTag"==e?(r.tagStart=t.column(),tagNameState):"closeTag"==e?closeTagNameState:baseState}function tagNameState(e,t,r){return"word"==e?(r.tagName=t.current(),u="tag",attrState):(u="error",tagNameState)}function closeTagNameState(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&a.implicitlyClosed.hasOwnProperty(r.context.tagName)&&popContext(r),r.context&&r.context.tagName==n||a.matchClosing===!1?(u="tag",closeState):(u="tag error",closeStateErr)}return u="error",closeStateErr}function closeState(e,t,r){return"endTag"!=e?(u="error",closeState):(popContext(r),baseState)}function closeStateErr(e,t,r){return u="error",closeState(e,t,r)}function attrState(e,t,r){if("word"==e)return u="attribute",attrEqState;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||a.autoSelfClosers.hasOwnProperty(n)?maybePopContext(r,n):(maybePopContext(r,n),r.context=new Context(r,n,i==r.indented)),baseState}return u="error",attrState}function attrEqState(e,t,r){return"equals"==e?attrValueState:(a.allowMissing||(u="error"),attrState(e,t,r))}function attrValueState(e,t,r){return"string"==e?attrContinuedState:"word"==e&&a.allowUnquoted?(u="string",attrState):(u="error",attrState(e,t,r))}function attrContinuedState(e,t,r){return"string"==e?attrContinuedState:attrState(e,t,r)}var o=n.indentUnit,a={},s=i.htmlMode?t:r;for(var l in s)a[l]=s[l];for(var l in i)a[l]=i[l];var c,u;return inText.isInText=!0,{startState:function(e){var t={tokenize:inText,state:baseState,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;c=null;var r=t.tokenize(e,t);return(r||c)&&"comment"!=r&&(u=null,t.state=t.state(c||r,e,t),u&&(r="error"==u?r+" error":u)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+o;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=inTag&&t.tokenize!=inText)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return a.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+o*(a.multilineTagIndentFactor||1);if(a.alignCDATA&&/$/,blockCommentStart:"",configuration:a.htmlMode?"html":"xml",helperType:a.htmlMode?"html":"xml",skipAttribute:function(e){e.state==attrValueState&&(e.state=attrState)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},646:function(e,t,r){"use strict";function normalizeLineEndings(e){return e?e.replace(/\r\n|\r/g,"\n"):e}var n=r(1),i=r(102),o=i.findDOMNode,a=r(53),s=r(213),l=n.createClass({displayName:"CodeMirror",propTypes:{className:n.PropTypes.any,codeMirrorInstance:n.PropTypes.func,defaultValue:n.PropTypes.string,onChange:n.PropTypes.func,onFocusChange:n.PropTypes.func,onScroll:n.PropTypes.func,options:n.PropTypes.object,path:n.PropTypes.string,value:n.PropTypes.string,preserveScrollPosition:n.PropTypes.bool},getDefaultProps:function getDefaultProps(){return{preserveScrollPosition:!1}},getCodeMirrorInstance:function getCodeMirrorInstance(){return this.props.codeMirrorInstance||r(85)},getInitialState:function getInitialState(){return{isFocused:!1}},componentWillMount:function componentWillMount(){this.componentWillReceiveProps=s(this.componentWillReceiveProps,0)},componentDidMount:function componentDidMount(){var e=o(this.refs.textarea),t=this.getCodeMirrorInstance();this.codeMirror=t.fromTextArea(e,this.props.options),this.codeMirror.on("change",this.codemirrorValueChanged),this.codeMirror.on("focus",this.focusChanged.bind(this,!0)),this.codeMirror.on("blur",this.focusChanged.bind(this,!1)),this.codeMirror.on("scroll",this.scrollChanged),this.codeMirror.setValue(this.props.defaultValue||this.props.value||"")},componentWillUnmount:function componentWillUnmount(){this.codeMirror&&this.codeMirror.toTextArea()},componentWillReceiveProps:function componentWillReceiveProps(e){if(this.codeMirror&&void 0!==e.value&&normalizeLineEndings(this.codeMirror.getValue())!==normalizeLineEndings(e.value))if(this.props.preserveScrollPosition){var t=this.codeMirror.getScrollInfo();this.codeMirror.setValue(e.value),this.codeMirror.scrollTo(t.left,t.top)}else this.codeMirror.setValue(e.value);if("object"==typeof e.options)for(var r in e.options)e.options.hasOwnProperty(r)&&this.codeMirror.setOption(r,e.options[r])},getCodeMirror:function getCodeMirror(){return this.codeMirror},focus:function focus(){this.codeMirror&&this.codeMirror.focus()},focusChanged:function focusChanged(e){this.setState({isFocused:e}),this.props.onFocusChange&&this.props.onFocusChange(e)},scrollChanged:function scrollChanged(e){this.props.onScroll&&this.props.onScroll(e.getScrollInfo())},codemirrorValueChanged:function codemirrorValueChanged(e,t){this.props.onChange&&"setValue"!==t.origin&&this.props.onChange(e.getValue(),t)},render:function render(){var e=a("ReactCodeMirror",this.state.isFocused?"ReactCodeMirror--focused":null,this.props.className);return n.createElement("div",{className:e},n.createElement("textarea",{ref:"textarea",name:this.props.path,defaultValue:this.props.value,autoComplete:"off"}))}});e.exports=l},761:function(e,t,r){t=e.exports=r(168)(void 0),t.push([e.id,'.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}',""])},762:function(e,t,r){t=e.exports=r(168)(void 0),t.push([e.id,".cm-s-base16-light.CodeMirror{background:#f5f5f5;color:#202020}.cm-s-base16-light div.CodeMirror-selected{background:#e0e0e0}.cm-s-base16-light .CodeMirror-line::selection,.cm-s-base16-light .CodeMirror-line>span::selection,.cm-s-base16-light .CodeMirror-line>span>span::selection{background:#e0e0e0}.cm-s-base16-light .CodeMirror-line::-moz-selection,.cm-s-base16-light .CodeMirror-line>span::-moz-selection,.cm-s-base16-light .CodeMirror-line>span>span::-moz-selection{background:#e0e0e0}.cm-s-base16-light .CodeMirror-gutters{background:#f5f5f5;border-right:0}.cm-s-base16-light .CodeMirror-guttermarker{color:#ac4142}.cm-s-base16-light .CodeMirror-guttermarker-subtle,.cm-s-base16-light .CodeMirror-linenumber{color:#b0b0b0}.cm-s-base16-light .CodeMirror-cursor{border-left:1px solid #505050}.cm-s-base16-light span.cm-comment{color:#8f5536}.cm-s-base16-light span.cm-atom,.cm-s-base16-light span.cm-number{color:#aa759f}.cm-s-base16-light span.cm-attribute,.cm-s-base16-light span.cm-property{color:#90a959}.cm-s-base16-light span.cm-keyword{color:#ac4142}.cm-s-base16-light span.cm-string{color:#f4bf75}.cm-s-base16-light span.cm-variable{color:#90a959}.cm-s-base16-light span.cm-variable-2{color:#6a9fb5}.cm-s-base16-light span.cm-def{color:#d28445}.cm-s-base16-light span.cm-bracket{color:#202020}.cm-s-base16-light span.cm-tag{color:#ac4142}.cm-s-base16-light span.cm-link{color:#aa759f}.cm-s-base16-light span.cm-error{background:#ac4142;color:#505050}.cm-s-base16-light .CodeMirror-activeline-background{background:#dddcdc}.cm-s-base16-light .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}",""])},828:function(e,t,r){var n=r(761);"string"==typeof n&&(n=[[e.id,n,""]]);r(2)(n,{});n.locals&&(e.exports=n.locals)},829:function(e,t,r){var n=r(762);"string"==typeof n&&(n=[[e.id,n,""]]);r(2)(n,{});n.locals&&(e.exports=n.locals)}});
\ No newline at end of file
diff --git a/arui-demo/styleguide/build/1.84780463.js b/arui-demo/styleguide/build/1.84780463.js
new file mode 100644
index 0000000000..8f4b7f2c5f
--- /dev/null
+++ b/arui-demo/styleguide/build/1.84780463.js
@@ -0,0 +1,7 @@
+webpackJsonp([1],{58:function(e,t,r){!function(t,r){e.exports=r()}(this,function(){"use strict";function classTest(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function removeChildren(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function removeChildrenAndAdd(e,t){return removeChildren(e).appendChild(t)}function elt(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}function indexOf(e,t){for(var r=0;r=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function spaceStr(e){for(;E.length<=e;)E.push(lst(E)+" ");return E[e]}function lst(e){return e[e.length-1]}function map(e,t){for(var r=[],n=0;n""&&(e.toUpperCase()!=e.toLowerCase()||I.test(e))}function isWordChar(e,t){return t?!!(t.source.indexOf("\\w")>-1&&isWordCharBasic(e))||t.test(e):isWordCharBasic(e)}function isEmpty(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function isExtendingChar(e){return e.charCodeAt(0)>=768&&F.test(e)}function skipExtendingChars(e,t,r){for(;(r<0?t>0:t=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t=e.first&&tr?Pos(r,getLine(e,r).text.length):clipToLen(t,getLine(e,t.line).text.length)}function clipToLen(e,t){var r=e.ch;return null==r||r>t?Pos(e.line,t):r<0?Pos(e.line,0):e}function clipPosArray(e,t){for(var r=[],n=0;n=t:o.to>t);(n||(n=[])).push(new MarkedSpan(a,o.from,s?null:o.to))}}return n}function markedSpansAfter(e,t,r){var n;if(e)for(var i=0;i=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&l)for(var x=0;x0)){var u=[s,1],d=cmp(c.from,l.from),p=cmp(c.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:l.from}),(p>0||!a.inclusiveRight&&!p)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}function detachMarkedSpans(e){var t=e.markedSpans;if(t){for(var r=0;r=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?cmp(c.to,r)>=0:cmp(c.to,r)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?cmp(c.from,n)<=0:cmp(c.from,n)<0)))return!0}}}function visualLine(e){for(var t;t=collapsedSpanAtStart(e);)e=t.find(-1,!0).line;return e}function visualLineEnd(e){for(var t;t=collapsedSpanAtEnd(e);)e=t.find(1,!0).line;return e}function visualLineContinued(e){for(var t,r;t=collapsedSpanAtEnd(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function visualLineNo(e,t){var r=getLine(e,t),n=visualLine(r);return r==n?t:lineNo(n)}function visualLineEndNo(e,t){if(t>e.lastLine())return t;var r,n=getLine(e,t);if(!lineIsHidden(e,n))return t;for(;r=collapsedSpanAtEnd(n);)n=r.find(1,!0).line;return lineNo(n)+1}function lineIsHidden(e,t){var r=z&&t.markedSpans;if(r)for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function iterateBidiSections(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;ot||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function getBidiPartAt(e,t,r){var n;R=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:R=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:R=i)}return null!=n?n:R}function getOrder(e,t){var r=e.order;return null==r&&(r=e.order=V(e.text,t)),r}function moveCharLogically(e,t,r){var n=skipExtendingChars(e.text,t+r,r);return n<0||n>e.text.length?null:n}function moveLogically(e,t,r){var n=moveCharLogically(e,t.ch,r);return null==n?null:new Pos(t.line,n,r<0?"after":"before")}function endOfLine(e,t,r,n,i){if(e){var o=getOrder(r,t.doc.direction);if(o){var a,l=i<0?lst(o):o[0],s=i<0==(1==l.level),c=s?"after":"before";if(l.level>0){var u=prepareMeasureForLine(t,r);a=i<0?r.text.length-1:0;var d=measureCharPrepared(t,u,a).top;a=findFirst(function(e){return measureCharPrepared(t,u,e).top==d},i<0==(1==l.level)?l.from:l.to-1,a),"before"==c&&(a=moveCharLogically(r,a,1,!0))}else a=i<0?l.to:l.from;return new Pos(n,a,c)}}return new Pos(n,i<0?r.text.length:0,i<0?"before":"after")}function moveVisually(e,t,r,n){var i=getOrder(t,e.doc.direction);if(!i)return moveLogically(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=getBidiPartAt(i,r.ch,r.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from=a.from&&p>=u.begin)){var f=d?"before":"after";return new Pos(r.line,p,f)}}var h=function(e,t,n){for(var o=function(e,t){return t?new Pos(r.line,s(e,1),"before"):new Pos(r.line,e,"after")};e>=0&&e0==(1!=a.level),c=l?n.begin:s(n.end,-1);if(a.from<=c&&c0?u.end:s(u.begin,-1);return null==m||n>0&&m==t.text.length||!(g=h(n>0?0:i.length-1,n,c(m)))?null:g}function getHandlers(e,t){return e._handlers&&e._handlers[t]||j}function off(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=indexOf(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function signal(e,t){var r=getHandlers(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function eventMixin(e){e.prototype.on=function(e,t){G(this,e,t)},e.prototype.off=function(e,t){off(this,e,t)}}function e_preventDefault(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function e_stopPropagation(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function e_defaultPrevented(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function e_stop(e){e_preventDefault(e),e_stopPropagation(e)}function e_target(e){return e.target||e.srcElement}function e_button(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}function zeroWidthElement(e){if(null==P){var t=elt("span","");removeChildrenAndAdd(e,elt("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(P=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&l<8))}var r=P?elt("span",""):elt("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function hasBadBidiRects(e){if(null!=O)return O;var t=removeChildrenAndAdd(e,document.createTextNode("AخA")),r=w(t,0,1).getBoundingClientRect(),n=w(t,1,2).getBoundingClientRect();return removeChildren(e),!(!r||r.left==r.right)&&(O=n.right-r.right<3)}function hasBadZoomedRects(e){if(null!=q)return q;var t=removeChildrenAndAdd(e,elt("span","x")),r=t.getBoundingClientRect(),n=w(t,0,1).getBoundingClientRect();return q=Math.abs(r.left-n.left)>1}function defineMode(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),X[e]=t}function defineMIME(e,t){Y[e]=t}function resolveMode(e){if("string"==typeof e&&Y.hasOwnProperty(e))e=Y[e];else if(e&&"string"==typeof e.name&&Y.hasOwnProperty(e.name)){var t=Y[e.name];"string"==typeof t&&(t={name:t}),e=createObj(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return resolveMode("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return resolveMode("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function getMode(e,t){t=resolveMode(t);var r=X[t.name];if(!r)return getMode(e,"text/plain");var n=r(e,t);if(Z.hasOwnProperty(t.name)){var i=Z[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}function extendMode(e,t){var r=Z.hasOwnProperty(e)?Z[e]:Z[e]={};copyObj(t,r)}function copyState(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function innerMode(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),r&&r.mode!=e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function startState(e,t,r){return!e.startState||e.startState(t,r)}function highlightLine(e,t,r,n){var i=[e.state.modeGen],o={};runMode(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var a=function(r){var n=e.state.overlays[r],a=1,l=0;runMode(e,t.text,n.mode,!0,function(e,t){for(var r=a;le&&i.splice(a,1,e,i[a+1],o),a+=2,l=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;re.options.maxHighlightLength?copyState(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function getStateBefore(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=findStartLine(e,t,r),a=o>n.first&&getLine(n,o-1).stateAfter;return a=a?copyState(n.mode,a):startState(n.mode),n.iter(o,t,function(r){processLine(e,r.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&ot.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function takeToken(e,t,r,n){var i,o=function(e){return{start:d.start,end:d.pos,string:d.current(),type:i||null,state:e?copyState(a.mode,u):u}},a=e.doc,l=a.mode;t=clipPos(a,t);var s,c=getLine(a,t.line),u=getStateBefore(e,t.line,r),d=new Q(c.text,e.options.tabSize);for(n&&(s=[]);(n||d.pose.options.maxHighlightLength?(l=!1,a&&processLine(e,t,n,d.pos),d.pos=t.length,s=null):s=extractLineClasses(readToken(r,d,n,p),o),p){var f=p[0].name;f&&(s="m-"+(s?f+" "+s:f))}if(!l||u!=s){for(;ca;--l){if(l<=o.first)return o.first;var s=getLine(o,l-1);if(s.stateAfter&&(!r||l<=o.frontier))return l;var c=countColumn(s.text,null,e.options.tabSize);(null==i||n>c)&&(i=l-1,n=c)}return i}function updateLine(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),detachMarkedSpans(e),attachMarkedSpans(e,r);var i=n?n(e):1;i!=e.height&&updateLineHeight(e,i)}function cleanUpLine(e){e.parent=null,detachMarkedSpans(e)}function interpretTokenStyle(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?re:te;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function buildLineContent(e,t){var r=eltP("span",null,null,s?"padding-right: .1px":null),n={pre:eltP("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(a||s)&&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,l=void 0;n.pos=0,n.addToken=buildToken,hasBadBidiRects(e.display.measure)&&(l=getOrder(o,e.doc.direction))&&(n.addToken=buildTokenBadBidi(n.addToken,l)),n.map=[];var c=t!=e.display.externalMeasured&&lineNo(o);insertLineContent(o,n,getLineStyles(e,o,c)),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=joinClasses(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=joinClasses(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(zeroWidthElement(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var u=n.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return signal(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=joinClasses(n.pre.className,n.textClass||"")),n}function defaultSpecialCharPlaceholder(e){var t=elt("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function buildToken(e,t,r,n,i,o,s){if(t){var c,u=e.splitSpaces?splitSpaces(t,e.trailingSpace):t,d=e.cm.state.specialChars,p=!1;if(d.test(t)){c=document.createDocumentFragment();for(var f=0;;){d.lastIndex=f;var h=d.exec(t),g=h?h.index-f:t.length-f;if(g){var m=document.createTextNode(u.slice(f,f+g));a&&l<9?c.appendChild(elt("span",[m])):c.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!h)break;f+=g+1;var v=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;v=c.appendChild(elt("span",spaceStr(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?(v=c.appendChild(elt("span","\r"==h[0]?"␍":"","cm-invalidchar")),v.setAttribute("cm-text",h[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(h[0]),v.setAttribute("cm-text",h[0]),a&&l<9?c.appendChild(elt("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&l<9&&(p=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||n||i||p||s){var x=r||"";n&&(x+=n),i&&(x+=i);var C=elt("span",[c],x,s);return o&&(C.title=o),e.content.appendChild(C)}e.content.appendChild(c)}}function splitSpaces(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;ic&&d.from<=c));p++);if(d.to>=u)return e(r,n,i,o,a,l,s);e(r,n.slice(0,d.to-c),i,o,null,l,s),o=null,n=n.slice(d.to-c),c=d.to}}}function buildCollapsedSpan(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function insertLineContent(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,p,f=i.length,h=0,g=1,m="",v=0;;){if(v==h){s=c=u=d=l="",p=null,v=1/0;for(var y=[],b=void 0,x=0;xh||w.collapsed&&C.to==h&&C.from==h)?(null!=C.to&&C.to!=h&&v>C.to&&(v=C.to,c=""),w.className&&(s+=" "+w.className),w.css&&(l=(l?l+";":"")+w.css),w.startStyle&&C.from==h&&(u+=" "+w.startStyle),w.endStyle&&C.to==v&&(b||(b=[])).push(w.endStyle,C.to),w.title&&!d&&(d=w.title),w.collapsed&&(!p||compareCollapsedMarkers(p.marker,w)<0)&&(p=C)):C.from>h&&v>C.from&&(v=C.from)}if(b)for(var S=0;S=f)break;for(var L=Math.min(f,v);;){if(m){var M=h+m.length;if(!p){var T=M>L?m.slice(0,L-h):m;t.addToken(t,T,a?a+s:s,u,h+T.length==v?c:"",d,l)}if(M>=L){m=m.slice(L-h),h=L;break}h=M,u=""}m=i.slice(o,o=r[g++]),a=interpretTokenStyle(r[g++],t.cm.options)}}else for(var P=1;P2&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}function mapFromLineView(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function updateExternalMeasurement(e,t){t=visualLine(t);var r=lineNo(t),n=e.display.externalMeasured=new LineView(e.doc,t,r);n.lineN=r;var i=n.built=buildLineContent(e,n);return n.text=i.pre,removeChildrenAndAdd(e.display.lineMeasure,i.pre),n}function measureChar(e,t,r,n){return measureCharPrepared(e,prepareMeasureForLine(e,t),r,n)}function findViewForLine(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(o=s-l,i=o-1,t>=s&&(a="right")),null!=i){if(n=e[c+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[(c-=3)+2],a="left";if("right"==r&&i==s-l)for(;c=0&&(r=e[i]).left==r.right;i--);return r}function measureCharInner(e,t,r,n){var i,o=nodeAndOffsetInLineMap(t.map,r,n),s=o.node,c=o.start,u=o.end,d=o.collapse;if(3==s.nodeType){for(var p=0;p<4;p++){for(;c&&isExtendingChar(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u0&&(d=n="right");var f;i=e.options.lineWrapping&&(f=s.getClientRects()).length>1?f["right"==n?f.length-1:0]:s.getBoundingClientRect()}if(a&&l<9&&!c&&(!i||!i.left&&!i.right)){var h=s.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+charWidth(e.display),top:h.top,bottom:h.bottom}:oe}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=n.text.length?(l=n.text.length,s="before"):l<=0&&(l=0,s="after"),!a)return get("before"==s?l-1:l,"before"==s);var c=getBidiPartAt(a,l,s),u=R,d=getBidi(l,c,"before"==s);return null!=u&&(d.other=getBidi(l,u,"before"!=s)),d}function estimateCoords(e,t){var r=0;t=clipPos(e.doc,t),e.options.lineWrapping||(r=charWidth(e.display)*t.ch);var n=getLine(e.doc,t.line),i=heightAtLine(n)+paddingTop(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function PosWithInfo(e,t,r,n,i){var o=Pos(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function coordsChar(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return PosWithInfo(n.first,0,null,!0,-1);var i=lineAtHeight(n,r),o=n.first+n.size-1;if(i>o)return PosWithInfo(n.first+n.size-1,getLine(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=getLine(n,i);;){var l=coordsCharInner(e,a,i,t,r),s=collapsedSpanAtEnd(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=lineNo(a=c.to.line)}}function wrappedLineExtent(e,t,r,n){var i=function(n){return intoCoordSystem(e,t,measureCharPrepared(e,r,n),"line")},o=t.text.length,a=findFirst(function(e){return i(e-1).bottom<=n},o,0);return o=findFirst(function(e){return i(e).top>n},a,o),{begin:a,end:o}}function wrappedLineExtentChar(e,t,r,n){var i=intoCoordSystem(e,t,measureCharPrepared(e,r,n),"line").top;return wrappedLineExtent(e,t,r,i)}function coordsCharInner(e,t,r,n,i){i-=heightAtLine(t);var o,a=0,l=t.text.length,s=prepareMeasureForLine(e,t),c=getOrder(t,e.doc.direction);if(c){if(e.options.lineWrapping){var u;u=wrappedLineExtent(e,t,s,i),a=u.begin,l=u.end,u}o=new Pos(r,a);var d,p,f=cursorCoords(e,o,"line",t,s).left,h=fMath.abs(d)){if(g<0==d<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=p}}else{var m=findFirst(function(r){var o=intoCoordSystem(e,t,measureCharPrepared(e,s,r),"line");return o.top>i?(l=Math.min(r,l),!0):!(o.bottom<=i)&&(o.left>n||!(o.rightv.right?1:0,o}function textHeight(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ee){ee=elt("pre");for(var t=0;t<49;++t)ee.appendChild(document.createTextNode("x")),ee.appendChild(elt("br"));ee.appendChild(document.createTextNode("x"))}removeChildrenAndAdd(e.measure,ee);var r=ee.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),removeChildren(e.measure),r||1}function charWidth(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=elt("span","xxxxxxxxxx"),r=elt("pre",[t]);removeChildrenAndAdd(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function getDimensions(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:compensateForHScroll(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function compensateForHScroll(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function estimateHeight(e){var t=textHeight(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/charWidth(e.display)-3);return function(i){if(lineIsHidden(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n=e.display.viewTo||l.to().line3&&(add(d,f.top,null,f.bottom),d=l,f.bottoma.bottom||c.bottom==a.bottom&&c.right>a.right)&&(a=c),d0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ensureFocus(e){e.state.focused||(e.display.input.focus(),onFocus(e))}function delayBlurEvent(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,onBlur(e))},100)}function onFocus(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(signal(e,"focus",e,t),e.state.focused=!0,addClass(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),restartBlink(e))}function onBlur(e,t){e.state.delayingBlurEvent||(e.state.focused&&(signal(e,"blur",e,t),e.state.focused=!1,L(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function alignHorizontally(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=compensateForHScroll(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a.001||u<-.001)&&(updateLineHeight(i.line,o),updateWidgetHeight(i.line),i.rest))for(var d=0;d=a&&(o=lineAtHeight(t,heightAtLine(getLine(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function setScrollTop(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,r||updateDisplaySimple(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),r&&updateDisplaySimple(e),startWorker(e,100))}function setScrollLeft(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,alignHorizontally(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function wheelEventDelta(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function wheelEventPixels(e){var t=wheelEventDelta(e);return t.x*=le,t.y*=le,t}function onScrollWheel(e,t){var n=wheelEventDelta(t),i=n.x,o=n.y,a=e.display,l=a.scroller,c=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(i&&c||o&&u){if(o&&y&&s)e:for(var p=t.target,f=a.view;p!=l;p=p.parentNode)for(var h=0;h(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!h){var o=elt("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-paddingTop(e.display))+"px;\n height: "+(t.bottom-t.top+scrollGap(e)+r.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)}}}function scrollPosIntoView(e,t,r,n){null==n&&(n=0);for(var i,o=0;o<5;o++){var a=!1,l=cursorCoords(e,t),s=r&&r!=t?cursorCoords(e,r):l;i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-n,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+n};var c=calculateScrollPos(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(setScrollTop(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(setScrollLeft(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function scrollIntoView(e,t){var r=calculateScrollPos(e,t);null!=r.scrollTop&&setScrollTop(e,r.scrollTop),null!=r.scrollLeft&&setScrollLeft(e,r.scrollLeft)}function calculateScrollPos(e,t){var r=e.display,n=textHeight(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=displayHeight(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+paddingVert(r),s=t.topl-n;if(t.topi+o){var u=Math.min(t.top,(c?l:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,p=displayWidth(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),f=t.right-t.left>p;return f&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.leftp+d-3&&(a.scrollLeft=t.right+(f?0:10)-p),a}function addToScrollPos(e,t,r){null==t&&null==r||resolveScrollToPos(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function ensureCursorVisible(e){resolveScrollToPos(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?Pos(t.line,t.ch-1):t,n=Pos(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin}}function resolveScrollToPos(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=estimateCoords(e,t.from),n=estimateCoords(e,t.to),i=calculateScrollPos(e,{left:Math.min(r.left,n.left),top:Math.min(r.top,n.top)-t.margin,right:Math.max(r.right,n.right),bottom:Math.max(r.bottom,n.bottom)+t.margin});e.scrollTo(i.scrollLeft,i.scrollTop)}}function startOperation(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++de},pushOperation(e.curOp)}function endOperation(e){var t=e.curOp;finishOperation(t,function(e){for(var t=0;t=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new pe(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function endOperation_W1(e){e.updatedDisplay=e.mustUpdate&&updateDisplayIfNeeded(e.cm,e.update)}function endOperation_R2(e){var t=e.cm,r=t.display;e.updatedDisplay&&updateHeightsInViewport(t),e.barMeasure=measureForScrollbars(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=measureChar(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+scrollGap(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-displayWidth(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function endOperation_W2(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeftt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)z&&visualLineNo(e.doc,t)i.viewFrom?resetView(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)resetView(e);else if(t<=i.viewFrom){var o=viewCuttingPoint(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):resetView(e)}else if(r>=i.viewTo){var a=viewCuttingPoint(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):resetView(e)}else{var l=viewCuttingPoint(e,t,t,-1),s=viewCuttingPoint(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(buildViewArray(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):resetView(e)}var c=i.externalMeasured;c&&(r=i.lineN&&t=n.viewTo)){var o=n.view[findViewIndex(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);indexOf(a,r)==-1&&a.push(r)}}}function resetView(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function viewCuttingPoint(e,t,r,n){
+var i,o=findViewIndex(e,t),a=e.display.view;if(!z||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;visualLineNo(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function adjustView(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=buildViewArray(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=buildViewArray(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,findViewIndex(e,r)))),n.viewTo=r}function countDirtyView(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo)){var r=+new Date+e.options.workTime,n=copyState(t.mode,getStateBefore(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength,s=highlightLine(e,o,l?copyState(t.mode,n):n,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),p=0;!d&&pr)return startWorker(e,e.options.workDelay),!0}),i.length&&runInOp(e,function(){for(var t=0;t=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==countDirtyView(e))return!1;maybeUpdateLineNumberWidth(e)&&(resetView(e),t.dims=getDimensions(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFroma&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),z&&(o=visualLineNo(e.doc,o),a=visualLineEndNo(e.doc,a));var l=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;adjustView(e,o,a),r.viewOffset=heightAtLine(getLine(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var s=countDirtyView(e);if(!l&&0==s&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=activeElt();return s>4&&(r.lineDiv.style.display="none"),patchDisplay(e,r.updateLineNumbers,t.dims),s>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,c&&activeElt()!=c&&c.offsetHeight&&c.focus(),removeChildren(r.cursorDiv),removeChildren(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,l&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,startWorker(e,400)),r.updateLineNumbers=null,!0}function postUpdateDisplay(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=displayWidth(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+paddingVert(e.display)-displayHeight(e),r.top)}),t.visible=visibleLines(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&updateDisplayIfNeeded(e,t);n=!1){updateHeightsInViewport(e);var i=measureForScrollbars(e);updateSelection(e),updateScrollbars(e,i),setDocumentHeight(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function updateDisplaySimple(e,t){var r=new pe(e,t);if(updateDisplayIfNeeded(e,r)){updateHeightsInViewport(e),postUpdateDisplay(e,r);var n=measureForScrollbars(e);updateSelection(e),updateScrollbars(e,n),setDocumentHeight(e,n),r.finish()}}function patchDisplay(e,t,r){function rm(t){var r=t.nextSibling;return s&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,a=o.firstChild,l=n.view,c=n.viewFrom,u=0;u-1&&(p=!1),updateLineForChanges(e,d,c,r)),p&&(removeChildren(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(lineNumberFor(e.options,c)))),a=d.node.nextSibling}else{var f=buildLineElement(e,d,c,r);o.insertBefore(f,a)}c+=d.size}for(;a;)a=rm(a)}function updateGutterSpace(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function setDocumentHeight(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+scrollGap(e)+"px"}function updateGutters(e){var t=e.display.gutters,r=e.options.gutters;removeChildren(t);for(var n=0;n-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function normalizeSelection(e,t){var r=e[t];e.sort(function(e,t){return cmp(e.from(),t.from())}),t=indexOf(e,r);for(var n=1;n=0){var a=minPos(o.from(),i.from()),l=maxPos(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new he(s?l:a,s?a:l))}}return new fe(e,t)}function simpleSelection(e,t){return new fe([new he(e,t||e)],0)}function changeEnd(e){return e.text?Pos(e.from.line+e.text.length-1,lst(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function adjustForChange(e,t){if(cmp(e,t.from)<0)return e;if(cmp(e,t.to)<=0)return changeEnd(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=changeEnd(t).ch-t.to.ch),Pos(r,n)}function computeSelAfterChange(e,t){for(var r=[],n=0;n1&&e.remove(i.line+1,d-1),e.insert(i.line+1,h)}signalLater(e,"change",e,t)}function linkedDocs(e,t,r){function propagate(e,n,i){if(e.linked)for(var o=0;o1&&!e.done[e.done.length-2].ranges?(e.done.pop(),lst(e.done)):void 0}function addChangeToHistory(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=lastChangeEvent(i,i.lastOp==n)))a=lst(o.changes),0==cmp(t.from,t.to)&&0==cmp(t.from,a.to)?a.to=changeEnd(t):o.changes.push(historyChangeFromChange(e,t));else{var s=lst(i.done);for(s&&s.ranges||pushSelectionToHistory(e.sel,i.done),o={changes:[historyChangeFromChange(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||signal(e,"historyAdded")}function selectionEventCanBeMerged(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function addSelectionToHistory(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||selectionEventCanBeMerged(e,o,lst(i.done),t))?i.done[i.done.length-1]=t:pushSelectionToHistory(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&clearSelectionEvents(i.undone)}function pushSelectionToHistory(e,t){var r=lst(t);r&&r.ranges&&r.equals(e)||t.push(e)}function attachLocalSpans(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function removeClearedSpans(e){if(!e)return null;for(var t,r=0;r-1&&(lst(l)[d]=c[d],delete c[d])}}}return n}function extendRange(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=cmp(r,i)<0;o!=cmp(n,i)<0?(i=r,r=n):o!=cmp(r,n)<0&&(r=n)}return new he(i,r)}return new he(n||r,r)}function extendSelection(e,t,r,n){setSelection(e,new fe([extendRange(e,e.sel.primary(),t,r)],0),n)}function extendSelections(e,t,r){for(var n=[],i=0;i=t.ch:l.to>t.ch))){if(i&&(signal(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var c=s.find(n<0?1:-1),u=void 0;if((n<0?s.inclusiveRight:s.inclusiveLeft)&&(c=movePos(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=cmp(c,r))&&(n<0?u<0:u>0))return skipAtomicInner(e,c,t,n,i)}var d=s.find(n<0?-1:1);return(n<0?s.inclusiveLeft:s.inclusiveRight)&&(d=movePos(e,d,n,d.line==t.line?o:null)),d?skipAtomicInner(e,d,t,n,i):null}}return t}function skipAtomic(e,t,r,n,i){var o=n||1,a=skipAtomicInner(e,t,r,o,i)||!i&&skipAtomicInner(e,t,r,o,!0)||skipAtomicInner(e,t,r,-o,i)||!i&&skipAtomicInner(e,t,r,-o,!0);return a?a:(e.cantEdit=!0,Pos(e.first,0))}function movePos(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?clipPos(e,Pos(t.line-1)):null:r>0&&t.ch==(n||getLine(e,t.line)).text.length?t.line=0;--i)makeChangeInner(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else makeChangeInner(e,t)}}function makeChangeInner(e,t){if(1!=t.text.length||""!=t.text[0]||0!=cmp(t.from,t.to)){var r=computeSelAfterChange(e,t);addChangeToHistory(e,t,r,e.cm?e.cm.curOp.id:NaN),makeChangeSingleDoc(e,t,r,stretchSpansOverChange(e,t));var n=[];linkedDocs(e,function(e,r){r||indexOf(n,e.history)!=-1||(rebaseHist(e.history,t),n.push(e.history)),makeChangeSingleDoc(e,t,null,stretchSpansOverChange(e,t))})}}function makeChangeFromHistory(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s=0;--p){var f=d(p);if(f)return f.v}}}}function shiftDoc(e,t){if(0!=t&&(e.first+=t,e.sel=new fe(map(e.sel.ranges,function(e){return new he(Pos(e.anchor.line+t,e.anchor.ch),Pos(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){regChange(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.lineo&&(t={from:t.from,to:Pos(o,getLine(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=getBetween(e,t.from,t.to),r||(r=computeSelAfterChange(e,t)),e.cm?makeChangeSingleDocInEditor(e.cm,t,n):updateDoc(e,t,n),setSelectionNoUndo(e,r,H)}}function makeChangeSingleDocInEditor(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=lineNo(visualLine(getLine(n,o.line))),n.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0,!0})),n.sel.contains(t.from,t.to)>-1&&signalCursorActivity(e),updateDoc(n,t,r,estimateHeight(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=lineLength(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,o.line),startWorker(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?regChange(e):o.line!=a.line||1!=t.text.length||isWholeLineUpdate(e.doc,t)?regChange(e,o.line,a.line+1,c):regLineChange(e,o.line,"text");var u=hasHandler(e,"changes"),d=hasHandler(e,"change");if(d||u){var p={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&signalLater(e,"change",e,p),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function replaceRange(e,t,r,n,i){if(n||(n=r),cmp(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),makeChange(e,{from:r,to:n,text:t,origin:i})}function rebaseHistSelSingle(e,t,r,n){r0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=eltP("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(conflictingCollapsedRange(e,t.line,t,r,o)||t.line!=r.line&&conflictingCollapsedRange(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");seeCollapsedSpans()}o.addToHistory&&addChangeToHistory(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var l,s=t.line,c=e.cm;if(e.iter(s,r.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&visualLine(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&updateLineHeight(e,0),addMarkedSpan(e,new MarkedSpan(o,s==t.line?t.ch:null,s==r.line?r.ch:null)),++s}),o.collapsed&&e.iter(t.line,r.line+1,function(t){lineIsHidden(e,t)&&updateLineHeight(t,0)}),o.clearOnEnter&&G(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(seeReadOnlySpans(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ye,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)regChange(c,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=r.line;u++)regLineChange(c,u,"text");o.atomic&&reCheckSelection(c.doc),signalLater(c,"markerAdded",c,o)}return o}function markTextShared(e,t,r,n,i){n=copyObj(n),n.shared=!1;var o=[markText(e,t,r,n,i)],a=o[0],l=n.widgetNode;return linkedDocs(e,function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push(markText(e,clipPos(e,t),clipPos(e,r),n,i));for(var s=0;s-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var u=e.dataTransfer.getData("Text");if(u){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),setSelectionNoUndo(t.doc,simpleSelection(r,r)),d)for(var p=0;p=0;t--)replaceRange(e.doc,"",n[t].from,n[t].to,"+delete");ensureCursorVisible(e)})}function lineStart(e,t){var r=getLine(e.doc,t),n=visualLine(r);return n!=r&&(t=lineNo(n)),endOfLine(!0,e,n,t,1)}function lineEnd(e,t){var r=getLine(e.doc,t),n=visualLineEnd(r);return n!=r&&(t=lineNo(n)),endOfLine(!0,e,r,t,-1)}function lineStartSmart(e,t){var r=lineStart(e,t.line),n=getLine(e.doc,r.line),i=getOrder(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return Pos(r.line,a?0:o,r.sticky)}return r}function doHandleBinding(e,t,r){if("string"==typeof t&&(t=He[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=N}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function lookupKeyForEditor(e,t,r){for(var n=0;ni-400&&0==cmp(Ne.pos,r)?n="triple":Ae&&Ae.time>i-400&&0==cmp(Ae.pos,r)?(n="double",Ne={time:i,pos:r}):(n="single",Ae={time:i,pos:r});var o,l=e.doc.sel,s=y?t.metaKey:t.ctrlKey;e.options.dragDrop&&_&&!e.isReadOnly()&&"single"==n&&(o=l.contains(r))>-1&&(cmp((o=l.ranges[o]).from(),r)<0||r.xRel>0)&&(cmp(o.to(),r)>0||r.xRel<0)?leftButtonStartDrag(e,t,r,s):leftButtonSelect(e,t,r,n,s)}function leftButtonStartDrag(e,t,r,n){var i=e.display,o=!1,c=operation(e,function(t){s&&(i.scroller.draggable=!1),e.state.draggingText=!1,off(document,"mouseup",c),off(document,"mousemove",u),off(i.scroller,"dragstart",d),off(i.scroller,"drop",c),o||(e_preventDefault(t),n||extendSelection(e.doc,r),s||a&&9==l?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())}),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};s&&(i.scroller.draggable=!0),e.state.draggingText=c,c.copy=y?t.altKey:t.ctrlKey,i.scroller.dragDrop&&i.scroller.dragDrop(),G(document,"mouseup",c),G(document,"mousemove",u),G(i.scroller,"dragstart",d),G(i.scroller,"drop",c),delayBlurEvent(e),setTimeout(function(){return i.input.focus()},20)}function leftButtonSelect(e,t,r,n,i){function extendTo(t){if(0!=cmp(f,t))if(f=t,"rect"==n){for(var i=[],o=e.options.tabSize,u=countColumn(getLine(a,r.line).text,r.ch,o),d=countColumn(getLine(a,t.line).text,t.ch,o),p=Math.min(u,d),h=Math.max(u,d),g=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=m;g++){var v=getLine(a,g).text,y=findColumn(v,p,o);p==h?i.push(new he(Pos(g,y),Pos(g,y))):v.length>y&&i.push(new he(Pos(g,y),Pos(g,findColumn(v,h,o))))}i.length||i.push(new he(r,r)),setSelection(a,normalizeSelection(c.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=l,x=b.anchor,C=t;if("single"!=n){var w;w="double"==n?e.findWordAt(t):new he(Pos(t.line,0),clipPos(a,Pos(t.line+1,0))),cmp(w.anchor,x)>0?(C=w.head,x=minPos(b.from(),w.anchor)):(C=w.anchor,x=maxPos(b.to(),w.head))}var S=c.ranges.slice(0);S[s]=new he(clipPos(a,x),C),setSelection(a,normalizeSelection(S,s),D)}}function extend(t){var r=++g,i=posFromMouse(e,t,!0,"rect"==n);if(i)if(0!=cmp(i,f)){e.curOp.focus=activeElt(),extendTo(i);var l=visibleLines(o,a);(i.line>=l.to||i.lineh.bottom?20:0;s&&setTimeout(operation(e,function(){g==r&&(o.scroller.scrollTop+=s,extend(t))}),50)}}function done(t){e.state.selectingText=!1,g=1/0,e_preventDefault(t),o.input.focus(),off(document,"mousemove",m),off(document,"mouseup",v),a.history.lastSelOrigin=null}var o=e.display,a=e.doc;e_preventDefault(t);var l,s,c=a.sel,u=c.ranges;if(i&&!t.shiftKey?(s=a.sel.contains(r),l=s>-1?u[s]:new he(r,r)):(l=a.sel.primary(),s=a.sel.primIndex),b?t.shiftKey&&t.metaKey:t.altKey)n="rect",i||(l=new he(r,r)),r=posFromMouse(e,t,!0,!0),s=-1;else if("double"==n){var d=e.findWordAt(r);l=e.display.shift||a.extend?extendRange(a,l,d.anchor,d.head):d}else if("triple"==n){var p=new he(Pos(r.line,0),clipPos(a,Pos(r.line+1,0)));l=e.display.shift||a.extend?extendRange(a,l,p.anchor,p.head):p}else l=extendRange(a,l,r);i?s==-1?(s=u.length,setSelection(a,normalizeSelection(u.concat([l]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"single"==n&&!t.shiftKey?(setSelection(a,normalizeSelection(u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),c=a.sel):replaceOneSelection(a,s,l,D):(s=0,setSelection(a,new fe([l],0),D),c=a.sel);var f=r,h=o.wrapper.getBoundingClientRect(),g=0,m=operation(e,function(e){e_button(e)?extend(e):done(e)}),v=operation(e,done);e.state.selectingText=v,G(document,"mousemove",m),G(document,"mouseup",v)}function gutterEvent(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&e_preventDefault(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!hasHandler(e,r))return e_defaultPrevented(t);o-=l.top-a.viewOffset;for(var s=0;s=i){var u=lineAtHeight(e.doc,o),d=e.options.gutters[s];return signal(e,r,e,u,d,t),e_defaultPrevented(t)}}}function clickInGutter(e,t){return gutterEvent(e,t,"gutterClick",!0)}function onContextMenu(e,t){eventInWidget(e.display,t)||contextMenuInGutter(e,t)||signalDOMEvent(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function contextMenuInGutter(e,t){return!!hasHandler(e,"gutterContextMenu")&&gutterEvent(e,t,"gutterContextMenu",!1)}function themeChanged(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),clearCaches(e)}function defineOptions(e){function option(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=Ee&&i(e,t,r)}:i)}var t=e.optionHandlers;e.defineOption=option,e.Init=Ee,option("value","",function(e,t){return e.setValue(t)},!0),option("mode",null,function(e,t){e.doc.modeOption=t,loadMode(e)},!0),option("indentUnit",2,loadMode,!0),option("indentWithTabs",!1),option("smartIndent",!0),option("tabSize",4,function(e){resetModeState(e),clearCaches(e),regChange(e)},!0),option("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,r.push(Pos(n,o))}n++});for(var i=r.length-1;i>=0;i--)replaceRange(e.doc,t,r[i],Pos(r[i].line,r[i].ch+t.length))}}),option("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Ee&&e.refresh()}),option("specialCharPlaceholder",defaultSpecialCharPlaceholder,function(e){return e.refresh()},!0),option("electricChars",!0),option("inputStyle",v?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),option("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),option("rtlMoveVisually",!x),option("wholeLineUpdateBefore",!0),option("theme","default",function(e){themeChanged(e),guttersChanged(e)},!0),option("keyMap","default",function(e,t,r){var n=getKeyMap(t),i=r!=Ee&&getKeyMap(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),option("extraKeys",null),option("lineWrapping",!1,wrappingChanged,!0),option("gutters",[],function(e){setGuttersForLineNumbers(e.options),guttersChanged(e)},!0),option("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?compensateForHScroll(e.display)+"px":"0",e.refresh()},!0),option("coverGutterNextToScrollbar",!1,function(e){return updateScrollbars(e)},!0),option("scrollbarStyle","native",function(e){initScrollbars(e),updateScrollbars(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),option("lineNumbers",!1,function(e){setGuttersForLineNumbers(e.options),guttersChanged(e)},!0),option("firstLineNumber",1,guttersChanged,!0),option("lineNumberFormatter",function(e){return e},guttersChanged,!0),option("showCursorWhenSelecting",!1,updateSelection,!0),option("resetSelectionOnContextMenu",!0),option("lineWiseCopyCut",!0),option("readOnly",!1,function(e,t){"nocursor"==t?(onBlur(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),option("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),option("dragDrop",!0,dragDropChanged),option("allowDropFileTypes",null),option("cursorBlinkRate",530),option("cursorScrollMargin",0),option("cursorHeight",1,updateSelection,!0),option("singleCursorHeightPerLine",!0,updateSelection,!0),option("workTime",100),option("workDelay",100),option("flattenSpans",!0,resetModeState,!0),option("addModeClass",!1,resetModeState,!0),option("pollInterval",100),option("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),option("historyEventDelay",1250),option("viewportMargin",10,function(e){return e.refresh()},!0),option("maxHighlightLength",1e4,resetModeState,!0),option("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),option("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),option("autofocus",null),option("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}function guttersChanged(e){updateGutters(e),regChange(e),alignHorizontally(e)}function dragDropChanged(e,t,r){var n=r&&r!=Ee;if(!t!=!n){var i=e.display.dragFunctions,o=t?G:off;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function wrappingChanged(e){e.options.lineWrapping?(addClass(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(L(e.display.wrapper,"CodeMirror-wrap"),findMaxLine(e)),estimateLineHeights(e),regChange(e),clearCaches(e),setTimeout(function(){return updateScrollbars(e)},100)}function CodeMirror$1(e,t){var r=this;if(!(this instanceof CodeMirror$1))return new CodeMirror$1(e,t);this.options=t=t?copyObj(t):{},copyObj(Ie,t,!1),setGuttersForLineNumbers(t);var n=t.value;"string"==typeof n&&(n=new we(n,t.mode,null,t.lineSeparator,t.direction)),this.doc=n;var i=new CodeMirror$1.inputStyles[t.inputStyle](this),o=this.display=new Display(e,n,i);o.wrapper.CodeMirror=this,updateGutters(this),themeChanged(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),initScrollbars(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 T,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&l<11&&setTimeout(function(){return r.display.input.reset(!0)},20),registerEventHandlers(this),ensureGlobalHandlers(),startOperation(this),this.curOp.forceUpdate=!0,attachDoc(this,n),t.autofocus&&!v||this.hasFocus()?setTimeout(bind(onFocus,this),20):onBlur(this);for(var c in Fe)Fe.hasOwnProperty(c)&&Fe[c](r,t[c],Ee);maybeUpdateLineNumberWidth(this),t.finishInit&&t.finishInit(this);for(var u=0;u400}var t=e.display;G(t.scroller,"mousedown",operation(e,onMouseDown)),a&&l<11?G(t.scroller,"dblclick",operation(e,function(t){if(!signalDOMEvent(e,t)){var r=posFromMouse(e,t);if(r&&!clickInGutter(e,t)&&!eventInWidget(e.display,t)){e_preventDefault(t);var n=e.findWordAt(r);extendSelection(e.doc,n.anchor,n.head)}}})):G(t.scroller,"dblclick",function(t){return signalDOMEvent(e,t)||e_preventDefault(t)}),k||G(t.scroller,"contextmenu",function(t){return onContextMenu(e,t)});var r,n={end:0};G(t.scroller,"touchstart",function(i){if(!signalDOMEvent(e,i)&&!isMouseLikeTouchEvent(i)){t.input.ensurePolled(),clearTimeout(r);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),G(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),G(t.scroller,"touchend",function(r){var n=t.activeTouch;if(n&&!eventInWidget(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var i,o=e.coordsChar(t.activeTouch,"page");i=!n.prev||farAway(n,n.prev)?new he(o,o):!n.prev.prev||farAway(n,n.prev.prev)?e.findWordAt(o):new he(Pos(o.line,0),clipPos(e.doc,Pos(o.line+1,0))),e.setSelection(i.anchor,i.head),e.focus(),e_preventDefault(r)}finishTouch()}),G(t.scroller,"touchcancel",finishTouch),G(t.scroller,"scroll",function(){t.scroller.clientHeight&&(setScrollTop(e,t.scroller.scrollTop),setScrollLeft(e,t.scroller.scrollLeft,!0),signal(e,"scroll",e))}),G(t.scroller,"mousewheel",function(t){return onScrollWheel(e,t)}),G(t.scroller,"DOMMouseScroll",function(t){return onScrollWheel(e,t)}),G(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){signalDOMEvent(e,t)||e_stop(t)},over:function(t){signalDOMEvent(e,t)||(onDragOver(e,t),e_stop(t))},start:function(t){return onDragStart(e,t)},drop:operation(e,onDrop),leave:function(t){signalDOMEvent(e,t)||clearDragCursor(e)}};var i=t.input.getField();G(i,"keyup",function(t){return onKeyUp.call(e,t)}),G(i,"keydown",operation(e,onKeyDown)),G(i,"keypress",operation(e,onKeyPress)),G(i,"focus",function(t){return onFocus(e,t)}),G(i,"blur",function(t){return onBlur(e,t)})}function indentLine(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=getStateBefore(e,t):r="prev");var a=e.options.tabSize,l=getLine(o,t),s=countColumn(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&(c=o.mode.indent(i,l.text.slice(u.length),l.text),c==N||c>150)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?countColumn(getLine(o,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c);var d="",p=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)p+=a,d+="\t";if(p1)if(ze&&ze.text.join("\n")==t){if(n.ranges.length%ze.text.length==0){s=[];for(var c=0;c=0;d--){var p=n.ranges[d],f=p.from(),h=p.to();p.empty()&&(r&&r>0?f=Pos(f.line,f.ch-r):e.state.overwrite&&!a?h=Pos(h.line,Math.min(getLine(o,h.line).text.length,h.ch+lst(l).length)):ze&&ze.lineWise&&ze.text.join("\n")==t&&(f=h=Pos(f.line,0))),u=e.curOp.updateInput;var g={from:f,to:h,text:s?s[d%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};makeChange(e.doc,g),signalLater(e,"inputRead",e,g)}t&&!a&&triggerElectric(e,t),ensureCursorVisible(e),e.curOp.updateInput=u,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function handlePaste(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||runInOp(t,function(){return applyTextInput(t,r,0,null,"paste")}),!0}function triggerElectric(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l-1){a=indentLine(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(getLine(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=indentLine(e,i.head.line,"smart"));a&&signalLater(e,"electricInput",e,i.head.line)}}}function copyableRanges(e){for(var t=[],r=[],n=0;n=e.first+e.size)&&(t=new Pos(n,t.ch,t.sticky),l=getLine(e,n))}function moveOnce(n){var o;if(o=i?moveVisually(e.cm,l,t,r):moveLogically(l,t,r),null==o){if(n||!findNextLine())return!1;t=endOfLine(i,e.cm,l,t.line,r)}else t=o;return!0}var o=t,a=r,l=getLine(e,t.line);if("char"==n)moveOnce();else if("column"==n)moveOnce(!0);else if("word"==n||"group"==n)for(var s=null,c="group"==n,u=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(r<0)||moveOnce(!d);d=!1){var p=l.text.charAt(t.ch)||"\n",f=isWordChar(p,u)?"w":c&&"\n"==p?"n":!c||/\s/.test(p)?null:"p";if(!c||d||f||(f="s"),s&&s!=f){r<0&&(r=1,moveOnce(),t.sticky="after");break}if(f&&(s=f),r>0&&!moveOnce(!d))break}var h=skipAtomic(e,t,o,a,!0);return equalCursorPos(o,h)&&(h.hitSide=!0),h}function findPosV(e,t,r,n){var i,o=e.doc,a=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*textHeight(e.display),3);i=(r>0?t.bottom:t.top)+r*s}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var c;c=coordsChar(e,a,i),c.outside;){if(r<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*r}return c}function posToDOM(e,t){var r=findViewForLine(e,t.line);if(!r||r.hidden)return null;var n=getLine(e.doc,t.line),i=mapFromLineView(r,n,t.line),o=getOrder(n,e.doc.direction),a="left";if(o){var l=getBidiPartAt(o,t.ch);a=l%2?"right":"left"}var s=nodeAndOffsetInLineMap(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function isInGutter(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function badPos(e,t){return t&&(e.bad=!0),e}function domTextBetween(e,t,r,n,i){function recognizeMarker(e){return function(t){return t.id==e}}function close(){a&&(o+=l,a=!1)}function addText(e){e&&(close(),o+=e)}function walk(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void addText(r||t.textContent.replace(/\u200b/g,""));var o,s=t.getAttribute("cm-marker");if(s){var c=e.findMarks(Pos(n,0),Pos(i+1,0),recognizeMarker(+s));return void(c.length&&(o=c[0].find())&&addText(getBetween(e.doc,o.from,o.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;var u=/^(pre|div|p)$/i.test(t.nodeName);u&&close();for(var d=0;d=15&&(d=!1,s=!0);var w,S=y&&(c||d&&(null==C||C<12.11)),k=r||a&&l>=9,L=function(e,t){var r=e.className,n=classTest(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};w=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var M=function(e){e.select()};g?M=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(M=function(e){try{e.select()}catch(e){}});var T=function(){this.id=null};T.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var P,O,A=30,N={toString:function(){return"CodeMirror.Pass"}},H={scroll:!1},D={origin:"*mouse"},W={origin:"+move"},E=[""],I=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,F=/[\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]/,B=!1,z=!1,R=null,V=function(){function charType(r){return r<=247?e.charAt(r):1424<=r&&r<=1524?"R":1536<=r&&r<=1785?t.charAt(r-1536):1774<=r&&r<=2220?"r":8192<=r&&r<=8203?"w":8204==r?"b":"L"}function BidiSpan(e,t,r){this.level=e,this.from=t,this.to=r}var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,i=/[LRr]/,o=/[Lb1n]/,a=/[1n]/;return function(e,t){var l="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var s=e.length,c=[],u=0;u=this.string.length},Q.prototype.sol=function(){return this.pos==this.lineStart},Q.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Q.prototype.next=function(){if(this.post},Q.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},Q.prototype.skipToEnd=function(){this.pos=this.string.length},Q.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Q.prototype.backUp=function(e){this.pos-=e},Q.prototype.column=function(){return this.lastColumnPos0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return t!==!1&&(this.pos+=e.length),!0},Q.prototype.current=function(){return this.string.slice(this.start,this.pos)},Q.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};var J=function(e,t,r){this.text=e,attachMarkedSpans(this,t),this.height=r?r(this):1};J.prototype.lineNo=function(){return lineNo(this)},eventMixin(J);var ee,te={},re={},ne=null,ie=null,oe={left:0,right:0,top:0,bottom:0},ae=0,le=null;a?le=-.53:r?le=15:u?le=-.7:p&&(le=-1/3);var se=function(e,t,r){this.cm=r;var n=this.vert=elt("div",[elt("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=elt("div",[elt("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),G(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),G(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,a&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};se.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},se.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},se.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},se.prototype.zeroWidthHack=function(){var e=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new T,this.disableVert=new T},se.prototype.enableZeroWidthBar=function(e,t,r){function maybeDisable(){var n=e.getBoundingClientRect(),i="vert"==r?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,maybeDisable)}e.style.pointerEvents="auto",t.set(1e3,maybeDisable)},se.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ce=function(){};ce.prototype.update=function(){return{bottom:0,right:0}},ce.prototype.setScrollLeft=function(){},ce.prototype.setScrollTop=function(){},ce.prototype.clear=function(){};var ue={native:se,null:ce},de=0,pe=function(e,t,r){var n=e.display;this.viewport=t,this.visible=visibleLines(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=displayWidth(e),this.force=r,this.dims=getDimensions(e),this.events=[]};pe.prototype.signal=function(e,t){hasHandler(e,t)&&this.events.push(arguments)},pe.prototype.finish=function(){for(var e=this,t=0;t=0&&cmp(e,i.to())<=0)return n}return-1};var he=function(e,t){this.anchor=e,this.head=t};he.prototype.from=function(){return minPos(this.anchor,this.head)},he.prototype.to=function(){return maxPos(this.anchor,this.head)},he.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};var ge=function(e){var t=this;this.lines=e,this.parent=null;for(var r=0,n=0;n1||!(this.children[0]instanceof ge))){var s=[];this.collapse(s),this.children=[new ge(s)],this.children[0].parent=this}},me.prototype.collapse=function(e){for(var t=this,r=0;r50){for(var l=o.lines.length%25+25,s=l;s10);e.parent.maybeSpill()}},me.prototype.iterN=function(e,t,r){for(var n=this,i=0;it.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&®Change(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&reCheckSelection(t.doc)),t&&signalLater(t,"markerCleared",t,this,i,o),r&&endOperation(t),this.parent&&this.parent.clear()}},be.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o=0;c--)makeChange(n,i[c]);s?setSelectionReplaceHistory(this,s):this.cm&&ensureCursorVisible(this.cm)}),undo:docMethodOp(function(){makeChangeFromHistory(this,"undo")}),redo:docMethodOp(function(){makeChangeFromHistory(this,"redo")}),undoSelection:docMethodOp(function(){makeChangeFromHistory(this,"undo",!0)}),redoSelection:docMethodOp(function(){makeChangeFromHistory(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=clipPos(this,e),t=clipPos(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne?(t=e,!0):(e-=o,void++r)}),clipPos(this,Pos(r,t))},indexFromPos:function(e){e=clipPos(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.to0)i=new Pos(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Pos(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=getLine(e.doc,i.line-1).text;a&&(i=new Pos(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),Pos(i.line-1,a.length-1),i,"+transpose"))}r.push(new he(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return runInOp(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;nn&&(indentLine(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&ensureCursorVisible(t));else{var a=o.from(),l=o.to(),s=Math.max(n,a.line);n=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1;for(var c=s;c0&&replaceOneSelection(t.doc,i,new he(a,u[i].to()),H)}}}),getTokenAt:function(e,t){return takeToken(this,e,t)},getLineTokens:function(e,t){return takeToken(this,Pos(e),t,!0)},getTokenTypeAt:function(e){e=clipPos(this.doc,e);var t,r=getLineStyles(this,getLine(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]o&&(e=o,i=!0),n=getLine(this.doc,e)}else n=e;return intoCoordSystem(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-heightAtLine(n):0)},defaultTextHeight:function(){return textHeight(this.display)},defaultCharWidth:function(){return charWidth(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=cursorCoords(this,clipPos(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),r&&scrollIntoView(this,{left:l,top:a,right:l+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:methodOp(onKeyDown),triggerOnKeyPress:methodOp(onKeyPress),triggerOnKeyUp:onKeyUp,execCommand:function(e){if(He.hasOwnProperty(e))return He[e].call(null,this)},triggerElectric:methodOp(function(e){triggerElectric(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var a=clipPos(this.doc,e),l=0;l0&&l(r.charAt(n-1));)--n;for(;i.5)&&estimateLineHeights(this),signal(this,"refresh",this)}),swapDoc:methodOp(function(e){var t=this.doc;return t.cm=null,attachDoc(this,e),clearCaches(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,signalLater(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},eventMixin(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}},Ve=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new T,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ve.prototype.init=function(e){function onCopyCut(e){if(!signalDOMEvent(n,e)){if(n.somethingSelected())setLastCopied({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=copyableRanges(n);setLastCopied({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,H),n.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var o=ze.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=hiddenTextarea(),l=a.firstChild;n.display.lineSpace.insertBefore(a,n.display.lineSpace.firstChild),l.value=ze.text.join("\n");var s=document.activeElement;M(l),setTimeout(function(){n.display.lineSpace.removeChild(a),s.focus(),s==i&&r.showPrimarySelection()},50)}}var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;disableBrowserMagic(i,n.options.spellcheck),G(i,"paste",function(e){signalDOMEvent(n,e)||handlePaste(e,n)||l<=11&&setTimeout(operation(n,function(){return t.updateFromDOM()}),20)}),G(i,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),G(i,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),G(i,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),G(i,"touchstart",function(){return r.forceCompositionEnd()}),G(i,"input",function(){t.composing||t.readFromDOMSoon()}),G(i,"copy",onCopyCut),G(i,"cut",onCopyCut)},Ve.prototype.prepareSelection=function(){var e=prepareSelection(this.cm,!1);return e.focus=this.cm.state.focused,e},Ve.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ve.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line=t.display.viewFrom&&posToDOM(t,i)||{node:s[0].measure.map[2],offset:0},u=o.linee.firstLine()&&(n=Pos(n.line-1,getLine(e.doc,n.line-1).length)),i.ch==getLine(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,a,l;n.line==t.viewFrom||0==(o=findViewIndex(e,n.line))?(a=lineNo(t.view[0].line),l=t.view[0].node):(a=lineNo(t.view[o].line),l=t.view[o-1].node.nextSibling);var s,c,u=findViewIndex(e,i.line);if(u==t.view.length-1?(s=t.viewTo-1,c=t.lineDiv.lastChild):(s=lineNo(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling),!l)return!1;for(var d=e.doc.splitLines(domTextBetween(e,l,c,a,s)),p=getBetween(e.doc,Pos(a,0),Pos(s,getLine(e.doc,s).text.length));d.length>1&&p.length>1;)if(lst(d)==lst(p))d.pop(),p.pop(),s--;else{if(d[0]!=p[0])break;d.shift(),p.shift(),a++}for(var f=0,h=0,g=d[0],m=p[0],v=Math.min(g.length,m.length);fn.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)f--,h++;d[d.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var C=Pos(a,f),w=Pos(s,p.length?lst(p).length-h:0);return d.length>1||d[0]||cmp(C,w)?(replaceRange(e.doc,d,C,w,"+input"),!0):void 0},Ve.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ve.prototype.reset=function(){this.forceCompositionEnd()},Ve.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ve.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))},Ve.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||runInOp(this.cm,function(){return regChange(e.cm)})},Ve.prototype.setUneditable=function(e){e.contentEditable="false"},Ve.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||operation(this.cm,applyTextInput)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ve.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ve.prototype.onContextMenu=function(){},Ve.prototype.resetPosition=function(){},Ve.prototype.needsContentAttribute=!0;var je=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new T,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};je.prototype.init=function(e){function prepareCopyCut(e){if(!signalDOMEvent(n,e)){if(n.somethingSelected())setLastCopied({lineWise:!1,text:n.getSelections()}),r.inaccurateSelection&&(r.prevInput="",r.inaccurateSelection=!1,o.value=ze.text.join("\n"),M(o));else{if(!n.options.lineWiseCopyCut)return;var t=copyableRanges(n);setLastCopied({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,H):(r.prevInput="",o.value=t.text.join("\n"),M(o))}"cut"==e.type&&(n.state.cutIncoming=!0)}}var t=this,r=this,n=this.cm,i=this.wrapper=hiddenTextarea(),o=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),g&&(o.style.width="0px"),G(o,"input",function(){a&&l>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),G(o,"paste",function(e){signalDOMEvent(n,e)||handlePaste(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())}),G(o,"cut",prepareCopyCut),G(o,"copy",prepareCopyCut),G(e.scroller,"paste",function(t){eventInWidget(e,t)||signalDOMEvent(n,t)||(n.state.pasteIncoming=!0,r.focus())}),G(e.lineSpace,"selectstart",function(t){eventInWidget(e,t)||e_preventDefault(t)}),G(o,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),G(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},je.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=prepareSelection(e);if(e.options.moveInputWithCursor){var i=cursorCoords(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},je.prototype.showSelection=function(e){var t=this.cm,r=t.display;removeChildrenAndAdd(r.cursorDiv,e.cursors),removeChildrenAndAdd(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},je.prototype.reset=function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=$&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var s=t?"-":r||n.getSelection();this.textarea.value=s,n.state.focused&&M(this.textarea),a&&l>=9&&(this.hasSelection=s)}else e||(this.prevInput=this.textarea.value="",a&&l>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},je.prototype.getField=function(){return this.textarea},je.prototype.supportsTouch=function(){return!1},je.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||activeElt()!=this.textarea))try{this.textarea.focus()}catch(e){}},je.prototype.blur=function(){this.textarea.blur()},je.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},je.prototype.receivedFocus=function(){this.slowPoll()},je.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},je.prototype.fastPoll=function(){function p(){var r=t.poll();r||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,p))}var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,p)},je.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||K(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(a&&l>=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||n||(n=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,c=Math.min(n.length,i.length);s1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},je.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},je.prototype.onKeyPress=function(){a&&l>=9&&(this.hasSelection=null),this.fastPoll()},je.prototype.onContextMenu=function(e){function prepareSelectAllHack(){if(null!=i.selectionStart){var e=r.somethingSelected(),o=""+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function rehide(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=p,a&&l<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=c),null!=i.selectionStart){(!a||a&&l<9)&&prepareSelectAllHack();var e=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?operation(r,selectAll)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}var t=this,r=t.cm,n=r.display,i=t.textarea,o=posFromMouse(r,e),c=n.scroller.scrollTop;if(o&&!d){var u=r.options.resetSelectionOnContextMenu;u&&r.doc.sel.contains(o)==-1&&operation(r,setSelection)(r.doc,simpleSelection(o),H);var p=i.style.cssText,f=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var h=t.wrapper.getBoundingClientRect();i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var g;if(s&&(g=window.scrollY),n.input.focus(),s&&window.scrollTo(null,g),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=!0,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),a&&l>=9&&prepareSelectAllHack(),k){e_stop(e);var m=function(){off(window,"mouseup",m),setTimeout(rehide,20)};G(window,"mouseup",m)}else setTimeout(rehide,50)}},je.prototype.readOnlyChanged=function(e){e||this.reset()},je.prototype.setUneditable=function(){},je.prototype.needsContentAttribute=!1,defineOptions(CodeMirror$1),Re(CodeMirror$1);var Ge="iter insert remove copy getEditor constructor".split(" ");for(var _e in we.prototype)we.prototype.hasOwnProperty(_e)&&indexOf(Ge,_e)<0&&(CodeMirror$1.prototype[_e]=function(e){return function(){return e.apply(this.doc,arguments)}}(we.prototype[_e]));return eventMixin(we),CodeMirror$1.inputStyles={textarea:je,contenteditable:Ve},CodeMirror$1.defineMode=function(e){CodeMirror$1.defaults.mode||"null"==e||(CodeMirror$1.defaults.mode=e),defineMode.apply(this,arguments)},CodeMirror$1.defineMIME=defineMIME,CodeMirror$1.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),CodeMirror$1.defineMIME("text/plain","null"),CodeMirror$1.defineExtension=function(e,t){CodeMirror$1.prototype[e]=t},CodeMirror$1.defineDocExtension=function(e,t){we.prototype[e]=t},CodeMirror$1.fromTextArea=fromTextArea,addLegacyProps(CodeMirror$1),CodeMirror$1.version="5.25.2",CodeMirror$1})},193:function(e,t,r){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(t,r){function readRegexp(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function ret(e,t,r){return n=e,i=r,t}function tokenBase(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=tokenString(r),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return ret("number","number");if("."==r&&e.match(".."))return ret("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return ret(r);if("="==r&&e.eat(">"))return ret("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),ret("number","number");if("0"==r&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),ret("number","number");if("0"==r&&e.eat(/b/i))return e.eatWhile(/[01]/i),ret("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),ret("number","number");if("/"==r)return e.eat("*")?(t.tokenize=tokenComment,tokenComment(e,t)):e.eat("/")?(e.skipToEnd(),ret("comment","comment")):expressionAllowed(e,t,1)?(readRegexp(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),ret("regexp","string-2")):(e.eatWhile(p),ret("operator","operator",e.current()));if("`"==r)return t.tokenize=tokenQuasi,tokenQuasi(e,t);if("#"==r)return e.skipToEnd(),ret("error","error");if(p.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||e.eatWhile(p),ret("operator","operator",e.current());if(u.test(r)){e.eatWhile(u);var n=e.current(),i=d.propertyIsEnumerable(n)&&d[n];return i&&"."!=t.lastType?ret(i.type,i.style,n):ret("variable","variable",n)}}function tokenString(e){return function(t,r){var n,i=!1;if(l&&"@"==t.peek()&&t.match(f))return r.tokenize=tokenBase,ret("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=tokenBase),ret("string","string")}}function tokenComment(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=tokenBase;break}n="*"==r}return ret("comment","comment")}function tokenQuasi(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=tokenBase;break}n=!n&&"\\"==r}return ret("quasi","string-2",e.current())}function findFatArrow(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(c){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var l=e.string.charAt(a),s=h.indexOf(l);if(s>=0&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(u.test(l))o=!0;else{if(/["'\/]/.test(l))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}function JSLexical(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function inScope(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function parseJS(e,t,r,n,i){var o=e.cc;for(m.state=e,m.stream=i,m.marked=null,m.cc=o,m.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():s?expression:statement;if(a(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return m.marked?m.marked:"variable"==r&&inScope(e,n)?"variable-2":t}}}function pass(){for(var e=arguments.length-1;e>=0;e--)m.cc.push(arguments[e])}function cont(){return pass.apply(null,arguments),!0}function register(e){function inList(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var t=m.state;if(m.marked="def",t.context){if(inList(t.localVars))return;t.localVars={name:e,next:t.localVars}}else{if(inList(t.globalVars))return;r.globalVars&&(t.globalVars={name:e,next:t.globalVars})}}function pushcontext(){m.state.context={prev:m.state.context,vars:m.state.localVars},m.state.localVars=v}function popcontext(){m.state.localVars=m.state.context.vars,m.state.context=m.state.context.prev}function pushlex(e,t){var r=function(){var r=m.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new JSLexical(n,m.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function poplex(){var e=m.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function expect(e){function exp(t){return t==e?cont():";"==e?pass():cont(exp)}return exp}function statement(e,t){return"var"==e?cont(pushlex("vardef",t.length),vardef,expect(";"),poplex):"keyword a"==e?cont(pushlex("form"),parenExpr,statement,poplex):"keyword b"==e?cont(pushlex("form"),statement,poplex):"{"==e?cont(pushlex("}"),block,poplex):";"==e?cont():"if"==e?("else"==m.state.lexical.info&&m.state.cc[m.state.cc.length-1]==poplex&&m.state.cc.pop()(),cont(pushlex("form"),parenExpr,statement,poplex,maybeelse)):"function"==e?cont(functiondef):"for"==e?cont(pushlex("form"),forspec,statement,poplex):"variable"==e?cont(pushlex("stat"),maybelabel):"switch"==e?cont(pushlex("form"),parenExpr,pushlex("}","switch"),expect("{"),block,poplex,poplex):"case"==e?cont(expression,expect(":")):"default"==e?cont(expect(":")):"catch"==e?cont(pushlex("form"),pushcontext,expect("("),funarg,expect(")"),statement,poplex,popcontext):"class"==e?cont(pushlex("form"),className,poplex):"export"==e?cont(pushlex("stat"),afterExport,poplex):"import"==e?cont(pushlex("stat"),afterImport,poplex):"module"==e?cont(pushlex("form"),pattern,pushlex("}"),expect("{"),block,poplex,poplex):"type"==e?cont(typeexpr,expect("operator"),typeexpr,expect(";")):"async"==e?cont(statement):"@"==t?cont(expression,statement):pass(pushlex("stat"),expression,expect(";"),poplex)}function expression(e){return expressionInner(e,!1)}function expressionNoComma(e){return expressionInner(e,!0)}function parenExpr(e){return"("!=e?pass():cont(pushlex(")"),expression,expect(")"),poplex)}function expressionInner(e,t){if(m.state.fatArrowAt==m.stream.start){var r=t?arrowBodyNoComma:arrowBody;if("("==e)return cont(pushcontext,pushlex(")"),commasep(pattern,")"),poplex,expect("=>"),r,popcontext);if("variable"==e)return pass(pushcontext,pattern,expect("=>"),r,popcontext)}var n=t?maybeoperatorNoComma:maybeoperatorComma;return g.hasOwnProperty(e)?cont(n):"function"==e?cont(functiondef,n):"class"==e?cont(pushlex("form"),classExpression,poplex):"keyword c"==e||"async"==e?cont(t?maybeexpressionNoComma:maybeexpression):"("==e?cont(pushlex(")"),maybeexpression,expect(")"),poplex,n):"operator"==e||"spread"==e?cont(t?expressionNoComma:expression):"["==e?cont(pushlex("]"),arrayLiteral,poplex,n):"{"==e?contCommasep(objprop,"}",null,n):"quasi"==e?pass(quasi,n):"new"==e?cont(maybeTarget(t)):cont()}function maybeexpression(e){return e.match(/[;\}\)\],]/)?pass():pass(expression)}function maybeexpressionNoComma(e){return e.match(/[;\}\)\],]/)?pass():pass(expressionNoComma)}function maybeoperatorComma(e,t){return","==e?cont(expression):maybeoperatorNoComma(e,t,!1)}function maybeoperatorNoComma(e,t,r){var n=0==r?maybeoperatorComma:maybeoperatorNoComma,i=0==r?expression:expressionNoComma;return"=>"==e?cont(pushcontext,r?arrowBodyNoComma:arrowBody,popcontext):"operator"==e?/\+\+|--/.test(t)?cont(n):"?"==t?cont(expression,expect(":"),i):cont(i):"quasi"==e?pass(quasi,n):";"!=e?"("==e?contCommasep(expressionNoComma,")","call",n):"."==e?cont(property,n):"["==e?cont(pushlex("]"),maybeexpression,expect("]"),poplex,n):void 0:void 0;
+}function quasi(e,t){return"quasi"!=e?pass():"${"!=t.slice(t.length-2)?cont(quasi):cont(expression,continueQuasi)}function continueQuasi(e){if("}"==e)return m.marked="string-2",m.state.tokenize=tokenQuasi,cont(quasi)}function arrowBody(e){return findFatArrow(m.stream,m.state),pass("{"==e?statement:expression)}function arrowBodyNoComma(e){return findFatArrow(m.stream,m.state),pass("{"==e?statement:expressionNoComma)}function maybeTarget(e){return function(t){return"."==t?cont(e?targetNoComma:target):pass(e?expressionNoComma:expression)}}function target(e,t){if("target"==t)return m.marked="keyword",cont(maybeoperatorComma)}function targetNoComma(e,t){if("target"==t)return m.marked="keyword",cont(maybeoperatorNoComma)}function maybelabel(e){return":"==e?cont(poplex,statement):pass(maybeoperatorComma,expect(";"),poplex)}function property(e){if("variable"==e)return m.marked="property",cont()}function objprop(e,t){return"async"==e?(m.marked="property",cont(objprop)):"variable"==e||"keyword"==m.style?(m.marked="property",cont("get"==t||"set"==t?getterSetter:afterprop)):"number"==e||"string"==e?(m.marked=l?"property":m.style+" property",cont(afterprop)):"jsonld-keyword"==e?cont(afterprop):"modifier"==e?cont(objprop):"["==e?cont(expression,expect("]"),afterprop):"spread"==e?cont(expression):":"==e?pass(afterprop):void 0}function getterSetter(e){return"variable"!=e?pass(afterprop):(m.marked="property",cont(functiondef))}function afterprop(e){return":"==e?cont(expressionNoComma):"("==e?pass(functiondef):void 0}function commasep(e,t,r){function proceed(n,i){if(r?r.indexOf(n)>-1:","==n){var o=m.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),cont(function(r,n){return r==t||n==t?pass():pass(e)},proceed)}return n==t||i==t?cont():cont(expect(t))}return function(r,n){return r==t||n==t?cont():pass(e,proceed)}}function contCommasep(e,t,r){for(var n=3;n"==e)return cont(typeexpr)}function typeprop(e,t){return"variable"==e||"keyword"==m.style?(m.marked="property",cont(typeprop)):"?"==t?cont(typeprop):":"==e?cont(typeexpr):void 0}function typearg(e){return"variable"==e?cont(typearg):":"==e?cont(typeexpr):void 0}function afterType(e,t){return"<"==t?cont(pushlex(">"),commasep(typeexpr,">"),poplex,afterType):"|"==t||"."==e?cont(typeexpr):"["==e?cont(expect("]"),afterType):void 0}function vardef(){return pass(pattern,maybetype,maybeAssign,vardefCont)}function pattern(e,t){return"modifier"==e?cont(pattern):"variable"==e?(register(t),cont()):"spread"==e?cont(pattern):"["==e?contCommasep(pattern,"]"):"{"==e?contCommasep(proppattern,"}"):void 0}function proppattern(e,t){return"variable"!=e||m.stream.match(/^\s*:/,!1)?("variable"==e&&(m.marked="property"),"spread"==e?cont(pattern):"}"==e?pass():cont(expect(":"),pattern,maybeAssign)):(register(t),cont(maybeAssign))}function maybeAssign(e,t){if("="==t)return cont(expressionNoComma)}function vardefCont(e){if(","==e)return cont(vardef)}function maybeelse(e,t){if("keyword b"==e&&"else"==t)return cont(pushlex("form","else"),statement,poplex)}function forspec(e){if("("==e)return cont(pushlex(")"),forspec1,expect(")"),poplex)}function forspec1(e){return"var"==e?cont(vardef,expect(";"),forspec2):";"==e?cont(forspec2):"variable"==e?cont(formaybeinof):pass(expression,expect(";"),forspec2)}function formaybeinof(e,t){return"in"==t||"of"==t?(m.marked="keyword",cont(expression)):cont(maybeoperatorComma,forspec2)}function forspec2(e,t){return";"==e?cont(forspec3):"in"==t||"of"==t?(m.marked="keyword",cont(expression)):pass(expression,expect(";"),forspec3)}function forspec3(e){")"!=e&&cont(expression)}function functiondef(e,t){return"*"==t?(m.marked="keyword",cont(functiondef)):"variable"==e?(register(t),cont(functiondef)):"("==e?cont(pushcontext,pushlex(")"),commasep(funarg,")"),poplex,maybetype,statement,popcontext):c&&"<"==t?cont(pushlex(">"),commasep(typeexpr,">"),poplex,functiondef):void 0}function funarg(e){return"spread"==e?cont(funarg):pass(pattern,maybetype,maybeAssign)}function classExpression(e,t){return"variable"==e?className(e,t):classNameAfter(e,t)}function className(e,t){if("variable"==e)return register(t),cont(classNameAfter)}function classNameAfter(e,t){return"<"==t?cont(pushlex(">"),commasep(typeexpr,">"),poplex,classNameAfter):"extends"==t||"implements"==t||c&&","==e?cont(c?typeexpr:expression,classNameAfter):"{"==e?cont(pushlex("}"),classBody,poplex):void 0}function classBody(e,t){return"variable"==e||"keyword"==m.style?("async"==t||"static"==t||"get"==t||"set"==t||c&&("public"==t||"private"==t||"protected"==t||"readonly"==t||"abstract"==t))&&m.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(m.marked="keyword",cont(classBody)):(m.marked="property",cont(c?classfield:functiondef,classBody)):"["==e?cont(expression,expect("]"),c?classfield:functiondef,classBody):"*"==t?(m.marked="keyword",cont(classBody)):";"==e?cont(classBody):"}"==e?cont():"@"==t?cont(expression,classBody):void 0}function classfield(e,t){return"?"==t?cont(classfield):":"==e?cont(typeexpr,maybeAssign):"="==t?cont(expressionNoComma):pass(functiondef)}function afterExport(e,t){return"*"==t?(m.marked="keyword",cont(maybeFrom,expect(";"))):"default"==t?(m.marked="keyword",cont(expression,expect(";"))):"{"==e?cont(commasep(exportField,"}"),maybeFrom,expect(";")):pass(statement)}function exportField(e,t){return"as"==t?(m.marked="keyword",cont(expect("variable"))):"variable"==e?pass(expressionNoComma,exportField):void 0}function afterImport(e){return"string"==e?cont():pass(importSpec,maybeMoreImports,maybeFrom)}function importSpec(e,t){return"{"==e?contCommasep(importSpec,"}"):("variable"==e&®ister(t),"*"==t&&(m.marked="keyword"),cont(maybeAs))}function maybeMoreImports(e){if(","==e)return cont(importSpec,maybeMoreImports)}function maybeAs(e,t){if("as"==t)return m.marked="keyword",cont(importSpec)}function maybeFrom(e,t){if("from"==t)return m.marked="keyword",cont(expression)}function arrayLiteral(e){return"]"==e?cont():pass(commasep(expressionNoComma,"]"))}function isContinuedStatement(e,t){return"operator"==e.lastType||","==e.lastType||p.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var n,i,o=t.indentUnit,a=r.statementIndent,l=r.jsonld,s=r.json||l,c=r.typescript,u=r.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function kw(e){return{type:e,style:"keyword"}}var e=kw("keyword a"),t=kw("keyword b"),r=kw("keyword c"),n=kw("operator"),i={type:"atom",style:"atom"},o={if:kw("if"),while:e,with:e,else:t,do:t,try:t,finally:t,return:r,break:r,continue:r,new:kw("new"),delete:r,throw:r,debugger:r,var:kw("var"),const:kw("var"),let:kw("var"),function:kw("function"),catch:kw("catch"),for:kw("for"),switch:kw("switch"),case:kw("case"),default:kw("default"),in:n,typeof:n,instanceof:n,true:i,false:i,null:i,undefined:i,NaN:i,Infinity:i,this:kw("this"),class:kw("class"),super:kw("atom"),yield:r,export:kw("export"),import:kw("import"),extends:r,await:r,async:kw("async")};if(c){var a={type:"variable",style:"variable-3"},l={interface:kw("class"),implements:r,namespace:r,module:kw("module"),enum:kw("module"),type:kw("type"),public:kw("modifier"),private:kw("modifier"),protected:kw("modifier"),abstract:kw("modifier"),as:n,string:a,number:a,boolean:a,any:a};for(var s in l)o[s]=l[s]}return o}(),p=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,h="([{}])",g={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},m={state:null,column:null,marked:null,cc:null},v={name:"this",next:{name:"arguments"}};return poplex.lex=!0,{startState:function(e){var t={tokenize:tokenBase,lastType:"sof",cc:[],lexical:new JSLexical((e||0)-o,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),findFatArrow(e,t)),t.tokenize!=tokenComment&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",parseJS(t,r,n,i,e))},indent:function(t,n){if(t.tokenize==tokenComment)return e.Pass;if(t.tokenize!=tokenBase)return 0;var i,l=n&&n.charAt(0),s=t.lexical;if(!/^\s*else\b/.test(n))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==poplex)s=s.prev;else if(u!=maybeelse)break}for(;("stat"==s.type||"form"==s.type)&&("}"==l||(i=t.cc[t.cc.length-1])&&(i==maybeoperatorComma||i==maybeoperatorNoComma)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev;a&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var d=s.type,p=l==d;return"vardef"==d?s.indented+("operator"==t.lastType||","==t.lastType?s.info+1:0):"form"==d&&"{"==l?s.indented:"form"==d?s.indented+o:"stat"==d?s.indented+(isContinuedStatement(t,n)?a||o:0):"switch"!=s.info||p||0==r.doubleIndentSwitch?s.align?s.column+(p?0:1):s.indented+(p?0:o):s.indented+(/^(?:case|default)\b/.test(n)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:l,jsonMode:s,expressionAllowed:expressionAllowed,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=expression&&t!=expressionNoComma||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},256:function(e,t,r){!function(e){e(r(58),r(257),r(255))}(function(e){"use strict";function Context(e,t,r,n){this.state=e,this.mode=t,this.depth=r,this.prev=n}function copyContext(t){return new Context(e.copyState(t.mode,t.state),t.mode,t.depth,t.prev&©Context(t.prev))}e.defineMode("jsx",function(t,r){function flatXMLIndent(e){var t=e.tagName;e.tagName=null;var r=n.indent(e,"");return e.tagName=t,r}function token(e,t){return t.context.mode==n?xmlToken(e,t,t.context):jsToken(e,t,t.context)}function xmlToken(r,o,a){if(2==a.depth)return r.match(/^.*?\*\//)?a.depth=1:r.skipToEnd(),"comment";if("{"==r.peek()){n.skipAttribute(a.state);var l=flatXMLIndent(a.state),s=a.state.context;if(s&&r.match(/^[^>]*>\s*$/,!1)){for(;s.prev&&!s.startOfLine;)s=s.prev;s.startOfLine?l-=t.indentUnit:a.prev.state.lexical&&(l=a.prev.state.lexical.indented)}else 1==a.depth&&(l+=t.indentUnit);return o.context=new Context(e.startState(i,l),i,0,o.context),null}if(1==a.depth){if("<"==r.peek())return n.skipAttribute(a.state),o.context=new Context(e.startState(n,flatXMLIndent(a.state)),n,0,o.context),null;if(r.match("//"))return r.skipToEnd(),"comment";if(r.match("/*"))return a.depth=2,token(r,o)}var c,u=n.token(r,a.state),d=r.current();return/\btag\b/.test(u)?/>$/.test(d)?a.state.context?a.depth=0:o.context=o.context.prev:/^-1&&r.backUp(d.length-c),u}function jsToken(t,r,o){if("<"==t.peek()&&i.expressionAllowed(t,o.state))return i.skipExpression(o.state),r.context=new Context(e.startState(n,i.indent(o.state,"")),n,0,r.context),null;var a=i.token(t,o.state);if(!a&&null!=o.depth){var l=t.current();"{"==l?o.depth++:"}"==l&&0==--o.depth&&(r.context=r.context.prev)}return a}var n=e.getMode(t,{name:"xml",allowMissing:!0,multilineTagIndentPastTag:!1}),i=e.getMode(t,r&&r.base||"javascript");return{startState:function(){return{context:new Context(e.startState(i),i)}},copyState:function(e){return{context:copyContext(e.context)}},token:token,indent:function(e,t,r){return e.context.mode.indent(e.context.state,t,r)},innerMode:function(e){return e.context}}},"xml","javascript"),e.defineMIME("text/jsx","jsx"),e.defineMIME("text/typescript-jsx",{name:"jsx",base:{name:"javascript",typescript:!0}})})},257:function(e,t,r){!function(e){e(r(58))}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(n,i){function inText(e,t){function chain(r){return t.tokenize=r,r(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?chain(inBlock("atom","]]>")):null:e.match("--")?chain(inBlock("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),chain(doctype(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=inBlock("meta","?>"),"meta"):(c=e.eat("/")?"closeTag":"openTag",t.tokenize=inTag,"tag bracket");if("&"==r){var n;return n=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),n?"atom":"error"}return e.eatWhile(/[^&<]/),null}function inTag(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=inText,c=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return c="equals",null;if("<"==r){t.tokenize=inText,t.state=baseState,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=inAttribute(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function inAttribute(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=inTag;break}return"string"};return t.isInAttribute=!0,t}function inBlock(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=inText;break}r.next()}return e}}function doctype(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=doctype(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=inText;break}return r.tokenize=doctype(e-1),r.tokenize(t,r)}}return"meta"}}function Context(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(a.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function popContext(e){e.context&&(e.context=e.context.prev)}function maybePopContext(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!a.contextGrabbers.hasOwnProperty(r)||!a.contextGrabbers[r].hasOwnProperty(t))return;popContext(e)}}function baseState(e,t,r){return"openTag"==e?(r.tagStart=t.column(),tagNameState):"closeTag"==e?closeTagNameState:baseState}function tagNameState(e,t,r){return"word"==e?(r.tagName=t.current(),u="tag",attrState):(u="error",tagNameState)}function closeTagNameState(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&a.implicitlyClosed.hasOwnProperty(r.context.tagName)&&popContext(r),r.context&&r.context.tagName==n||a.matchClosing===!1?(u="tag",closeState):(u="tag error",closeStateErr)}return u="error",closeStateErr}function closeState(e,t,r){return"endTag"!=e?(u="error",closeState):(popContext(r),baseState)}function closeStateErr(e,t,r){return u="error",closeState(e,t,r)}function attrState(e,t,r){if("word"==e)return u="attribute",attrEqState;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||a.autoSelfClosers.hasOwnProperty(n)?maybePopContext(r,n):(maybePopContext(r,n),r.context=new Context(r,n,i==r.indented)),baseState}return u="error",attrState}function attrEqState(e,t,r){return"equals"==e?attrValueState:(a.allowMissing||(u="error"),attrState(e,t,r))}function attrValueState(e,t,r){return"string"==e?attrContinuedState:"word"==e&&a.allowUnquoted?(u="string",attrState):(u="error",attrState(e,t,r))}function attrContinuedState(e,t,r){return"string"==e?attrContinuedState:attrState(e,t,r)}var o=n.indentUnit,a={},l=i.htmlMode?t:r;for(var s in l)a[s]=l[s];for(var s in i)a[s]=i[s];var c,u;return inText.isInText=!0,{startState:function(e){var t={tokenize:inText,state:baseState,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;c=null;var r=t.tokenize(e,t);return(r||c)&&"comment"!=r&&(u=null,t.state=t.state(c||r,e,t),u&&(r="error"==u?r+" error":u)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+o;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=inTag&&t.tokenize!=inText)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return a.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+o*(a.multilineTagIndentFactor||1);if(a.alignCDATA&&/$/,blockCommentStart:"",configuration:a.htmlMode?"html":"xml",helperType:a.htmlMode?"html":"xml",skipAttribute:function(e){e.state==attrValueState&&(e.state=attrState)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},516:function(e,t,r){"use strict";function normalizeLineEndings(e){return e?e.replace(/\r\n|\r/g,"\n"):e}var n=r(1),i=r(70),o=i.findDOMNode,a=r(36),l=r(150),s=n.createClass({displayName:"CodeMirror",propTypes:{className:n.PropTypes.any,codeMirrorInstance:n.PropTypes.func,defaultValue:n.PropTypes.string,onChange:n.PropTypes.func,onFocusChange:n.PropTypes.func,onScroll:n.PropTypes.func,options:n.PropTypes.object,path:n.PropTypes.string,value:n.PropTypes.string,preserveScrollPosition:n.PropTypes.bool},getDefaultProps:function getDefaultProps(){return{preserveScrollPosition:!1}},getCodeMirrorInstance:function getCodeMirrorInstance(){return this.props.codeMirrorInstance||r(58)},getInitialState:function getInitialState(){return{isFocused:!1}},componentWillMount:function componentWillMount(){this.componentWillReceiveProps=l(this.componentWillReceiveProps,0)},componentDidMount:function componentDidMount(){var e=o(this.refs.textarea),t=this.getCodeMirrorInstance();this.codeMirror=t.fromTextArea(e,this.props.options),this.codeMirror.on("change",this.codemirrorValueChanged),this.codeMirror.on("focus",this.focusChanged.bind(this,!0)),this.codeMirror.on("blur",this.focusChanged.bind(this,!1)),this.codeMirror.on("scroll",this.scrollChanged),this.codeMirror.setValue(this.props.defaultValue||this.props.value||"")},componentWillUnmount:function componentWillUnmount(){this.codeMirror&&this.codeMirror.toTextArea()},componentWillReceiveProps:function componentWillReceiveProps(e){if(this.codeMirror&&void 0!==e.value&&normalizeLineEndings(this.codeMirror.getValue())!==normalizeLineEndings(e.value))if(this.props.preserveScrollPosition){var t=this.codeMirror.getScrollInfo();this.codeMirror.setValue(e.value),this.codeMirror.scrollTo(t.left,t.top)}else this.codeMirror.setValue(e.value);if("object"==typeof e.options)for(var r in e.options)e.options.hasOwnProperty(r)&&this.codeMirror.setOption(r,e.options[r])},getCodeMirror:function getCodeMirror(){return this.codeMirror},focus:function focus(){this.codeMirror&&this.codeMirror.focus()},focusChanged:function focusChanged(e){this.setState({isFocused:e}),this.props.onFocusChange&&this.props.onFocusChange(e)},scrollChanged:function scrollChanged(e){this.props.onScroll&&this.props.onScroll(e.getScrollInfo())},codemirrorValueChanged:function codemirrorValueChanged(e,t){this.props.onChange&&"setValue"!==t.origin&&this.props.onChange(e.getValue(),t)},render:function render(){var e=a("ReactCodeMirror",this.state.isFocused?"ReactCodeMirror--focused":null,this.props.className);return n.createElement("div",{className:e},n.createElement("textarea",{ref:"textarea",name:this.props.path,defaultValue:this.props.value,autoComplete:"off"}))}});e.exports=s},633:function(e,t,r){t=e.exports=r(119)(void 0),t.push([e.id,'.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}',""])},634:function(e,t,r){t=e.exports=r(119)(void 0),t.push([e.id,".cm-s-base16-light.CodeMirror{background:#f5f5f5;color:#202020}.cm-s-base16-light div.CodeMirror-selected{background:#e0e0e0}.cm-s-base16-light .CodeMirror-line::selection,.cm-s-base16-light .CodeMirror-line>span::selection,.cm-s-base16-light .CodeMirror-line>span>span::selection{background:#e0e0e0}.cm-s-base16-light .CodeMirror-line::-moz-selection,.cm-s-base16-light .CodeMirror-line>span::-moz-selection,.cm-s-base16-light .CodeMirror-line>span>span::-moz-selection{background:#e0e0e0}.cm-s-base16-light .CodeMirror-gutters{background:#f5f5f5;border-right:0}.cm-s-base16-light .CodeMirror-guttermarker{color:#ac4142}.cm-s-base16-light .CodeMirror-guttermarker-subtle,.cm-s-base16-light .CodeMirror-linenumber{color:#b0b0b0}.cm-s-base16-light .CodeMirror-cursor{border-left:1px solid #505050}.cm-s-base16-light span.cm-comment{color:#8f5536}.cm-s-base16-light span.cm-atom,.cm-s-base16-light span.cm-number{color:#aa759f}.cm-s-base16-light span.cm-attribute,.cm-s-base16-light span.cm-property{color:#90a959}.cm-s-base16-light span.cm-keyword{color:#ac4142}.cm-s-base16-light span.cm-string{color:#f4bf75}.cm-s-base16-light span.cm-variable{color:#90a959}.cm-s-base16-light span.cm-variable-2{color:#6a9fb5}.cm-s-base16-light span.cm-def{color:#d28445}.cm-s-base16-light span.cm-bracket{color:#202020}.cm-s-base16-light span.cm-tag{color:#ac4142}.cm-s-base16-light span.cm-link{color:#aa759f}.cm-s-base16-light span.cm-error{background:#ac4142;color:#505050}.cm-s-base16-light .CodeMirror-activeline-background{background:#dddcdc}.cm-s-base16-light .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}",""])},700:function(e,t,r){var n=r(633);"string"==typeof n&&(n=[[e.id,n,""]]);r(2)(n,{});n.locals&&(e.exports=n.locals)},701:function(e,t,r){var n=r(634);"string"==typeof n&&(n=[[e.id,n,""]]);r(2)(n,{});n.locals&&(e.exports=n.locals)}});
\ No newline at end of file
diff --git a/arui-demo/styleguide/build/bundle.39de39a0.js b/arui-demo/styleguide/build/bundle.39de39a0.js
new file mode 100644
index 0000000000..98cc60cb8a
--- /dev/null
+++ b/arui-demo/styleguide/build/bundle.39de39a0.js
@@ -0,0 +1,40 @@
+!function(e){function __webpack_require__(t){if(n[t])return n[t].exports;var r=n[t]={exports:{},id:t,loaded:!1};return e[t].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}var t=window.webpackJsonp;window.webpackJsonp=function webpackJsonpCallback(n,o){for(var i,a,s=0,u=[];s=0&&l.splice(t,1)}function createStyleElement(e){var t=document.createElement("style");return e.attrs.type="text/css",attachTagAttrs(t,e.attrs),insertStyleElement(e,t),t}function createLinkElement(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",attachTagAttrs(t,e.attrs),insertStyleElement(e,t),t}function attachTagAttrs(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function addStyle(e,t){var n,r,o;if(t.singleton){var i=u++;n=s||(s=createStyleElement(t)),r=applyToSingletonTag.bind(null,n,i,!1),o=applyToSingletonTag.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=createLinkElement(t),r=updateLink.bind(null,n,t),o=function(){removeStyleElement(n),n.href&&URL.revokeObjectURL(n.href)}):(n=createStyleElement(t),r=applyToTag.bind(null,n),o=function(){removeStyleElement(n)});return r(e),function updateStyle(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}function applyToSingletonTag(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=p(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function applyToTag(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function updateLink(e,t,n){var r=n.css,o=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||i)&&(r=c(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}var r={},o=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},i=o(function(){return window&&document&&document.all&&!window.atob}),a=function(e){var t={};return function(n){return"undefined"==typeof t[n]&&(t[n]=e.call(this,n)),t[n]}}(function(e){return document.querySelector(e)}),s=null,u=0,l=[],c=n(762);e.exports=function(e,t){t=t||{},t.attrs="object"==typeof t.attrs?t.attrs:{},"undefined"==typeof t.singleton&&(t.singleton=i()),"undefined"==typeof t.insertInto&&(t.insertInto="head"),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var n=listToStyles(e);return addStylesToDom(n,t),function update(e){for(var o=[],i=0;i2&&void 0!==arguments[2]&&arguments[2];if(Object.is(e,t))return!0;if("object"!==("undefined"==typeof e?"undefined":n(e))||null===e||"object"!==("undefined"==typeof t?"undefined":n(t))||null===t)return!1;if(e.prototype!==t.prototype)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=r.bind(t);i.length>0;){var u=i.pop();if(!s(u))return!1;var l=e[u],c=t[u];if(!Object.is(l,c)){if(!o||"object"!==("undefined"==typeof l?"undefined":n(l))||"object"!==("undefined"==typeof c?"undefined":n(c))||null===l||null===c)return!1;if(!isEqual(l,c,o))return!1}}return!0}function shallow(e,t,n){return!isEqual(this.props,e)||!isEqual(this.state,t)||!isEqual(this.context,n)}function deep(e,t,n){return!isEqual(this.props,e,!0)||!isEqual(this.state,t,!0)||!isEqual(this.context,n,!0)}function performance(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(t){t.prototype.shouldComponentUpdate=e?deep:shallow}}Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.isEqual=isEqual,t.default=performance;var r=Object.prototype.hasOwnProperty},function(e,t,n){"use strict";var r=n(17),o=r;e.exports=o},function(e,t){"use strict";e.exports=function evalInContext(e,t,n){var r=new Function("require","state","setState","__setInitialState",e+n);return r.bind(null,t)}},function(e,t){"use strict";e.exports=function requireInRuntime(e,t){if(!(t in e))throw new Error('require() statements can be added only by editing a Markdown example file: require("'+t+'")');return e[t]}},function(e,t){"use strict";function reactProdInvariant(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.control.value.length;this.control.setSelectionRange(e,t)}},{key:"getControl",value:function getControl(){return this.control}},{key:"changeValue",value:function changeValue(e){this.setState({value:e}),this.props.onChange&&this.props.onChange(e)}},{key:"ensureErrorPopupTarget",value:function ensureErrorPopupTarget(){this.props.error&&this.props.showErrorPopup&&this.getFocused()&&this.errorPopup.setTarget(this.root)}},{key:"getFocused",value:function getFocused(){return void 0!==this.props.focused?this.props.focused:this.state.focused}},{key:"getOptimalSize",value:function getOptimalSize(){var e=this.props,t=e.mask,n=e.maxLength,r=void 0!==t?t.length:n||1;return Math.floor(r*I.INPUT_SIZE_CORRECTION_RATIO)}}]),Input}(f.default.Component),s.propTypes={type:m.default.oneOf(["number","card","email","file","hidden","money","password","tel","text"]),width:m.default.oneOf(["default","available"]),view:m.default.oneOf(["default","line"]),autocomplete:m.default.bool,disabled:m.default.bool,disabledAttr:m.default.bool,focused:m.default.bool,maxLength:m.default.number,icon:m.default.node,clear:m.default.bool,id:m.default.string,name:m.default.string,value:m.default.string,tabIndex:m.default.number,placeholder:m.default.string,mask:m.default.string,maskFormatCharacters:m.default.objectOf(m.default.shape({validate:m.default.func.isRequired,transform:m.default.func})),pattern:m.default.string,noValidate:m.default.bool,leftAddons:m.default.node,rightAddons:m.default.node,error:m.default.node,errorDirections:m.default.arrayOf(m.default.string),showErrorPopup:m.default.bool,size:m.default.oneOf(["s","m","l","xl"]),theme:m.default.oneOf(["alfa-on-color","alfa-on-white"]),className:m.default.oneOfType([m.default.func,m.default.string]),title:m.default.string,onChange:m.default.func,onFocus:m.default.func,onClick:m.default.func,onBlur:m.default.func,onClearClick:m.default.func,onKeyDown:m.default.func,onKeyUp:m.default.func,onPaste:m.default.func,onTouchStart:m.default.func,onTouchEnd:m.default.func,onTouchMove:m.default.func,onTouchCancel:m.default.func,onProcessMaskInputEvent:m.default.func},s.defaultProps={noValidate:!1,showErrorPopup:!0,errorDirections:["right-center","right-top","right-bottom","bottom-left"],size:"m",type:"text",view:"default"},a=u,_applyDecoratedDescriptor(a.prototype,"handleFocus",[p.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleFocus"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleClick",[p.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleClick"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleBlur",[p.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleBlur"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleChange",[p.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleChange"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleClearClick",[p.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleClearClick"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleKeyDown",[p.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleKeyDown"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleKeyUp",[p.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleKeyUp"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handlePaste",[p.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handlePaste"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleTouchStart",[p.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleTouchStart"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleTouchEnd",[p.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleTouchEnd"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleTouchMove",[p.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleTouchMove"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleTouchCancel",[p.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleTouchCancel"),a.prototype),i=a))||i)||i);t.default=E},function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _applyDecoratedDescriptor(e,t,n,r,o){var i={};return Object.keys(r).forEach(function(e){i[e]=r[e]}),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=n.slice().reverse().reduce(function(n,r){return r(e,t,n)||n},i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(e,t,i),i=null),i}Object.defineProperty(t,"__esModule",{value:!0});var r,o,i,a,s,u,l=function(){function defineProperties(e,t){for(var n=0;n1){for(var h=Array(f),m=0;m1){for(var A=Array(g),y=0;y1)for(var n=1;nn.right||e.pageYn.bottom}function isNodeOutsideElement(e,t){return!(t.contains(e)||t===e)}function isEventOutsideClientBounds(e,t){var n=t.getBoundingClientRect();return e.clientXn.right||e.clientYn.bottom}Object.defineProperty(t,"__esModule",{value:!0}),t.isEventOusideBounds=isEventOusideBounds,t.isNodeOutsideElement=isNodeOutsideElement,t.isEventOutsideClientBounds=isEventOutsideClientBounds},,function(e,t,n){function startOfDay(e){var t=r(e);return t.setHours(0,0,0,0),t}var r=n(18);e.exports=startOfDay},function(e,t){"use strict";function decimal(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=48&&t<=57}e.exports=decimal},function(e,t,n){function ListCache(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t]/;e.exports=escapeTextContentForBrowser},function(e,t,n){"use strict";var r,o=n(19),i=n(103),a=/^[ \r\n\t\f]/,s=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,u=n(111),l=u(function(e,t){if(e.namespaceURI!==i.svg||"innerHTML"in e)e.innerHTML=t;else{r=r||document.createElement("div"),r.innerHTML="";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(o.canUseDOM){var c=document.createElement("div");c.innerHTML=" ",""===c.innerHTML&&(l=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),c=null}e.exports=l},function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(595);Object.defineProperty(t,"default",{enumerable:!0,get:function get(){return _interopRequireDefault(r).default}}),Object.defineProperty(t,"styles",{enumerable:!0,get:function get(){return r.styles}})},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={SPACE:32,BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE_BREAK:19,CAPS_LOCK:20,ESCAPE:27,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,NUMBER_0:48,NUMBER_1:49,NUMBER_2:50,NUMBER_3:51,NUMBER_4:52,NUMBER_5:53,NUMBER_6:54,NUMBER_7:55,NUMBER_8:56,NUMBER_9:57,LETTER_A:65,LETTER_B:66,LETTER_C:67,LETTER_D:68,LETTER_E:69,LETTER_F:70,LETTER_G:71,LETTER_H:72,LETTER_I:73,LETTER_J:74,LETTER_K:75,LETTER_L:76,LETTER_M:77,LETTER_N:78,LETTER_O:79,LETTER_P:80,LETTER_Q:81,LETTER_R:82,LETTER_S:83,LETTER_T:84,LETTER_U:85,LETTER_V:86,LETTER_W:87,LETTER_X:88,LETTER_Y:89,LETTER_Z:90,LEFT_WINDOW_KEY:91,RIGHT_WINDOW_KEY:92,SELECT_KEY:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,MULTIPLY:106,ADD:107,SUBTRACT:109,DECIMALPOINT:110,DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUM_LOCK:144,SCROLL_LOCK:145,SEMI_COLON:186,EQUAL_SIGN:187,COMMA:188,DASH:189,PERIOD:190,FORWARD_SLASH:191,GRAVE_ACCENT:192,OPEN_BRACKET:219,BACK_SLASH:220,CLOSE_BRACKET:221,SINGLE_QUOTE:222}},function(e,t,n){function addDays(e,t){var n=r(e),o=Number(t);return n.setDate(n.getDate()+o),n}var r=n(18);e.exports=addDays},function(e,t,n){function startOfISOWeek(e){return r(e,{weekStartsOn:1})}var r=n(339);e.exports=startOfISOWeek},function(e,t){"use strict";function is(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function shallowEqual(e,t){if(is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=n.jss;if(r){var i=r.plugins.onCreateRule(e,t,n);if(i)return i}return e&&"@"===e[0]&&(0,o.default)(!1,"[JSS] Unknown at-rule %s",e),new a.default(e,t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=createRule;var r=n(77),o=_interopRequireDefault(r),i=n(390),a=_interopRequireDefault(i)},function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function indentStr(e,t){for(var n="",r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r=n.indent,i=void 0===r?0:r,a=t.fallbacks,s="";if(i++,a)if(Array.isArray(a))for(var u=0;u-1&&e%1==0&&e-1&&e%1==0&&e<=n}var n=9007199254740991;e.exports=isLength},function(e,t,n){var r=n(419),o=n(433),i=n(475),a=i&&i.isTypedArray,s=a?o(a):r;e.exports=s},function(e,t,n){function keys(e){return i(e)?r(e):o(e)}var r=n(152),o=n(421),i=n(68);e.exports=keys},function(e,t,n){"use strict";function wrapper(e,t){var n,r={};t||(t={});for(n in w)r[n]=null==t[n]?w[n]:t[n];return(r.position.indent||r.position.start)&&(r.indent=r.position.indent||[],r.position=r.position.start),parse(e,r)}function parse(e,t){function now(){return{line:fe,column:de,offset:ce+(se.offset||0)}}function parseError(e,t){var n=now();n.column+=t,n.offset+=t,re.call(ae,U[e],n,e)}function at(t){return e.charAt(t)}function flush(){he&&(me.push(he),te&&te.call(oe,he,{start:V,end:now()}),he=x)}var n,s,u,w,z,R,q,F,G,Y,W,H,Z,Q,V,J,K,X,$=t.additional,ee=t.nonTerminated,te=t.text,ne=t.reference,re=t.warning,oe=t.textContext,ie=t.referenceContext,ae=t.warningContext,se=t.position,ue=t.indent||[],le=e.length,ce=0,pe=-1,de=se.column||1,fe=se.line||1,he=x,me=[];for(V=now(),q=re?parseError:p,ce--,le++;++ce65535&&(z-=65536,G+=c(z>>>10|55296),z=56320|1023&z),z=G+c(z))):Z!==I&&q(N,K)),z?(flush(),V=now(),ce=X-1,de+=X-H+1,me.push(z),J=now(),J.offset++,ne&&ne.call(ie,z,{start:V,end:J},e.slice(H-1,X)),V=J):(u=e.slice(H-1,X),he+=u,de+=u.length,ce=X-1)}return me.join(x)}function isProhibited(e){return e>=55296&&e<=57343||e>1114111}function isWarning(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||65535===(65535&e)||65534===(65535&e)}var r=n(47),o=n(373),i=n(372),a=n(374),s=n(60),u=n(367),l=n(365);e.exports=wrapper;var c=String.fromCharCode,p=Function.prototype,d="�",f="\f",h="&",m="#",g=";",A="\n",y="x",b="X",v=" ",_="<",C="=",x="",D="\t",w={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},I="named",E="hexadecimal",k="decimal",M={};M[E]=16,M[k]=10;var S={};S[I]=l,S[k]=s,S[E]=u;var B=1,j=2,T=3,N=4,O=5,L=6,P=7,z="Numeric character references",R="Named character references",q=" must be terminated by a semicolon",F=" cannot be empty",U={};U[B]=R+q,U[j]=z+q,U[T]=R+F,U[N]=z+F,U[O]=R+" must be known",U[L]=z+" cannot be disallowed",U[P]=z+" cannot be outside the permissible Unicode range"},function(e,t,n){"use strict";function getIteratorFn(e){var t=e&&(c&&e[c]||e[p]);if("function"==typeof t)return t}function escape(e){var t=/[=:]/g,n={"=":"=0",":":"=2"},r=(""+e).replace(t,function(e){return n[e]});return"$"+r}function getComponentKey(e,t){return e&&"object"==typeof e&&null!=e.key?escape(e.key):t.toString(36)}function traverseAllChildrenImpl(e,t,n,r){var i=typeof e;if("undefined"!==i&&"boolean"!==i||(e=null),null===e||"string"===i||"number"===i||"object"===i&&e.$$typeof===o)return n(r,e,""===t?u+getComponentKey(e,0):t),1;var s,c,p=0,d=""===t?u:t+l;if(Array.isArray(e))for(var f=0;f-1?void 0:r("96",e),!a.plugins[n]){t.extractEvents?void 0:r("97",e),a.plugins[n]=t;var s=t.eventTypes;for(var u in s)publishEventForPlugin(s[u],t,u)?void 0:r("98",u,e)}}}function publishEventForPlugin(e,t,n){a.eventNameDispatchConfigs.hasOwnProperty(n)?r("99",n):void 0,a.eventNameDispatchConfigs[n]=e;var o=e.phasedRegistrationNames;if(o){for(var i in o)if(o.hasOwnProperty(i)){var s=o[i];publishRegistrationName(s,t,n)}return!0}return!!e.registrationName&&(publishRegistrationName(e.registrationName,t,n),!0)}function publishRegistrationName(e,t,n){a.registrationNameModules[e]?r("100",e):void 0,a.registrationNameModules[e]=t,a.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var r=n(11),o=(n(4),null),i={},a={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){o?r("101"):void 0,o=Array.prototype.slice.call(e),recomputePluginOrdering()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];i.hasOwnProperty(n)&&i[n]===o||(i[n]?r("102",n):void 0,i[n]=o,t=!0)}t&&recomputePluginOrdering()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return a.registrationNameModules[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var n=t.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var o=a.registrationNameModules[n[r]];if(o)return o}}return null},_resetEventPlugins:function(){o=null;for(var e in i)i.hasOwnProperty(e)&&delete i[e];a.plugins.length=0;var t=a.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=a.registrationNameModules;for(var s in r)r.hasOwnProperty(s)&&delete r[s]}};e.exports=a},function(e,t,n){"use strict";function isEndish(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e}function isMoveish(e){return"topMouseMove"===e||"topTouchMove"===e}function isStartish(e){return"topMouseDown"===e||"topTouchStart"===e}function executeDispatch(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=u.getNodeFromInstance(r),t?a.invokeGuardedCallbackWithCatch(o,n,e):a.invokeGuardedCallback(o,n,e),e.currentTarget=null}function executeDispatchesInOrder(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}function getInternalInstanceReadyForUpdate(e,t){var n=o.get(e);if(!n){return null}return n}var r=n(11),o=(n(27),n(52)),i=(n(22),n(24)),a=(n(4),n(8),{isMounted:function(e){var t=o.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,n){a.validateCallback(t,n);var r=getInternalInstanceReadyForUpdate(e);return r?(r._pendingCallbacks?r._pendingCallbacks.push(t):r._pendingCallbacks=[t],void enqueueUpdate(r)):null},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],enqueueUpdate(e)},enqueueForceUpdate:function(e){var t=getInternalInstanceReadyForUpdate(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,enqueueUpdate(t))},enqueueReplaceState:function(e,t,n){var r=getInternalInstanceReadyForUpdate(e,"replaceState");r&&(r._pendingStateQueue=[t],r._pendingReplaceState=!0,void 0!==n&&null!==n&&(a.validateCallback(n,"replaceState"),r._pendingCallbacks?r._pendingCallbacks.push(n):r._pendingCallbacks=[n]),enqueueUpdate(r))},enqueueSetState:function(e,t){var n=getInternalInstanceReadyForUpdate(e,"setState");if(n){var r=n._pendingStateQueue||(n._pendingStateQueue=[]);r.push(t),enqueueUpdate(n)}},enqueueElementInternal:function(e,t,n){e._pendingElement=t,e._context=n,enqueueUpdate(e)},validateCallback:function(e,t){e&&"function"!=typeof e?r("122",t,formatUnexpectedArgument(e)):void 0}});e.exports=a},function(e,t){"use strict";var n=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e};e.exports=n},function(e,t){"use strict";function getEventCharCode(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}e.exports=getEventCharCode},function(e,t){"use strict";function modifierStateGetter(e){var t=this,r=t.nativeEvent;if(r.getModifierState)return r.getModifierState(e);var o=n[e];return!!o&&!!r[o]}function getEventModifierState(e){return modifierStateGetter}var n={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=getEventModifierState},function(e,t){"use strict";function getEventTarget(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}e.exports=getEventTarget},function(e,t,n){"use strict";function isEventSupported(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i="function"==typeof a[n]}return!i&&r&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var r,o=n(19);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=isEventSupported},function(e,t){"use strict";function shouldUpdateReactComponent(e,t){var n=null===e||e===!1,r=null===t||t===!1;if(n||r)return n===r;var o=typeof e,i=typeof t;return"string"===o||"number"===o?"string"===i||"number"===i:"object"===i&&e.type===t.type&&e.key===t.key}e.exports=shouldUpdateReactComponent},function(e,t,n){"use strict";var r=(n(13),n(17)),o=(n(8),r);e.exports=o},function(e,t,n){(function(e){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0||e.sections.length>0||n.test(e.name)})}function filterComponentsByExactName(e,t){return e.filter(function(e){return e.name===t})}function filterComponentsInSectionsByExactName(e,t){var n=[];return e.forEach(function(e){e.components&&n.push.apply(n,_toConsumableArray(filterComponentsByExactName(e.components,t))),e.sections&&n.push.apply(n,_toConsumableArray(filterComponentsInSectionsByExactName(e.sections,t)))}),n}function getComponentNameFromHash(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.hash;if("#!/"===e.substr(0,3)){var t=e.substr(3).split("/"),n=parseInt(t[1],10);return{targetComponentName:t[0],targetComponentIndex:(0,o.default)(n)?null:n}}return{}}function filterComponentExamples(e,t){var n=Object.assign({},e);return n.props.examples=[e.props.examples[t]],n}Object.defineProperty(t,"__esModule",{value:!0}),t.slugger=void 0,t.setSlugs=setSlugs,t.globalizeComponent=globalizeComponent,t.processComponents=processComponents,t.processSections=processSections,t.getFilterRegExp=getFilterRegExp,t.filterComponentsByName=filterComponentsByName,t.filterSectionsByName=filterSectionsByName,t.filterComponentsByExactName=filterComponentsByExactName,t.filterComponentsInSectionsByExactName=filterComponentsInSectionsByExactName,t.getComponentNameFromHash=getComponentNameFromHash,t.filterComponentExamples=filterComponentExamples;var r=n(494),o=_interopRequireDefault(r),i=n(361),a=_interopRequireDefault(i),s=t.slugger=new a.default}).call(t,function(){return this}())},function(e,t){function cssWithMappingToString(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=toComment(r),i=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(i).concat([o]).join("\n")}return[n].join("\n")}function toComment(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,"+t;return"/*# "+n+" */"}e.exports=function(e){var t=[];return t.toString=function toString(){return this.map(function(t){var n=cssWithMappingToString(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o=o)return r.substr(0,o);for(;o>r.length&&t>1;)1&t&&(r+=e),t>>=1,e+=e;return r+=e,r=r.substr(0,o)}var n,r="";e.exports=repeat},function(e,t){"use strict";function trimTrailingLines(e){for(var t=String(e),r=t.length;t.charAt(--r)===n;);return t.slice(0,r+1)}e.exports=trimTrailingLines;var n="\n"},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _applyDecoratedDescriptor(e,t,n,r,o){var i={};return Object.keys(r).forEach(function(e){i[e]=r[e]}),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=n.slice().reverse().reduce(function(n,r){return r(e,t,n)||n},i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(e,t,i),i=null),i}Object.defineProperty(t,"__esModule",{value:!0});var r,o,i,a,s,u,l=function(){function defineProperties(e,t){for(var n=0;n0,r=!this.laterLimit||(0,g.default)(t,this.laterLimit)<0,o=this.earlierLimit&&(0,I.default)(this.earlierLimit,1),i=!this.earlierLimit||(0,g.default)(t,o)>=0,a=this.laterLimit&&(0,k.default)(this.laterLimit,1),s=!this.laterLimit||(0,
+g.default)(t,a)<=0;return d.default.createElement("div",{className:e("title")},this.props.showArrows&&d.default.createElement("div",{className:e("arrow",{direction:"left",double:!0,disabled:!i}),"data-step":"-12","data-disabled":!n,onClick:this.handleArrowClick}),this.props.showArrows&&d.default.createElement("div",{className:e("arrow",{direction:"left",disabled:!n}),"data-step":"-1","data-disabled":!n,onClick:this.handleArrowClick}),this.props.showArrows&&d.default.createElement("div",{className:e("arrow",{direction:"right",double:!0,disabled:!s}),"data-step":"12","data-disabled":!r,onClick:this.handleArrowClick}),this.props.showArrows&&d.default.createElement("div",{className:e("arrow",{direction:"right",disabled:!r}),"data-step":"1","data-disabled":!r,onClick:this.handleArrowClick}),d.default.createElement("div",{className:e("name")},this.props.months[t.getMonth()]+" "+t.getFullYear()))}},{key:"renderShortWeekdays",value:function renderShortWeekdays(e){return this.props.weekdays.map(function(t,n){return d.default.createElement("th",{className:e("dayname",{type:n>4&&"weekend"}),key:t},t)})}},{key:"renderMonth",value:function renderMonth(e){var t=this;return this.calculateWeeks().map(function(n){return t.renderWeek(e,n)})}},{key:"renderWeek",value:function renderWeek(e,t){var n=this;return t.map(function(t,r){var o=!n.isValidDate(t),i=n.value,a=r>4,s={};if(t){var u=i&&i.getTime()===t.getTime(),l=n.selectedFrom&&n.selectedTo&&n.selectedFrom<=t&&n.selectedTo>=t;(o||a)&&(a?s.type=o?"weekend-off":"weekend":s.type="off"),(u||l)&&(s.state="current")}var c=t&&!o?t.getTime():null;return d.default.createElement("td",{className:e("day",s),"data-day":c,key:t||"day_"+(r+1),onClick:n.handleDayClick},t?t.getDate():"")})}},{key:"handleDayClick",value:function handleDayClick(e){var t=e.target.attributes[Y];t&&this.performChange(parseInt(t.nodeValue,10))}},{key:"handleFocus",value:function handleFocus(e){this.blurTimeoutId&&(clearTimeout(this.blurTimeoutId),this.blurTimeoutId=null),this.props.onFocus&&this.props.onFocus(e)}},{key:"handleBlur",value:function handleBlur(e){var t=this;e.persist(),this.blurTimeoutId&&clearTimeout(this.blurTimeoutId),this.blurTimeoutId=setTimeout(function(){(0,U.isNodeOutsideElement)(document.activeElement,t.root)&&t.props.onBlur&&t.props.onBlur(e),t.blurTimeoutId=null},0)}},{key:"handleArrowClick",value:function handleArrowClick(e){if("true"!==e.currentTarget.attributes[H].nodeValue){var t=e.currentTarget.attributes[W].nodeValue,n=parseInt(t,10),r=new Date(this.state.month);r.setMonth(r.getMonth()+n),this.props.onMonthChange?this.props.onMonthChange(r.valueOf()):this.setState({month:r.valueOf()})}}},{key:"handleKeyDown",value:function handleKeyDown(e){switch(e.which){case z.default.DOWN_ARROW:e.preventDefault(),this.performChangeWithShift(7,!0);break;case z.default.UP_ARROW:e.preventDefault(),this.performChangeWithShift(-7,!0);break;case z.default.LEFT_ARROW:e.preventDefault(),this.performChangeWithShift(-1,!0);break;case z.default.RIGHT_ARROW:e.preventDefault(),this.performChangeWithShift(1,!0)}this.props.onKeyDown&&this.props.onKeyDown(e)}},{key:"handleKeyUp",value:function handleKeyUp(e){this.props.onKeyUp&&this.props.onKeyUp(e)}},{key:"focus",value:function focus(){this.root.focus()}},{key:"blur",value:function blur(){document.activeElement&&document.activeElement.blur()}},{key:"getNode",value:function getNode(){return this.root}},{key:"isValidDate",value:function isValidDate(e){return!!e&&(!!(e instanceof Date&&isFinite(e.valueOf()))&&!(this.earlierLimit&&this.earlierLimit>e||this.laterLimit&&this.laterLimit=0)&&(!this.laterLimit||(0,y.default)(t,this.laterLimit)<=0)}},{key:"calculateWeeks",value:function calculateWeeks(){var e=void 0,t=[],n=6,r=new Date(this.state.month),o=new Date(this.state.month),i=new Array(G).fill(null);for(o.setDate(1);o.getMonth()===r.getMonth();o.setDate(o.getDate()+1))e=(0,F.getRussianWeekDay)(o),i[e]=new Date(o.getTime()),e===n&&(t.push(i),i=new Array(G).fill(null));return e!==n&&t.push(i),t}},{key:"prepareData",value:function prepareData(e){var t=!1;e||(e=this.props,t=!0),(t||this.props.value!==e.value)&&(e.value?this.value=(0,v.default)((0,F.normalizeDate)(e.value)):this.value=null);var n=void 0;if(n=e.month?(0,F.normalizeDate)(e.month):this.value?new Date(this.value.valueOf()):new Date,this.setState({month:(0,C.default)(n)}),(t||this.props.earlierLimit!==e.earlierLimit)&&(this.earlierLimit=e.earlierLimit?(0,F.normalizeDate)(e.earlierLimit):null,this.earlierLimit&&(this.earlierLimit=(0,v.default)(this.earlierLimit),this.value))){var r=Math.max(this.value.valueOf(),this.earlierLimit.valueOf());this.value=new Date(r)}if((t||this.props.laterLimit!==e.laterLimit)&&(this.laterLimit=e.laterLimit?(0,F.normalizeDate)(e.laterLimit):null,this.laterLimit&&(this.laterLimit=(0,v.default)(this.laterLimit),this.value))){var o=Math.min(this.value.valueOf(),this.laterLimit.valueOf());this.value=new Date(o)}(t||this.props.selectedTo!==e.selectedTo)&&(this.selectedFrom=e.selectedTo?(0,F.normalizeDate)(e.selectedTo):null),(t||this.props.selectedFrom!==e.selectedFrom)&&(this.selectedFrom=e.selectedFrom?(0,F.normalizeDate)(e.selectedFrom):null)}}]),Calendar}(d.default.Component),s.propTypes={value:h.default.number,selectedFrom:h.default.number,selectedTo:h.default.number,earlierLimit:h.default.number,laterLimit:h.default.number,month:h.default.number,onValueChange:h.default.func,onMonthChange:h.default.func,outputFormat:h.default.string,months:h.default.arrayOf(h.default.string),weekdays:h.default.arrayOf(h.default.string),offDays:h.default.arrayOf(h.default.number),showArrows:h.default.bool,isKeyboard:h.default.bool,error:h.default.node,theme:h.default.oneOf(["alfa-on-color","alfa-on-white"]),className:h.default.oneOfType([h.default.func,h.default.string]),onKeyDown:h.default.func,onKeyUp:h.default.func,onFocus:h.default.func,onBlur:h.default.func},s.defaultProps={selectedFrom:null,selectedTo:null,outputFormat:"DD.MM.YYYY",weekdays:["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],offDays:[],showArrows:!0,isKeyboard:!0},a=u,_applyDecoratedDescriptor(a.prototype,"handleDayClick",[c.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleDayClick"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleFocus",[c.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleFocus"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleBlur",[c.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleBlur"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleArrowClick",[c.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleArrowClick"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleKeyDown",[c.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleKeyDown"),a.prototype),_applyDecoratedDescriptor(a.prototype,"handleKeyUp",[c.autobind],Object.getOwnPropertyDescriptor(a.prototype,"handleKeyUp"),a.prototype),i=a))||i)||i);t.default=Z},function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var r,o,i,a,s,u=function(){function defineProperties(e,t){for(var n=0;n0;){var r=a.find(function(e){return n.match(e.formatRegex)});r?(t.push(r),n=n.replace(r.formatRegex,"")):(t.push({type:"delimiter",value:n[0]}),n=n.substring(1))}return s[e]=t,t}function parse(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"DD.MM.YYYY",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=parseFormat(t),o={},i=0;il.max||o.datec.max||o.monthp.max||o.years;s++)m.setAttribute("type",n=e[s]),o="text"!==m.type&&"style"in m,o&&(m.value=a,m.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(n)&&m.style.WebkitAppearance!==u?(f.appendChild(m),r=t.defaultView,o=r.getComputedStyle&&"textfield"!==r.getComputedStyle(m,null).WebkitAppearance&&0!==m.offsetHeight,f.removeChild(m)):/^(search|tel)$/.test(n)||(o=/^(url|email)$/.test(n)?m.checkValidity&&m.checkValidity()===!1:m.value!=a)),A[e[s]]=!!o;return A}(g);var y="Moz O ms Webkit",b=c._config.usePrefixes?y.toLowerCase().split(" "):[];c._domPrefixes=b;var v=function(){function e(e,t){var r;return!!e&&(t&&"string"!=typeof t||(t=s(t||"div")),e="on"+e,r=e in t,!r&&n&&(t.setAttribute||(t=s("div")),t.setAttribute(e,""),r="function"==typeof t[e],t[e]!==u&&(t[e]=u),t.removeAttribute(e)),r)}var n=!("onblur"in t.documentElement);return e}();c.hasEvent=v,p.addTest("pointerevents",function(){var e=!1,t=b.length;for(e=p.hasEvent("pointerdown");t--&&!e;)v(b[t]+"pointerdown")&&(e=!0);return e});var _=c._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):[];c._prefixes=_;var C=c.testStyles=a;p.addTest("touchevents",function(){var n;if("ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch)n=!0;else{var r=["@media (",_.join("touch-enabled),("),"heartz",")","{#modernizr{top:9px;position:absolute}}"].join("");C(r,function(e){n=9===e.offsetTop})}return n}),i(),delete c.addTest,delete c.addAsyncTest;for(var x=0;x0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;return n+addLeadingZeros(o,2)+t+addLeadingZeros(i,2)}function addLeadingZeros(e,t){for(var n=Math.abs(e).toString();n.length12?t%12:t},hh:function(e){return addLeadingZeros(l.h(e),2)},m:function(e){return e.getMinutes()},mm:function(e){return addLeadingZeros(e.getMinutes(),2)},s:function(e){return e.getSeconds()},ss:function(e){return addLeadingZeros(e.getSeconds(),2)},S:function(e){return Math.floor(e.getMilliseconds()/100)},SS:function(e){return addLeadingZeros(Math.floor(e.getMilliseconds()/10),2)},SSS:function(e){return addLeadingZeros(e.getMilliseconds(),3)},Z:function(e){return formatTimezone(e.getTimezoneOffset(),":")},ZZ:function(e){return formatTimezone(e.getTimezoneOffset())},X:function(e){return Math.floor(e.getTime()/1e3)},x:function(e){return e.getTime()}};e.exports=format},function(e,t,n){function getDaysInMonth(e){var t=r(e),n=t.getFullYear(),o=t.getMonth(),i=new Date(0);return i.setFullYear(n,o+1,0),i.setHours(0,0,0,0),i.getDate()}var r=n(18);e.exports=getDaysInMonth},function(e,t,n){function getISOYear(e){var t=r(e),n=t.getFullYear(),i=new Date(0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);var a=o(i),s=new Date(0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);var u=o(s);return t.getTime()>=a.getTime()?n+1:t.getTime()>=u.getTime()?n:n-1}var r=n(18),o=n(80);e.exports=getISOYear},function(e,t){function isDate(e){return e instanceof Date}e.exports=isDate},function(e,t,n){function isValid(e){if(r(e))return!isNaN(e);throw new TypeError(toString.call(e)+" is not an instance of Date")}var r=n(141);e.exports=isValid},function(e,t,n){"use strict";var r=n(17),o={listen:function listen(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function remove(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function remove(){e.detachEvent("on"+t,n)}}):void 0},capture:function capture(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function remove(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function registerDefault(){}};e.exports=o},function(e,t){"use strict";function focusNode(e){try{e.focus()}catch(e){}}e.exports=focusNode},function(e,t){"use strict";function getActiveElement(e){if(e=e||("undefined"!=typeof document?document:void 0),"undefined"==typeof e)return null;try{return e.activeElement||e.body}catch(t){return e.body}}e.exports=getActiveElement},function(e,t){"use strict";function alphabetical(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}e.exports=alphabetical},function(e,t){"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function defineProperties(e,t){for(var n=0;n=t[t.length-1].options.index)return void t.push(e);for(var r=0;rn)return void t.splice(r,0,e)}}},{key:"reset",value:function reset(){this.registry=[]}},{key:"remove",value:function remove(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)}},{key:"toString",value:function toString(e){return this.registry.filter(function(e){
+return e.attached}).map(function(t){return t.toString(e)}).join("\n")}}]),SheetsRegistry}();t.default=r},function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function findRenderer(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.Renderer)return e.Renderer;var t=e.virtual||!o.default;return t?u.default:a.default}Object.defineProperty(t,"__esModule",{value:!0}),t.default=findRenderer;var r=n(368),o=_interopRequireDefault(r),i=n(385),a=_interopRequireDefault(i),s=n(386),u=_interopRequireDefault(s)},function(e,t){"use strict";function toCssValue(e){return Array.isArray(e)?Array.isArray(e[0])?toCssValue(e.map(n)):e.join(", "):e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=toCssValue;var n=function joinWithSpace(e){return e.join(" ")}},function(e,t){(function(t){function debounce(e,t,r){function invokeFunc(t){var n=o,r=i;return o=i=void 0,c=t,s=e.apply(r,n)}function leadingEdge(e){return c=e,u=setTimeout(timerExpired,t),p?invokeFunc(e):s}function remainingWait(e){var n=e-l,r=e-c,o=t-n;return d?g(o,a-r):o}function shouldInvoke(e){var n=e-l,r=e-c;return void 0===l||n>=t||n<0||d&&r>=a}function timerExpired(){var e=A();return shouldInvoke(e)?trailingEdge(e):void(u=setTimeout(timerExpired,remainingWait(e)))}function trailingEdge(e){return u=void 0,f&&o?invokeFunc(e):(o=i=void 0,s)}function cancel(){void 0!==u&&clearTimeout(u),c=0,o=l=i=u=void 0}function flush(){return void 0===u?s:trailingEdge(A())}function debounced(){var e=A(),n=shouldInvoke(e);if(o=arguments,i=this,l=e,n){if(void 0===u)return leadingEdge(l);if(d)return u=setTimeout(timerExpired,t),invokeFunc(l)}return void 0===u&&(u=setTimeout(timerExpired,t)),s}var o,i,a,s,u,l,c=0,p=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(n);return t=toNumber(t)||0,isObject(r)&&(p=!!r.leading,d="maxWait"in r,a=d?m(toNumber(r.maxWait)||0,t):a,f="trailing"in r?!!r.trailing:f),debounced.cancel=cancel,debounced.flush=flush,debounced}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&h.call(e)==o}function toNumber(e){if("number"==typeof e)return e;if(isSymbol(e))return r;if(isObject(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=s.test(e);return n||u.test(e)?l(e.slice(2),n?2:8):a.test(e)?r:+e}var n="Expected a function",r=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt,c="object"==typeof t&&t&&t.Object===Object&&t,p="object"==typeof self&&self&&self.Object===Object&&self,d=c||p||Function("return this")(),f=Object.prototype,h=f.toString,m=Math.max,g=Math.min,A=function(){return d.Date.now()};e.exports=debounce}).call(t,function(){return this}())},function(e,t,n){var r=n(20),o=r.Uint8Array;e.exports=o},function(e,t,n){function arrayLikeKeys(e,t){var n=i(e),l=!n&&o(e),p=!n&&!l&&a(e),d=!n&&!l&&!p&&u(e),f=n||l||p||d,h=f?r(e.length,String):[],m=h.length;for(var g in e)!t&&!c.call(e,g)||f&&("length"==g||p&&("offset"==g||"parent"==g)||d&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,m))||h.push(g);return h}var r=n(431),o=n(94),i=n(25),a=n(95),s=n(90),u=n(98),l=Object.prototype,c=l.hasOwnProperty;e.exports=arrayLikeKeys},function(e,t,n){function assignMergeValue(e,t,n){(void 0===n||o(e[t],n))&&(void 0!==n||t in e)||r(e,t,n)}var r=n(64),o=n(48);e.exports=assignMergeValue},function(e,t,n){var r=n(442),o=r();e.exports=o},function(e,t,n){function baseGet(e,t){t=r(t,e);for(var n=0,i=t.length;null!=e&&nd))return!1;var h=c.get(e);if(h&&c.get(t))return h==t;var m=-1,g=!0,A=n&s?new r:void 0;for(c.set(e,t),c.set(t,e);++m=t||n<0||A&&r>=p}function timerExpired(){var e=o();return shouldInvoke(e)?trailingEdge(e):void(f=setTimeout(timerExpired,remainingWait(e)))}function trailingEdge(e){return f=void 0,y&&l?invokeFunc(e):(l=c=void 0,d)}function cancel(){void 0!==f&&clearTimeout(f),m=0,l=h=c=f=void 0}function flush(){return void 0===f?d:trailingEdge(o())}function debounced(){var e=o(),n=shouldInvoke(e);if(l=arguments,c=this,h=e,n){if(void 0===f)return leadingEdge(h);if(A)return f=setTimeout(timerExpired,t),invokeFunc(h)}return void 0===f&&(f=setTimeout(timerExpired,t)),d}var l,c,p,d,f,h,m=0,g=!1,A=!1,y=!0;if("function"!=typeof e)throw new TypeError(a);return t=i(t)||0,r(n)&&(g=!!n.leading,A="maxWait"in n,p=A?s(i(n.maxWait)||0,t):p,y="trailing"in n?!!n.trailing:y),debounced.cancel=cancel,debounced.flush=flush,debounced}var r=n(23),o=n(500),i=n(504),a="Expected a function",s=Math.max,u=Math.min;e.exports=debounce},function(e,t,n){function keysIn(e){return i(e)?r(e,!0):o(e)}var r=n(152),o=n(422),i=n(68);e.exports=keysIn},function(e,t,n){function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(memoize.Cache||r),n}var r=n(88),o="Expected a function";memoize.Cache=r,e.exports=memoize},function(e,t,n){(function(e){function normalizeArray(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function filter(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!n;r--){var o=r>=0?arguments[r]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,n="/"===o.charAt(0))}return t=normalizeArray(filter(t.split("/"),function(e){return!!e}),!n).join("/"),(n?"/":"")+t||"."},t.normalize=function(e){var n=t.isAbsolute(e),r="/"===o(e,-1);return e=normalizeArray(filter(e.split("/"),function(e){return!!e}),!n).join("/"),e||n||(e="."),e&&r&&(e+="/"),(n?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(filter(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function trim(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var r=trim(e.split("/")),o=trim(n.split("/")),i=Math.min(r.length,o.length),a=i,s=0;s.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or .":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var i,s=a.createElement(k,{child:t});if(e){var u=d.get(e);i=u._processChildContext(u._context)}else i=A;var l=getTopLevelWrapperInContainer(n);if(l){var c=l._currentElement,p=c.props.child;if(v(p,t)){var f=l._renderedComponent.getPublicInstance(),h=o&&function(){o.call(f)};return M._updateRootComponent(l,s,i,n,h),f}M.unmountComponentAtNode(n)}var g=getReactRootElementInContainer(n),y=g&&!!internalGetID(g),b=hasNonRootReactChild(n),_=y&&!l&&!b,C=M._renderNewRootComponent(s,n,_,i)._renderedComponent.getPublicInstance();return o&&o.call(C),C},render:function(e,t,n){return M._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){isValidContainer(e)?void 0:r("40");var t=getTopLevelWrapperInContainer(e);if(!t){hasNonRootReactChild(e),1===e.nodeType&&e.hasAttribute(C);return!1}return delete I[t._instance.rootID],g.batchedUpdates(unmountComponentFromNode,t,e,!1),!0},_mountImageIntoNode:function(e,t,n,i,a){if(isValidContainer(t)?void 0:r("41"),i){var s=getReactRootElementInContainer(t);if(f.canReuseMarkup(e,s))return void u.precacheNode(n,s);var l=s.getAttribute(f.CHECKSUM_ATTR_NAME);s.removeAttribute(f.CHECKSUM_ATTR_NAME);var c=s.outerHTML;s.setAttribute(f.CHECKSUM_ATTR_NAME,l);var p=e,d=firstDifferenceIndex(p,c),h=" (client) "+p.substring(d-20,d+20)+"\n (server) "+c.substring(d-20,d+20);t.nodeType===D?r("42",h):void 0}if(t.nodeType===D?r("43"):void 0,a.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);o.insertTreeBefore(t,e,null)}else b(t,e),u.precacheNode(n,t.firstChild)}};e.exports=M},function(e,t,n){"use strict";var r=n(11),o=n(41),i=(n(4),{HOST:0,COMPOSITE:1,EMPTY:2,getType:function(e){return null===e||e===!1?i.EMPTY:o.isValidElement(e)?"function"==typeof e.type?i.COMPOSITE:i.HOST:void r("26",e)}});e.exports=i},function(e,t){"use strict";var n={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){n.currentScrollLeft=e.x,n.currentScrollTop=e.y}};e.exports=n},function(e,t,n){"use strict";function accumulateInto(e,t){return null==t?r("30"):void 0,null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}var r=n(11);n(4);e.exports=accumulateInto},function(e,t){"use strict";function forEachAccumulated(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}e.exports=forEachAccumulated},function(e,t,n){"use strict";function getHostComponentFromComposite(e){for(var t;(t=e._renderedNodeType)===r.COMPOSITE;)e=e._renderedComponent;return t===r.HOST?e._renderedComponent:t===r.EMPTY?null:void 0}var r=n(181);e.exports=getHostComponentFromComposite},function(e,t,n){"use strict";function getTextContentAccessor(){return!o&&r.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}var r=n(19),o=null;e.exports=getTextContentAccessor},function(e,t,n){"use strict";function getDeclarationErrorAddendum(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}function isInternalComponentType(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function instantiateReactComponent(e,t){var n;if(null===e||e===!1)n=a.create(instantiateReactComponent);else if("object"==typeof e){var o=e,i=o.type;if("function"!=typeof i&&"string"!=typeof i){var l="";l+=getDeclarationErrorAddendum(o._owner),r("130",null==i?i:typeof i,l)}"string"==typeof o.type?n=s.createInternalComponent(o):isInternalComponentType(o.type)?(n=new o.type(o),n.getHostNode||(n.getHostNode=n.getNativeNode)):n=new u(o)}else"string"==typeof e||"number"==typeof e?n=s.createInstanceForText(e):r("131",typeof e);return n._mountIndex=0,n._mountImage=null,n}var r=n(11),o=n(13),i=n(529),a=n(176),s=n(178),u=(n(717),n(4),n(8),function(e){this.construct(e)});o(u.prototype,i,{_instantiateReactComponent:instantiateReactComponent}),e.exports=instantiateReactComponent},function(e,t){"use strict";function isTextInputElement(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!n[e.type]:"textarea"===t}var n={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=isTextInputElement},function(e,t,n){"use strict";var r=n(19),o=n(74),i=n(75),a=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){return 3===e.nodeType?void(e.nodeValue=t):void i(e,o(t))})),e.exports=a},function(e,t,n){"use strict";function getComponentKey(e,t){return e&&"object"==typeof e&&null!=e.key?a.escape(e.key):t.toString(36)}function traverseAllChildrenImpl(e,t,n,l){var c=typeof e;if("undefined"!==c&&"boolean"!==c||(e=null),null===e||"string"===c||"number"===c||"object"===c&&e.$$typeof===o)return n(l,e,""===t?s+getComponentKey(e,0):t),1;var p,d,f=0,h=""===t?s:t+u;if(Array.isArray(e))for(var m=0;m1&&(n=[t.shift()],t.forEach(function(e,t){if(i){var a="separator-"+(e.key||t);o=r.cloneElement(o,{key:a})}return n.push(o,e)})),r.createElement(e.inline?"span":"div",{className:e.className},n)}var r=n(1),o=n(581);Group.propTypes={children:o.node,inline:o.bool,separator:o.node,className:o.string},Group.defaultProps={separator:" "},e.exports=Group},function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(583);Object.defineProperty(t,"default",{enumerable:!0,get:function get(){return _interopRequireDefault(r).default}})},,function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(592);Object.defineProperty(t,"default",{enumerable:!0,get:function get(){return _interopRequireDefault(r).default}})},function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(594);Object.defineProperty(t,"default",{enumerable:!0,get:function get(){return _interopRequireDefault(r).default}}),Object.defineProperty(t,"styles",{enumerable:!0,get:function get(){return r.styles}})},function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(615);Object.defineProperty(t,"default",{enumerable:!0,get:function get(){return _interopRequireDefault(r).default}})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={animation:"none 0s ease 0s 1 normal none running","backface-visibility":"visible",background:"transparent none repeat 0 0 / auto auto padding-box border-box scroll",border:"medium none currentColor","border-image":"none","border-radius":"0",bottom:"auto","box-shadow":"none",clear:"none",clip:"auto",columns:"auto","column-count":"auto","column-fill":"balance","column-gap":"normal","column-rule":"medium none currentColor","column-span":"1","column-width":"auto",content:"normal","counter-increment":"none","counter-reset":"none",float:"none",height:"auto",hyphens:"none",left:"auto",margin:"0","max-height":"none","max-width":"none","min-height":"0","min-width":"0",opacity:"1",outline:"medium none invert",overflow:"visible","overflow-x":"visible","overflow-y":"visible",padding:"0","page-break-after":"auto","page-break-before":"auto","page-break-inside":"auto",perspective:"none","perspective-origin":"50% 50%",position:"static",right:"auto","table-layout":"auto","text-decoration":"none",top:"auto",transform:"none","transform-origin":"50% 50% 0","transform-style":"flat",transition:"none 0s ease 0s","unicode-bidi":"normal","vertical-align":"baseline",width:"auto","z-index":"auto"}},function(e,t,n){e.exports={config:{title:"ARUI FEATHER",highlightTheme:"base16-light",showCode:!1,showSidebar:!0,previewDelay:500,theme:{},styles:{}},welcomeScreen:!1,sections:[{name:void 0,components:[{filepath:"src/amount/amount.jsx",pathLine:"src/amount/amount.jsx",module:n(215),props:n(668),hasExamples:!0},{filepath:"src/attach/attach.jsx",pathLine:"src/attach/attach.jsx",module:n(216),props:n(669),hasExamples:!0},{filepath:"src/button/button.jsx",pathLine:"src/button/button.jsx",module:n(45),props:n(670),hasExamples:!0},{filepath:"src/calendar-input/calendar-input.jsx",pathLine:"src/calendar-input/calendar-input.jsx",module:n(217),props:n(671),hasExamples:!0},{filepath:"src/calendar/calendar.jsx",pathLine:"src/calendar/calendar.jsx",module:n(127),props:n(672),hasExamples:!0},{filepath:"src/card-input/card-input.jsx",pathLine:"src/card-input/card-input.jsx",module:n(218),props:n(673),hasExamples:!0},{filepath:"src/card-number/card-number.jsx",pathLine:"src/card-number/card-number.jsx",module:n(219),props:n(674),hasExamples:!0},{filepath:"src/checkbox-group/checkbox-group.jsx",pathLine:"src/checkbox-group/checkbox-group.jsx",module:n(220),props:n(675),hasExamples:!0},{filepath:"src/checkbox/checkbox.jsx",pathLine:"src/checkbox/checkbox.jsx",module:n(221),props:n(676),hasExamples:!0},{filepath:"src/collapse/collapse.jsx",pathLine:"src/collapse/collapse.jsx",module:n(222),props:n(677),hasExamples:!0},{filepath:"src/copyright/copyright.jsx",pathLine:"src/copyright/copyright.jsx",module:n(223),props:n(678),hasExamples:!0},{filepath:"src/dropdown/dropdown.jsx",pathLine:"src/dropdown/dropdown.jsx",module:n(224),props:n(679),hasExamples:!0},{filepath:"src/email-input/email-input.jsx",pathLine:"src/email-input/email-input.jsx",module:n(225),props:n(680),hasExamples:!0},{filepath:"src/form-field/form-field.jsx",pathLine:"src/form-field/form-field.jsx",module:n(226),props:n(681),hasExamples:!0},{filepath:"src/form/form.jsx",pathLine:"src/form/form.jsx",module:n(227),props:n(682),hasExamples:!0},{filepath:"src/heading/heading.jsx",pathLine:"src/heading/heading.jsx",module:n(128),props:n(683),hasExamples:!0},{filepath:"src/highlight/highlight.jsx",pathLine:"src/highlight/highlight.jsx",module:n(228),props:n(684),hasExamples:!0},{filepath:"src/icon/icon.jsx",pathLine:"src/icon/icon.jsx",module:n(55),
+props:n(685),hasExamples:!0},{filepath:"src/input/input.jsx",pathLine:"src/input/input.jsx",module:n(32),props:n(686),hasExamples:!0},{filepath:"src/label/label.jsx",pathLine:"src/label/label.jsx",module:n(129),props:n(687),hasExamples:!0},{filepath:"src/link/link.jsx",pathLine:"src/link/link.jsx",module:n(33),props:n(688),hasExamples:!0},{filepath:"src/list/list.jsx",pathLine:"src/list/list.jsx",module:n(233),props:n(689),hasExamples:!0},{filepath:"src/message/message.jsx",pathLine:"src/message/message.jsx",module:n(133),props:n(690),hasExamples:!0},{filepath:"src/money-input/money-input.jsx",pathLine:"src/money-input/money-input.jsx",module:n(235),props:n(691),hasExamples:!0},{filepath:"src/notification/notification.jsx",pathLine:"src/notification/notification.jsx",module:n(237),props:n(692),hasExamples:!0},{filepath:"src/phone-input/phone-input.jsx",pathLine:"src/phone-input/phone-input.jsx",module:n(238),props:n(693),hasExamples:!0},{filepath:"src/radio-group/radio-group.jsx",pathLine:"src/radio-group/radio-group.jsx",module:n(240),props:n(694),hasExamples:!0},{filepath:"src/radio/radio.jsx",pathLine:"src/radio/radio.jsx",module:n(241),props:n(695),hasExamples:!0},{filepath:"src/spin/spin.jsx",pathLine:"src/spin/spin.jsx",module:n(243),props:n(696),hasExamples:!0},{filepath:"src/support/support.jsx",pathLine:"src/support/support.jsx",module:n(244),props:n(697),hasExamples:!0},{filepath:"src/textarea/textarea.jsx",pathLine:"src/textarea/textarea.jsx",module:n(245),props:n(698),hasExamples:!0},{filepath:"src/user/user.jsx",pathLine:"src/user/user.jsx",module:n(247),props:n(699),hasExamples:!0}],sections:[],content:void 0}]}},function(e,t){"use strict";e.exports={HOMEPAGE:"https://github.com/styleguidist/react-styleguidist",BUGS:"https://github.com/styleguidist/react-styleguidist/issues",DOCS_CONFIG:"https://github.com/styleguidist/react-styleguidist/blob/master/docs/Configuration.md",DOCS_COMPONENTS:"https://github.com/styleguidist/react-styleguidist/blob/master/docs/Components.md",DOCS_WEBPACK:"https://github.com/styleguidist/react-styleguidist/blob/master/docs/Webpack.md",DOCS_DOCUMENTING:"https://github.com/styleguidist/react-styleguidist/blob/master/docs/Documenting.md"}},function(e,t,n){"use strict";function isNative(e){var t=Function.prototype.toString,n=Object.prototype.hasOwnProperty,r=RegExp("^"+t.call(n).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");try{var o=t.call(e);return r.test(o)}catch(e){return!1}}function purgeDeep(e){var t=o(e);if(t){var n=t.childIDs;i(e),n.forEach(purgeDeep)}}function describeComponentFrame(e,t,n){return"\n in "+(e||"Unknown")+(t?" (at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+")":n?" (created by "+n+")":"")}function getDisplayName(e){return null==e?"#empty":"string"==typeof e||"number"==typeof e?"#text":"string"==typeof e.type?e.type:e.type.displayName||e.type.name||"Unknown"}function describeID(e){var t,n=v.getDisplayName(e),r=v.getElement(e),o=v.getOwnerID(e);return o&&(t=v.getDisplayName(o)),describeComponentFrame(n,r&&r._source,t)}var r,o,i,a,s,u,l,c=n(43),p=n(27),d=(n(4),n(8),"function"==typeof Array.from&&"function"==typeof Map&&isNative(Map)&&null!=Map.prototype&&"function"==typeof Map.prototype.keys&&isNative(Map.prototype.keys)&&"function"==typeof Set&&isNative(Set)&&null!=Set.prototype&&"function"==typeof Set.prototype.keys&&isNative(Set.prototype.keys));if(d){var f=new Map,h=new Set;r=function(e,t){f.set(e,t)},o=function(e){return f.get(e)},i=function(e){f.delete(e)},a=function(){return Array.from(f.keys())},s=function(e){h.add(e)},u=function(e){h.delete(e)},l=function(){return Array.from(h.keys())}}else{var m={},g={},A=function(e){return"."+e},y=function(e){return parseInt(e.substr(1),10)};r=function(e,t){var n=A(e);m[n]=t},o=function(e){var t=A(e);return m[t]},i=function(e){var t=A(e);delete m[t]},a=function(){return Object.keys(m).map(y)},s=function(e){var t=A(e);g[t]=!0},u=function(e){var t=A(e);delete g[t]},l=function(){return Object.keys(g).map(y)}}var b=[],v={onSetChildren:function(e,t){var n=o(e);n?void 0:c("144"),n.childIDs=t;for(var r=0;r1&&(o=Math.floor(o/t)*t),a[o]=r,i=e.charAt(++r);return{indent:o,stops:a}}e.exports=indentation;var n={" ":1,"\t":4}},function(e,t){"use strict";var n="[a-zA-Z_:][a-zA-Z0-9:._-]*",r="[^\"'=<>`\\u0000-\\u0020]+",o="'[^']*'",i='"[^"]*"',a="(?:"+r+"|"+o+"|"+i+")",s="(?:\\s+"+n+"(?:\\s*=\\s*"+a+")?)",u="<[A-Za-z][A-Za-z0-9\\-]*"+s+"*\\s*\\/?>",l="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",c="|",p="<[?].*?[?]>",d="]*>",f="";t.openCloseTag=new RegExp("^(?:"+u+"|"+l+")"),t.tag=new RegExp("^(?:"+u+"|"+l+"|"+c+"|"+p+"|"+d+"|"+f+")")},function(e,t){function isString(e){return"[object String]"===n.call(e)}var n=Object.prototype.toString;e.exports=isString},function(e,t,n){!function(e,n){n(t)}(this,function(e){"use strict";function isInAstralSet(e,t){for(var n=65536,r=0;re)return!1;if(n+=t[r+1],n>=e)return!0}}function isIdentifierStart(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&a.test(String.fromCharCode(e)):t!==!1&&isInAstralSet(e,u)))}function isIdentifierChar(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&s.test(String.fromCharCode(e)):t!==!1&&(isInAstralSet(e,u)||isInAstralSet(e,l)))))}function binop(e,t){return new c(e,{beforeExpr:!0,binop:t})}function kw(e,t){return void 0===t&&(t={}),t.keyword=e,f[e]=new c(e,t)}function isNewLine(e){return 10===e||13===e||8232===e||8233==e}function isArray(e){return"[object Array]"===Object.prototype.toString.call(e)}function has(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function getLineInfo(e,t){for(var n=1,r=0;;){g.lastIndex=r;var o=g.exec(e);if(!(o&&o.index>10)+55296,(1023&e)+56320))}function parse(e,t){return new x(t,e).parse()}function parseExpressionAt(e,t,n){var r=new x(n,e,t);return r.nextToken(),r.parseExpression()}function tokenizer(e,t){return new x(t,e)}var t={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",7:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},n="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",r={5:n,6:n+" const class extends export import super"},o="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞮꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",i="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",a=new RegExp("["+o+"]"),s=new RegExp("["+o+i+"]");o=i=null;var u=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541],l=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,838,7,2,7,17,9,57,21,2,13,19882,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239],c=function TokenType(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null},p={beforeExpr:!0},d={startsExpr:!0},f={},h={num:new c("num",d),regexp:new c("regexp",d),string:new c("string",d),name:new c("name",d),eof:new c("eof"),bracketL:new c("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new c("]"),braceL:new c("{",{beforeExpr:!0,startsExpr:!0}),braceR:new c("}"),parenL:new c("(",{beforeExpr:!0,startsExpr:!0}),parenR:new c(")"),comma:new c(",",p),semi:new c(";",p),colon:new c(":",p),dot:new c("."),question:new c("?",p),arrow:new c("=>",p),template:new c("template"),ellipsis:new c("...",p),backQuote:new c("`",d),dollarBraceL:new c("${",{beforeExpr:!0,startsExpr:!0}),eq:new c("=",{beforeExpr:!0,isAssign:!0}),assign:new c("_=",{beforeExpr:!0,isAssign:!0}),incDec:new c("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new c("prefix",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=",6),relational:binop(">",7),bitShift:binop("<>>",8),plusMin:new c("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new c("**",{beforeExpr:!0}),_break:kw("break"),_case:kw("case",p),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",p),_do:kw("do",{isLoop:!0,beforeExpr:!0}),_else:kw("else",p),_finally:kw("finally"),_for:kw("for",{isLoop:!0}),_function:kw("function",d),_if:kw("if"),_return:kw("return",p),_switch:kw("switch"),_throw:kw("throw",p),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:!0}),_with:kw("with"),_new:kw("new",{beforeExpr:!0,startsExpr:!0}),_this:kw("this",d),_super:kw("super",d),_class:kw("class"),_extends:kw("extends",p),_export:kw("export"),_import:kw("import"),_null:kw("null",d),_true:kw("true",d),_false:kw("false",d),_in:kw("in",{beforeExpr:!0,binop:7}),_instanceof:kw("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},m=/\r\n?|\n|\u2028|\u2029/,g=new RegExp(m.source,"g"),A=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,y=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,b=function Position(e,t){this.line=e,this.column=t};b.prototype.offset=function offset(e){return new b(this.line,this.column+e)};var v=function SourceLocation(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)},_={ecmaVersion:6,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1,plugins:{}},C={},x=function Parser(e,n,o){this.options=e=getOptions(e),this.sourceFile=e.sourceFile,this.keywords=keywordRegexp(r[e.ecmaVersion>=6?6:5]);var i=e.allowReserved?"":t[e.ecmaVersion]+("module"==e.sourceType?" await":"");this.reservedWords=keywordRegexp(i);var a=(i?i+" ":"")+t.strict;this.reservedWordsStrict=keywordRegexp(a),this.reservedWordsStrictBind=keywordRegexp(a+" "+t.strictBind),this.input=String(n),this.containsEsc=!1,this.loadPlugins(e.plugins),o?(this.pos=o,this.lineStart=Math.max(0,this.input.lastIndexOf("\n",o)),this.curLine=this.input.slice(0,this.lineStart).split(m).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=h.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.strict=this.inModule="module"===e.sourceType,this.potentialArrowAt=-1,this.inFunction=this.inGenerator=!1,this.labels=[],0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2)};x.prototype.isKeyword=function isKeyword(e){return this.keywords.test(e)},x.prototype.isReservedWord=function isReservedWord(e){return this.reservedWords.test(e)},x.prototype.extend=function extend(e,t){this[e]=t(this[e])},x.prototype.loadPlugins=function loadPlugins(e){var t=this;for(var n in e){var r=C[n];if(!r)throw new Error("Plugin '"+n+"' not found");r(t,e[n])}},x.prototype.parse=function parse(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)};var D=x.prototype;D.isUseStrict=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"use strict"===e.expression.raw.slice(1,-1)},D.eat=function(e){return this.type===e&&(this.next(),!0)},D.isContextual=function(e){return this.type===h.name&&this.value===e},D.eatContextual=function(e){return this.value===e&&this.eat(h.name)},D.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},D.canInsertSemicolon=function(){return this.type===h.eof||this.type===h.braceR||m.test(this.input.slice(this.lastTokEnd,this.start))},D.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},D.semicolon=function(){this.eat(h.semi)||this.insertSemicolon()||this.unexpected()},D.afterTrailingComma=function(e){if(this.type==e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),this.next(),!0},D.expect=function(e){this.eat(e)||this.unexpected()},D.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var w=function DestructuringErrors(){this.shorthandAssign=0,this.trailingComma=0};D.checkPatternErrors=function(e,t){var n=e&&e.trailingComma;return t?void(n&&this.raise(n,"Comma is not permitted after the rest element")):!!n},D.checkExpressionErrors=function(e,t){var n=e&&e.shorthandAssign;return t?void(n&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns")):!!n};var I=x.prototype;I.parseTopLevel=function(e){var t=this,n=!0;for(e.body||(e.body=[]);this.type!==h.eof;){var r=t.parseStatement(!0,!0);e.body.push(r),n&&(t.isUseStrict(r)&&t.setStrict(!0),n=!1)}return this.next(),this.options.ecmaVersion>=6&&(e.sourceType=this.options.sourceType),this.finishNode(e,"Program")};var E={kind:"loop"},k={kind:"switch"};I.isLet=function(){if(this.type!==h.name||this.options.ecmaVersion<6||"let"!=this.value)return!1;y.lastIndex=this.pos;var e=y.exec(this.input),t=this.pos+e[0].length,n=this.input.charCodeAt(t);if(91===n||123==n)return!0;if(isIdentifierStart(n,!0)){for(var r=t+1;isIdentifierChar(this.input.charCodeAt(r),!0);++r);var o=this.input.slice(t,r);if(!this.isKeyword(o))return!0}return!1},I.parseStatement=function(e,t){var n,r=this.type,o=this.startNode();switch(this.isLet()&&(r=h._var,n="let"),r){case h._break:case h._continue:return this.parseBreakContinueStatement(o,r.keyword);case h._debugger:return this.parseDebuggerStatement(o);case h._do:return this.parseDoStatement(o);case h._for:return this.parseForStatement(o);case h._function:return!e&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(o);case h._class:return e||this.unexpected(),this.parseClass(o,!0);case h._if:return this.parseIfStatement(o);case h._return:return this.parseReturnStatement(o);case h._switch:return this.parseSwitchStatement(o);case h._throw:return this.parseThrowStatement(o);case h._try:return this.parseTryStatement(o);case h._const:case h._var:return n=n||this.value,e||"var"==n||this.unexpected(),this.parseVarStatement(o,n);case h._while:return this.parseWhileStatement(o);case h._with:return this.parseWithStatement(o);case h.braceL:return this.parseBlock();case h.semi:return this.parseEmptyStatement(o);case h._export:case h._import:return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===h._import?this.parseImport(o):this.parseExport(o);default:var i=this.value,a=this.parseExpression();return r===h.name&&"Identifier"===a.type&&this.eat(h.colon)?this.parseLabeledStatement(o,i,a):this.parseExpressionStatement(o,a)}},I.parseBreakContinueStatement=function(e,t){var n=this,r="break"==t;this.next(),this.eat(h.semi)||this.insertSemicolon()?e.label=null:this.type!==h.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var o=0;o=6?this.eat(h.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},I.parseForStatement=function(e){if(this.next(),this.labels.push(E),this.expect(h.parenL),this.type===h.semi)return this.parseFor(e,null);var t=this.isLet();if(this.type===h._var||this.type===h._const||t){var n=this.startNode(),r=t?"let":this.value;return this.next(),this.parseVar(n,!0,r),this.finishNode(n,"VariableDeclaration"),!(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))||1!==n.declarations.length||"var"!==r&&n.declarations[0].init?this.parseFor(e,n):this.parseForIn(e,n)}var o=new w,i=this.parseExpression(!0,o);return this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.checkPatternErrors(o,!0),this.toAssignable(i),this.checkLVal(i),this.parseForIn(e,i)):(this.checkExpressionErrors(o,!0),this.parseFor(e,i))},I.parseFunctionStatement=function(e){return this.next(),this.parseFunction(e,!0)},I.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(!1),e.alternate=this.eat(h._else)?this.parseStatement(!1):null,this.finishNode(e,"IfStatement")},I.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(h.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},I.parseSwitchStatement=function(e){var t=this;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(h.braceL),this.labels.push(k);for(var n,r=!1;this.type!=h.braceR;)if(t.type===h._case||t.type===h._default){var o=t.type===h._case;n&&t.finishNode(n,"SwitchCase"),e.cases.push(n=t.startNode()),n.consequent=[],t.next(),o?n.test=t.parseExpression():(r&&t.raiseRecoverable(t.lastTokStart,"Multiple default clauses"),r=!0,n.test=null),t.expect(h.colon)}else n||t.unexpected(),n.consequent.push(t.parseStatement(!0));return n&&this.finishNode(n,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},I.parseThrowStatement=function(e){return this.next(),m.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var M=[];I.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===h._catch){var t=this.startNode();this.next(),this.expect(h.parenL),t.param=this.parseBindingAtom(),this.checkLVal(t.param,!0),this.expect(h.parenR),t.body=this.parseBlock(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(h._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},I.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},I.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(E),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"WhileStatement")},I.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(!1),this.finishNode(e,"WithStatement")},I.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},I.parseLabeledStatement=function(e,t,n){for(var r=this,o=0;o=0;a--){var s=r.labels[a];if(s.statementStart!=e.start)break;s.statementStart=r.start,s.kind=i}return this.labels.push({name:t,kind:i,statementStart:this.start}),e.body=this.parseStatement(!0),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},I.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},I.parseBlock=function(e){var t,n=this,r=this.startNode(),o=!0;for(r.body=[],this.expect(h.braceL);!this.eat(h.braceR);){var i=n.parseStatement(!0);r.body.push(i),o&&e&&n.isUseStrict(i)&&(t=n.strict,n.setStrict(n.strict=!0)),o=!1}return t===!1&&this.setStrict(!1),this.finishNode(r,"BlockStatement")},I.parseFor=function(e,t){return e.init=t,this.expect(h.semi),e.test=this.type===h.semi?null:this.parseExpression(),this.expect(h.semi),e.update=this.type===h.parenR?null:this.parseExpression(),this.expect(h.parenR),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"ForStatement")},I.parseForIn=function(e,t){var n=this.type===h._in?"ForInStatement":"ForOfStatement";return this.next(),e.left=t,e.right=this.parseExpression(),this.expect(h.parenR),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,n)},I.parseVar=function(e,t,n){var r=this;for(e.declarations=[],e.kind=n;;){var o=r.startNode();if(r.parseVarId(o),r.eat(h.eq)?o.init=r.parseMaybeAssign(t):"const"!==n||r.type===h._in||r.options.ecmaVersion>=6&&r.isContextual("of")?"Identifier"==o.id.type||t&&(r.type===h._in||r.isContextual("of"))?o.init=null:r.raise(r.lastTokEnd,"Complex binding patterns require an initialization value"):r.unexpected(),e.declarations.push(r.finishNode(o,"VariableDeclarator")),!r.eat(h.comma))break}return e},I.parseVarId=function(e){e.id=this.parseBindingAtom(),this.checkLVal(e.id,!0)},I.parseFunction=function(e,t,n){this.initFunction(e),this.options.ecmaVersion>=6&&(e.generator=this.eat(h.star));var r=this.inGenerator;return this.inGenerator=e.generator,(t||this.type===h.name)&&(e.id=this.parseIdent()),this.parseFunctionParams(e),this.parseFunctionBody(e,n),this.inGenerator=r,this.finishNode(e,t?"FunctionDeclaration":"FunctionExpression")},I.parseFunctionParams=function(e){this.expect(h.parenL),e.params=this.parseBindingList(h.parenR,!1,!1,!0)},I.parseClass=function(e,t){var n=this;this.next(),this.parseClassId(e,t),this.parseClassSuper(e);var r=this.startNode(),o=!1;for(r.body=[],this.expect(h.braceL);!this.eat(h.braceR);)if(!n.eat(h.semi)){var i=n.startNode(),a=n.eat(h.star),s=n.type===h.name&&"static"===n.value;n.parsePropertyName(i),i.static=s&&n.type!==h.parenL,i.static&&(a&&n.unexpected(),a=n.eat(h.star),n.parsePropertyName(i)),i.kind="method";var u=!1;if(!i.computed){var l=i.key;a||"Identifier"!==l.type||n.type===h.parenL||"get"!==l.name&&"set"!==l.name||(u=!0,i.kind=l.name,l=n.parsePropertyName(i)),!i.static&&("Identifier"===l.type&&"constructor"===l.name||"Literal"===l.type&&"constructor"===l.value)&&(o&&n.raise(l.start,"Duplicate constructor in the same class"),u&&n.raise(l.start,"Constructor can't have get/set modifier"),a&&n.raise(l.start,"Constructor can't be a generator"),i.kind="constructor",o=!0)}if(n.parseClassMethod(r,i,a),u){var c="get"===i.kind?0:1;if(i.value.params.length!==c){var p=i.value.start;"get"===i.kind?n.raiseRecoverable(p,"getter should have no params"):n.raiseRecoverable(p,"setter should have exactly one param")}"set"===i.kind&&"RestElement"===i.value.params[0].type&&n.raise(i.value.params[0].start,"Setter cannot use rest params")}}return e.body=this.finishNode(r,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},I.parseClassMethod=function(e,t,n){t.value=this.parseMethod(n),e.body.push(this.finishNode(t,"MethodDefinition"))},I.parseClassId=function(e,t){e.id=this.type===h.name?this.parseIdent():t?this.unexpected():null},I.parseClassSuper=function(e){e.superClass=this.eat(h._extends)?this.parseExprSubscripts():null},I.parseExport=function(e){var t=this;if(this.next(),this.eat(h.star))return this.expectContextual("from"),e.source=this.type===h.string?this.parseExprAtom():this.unexpected(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(h._default)){var n=this.type==h.parenL,r=this.parseMaybeAssign(),o=!0;return n||"FunctionExpression"!=r.type&&"ClassExpression"!=r.type||(o=!1,r.id&&(r.type="FunctionExpression"==r.type?"FunctionDeclaration":"ClassDeclaration")),e.declaration=r,o&&this.semicolon(),this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(!0),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(),this.eatContextual("from"))e.source=this.type===h.string?this.parseExprAtom():this.unexpected();else{for(var i=0;i=6&&e)switch(e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":break;case"ObjectExpression":e.type="ObjectPattern";for(var r=0;r