v-uikit
Version:
基于 UIKit 和 Vue2 开发的界面套件
2 lines • 1.15 MB
JavaScript
webpackJsonp([1,0],[,function(e,t,n){(function(t){!function(t,n){e.exports=n()}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function n(e,n){return t(e).appendChild(n)}function i(e,t,n,i){var r=document.createElement(e);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof t)r.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)r.appendChild(t[a]);return r}function r(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function a(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function o(t,n){var i=t.className;e(n).test(i)||(t.className+=(i?" ":"")+n)}function s(t,n){for(var i=t.split(" "),r=0;r<i.length;r++)i[r]&&!e(i[r]).test(n)&&(n+=" "+i[r]);return n}function l(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function c(e,t,n){t||(t={});for(var i in e)!e.hasOwnProperty(i)||n===!1&&t.hasOwnProperty(i)||(t[i]=e[i]);return t}function d(e,t,n,i,r){null==t&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=i||0,o=r||0;;){var s=e.indexOf("\t",a);if(s<0||s>=t)return o+(t-a);o+=s-a,o+=n-o%n,a=s+1}}function u(){this.id=null}function p(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function m(e,t,n){for(var i=0,r=0;;){var a=e.indexOf("\t",i);a==-1&&(a=e.length);var o=a-i;if(a==e.length||r+o>=t)return i+Math.min(o,t-r);if(r+=a-i,r+=n-r%n,i=a+1,r>=t)return i}}function f(e){for(;No.length<=e;)No.push(h(No)+" ");return No[e]}function h(e){return e[e.length-1]}function g(e,t){for(var n=[],i=0;i<e.length;i++)n[i]=t(e[i],i);return n}function b(e,t,n){for(var i=0,r=n(t);i<e.length&&n(e[i])<=r;)i++;e.splice(i,0,t)}function v(){}function _(e,t){var n;return Object.create?n=Object.create(e):(v.prototype=e,n=new v),t&&c(t,n),n}function y(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Ao.test(e))}function S(e,t){return t?!!(t.source.indexOf("\\w")>-1&&y(e))||t.test(e):y(e)}function C(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function x(e){return e.charCodeAt(0)>=768&&Do.test(e)}function E(e,t,n){var r=this;this.input=n,r.scrollbarFiller=i("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=i("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=i("div",null,"CodeMirror-code"),r.selectionDiv=i("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=i("div",null,"CodeMirror-cursors"),r.measure=i("div",null,"CodeMirror-measure"),r.lineMeasure=i("div",null,"CodeMirror-measure"),r.lineSpace=i("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none"),r.mover=i("div",[i("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=i("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=i("div",null,null,"position: absolute; height: "+Eo+"px; width: 1px;"),r.gutters=i("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=i("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=i("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),to&&no<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),io||Xa&&po||(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,n.init(r)}function w(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],a=r.chunkSize();if(t<a){n=r;break}t-=a}return n.lines[t]}function T(e,t,n){var i=[],r=t.line;return e.iter(t.line,n.line+1,function(e){var a=e.text;r==n.line&&(a=a.slice(0,n.ch)),r==t.line&&(a=a.slice(t.ch)),i.push(a),++r}),i}function M(e,t,n){var i=[];return e.iter(t,n,function(e){i.push(e.text)}),i}function k(e,t){var n=t-e.height;if(n)for(var i=e;i;i=i.parent)i.height+=n}function N(e){if(null==e.parent)return null;for(var t=e.parent,n=p(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var r=0;i.children[r]!=t;++r)n+=i.children[r].chunkSize();return n+t.first}function A(e,t){var n=e.first;e:do{for(var i=0;i<e.children.length;++i){var r=e.children[i],a=r.height;if(t<a){e=r;continue e}t-=a,n+=r.chunkSize()}return n}while(!e.lines);for(var o=0;o<e.lines.length;++o){var s=e.lines[o],l=s.height;if(t<l)break;t-=l}return n+o}function D(e,t){return t>=e.first&&t<e.first+e.size}function O(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function L(e,t){return this instanceof L?(this.line=e,void(this.ch=t)):new L(e,t)}function R(e,t){return e.line-t.line||e.ch-t.ch}function I(e){return L(e.line,e.ch)}function P(e,t){return R(e,t)<0?t:e}function B(e,t){return R(e,t)<0?e:t}function F(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function U(e,t){if(t.line<e.first)return L(e.first,0);var n=e.first+e.size-1;return t.line>n?L(n,w(e,n).text.length):G(t,w(e,t.line).text.length)}function G(e,t){var n=e.ch;return null==n||n>t?L(e.line,t):n<0?L(e.line,0):e}function z(e,t){for(var n=[],i=0;i<t.length;i++)n[i]=U(e,t[i]);return n}function $(){Oo=!0}function q(){Lo=!0}function H(e,t,n){this.marker=e,this.from=t,this.to=n}function W(e,t){if(e)for(var n=0;n<e.length;++n){var i=e[n];if(i.marker==t)return i}}function V(e,t){for(var n,i=0;i<e.length;++i)e[i]!=t&&(n||(n=[])).push(e[i]);return n}function j(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function K(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var a=e[r],o=a.marker,s=null==a.from||(o.inclusiveLeft?a.from<=t:a.from<t);if(s||a.from==t&&"bookmark"==o.type&&(!n||!a.marker.insertLeft)){var l=null==a.to||(o.inclusiveRight?a.to>=t:a.to>t);(i||(i=[])).push(new H(o,a.from,l?null:a.to))}}return i}function Y(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var a=e[r],o=a.marker,s=null==a.to||(o.inclusiveRight?a.to>=t:a.to>t);if(s||a.from==t&&"bookmark"==o.type&&(!n||a.marker.insertLeft)){var l=null==a.from||(o.inclusiveLeft?a.from<=t:a.from<t);(i||(i=[])).push(new H(o,l?null:a.from-t,null==a.to?null:a.to-t))}}return i}function Z(e,t){if(t.full)return null;var n=D(e,t.from.line)&&w(e,t.from.line).markedSpans,i=D(e,t.to.line)&&w(e,t.to.line).markedSpans;if(!n&&!i)return null;var r=t.from.ch,a=t.to.ch,o=0==R(t.from,t.to),s=K(n,r,o),l=Y(i,a,o),c=1==t.text.length,d=h(t.text).length+(c?r:0);if(s)for(var u=0;u<s.length;++u){var p=s[u];if(null==p.to){var m=W(l,p.marker);m?c&&(p.to=null==m.to?null:m.to+d):p.to=r}}if(l)for(var f=0;f<l.length;++f){var g=l[f];if(null!=g.to&&(g.to+=d),null==g.from){var b=W(s,g.marker);b||(g.from=d,c&&(s||(s=[])).push(g))}else g.from+=d,c&&(s||(s=[])).push(g)}s&&(s=Q(s)),l&&l!=s&&(l=Q(l));var v=[s];if(!c){var _,y=t.text.length-2;if(y>0&&s)for(var S=0;S<s.length;++S)null==s[S].to&&(_||(_=[])).push(new H(s[S].marker,null,null));for(var C=0;C<y;++C)v.push(_);v.push(l)}return v}function Q(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function X(e,t,n){var i=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||i&&p(i,n)!=-1||(i||(i=[])).push(n)}}),!i)return null;for(var r=[{from:t,to:n}],a=0;a<i.length;++a)for(var o=i[a],s=o.find(0),l=0;l<r.length;++l){var c=r[l];if(!(R(c.to,s.from)<0||R(c.from,s.to)>0)){var d=[l,1],u=R(c.from,s.from),m=R(c.to,s.to);(u<0||!o.inclusiveLeft&&!u)&&d.push({from:c.from,to:s.from}),(m>0||!o.inclusiveRight&&!m)&&d.push({from:s.to,to:c.to}),r.splice.apply(r,d),l+=d.length-1}}return r}function J(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function ee(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function te(e){return e.inclusiveLeft?-1:0}function ne(e){return e.inclusiveRight?1:0}function ie(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var i=e.find(),r=t.find(),a=R(i.from,r.from)||te(e)-te(t);if(a)return-a;var o=R(i.to,r.to)||ne(e)-ne(t);return o?o:t.id-e.id}function re(e,t){var n,i=Lo&&e.markedSpans;if(i)for(var r=void 0,a=0;a<i.length;++a)r=i[a],r.marker.collapsed&&null==(t?r.from:r.to)&&(!n||ie(n,r.marker)<0)&&(n=r.marker);return n}function ae(e){return re(e,!0)}function oe(e){return re(e,!1)}function se(e,t,n,i,r){var a=w(e,t),o=Lo&&a.markedSpans;if(o)for(var s=0;s<o.length;++s){var l=o[s];if(l.marker.collapsed){var c=l.marker.find(0),d=R(c.from,n)||te(l.marker)-te(r),u=R(c.to,i)||ne(l.marker)-ne(r);if(!(d>=0&&u<=0||d<=0&&u>=0)&&(d<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?R(c.to,n)>=0:R(c.to,n)>0)||d>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?R(c.from,i)<=0:R(c.from,i)<0)))return!0}}}function le(e){for(var t;t=ae(e);)e=t.find(-1,!0).line;return e}function ce(e){for(var t,n;t=oe(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function de(e,t){var n=w(e,t),i=le(n);return n==i?t:N(i)}function ue(e,t){if(t>e.lastLine())return t;var n,i=w(e,t);if(!pe(e,i))return t;for(;n=oe(i);)i=n.find(1,!0).line;return N(i)+1}function pe(e,t){var n=Lo&&t.markedSpans;if(n)for(var i=void 0,r=0;r<n.length;++r)if(i=n[r],i.marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&me(e,t,i))return!0}}function me(e,t,n){if(null==n.to){var i=n.marker.find(1,!0);return me(e,i.line,W(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var r=void 0,a=0;a<t.markedSpans.length;++a)if(r=t.markedSpans[a],r.marker.collapsed&&!r.marker.widgetNode&&r.from==n.to&&(null==r.to||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&me(e,t,r))return!0}function fe(e){e=le(e);for(var t=0,n=e.parent,i=0;i<n.lines.length;++i){var r=n.lines[i];if(r==e)break;t+=r.height}for(var a=n.parent;a;n=a,a=n.parent)for(var o=0;o<a.children.length;++o){var s=a.children[o];if(s==n)break;t+=s.height}return t}function he(e){if(0==e.height)return 0;for(var t,n=e.text.length,i=e;t=ae(i);){var r=t.find(0,!0);i=r.from.line,n+=r.from.ch-r.to.ch}for(i=e;t=oe(i);){var a=t.find(0,!0);n-=i.text.length-a.from.ch,i=a.to.line,n+=i.text.length-a.to.ch}return n}function ge(e){var t=e.display,n=e.doc;t.maxLine=w(n,n.first),t.maxLineLength=he(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=he(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function be(e,t,n,i){if(!e)return i(t,n,"ltr");for(var r=!1,a=0;a<e.length;++a){var o=e[a];(o.from<n&&o.to>t||t==n&&o.to==t)&&(i(Math.max(o.from,t),Math.min(o.to,n),1==o.level?"rtl":"ltr"),r=!0)}r||i(t,n,"ltr")}function ve(e){return e.level%2?e.to:e.from}function _e(e){return e.level%2?e.from:e.to}function ye(e){var t=Me(e);return t?ve(t[0]):0}function Se(e){var t=Me(e);return t?_e(h(t)):e.text.length}function Ce(e,t,n){var i=e[0].level;return t==i||n!=i&&t<n}function xe(e,t){var n;Ro=null;for(var i=0;i<e.length;++i){var r=e[i];if(r.from<t&&r.to>t)return i;if(r.from==t||r.to==t){if(null!=n)return Ce(e,r.level,e[n].level)?(r.from!=r.to&&(Ro=n),i):(r.from!=r.to&&(Ro=i),n);n=i}}return n}function Ee(e,t,n,i){if(!i)return t+n;do t+=n;while(t>0&&x(e.text.charAt(t)));return t}function we(e,t,n,i){var r=Me(e);if(!r)return Te(e,t,n,i);for(var a=xe(r,t),o=r[a],s=Ee(e,t,o.level%2?-n:n,i);;){if(s>o.from&&s<o.to)return s;if(s==o.from||s==o.to)return xe(r,s)==a?s:(o=r[a+=n],n>0==o.level%2?o.to:o.from);if(o=r[a+=n],!o)return null;s=n>0==o.level%2?Ee(e,o.to,-1,i):Ee(e,o.from,1,i)}}function Te(e,t,n,i){var r=t+n;if(i)for(;r>0&&x(e.text.charAt(r));)r+=n;return r<0||r>e.text.length?null:r}function Me(e){var t=e.order;return null==t&&(t=e.order=Io(e.text)),t}function ke(e,t){return e._handlers&&e._handlers[t]||Po}function Ne(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var i=e._handlers,r=i&&i[t];if(r){var a=p(r,n);a>-1&&(i[t]=r.slice(0,a).concat(r.slice(a+1)))}}}function Ae(e,t){var n=ke(e,t);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,i)}function De(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ae(e,n||t.type,e,t),Be(t)||t.codemirrorIgnore}function Oe(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)p(n,t[i])==-1&&n.push(t[i])}function Le(e,t){return ke(e,t).length>0}function Re(e){e.prototype.on=function(e,t){Bo(this,e,t)},e.prototype.off=function(e,t){Ne(this,e,t)}}function Ie(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Pe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Be(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Fe(e){Ie(e),Pe(e)}function Ue(e){return e.target||e.srcElement}function Ge(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),mo&&e.ctrlKey&&1==t&&(t=3),t}function ze(e){if(null==Co){var t=i("span","");n(e,i("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Co=t.offsetWidth<=1&&t.offsetHeight>2&&!(to&&no<8))}var r=Co?i("span",""):i("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function $e(e){if(null!=xo)return xo;var i=n(e,document.createTextNode("AخA")),r=bo(i,0,1).getBoundingClientRect(),a=bo(i,1,2).getBoundingClientRect();return t(e),!(!r||r.left==r.right)&&(xo=a.right-r.right<3)}function qe(e){if(null!=$o)return $o;var t=n(e,i("span","x")),r=t.getBoundingClientRect(),a=bo(t,0,1).getBoundingClientRect();return $o=Math.abs(r.left-a.left)>1}function He(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),qo[e]=t}function We(e,t){Ho[e]=t}function Ve(e){if("string"==typeof e&&Ho.hasOwnProperty(e))e=Ho[e];else if(e&&"string"==typeof e.name&&Ho.hasOwnProperty(e.name)){var t=Ho[e.name];"string"==typeof t&&(t={name:t}),e=_(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ve("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ve("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function je(e,t){t=Ve(t);var n=qo[t.name];if(!n)return je(e,"text/plain");var i=n(e,t);if(Wo.hasOwnProperty(t.name)){var r=Wo[t.name];for(var a in r)r.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=r[a])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)i[o]=t.modeProps[o];return i}function Ke(e,t){var n=Wo.hasOwnProperty(e)?Wo[e]:Wo[e]={};c(t,n)}function Ye(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function Ze(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),n&&n.mode!=e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Qe(e,t,n){return!e.startState||e.startState(t,n)}function Xe(e,t,n,i){var r=[e.state.modeGen],a={};ot(e,t.text,e.doc.mode,n,function(e,t){return r.push(e,t)},a,i);for(var o=function(n){var i=e.state.overlays[n],o=1,s=0;ot(e,t.text,i.mode,!0,function(e,t){for(var n=o;s<e;){var a=r[o];a>e&&r.splice(o,1,e,r[o+1],a),o+=2,s=Math.min(e,a)}if(t)if(i.opaque)r.splice(n,o-n,e,"overlay "+t),o=n+2;else for(;n<o;n+=2){var l=r[n+1];r[n+1]=(l?l+" ":"")+"overlay "+t}},a)},s=0;s<e.state.overlays.length;++s)o(s);return{styles:r,classes:a.bgClass||a.textClass?a:null}}function Je(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=et(e,N(t)),r=Xe(e,t,t.text.length>e.options.maxHighlightLength?Ye(e.doc.mode,i):i);t.stateAfter=i,t.styles=r.styles,r.classes?t.styleClasses=r.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function et(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return!0;var a=st(e,t,n),o=a>i.first&&w(i,a-1).stateAfter;return o=o?Ye(i.mode,o):Qe(i.mode),i.iter(a,t,function(n){tt(e,n.text,o);var s=a==t-1||a%5==0||a>=r.viewFrom&&a<r.viewTo;n.stateAfter=s?Ye(i.mode,o):null,++a}),n&&(i.frontier=a),o}function tt(e,t,n,i){var r=e.doc.mode,a=new Vo(t,e.options.tabSize);for(a.start=a.pos=i||0,""==t&&nt(r,n);!a.eol();)it(r,a,n),a.start=a.pos}function nt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ze(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function it(e,t,n,i){for(var r=0;r<10;r++){i&&(i[0]=Ze(e,n).mode);var a=e.token(t,n);if(t.pos>t.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}function rt(e,t,n,i){var r,a=function(e){return{start:u.start,end:u.pos,string:u.current(),type:r||null,state:e?Ye(o.mode,d):d}},o=e.doc,s=o.mode;t=U(o,t);var l,c=w(o,t.line),d=et(e,t.line,n),u=new Vo(c.text,e.options.tabSize);for(i&&(l=[]);(i||u.pos<t.ch)&&!u.eol();)u.start=u.pos,r=it(s,u,d),i&&l.push(a(!0));return i?l:a()}function at(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";null==t[i]?t[i]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[i])||(t[i]+=" "+n[2])}return e}function ot(e,t,n,i,r,a,o){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,d=null,u=new Vo(t,e.options.tabSize),p=e.options.addModeClass&&[null];for(""==t&&at(nt(n,i),a);!u.eol();){if(u.pos>e.options.maxHighlightLength?(s=!1,o&&tt(e,t,i,u.pos),u.pos=t.length,l=null):l=at(it(n,u,i,p),a),p){var m=p[0].name;m&&(l="m-"+(l?m+" "+l:m))}if(!s||d!=l){for(;c<u.start;)c=Math.min(u.start,c+5e3),r(c,d);d=l}u.start=u.pos}for(;c<u.pos;){var f=Math.min(u.pos,c+5e3);r(f,d),c=f}}function st(e,t,n){for(var i,r,a=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>o;--s){if(s<=a.first)return a.first;var l=w(a,s-1);if(l.stateAfter&&(!n||s<=a.frontier))return s;var c=d(l.text,null,e.options.tabSize);(null==r||i>c)&&(r=s-1,i=c)}return r}function lt(e,t,n){this.text=e,ee(this,t),this.height=n?n(this):1}function ct(e,t,n,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),J(e),ee(e,n);var r=i?i(e):1;r!=e.height&&k(e,r)}function dt(e){e.parent=null,J(e)}function ut(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Yo:Ko;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function pt(e,t){var n=i("span",null,null,io?"padding-right: .1px":null),r={pre:i("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(to||io)&&e.getOption("lineWrapping")};t.measure={};for(var a=0;a<=(t.rest?t.rest.length:0);a++){var o=a?t.rest[a-1]:t.line,l=void 0;r.pos=0,r.addToken=ft,$e(e.display.measure)&&(l=Me(o))&&(r.addToken=gt(r.addToken,l)),r.map=[];var c=t!=e.display.externalMeasured&&N(o);vt(o,r,Je(e,o,c)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=s(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=s(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(ze(e.display.measure))),0==a?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(io){var d=r.content.lastChild;(/\bcm-tab\b/.test(d.className)||d.querySelector&&d.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ae(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=s(r.pre.className,r.textClass||"")),r}function mt(e){var t=i("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ft(e,t,n,r,a,o,s){if(t){var l,c=e.splitSpaces?ht(t,e.trailingSpace):t,d=e.cm.state.specialChars,u=!1;if(d.test(t)){l=document.createDocumentFragment();for(var p=0;;){d.lastIndex=p;var m=d.exec(t),h=m?m.index-p:t.length-p;if(h){var g=document.createTextNode(c.slice(p,p+h));to&&no<9?l.appendChild(i("span",[g])):l.appendChild(g),e.map.push(e.pos,e.pos+h,g),e.col+=h,e.pos+=h}if(!m)break;p+=h+1;var b=void 0;if("\t"==m[0]){var v=e.cm.options.tabSize,_=v-e.col%v;b=l.appendChild(i("span",f(_),"cm-tab")),b.setAttribute("role","presentation"),b.setAttribute("cm-text","\t"),e.col+=_}else"\r"==m[0]||"\n"==m[0]?(b=l.appendChild(i("span","\r"==m[0]?"␍":"","cm-invalidchar")),b.setAttribute("cm-text",m[0]),e.col+=1):(b=e.cm.options.specialCharPlaceholder(m[0]),b.setAttribute("cm-text",m[0]),to&&no<9?l.appendChild(i("span",[b])):l.appendChild(b),e.col+=1);e.map.push(e.pos,e.pos+1,b),e.pos++}}else e.col+=t.length,l=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,l),to&&no<9&&(u=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||a||u||s){var y=n||"";r&&(y+=r),a&&(y+=a);var S=i("span",[l],y,s);return o&&(S.title=o),e.content.appendChild(S)}e.content.appendChild(l)}}function ht(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",r=0;r<e.length;r++){var a=e.charAt(r);" "!=a||!n||r!=e.length-1&&32!=e.charCodeAt(r+1)||(a=" "),i+=a,n=" "==a}return i}function gt(e,t){return function(n,i,r,a,o,s,l){r=r?r+" cm-force-border":"cm-force-border";for(var c=n.pos,d=c+i.length;;){for(var u=void 0,p=0;p<t.length&&(u=t[p],!(u.to>c&&u.from<=c));p++);if(u.to>=d)return e(n,i,r,a,o,s,l);e(n,i.slice(0,u.to-c),r,a,null,s,l),a=null,i=i.slice(u.to-c),c=u.to}}}function bt(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!i&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function vt(e,t,n){var i=e.markedSpans,r=e.text,a=0;if(i)for(var o,s,l,c,d,u,p,m=r.length,f=0,h=1,g="",b=0;;){if(b==f){l=c=d=u=s="",p=null,b=1/0;for(var v=[],_=void 0,y=0;y<i.length;++y){var S=i[y],C=S.marker;"bookmark"==C.type&&S.from==f&&C.widgetNode?v.push(C):S.from<=f&&(null==S.to||S.to>f||C.collapsed&&S.to==f&&S.from==f)?(null!=S.to&&S.to!=f&&b>S.to&&(b=S.to,c=""),C.className&&(l+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&S.from==f&&(d+=" "+C.startStyle),C.endStyle&&S.to==b&&(_||(_=[])).push(C.endStyle,S.to),C.title&&!u&&(u=C.title),C.collapsed&&(!p||ie(p.marker,C)<0)&&(p=S)):S.from>f&&b>S.from&&(b=S.from)}if(_)for(var x=0;x<_.length;x+=2)_[x+1]==b&&(c+=" "+_[x]);if(!p||p.from==f)for(var E=0;E<v.length;++E)bt(t,0,v[E]);if(p&&(p.from||0)==f){if(bt(t,(null==p.to?m+1:p.to)-f,p.marker,null==p.from),null==p.to)return;p.to==f&&(p=!1)}}if(f>=m)break;for(var w=Math.min(m,b);;){if(g){var T=f+g.length;if(!p){var M=T>w?g.slice(0,w-f):g;t.addToken(t,M,o?o+l:l,d,f+M.length==b?c:"",u,s)}if(T>=w){g=g.slice(w-f),f=w;break}f=T,d=""}g=r.slice(a,a=n[h++]),o=ut(n[h++],t.cm.options)}}else for(var k=1;k<n.length;k+=2)t.addToken(t,r.slice(a,a=n[k]),ut(n[k+1],t.cm.options))}function _t(e,t,n){this.line=t,this.rest=ce(t),this.size=this.rest?N(h(this.rest))-n+1:1,this.node=this.text=null,this.hidden=pe(e,t)}function yt(e,t,n){for(var i,r=[],a=t;a<n;a=i){var o=new _t(e.doc,w(e.doc,a),a);i=a+o.size,r.push(o)}return r}function St(e){Zo?Zo.ops.push(e):e.ownsGroup=Zo={ops:[e],delayedCallbacks:[]}}function Ct(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var i=0;i<e.ops.length;i++){var r=e.ops[i];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(n<t.length)}function xt(e,t){var n=e.ownsGroup;if(n)try{Ct(n)}finally{Zo=null,t(n)}}function Et(e,t){var n=ke(e,t);if(n.length){var i,r=Array.prototype.slice.call(arguments,2);Zo?i=Zo.delayedCallbacks:Qo?i=Qo:(i=Qo=[],setTimeout(wt,0));for(var a=function(e){i.push(function(){return n[e].apply(null,r)})},o=0;o<n.length;++o)a(o)}}function wt(){var e=Qo;Qo=null;for(var t=0;t<e.length;++t)e[t]()}function Tt(e,t,n,i){for(var r=0;r<t.changes.length;r++){var a=t.changes[r];"text"==a?At(e,t):"gutter"==a?Ot(e,t,n,i):"class"==a?Dt(t):"widget"==a&&Lt(e,t,i)}t.changes=null}function Mt(e){return e.node==e.text&&(e.node=i("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),to&&no<8&&(e.node.style.zIndex=2)),e.node}function kt(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=Mt(e);e.background=n.insertBefore(i("div",null,t),n.firstChild)}}function Nt(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):pt(e,t)}function At(e,t){var n=t.text.className,i=Nt(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,Dt(t)):n&&(t.text.className=n)}function Dt(e){kt(e),e.line.wrapClass?Mt(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function Ot(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var a=Mt(t);t.gutterBackground=i("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),a.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var s=Mt(t),l=t.gutter=i("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),s.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(i("div",O(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var c=0;c<e.options.gutters.length;++c){var d=e.options.gutters[c],u=o.hasOwnProperty(d)&&o[d];u&&l.appendChild(i("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[d]+"px; width: "+r.gutterWidth[d]+"px"))}}}function Lt(e,t,n){t.alignable&&(t.alignable=null);for(var i=t.node.firstChild,r=void 0;i;i=r)r=i.nextSibling,"CodeMirror-linewidget"==i.className&&t.node.removeChild(i);It(e,t,n)}function Rt(e,t,n,i){var r=Nt(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),Dt(t),Ot(e,t,n,i),It(e,t,i),t.node}function It(e,t,n){if(Pt(e,t.line,t,n,!0),t.rest)for(var i=0;i<t.rest.length;i++)Pt(e,t.rest[i],t,n,!1)}function Pt(e,t,n,r,a){if(t.widgets)for(var o=Mt(n),s=0,l=t.widgets;s<l.length;++s){var c=l[s],d=i("div",[c.node],"CodeMirror-linewidget");c.handleMouseEvents||d.setAttribute("cm-ignore-events","true"),Bt(c,d,n,r),e.display.input.setUneditable(d),a&&c.above?o.insertBefore(d,n.gutter||n.text):o.appendChild(d),Et(c,"redraw")}}function Bt(e,t,n,i){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var r=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(r-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function Ft(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!r(document.body,e.node)){var a="position: relative;";e.coverGutter&&(a+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(a+="width: "+t.display.wrapper.clientWidth+"px;"),n(t.display.measure,i("div",[e.node],null,a))}return e.height=e.node.parentNode.offsetHeight}function Ut(e,t){for(var n=Ue(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Gt(e){return e.lineSpace.offsetTop}function zt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function $t(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=n(e.measure,i("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,a={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(a.left)||isNaN(a.right)||(e.cachedPaddingH=a),a}function qt(e){return Eo-e.display.nativeBarWidth}function Ht(e){return e.display.scroller.clientWidth-qt(e)-e.display.barWidth}function Wt(e){return e.display.scroller.clientHeight-qt(e)-e.display.barHeight}function Vt(e,t,n){var i=e.options.lineWrapping,r=i&&Ht(e);if(!t.measure.heights||i&&t.measure.width!=r){var a=t.measure.heights=[];if(i){t.measure.width=r;for(var o=t.text.firstChild.getClientRects(),s=0;s<o.length-1;s++){var l=o[s],c=o[s+1];Math.abs(l.bottom-c.bottom)>2&&a.push((l.bottom+c.top)/2-n.top)}}a.push(n.bottom-n.top)}}function jt(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var r=0;r<e.rest.length;r++)if(N(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Kt(e,t){t=le(t);var i=N(t),r=e.display.externalMeasured=new _t(e.doc,t,i);r.lineN=i;var a=r.built=pt(e,r);return r.text=a.pre,n(e.display.lineMeasure,a.pre),r}function Yt(e,t,n,i){return Xt(e,Qt(e,t),n,i)}function Zt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[En(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Qt(e,t){var n=N(t),i=Zt(e,n);i&&!i.text?i=null:i&&i.changes&&(Tt(e,i,n,_n(e)),e.curOp.forceUpdate=!0),i||(i=Kt(e,t));var r=jt(i,t,n);return{line:t,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function Xt(e,t,n,i,r){t.before&&(n=-1);var a,o=n+(i||"");return t.cache.hasOwnProperty(o)?a=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Vt(e,t.view,t.rect),t.hasHeights=!0),a=tn(e,t,n,i),a.bogus||(t.cache[o]=a)),{left:a.left,right:a.right,top:r?a.rtop:a.top,bottom:r?a.rbottom:a.bottom}}function Jt(e,t,n){for(var i,r,a,o,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(r=0,a=1,o="left"):t<l?(r=t-s,a=r+1):(c==e.length-3||t==l&&e[c+3]>t)&&(a=l-s,r=a-1,t>=l&&(o="right")),null!=r){if(i=e[c+2],s==l&&n==(i.insertLeft?"left":"right")&&(o=n),"left"==n&&0==r)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)i=e[(c-=3)+2],o="left";if("right"==n&&r==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)i=e[(c+=3)+2],o="right";break}return{node:i,start:r,end:a,collapse:o,coverStart:s,coverEnd:l}}function en(e,t){var n=Xo;if("left"==t)for(var i=0;i<e.length&&(n=e[i]).left==n.right;i++);else for(var r=e.length-1;r>=0&&(n=e[r]).left==n.right;r--);return n}function tn(e,t,n,i){var r,a=Jt(t.map,n,i),o=a.node,s=a.start,l=a.end,c=a.collapse;if(3==o.nodeType){for(var d=0;d<4;d++){for(;s&&x(t.line.text.charAt(a.coverStart+s));)--s;for(;a.coverStart+l<a.coverEnd&&x(t.line.text.charAt(a.coverStart+l));)++l;if(r=to&&no<9&&0==s&&l==a.coverEnd-a.coverStart?o.parentNode.getBoundingClientRect():en(bo(o,s,l).getClientRects(),i),r.left||r.right||0==s)break;l=s,s-=1,c="right";
}to&&no<11&&(r=nn(e.display.measure,r))}else{s>0&&(c=i="right");var u;r=e.options.lineWrapping&&(u=o.getClientRects()).length>1?u["right"==i?u.length-1:0]:o.getBoundingClientRect()}if(to&&no<9&&!s&&(!r||!r.left&&!r.right)){var p=o.parentNode.getClientRects()[0];r=p?{left:p.left,right:p.left+vn(e.display),top:p.top,bottom:p.bottom}:Xo}for(var m=r.top-t.rect.top,f=r.bottom-t.rect.top,h=(m+f)/2,g=t.view.measure.heights,b=0;b<g.length-1&&!(h<g[b]);b++);var v=b?g[b-1]:0,_=g[b],y={left:("right"==c?r.right:r.left)-t.rect.left,right:("left"==c?r.left:r.right)-t.rect.left,top:v,bottom:_};return r.left||r.right||(y.bogus=!0),e.options.singleCursorHeightPerLine||(y.rtop=m,y.rbottom=f),y}function nn(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!qe(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}function rn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function an(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)rn(e.display.view[n])}function on(e){an(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function sn(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ln(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function cn(e,t,n,i,r){if(!r&&t.widgets)for(var a=0;a<t.widgets.length;++a)if(t.widgets[a].above){var o=Ft(t.widgets[a]);n.top+=o,n.bottom+=o}if("line"==i)return n;i||(i="local");var s=fe(t);if("local"==i?s+=Gt(e.display):s-=e.display.viewOffset,"page"==i||"window"==i){var l=e.display.lineSpace.getBoundingClientRect();s+=l.top+("window"==i?0:ln());var c=l.left+("window"==i?0:sn());n.left+=c,n.right+=c}return n.top+=s,n.bottom+=s,n}function dn(e,t,n){if("div"==n)return t;var i=t.left,r=t.top;if("page"==n)i-=sn(),r-=ln();else if("local"==n||!n){var a=e.display.sizer.getBoundingClientRect();i+=a.left,r+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:i-o.left,top:r-o.top}}function un(e,t,n,i,r){return i||(i=w(e.doc,t.line)),cn(e,i,Yt(e,i,t.ch,r),n)}function pn(e,t,n,i,r,a){function o(t,o){var s=Xt(e,r,t,o?"right":"left",a);return o?s.left=s.right:s.right=s.left,cn(e,i,s,n)}function s(e,t){var n=l[t],i=n.level%2;return e==ve(n)&&t&&n.level<l[t-1].level?(n=l[--t],e=_e(n)-(n.level%2?0:1),i=!0):e==_e(n)&&t<l.length-1&&n.level<l[t+1].level&&(n=l[++t],e=ve(n)-n.level%2,i=!1),i&&e==n.to&&e>n.from?o(e-1):o(e,i)}i=i||w(e.doc,t.line),r||(r=Qt(e,i));var l=Me(i),c=t.ch;if(!l)return o(c);var d=xe(l,c),u=s(c,d);return null!=Ro&&(u.other=s(c,Ro)),u}function mn(e,t){var n=0;t=U(e.doc,t),e.options.lineWrapping||(n=vn(e.display)*t.ch);var i=w(e.doc,t.line),r=fe(i)+Gt(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function fn(e,t,n,i){var r=L(e,t);return r.xRel=i,n&&(r.outside=!0),r}function hn(e,t,n){var i=e.doc;if(n+=e.display.viewOffset,n<0)return fn(i.first,0,!0,-1);var r=A(i,n),a=i.first+i.size-1;if(r>a)return fn(i.first+i.size-1,w(i,a).text.length,!0,1);t<0&&(t=0);for(var o=w(i,r);;){var s=gn(e,o,r,t,n),l=oe(o),c=l&&l.find(0,!0);if(!l||!(s.ch>c.from.ch||s.ch==c.from.ch&&s.xRel>0))return s;r=N(o=c.to.line)}}function gn(e,t,n,i,r){function a(i){var r=pn(e,L(n,i),"line",t,c);return s=!0,o>r.bottom?r.left-l:o<r.top?r.left+l:(s=!1,r.left)}var o=r-fe(t),s=!1,l=2*e.display.wrapper.clientWidth,c=Qt(e,t),d=Me(t),u=t.text.length,p=ye(t),m=Se(t),f=a(p),h=s,g=a(m),b=s;if(i>g)return fn(n,m,b,1);for(;;){if(d?m==p||m==we(t,p,1):m-p<=1){var v=i<f||i-f<=g-i?p:m,_=v==p?h:b,y=i-(v==p?f:g);if(b&&!d&&!/\s/.test(t.text.charAt(v))&&y>0&&v<t.text.length&&c.view.measure.heights.length>1){var S=Xt(e,c,v,"right");o<=S.bottom&&o>=S.top&&Math.abs(i-S.right)<y&&(_=!1,v++,y=i-S.right)}for(;x(t.text.charAt(v));)++v;var C=fn(n,v,_,y<-1?-1:y>1?1:0);return C}var E=Math.ceil(u/2),w=p+E;if(d){w=p;for(var T=0;T<E;++T)w=we(t,w,1)}var M=a(w);M>i?(m=w,g=M,(b=s)&&(g+=1e3),u=E):(p=w,f=M,h=s,u-=E)}}function bn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==jo){jo=i("pre");for(var r=0;r<49;++r)jo.appendChild(document.createTextNode("x")),jo.appendChild(i("br"));jo.appendChild(document.createTextNode("x"))}n(e.measure,jo);var a=jo.offsetHeight/50;return a>3&&(e.cachedTextHeight=a),t(e.measure),a||1}function vn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=i("span","xxxxxxxxxx"),r=i("pre",[t]);n(e.measure,r);var a=t.getBoundingClientRect(),o=(a.right-a.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function _n(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o)n[e.options.gutters[o]]=a.offsetLeft+a.clientLeft+r,i[e.options.gutters[o]]=a.clientWidth;return{fixedPos:yn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function yn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Sn(e){var t=bn(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/vn(e.display)-3);return function(r){if(pe(e.doc,r))return 0;var a=0;if(r.widgets)for(var o=0;o<r.widgets.length;o++)r.widgets[o].height&&(a+=r.widgets[o].height);return n?a+(Math.ceil(r.text.length/i)||1)*t:a+t}}function Cn(e){var t=e.doc,n=Sn(e);t.iter(function(e){var t=n(e);t!=e.height&&k(e,t)})}function xn(e,t,n,i){var r=e.display;if(!n&&"true"==Ue(t).getAttribute("cm-not-content"))return null;var a,o,s=r.lineSpace.getBoundingClientRect();try{a=t.clientX-s.left,o=t.clientY-s.top}catch(e){return null}var l,c=hn(e,a,o);if(i&&1==c.xRel&&(l=w(e.doc,c.line).text).length==c.ch){var u=d(l,l.length,e.options.tabSize)-l.length;c=L(c.line,Math.max(0,Math.round((a-$t(e.display).left)/vn(e.display))-u))}return c}function En(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,i=0;i<n.length;i++)if(t-=n[i].size,t<0)return i}function wn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Tn(e,t){for(var n=e.doc,i={},r=i.cursors=document.createDocumentFragment(),a=i.selection=document.createDocumentFragment(),o=0;o<n.sel.ranges.length;o++)if(t!==!1||o!=n.sel.primIndex){var s=n.sel.ranges[o];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&Mn(e,s.head,r),l||kn(e,s,a)}}return i}function Mn(e,t,n){var r=pn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),a=n.appendChild(i("div"," ","CodeMirror-cursor"));if(a.style.left=r.left+"px",a.style.top=r.top+"px",a.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(i("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function kn(e,t,n){function r(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),l.appendChild(i("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?u-e:n)+"px;\n height: "+(r-t)+"px"))}function a(t,n,i){function a(n,i){return un(e,L(t,n),"div",c,i)}var o,l,c=w(s,t),p=c.text.length;return be(Me(c),n||0,null==i?p:i,function(e,t,s){var c,m,f,h=a(e,"left");if(e==t)c=h,m=f=h.left;else{if(c=a(t-1,"right"),"rtl"==s){var g=h;h=c,c=g}m=h.left,f=c.right}null==n&&0==e&&(m=d),c.top-h.top>3&&(r(m,h.top,null,h.bottom),m=d,h.bottom<c.top&&r(m,h.bottom,null,c.top)),null==i&&t==p&&(f=u),(!o||h.top<o.top||h.top==o.top&&h.left<o.left)&&(o=h),(!l||c.bottom>l.bottom||c.bottom==l.bottom&&c.right>l.right)&&(l=c),m<d+1&&(m=d),r(m,c.top,f-m,c.bottom)}),{start:o,end:l}}var o=e.display,s=e.doc,l=document.createDocumentFragment(),c=$t(e.display),d=c.left,u=Math.max(o.sizerWidth,Ht(e)-o.sizer.offsetLeft)-c.right,p=t.from(),m=t.to();if(p.line==m.line)a(p.line,p.ch,m.ch);else{var f=w(s,p.line),h=w(s,m.line),g=le(f)==le(h),b=a(p.line,p.ch,g?f.text.length+1:null).end,v=a(m.line,g?0:null,m.ch).start;g&&(b.top<v.top-2?(r(b.right,b.top,null,b.bottom),r(d,v.top,v.left,v.bottom)):r(b.right,b.top,v.left-b.right,b.bottom)),b.bottom<v.top&&r(d,b.bottom,null,v.top)}n.appendChild(l)}function Nn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function An(e){e.state.focused||(e.display.input.focus(),On(e))}function Dn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ln(e))},100)}function On(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ae(e,"focus",e,t),e.state.focused=!0,o(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),io&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Nn(e))}function Ln(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ae(e,"blur",e,t),e.state.focused=!1,yo(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Rn(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=yn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,a=i+"px",o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=a),n[o].gutterBackground&&(n[o].gutterBackground.style.left=a));var s=n[o].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=i+r+"px")}}function In(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=O(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var a=r.measure.appendChild(i("div",[i("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=a.firstChild.offsetWidth,s=a.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-s)+1,r.lineNumWidth=r.lineNumInnerWidth+s,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Ti(e),!0}return!1}function Pn(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var r=t.view[i],a=void 0;if(!r.hidden){if(to&&no<8){var o=r.node.offsetTop+r.node.offsetHeight;a=o-n,n=o}else{var s=r.node.getBoundingClientRect();a=s.bottom-s.top}var l=r.line.height-a;if(a<2&&(a=bn(t)),(l>.001||l<-.001)&&(k(r.line,a),Bn(r.line),r.rest))for(var c=0;c<r.rest.length;c++)Bn(r.rest[c])}}}function Bn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function Fn(e,t,n){var i=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;i=Math.floor(i-Gt(e));var r=n&&null!=n.bottom?n.bottom:i+e.wrapper.clientHeight,a=A(t,i),o=A(t,r);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<a?(a=s,o=A(t,fe(w(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=o&&(a=A(t,fe(w(t,l))-e.wrapper.clientHeight),o=l)}return{from:a,to:Math.max(o,a+1)}}function Un(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,Xa||Ei(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),Xa&&Ei(e),_i(e,100))}function Gn(e,t,n){(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,Rn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function zn(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function $n(e){var t=zn(e);return t.x*=es,t.y*=es,t}function qn(e,t){var n=zn(t),i=n.x,r=n.y,a=e.display,o=a.scroller,s=o.scrollWidth>o.clientWidth,l=o.scrollHeight>o.clientHeight;if(i&&s||r&&l){if(r&&mo&&io)e:for(var c=t.target,d=a.view;c!=o;c=c.parentNode)for(var u=0;u<d.length;u++)if(d[u].node==c){e.display.currentWheelTarget=c;break e}if(i&&!Xa&&!oo&&null!=es)return r&&l&&Un(e,Math.max(0,Math.min(o.scrollTop+r*es,o.scrollHeight-o.clientHeight))),Gn(e,Math.max(0,Math.min(o.scrollLeft+i*es,o.scrollWidth-o.clientWidth))),(!r||r&&l)&&Ie(t),void(a.wheelStartX=null);if(r&&null!=es){var p=r*es,m=e.doc.scrollTop,f=m+a.wrapper.clientHeight;p<0?m=Math.max(0,m+p-50):f=Math.min(e.doc.height,f+p+50),Ei(e,{top:m,bottom:f})}Jo<20&&(null==a.wheelStartX?(a.wheelStartX=o.scrollLeft,a.wheelStartY=o.scrollTop,a.wheelDX=i,a.wheelDY=r,setTimeout(function(){if(null!=a.wheelStartX){var e=o.scrollLeft-a.wheelStartX,t=o.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(es=(es*Jo+n)/(Jo+1),++Jo)}},200)):(a.wheelDX+=i,a.wheelDY+=r))}}function Hn(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+zt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+qt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function Wn(e,t){t||(t=Hn(e));var n=e.display.barWidth,i=e.display.barHeight;Vn(e,t);for(var r=0;r<4&&n!=e.display.barWidth||i!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&Pn(e),Vn(e,Hn(e)),n=e.display.barWidth,i=e.display.barHeight}function Vn(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function jn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&yo(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new is[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Bo(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?Gn(e,t):Un(e,t)},e),e.display.scrollbars.addClass&&o(e.display.wrapper,e.display.scrollbars.addClass)}function Kn(e,t){if(!De(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),a=null;if(t.top+r.top<0?a=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),null!=a&&!co){var o=i("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Gt(e.display))+"px;\n height: "+(t.bottom-t.top+qt(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(a),e.display.lineSpace.removeChild(o)}}}function Yn(e,t,n,i){null==i&&(i=0);for(var r,a=0;a<5;a++){var o=!1;r=pn(e,t);var s=n&&n!=t?pn(e,n):r,l=Qn(e,Math.min(r.left,s.left),Math.min(r.top,s.top)-i,Math.max(r.left,s.left),Math.max(r.bottom,s.bottom)+i),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=l.scrollTop&&(Un(e,l.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(o=!0)),null!=l.scrollLeft&&(Gn(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(o=!0)),!o)break}return r}function Zn(e,t,n,i,r){var a=Qn(e,t,n,i,r);null!=a.scrollTop&&Un(e,a.scrollTop),null!=a.scrollLeft&&Gn(e,a.scrollLeft)}function Qn(e,t,n,i,r){var a=e.display,o=bn(e.display);n<0&&(n=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:a.scroller.scrollTop,l=Wt(e),c={};r-n>l&&(r=n+l);var d=e.doc.height+zt(a),u=n<o,p=r>d-o;if(n<s)c.scrollTop=u?0:n;else if(r>s+l){var m=Math.min(n,(p?d:r)-l);m!=s&&(c.scrollTop=m)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:a.scroller.scrollLeft,h=Ht(e)-(e.options.fixedGutter?a.gutters.offsetWidth:0),g=i-t>h;return g&&(i=t+h),t<10?c.scrollLeft=0:t<f?c.scrollLeft=Math.max(0,t-(g?0:10)):i>h+f-3&&(c.scrollLeft=i+(g?0:10)-h),c}function Xn(e,t,n){null==t&&null==n||ei(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Jn(e){ei(e);var t=e.getCursor(),n=t,i=t;e.options.lineWrapping||(n=t.ch?L(t.line,t.ch-1):t,i=L(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:i,margin:e.options.cursorScrollMargin,isCursor:!0}}function ei(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=mn(e,t.from),i=mn(e,t.to),r=Qn(e,Math.min(n.left,i.left),Math.min(n.top,i.top)-t.margin,Math.max(n.right,i.right),Math.max(n.bottom,i.bottom)+t.margin);e.scrollTo(r.scrollLeft,r.scrollTop)}}function ti(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++rs},St(e.curOp)}function ni(e){var t=e.curOp;xt(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;ii(e)})}function ii(e){f