@vendure/graphiql-plugin 3.4.3-master-202509260228 → 3.5.0-minor-202510012036
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/graphiql/assets/Range-CZNrBk8u.js.map +1 -1
- package/dist/graphiql/assets/{SchemaReference-CvpLgB2d.js → SchemaReference-DxjLeZ59.js} +2 -2
- package/dist/graphiql/assets/{SchemaReference-CvpLgB2d.js.map → SchemaReference-DxjLeZ59.js.map} +1 -1
- package/dist/graphiql/assets/{brace-fold-CbvXwIyh.js → brace-fold-C5NBigGY.js} +2 -2
- package/dist/graphiql/assets/{brace-fold-CbvXwIyh.js.map → brace-fold-C5NBigGY.js.map} +1 -1
- package/dist/graphiql/assets/{closebrackets-D9IC1c35.js → closebrackets-CVCrAWV7.js} +2 -2
- package/dist/graphiql/assets/{closebrackets-D9IC1c35.js.map → closebrackets-CVCrAWV7.js.map} +1 -1
- package/dist/graphiql/assets/{codemirror-HbUmq4EM.js → codemirror-BJo8frku.js} +3 -3
- package/dist/graphiql/assets/codemirror-BJo8frku.js.map +1 -0
- package/dist/graphiql/assets/{codemirror-s7RqOvtc.js → codemirror-TTILi5Ok.js} +2 -2
- package/dist/graphiql/assets/codemirror-TTILi5Ok.js.map +1 -0
- package/dist/graphiql/assets/{comment-hYnnSLkz.js → comment-CvLlMsd_.js} +2 -2
- package/dist/graphiql/assets/{comment-hYnnSLkz.js.map → comment-CvLlMsd_.js.map} +1 -1
- package/dist/graphiql/assets/{dialog-BwC5n760.js → dialog-Bw_kCHcZ.js} +2 -2
- package/dist/graphiql/assets/{dialog-BwC5n760.js.map → dialog-Bw_kCHcZ.js.map} +1 -1
- package/dist/graphiql/assets/{dialog-74yvRjdg.js → dialog-DRbboQHi.js} +2 -2
- package/dist/graphiql/assets/dialog-DRbboQHi.js.map +1 -0
- package/dist/graphiql/assets/{foldgutter-CNvWBdVI.js → foldgutter-xM98xUAG.js} +2 -2
- package/dist/graphiql/assets/{foldgutter-CNvWBdVI.js.map → foldgutter-xM98xUAG.js.map} +1 -1
- package/dist/graphiql/assets/forEachState-C8esYVuF.js.map +1 -1
- package/dist/graphiql/assets/{hint-D4-TGuu2.js → hint-5FUhY45V.js} +2 -2
- package/dist/graphiql/assets/{hint-D4-TGuu2.js.map → hint-5FUhY45V.js.map} +1 -1
- package/dist/graphiql/assets/{hint-tBpO-B8y.js → hint-CE5L8QSM.js} +2 -2
- package/dist/graphiql/assets/{hint-tBpO-B8y.js.map → hint-CE5L8QSM.js.map} +1 -1
- package/dist/graphiql/assets/index-BHryLb7e.js +375 -0
- package/dist/graphiql/assets/index-BHryLb7e.js.map +1 -0
- package/dist/graphiql/assets/index-CVlvTGMf.js.map +1 -1
- package/dist/graphiql/assets/{index-DDpY1Cbm.css → index-DssUSu3K.css} +1 -1
- package/dist/graphiql/assets/{info-D0V7Zrnm.js → info-Eys77UxT.js} +2 -2
- package/dist/graphiql/assets/{info-D0V7Zrnm.js.map → info-Eys77UxT.js.map} +1 -1
- package/dist/graphiql/assets/info-addon-DqEXsUQA.js +2 -0
- package/dist/graphiql/assets/info-addon-DqEXsUQA.js.map +1 -0
- package/dist/graphiql/assets/{javascript-C1fmnkCb.js → javascript-CIef8F0n.js} +2 -2
- package/dist/graphiql/assets/{javascript-C1fmnkCb.js.map → javascript-CIef8F0n.js.map} +1 -1
- package/dist/graphiql/assets/{jump-CMl3nz-1.js → jump-CTE51hYz.js} +2 -2
- package/dist/graphiql/assets/{jump-CMl3nz-1.js.map → jump-CTE51hYz.js.map} +1 -1
- package/dist/graphiql/assets/{jump-to-line-Hq5vq2W4.js → jump-to-line-BvpEaCtd.js} +2 -2
- package/dist/graphiql/assets/{jump-to-line-Hq5vq2W4.js.map → jump-to-line-BvpEaCtd.js.map} +1 -1
- package/dist/graphiql/assets/{lint-C6rDu9yg.js → lint-BIG9wcrT.js} +2 -2
- package/dist/graphiql/assets/{lint-C6rDu9yg.js.map → lint-BIG9wcrT.js.map} +1 -1
- package/dist/graphiql/assets/{lint-B6DlOY4R.js → lint-CEbnMjdF.js} +2 -2
- package/dist/graphiql/assets/{lint-B6DlOY4R.js.map → lint-CEbnMjdF.js.map} +1 -1
- package/dist/graphiql/assets/{lint-B2CUTgTB.js → lint-F_nW9Zrt.js} +2 -2
- package/dist/graphiql/assets/{lint-B2CUTgTB.js.map → lint-F_nW9Zrt.js.map} +1 -1
- package/dist/graphiql/assets/{matchbrackets-DcI6Xjhe.js → matchbrackets-D0OH_t55.js} +2 -2
- package/dist/graphiql/assets/matchbrackets-D0OH_t55.js.map +1 -0
- package/dist/graphiql/assets/{matchbrackets-D7CjVzEn.js → matchbrackets-zOPNoWNW.js} +2 -2
- package/dist/graphiql/assets/{matchbrackets-D7CjVzEn.js.map → matchbrackets-zOPNoWNW.js.map} +1 -1
- package/dist/graphiql/assets/{mode-DtlwYZcH.js → mode-Bgsek-oa.js} +2 -2
- package/dist/graphiql/assets/{mode-DtlwYZcH.js.map → mode-Bgsek-oa.js.map} +1 -1
- package/dist/graphiql/assets/{mode-CJXCb3SU.js → mode-CdWNzEF9.js} +2 -2
- package/dist/graphiql/assets/{mode-CJXCb3SU.js.map → mode-CdWNzEF9.js.map} +1 -1
- package/dist/graphiql/assets/{mode-C2URUmUb.js → mode-u5eBXn1b.js} +2 -2
- package/dist/graphiql/assets/{mode-C2URUmUb.js.map → mode-u5eBXn1b.js.map} +1 -1
- package/dist/graphiql/assets/{search-BzUGWzlS.js → search-BwFO2EYo.js} +2 -2
- package/dist/graphiql/assets/{search-BzUGWzlS.js.map → search-BwFO2EYo.js.map} +1 -1
- package/dist/graphiql/assets/{searchcursor-CHMRisY0.js → searchcursor-C8teH98l.js} +2 -2
- package/dist/graphiql/assets/searchcursor-C8teH98l.js.map +1 -0
- package/dist/graphiql/assets/{searchcursor-DThQw5sX.js → searchcursor-Do0yqmiZ.js} +2 -2
- package/dist/graphiql/assets/{searchcursor-DThQw5sX.js.map → searchcursor-Do0yqmiZ.js.map} +1 -1
- package/dist/graphiql/assets/{show-hint-CD13Xkku.js → show-hint-C-WEDAS_.js} +2 -2
- package/dist/graphiql/assets/{show-hint-CD13Xkku.js.map → show-hint-C-WEDAS_.js.map} +1 -1
- package/dist/graphiql/assets/{sublime-2ochNaKe.js → sublime-Cj8gH-vM.js} +2 -2
- package/dist/graphiql/assets/{sublime-2ochNaKe.js.map → sublime-Cj8gH-vM.js.map} +1 -1
- package/dist/graphiql/index.html +2 -2
- package/package.json +4 -4
- package/dist/graphiql/assets/codemirror-HbUmq4EM.js.map +0 -1
- package/dist/graphiql/assets/codemirror-s7RqOvtc.js.map +0 -1
- package/dist/graphiql/assets/dialog-74yvRjdg.js.map +0 -1
- package/dist/graphiql/assets/index-IiLbhMF9.js +0 -375
- package/dist/graphiql/assets/index-IiLbhMF9.js.map +0 -1
- package/dist/graphiql/assets/info-addon-BjO9oTYK.js +0 -2
- package/dist/graphiql/assets/info-addon-BjO9oTYK.js.map +0 -1
- package/dist/graphiql/assets/matchbrackets-DcI6Xjhe.js.map +0 -1
- package/dist/graphiql/assets/searchcursor-CHMRisY0.js.map +0 -1
|
@@ -7,7 +7,7 @@ b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.
|
|
|
7
7
|
height: `+(S-C)+"px"))}function h(b,C,L){var S=w(n,b),N=S.text.length,P,J;function R(K,fe){return qr(e,g(b,K),"div",S,fe)}function de(K,fe,V){var X=Nl(e,S,null,K),_=fe=="ltr"==(V=="after")?"left":"right",B=V=="after"?X.begin:X.end-(/\s/.test(S.text.charAt(X.end-1))?2:1);return R(B,_)[_]}var ue=He(S,n.direction);return ta(ue,C||0,L??N,function(K,fe,V,X){var _=V=="ltr",B=R(K,_?"left":"right"),he=R(fe-1,_?"right":"left"),Gt=C==null&&K==0,Ve=L==null&&fe==N,te=X==0,Oe=!ue||X==ue.length-1;if(he.top-B.top<=3){var j=(u?Gt:Ve)&&te,Nn=(u?Ve:Gt)&&Oe,Be=j?a:(_?B:he).left,gt=Nn?s:(_?he:B).right;f(Be,B.top,gt-Be,B.bottom)}else{var yt,le,Ut,An;_?(yt=u&&Gt&&te?a:B.left,le=u?s:de(K,V,"before"),Ut=u?a:de(fe,V,"after"),An=u&&Ve&&Oe?s:he.right):(yt=u?de(K,V,"before"):a,le=!u&&Gt&&te?s:B.right,Ut=!u&&Ve&&Oe?a:he.left,An=u?de(fe,V,"after"):s),f(yt,B.top,le-yt,B.bottom),B.bottom<he.top&&f(a,B.bottom,null,he.top),f(Ut,he.top,An-Ut,he.bottom)}(!P||Qr(B,P)<0)&&(P=B),Qr(he,P)<0&&(P=he),(!J||Qr(B,J)<0)&&(J=B),Qr(he,J)<0&&(J=he)}),{start:P,end:J}}var d=t.from(),c=t.to();if(d.line==c.line)h(d.line,d.ch,c.ch);else{var p=w(n,d.line),v=w(n,c.line),y=we(p)==we(v),m=h(d.line,d.ch,y?p.text.length+1:null).end,x=h(c.line,y?0:null,c.ch).start;y&&(m.top<x.top-2?(f(m.right,m.top,null,m.bottom),f(a,x.top,x.left,x.bottom)):f(m.right,m.top,x.left-m.right,m.bottom)),m.bottom<x.top&&f(a,m.bottom,null,x.top)}i.appendChild(l)}function rn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Nt(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Hl(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ln(e))}function nn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Nt(e))},100)}function ln(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(G(e,"focus",e,t),e.state.focused=!0,rt(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),ie&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),rn(e))}function Nt(e,t){e.state.delayingBlurEvent||(e.state.focused&&(G(e,"blur",e,t),e.state.focused=!1,et(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Jr(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),n=t.lineDiv.getBoundingClientRect().top,l=0,o=0;o<t.view.length;o++){var a=t.view[o],s=e.options.lineWrapping,u=void 0,f=0;if(!a.hidden){if(n+=a.line.height,A&&E<8){var h=a.node.offsetTop+a.node.offsetHeight;u=h-i,i=h}else{var d=a.node.getBoundingClientRect();u=d.bottom-d.top,!s&&a.text.firstChild&&(f=a.text.firstChild.getBoundingClientRect().right-d.left-1)}var c=a.line.height-u;if((c>.005||c<-.005)&&(n<r&&(l-=c),Me(a.line,u),Fl(a.line),a.rest))for(var p=0;p<a.rest.length;p++)Fl(a.rest[p]);if(f>e.display.sizerWidth){var v=Math.ceil(f/Dt(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}Math.abs(l)>2&&(t.scroller.scrollTop+=l)}function Fl(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function jr(e,t,i){var r=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;r=Math.floor(r-Xr(e));var n=i&&i.bottom!=null?i.bottom:r+e.wrapper.clientHeight,l=at(t,r),o=at(t,n);if(i&&i.ensure){var a=i.ensure.from.line,s=i.ensure.to.line;a<l?(l=a,o=at(t,Pe(w(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=o&&(l=at(t,Pe(w(t,s))-e.wrapper.clientHeight),o=s)}return{from:l,to:Math.max(o,l+1)}}function $a(e,t){if(!Y(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),n=null,l=i.wrapper.ownerDocument;if(t.top+r.top<0?n=!0:t.bottom+r.top>(l.defaultView.innerHeight||l.documentElement.clientHeight)&&(n=!1),n!=null&&!Qo){var o=k("div","",null,`position: absolute;
|
|
8
8
|
top: `+(t.top-i.viewOffset-Xr(e.display))+`px;
|
|
9
9
|
height: `+(t.bottom-t.top+Ne(e)+i.barHeight)+`px;
|
|
10
|
-
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(n),e.display.lineSpace.removeChild(o)}}}function es(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?g(t.line,t.ch+1,"before"):t,t=t.ch?g(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var l=0;l<5;l++){var o=!1,a=Se(e,t),s=!i||i==t?a:Se(e,i);n={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r};var u=on(e,n),f=e.doc.scrollTop,h=e.doc.scrollLeft;if(u.scrollTop!=null&&(ar(e,u.scrollTop),Math.abs(e.doc.scrollTop-f)>1&&(o=!0)),u.scrollLeft!=null&&(ct(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(o=!0)),!o)break}return n}function ts(e,t){var i=on(e,t);i.scrollTop!=null&&ar(e,i.scrollTop),i.scrollLeft!=null&&ct(e,i.scrollLeft)}function on(e,t){var i=e.display,r=Mt(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,l=Yi(e),o={};t.bottom-t.top>l&&(t.bottom=t.top+l);var a=e.doc.height+Xi(i),s=t.top<r,u=t.bottom>a-r;if(t.top<n)o.scrollTop=s?0:t.top;else if(t.bottom>n+l){var f=Math.min(t.top,(u?a:t.bottom)-l);f!=n&&(o.scrollTop=f)}var h=e.options.fixedGutter?0:i.gutters.offsetWidth,d=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-h,c=st(e)-i.gutters.offsetWidth,p=t.right-t.left>c;return p&&(t.right=t.left+c),t.left<10?o.scrollLeft=0:t.left<d?o.scrollLeft=Math.max(0,t.left+h-(p?0:10)):t.right>c+d-3&&(o.scrollLeft=t.right+(p?0:10)-c),o}function an(e,t){t!=null&&(Vr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function At(e){Vr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function or(e,t,i){(t!=null||i!=null)&&Vr(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function rs(e,t){Vr(e),e.curOp.scrollToPos=t}function Vr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Ml(e,t.from),r=Ml(e,t.to);Pl(e,i,r,t.margin)}}function Pl(e,t,i,r){var n=on(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});or(e,n.scrollLeft,n.scrollTop)}function ar(e,t){Math.abs(e.doc.scrollTop-t)<2||(We||un(e,{top:t}),El(e,t,!0),We&&un(e),fr(e,100))}function El(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function ct(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,Gl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function sr(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+Xi(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?i:0,docHeight:r,scrollHeight:r+Ne(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var dt=function(e,t,i){this.cm=i;var r=this.vert=k("div",[k("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=k("div",[k("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),T(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),T(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,A&&E<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};dt.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var l=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+l)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},dt.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},dt.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},dt.prototype.zeroWidthHack=function(){var e=ye&&!Zo?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ke,this.disableVert=new Ke},dt.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var n=e.getBoundingClientRect(),l=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);l!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},dt.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ur=function(){};ur.prototype.update=function(){return{bottom:0,right:0}},ur.prototype.setScrollLeft=function(){},ur.prototype.setScrollTop=function(){},ur.prototype.clear=function(){};function Ot(e,t){t||(t=sr(e));var i=e.display.barWidth,r=e.display.barHeight;Il(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&Jr(e),Il(e,sr(e)),i=e.display.barWidth,r=e.display.barHeight}function Il(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Rl={native:dt,null:ur};function Bl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&et(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Rl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),T(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?ct(e,t):ar(e,t)},e),e.display.scrollbars.addClass&&rt(e.display.wrapper,e.display.scrollbars.addClass)}var is=0;function pt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++is,markArrays:null},Fa(e.curOp)}function vt(e){var t=e.curOp;t&&Ea(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;ns(i)})}function ns(e){for(var t=e.ops,i=0;i<t.length;i++)ls(t[i]);for(var r=0;r<t.length;r++)os(t[r]);for(var n=0;n<t.length;n++)as(t[n]);for(var l=0;l<t.length;l++)ss(t[l]);for(var o=0;o<t.length;o++)us(t[o])}function ls(e){var t=e.cm,i=t.display;hs(t),e.updateMaxLine&&Ki(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $r(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function os(e){e.updatedDisplay=e.mustUpdate&&sn(e.cm,e.update)}function as(e){var t=e.cm,i=t.display;e.updatedDisplay&&Jr(t),e.barMeasure=sr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=bl(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Ne(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-st(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function ss(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ct(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==me(xt(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ot(t,e.barMeasure),e.updatedDisplay&&hn(t,e.barMeasure),e.selectionChanged&&rn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Hl(e.cm)}function us(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&zl(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&El(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ct(t,e.scrollLeft,!0,!0),e.scrollToPos){var n=es(t,D(r,e.scrollToPos.from),D(r,e.scrollToPos.to),e.scrollToPos.margin);$a(t,n)}var l=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(l)for(var a=0;a<l.length;++a)l[a].lines.length||G(l[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&G(o[s],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&G(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ce(e,t){if(e.curOp)return t();pt(e);try{return t()}finally{vt(e)}}function Z(e,t){return function(){if(e.curOp)return t.apply(e,arguments);pt(e);try{return t.apply(e,arguments)}finally{vt(e)}}}function ne(e){return function(){if(this.curOp)return e.apply(this,arguments);pt(this);try{return e.apply(this,arguments)}finally{vt(this)}}}function Q(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);pt(t);try{return e.apply(this,arguments)}finally{vt(t)}}}function fr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,yi(fs,e))}function fs(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var i=+new Date+e.options.workTime,r=$t(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(l){if(r.line>=e.display.viewFrom){var o=l.styles,a=l.text.length>e.options.maxHighlightLength?lt(t.mode,r.state):null,s=qn(e,l,r,!0);a&&(r.state=a),l.styles=s.styles;var u=l.styleClasses,f=s.classes;f?l.styleClasses=f:u&&(l.styleClasses=null);for(var h=!o||o.length!=l.styles.length||u!=f&&(!u||!f||u.bgClass!=f.bgClass||u.textClass!=f.textClass),d=0;!h&&d<o.length;++d)h=o[d]!=l.styles[d];h&&n.push(r.line),l.stateAfter=r.save(),r.nextLine()}else l.text.length<=e.options.maxHighlightLength&&Ii(e,l.text,r),l.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return fr(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&ce(e,function(){for(var l=0;l<n.length;l++)Xe(e,n[l],"text")})}}var $r=function(e,t,i){var r=e.display;this.viewport=t,this.visible=jr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=st(e),this.force=i,this.dims=Vi(e),this.events=[]};$r.prototype.signal=function(e,t){xe(e,t)&&this.events.push(arguments)},$r.prototype.finish=function(){for(var e=0;e<this.events.length;e++)G.apply(null,this.events[e])};function hs(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ne(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ne(e)+"px",t.scrollbarsClipped=!0)}function cs(e){if(e.hasFocus())return null;var t=me(xt(e));if(!t||!Ue(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=Ar(e).getSelection();r.anchorNode&&r.extend&&Ue(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}function ds(e){if(!(!e||!e.activeElt||e.activeElt==me(it(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&Ue(document.body,e.anchorNode)&&Ue(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,i=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),i.removeAllRanges(),i.addRange(r),i.extend(e.focusNode,e.focusOffset)}}function sn(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return Ye(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Ol(e)==0)return!1;Ul(e)&&(Ye(e),t.dims=Vi(e));var n=r.first+r.size,l=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFrom<l&&l-i.viewFrom<20&&(l=Math.max(r.first,i.viewFrom)),i.viewTo>o&&i.viewTo-o<20&&(o=Math.min(n,i.viewTo)),Fe&&(l=Gi(e.doc,l),o=al(e.doc,o));var a=l!=i.viewFrom||o!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;ja(e,l,o),i.viewOffset=Pe(w(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var s=Ol(e);if(!a&&s==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var u=cs(e);return s>4&&(i.lineDiv.style.display="none"),ps(e,i.updateLineNumbers,t.dims),s>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ds(u),Ge(i.cursorDiv),Ge(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,a&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,fr(e,400)),i.updateLineNumbers=null,!0}function zl(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==st(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+Xi(e.display)-Yi(e),i.top)}),t.visible=jr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=jr(e.display,e.doc,i));if(!sn(e,t))break;Jr(e);var n=sr(e);lr(e),Ot(e,n),hn(e,n),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function un(e,t){var i=new $r(e,t);if(sn(e,i)){Jr(e),zl(e,i);var r=sr(e);lr(e),Ot(e,r),hn(e,r),i.finish()}}function ps(e,t,i){var r=e.display,n=e.options.lineNumbers,l=r.lineDiv,o=l.firstChild;function a(p){var v=p.nextSibling;return ie&&ye&&e.display.currentWheelTarget==p?p.style.display="none":p.parentNode.removeChild(p),v}for(var s=r.view,u=r.viewFrom,f=0;f<s.length;f++){var h=s[f];if(!h.hidden)if(!h.node||h.node.parentNode!=l){var d=Ga(e,h,u,i);l.insertBefore(d,o)}else{for(;o!=h.node;)o=a(o);var c=n&&t!=null&&t<=u&&h.lineNumber;h.changes&&($(h.changes,"gutter")>-1&&(c=!1),cl(e,h,u,i)),c&&(Ge(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(Fi(e.options,u)))),o=h.node.nextSibling}u+=h.size}for(;o;)o=a(o)}function fn(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",q(e,"gutterChanged",e)}function hn(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+Ne(e)+"px"}function Gl(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=$i(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,l=r+"px",o=0;o<i.length;o++)if(!i[o].hidden){e.options.fixedGutter&&(i[o].gutter&&(i[o].gutter.style.left=l),i[o].gutterBackground&&(i[o].gutterBackground.style.left=l));var a=i[o].alignable;if(a)for(var s=0;s<a.length;s++)a[s].style.left=l}e.options.fixedGutter&&(t.gutters.style.left=r+n+"px")}}function Ul(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Fi(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var n=r.measure.appendChild(k("div",[k("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),l=n.firstChild.offsetWidth,o=n.offsetWidth-l;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(l,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",fn(e.display),!0}return!1}function cn(e,t){for(var i=[],r=!1,n=0;n<e.length;n++){var l=e[n],o=null;if(typeof l!="string"&&(o=l.style,l=l.className),l=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:l,style:o})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Kl(e){var t=e.gutters,i=e.gutterSpecs;Ge(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var n=i[r],l=n.className,o=n.style,a=t.appendChild(k("div",null,"CodeMirror-gutter "+l));o&&(a.style.cssText=o),l=="CodeMirror-linenumbers"&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",fn(e)}function hr(e){Kl(e.display),ae(e),Gl(e)}function vs(e,t,i,r){var n=this;this.input=i,n.scrollbarFiller=k("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=k("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=bt("div",null,"CodeMirror-code"),n.selectionDiv=k("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=k("div",null,"CodeMirror-cursors"),n.measure=k("div",null,"CodeMirror-measure"),n.lineMeasure=k("div",null,"CodeMirror-measure"),n.lineSpace=bt("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var l=bt("div",[n.lineSpace],"CodeMirror-lines");n.mover=k("div",[l],null,"position: relative"),n.sizer=k("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=k("div",null,null,"position: absolute; height: "+Pn+"px; width: 1px;"),n.gutters=k("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=k("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=k("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),ze&&Hn>=105&&(n.wrapper.style.clipPath="inset(0px)"),n.wrapper.setAttribute("translate","no"),A&&E<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),!ie&&!(We&&_t)&&(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,n.gutterSpecs=cn(r.gutters,r.lineNumbers),Kl(n),i.init(n)}var ei=0,Ie=null;A?Ie=-.53:We?Ie=15:ze?Ie=-.7:Dr&&(Ie=-1/3);function _l(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function gs(e){var t=_l(e);return t.x*=Ie,t.y*=Ie,t}function Xl(e,t){ze&&Hn==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var i=_l(t),r=i.x,n=i.y,l=Ie;t.deltaMode===0&&(r=t.deltaX,n=t.deltaY,l=1);var o=e.display,a=o.scroller,s=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&s||n&&u){if(n&&ye&&ie){e:for(var f=t.target,h=o.view;f!=a;f=f.parentNode)for(var d=0;d<h.length;d++)if(h[d].node==f){e.display.currentWheelTarget=f;break e}}if(r&&!We&&!Ce&&l!=null){n&&u&&ar(e,Math.max(0,a.scrollTop+n*l)),ct(e,Math.max(0,a.scrollLeft+r*l)),(!n||n&&u)&&oe(t),o.wheelStartX=null;return}if(n&&l!=null){var c=n*l,p=e.doc.scrollTop,v=p+o.wrapper.clientHeight;c<0?p=Math.max(0,p+c-50):v=Math.min(e.doc.height,v+c+50),un(e,{top:p,bottom:v})}ei<20&&t.deltaMode!==0&&(o.wheelStartX==null?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=n,setTimeout(function(){if(o.wheelStartX!=null){var y=a.scrollLeft-o.wheelStartX,m=a.scrollTop-o.wheelStartY,x=m&&o.wheelDY&&m/o.wheelDY||y&&o.wheelDX&&y/o.wheelDX;o.wheelStartX=o.wheelStartY=null,x&&(Ie=(Ie*ei+x)/(ei+1),++ei)}},200)):(o.wheelDX+=r,o.wheelDY+=n))}}var ge=function(e,t){this.ranges=e,this.primIndex=t};ge.prototype.primary=function(){return this.ranges[this.primIndex]},ge.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],r=e.ranges[t];if(!Pi(i.anchor,r.anchor)||!Pi(i.head,r.head))return!1}return!0},ge.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new O(Ei(this.ranges[t].anchor),Ei(this.ranges[t].head));return new ge(e,this.primIndex)},ge.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ge.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(M(t,r.from())>=0&&M(e,r.to())<=0)return i}return-1};var O=function(e,t){this.anchor=e,this.head=t};O.prototype.from=function(){return Ir(this.anchor,this.head)},O.prototype.to=function(){return Er(this.anchor,this.head)},O.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Le(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(d,c){return M(d.from(),c.from())}),i=$(t,n);for(var l=1;l<t.length;l++){var o=t[l],a=t[l-1],s=M(a.to(),o.from());if(r&&!o.empty()?s>0:s>=0){var u=Ir(a.from(),o.from()),f=Er(a.to(),o.to()),h=a.empty()?o.from()==o.head:a.from()==a.head;l<=i&&--i,t.splice(--l,2,new O(h?f:u,h?u:f))}}return new ge(t,i)}function qe(e,t){return new ge([new O(e,t||e)],0)}function Ze(e){return e.text?g(e.from.line+e.text.length-1,W(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Yl(e,t){if(M(e,t.from)<0)return e;if(M(e,t.to)<=0)return Ze(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ze(t).ch-t.to.ch),g(i,r)}function dn(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var n=e.sel.ranges[r];i.push(new O(Yl(n.anchor,t),Yl(n.head,t)))}return Le(e.cm,i,e.sel.primIndex)}function ql(e,t,i){return e.line==t.line?g(i.line,e.ch-t.ch+i.ch):g(i.line+(e.line-t.line),e.ch)}function ys(e,t,i){for(var r=[],n=g(e.first,0),l=n,o=0;o<t.length;o++){var a=t[o],s=ql(a.from,n,l),u=ql(Ze(a),n,l);if(n=a.to,l=u,i=="around"){var f=e.sel.ranges[o],h=M(f.head,f.anchor)<0;r[o]=new O(h?u:s,h?s:u)}else r[o]=new O(s,s)}return new ge(r,e.sel.primIndex)}function pn(e){e.doc.mode=Oi(e.options,e.doc.modeOption),cr(e)}function cr(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,fr(e,100),e.state.modeGen++,e.curOp&&ae(e)}function Zl(e,t){return t.from.ch==0&&t.to.ch==0&&W(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function vn(e,t,i,r){function n(x){return i?i[x]:null}function l(x,b,C){ka(x,b,C,r),q(x,"change",x,t)}function o(x,b){for(var C=[],L=x;L<b;++L)C.push(new Lt(u[L],n(L),r));return C}var a=t.from,s=t.to,u=t.text,f=w(e,a.line),h=w(e,s.line),d=W(u),c=n(u.length-1),p=s.line-a.line;if(t.full)e.insert(0,o(0,u.length)),e.remove(u.length,e.size-u.length);else if(Zl(e,t)){var v=o(0,u.length-1);l(h,h.text,c),p&&e.remove(a.line,p),v.length&&e.insert(a.line,v)}else if(f==h)if(u.length==1)l(f,f.text.slice(0,a.ch)+d+f.text.slice(s.ch),c);else{var y=o(1,u.length-1);y.push(new Lt(d+f.text.slice(s.ch),c,r)),l(f,f.text.slice(0,a.ch)+u[0],n(0)),e.insert(a.line+1,y)}else if(u.length==1)l(f,f.text.slice(0,a.ch)+u[0]+h.text.slice(s.ch),n(0)),e.remove(a.line+1,p);else{l(f,f.text.slice(0,a.ch)+u[0],n(0)),l(h,d+h.text.slice(s.ch),c);var m=o(1,u.length-1);p>1&&e.remove(a.line+1,p-1),e.insert(a.line+1,m)}q(e,"change",e,t)}function Qe(e,t,i){function r(n,l,o){if(n.linked)for(var a=0;a<n.linked.length;++a){var s=n.linked[a];if(s.doc!=l){var u=o&&s.sharedHist;i&&!u||(t(s.doc,u),r(s.doc,n,u))}}}r(e,null,!0)}function Ql(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,en(e),pn(e),Jl(e),e.options.direction=t.direction,e.options.lineWrapping||Ki(e),e.options.mode=t.modeOption,ae(e)}function Jl(e){(e.doc.direction=="rtl"?rt:et)(e.display.lineDiv,"CodeMirror-rtl")}function ms(e){ce(e,function(){Jl(e),ae(e)})}function ti(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function gn(e,t){var i={from:Ei(t.from),to:Ze(t),text:ot(e,t.from,t.to)};return $l(e,i,t.from.line,t.to.line+1),Qe(e,function(r){return $l(r,i,t.from.line,t.to.line+1)},!0),i}function jl(e){for(;e.length;){var t=W(e);if(t.ranges)e.pop();else break}}function bs(e,t){if(t)return jl(e.done),W(e.done);if(e.done.length&&!W(e.done).ranges)return W(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),W(e.done)}function Vl(e,t,i,r){var n=e.history;n.undone.length=0;var l=+new Date,o,a;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(o=bs(n,n.lastOp==r)))a=W(o.changes),M(t.from,t.to)==0&&M(t.from,a.to)==0?a.to=Ze(t):o.changes.push(gn(e,t));else{var s=W(n.done);for((!s||!s.ranges)&&ri(e.sel,n.done),o={changes:[gn(e,t)],generation:n.generation},n.done.push(o);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=l,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,a||G(e,"historyAdded")}function xs(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Cs(e,t,i,r){var n=e.history,l=r&&r.origin;i==n.lastSelOp||l&&n.lastSelOrigin==l&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==l||xs(e,l,W(n.done),t))?n.done[n.done.length-1]=t:ri(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=l,n.lastSelOp=i,r&&r.clearRedo!==!1&&jl(n.undone)}function ri(e,t){var i=W(t);i&&i.ranges&&i.equals(e)||t.push(e)}function $l(e,t,i,r){var n=t["spans_"+e.id],l=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(o){o.markedSpans&&((n||(n=t["spans_"+e.id]={}))[l]=o.markedSpans),++l})}function ws(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function Ss(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],n=0;n<t.text.length;++n)r.push(ws(i[n]));return r}function eo(e,t){var i=Ss(e,t),r=Bi(e,t);if(!i)return r;if(!r)return i;for(var n=0;n<i.length;++n){var l=i[n],o=r[n];if(l&&o)e:for(var a=0;a<o.length;++a){for(var s=o[a],u=0;u<l.length;++u)if(l[u].marker==s.marker)continue e;l.push(s)}else o&&(i[n]=o)}return i}function Wt(e,t,i){for(var r=[],n=0;n<e.length;++n){var l=e[n];if(l.ranges){r.push(i?ge.prototype.deepCopy.call(l):l);continue}var o=l.changes,a=[];r.push({changes:a});for(var s=0;s<o.length;++s){var u=o[s],f=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(f=h.match(/^spans_(\d+)$/))&&$(t,Number(f[1]))>-1&&(W(a)[h]=u[h],delete u[h])}}return r}function yn(e,t,i,r){if(r){var n=e.anchor;if(i){var l=M(t,n)<0;l!=M(i,n)<0?(n=t,t=i):l!=M(t,i)<0&&(t=i)}return new O(n,t)}else return new O(i||t,t)}function ii(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),ee(e,new ge([yn(e.sel.primary(),t,i,n)],0),r)}function to(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),l=0;l<e.sel.ranges.length;l++)r[l]=yn(e.sel.ranges[l],t[l],null,n);var o=Le(e.cm,r,e.sel.primIndex);ee(e,o,i)}function mn(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i,ee(e,Le(e.cm,n,e.sel.primIndex),r)}function ro(e,t,i,r){ee(e,qe(t,i),r)}function Ls(e,t,i){var r={ranges:t.ranges,update:function(n){this.ranges=[];for(var l=0;l<n.length;l++)this.ranges[l]=new O(D(e,n[l].anchor),D(e,n[l].head))},origin:i&&i.origin};return G(e,"beforeSelectionChange",e,r),e.cm&&G(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Le(e.cm,r.ranges,r.ranges.length-1):t}function io(e,t,i){var r=e.history.done,n=W(r);n&&n.ranges?(r[r.length-1]=t,ni(e,t,i)):ee(e,t,i)}function ee(e,t,i){ni(e,t,i),Cs(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function ni(e,t,i){(xe(e,"beforeSelectionChange")||e.cm&&xe(e.cm,"beforeSelectionChange"))&&(t=Ls(e,t,i));var r=i&&i.bias||(M(t.primary().head,e.sel.primary().head)<0?-1:1);no(e,oo(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&At(e.cm)}function no(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Gn(e.cm)),q(e,"cursorActivity",e))}function lo(e){no(e,oo(e,e.sel,null,!1))}function oo(e,t,i,r){for(var n,l=0;l<t.ranges.length;l++){var o=t.ranges[l],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[l],s=li(e,o.anchor,a&&a.anchor,i,r),u=o.head==o.anchor?s:li(e,o.head,a&&a.head,i,r);(n||s!=o.anchor||u!=o.head)&&(n||(n=t.ranges.slice(0,l)),n[l]=new O(s,u))}return n?Le(e.cm,n,t.primIndex):t}function Ht(e,t,i,r,n){var l=w(e,t.line);if(l.markedSpans)for(var o=0;o<l.markedSpans.length;++o){var a=l.markedSpans[o],s=a.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,f="selectRight"in s?!s.selectRight:s.inclusiveRight;if((a.from==null||(u?a.from<=t.ch:a.from<t.ch))&&(a.to==null||(f?a.to>=t.ch:a.to>t.ch))){if(n&&(G(s,"beforeCursorEnter"),s.explicitlyCleared))if(l.markedSpans){--o;continue}else break;if(!s.atomic)continue;if(i){var h=s.find(r<0?1:-1),d=void 0;if((r<0?f:u)&&(h=ao(e,h,-r,h&&h.line==t.line?l:null)),h&&h.line==t.line&&(d=M(h,i))&&(r<0?d<0:d>0))return Ht(e,h,t,r,n)}var c=s.find(r<0?-1:1);return(r<0?u:f)&&(c=ao(e,c,r,c.line==t.line?l:null)),c?Ht(e,c,t,r,n):null}}return t}function li(e,t,i,r,n){var l=r||1,o=Ht(e,t,i,l,n)||!n&&Ht(e,t,i,l,!0)||Ht(e,t,i,-l,n)||!n&&Ht(e,t,i,-l,!0);return o||(e.cantEdit=!0,g(e.first,0))}function ao(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?D(e,g(t.line-1)):null:i>0&&t.ch==(r||w(e,t.line)).text.length?t.line<e.first+e.size-1?g(t.line+1,0):null:new g(t.line,t.ch+i)}function so(e){e.setSelection(g(e.firstLine(),0),g(e.lastLine()),Te)}function uo(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(n,l,o,a){n&&(r.from=D(e,n)),l&&(r.to=D(e,l)),o&&(r.text=o),a!==void 0&&(r.origin=a)}),G(e,"beforeChange",e,r),e.cm&&G(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Ft(e,t,i){if(e.cm){if(!e.cm.curOp)return Z(e.cm,Ft)(e,t,i);if(e.cm.state.suppressEdits)return}if(!((xe(e,"beforeChange")||e.cm&&xe(e.cm,"beforeChange"))&&(t=uo(e,t,!0),!t))){var r=el&&!i&&Ca(e,t.from,t.to);if(r)for(var n=r.length-1;n>=0;--n)fo(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else fo(e,t)}}function fo(e,t){if(!(t.text.length==1&&t.text[0]==""&&M(t.from,t.to)==0)){var i=dn(e,t);Vl(e,t,i,e.cm?e.cm.curOp.id:NaN),dr(e,t,i,Bi(e,t));var r=[];Qe(e,function(n,l){!l&&$(r,n.history)==-1&&(vo(n.history,t),r.push(n.history)),dr(n,t,null,Bi(n,t))})}}function oi(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var n=e.history,l,o=e.sel,a=t=="undo"?n.done:n.undone,s=t=="undo"?n.undone:n.done,u=0;u<a.length&&(l=a[u],!(i?l.ranges&&!l.equals(e.sel):!l.ranges));u++);if(u!=a.length){for(n.lastOrigin=n.lastSelOrigin=null;;)if(l=a.pop(),l.ranges){if(ri(l,s),i&&!l.equals(e.sel)){ee(e,l,{clearRedo:!1});return}o=l}else if(r){a.push(l);return}else break;var f=[];ri(o,s),s.push({changes:f,generation:n.generation}),n.generation=l.generation||++n.maxGeneration;for(var h=xe(e,"beforeChange")||e.cm&&xe(e.cm,"beforeChange"),d=function(v){var y=l.changes[v];if(y.origin=t,h&&!uo(e,y,!1))return a.length=0,{};f.push(gn(e,y));var m=v?dn(e,y):W(a);dr(e,y,m,eo(e,y)),!v&&e.cm&&e.cm.scrollIntoView({from:y.from,to:Ze(y)});var x=[];Qe(e,function(b,C){!C&&$(x,b.history)==-1&&(vo(b.history,y),x.push(b.history)),dr(b,y,null,eo(b,y))})},c=l.changes.length-1;c>=0;--c){var p=d(c);if(p)return p.v}}}}function ho(e,t){if(t!=0&&(e.first+=t,e.sel=new ge(Hr(e.sel.ranges,function(n){return new O(g(n.anchor.line+t,n.anchor.ch),g(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm)){ae(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)Xe(e.cm,r,"gutter")}}function dr(e,t,i,r){if(e.cm&&!e.cm.curOp)return Z(e.cm,dr)(e,t,i,r);if(t.to.line<e.first){ho(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var n=t.text.length-1-(e.first-t.from.line);ho(e,n),t={from:g(e.first,0),to:g(t.to.line+n,t.to.ch),text:[W(t.text)],origin:t.origin}}var l=e.lastLine();t.to.line>l&&(t={from:t.from,to:g(l,w(e,l).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ot(e,t.from,t.to),i||(i=dn(e,t)),e.cm?ks(e.cm,t,r):vn(e,t,r),ni(e,i,Te),e.cantEdit&&li(e,g(e.firstLine(),0))&&(e.cantEdit=!1)}}function ks(e,t,i){var r=e.doc,n=e.display,l=t.from,o=t.to,a=!1,s=l.line;e.options.lineWrapping||(s=H(we(w(r,l.line))),r.iter(s,o.line+1,function(c){if(c==n.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Gn(e),vn(r,t,i,Al(e)),e.options.lineWrapping||(r.iter(s,l.line+t.text.length,function(c){var p=Kr(c);p>n.maxLineLength&&(n.maxLine=c,n.maxLineLength=p,n.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),pa(r,l.line),fr(e,400);var u=t.text.length-(o.line-l.line)-1;t.full?ae(e):l.line==o.line&&t.text.length==1&&!Zl(e.doc,t)?Xe(e,l.line,"text"):ae(e,l.line,o.line+1,u);var f=xe(e,"changes"),h=xe(e,"change");if(h||f){var d={from:l,to:o,text:t.text,removed:t.removed,origin:t.origin};h&&q(e,"change",e,d),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}function Pt(e,t,i,r,n){var l;r||(r=i),M(r,i)<0&&(l=[r,i],i=l[0],r=l[1]),typeof t=="string"&&(t=e.splitLines(t)),Ft(e,{from:i,to:r,text:t,origin:n})}function co(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function po(e,t,i,r){for(var n=0;n<e.length;++n){var l=e[n],o=!0;if(l.ranges){l.copied||(l=e[n]=l.deepCopy(),l.copied=!0);for(var a=0;a<l.ranges.length;a++)co(l.ranges[a].anchor,t,i,r),co(l.ranges[a].head,t,i,r);continue}for(var s=0;s<l.changes.length;++s){var u=l.changes[s];if(i<u.from.line)u.from=g(u.from.line+r,u.from.ch),u.to=g(u.to.line+r,u.to.ch);else if(t<=u.to.line){o=!1;break}}o||(e.splice(0,n+1),n=0)}}function vo(e,t){var i=t.from.line,r=t.to.line,n=t.text.length-(r-i)-1;po(e.done,i,r,n),po(e.undone,i,r,n)}function pr(e,t,i,r){var n=t,l=t;return typeof t=="number"?l=w(e,Xn(e,t)):n=H(t),n==null?null:(r(l,n)&&e.cm&&Xe(e.cm,n,i),l)}function vr(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}vr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var n=this.lines[i];this.height-=n.height,Ta(n),q(n,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function gr(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var n=e[r];t+=n.chunkSize(),i+=n.height,n.parent=this}this.size=t,this.height=i,this.parent=null}gr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],n=r.chunkSize();if(e<n){var l=Math.min(t,n-e),o=r.height;if(r.removeInner(e,l),this.height-=o-r.height,n==l&&(this.children.splice(i--,1),r.parent=null),(t-=l)==0)break;e=0}else e-=n}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof vr))){var a=[];this.collapse(a),this.children=[new vr(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var n=this.children[r],l=n.chunkSize();if(e<=l){if(n.insertInner(e,t,i),n.lines&&n.lines.length>50){for(var o=n.lines.length%25+25,a=o;a<n.lines.length;){var s=new vr(n.lines.slice(a,a+=25));n.height-=s.height,this.children.splice(++r,0,s),s.parent=this}n.lines=n.lines.slice(0,o),this.maybeSpill()}break}e-=l}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new gr(t);if(e.parent){e.size-=i.size,e.height-=i.height;var n=$(e.parent.children,e);e.parent.children.splice(n+1,0,i)}else{var r=new gr(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var n=this.children[r],l=n.chunkSize();if(e<l){var o=Math.min(t,l-e);if(n.iterN(e,o,i))return!0;if((t-=o)==0)break;e=0}else e-=l}}};var yr=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};yr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=H(i);if(!(r==null||!t)){for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(i.widgets=null);var l=ir(this);Me(i,Math.max(0,i.height-l)),e&&(ce(e,function(){go(e,i,-l),Xe(e,r,"widget")}),q(e,"lineWidgetCleared",e,this,r))}},yr.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var n=ir(this)-t;n&&(_e(this.doc,r)||Me(r,r.height+n),i&&ce(i,function(){i.curOp.forceUpdate=!0,go(i,r,n),q(i,"lineWidgetChanged",i,e,H(r))}))},Ct(yr);function go(e,t,i){Pe(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&an(e,i)}function Ts(e,t,i,r){var n=new yr(e,i,r),l=e.cm;return l&&n.noHScroll&&(l.display.alignWidgets=!0),pr(e,t,"widget",function(o){var a=o.widgets||(o.widgets=[]);if(n.insertAt==null?a.push(n):a.splice(Math.min(a.length,Math.max(0,n.insertAt)),0,n),n.line=o,l&&!_e(e,o)){var s=Pe(o)<e.scrollTop;Me(o,o.height+ir(n)),s&&an(l,n.height),l.curOp.forceUpdate=!0}return!0}),l&&q(l,"lineWidgetAdded",l,n,typeof t=="number"?t:H(t)),n}var yo=0,Je=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++yo};Je.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&pt(e),xe(this,"clear")){var i=this.find();i&&q(this,"clear",i.from,i.to)}for(var r=null,n=null,l=0;l<this.lines.length;++l){var o=this.lines[l],a=er(o.markedSpans,this);e&&!this.collapsed?Xe(e,H(o),"text"):e&&(a.to!=null&&(n=H(o)),a.from!=null&&(r=H(o))),o.markedSpans=ya(o.markedSpans,a),a.from==null&&this.collapsed&&!_e(this.doc,o)&&e&&Me(o,Mt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=we(this.lines[s]),f=Kr(u);f>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=f,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&ae(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&lo(e.doc)),e&&q(e,"markerCleared",e,this,r,n),t&&vt(e),this.parent&&this.parent.clear()}},Je.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n<this.lines.length;++n){var l=this.lines[n],o=er(l.markedSpans,this);if(o.from!=null&&(i=g(t?l:H(l),o.from),e==-1))return i;if(o.to!=null&&(r=g(t?l:H(l),o.to),e==1))return r}return i&&{from:i,to:r}},Je.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;!t||!r||ce(r,function(){var n=t.line,l=H(t.line),o=qi(r,l);if(o&&(wl(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!_e(i.doc,n)&&i.height!=null){var a=i.height;i.height=null;var s=ir(i)-a;s&&Me(n,n.height+s)}q(r,"markerChanged",r,e)})},Je.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||$(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Je.prototype.detachLine=function(e){if(this.lines.splice($(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ct(Je);function Et(e,t,i,r,n){if(r&&r.shared)return Ms(e,t,i,r,n);if(e.cm&&!e.cm.curOp)return Z(e.cm,Et)(e,t,i,r,n);var l=new Je(e,n),o=M(t,i);if(r&&nt(r,l,!1),o>0||o==0&&l.clearWhenEmpty!==!1)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=bt("span",[l.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(ol(e,t.line,t,i,l)||t.line!=i.line&&ol(e,i.line,t,i,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");ga()}l.addToHistory&&Vl(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var a=t.line,s=e.cm,u;if(e.iter(a,i.line+1,function(h){s&&l.collapsed&&!s.options.lineWrapping&&we(h)==s.display.maxLine&&(u=!0),l.collapsed&&a!=t.line&&Me(h,0),ma(h,new Br(l,a==t.line?t.ch:null,a==i.line?i.ch:null),e.cm&&e.cm.curOp),++a}),l.collapsed&&e.iter(t.line,i.line+1,function(h){_e(e,h)&&Me(h,0)}),l.clearOnEnter&&T(l,"beforeCursorEnter",function(){return l.clear()}),l.readOnly&&(va(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++yo,l.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),l.collapsed)ae(s,t.line,i.line+1);else if(l.className||l.startStyle||l.endStyle||l.css||l.attributes||l.title)for(var f=t.line;f<=i.line;f++)Xe(s,f,"text");l.atomic&&lo(s.doc),q(s,"markerAdded",s,l)}return l}var mr=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};mr.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();q(this,"clear")}},mr.prototype.find=function(e,t){return this.primary.find(e,t)},Ct(mr);function Ms(e,t,i,r,n){r=nt(r),r.shared=!1;var l=[Et(e,t,i,r,n)],o=l[0],a=r.widgetNode;return Qe(e,function(s){a&&(r.widgetNode=a.cloneNode(!0)),l.push(Et(s,D(s,t),D(s,i),r,n));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;o=W(l)}),new mr(l,o)}function mo(e){return e.findMarks(g(e.first,0),e.clipPos(g(e.lastLine())),function(t){return t.parent})}function Ds(e,t){for(var i=0;i<t.length;i++){var r=t[i],n=r.find(),l=e.clipPos(n.from),o=e.clipPos(n.to);if(M(l,o)){var a=Et(e,l,o,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}function Ns(e){for(var t=function(r){var n=e[r],l=[n.primary.doc];Qe(n.primary.doc,function(s){return l.push(s)});for(var o=0;o<n.markers.length;o++){var a=n.markers[o];$(l,a.doc)==-1&&(a.parent=null,n.markers.splice(o--,1))}},i=0;i<e.length;i++)t(i)}var As=0,se=function(e,t,i,r,n){if(!(this instanceof se))return new se(e,t,i,r,n);i==null&&(i=0),gr.call(this,[new vr([new Lt("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var l=g(i,0);this.sel=qe(l),this.history=new ti(null),this.id=++As,this.modeOption=t,this.lineSep=r,this.direction=n=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),vn(this,{from:l,to:l,text:e}),ee(this,qe(l),Te)};se.prototype=In(gr.prototype,{constructor:se,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Hi(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Q(function(e){var t=g(this.first,0),i=this.first+this.size-1;Ft(this,{from:t,to:g(i,w(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&or(this.cm,0,0),ee(this,qe(t),Te)}),replaceRange:function(e,t,i,r){t=D(this,t),i=i?D(this,i):t,Pt(this,e,t,i,r)},getRange:function(e,t,i){var r=ot(this,D(this,e),D(this,t));return i===!1?r:i===""?r.join(""):r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Vt(this,e))return w(this,e)},getLineNumber:function(e){return H(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=w(this,e)),we(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return D(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Q(function(e,t,i){ro(this,D(this,typeof e=="number"?g(e,t||0):e),null,i)}),setSelection:Q(function(e,t,i){ro(this,D(this,e),D(this,t||e),i)}),extendSelection:Q(function(e,t,i){ii(this,D(this,e),t&&D(this,t),i)}),extendSelections:Q(function(e,t){to(this,Yn(this,e),t)}),extendSelectionsBy:Q(function(e,t){var i=Hr(this.sel.ranges,e);to(this,Yn(this,i),t)}),setSelections:Q(function(e,t,i){if(e.length){for(var r=[],n=0;n<e.length;n++)r[n]=new O(D(this,e[n].anchor),D(this,e[n].head||e[n].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),ee(this,Le(this.cm,r,t),i)}}),addSelection:Q(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new O(D(this,e),D(this,t||e))),ee(this,Le(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,r=0;r<t.length;r++){var n=ot(this,t[r].from(),t[r].to());i=i?i.concat(n):n}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var n=ot(this,i[r].from(),i[r].to());e!==!1&&(n=n.join(e||this.lineSeparator())),t[r]=n}return t},replaceSelection:function(e,t,i){for(var r=[],n=0;n<this.sel.ranges.length;n++)r[n]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:Q(function(e,t,i){for(var r=[],n=this.sel,l=0;l<n.ranges.length;l++){var o=n.ranges[l];r[l]={from:o.from(),to:o.to(),text:this.splitLines(e[l]),origin:i}}for(var a=t&&t!="end"&&ys(this,r,t),s=r.length-1;s>=0;s--)Ft(this,r[s]);a?io(this,a):this.cm&&At(this.cm)}),undo:Q(function(){oi(this,"undo")}),redo:Q(function(){oi(this,"redo")}),undoSelection:Q(function(){oi(this,"undo",!0)}),redoSelection:Q(function(){oi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new ti(this.history),Qe(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Wt(this.history.done),undone:Wt(this.history.undone)}},setHistory:function(e){var t=this.history=new ti(this.history);t.done=Wt(e.done.slice(0),null,!0),t.undone=Wt(e.undone.slice(0),null,!0)},setGutterMarker:Q(function(e,t,i){return pr(this,e,"gutter",function(r){var n=r.gutterMarkers||(r.gutterMarkers={});return n[t]=i,!i&&Rn(n)&&(r.gutterMarkers=null),!0})}),clearGutter:Q(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&pr(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Rn(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Vt(this,e)||(t=e,e=w(this,e),!e))return null}else if(t=H(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Q(function(e,t,i){return pr(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[n])r[n]=i;else{if(mt(i).test(r[n]))return!1;r[n]+=" "+i}return!0})}),removeLineClass:Q(function(e,t,i){return pr(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",l=r[n];if(l)if(i==null)r[n]=null;else{var o=l.match(mt(i));if(!o)return!1;var a=o.index+o[0].length;r[n]=l.slice(0,o.index)+(!o.index||a==l.length?"":" ")+l.slice(a)||null}else return!1;return!0})}),addLineWidget:Q(function(e,t,i){return Ts(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Et(this,D(this,e),D(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=D(this,e),Et(this,e,e,i,"bookmark")},findMarksAt:function(e){e=D(this,e);var t=[],i=w(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var n=i[r];(n.from==null||n.from<=e.ch)&&(n.to==null||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=D(this,e),t=D(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(l){var o=l.markedSpans;if(o)for(var a=0;a<o.length;a++){var s=o[a];!(s.to!=null&&n==e.line&&e.ch>=s.to||s.from==null&&n!=e.line||s.from!=null&&n==t.line&&s.from>=t.ch)&&(!i||i(s.marker))&&r.push(s.marker.parent||s.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)i[r].from!=null&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(n){var l=n.text.length+r;if(l>e)return t=e,!0;e-=l,++i}),D(this,g(i,t))},indexFromPos:function(e){e=D(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new se(Hi(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new se(Hi(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Ds(r,mo(this)),r},unlinkDoc:function(e){if(e instanceof I&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ns(mo(this));break}}if(e.history==this.history){var r=[e.id];Qe(e,function(n){return r.push(n.id)},!0),e.history=new ti(null),e.history.done=Wt(this.history.done,r),e.history.undone=Wt(this.history.undone,r)}},iterLinkedDocs:function(e){Qe(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Di(e)},lineSeparator:function(){return this.lineSep||`
|
|
10
|
+
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(n),e.display.lineSpace.removeChild(o)}}}function es(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?g(t.line,t.ch+1,"before"):t,t=t.ch?g(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var l=0;l<5;l++){var o=!1,a=Se(e,t),s=!i||i==t?a:Se(e,i);n={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r};var u=on(e,n),f=e.doc.scrollTop,h=e.doc.scrollLeft;if(u.scrollTop!=null&&(ar(e,u.scrollTop),Math.abs(e.doc.scrollTop-f)>1&&(o=!0)),u.scrollLeft!=null&&(ct(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(o=!0)),!o)break}return n}function ts(e,t){var i=on(e,t);i.scrollTop!=null&&ar(e,i.scrollTop),i.scrollLeft!=null&&ct(e,i.scrollLeft)}function on(e,t){var i=e.display,r=Mt(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,l=Yi(e),o={};t.bottom-t.top>l&&(t.bottom=t.top+l);var a=e.doc.height+Xi(i),s=t.top<r,u=t.bottom>a-r;if(t.top<n)o.scrollTop=s?0:t.top;else if(t.bottom>n+l){var f=Math.min(t.top,(u?a:t.bottom)-l);f!=n&&(o.scrollTop=f)}var h=e.options.fixedGutter?0:i.gutters.offsetWidth,d=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-h,c=st(e)-i.gutters.offsetWidth,p=t.right-t.left>c;return p&&(t.right=t.left+c),t.left<10?o.scrollLeft=0:t.left<d?o.scrollLeft=Math.max(0,t.left+h-(p?0:10)):t.right>c+d-3&&(o.scrollLeft=t.right+(p?0:10)-c),o}function an(e,t){t!=null&&(Vr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function At(e){Vr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function or(e,t,i){(t!=null||i!=null)&&Vr(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function rs(e,t){Vr(e),e.curOp.scrollToPos=t}function Vr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Ml(e,t.from),r=Ml(e,t.to);Pl(e,i,r,t.margin)}}function Pl(e,t,i,r){var n=on(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});or(e,n.scrollLeft,n.scrollTop)}function ar(e,t){Math.abs(e.doc.scrollTop-t)<2||(We||un(e,{top:t}),El(e,t,!0),We&&un(e),fr(e,100))}function El(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function ct(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,Gl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function sr(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+Xi(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?i:0,docHeight:r,scrollHeight:r+Ne(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var dt=function(e,t,i){this.cm=i;var r=this.vert=k("div",[k("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=k("div",[k("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),T(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),T(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,A&&E<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};dt.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var l=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+l)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},dt.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},dt.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},dt.prototype.zeroWidthHack=function(){var e=ye&&!Zo?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ke,this.disableVert=new Ke},dt.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var n=e.getBoundingClientRect(),l=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);l!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},dt.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ur=function(){};ur.prototype.update=function(){return{bottom:0,right:0}},ur.prototype.setScrollLeft=function(){},ur.prototype.setScrollTop=function(){},ur.prototype.clear=function(){};function Ot(e,t){t||(t=sr(e));var i=e.display.barWidth,r=e.display.barHeight;Il(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&Jr(e),Il(e,sr(e)),i=e.display.barWidth,r=e.display.barHeight}function Il(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Rl={native:dt,null:ur};function Bl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&et(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Rl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),T(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?ct(e,t):ar(e,t)},e),e.display.scrollbars.addClass&&rt(e.display.wrapper,e.display.scrollbars.addClass)}var is=0;function pt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++is,markArrays:null},Fa(e.curOp)}function vt(e){var t=e.curOp;t&&Ea(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;ns(i)})}function ns(e){for(var t=e.ops,i=0;i<t.length;i++)ls(t[i]);for(var r=0;r<t.length;r++)os(t[r]);for(var n=0;n<t.length;n++)as(t[n]);for(var l=0;l<t.length;l++)ss(t[l]);for(var o=0;o<t.length;o++)us(t[o])}function ls(e){var t=e.cm,i=t.display;hs(t),e.updateMaxLine&&Ki(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $r(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function os(e){e.updatedDisplay=e.mustUpdate&&sn(e.cm,e.update)}function as(e){var t=e.cm,i=t.display;e.updatedDisplay&&Jr(t),e.barMeasure=sr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=bl(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Ne(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-st(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function ss(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ct(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==me(xt(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ot(t,e.barMeasure),e.updatedDisplay&&hn(t,e.barMeasure),e.selectionChanged&&rn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Hl(e.cm)}function us(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&zl(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&El(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ct(t,e.scrollLeft,!0,!0),e.scrollToPos){var n=es(t,D(r,e.scrollToPos.from),D(r,e.scrollToPos.to),e.scrollToPos.margin);$a(t,n)}var l=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(l)for(var a=0;a<l.length;++a)l[a].lines.length||G(l[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&G(o[s],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&G(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ce(e,t){if(e.curOp)return t();pt(e);try{return t()}finally{vt(e)}}function Z(e,t){return function(){if(e.curOp)return t.apply(e,arguments);pt(e);try{return t.apply(e,arguments)}finally{vt(e)}}}function ne(e){return function(){if(this.curOp)return e.apply(this,arguments);pt(this);try{return e.apply(this,arguments)}finally{vt(this)}}}function Q(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);pt(t);try{return e.apply(this,arguments)}finally{vt(t)}}}function fr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,yi(fs,e))}function fs(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var i=+new Date+e.options.workTime,r=$t(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(l){if(r.line>=e.display.viewFrom){var o=l.styles,a=l.text.length>e.options.maxHighlightLength?lt(t.mode,r.state):null,s=qn(e,l,r,!0);a&&(r.state=a),l.styles=s.styles;var u=l.styleClasses,f=s.classes;f?l.styleClasses=f:u&&(l.styleClasses=null);for(var h=!o||o.length!=l.styles.length||u!=f&&(!u||!f||u.bgClass!=f.bgClass||u.textClass!=f.textClass),d=0;!h&&d<o.length;++d)h=o[d]!=l.styles[d];h&&n.push(r.line),l.stateAfter=r.save(),r.nextLine()}else l.text.length<=e.options.maxHighlightLength&&Ii(e,l.text,r),l.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return fr(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&ce(e,function(){for(var l=0;l<n.length;l++)Xe(e,n[l],"text")})}}var $r=function(e,t,i){var r=e.display;this.viewport=t,this.visible=jr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=st(e),this.force=i,this.dims=Vi(e),this.events=[]};$r.prototype.signal=function(e,t){xe(e,t)&&this.events.push(arguments)},$r.prototype.finish=function(){for(var e=0;e<this.events.length;e++)G.apply(null,this.events[e])};function hs(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ne(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ne(e)+"px",t.scrollbarsClipped=!0)}function cs(e){if(e.hasFocus())return null;var t=me(xt(e));if(!t||!Ue(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=Ar(e).getSelection();r.anchorNode&&r.extend&&Ue(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}function ds(e){if(!(!e||!e.activeElt||e.activeElt==me(it(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&Ue(document.body,e.anchorNode)&&Ue(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,i=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),i.removeAllRanges(),i.addRange(r),i.extend(e.focusNode,e.focusOffset)}}function sn(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return Ye(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Ol(e)==0)return!1;Ul(e)&&(Ye(e),t.dims=Vi(e));var n=r.first+r.size,l=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFrom<l&&l-i.viewFrom<20&&(l=Math.max(r.first,i.viewFrom)),i.viewTo>o&&i.viewTo-o<20&&(o=Math.min(n,i.viewTo)),Fe&&(l=Gi(e.doc,l),o=al(e.doc,o));var a=l!=i.viewFrom||o!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;ja(e,l,o),i.viewOffset=Pe(w(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var s=Ol(e);if(!a&&s==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var u=cs(e);return s>4&&(i.lineDiv.style.display="none"),ps(e,i.updateLineNumbers,t.dims),s>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ds(u),Ge(i.cursorDiv),Ge(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,a&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,fr(e,400)),i.updateLineNumbers=null,!0}function zl(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==st(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+Xi(e.display)-Yi(e),i.top)}),t.visible=jr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=jr(e.display,e.doc,i));if(!sn(e,t))break;Jr(e);var n=sr(e);lr(e),Ot(e,n),hn(e,n),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function un(e,t){var i=new $r(e,t);if(sn(e,i)){Jr(e),zl(e,i);var r=sr(e);lr(e),Ot(e,r),hn(e,r),i.finish()}}function ps(e,t,i){var r=e.display,n=e.options.lineNumbers,l=r.lineDiv,o=l.firstChild;function a(p){var v=p.nextSibling;return ie&&ye&&e.display.currentWheelTarget==p?p.style.display="none":p.parentNode.removeChild(p),v}for(var s=r.view,u=r.viewFrom,f=0;f<s.length;f++){var h=s[f];if(!h.hidden)if(!h.node||h.node.parentNode!=l){var d=Ga(e,h,u,i);l.insertBefore(d,o)}else{for(;o!=h.node;)o=a(o);var c=n&&t!=null&&t<=u&&h.lineNumber;h.changes&&($(h.changes,"gutter")>-1&&(c=!1),cl(e,h,u,i)),c&&(Ge(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(Fi(e.options,u)))),o=h.node.nextSibling}u+=h.size}for(;o;)o=a(o)}function fn(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",q(e,"gutterChanged",e)}function hn(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+Ne(e)+"px"}function Gl(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=$i(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,l=r+"px",o=0;o<i.length;o++)if(!i[o].hidden){e.options.fixedGutter&&(i[o].gutter&&(i[o].gutter.style.left=l),i[o].gutterBackground&&(i[o].gutterBackground.style.left=l));var a=i[o].alignable;if(a)for(var s=0;s<a.length;s++)a[s].style.left=l}e.options.fixedGutter&&(t.gutters.style.left=r+n+"px")}}function Ul(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Fi(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var n=r.measure.appendChild(k("div",[k("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),l=n.firstChild.offsetWidth,o=n.offsetWidth-l;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(l,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",fn(e.display),!0}return!1}function cn(e,t){for(var i=[],r=!1,n=0;n<e.length;n++){var l=e[n],o=null;if(typeof l!="string"&&(o=l.style,l=l.className),l=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:l,style:o})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Kl(e){var t=e.gutters,i=e.gutterSpecs;Ge(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var n=i[r],l=n.className,o=n.style,a=t.appendChild(k("div",null,"CodeMirror-gutter "+l));o&&(a.style.cssText=o),l=="CodeMirror-linenumbers"&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",fn(e)}function hr(e){Kl(e.display),ae(e),Gl(e)}function vs(e,t,i,r){var n=this;this.input=i,n.scrollbarFiller=k("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=k("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=bt("div",null,"CodeMirror-code"),n.selectionDiv=k("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=k("div",null,"CodeMirror-cursors"),n.measure=k("div",null,"CodeMirror-measure"),n.lineMeasure=k("div",null,"CodeMirror-measure"),n.lineSpace=bt("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var l=bt("div",[n.lineSpace],"CodeMirror-lines");n.mover=k("div",[l],null,"position: relative"),n.sizer=k("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=k("div",null,null,"position: absolute; height: "+Pn+"px; width: 1px;"),n.gutters=k("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=k("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=k("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),ze&&Hn===105&&(n.wrapper.style.clipPath="inset(0px)"),n.wrapper.setAttribute("translate","no"),A&&E<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),!ie&&!(We&&_t)&&(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,n.gutterSpecs=cn(r.gutters,r.lineNumbers),Kl(n),i.init(n)}var ei=0,Ie=null;A?Ie=-.53:We?Ie=15:ze?Ie=-.7:Dr&&(Ie=-1/3);function _l(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function gs(e){var t=_l(e);return t.x*=Ie,t.y*=Ie,t}function Xl(e,t){ze&&Hn==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var i=_l(t),r=i.x,n=i.y,l=Ie;t.deltaMode===0&&(r=t.deltaX,n=t.deltaY,l=1);var o=e.display,a=o.scroller,s=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&s||n&&u){if(n&&ye&&ie){e:for(var f=t.target,h=o.view;f!=a;f=f.parentNode)for(var d=0;d<h.length;d++)if(h[d].node==f){e.display.currentWheelTarget=f;break e}}if(r&&!We&&!Ce&&l!=null){n&&u&&ar(e,Math.max(0,a.scrollTop+n*l)),ct(e,Math.max(0,a.scrollLeft+r*l)),(!n||n&&u)&&oe(t),o.wheelStartX=null;return}if(n&&l!=null){var c=n*l,p=e.doc.scrollTop,v=p+o.wrapper.clientHeight;c<0?p=Math.max(0,p+c-50):v=Math.min(e.doc.height,v+c+50),un(e,{top:p,bottom:v})}ei<20&&t.deltaMode!==0&&(o.wheelStartX==null?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=n,setTimeout(function(){if(o.wheelStartX!=null){var y=a.scrollLeft-o.wheelStartX,m=a.scrollTop-o.wheelStartY,x=m&&o.wheelDY&&m/o.wheelDY||y&&o.wheelDX&&y/o.wheelDX;o.wheelStartX=o.wheelStartY=null,x&&(Ie=(Ie*ei+x)/(ei+1),++ei)}},200)):(o.wheelDX+=r,o.wheelDY+=n))}}var ge=function(e,t){this.ranges=e,this.primIndex=t};ge.prototype.primary=function(){return this.ranges[this.primIndex]},ge.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],r=e.ranges[t];if(!Pi(i.anchor,r.anchor)||!Pi(i.head,r.head))return!1}return!0},ge.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new O(Ei(this.ranges[t].anchor),Ei(this.ranges[t].head));return new ge(e,this.primIndex)},ge.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ge.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(M(t,r.from())>=0&&M(e,r.to())<=0)return i}return-1};var O=function(e,t){this.anchor=e,this.head=t};O.prototype.from=function(){return Ir(this.anchor,this.head)},O.prototype.to=function(){return Er(this.anchor,this.head)},O.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Le(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(d,c){return M(d.from(),c.from())}),i=$(t,n);for(var l=1;l<t.length;l++){var o=t[l],a=t[l-1],s=M(a.to(),o.from());if(r&&!o.empty()?s>0:s>=0){var u=Ir(a.from(),o.from()),f=Er(a.to(),o.to()),h=a.empty()?o.from()==o.head:a.from()==a.head;l<=i&&--i,t.splice(--l,2,new O(h?f:u,h?u:f))}}return new ge(t,i)}function qe(e,t){return new ge([new O(e,t||e)],0)}function Ze(e){return e.text?g(e.from.line+e.text.length-1,W(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Yl(e,t){if(M(e,t.from)<0)return e;if(M(e,t.to)<=0)return Ze(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ze(t).ch-t.to.ch),g(i,r)}function dn(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var n=e.sel.ranges[r];i.push(new O(Yl(n.anchor,t),Yl(n.head,t)))}return Le(e.cm,i,e.sel.primIndex)}function ql(e,t,i){return e.line==t.line?g(i.line,e.ch-t.ch+i.ch):g(i.line+(e.line-t.line),e.ch)}function ys(e,t,i){for(var r=[],n=g(e.first,0),l=n,o=0;o<t.length;o++){var a=t[o],s=ql(a.from,n,l),u=ql(Ze(a),n,l);if(n=a.to,l=u,i=="around"){var f=e.sel.ranges[o],h=M(f.head,f.anchor)<0;r[o]=new O(h?u:s,h?s:u)}else r[o]=new O(s,s)}return new ge(r,e.sel.primIndex)}function pn(e){e.doc.mode=Oi(e.options,e.doc.modeOption),cr(e)}function cr(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,fr(e,100),e.state.modeGen++,e.curOp&&ae(e)}function Zl(e,t){return t.from.ch==0&&t.to.ch==0&&W(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function vn(e,t,i,r){function n(x){return i?i[x]:null}function l(x,b,C){ka(x,b,C,r),q(x,"change",x,t)}function o(x,b){for(var C=[],L=x;L<b;++L)C.push(new Lt(u[L],n(L),r));return C}var a=t.from,s=t.to,u=t.text,f=w(e,a.line),h=w(e,s.line),d=W(u),c=n(u.length-1),p=s.line-a.line;if(t.full)e.insert(0,o(0,u.length)),e.remove(u.length,e.size-u.length);else if(Zl(e,t)){var v=o(0,u.length-1);l(h,h.text,c),p&&e.remove(a.line,p),v.length&&e.insert(a.line,v)}else if(f==h)if(u.length==1)l(f,f.text.slice(0,a.ch)+d+f.text.slice(s.ch),c);else{var y=o(1,u.length-1);y.push(new Lt(d+f.text.slice(s.ch),c,r)),l(f,f.text.slice(0,a.ch)+u[0],n(0)),e.insert(a.line+1,y)}else if(u.length==1)l(f,f.text.slice(0,a.ch)+u[0]+h.text.slice(s.ch),n(0)),e.remove(a.line+1,p);else{l(f,f.text.slice(0,a.ch)+u[0],n(0)),l(h,d+h.text.slice(s.ch),c);var m=o(1,u.length-1);p>1&&e.remove(a.line+1,p-1),e.insert(a.line+1,m)}q(e,"change",e,t)}function Qe(e,t,i){function r(n,l,o){if(n.linked)for(var a=0;a<n.linked.length;++a){var s=n.linked[a];if(s.doc!=l){var u=o&&s.sharedHist;i&&!u||(t(s.doc,u),r(s.doc,n,u))}}}r(e,null,!0)}function Ql(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,en(e),pn(e),Jl(e),e.options.direction=t.direction,e.options.lineWrapping||Ki(e),e.options.mode=t.modeOption,ae(e)}function Jl(e){(e.doc.direction=="rtl"?rt:et)(e.display.lineDiv,"CodeMirror-rtl")}function ms(e){ce(e,function(){Jl(e),ae(e)})}function ti(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function gn(e,t){var i={from:Ei(t.from),to:Ze(t),text:ot(e,t.from,t.to)};return $l(e,i,t.from.line,t.to.line+1),Qe(e,function(r){return $l(r,i,t.from.line,t.to.line+1)},!0),i}function jl(e){for(;e.length;){var t=W(e);if(t.ranges)e.pop();else break}}function bs(e,t){if(t)return jl(e.done),W(e.done);if(e.done.length&&!W(e.done).ranges)return W(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),W(e.done)}function Vl(e,t,i,r){var n=e.history;n.undone.length=0;var l=+new Date,o,a;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(o=bs(n,n.lastOp==r)))a=W(o.changes),M(t.from,t.to)==0&&M(t.from,a.to)==0?a.to=Ze(t):o.changes.push(gn(e,t));else{var s=W(n.done);for((!s||!s.ranges)&&ri(e.sel,n.done),o={changes:[gn(e,t)],generation:n.generation},n.done.push(o);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=l,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,a||G(e,"historyAdded")}function xs(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Cs(e,t,i,r){var n=e.history,l=r&&r.origin;i==n.lastSelOp||l&&n.lastSelOrigin==l&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==l||xs(e,l,W(n.done),t))?n.done[n.done.length-1]=t:ri(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=l,n.lastSelOp=i,r&&r.clearRedo!==!1&&jl(n.undone)}function ri(e,t){var i=W(t);i&&i.ranges&&i.equals(e)||t.push(e)}function $l(e,t,i,r){var n=t["spans_"+e.id],l=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(o){o.markedSpans&&((n||(n=t["spans_"+e.id]={}))[l]=o.markedSpans),++l})}function ws(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function Ss(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],n=0;n<t.text.length;++n)r.push(ws(i[n]));return r}function eo(e,t){var i=Ss(e,t),r=Bi(e,t);if(!i)return r;if(!r)return i;for(var n=0;n<i.length;++n){var l=i[n],o=r[n];if(l&&o)e:for(var a=0;a<o.length;++a){for(var s=o[a],u=0;u<l.length;++u)if(l[u].marker==s.marker)continue e;l.push(s)}else o&&(i[n]=o)}return i}function Wt(e,t,i){for(var r=[],n=0;n<e.length;++n){var l=e[n];if(l.ranges){r.push(i?ge.prototype.deepCopy.call(l):l);continue}var o=l.changes,a=[];r.push({changes:a});for(var s=0;s<o.length;++s){var u=o[s],f=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(f=h.match(/^spans_(\d+)$/))&&$(t,Number(f[1]))>-1&&(W(a)[h]=u[h],delete u[h])}}return r}function yn(e,t,i,r){if(r){var n=e.anchor;if(i){var l=M(t,n)<0;l!=M(i,n)<0?(n=t,t=i):l!=M(t,i)<0&&(t=i)}return new O(n,t)}else return new O(i||t,t)}function ii(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),ee(e,new ge([yn(e.sel.primary(),t,i,n)],0),r)}function to(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),l=0;l<e.sel.ranges.length;l++)r[l]=yn(e.sel.ranges[l],t[l],null,n);var o=Le(e.cm,r,e.sel.primIndex);ee(e,o,i)}function mn(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i,ee(e,Le(e.cm,n,e.sel.primIndex),r)}function ro(e,t,i,r){ee(e,qe(t,i),r)}function Ls(e,t,i){var r={ranges:t.ranges,update:function(n){this.ranges=[];for(var l=0;l<n.length;l++)this.ranges[l]=new O(D(e,n[l].anchor),D(e,n[l].head))},origin:i&&i.origin};return G(e,"beforeSelectionChange",e,r),e.cm&&G(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Le(e.cm,r.ranges,r.ranges.length-1):t}function io(e,t,i){var r=e.history.done,n=W(r);n&&n.ranges?(r[r.length-1]=t,ni(e,t,i)):ee(e,t,i)}function ee(e,t,i){ni(e,t,i),Cs(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function ni(e,t,i){(xe(e,"beforeSelectionChange")||e.cm&&xe(e.cm,"beforeSelectionChange"))&&(t=Ls(e,t,i));var r=i&&i.bias||(M(t.primary().head,e.sel.primary().head)<0?-1:1);no(e,oo(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&At(e.cm)}function no(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Gn(e.cm)),q(e,"cursorActivity",e))}function lo(e){no(e,oo(e,e.sel,null,!1))}function oo(e,t,i,r){for(var n,l=0;l<t.ranges.length;l++){var o=t.ranges[l],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[l],s=li(e,o.anchor,a&&a.anchor,i,r),u=o.head==o.anchor?s:li(e,o.head,a&&a.head,i,r);(n||s!=o.anchor||u!=o.head)&&(n||(n=t.ranges.slice(0,l)),n[l]=new O(s,u))}return n?Le(e.cm,n,t.primIndex):t}function Ht(e,t,i,r,n){var l=w(e,t.line);if(l.markedSpans)for(var o=0;o<l.markedSpans.length;++o){var a=l.markedSpans[o],s=a.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,f="selectRight"in s?!s.selectRight:s.inclusiveRight;if((a.from==null||(u?a.from<=t.ch:a.from<t.ch))&&(a.to==null||(f?a.to>=t.ch:a.to>t.ch))){if(n&&(G(s,"beforeCursorEnter"),s.explicitlyCleared))if(l.markedSpans){--o;continue}else break;if(!s.atomic)continue;if(i){var h=s.find(r<0?1:-1),d=void 0;if((r<0?f:u)&&(h=ao(e,h,-r,h&&h.line==t.line?l:null)),h&&h.line==t.line&&(d=M(h,i))&&(r<0?d<0:d>0))return Ht(e,h,t,r,n)}var c=s.find(r<0?-1:1);return(r<0?u:f)&&(c=ao(e,c,r,c.line==t.line?l:null)),c?Ht(e,c,t,r,n):null}}return t}function li(e,t,i,r,n){var l=r||1,o=Ht(e,t,i,l,n)||!n&&Ht(e,t,i,l,!0)||Ht(e,t,i,-l,n)||!n&&Ht(e,t,i,-l,!0);return o||(e.cantEdit=!0,g(e.first,0))}function ao(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?D(e,g(t.line-1)):null:i>0&&t.ch==(r||w(e,t.line)).text.length?t.line<e.first+e.size-1?g(t.line+1,0):null:new g(t.line,t.ch+i)}function so(e){e.setSelection(g(e.firstLine(),0),g(e.lastLine()),Te)}function uo(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(n,l,o,a){n&&(r.from=D(e,n)),l&&(r.to=D(e,l)),o&&(r.text=o),a!==void 0&&(r.origin=a)}),G(e,"beforeChange",e,r),e.cm&&G(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Ft(e,t,i){if(e.cm){if(!e.cm.curOp)return Z(e.cm,Ft)(e,t,i);if(e.cm.state.suppressEdits)return}if(!((xe(e,"beforeChange")||e.cm&&xe(e.cm,"beforeChange"))&&(t=uo(e,t,!0),!t))){var r=el&&!i&&Ca(e,t.from,t.to);if(r)for(var n=r.length-1;n>=0;--n)fo(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else fo(e,t)}}function fo(e,t){if(!(t.text.length==1&&t.text[0]==""&&M(t.from,t.to)==0)){var i=dn(e,t);Vl(e,t,i,e.cm?e.cm.curOp.id:NaN),dr(e,t,i,Bi(e,t));var r=[];Qe(e,function(n,l){!l&&$(r,n.history)==-1&&(vo(n.history,t),r.push(n.history)),dr(n,t,null,Bi(n,t))})}}function oi(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var n=e.history,l,o=e.sel,a=t=="undo"?n.done:n.undone,s=t=="undo"?n.undone:n.done,u=0;u<a.length&&(l=a[u],!(i?l.ranges&&!l.equals(e.sel):!l.ranges));u++);if(u!=a.length){for(n.lastOrigin=n.lastSelOrigin=null;;)if(l=a.pop(),l.ranges){if(ri(l,s),i&&!l.equals(e.sel)){ee(e,l,{clearRedo:!1});return}o=l}else if(r){a.push(l);return}else break;var f=[];ri(o,s),s.push({changes:f,generation:n.generation}),n.generation=l.generation||++n.maxGeneration;for(var h=xe(e,"beforeChange")||e.cm&&xe(e.cm,"beforeChange"),d=function(v){var y=l.changes[v];if(y.origin=t,h&&!uo(e,y,!1))return a.length=0,{};f.push(gn(e,y));var m=v?dn(e,y):W(a);dr(e,y,m,eo(e,y)),!v&&e.cm&&e.cm.scrollIntoView({from:y.from,to:Ze(y)});var x=[];Qe(e,function(b,C){!C&&$(x,b.history)==-1&&(vo(b.history,y),x.push(b.history)),dr(b,y,null,eo(b,y))})},c=l.changes.length-1;c>=0;--c){var p=d(c);if(p)return p.v}}}}function ho(e,t){if(t!=0&&(e.first+=t,e.sel=new ge(Hr(e.sel.ranges,function(n){return new O(g(n.anchor.line+t,n.anchor.ch),g(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm)){ae(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)Xe(e.cm,r,"gutter")}}function dr(e,t,i,r){if(e.cm&&!e.cm.curOp)return Z(e.cm,dr)(e,t,i,r);if(t.to.line<e.first){ho(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var n=t.text.length-1-(e.first-t.from.line);ho(e,n),t={from:g(e.first,0),to:g(t.to.line+n,t.to.ch),text:[W(t.text)],origin:t.origin}}var l=e.lastLine();t.to.line>l&&(t={from:t.from,to:g(l,w(e,l).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ot(e,t.from,t.to),i||(i=dn(e,t)),e.cm?ks(e.cm,t,r):vn(e,t,r),ni(e,i,Te),e.cantEdit&&li(e,g(e.firstLine(),0))&&(e.cantEdit=!1)}}function ks(e,t,i){var r=e.doc,n=e.display,l=t.from,o=t.to,a=!1,s=l.line;e.options.lineWrapping||(s=H(we(w(r,l.line))),r.iter(s,o.line+1,function(c){if(c==n.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Gn(e),vn(r,t,i,Al(e)),e.options.lineWrapping||(r.iter(s,l.line+t.text.length,function(c){var p=Kr(c);p>n.maxLineLength&&(n.maxLine=c,n.maxLineLength=p,n.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),pa(r,l.line),fr(e,400);var u=t.text.length-(o.line-l.line)-1;t.full?ae(e):l.line==o.line&&t.text.length==1&&!Zl(e.doc,t)?Xe(e,l.line,"text"):ae(e,l.line,o.line+1,u);var f=xe(e,"changes"),h=xe(e,"change");if(h||f){var d={from:l,to:o,text:t.text,removed:t.removed,origin:t.origin};h&&q(e,"change",e,d),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}function Pt(e,t,i,r,n){var l;r||(r=i),M(r,i)<0&&(l=[r,i],i=l[0],r=l[1]),typeof t=="string"&&(t=e.splitLines(t)),Ft(e,{from:i,to:r,text:t,origin:n})}function co(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function po(e,t,i,r){for(var n=0;n<e.length;++n){var l=e[n],o=!0;if(l.ranges){l.copied||(l=e[n]=l.deepCopy(),l.copied=!0);for(var a=0;a<l.ranges.length;a++)co(l.ranges[a].anchor,t,i,r),co(l.ranges[a].head,t,i,r);continue}for(var s=0;s<l.changes.length;++s){var u=l.changes[s];if(i<u.from.line)u.from=g(u.from.line+r,u.from.ch),u.to=g(u.to.line+r,u.to.ch);else if(t<=u.to.line){o=!1;break}}o||(e.splice(0,n+1),n=0)}}function vo(e,t){var i=t.from.line,r=t.to.line,n=t.text.length-(r-i)-1;po(e.done,i,r,n),po(e.undone,i,r,n)}function pr(e,t,i,r){var n=t,l=t;return typeof t=="number"?l=w(e,Xn(e,t)):n=H(t),n==null?null:(r(l,n)&&e.cm&&Xe(e.cm,n,i),l)}function vr(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}vr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var n=this.lines[i];this.height-=n.height,Ta(n),q(n,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function gr(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var n=e[r];t+=n.chunkSize(),i+=n.height,n.parent=this}this.size=t,this.height=i,this.parent=null}gr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],n=r.chunkSize();if(e<n){var l=Math.min(t,n-e),o=r.height;if(r.removeInner(e,l),this.height-=o-r.height,n==l&&(this.children.splice(i--,1),r.parent=null),(t-=l)==0)break;e=0}else e-=n}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof vr))){var a=[];this.collapse(a),this.children=[new vr(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var n=this.children[r],l=n.chunkSize();if(e<=l){if(n.insertInner(e,t,i),n.lines&&n.lines.length>50){for(var o=n.lines.length%25+25,a=o;a<n.lines.length;){var s=new vr(n.lines.slice(a,a+=25));n.height-=s.height,this.children.splice(++r,0,s),s.parent=this}n.lines=n.lines.slice(0,o),this.maybeSpill()}break}e-=l}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new gr(t);if(e.parent){e.size-=i.size,e.height-=i.height;var n=$(e.parent.children,e);e.parent.children.splice(n+1,0,i)}else{var r=new gr(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var n=this.children[r],l=n.chunkSize();if(e<l){var o=Math.min(t,l-e);if(n.iterN(e,o,i))return!0;if((t-=o)==0)break;e=0}else e-=l}}};var yr=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};yr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=H(i);if(!(r==null||!t)){for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(i.widgets=null);var l=ir(this);Me(i,Math.max(0,i.height-l)),e&&(ce(e,function(){go(e,i,-l),Xe(e,r,"widget")}),q(e,"lineWidgetCleared",e,this,r))}},yr.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var n=ir(this)-t;n&&(_e(this.doc,r)||Me(r,r.height+n),i&&ce(i,function(){i.curOp.forceUpdate=!0,go(i,r,n),q(i,"lineWidgetChanged",i,e,H(r))}))},Ct(yr);function go(e,t,i){Pe(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&an(e,i)}function Ts(e,t,i,r){var n=new yr(e,i,r),l=e.cm;return l&&n.noHScroll&&(l.display.alignWidgets=!0),pr(e,t,"widget",function(o){var a=o.widgets||(o.widgets=[]);if(n.insertAt==null?a.push(n):a.splice(Math.min(a.length,Math.max(0,n.insertAt)),0,n),n.line=o,l&&!_e(e,o)){var s=Pe(o)<e.scrollTop;Me(o,o.height+ir(n)),s&&an(l,n.height),l.curOp.forceUpdate=!0}return!0}),l&&q(l,"lineWidgetAdded",l,n,typeof t=="number"?t:H(t)),n}var yo=0,Je=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++yo};Je.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&pt(e),xe(this,"clear")){var i=this.find();i&&q(this,"clear",i.from,i.to)}for(var r=null,n=null,l=0;l<this.lines.length;++l){var o=this.lines[l],a=er(o.markedSpans,this);e&&!this.collapsed?Xe(e,H(o),"text"):e&&(a.to!=null&&(n=H(o)),a.from!=null&&(r=H(o))),o.markedSpans=ya(o.markedSpans,a),a.from==null&&this.collapsed&&!_e(this.doc,o)&&e&&Me(o,Mt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=we(this.lines[s]),f=Kr(u);f>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=f,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&ae(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&lo(e.doc)),e&&q(e,"markerCleared",e,this,r,n),t&&vt(e),this.parent&&this.parent.clear()}},Je.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n<this.lines.length;++n){var l=this.lines[n],o=er(l.markedSpans,this);if(o.from!=null&&(i=g(t?l:H(l),o.from),e==-1))return i;if(o.to!=null&&(r=g(t?l:H(l),o.to),e==1))return r}return i&&{from:i,to:r}},Je.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;!t||!r||ce(r,function(){var n=t.line,l=H(t.line),o=qi(r,l);if(o&&(wl(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!_e(i.doc,n)&&i.height!=null){var a=i.height;i.height=null;var s=ir(i)-a;s&&Me(n,n.height+s)}q(r,"markerChanged",r,e)})},Je.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||$(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Je.prototype.detachLine=function(e){if(this.lines.splice($(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ct(Je);function Et(e,t,i,r,n){if(r&&r.shared)return Ms(e,t,i,r,n);if(e.cm&&!e.cm.curOp)return Z(e.cm,Et)(e,t,i,r,n);var l=new Je(e,n),o=M(t,i);if(r&&nt(r,l,!1),o>0||o==0&&l.clearWhenEmpty!==!1)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=bt("span",[l.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(ol(e,t.line,t,i,l)||t.line!=i.line&&ol(e,i.line,t,i,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");ga()}l.addToHistory&&Vl(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var a=t.line,s=e.cm,u;if(e.iter(a,i.line+1,function(h){s&&l.collapsed&&!s.options.lineWrapping&&we(h)==s.display.maxLine&&(u=!0),l.collapsed&&a!=t.line&&Me(h,0),ma(h,new Br(l,a==t.line?t.ch:null,a==i.line?i.ch:null),e.cm&&e.cm.curOp),++a}),l.collapsed&&e.iter(t.line,i.line+1,function(h){_e(e,h)&&Me(h,0)}),l.clearOnEnter&&T(l,"beforeCursorEnter",function(){return l.clear()}),l.readOnly&&(va(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++yo,l.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),l.collapsed)ae(s,t.line,i.line+1);else if(l.className||l.startStyle||l.endStyle||l.css||l.attributes||l.title)for(var f=t.line;f<=i.line;f++)Xe(s,f,"text");l.atomic&&lo(s.doc),q(s,"markerAdded",s,l)}return l}var mr=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};mr.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();q(this,"clear")}},mr.prototype.find=function(e,t){return this.primary.find(e,t)},Ct(mr);function Ms(e,t,i,r,n){r=nt(r),r.shared=!1;var l=[Et(e,t,i,r,n)],o=l[0],a=r.widgetNode;return Qe(e,function(s){a&&(r.widgetNode=a.cloneNode(!0)),l.push(Et(s,D(s,t),D(s,i),r,n));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;o=W(l)}),new mr(l,o)}function mo(e){return e.findMarks(g(e.first,0),e.clipPos(g(e.lastLine())),function(t){return t.parent})}function Ds(e,t){for(var i=0;i<t.length;i++){var r=t[i],n=r.find(),l=e.clipPos(n.from),o=e.clipPos(n.to);if(M(l,o)){var a=Et(e,l,o,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}function Ns(e){for(var t=function(r){var n=e[r],l=[n.primary.doc];Qe(n.primary.doc,function(s){return l.push(s)});for(var o=0;o<n.markers.length;o++){var a=n.markers[o];$(l,a.doc)==-1&&(a.parent=null,n.markers.splice(o--,1))}},i=0;i<e.length;i++)t(i)}var As=0,se=function(e,t,i,r,n){if(!(this instanceof se))return new se(e,t,i,r,n);i==null&&(i=0),gr.call(this,[new vr([new Lt("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var l=g(i,0);this.sel=qe(l),this.history=new ti(null),this.id=++As,this.modeOption=t,this.lineSep=r,this.direction=n=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),vn(this,{from:l,to:l,text:e}),ee(this,qe(l),Te)};se.prototype=In(gr.prototype,{constructor:se,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Hi(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Q(function(e){var t=g(this.first,0),i=this.first+this.size-1;Ft(this,{from:t,to:g(i,w(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&or(this.cm,0,0),ee(this,qe(t),Te)}),replaceRange:function(e,t,i,r){t=D(this,t),i=i?D(this,i):t,Pt(this,e,t,i,r)},getRange:function(e,t,i){var r=ot(this,D(this,e),D(this,t));return i===!1?r:i===""?r.join(""):r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Vt(this,e))return w(this,e)},getLineNumber:function(e){return H(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=w(this,e)),we(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return D(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Q(function(e,t,i){ro(this,D(this,typeof e=="number"?g(e,t||0):e),null,i)}),setSelection:Q(function(e,t,i){ro(this,D(this,e),D(this,t||e),i)}),extendSelection:Q(function(e,t,i){ii(this,D(this,e),t&&D(this,t),i)}),extendSelections:Q(function(e,t){to(this,Yn(this,e),t)}),extendSelectionsBy:Q(function(e,t){var i=Hr(this.sel.ranges,e);to(this,Yn(this,i),t)}),setSelections:Q(function(e,t,i){if(e.length){for(var r=[],n=0;n<e.length;n++)r[n]=new O(D(this,e[n].anchor),D(this,e[n].head||e[n].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),ee(this,Le(this.cm,r,t),i)}}),addSelection:Q(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new O(D(this,e),D(this,t||e))),ee(this,Le(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,r=0;r<t.length;r++){var n=ot(this,t[r].from(),t[r].to());i=i?i.concat(n):n}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var n=ot(this,i[r].from(),i[r].to());e!==!1&&(n=n.join(e||this.lineSeparator())),t[r]=n}return t},replaceSelection:function(e,t,i){for(var r=[],n=0;n<this.sel.ranges.length;n++)r[n]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:Q(function(e,t,i){for(var r=[],n=this.sel,l=0;l<n.ranges.length;l++){var o=n.ranges[l];r[l]={from:o.from(),to:o.to(),text:this.splitLines(e[l]),origin:i}}for(var a=t&&t!="end"&&ys(this,r,t),s=r.length-1;s>=0;s--)Ft(this,r[s]);a?io(this,a):this.cm&&At(this.cm)}),undo:Q(function(){oi(this,"undo")}),redo:Q(function(){oi(this,"redo")}),undoSelection:Q(function(){oi(this,"undo",!0)}),redoSelection:Q(function(){oi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new ti(this.history),Qe(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Wt(this.history.done),undone:Wt(this.history.undone)}},setHistory:function(e){var t=this.history=new ti(this.history);t.done=Wt(e.done.slice(0),null,!0),t.undone=Wt(e.undone.slice(0),null,!0)},setGutterMarker:Q(function(e,t,i){return pr(this,e,"gutter",function(r){var n=r.gutterMarkers||(r.gutterMarkers={});return n[t]=i,!i&&Rn(n)&&(r.gutterMarkers=null),!0})}),clearGutter:Q(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&pr(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Rn(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Vt(this,e)||(t=e,e=w(this,e),!e))return null}else if(t=H(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Q(function(e,t,i){return pr(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[n])r[n]=i;else{if(mt(i).test(r[n]))return!1;r[n]+=" "+i}return!0})}),removeLineClass:Q(function(e,t,i){return pr(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",l=r[n];if(l)if(i==null)r[n]=null;else{var o=l.match(mt(i));if(!o)return!1;var a=o.index+o[0].length;r[n]=l.slice(0,o.index)+(!o.index||a==l.length?"":" ")+l.slice(a)||null}else return!1;return!0})}),addLineWidget:Q(function(e,t,i){return Ts(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Et(this,D(this,e),D(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=D(this,e),Et(this,e,e,i,"bookmark")},findMarksAt:function(e){e=D(this,e);var t=[],i=w(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var n=i[r];(n.from==null||n.from<=e.ch)&&(n.to==null||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=D(this,e),t=D(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(l){var o=l.markedSpans;if(o)for(var a=0;a<o.length;a++){var s=o[a];!(s.to!=null&&n==e.line&&e.ch>=s.to||s.from==null&&n!=e.line||s.from!=null&&n==t.line&&s.from>=t.ch)&&(!i||i(s.marker))&&r.push(s.marker.parent||s.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)i[r].from!=null&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(n){var l=n.text.length+r;if(l>e)return t=e,!0;e-=l,++i}),D(this,g(i,t))},indexFromPos:function(e){e=D(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new se(Hi(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new se(Hi(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Ds(r,mo(this)),r},unlinkDoc:function(e){if(e instanceof I&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ns(mo(this));break}}if(e.history==this.history){var r=[e.id];Qe(e,function(n){return r.push(n.id)},!0),e.history=new ti(null),e.history.done=Wt(this.history.done,r),e.history.undone=Wt(this.history.undone,r)}},iterLinkedDocs:function(e){Qe(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Di(e)},lineSeparator:function(){return this.lineSep||`
|
|
11
11
|
`},setDirection:Q(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&ms(this.cm))})}),se.prototype.eachLine=se.prototype.iter;var bo=0;function Os(e){var t=this;if(xo(t),!(Y(t,e)||Ee(t.display,e))){oe(e),A&&(bo=+new Date);var i=ft(t,e,!0),r=e.dataTransfer.files;if(!(!i||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var n=r.length,l=Array(n),o=0,a=function(){++o==n&&Z(t,function(){i=D(t.doc,i);var c={from:i,to:i,text:t.doc.splitLines(l.filter(function(p){return p!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ft(t.doc,c),io(t.doc,qe(D(t.doc,i),D(t.doc,Ze(c))))})()},s=function(c,p){if(t.options.allowDropFileTypes&&$(t.options.allowDropFileTypes,c.type)==-1){a();return}var v=new FileReader;v.onerror=function(){return a()},v.onload=function(){var y=v.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(y)){a();return}l[p]=y,a()},v.readAsText(c)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var f=e.dataTransfer.getData("Text");if(f){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),ni(t.doc,qe(i,i)),h)for(var d=0;d<h.length;++d)Pt(t.doc,"",h[d].anchor,h[d].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch{}}}}function Ws(e,t){if(A&&(!e.state.draggingText||+new Date-bo<100)){jt(t);return}if(!(Y(e,t)||Ee(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Dr)){var i=k("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Ce&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),Ce&&i.parentNode.removeChild(i)}}function Hs(e,t){var i=ft(e,t);if(i){var r=document.createDocumentFragment();tn(e,i,r),e.display.dragCursor||(e.display.dragCursor=k("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),pe(e.display.dragCursor,r)}}function xo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Co(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&i.push(n)}i.length&&i[0].operation(function(){for(var l=0;l<i.length;l++)e(i[l])})}}var wo=!1;function Fs(){wo||(Ps(),wo=!0)}function Ps(){var e;T(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Co(Es)},100))}),T(window,"blur",function(){return Co(Nt)})}function Es(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var je={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},br=0;br<10;br++)je[br+48]=je[br+96]=String(br);for(var ai=65;ai<=90;ai++)je[ai]=String.fromCharCode(ai);for(var xr=1;xr<=12;xr++)je[xr+111]=je[xr+63235]="F"+xr;var Re={};Re.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Re.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Re.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Re.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Re.default=ye?Re.macDefault:Re.pcDefault;function Is(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,n,l,o=0;o<t.length-1;o++){var a=t[o];if(/^(cmd|meta|m)$/i.test(a))l=!0;else if(/^a(lt)?$/i.test(a))i=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else if(/^s(hift)?$/i.test(a))n=!0;else throw new Error("Unrecognized modifier name: "+a)}return i&&(e="Alt-"+e),r&&(e="Ctrl-"+e),l&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Rs(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(r=="..."){delete e[i];continue}for(var n=Hr(i.split(" "),Is),l=0;l<n.length;l++){var o=void 0,a=void 0;l==n.length-1?(a=n.join(" "),o=r):(a=n.slice(0,l+1).join(" "),o="...");var s=t[a];if(!s)t[a]=o;else if(s!=o)throw new Error("Inconsistent bindings for "+a)}delete e[i]}for(var u in t)e[u]=t[u];return e}function It(e,t,i,r){t=si(t);var n=t.call?t.call(e,r):t[e];if(n===!1)return"nothing";if(n==="...")return"multi";if(n!=null&&i(n))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return It(e,t.fallthrough,i,r);for(var l=0;l<t.fallthrough.length;l++){var o=It(e,t.fallthrough[l],i,r);if(o)return o}}}function So(e){var t=typeof e=="string"?e:je[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Lo(e,t,i){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(Fn?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(Fn?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function ko(e,t){if(Ce&&e.keyCode==34&&e.char)return!1;var i=je[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),Lo(i,e,t))}function si(e){return typeof e=="string"?Re[e]:e}function Rt(e,t){for(var i=e.doc.sel.ranges,r=[],n=0;n<i.length;n++){for(var l=t(i[n]);r.length&&M(l.from,W(r).to)<=0;){var o=r.pop();if(M(o.from,l.from)<0){l.from=o.from;break}}r.push(l)}ce(e,function(){for(var a=r.length-1;a>=0;a--)Pt(e.doc,"",r[a].from,r[a].to,"+delete");At(e)})}function bn(e,t,i){var r=Bn(e.text,t+i,i);return r<0||r>e.text.length?null:r}function xn(e,t,i){var r=bn(e,t.ch,i);return r==null?null:new g(t.line,r,i<0?"after":"before")}function Cn(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var l=He(i,t.doc.direction);if(l){var o=n<0?W(l):l[0],a=n<0==(o.level==1),s=a?"after":"before",u;if(o.level>0||t.doc.direction=="rtl"){var f=Tt(t,i);u=n<0?i.text.length-1:0;var h=Ae(t,f,u).top;u=Zt(function(d){return Ae(t,f,d).top==h},n<0==(o.level==1)?o.from:o.to-1,u),s=="before"&&(u=bn(i,u,1))}else u=n<0?o.to:o.from;return new g(r,u,s)}}return new g(r,n<0?i.text.length:0,n<0?"before":"after")}function Bs(e,t,i,r){var n=He(t,e.doc.direction);if(!n)return xn(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var l=Jt(n,i.ch,i.sticky),o=n[l];if(e.doc.direction=="ltr"&&o.level%2==0&&(r>0?o.to>i.ch:o.from<i.ch))return xn(t,i,r);var a=function(m,x){return bn(t,m instanceof g?m.ch:m,x)},s,u=function(m){return e.options.lineWrapping?(s=s||Tt(e,t),Nl(e,t,s,m)):{begin:0,end:t.text.length}},f=u(i.sticky=="before"?a(i,-1):i.ch);if(e.doc.direction=="rtl"||o.level==1){var h=o.level==1==r<0,d=a(i,h?1:-1);if(d!=null&&(h?d<=o.to&&d<=f.end:d>=o.from&&d>=f.begin)){var c=h?"before":"after";return new g(i.line,d,c)}}var p=function(m,x,b){for(var C=function(P,J){return J?new g(i.line,a(P,1),"before"):new g(i.line,P,"after")};m>=0&&m<n.length;m+=x){var L=n[m],S=x>0==(L.level!=1),N=S?b.begin:a(b.end,-1);if(L.from<=N&&N<L.to||(N=S?L.from:a(L.to,-1),b.begin<=N&&N<b.end))return C(N,S)}},v=p(l+r,r,f);if(v)return v;var y=r>0?f.end:a(f.begin,-1);return y!=null&&!(r>0&&y==t.text.length)&&(v=p(r>0?0:n.length-1,r,u(y)),v)?v:null}var Cr={selectAll:so,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Te)},killLine:function(e){return Rt(e,function(t){if(t.empty()){var i=w(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:g(t.head.line+1,0)}:{from:t.head,to:g(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Rt(e,function(t){return{from:g(t.from().line,0),to:D(e.doc,g(t.to().line+1,0))}})},delLineLeft:function(e){return Rt(e,function(t){return{from:g(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Rt(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Rt(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(g(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(g(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return To(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Mo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return zs(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},qt)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},qt)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?Mo(e,t.head):r},qt)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),r=e.options.tabSize,n=0;n<i.length;n++){var l=i[n].from(),o=be(e.getLine(l.line),l.ch,r);t.push(xi(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ce(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++)if(t[r].empty()){var n=t[r].head,l=w(e.doc,n.line).text;if(l){if(n.ch==l.length&&(n=new g(n.line,n.ch-1)),n.ch>0)n=new g(n.line,n.ch+1),e.replaceRange(l.charAt(n.ch-1)+l.charAt(n.ch-2),g(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var o=w(e.doc,n.line-1).text;o&&(n=new g(n.line,1),e.replaceRange(l.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),g(n.line-1,o.length-1),n,"+transpose"))}}i.push(new O(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return ce(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);At(e)})},openLine:function(e){return e.replaceSelection(`
|
|
12
12
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function To(e,t){var i=w(e.doc,t),r=we(i);return r!=i&&(t=H(r)),Cn(!0,e,r,t,1)}function zs(e,t){var i=w(e.doc,t),r=Sa(i);return r!=i&&(t=H(r)),Cn(!0,e,i,t,-1)}function Mo(e,t){var i=To(e,t.line),r=w(e.doc,i.line),n=He(r,e.doc.direction);if(!n||n[0].level==0){var l=Math.max(i.ch,r.text.search(/\S/)),o=t.line==i.line&&t.ch<=l&&t.ch;return g(i.line,o?0:l,i.sticky)}return i}function ui(e,t,i){if(typeof t=="string"&&(t=Cr[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),n=t(e)!=Or}finally{e.display.shift=r,e.state.suppressEdits=!1}return n}function Gs(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var n=It(t,e.state.keyMaps[r],i,e);if(n)return n}return e.options.extraKeys&&It(t,e.options.extraKeys,i,e)||It(t,e.options.keyMap,i,e)}var Us=new Ke;function wr(e,t,i,r){var n=e.state.keySeq;if(n){if(So(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Us.set(50,function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())}),Do(e,n+" "+t,i,r))return!0}return Do(e,t,i,r)}function Do(e,t,i,r){var n=Gs(e,t,r);return n=="multi"&&(e.state.keySeq=t),n=="handled"&&q(e,"keyHandled",e,t,i),(n=="handled"||n=="multi")&&(oe(i),rn(e)),!!n}function No(e,t){var i=ko(t,!0);return i?t.shiftKey&&!e.state.keySeq?wr(e,"Shift-"+i,t,function(r){return ui(e,r,!0)})||wr(e,i,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return ui(e,r)}):wr(e,i,t,function(r){return ui(e,r)}):!1}function Ks(e,t,i){return wr(e,"'"+i+"'",t,function(r){return ui(e,r,!0)})}var wn=null;function Ao(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=me(xt(t)),!Y(t,e))){A&&E<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=No(t,e);Ce&&(wn=r?i:null,!r&&i==88&&!aa&&(ye?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),We&&!ye&&!r&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&_s(t)}}function _s(e){var t=e.display.lineDiv;rt(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(et(t,"CodeMirror-crosshair"),ve(document,"keyup",i),ve(document,"mouseover",i))}T(document,"keyup",i),T(document,"mouseover",i)}function Oo(e){e.keyCode==16&&(this.doc.sel.shift=!1),Y(this,e)}function Wo(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(Ee(t.display,e)||Y(t,e)||e.ctrlKey&&!e.altKey||ye&&e.metaKey)){var i=e.keyCode,r=e.charCode;if(Ce&&i==wn){wn=null,oe(e);return}if(!(Ce&&(!e.which||e.which<10)&&No(t,e))){var n=String.fromCharCode(r??i);n!="\b"&&(Ks(t,e,n)||t.display.input.onKeyPress(e))}}}var Xs=400,Sn=function(e,t,i){this.time=e,this.pos=t,this.button=i};Sn.prototype.compare=function(e,t,i){return this.time+Xs>e&&M(t,this.pos)==0&&i==this.button};var Sr,Lr;function Ys(e,t){var i=+new Date;return Lr&&Lr.compare(i,e,t)?(Sr=Lr=null,"triple"):Sr&&Sr.compare(i,e,t)?(Lr=new Sn(i,e,t),Sr=null,"double"):(Sr=new Sn(i,e,t),Lr=null,"single")}function Ho(e){var t=this,i=t.display;if(!(Y(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,Ee(i,e)){ie||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!Ln(t,e)){var r=ft(t,e),n=Kn(e),l=r?Ys(r,n):"single";Ar(t).focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&qs(t,n,r,l,e))&&(n==1?r?Qs(t,r,l,e):ki(e)==i.scroller&&oe(e):n==2?(r&&ii(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(vi?t.display.input.onContextMenu(e):nn(t)))}}}function qs(e,t,i,r,n){var l="Click";return r=="double"?l="Double"+l:r=="triple"&&(l="Triple"+l),l=(t==1?"Left":t==2?"Middle":"Right")+l,wr(e,Lo(l,n),n,function(o){if(typeof o=="string"&&(o=Cr[o]),!o)return!1;var a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a=o(e,i)!=Or}finally{e.state.suppressEdits=!1}return a})}function Zs(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(n.unit==null){var l=Jo?i.shiftKey&&i.metaKey:i.altKey;n.unit=l?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=ye?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(ye?i.altKey:i.ctrlKey)),n}function Qs(e,t,i,r){A?setTimeout(yi(Hl,e),0):e.curOp.focus=me(xt(e));var n=Zs(e,i,r),l=e.doc.sel,o;e.options.dragDrop&&ia&&!e.isReadOnly()&&i=="single"&&(o=l.contains(t))>-1&&(M((o=l.ranges[o]).from(),t)<0||t.xRel>0)&&(M(o.to(),t)>0||t.xRel<0)?Js(e,r,t,n):js(e,r,t,n)}function Js(e,t,i,r){var n=e.display,l=!1,o=Z(e,function(u){ie&&(n.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:nn(e)),ve(n.wrapper.ownerDocument,"mouseup",o),ve(n.wrapper.ownerDocument,"mousemove",a),ve(n.scroller,"dragstart",s),ve(n.scroller,"drop",o),l||(oe(u),r.addNew||ii(e.doc,i,null,null,r.extend),ie&&!Dr||A&&E==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),a=function(u){l=l||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return l=!0};ie&&(n.scroller.draggable=!0),e.state.draggingText=o,o.copy=!r.moveOnDrag,T(n.wrapper.ownerDocument,"mouseup",o),T(n.wrapper.ownerDocument,"mousemove",a),T(n.scroller,"dragstart",s),T(n.scroller,"drop",o),e.state.delayingBlurEvent=!0,setTimeout(function(){return n.input.focus()},20),n.scroller.dragDrop&&n.scroller.dragDrop()}function Fo(e,t,i){if(i=="char")return new O(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new O(g(t.line,0),D(e.doc,g(t.line+1,0)));var r=i(e,t);return new O(r.from,r.to)}function js(e,t,i,r){A&&nn(e);var n=e.display,l=e.doc;oe(t);var o,a,s=l.sel,u=s.ranges;if(r.addNew&&!r.extend?(a=l.sel.contains(i),a>-1?o=u[a]:o=new O(i,i)):(o=l.sel.primary(),a=l.sel.primIndex),r.unit=="rectangle")r.addNew||(o=new O(i,i)),i=ft(e,t,!0,!0),a=-1;else{var f=Fo(e,i,r.unit);r.extend?o=yn(o,f.anchor,f.head,r.extend):o=f}r.addNew?a==-1?(a=u.length,ee(l,Le(e,u.concat([o]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&r.unit=="char"&&!r.extend?(ee(l,Le(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=l.sel):mn(l,a,o,mi):(a=0,ee(l,new ge([o],0),mi),s=l.sel);var h=i;function d(b){if(M(h,b)!=0)if(h=b,r.unit=="rectangle"){for(var C=[],L=e.options.tabSize,S=be(w(l,i.line).text,i.ch,L),N=be(w(l,b.line).text,b.ch,L),P=Math.min(S,N),J=Math.max(S,N),R=Math.min(i.line,b.line),de=Math.min(e.lastLine(),Math.max(i.line,b.line));R<=de;R++){var ue=w(l,R).text,K=bi(ue,P,L);P==J?C.push(new O(g(R,K),g(R,K))):ue.length>K&&C.push(new O(g(R,K),g(R,bi(ue,J,L))))}C.length||C.push(new O(i,i)),ee(l,Le(e,s.ranges.slice(0,a).concat(C),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(b)}else{var fe=o,V=Fo(e,b,r.unit),X=fe.anchor,_;M(V.anchor,X)>0?(_=V.head,X=Ir(fe.from(),V.anchor)):(_=V.anchor,X=Er(fe.to(),V.head));var B=s.ranges.slice(0);B[a]=Vs(e,new O(D(l,X),_)),ee(l,Le(e,B,a),mi)}}var c=n.wrapper.getBoundingClientRect(),p=0;function v(b){var C=++p,L=ft(e,b,!0,r.unit=="rectangle");if(L)if(M(L,h)!=0){e.curOp.focus=me(xt(e)),d(L);var S=jr(n,l);(L.line>=S.to||L.line<S.from)&&setTimeout(Z(e,function(){p==C&&v(b)}),150)}else{var N=b.clientY<c.top?-20:b.clientY>c.bottom?20:0;N&&setTimeout(Z(e,function(){p==C&&(n.scroller.scrollTop+=N,v(b))}),50)}}function y(b){e.state.selectingText=!1,p=1/0,b&&(oe(b),n.input.focus()),ve(n.wrapper.ownerDocument,"mousemove",m),ve(n.wrapper.ownerDocument,"mouseup",x),l.history.lastSelOrigin=null}var m=Z(e,function(b){b.buttons===0||!Kn(b)?y(b):v(b)}),x=Z(e,y);e.state.selectingText=x,T(n.wrapper.ownerDocument,"mousemove",m),T(n.wrapper.ownerDocument,"mouseup",x)}function Vs(e,t){var i=t.anchor,r=t.head,n=w(e.doc,i.line);if(M(i,r)==0&&i.sticky==r.sticky)return t;var l=He(n);if(!l)return t;var o=Jt(l,i.ch,i.sticky),a=l[o];if(a.from!=i.ch&&a.to!=i.ch)return t;var s=o+(a.from==i.ch==(a.level!=1)?0:1);if(s==0||s==l.length)return t;var u;if(r.line!=i.line)u=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var f=Jt(l,r.ch,r.sticky),h=f-o||(r.ch-i.ch)*(a.level==1?-1:1);f==s-1||f==s?u=h<0:u=h>0}var d=l[s+(u?-1:0)],c=u==(d.level==1),p=c?d.from:d.to,v=c?"after":"before";return i.ch==p&&i.sticky==v?t:new O(new g(i.line,p,v),r)}function Po(e,t,i,r){var n,l;if(t.touches)n=t.touches[0].clientX,l=t.touches[0].clientY;else try{n=t.clientX,l=t.clientY}catch{return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&oe(t);var o=e.display,a=o.lineDiv.getBoundingClientRect();if(l>a.bottom||!xe(e,i))return Li(t);l-=a.top-o.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=o.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=n){var f=at(e.doc,l),h=e.display.gutterSpecs[s];return G(e,i,e,f,h.className,t),Li(t)}}}function Ln(e,t){return Po(e,t,"gutterClick",!0)}function Eo(e,t){Ee(e.display,t)||$s(e,t)||Y(e,t,"contextmenu")||vi||e.display.input.onContextMenu(t)}function $s(e,t){return xe(e,"gutterContextMenu")?Po(e,t,"gutterContextMenu",!1):!1}function Io(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),nr(e)}var Bt={toString:function(){return"CodeMirror.Init"}},Ro={},fi={};function eu(e){var t=e.optionHandlers;function i(r,n,l,o){e.defaults[r]=n,l&&(t[r]=o?function(a,s,u){u!=Bt&&l(a,s,u)}:l)}e.defineOption=i,e.Init=Bt,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,pn(r)},!0),i("indentUnit",2,pn,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){cr(r),nr(r),ae(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!!n){var l=[],o=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var f=s.text.indexOf(n,u);if(f==-1)break;u=f+n.length,l.push(g(o,f))}o++});for(var a=l.length-1;a>=0;a--)Pt(r.doc,n,l[a],g(l[a].line,l[a].ch+n.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,n,l){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),l!=Bt&&r.refresh()}),i("specialCharPlaceholder",Na,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",_t?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!jo),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){Io(r),hr(r)},!0),i("keyMap","default",function(r,n,l){var o=si(n),a=l!=Bt&&si(l);a&&a.detach&&a.detach(r,o),o.attach&&o.attach(r,a||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,ru,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=cn(n,r.options.lineNumbers),hr(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?$i(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Ot(r)},!0),i("scrollbarStyle","native",function(r){Bl(r),Ot(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=cn(r.options.gutters,n),hr(r)},!0),i("firstLineNumber",1,hr,!0),i("lineNumberFormatter",function(r){return r},hr,!0),i("showCursorWhenSelecting",!1,lr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(Nt(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,tu),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,lr,!0),i("singleCursorHeightPerLine",!0,lr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,cr,!0),i("addModeClass",!1,cr,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,cr,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function tu(e,t,i){var r=i&&i!=Bt;if(!t!=!r){var n=e.display.dragFunctions,l=t?T:ve;l(e.display.scroller,"dragstart",n.start),l(e.display.scroller,"dragenter",n.enter),l(e.display.scroller,"dragover",n.over),l(e.display.scroller,"dragleave",n.leave),l(e.display.scroller,"drop",n.drop)}}function ru(e){e.options.lineWrapping?(rt(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(et(e.display.wrapper,"CodeMirror-wrap"),Ki(e)),en(e),ae(e),nr(e),setTimeout(function(){return Ot(e)},100)}function I(e,t){var i=this;if(!(this instanceof I))return new I(e,t);this.options=t=t?nt(t):{},nt(Ro,t,!1);var r=t.value;typeof r=="string"?r=new se(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new I.inputStyles[t.inputStyle](this),l=this.display=new vs(e,r,n,t);l.wrapper.CodeMirror=this,Io(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Bl(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 Ke,keySeq:null,specialChars:null},t.autofocus&&!_t&&l.input.focus(),A&&E<11&&setTimeout(function(){return i.display.input.reset(!0)},20),iu(this),Fs(),pt(this),this.curOp.forceUpdate=!0,Ql(this,r),t.autofocus&&!_t||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ln(i)},20):Nt(this);for(var o in fi)fi.hasOwnProperty(o)&&fi[o](this,t[o],Bt);Ul(this),t.finishInit&&t.finishInit(this);for(var a=0;a<kn.length;++a)kn[a](this);vt(this),ie&&t.lineWrapping&&getComputedStyle(l.lineDiv).textRendering=="optimizelegibility"&&(l.lineDiv.style.textRendering="auto")}I.defaults=Ro,I.optionHandlers=fi;function iu(e){var t=e.display;T(t.scroller,"mousedown",Z(e,Ho)),A&&E<11?T(t.scroller,"dblclick",Z(e,function(s){if(!Y(e,s)){var u=ft(e,s);if(!(!u||Ln(e,s)||Ee(e.display,s))){oe(s);var f=e.findWordAt(u);ii(e.doc,f.anchor,f.head)}}})):T(t.scroller,"dblclick",function(s){return Y(e,s)||oe(s)}),T(t.scroller,"contextmenu",function(s){return Eo(e,s)}),T(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||Eo(e,s)});var i,r={end:0};function n(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function l(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function o(s,u){if(u.left==null)return!0;var f=u.left-s.left,h=u.top-s.top;return f*f+h*h>20*20}T(t.scroller,"touchstart",function(s){if(!Y(e,s)&&!l(s)&&!Ln(e,s)){t.input.ensurePolled(),clearTimeout(i);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),T(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),T(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Ee(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var f=e.coordsChar(t.activeTouch,"page"),h;!u.prev||o(u,u.prev)?h=new O(f,f):!u.prev.prev||o(u,u.prev.prev)?h=e.findWordAt(f):h=new O(g(f.line,0),D(e.doc,g(f.line+1,0))),e.setSelection(h.anchor,h.head),e.focus(),oe(s)}n()}),T(t.scroller,"touchcancel",n),T(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ar(e,t.scroller.scrollTop),ct(e,t.scroller.scrollLeft,!0),G(e,"scroll",e))}),T(t.scroller,"mousewheel",function(s){return Xl(e,s)}),T(t.scroller,"DOMMouseScroll",function(s){return Xl(e,s)}),T(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Y(e,s)||jt(s)},over:function(s){Y(e,s)||(Hs(e,s),jt(s))},start:function(s){return Ws(e,s)},drop:Z(e,Os),leave:function(s){Y(e,s)||xo(e)}};var a=t.input.getField();T(a,"keyup",function(s){return Oo.call(e,s)}),T(a,"keydown",Z(e,Ao)),T(a,"keypress",Z(e,Wo)),T(a,"focus",function(s){return ln(e,s)}),T(a,"blur",function(s){return Nt(e,s)})}var kn=[];I.defineInitHook=function(e){return kn.push(e)};function kr(e,t,i,r){var n=e.doc,l;i==null&&(i="add"),i=="smart"&&(n.mode.indent?l=$t(e,t).state:i="prev");var o=e.options.tabSize,a=w(n,t),s=be(a.text,null,o);a.stateAfter&&(a.stateAfter=null);var u=a.text.match(/^\s*/)[0],f;if(!r&&!/\S/.test(a.text))f=0,i="not";else if(i=="smart"&&(f=n.mode.indent(l,a.text.slice(u.length),a.text),f==Or||f>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?f=be(w(n,t-1).text,null,o):f=0:i=="add"?f=s+e.options.indentUnit:i=="subtract"?f=s-e.options.indentUnit:typeof i=="number"&&(f=s+i),f=Math.max(0,f);var h="",d=0;if(e.options.indentWithTabs)for(var c=Math.floor(f/o);c;--c)d+=o,h+=" ";if(d<f&&(h+=xi(f-d)),h!=u)return Pt(n,h,g(t,0),g(t,u.length),"+input"),a.stateAfter=null,!0;for(var p=0;p<n.sel.ranges.length;p++){var v=n.sel.ranges[p];if(v.head.line==t&&v.head.ch<u.length){var y=g(t,u.length);mn(n,p,new O(y,y));break}}}var ke=null;function hi(e){ke=e}function Tn(e,t,i,r,n){var l=e.doc;e.display.shift=!1,r||(r=l.sel);var o=+new Date-200,a=n=="paste"||e.state.pasteIncoming>o,s=Di(t),u=null;if(a&&r.ranges.length>1)if(ke&&ke.text.join(`
|
|
13
13
|
`)==t){if(r.ranges.length%ke.text.length==0){u=[];for(var f=0;f<ke.text.length;f++)u.push(l.splitLines(ke.text[f]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=Hr(s,function(m){return[m]}));for(var h=e.curOp.updateInput,d=r.ranges.length-1;d>=0;d--){var c=r.ranges[d],p=c.from(),v=c.to();c.empty()&&(i&&i>0?p=g(p.line,p.ch-i):e.state.overwrite&&!a?v=g(v.line,Math.min(w(l,v.line).text.length,v.ch+W(s).length)):a&&ke&&ke.lineWise&&ke.text.join(`
|
|
@@ -21,5 +21,5 @@ b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.
|
|
|
21
21
|
`)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},z.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},z.prototype.onKeyPress=function(){A&&E>=9&&(this.hasSelection=null),this.fastPoll()},z.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var l=ft(i,e),o=r.scroller.scrollTop;if(!l||Ce)return;var a=i.options.resetSelectionOnContextMenu;a&&i.doc.sel.contains(l)==-1&&Z(i,ee)(i.doc,qe(l),Te);var s=n.style.cssText,u=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
22
22
|
top: `+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+`px;
|
|
23
23
|
z-index: 1000; background: `+(A?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
24
|
-
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var h;ie&&(h=n.ownerDocument.defaultView.scrollY),r.input.focus(),ie&&n.ownerDocument.defaultView.scrollTo(null,h),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=c,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function d(){if(n.selectionStart!=null){var v=i.somethingSelected(),y=""+(v?n.value:"");n.value="⇚",n.value=y,t.prevInput=v?"":"",n.selectionStart=1,n.selectionEnd=y.length,r.selForContextMenu=i.doc.sel}}function c(){if(t.contextMenuPending==c&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,n.style.cssText=s,A&&E<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=o),n.selectionStart!=null)){(!A||A&&E<9)&&d();var v=0,y=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput==""?Z(i,so)(i):v++<10?r.detectingSelectAll=setTimeout(y,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(y,200)}}if(A&&E>=9&&d(),vi){jt(e);var p=function(){ve(window,"mouseup",p),setTimeout(c,20)};T(window,"mouseup",p)}else setTimeout(c,50)},z.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},z.prototype.setUneditable=function(){},z.prototype.needsContentAttribute=!1;function su(e,t){if(t=t?nt(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=me(it(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=a.getValue()}var n;if(e.form&&(T(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var l=e.form;n=l.submit;try{var o=l.submit=function(){r(),l.submit=n,l.submit(),l.submit=o}}catch{}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(ve(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var a=I(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function uu(e){e.off=ve,e.on=T,e.wheelEventPixels=gs,e.Doc=se,e.splitLines=Di,e.countColumn=be,e.findColumn=bi,e.isWordChar=Ci,e.Pass=Or,e.signal=G,e.Line=Lt,e.changeEnd=Ze,e.scrollbarModel=Rl,e.Pos=g,e.cmpPos=M,e.modes=Ai,e.mimeModes=wt,e.resolveMode=Pr,e.getMode=Oi,e.modeExtensions=St,e.extendMode=ha,e.copyState=lt,e.startState=_n,e.innerMode=Wi,e.commands=Cr,e.keyMap=Re,e.keyName=ko,e.isModifierKey=So,e.lookupKey=It,e.normalizeKeyMap=Rs,e.StringStream=U,e.SharedTextMarker=mr,e.TextMarker=Je,e.LineWidget=yr,e.e_preventDefault=oe,e.e_stopPropagation=Un,e.e_stop=jt,e.addClass=rt,e.contains=Ue,e.rmClass=et,e.keyNames=je}eu(I),nu(I);var fu="iter insert remove copy getEditor constructor".split(" ");for(var di in se.prototype)se.prototype.hasOwnProperty(di)&&$(fu,di)<0&&(I.prototype[di]=function(e){return function(){return e.apply(this.doc,arguments)}}(se.prototype[di]));return Ct(se),I.inputStyles={textarea:z,contenteditable:F},I.defineMode=function(e){!I.defaults.mode&&e!="null"&&(I.defaults.mode=e),ua.apply(this,arguments)},I.defineMIME=fa,I.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),I.defineMIME("text/plain","null"),I.defineExtension=function(e,t){I.prototype[e]=t},I.defineDocExtension=function(e,t){se.prototype[e]=t},I.fromTextArea=su,uu(I),I.version="5.65.
|
|
25
|
-
//# sourceMappingURL=codemirror-
|
|
24
|
+
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var h;ie&&(h=n.ownerDocument.defaultView.scrollY),r.input.focus(),ie&&n.ownerDocument.defaultView.scrollTo(null,h),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=c,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function d(){if(n.selectionStart!=null){var v=i.somethingSelected(),y=""+(v?n.value:"");n.value="⇚",n.value=y,t.prevInput=v?"":"",n.selectionStart=1,n.selectionEnd=y.length,r.selForContextMenu=i.doc.sel}}function c(){if(t.contextMenuPending==c&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,n.style.cssText=s,A&&E<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=o),n.selectionStart!=null)){(!A||A&&E<9)&&d();var v=0,y=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput==""?Z(i,so)(i):v++<10?r.detectingSelectAll=setTimeout(y,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(y,200)}}if(A&&E>=9&&d(),vi){jt(e);var p=function(){ve(window,"mouseup",p),setTimeout(c,20)};T(window,"mouseup",p)}else setTimeout(c,50)},z.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},z.prototype.setUneditable=function(){},z.prototype.needsContentAttribute=!1;function su(e,t){if(t=t?nt(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=me(it(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=a.getValue()}var n;if(e.form&&(T(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var l=e.form;n=l.submit;try{var o=l.submit=function(){r(),l.submit=n,l.submit(),l.submit=o}}catch{}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(ve(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var a=I(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function uu(e){e.off=ve,e.on=T,e.wheelEventPixels=gs,e.Doc=se,e.splitLines=Di,e.countColumn=be,e.findColumn=bi,e.isWordChar=Ci,e.Pass=Or,e.signal=G,e.Line=Lt,e.changeEnd=Ze,e.scrollbarModel=Rl,e.Pos=g,e.cmpPos=M,e.modes=Ai,e.mimeModes=wt,e.resolveMode=Pr,e.getMode=Oi,e.modeExtensions=St,e.extendMode=ha,e.copyState=lt,e.startState=_n,e.innerMode=Wi,e.commands=Cr,e.keyMap=Re,e.keyName=ko,e.isModifierKey=So,e.lookupKey=It,e.normalizeKeyMap=Rs,e.StringStream=U,e.SharedTextMarker=mr,e.TextMarker=Je,e.LineWidget=yr,e.e_preventDefault=oe,e.e_stopPropagation=Un,e.e_stop=jt,e.addClass=rt,e.contains=Ue,e.rmClass=et,e.keyNames=je}eu(I),nu(I);var fu="iter insert remove copy getEditor constructor".split(" ");for(var di in se.prototype)se.prototype.hasOwnProperty(di)&&$(fu,di)<0&&(I.prototype[di]=function(e){return function(){return e.apply(this.doc,arguments)}}(se.prototype[di]));return Ct(se),I.inputStyles={textarea:z,contenteditable:F},I.defineMode=function(e){!I.defaults.mode&&e!="null"&&(I.defaults.mode=e),ua.apply(this,arguments)},I.defineMIME=fa,I.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),I.defineMIME("text/plain","null"),I.defineExtension=function(e,t){I.prototype[e]=t},I.defineDocExtension=function(e,t){se.prototype[e]=t},I.fromTextArea=su,uu(I),I.version="5.65.20",I})}(pi)),pi.exports}export{du as r};
|
|
25
|
+
//# sourceMappingURL=codemirror-BJo8frku.js.map
|