/** layuiAdmin.pro-v1.2.1 LPPL License By http://www.layui.com/admin/ */ ;var CodeMirror=function(){function t(o,u){function v(t){return t>=0&&t<$e.size}function k(t){return h($e,t)}function L(t,e){sn=!0;for(var n=e-t.height,r=t;r;r=r.parent)r.height+=n}function A(t){var e={line:0,ch:0};lt(e,{line:$e.size-1,ch:k($e.size-1).text.length},X(t),e,e),en=!0}function P(t){var e=[];return $e.iter(0,$e.size,function(t){e.push(t.text)}),e.join("\n")}function U(t){function e(t){var n=me(t,!0);if(n&&!E(n,l)){_e||it(),l=n,Wt(r,n),en=!1;var i=bt();(n.line>=i.to||n.linei-400&&E(Qe.pos,r))return y(t),setTimeout(kt,20),Kt(r.line);if(Je&&Je.time>i-400&&E(Je.pos,r))return Qe={time:i,pos:r},y(t),Vt(r);Je={time:i,pos:r};var o,l=r;if(F&&!E(hn.from,hn.to)&&!W(r,hn.from)&&!W(hn.to,r)){Y&&(Ue.draggable=!0);var a=b(Ee,"mouseup",Le(function(e){Y&&(Ue.draggable=!1),tn=!1,a(),Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)<10&&(y(e),Ht(r.line,r.ch,!0),kt())}),!0);return void(tn=!0)}y(t),Ht(r.line,r.ch,!0);var s=b(Ee,"mousemove",Le(function(t){clearTimeout(o),y(t),e(t)}),!0),a=b(Ee,"mouseup",Le(function(t){clearTimeout(o);var e=me(t);e&&Wt(r,e),y(t),kt(),en=!0,s(),a()}),!0)}function _(t){for(var e=w(t);e!=We;e=e.parentNode)if(e.parentNode==Pe)return y(t);var n=me(t);n&&(Qe={time:+new Date,pos:n},y(t),Vt(n))}function J(t){function e(t,e){var r=new FileReader;r.onload=function(){o[e]=r.result,++l==i&&(n=Ot(n),Le(function(){var t=ct(o.join(""),n,n);Wt(n,t)})())},r.readAsText(t)}t.preventDefault();var n=me(t,!0),r=t.dataTransfer.files;if(n&&!Ae.readOnly)if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),l=0,a=0;a-1&&setTimeout(Le(function(){jt(hn.to.line,"smart")}),75)}vt()}}function rt(t){Ae.onKeyEvent&&Ae.onKeyEvent(wn,x(t))||16==t.keyCode&&(Ze=null)}function it(){Ae.readOnly||(_e||(Ae.onFocus&&Ae.onFocus(wn),_e=!0,We.className.search(/\bCodeMirror-focused\b/)==-1&&(We.className+=" CodeMirror-focused"),an||yt(!0)),gt(),ve())}function ot(){_e&&(Ae.onBlur&&Ae.onBlur(wn),_e=!1,We.className=We.className.replace(" CodeMirror-focused","")),clearInterval(je),setTimeout(function(){_e||(Ze=null)},150)}function lt(t,e,n,r,i){if(kn){var o=[];for($e.iter(t.line,e.line+1,function(t){o.push(t.text)}),kn.addChange(t.line,n.length,o);kn.done.length>Ae.undoDepth;)kn.done.shift()}ft(t,e,n,r,i)}function at(t,e){var n=t.pop();if(n){var r=[],i=n.start+n.added;$e.iter(n.start,i,function(t){r.push(t.text)}),e.push({start:n.start,added:n.old.length,old:r});var o=Ot({line:n.start+n.old.length-1,ch:H(r[r.length-1],n.old[n.old.length-1])});ft({line:n.start,ch:0},{line:i-1,ch:k(i-1).text.length},n.old,o,o),en=!0}}function st(){at(kn.done,kn.undone)}function ut(){at(kn.undone,kn.done)}function ft(t,e,n,r,i){function o(t){return t<=Math.min(e.line,e.line+x)?t:t+x}var l=!1,a=xn.length;Ae.lineWrapping||$e.iter(t.line,e.line,function(t){if(t.text.length==a)return l=!0,!0}),(t.line!=e.line||n.length>1)&&(sn=!0);var u=e.line-t.line,f=k(t.line),c=k(e.line);if(0==t.ch&&0==e.ch&&""==n[n.length-1]){var h=[],d=null;t.line?(d=k(t.line-1),d.fixMarkEnds(c)):c.fixMarkStarts();for(var p=0,m=n.length-1;p1&&$e.remove(t.line+1,u-1,un),$e.insert(t.line+1,h)}if(Ae.lineWrapping){var g=He.clientWidth/he()-3;$e.iter(t.line,t.line+n.length,function(t){if(!t.hidden){var e=Math.ceil(t.text.length/g)||1;e!=t.height&&L(t,e)}})}else $e.iter(t.line,p+n.length,function(t){var e=t.text;e.length>a&&(xn=e,a=e.length,cn=null,l=!1)}),l&&(a=0,xn="",cn=null,$e.iter(0,$e.size,function(t){var e=t.text;e.length>a&&(a=e.length,xn=e)}));for(var v=[],x=n.length-u-1,p=0,y=Ye.length;pe.line&&v.push(C+x)}var w=t.line+Math.min(n.length,500);Ce(t.line,w),v.push(w),Ye=v,Me(100),rn.push({from:t.line,to:e.line+1,diff:x});var M={from:t,to:e,text:n};if(on){for(var b=on;b.next;b=b.next);b.next=M}else on=M;Nt(r,i,o(hn.from.line),o(hn.to.line)),Ie.style.height=$e.height*ce()+2*de()+"px"}function ct(t,e,n){function r(r){if(W(r,e))return r;if(!W(n,r))return i;var o=r.line+t.length-(n.line-e.line)-1,l=r.ch;return r.line==n.line&&(l+=t[t.length-1].length-(n.ch-(n.line==e.line?e.ch:0))),{line:o,ch:l}}e=Ot(e),n=n?Ot(n):e,t=X(t);var i;return dt(t,e,n,function(t){return i=t,{from:r(hn.from),to:r(hn.to)}}),i}function ht(t,e){dt(X(t),hn.from,hn.to,function(t){return"end"==e?{from:t,to:t}:"start"==e?{from:hn.from,to:hn.from}:{from:hn.from,to:t}})}function dt(t,e,n,r){var i=1==t.length?t[0].length+e.ch:t[t.length-1].length,o=r({line:e.line+t.length-1,ch:i});lt(e,n,t,o.from,o.to)}function pt(t,e){var n=t.line,r=e.line;if(n==r)return k(n).text.slice(t.ch,e.ch);var i=[k(n).text.slice(t.ch)];return $e.iter(n+1,r,function(t){i.push(t.text)}),i.push(k(r).text.slice(0,e.ch)),i.join("\n")}function mt(){return pt(hn.from,hn.to)}function gt(){bn||qe.set(Ae.pollInterval,function(){be(),xt(),_e&>(),Se()})}function vt(){function t(){be();var n=xt();n||e?(bn=!1,gt()):(e=!0,qe.set(60,t)),Se()}var e=!1;bn=!0,qe.set(20,t)}function xt(){if(an||!_e||$(De))return!1;var t=De.value;if(t==Sn)return!1;Ze=null;for(var e=0,n=Math.min(Sn.length,t.length);ee)&&Ve.scrollIntoView()}}}function wt(){var t=se(hn.inverted?hn.from:hn.to),e=Ae.lineWrapping?Math.min(t.x,Ue.offsetWidth):t.x;return Mt(e,t.y,e,t.yBot)}function Mt(t,e,n,r){var i=pe(),o=de(),l=ce();e+=o,r+=o,t+=i,n+=i;var a=He.clientHeight,s=He.scrollTop,u=!1,f=!0;es+a&&(He.scrollTop=r+l-a,u=!0);var c=He.clientWidth,h=He.scrollLeft,d=Ae.fixedGutter?Re.clientWidth:0;return tc+h-3&&(He.scrollLeft=n+10-c,u=!0,n>Ie.clientWidth&&(f=!1)),u&&Ae.onScroll&&Ae.onScroll(wn),f}function bt(){var t=ce(),e=He.scrollTop-de(),n=Math.max(0,Math.floor(e/t)),r=Math.ceil((e+He.clientHeight)/t);return{from:p($e,n),to:p($e,r)}}function St(t,e){if(!He.clientWidth)return void(mn=gn=pn=0);var n=bt();if(!(t!==!0&&0==t.length&&n.from>=mn&&n.to<=gn)){var r=Math.max(n.from-100,0),i=Math.min($e.size,n.to+100);mni&&gn-i<20&&(i=Math.min($e.size,gn));for(var o=t===!0?[]:Lt([{from:mn,to:gn,domStart:0}],t),l=0,a=0;ai&&(s.to=i),s.from>=s.to?o.splice(a--,1):l+=s.to-s.from}if(l!=i-r){o.sort(function(t,e){return t.domStart-e.domStart});var u=ce(),f=Re.style.display;Ke.style.display=Re.style.display="none",At(r,i,o),Ke.style.display="";var c=r!=mn||i!=gn||vn!=He.clientHeight+u;if(c&&(vn=He.clientHeight+u),mn=r,gn=i,pn=m($e,r),Oe.style.top=pn*u+"px",Ie.style.height=$e.height*u+2*de()+"px",Ke.childNodes.length!=gn-mn)throw new Error("BAD PATCH! "+JSON.stringify(o)+" size="+(gn-mn)+" nodes="+Ke.childNodes.length);if(Ae.lineWrapping){cn=He.clientWidth;var h=Ke.firstChild;$e.iter(mn,gn,function(t){if(!t.hidden){var e=Math.round(h.offsetHeight/u)||1;t.height!=e&&(L(t,e),sn=!0)}h=h.nextSibling})}else null==cn&&(cn=le(xn)),cn>He.clientWidth?(Ue.style.width=cn+"px",Ie.style.width="",Ie.style.width=He.scrollWidth+"px"):Ue.style.width=Ie.style.width="";return Re.style.display=f,(c||sn)&&zt(),Tt(),!e&&Ae.onUpdate&&Ae.onUpdate(wn),!0}}}function Lt(t,e){for(var n=0,r=e.length||0;n=u.to?o.push(u):(i.from>u.from&&o.push({from:u.from,to:i.from,domStart:u.domStart}),i.toi;)o=r(o),i++;for(var s=0,u=a.to-a.from;s=t,p=Ee.createElement("div");$e.iter(t,e,function(t){var e=null,r=null;d?(e=0,h==s&&(d=!1,r=hn.to.ch)):c==s&&(h==s?(e=hn.from.ch,r=hn.to.ch):(d=!0,e=hn.from.ch)),f&&f.to==s&&(f=n.shift()),!f||f.from>s?(t.hidden?p.innerHTML="
":p.innerHTML=t.getHTML(e,r,!0,yn),Ke.insertBefore(p.firstChild,o)):o=o.nextSibling,++s})}function zt(){if(Ae.gutter||Ae.lineNumbers){var t=Oe.offsetHeight,e=He.clientHeight;Re.style.height=(t-e<2?e:t)+"px";var n=[],r=mn;$e.iter(mn,Math.max(gn,mn+1),function(t){if(t.hidden)n.push("
");else{var e=t.gutterMarker,i=Ae.lineNumbers?r+Ae.firstLineNumber:null;e&&e.text?i=e.text.replace("%N%",null!=i?i:""):null==i&&(i=" "),n.push(e&&e.style?'
':"
",i);for(var o=1;o ");n.push("
")}++r}),Re.style.display="none",Pe.innerHTML=n.join("");for(var i=String($e.size).length,o=Pe.firstChild,l=T(o),a="";l.length+a.lengthn||l>o.text.length)&&(l=o.text.length),{line:r,ch:l}}r+=e}}var i=k(t.line);return i.hidden?t.line>=e?r(1)||r(-1):r(-1)||r(1):t}function Ht(t,e,n){var r=Ot({line:t,ch:e||0});(n?Wt:Nt)(r,r)}function It(t){return Math.max(0,Math.min(t,$e.size-1))}function Ot(t){if(t.line<0)return{line:0,ch:0};if(t.line>=$e.size)return{line:$e.size-1,ch:k($e.size-1).text.length};var e=t.ch,n=k(t.line).text.length;return null==e||e>n?{line:t.line,ch:n}:e<0?{line:t.line,ch:0}:t}function Rt(t,e){function n(){for(var e=o+t,n=t<0?-1:$e.size;e!=n;e+=t){var r=k(e);if(!r.hidden)return o=e,a=r,!0}}function r(e){if(l==(t<0?0:a.text.length)){if(e||!n())return!1;l=t<0?a.text.length:0}else l+=t;return!0}var i=hn.inverted?hn.from:hn.to,o=i.line,l=i.ch,a=k(o);if("char"==e)r();else if("column"==e)r(!0);else if("word"==e)for(var s=!1;!(t<0)||r();){if(O(a.text.charAt(l)))s=!0;else if(s){t<0&&(t=1,r());break}if(t>0&&!r())break}return{line:o,ch:l}}function Pt(t,e){var n=t<0?hn.from:hn.to;(Ze||E(hn.from,hn.to))&&(n=Rt(t,e)),Ht(n.line,n.ch,!0)}function Ut(t,e){E(hn.from,hn.to)?t<0?ct("",Rt(t,e),hn.to):ct("",hn.from,Rt(t,e)):ct("",hn.from,hn.to),nn=!0}function Bt(t,e){var n=0,r=se(hn.inverted?hn.from:hn.to,!0);null!=Ln&&(r.x=Ln),"page"==e?n=He.clientHeight:"line"==e&&(n=ce());var i=ue(r.x,r.y+n*t+2);Ht(i.line,i.ch,!0),Ln=r.x}function Vt(t){for(var e=k(t.line).text,n=t.ch,r=t.ch;n>0&&O(e.charAt(n-1));)--n;for(;rxn.length&&(xn=t.text)});rn.push({from:0,to:$e.size})}function qt(){for(var t='',e=0;e"}function Xt(){yn=qt(),St(!0)}function $t(){He.className=He.className.replace(/\s*cm-s-\w+/g,"")+Ae.theme.replace(/(^|\s)\s*/g," cm-s-")}function Zt(){this.set=[]}function Jt(t,e,n){function r(t,e,n,r){k(t).addMark(new l(e,n,r,i.set))}t=Ot(t),e=Ot(e);var i=new Zt;if(t.line==e.line)r(t.line,t.ch,e.ch,n);else{r(t.line,t.ch,null,n);for(var o=t.line+1,a=e.line;o"+t.getHTML(null,null,!1,yn,e)+''+D(t.text.charAt(e)||" ")+""+n+"
";var i=document.getElementById("CodeMirror-temp-"+Wn),o=i.offsetTop,l=i.offsetLeft;if(G&&e&&0==o&&0==l){var a=document.createElement("span");a.innerHTML="x",i.parentNode.insertBefore(a,i.nextSibling),o=a.offsetTop}return{top:o,left:l}}function se(t,e){var n,r=ce(),i=r*(m($e,t.line)-(e?pn:0));if(0==t.ch)n=0;else{var o=ae(k(t.line),t.ch);n=o.left,Ae.lineWrapping&&(i+=Math.max(0,o.top))}return{x:n,y:i,yBot:i+r}}function ue(t,e){function n(t){var e=ae(a,t);if(u){var n=Math.round(e.top/r);return Math.max(0,e.left+(n-f)*He.clientWidth)}return e.left}e<0&&(e=0);var r=ce(),i=he(),o=pn+Math.floor(e/r),l=p($e,o);if(l>=$e.size)return{line:$e.size-1,ch:k($e.size-1).text.length};var a=k(l),s=a.text,u=Ae.lineWrapping,f=u?o-m($e,l):0;if(t<=0&&0==f)return{line:l,ch:0};for(var c,h=0,d=0,g=s.length,v=Math.min(g,Math.ceil((t+f*He.clientWidth*.9)/i));;){var x=n(v);if(!(x<=t&&vc)return{line:l,ch:g};for(v=Math.floor(.8*g),x=n(v),xt-d?h:g};var y=Math.ceil((h+g)/2),C=n(y);C>t?(g=y,c=C):(h=y,d=C)}}function fe(t){var e=se(t,!0),n=z(Ue);return{x:n.left+e.x,y:n.top+e.y,yBot:n.top+e.yBot}}function ce(){if(null==Tn){Tn="
";for(var t=0;t<49;++t)Tn+="x
";Tn+="x
"}var e=Ke.clientHeight;return e==zn?An:(zn=e,Be.innerHTML=Tn,An=Be.firstChild.offsetHeight/50||1,Be.innerHTML="",An)}function he(){return He.clientWidth==Nn?En:(Nn=He.clientWidth,En=le("x"))}function de(){return Ue.offsetTop}function pe(){return Ue.offsetLeft}function me(t,e){var n,r,i=z(He,!0);try{n=t.clientX,r=t.clientY}catch(t){return null}if(!e&&(n-i.left>He.clientWidth||r-i.top>He.clientHeight))return null;var o=z(Ue,!0);return ue(n-o.left,r-o.top)}function ge(t){function e(){var t=X(De.value).join("\n");t!=i&&Le(ht)(t,"end"),Ne.style.position="relative",De.style.cssText=r,an=!1,yt(!0),gt()}var n=me(t);if(n&&!window.opera){(E(hn.from,hn.to)||W(n,hn.from)||!W(n,hn.to))&&Le(Ht)(n.line,n.ch);var r=De.style.cssText;Ne.style.position="absolute",De.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(t.clientY-5)+"px; left: "+(t.clientX-5)+"px; z-index: 1000; background: white; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",an=!0;var i=De.value=mt();if(kt(),De.select(),j){C(t);var o=b(window,"mouseup",function(){o(),setTimeout(e,20)},!0)}else setTimeout(e,50)}}function ve(){clearInterval(je);var t=!0;Ve.style.visibility="",je=setInterval(function(){Ve.style.visibility=(t=!t)?"":"hidden"},650)}function xe(t){function e(t,e,n){if(t.text)for(var r,i=t.styles,o=l?0:t.text.length-1,s=l?0:i.length-2,u=l?i.length:-2;s!=u;s+=2*a){var f=i[s];if(null==i[s+1]||i[s+1]==h){for(var c=l?0:f.length-1,m=l?f.length:-1;c!=m;c+=a,o+=a)if(o>=e&&o"==g.charAt(1)==l)d.push(r);else{if(d.pop()!=g.charAt(0))return{pos:o,match:!1};if(!d.length)return{pos:o,match:!0}}}}else o+=a*f.length}}var n=hn.inverted?hn.from:hn.to,r=k(n.line),i=n.ch-1,o=i>=0&&Dn[r.text.charAt(i)]||Dn[r.text.charAt(++i)];if(o){for(var l=(o.charAt(0),">"==o.charAt(1)),a=l?1:-1,s=r.styles,u=i+1,f=0,c=s.length;fi;--r){if(0==r)return 0;var o=k(r-1);if(o.stateAfter)return r;var l=o.indentation(Ae.tabSize);(null==n||e>l)&&(n=r-1,e=l)}return n}function ke(t){var e=ye(t),n=e&&k(e-1).stateAfter;return n=n?r(Ge,n):i(Ge),$e.iter(e,t,function(t){t.highlight(Ge,n,Ae.tabSize),t.stateAfter=r(Ge,n)}),e=$e.size)){var o=ye(n),l=o&&k(o-1).stateAfter;l=l?r(Ge,l):i(Ge);var a=0,s=Ge.compareStates,u=!1,f=o,c=!1;if($e.iter(f,$e.size,function(e){var i=e.stateAfter;if(+new Date>t)return Ye.push(f),Me(Ae.workDelay),u&&rn.push({from:n,to:f+1}),c=!0;var o=e.highlight(Ge,l,Ae.tabSize);if(o&&(u=!0),e.stateAfter=r(Ge,l),s){if(i&&s(i,l))return!0}else if(o===!1&&i){if(++a>3&&(!Ge.indent||Ge.indent(i,"")==Ge.indent(l,"")))return!0}else a=0;++f}),c)return;u&&rn.push({from:n,to:f+1})}}e&&Ae.onHighlightComplete&&Ae.onHighlightComplete(wn)}function Me(t){Ye.length&&Xe.set(t,Le(we))}function be(){en=nn=on=null,rn=[],ln=!1,un=[]}function Se(){var t,e=!1;ln&&(e=!wt()),rn.length?t=St(rn,!0):(ln&&Tt(),sn&&zt()),e&&wt(),ln&&(Ct(),ve()),_e&&!an&&(en===!0||en!==!1&&ln)&&yt(nn),ln&&Ae.matchBrackets&&setTimeout(Le(function(){fn&&(fn(),fn=null),E(hn.from,hn.to)&&xe(!1)}),20);var n=on,r=un;ln&&Ae.onCursorActivity&&Ae.onCursorActivity(wn),n&&Ae.onChange&&wn&&Ae.onChange(wn,n);for(var i=0;ia&&t.y>e.offsetHeight&&(o=t.y-e.offsetHeight),l+e.offsetWidth>s&&(l=s-e.offsetWidth)}e.style.top=o+de()+"px",e.style.left=e.style.right="","right"==i?(l=Ie.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(Ie.clientWidth-e.offsetWidth)/2),e.style.left=l+pe()+"px"),n&&Mt(l,o,l+e.offsetWidth,o+e.offsetHeight)},lineCount:function(){return $e.size},clipPos:Ot,getCursor:function(t){return null==t&&(t=hn.inverted),N(t?hn.from:hn.to)},somethingSelected:function(){return!E(hn.from,hn.to)},setCursor:Le(function(t,e,n){null==e&&"number"==typeof t.line?Ht(t.line,t.ch,n):Ht(t,e,n)}),setSelection:Le(function(t,e,n){(n?Wt:Nt)(Ot(t),Ot(e||t))}),getLine:function(t){if(v(t))return k(t).text},getLineHandle:function(t){if(v(t))return k(t)},setLine:Le(function(t,e){v(t)&&ct(e,{line:t,ch:0},{line:t,ch:k(t).text.length})}),removeLine:Le(function(t){v(t)&&ct("",{line:t,ch:0},Ot({line:t+1,ch:0}))}),replaceRange:Le(ct),getRange:function(t,e){return pt(Ot(t),Ot(e))},execCommand:function(t){return V[t](wn)},moveH:Le(Pt),deleteH:Le(Ut),moveV:Le(Bt),toggleOverwrite:function(){dn=!dn},posFromIndex:function(t){var e,n=0;return $e.iter(0,$e.size,function(r){var i=r.text.length+1;return i>t?(e=t,!0):(t-=i,void++n)}),Ot({line:n,ch:e})},indexFromPos:function(t){if(t.line<0||t.ch<0)return 0;var e=t.ch;return $e.iter(0,t.line,function(t){e+=t.text.length+1}),e},operation:function(t){return Le(t)()},refresh:function(){St(!0)},getInputField:function(){return De},getWrapperElement:function(){return We},getScrollerElement:function(){return He},getGutterElement:function(){return Re}},Mn=null,bn=!1,Sn="",Ln=null;Zt.prototype.clear=Le(function(){for(var t=1/0,e=-(1/0),n=0,r=this.set.length;n",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},Hn=0;for(var In in B)B.propertyIsEnumerable(In)&&!wn.propertyIsEnumerable(In)&&(wn[In]=B[In]);return wn}function e(t,e,n){function r(t,e,n){var i=e[t];if(null!=i)return i;if(null==n&&(n=e.fallthrough),null==n)return e.catchall;if("string"==typeof n)return r(t,K[n]);for(var o=0,l=n.length;ot&&r.push(a.slice(t-o,Math.min(a.length,e-o)),n[i+1]),s>=t&&(l=1)):1==l&&(s>e?r.push(a.slice(0,e-o),n[i+1]):r.push(a,n[i+1])),o=s}}function f(t){this.lines=t,this.parent=null;for(var e=0,n=t.length,r=0;e=0&&r>=0&&t.charAt(n)==e.charAt(r);--n,--r);return r+1}function I(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;n0&&e.ch=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pose},eatSpace:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},backUp:function(t){this.pos-=t},column:function(){return L(this.string,this.start,this.tabSize)},indentation:function(){return L(this.string,null,this.tabSize)},match:function(t,e,n){function r(t){return n?t.toLowerCase():t}if("string"!=typeof t){var i=this.string.slice(this.pos).match(t);return i&&e!==!1&&(this.pos+=i[0].length),i}if(r(this.string).indexOf(r(t),this.pos)==this.pos)return e!==!1&&(this.pos+=t.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},t.StringStream=o,l.prototype={attach:function(t){this.set.push(t)},detach:function(t){var e=I(this.set,t);e>-1&&this.set.splice(e,1)},split:function(t,e){if(this.to<=t&&null!=this.to)return null;var n=this.from=e&&(this.from=Math.max(r,this.from)+i),null!=this.to&&this.to>e&&(this.to=rthis.from&&(rthis.from||null==this.from)&&(this.to=null)},isDead:function(){return null!=this.from&&null!=this.to&&this.from>=this.to},sameSet:function(t){return this.set==t.set}},a.prototype={attach:function(t){this.line=t},detach:function(t){this.line==t&&(this.line=null)},split:function(t,e){if(tthis.to},clipTo:function(t,e,n,r,i){(t||ethis.to)?(this.from=0,this.to=-1):this.from>e&&(this.from=this.to=Math.max(r,this.from)+i)},sameSet:function(t){return!1},find:function(){return this.line&&this.line.parent?{line:d(this.line),ch:this.from}:null},clear:function(){if(this.line){var t=I(this.line.marked,this);t!=-1&&this.line.marked.splice(t,1),this.line=null}}},s.inheritMarks=function(t,e){var n=new s(t),r=e&&e.marked;if(r)for(var i=0;i5e3){l[a++]=this.text.slice(i.pos),l[a++]=null;break}}return l.length!=a&&(l.length=a,s=!0),a&&l[a-2]!=r&&(s=!0),s||l.length<5&&this.text.length<10&&null},getTokenAt:function(t,e,n){for(var r=this.text,i=new o(r);i.pos',D(t).replace(/\t/g,r),""):a.push(D(t).replace(/\t/g,r)))}function l(){c&&(v+=1,x=v':"
");var u=this.styles,f=this.text,c=this.marked;t==e&&(t=null);var h=f.length;if(null!=i&&(h=Math.min(i,h)),f||null!=i)if(c||null!=t){var d,p=0,m=0,g="",v=-1,x=null;for(l();pp?y=t:(null==e||e>p)&&(k=" CodeMirror-selected",null!=e&&(y=Math.min(y,e))));x&&null!=x.to&&x.to<=p;)l();for(x&&(x.from>p?y=Math.min(y,x.from):(k+=" "+x.style,null!=x.to&&(y=Math.min(y,x.to))));;){var C=p+g.length,w=d;if(k&&(w=d?d+k:k),o(C>y?g.slice(0,y-p):g,w),C>=y){g=g.slice(y-p),p=y;break}p=C,g=u[m++],d="cm-"+u[m++]}}null!=t&&null==e&&o(" ","CodeMirror-selected")}else for(var m=0,M=0;Mh&&(b=b.slice(0,h-M)),M+=S,o(b,d&&"cm-"+d)}else o(" ",null!=t&&null==e?"CodeMirror-selected":null);return n&&a.push("
"),a.join("")},cleanUp:function(){if(this.parent=null,this.marked)for(var t=0,e=this.marked.length;t50){for(;o.lines.length>50;){var a=o.lines.splice(o.lines.length-25,25),s=new f(a);o.height-=s.height,this.children.splice(r+1,0,s),s.parent=this}this.maybeSpill()}break}t-=l}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=t.children.splice(t.children.length-5,5),n=new c(e);if(t.parent){t.size-=n.size,t.height-=n.height;var r=I(t.parent.children,t);t.parent.children.splice(r+1,0,n)}else{var i=new c(t.children);i.parent=t,t.children=[i,n],t=i}n.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iter:function(t,e,n){this.iterN(t,e-t,n)},iterN:function(t,e,n){for(var r=0,i=this.children.length;r400||!i||i.start>t+e||i.start+i.added=0;--l)i.old.unshift(n[l]);i.added+=i.start-t,i.start=t}else i.start-1&&(_="\r\n")}(),null!=document.documentElement.getBoundingClientRect&&(z=function(t,e){try{var n=t.getBoundingClientRect();n={top:n.top,left:n.left}}catch(r){n={top:0,left:0}}if(!e)if(null==window.pageYOffset){var i=document.documentElement||document.body.parentNode;null==i.scrollTop&&(i=document.body),n.top+=i.scrollTop,n.left+=i.scrollLeft}else n.top+=window.pageYOffset,n.left+=window.pageXOffset;return n});var q=document.createElement("pre");"\na"==D("a")?D=function(t){return q.textContent=t,q.innerHTML.slice(1)}:"\t"!=D("\t")&&(D=function(t){return q.innerHTML="",q.appendChild(document.createTextNode(t)),q.innerHTML}),t.htmlEscape=D;var X=3!="\n\nb".split(/\n/).length?function(t){for(var e,n=0,r=[];(e=t.indexOf("\n",n))>-1;)r.push(t.slice(n,"\r"==t.charAt(e-1)?e-1:e)),n=e+1;return r.push(t.slice(n)),r}:function(t){return t.split(/\r?\n/)};t.splitLines=X;var $=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(e){return!1}}:function(t){try{var e=t.ownerDocument.selection.createRange()}catch(n){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)};t.defineMode("null",function(){return{token:function(t){t.skipToEnd()}}}),t.defineMIME("text/plain","null");var Z={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return t.keyNames=Z,function(){for(var t=0;t<10;t++)Z[t+48]=String(t);for(var t=65;t<=90;t++)Z[t]=String.fromCharCode(t);for(var t=1;t<=12;t++)Z[t+111]=Z[t+63235]="F"+t}(),t}();CodeMirror.defineMode("xml",function(t,e){function n(t,e){function n(n){return e.tokenize=n,n(t,e)}var i=t.next();if("<"==i){if(t.eat("!"))return t.eat("[")?t.match("CDATA[")?n(o("atom","]]>")):null:t.match("--")?n(o("comment","-->")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(l(1))):null;if(t.eat("?"))return t.eatWhile(/[\w\._\-]/),e.tokenize=o("meta","?>"),"meta";x=t.eat("/")?"closeTag":"openTag",t.eatSpace(),v="";for(var a;a=t.eat(/[^\s\u00a0=<>\"\'\/?]/);)v+=a;return e.tokenize=r,"tag"}return"&"==i?(t.eatWhile(/[^;]/),t.eat(";"),"atom"):(t.eatWhile(/[^&<]/),null)}function r(t,e){var r=t.next();return">"==r||"/"==r&&t.eat(">")?(e.tokenize=n,x=">"==r?"endTag":"selfcloseTag","tag"):"="==r?(x="equals",null):/[\'\"]/.test(r)?(e.tokenize=i(r),e.tokenize(t,e)):(t.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function i(t){return function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=r;break}return"string"}}function o(t,e){return function(r,i){for(;!r.eol();){if(r.match(e)){i.tokenize=n;break}r.next()}return t}}function l(t){return function(e,r){for(var i;null!=(i=e.next());){if("<"==i)return r.tokenize=l(t+1),r.tokenize(e,r);if(">"==i){if(1==t){r.tokenize=n;break}return r.tokenize=l(t-1),r.tokenize(e,r)}}return"meta"}}function a(){for(var t=arguments.length-1;t>=0;t--)y.cc.push(arguments[t])}function s(){return a.apply(null,arguments),!0}function u(t,e){var n=w.doNotIndent.hasOwnProperty(t)||y.context&&y.context.noIndent;y.context={prev:y.context,tagName:t,indent:y.indented,startOfLine:e,noIndent:n}}function f(){y.context&&(y.context=y.context.prev)}function c(t){if("openTag"==t)return y.tagName=v,s(p,h(y.startOfLine));if("closeTag"==t){var e=!1;return e=!y.context||y.context.tagName!=v,e&&(k="error"),s(d(e))}return s()}function h(t){return function(e){return"selfcloseTag"==e||"endTag"==e&&w.autoSelfClosers.hasOwnProperty(y.tagName.toLowerCase())?s():"endTag"==e?(u(y.tagName,t),s()):s()}}function d(t){return function(e){return t&&(k="error"),"endTag"==e?(f(),s()):(k="error",s(arguments.callee))}}function p(t){return"word"==t?(k="attribute",s(p)):"equals"==t?s(m,p):"string"==t?(k="error",s(p)):a()}function m(t){return"word"==t&&w.allowUnquoted?(k="string",s()):"string"==t?s(g):a()}function g(t){return"string"==t?s(g):a()}var v,x,y,k,C=t.indentUnit,w=e.htmlMode?{autoSelfClosers:{br:!0,img:!0,hr:!0,link:!0,input:!0,meta:!0,col:!0,frame:!0,base:!0,area:!0},doNotIndent:{pre:!0},allowUnquoted:!0}:{autoSelfClosers:{},doNotIndent:{},allowUnquoted:!1},M=e.alignCDATA;return{startState:function(){return{tokenize:n,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(t,e){if(t.sol()&&(e.startOfLine=!0,e.indented=t.indentation()),t.eatSpace())return null;k=x=v=null;var n=e.tokenize(t,e);if(e.type=x,(n||x)&&"comment"!=n)for(y=e;;){var r=e.cc.pop()||c;if(r(x||n))break}return e.startOfLine=!1,k||n},indent:function(t,e,i){var o=t.context;if(t.tokenize!=r&&t.tokenize!=n||o&&o.noIndent)return i?i.match(/^(\s*)/)[0].length:0;if(M&&/=0;t--)F.cc.push(arguments[t])}function h(){return c.apply(null,arguments),!0}function d(t){var e=F.state;if(e.context){F.marked="def";for(var n=e.localVars;n;n=n.next)if(n.name==t)return;e.localVars={name:t,next:e.localVars}}}function p(){F.state.context||(F.state.localVars=j),F.state.context={prev:F.state.context,vars:F.state.localVars}}function m(){F.state.localVars=F.state.context.vars,F.state.context=F.state.context.prev}function g(t,e){var n=function(){var n=F.state;n.lexical=new s(n.indented,F.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function v(){var t=F.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function x(t){return function(e){return e==t?h():";"==t?c():h(arguments.callee)}}function y(t){return"var"==t?h(g("vardef"),z,x(";"),v):"keyword a"==t?h(g("form"),k,y,v):"keyword b"==t?h(g("form"),y,v):"{"==t?h(g("}"),A,v):";"==t?h():"function"==t?h(H):"for"==t?h(g("form"),x("("),g(")"),E,x(")"),v,y,v):"variable"==t?h(g("stat"),M):"switch"==t?h(g("form"),k,g("}","switch"),x("{"),A,v,v):"case"==t?h(k,x(":")):"default"==t?h(x(":")):"catch"==t?h(g("form"),p,x("("),I,x(")"),y,v,m):c(g("stat"),k,x(";"),v)}function k(t){return K.hasOwnProperty(t)?h(w):"function"==t?h(H):"keyword c"==t?h(C):"("==t?h(g(")"),k,x(")"),v,w):"operator"==t?h(k):"["==t?h(g("]"),L(k,"]"),v,w):"{"==t?h(g("}"),L(S,"}"),v,w):h()}function C(t){return t.match(/[;\}\)\],]/)?c():c(k)}function w(t,e){if("operator"==t&&/\+\+|--/.test(e))return h(w);if("operator"==t)return h(k);if(";"!=t)return"("==t?h(g(")"),L(k,")"),v,w):"."==t?h(b,w):"["==t?h(g("]"),k,x("]"),v,w):void 0}function M(t){return":"==t?h(v,y):c(w,x(";"),v)}function b(t){if("variable"==t)return F.marked="property",h()}function S(t){if("variable"==t&&(F.marked="property"),K.hasOwnProperty(t))return h(x(":"),k)}function L(t,e){function n(r){return","==r?h(t,n):r==e?h():h(x(e))}return function(r){return r==e?h():c(t,n)}}function A(t){return"}"==t?h():c(y,A)}function z(t,e){return"variable"==t?(d(e),h(T)):h()}function T(t,e){return"="==e?h(k,T):","==t?h(z):void 0}function E(t){return"var"==t?h(z,N):";"==t?c(N):"variable"==t?h(W):c(N)}function W(t,e){return"in"==e?h(k):h(w,N)}function N(t,e){return";"==t?h(D):"in"==e?h(k):h(k,x(";"),D)}function D(t){")"!=t&&h(k)}function H(t,e){return"variable"==t?(d(e),h(H)):"("==t?h(g(")"),p,L(I,")"),v,y,m):void 0}function I(t,e){if("variable"==t)return d(e),h()}var O,R,P=t.indentUnit,U=e.json,B=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),r=t("keyword c"),i=t("operator"),o={type:"atom",style:"atom"};return{"if":e,"while":e,"with":e,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":r,"delete":r,"throw":r,"var":t("var"),"const":t("var"),"let":t("var"),"function":t("function"),"catch":t("catch"),"for":t("for"),"switch":t("switch"),"case":t("case"),"default":t("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o}}(),V=/[+\-*&%=<>!?|]/,K={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},F={state:null,column:null,marked:null,cc:null},j={name:"this",next:{name:"arguments"}};return v.lex=!0,{startState:function(t){return{tokenize:o,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new s((t||0)-P,0,"block",(!1)),localVars:null,context:null,indented:0}},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation()),t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==O?n:(e.reAllowed="operator"==O||"keyword c"==O||O.match(/^[\[{}\(,;:]$/),e.kwAllowed="."!=O,f(e,n,O,R,t))},indent:function(t,e){if(t.tokenize!=o)return 0;var n=e&&e.charAt(0),r=t.lexical,i=r.type,l=n==i;return"vardef"==i?r.indented+4:"form"==i&&"{"==n?r.indented:"stat"==i||"form"==i?r.indented+P:"switch"!=r.info||l?r.align?r.column+(l?0:1):r.indented+(l?0:P):r.indented+(/^(?:case|default)\b/.test(e)?P:2*P)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMode("css",function(t){function e(t,e){return l=e,t}function n(t,n){var l=t.next();return"@"==l?(t.eatWhile(/[\w\\\-]/),e("meta",t.current())):"/"==l&&t.eat("*")?(n.tokenize=r,r(t,n)):"<"==l&&t.eat("!")?(n.tokenize=i,i(t,n)):"="!=l?"~"!=l&&"|"!=l||!t.eat("=")?'"'==l||"'"==l?(n.tokenize=o(l),n.tokenize(t,n)):"#"==l?(t.eatWhile(/[\w\\\-]/),e("atom","hash")):"!"==l?(t.match(/^\s*\w*/),e("keyword","important")):/\d/.test(l)?(t.eatWhile(/[\w.%]/),e("number","unit")):/[,.+>*\/]/.test(l)?e(null,"select-op"):/[;{}:\[\]]/.test(l)?e(null,l):(t.eatWhile(/[\w\\\-]/),e("variable","variable")):e(null,"compare"):void e(null,"compare")}function r(t,r){for(var i,o=!1;null!=(i=t.next());){if(o&&"/"==i){r.tokenize=n;break}o="*"==i}return e("comment","comment")}function i(t,r){for(var i,o=0;null!=(i=t.next());){if(o>=2&&">"==i){r.tokenize=n;break}o="-"==i?o+1:0}return e("comment","comment")}function o(t){return function(r,i){for(var o,l=!1;null!=(o=r.next())&&(o!=t||l);)l=!l&&"\\"==o;return l||(i.tokenize=n),e("string","string")}}var l,a=t.indentUnit;return{startState:function(t){return{tokenize:n,baseIndent:t||0,stack:[]}},token:function(t,e){if(t.eatSpace())return null;var n=e.tokenize(t,e),r=e.stack[e.stack.length-1];return"hash"==l&&"rule"==r?n="atom":"variable"==n&&("rule"==r?n="number":r&&"@media{"!=r||(n="tag")),"rule"==r&&/^[\{\};]$/.test(l)&&e.stack.pop(),"{"==l?"@media"==r?e.stack[e.stack.length-1]="@media{":e.stack.push("{"):"}"==l?e.stack.pop():"@media"==l?e.stack.push("@media"):"{"==r&&"comment"!=l&&e.stack.push("rule"),n},indent:function(t,e){var n=t.stack.length;return/^\}/.test(e)&&(n-="rule"==t.stack[t.stack.length-1]?2:1),t.baseIndent+n*a},electricChars:"}"}}),CodeMirror.defineMIME("text/css","css"),CodeMirror.defineMode("htmlmixed",function(t,e){function n(t,e){var n=l.token(t,e.htmlState);return"tag"==n&&">"==t.current()&&e.htmlState.context&&(/^script$/i.test(e.htmlState.context.tagName)?(e.token=i,e.localState=a.startState(l.indent(e.htmlState,"")),e.mode="javascript"):/^style$/i.test(e.htmlState.context.tagName)&&(e.token=o,e.localState=s.startState(l.indent(e.htmlState,"")),e.mode="css")),n}function r(t,e,n){var r=t.current(),i=r.search(e);return i>-1&&t.backUp(r.length-i),n}function i(t,e){return t.match(/^<\/\s*script\s*>/i,!1)?(e.token=n,e.curState=null,e.mode="html",n(t,e)):r(t,/<\/\s*script\s*>/,a.token(t,e.localState))}function o(t,e){return t.match(/^<\/\s*style\s*>/i,!1)?(e.token=n,e.localState=null,e.mode="html",n(t,e)):r(t,/<\/\s*style\s*>/,s.token(t,e.localState))}var l=CodeMirror.getMode(t,{name:"xml",htmlMode:!0}),a=CodeMirror.getMode(t,"javascript"),s=CodeMirror.getMode(t,"css");return{startState:function(){var t=l.startState();return{token:n,localState:null,mode:"html",htmlState:t}},copyState:function(t){if(t.localState)var e=CodeMirror.copyState(t.token==o?s:a,t.localState);return{token:t.token,localState:e,mode:t.mode,htmlState:CodeMirror.copyState(l,t.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(t,e){return t.token==n||/^\s*<\//.test(e)?l.indent(t.htmlState,e):t.token==i?a.indent(t.localState,e):s.indent(t.localState,e)},compareStates:function(t,e){return l.compareStates(t.htmlState,e.htmlState)},electricChars:"/{}:"}}),CodeMirror.defineMIME("text/html","htmlmixed");