genghisapp 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/CHANGELOG.markdown +6 -0
  2. data/genghis.rb +7 -7
  3. metadata +2 -2
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,9 @@
1
+ ## v2.1.1
2
+
3
+ * Fix #38 — JSON rendering weirdness with empty array properties.
4
+ * Fix #40 — Ruby 1.8.7 regression.
5
+
6
+
1
7
  ## v2.1
2
8
 
3
9
  * Fix #28 — Handle BSON BinData properly in documents and ids.
data/genghis.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Genghis v2.1.0
3
+ # Genghis v2.1.1
4
4
  #
5
5
  # The single-file MongoDB admin app
6
6
  #
@@ -8,7 +8,7 @@
8
8
  #
9
9
  # @author Justin Hileman <justin@justinhileman.info>
10
10
  #
11
- GENGHIS_VERSION = "2.1.0"
11
+ GENGHIS_VERSION = "2.1.1"
12
12
 
13
13
  require 'mongo'
14
14
  require 'json'
@@ -641,7 +641,7 @@ module Genghis
641
641
  @genghis_version = GENGHIS_VERSION
642
642
  if request.xhr?
643
643
  content_type :json
644
- error(status, {error: message, status: status}.to_json)
644
+ error(status, {:error => message, :status => status}.to_json)
645
645
  else
646
646
  error(status, mustache('error.html.mustache'.intern))
647
647
  end
@@ -778,7 +778,7 @@ __END__
778
778
 
779
779
  @@ style.css
780
780
  /**
781
- * Genghis v2.1.0
781
+ * Genghis v2.1.1
782
782
  *
783
783
  * The single-file MongoDB admin app
784
784
  *
@@ -790,7 +790,7 @@ __END__
790
790
 
791
791
  @@ script.js
792
792
  /**
793
- * Genghis v2.1.0
793
+ * Genghis v2.1.1
794
794
  *
795
795
  * The single-file MongoDB admin app
796
796
  *
@@ -805,7 +805,7 @@ n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==n
805
805
  null?void 0:this._byId[e.id!=null?e.id:e]},getByCid:function(e){return e&&this._byCid[e.cid||e]},at:function(e){return this.models[e]},where:function(e){return s.isEmpty(e)?[]:this.filter(function(t){for(var n in e)if(e[n]!==t.get(n))return!1;return!0})},sort:function(e){e||(e={});if(!this.comparator)throw new Error("Cannot sort a set without a comparator");var t=s.bind(this.comparator,this);return this.comparator.length==1?this.models=this.sortBy(t):this.models.sort(t),e.silent||this.trigger("reset",this,e),this},pluck:function(e){return s.map(this.models,function(t){return t.get(e)})},reset:function(e,t){e||(e=[]),t||(t={});for(var n=0,r=this.models.length;n<r;n++)this._removeReference(this.models[n]);return this._reset(),this.add(e,s.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),this},fetch:function(e){e=e?s.clone(e):{},e.parse===undefined&&(e.parse=!0);var t=this,n=e.success;return e.success=function(r,i,s){t[e.add?"add":"reset"](t.parse(r,s),e),n&&n(t,r)},e.error=i.wrapError(e.error,t,e),(this.sync||i.sync).call(this,"read",this,e)},create:function(e,t){var n=this;t=t?s.clone(t):{},e=this._prepareModel(e,t);if(!e)return!1;t.wait||n.add(e,t);var r=t.success;return t.success=function(i,s,o){t.wait&&n.add(i,t),r?r(i,s):i.trigger("sync",e,s,t)},e.save(null,t),e},parse:function(e,t){return e},chain:function(){return s(this.models).chain()},_reset:function(e){this.length=0,this.models=[],this._byId={},this._byCid={}},_prepareModel:function(e,t){t||(t={});if(e instanceof f)e.collection||(e.collection=this);else{var n=e;t.collection=this,e=new this.model(n,t),e._validate(e.attributes,t)||(e=!1)}return e},_removeReference:function(e){this==e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,n,r){if((e=="add"||e=="remove")&&n!=this)return;e=="destroy"&&this.remove(t,r),t&&e==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],this._byId[t.id]=t),this.trigger.apply(this,arguments)}});var c=["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","sortBy","sortedIndex","toArray","size","first","initial","rest","last","without","indexOf","shuffle","lastIndexOf","isEmpty","groupBy"];s.each(c,function(e){l.prototype[e]=function(){return s[e].apply(s,[this.models].concat(s.toArray(arguments)))}});var h=i.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},p=/:\w+/g,d=/\*\w+/g,v=/[-[\]{}()+?.,\\^$|#\s]/g;s.extend(h.prototype,a,{initialize:function(){},route:function(e,t,n){return i.history||(i.history=new m),s.isRegExp(e)||(e=this._routeToRegExp(e)),n||(n=this[t]),i.history.route(e,s.bind(function(r){var s=this._extractParameters(e,r);n&&n.apply(this,s),this.trigger.apply(this,["route:"+t].concat(s)),i.history.trigger("route",this,t,s)},this)),this},navigate:function(e,t){i.history.navigate(e,t)},_bindRoutes:function(){if(!this.routes)return;var e=[];for(var t in this.routes)e.unshift([t,this.routes[t]]);for(var n=0,r=e.length;n<r;n++)this.route(e[n][0],e[n][1],this[e[n][1]])},_routeToRegExp:function(e){return e=e.replace(v,"\\$&").replace(p,"([^/]+)").replace(d,"(.*?)"),new RegExp("^"+e+"$")},_extractParameters:function(e,t){return e.exec(t).slice(1)}});var m=i.History=function(){this.handlers=[],s.bindAll(this,"checkUrl")},g=/^[#\/]/,y=/msie [\w.]+/;m.started=!1,s.extend(m.prototype,a,{interval:50,getHash:function(e){var t=e?e.location:window.location,n=t.href.match(/#(.*)$/);return n?n[1]:""},getFragment:function(e,t){if(e==null)if(this._hasPushState||t){e=window.location.pathname;var n=window.location.search;n&&(e+=n)}else e=this.getHash();return e.indexOf(this.options.root)||(e=e.substr(this.options.root.length)),e.replace(g,"")},start:function(e){if(m.started)throw new Error("Backbone.history has already been started");m.started=!0,this.options=s.extend({},{root:"/"},this.options,e),this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&window.history&&window.history.pushState);var t=this.getFragment(),n=document.documentMode,r=y.exec(navigator.userAgent.toLowerCase())&&(!n||n<=7);r&&(this.iframe=o('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(t)),this._hasPushState?o(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!r?o(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=t;var i=window.location,u=i.pathname==this.options.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!u)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&u&&i.hash&&(this.fragment=this.getHash().replace(g,""),window.history.replaceState({},document.title,i.protocol+"//"+i.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},stop:function(){o(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),m.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();t==this.fragment&&this.iframe&&(t=this.getFragment(this.getHash(this.iframe)));if(t==this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(e){var t=this.fragment=this.getFragment(e),n=s.any(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0});return n},navigate:function(e,t){if(!m.started)return!1;if(!t||t===!0)t={trigger:t};var n=(e||"").replace(g,"");if(this.fragment==n)return;this._hasPushState?(n.indexOf(this.options.root)!=0&&(n=this.options.root+n),this.fragment=n,window.history[t.replace?"replaceState":"pushState"]({},document.title,n)):this._wantsHashChange?(this.fragment=n,this._updateHash(window.location,n,t.replace),this.iframe&&n!=this.getFragment(this.getHash(this.iframe))&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,n,t.replace))):window.location.assign(this.options.root+e),t.trigger&&this.loadUrl(e)},_updateHash:function(e,t,n){n?e.replace(e.toString().replace(/(javascript:|#).*$/,"")+"#"+t):e.hash=t}});var b=i.View=function(e){this.cid=s.uniqueId("view"),this._configure(e||{}),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},w=/^(\S+)\s*(.*)$/,E=["model","collection","el","id","attributes","className","tagName"];s.extend(b.prototype,a,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this},make:function(e,t,n){var r=document.createElement(e);return t&&o(r).attr(t),n&&o(r).html(n),r},setElement:function(e,t){return this.$el&&this.undelegateEvents(),this.$el=e instanceof o?e:o(e),this.el=this.$el[0],t!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=C(this,"events")))return;this.undelegateEvents();for(var t in e){var n=e[t];s.isFunction(n)||(n=this[e[t]]);if(!n)throw new Error('Method "'+e[t]+'" does not exist');var r=t.match(w),i=r[1],o=r[2];n=s.bind(n,this),i+=".delegateEvents"+this.cid,o===""?this.$el.bind(i,n):this.$el.delegate(o,i,n)}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(e){this.options&&(e=s.extend({},this.options,e));for(var t=0,n=E.length;t<n;t++){var r=E[t];e[r]&&(this[r]=e[r])}this.options=e},_ensureElement:function(){if(!this.el){var e=C(this,"attributes")||{};this.id&&(e.id=this.id),this.className&&(e["class"]=this.className),this.setElement(this.make(this.tagName,e),!1)}else this.setElement(this.el,!1)}});var S=function(e,t){var n=N(this,e,t);return n.extend=this.extend,n};f.extend=l.extend=h.extend=b.extend=S;var x={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};i.sync=function(e,t,n){var r=x[e];n||(n={});var u={type:r,dataType:"json"};return n.url||(u.url=C(t,"url")||k()),!n.data&&t&&(e=="create"||e=="update")&&(u.contentType="application/json",u.data=JSON.stringify(t.toJSON())),i.emulateJSON&&(u.contentType="application/x-www-form-urlencoded",u.data=u.data?{model:u.data}:{}),i.emulateHTTP&&(r==="PUT"||r==="DELETE")&&(i.emulateJSON&&(u.data._method=r),u.type="POST",u.beforeSend=function(e){e.setRequestHeader("X-HTTP-Method-Override",r)}),u.type!=="GET"&&!i.emulateJSON&&(u.processData=!1),o.ajax(s.extend(u,n))},i.wrapError=function(e,t,n){return function(r,i){i=r===t?i:r,e?e(t,i,n):t.trigger("error",t,i,n)}};var T=function(){},N=function(e,t,n){var r;return t&&t.hasOwnProperty("constructor")?r=t.constructor:r=function(){e.apply(this,arguments)},s.extend(r,e),T.prototype=e.prototype,r.prototype=new T,t&&s.extend(r.prototype,t),n&&s.extend(r,n),r.prototype.constructor=r,r.__super__=e.prototype,r},C=function(e,t){return!e||!e[t]?null:s.isFunction(e[t])?e[t]():e[t]},k=function(){throw new Error('A "url" property or function must be specified')}}.call(this),window.CodeMirror=function(){"use strict";function e(r,i){function an(e){if(s.onDragEvent&&s.onDragEvent(cn,I(e)))return;U(e)}function ln(e){return e>=0&&e<At.size}function hn(e){return D(At,e)}function pn(e,t){Vt=!0;var n=t-e.height;for(var r=e;r;r=r.parent)r.height+=n}function dn(e){var t={line:0,ch:0};_n(t,{line:At.size-1,ch:hn(At.size-1).text.length},ht(e),t,t),qt=!0}function vn(e){var t=[];return At.iter(0,At.size,function(e){t.push(e.text)}),t.join(e||"\n")}function mn(e){R.scrollTop!=Bt&&(Bt=St.scrollTop=R.scrollTop,nr([]))}function gn(e){s.fixedGutter&&bt.style.left!=St.scrollLeft+"px"&&(bt.style.left=St.scrollLeft+"px"),St.scrollTop!=Bt&&(Bt=St.scrollTop,R.scrollTop!=Bt&&(R.scrollTop=Bt),nr([])),s.onScroll&&s.onScroll(cn)}function yn(e){function u(t){g&&(St.draggable=!1),jt=!1,l(),c(),Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)<10&&(q(t),cr(n.line,n.ch,!0),Qn())}function m(e){if(i=="single")ar(n,e);else if(i=="double"){var t=yr(e);rt(e,d)?ar(t.from,v):ar(d,t.to)}else i=="triple"&&(rt(e,d)?ar(v,pr({line:e.line,ch:0})):ar(d,pr({line:e.line+1,ch:0})))}function y(e){var t=Yr(e,!0);if(t&&!nt(t,a)){Mt||On(),a=t,m(t),qt=!1;var n=tr();if(t.line>=n.to||t.line<n.from)f=setTimeout(ci(function(){y(e)}),150)}}function b(e){clearTimeout(f);var t=Yr(e);t&&m(t),q(e),Qn(),qt=!0,w(),l()}ur(X(e,"shiftKey"));for(var t=z(e);t!=xt;t=t.parentNode)if(t.parentNode==Et&&t!=wt)return;for(var t=z(e);t!=xt;t=t.parentNode)if(t.parentNode==yt)return s.onGutterClick&&s.onGutterClick(cn,lt(yt.childNodes,t)+Kt,e),q(e);var n=Yr(e);switch(W(e)){case 3:h&&Zr(e);return;case 2:n&&cr(n.line,n.ch,!0),setTimeout(Qn,20),q(e);return}if(!n){z(e)==St&&q(e);return}Mt||On();var r=+(new Date),i="single";if(Ht&&Ht.time>r-400&&nt(Ht.pos,n))i="triple",q(e),setTimeout(Qn,20),br(n.line);else if(Pt&&Pt.time>r-400&&nt(Pt.pos,n)){i="double",Ht={time:r,pos:n},q(e);var o=yr(n);ar(o.from,o.to)}else Pt={time:r,pos:n};var a=n,f;if(s.dragDrop&&K&&!s.readOnly&&!nt(_t.from,_t.to)&&!rt(n,_t.from)&&!rt(_t.to,n)&&i=="single"){g&&(St.draggable=!0);var l=V(document,"mouseup",ci(u),!0),c=V(St,"drop",ci(u),!0);jt=!0,St.dragDrop&&St.dragDrop();return}q(e),i=="single"&&cr(n.line,n.ch,!0);var d=_t.from,v=_t.to,w=V(document,"mousemove",ci(function(e){clearTimeout(f),q(e),!p&&!W(e)?b(e):y(e)}),!0),l=V(document,"mouseup",ci(b),!0)}function bn(e){for(var t=z(e);t!=xt;t=t.parentNode)if(t.parentNode==yt)return q(e);q(e)}function wn(e){if(s.onDragEvent&&s.onDragEvent(cn,I(e)))return;q(e);var t=Yr(e,!0),n=e.dataTransfer.files;if(!t||s.readOnly)return;if(n&&n.length&&window.FileReader&&window.File){var r=n.length,i=Array(r),o=0,u=function(e,n){var s=new FileReader;s.onload=function(){i[n]=s.result,++o==r&&(t=pr(t),ci(function(){var e=qn(i.join(""),t,t);ar(t,e)})())},s.readAsText(e)};for(var a=0;a<r;++a)u(n[a],a)}else{if(jt&&!rt(t,_t.from)&&!rt(_t.to,t))return;try{var i=e.dataTransfer.getData("Text");i&&hi(function(){var e=_t.from,n=_t.to;ar(t,t),jt&&qn("",e,n),Rn(i),Qn()})}catch(e){}}}function En(e){var t=Wn();e.dataTransfer.setData("Text",t);if(h||y||b){var n=st("img");n.scr="data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs=",e.dataTransfer.setDragImage(n,0,0)}}function Sn(e,t){if(typeof e=="string"){e=u[e];if(!e)return!1}var n=Dt;try{s.readOnly&&(It=!0),t&&(Dt=null),e(cn)}catch(r){if(r!=J)throw r;return!1}finally{Dt=n,It=!1}return!0}function Tn(e){function u(){o=!0}var t=f(s.keyMap),n=t.auto;clearTimeout(xn),n&&!c(e)&&(xn=setTimeout(function(){f(s.keyMap)==t&&(s.keyMap=n.call?n.call(null,cn):n)},50));var r=dt[X(e,"keyCode")],i=!1;if(r==null||e.altGraphKey)return!1;X(e,"altKey")&&(r="Alt-"+r),X(e,"ctrlKey")&&(r="Ctrl-"+r),X(e,"metaKey")&&(r="Cmd-"+r);var o=!1;return X(e,"shiftKey")?i=l("Shift-"+r,s.extraKeys,s.keyMap,function(e){return Sn(e,!0)},u)||l(r,s.extraKeys,s.keyMap,function(e){if(typeof e=="string"&&/^go[A-Z]/.test(e))return Sn(e)},u):i=l(r,s.extraKeys,s.keyMap,Sn,u),o&&(i=!1),i&&(q(e),ei(),p&&(e.oldKeyCode=e.keyCode,e.keyCode=0)),i}function Nn(e,t){var n=l("'"+t+"'",s.extraKeys,s.keyMap,function(e){return Sn(e,!0)});return n&&(q(e),ei()),n}function kn(e){Mt||On(),p&&e.keyCode==27&&(e.returnValue=!1),rn&&Jn()&&(rn=!1);if(s.onKeyEvent&&s.onKeyEvent(cn,I(e)))return;var t=X(e,"keyCode");ur(t==16||X(e,"shiftKey"));var r=Tn(e);b&&(Cn=r?t:null,!r&&t==88&&X(e,n?"metaKey":"ctrlKey")&&Rn(""))}function Ln(e){rn&&Jn();if(s.onKeyEvent&&s.onKeyEvent(cn,I(e)))return;var t=X(e,"keyCode"),n=X(e,"charCode");if(b&&t==Cn){Cn=null,q(e);return}if((b&&(!e.which||e.which<10)||E)&&Tn(e))return;var r=String.fromCharCode(n==null?t:n);s.electricChars&&Lt.electricChars&&s.smartIndent&&!s.readOnly&&Lt.electricChars.indexOf(r)>-1&&setTimeout(ci(function(){Er(_t.to.line,"smart")}),75);if(Nn(e,r))return;Vn()}function An(e){if(s.onKeyEvent&&s.onKeyEvent(cn,I(e)))return;X(e,"keyCode")==16&&(Dt=null)}function On(){if(s.readOnly=="nocursor")return;Mt||(s.onFocus&&s.onFocus(cn),Mt=!0,St.className.search(/\bCodeMirror-focused\b/)==-1&&(St.className+=" CodeMirror-focused"),Xt||Kn(!0)),Xn(),ei()}function Mn(){Mt&&(s.onBlur&&s.onBlur(cn),Mt=!1,Yt&&ci(function(){Yt&&(Yt(),Yt=null)})(),St.className=St.className.replace(" CodeMirror-focused","")),clearInterval(kt),setTimeout(function(){Mt||(Dt=null)},150)}function _n(e,t,n,r,i){if(It)return;if(on){var o=[];At.iter(e.line,t.line+1,function(e){o.push(e.text)}),on.addChange(e.line,n.length,o);while(on.done.length>s.undoDepth)on.done.shift()}Bn(e,t,n,r,i)}function Dn(e,t){if(!e.length)return;var n=e.pop(),r=[];for(var i=n.length-1;i>=0;i-=1){var s=n[i],o=[],u=s.start+s.added;At.iter(s.start,u,function(e){o.push(e.text)}),r.push({start:s.start,added:s.old.length,old:o});var a={line:s.start+s.old.length-1,ch:ft(o[o.length-1],s.old[s.old.length-1])};Bn({line:s.start,ch:0},{line:u-1,ch:hn(u-1).text.length},s.old,a,a)}qt=!0,t.push(r)}function Pn(){Dn(on.done,on.undone)}function Hn(){Dn(on.undone,on.done)}function Bn(e,t,n,r,i){function x(e){return e<=Math.min(t.line,t.line+g)?e:e+g}if(It)return;var o=!1,u=Zt.text.length;s.lineWrapping||At.iter(e.line,t.line+1,function(e){if(!e.hidden&&e.text.length==u)return o=!0,!0});if(e.line!=t.line||n.length>1)Vt=!0;var a=t.line-e.line,f=hn(e.line),l=hn(t.line);if(e.ch==0&&t.ch==0&&n[n.length-1]==""){var c=[],h=null;e.line?(h=hn(e.line-1),h.fixMarkEnds(l)):l.fixMarkStarts();for(var p=0,d=n.length-1;p<d;++p)c.push(A.inheritMarks(n[p],h));a&&At.remove(e.line,a,$t),c.length&&At.insert(e.line,c)}else if(f==l)if(n.length==1)f.replace(e.ch,t.ch,n[0]);else{l=f.split(t.ch,n[n.length-1]),f.replace(e.ch,null,n[0]),f.fixMarkEnds(l);var c=[];for(var p=1,d=n.length-1;p<d;++p)c.push(A.inheritMarks(n[p],f));c.push(l),At.insert(e.line+1,c)}else if(n.length==1)f.replace(e.ch,null,n[0]),l.replace(null,t.ch,""),f.append(l),At.remove(e.line+1,a,$t);else{var c=[];f.replace(e.ch,null,n[0]),l.replace(null,t.ch,n[n.length-1]),f.fixMarkEnds(l);for(var p=1,d=n.length-1;p<d;++p)c.push(A.inheritMarks(n[p],f));a>1&&At.remove(e.line+1,a-1,$t),At.insert(e.line+1,c)}if(s.lineWrapping){var v=Math.max(5,St.clientWidth/Kr()-3);At.iter(e.line,e.line+n.length,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/v)||1;t!=e.height&&pn(e,t)})}else At.iter(e.line,e.line+n.length,function(e){var t=e.text;!e.hidden&&t.length>u&&(Zt=e,u=t.length,tn=!0,o=!1)}),o&&(en=!0);var m=[],g=n.length-a-1;for(var p=0,y=Ot.length;p<y;++p){var b=Ot[p];b<e.line?m.push(b):b>t.line&&m.push(b+g)}var w=e.line+Math.min(n.length,500);si(e.line,w),m.push(w),Ot=m,ui(100),Ut.push({from:e.line,to:t.line+1,diff:g});var E={from:e,to:t,text:n};if(zt){for(var S=zt;S.next;S=S.next);S.next=E}else zt=E;fr(pr(r),pr(i),x(_t.from.line),x(_t.to.line))}function jn(){var e=At.height*Vr()+2*Qr();return e*.99>St.offsetHeight?e:!1}function Fn(e){var t=jn();R.style.display=t?"block":"none",t?(F.style.height=Et.style.minHeight=t+"px",R.style.height=St.clientHeight+"px",e!=null&&(R.scrollTop=St.scrollTop=e,g&&setTimeout(function(){if(R.scrollTop!=e)return;R.scrollTop=e+(e?-1:1),R.scrollTop=e},0))):Et.style.minHeight="",wt.style.top=Jt*Vr()+"px"}function In(){Zt=hn(0),tn=!0;var e=Zt.text.length;At.iter(1,At.size,function(t){var n=t.text;!t.hidden&&n.length>e&&(e=n.length,Zt=t)}),en=!1}function qn(e,t,n){function r(r){if(rt(r,t))return r;if(!rt(n,r))return i;var s=r.line+e.length-(n.line-t.line)-1,o=r.ch;return r.line==n.line&&(o+=e[e.length-1].length-(n.ch-(n.line==t.line?t.ch:0))),{line:s,ch:o}}t=pr(t),n?n=pr(n):n=t,e=ht(e);var i;return Un(e,t,n,function(e){return i=e,{from:r(_t.from),to:r(_t.to)}}),i}function Rn(e,t){Un(ht(e),_t.from,_t.to,function(e){return t=="end"?{from:e,to:e}:t=="start"?{from:_t.from,to:_t.from}:{from:_t.from,to:e}})}function Un(e,t,n,r){var i=e.length==1?e[0].length+t.ch:e[e.length-1].length,s=r({line:t.line+e.length-1,ch:i});_n(t,n,e,s.from,s.to)}function zn(e,t,n){var r=e.line,i=t.line;if(r==i)return hn(r).text.slice(e.ch,t.ch);var s=[hn(r).text.slice(e.ch)];return At.iter(r+1,i,function(e){s.push(e.text)}),s.push(hn(i).text.slice(0,t.ch)),s.join(n||"\n")}function Wn(e){return zn(_t.from,_t.to,e)}function Xn(){if(rn)return;Nt.set(s.pollInterval,function(){ai(),Jn(),Mt&&Xn(),fi()})}function Vn(){function t(){ai();var n=Jn();!n&&!e?(e=!0,Nt.set(60,t)):(rn=!1,Xn()),fi()}var e=!1;rn=!0,Nt.set(20,t)}function Jn(){if(Xt||!Mt||pt(L)||s.readOnly)return!1;var e=L.value;if(e==$n)return!1;Dt=null;var t=0,n=Math.min($n.length,e.length);while(t<n&&$n[t]==e[t])++t;return t<$n.length?_t.from={line:_t.from.line,ch:_t.from.ch-($n.length-t)}:Ft&&nt(_t.from,_t.to)&&(_t.to={line:_t.to.line,ch:Math.min(hn(_t.to.line).text.length,_t.to.ch+(e.length-t))}),Rn(e.slice(t),"end"),e.length>1e3?L.value=$n="":$n=e,!0}function Kn(e){nt(_t.from,_t.to)?e&&($n=L.value=""):($n="",L.value=Wn(),Mt&&tt(L))}function Qn(){s.readOnly!="nocursor"&&L.focus()}function Gn(){var e=Yn();Zn(e.x,e.y,e.x,e.yBot);if(!Mt)return;var t=Et.getBoundingClientRect(),n=null;e.y+t.top<0?n=!0:e.y+t.top+Vr()>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1);if(n!=null){var r=at.style.display=="none";r&&(at.style.display="",at.style.left=e.x+"px",at.style.top=e.y-Jt+"px"),at.scrollIntoView(n),r&&(at.style.display="none")}}function Yn(){var e=qr(_t.inverted?_t.from:_t.to),t=s.lineWrapping?Math.min(e.x,gt.offsetWidth):e.x;return{x:t,y:e.y,yBot:e.yBot}}function Zn(e,t,n,r){var i=er(e,t,n,r);i.scrollLeft!=null&&(St.scrollLeft=i.scrollLeft),i.scrollTop!=null&&(R.scrollTop=St.scrollTop=i.scrollTop)}function er(e,t,n,r){var i=Gr(),o=Qr();t+=o,r+=o,e+=i,n+=i;var u=St.clientHeight,a=R.scrollTop,f={},l=jn()||Infinity,c=t<o+10,h=r+o>l-10;t<a?f.scrollTop=c?0:Math.max(0,t):r>a+u&&(f.scrollTop=(h?l:r)-u);var p=St.clientWidth,d=St.scrollLeft,v=s.fixedGutter?bt.clientWidth:0,m=e<v+i+10;return e<d+v||m?(m&&(e=0),f.scrollLeft=Math.max(0,e-10-v)):n>p+d-3&&(f.scrollLeft=n+10-p),f}function tr(e){var t=Vr(),n=(e!=null?e:R.scrollTop)-Qr(),r=Math.max(0,Math.floor(n/t)),i=Math.ceil((n+St.clientHeight)/t);return{from:H(At,r),to:H(At,i)}}function nr(e,t,n){function d(){var e=Q.firstChild,t=!1;return At.iter(Kt,Qt,function(n){if(!e)return;if(!n.hidden){var r=Math.round(e.offsetHeight/c)||1;n.height!=r&&(pn(n,r),Vt=t=!0)}e=e.nextSibling}),t}if(!St.clientWidth){Kt=Qt=Jt=0;return}var r=tr(n);if(e!==!0&&e.length==0&&r.from>Kt&&r.to<Qt){Fn(n);return}var i=Math.max(r.from-100,0),o=Math.min(At.size,r.to+100);Kt<i&&i-Kt<20&&(i=Kt),Qt>o&&Qt-o<20&&(o=Math.min(At.size,Qt));var u=e===!0?[]:rr([{from:Kt,to:Qt,domStart:0}],e),a=0;for(var f=0;f<u.length;++f){var l=u[f];l.from<i&&(l.domStart+=i-l.from,l.from=i),l.to>o&&(l.to=o),l.from>=l.to?u.splice(f--,1):a+=l.to-l.from}if(a==o-i&&i==Kt&&o==Qt){Fn(n);return}u.sort(function(e,t){return e.domStart-t.domStart});var c=Vr(),h=bt.style.display;Q.style.display="none",ir(i,o,u),Q.style.display=bt.style.display="";var p=i!=Kt||o!=Qt||Gt!=St.clientHeight+c;p&&(Gt=St.clientHeight+c),(i!=Kt||o!=Qt&&s.onViewportChange)&&setTimeout(function(){s.onViewportChange&&s.onViewportChange(cn,i,o)}),Kt=i,Qt=o,Jt=B(At,i);if(Q.childNodes.length!=Qt-Kt)throw new Error("BAD PATCH! "+JSON.stringify(u)+" size="+(Qt-Kt)+" nodes="+Q.childNodes.length);return s.lineWrapping&&d(),bt.style.display=h,(p||Vt)&&sr()&&s.lineWrapping&&d()&&sr(),Fn(n),or(),!t&&s.onUpdate&&s.onUpdate(cn),!0}function rr(e,t){for(var n=0,r=t.length||0;n<r;++n){var i=t[n],s=[],o=i.diff||0;for(var u=0,a=e.length;u<a;++u){var f=e[u];i.to<=f.from&&i.diff?s.push({from:f.from+o,to:f.to+o,domStart:f.domStart}):i.to<=f.from||i.from>=f.to?s.push(f):(i.from>f.from&&s.push({from:f.from,to:i.from,domStart:f.domStart}),i.to<f.to&&s.push({from:i.to+o,to:f.to+o,domStart:f.domStart+(i.to-f.from)}))}e=s}return e}function ir(e,t,n){function r(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}if(!n.length)ot(Q);else{var i=0,s=Q.firstChild,o;for(var u=0;u<n.length;++u){var a=n[u];while(a.domStart>i)s=r(s),i++;for(var f=0,l=a.to-a.from;f<l;++f)s=s.nextSibling,i++}while(s)s=r(s)}var c=n.shift(),s=Q.firstChild,f=e;At.iter(e,t,function(e){c&&c.to==f&&(c=n.shift());if(!c||c.from>f){if(e.hidden)var t=st("pre");else{var t=e.getElement(Nr);e.className&&(t.className=e.className);if(e.bgClassName){var r=st("pre"," ",e.bgClassName,"position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2");t=st("div",[r,t],null,"position: relative")}}Q.insertBefore(t,s)}else s=s.nextSibling;++f})}function sr(){if(!s.gutter&&!s.lineNumbers)return;var e=wt.offsetHeight,t=St.clientHeight;bt.style.height=(e-t<2?t:e)+"px";var n=document.createDocumentFragment(),r=Kt,i;At.iter(Kt,Math.max(Qt,Kt+1),function(e){if(e.hidden)n.appendChild(st("pre"));else{var t=e.gutterMarker,o=s.lineNumbers?s.lineNumberFormatter(r+s.firstLineNumber):null;t&&t.text?o=t.text.replace("%N%",o!=null?o:""):o==null&&(o=" ");var u=n.appendChild(st("pre",null,t&&t.style));u.innerHTML=o;for(var a=1;a<e.height;++a)u.appendChild(st("br")),u.appendChild(document.createTextNode(" "));t||(i=r)}++r}),bt.style.display="none",ut(yt,n);if(i!=null&&s.lineNumbers){var o=yt.childNodes[i-Kt],u=String(At.size).length,a=et(o.firstChild),f="";while(a.length+f.length<u)f+=" ";f&&o.insertBefore(document.createTextNode(f),o.firstChild)}bt.style.display="";var l=Math.abs((parseInt(gt.style.marginLeft)||0)-bt.offsetWidth)>2;return gt.style.marginLeft=bt.offsetWidth+"px",Vt=!1,l}function or(){var e=nt(_t.from,_t.to),t=qr(_t.from,!0),n=e?t:qr(_t.to,!0),r=_t.inverted?t:n,i=Vr(),o=Z(xt),u=Z(Q);O.style.top=Math.max(0,Math.min(St.offsetHeight,r.y+u.top-o.top))+"px",O.style.left=Math.max(0,Math.min(St.offsetWidth,r.x+u.left-o.left))+"px";if(e)at.style.top=r.y+"px",at.style.left=(s.lineWrapping?Math.min(r.x,gt.offsetWidth):r.x)+"px",at.style.display="",Y.style.display="none";else{var a=t.y==n.y,f=document.createDocumentFragment(),l=gt.clientWidth||gt.offsetWidth,c=gt.clientHeight||gt.offsetHeight,h=function(e,t,n,r){var i=m?"width: "+(n?l-n-e:l)+"px":"right: "+n+"px";f.appendChild(st("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; "+i+"; height: "+r+"px"))};if(_t.from.ch&&t.y>=0){var p=a?l-n.x:0;h(t.x,t.y,p,i)}var d=Math.max(0,t.y+(_t.from.ch?i:0)),v=Math.min(n.y,c)-d;v>.2*i&&h(0,d,0,v),(!a||!_t.from.ch)&&n.y<c-.5*i&&h(0,n.y,l-n.x,i),ut(Y,f),at.style.display="none",Y.style.display=""}}function ur(e){e?Dt=Dt||(_t.inverted?_t.to:_t.from):Dt=null}function ar(e,t){var n=Dt&&pr(Dt);n&&(rt(n,e)?e=n:rt(t,n)&&(t=n)),fr(e,t),Rt=!0}function fr(e,t,n,r){sn=null,n==null&&(n=_t.from.line,r=_t.to.line);if(nt(_t.from,e)&&nt(_t.to,t))return;if(rt(t,e)){var i=t;t=e,e=i}if(e.line!=n){var o=lr(e,n,_t.from.ch);o?e=o:Br(e.line,!1)}t.line!=r&&(t=lr(t,r,_t.to.ch)),nt(e,t)?_t.inverted=!1:nt(e,_t.to)?_t.inverted=!1:nt(t,_t.from)&&(_t.inverted=!0);if(s.autoClearEmptyLines&&nt(_t.from,_t.to)){var u=_t.inverted?e:t;if(u.line!=_t.from.line&&_t.from.line<At.size){var a=hn(_t.from.line);/^\s+$/.test(a.text)&&setTimeout(ci(function(){if(a.parent&&/^\s+$/.test(a.text)){var e=P(a);qn("",{line:e,ch:0},{line:e,ch:a.text.length})}},10))}}_t.from=e,_t.to=t,Wt=!0}function lr(e,t,n){function r(t){var r=e.line+t,i=t==1?At.size:-1;while(r!=i){var o=hn(r);if(!o.hidden){var u=e.ch;if(s||u>n||u>o.text.length)u=o.text.length;return{line:r,ch:u}}r+=t}}var i=hn(e.line),s=e.ch==i.text.length&&e.ch!=n;return i.hidden?e.line>=t?r(1)||r(-1):r(-1)||r(1):e}function cr(e,t,n){var r=pr({line:e,ch:t||0});(n?ar:fr)(r,r)}function hr(e){return Math.max(0,Math.min(e,At.size-1))}function pr(e){if(e.line<0)return{line:0,ch:0};if(e.line>=At.size)return{line:At.size-1,ch:hn(At.size-1).text.length};var t=e.ch,n=hn(e.line).text.length;return t==null||t>n?{line:e.line,ch:n}:t<0?{line:e.line,ch:0}:e}function dr(e,t){function o(){for(var t=r+e,n=e<0?-1:At.size;t!=n;t+=e){var i=hn(t);if(!i.hidden)return r=t,s=i,!0}}function u(t){if(i==(e<0?0:s.text.length)){if(!!t||!o())return!1;i=e<0?s.text.length:0}else i+=e;return!0}var n=_t.inverted?_t.from:_t.to,r=n.line,i=n.ch,s=hn(r);if(t=="char")u();else if(t=="column")u(!0);else if(t=="word"){var a=!1;for(;;){if(e<0&&!u())break;if(ct(s.text.charAt(i)))a=!0;else if(a){e<0&&(e=1,u());break}if(e>0&&!u())break}}return{line:r,ch:i}}function vr(e,t){var n=e<0?_t.from:_t.to;if(Dt||nt(_t.from,_t.to))n=dr(e,t);cr(n.line,n.ch,!0)}function mr(e,t){nt(_t.from,_t.to)?e<0?qn("",dr(e,t),_t.to):qn("",_t.from,dr(e,t)):qn("",_t.from,_t.to),Rt=!0}function gr(e,t){var n=0,r=qr(_t.inverted?_t.from:_t.to,!0);sn!=null&&(r.x=sn);if(t=="page")var i=Math.min(St.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Rr(r.x,r.y+i*e);else if(t=="line")var o=Vr(),s=Rr(r.x,r.y+.5*o+e*o);t=="page"&&(R.scrollTop+=qr(s,!0).y-r.y),cr(s.line,s.ch,!0),sn=r.x}function yr(e){var t=hn(e.line).text,n=e.ch,r=e.ch;if(t){e.after===!1||r==t.length?--n:++r;var i=t.charAt(n),s=ct(i)?ct:/\s/.test(i)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ct(e)};while(n>0&&s(t.charAt(n-1)))--n;while(r<t.length&&s(t.charAt(r)))++r}return{from:{line:e.line,ch:n},to:{line:e.line,ch:r}}}function br(e){ar({line:e,ch:0},pr({line:e+1,ch:0}))}function wr(e){if(nt(_t.from,_t.to))return Er(_t.from.line,e);var t=_t.to.line-(_t.to.ch?0:1);for(var n=_t.from.line;n<=t;++n)Er(n,e)}function Er(e,t){t||(t="add");if(t=="smart")if(!Lt.indent)t="prev";else var n=ii(e);var r=hn(e),i=r.indentation(s.tabSize),o=r.text.match(/^\s*/)[0],u;t=="smart"&&(u=Lt.indent(n,r.text.slice(o.length),r.text),u==J&&(t="prev")),t=="prev"?e?u=hn(e-1).indentation(s.tabSize):u=0:t=="add"?u=i+s.indentUnit:t=="subtract"&&(u=i-s.indentUnit),u=Math.max(0,u);var a=u-i,f="",l=0;if(s.indentWithTabs)for(var c=Math.floor(u/s.tabSize);c;--c)l+=s.tabSize,f+=" ";while(l<u)++l,f+=" ";f!=o&&qn(f,{line:e,ch:0},{line:e,ch:o.length})}function Sr(){Lt=e.getMode(s,s.mode),At.iter(0,At.size,function(e){e.stateAfter=null}),Ot=[0],ui()}function xr(){var e=s.gutter||s.lineNumbers;bt.style.display=e?"":"none",e?Vt=!0:Q.parentNode.style.marginLeft=0}function Tr(e,t){if(s.lineWrapping){xt.className+=" CodeMirror-wrap";var n=St.clientWidth/Kr()-3;At.iter(0,At.size,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/n)||1;t!=1&&pn(e,t)}),gt.style.minWidth=vt.style.left=""}else xt.className=xt.className.replace(" CodeMirror-wrap",""),In(),At.iter(0,At.size,function(e){e.height!=1&&!e.hidden&&pn(e,1)});Ut.push({from:0,to:At.size})}function Nr(e){var t=s.tabSize-e%s.tabSize,n=nn[t];if(n)return n;for(var r="",i=0;i<t;++i)r+=" ";var o=st("span",r,"cm-tab");return nn[t]={element:o,width:t}}function Cr(){St.className=St.className.replace(/\s*cm-s-\S+/g,"")+s.theme.replace(/(^|\s)\s*/g," cm-s-")}function kr(){var e=a[s.keyMap].style;xt.className=xt.className.replace(/\s*cm-keymap-\S+/g,"")+(e?" cm-keymap-"+e:"")}function Lr(){this.set=[]}function Ar(e,t,n){function i(e,t,n,i){hn(e).addMark(new C(t,n,i,r))}e=pr(e),t=pr(t);var r=new Lr;if(!rt(e,t))return r;if(e.line==t.line)i(e.line,e.ch,t.ch,n);else{i(e.line,e.ch,null,n);for(var s=e.line+1,o=t.line;s<o;++s)i(s,null,null,n);i(t.line,null,t.ch,n)}return Ut.push({from:e.line,to:t.line+1}),r}function Or(e){e=pr(e);var t=new k(e.ch);return hn(e.line).addMark(t),t}function Mr(e){e=pr(e);var t=[],n=hn(e.line).marked;if(!n)return t;for(var r=0,i=n.length;r<i;++r){var s=n[r];(s.from==null||s.from<=e.ch)&&(s.to==null||s.to>=e.ch)&&t.push(s.marker||s)}return t}function _r(e,t,n){return typeof e=="number"&&(e=hn(hr(e))),e.gutterMarker={text:t,style:n},Vt=!0,e}function Dr(e){typeof e=="number"&&(e=hn(hr(e))),e.gutterMarker=null,Vt=!0}function Pr(e,t){var n=e,r=e;return typeof e=="number"?r=hn(hr(e)):n=P(e),n==null?null:t(r,n)?(Ut.push({from:n,to:n+1}),r):null}function Hr(e,t,n){return Pr(e,function(e){if(e.className!=t||e.bgClassName!=n)return e.className=t,e.bgClassName=n,!0})}function Br(e,t){return Pr(e,function(e,n){if(e.hidden!=t){e.hidden=t,s.lineWrapping||(t&&e.text.length==Zt.text.length?en=!0:!t&&e.text.length>Zt.text.length&&(Zt=e,en=!1)),pn(e,t?0:1);var r=_t.from.line,i=_t.to.line;if(t&&(r==n||i==n)){var o=r==n?lr({line:r,ch:0},r,0):_t.from,u=i==n?lr({line:i,ch:0},i,0):_t.to;if(!u)return;fr(o,u)}return Vt=!0}})}function jr(e){if(typeof e=="number"){if(!ln(e))return null;var t=e;e=hn(e);if(!e)return null}else{var t=P(e);if(t==null)return null}var n=e.gutterMarker;return{line:t,handle:e,text:e.text,markerText:n&&n.text,markerClass:n&&n.style,lineClass:e.className,bgClass:e.bgClassName}}function Fr(e,t){function i(e){return Ir(n,e).left}if(t<=0)return 0;var n=hn(e),r=n.text,s=0,o=0,u=r.length,a,f=Math.min(u,Math.ceil(t/Kr()));for(;;){var l=i(f);if(!(l<=t&&f<u)){a=l,u=f;break}f=Math.min(u,Math.ceil(f*1.2))}if(t>a)return u;f=Math.floor(u*.8),l=i(f),l<t&&(s=f,o=l);for(;;){if(u-s<=1)return a-t>t-o?s:u;var c=Math.ceil((s+u)/2),h=i(c);h>t?(u=c,a=h):(s=c,o=h)}}function Ir(e,t){if(t==0)return{top:0,left:0};var n=s.lineWrapping&&t<e.text.length&&G.test(e.text.slice(t-1,t+1)),r=e.getElement(Nr,t,n);ut(mt,r);var i=r.anchor,o=i.offsetTop,u=i.offsetLeft;if(p&&o==0&&u==0){var a=st("span","x");i.parentNode.insertBefore(a,i.nextSibling),o=a.offsetTop}return{top:o,left:u}}function qr(e,t){var n,r=Vr(),i=r*(B(At,e.line)-(t?Jt:0));if(e.ch==0)n=0;else{var o=Ir(hn(e.line),e.ch);n=o.left,s.lineWrapping&&(i+=Math.max(0,o.top))}return{x:n,y:i,yBot:i+r}}function Rr(e,t){function h(e){var t=Ir(u,e);if(f){var r=Math.round(t.top/n);return c=r!=l,Math.max(0,t.left+(r-l)*St.clientWidth)}return t.left}var n=Vr(),r=Kr(),i=Jt+Math.floor(t/n);if(i<0)return{line:0,ch:0};var o=H(At,i);if(o>=At.size)return{line:At.size-1,ch:hn(At.size-1).text.length};var u=hn(o),a=u.text,f=s.lineWrapping,l=f?i-B(At,o):0;if(e<=0&&l==0)return{line:o,ch:0};var c=!1,p=0,d=0,v=a.length,m,g=Math.min(v,Math.ceil((e+l*St.clientWidth*.9)/r));for(;;){var y=h(g);if(!(y<=e&&g<v)){m=y,v=g;break}g=Math.min(v,Math.ceil(g*1.2))}if(e>m)return{line:o,ch:v};g=Math.floor(v*.8),y=h(g),y<e&&(p=g,d=y);for(;;){if(v-p<=1){var b=e-d<m-e;return{line:o,ch:b?p:v,after:b}}var w=Math.ceil((p+v)/2),E=h(w);E>e?(v=w,m=E,c&&(m+=1e3)):(p=w,d=E)}}function Ur(e){var t=qr(e,!0),n=Z(gt);return{x:n.left+t.x,y:n.top+t.y,yBot:n.top+t.yBot}}function Vr(){if(Xr==null){Xr=st("pre");for(var e=0;e<49;++e)Xr.appendChild(document.createTextNode("x")),Xr.appendChild(st("br"));Xr.appendChild(document.createTextNode("x"))}var t=Q.clientHeight;return t==Wr?zr:(Wr=t,ut(mt,Xr.cloneNode(!0)),zr=mt.firstChild.offsetHeight/50||1,ot(mt),zr)}function Kr(){if(St.clientWidth==Jr)return $r;Jr=St.clientWidth;var e=st("span","x"),t=st("pre",[e]);return ut(mt,t),$r=e.offsetWidth||10}function Qr(){return gt.offsetTop}function Gr(){return gt.offsetLeft}function Yr(e,t){var n=Z(St,!0),r,i;try{r=e.clientX,i=e.clientY}catch(e){return null}if(!t&&(r-n.left>St.clientWidth||i-n.top>St.clientHeight))return null
806
806
  ;var s=Z(gt,!0);return Rr(r-s.left,i-s.top)}function Zr(e){function o(){var e=ht(L.value).join("\n");e!=i&&!s.readOnly&&ci(Rn)(e,"end"),O.style.position="relative",L.style.cssText=r,v&&(R.scrollTop=n),Xt=!1,Kn(!0),Xn()}var t=Yr(e),n=R.scrollTop;if(!t||b)return;(nt(_t.from,_t.to)||rt(t,_t.from)||!rt(t,_t.to))&&ci(cr)(t.line,t.ch);var r=L.style.cssText;O.style.position="absolute",L.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Xt=!0;var i=L.value=Wn();Qn(),tt(L);if(h){U(e);var u=V(window,"mouseup",function(){u(),setTimeout(o,20)},!0)}else setTimeout(o,50)}function ei(){clearInterval(kt);var e=!0;at.style.visibility="",kt=setInterval(function(){at.style.visibility=(e=!e)?"":"hidden"},s.cursorBlinkRate)}function ni(e){function v(e,t,n){if(!e.text)return;var r=e.styles,i=o?0:e.text.length-1,s;for(var a=o?0:r.length-2,f=o?r.length:-2;a!=f;a+=2*u){var l=r[a];if(r[a+1]!=h){i+=u*l.length;continue}for(var c=o?0:l.length-1,v=o?l.length:-1;c!=v;c+=u,i+=u)if(i>=t&&i<n&&d.test(s=l.charAt(c))){var m=ti[s];if(m.charAt(1)==">"==o)p.push(s);else{if(p.pop()!=m.charAt(0))return{pos:i,match:!1};if(!p.length)return{pos:i,match:!0}}}}}var t=_t.inverted?_t.from:_t.to,n=hn(t.line),r=t.ch-1,i=r>=0&&ti[n.text.charAt(r)]||ti[n.text.charAt(++r)];if(!i)return;var s=i.charAt(0),o=i.charAt(1)==">",u=o?1:-1,a=n.styles;for(var f=r+1,l=0,c=a.length;l<c;l+=2)if((f-=a[l].length)<=0){var h=a[l+1];break}var p=[n.text.charAt(r)],d=/[(){}[\]]/;for(var l=t.line,c=o?Math.min(l+100,At.size):Math.max(-1,l-100);l!=c;l+=u){var n=hn(l),m=l==t.line,g=v(n,m&&o?r+1:0,m&&!o?r:n.text.length);if(g)break}g||(g={pos:null,match:!1});var h=g.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",y=Ar({line:t.line,ch:r},{line:t.line,ch:r+1},h),b=g.pos!=null&&Ar({line:l,ch:g.pos},{line:l,ch:g.pos+1},h),w=ci(function(){y.clear(),b&&b.clear()});e?setTimeout(w,800):Yt=w}function ri(e){var t,n;for(var r=e,i=e-40;r>i;--r){if(r==0)return 0;var o=hn(r-1);if(o.stateAfter)return r;var u=o.indentation(s.tabSize);if(n==null||t>u)n=r-1,t=u}return n}function ii(e){var t=ri(e),n=t&&hn(t-1).stateAfter;return n?n=x(Lt,n):n=T(Lt),At.iter(t,e,function(e){e.highlight(Lt,n,s.tabSize),e.stateAfter=x(Lt,n)}),t<e&&Ut.push({from:t,to:e}),e<At.size&&!hn(e).stateAfter&&Ot.push(e),n}function si(e,t){var n=ii(e);At.iter(e,t,function(e){e.highlight(Lt,n,s.tabSize),e.stateAfter=x(Lt,n)})}function oi(){var e=+(new Date)+s.workTime,t=Ot.length;while(Ot.length){if(!hn(Kt).stateAfter)var n=Kt;else var n=Ot.pop();if(n>=At.size)continue;var r=ri(n),i=r&&hn(r-1).stateAfter;i?i=x(Lt,i):i=T(Lt);var o=0,u=Lt.compareStates,a=!1,f=r,l=!1;At.iter(f,At.size,function(t){var r=t.stateAfter;if(+(new Date)>e)return Ot.push(f),ui(s.workDelay),a&&Ut.push({from:n,to:f+1}),l=!0;var c=t.highlight(Lt,i,s.tabSize);c&&(a=!0),t.stateAfter=x(Lt,i);var h=null;if(u){var p=r&&u(r,i);p!=J&&(h=!!p)}h==null&&(c!==!1||!r?o=0:++o>3&&(!Lt.indent||Lt.indent(r,"")==Lt.indent(i,""))&&(h=!0));if(h)return!0;++f});if(l)return;a&&Ut.push({from:n,to:f+1})}t&&s.onHighlightComplete&&s.onHighlightComplete(cn)}function ui(e){if(!Ot.length)return;Ct.set(e,ci(oi))}function ai(){qt=Rt=zt=null,Ut=[],Wt=!1,$t=[]}function fi(){en&&In();if(tn&&!s.lineWrapping){var e=vt.offsetWidth,t=Ir(Zt,Zt.text.length).left;d||(vt.style.left=t+"px",gt.style.minWidth=t+e+"px"),tn=!1}var n,r;if(Wt){var i=Yn();n=er(i.x,i.y,i.x,i.yBot)}if(Ut.length||n&&n.scrollTop!=null)r=nr(Ut,!0,n&&n.scrollTop);r||(Wt&&or(),Vt&&sr()),n&&Gn(),Wt&&ei(),Mt&&!Xt&&(qt===!0||qt!==!1&&Wt)&&Kn(Rt),Wt&&s.matchBrackets&&setTimeout(ci(function(){Yt&&(Yt(),Yt=null),nt(_t.from,_t.to)&&ni(!1)}),20);var o=Wt,u=$t;zt&&s.onChange&&cn&&s.onChange(cn,zt),o&&s.onCursorActivity&&s.onCursorActivity(cn);for(var a=0;a<u.length;++a)u[a](cn);r&&s.onUpdate&&s.onUpdate(cn)}function ci(e){return function(){li++||ai();try{var t=e.apply(this,arguments)}finally{--li||fi()}return t}}function hi(e){on.startCompound();try{return e()}finally{on.endCompound()}}var s={},w=e.defaults;for(var N in w)w.hasOwnProperty(N)&&(s[N]=(i&&i.hasOwnProperty(N)?i:w)[N]);var L=st("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em");L.setAttribute("wrap","off"),L.setAttribute("autocorrect","off"),L.setAttribute("autocapitalize","off");var O=st("div",[L],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),F=st("div",null,"CodeMirror-scrollbar-inner"),R=st("div",[F],"CodeMirror-scrollbar"),Q=st("div"),Y=st("div",null,null,"position: relative; z-index: -1"),at=st("pre"," ","CodeMirror-cursor"),vt=st("pre"," ","CodeMirror-cursor","visibility: hidden"),mt=st("div",null,null,"position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden;"),gt=st("div",[mt,at,vt,Y,Q],null,"position: relative; z-index: 0"),yt=st("div",null,"CodeMirror-gutter-text"),bt=st("div",[yt],"CodeMirror-gutter"),wt=st("div",[bt,st("div",[gt],"CodeMirror-lines")],null,"position: relative"),Et=st("div",[wt],null,"position: relative"),St=st("div",[Et],"CodeMirror-scroll");St.setAttribute("tabIndex","-1");var xt=st("div",[O,R,St],"CodeMirror"+(s.lineWrapping?" CodeMirror-wrap":""));r.appendChild?r.appendChild(xt):r(xt),Cr(),kr(),t&&(L.style.width="0px"),g||(St.draggable=!0),gt.style.outline="none",s.tabindex!=null&&(L.tabIndex=s.tabindex),s.autofocus&&Qn(),!s.gutter&&!s.lineNumbers&&(bt.style.display="none"),E&&(O.style.height="1px",O.style.position="absolute"),S?(R.style.zIndex=-2,R.style.visibility="hidden"):d&&(R.style.minWidth="18px");try{Kr()}catch(Tt){throw Tt.message.match(/runtime/i)&&(Tt=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),Tt}var Nt=new $,Ct=new $,kt,Lt,At=new _([new M([new A("")])]),Ot,Mt;Sr();var _t={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},Dt,Pt,Ht,Bt=0,jt,Ft=!1,It=!1,qt,Rt,Ut,zt,Wt,Xt,Vt,$t,Jt=0,Kt=0,Qt=0,Gt=0,Yt,Zt=hn(0),en=!1,tn=!0,nn={},rn=!1,sn=null;ci(function(){dn(s.value||""),qt=!1})();var on=new j;V(St,"mousedown",ci(yn)),V(St,"dblclick",ci(bn)),V(gt,"selectstart",q),h||V(St,"contextmenu",Zr),V(St,"scroll",gn),V(R,"scroll",mn),V(R,"mousedown",function(){Mt&&setTimeout(Qn,0)});var un=V(window,"resize",function(){xt.parentNode?nr(!0):un()},!0);V(L,"keyup",ci(An)),V(L,"input",Vn),V(L,"keydown",ci(kn)),V(L,"keypress",ci(Ln)),V(L,"focus",On),V(L,"blur",Mn),s.dragDrop&&(V(St,"dragstart",En),V(St,"dragenter",an),V(St,"dragover",an),V(St,"drop",ci(wn))),V(St,"paste",function(){Qn(),Vn()}),V(L,"paste",Vn),V(L,"cut",ci(function(){s.readOnly||Rn("")})),E&&V(Et,"mouseup",function(){document.activeElement==L&&L.blur(),Qn()});var fn;try{fn=document.activeElement==L}catch(Tt){}fn||s.autofocus?setTimeout(On,20):Mn();var cn=xt.CodeMirror={getValue:vn,setValue:ci(dn),getSelection:Wn,replaceSelection:ci(Rn),focus:function(){window.focus(),Qn(),On(),Vn()},setOption:function(e,t){var n=s[e];s[e]=t,e=="mode"||e=="indentUnit"?Sr():e=="readOnly"&&t=="nocursor"?(Mn(),L.blur()):e=="readOnly"&&!t?Kn(!0):e=="theme"?Cr():e=="lineWrapping"&&n!=t?ci(Tr)():e=="tabSize"?nr(!0):e=="keyMap"&&kr();if(e=="lineNumbers"||e=="gutter"||e=="firstLineNumber"||e=="theme"||e=="lineNumberFormatter")xr(),nr(!0)},getOption:function(e){return s[e]},undo:ci(Pn),redo:ci(Hn),indentLine:ci(function(e,t){typeof t!="string"&&(t==null?t=s.smartIndent?"smart":"prev":t=t?"add":"subtract"),ln(e)&&Er(e,t)}),indentSelection:ci(wr),historySize:function(){return{undo:on.done.length,redo:on.undone.length}},clearHistory:function(){on=new j},setHistory:function(e){on=new j,on.done=e.done,on.undone=e.undone},getHistory:function(){return on.time=0,{done:on.done.concat([]),undone:on.undone.concat([])}},matchBrackets:ci(function(){ni(!0)}),getTokenAt:ci(function(e){return e=pr(e),hn(e.line).getTokenAt(Lt,ii(e.line),s.tabSize,e.ch)}),getStateAfter:function(e){return e=hr(e==null?At.size-1:e),ii(e+1)},cursorCoords:function(e,t){return e==null&&(e=_t.inverted),this.charCoords(e?_t.from:_t.to,t)},charCoords:function(e,t){return e=pr(e),t=="local"?qr(e,!1):t=="div"?qr(e,!0):Ur(e)},coordsChar:function(e){var t=Z(gt);return Rr(e.x-t.left,e.y-t.top)},markText:ci(Ar),setBookmark:Or,findMarksAt:Mr,setMarker:ci(_r),clearMarker:ci(Dr),setLineClass:ci(Hr),hideLine:ci(function(e){return Br(e,!0)}),showLine:ci(function(e){return Br(e,!1)}),onDeleteLine:function(e,t){if(typeof e=="number"){if(!ln(e))return null;e=hn(e)}return(e.handlers||(e.handlers=[])).push(t),e},lineInfo:jr,getViewport:function(){return{from:Kt,to:Qt}},addWidget:function(e,t,n,r,i){e=qr(pr(e));var s=e.yBot,o=e.x;t.style.position="absolute",Et.appendChild(t);if(r=="over")s=e.y;else if(r=="near"){var u=Math.max(St.offsetHeight,At.height*Vr()),a=Math.max(Et.clientWidth,gt.clientWidth)-Gr();e.yBot+t.offsetHeight>u&&e.y>t.offsetHeight&&(s=e.y-t.offsetHeight),o+t.offsetWidth>a&&(o=a-t.offsetWidth)}t.style.top=s+Qr()+"px",t.style.left=t.style.right="",i=="right"?(o=Et.clientWidth-t.offsetWidth,t.style.right="0px"):(i=="left"?o=0:i=="middle"&&(o=(Et.clientWidth-t.offsetWidth)/2),t.style.left=o+Gr()+"px"),n&&Zn(o,s,o+t.offsetWidth,s+t.offsetHeight)},lineCount:function(){return At.size},clipPos:pr,getCursor:function(e){return e==null&&(e=_t.inverted),it(e?_t.from:_t.to)},somethingSelected:function(){return!nt(_t.from,_t.to)},setCursor:ci(function(e,t,n){t==null&&typeof e.line=="number"?cr(e.line,e.ch,n):cr(e,t,n)}),setSelection:ci(function(e,t,n){(n?ar:fr)(pr(e),pr(t||e))}),getLine:function(e){if(ln(e))return hn(e).text},getLineHandle:function(e){if(ln(e))return hn(e)},setLine:ci(function(e,t){ln(e)&&qn(t,{line:e,ch:0},{line:e,ch:hn(e).text.length})}),removeLine:ci(function(e){ln(e)&&qn("",{line:e,ch:0},pr({line:e+1,ch:0}))}),replaceRange:ci(qn),getRange:function(e,t,n){return zn(pr(e),pr(t),n)},triggerOnKeyDown:ci(kn),execCommand:function(e){return u[e](cn)},moveH:ci(vr),deleteH:ci(mr),moveV:ci(gr),toggleOverwrite:function(){Ft?(Ft=!1,at.className=at.className.replace(" CodeMirror-overwrite","")):(Ft=!0,at.className+=" CodeMirror-overwrite")},posFromIndex:function(e){var t=0,n;return At.iter(0,At.size,function(r){var i=r.text.length+1;if(i>e)return n=e,!0;e-=i,++t}),pr({line:t,ch:n})},indexFromPos:function(e){if(e.line<0||e.ch<0)return 0;var t=e.ch;return At.iter(0,e.line,function(e){t+=e.text.length+1}),t},scrollTo:function(e,t){e!=null&&(St.scrollLeft=e),t!=null&&(R.scrollTop=St.scrollTop=t),nr([])},getScrollInfo:function(){return{x:St.scrollLeft,y:R.scrollTop,height:R.scrollHeight,width:St.scrollWidth}},setSize:function(e,t){function n(e){return e=String(e),/^\d+$/.test(e)?e+"px":e}e!=null&&(xt.style.width=n(e)),t!=null&&(St.style.height=n(t)),cn.refresh()},operation:function(e){return ci(e)()},compoundChange:function(e){return hi(e)},refresh:function(){nr(!0,null,Bt),R.scrollHeight>Bt&&(R.scrollTop=Bt)},getInputField:function(){return L},getWrapperElement:function(){return xt},getScrollerElement:function(){return St},getGutterElement:function(){return bt}},xn,Cn=null,$n="";Lr.prototype.clear=ci(function(){var e=Infinity,t=-Infinity;for(var n=0,r=this.set.length;n<r;++n){var i=this.set[n],s=i.marked;if(!s||!i.parent)continue;var o=P(i);e=Math.min(e,o),t=Math.max(t,o);for(var u=0;u<s.length;++u)s[u].marker==this&&s.splice(u--,1)}e!=Infinity&&Ut.push({from:e,to:t+1})}),Lr.prototype.find=function(){var e,t;for(var n=0,r=this.set.length;n<r;++n){var i=this.set[n],s=i.marked;for(var o=0;o<s.length;++o){var u=s[o];if(u.marker==this)if(u.from!=null||u.to!=null){var a=P(i);a!=null&&(u.from!=null&&(e={line:a,ch:u.from}),u.to!=null&&(t={line:a,ch:u.to}))}}}return{from:e,to:t}};var zr,Wr,Xr,$r,Jr=0,ti={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},li=0;for(var pi in o)o.propertyIsEnumerable(pi)&&!cn.propertyIsEnumerable(pi)&&(cn[pi]=o[pi]);return cn}function f(e){return typeof e=="string"?a[e]:e}function l(e,t,n,r,i){function s(t){t=f(t);var n=t[e];if(n===!1)return i&&i(),!0;if(n!=null&&r(n))return!0;if(t.nofallthrough)return i&&i(),!0;var o=t.fallthrough;if(o==null)return!1;if(Object.prototype.toString.call(o)!="[object Array]")return s(o);for(var u=0,a=o.length;u<a;++u)if(s(o[u]))return!0;return!1}return t&&s(t)?!0:s(n)}function c(e){var t=dt[X(e,"keyCode")];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function x(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function T(e,t,n){return e.startState?e.startState(t,n):!0}function N(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8}function C(e,t,n,r){this.from=e,this.to=t,this.style=n,this.marker=r}function k(e){this.from=e,this.to=e,this.line=null}function A(e,t){this.styles=t||[e,null],this.text=e,this.height=1}function O(e,t,n,r){for(var i=0,s=0,o=0;s<t;i+=2){var u=n[i],a=s+u.length;o==0?(a>e&&r.push(u.slice(e-s,Math.min(u.length,t-s)),n[i+1]),a>=e&&(o=1)):o==1&&(a>t?r.push(u.slice(0,t-s),n[i+1]):r.push(u,n[i+1])),s=a}}function M(e){this.lines=e,this.parent=null;for(var t=0,n=e.length,r=0;t<n;++t)e[t].parent=this,r+=e[t].height;this.height=r}function _(e){this.children=e;var t=0,n=0;for(var r=0,i=e.length;r<i;++r){var s=e[r];t+=s.chunkSize(),n+=s.height,s.parent=this}this.size=t,this.height=n,this.parent=null}function D(e,t){while(!e.lines)for(var n=0;;++n){var r=e.children[n],i=r.chunkSize();if(t<i){e=r;break}t-=i}return e.lines[t]}function P(e){if(e.parent==null)return null;var t=e.parent,n=lt(t.lines,e);for(var r=t.parent;r;t=r,r=r.parent)for(var i=0,s=r.children.length;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n}function H(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.height;if(t<o){e=s;continue e}t-=o,n+=s.chunkSize()}return n}while(!e.lines);for(var r=0,i=e.lines.length;r<i;++r){var u=e.lines[r],a=u.height;if(t<a)break;t-=a}return n+r}function B(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.chunkSize();if(t<o){e=s;continue e}t-=o,n+=s.height}return n}while(!e.lines);for(var r=0;r<t;++r)n+=e.lines[r].height;return n}function j(){this.time=0,this.done=[],this.undone=[],this.compound=0,this.closed=!1}function F(){U(this)}function I(e){return e.stop||(e.stop=F),e}function q(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function R(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function U(e){q(e),R(e)}function z(e){return e.target||e.srcElement}function W(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),n&&e.ctrlKey&&t==1&&(t=3),t}function X(e,t){var n=e.override&&e.override.hasOwnProperty(t);return n?e.override[t]:e[t]}function V(e,t,n,r){if(typeof e.addEventListener=="function"){e.addEventListener(t,n,!1);if(r)return function(){e.removeEventListener(t,n,!1)}}else{var i=function(e){n(e||window.event)};e.attachEvent("on"+t,i);if(r)return function(){e.detachEvent("on"+t,i)}}}function $(){this.id=null}function Y(e,t,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var r=0,i=0;r<t;++r)e.charAt(r)==" "?i+=n-i%n:++i;return i}function Z(e,t){try{var n=e.getBoundingClientRect();n={top:n.top,left:n.left}}catch(r){n={top:0,left:0}}if(!t)if(window.pageYOffset==null){var i=document.documentElement||document.body.parentNode;i.scrollTop==null&&(i=document.body),n.top+=i.scrollTop,n.left+=i.scrollLeft}else n.top+=window.pageYOffset,n.left+=window.pageXOffset;return n}function et(e){return e.textContent||e.innerText||e.nodeValue||""}function tt(e){t?(e.selectionStart=0,e.selectionEnd=e.value.length):e.select()}function nt(e,t){return e.line==t.line&&e.ch==t.ch}function rt(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function it(e){return{line:e.line,ch:e.ch}}function st(e,t,n,r){var i=document.createElement(e);n&&(i.className=n),r&&(i.style.cssText=r);if(typeof t=="string")at(i,t);else if(t)for(var s=0;s<t.length;++s)i.appendChild(t[s]);return i}function ot(e){return e.innerHTML="",e}function ut(e,t){ot(e).appendChild(t)}function at(e,t){v?(e.innerHTML="",e.appendChild(document.createTextNode(t))):e.textContent=t}function ft(e,t){if(!t)return 0;if(!e)return t.length;for(var n=e.length,r=t.length;n>=0&&r>=0;--n,--r)if(e.charAt(n)!=t.charAt(r))break;return r+1}function lt(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function ct(e){return/\w/.test(e)||e.toUpperCase()!=e.toLowerCase()}e.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,onDragEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,dragDrop:!0,onChange:null,onCursorActivity:null,onViewportChange:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,cursorBlinkRate:530,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null,lineNumberFormatter:function(e){return e}};var t=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),n=t||/Mac/.test(navigator.platform),r=/Win/.test(navigator.platform),i=e.modes={},s=e.mimeModes={};e.defineMode=function(t,n){!e.defaults.mode&&t!="null"&&(e.defaults.mode=t);if(arguments.length>2){n.dependencies=[];for(var r=2;r<arguments.length;++r)n.dependencies.push(arguments[r])}i[t]=n},e.defineMIME=function(e,t){s[e]=t},e.resolveMode=function(t){if(typeof t=="string"&&s.hasOwnProperty(t))t=s[t];else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return typeof t=="string"?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=i[n.name];return r?r(t,n):e.getMode(t,"text/plain")},e.listModes=function(){var e=[];for(var t in i)i.propertyIsEnumerable(t)&&e.push(t);return e},e.listMIMEs=function(){var e=[];for(var t in s)s.propertyIsEnumerable(t)&&e.push({mime:t,mode:s[t]});return e};var o=e.extensions={};e.defineExtension=function(e,t){o[e]=t};var u=e.commands={selectAll:function(e){e.setSelection({line:0,ch:0},{line:e.lineCount()-1})},killLine:function(e){var t=e.getCursor(!0),n=e.getCursor(!1),r=!nt(t,n);!r&&e.getLine(t.line).length==t.ch?e.replaceRange("",t,{line:t.line+1,ch:0}):e.replaceRange("",t,r?n:{line:t.line})},deleteLine:function(e){var t=e.getCursor().line;e.replaceRange("",{line:t,ch:0},{line:t})},undo:function(e){e.undo()},redo:function(e){e.redo()},goDocStart:function(e){e.setCursor(0,0,!0)},goDocEnd:function(e){e.setSelection({line:e.lineCount()-1},null,!0)},goLineStart:function(e){e.setCursor(e.getCursor().line,0,!0)},goLineStartSmart:function(e){var t=e.getCursor(),n=e.getLine(t.line),r=Math.max(0,n.search(/\S/));e.setCursor(t.line,t.ch<=r&&t.ch?0:r,!0)},goLineEnd:function(e){e.setSelection({line:e.getCursor().line},null,!0)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goWordRight:function(e){e.moveH(1,"word")},delCharLeft:function(e){e.deleteH(-1,"char")},delCharRight:function(e){e.deleteH(1,"char")},delWordLeft:function(e){e.deleteH(-1,"word")},delWordRight:function(e){e.deleteH(1,"word")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ","end")},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.replaceSelection(" ","end")},transposeChars:function(e){var t=e.getCursor(),n=e.getLine(t.line);t.ch>0&&t.ch<n.length-1&&e.replaceRange(n.charAt(t.ch)+n.charAt(t.ch-1),{line:t.line,ch:t.ch-1},{line:t.line,ch:t.ch+1})},newlineAndIndent:function(e){e.replaceSelection("\n","end"),e.indentLine(e.getCursor().line)},toggleOverwrite:function(e){e.toggleOverwrite()}},a=e.keyMap={};a.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},a.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","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",fallthrough:"basic"},a.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","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",fallthrough:["basic","emacsy"]},a["default"]=n?a.macDefault:a.pcDefault,a.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},e.fromTextArea=function(t,n){function s(){t.value=a.getValue()}n||(n={}),n.value=t.value,!n.tabindex&&t.tabindex&&(n.tabindex=t.tabindex);if(n.autofocus==null){var r=document.body;try{r=document.activeElement}catch(i){}n.autofocus=r==t||t.getAttribute("autofocus")!=null&&r==document.body}if(t.form){var o=V(t.form,"submit",s,!0);if(typeof t.form.submit=="function"){var u=t.form.submit;t.form.submit=function f(){s(),t.form.submit=u,t.form.submit(),t.form.submit=f}}}t.style.display="none";var a=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return a.save=s,a.getTextArea=function(){return t},a.toTextArea=function(){s(),t.parentNode.removeChild(a.getWrapperElement()),t.style.display="",t.form&&(o(),typeof t.form.submit=="function"&&(t.form.submit=u))},a};var h=/gecko\/\d{7}/i.test(navigator.userAgent),p=/MSIE \d/.test(navigator.userAgent),d=/MSIE [1-7]\b/.test(navigator.userAgent),v=/MSIE [1-8]\b/.test(navigator.userAgent),m=p&&document.documentMode==5,g=/WebKit\//.test(navigator.userAgent),y=/Chrome\//.test(navigator.userAgent),b=/Opera\//.test(navigator.userAgent),w=/Apple Computer/.test(navigator.vendor),E=/KHTML\//.test(navigator.userAgent),S=/Mac OS X 10\D([7-9]|\d\d)\D/.test(navigator.userAgent);e.copyState=x,e.startState=T,N.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if(typeof e=="string")var n=t==e;else var n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){var t=this.pos;while(this.eat(e));return this.pos>t},eatSpace:function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return Y(this.string,this.start,this.tabSize)},indentation:function(){return Y(this.string,null,this.tabSize)},match:function(e,t,n){if(typeof e!="string"){var i=this.string.slice(this.pos).match(e);return i&&t!==!1&&(this.pos+=i[0].length),i}var r=function(e){return n?e.toLowerCase():e};if(r(this.string).indexOf(r(e),this.pos)==this.pos)return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},e.StringStream=N,C.prototype={attach:function(e){this.marker.set.push(e)},detach:function(e){var t=lt(this.marker.set,e);t>-1&&this.marker.set.splice(t,1)},split:function(e,t){if(this.to<=e&&this.to!=null)return null;var n=this.from<e||this.from==null?null:this.from-e+t,r=this.to==null?null:this.to-e+t;return new C(n,r,this.style,this.marker)},dup:function(){return new C(null,null,this.style,this.marker)},clipTo:function(e,t,n,r,i){e&&r>this.from&&(r<this.to||this.to==null)?this.from=null:this.from!=null&&this.from>=t&&(this.from=Math.max(r,this.from)+i),n&&(t<this.to||this.to==null)&&(t>this.from||this.from==null)?this.to=null:this.to!=null&&this.to>t&&(this.to=r<this.to?this.to+i:t)},isDead:function(){return this.from!=null&&this.to!=null&&this.from>=this.to},sameSet:function(e){return this.marker==e.marker}},k.prototype={attach:function(e){this.line=e},detach:function(e){this.line==e&&(this.line=null)},split:function(e,t){if(e<this.from)return this.from=this.to=this.from-e+t,this},isDead:function(){return this.from>this.to},clipTo:function(e,t,n,r,i){(e||t<this.from)&&(n||r>this.to)?(this.from=0,this.to=-1):this.from>t&&(this.from=this.to=Math.max(r,this.from)+i)},sameSet:function(e){return!1},find:function(){return!this.line||!this.line.parent?null:{line:P(this.line),ch:this.from}},clear:function(){if(this.line){var e=lt(this.line.marked,this);e!=-1&&this.line.marked.splice(e,1),this.line=null}}};var L=" ";h||p&&!d?L="​":b&&(L=""),A.inheritMarks=function(e,t){var n=new A(e),r=t&&t.marked;if(r)for(var i=0;i<r.length;++i)if(r[i].to==null&&r[i].style){var s=n.marked||(n.marked=[]),o=r[i],u=o.dup();s.push(u),u.attach(n)}return n},A.prototype={replace:function(e,t,n){var r=[],i=this.marked,s=t==null?this.text.length:t;O(0,e,this.styles,r),n&&r.push(n,null),O(s,this.text.length,this.styles,r),this.styles=r,this.text=this.text.slice(0,e)+n+this.text.slice(s),this.stateAfter=null;if(i){var o=n.length-(s-e);for(var u=0;u<i.length;++u){var a=i[u];a.clipTo(e==null,e||0,t==null,s,o),a.isDead()&&(a.detach(this),i.splice(u--,1))}}},split:function(e,t){var n=[t,null],r=this.marked;O(e,this.text.length,this.styles,n);var i=new A(t+this.text.slice(e),n);if(r)for(var s=0;s<r.length;++s){var o=r[s],u=o.split(e,t.length);u&&(i.marked||(i.marked=[]),i.marked.push(u),u.attach(i),u==o&&r.splice(s--,1))}return i},append:function(e){var t=this.text.length,n=e.marked,r=this.marked;this.text+=e.text,O(0,e.text.length,e.styles,this.styles);if(r)for(var i=0;i<r.length;++i)r[i].to==null&&(r[i].to=t);if(n&&n.length){r||(this.marked=r=[]);e:for(var i=0;i<n.length;++i){var s=n[i];if(!s.from)for(var o=0;o<r.length;++o){var u=r[o];if(u.to==t&&u.sameSet(s)){u.to=s.to==null?null:s.to+t,u.isDead()&&(u.detach(this),n.splice(i--,1));continue e}}r.push(s),s.attach(this),s.from+=t,s.to!=null&&(s.to+=t)}}},fixMarkEnds:function(e){var t=this.marked,n=e.marked;if(!t)return;e:for(var r=0;r<t.length;++r){var i=t[r],s=i.to==null;if(s&&n)for(var o=0;o<n.length;++o){var u=n[o];if(!u.sameSet(i)||u.from!=null)continue;if(i.from==this.text.length&&u.to==0){n.splice(o,1),t.splice(r--,1);continue e}s=!1;break}s&&(i.to=this.text.length)}},fixMarkStarts:function(){var e=this.marked;if(!e)return;for(var t=0;t<e.length;++t)e[t].from==null&&(e[t].from=0)},addMark:function(e){e.attach(this),this.marked==null&&(this.marked=[]),this.marked.push(e),this.marked.sort(function(e,t){return(e.from||0)-(t.from||0)})},highlight:function(e,t,n){var r=new N(this.text,n),i=this.styles,s=0,o=!1,u=i[0],a;this.text==""&&e.blankLine&&e.blankLine(t);while(!r.eol()){var f=e.token(r,t),l=this.text.slice(r.start,r.pos);r.start=r.pos,s&&i[s-1]==f?i[s-2]+=l:l&&(!o&&(i[s+1]!=f||s&&i[s-2]!=a)&&(o=!0),i[s++]=l,i[s++]=f,a=u,u=i[s]);if(r.pos>5e3){i[s++]=this.text.slice(r.pos),i[s++]=null;break}}return i.length!=s&&(i.length=s,o=!0),s&&i[s-2]!=a&&(o=!0),o||(i.length<5&&this.text.length<10?null:!1)},getTokenAt:function(e,t,n,r){var i=this.text,s=new N(i,n);while(s.pos<r&&!s.eol()){s.start=s.pos;var o=e.token(s,t)}return{start:s.start,end:s.pos,string:s.current(),className:o||null,state:t}},indentation:function(e){return Y(this.text,null,e)},getElement:function(e,t,n){function u(t,n,o){if(!n)return;r&&p&&n.charAt(0)==" "&&(n=" "+n.slice(1)),r=!1;if(!s.test(n)){i+=n.length;var u=document.createTextNode(n)}else{var u=document.createDocumentFragment(),a=0;for(;;){s.lastIndex=a;var f=s.exec(n),l=f?f.index-a:n.length-a;l&&(u.appendChild(document.createTextNode(n.slice(a,a+l))),i+=l);if(!f)break;a+=l+1;if(f[0]==" "){var c=e(i);u.appendChild(c.element.cloneNode(!0)),i+=c.width}else{var h=st("span","•","cm-invalidchar");h.title="\\u"+f[0].charCodeAt(0).toString(16),u.appendChild(h),i+=1}}}o?t.appendChild(st("span",[u],o)):t.appendChild(u)}function m(e){return e?"cm-"+e.replace(/ +/g," cm-"):null}var r=!0,i=0,s=/[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g,o=st("pre"),a=u;if(t!=null){var f=0,l=o.anchor=st("span");a=function(e,r,i){var s=r.length;if(t>=f&&t<f+s){t>f&&(u(e,r.slice(0,t-f),i),n&&e.appendChild(st("wbr"))),e.appendChild(l);var o=t-f;u(l,b?r.slice(o,o+1):r.slice(o),i),b&&u(e,r.slice(o+1),i),t--,f+=s}else f+=s,u(e,r,i),f==t&&f==v?(at(l,L),e.appendChild(l)):f>t+10&&/\s/.test(r)&&(a=function(){})}}var c=this.styles,h=this.text,d=this.marked,v=h.length;if(!h&&t==null)a(o," ");else if(!d||!d.length)for(var g=0,y=0;y<v;g+=2){var w=c[g],E=c[g+1],S=w.length;y+S>v&&(w=w.slice(0,v-y)),y+=S,a(o,w,m(E))}else{var x=0,g=0,T="",E,N=0,C=d[0].from||0,k=[],A=0,O=function(){var e;while(A<d.length&&((e=d[A]).from==x||e.from==null))e.style!=null&&k.push(e),++A;C=A<d.length?d[A].from:Infinity;for(var t=0;t<k.length;++t){var n=k[t].to;n==null&&(n=Infinity),n==x?k.splice(t--,1):C=Math.min(n,C)}},M=0;while(x<v){C==x&&O();var _=Math.min(v,C);for(;;){if(T){var D=x+T.length,P=E;for(var H=0;H<k.length;++H)P=(P?P+" ":"")+k[H].style;a(o,D>_?T.slice(0,_-x):T,P);if(D>=_){T=T.slice(_-x),x=_;break}x=D}T=c[g++],E=m(c[g++])}}}return o},cleanUp:function(){this.parent=null;if(this.marked)for(var e=0,t=this.marked.length;e<t;++e)this.marked[e].detach(this)}},M.prototype={chunkSize:function(){return this.lines.length},remove:function(e,t,n){for(var r=e,i=e+t;r<i;++r){var s=this.lines[r];this.height-=s.height,s.cleanUp();if(s.handlers)for(var o=0;o<s.handlers.length;++o)n.push(s.handlers[o])}this.lines.splice(e,t)},collapse:function(e){e.splice.apply(e,[e.length,0].concat(this.lines))},insertHeight:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0,i=t.length;r<i;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},_.prototype={chunkSize:function(){return this.size},remove:function(e,t,n){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],s=i.chunkSize();if(e<s){var o=Math.min(t,s-e),u=i.height;i.remove(e,o,n),this.height-=u-i.height,s==o&&(this.children.splice(r--,1),i.parent=null);if((t-=o)==0)break;e=0}else e-=s}if(this.size-t<25){var a=[];this.collapse(a),this.children=[new M(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0,n=this.children.length;t<n;++t)this.children[t].collapse(e)},insert:function(e,t){var n=0;for(var r=0,i=t.length;r<i;++r)n+=t[r].height;this.insertHeight(e,t,n)},insertHeight:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<=o){s.insertHeight(e,t,n);if(s.lines&&s.lines.length>50){while(s.lines.length>50){var u=s.lines.splice(s.lines.length-25,25),a=new M(u);s.height-=a.height,this.children.splice(r+1,0,a),a.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new _(t);if(!e.parent){var r=new _(e.children);r.parent=e,e.children=[r,n],e=r}else{e.size-=n.size,e.height-=n.height;var i=lt(e.parent.children,e);e.parent.children.splice(i+1,0,n)}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iter:function(e,t,n){this.iterN(e,t-e,n)},iterN:function(e,t,n){for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<o){var u=Math.min(t,o-e);if(s.iterN(e,u,n))return!0;if((t-=u)==0)break;e=0}else e-=o}}},j.prototype={addChange:function(
807
807
  e,t,n){this.undone.length=0;var r=+(new Date),i=this.done[this.done.length-1],s=i&&i[i.length-1],o=r-this.time;if(this.compound&&i&&!this.closed)i.push({start:e,added:t,old:n});else if(o>400||!s||this.closed||s.start>e+n.length||s.start+s.added<e)this.done.push([{start:e,added:t,old:n}]),this.closed=!1;else{var u=Math.max(0,s.start-e),a=Math.max(0,e+n.length-(s.start+s.added));for(var f=u;f>0;--f)s.old.unshift(n[f-1]);for(var f=a;f>0;--f)s.old.push(n[n.length-f]);u&&(s.start=e),s.added+=t-(n.length-u-a)}this.time=r},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}},e.e_stop=U,e.e_preventDefault=q,e.e_stopPropagation=R,e.connect=V,$.prototype={set:function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}};var J=e.Pass={toString:function(){return"CodeMirror.Pass"}},K=function(){if(v)return!1;var e=st("div");return"draggable"in e||"dragDrop"in e}(),Q=function(){var e=st("textarea");return e.value="foo\nbar",e.value.indexOf("\r")>-1?"\r\n":"\n"}(),G=/^$/;h?G=/$'/:w?G=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:y&&(G=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/),e.setTextContent=at;var ht="\n\nb".split(/\n/).length!=3?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var s=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=s.indexOf("\r");o!=-1?(n.push(s.slice(0,o)),t+=o+1):(n.push(s),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)};e.splitLines=ht;var pt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0};e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var dt={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",109:"-",107:"=",127:"Delete",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 e.keyNames=dt,function(){for(var e=0;e<10;e++)dt[e+48]=String(e);for(var e=65;e<=90;e++)dt[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)dt[e+111]=dt[e+63235]="F"+e}(),e}(),CodeMirror.defineMode("javascript",function(e,t){function o(e,t,n){return t.tokenize=n,n(e,t)}function u(e,t){var n=!1,r;while((r=e.next())!=null){if(r==t&&!n)return!1;n=!n&&r=="\\"}return n}function l(e,t,n){return a=e,f=n,t}function c(e,t){var n=e.next();if(n=='"'||n=="'")return o(e,t,h(n));if(/[\[\]{}\(\),;\:\.]/.test(n))return l(n);if(n=="0"&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),l("number","number");if(/\d/.test(n)||n=="-"&&e.eat(/\d/))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),l("number","number");if(n=="/")return e.eat("*")?o(e,t,p):e.eat("/")?(e.skipToEnd(),l("comment","comment")):t.reAllowed?(u(e,"/"),e.eatWhile(/[gimy]/),l("regexp","string-2")):(e.eatWhile(s),l("operator",null,e.current()));if(n=="#")return e.skipToEnd(),l("error","error");if(s.test(n))return e.eatWhile(s),l("operator",null,e.current());e.eatWhile(/[\w\$_]/);var r=e.current(),a=i.propertyIsEnumerable(r)&&i[r];return a&&t.kwAllowed?l(a.type,a.style,r):l("variable","variable",r)}function h(e){return function(t,n){return u(t,e)||(n.tokenize=c),l("string","string")}}function p(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=c;break}n=r=="*"}return l("comment","comment")}function v(e,t,n,r,i,s){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=s,r!=null&&(this.align=r)}function m(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0}function g(e,t,n,i,s){var o=e.cc;y.state=e,y.stream=s,y.marked=null,y.cc=o,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);for(;;){var u=o.length?o.pop():r?A:L;if(u(n,i)){while(o.length&&o[o.length-1].lex)o.pop()();return y.marked?y.marked:n=="variable"&&m(e,i)?"variable-2":t}}}function b(){for(var e=arguments.length-1;e>=0;e--)y.cc.push(arguments[e])}function w(){return b.apply(null,arguments),!0}function E(e){var t=y.state;if(t.context){y.marked="def";for(var n=t.localVars;n;n=n.next)if(n.name==e)return;t.localVars={name:e,next:t.localVars}}}function x(){y.state.context||(y.state.localVars=S),y.state.context={prev:y.state.context,vars:y.state.localVars}}function T(){y.state.localVars=y.state.context.vars,y.state.context=y.state.context.prev}function N(e,t){var n=function(){var n=y.state;n.lexical=new v(n.indented,y.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function C(){var e=y.state;e.lexical.prev&&(e.lexical.type==")"&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function k(e){return function(n){return n==e?w():e==";"?b():w(arguments.callee)}}function L(e){return e=="var"?w(N("vardef"),j,k(";"),C):e=="keyword a"?w(N("form"),A,L,C):e=="keyword b"?w(N("form"),L,C):e=="{"?w(N("}"),B,C):e==";"?w():e=="function"?w(z):e=="for"?w(N("form"),k("("),N(")"),I,k(")"),C,L,C):e=="variable"?w(N("stat"),_):e=="switch"?w(N("form"),A,N("}","switch"),k("{"),B,C,C):e=="case"?w(A,k(":")):e=="default"?w(k(":")):e=="catch"?w(N("form"),x,k("("),W,k(")"),L,C,T):b(N("stat"),A,k(";"),C)}function A(e){return d.hasOwnProperty(e)?w(M):e=="function"?w(z):e=="keyword c"?w(O):e=="("?w(N(")"),O,k(")"),C,M):e=="operator"?w(A):e=="["?w(N("]"),H(A,"]"),C,M):e=="{"?w(N("}"),H(P,"}"),C,M):w()}function O(e){return e.match(/[;\}\)\],]/)?b():b(A)}function M(e,t){if(e=="operator"&&/\+\+|--/.test(t))return w(M);if(e=="operator"&&t=="?")return w(A,k(":"),A);if(e==";")return;if(e=="(")return w(N(")"),H(A,")"),C,M);if(e==".")return w(D,M);if(e=="[")return w(N("]"),A,k("]"),C,M)}function _(e){return e==":"?w(C,L):b(M,k(";"),C)}function D(e){if(e=="variable")return y.marked="property",w()}function P(e){e=="variable"&&(y.marked="property");if(d.hasOwnProperty(e))return w(k(":"),A)}function H(e,t){function n(r){return r==","?w(e,n):r==t?w():w(k(t))}return function(i){return i==t?w():b(e,n)}}function B(e){return e=="}"?w():b(L,B)}function j(e,t){return e=="variable"?(E(t),w(F)):w()}function F(e,t){if(t=="=")return w(A,F);if(e==",")return w(j)}function I(e){return e=="var"?w(j,R):e==";"?b(R):e=="variable"?w(q):b(R)}function q(e,t){return t=="in"?w(A):w(M,R)}function R(e,t){return e==";"?w(U):t=="in"?w(A):w(A,k(";"),U)}function U(e){e!=")"&&w(A)}function z(e,t){if(e=="variable")return E(t),w(z);if(e=="(")return w(N(")"),x,H(W,")"),C,L,T)}function W(e,t){if(e=="variable")return E(t),w()}var n=e.indentUnit,r=t.json,i=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),s={type:"atom",style:"atom"};return{"if":t,"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":r,"delete":r,"throw":r,"var":e("var"),"const":e("var"),let:e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":s,"false":s,"null":s,"undefined":s,NaN:s,Infinity:s}}(),s=/[+\-*&%=<>!?|]/,a,f,d={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},y={state:null,column:null,marked:null,cc:null},S={name:"this",next:{name:"arguments"}};return C.lex=!0,{startState:function(e){return{tokenize:c,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new v((e||0)-n,0,"block",!1),localVars:t.localVars,context:t.localVars&&{vars:t.localVars},indented:0}},token:function(e,t){e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation());if(e.eatSpace())return null;var n=t.tokenize(e,t);return a=="comment"?n:(t.reAllowed=a=="operator"||a=="keyword c"||!!a.match(/^[\[{}\(,;:]$/),t.kwAllowed=a!=".",g(t,n,a,f,e))},indent:function(e,t){if(e.tokenize!=c)return 0;var r=t&&t.charAt(0),i=e.lexical;i.type=="stat"&&r=="}"&&(i=i.prev);var s=i.type,o=r==s;return s=="vardef"?i.indented+4:s=="form"&&r=="{"?i.indented:s=="stat"||s=="form"?i.indented+n:i.info=="switch"&&!o?i.indented+(/^(?:case|default)\b/.test(t)?n:2*n):i.align?i.column+(o?0:1):i.indented+(o?0:n)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,this.options.trigger=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):this.options.trigger!="manual"&&(i=this.options.trigger=="hover"?"mouseenter":"focus",s=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this))),this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,t,this.$element.data()),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);if(!n.options.delay||!n.options.delay.show)return n.show();clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var e,t,n,r,i,s,o;if(this.hasContent()&&this.enabled){e=this.tip(),this.setContent(),this.options.animation&&e.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,t=/in/.test(s),e.remove().css({top:0,left:0,display:"block"}).appendTo(t?this.$element:document.body),n=this.getPosition(t),r=e[0].offsetWidth,i=e[0].offsetHeight;switch(t?s.split(" ")[1]:s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}e.css(o).addClass(s).addClass("in")}},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function r(){var t=setTimeout(function(){n.off(e.support.transition.end).remove()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.remove()})}var t=this,n=this.tip();return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?r():n.remove(),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(t){return e.extend({},t?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}},e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover",title:"",delay:0,html:!0}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content > *")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}}),e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;e("body").addClass("modal-open"),this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1).focus(),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.trigger("shown")}):t.$element.trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,e("body").removeClass("modal-open"),this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(e){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,e.proxy(this.removeBackdrop,this)):this.removeBackdrop()):t&&t()}},e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e(function(){e("body").on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})})}(window.jQuery),function(e){"use strict";typeof define=="function"&&define.amd?define(["exports"],e):typeof exports!="undefined"?e(exports):e(window.esprima={})}(function(e){"use strict";function m(e,t){if(!e)throw new Error("ASSERT: "+t)}function g(e,t){return u.slice(e,t)}function y(e){return"0123456789".indexOf(e)>=0}function b(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function w(e){return"01234567".indexOf(e)>=0}function E(e){return e===" "||e===" "||e===" "||e==="\f"||e===" "||e.charCodeAt(0)>=5760&&" ᠎              ".indexOf(e)>=0}function S(e){return e==="\n"||e==="\r"||e==="\u2028"||e==="\u2029"}function x(e){return e==="$"||e==="_"||e==="\\"||e>="a"&&e<="z"||e>="A"&&e<="Z"||e.charCodeAt(0)>=128&&o.NonAsciiIdentifierStart.test(e)}function T(e){return e==="$"||e==="_"||e==="\\"||e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e.charCodeAt(0)>=128&&o.NonAsciiIdentifierPart.test(e)}function N(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0}return!1}function C(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0}return!1}function k(e){return e==="eval"||e==="arguments"}function L(e){var t=!1;switch(e.length){case 2:t=e==="if"||e==="in"||e==="do";break;case 3:t=e==="var"||e==="for"||e==="new"||e==="try";break;case 4:t=e==="this"||e==="else"||e==="case"||e==="void"||e==="with";break;case 5:t=e==="while"||e==="break"||e==="catch"||e==="throw";break;case 6:t=e==="return"||e==="typeof"||e==="delete"||e==="switch";break;case 7:t=e==="default"||e==="finally";break;case 8:t=e==="function"||e==="continue"||e==="debugger";break;case 10:t=e==="instanceof"}if(t)return!0;switch(e){case"const":return!0;case"yield":case"let":return!0}return a&&C(e)?!0:N(e)}function A(){return u[f++]}function O(){var e,t,n;t=!1,n=!1;while(f<h){e=u[f];if(n)e=A(),S(e)&&(n=!1,e==="\r"&&u[f]==="\n"&&++f,++l,c=f);else if(t)S(e)?(e==="\r"&&u[f+1]==="\n"&&++f,++l,++f,c=f,f>=h&&U({},s.UnexpectedToken,"ILLEGAL")):(e=A(),f>=h&&U({},s.UnexpectedToken,"ILLEGAL"),e==="*"&&(e=u[f],e==="/"&&(++f,t=!1)));else if(e==="/"){e=u[f+1];if(e==="/")f+=2,n=!0;else{if(e!=="*")break;f+=2,t=!0,f>=h&&U({},s.UnexpectedToken,"ILLEGAL")}}else if(E(e))++f;else{if(!S(e))break;++f,e==="\r"&&u[f]==="\n"&&++f,++l,c=f}}}function M(e){var t,n,r,i=0;n=e==="u"?4:2;for(t=0;t<n;++t){if(!(f<h&&b(u[f])))return"";r=A(),i=i*16+"0123456789abcdef".indexOf(r.toLowerCase())}return String.fromCharCode(i)}function _(){var e,n,r,i;e=u[f];if(!x(e))return;n=f;if(e==="\\"){++f;if(u[f]!=="u")return;++f,i=f,e=M("u");if(e){if(e==="\\"||!x(e))return;r=e}else f=i,r="u"}else r=A();while(f<h){e=u[f];if(!T(e))break;if(e==="\\"){++f;if(u[f]!=="u")return;++f,i=f,e=M("u");if(e){if(e==="\\"||!T(e))return;r+=e}else f=i,r+="u"}else r+=A()}return r.length===1?{type:t.Identifier,value:r,lineNumber:l,lineStart:c,range:[n,f]}:L(r)?{type:t.Keyword,value:r,lineNumber:l,lineStart:c,range:[n,f]}:r==="null"?{type:t.NullLiteral,value:r,lineNumber:l,lineStart:c,range:[n,f]}:r==="true"||r==="false"?{type:t.BooleanLiteral,value:r,lineNumber:l,lineStart:c,range:[n,f]}:{type:t.Identifier,value:r,lineNumber:l,lineStart:c,range:[n,f]}}function D(){var e=f,n=u[f],r,i,s;if(n===";"||n==="{"||n==="}")return++f,{type:t.Punctuator,value:n,lineNumber:l,lineStart:c,range:[e,f]};if(n===","||n==="("||n===")")return++f,{type:t.Punctuator,value:n,lineNumber:l,lineStart:c,range:[e,f]};r=u[f+1];if(n==="."&&!y(r))return{type:t.Punctuator,value:A(),lineNumber:l,lineStart:c,range:[e,f]};i=u[f+2],s=u[f+3];if(n===">"&&r===">"&&i===">"&&s==="=")return f+=4,{type:t.Punctuator,value:">>>=",lineNumber:l,lineStart:c,range:[e,f]};if(n==="="&&r==="="&&i==="=")return f+=3,{type:t.Punctuator,value:"===",lineNumber:l,lineStart:c,range:[e,f]};if(n==="!"&&r==="="&&i==="=")return f+=3,{type:t.Punctuator,value:"!==",lineNumber:l,lineStart:c,range:[e,f]};if(n===">"&&r===">"&&i===">")return f+=3,{type:t.Punctuator,value:">>>",lineNumber:l,lineStart:c,range:[e,f]};if(n==="<"&&r==="<"&&i==="=")return f+=3,{type:t.Punctuator,value:"<<=",lineNumber:l,lineStart:c,range:[e,f]};if(n===">"&&r===">"&&i==="=")return f+=3,{type:t.Punctuator,value:">>=",lineNumber:l,lineStart:c,range:[e,f]};if(r==="="&&"<>=!+-*%&|^/".indexOf(n)>=0)return f+=2,{type:t.Punctuator,value:n+r,lineNumber:l,lineStart:c,range:[e,f]};if(n===r&&"+-<>&|".indexOf(n)>=0&&"+-<>&|".indexOf(r)>=0)return f+=2,{type:t.Punctuator,value:n+r,lineNumber:l,lineStart:c,range:[e,f]};if("[]<>+-*%&|^!~?:=/".indexOf(n)>=0)return{type:t.Punctuator,value:A(),lineNumber:l,lineStart:c,range:[e,f]}}function P(){var e,n,r;r=u[f],m(y(r)||r===".","Numeric literal must start with a decimal digit or a decimal point"),n=f,e="";if(r!=="."){e=A(),r=u[f];if(e==="0"){if(r==="x"||r==="X"){e+=A();while(f<h){r=u[f];if(!b(r))break;e+=A()}return e.length<=2&&U({},s.UnexpectedToken,"ILLEGAL"),f<h&&(r=u[f],x(r)&&U({},s.UnexpectedToken,"ILLEGAL")),{type:t.NumericLiteral,value:parseInt(e,16),lineNumber:l,lineStart:c,range:[n,f]}}if(w(r)){e+=A();while(f<h){r=u[f];if(!w(r))break;e+=A()}return f<h&&(r=u[f],(x(r)||y(r))&&U({},s.UnexpectedToken,"ILLEGAL")),{type:t.NumericLiteral,value:parseInt(e,8),octal:!0,lineNumber:l,lineStart:c,range:[n,f]}}y(r)&&U({},s.UnexpectedToken,"ILLEGAL")}while(f<h){r=u[f];if(!y(r))break;e+=A()}}if(r==="."){e+=A();while(f<h){r=u[f];if(!y(r))break;e+=A()}}if(r==="e"||r==="E"){e+=A(),r=u[f];if(r==="+"||r==="-")e+=A();r=u[f];if(y(r)){e+=A();while(f<h){r=u[f];if(!y(r))break;e+=A()}}else r="character "+r,f>=h&&(r="<end>"),U({},s.UnexpectedToken,"ILLEGAL")}return f<h&&(r=u[f],x(r)&&U({},s.UnexpectedToken,"ILLEGAL")),{type:t.NumericLiteral,value:parseFloat(e),lineNumber:l,lineStart:c,range:[n,f]}}function H(){var e="",n,r,i,o,a,p,d=!1;n=u[f],m(n==="'"||n==='"',"String literal must starts with a quote"),r=f,++f;while(f<h){i=A();if(i===n){n="";break}if(i==="\\"){i=A();if(!S(i))switch(i){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+=" ";break;case"u":case"x":p=f,a=M(i),a?e+=a:(f=p,e+=i);break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+=" ";break;default:w(i)?(o="01234567".indexOf(i),o!==0&&(d=!0),f<h&&w(u[f])&&(d=!0,o=o*8+"01234567".indexOf(A()),"0123".indexOf(i)>=0&&f<h&&w(u[f])&&(o=o*8+"01234567".indexOf(A()))),e+=String.fromCharCode(o)):e+=i}else++l,i==="\r"&&u[f]==="\n"&&++f}else{if(S(i))break;e+=i}}return n!==""&&U({},s.UnexpectedToken,"ILLEGAL"),{type:t.StringLiteral,value:e,octal:d,lineNumber:l,lineStart:c,range:[r,f]}}function B(){var e="",t,n,r,i,o,a=!1,l,c=!1;p=null,O(),n=f,t=u[f],m(t==="/","Regular expression literal must start with a slash"),e=A();while(f<h){t=A(),e+=t;if(a)t==="]"&&(a=!1);else if(t==="\\")t=A(),S(t)&&U({},s.UnterminatedRegExp),e+=t;else{if(t==="/"){c=!0;break}t==="["?a=!0:S(t)&&U({},s.UnterminatedRegExp)}}c||U({},s.UnterminatedRegExp),r=e.substr(1,e.length-2),i="";while(f<h){t=u[f];if(!T(t))break;++f;if(t==="\\"&&f<h){t=u[f];if(t==="u"){++f,l=f,t=M("u");if(t){i+=t,e+="\\u";for(;l<f;++l)e+=u[l]}else f=l,i+="u",e+="\\u"}else e+="\\"}else i+=t,e+=t}try{o=new RegExp(r,i)}catch(d){U({},s.InvalidRegExp)}return{literal:e,value:o,range:[n,f]}}function j(e){return e.type===t.Identifier||e.type===t.Keyword||e.type===t.BooleanLiteral||e.type===t.NullLiteral}function F(){var e,n;O();if(f>=h)return{type:t.EOF,lineNumber:l,lineStart:c,range:[f,f]};n=D();if(typeof n!="undefined")return n;e=u[f];if(e==="'"||e==='"')return H();if(e==="."||y(e))return P();n=_();if(typeof n!="undefined")return n;U({},s.UnexpectedToken,"ILLEGAL")}function I(){var e;return p?(f=p.range[1],l=p.lineNumber,c=p.lineStart,e=p,p=null,e):(p=null,F())}function q(){var e,t,n;return p!==null?p:(e=f,t=l,n=c,p=F(),f=e,l=t,c=n,p)}function R(){var e,t,n,r;return e=f,t=l,n=c,O(),r=l!==t,f=e,l=t,c=n,r}function U(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,function(e,t){return r[t]||""});throw typeof e.lineNumber=="number"?(n=new Error("Line "+e.lineNumber+": "+i),n.index=e.range[0],n.lineNumber=e.lineNumber,n.column=e.range[0]-c+1):(n=new Error("Line "+l+": "+i),n.index=f,n.lineNumber=l,n.column=f-c+1),n}function z(){try{U.apply(null,arguments)}catch(e){if(!v.errors)throw e;v.errors.push(e)}}function W(e){e.type===t.EOF&&U(e,s.UnexpectedEOS),e.type===t.NumericLiteral&&U(e,s.UnexpectedNumber),e.type===t.StringLiteral&&U(e,s.UnexpectedString),e.type===t.Identifier&&U(e,s.UnexpectedIdentifier),e.type===t.Keyword&&(N(e.value)?U(e,s.UnexpectedReserved):a&&C(e.value)&&U(e,s.StrictReservedWord),U(e,s.UnexpectedToken,e.value)),U(e,s.UnexpectedToken,e.value)}function X(e){var n=I();(n.type!==t.Punctuator||n.value!==e)&&W(n)}function V(e){var n=I();(n.type!==t.Keyword||n.value!==e)&&W(n)}function $(e){var n=q();return n.type===t.Punctuator&&n.value===e}function J(e){var n=q();return n.type===t.Keyword&&n.value===e}function K(){var e=q(),n=e.value;return e.type!==t.Punctuator?!1:n==="="||n==="*="||n==="/="||n==="%="||n==="+="||n==="-="||n==="<<="||n===">>="||n===">>>="||n==="&="||n==="^="||n==="|="}function Q(){var e,n;if(u[f]===";"){I();return}n=l,O();if(l!==n)return;if($(";")){I();return}e=q(),e.type!==t.EOF&&!$("}")&&W(e);return}function G(e){return e.type===r.Identifier||e.type===r.MemberExpression}function Y(){var e=[];X("[");while(!$("]"))$(",")?(I(),e.push(null)):(e.push(Nt()),$("]")||X(","));return X("]"),{type:r.ArrayExpression,elements:e}}function Z(e,t){var n,i;return n=a,i=Yt(),t&&a&&k(e[0].name)&&U(t,s.StrictParamName),a=n,{type:r.FunctionExpression,id:null,params:e,defaults:[],body:i,rest:null,generator:!1,expression:!1}}function et(){var e=I();return e.type===t.StringLiteral||e.type===t.NumericLiteral?(a&&e.octal&&U(e,s.StrictOctalLiteral),cn(e)):{type:r.Identifier,name:e.value}}function tt(){var e,n,i,s;e=q();if(e.type===t.Identifier)return i=et(),e.value==="get"&&!$(":")?(n=et(),X("("),X(")"),{type:r.Property,key:n,value:Z([]),kind:"get"}):e.value==="set"&&!$(":")?(n=et(),X("("),e=q(),e.type!==t.Identifier&&W(I()),s=[At()],X(")"),{type:r.Property,key:n,value:Z(s,e),kind:"set"}):(X(":"),{type:r.Property,key:i,value:Nt(),kind:"init"});if(e.type!==t.EOF&&e.type!==t.Punctuator)return n=et(),X(":"),{type:r.Property,key:n,value:Nt(),kind:"init"};W(e)}function nt(){var e=[],t,n,o,u={},f=String;X("{");while(!$("}"))t=tt(),t.key.type===r.Identifier?n=t.key.name:n=f(t.key.value),o=t.kind==="init"?i.Data:t.kind==="get"?i.Get:i.Set,Object.prototype.hasOwnProperty.call(u,n)?(u[n]===i.Data?a&&o===i.Data?z({},s.StrictDuplicateProperty):o!==i.Data&&U({},s.AccessorDataProperty):o===i.Data?U({},s.AccessorDataProperty):u[n]&o&&U({},s.AccessorGetSet),u[n]|=o):u[n]=o,e.push(t),$("}")||X(",");return X("}"),{type:r.ObjectExpression,properties:e}}function rt(){var e,n=q(),i=n.type;if(i===t.Identifier)return{type:r.Identifier,name:I().value};if(i===t.StringLiteral||i===t.NumericLiteral)return a&&n.octal&&z(n,s.StrictOctalLiteral),cn(I());if(i===t.Keyword){if(J("this"))return I(),{type:r.ThisExpression};if(J("function"))return en()}return i===t.BooleanLiteral?(I(),n.value=n.value==="true",cn(n)):i===t.NullLiteral?(I(),n.value=null,cn(n)):$("[")?Y():$("{")?nt():$("(")?(I(),d.lastParenthesized=e=Ct(),X(")"),e):$("/")||$("/=")?cn(B()):W(I())}function it(){var e=[];X("(");if(!$(")"))while(f<h){e.push(Nt());if($(")"))break;X(",")}return X(")"),e}function st(){var e=I();return j(e)||W(e),{type:r.Identifier,name:e.value}}function ot(e){return{type:r.MemberExpression,computed:!1,object:e,property:st()}}function ut(e){var t,n;return X("["),t=Ct(),n={type:r.MemberExpression,computed:!0,object:e,property:t},X("]"),n}function at(e){return{type:r.CallExpression,callee:e,arguments:it()}}function ft(){var e;return V("new"),e={type:r.NewExpression,callee:ct(),arguments:[]},$("(")&&(e.arguments=it()),e}function lt(){var e,t;e=J("new"),t=e?ft():rt();while(f<h)if($("."))I(),t=ot(t);else if($("["))t=ut(t);else{if(!$("("))break;t=at(t)}return t}function ct(){var e,t;e=J("new"),t=e?ft():rt();while(f<h)if($("."))I(),t=ot(t);else{if(!$("["))break;t=ut(t)}return t}function ht(){var e=lt();return($("++")||$("--"))&&!R()&&(a&&e.type===r.Identifier&&k(e.name)&&U({},s.StrictLHSPostfix),G(e)||U({},s.InvalidLHSInAssignment),e={type:r.UpdateExpression,operator:I().value,argument:e,prefix:!1}),e}function pt(){var e,t;return $("++")||$("--")?(e=I(),t=pt(),a&&t.type===r.Identifier&&k(t.name)&&U({},s.StrictLHSPrefix),G(t)||U({},s.InvalidLHSInAssignment),t={type:r.UpdateExpression,operator:e.value,argument:t,prefix:!0},t):$("+")||$("-")||$("~")||$("!")?(t={type:r.UnaryExpression,operator:I().value,argument:pt()},t):J("delete")||J("void")||J("typeof")?(t={type:r.UnaryExpression,operator:I().value,argument:pt()},a&&t.operator==="delete"&&t.argument.type===r.Identifier&&z({},s.StrictDelete),t):ht()}function dt(){var e=pt();while($("*")||$("/")||$("%"))e={type:r.BinaryExpression,operator:I().value,left:e,right:pt()};return e}function vt(){var e=dt();while($("+")||$("-"))e={type:r.BinaryExpression,operator:I().value,left:e,right:dt()};return e}function mt(){var e=vt();while($("<<")||$(">>")||$(">>>"))e={type:r.BinaryExpression,operator:I().value,left:e,right:vt()};return e}function gt(){var e,t;t=d.allowIn,d.allowIn=!0,e=mt();while($("<")||$(">")||$("<=")||$(">=")||t&&J("in")||J("instanceof"))e={type:r.BinaryExpression,operator:I().value,left:e,right:mt()};return d.allowIn=t,e}function yt(){var e=gt();while($("==")||$("!=")||$("===")||$("!=="))e={type:r.BinaryExpression,operator:I().value,left:e,right:gt()};return e}function bt(){var e=yt();while($("&"))I(),e={type:r.BinaryExpression,operator:"&",left:e,right:yt()};return e}function wt(){var e=bt();while($("^"))I(),e={type:r.BinaryExpression,operator:"^",left:e,right:bt()};return e}function Et(){var e=wt();while($("|"))I(),e={type:r.BinaryExpression,operator:"|",left:e,right:wt()};return e}function St(){var e=Et();while($("&&"))I(),e={type:r.LogicalExpression,operator:"&&",left:e,right:Et()};return e}function xt(){var e=St();while($("||"))I(),e={type:r.LogicalExpression,operator:"||",left:e,right:St()};return e}function Tt(){var e,t,n;return e=xt(),$("?")&&(I(),t=d.allowIn,d.allowIn=!0,n=Nt(),d.allowIn=t,X(":"),e={type:r.ConditionalExpression,test:e,consequent:n,alternate:Nt()}),e}function Nt(){var e;return e=Tt(),K()&&(G(e)||U({},s.InvalidLHSInAssignment),a&&e.type===r.Identifier&&k(e.name)&&U({},s.StrictLHSAssignment),e={type:r.AssignmentExpression,operator:I().value,left:e,right:Nt()}),e}function Ct(){var e=Nt();if($(",")){e={type:r.SequenceExpression,expressions:[e]};while(f<h){if(!$(","))break;I(),e.expressions.push(Nt())}}return e}function kt(){var e=[],t;while(f<h){if($("}"))break;t=tn();if(typeof t=="undefined")break;e.push(t)}return e}function Lt(){var e;return X("{"),e=kt(),X("}"),{type:r.BlockStatement,body:e}}function At(){var e=I();return e.type!==t.Identifier&&W(e),{type:r.Identifier,name:e.value}}function Ot(e){var t=At(),n=null;return a&&k(t.name)&&z({},s.StrictVarName),e==="const"?(X("="),n=Nt()):$("=")&&(I(),n=Nt()),{type:r.VariableDeclarator,id:t,init:n}}function Mt(e){var t=[];while(f<h){t.push(Ot(e));if(!$(","))break;I()}return t}function _t(){var e;return V("var"),e=Mt(),Q(),{type:r.VariableDeclaration,declarations:e,kind:"var"}}function Dt(e){var t;return V(e),t=Mt(e),Q(),{type:r.VariableDeclaration,declarations:t,kind:e}}function Pt(){return X(";"),{type:r.EmptyStatement}}function Ht(){var e=Ct();return Q(),{type:r.ExpressionStatement,expression:e}}function Bt(){var e,t,n;return V("if"),X("("),e=Ct(),X(")"),t=Gt(),J("else")?(I(),n=Gt()):n=null,{type:r.IfStatement,test:e,consequent:t,alternate:n}}function jt(){var e,t,n;return V("do"),n=
808
- d.inIteration,d.inIteration=!0,e=Gt(),d.inIteration=n,V("while"),X("("),t=Ct(),X(")"),$(";")&&I(),{type:r.DoWhileStatement,body:e,test:t}}function Ft(){var e,t,n;return V("while"),X("("),e=Ct(),X(")"),n=d.inIteration,d.inIteration=!0,t=Gt(),d.inIteration=n,{type:r.WhileStatement,test:e,body:t}}function It(){var e=I();return{type:r.VariableDeclaration,declarations:Mt(),kind:e.value}}function qt(){var e,t,n,i,o,u,a;return e=t=n=null,V("for"),X("("),$(";")?I():(J("var")||J("let")?(d.allowIn=!1,e=It(),d.allowIn=!0,e.declarations.length===1&&J("in")&&(I(),i=e,o=Ct(),e=null)):(d.allowIn=!1,e=Ct(),d.allowIn=!0,J("in")&&(G(e)||U({},s.InvalidLHSInForIn),I(),i=e,o=Ct(),e=null)),typeof i=="undefined"&&X(";")),typeof i=="undefined"&&($(";")||(t=Ct()),X(";"),$(")")||(n=Ct())),X(")"),a=d.inIteration,d.inIteration=!0,u=Gt(),d.inIteration=a,typeof i=="undefined"?{type:r.ForStatement,init:e,test:t,update:n,body:u}:{type:r.ForInStatement,left:i,right:o,body:u,each:!1}}function Rt(){var e,n=null;return V("continue"),u[f]===";"?(I(),d.inIteration||U({},s.IllegalContinue),{type:r.ContinueStatement,label:null}):R()?(d.inIteration||U({},s.IllegalContinue),{type:r.ContinueStatement,label:null}):(e=q(),e.type===t.Identifier&&(n=At(),Object.prototype.hasOwnProperty.call(d.labelSet,n.name)||U({},s.UnknownLabel,n.name)),Q(),n===null&&!d.inIteration&&U({},s.IllegalContinue),{type:r.ContinueStatement,label:n})}function Ut(){var e,n=null;return V("break"),u[f]===";"?(I(),!d.inIteration&&!d.inSwitch&&U({},s.IllegalBreak),{type:r.BreakStatement,label:null}):R()?(!d.inIteration&&!d.inSwitch&&U({},s.IllegalBreak),{type:r.BreakStatement,label:null}):(e=q(),e.type===t.Identifier&&(n=At(),Object.prototype.hasOwnProperty.call(d.labelSet,n.name)||U({},s.UnknownLabel,n.name)),Q(),n===null&&!d.inIteration&&!d.inSwitch&&U({},s.IllegalBreak),{type:r.BreakStatement,label:n})}function zt(){var e,n=null;return V("return"),d.inFunctionBody||z({},s.IllegalReturn),u[f]===" "&&x(u[f+1])?(n=Ct(),Q(),{type:r.ReturnStatement,argument:n}):R()?{type:r.ReturnStatement,argument:null}:($(";")||(e=q(),!$("}")&&e.type!==t.EOF&&(n=Ct())),Q(),{type:r.ReturnStatement,argument:n})}function Wt(){var e,t;return a&&z({},s.StrictModeWith),V("with"),X("("),e=Ct(),X(")"),t=Gt(),{type:r.WithStatement,object:e,body:t}}function Xt(){var e,t=[],n;J("default")?(I(),e=null):(V("case"),e=Ct()),X(":");while(f<h){if($("}")||J("default")||J("case"))break;n=Gt();if(typeof n=="undefined")break;t.push(n)}return{type:r.SwitchCase,test:e,consequent:t}}function Vt(){var e,t,n,i,o;V("switch"),X("("),e=Ct(),X(")"),X("{");if($("}"))return I(),{type:r.SwitchStatement,discriminant:e};t=[],i=d.inSwitch,d.inSwitch=!0,o=!1;while(f<h){if($("}"))break;n=Xt(),n.test===null&&(o&&U({},s.MultipleDefaultsInSwitch),o=!0),t.push(n)}return d.inSwitch=i,X("}"),{type:r.SwitchStatement,discriminant:e,cases:t}}function $t(){var e;return V("throw"),R()&&U({},s.NewlineAfterThrow),e=Ct(),Q(),{type:r.ThrowStatement,argument:e}}function Jt(){var e;return V("catch"),X("("),$(")")||(e=Ct(),a&&e.type===r.Identifier&&k(e.name)&&z({},s.StrictCatchVariable)),X(")"),{type:r.CatchClause,param:e,body:Lt()}}function Kt(){var e,t=[],n=null;return V("try"),e=Lt(),J("catch")&&t.push(Jt()),J("finally")&&(I(),n=Lt()),t.length===0&&!n&&U({},s.NoCatchOrFinally),{type:r.TryStatement,block:e,guardedHandlers:[],handlers:t,finalizer:n}}function Qt(){return V("debugger"),Q(),{type:r.DebuggerStatement}}function Gt(){var e=q(),n,i;e.type===t.EOF&&W(e);if(e.type===t.Punctuator)switch(e.value){case";":return Pt();case"{":return Lt();case"(":return Ht();default:}if(e.type===t.Keyword)switch(e.value){case"break":return Ut();case"continue":return Rt();case"debugger":return Qt();case"do":return jt();case"for":return qt();case"function":return Zt();case"if":return Bt();case"return":return zt();case"switch":return Vt();case"throw":return $t();case"try":return Kt();case"var":return _t();case"while":return Ft();case"with":return Wt();default:}return n=Ct(),n.type===r.Identifier&&$(":")?(I(),Object.prototype.hasOwnProperty.call(d.labelSet,n.name)&&U({},s.Redeclaration,"Label",n.name),d.labelSet[n.name]=!0,i=Gt(),delete d.labelSet[n.name],{type:r.LabeledStatement,label:n,body:i}):(Q(),{type:r.ExpressionStatement,expression:n})}function Yt(){var e,n=[],i,o,u,l,c,p,v;X("{");while(f<h){i=q();if(i.type!==t.StringLiteral)break;e=tn(),n.push(e);if(e.expression.type!==r.Literal)break;o=g(i.range[0]+1,i.range[1]-1),o==="use strict"?(a=!0,u&&U(u,s.StrictOctalLiteral)):!u&&i.octal&&(u=i)}l=d.labelSet,c=d.inIteration,p=d.inSwitch,v=d.inFunctionBody,d.labelSet={},d.inIteration=!1,d.inSwitch=!1,d.inFunctionBody=!0;while(f<h){if($("}"))break;e=tn();if(typeof e=="undefined")break;n.push(e)}return X("}"),d.labelSet=l,d.inIteration=c,d.inSwitch=p,d.inFunctionBody=v,{type:r.BlockStatement,body:n}}function Zt(){var e,t,n=[],i,o,u,l,c,p;V("function"),o=q(),e=At(),a?k(o.value)&&U(o,s.StrictFunctionName):k(o.value)?(u=o,l=s.StrictFunctionName):C(o.value)&&(u=o,l=s.StrictReservedWord),X("(");if(!$(")")){p={};while(f<h){o=q(),t=At(),a?(k(o.value)&&U(o,s.StrictParamName),Object.prototype.hasOwnProperty.call(p,o.value)&&U(o,s.StrictParamDupe)):u||(k(o.value)?(u=o,l=s.StrictParamName):C(o.value)?(u=o,l=s.StrictReservedWord):Object.prototype.hasOwnProperty.call(p,o.value)&&(u=o,l=s.StrictParamDupe)),n.push(t),p[t.name]=!0;if($(")"))break;X(",")}}return X(")"),c=a,i=Yt(),a&&u&&U(u,l),a=c,{type:r.FunctionDeclaration,id:e,params:n,defaults:[],body:i,rest:null,generator:!1,expression:!1}}function en(){var e,t=null,n,i,o,u=[],l,c,p;V("function"),$("(")||(e=q(),t=At(),a?k(e.value)&&U(e,s.StrictFunctionName):k(e.value)?(n=e,i=s.StrictFunctionName):C(e.value)&&(n=e,i=s.StrictReservedWord)),X("(");if(!$(")")){p={};while(f<h){e=q(),o=At(),a?(k(e.value)&&U(e,s.StrictParamName),Object.prototype.hasOwnProperty.call(p,e.value)&&U(e,s.StrictParamDupe)):n||(k(e.value)?(n=e,i=s.StrictParamName):C(e.value)?(n=e,i=s.StrictReservedWord):Object.prototype.hasOwnProperty.call(p,e.value)&&(n=e,i=s.StrictParamDupe)),u.push(o),p[o.name]=!0;if($(")"))break;X(",")}}return X(")"),c=a,l=Yt(),a&&n&&U(n,i),a=c,{type:r.FunctionExpression,id:t,params:u,defaults:[],body:l,rest:null,generator:!1,expression:!1}}function tn(){var e=q();if(e.type===t.Keyword)switch(e.value){case"const":case"let":return Dt(e.value);case"function":return Zt();default:return Gt()}if(e.type!==t.EOF)return Gt()}function nn(){var e,n=[],i,o,u;while(f<h){i=q();if(i.type!==t.StringLiteral)break;e=tn(),n.push(e);if(e.expression.type!==r.Literal)break;o=g(i.range[0]+1,i.range[1]-1),o==="use strict"?(a=!0,u&&U(u,s.StrictOctalLiteral)):!u&&i.octal&&(u=i)}while(f<h){e=tn();if(typeof e=="undefined")break;n.push(e)}return n}function rn(){var e;return a=!1,e={type:r.Program,body:nn()},e}function sn(e,t,n,r,i){m(typeof n=="number","Comment must have valid position");if(v.comments.length>0&&v.comments[v.comments.length-1].range[1]>n)return;v.comments.push({type:e,value:t,range:[n,r],loc:i})}function on(){var e,t,n,r,i,o;e="",i=!1,o=!1;while(f<h){t=u[f];if(o)t=A(),S(t)?(n.end={line:l,column:f-c-1},o=!1,sn("Line",e,r,f-1,n),t==="\r"&&u[f]==="\n"&&++f,++l,c=f,e=""):f>=h?(o=!1,e+=t,n.end={line:l,column:h-c},sn("Line",e,r,h,n)):e+=t;else if(i)S(t)?(t==="\r"&&u[f+1]==="\n"?(++f,e+="\r\n"):e+=t,++l,++f,c=f,f>=h&&U({},s.UnexpectedToken,"ILLEGAL")):(t=A(),f>=h&&U({},s.UnexpectedToken,"ILLEGAL"),e+=t,t==="*"&&(t=u[f],t==="/"&&(e=e.substr(0,e.length-1),i=!1,++f,n.end={line:l,column:f-c},sn("Block",e,r,f,n),e="")));else if(t==="/"){t=u[f+1];if(t==="/")n={start:{line:l,column:f-c}},r=f,f+=2,o=!0,f>=h&&(n.end={line:l,column:f-c},o=!1,sn("Line",e,r,f,n));else{if(t!=="*")break;r=f,f+=2,i=!0,n={start:{line:l,column:f-c-2}},f>=h&&U({},s.UnexpectedToken,"ILLEGAL")}}else if(E(t))++f;else{if(!S(t))break;++f,t==="\r"&&u[f]==="\n"&&++f,++l,c=f}}}function un(){var e,t,n,r=[];for(e=0;e<v.comments.length;++e)t=v.comments[e],n={type:t.type,value:t.value},v.range&&(n.range=t.range),v.loc&&(n.loc=t.loc),r.push(n);v.comments=r}function an(){var e,r,i,s,o;return O(),e=f,r={start:{line:l,column:f-c}},i=v.advance(),r.end={line:l,column:f-c},i.type!==t.EOF&&(s=[i.range[0],i.range[1]],o=g(i.range[0],i.range[1]),v.tokens.push({type:n[i.type],value:o,range:s,loc:r})),i}function fn(){var e,t,n,r;return O(),e=f,t={start:{line:l,column:f-c}},n=v.scanRegExp(),t.end={line:l,column:f-c},v.tokens.length>0&&(r=v.tokens[v.tokens.length-1],r.range[0]===e&&r.type==="Punctuator"&&(r.value==="/"||r.value==="/=")&&v.tokens.pop()),v.tokens.push({type:"RegularExpression",value:n.literal,range:[e,f],loc:t}),n}function ln(){var e,t,n,r=[];for(e=0;e<v.tokens.length;++e)t=v.tokens[e],n={type:t.type,value:t.value},v.range&&(n.range=t.range),v.loc&&(n.loc=t.loc),r.push(n);v.tokens=r}function cn(e){return{type:r.Literal,value:e.value}}function hn(e){return{type:r.Literal,value:e.value,raw:g(e.range[0],e.range[1])}}function pn(e,t){return function(n){function i(e){return e.type===r.LogicalExpression||e.type===r.BinaryExpression}function s(n){i(n.left)&&s(n.left),i(n.right)&&s(n.right),e&&typeof n.range=="undefined"&&(n.range=[n.left.range[0],n.right.range[1]]),t&&typeof n.loc=="undefined"&&(n.loc={start:n.left.loc.start,end:n.right.loc.end})}return function(){var o,u,a;O(),u=[f,0],a={start:{line:l,column:f-c}},o=n.apply(null,arguments);if(typeof o!="undefined")return e&&typeof o.range=="undefined"&&(u[1]=f,o.range=u),t&&typeof o.loc=="undefined"&&(a.end={line:l,column:f-c},o.loc=a),i(o)&&s(o),o.type===r.MemberExpression&&(typeof o.object.range!="undefined"&&(o.range[0]=o.object.range[0]),typeof o.object.loc!="undefined"&&(o.loc.start=o.object.loc.start)),o.type===r.CallExpression&&(typeof o.callee.range!="undefined"&&(o.range[0]=o.callee.range[0]),typeof o.callee.loc!="undefined"&&(o.loc.start=o.callee.loc.start)),o}}}function dn(){var e;v.comments&&(v.skipComment=O,O=on),v.raw&&(v.createLiteral=cn,cn=hn);if(v.range||v.loc)e=pn(v.range,v.loc),v.parseAdditiveExpression=vt,v.parseAssignmentExpression=Nt,v.parseBitwiseANDExpression=bt,v.parseBitwiseORExpression=Et,v.parseBitwiseXORExpression=wt,v.parseBlock=Lt,v.parseFunctionSourceElements=Yt,v.parseCallMember=at,v.parseCatchClause=Jt,v.parseComputedMember=ut,v.parseConditionalExpression=Tt,v.parseConstLetDeclaration=Dt,v.parseEqualityExpression=yt,v.parseExpression=Ct,v.parseForVariableDeclaration=It,v.parseFunctionDeclaration=Zt,v.parseFunctionExpression=en,v.parseLogicalANDExpression=St,v.parseLogicalORExpression=xt,v.parseMultiplicativeExpression=dt,v.parseNewExpression=ft,v.parseNonComputedMember=ot,v.parseNonComputedProperty=st,v.parseObjectProperty=tt,v.parseObjectPropertyKey=et,v.parsePostfixExpression=ht,v.parsePrimaryExpression=rt,v.parseProgram=rn,v.parsePropertyFunction=Z,v.parseRelationalExpression=gt,v.parseStatement=Gt,v.parseShiftExpression=mt,v.parseSwitchCase=Xt,v.parseUnaryExpression=pt,v.parseVariableDeclaration=Ot,v.parseVariableIdentifier=At,vt=e(v.parseAdditiveExpression),Nt=e(v.parseAssignmentExpression),bt=e(v.parseBitwiseANDExpression),Et=e(v.parseBitwiseORExpression),wt=e(v.parseBitwiseXORExpression),Lt=e(v.parseBlock),Yt=e(v.parseFunctionSourceElements),at=e(v.parseCallMember),Jt=e(v.parseCatchClause),ut=e(v.parseComputedMember),Tt=e(v.parseConditionalExpression),Dt=e(v.parseConstLetDeclaration),yt=e(v.parseEqualityExpression),Ct=e(v.parseExpression),It=e(v.parseForVariableDeclaration),Zt=e(v.parseFunctionDeclaration),en=e(v.parseFunctionExpression),St=e(v.parseLogicalANDExpression),xt=e(v.parseLogicalORExpression),dt=e(v.parseMultiplicativeExpression),ft=e(v.parseNewExpression),ot=e(v.parseNonComputedMember),st=e(v.parseNonComputedProperty),tt=e(v.parseObjectProperty),et=e(v.parseObjectPropertyKey),ht=e(v.parsePostfixExpression),rt=e(v.parsePrimaryExpression),rn=e(v.parseProgram),Z=e(v.parsePropertyFunction),gt=e(v.parseRelationalExpression),Gt=e(v.parseStatement),mt=e(v.parseShiftExpression),Xt=e(v.parseSwitchCase),pt=e(v.parseUnaryExpression),Ot=e(v.parseVariableDeclaration),At=e(v.parseVariableIdentifier);typeof v.tokens!="undefined"&&(v.advance=F,v.scanRegExp=B,F=an,B=fn)}function vn(){typeof v.skipComment=="function"&&(O=v.skipComment),v.raw&&(cn=v.createLiteral);if(v.range||v.loc)vt=v.parseAdditiveExpression,Nt=v.parseAssignmentExpression,bt=v.parseBitwiseANDExpression,Et=v.parseBitwiseORExpression,wt=v.parseBitwiseXORExpression,Lt=v.parseBlock,Yt=v.parseFunctionSourceElements,at=v.parseCallMember,Jt=v.parseCatchClause,ut=v.parseComputedMember,Tt=v.parseConditionalExpression,Dt=v.parseConstLetDeclaration,yt=v.parseEqualityExpression,Ct=v.parseExpression,It=v.parseForVariableDeclaration,Zt=v.parseFunctionDeclaration,en=v.parseFunctionExpression,St=v.parseLogicalANDExpression,xt=v.parseLogicalORExpression,dt=v.parseMultiplicativeExpression,ft=v.parseNewExpression,ot=v.parseNonComputedMember,st=v.parseNonComputedProperty,tt=v.parseObjectProperty,et=v.parseObjectPropertyKey,rt=v.parsePrimaryExpression,ht=v.parsePostfixExpression,rn=v.parseProgram,Z=v.parsePropertyFunction,gt=v.parseRelationalExpression,Gt=v.parseStatement,mt=v.parseShiftExpression,Xt=v.parseSwitchCase,pt=v.parseUnaryExpression,Ot=v.parseVariableDeclaration,At=v.parseVariableIdentifier;typeof v.scanRegExp=="function"&&(F=v.advance,B=v.scanRegExp)}function mn(e){var t=e.length,n=[],r;for(r=0;r<t;++r)n[r]=e.charAt(r);return n}function gn(e,t){var n,r;r=String,typeof e!="string"&&!(e instanceof String)&&(e=r(e)),u=e,f=0,l=u.length>0?1:0,c=0,h=u.length,p=null,d={allowIn:!0,labelSet:{},lastParenthesized:null,inFunctionBody:!1,inIteration:!1,inSwitch:!1},v={},typeof t!="undefined"&&(v.range=typeof t.range=="boolean"&&t.range,v.loc=typeof t.loc=="boolean"&&t.loc,v.raw=typeof t.raw=="boolean"&&t.raw,typeof t.tokens=="boolean"&&t.tokens&&(v.tokens=[]),typeof t.comment=="boolean"&&t.comment&&(v.comments=[]),typeof t.tolerant=="boolean"&&t.tolerant&&(v.errors=[])),h>0&&typeof u[0]=="undefined"&&(e instanceof String&&(u=e.valueOf()),typeof u[0]=="undefined"&&(u=mn(e))),dn();try{n=rn(),typeof v.comments!="undefined"&&(un(),n.comments=v.comments),typeof v.tokens!="undefined"&&(ln(),n.tokens=v.tokens),typeof v.errors!="undefined"&&(n.errors=v.errors)}catch(i){throw i}finally{vn(),v={}}return n}var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v;t={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},n={},n[t.BooleanLiteral]="Boolean",n[t.EOF]="<end>",n[t.Identifier]="Identifier",n[t.Keyword]="Keyword",n[t.NullLiteral]="Null",n[t.NumericLiteral]="Numeric",n[t.Punctuator]="Punctuator",n[t.StringLiteral]="String",r={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},i={Data:1,Get:2,Set:4},s={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},o={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},typeof "esprima"[0]=="undefined"&&(g=function(t,n){return u.slice(t,n).join("")}),e.version="1.0.0-dev",e.parse=gn,e.Syntax=function(){var e,t={};typeof Object.create=="function"&&(t=Object.create(null));for(e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);return typeof Object.freeze=="function"&&Object.freeze(t),t}()}),function(e){function t(t){if(typeof t.data!="string")return;var n=t.handler,r=t.data.toLowerCase().split(" ");t.handler=function(t){if(!(this===t.target||!/textarea|select/i.test(t.target.nodeName)&&t.target.type!=="text"))return;var i=t.type!=="keypress"&&e.hotkeys.specialKeys[t.which],s=String.fromCharCode(t.which).toLowerCase(),o,u="",a={};t.altKey&&i!=="alt"&&(u+="alt+"),t.ctrlKey&&i!=="ctrl"&&(u+="ctrl+"),t.metaKey&&!t.ctrlKey&&i!=="meta"&&(u+="meta+"),t.shiftKey&&i!=="shift"&&(u+="shift+"),i?a[u+i]=!0:(a[u+s]=!0,a[u+e.hotkeys.shiftNums[s]]=!0,u==="shift+"&&(a[e.hotkeys.shiftNums[s]]=!0));for(var f=0,l=r.length;f<l;f++)if(a[r[f]])return n.apply(this,arguments)}}e.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",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",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}},e.each(["keydown","keyup","keypress"],function(){e.event.special[this]={add:t}})}(jQuery);var Hogan={};(function(e,t){function n(e,t,n,r){function i(){}function s(){}i.prototype=e,s.prototype=e.subs;var o,u=new i;u.subs=new s,u.subsText={},u.ib();for(o in t)u.subs[o]=t[o],u.subsText[o]=r;for(o in n)u.partials[o]=n[o];return u}function f(e){return String(e===null||e===undefined?"":e)}function l(e){return e=f(e),a.test(e)?e.replace(r,"&amp;").replace(i,"&lt;").replace(s,"&gt;").replace(o,"&#39;").replace(u,"&quot;"):e}e.Template=function(e,t,n,r){e=e||{},this.r=e.code||this.r,this.c=n,this.options=r,this.text=t||"",this.partials=e.partials||{},this.subs=e.subs||{},this.ib()},e.Template.prototype={r:function(e,t,n){return""},v:l,t:f,render:function(t,n,r){return this.ri([t],n||{},r)},ri:function(e,t,n){return this.r(e,t,n)},ep:function(e,t){var r=this.partials[e],i=t[r.name];if(r.instance&&r.base==i)return r.instance;if(typeof i=="string"){if(!this.c)throw new Error("No compiler available.");i=this.c.compile(i,this.options)}return i?(this.partials[e].base=i,r.subs&&(i=n(i,r.subs,r.partials,this.text)),this.partials[e].instance=i,i):null},rp:function(e,t,n,r){var i=this.ep(e,n);return i?i.ri(t,n,r):""},rs:function(e,t,n){var r=e[e.length-1];if(!c(r)){n(e,t,this);return}for(var i=0;i<r.length;i++)e.push(r[i]),n(e,t,this),e.pop()},s:function(e,t,n,r,i,s,o){var u;return c(e)&&e.length===0?!1:(typeof e=="function"&&(e=this.ms(e,t,n,r,i,s,o)),u=e===""||!!e,!r&&u&&t&&t.push(typeof e=="object"?e:t[t.length-1]),u)},d:function(e,t,n,r){var i=e.split("."),s=this.f(i[0],t,n,r),o=null;if(e==="."&&c(t[t.length-2]))s=t[t.length-1];else for(var u=1;u<i.length;u++)s&&typeof s=="object"&&s[i[u]]!=null?(o=s,s=s[i[u]]):s="";return r&&!s?!1:(!r&&typeof s=="function"&&(t.push(o),s=this.mv(s,t,n),t.pop()),s)},f:function(e,t,n,r){var i=!1,s=null,o=!1;for(var u=t.length-1;u>=0;u--){s=t[u];if(s&&typeof s=="object"&&s[e]!=null){i=s[e],o=!0;break}}return o?(!r&&typeof i=="function"&&(i=this.mv(i,t,n)),i):r?!1:""},ls:function(e,t,n,r,i){var s=this.options.delimiters;return this.options.delimiters=i,this.b(this.ct(f(e.call(t,r)),t,n)),this.options.delimiters=s,!1},ct:function(e,t,n){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(e,this.options).render(t,n)},b:t?function(e){this.buf.push(e)}:function(e){this.buf+=e},fl:t?function(){var e=this.buf.join("");return this.buf=[],e}:function(){var e=this.buf;return this.buf="",e},ib:function(){this.buf=t?[]:""},ms:function(e,t,n,r,i,s,o){var u,a=t[t.length-1],f=e.call(a);return typeof f=="function"?r?!0:(u=this.activeSub&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(f,a,n,u.substring(i,s),o)):f},mv:function(e,t,n){var r=t[t.length-1],i=e.call(r);return typeof i=="function"?this.ct(f(i.call(r)),r,n):i},sub:function(e,t,n,r){var i=this.subs[e];i&&(this.activeSub=e,i(t,n,this,r),this.activeSub=!1)}};var r=/&/g,i=/</g,s=/>/g,o=/\'/g,u=/\"/g,a=/[&<>\"\']/,c=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}})(typeof exports!="undefined"?exports:Hogan),jQuery.tablesorter.addParser({id:"size",is:function(e){return e.trim().match(/^\d+(\.\d+)? (Bytes|KB|MB|GB|TB|PB)$/)},format:function(e){var t=["Bytes","KB","MB","GB","TB","PB"],n=e.trim().split(" ");return parseFloat(n.shift())*Math.pow(1024,_.indexOf(t,n.shift()))},type:"numeric"}),window.Genghis={Models:{},Collections:{},Views:{},Templates:{},defaults:{codeMirror:{mode:"application/json",lineNumbers:!0,tabSize:4,indentUnit:4,matchBrackets:!0}},boot:function(e){e+=e.charAt(e.length-1)=="/"?"":"/",window.app=new Genghis.Views.App({baseUrl:e}),Backbone.history.start({pushState:!0,root:e})}},Genghis.version="2.1.0",Genghis.Templates.Alert=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="alert'),r.s(r.f("block",e,t,1),e,t,0,29,41,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" alert-block")}),e.pop()),r.b(" alert-"),r.b(r.v(r.f("level",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <a class="close" href="#">×</a>'),r.b("\n"+n),r.s(r.f("block",e,t,1),e,t,0,122,148,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" <p>"),n.b(n.t(n.f("msg",e,t,0))),n.b("</p>"),n.b("\n")}),e.pop()),r.s(r.f("block",e,t,1),e,t,1,0,0,"")||(r.b(" "),r.b(r.t(r.f("msg",e,t,0))),r.b("\n")),r.b("</div>"),r.fl()}}),Genghis.Templates.CollectionRow=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<td>"),r.b("\n"+n),r.b(' <a href="'),r.b(r.v(r.f("url",e,t,0))),r.b('" class="name value">'),r.b(r.v(r.f("name",e,t,0))),r.b("</a>"),r.b("\n"+n),r.b("</td>"),r.b("\n"+n),r.b("<td>"),r.b("\n"+n),r.b(' <span class="documents value">'),r.b(r.v(r.f("count",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b("</td>"),r.b("\n"+n),r.b("<td>"),r.b("\n"+n),r.b(' <span class="indexes has-details value">'),r.b(r.v(r.f("indexCount",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(' <div class="details" title="'),r.b(r.v(r.f("indexCount",e,t,0))),r.b(" Index"),r.s(r.f("indexesIsPlural",e,t,1),e,t,0,282,284,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b("es")}),e.pop()),r.b('">'),r.b("\n"+n),r.s(r.f("indexCount",e,t,1),e,t,0,334,501,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(' <ul class="index-details">'),r.b("\n"+n),r.s(r.f("indexes",e,t,1),e,t,0,404,460,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" <li>"),n.b(n.t(n.d(".",e,t,0))),n.b("</li>"),n.b("\n")}),e.pop()),r.b(" </ul>"),r.b("\n")}),e.pop()),r.s(r.f("indexCount",e,t,1),e,t,1,0,0,"")||(r.b(" <em>None.</em>"),r.b("\n")),r.b(" </div>"),r.b("\n"+n),r.b("</td>"),r.b("\n"+n),r.b('<td class="action-column">'),r.b("\n"+n),r.b(' <button class="btn btn-mini btn-danger destroy">Remove</button>'),r.b("\n"+n),r.b("</td>"),r.b("\n"),r.fl()}}),Genghis.Templates.Collections=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<header><h2>"),r.b(r.v(r.f("title",e,t,0))),r.b("</h2></header>"),r.b("\n"+n),r.b('<div class="content">'),r.b("\n"+n),r.b(" <table>"),r.b("\n"+n),r.b(" <thead>"),r.b("\n"+n),r.b(" <tr>"),r.b("\n"+n),r.b(" <th>name</th>"),r.b("\n"+n),r.b(" <th>documents</th>"),r.b("\n"+n),r.b(" <th>indexes</th>"),r.b("\n"+n),r.b(" <th></th>"),r.b("\n"+n),r.b(" </tr>"),r.b("\n"+n),r.b(" </thead>"),r.b("\n"+n),r.b(" <tbody>"),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b("</div>"),r.b("\n"+n),r.b('<div class="add-form inactive form-horizontal">'),r.b("\n"+n),r.b(' <input class="name span4" type="text" size="30">'),r.b("\n"+n),r.b(' <button class="show btn">Add collection</button>'),r.b("\n"+n),r.b(' <button class="add btn btn-primary">Add collection</button>'),r.b("\n"+n),r.b(' <button class="cancel btn">Cancel</button>'),r.b("\n"+n),r.b("</div>"),r.b("\n"),r.fl()}}),Genghis.Templates.DatabaseRow=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<td>"),r.b("\n"+n),r.b(' <a href="'),r.b(r.v(r.f("url",e,t,0))),r.b('" class="name value">'),r.b(r.v(r.f("name",e,t,0))),r.b("</a>"),r.b("\n"+n),r.b("</td>"),r.b("\n"+n),r.b("<td>"),r.b("\n"+n),r.b(' <span class="collections has-details value">'),r.b(r.v(r.f("count",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(' <div class="details" title="'),r.b(r.v(r.f("count",e,t,0))),r.b(" Collection"),r.s(r.f("isPlural",e,t,1),e,t,0,210,211,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b("s")}),e.pop()),r.b('">'),r.b("\n"+n),r.s(r.f("count",e,t,1),e,t,0,249,520,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(" <ul>"),r.b("\n"+n),r.s(r.f("firstChildren",e,t,1),e,t,0,303,357,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" <li>"),n.b(n.v(n.d(".",e,t,0))),n.b("</li>"),n.b("\n")}),e.pop()),r.s(r.f("hasMoreChildren",e,t,1),e,t,0,416,471,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" <li>&hellip;</li>"),n.b("\n")}),e.pop()),r.b(" </ul>"),r.b("\n")}),e.pop()),r.s(r.f("count",e,t,1),e,t,1,0,0,"")||(r.b(" <em>None.</em>"),r.b("\n")),r.b(" </div>"),r.b("\n"+n),r.b("</td>"),r.b("\n"+n),r.b("<td>"),r.b("\n"+n),r.b(' <span class="size value">'),r.b(r.v(r.f("humanSize",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b("</td>"),r.b("\n"+n),r.b('<td class="action-column">'),r.b("\n"+n),r.b(' <button class="btn btn-mini btn-danger destroy">Remove</button>'),r.b("\n"+n),r.b("</td>"),r.fl()}}),Genghis.Templates.Databases=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<header><h2>"),r.b(r.v(r.f("title",e,t,0))),r.b("</h2></header>"),r.b("\n"+n),r.b('<div class="content">'),r.b("\n"+n),r.b(" <table>"),r.b("\n"+n),r.b(" <thead>"),r.b("\n"+n),r.b(" <tr>"),r.b("\n"+n),r.b(" <th>name</th>"),r.b("\n"+n),r.b(" <th>collections</th>"),r.b("\n"+n),r.b(" <th>size</th>"),r.b("\n"+n),r.b(" <th></th>"),r.b("\n"+n),r.b(" </tr>"),r.b("\n"+n),r.b(" </thead>"),r.b("\n"+n),r.b(" <tbody>"),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b("</div>"),r.b("\n"+n),r.b('<div class="add-form inactive form-horizontal">'),r.b("\n"+n),r.b(' <input class="name span4" type="text" size="30">'),r.b("\n"+n),r.b(' <button class="show btn">Add database</button>'),r.b("\n"+n),r.b(' <button class="add btn btn-primary">Add database</button>'),r.b("\n"+n),r.b(' <button class="cancel btn">Cancel</button>'),r.b("\n"+n),r.b("</div>"),r.fl()}}),Genghis.Templates.Document=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<header>"),r.b("\n"+n),r.b(" <h2>"),r.b("\n"+n),r.b(" "),r.b(r.v(r.d("model.prettyId",e,t,0))),r.b("\n"+n),r.s(r.d("model.prettyTime",e,t,1),e,t,0,78,184,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(' <small><time datetime="'),n.b(n.v(n.d("model.prettyTime",e,t,0))),n.b('">'),n.b(n.v(n.d("model.prettyTime",e,t,0))),n.b("</time></small>"),n.b("\n")}),e.pop()),r.b(" </h2>"),r.b("\n"+n),r.b("</header>"),r.b("\n"+n),r.b('<div class="content document-wrapper"></div>'),r.fl()}}),Genghis.Templates.DocumentView=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="well">'),r.b("\n"+n),r.b(' <div class="document-actions">'),r.b("\n"+n),r.b(' <button class="btn btn-small btn-primary save">Save</button>'),r.b("\n"+n),r.b(' <button class="btn btn-small cancel">Cancel</button>'),r.b("\n"+n),r.b(' <button class="btn btn-small edit">Edit</button>'),r.b("\n"+n),r.b(' <button class="btn btn-small btn-danger destroy">Delete</button>'),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b("\n"+n),r.b(" <h3>"),r.b("\n"+n),r.b(' <a class="id" href="'),r.b(r.v(r.f("url",e,t,0))),r.b('">'),r.b(r.v(r.f("prettyId",e,t,0))),r.b("</a>"),r.b("\n"+n),r.s(r.f("prettyTime",e,t,1),e,t,0,418,512,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(' <small><time datetime="'),n.b
809
- (n.v(n.f("prettyTime",e,t,0))),n.b('">'),n.b(n.v(n.f("prettyTime",e,t,0))),n.b("</time></small>"),n.b("\n")}),e.pop()),r.b(" </h3>"),r.b("\n"+n),r.b("\n"+n),r.b(' <div class="document"></div>'),r.b("\n"+n),r.b("</div>"),r.b("\n"),r.fl()}}),Genghis.Templates.Documents=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<header><h2>Documents</h2></header>"),r.b("\n"+n),r.b('<div class="controls">'),r.b("\n"+n),r.b(' <button class="add-document btn btn-large">Add document</button>'),r.b("\n"+n),r.b(' <div class="pagination-wrapper top"></div>'),r.b("\n"+n),r.b("</div>"),r.b("\n"+n),r.b('<div class="content document-wrapper"></div>'),r.b("\n"+n),r.b('<div class="controls">'),r.b("\n"+n),r.b(' <button class="add-document btn btn-large">Add document</button>'),r.b("\n"+n),r.b(' <div class="pagination-wrapper top"></div>'),r.b("\n"+n),r.b("</div>"),r.b("\n"),r.fl()}}),Genghis.Templates.KeyboardShortcuts=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div id="keyboard-shortcuts" class="modal">'),r.b("\n"+n),r.b(' <div class="modal-header">'),r.b("\n"+n),r.b(' <a href="#" class="close">×</a>'),r.b("\n"+n),r.b(" <h3>Keyboard shortcuts</h3>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="modal-body">'),r.b("\n"+n),r.b(" <ul>"),r.b("\n"+n),r.b(" <li>"),r.b("\n"+n),r.b(" <h4>Global</h4>"),r.b("\n"+n),r.b(" <dl>"),r.b("\n"+n),r.b(" <dt><kbd>?</kbd></dt>"),r.b("\n"+n),r.b(" <dd>This cheat sheet</dd>"),r.b("\n"+n),r.b("\n"+n),r.b(" <dt><kbd>s</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Go to servers</dd>"),r.b("\n"+n),r.b("\n"+n),r.b(" <dt><kbd>u</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Go up one level</dd>"),r.b("\n"+n),r.b(" </dl>"),r.b("\n"+n),r.b("\n"+n),r.b(" <h4>Servers</h4>"),r.b("\n"+n),r.b(" <dl>"),r.b("\n"+n),r.b(" <dt><kbd>c</kbd></dt>"),r.b("\n"+n),r.b(" <dd>New server</dd>"),r.b("\n"+n),r.b(" </dl>"),r.b("\n"+n),r.b("\n"+n),r.b(" <h4>Databases</h4>"),r.b("\n"+n),r.b(" <dl>"),r.b("\n"+n),r.b(" <dt><kbd>c</kbd></dt>"),r.b("\n"+n),r.b(" <dd>New database</dd>"),r.b("\n"+n),r.b(" </dl>"),r.b("\n"+n),r.b(" </li>"),r.b("\n"+n),r.b(" <li>"),r.b("\n"+n),r.b(" <h4>Collections</h4>"),r.b("\n"+n),r.b(" <dl>"),r.b("\n"+n),r.b(" <dt><kbd>c</kbd></dt>"),r.b("\n"+n),r.b(" <dd>New collection</dd>"),r.b("\n"+n),r.b(" </dl>"),r.b("\n"+n),r.b("\n"+n),r.b(" <h4>Documents</h4>"),r.b("\n"+n),r.b(" <dl>"),r.b("\n"+n),r.b(" <dt><kbd>/</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Search</dd>"),r.b("\n"+n),r.b("\n"+n),r.b(" <dt><kbd>c</kbd></dt>"),r.b("\n"+n),r.b(" <dd>New document</dd>"),r.b("\n"+n),r.b("\n"+n),r.b(" <dt><kbd>n</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Next page</dd>"),r.b("\n"+n),r.b("\n"+n),r.b(" <dt><kbd>p</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Previous page</dd>"),r.b("\n"+n),r.b("\n"+n),r.b("<!--"),r.b("\n"+n),r.b(" <dt><kbd>-</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Collapse all</dd>"),r.b("\n"+n),r.b("\n"+n),r.b(" <dt><kbd>+</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Expand all</dd>"),r.b("\n"+n),r.b("\n"+n),r.b(" <dt><kbd>Alt+1</kbd> &ndash; <kbd>Alt+9</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Expand to depth</dd>"),r.b("\n"+n),r.b("-->"),r.b("\n"+n),r.b(" </dl>"),r.b("\n"+n),r.b(" </li>"),r.b("\n"+n),r.b(" </ul>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b("</div>"),r.fl()}}),Genghis.Templates.Masthead=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="container">'),r.b("\n"+n),r.b(" "),r.s(r.f("heading",e,t,1),e,t,0,42,64,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b("<h1>"),n.b(n.v(n.f("heading",e,t,0))),n.b("</h1>")}),e.pop()),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("content",e,t,0))),r.b("\n"+n),r.b("</div>"),r.fl()}}),Genghis.Templates.Nav=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<ul class="nav">'),r.b("\n"+n),r.b(' <li class="nav-section servers"><a class="btn-servers" href="'),r.b(r.v(r.f("baseUrl",e,t,0))),r.b('">Servers</a></li>'),r.b("\n"+n),r.b(' <li class="nav-section dropdown server"></li>'),r.b("\n"+n),r.b(' <li class="nav-section dropdown database"></li>'),r.b("\n"+n),r.b(' <li class="nav-section dropdown collection"></li>'),r.b("\n"+n),r.b("</ul>"),r.b("\n"),r.fl()}}),Genghis.Templates.NavSection=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<a href="#" class="dropdown-toggle" data-toggle="dropdown">'),r.b(r.v(r.f("id",e,t,0))),r.b("</a>"),r.b("\n"+n),r.b('<ul class="dropdown-menu"></ul>'),r.b("\n"),r.fl()}}),Genghis.Templates.NavSectionMenu=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.s(r.d("collection.firstChildren",e,t,1),e,t,0,31,130,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(' <li><a href="'),r.b(r.v(r.f("url",e,t,0))),r.b('">'),r.b("\n"+n),r.b(" "),r.b(r.v(r.f("id",e,t,0))),r.b("\n"+n),r.b(" <span>"),r.b(r.v(r.f("humanCount",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(" </a></li>"),r.b("\n")}),e.pop()),r.s(r.d("collection.hasMoreChildren",e,t,1),e,t,0,195,287,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(' <li class="divider"></li>'),r.b("\n"+n),r.b(' <li><a href="'),r.b(r.v(r.d("collection.url",e,t,0))),r.b('">More &raquo;</a></li>'),r.b("\n")}),e.pop()),r.fl()}}),Genghis.Templates.NewDocument=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div id="new-document" class="modal editor">'),r.b("\n"+n),r.b(' <div class="modal-header">'),r.b("\n"+n),r.b(' <a class="close" data-dismiss="modal">&times;</a>'),r.b("\n"+n),r.b(" <h3>New Document</h3>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="modal-body">'),r.b("\n"+n),r.b(' <div class="wrapper">'),r.b("\n"+n),r.b(' <div id="editor-new" class="genghis-document-editor"></div>'),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="modal-footer">'),r.b("\n"+n),r.b(' <button class="btn cancel">Cancel</button>'),r.b("\n"+n),r.b(' <button class="btn btn-primary save">Save</button>'),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b("</div>"),r.fl()}}),Genghis.Templates.Pagination=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="pagination pagination-right">'),r.b("\n"+n),r.b(" <ul>"),r.b("\n"+n),r.b(' <li class="prev'),r.s(r.f("isFirst",e,t,1),e,t,0,82,91,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" disabled")}),e.pop()),r.b('">'),r.b("\n"+n),r.b(" <a"),r.s(r.f("isFirst",e,t,1),e,t,1,0,0,"")||(r.b(' href="'),r.b(r.v(r.f("prevUrl",e,t,0))),r.b('"')),r.b(">&larr;</a>"),r.b("\n"+n),r.b(" </li>"),r.b("\n"+n),r.b("\n"+n),r.s(r.f("isStart",e,t,1),e,t,1,0,0,"")||(r.b(' <li class="first"><a href="'),r.b(r.v(r.f("firstUrl",e,t,0))),r.b('">1</a></li>'),r.b("\n"+n),r.b(' <li class="disabled"><a>&hellip;</a></li>'),r.b("\n")),r.b("\n"+n),r.b("\n"+n),r.s(r.f("pageUrls",e,t,1),e,t,0,361,460,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" <li"),n.s(n.f("active",e,t,1),e,t,0,386,401,"{{ }}")&&(n.rs(e,t,function(e,t,n){n.b(' class="active"')}),e.pop()),n.b('><a href="'),n.b(n.v(n.f("url",e,t,0))),n.b('">'),n.b(n.v(n.f("index",e,t,0))),n.b("</a></li>"),n.b("\n")}),e.pop()),r.b("\n"+n),r.s(r.f("isEnd",e,t,1),e,t,1,0,0,"")||(r.b(' <li class="disabled"><a>&hellip;</a></li>'),r.b("\n"+n),r.b(' <li class="last"><a href="'),r.b(r.v(r.f("lastUrl",e,t,0))),r.b('">'),r.b(r.v(r.f("last",e,t,0))),r.b("</a></li>"),r.b("\n")),r.b("\n"+n),r.b(' <li class="next'),r.s(r.f("isLast",e,t,1),e,t,0,663,672,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" disabled")}),e.pop()),r.b('">'),r.b("\n"+n),r.b(" <a"),r.s(r.f("isLast",e,t,1),e,t,1,0,0,"")||(r.b(' href="'),r.b(r.v(r.f("nextUrl",e,t,0))),r.b('"')),r.b(">&rarr;</a>"),r.b("\n"+n),r.b(" </li>"),r.b("\n"+n),r.b(" </ul>"),r.b("\n"+n),r.b("</div>"),r.fl()}}),Genghis.Templates.Search=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<input id="navbar-query" class="search-query" name="q" type="text" value="'),r.b(r.v(r.f("query",e,t,0))),r.b('" />'),r.b("\n"+n),r.b('<div class="search-advanced">'),r.b("\n"+n),r.b(' <div class="well"></div>'),r.b("\n"+n),r.b(' <div class="form-actions">'),r.b("\n"+n),r.b(' <button class="search btn btn-primary">Search</button>'),r.b("\n"+n),r.b(' <button class="cancel btn">Cancel</button>'),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b("</div>"),r.b("\n"+n),r.b('<span class="grippie"></span>'),r.b("\n"),r.fl()}}),Genghis.Templates.ServerRow=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.s(r.f("error",e,t,1),e,t,0,12,167,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(' <td colspan="3">'),r.b("\n"+n),r.b(' <span class="value">'),r.b(r.v(r.f("name",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(' <span class="label label-important" title="'),r.b(r.v(r.f("error",e,t,0))),r.b('">Error</span>'),r.b("\n"+n),r.b(" </td>"),r.b("\n")}),e.pop()),r.s(r.f("error",e,t,1),e,t,1,0,0,"")||(r.b(" <td>"),r.b("\n"+n),r.b(' <a href="'),r.b(r.v(r.f("url",e,t,0))),r.b('" class="name value">'),r.b(r.v(r.f("name",e,t,0))),r.b("</a>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b(" <td>"),r.b("\n"+n),r.b(' <span class="databases has-details value">'),r.b(r.v(r.f("count",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(' <div class="details" title="'),r.b(r.v(r.f("count",e,t,0))),r.b(" Database"),r.s(r.f("isPlural",e,t,1),e,t,0,423,424,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b("s")}),e.pop()),r.b('">'),r.b("\n"+n),r.s(r.f("count",e,t,1),e,t,0,466,773,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(" <ul>"),r.b("\n"+n),r.s(r.f("firstChildren",e,t,1),e,t,0,528,590,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" <li>"),n.b(n.v(n.d(".",e,t,0))),n.b("</li>"),n.b("\n")}),e.pop()),r.s(r.f("hasMoreChildren",e,t,1),e,t,0,653,716,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" <li>&hellip;</li>"),n.b("\n")}),e.pop()),r.b(" </ul>"),r.b("\n")}),e.pop()),r.s(r.f("count",e,t,1),e,t,1,0,0,"")||(r.b(" <em>None.</em>"),r.b("\n")),r.b(" </div>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b(" <td>"),r.b("\n"+n),r.b(' <span class="size value">'),r.b(r.v(r.f("humanSize",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(" </td>"),r.b("\n")),r.b('<td class="action-column">'),r.b("\n"+n),r.b(" "),r.s(r.f("editable",e,t,1),e,t,0,1026,1089,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b('<button class="btn btn-mini btn-danger destroy">Remove</button>')}),e.pop()),r.b("\n"+n),r.b("</td>"),r.b("\n"),r.fl()}}),Genghis.Templates.Servers=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<header><h2>Servers</h2></header>"),r.b("\n"+n),r.b('<div class="content">'),r.b("\n"+n),r.b(" <table>"),r.b("\n"+n),r.b(" <thead>"),r.b("\n"+n),r.b(" <tr>"),r.b("\n"+n),r.b(" <th>name</th>"),r.b("\n"+n),r.b(" <th>databases</th>"),r.b("\n"+n),r.b(" <th>size</th>"),r.b("\n"+n),r.b(" <th></th>"),r.b("\n"+n),r.b(" </tr>"),r.b("\n"+n),r.b(" </thead>"),r.b("\n"+n),r.b(" <tbody>"),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b("</div>"),r.b("\n"+n),r.b('<div class="add-form inactive form-horizontal">'),r.b("\n"+n),r.b(' <span class="input-append">'),r.b("\n"+n),r.b(' <input class="name span4" type="text" size="30"><span class="add-on help" title="user:pass@localhost:27017">?</span>'),r.b("\n"+n),r.b(" </span>"),r.b("\n"+n),r.b(' <button class="show btn">Add server</button>'),r.b("\n"+n),r.b(' <button class="add btn btn-primary">Add server</button>'),r.b("\n"+n),r.b(' <button class="cancel btn">Cancel</button>'),r.b("\n"+n),r.b("</div>"),r.b("\n"),r.fl()}}),Genghis.Templates.Welcome=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<h2>Welcome to</h2>"),r.b("\n"+n),r.b("<h1>Genghis</h1>"),r.b("\n"+n),r.b("<p>The single-file MongoDB admin app.</p>"),r.b("\n"+n),r.b('<ul class="welcome-links">'),r.b("\n"+n),r.b(' <li><a href="http://genghisapp.com">Homepage</a></li>'),r.b("\n"+n),r.b(' <li><a href="https://github.com/bobthecow/genghis/issues">Issues</a></li>'),r.b("\n"+n),r.b(" <li>Version "),r.b(r.v(r.f("version",e,t,0))),r.b("</li>"),r.b("\n"+n),r.b("</ul>"),r.fl()}}),Genghis.Util={route:function(e){return e.replace(app.baseUrl,"").replace(/^\//,"")},parseQuery:function(e){var t={};return e.length&&_.each(e.split("&"),function(e){var n=e.split("="),r=n.shift();t[r]=decodeURIComponent(n.join("="))}),t},buildQuery:function(e){return _.map(e,function(e,t){return t+"="+e}).join("&")},humanizeSize:function(e){if(e==-0)return"n/a";var t=["Bytes","KB","MB","GB","TB","PB"],n=parseInt(Math.floor(Math.log(e)/Math.log(1024)),10);return(n===0?e/Math.pow(1024,n):(e/Math.pow(1024,n)).toFixed(1))+" "+t[n]},humanizeCount:function(e){var t="";return e=e||0,e>1e3&&(e=Math.floor(e/1e3),t=" k"),e>1e3&&(e=Math.floor(e/1e3),t=" M"),e>1e3?"...":e+t},escape:function(e){if(e)return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},attachCollapsers:function(e){$(".document",e).on("click","button,span.e",function(e){var t=$(this).parent(),n=t.children(".v"),r=/^\s*(name|title)\s*/i,i=n.hasClass("o"),s="",o,u;t.children(".e").length||(i&&(u=$(_.detect(n.find("> span.p > var"),function(e){return r.test($(e).text())})).siblings("span.v"),u.length===0&&(u=$(_.detect(n.find("> span.p > span.v"),function(e){var t=$(e);return t.hasClass("n")||t.hasClass("b")||t.hasClass("q")&&t.text().length<64}))),u&&u.length&&(o=u.siblings("var").text(),s=(o?o+": ":"")+Genghis.Util.escape(u.text()))),t.append('<span class="e">'+(i?"{":"[")+" <q>"+s+" &hellip;</q> "+(i?"}":"]")+"</span>")),t.toggleClass("collapsed"),e.preventDefault()})},base64Encode:function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=e.length,r="";for(var i=0;i<n;i+=3){var s=[e.charCodeAt(i),e.charCodeAt(i+1),e.charCodeAt(i+2)],o=[s[0]>>2,(s[0]&3)<<4|s[1]>>4,(s[1]&15)<<2|s[2]>>6,s[2]&63];isNaN(s[1])&&(o[2]=64),isNaN(s[2])&&(o[3]=64),r+=t[o[0]]+t[o[1]]+t[o[2]]+t[o[3]]}return r},base64Decode:function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=e.length,r="",i,s,o,u,a,f,l;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");var c=0;while(c<n)u=t.indexOf(e.charAt(c++)),a=t.indexOf(e.charAt(c++)),f=t.indexOf(e.charAt(c++)),l=t.indexOf(e.charAt(c++)),i=u<<2|a>>4,s=(a&15)<<4|f>>2,o=(f&3)<<6|l,r+=String.fromCharCode(i),f!=64&&(r+=String.fromCharCode(s)),l!=64&&(r+=String.fromCharCode(o));return r},base64ToHex:function(e){var t=[],n=atob(e.replace(/[=\s]+$/,"")),r=n.length;for(var i=0;i<r;++i){var s=n.charCodeAt(i).toString(16);t.push(s.length===1?"0"+s:s)}return t.join("")}},Genghis.JSON={parse:function(src){function addError(e,t){t.error||(error=new Error(e),error.loc=t.loc,error.node=t,t.error=error,errors.push(error))}function throwErrors(e){var t=new Error(""+e.length+" parse error"+(e.length===1?"":"s"));throw t.errors=e,t}function replaceCallExpression(src){function ObjectId(e){return{$genghisType:"ObjectId",$value:e?e.toString():null}}function GenghisDate(e){return{$genghisType:"ISODate",$value:e?(new Date(e)).toString():null}}function ISODate(e){if(!e)return new GenghisDate;var t=/(\d{4})-?(\d{2})-?(\d{2})([T ](\d{2})(:?(\d{2})(:?(\d{2}(\.\d+)?))?)?(Z|([+\-])(\d{2}):?(\d{2})?)?)?/,n=t.exec(e);if(!n)throw"Invalid ISO date";var r=parseInt(n[1],10)||1970,i=(parseInt(n[2],10)||1)-1,s=parseInt(n[3],10)||0,o=parseInt(n[5],10)||0,u=parseInt(n[7],10)||0,a=parseFloat(n[9])||0,f=Math.round(a%1*1e3);a-=f/1e3;var l=Date.UTC(r,i,s,o,u,a,f);if(n[11]&&n[11]!="Z"){var c=0;c+=(parseInt(n[13],10)||0)*60*60*1e3,c+=(parseInt(n[14],10)||0)*60*1e3,n[12]=="+"&&(c*=-1),l+=c}return new GenghisDate(l)}function DBRef(e,t){return{$ref:e,$id:t}}function GenghisRegExp(e,t){return{$genghisType:"RegExp",$value:{$pattern:e?e.toString():null,$flags:t?t.toString():null}}}function BinData(e,t){return{$genghisType:"BinData",$value:{$subtype:e,$binary:t}}}return src=src.replace(/^\s*(new\s+)?(Date|RegExp)(\b)/,"$1Genghis$2$3"),JSON.stringify(eval(src))}function replaceRegExpLiteral(e){var t="";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),replaceCallExpression("GenghisRegExp("+JSON.stringify(e.source)+', "'+t+'")')}function insertHelpers(e){function n(t){chunks[e.range[0]]=t;for(var n=e.range[0]+1;n<e.range[1];n++)chunks[n]=""}if(!e.range)return;e.source=function(){return chunks.slice(e.range[0],e.range[1]).join("")};if(e.update&&typeof e.update=="object"){var t=e.update;Object.keys(t).forEach(function(e){n[e]=t[e]}),e.update=n}else e.update=n}function assertType(e,t){t.type!==e&&addError("Expecting "+e+" but found "+t.type,t)}typeof src!="string"&&(src=String(src)),src="var __genghis_json__ = "+src;var opts={loc:!0,raw:!0,tokens:!0,tolerant:!0,range:!0},allowedCalls={ObjectId:!0,Date:!0,ISODate:!0,DBRef:!0,RegExp:!0,BinData:!0},allowedPropertyValues={Literal:!0,ObjectExpression:!0,ArrayExpression:!0,NewExpression:!0,CallExpression:!0,UnaryExpression:!0},errors=[],chunks=src.split(""),ast;try{ast=esprima.parse(src,opts)}catch(e){throwErrors([e])}ast.errors.length&&throwErrors(ast.errors);var node;return node=ast,assertType("Program",node),node=node.body,node.length!==1&&addError("Unexpected statement "+node[1].type,node[1]),node=node[0],assertType("VariableDeclaration",node),node=node.declarations,node.length!==1&&addError("Unexpected variable declarations "+node.length,node[1]),node=node[0],assertType("VariableDeclarator",node),node=node.init,node.type!=="ObjectExpression"&&addError("Expected an object expression, found "+node.type,node),errors.length&&throwErrors(errors),function walk(e){insertHelpers(e),Object.keys(e).forEach(function(t){var n=e[t];if(Array.isArray(n)){var r=[];n.forEach(function(e){e&&typeof e.type=="string"&&walk(e)})}else n&&typeof n.type=="string"&&(insertHelpers(e),walk(n))});switch(e.type){case"NewExpression":case"CallExpression":e.callee&&!allowedCalls[e.callee.name]?addError("Bad call, bro: "+e.callee.name,e):e.update(replaceCallExpression(e.source()));break;case"Property":e.value&&!allowedPropertyValues[e.value.type]&&addError("Unexpected value: "+e.value.source(),e.value);break;case"Identifier":case"ArrayExpression":case"ObjectExpression":case"UnaryExpression":break;case"Literal":_.isRegExp(e.value)&&e.update(replaceRegExpLiteral(e.value));break;default:addError("Unexpected "+e.type,e)}}(node),errors.length&&throwErrors(errors),function(node){var __genghis_json__;return eval("__genghis_json__ = "+node.source()),__genghis_json__}(node)},stringify:function(e,t){return jQuery("<div>"+this.prettyPrint(e,t,!1)+"</div>").text()},prettyPrint:function(e,t,n){function r(e){function d(e,t){return m("SPAN",e,t)}function m(e,t,n){var r=document.createElement(e);return t&&(r.className=t),n&&(typeof n=="string"&&(n=g(n)),r.appendChild(n)),r}function g(e){return document.createTextNode(e)}function y(e){var t=d("v q"),n;return t.appendChild(g('"')),i.lastIndex=0,i.test(e)&&(e=e.replace(i,function(e){var t=h[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),s.test(e)?(n=m("A","s"),n.href=e):n=d("s"),n.appendChild(g(e)),t.appendChild(n),t.appendChild(g('"')),t}function b(e){if(f.test(e)||!a.test(e))e='"'+e.replace(i,function(e){var t=h[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"';return m("VAR",!1,e)}function w(e,t,n){var r=d("call "+n);return r.appendChild(g(e+"(")),_.each(t,function(e,n){r.appendChild(e),n<t.length-1&&r.appendChild(g(", "))}),r.appendChild(g(")")),r}function E(e,t){var r,i,s,o,u=l,a,f,h,p="",v=t[e],S;_.isObject(v)&&typeof v.toJSON=="function"&&(v=v.toJSON(e));switch(typeof v){case"string":return y(v);case"number":return d("v n",isFinite(v)?String(v):"null");case"boolean":return d("v b",String(v));case"object":if(_.isNull(v))return d("v z","null");if(Object.hasOwnProperty.call(v,"$genghisType"))switch(v.$genghisType){case"ObjectId":return w("ObjectId",[y(v.$value)],"oid");case"ISODate":return w("ISODate",[y(v.$value)],"date");case"RegExp":var x=v.$value.$pattern,T=v.$value.$flags||"";return d("v re","/"+x+"/"+T);case"BinData":return w("BinData",[d("n",String(v.$value.$subtype)),y(v.$value.$binary)],"bindata")}l+=c;if(_.isArray(v)){if(v.length===0)return d("v a","[]");f=d("v a"),n&&l&&(f.collapsible=!0,v.length>10&&(f.collapsed=!0)),f.appendChild(g(l?"[\n"+l:"[")),p=g(l?",\n"+l:","),o=v.length;for(r=0;r<o;r+=1)r>0&&f.appendChild(p.cloneNode(!1)),f.appendChild(E(r,v)||d("v z","null"));return f.appendChild(g(l?"\n"+u+"]":"]")),l=u,f}a=[];var N=g(l?": ":":");for(i in v)if(Object.hasOwnProperty.call(v,i)){s=E(i,v);if(s){S="p"+(s.collapsed?" collapsed":"");if(i=="$ref"||i=="$id"||i=="$db")S=S+" ref-"+i.substr(1);h=d(S),s.collapsible&&h.appendChild(m("button")),h.appendChild(b(i)),h.appendChild(N.cloneNode(!1)),h.appendChild(s),s.collapsed&&(child=d("e"),child.appendChild(g("[ ")),child.appendChild(m("Q",!1,g(" …"))),child.appendChild(g(" ]")),h.appendChild(child)),a.push(h)}}S="v o";if(a.length===0)return d(S,g("{}"));v.$ref&&v.$id&&(S+=" ref"),f=d(S),f.collapsible=!!n,f.appendChild(g(l?"{\n"+l:"{")),p=g(l?",\n"+l:","),o=a.length;for(r=0;r<a.length;r++)r>0&&f.appendChild(p.cloneNode(!0)),f.appendChild(a[r]);return f.appendChild(g(l?"\n"+u+"}":"}")),l=u,f}}var r=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s=/^https?:\/\/[^\s]+$/,o="$A-Z_a-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",u="0-9̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ംഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧙ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᷀-ᷦ᷼-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︦︳︴﹍-﹏0-9_",a=RegExp("^["+o+"]["+o+u+"]*$"),f=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/,l="",c=t===!1?"":" ",h={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},p={"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"};return l="",v=E("_",{_:e}).innerHTML,v}return n=n!==!1,r(e)},normalize:function(e,t){return Genghis.JSON.stringify(Genghis.JSON.parse(e),t)}},Genghis.Collections.BaseCollection=Backbone.Collection.extend({firstChildren:function(){return this.collection.toArray().slice(0,10)},hasMoreChildren:function(){return this.collection.length>10}}),Genghis.Models.BaseModel=Backbone.Model.extend({name:function(){return this.get("name")},count:function(){return this.get("count")},humanCount:function(){return Genghis.Util.humanizeCount(this.get("count")||0)},isPlural:function(){return this.get("count")!==1},humanSize:function(){return Genghis.Util.humanizeSize(this.get("size"))},hasMoreChildren:function(){return this.get("count")>15}}),Genghis.Views.BaseDocument=Backbone.View.extend({errorMarkers:[],clearErrors:function(){var e=this.editor;this.getErrorBlock().html(""),_.each(this.errorMarkers,function(t){e.clearMarker(t)}),this.errorMarkers=[]},getEditorValue:function(){this.clearErrors();var e=this.getErrorBlock(),t=this.editor,n=this.errorMarkers;try{return Genghis.JSON.parse(t.getValue())}catch(r){_.each(r.errors||[r],function(r){var i=r.message;r.lineNumber&&!/Line \d+/i.test(i)&&(i="Line "+r.lineNumber+": "+r.message);var s=new Genghis.Views.Alert({model:new Genghis.Models.Alert({level:"error",msg:i,block:!0})});e.append(s.render().el),r.lineNumber&&n.push(t.setMarker(r.lineNumber-1,null,"line-error"))})}return!1}}),Genghis.Views.BaseRow=Backbone.View.extend({tagName:"tr",events:{"click a.name":"navigate","click button.destroy":"destroy"},initialize:function(){_.bindAll(this,"render","navigate","remove","destroy"),this.model.bind("change",this.render),this.model.bind("destroy",this.remove)},render:function(){return $(this.el).html(this.template.render(this.model)).toggleClass("error",!!this.model.get("error")).find(".label[title]").tooltip({placement:"bottom"}),this.$(".has-details").popover({html:!0,content:function(){return $(this).siblings(".details").html()},title:function(){return $(this).siblings(".details").attr("title")},trigger:"manual"}).hoverIntent(function(){$(this).popover("show")},function(){$(this).popover("hide")}),this},navigate:function(e){e.preventDefault(),app.router.navigate(Genghis.Util.route($(e.target).attr("href")),!0)},remove:function(){$(this.el).remove()},isParanoid:!1,destroy:function(){var e=this.model,t=e.has("name")?e.get("name"):"";if(this.isParanoid){if(!t)throw"Unable to confirm destruction without a confirmation string.";apprise("<strong>Deleting is forever.</strong><br><br>Type <strong>"+t+"</strong> to continue:",{input:!0,textOk:"Delete "+t+" forever"},function(n){n==t?e.destroy():apprise("<strong>Phew. That was close.</strong><br><br>"+t+" was not deleted.")})}else apprise("Really? There is no undo.",{confirm:!0,textOk:this.destroyConfirmButton(t)},function(t){t&&e.destroy()})},destroyConfirmButton:function(e){return"<strong>Yes</strong>, delete "+e+" forever"}}),Genghis.Views.BaseSection=Backbone.View.extend({events:{"click .add-form button.show":"showAddForm","click .add-form button.add":"submitAddForm","click .add-form button.cancel":"closeAddForm","keyup .add-form input.name":"updateOnKeyup"},initialize:function(){_.bindAll(this,"render","updateTitle","showAddForm","showAddFormIfVisible","submitAddForm","closeAddForm","updateOnKeyup","addModel","addModelAndUpdate","addAll"),this.model&&this.model.bind("change",this.updateTitle),this.collection&&(this.collection.bind("reset",this.render),this.collection.bind("add",this.addModelAndUpdate)),$(document).bind("keyup","c",this.showAddFormIfVisible),this.render()},render:function(){$(this.el).html(this.template.render({title:this.formatTitle(this.model)})),this.addForm=this.$(".add-form"),this.addButton=this.$(".add-form button.add"),this.addInput=this.$(".add-form input"),this.cancelButton=this.$(".add-form button.cancel"),this.addAll(),this.$(".help",this.addForm).tooltip();var e={};return e[this.$("table thead th").length-1]={sorter:!1},this.$("table").tablesorter({headers:e,textExtraction:function(e){return $(".value",e).text()||$(e).text()}}),this.collection.size()&&this.$("table").trigger("sorton",[[[0,0]]]),this},updateTitle:function(){this.$("> header h2").text(this.formatTitle(this.model))},showAddForm:function(){this.addForm.removeClass("inactive"),this.addInput.focus()},showAddFormIfVisible:function(e){$(this.el).is(":visible")&&(e.preventDefault(),this.showAddForm())},submitAddForm:function(){this.collection.create({name:this.addInput.val()}),this.closeAddForm()},closeAddForm:function(){this.addForm.addClass("inactive"),this.addInput.val("")},updateOnKeyup:function(e){e.keyCode==13&&this.submitAddForm(),e.keyCode==27&&this.closeAddForm()},addModel:function(e){var t=new this.rowView({model:e});this.$("table tbody").append(t.render().el)},addModelAndUpdate:function(e){this.addModel(e),this.$("table").trigger("update")},addAll:function(){this.$("table tbody").html(""),this.collection.each(this.addModel),$(this.el).removeClass("spinning")}}),Genghis.Models.Alert=Backbone.Model.extend({defaults:{level:"warning",block:!1}}),Genghis.Models.Collection=Genghis.Models.BaseModel.extend({indexesIsPlural:function(){return this.indexCount()!==1},indexCount:function(){return(this.get("indexes")||[]).length},indexes:function(){return _.map(this.get("indexes"),function(e){return Genghis.JSON.prettyPrint(e.key)})}}),Genghis.Models.Database=Genghis.Models.BaseModel.extend({firstChildren:function(){return _.first(this.get("collections")||[],15)}}),Genghis.Models.Document=Backbone.Model.extend({initialize:function(){_.bindAll(this,"prettyId","prettyTime","prettyPrint","JSONish");var e=this.thunkId(this.get("_id"));e&&(this.id=e)},thunkId:function(e){if(typeof e=="object"&&e.hasOwnProperty("$genghisType")&&e["$genghisType"]=="ObjectId")return e.$value;if(typeof e!="undefined")return"~"+Genghis.Util.base64Encode(JSON.stringify(e))},parse:function(e){var t=this.thunkId(e._id);return t&&(this.id=t),e},url:function(){var e=function(e){return!e||!e.url?null:_.isFunction(e.url)?e.url():e.url},t=e(this.collection)||this.urlRoot||urlError();return t=t.split("?").shift(),this.isNew()?t:t+(t.charAt(t.length-1)=="/"?"":"/")+encodeURIComponent(this.id)},prettyId:function(){var e=this.get("_id");if(typeof e=="object"&&e.hasOwnProperty("$genghisType"))switch(e.$genghisType){case"ObjectId":return e.$value;case"BinData":if(e["$value"]["$subtype"]==3){var t=/^([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})$/i,n=Genghis.Util.base64ToHex(e.$value.$binary);if(t.test(n))return n.replace(t,"$1-$2-$3-$4-$5")}return e.$value.$binary.replace(/\=+$/,"")}return e},prettyTime:function(){if(typeof this._prettyTime=="undefined"){var e=this.get("_id");if(typeof e=="object"&&e.hasOwnProperty("$genghisType")&&e.$genghisType==="ObjectId"&&e["$value"].length==24){var t=new Date;t.setTime(parseInt(e.$value.substring(0,8),16)*1e3),this._prettyTime=t.toUTCString()}}return this._prettyTime},prettyPrint:function(){return Genghis.JSON.prettyPrint(this.toJSON())},JSONish:function(){return Genghis.JSON.stringify(this.toJSON())}}),Genghis.Models.Pagination=Backbone.Model.extend({defaults:{page:1,pages:1,limit:50,count:0,total:0},initialize:function(){_.bindAll(this,"decrementTotal")},decrementTotal:function(){this.set({total:this.get("total")-1,count:this.get("count")-1})}}),Genghis.Models.Selection=Backbone.Model.extend({defaults:{server:null,database:null,collection:null,query:null,page:null},initialize:function(){_.bindAll(this,"select","update","nextPage","previousPage"),this.bind("change",this.update),this.pagination=new Genghis.Models.Pagination,this.servers=new Genghis.Collections.Servers,this.currentServer=new Genghis.Models.Server,this.databases=new Genghis.Collections.Databases,this.currentDatabase=new Genghis.Models.Database,this.collections=new Genghis.Collections.Collections,this.currentCollection=new Genghis.Models.Collection,this.documents=new Genghis.Collections.Documents,this.currentDocument=new Genghis.Models.Document},select:function(e,t,n,r,i,s){this.set({server:e||null,database:t||null,collection:n||null,document:r||null,query:i||null,page:s||null})},update:function(){function f(e,t,n){return n=n||"Please try again.",function(r,i){try{data=JSON.parse(i.responseText)}catch(s){data={}}switch(i.status){case 404:$("section#"+e).hide(),app.showMasthead("404: "+t,"<p>"+n+"</p>",{error:!0});break;default:app.alerts.create({msg:i.status+": "+(data.error||"Unknown error"),level:"error",block:!0})}}}var e=this.get("server"),t=this.get("database"),n=this.get("collection"),r=this.get("document"),i=this.get("query"),s=this.get("page"),o=app.baseUrl,u={};o+="servers",this.servers.url=o,this.servers.fetch(),e?(o=o+"/"+e,this.currentServer.url=o,this.currentServer.fetch({error:f("databases","Server Not Found"
808
+ d.inIteration,d.inIteration=!0,e=Gt(),d.inIteration=n,V("while"),X("("),t=Ct(),X(")"),$(";")&&I(),{type:r.DoWhileStatement,body:e,test:t}}function Ft(){var e,t,n;return V("while"),X("("),e=Ct(),X(")"),n=d.inIteration,d.inIteration=!0,t=Gt(),d.inIteration=n,{type:r.WhileStatement,test:e,body:t}}function It(){var e=I();return{type:r.VariableDeclaration,declarations:Mt(),kind:e.value}}function qt(){var e,t,n,i,o,u,a;return e=t=n=null,V("for"),X("("),$(";")?I():(J("var")||J("let")?(d.allowIn=!1,e=It(),d.allowIn=!0,e.declarations.length===1&&J("in")&&(I(),i=e,o=Ct(),e=null)):(d.allowIn=!1,e=Ct(),d.allowIn=!0,J("in")&&(G(e)||U({},s.InvalidLHSInForIn),I(),i=e,o=Ct(),e=null)),typeof i=="undefined"&&X(";")),typeof i=="undefined"&&($(";")||(t=Ct()),X(";"),$(")")||(n=Ct())),X(")"),a=d.inIteration,d.inIteration=!0,u=Gt(),d.inIteration=a,typeof i=="undefined"?{type:r.ForStatement,init:e,test:t,update:n,body:u}:{type:r.ForInStatement,left:i,right:o,body:u,each:!1}}function Rt(){var e,n=null;return V("continue"),u[f]===";"?(I(),d.inIteration||U({},s.IllegalContinue),{type:r.ContinueStatement,label:null}):R()?(d.inIteration||U({},s.IllegalContinue),{type:r.ContinueStatement,label:null}):(e=q(),e.type===t.Identifier&&(n=At(),Object.prototype.hasOwnProperty.call(d.labelSet,n.name)||U({},s.UnknownLabel,n.name)),Q(),n===null&&!d.inIteration&&U({},s.IllegalContinue),{type:r.ContinueStatement,label:n})}function Ut(){var e,n=null;return V("break"),u[f]===";"?(I(),!d.inIteration&&!d.inSwitch&&U({},s.IllegalBreak),{type:r.BreakStatement,label:null}):R()?(!d.inIteration&&!d.inSwitch&&U({},s.IllegalBreak),{type:r.BreakStatement,label:null}):(e=q(),e.type===t.Identifier&&(n=At(),Object.prototype.hasOwnProperty.call(d.labelSet,n.name)||U({},s.UnknownLabel,n.name)),Q(),n===null&&!d.inIteration&&!d.inSwitch&&U({},s.IllegalBreak),{type:r.BreakStatement,label:n})}function zt(){var e,n=null;return V("return"),d.inFunctionBody||z({},s.IllegalReturn),u[f]===" "&&x(u[f+1])?(n=Ct(),Q(),{type:r.ReturnStatement,argument:n}):R()?{type:r.ReturnStatement,argument:null}:($(";")||(e=q(),!$("}")&&e.type!==t.EOF&&(n=Ct())),Q(),{type:r.ReturnStatement,argument:n})}function Wt(){var e,t;return a&&z({},s.StrictModeWith),V("with"),X("("),e=Ct(),X(")"),t=Gt(),{type:r.WithStatement,object:e,body:t}}function Xt(){var e,t=[],n;J("default")?(I(),e=null):(V("case"),e=Ct()),X(":");while(f<h){if($("}")||J("default")||J("case"))break;n=Gt();if(typeof n=="undefined")break;t.push(n)}return{type:r.SwitchCase,test:e,consequent:t}}function Vt(){var e,t,n,i,o;V("switch"),X("("),e=Ct(),X(")"),X("{");if($("}"))return I(),{type:r.SwitchStatement,discriminant:e};t=[],i=d.inSwitch,d.inSwitch=!0,o=!1;while(f<h){if($("}"))break;n=Xt(),n.test===null&&(o&&U({},s.MultipleDefaultsInSwitch),o=!0),t.push(n)}return d.inSwitch=i,X("}"),{type:r.SwitchStatement,discriminant:e,cases:t}}function $t(){var e;return V("throw"),R()&&U({},s.NewlineAfterThrow),e=Ct(),Q(),{type:r.ThrowStatement,argument:e}}function Jt(){var e;return V("catch"),X("("),$(")")||(e=Ct(),a&&e.type===r.Identifier&&k(e.name)&&z({},s.StrictCatchVariable)),X(")"),{type:r.CatchClause,param:e,body:Lt()}}function Kt(){var e,t=[],n=null;return V("try"),e=Lt(),J("catch")&&t.push(Jt()),J("finally")&&(I(),n=Lt()),t.length===0&&!n&&U({},s.NoCatchOrFinally),{type:r.TryStatement,block:e,guardedHandlers:[],handlers:t,finalizer:n}}function Qt(){return V("debugger"),Q(),{type:r.DebuggerStatement}}function Gt(){var e=q(),n,i;e.type===t.EOF&&W(e);if(e.type===t.Punctuator)switch(e.value){case";":return Pt();case"{":return Lt();case"(":return Ht();default:}if(e.type===t.Keyword)switch(e.value){case"break":return Ut();case"continue":return Rt();case"debugger":return Qt();case"do":return jt();case"for":return qt();case"function":return Zt();case"if":return Bt();case"return":return zt();case"switch":return Vt();case"throw":return $t();case"try":return Kt();case"var":return _t();case"while":return Ft();case"with":return Wt();default:}return n=Ct(),n.type===r.Identifier&&$(":")?(I(),Object.prototype.hasOwnProperty.call(d.labelSet,n.name)&&U({},s.Redeclaration,"Label",n.name),d.labelSet[n.name]=!0,i=Gt(),delete d.labelSet[n.name],{type:r.LabeledStatement,label:n,body:i}):(Q(),{type:r.ExpressionStatement,expression:n})}function Yt(){var e,n=[],i,o,u,l,c,p,v;X("{");while(f<h){i=q();if(i.type!==t.StringLiteral)break;e=tn(),n.push(e);if(e.expression.type!==r.Literal)break;o=g(i.range[0]+1,i.range[1]-1),o==="use strict"?(a=!0,u&&U(u,s.StrictOctalLiteral)):!u&&i.octal&&(u=i)}l=d.labelSet,c=d.inIteration,p=d.inSwitch,v=d.inFunctionBody,d.labelSet={},d.inIteration=!1,d.inSwitch=!1,d.inFunctionBody=!0;while(f<h){if($("}"))break;e=tn();if(typeof e=="undefined")break;n.push(e)}return X("}"),d.labelSet=l,d.inIteration=c,d.inSwitch=p,d.inFunctionBody=v,{type:r.BlockStatement,body:n}}function Zt(){var e,t,n=[],i,o,u,l,c,p;V("function"),o=q(),e=At(),a?k(o.value)&&U(o,s.StrictFunctionName):k(o.value)?(u=o,l=s.StrictFunctionName):C(o.value)&&(u=o,l=s.StrictReservedWord),X("(");if(!$(")")){p={};while(f<h){o=q(),t=At(),a?(k(o.value)&&U(o,s.StrictParamName),Object.prototype.hasOwnProperty.call(p,o.value)&&U(o,s.StrictParamDupe)):u||(k(o.value)?(u=o,l=s.StrictParamName):C(o.value)?(u=o,l=s.StrictReservedWord):Object.prototype.hasOwnProperty.call(p,o.value)&&(u=o,l=s.StrictParamDupe)),n.push(t),p[t.name]=!0;if($(")"))break;X(",")}}return X(")"),c=a,i=Yt(),a&&u&&U(u,l),a=c,{type:r.FunctionDeclaration,id:e,params:n,defaults:[],body:i,rest:null,generator:!1,expression:!1}}function en(){var e,t=null,n,i,o,u=[],l,c,p;V("function"),$("(")||(e=q(),t=At(),a?k(e.value)&&U(e,s.StrictFunctionName):k(e.value)?(n=e,i=s.StrictFunctionName):C(e.value)&&(n=e,i=s.StrictReservedWord)),X("(");if(!$(")")){p={};while(f<h){e=q(),o=At(),a?(k(e.value)&&U(e,s.StrictParamName),Object.prototype.hasOwnProperty.call(p,e.value)&&U(e,s.StrictParamDupe)):n||(k(e.value)?(n=e,i=s.StrictParamName):C(e.value)?(n=e,i=s.StrictReservedWord):Object.prototype.hasOwnProperty.call(p,e.value)&&(n=e,i=s.StrictParamDupe)),u.push(o),p[o.name]=!0;if($(")"))break;X(",")}}return X(")"),c=a,l=Yt(),a&&n&&U(n,i),a=c,{type:r.FunctionExpression,id:t,params:u,defaults:[],body:l,rest:null,generator:!1,expression:!1}}function tn(){var e=q();if(e.type===t.Keyword)switch(e.value){case"const":case"let":return Dt(e.value);case"function":return Zt();default:return Gt()}if(e.type!==t.EOF)return Gt()}function nn(){var e,n=[],i,o,u;while(f<h){i=q();if(i.type!==t.StringLiteral)break;e=tn(),n.push(e);if(e.expression.type!==r.Literal)break;o=g(i.range[0]+1,i.range[1]-1),o==="use strict"?(a=!0,u&&U(u,s.StrictOctalLiteral)):!u&&i.octal&&(u=i)}while(f<h){e=tn();if(typeof e=="undefined")break;n.push(e)}return n}function rn(){var e;return a=!1,e={type:r.Program,body:nn()},e}function sn(e,t,n,r,i){m(typeof n=="number","Comment must have valid position");if(v.comments.length>0&&v.comments[v.comments.length-1].range[1]>n)return;v.comments.push({type:e,value:t,range:[n,r],loc:i})}function on(){var e,t,n,r,i,o;e="",i=!1,o=!1;while(f<h){t=u[f];if(o)t=A(),S(t)?(n.end={line:l,column:f-c-1},o=!1,sn("Line",e,r,f-1,n),t==="\r"&&u[f]==="\n"&&++f,++l,c=f,e=""):f>=h?(o=!1,e+=t,n.end={line:l,column:h-c},sn("Line",e,r,h,n)):e+=t;else if(i)S(t)?(t==="\r"&&u[f+1]==="\n"?(++f,e+="\r\n"):e+=t,++l,++f,c=f,f>=h&&U({},s.UnexpectedToken,"ILLEGAL")):(t=A(),f>=h&&U({},s.UnexpectedToken,"ILLEGAL"),e+=t,t==="*"&&(t=u[f],t==="/"&&(e=e.substr(0,e.length-1),i=!1,++f,n.end={line:l,column:f-c},sn("Block",e,r,f,n),e="")));else if(t==="/"){t=u[f+1];if(t==="/")n={start:{line:l,column:f-c}},r=f,f+=2,o=!0,f>=h&&(n.end={line:l,column:f-c},o=!1,sn("Line",e,r,f,n));else{if(t!=="*")break;r=f,f+=2,i=!0,n={start:{line:l,column:f-c-2}},f>=h&&U({},s.UnexpectedToken,"ILLEGAL")}}else if(E(t))++f;else{if(!S(t))break;++f,t==="\r"&&u[f]==="\n"&&++f,++l,c=f}}}function un(){var e,t,n,r=[];for(e=0;e<v.comments.length;++e)t=v.comments[e],n={type:t.type,value:t.value},v.range&&(n.range=t.range),v.loc&&(n.loc=t.loc),r.push(n);v.comments=r}function an(){var e,r,i,s,o;return O(),e=f,r={start:{line:l,column:f-c}},i=v.advance(),r.end={line:l,column:f-c},i.type!==t.EOF&&(s=[i.range[0],i.range[1]],o=g(i.range[0],i.range[1]),v.tokens.push({type:n[i.type],value:o,range:s,loc:r})),i}function fn(){var e,t,n,r;return O(),e=f,t={start:{line:l,column:f-c}},n=v.scanRegExp(),t.end={line:l,column:f-c},v.tokens.length>0&&(r=v.tokens[v.tokens.length-1],r.range[0]===e&&r.type==="Punctuator"&&(r.value==="/"||r.value==="/=")&&v.tokens.pop()),v.tokens.push({type:"RegularExpression",value:n.literal,range:[e,f],loc:t}),n}function ln(){var e,t,n,r=[];for(e=0;e<v.tokens.length;++e)t=v.tokens[e],n={type:t.type,value:t.value},v.range&&(n.range=t.range),v.loc&&(n.loc=t.loc),r.push(n);v.tokens=r}function cn(e){return{type:r.Literal,value:e.value}}function hn(e){return{type:r.Literal,value:e.value,raw:g(e.range[0],e.range[1])}}function pn(e,t){return function(n){function i(e){return e.type===r.LogicalExpression||e.type===r.BinaryExpression}function s(n){i(n.left)&&s(n.left),i(n.right)&&s(n.right),e&&typeof n.range=="undefined"&&(n.range=[n.left.range[0],n.right.range[1]]),t&&typeof n.loc=="undefined"&&(n.loc={start:n.left.loc.start,end:n.right.loc.end})}return function(){var o,u,a;O(),u=[f,0],a={start:{line:l,column:f-c}},o=n.apply(null,arguments);if(typeof o!="undefined")return e&&typeof o.range=="undefined"&&(u[1]=f,o.range=u),t&&typeof o.loc=="undefined"&&(a.end={line:l,column:f-c},o.loc=a),i(o)&&s(o),o.type===r.MemberExpression&&(typeof o.object.range!="undefined"&&(o.range[0]=o.object.range[0]),typeof o.object.loc!="undefined"&&(o.loc.start=o.object.loc.start)),o.type===r.CallExpression&&(typeof o.callee.range!="undefined"&&(o.range[0]=o.callee.range[0]),typeof o.callee.loc!="undefined"&&(o.loc.start=o.callee.loc.start)),o}}}function dn(){var e;v.comments&&(v.skipComment=O,O=on),v.raw&&(v.createLiteral=cn,cn=hn);if(v.range||v.loc)e=pn(v.range,v.loc),v.parseAdditiveExpression=vt,v.parseAssignmentExpression=Nt,v.parseBitwiseANDExpression=bt,v.parseBitwiseORExpression=Et,v.parseBitwiseXORExpression=wt,v.parseBlock=Lt,v.parseFunctionSourceElements=Yt,v.parseCallMember=at,v.parseCatchClause=Jt,v.parseComputedMember=ut,v.parseConditionalExpression=Tt,v.parseConstLetDeclaration=Dt,v.parseEqualityExpression=yt,v.parseExpression=Ct,v.parseForVariableDeclaration=It,v.parseFunctionDeclaration=Zt,v.parseFunctionExpression=en,v.parseLogicalANDExpression=St,v.parseLogicalORExpression=xt,v.parseMultiplicativeExpression=dt,v.parseNewExpression=ft,v.parseNonComputedMember=ot,v.parseNonComputedProperty=st,v.parseObjectProperty=tt,v.parseObjectPropertyKey=et,v.parsePostfixExpression=ht,v.parsePrimaryExpression=rt,v.parseProgram=rn,v.parsePropertyFunction=Z,v.parseRelationalExpression=gt,v.parseStatement=Gt,v.parseShiftExpression=mt,v.parseSwitchCase=Xt,v.parseUnaryExpression=pt,v.parseVariableDeclaration=Ot,v.parseVariableIdentifier=At,vt=e(v.parseAdditiveExpression),Nt=e(v.parseAssignmentExpression),bt=e(v.parseBitwiseANDExpression),Et=e(v.parseBitwiseORExpression),wt=e(v.parseBitwiseXORExpression),Lt=e(v.parseBlock),Yt=e(v.parseFunctionSourceElements),at=e(v.parseCallMember),Jt=e(v.parseCatchClause),ut=e(v.parseComputedMember),Tt=e(v.parseConditionalExpression),Dt=e(v.parseConstLetDeclaration),yt=e(v.parseEqualityExpression),Ct=e(v.parseExpression),It=e(v.parseForVariableDeclaration),Zt=e(v.parseFunctionDeclaration),en=e(v.parseFunctionExpression),St=e(v.parseLogicalANDExpression),xt=e(v.parseLogicalORExpression),dt=e(v.parseMultiplicativeExpression),ft=e(v.parseNewExpression),ot=e(v.parseNonComputedMember),st=e(v.parseNonComputedProperty),tt=e(v.parseObjectProperty),et=e(v.parseObjectPropertyKey),ht=e(v.parsePostfixExpression),rt=e(v.parsePrimaryExpression),rn=e(v.parseProgram),Z=e(v.parsePropertyFunction),gt=e(v.parseRelationalExpression),Gt=e(v.parseStatement),mt=e(v.parseShiftExpression),Xt=e(v.parseSwitchCase),pt=e(v.parseUnaryExpression),Ot=e(v.parseVariableDeclaration),At=e(v.parseVariableIdentifier);typeof v.tokens!="undefined"&&(v.advance=F,v.scanRegExp=B,F=an,B=fn)}function vn(){typeof v.skipComment=="function"&&(O=v.skipComment),v.raw&&(cn=v.createLiteral);if(v.range||v.loc)vt=v.parseAdditiveExpression,Nt=v.parseAssignmentExpression,bt=v.parseBitwiseANDExpression,Et=v.parseBitwiseORExpression,wt=v.parseBitwiseXORExpression,Lt=v.parseBlock,Yt=v.parseFunctionSourceElements,at=v.parseCallMember,Jt=v.parseCatchClause,ut=v.parseComputedMember,Tt=v.parseConditionalExpression,Dt=v.parseConstLetDeclaration,yt=v.parseEqualityExpression,Ct=v.parseExpression,It=v.parseForVariableDeclaration,Zt=v.parseFunctionDeclaration,en=v.parseFunctionExpression,St=v.parseLogicalANDExpression,xt=v.parseLogicalORExpression,dt=v.parseMultiplicativeExpression,ft=v.parseNewExpression,ot=v.parseNonComputedMember,st=v.parseNonComputedProperty,tt=v.parseObjectProperty,et=v.parseObjectPropertyKey,rt=v.parsePrimaryExpression,ht=v.parsePostfixExpression,rn=v.parseProgram,Z=v.parsePropertyFunction,gt=v.parseRelationalExpression,Gt=v.parseStatement,mt=v.parseShiftExpression,Xt=v.parseSwitchCase,pt=v.parseUnaryExpression,Ot=v.parseVariableDeclaration,At=v.parseVariableIdentifier;typeof v.scanRegExp=="function"&&(F=v.advance,B=v.scanRegExp)}function mn(e){var t=e.length,n=[],r;for(r=0;r<t;++r)n[r]=e.charAt(r);return n}function gn(e,t){var n,r;r=String,typeof e!="string"&&!(e instanceof String)&&(e=r(e)),u=e,f=0,l=u.length>0?1:0,c=0,h=u.length,p=null,d={allowIn:!0,labelSet:{},lastParenthesized:null,inFunctionBody:!1,inIteration:!1,inSwitch:!1},v={},typeof t!="undefined"&&(v.range=typeof t.range=="boolean"&&t.range,v.loc=typeof t.loc=="boolean"&&t.loc,v.raw=typeof t.raw=="boolean"&&t.raw,typeof t.tokens=="boolean"&&t.tokens&&(v.tokens=[]),typeof t.comment=="boolean"&&t.comment&&(v.comments=[]),typeof t.tolerant=="boolean"&&t.tolerant&&(v.errors=[])),h>0&&typeof u[0]=="undefined"&&(e instanceof String&&(u=e.valueOf()),typeof u[0]=="undefined"&&(u=mn(e))),dn();try{n=rn(),typeof v.comments!="undefined"&&(un(),n.comments=v.comments),typeof v.tokens!="undefined"&&(ln(),n.tokens=v.tokens),typeof v.errors!="undefined"&&(n.errors=v.errors)}catch(i){throw i}finally{vn(),v={}}return n}var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v;t={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},n={},n[t.BooleanLiteral]="Boolean",n[t.EOF]="<end>",n[t.Identifier]="Identifier",n[t.Keyword]="Keyword",n[t.NullLiteral]="Null",n[t.NumericLiteral]="Numeric",n[t.Punctuator]="Punctuator",n[t.StringLiteral]="String",r={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},i={Data:1,Get:2,Set:4},s={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},o={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},typeof "esprima"[0]=="undefined"&&(g=function(t,n){return u.slice(t,n).join("")}),e.version="1.0.0-dev",e.parse=gn,e.Syntax=function(){var e,t={};typeof Object.create=="function"&&(t=Object.create(null));for(e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);return typeof Object.freeze=="function"&&Object.freeze(t),t}()}),function(e){function t(t){if(typeof t.data!="string")return;var n=t.handler,r=t.data.toLowerCase().split(" ");t.handler=function(t){if(!(this===t.target||!/textarea|select/i.test(t.target.nodeName)&&t.target.type!=="text"))return;var i=t.type!=="keypress"&&e.hotkeys.specialKeys[t.which],s=String.fromCharCode(t.which).toLowerCase(),o,u="",a={};t.altKey&&i!=="alt"&&(u+="alt+"),t.ctrlKey&&i!=="ctrl"&&(u+="ctrl+"),t.metaKey&&!t.ctrlKey&&i!=="meta"&&(u+="meta+"),t.shiftKey&&i!=="shift"&&(u+="shift+"),i?a[u+i]=!0:(a[u+s]=!0,a[u+e.hotkeys.shiftNums[s]]=!0,u==="shift+"&&(a[e.hotkeys.shiftNums[s]]=!0));for(var f=0,l=r.length;f<l;f++)if(a[r[f]])return n.apply(this,arguments)}}e.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",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",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}},e.each(["keydown","keyup","keypress"],function(){e.event.special[this]={add:t}})}(jQuery);var Hogan={};(function(e,t){function n(e,t,n,r){function i(){}function s(){}i.prototype=e,s.prototype=e.subs;var o,u=new i;u.subs=new s,u.subsText={},u.ib();for(o in t)u.subs[o]=t[o],u.subsText[o]=r;for(o in n)u.partials[o]=n[o];return u}function f(e){return String(e===null||e===undefined?"":e)}function l(e){return e=f(e),a.test(e)?e.replace(r,"&amp;").replace(i,"&lt;").replace(s,"&gt;").replace(o,"&#39;").replace(u,"&quot;"):e}e.Template=function(e,t,n,r){e=e||{},this.r=e.code||this.r,this.c=n,this.options=r,this.text=t||"",this.partials=e.partials||{},this.subs=e.subs||{},this.ib()},e.Template.prototype={r:function(e,t,n){return""},v:l,t:f,render:function(t,n,r){return this.ri([t],n||{},r)},ri:function(e,t,n){return this.r(e,t,n)},ep:function(e,t){var r=this.partials[e],i=t[r.name];if(r.instance&&r.base==i)return r.instance;if(typeof i=="string"){if(!this.c)throw new Error("No compiler available.");i=this.c.compile(i,this.options)}return i?(this.partials[e].base=i,r.subs&&(i=n(i,r.subs,r.partials,this.text)),this.partials[e].instance=i,i):null},rp:function(e,t,n,r){var i=this.ep(e,n);return i?i.ri(t,n,r):""},rs:function(e,t,n){var r=e[e.length-1];if(!c(r)){n(e,t,this);return}for(var i=0;i<r.length;i++)e.push(r[i]),n(e,t,this),e.pop()},s:function(e,t,n,r,i,s,o){var u;return c(e)&&e.length===0?!1:(typeof e=="function"&&(e=this.ms(e,t,n,r,i,s,o)),u=e===""||!!e,!r&&u&&t&&t.push(typeof e=="object"?e:t[t.length-1]),u)},d:function(e,t,n,r){var i=e.split("."),s=this.f(i[0],t,n,r),o=null;if(e==="."&&c(t[t.length-2]))s=t[t.length-1];else for(var u=1;u<i.length;u++)s&&typeof s=="object"&&s[i[u]]!=null?(o=s,s=s[i[u]]):s="";return r&&!s?!1:(!r&&typeof s=="function"&&(t.push(o),s=this.mv(s,t,n),t.pop()),s)},f:function(e,t,n,r){var i=!1,s=null,o=!1;for(var u=t.length-1;u>=0;u--){s=t[u];if(s&&typeof s=="object"&&s[e]!=null){i=s[e],o=!0;break}}return o?(!r&&typeof i=="function"&&(i=this.mv(i,t,n)),i):r?!1:""},ls:function(e,t,n,r,i){var s=this.options.delimiters;return this.options.delimiters=i,this.b(this.ct(f(e.call(t,r)),t,n)),this.options.delimiters=s,!1},ct:function(e,t,n){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(e,this.options).render(t,n)},b:t?function(e){this.buf.push(e)}:function(e){this.buf+=e},fl:t?function(){var e=this.buf.join("");return this.buf=[],e}:function(){var e=this.buf;return this.buf="",e},ib:function(){this.buf=t?[]:""},ms:function(e,t,n,r,i,s,o){var u,a=t[t.length-1],f=e.call(a);return typeof f=="function"?r?!0:(u=this.activeSub&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(f,a,n,u.substring(i,s),o)):f},mv:function(e,t,n){var r=t[t.length-1],i=e.call(r);return typeof i=="function"?this.ct(f(i.call(r)),r,n):i},sub:function(e,t,n,r){var i=this.subs[e];i&&(this.activeSub=e,i(t,n,this,r),this.activeSub=!1)}};var r=/&/g,i=/</g,s=/>/g,o=/\'/g,u=/\"/g,a=/[&<>\"\']/,c=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}})(typeof exports!="undefined"?exports:Hogan),jQuery.tablesorter.addParser({id:"size",is:function(e){return e.trim().match(/^\d+(\.\d+)? (Bytes|KB|MB|GB|TB|PB)$/)},format:function(e){var t=["Bytes","KB","MB","GB","TB","PB"],n=e.trim().split(" ");return parseFloat(n.shift())*Math.pow(1024,_.indexOf(t,n.shift()))},type:"numeric"}),window.Genghis={Models:{},Collections:{},Views:{},Templates:{},defaults:{codeMirror:{mode:"application/json",lineNumbers:!0,tabSize:4,indentUnit:4,matchBrackets:!0}},boot:function(e){e+=e.charAt(e.length-1)=="/"?"":"/",window.app=new Genghis.Views.App({baseUrl:e}),Backbone.history.start({pushState:!0,root:e})}},Genghis.version="2.1.1",Genghis.Templates.Alert=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="alert'),r.s(r.f("block",e,t,1),e,t,0,29,41,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" alert-block")}),e.pop()),r.b(" alert-"),r.b(r.v(r.f("level",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <a class="close" href="#">×</a>'),r.b("\n"+n),r.s(r.f("block",e,t,1),e,t,0,122,148,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" <p>"),n.b(n.t(n.f("msg",e,t,0))),n.b("</p>"),n.b("\n")}),e.pop()),r.s(r.f("block",e,t,1),e,t,1,0,0,"")||(r.b(" "),r.b(r.t(r.f("msg",e,t,0))),r.b("\n")),r.b("</div>"),r.fl()}}),Genghis.Templates.CollectionRow=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<td>"),r.b("\n"+n),r.b(' <a href="'),r.b(r.v(r.f("url",e,t,0))),r.b('" class="name value">'),r.b(r.v(r.f("name",e,t,0))),r.b("</a>"),r.b("\n"+n),r.b("</td>"),r.b("\n"+n),r.b("<td>"),r.b("\n"+n),r.b(' <span class="documents value">'),r.b(r.v(r.f("count",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b("</td>"),r.b("\n"+n),r.b("<td>"),r.b("\n"+n),r.b(' <span class="indexes has-details value">'),r.b(r.v(r.f("indexCount",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(' <div class="details" title="'),r.b(r.v(r.f("indexCount",e,t,0))),r.b(" Index"),r.s(r.f("indexesIsPlural",e,t,1),e,t,0,282,284,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b("es")}),e.pop()),r.b('">'),r.b("\n"+n),r.s(r.f("indexCount",e,t,1),e,t,0,334,501,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(' <ul class="index-details">'),r.b("\n"+n),r.s(r.f("indexes",e,t,1),e,t,0,404,460,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" <li>"),n.b(n.t(n.d(".",e,t,0))),n.b("</li>"),n.b("\n")}),e.pop()),r.b(" </ul>"),r.b("\n")}),e.pop()),r.s(r.f("indexCount",e,t,1),e,t,1,0,0,"")||(r.b(" <em>None.</em>"),r.b("\n")),r.b(" </div>"),r.b("\n"+n),r.b("</td>"),r.b("\n"+n),r.b('<td class="action-column">'),r.b("\n"+n),r.b(' <button class="btn btn-mini btn-danger destroy">Remove</button>'),r.b("\n"+n),r.b("</td>"),r.b("\n"),r.fl()}}),Genghis.Templates.Collections=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<header><h2>"),r.b(r.v(r.f("title",e,t,0))),r.b("</h2></header>"),r.b("\n"+n),r.b('<div class="content">'),r.b("\n"+n),r.b(" <table>"),r.b("\n"+n),r.b(" <thead>"),r.b("\n"+n),r.b(" <tr>"),r.b("\n"+n),r.b(" <th>name</th>"),r.b("\n"+n),r.b(" <th>documents</th>"),r.b("\n"+n),r.b(" <th>indexes</th>"),r.b("\n"+n),r.b(" <th></th>"),r.b("\n"+n),r.b(" </tr>"),r.b("\n"+n),r.b(" </thead>"),r.b("\n"+n),r.b(" <tbody>"),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b("</div>"),r.b("\n"+n),r.b('<div class="add-form inactive form-horizontal">'),r.b("\n"+n),r.b(' <input class="name span4" type="text" size="30">'),r.b("\n"+n),r.b(' <button class="show btn">Add collection</button>'),r.b("\n"+n),r.b(' <button class="add btn btn-primary">Add collection</button>'),r.b("\n"+n),r.b(' <button class="cancel btn">Cancel</button>'),r.b("\n"+n),r.b("</div>"),r.b("\n"),r.fl()}}),Genghis.Templates.DatabaseRow=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<td>"),r.b("\n"+n),r.b(' <a href="'),r.b(r.v(r.f("url",e,t,0))),r.b('" class="name value">'),r.b(r.v(r.f("name",e,t,0))),r.b("</a>"),r.b("\n"+n),r.b("</td>"),r.b("\n"+n),r.b("<td>"),r.b("\n"+n),r.b(' <span class="collections has-details value">'),r.b(r.v(r.f("count",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(' <div class="details" title="'),r.b(r.v(r.f("count",e,t,0))),r.b(" Collection"),r.s(r.f("isPlural",e,t,1),e,t,0,210,211,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b("s")}),e.pop()),r.b('">'),r.b("\n"+n),r.s(r.f("count",e,t,1),e,t,0,249,520,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(" <ul>"),r.b("\n"+n),r.s(r.f("firstChildren",e,t,1),e,t,0,303,357,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" <li>"),n.b(n.v(n.d(".",e,t,0))),n.b("</li>"),n.b("\n")}),e.pop()),r.s(r.f("hasMoreChildren",e,t,1),e,t,0,416,471,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" <li>&hellip;</li>"),n.b("\n")}),e.pop()),r.b(" </ul>"),r.b("\n")}),e.pop()),r.s(r.f("count",e,t,1),e,t,1,0,0,"")||(r.b(" <em>None.</em>"),r.b("\n")),r.b(" </div>"),r.b("\n"+n),r.b("</td>"),r.b("\n"+n),r.b("<td>"),r.b("\n"+n),r.b(' <span class="size value">'),r.b(r.v(r.f("humanSize",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b("</td>"),r.b("\n"+n),r.b('<td class="action-column">'),r.b("\n"+n),r.b(' <button class="btn btn-mini btn-danger destroy">Remove</button>'),r.b("\n"+n),r.b("</td>"),r.fl()}}),Genghis.Templates.Databases=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<header><h2>"),r.b(r.v(r.f("title",e,t,0))),r.b("</h2></header>"),r.b("\n"+n),r.b('<div class="content">'),r.b("\n"+n),r.b(" <table>"),r.b("\n"+n),r.b(" <thead>"),r.b("\n"+n),r.b(" <tr>"),r.b("\n"+n),r.b(" <th>name</th>"),r.b("\n"+n),r.b(" <th>collections</th>"),r.b("\n"+n),r.b(" <th>size</th>"),r.b("\n"+n),r.b(" <th></th>"),r.b("\n"+n),r.b(" </tr>"),r.b("\n"+n),r.b(" </thead>"),r.b("\n"+n),r.b(" <tbody>"),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b("</div>"),r.b("\n"+n),r.b('<div class="add-form inactive form-horizontal">'),r.b("\n"+n),r.b(' <input class="name span4" type="text" size="30">'),r.b("\n"+n),r.b(' <button class="show btn">Add database</button>'),r.b("\n"+n),r.b(' <button class="add btn btn-primary">Add database</button>'),r.b("\n"+n),r.b(' <button class="cancel btn">Cancel</button>'),r.b("\n"+n),r.b("</div>"),r.fl()}}),Genghis.Templates.Document=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<header>"),r.b("\n"+n),r.b(" <h2>"),r.b("\n"+n),r.b(" "),r.b(r.v(r.d("model.prettyId",e,t,0))),r.b("\n"+n),r.s(r.d("model.prettyTime",e,t,1),e,t,0,78,184,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(' <small><time datetime="'),n.b(n.v(n.d("model.prettyTime",e,t,0))),n.b('">'),n.b(n.v(n.d("model.prettyTime",e,t,0))),n.b("</time></small>"),n.b("\n")}),e.pop()),r.b(" </h2>"),r.b("\n"+n),r.b("</header>"),r.b("\n"+n),r.b('<div class="content document-wrapper"></div>'),r.fl()}}),Genghis.Templates.DocumentView=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="well">'),r.b("\n"+n),r.b(' <div class="document-actions">'),r.b("\n"+n),r.b(' <button class="btn btn-small btn-primary save">Save</button>'),r.b("\n"+n),r.b(' <button class="btn btn-small cancel">Cancel</button>'),r.b("\n"+n),r.b(' <button class="btn btn-small edit">Edit</button>'),r.b("\n"+n),r.b(' <button class="btn btn-small btn-danger destroy">Delete</button>'),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b("\n"+n),r.b(" <h3>"),r.b("\n"+n),r.b(' <a class="id" href="'),r.b(r.v(r.f("url",e,t,0))),r.b('">'),r.b(r.v(r.f("prettyId",e,t,0))),r.b("</a>"),r.b("\n"+n),r.s(r.f("prettyTime",e,t,1),e,t,0,418,512,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(' <small><time datetime="'),n.b
809
+ (n.v(n.f("prettyTime",e,t,0))),n.b('">'),n.b(n.v(n.f("prettyTime",e,t,0))),n.b("</time></small>"),n.b("\n")}),e.pop()),r.b(" </h3>"),r.b("\n"+n),r.b("\n"+n),r.b(' <div class="document"></div>'),r.b("\n"+n),r.b("</div>"),r.b("\n"),r.fl()}}),Genghis.Templates.Documents=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<header><h2>Documents</h2></header>"),r.b("\n"+n),r.b('<div class="controls">'),r.b("\n"+n),r.b(' <button class="add-document btn btn-large">Add document</button>'),r.b("\n"+n),r.b(' <div class="pagination-wrapper top"></div>'),r.b("\n"+n),r.b("</div>"),r.b("\n"+n),r.b('<div class="content document-wrapper"></div>'),r.b("\n"+n),r.b('<div class="controls">'),r.b("\n"+n),r.b(' <button class="add-document btn btn-large">Add document</button>'),r.b("\n"+n),r.b(' <div class="pagination-wrapper top"></div>'),r.b("\n"+n),r.b("</div>"),r.b("\n"),r.fl()}}),Genghis.Templates.KeyboardShortcuts=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div id="keyboard-shortcuts" class="modal">'),r.b("\n"+n),r.b(' <div class="modal-header">'),r.b("\n"+n),r.b(' <a href="#" class="close">×</a>'),r.b("\n"+n),r.b(" <h3>Keyboard shortcuts</h3>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="modal-body">'),r.b("\n"+n),r.b(" <ul>"),r.b("\n"+n),r.b(" <li>"),r.b("\n"+n),r.b(" <h4>Global</h4>"),r.b("\n"+n),r.b(" <dl>"),r.b("\n"+n),r.b(" <dt><kbd>?</kbd></dt>"),r.b("\n"+n),r.b(" <dd>This cheat sheet</dd>"),r.b("\n"+n),r.b("\n"+n),r.b(" <dt><kbd>s</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Go to servers</dd>"),r.b("\n"+n),r.b("\n"+n),r.b(" <dt><kbd>u</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Go up one level</dd>"),r.b("\n"+n),r.b(" </dl>"),r.b("\n"+n),r.b("\n"+n),r.b(" <h4>Servers</h4>"),r.b("\n"+n),r.b(" <dl>"),r.b("\n"+n),r.b(" <dt><kbd>c</kbd></dt>"),r.b("\n"+n),r.b(" <dd>New server</dd>"),r.b("\n"+n),r.b(" </dl>"),r.b("\n"+n),r.b("\n"+n),r.b(" <h4>Databases</h4>"),r.b("\n"+n),r.b(" <dl>"),r.b("\n"+n),r.b(" <dt><kbd>c</kbd></dt>"),r.b("\n"+n),r.b(" <dd>New database</dd>"),r.b("\n"+n),r.b(" </dl>"),r.b("\n"+n),r.b(" </li>"),r.b("\n"+n),r.b(" <li>"),r.b("\n"+n),r.b(" <h4>Collections</h4>"),r.b("\n"+n),r.b(" <dl>"),r.b("\n"+n),r.b(" <dt><kbd>c</kbd></dt>"),r.b("\n"+n),r.b(" <dd>New collection</dd>"),r.b("\n"+n),r.b(" </dl>"),r.b("\n"+n),r.b("\n"+n),r.b(" <h4>Documents</h4>"),r.b("\n"+n),r.b(" <dl>"),r.b("\n"+n),r.b(" <dt><kbd>/</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Search</dd>"),r.b("\n"+n),r.b("\n"+n),r.b(" <dt><kbd>c</kbd></dt>"),r.b("\n"+n),r.b(" <dd>New document</dd>"),r.b("\n"+n),r.b("\n"+n),r.b(" <dt><kbd>n</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Next page</dd>"),r.b("\n"+n),r.b("\n"+n),r.b(" <dt><kbd>p</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Previous page</dd>"),r.b("\n"+n),r.b("\n"+n),r.b("<!--"),r.b("\n"+n),r.b(" <dt><kbd>-</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Collapse all</dd>"),r.b("\n"+n),r.b("\n"+n),r.b(" <dt><kbd>+</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Expand all</dd>"),r.b("\n"+n),r.b("\n"+n),r.b(" <dt><kbd>Alt+1</kbd> &ndash; <kbd>Alt+9</kbd></dt>"),r.b("\n"+n),r.b(" <dd>Expand to depth</dd>"),r.b("\n"+n),r.b("-->"),r.b("\n"+n),r.b(" </dl>"),r.b("\n"+n),r.b(" </li>"),r.b("\n"+n),r.b(" </ul>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b("</div>"),r.fl()}}),Genghis.Templates.Masthead=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="container">'),r.b("\n"+n),r.b(" "),r.s(r.f("heading",e,t,1),e,t,0,42,64,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b("<h1>"),n.b(n.v(n.f("heading",e,t,0))),n.b("</h1>")}),e.pop()),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("content",e,t,0))),r.b("\n"+n),r.b("</div>"),r.fl()}}),Genghis.Templates.Nav=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<ul class="nav">'),r.b("\n"+n),r.b(' <li class="nav-section servers"><a class="btn-servers" href="'),r.b(r.v(r.f("baseUrl",e,t,0))),r.b('">Servers</a></li>'),r.b("\n"+n),r.b(' <li class="nav-section dropdown server"></li>'),r.b("\n"+n),r.b(' <li class="nav-section dropdown database"></li>'),r.b("\n"+n),r.b(' <li class="nav-section dropdown collection"></li>'),r.b("\n"+n),r.b("</ul>"),r.b("\n"),r.fl()}}),Genghis.Templates.NavSection=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<a href="#" class="dropdown-toggle" data-toggle="dropdown">'),r.b(r.v(r.f("id",e,t,0))),r.b("</a>"),r.b("\n"+n),r.b('<ul class="dropdown-menu"></ul>'),r.b("\n"),r.fl()}}),Genghis.Templates.NavSectionMenu=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.s(r.d("collection.firstChildren",e,t,1),e,t,0,31,130,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(' <li><a href="'),r.b(r.v(r.f("url",e,t,0))),r.b('">'),r.b("\n"+n),r.b(" "),r.b(r.v(r.f("id",e,t,0))),r.b("\n"+n),r.b(" <span>"),r.b(r.v(r.f("humanCount",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(" </a></li>"),r.b("\n")}),e.pop()),r.s(r.d("collection.hasMoreChildren",e,t,1),e,t,0,195,287,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(' <li class="divider"></li>'),r.b("\n"+n),r.b(' <li><a href="'),r.b(r.v(r.d("collection.url",e,t,0))),r.b('">More &raquo;</a></li>'),r.b("\n")}),e.pop()),r.fl()}}),Genghis.Templates.NewDocument=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div id="new-document" class="modal editor">'),r.b("\n"+n),r.b(' <div class="modal-header">'),r.b("\n"+n),r.b(' <a class="close" data-dismiss="modal">&times;</a>'),r.b("\n"+n),r.b(" <h3>New Document</h3>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="modal-body">'),r.b("\n"+n),r.b(' <div class="wrapper">'),r.b("\n"+n),r.b(' <div id="editor-new" class="genghis-document-editor"></div>'),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="modal-footer">'),r.b("\n"+n),r.b(' <button class="btn cancel">Cancel</button>'),r.b("\n"+n),r.b(' <button class="btn btn-primary save">Save</button>'),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b("</div>"),r.fl()}}),Genghis.Templates.Pagination=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="pagination pagination-right">'),r.b("\n"+n),r.b(" <ul>"),r.b("\n"+n),r.b(' <li class="prev'),r.s(r.f("isFirst",e,t,1),e,t,0,82,91,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" disabled")}),e.pop()),r.b('">'),r.b("\n"+n),r.b(" <a"),r.s(r.f("isFirst",e,t,1),e,t,1,0,0,"")||(r.b(' href="'),r.b(r.v(r.f("prevUrl",e,t,0))),r.b('"')),r.b(">&larr;</a>"),r.b("\n"+n),r.b(" </li>"),r.b("\n"+n),r.b("\n"+n),r.s(r.f("isStart",e,t,1),e,t,1,0,0,"")||(r.b(' <li class="first"><a href="'),r.b(r.v(r.f("firstUrl",e,t,0))),r.b('">1</a></li>'),r.b("\n"+n),r.b(' <li class="disabled"><a>&hellip;</a></li>'),r.b("\n")),r.b("\n"+n),r.b("\n"+n),r.s(r.f("pageUrls",e,t,1),e,t,0,361,460,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" <li"),n.s(n.f("active",e,t,1),e,t,0,386,401,"{{ }}")&&(n.rs(e,t,function(e,t,n){n.b(' class="active"')}),e.pop()),n.b('><a href="'),n.b(n.v(n.f("url",e,t,0))),n.b('">'),n.b(n.v(n.f("index",e,t,0))),n.b("</a></li>"),n.b("\n")}),e.pop()),r.b("\n"+n),r.s(r.f("isEnd",e,t,1),e,t,1,0,0,"")||(r.b(' <li class="disabled"><a>&hellip;</a></li>'),r.b("\n"+n),r.b(' <li class="last"><a href="'),r.b(r.v(r.f("lastUrl",e,t,0))),r.b('">'),r.b(r.v(r.f("last",e,t,0))),r.b("</a></li>"),r.b("\n")),r.b("\n"+n),r.b(' <li class="next'),r.s(r.f("isLast",e,t,1),e,t,0,663,672,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" disabled")}),e.pop()),r.b('">'),r.b("\n"+n),r.b(" <a"),r.s(r.f("isLast",e,t,1),e,t,1,0,0,"")||(r.b(' href="'),r.b(r.v(r.f("nextUrl",e,t,0))),r.b('"')),r.b(">&rarr;</a>"),r.b("\n"+n),r.b(" </li>"),r.b("\n"+n),r.b(" </ul>"),r.b("\n"+n),r.b("</div>"),r.fl()}}),Genghis.Templates.Search=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<input id="navbar-query" class="search-query" name="q" type="text" value="'),r.b(r.v(r.f("query",e,t,0))),r.b('" />'),r.b("\n"+n),r.b('<div class="search-advanced">'),r.b("\n"+n),r.b(' <div class="well"></div>'),r.b("\n"+n),r.b(' <div class="form-actions">'),r.b("\n"+n),r.b(' <button class="search btn btn-primary">Search</button>'),r.b("\n"+n),r.b(' <button class="cancel btn">Cancel</button>'),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b("</div>"),r.b("\n"+n),r.b('<span class="grippie"></span>'),r.b("\n"),r.fl()}}),Genghis.Templates.ServerRow=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.s(r.f("error",e,t,1),e,t,0,12,167,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(' <td colspan="3">'),r.b("\n"+n),r.b(' <span class="value">'),r.b(r.v(r.f("name",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(' <span class="label label-important" title="'),r.b(r.v(r.f("error",e,t,0))),r.b('">Error</span>'),r.b("\n"+n),r.b(" </td>"),r.b("\n")}),e.pop()),r.s(r.f("error",e,t,1),e,t,1,0,0,"")||(r.b(" <td>"),r.b("\n"+n),r.b(' <a href="'),r.b(r.v(r.f("url",e,t,0))),r.b('" class="name value">'),r.b(r.v(r.f("name",e,t,0))),r.b("</a>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b(" <td>"),r.b("\n"+n),r.b(' <span class="databases has-details value">'),r.b(r.v(r.f("count",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(' <div class="details" title="'),r.b(r.v(r.f("count",e,t,0))),r.b(" Database"),r.s(r.f("isPlural",e,t,1),e,t,0,423,424,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b("s")}),e.pop()),r.b('">'),r.b("\n"+n),r.s(r.f("count",e,t,1),e,t,0,466,773,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(" <ul>"),r.b("\n"+n),r.s(r.f("firstChildren",e,t,1),e,t,0,528,590,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" <li>"),n.b(n.v(n.d(".",e,t,0))),n.b("</li>"),n.b("\n")}),e.pop()),r.s(r.f("hasMoreChildren",e,t,1),e,t,0,653,716,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(" <li>&hellip;</li>"),n.b("\n")}),e.pop()),r.b(" </ul>"),r.b("\n")}),e.pop()),r.s(r.f("count",e,t,1),e,t,1,0,0,"")||(r.b(" <em>None.</em>"),r.b("\n")),r.b(" </div>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b(" <td>"),r.b("\n"+n),r.b(' <span class="size value">'),r.b(r.v(r.f("humanSize",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(" </td>"),r.b("\n")),r.b('<td class="action-column">'),r.b("\n"+n),r.b(" "),r.s(r.f("editable",e,t,1),e,t,0,1026,1089,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b('<button class="btn btn-mini btn-danger destroy">Remove</button>')}),e.pop()),r.b("\n"+n),r.b("</td>"),r.b("\n"),r.fl()}}),Genghis.Templates.Servers=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<header><h2>Servers</h2></header>"),r.b("\n"+n),r.b('<div class="content">'),r.b("\n"+n),r.b(" <table>"),r.b("\n"+n),r.b(" <thead>"),r.b("\n"+n),r.b(" <tr>"),r.b("\n"+n),r.b(" <th>name</th>"),r.b("\n"+n),r.b(" <th>databases</th>"),r.b("\n"+n),r.b(" <th>size</th>"),r.b("\n"+n),r.b(" <th></th>"),r.b("\n"+n),r.b(" </tr>"),r.b("\n"+n),r.b(" </thead>"),r.b("\n"+n),r.b(" <tbody>"),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b("</div>"),r.b("\n"+n),r.b('<div class="add-form inactive form-horizontal">'),r.b("\n"+n),r.b(' <span class="input-append">'),r.b("\n"+n),r.b(' <input class="name span4" type="text" size="30"><span class="add-on help" title="user:pass@localhost:27017">?</span>'),r.b("\n"+n),r.b(" </span>"),r.b("\n"+n),r.b(' <button class="show btn">Add server</button>'),r.b("\n"+n),r.b(' <button class="add btn btn-primary">Add server</button>'),r.b("\n"+n),r.b(' <button class="cancel btn">Cancel</button>'),r.b("\n"+n),r.b("</div>"),r.b("\n"),r.fl()}}),Genghis.Templates.Welcome=new Hogan.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<h2>Welcome to</h2>"),r.b("\n"+n),r.b("<h1>Genghis</h1>"),r.b("\n"+n),r.b("<p>The single-file MongoDB admin app.</p>"),r.b("\n"+n),r.b('<ul class="welcome-links">'),r.b("\n"+n),r.b(' <li><a href="http://genghisapp.com">Homepage</a></li>'),r.b("\n"+n),r.b(' <li><a href="https://github.com/bobthecow/genghis/issues">Issues</a></li>'),r.b("\n"+n),r.b(" <li>Version "),r.b(r.v(r.f("version",e,t,0))),r.b("</li>"),r.b("\n"+n),r.b("</ul>"),r.fl()}}),Genghis.Util={route:function(e){return e.replace(app.baseUrl,"").replace(/^\//,"")},parseQuery:function(e){var t={};return e.length&&_.each(e.split("&"),function(e){var n=e.split("="),r=n.shift();t[r]=decodeURIComponent(n.join("="))}),t},buildQuery:function(e){return _.map(e,function(e,t){return t+"="+e}).join("&")},humanizeSize:function(e){if(e==-0)return"n/a";var t=["Bytes","KB","MB","GB","TB","PB"],n=parseInt(Math.floor(Math.log(e)/Math.log(1024)),10);return(n===0?e/Math.pow(1024,n):(e/Math.pow(1024,n)).toFixed(1))+" "+t[n]},humanizeCount:function(e){var t="";return e=e||0,e>1e3&&(e=Math.floor(e/1e3),t=" k"),e>1e3&&(e=Math.floor(e/1e3),t=" M"),e>1e3?"...":e+t},escape:function(e){if(e)return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},attachCollapsers:function(e){$(".document",e).on("click","button,span.e",function(e){var t=$(this).parent(),n=t.children(".v"),r=/^\s*(name|title)\s*/i,i=n.hasClass("o"),s="",o,u;t.children(".e").length||(i&&(u=$(_.detect(n.find("> span.p > var"),function(e){return r.test($(e).text())})).siblings("span.v"),u.length===0&&(u=$(_.detect(n.find("> span.p > span.v"),function(e){var t=$(e);return t.hasClass("n")||t.hasClass("b")||t.hasClass("q")&&t.text().length<64}))),u&&u.length&&(o=u.siblings("var").text(),s=(o?o+": ":"")+Genghis.Util.escape(u.text()))),t.append('<span class="e">'+(i?"{":"[")+" <q>"+s+" &hellip;</q> "+(i?"}":"]")+"</span>")),t.toggleClass("collapsed"),e.preventDefault()})},base64Encode:function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=e.length,r="";for(var i=0;i<n;i+=3){var s=[e.charCodeAt(i),e.charCodeAt(i+1),e.charCodeAt(i+2)],o=[s[0]>>2,(s[0]&3)<<4|s[1]>>4,(s[1]&15)<<2|s[2]>>6,s[2]&63];isNaN(s[1])&&(o[2]=64),isNaN(s[2])&&(o[3]=64),r+=t[o[0]]+t[o[1]]+t[o[2]]+t[o[3]]}return r},base64Decode:function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=e.length,r="",i,s,o,u,a,f,l;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");var c=0;while(c<n)u=t.indexOf(e.charAt(c++)),a=t.indexOf(e.charAt(c++)),f=t.indexOf(e.charAt(c++)),l=t.indexOf(e.charAt(c++)),i=u<<2|a>>4,s=(a&15)<<4|f>>2,o=(f&3)<<6|l,r+=String.fromCharCode(i),f!=64&&(r+=String.fromCharCode(s)),l!=64&&(r+=String.fromCharCode(o));return r},base64ToHex:function(e){var t=[],n=atob(e.replace(/[=\s]+$/,"")),r=n.length;for(var i=0;i<r;++i){var s=n.charCodeAt(i).toString(16);t.push(s.length===1?"0"+s:s)}return t.join("")}},Genghis.JSON={parse:function(src){function addError(e,t){t.error||(error=new Error(e),error.loc=t.loc,error.node=t,t.error=error,errors.push(error))}function throwErrors(e){var t=new Error(""+e.length+" parse error"+(e.length===1?"":"s"));throw t.errors=e,t}function replaceCallExpression(src){function ObjectId(e){return{$genghisType:"ObjectId",$value:e?e.toString():null}}function GenghisDate(e){return{$genghisType:"ISODate",$value:e?(new Date(e)).toString():null}}function ISODate(e){if(!e)return new GenghisDate;var t=/(\d{4})-?(\d{2})-?(\d{2})([T ](\d{2})(:?(\d{2})(:?(\d{2}(\.\d+)?))?)?(Z|([+\-])(\d{2}):?(\d{2})?)?)?/,n=t.exec(e);if(!n)throw"Invalid ISO date";var r=parseInt(n[1],10)||1970,i=(parseInt(n[2],10)||1)-1,s=parseInt(n[3],10)||0,o=parseInt(n[5],10)||0,u=parseInt(n[7],10)||0,a=parseFloat(n[9])||0,f=Math.round(a%1*1e3);a-=f/1e3;var l=Date.UTC(r,i,s,o,u,a,f);if(n[11]&&n[11]!="Z"){var c=0;c+=(parseInt(n[13],10)||0)*60*60*1e3,c+=(parseInt(n[14],10)||0)*60*1e3,n[12]=="+"&&(c*=-1),l+=c}return new GenghisDate(l)}function DBRef(e,t){return{$ref:e,$id:t}}function GenghisRegExp(e,t){return{$genghisType:"RegExp",$value:{$pattern:e?e.toString():null,$flags:t?t.toString():null}}}function BinData(e,t){return{$genghisType:"BinData",$value:{$subtype:e,$binary:t}}}return src=src.replace(/^\s*(new\s+)?(Date|RegExp)(\b)/,"$1Genghis$2$3"),JSON.stringify(eval(src))}function replaceRegExpLiteral(e){var t="";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),replaceCallExpression("GenghisRegExp("+JSON.stringify(e.source)+', "'+t+'")')}function insertHelpers(e){function n(t){chunks[e.range[0]]=t;for(var n=e.range[0]+1;n<e.range[1];n++)chunks[n]=""}if(!e.range)return;e.source=function(){return chunks.slice(e.range[0],e.range[1]).join("")};if(e.update&&typeof e.update=="object"){var t=e.update;Object.keys(t).forEach(function(e){n[e]=t[e]}),e.update=n}else e.update=n}function assertType(e,t){t.type!==e&&addError("Expecting "+e+" but found "+t.type,t)}typeof src!="string"&&(src=String(src)),src="var __genghis_json__ = "+src;var opts={loc:!0,raw:!0,tokens:!0,tolerant:!0,range:!0},allowedCalls={ObjectId:!0,Date:!0,ISODate:!0,DBRef:!0,RegExp:!0,BinData:!0},allowedPropertyValues={Literal:!0,ObjectExpression:!0,ArrayExpression:!0,NewExpression:!0,CallExpression:!0,UnaryExpression:!0},errors=[],chunks=src.split(""),ast;try{ast=esprima.parse(src,opts)}catch(e){throwErrors([e])}ast.errors.length&&throwErrors(ast.errors);var node;return node=ast,assertType("Program",node),node=node.body,node.length!==1&&addError("Unexpected statement "+node[1].type,node[1]),node=node[0],assertType("VariableDeclaration",node),node=node.declarations,node.length!==1&&addError("Unexpected variable declarations "+node.length,node[1]),node=node[0],assertType("VariableDeclarator",node),node=node.init,node.type!=="ObjectExpression"&&addError("Expected an object expression, found "+node.type,node),errors.length&&throwErrors(errors),function walk(e){insertHelpers(e),Object.keys(e).forEach(function(t){var n=e[t];if(Array.isArray(n)){var r=[];n.forEach(function(e){e&&typeof e.type=="string"&&walk(e)})}else n&&typeof n.type=="string"&&(insertHelpers(e),walk(n))});switch(e.type){case"NewExpression":case"CallExpression":e.callee&&!allowedCalls[e.callee.name]?addError("Bad call, bro: "+e.callee.name,e):e.update(replaceCallExpression(e.source()));break;case"Property":e.value&&!allowedPropertyValues[e.value.type]&&addError("Unexpected value: "+e.value.source(),e.value);break;case"Identifier":case"ArrayExpression":case"ObjectExpression":case"UnaryExpression":break;case"Literal":_.isRegExp(e.value)&&e.update(replaceRegExpLiteral(e.value));break;default:addError("Unexpected "+e.type,e)}}(node),errors.length&&throwErrors(errors),function(node){var __genghis_json__;return eval("__genghis_json__ = "+node.source()),__genghis_json__}(node)},stringify:function(e,t){return jQuery("<div>"+this.prettyPrint(e,t,!1)+"</div>").text()},prettyPrint:function(e,t,n){function r(e){function d(e,t){return m("SPAN",e,t)}function m(e,t,n){var r=document.createElement(e);return t&&(r.className=t),n&&(typeof n=="string"&&(n=g(n)),r.appendChild(n)),r}function g(e){return document.createTextNode(e)}function y(e){var t=d("v q"),n;return t.appendChild(g('"')),i.lastIndex=0,i.test(e)&&(e=e.replace(i,function(e){var t=h[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),s.test(e)?(n=m("A","s"),n.href=e):n=d("s"),n.appendChild(g(e)),t.appendChild(n),t.appendChild(g('"')),t}function b(e){if(f.test(e)||!a.test(e))e='"'+e.replace(i,function(e){var t=h[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"';return m("VAR",!1,e)}function w(e,t,n){var r=d("call "+n);return r.appendChild(g(e+"(")),_.each(t,function(e,n){r.appendChild(e),n<t.length-1&&r.appendChild(g(", "))}),r.appendChild(g(")")),r}function E(e,t){var r,i,s,o,u=l,a,f,h,p="",v=t[e],S;_.isObject(v)&&typeof v.toJSON=="function"&&(v=v.toJSON(e));switch(typeof v){case"string":return y(v);case"number":return d("v n",isFinite(v)?String(v):"null");case"boolean":return d("v b",String(v));case"object":if(_.isNull(v))return d("v z","null");if(Object.hasOwnProperty.call(v,"$genghisType"))switch(v.$genghisType){case"ObjectId":return w("ObjectId",[y(v.$value)],"oid");case"ISODate":return w("ISODate",[y(v.$value)],"date");case"RegExp":var x=v.$value.$pattern,T=v.$value.$flags||"";return d("v re","/"+x+"/"+T);case"BinData":return w("BinData",[d("n",String(v.$value.$subtype)),y(v.$value.$binary)],"bindata")}l+=c;if(_.isArray(v)){if(v.length===0)return l=u,d("v a","[]");f=d("v a"),n&&l&&(f.collapsible=!0,v.length>10&&(f.collapsed=!0)),f.appendChild(g(l?"[\n"+l:"[")),p=g(l?",\n"+l:","),o=v.length;for(r=0;r<o;r+=1)r>0&&f.appendChild(p.cloneNode(!1)),f.appendChild(E(r,v)||d("v z","null"));return f.appendChild(g(l?"\n"+u+"]":"]")),l=u,f}a=[];var N=g(l?": ":":");for(i in v)if(Object.hasOwnProperty.call(v,i)){s=E(i,v);if(s){S="p"+(s.collapsed?" collapsed":"");if(i=="$ref"||i=="$id"||i=="$db")S=S+" ref-"+i.substr(1);h=d(S),s.collapsible&&h.appendChild(m("button")),h.appendChild(b(i)),h.appendChild(N.cloneNode(!1)),h.appendChild(s),s.collapsed&&(child=d("e"),child.appendChild(g("[ ")),child.appendChild(m("Q",!1,g(" …"))),child.appendChild(g(" ]")),h.appendChild(child)),a.push(h)}}S="v o";if(a.length===0)return d(S,g("{}"));v.$ref&&v.$id&&(S+=" ref"),f=d(S),f.collapsible=!!n,f.appendChild(g(l?"{\n"+l:"{")),p=g(l?",\n"+l:","),o=a.length;for(r=0;r<a.length;r++)r>0&&f.appendChild(p.cloneNode(!0)),f.appendChild(a[r]);return f.appendChild(g(l?"\n"+u+"}":"}")),l=u,f}}var r=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s=/^https?:\/\/[^\s]+$/,o="$A-Z_a-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",u="0-9̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ംഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧙ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᷀-ᷦ᷼-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︦︳︴﹍-﹏0-9_",a=RegExp("^["+o+"]["+o+u+"]*$"),f=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/,l="",c=t===!1?"":" ",h={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},p={"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"};return l="",v=E("_",{_:e}).innerHTML,v}return n=n!==!1,r(e)},normalize:function(e,t){return Genghis.JSON.stringify(Genghis.JSON.parse(e),t)}},Genghis.Collections.BaseCollection=Backbone.Collection.extend({firstChildren:function(){return this.collection.toArray().slice(0,10)},hasMoreChildren:function(){return this.collection.length>10}}),Genghis.Models.BaseModel=Backbone.Model.extend({name:function(){return this.get("name")},count:function(){return this.get("count")},humanCount:function(){return Genghis.Util.humanizeCount(this.get("count")||0)},isPlural:function(){return this.get("count")!==1},humanSize:function(){return Genghis.Util.humanizeSize(this.get("size"))},hasMoreChildren:function(){return this.get("count")>15}}),Genghis.Views.BaseDocument=Backbone.View.extend({errorMarkers:[],clearErrors:function(){var e=this.editor;this.getErrorBlock().html(""),_.each(this.errorMarkers,function(t){e.clearMarker(t)}),this.errorMarkers=[]},getEditorValue:function(){this.clearErrors();var e=this.getErrorBlock(),t=this.editor,n=this.errorMarkers;try{return Genghis.JSON.parse(t.getValue())}catch(r){_.each(r.errors||[r],function(r){var i=r.message;r.lineNumber&&!/Line \d+/i.test(i)&&(i="Line "+r.lineNumber+": "+r.message);var s=new Genghis.Views.Alert({model:new Genghis.Models.Alert({level:"error",msg:i,block:!0})});e.append(s.render().el),r.lineNumber&&n.push(t.setMarker(r.lineNumber-1,null,"line-error"))})}return!1}}),Genghis.Views.BaseRow=Backbone.View.extend({tagName:"tr",events:{"click a.name":"navigate","click button.destroy":"destroy"},initialize:function(){_.bindAll(this,"render","navigate","remove","destroy"),this.model.bind("change",this.render),this.model.bind("destroy",this.remove)},render:function(){return $(this.el).html(this.template.render(this.model)).toggleClass("error",!!this.model.get("error")).find(".label[title]").tooltip({placement:"bottom"}),this.$(".has-details").popover({html:!0,content:function(){return $(this).siblings(".details").html()},title:function(){return $(this).siblings(".details").attr("title")},trigger:"manual"}).hoverIntent(function(){$(this).popover("show")},function(){$(this).popover("hide")}),this},navigate:function(e){e.preventDefault(),app.router.navigate(Genghis.Util.route($(e.target).attr("href")),!0)},remove:function(){$(this.el).remove()},isParanoid:!1,destroy:function(){var e=this.model,t=e.has("name")?e.get("name"):"";if(this.isParanoid){if(!t)throw"Unable to confirm destruction without a confirmation string.";apprise("<strong>Deleting is forever.</strong><br><br>Type <strong>"+t+"</strong> to continue:",{input:!0,textOk:"Delete "+t+" forever"},function(n){n==t?e.destroy():apprise("<strong>Phew. That was close.</strong><br><br>"+t+" was not deleted.")})}else apprise("Really? There is no undo.",{confirm:!0,textOk:this.destroyConfirmButton(t)},function(t){t&&e.destroy()})},destroyConfirmButton:function(e){return"<strong>Yes</strong>, delete "+e+" forever"}}),Genghis.Views.BaseSection=Backbone.View.extend({events:{"click .add-form button.show":"showAddForm","click .add-form button.add":"submitAddForm","click .add-form button.cancel":"closeAddForm","keyup .add-form input.name":"updateOnKeyup"},initialize:function(){_.bindAll(this,"render","updateTitle","showAddForm","showAddFormIfVisible","submitAddForm","closeAddForm","updateOnKeyup","addModel","addModelAndUpdate","addAll"),this.model&&this.model.bind("change",this.updateTitle),this.collection&&(this.collection.bind("reset",this.render),this.collection.bind("add",this.addModelAndUpdate)),$(document).bind("keyup","c",this.showAddFormIfVisible),this.render()},render:function(){$(this.el).html(this.template.render({title:this.formatTitle(this.model)})),this.addForm=this.$(".add-form"),this.addButton=this.$(".add-form button.add"),this.addInput=this.$(".add-form input"),this.cancelButton=this.$(".add-form button.cancel"),this.addAll(),this.$(".help",this.addForm).tooltip();var e={};return e[this.$("table thead th").length-1]={sorter:!1},this.$("table").tablesorter({headers:e,textExtraction:function(e){return $(".value",e).text()||$(e).text()}}),this.collection.size()&&this.$("table").trigger("sorton",[[[0,0]]]),this},updateTitle:function(){this.$("> header h2").text(this.formatTitle(this.model))},showAddForm:function(){this.addForm.removeClass("inactive"),this.addInput.focus()},showAddFormIfVisible:function(e){$(this.el).is(":visible")&&(e.preventDefault(),this.showAddForm())},submitAddForm:function(){this.collection.create({name:this.addInput.val()}),this.closeAddForm()},closeAddForm:function(){this.addForm.addClass("inactive"),this.addInput.val("")},updateOnKeyup:function(e){e.keyCode==13&&this.submitAddForm(),e.keyCode==27&&this.closeAddForm()},addModel:function(e){var t=new this.rowView({model:e});this.$("table tbody").append(t.render().el)},addModelAndUpdate:function(e){this.addModel(e),this.$("table").trigger("update")},addAll:function(){this.$("table tbody").html(""),this.collection.each(this.addModel),$(this.el).removeClass("spinning")}}),Genghis.Models.Alert=Backbone.Model.extend({defaults:{level:"warning",block:!1}}),Genghis.Models.Collection=Genghis.Models.BaseModel.extend({indexesIsPlural:function(){return this.indexCount()!==1},indexCount:function(){return(this.get("indexes")||[]).length},indexes:function(){return _.map(this.get("indexes"),function(e){return Genghis.JSON.prettyPrint(e.key)})}}),Genghis.Models.Database=Genghis.Models.BaseModel.extend({firstChildren:function(){return _.first(this.get("collections")||[],15)}}),Genghis.Models.Document=Backbone.Model.extend({initialize:function(){_.bindAll(this,"prettyId","prettyTime","prettyPrint","JSONish");var e=this.thunkId(this.get("_id"));e&&(this.id=e)},thunkId:function(e){if(typeof e=="object"&&e.hasOwnProperty("$genghisType")&&e["$genghisType"]=="ObjectId")return e.$value;if(typeof e!="undefined")return"~"+Genghis.Util.base64Encode(JSON.stringify(e))},parse:function(e){var t=this.thunkId(e._id);return t&&(this.id=t),e},url:function(){var e=function(e){return!e||!e.url?null:_.isFunction(e.url)?e.url():e.url},t=e(this.collection)||this.urlRoot||urlError();return t=t.split("?").shift(),this.isNew()?t:t+(t.charAt(t.length-1)=="/"?"":"/")+encodeURIComponent(this.id)},prettyId:function(){var e=this.get("_id");if(typeof e=="object"&&e.hasOwnProperty("$genghisType"))switch(e.$genghisType){case"ObjectId":return e.$value;case"BinData":if(e["$value"]["$subtype"]==3){var t=/^([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})$/i,n=Genghis.Util.base64ToHex(e.$value.$binary);if(t.test(n))return n.replace(t,"$1-$2-$3-$4-$5")}return e.$value.$binary.replace(/\=+$/,"")}return e},prettyTime:function(){if(typeof this._prettyTime=="undefined"){var e=this.get("_id");if(typeof e=="object"&&e.hasOwnProperty("$genghisType")&&e.$genghisType==="ObjectId"&&e["$value"].length==24){var t=new Date;t.setTime(parseInt(e.$value.substring(0,8),16)*1e3),this._prettyTime=t.toUTCString()}}return this._prettyTime},prettyPrint:function(){return Genghis.JSON.prettyPrint(this.toJSON())},JSONish:function(){return Genghis.JSON.stringify(this.toJSON())}}),Genghis.Models.Pagination=Backbone.Model.extend({defaults:{page:1,pages:1,limit:50,count:0,total:0},initialize:function(){_.bindAll(this,"decrementTotal")},decrementTotal:function(){this.set({total:this.get("total")-1,count:this.get("count")-1})}}),Genghis.Models.Selection=Backbone.Model.extend({defaults:{server:null,database:null,collection:null,query:null,page:null},initialize:function(){_.bindAll(this,"select","update","nextPage","previousPage"),this.bind("change",this.update),this.pagination=new Genghis.Models.Pagination,this.servers=new Genghis.Collections.Servers,this.currentServer=new Genghis.Models.Server,this.databases=new Genghis.Collections.Databases,this.currentDatabase=new Genghis.Models.Database,this.collections=new Genghis.Collections.Collections,this.currentCollection=new Genghis.Models.Collection,this.documents=new Genghis.Collections.Documents,this.currentDocument=new Genghis.Models.Document},select:function(e,t,n,r,i,s){this.set({server:e||null,database:t||null,collection:n||null,document:r||null,query:i||null,page:s||null})},update:function(){function f(e,t,n){return n=n||"Please try again.",function(r,i){try{data=JSON.parse(i.responseText)}catch(s){data={}}switch(i.status){case 404:$("section#"+e).hide(),app.showMasthead("404: "+t,"<p>"+n+"</p>",{error:!0});break;default:app.alerts.create({msg:i.status+": "+(data.error||"Unknown error"),level:"error",block:!0})}}}var e=this.get("server"),t=this.get("database"),n=this.get("collection"),r=this.get("document"),i=this.get("query"),s=this.get("page"),o=app.baseUrl,u={};o+="servers",this.servers.url=o,this.servers.fetch(),e?(o=o+"/"+e,this.currentServer.url=o,this.currentServer.fetch({error:f("databases","Server Not Found"
810
810
  )}),o+="/databases",this.databases.url=o,this.databases.fetch()):(this.currentServer.clear(),this.databases.reset()),t?(o=o+"/"+t,this.currentDatabase.url=o,this.currentDatabase.fetch({error:f("collections","Database Not Found")}),o+="/collections",this.collections.url=o,this.collections.fetch()):(this.currentDatabase.clear(),this.collections.reset());if(n){o=o+"/"+n,this.currentCollection.url=o,this.currentCollection.fetch({error:f("documents","Collection Not Found")}),o+="/documents";var a="";if(i||s)i&&(u.q=encodeURIComponent(JSON.stringify(Genghis.JSON.parse(i)))),s&&(u.page=encodeURIComponent(s)),a="?"+Genghis.Util.buildQuery(u);this.documents.url=o+a,this.documents.fetch()}else this.currentCollection.clear(),this.documents.reset();r&&(this.currentDocument.clear({silent:!0}),this.currentDocument.id=r,this.currentDocument.urlRoot=o,this.currentDocument.fetch({error:f("document","Document Not Found","But I&#146;m sure there are plenty of other nice documents out there&hellip;")}))},nextPage:function(){return 1+(this.get("page")||1)},previousPage:function(){return Math.max(1,(this.get("page")||1)-1)}}),Genghis.Models.Server=Genghis.Models.BaseModel.extend({editable:function(){return!!this.get("editable")},firstChildren:function(){return _.first(this.get("databases")||[],15)},error:function(){return this.get("error")}}),Genghis.Collections.Alerts=Backbone.Collection.extend({model:Genghis.Models.Alert,initialize:function(){_.bindAll(this,"handleError")},handleError:function(e){if(e.readyState===0)return;try{data=JSON.parse(e.responseText)}catch(t){data={error:e.responseText}}msg=data.error||"<strong>FAIL</strong> An unexpected server error has occurred.",this.add({level:"error",msg:msg,block:!msg.search(/<(p|ul|ol|div)[ >]/)})}}),Genghis.Collections.Collections=Genghis.Collections.BaseCollection.extend({model:Genghis.Models.Collection}),Genghis.Collections.Databases=Genghis.Collections.BaseCollection.extend({model:Genghis.Models.Database}),Genghis.Collections.Documents=Backbone.Collection.extend({model:Genghis.Models.Document,parse:function(e){return app.selection.pagination.set({page:e.page,pages:e.pages,count:e.documents.length,total:e.count}),e.documents}}),Genghis.Collections.Servers=Backbone.Collection.extend({model:Genghis.Models.Server,firstChildren:function(){return this.collection.reject(function(e){return e.has("error")}).slice(0,10)},hasMoreChildren:function(){return this.collection.length>10||this.collection.detect(function(e){return e.has("error")})}}),Genghis.Views.Alert=Backbone.View.extend({tagName:"div",template:Genghis.Templates.Alert,events:{"click a.close":"destroy"},initialize:function(){_.bindAll(this,"render","remove","destroy"),this.model.bind("change",this.render),this.model.bind("destroy",this.remove)},render:function(){return $(this.el).html(this.template.render(this.model.toJSON())),this},destroy:function(){this.model.destroy()},remove:function(){$(this.el).remove()}}),Genghis.Views.Alerts=Backbone.View.extend({el:"aside#alerts",initialize:function(){_.bindAll(this,"render","addModel"),this.collection.bind("reset",this.render),this.collection.bind("add",this.addModel)},render:function(){return $(this.el).html(""),this},addModel:function(e){var t=new Genghis.Views.Alert({model:e});$(this.el).append(t.render().el)}}),Genghis.Views.App=Backbone.View.extend({el:"section#genghis",initialize:function(){_.bindAll(this,"showMasthead","removeMasthead","showSection");var e=this.baseUrl=this.options.baseUrl,t=this.selection=new Genghis.Models.Selection,n=this.alerts=new Genghis.Collections.Alerts;this.navView=new Genghis.Views.Nav({model:t,baseUrl:e}),this.alertsView=new Genghis.Views.Alerts({collection:n}),this.keyboardShortcutsView=new Genghis.Views.KeyboardShortcuts,this.serversView=new Genghis.Views.Servers({collection:t.servers}),this.databasesView=new Genghis.Views.Databases({model:t.currentServer,collection:t.databases}),this.collectionsView=new Genghis.Views.Collections({model:t.currentDatabase,collection:t.collections}),this.documentsView=new Genghis.Views.Documents({collection:t.documents,pagination:t.pagination}),this.documentView=new Genghis.Views.Document({model:t.currentDocument});var r=this.router=new Genghis.Router;$(".navbar a.brand").click(function(e){e.preventDefault(),r.navigate("",!0)}),$.getJSON(this.baseUrl+"check-status").error(n.handleError).success(function(e){_.each(e.alerts,function(e){n.add(_.extend({block:!e.msg.search(/<(p|ul|ol|div)[ >]/i)},e))})}),t.change()},showMasthead:function(e,t,n){this.removeMasthead(!0),mastheadView=new Genghis.Views.Masthead(_.extend(n||{},{heading:e,content:t||""}))},removeMasthead:function(e){var t=$("header.masthead");e||(t=t.not(".sticky")),t.remove()},showSection:function(e){this.removeMasthead(),e=="servers"&&this.showWelcome();var t=e?"section-"+(_.isArray(e)?e.join(" section-"):e):"";$("body").removeClass("section-servers section-databases section-collections section-documents section-document").addClass(t).toggleClass("has-section",!!e),this.$("section").hide().filter("#"+(_.isArray(e)?e.join(",#"):e)).addClass("spinning").show(),$(document).scrollTop(0)},showWelcome:_.once(function(){this.showMasthead("",Genghis.Templates.Welcome.render({version:Genghis.version}),{epic:!0})})}),Genghis.Views.CollectionRow=Genghis.Views.BaseRow.extend({template:Genghis.Templates.CollectionRow,isParanoid:!0}),Genghis.Views.Collections=Genghis.Views.BaseSection.extend({el:"section#collections",template:Genghis.Templates.Collections,rowView:Genghis.Views.CollectionRow,formatTitle:function(e){return e.id?e.id+" Collections":"Collections"}}),Genghis.Views.DatabaseRow=Genghis.Views.BaseRow.extend({template:Genghis.Templates.DatabaseRow,isParanoid:!0}),Genghis.Views.Databases=Genghis.Views.BaseSection.extend({el:"section#databases",template:Genghis.Templates.Databases,rowView:Genghis.Views.DatabaseRow,formatTitle:function(e){return e.id?e.id+" Databases":"Databases"}}),Genghis.Views.Document=Backbone.View.extend({el:"section#document",template:Genghis.Templates.Document,initialize:function(){_.bindAll(this,"render"),this.model.bind("change",this.render)},render:function(){var e=new Genghis.Views.DocumentView({model:this.model});return $(this.el).removeClass("spinning").html(this.template.render({model:this.model})),this.$(".content").html(e.render().el),this}}),Genghis.Views.DocumentView=Genghis.Views.BaseDocument.extend({tagName:"article",template:Genghis.Templates.DocumentView,events:{"click a.id":"navigate","click button.edit":"openEditDialog","click button.save":"saveDocument","click button.cancel":"cancelEdit","click button.destroy":"destroy","click .ref .ref-ref .v .s":"navigateColl","click .ref .ref-db .v .s":"navigateDb","click .ref .ref-id .v .s, .ref .ref-id .v.n":"navigateId"},initialize:function(){_.bindAll(this,"render","updateDocument","navigate","openEditDialog","cancelEdit","saveDocument","destroy","remove","navigateColl","navigateDb","navigateId"),this.model.bind("change",this.updateDocument),this.model.bind("destroy",this.remove)},render:function(){return $(this.el).html(this.template.render(this.model)),Genghis.Util.attachCollapsers(this.el),setTimeout(this.updateDocument,1),this},updateDocument:function(){this.$(".document").html("").append(this.model.prettyPrint()).show()},navigate:function(e){e.preventDefault(),app.router.navigate(Genghis.Util.route($(e.target).attr("href")),!0)},navigateDb:function(e){var t=$(e.target).parents(".ref"),n=t.find(".ref-db .v .s").text();app.router.redirectToDatabase(app.selection.currentServer.id,n)},navigateColl:function(e){var t=$(e.target).parents(".ref"),n=t.find(".ref-db .v .s").text()||app.selection.currentDatabase.id,r=t.find(".ref-ref .v .s").text();app.router.redirectToCollection(app.selection.currentServer.id,n,r)},navigateId:function(e){var t=$(e.target).parents(".ref"),n=t.find(".ref-db .v .s").text()||app.selection.currentDatabase.id,r=t.find(".ref-ref .v .s").text()||app.selection.currentCollection.id,i=t.find(".ref-id .v .s, .ref-id .v.n").text();app.router.redirectToDocument(app.selection.currentServer.id,n,r,i)},openEditDialog:function(){var e=this.$(".well"),t=Math.max(180,Math.min(600,e.height()+40)),n="editor-"+this.model.id.replace("~","-"),r=$('<textarea id="'+n+'"></textarea>').text(this.model.JSONish()).appendTo(e);this.$(".document").hide();var i=$(this.el).addClass("edit");this.editor=CodeMirror.fromTextArea(r[0],_.extend(Genghis.defaults.codeMirror,{onFocus:function(){i.addClass("focused")},onBlur:function(){i.removeClass("focused")},extraKeys:{"Ctrl-Enter":this.saveDocument,"Cmd-Enter":this.saveDocument}})),this.editor.setSize(null,t),setTimeout(this.editor.focus,50),r.resize(_.throttle(this.editor.refresh,100))},cancelEdit:function(){$(this.el).removeClass("edit focused"),this.editor.toTextArea(),$("textarea",this.el).remove(),this.updateDocument(),this.$(".well").height("auto")},getErrorBlock:function(){var e=this.$("div.errors");return e.length===0&&(e=$('<div class="errors"></div>').prependTo(this.el)),e},saveDocument:function(){var e=this.getEditorValue();if(e===!1)return;this.model.clear({silent:!0}),this.model.set(e),this.model.save(),this.cancelEdit()},destroy:function(){var e=this.model;apprise("Really? There is no undo.",{confirm:!0,textCancel:"Cancel",textOk:"<strong>Yes</strong>, delete document forever"},function(t){if(t){var n=app.selection;e.destroy(),n.pagination.decrementTotal(),n.get("document")&&app.router.redirectTo(n.get("server"),n.get("database"),n.get("collection"),null,n.get("query"))}})},remove:function(){$(this.el).remove()}}),Genghis.Views.Documents=Backbone.View.extend({el:"section#documents",template:Genghis.Templates.Documents,events:{"click button.add-document":"createDocument"},initialize:function(){_.bindAll(this,"render","addAll","addDocument","createDocument","createDocumentIfVisible"),this.pagination=this.options.pagination,this.collection.bind("reset",this.addAll,this),this.collection.bind("add",this.addDocument,this),$(document).bind("keyup","c",this.createDocumentIfVisible),this.render()},render:function(){return $(this.el).html(this.template.render({})),this.headerView=new Genghis.Views.DocumentsHeader({model:this.pagination}),this.newDocumentView=new Genghis.Views.NewDocument({collection:this.collection}),this.paginationView=new Genghis.Views.Pagination({el:this.$(".pagination-wrapper"),model:this.pagination,collection:this.collection}),this.addAll(),this},addAll:function(){this.$(".content").html(""),this.collection.each(this.addDocument),$(this.el).removeClass("spinning")},addDocument:function(e){var t=new Genghis.Views.DocumentView({model:e});this.$(".content").append(t.render().el)},createDocument:function(){this.newDocumentView.show()},createDocumentIfVisible:function(e){$(this.el).is(":visible")&&(e.preventDefault(),this.createDocument())}}),Genghis.Views.DocumentsHeader=Backbone.View.extend({el:"section#documents > header h2",initialize:function(){_.bindAll(this,"render"),this.model.bind("change",this.render)},render:function(){var e,t=this.model.get("count"),n=this.model.get("page"),r=this.model.get("pages"),i=this.model.get("limit"),s=this.model.get("total");e=""+s+" Document"+(s!=1?"s":"");if(s!=t){var o=(n-1)*i+1,u=Math.min((n-1)*i+t,s);e=""+o+" - "+u+" of "+e}return $(this.el).html(e),this}}),Genghis.Views.KeyboardShortcuts=Backbone.View.extend({tagName:"div",template:Genghis.Templates.KeyboardShortcuts,events:{"click a.close":"hide"},initialize:function(){_.bindAll(this,"render","show","hide","toggle"),$(document).bind("keyup","shift+/",this.toggle),$("footer a.keyboard-shortcuts").click(this.show),this.render()},render:function(){return $(this.el).html(this.template.render()).modal({backdrop:!0,keyboard:!0,show:!1}),this},show:function(e){e.preventDefault(),$(this.el).modal("show")},hide:function(e){e.preventDefault(),$(this.el).modal("hide")},toggle:function(){$(this.el).modal("toggle")}}),Genghis.Views.Masthead=Backbone.View.extend({tagName:"header",attributes:{"class":"masthead"},template:Genghis.Templates.Masthead,initialize:function(){this.heading=this.options.heading,this.content=this.options.content||"",this.error=this.options.error||!1,this.epic=this.options.epic||!1,this.sticky=this.options.sticky||!1,this.render()},render:function(){return this.$el.html(this.template.render({heading:this.heading,content:this.content})).toggleClass("error",this.error).toggleClass("epic",this.epic).toggleClass("sticky",this.sticky).insertAfter("header.navbar"),this}}),Genghis.Views.Nav=Backbone.View.extend({el:".navbar nav",template:Genghis.Templates.Nav,events:{"click a":"navigate"},initialize:function(){_.bindAll(this,"render","navigate","navigateToServers","navigateUp"),this.baseUrl=this.options.baseUrl,this.model.bind("change",this.updateQuery),$("body").bind("click",function(e){$(".dropdown-toggle, .menu").parent("li").removeClass("open")}),$(document).bind("keyup","s",this.navigateToServers),$(document).bind("keyup","u",this.navigateUp),this.render()},render:function(){return $(this.el).html(this.template.render({baseUrl:this.baseUrl})),this.serverNavView=new Genghis.Views.NavSection({el:$("li.server",this.el),model:this.model.currentServer,collection:this.model.servers}),this.databaseNavView=new Genghis.Views.NavSection({el:$("li.database",this.el),model:this.model.currentDatabase,collection:this.model.databases}),this.collectionNavView=new Genghis.Views.NavSection({el:$("li.collection",this.el),model:this.model.currentCollection,collection:this.model.collections}),this.searchView=new Genghis.Views.Search({model:this.model}),$(this.el).append(this.searchView.render().el),this},navigate:function(e){e.preventDefault(),app.router.navigate(Genghis.Util.route($(e.target).attr("href")),!0)},navigateToServers:function(e){e.preventDefault(),app.router.redirectToIndex()},navigateUp:function(e){e.preventDefault(),app.router.redirectTo(this.model.has("database")&&this.model.get("server"),this.model.has("collection")&&this.model.get("database"),(this.model.has("document")||this.model.has("query"))&&this.model.get("collection"))}}),Genghis.Views.NavSection=Backbone.View.extend({template:Genghis.Templates.NavSection,menuTemplate:Genghis.Templates.NavSectionMenu,initialize:function(){_.bindAll(this,"render"),this.model.bind("change",this.updateLink,this),this.collection.bind("reset",this.renderMenu,this),this.render()},render:function(){return $(this.el).html(this.template.render(this.model)),this.$(".dropdown-toggle").hoverIntent(function(e){$(e.target).parent("li").addClass("open").siblings("li").removeClass("open")},$.noop),this},updateLink:function(){this.$("a.dropdown-toggle").text(this.model.id?this.model.id:"").attr("href",this.model.id?this.model.url:"")},renderMenu:function(){this.$("ul.dropdown-menu").html(this.menuTemplate.render({model:this.model,collection:this.collection})),this.$("ul.dropdown-menu a span").each(function(e,t){var n=$(t),r=n.text().length;r>3&&n.parent().css("padding-right",""+(r+.5)+"em")})}}),Genghis.Views.NewDocument=Genghis.Views.BaseDocument.extend({el:"#new-document",template:Genghis.Templates.NewDocument,initialize:function(){_.bindAll(this,"render","show","refreshEditor","closeModal","cancelEdit","saveDocument"),this.render()},render:function(){var e;return this.el=$(this.template.render()).hide().appendTo("body"),this.modal=this.el.modal({backdrop:"static",show:!1,keyboard:!1}),e=$(".wrapper",this.el),this.editor=CodeMirror.fromTextArea($("#editor-new",this.el)[0],_.extend(Genghis.defaults.codeMirror,{onFocus:function(){e.addClass("focused")},onBlur:function(){e.removeClass("focused")},extraKeys:{"Ctrl-Enter":this.saveDocument,"Cmd-Enter":this.saveDocument}})),$(window).resize(_.throttle(this.refreshEditor,100)),this.modal.bind("hide",this.cancelEdit),this.modal.bind("shown",this.refreshEditor),this.modal.find("button.cancel").bind("click",this.closeModal),this.modal.find("button.save").bind("click",this.saveDocument),this},show:function(){this.editor.setValue("{\n \n}\n"),this.editor.setCursor({line:1,ch:4}),this.modal.css({marginTop:-10-this.el.height()/2+"px"}).modal("show")},refreshEditor:function(){this.editor.refresh(),this.editor.focus()},closeModal:function(e){this.modal.modal("hide")},cancelEdit:function(e){this.editor.setValue("")},getErrorBlock:function(){var e=$("div.errors",this.el);return e.length===0&&(e=$('<div class="errors"></div>').prependTo($(".modal-body",this.el))),e},saveDocument:function(){var e=this.getEditorValue();if(e===!1)return;var t=this.closeModal;this.collection.create(e,{wait:!0,success:function(e){t(),app.router.navigate(Genghis.Util.route(e.url()),!0)}})}}),Genghis.Views.Pagination=Backbone.View.extend({template:Genghis.Templates.Pagination,events:{"click a":"navigate"},initialize:function(){_.bindAll(this,"render","urlTemplate","navigate","nextPage","prevPage"),this.model.bind("change",this.render),$(document).bind("keyup","n",this.nextPage),$(document).bind("keyup","p",this.prevPage)},render:function(){if(this.model.get("pages")==1)$(this.el).hide();else{var e=9,t=Math.ceil(e/2),n=this.model.get("page"),r=this.model.get("pages"),i=n>t?Math.max(n-(t-3),1):1,s=r-n>t?Math.min(n+(t-3),r):r,o=s==r?Math.max(r-(e-3),1):i,u=i==1?Math.min(o+(e-3),r):s;u>=r-2&&(u=r),o<=3&&(o=1);var a=this.urlTemplate;$(this.el).html(this.template.render({page:n,last:r,firstUrl:a(1),prevUrl:a(Math.max(1,n-1)),nextUrl:a(Math.min(n+1,r)),lastUrl:a(r),pageUrls:_.range(o,u+1).map(function(e){return{index:e,url:a(e),active:e===n}}),isFirst:n===1,isStart:o===1,isEnd:u>=r,isLast:n===r})).show()}return this},urlTemplate:function(e){var t=this.collection.url,n=t.split("?"),r=n.shift(),i=Genghis.Util.parseQuery(n.join("?")),s={page:e};return i.q&&(s.q=encodeURIComponent(app.selection.get("query"))),r+"?"+Genghis.Util.buildQuery(_.extend(i,s))},navigate:function(e){e.preventDefault();var t=$(e.target).attr("href");t&&app.router.navigate(Genghis.Util.route(t),!0)},nextPage:function(e){$(this.el).is(":visible")&&(e.preventDefault(),this.$("li.next a[href]").click())},prevPage:function(e){$(this.el).is(":visible")&&(e.preventDefault(),this.$("li.prev a[href]").click())}}),Genghis.Views.Search=Backbone.View.extend({tagName:"form",className:"navbar-search form-search",template:Genghis.Templates.Search,events:{"keyup input#navbar-query":"handleSearchKeyup","click span.grippie":"toggleExpanded","dragmove span.grippie":"handleGrippieDrag","click button.cancel":"collapseSearch","click button.search":"findDocumentsAdvanced"},initialize:function(){_.bindAll(this,"render","updateQuery","handleSearchKeyup","findDocuments","findDocumentsAdvanced","focusSearch","blurSearch","advancedSearchToQuery","queryToAdvancedSearch","expandSearch","collapseSearch","collapseNoFocus","toggleExpanded","handleGrippieDrag"),this.model.bind("change",this.updateQuery),this.model.bind("change:collection",this.collapseNoFocus)},render:function(){$(this.el).html(this.template.render({query:this.model.get("query")})),$(this.el).submit(function(e){e.preventDefault()}),$(document).bind("keydown","/",this.focusSearch);var e=$(this.el),t=e.find(".well"),n=this.expandSearch,r=this.collapseSearch;return $(".grippie",this.el).bind("mousedown",function(t){function o(t){var o=t.clientY+document.documentElement.scrollTop-e.offset().top;return o>=i&&o<=s&&e.height(o+"px"),e.hasClass("expanded")?o<i&&r():o>100&&n(),!1}function u(t){$(document).unbind("mousemove",o).unbind("mouseup",u),e.hasClass("expanded")||r(),t.preventDefault()}t.preventDefault();var i=30,s=Math.min($(window).height()/2,350);$(document).mousemove(o).mouseup(u)}),this},updateQuery:function(){var e=this.normalizeQuery(this.model.get("query")||this.getDocumentQuery()||"");this.$("input#navbar-query").val(e)},getDocumentQuery:function(){var e=this.model.get("document");return typeof e=="string"&&e[0]==="~"&&(e=Genghis.JSON.normalize('{"_id":'+Genghis.Util.base64Decode(e.substr(1))+"}")),e},handleSearchKeyup:function(e){e.keyCode==13?(e.preventDefault(),this.findDocuments($(e.target).val())):e.keyCode==27&&this.blurSearch()},findDocuments:function(e){var t=Genghis.Util.route(this.model.currentCollection.url+"/documents");e=e.trim(),e.match(/^([a-z\d]+)$/i)?t=t+"/"+e:t=t+"?"+Genghis.Util.buildQuery({q:encodeURIComponent(Genghis.JSON.normalize(e,!1))}),app.router.navigate(t,!0)},findDocumentsAdvanced:function(e){this.findDocuments(this.editor.getValue()),this.collapseSearch()},focusSearch:function(e){this.$("input#navbar-query").is(":visible")?(e&&e.preventDefault(),this.$("input#navbar-query").focus()):this.editor&&this.$(".well").is(":visible")&&(e&&e.preventDefault(),this.editor.focus())},blurSearch:function(){this.$("input#navbar-query").blur(),this.updateQuery()},normalizeQuery:function(e){e=e.trim();if(e!=="")try{e=Genghis.JSON.normalize(e,!1)}catch(t){}return e.replace(/^\{\s*\}$/,"").replace(/^\{\s*(['"]?)_id\1\s*:\s*\{\s*(['"]?)\$id\2\s*:\s*(["'])([a-z\d]+)\3\s*\}\s*\}$/,"$4").replace(/^\{\s*(['"]?)_id\1\s*:\s*(new\s+)?ObjectId\s*\(\s*(["'])([a-z\d]+)\3\s*\)\s*\}$/,"$4")},advancedSearchToQuery:function(){this.$("input#navbar-query").val(this.normalizeQuery(this.editor.getValue()))},queryToAdvancedSearch:function(){var e=this.$("input#navbar-query").val().trim();e.match(/^[a-z\d]+$/i)&&(e='{_id:ObjectId("'+e+'")}');if(e!=="")try{e=Genghis.JSON.normalize(e,!0)}catch(t){}this.editor.setValue(e)},expandSearch:function(e){if(!this.editor){var t=$(".search-advanced",this.el);this.editor=CodeMirror($(".well",this.el)[0],_.extend(Genghis.defaults.codeMirror,{lineNumbers:!1,onFocus:function(){t.addClass("focused")},onBlur:function(){t.removeClass("focused")},extraKeys:{"Ctrl-Enter":this.findDocumentsAdvanced,"Cmd-Enter":this.findDocumentsAdvanced,Esc:this.findDocumentsAdvanced},onChange:this.advancedSearchToQuery}))}this.queryToAdvancedSearch(),$(this.el).addClass("expanded");var n=this.editor,r=this.focusSearch;_.defer(function(){n.refresh(),r()})},collapseSearch:function(){this.collapseNoFocus(),this.focusSearch()},collapseNoFocus:function(){$(this.el).removeClass("expanded").css("height","auto")},toggleExpanded:function(){$(this.el).hasClass("expanded")?this.collapseSearch():(this.expandSearch(),$(this.el).height(Math.floor($(window).height()/4)+"px"))},handleGrippieDrag:function(e){console.log(e)}}),Genghis.Views.ServerRow=Genghis.Views.BaseRow.extend({template:Genghis.Templates.ServerRow,destroyConfirmButton:function(e){return"<strong>Yes</strong>, remove "+e+" from server list"}}),Genghis.Views.Servers=Genghis.Views.BaseSection.extend({el:"section#servers",template:Genghis.Templates.Servers,rowView:Genghis.Views.ServerRow,updateTitle:function(){},formatTitle:function(){return"Servers"}}),Genghis.Router=Backbone.Router.extend({routes:{"":"index",servers:"redirectToIndex","servers/:server":"server","servers/:server/databases":"redirectToServer","servers/:server/databases/:database":"database","servers/:server/databases/:database/collections":"redirectToDatabase","servers/:server/databases/:database/collections/:collection?*query":"redirectToCollectionQuery","servers/:server/databases/:database/collections/:collection":"collection","servers/:server/databases/:database/collections/:collection/documents":"redirectToCollection","servers/:server/databases/:database/collections/:collection/documents?*query":"collectionQuery","servers/:server/databases/:database/collections/:collection/documents/:documentId":"document","*path":"notFound"},index:function(){document.title="Genghis",app.selection.select(),app.showSection("servers")},redirectToIndex:function(){this.navigate("",!0)},server:function(e){document.title=this.buildTitle(e),app.selection.select(e),app.showSection("databases")},redirectToServer:function(e){this.navigate("servers/"+e,!0)},database:function(e,t){document.title=this.buildTitle(e,t),app.selection.select(e,t),app.showSection("collections")},redirectToDatabase:function(e,t){this.navigate("servers/"+e+"/databases/"+t,!0)},collection:function(e,t,n){document.title=this.buildTitle(e,t,n),app.selection.select(e,t,n),app.showSection("documents")},redirectToCollection:function(e,t,n){this.navigate("servers/"+e+"/databases/"+t+"/collections/"+n,!0)},redirectToCollectionQuery:function(e,t,n,r){this.navigate("servers/"+e+"/databases/"+t+"/collections/"+n+"/documents?"+r,!0)},collectionQuery:function(e,t,n,r){document.title=this.buildTitle(e,t,n,"Query results");var i=Genghis.Util.parseQuery(r);app.selection.select(e,t,n,null,i.q,i.page),app.showSection("documents")},redirectToQuery:function(e,t,n,r){this.navigate("servers/"+e+"/databases/"+t+"/collections/"+n+"/documents?"+Genghis.Util.buildQuery({q:encodeURIComponent(r)}),!0)},document:function(e,t,n,r){document.title=this.buildTitle(e,t,n,r),app.selection.select(e,t,n,r),app.showSection("document")},redirectToDocument:function(e,t,n,r){this.navigate("servers/"+e+"/databases/"+t+"/collections/"+n+"/documents/"+r,!0)},redirectTo:function(e,t,n,r,i){return e?t?n?!r&&!i?this.redirectToCollection(e,t,n):i?this.redirectToQuery(e,t,n,i):this.redirectToDocument(e,t,n,r):this.redirectToDatabase(e,t):this.redirectToServer(e):this.redirectToIndex()},notFound:function(e){if(e.replace(/(^\/|\/$)/g,"")==app.baseUrl.replace(/(^\/|\/$)/g,""))return this.redirectToIndex();document.title=this.buildTitle("404: Not Found"),app.showSection(),app.showMasthead("404: Not Found","<p>If you think you've reached this message in error, please press <strong>0</strong> to speak with an operator. Otherwise, hang up and try again.</p>",{error:!0,epic:!0})},buildTitle:function(){var e=Array.prototype.slice.call(arguments);return e.length?"Genghis — "+e.join(" › "):"Genghis"}});
811
811
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genghisapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-03 00:00:00.000000000 Z
12
+ date: 2012-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: vegas