noddity
Version:
A client-side cms with a flat-file backend
2 lines • 4.22 MB
JavaScript
(function e(t,r,n){function i(a,o){if(!r[a]){if(!t[a]){var u=typeof require=="function"&&require;if(!o&&u)return u(a,!0);if(s)return s(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[a]={exports:{}};t[a][0].call(f.exports,function(e){var r=t[a][1][e];return i(r?r:e)},f,f.exports,e,t,r,n)}return r[a].exports}var s=typeof require=="function"&&require;for(var a=0;a<n.length;a++)i(n[a]);return i})({1:[function(e,t,r){var n=e("levelup");var i=e("fruitdown");t.exports={clearCache:function s(){var e=n("noddity-content",{db:i});e.createKeyStream().on("data",function(t){e.del(t)})}}},{fruitdown:34,levelup:102}],2:[function(e,t,r){var n=e("noddity-butler");var i=e("levelup");var s=e("noddity-linkifier");var a=e("fruitdown");var o=e("./mainViewModel");var u=e("subleveldown");var c=e("xtend");var f=noddityConfig;var l=i("noddity-content",{db:a});f.title=f.name=f.title||f.name;var h=f.title.replace(/[^\w]+/g,"");var p=f.debug?{refreshEvery:30*1e3}:{cacheCheckIntervalMs:60*1e3};var d=c(p,{parallelPostRequests:4,loadPostsOnIndexChange:false});var v=new n(f.noddityRoot,u(l,h),d);var g=new s(f.pathPrefix+f.pagePathPrefix);o(v,g);if(f.sidebar){console.warn('The "sidebar" config.js setting is not supported any more - you should add ::'+f.sidebar+":: to your "+f.template+" template")}if(f.debug){debug=e("./debug")}},{"./debug":1,"./mainViewModel":3,fruitdown:34,levelup:102,"noddity-butler":106,"noddity-linkifier":110,subleveldown:202,xtend:221}],3:[function(e,t,r){var n=e("noddity-render-dom");var i=e("./routing");var s=e("ractive");var a=noddityConfig;s.DEBUG=a.debug;t.exports=function u(e,t){var r="";var u={butler:e,linkifier:t,el:"body",data:a};var c=false;function f(){if(!c){c=true;e.on("index changed",function(){e.getPosts()})}}var l=new s({el:"title",template:"{{name}}{{#current.metadata.title}} | {{current.metadata.title}}{{/current.metadata.title}}"});function h(e,t){l.reset(a);if(!e&&t){l.set("current",t)}}e.on("post change",function(e){if(e.filename===r){h(null,e)}});t.on("link",function(t){e.getPost(t,function(){})});n("post",u,function(t,r){if(t){console.error(t);document.body.innerHTML="<h1>ERROR</h1>"+t.message}var n=i();n.on("current",function(t,i){var s={parameters:i||{}};r(t,s,function(i){if(i){if(t!==a.errorPage){n.emit("404")}}else{o(r.ractive,"#!/"+a.pagePathPrefix,t);n.emit("loaded",t)}e.getPost(t,h);e.refreshPost(t);f()})});r.on("error",console.error.bind(console,"setCurrent error"))})};function o(e,t,r){e.findAll("a[href]").forEach(function(e){var n=e.getAttribute("href");if(n&&n[0]==="#"&&n.indexOf(t)!==0){e.setAttribute("href",t+r+n)}})}},{"./routing":4,"noddity-render-dom":111,ractive:125}],4:[function(e,t,r){var n=e("events").EventEmitter;var i=e("hash-brown-router");var s=noddityConfig;t.exports=function(){var e=i();var t=new n;var r=null;t.on("404",function(){e.replace("!/"+s.pagePathPrefix+s.errorPage)});t.on("current",function(e){scrollTo(0,0)});e.add("!/",function(e){t.emit("current","index.md",e)});e.add("!/"+s.pagePathPrefix+":name([^#]+)#:anchor",function(e){if(r===e.name){a(e.anchor)}else{t.emit("current",e.name,e);r=e.name;t.once("loaded",function(){a(e.anchor)})}});e.add("!/"+s.pagePathPrefix+":name([^#]+)",function(e){t.emit("current",e.name,e)});e.setDefault(function(e){t.emit("404",e)});setTimeout(e.evaluateCurrent.bind(null,"!/"),0);return t};function a(e){var t=document.getElementById(e);if(t){scrollTo(0,t.offsetTop)}}},{events:30,"hash-brown-router":38}],5:[function(e,t,r){(function(e){function r(e){this._db=e;this._operations=[];this._written=false}r.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")};r.prototype.put=function(e,t){this._checkWritten();var r=this._db._checkKeyValue(e,"key",this._db._isBuffer);if(r)throw r;r=this._db._checkKeyValue(t,"value",this._db._isBuffer);if(r)throw r;if(!this._db._isBuffer(e))e=String(e);if(!this._db._isBuffer(t))t=String(t);if(typeof this._put=="function")this._put(e,t);else this._operations.push({type:"put",key:e,value:t});return this};r.prototype.del=function(e){this._checkWritten();var t=this._db._checkKeyValue(e,"key",this._db._isBuffer);if(t)throw t;if(!this._db._isBuffer(e))e=String(e);if(typeof this._del=="function")this._del(e);else this._operations.push({type:"del",key:e});return this};r.prototype.clear=function(){this._checkWritten();this._operations=[];if(typeof this._clear=="function")this._clear();return this};r.prototype.write=function(t,r){this._checkWritten();if(typeof t=="function")r=t;if(typeof r!="function")throw new Error("write() requires a callback argument");if(typeof t!="object")t={};this._written=true;if(typeof this._write=="function")return this._write(r);if(typeof this._db._batch=="function")return this._db._batch(this._operations,t,r);e.nextTick(r)};t.exports=r}).call(this,e("_process"))},{_process:119}],6:[function(e,t,r){(function(e){function r(e){this.db=e;this._ended=false;this._nexting=false}r.prototype.next=function(t){var r=this;if(typeof t!="function")throw new Error("next() requires a callback argument");if(r._ended)return t(new Error("cannot call next() after end()"));if(r._nexting)return t(new Error("cannot call next() before previous next() has completed"));r._nexting=true;if(typeof r._next=="function"){return r._next(function(){r._nexting=false;t.apply(null,arguments)})}e.nextTick(function(){r._nexting=false;t()})};r.prototype.end=function(t){if(typeof t!="function")throw new Error("end() requires a callback argument");if(this._ended)return t(new Error("end() already called on iterator"));this._ended=true;if(typeof this._end=="function")return this._end(t);e.nextTick(t)};t.exports=r}).call(this,e("_process"))},{_process:119}],7:[function(e,t,r){(function(r,n){var i=e("xtend"),s=e("./abstract-iterator"),a=e("./abstract-chained-batch");function o(e){if(!arguments.length||e===undefined)throw new Error("constructor requires at least a location argument");if(typeof e!="string")throw new Error("constructor requires a location string argument");this.location=e}o.prototype.open=function(e,t){if(typeof e=="function")t=e;if(typeof t!="function")throw new Error("open() requires a callback argument");if(typeof e!="object")e={};if(typeof this._open=="function")return this._open(e,t);n.nextTick(t)};o.prototype.close=function(e){if(typeof e!="function")throw new Error("close() requires a callback argument");if(typeof this._close=="function")return this._close(e);n.nextTick(e)};o.prototype.get=function(e,t,r){var i;if(typeof t=="function")r=t;if(typeof r!="function")throw new Error("get() requires a callback argument");if(i=this._checkKeyValue(e,"key",this._isBuffer))return r(i);if(!this._isBuffer(e))e=String(e);if(typeof t!="object")t={};if(typeof this._get=="function")return this._get(e,t,r);n.nextTick(function(){r(new Error("NotFound"))})};o.prototype.put=function(e,t,r,i){var s;if(typeof r=="function")i=r;if(typeof i!="function")throw new Error("put() requires a callback argument");if(s=this._checkKeyValue(e,"key",this._isBuffer))return i(s);if(s=this._checkKeyValue(t,"value",this._isBuffer))return i(s);if(!this._isBuffer(e))e=String(e);if(!this._isBuffer(t)&&!n.browser)t=String(t);if(typeof r!="object")r={};if(typeof this._put=="function")return this._put(e,t,r,i);n.nextTick(i)};o.prototype.del=function(e,t,r){var i;if(typeof t=="function")r=t;if(typeof r!="function")throw new Error("del() requires a callback argument");if(i=this._checkKeyValue(e,"key",this._isBuffer))return r(i);if(!this._isBuffer(e))e=String(e);if(typeof t!="object")t={};if(typeof this._del=="function")return this._del(e,t,r);n.nextTick(r)};o.prototype.batch=function(e,t,r){if(!arguments.length)return this._chainedBatch();if(typeof t=="function")r=t;if(typeof r!="function")throw new Error("batch(array) requires a callback argument");if(!Array.isArray(e))return r(new Error("batch(array) requires an array argument"));if(typeof t!="object")t={};var i=0,s=e.length,a,o;for(;i<s;i++){a=e[i];if(typeof a!="object")continue;if(o=this._checkKeyValue(a.type,"type",this._isBuffer))return r(o);if(o=this._checkKeyValue(a.key,"key",this._isBuffer))return r(o);if(a.type=="put"){if(o=this._checkKeyValue(a.value,"value",this._isBuffer))return r(o)}}if(typeof this._batch=="function")return this._batch(e,t,r);n.nextTick(r)};o.prototype.approximateSize=function(e,t,r){if(e==null||t==null||typeof e=="function"||typeof t=="function"){throw new Error("approximateSize() requires valid `start`, `end` and `callback` arguments")}if(typeof r!="function")throw new Error("approximateSize() requires a callback argument");if(!this._isBuffer(e))e=String(e);if(!this._isBuffer(t))t=String(t);if(typeof this._approximateSize=="function")return this._approximateSize(e,t,r);n.nextTick(function(){r(null,0)})};o.prototype._setupIteratorOptions=function(e){var t=this;e=i(e);["start","end","gt","gte","lt","lte"].forEach(function(r){if(e[r]&&t._isBuffer(e[r])&&e[r].length===0)delete e[r]});e.reverse=!!e.reverse;if(e.reverse&&e.lt)e.start=e.lt;if(e.reverse&&e.lte)e.start=e.lte;if(!e.reverse&&e.gt)e.start=e.gt;if(!e.reverse&&e.gte)e.start=e.gte;if(e.reverse&&e.lt&&!e.lte||!e.reverse&&e.gt&&!e.gte)e.exclusiveStart=true;return e};o.prototype.iterator=function(e){if(typeof e!="object")e={};e=this._setupIteratorOptions(e);if(typeof this._iterator=="function")return this._iterator(e);return new s(this)};o.prototype._chainedBatch=function(){return new a(this)};o.prototype._isBuffer=function(e){return r.isBuffer(e)};o.prototype._checkKeyValue=function(e,t){if(e===null||e===undefined)return new Error(t+" cannot be `null` or `undefined`");if(e===null||e===undefined)return new Error(t+" cannot be `null` or `undefined`");if(this._isBuffer(e)){if(e.length===0)return new Error(t+" cannot be an empty Buffer")}else if(String(e)==="")return new Error(t+" cannot be an empty String")};t.exports.AbstractLevelDOWN=o;t.exports.AbstractIterator=s;t.exports.AbstractChainedBatch=a}).call(this,{isBuffer:e("../is-buffer/index.js")},e("_process"))},{"../is-buffer/index.js":62,"./abstract-chained-batch":5,"./abstract-iterator":6,_process:119,xtend:8}],8:[function(e,t,r){t.exports=n;function n(){var e={};for(var t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(r.hasOwnProperty(n)){e[n]=r[n]}}}return e}},{}],9:[function(e,t,r){"use strict";t.exports=n;function n(e){return function(){var t=arguments.length;if(t){var r=[];var n=-1;while(++n<t){r[n]=arguments[n]}return e.call(this,r)}else{return e.call(this,[])}}}},{}],10:[function(e,t,r){(function(e){if(Array.prototype.find)return;var t=function(e){var t=Object(this);var r=t.length<0?0:t.length>>>0;if(r===0)return undefined;if(typeof e!=="function"||Object.prototype.toString.call(e)!=="[object Function]"){throw new TypeError("Array#find: predicate must be a function")}var n=arguments[1];for(var i=0,s;i<r;i++){s=t[i];if(e.call(n,s,i,t))return s}return undefined};if(Object.defineProperty){try{Object.defineProperty(Array.prototype,"find",{value:t,configurable:true,enumerable:false,writable:true})}catch(r){}}if(!Array.prototype.find){Array.prototype.find=t}})(this)},{}],11:[function(e,t,r){(function(e){"use strict";var r=function(e,t,r){if(!Array.isArray(e))throw new TypeError("each() expects array as first argument");if(typeof t!=="function")throw new TypeError("each() expects function as second argument");if(typeof r!=="function")r=Function.prototype;if(e.length===0)return r(undefined,e);var n=new Array(e.length);var i=0;var s=false;e.forEach(function(a,o){t(a,function(t,a){if(s)return;if(t){s=true;return r(t)}n[o]=a;i+=1;if(i===e.length)return r(undefined,n)})})};if(typeof define!=="undefined"&&define.amd){define([],function(){return r})}else if(typeof t!=="undefined"&&t.exports){t.exports=r}else{e.asyncEach=r}})(this)},{}],12:[function(e,t,r){(function(e,n){if(typeof define==="function"&&define.amd){define([],function(){return e["Autolinker"]=n()})}else if(typeof r==="object"){t.exports=n()}else{e["Autolinker"]=n()}})(this,function(){var e=function(t){e.Util.assign(this,t)};e.prototype={constructor:e,urls:true,email:true,twitter:true,newWindow:true,stripPrefix:true,truncate:undefined,className:"",htmlParser:undefined,matchParser:undefined,tagBuilder:undefined,link:function(e){var t=this.getHtmlParser(),r=t.parse(e),n=0,i=[];for(var s=0,a=r.length;s<a;s++){var o=r[s],u=o.getType(),c=o.getText();if(u==="element"){if(o.getTagName()==="a"){if(!o.isClosing()){n++}else{n=Math.max(n-1,0)}}i.push(c)}else if(u==="entity"){i.push(c)}else{if(n===0){var f=this.linkifyStr(c);i.push(f)}else{i.push(c)}}}return i.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(t){var r;if(this.replaceFn){r=this.replaceFn.call(this,this,t)}if(typeof r==="string"){return r}else if(r===false){return t.getMatchedText()}else if(r instanceof e.HtmlTag){return r.toString()}else{var n=this.getTagBuilder(),i=n.build(t);return i.toString()}},getHtmlParser:function(){var t=this.htmlParser;if(!t){t=this.htmlParser=new e.htmlParser.HtmlParser}return t},getMatchParser:function(){var t=this.matchParser;if(!t){t=this.matchParser=new e.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,stripPrefix:this.stripPrefix})}return t},getTagBuilder:function(){var t=this.tagBuilder;if(!t){t=this.tagBuilder=new e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})}return t}};e.link=function(t,r){var n=new e(r);return n.link(t)};e.match={};e.htmlParser={};e.matchParser={};e.Util={abstractMethod:function(){throw"abstract"},assign:function(e,t){for(var r in t){if(t.hasOwnProperty(r)){e[r]=t[r]}}return e},extend:function(t,r){var n=t.prototype;var i=function(){};i.prototype=n;var s;if(r.hasOwnProperty("constructor")){s=r.constructor}else{s=function(){n.constructor.apply(this,arguments)}}var a=s.prototype=new i;a.constructor=s;a.superclass=n;delete r.constructor;e.Util.assign(a,r);return s},ellipsis:function(e,t,r){if(e.length>t){r=r==null?"..":r;e=e.substring(0,t-r.length)+r}return e},indexOf:function(e,t){if(Array.prototype.indexOf){return e.indexOf(t)}else{for(var r=0,n=e.length;r<n;r++){if(e[r]===t)return r}return-1}},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");var r=[],n=0,i;while(i=t.exec(e)){r.push(e.substring(n,i.index));r.push(i[0]);n=i.index+i[0].length}r.push(e.substring(n));return r}};e.HtmlTag=e.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(t){e.Util.assign(this,t);this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){this.tagName=e;return this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){var r=this.getAttrs();r[e]=t;return this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var r=this.getAttrs();e.Util.assign(r,t);return this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){var r=this.getClass(),n=this.whitespaceRegex,i=e.Util.indexOf,s=!r?[]:r.split(n),a=t.split(n),o;while(o=a.shift()){if(i(s,o)===-1){s.push(o)}}this.getAttrs()["class"]=s.join(" ");return this},removeClass:function(t){var r=this.getClass(),n=this.whitespaceRegex,i=e.Util.indexOf,s=!r?[]:r.split(n),a=t.split(n),o;while(s.length&&(o=a.shift())){var u=i(s,o);if(u!==-1){s.splice(u,1)}}this.getAttrs()["class"]=s.join(" ");return this},getClass:function(){return this.getAttrs()["class"]||""},hasClass:function(e){return(" "+this.getClass()+" ").indexOf(" "+e+" ")!==-1},setInnerHtml:function(e){this.innerHtml=e;return this},getInnerHtml:function(){return this.innerHtml||""},toString:function(){var e=this.getTagName(),t=this.buildAttrsStr();t=t?" "+t:"";return["<",e,t,">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e){if(e.hasOwnProperty(r)){t.push(r+'="'+e[r]+'"')}}return t.join(" ")}});e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){var r=new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())});return r},createAttrs:function(e,t){var r={href:t};var n=this.createCssClass(e);if(n){r["class"]=n}if(this.newWindow){r["target"]="_blank"}return r},createCssClass:function(e){var t=this.className;if(!t)return"";else return t+" "+t+"-"+e},processAnchorText:function(e){e=this.doTruncate(e);return e},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}});e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/[0-9a-zA-Z][0-9a-zA-Z:]*/,t=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,r=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=t.source+"(?:\\s*=\\s*"+r.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",r.source+")",")*",">",")","|","(?:","<(/)?","("+e.source+")","(?:","\\s+",n,")*","\\s*/?",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){var t=this.htmlRegex,r,n=0,i,s=[];while((r=t.exec(e))!==null){var a=r[0],o=r[1]||r[3],u=!!r[2],c=e.substring(n,r.index);if(c){i=this.parseTextAndEntityNodes(c);s.push.apply(s,i)}s.push(this.createElementNode(a,o,u));n=r.index+a.length}if(n<e.length){var f=e.substring(n);if(f){i=this.parseTextAndEntityNodes(f);s.push.apply(s,i)}}return s},parseTextAndEntityNodes:function(t){var r=[],n=e.Util.splitAndCapture(t,this.htmlCharacterEntitiesRegex);for(var i=0,s=n.length;i<s;i+=2){var a=n[i],o=n[i+1];if(a)r.push(this.createTextNode(a));if(o)r.push(this.createEntityNode(o))}return r},createElementNode:function(t,r,n){return new e.htmlParser.ElementNode({text:t,tagName:r.toLowerCase(),closing:n})},createEntityNode:function(t){return new e.htmlParser.EntityNode({text:t})},createTextNode:function(t){return new e.htmlParser.TextNode({text:t})}});e.htmlParser.HtmlNode=e.Util.extend(Object,{text:"",constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getText:function(){return this.text}});e.htmlParser.ElementNode=e.Util.extend(e.htmlParser.HtmlNode,{tagName:"",closing:false,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}});e.htmlParser.EntityNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"entity"}});e.htmlParser.TextNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"text"}});e.matchParser.MatchParser=e.Util.extend(Object,{urls:true,email:true,twitter:true,stripPrefix:true,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,t=/(?:[\-;:&=\+\$,\w\.]+@)/,r=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,n=/(?:www\.)/,i=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,s=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,a=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;return new RegExp(["(",e.source,")","|","(",t.source,i.source,s.source,")","|","(","(?:","(",r.source,i.source,")","|","(?:","(.?//)?",n.source,i.source,")","|","(?:","(.?//)?",i.source,s.source,")",")","(?:"+a.source+")?",")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,constructor:function(t){e.Util.assign(this,t);this.matchValidator=new e.MatchValidator},replace:function(e,t,r){var n=this;return e.replace(this.matcherRegex,function(e,i,s,a,o,u,c,f,l){var h=n.processCandidateMatch(e,i,s,a,o,u,c,f,l);if(!h){return e}else{var p=t.call(r,h.match);return h.prefixStr+p+h.suffixStr}})},processCandidateMatch:function(t,r,n,i,s,a,o,u,c){var f=u||c,l,h="",p="";if(r&&!this.twitter||s&&!this.email||a&&!this.urls||!this.matchValidator.isValidMatch(a,o,f)){return null}if(this.matchHasUnbalancedClosingParen(t)){t=t.substr(0,t.length-1);p=")"}if(s){l=new e.match.Email({matchedText:t,email:s})}else if(r){if(n){h=n;t=t.slice(1)}l=new e.match.Twitter({matchedText:t,twitterHandle:i})}else{if(f){var d=f.match(this.charBeforeProtocolRelMatchRegex)[1]||"";if(d){h=d;t=t.slice(1)}}l=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!o,protocolRelativeMatch:!!f,stripPrefix:this.stripPrefix})}return{prefixStr:h,suffixStr:p,match:l}},matchHasUnbalancedClosingParen:function(e){var t=e.charAt(e.length-1);if(t===")"){var r=e.match(/\(/g),n=e.match(/\)/g),i=r&&r.length||0,s=n&&n.length||0;if(i<s){return true}}return false}});e.MatchValidator=e.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(e,t,r){if(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(r)){return false}return true},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return t!=="javascript:"&&t!=="vbscript:"},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!!e&&(!t||!this.hasFullProtocolRegex.test(t))&&e.indexOf(".")===-1},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){if(e&&t){return!this.hasWordCharAfterProtocolRegex.test(e)}else{return false}},isInvalidProtocolRelativeMatch:function(e){return!!e&&this.invalidProtocolRelMatchRegex.test(e)}});e.match.Match=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:e.Util.abstractMethod,getAnchorText:e.Util.abstractMethod});e.match.Email=e.Util.extend(e.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}});e.match.Twitter=e.Util.extend(e.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}});e.match.Url=e.Util.extend(e.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:false,getType:function(){return"url"},getUrl:function(){var e=this.url;if(!this.protocolRelativeMatch&&!this.protocolUrlMatch&&!this.protocolPrepended){e=this.url="http://"+e;this.protocolPrepended=true}return e},getAnchorHref:function(){var e=this.getUrl();return e.replace(/&/g,"&")},getAnchorText:function(){var e=this.getUrl();if(this.protocolRelativeMatch){e=this.stripProtocolRelativePrefix(e)}if(this.stripPrefix){e=this.stripUrlPrefix(e)}e=this.removeTrailingSlash(e);return e},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){if(e.charAt(e.length-1)==="/"){e=e.slice(0,-1)}return e}});return e})},{}],13:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var i="/".charCodeAt(0);var s="0".charCodeAt(0);var a="a".charCodeAt(0);var o="A".charCodeAt(0);var u="-".charCodeAt(0);var c="_".charCodeAt(0);function f(e){var t=e.charCodeAt(0);if(t===r||t===u)return 62;if(t===i||t===c)return 63;if(t<s)return-1;if(t<s+10)return t-s+26+26;if(t<o+26)return t-o;if(t<a+26)return t-a+26}function l(e){var r,n,i,s,a,o;if(e.length%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var u=e.length;a="="===e.charAt(u-2)?2:"="===e.charAt(u-1)?1:0;o=new t(e.length*3/4-a);i=a>0?e.length-4:e.length;var c=0;function l(e){o[c++]=e}for(r=0,n=0;r<i;r+=4,n+=3){s=f(e.charAt(r))<<18|f(e.charAt(r+1))<<12|f(e.charAt(r+2))<<6|f(e.charAt(r+3));l((s&16711680)>>16);l((s&65280)>>8);l(s&255)}if(a===2){s=f(e.charAt(r))<<2|f(e.charAt(r+1))>>4;l(s&255)}else if(a===1){s=f(e.charAt(r))<<10|f(e.charAt(r+1))<<4|f(e.charAt(r+2))>>2;l(s>>8&255);l(s&255)}return o}function h(e){var t,r=e.length%3,i="",s,a;function o(e){return n.charAt(e)}function u(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,a=e.length-r;t<a;t+=3){s=(e[t]<<16)+(e[t+1]<<8)+e[t+2];i+=u(s)}switch(r){case 1:s=e[e.length-1];i+=o(s>>2);i+=o(s<<4&63);i+="==";break;case 2:s=(e[e.length-2]<<8)+e[e.length-1];i+=o(s>>10);i+=o(s>>4&63);i+=o(s<<2&63);i+="=";break}return i}e.toByteArray=l;e.fromByteArray=h})(typeof r==="undefined"?this.base64js={}:r)},{}],14:[function(e,t,r){},{}],15:[function(e,t,r){(function(t){"use strict";var n=e("base64-js");var i=e("ieee754");var s=e("isarray");r.Buffer=c;r.SlowBuffer=_;r.INSPECT_MAX_BYTES=50;c.poolSize=8192;var a={};c.TYPED_ARRAY_SUPPORT=t.TYPED_ARRAY_SUPPORT!==undefined?t.TYPED_ARRAY_SUPPORT:o();function o(){function e(){}try{var t=new Uint8Array(1);t.foo=function(){return 42};t.constructor=e;return t.foo()===42&&t.constructor===e&&typeof t.subarray==="function"&&t.subarray(1,1).byteLength===0}catch(r){return false}}function u(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(e){if(!(this instanceof c)){if(arguments.length>1)return new c(e,arguments[1]);return new c(e)}if(!c.TYPED_ARRAY_SUPPORT){this.length=0;this.parent=undefined}if(typeof e==="number"){return f(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return h(this,e)}function f(e,t){e=y(e,t<0?0:w(t)|0);if(!c.TYPED_ARRAY_SUPPORT){for(var r=0;r<t;r++){e[r]=0}}return e}function l(e,t,r){if(typeof r!=="string"||r==="")r="utf8";var n=k(t,r)|0;e=y(e,n);e.write(t,r);return e}function h(e,t){if(c.isBuffer(t))return p(e,t);if(s(t))return d(e,t);if(t==null){throw new TypeError("must start with number, buffer, array or string")}if(typeof ArrayBuffer!=="undefined"){if(t.buffer instanceof ArrayBuffer){return v(e,t)}if(t instanceof ArrayBuffer){return g(e,t)}}if(t.length)return m(e,t);return b(e,t)}function p(e,t){var r=w(t.length)|0;e=y(e,r);t.copy(e,0,0,r);return e}function d(e,t){var r=w(t.length)|0;e=y(e,r);for(var n=0;n<r;n+=1){e[n]=t[n]&255}return e}function v(e,t){var r=w(t.length)|0;e=y(e,r);for(var n=0;n<r;n+=1){e[n]=t[n]&255}return e}function g(e,t){if(c.TYPED_ARRAY_SUPPORT){t.byteLength;e=c._augment(new Uint8Array(t))}else{e=v(e,new Uint8Array(t))}return e}function m(e,t){var r=w(t.length)|0;e=y(e,r);for(var n=0;n<r;n+=1){e[n]=t[n]&255}return e}function b(e,t){var r;var n=0;if(t.type==="Buffer"&&s(t.data)){r=t.data;n=w(r.length)|0}e=y(e,n);for(var i=0;i<n;i+=1){e[i]=r[i]&255}return e}if(c.TYPED_ARRAY_SUPPORT){c.prototype.__proto__=Uint8Array.prototype;c.__proto__=Uint8Array}else{c.prototype.length=undefined;c.prototype.parent=undefined}function y(e,t){if(c.TYPED_ARRAY_SUPPORT){e=c._augment(new Uint8Array(t));e.__proto__=c.prototype}else{e.length=t;e._isBuffer=true}var r=t!==0&&t<=c.poolSize>>>1;if(r)e.parent=a;return e}function w(e){if(e>=u()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+u().toString(16)+" bytes")}return e|0}function _(e,t){if(!(this instanceof _))return new _(e,t);var r=new c(e,t);delete r.parent;return r}c.isBuffer=function te(e){return!!(e!=null&&e._isBuffer)};c.compare=function re(e,t){if(!c.isBuffer(e)||!c.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var n=t.length;var i=0;var s=Math.min(r,n);while(i<s){if(e[i]!==t[i])break;++i}if(i!==s){r=e[i];n=t[i]}if(r<n)return-1;if(n<r)return 1;return 0};c.isEncoding=function ne(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};c.concat=function ie(e,t){if(!s(e))throw new TypeError("list argument must be an Array of Buffers.");if(e.length===0){return new c(0)}var r;if(t===undefined){t=0;for(r=0;r<e.length;r++){t+=e[r].length}}var n=new c(t);var i=0;for(r=0;r<e.length;r++){var a=e[r];a.copy(n,i);i+=a.length}return n};function k(e,t){if(typeof e!=="string")e=""+e;var r=e.length;if(r===0)return 0;var n=false;for(;;){switch(t){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":return Z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return X(e).length;default:if(n)return Z(e).length;t=(""+t).toLowerCase();n=true}}}c.byteLength=k;function x(e,t,r){var n=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return I(this,t,r);case"binary":return N(this,t,r);case"base64":return j(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}c.prototype.toString=function se(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return O(this,0,e);return x.apply(this,arguments)};c.prototype.equals=function ae(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return c.compare(this,e)===0};c.prototype.inspect=function oe(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return"<Buffer "+e+">"};c.prototype.compare=function ue(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return c.compare(this,e)};c.prototype.indexOf=function ce(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(c.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(c.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var n=-1;for(var i=0;r+i<e.length;i++){if(e[r+i]===t[n===-1?0:i-n]){
if(n===-1)n=i;if(i-n+1===t.length)return r+n}else{n=-1}}return-1}throw new TypeError("val must be string, number or Buffer")};c.prototype.get=function fe(e){console.log(".get() is deprecated. Access using array indexes instead.");return this.readUInt8(e)};c.prototype.set=function le(e,t){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(e,t)};function E(e,t,r,n){r=Number(r)||0;var i=e.length-r;if(!n){n=i}else{n=Number(n);if(n>i){n=i}}var s=t.length;if(s%2!==0)throw new Error("Invalid hex string");if(n>s/2){n=s/2}for(var a=0;a<n;a++){var o=parseInt(t.substr(a*2,2),16);if(isNaN(o))throw new Error("Invalid hex string");e[r+a]=o}return a}function A(e,t,r,n){return ee(Z(t,e.length-r),e,r,n)}function S(e,t,r,n){return ee(J(t),e,r,n)}function C(e,t,r,n){return S(e,t,r,n)}function T(e,t,r,n){return ee(X(t),e,r,n)}function q(e,t,r,n){return ee(Q(t,e.length-r),e,r,n)}c.prototype.write=function he(e,t,r,n){if(t===undefined){n="utf8";r=this.length;t=0}else if(r===undefined&&typeof t==="string"){n=t;r=this.length;t=0}else if(isFinite(t)){t=t|0;if(isFinite(r)){r=r|0;if(n===undefined)n="utf8"}else{n=r;r=undefined}}else{var i=n;n=t;t=r|0;r=i}var s=this.length-t;if(r===undefined||r>s)r=s;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!n)n="utf8";var a=false;for(;;){switch(n){case"hex":return E(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":return S(this,e,t,r);case"binary":return C(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();a=true}}};c.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(e,t,r){if(t===0&&r===e.length){return n.fromByteArray(e)}else{return n.fromByteArray(e.slice(t,r))}}function O(e,t,r){r=Math.min(e.length,r);var n=[];var i=t;while(i<r){var s=e[i];var a=null;var o=s>239?4:s>223?3:s>191?2:1;if(i+o<=r){var u,c,f,l;switch(o){case 1:if(s<128){a=s}break;case 2:u=e[i+1];if((u&192)===128){l=(s&31)<<6|u&63;if(l>127){a=l}}break;case 3:u=e[i+1];c=e[i+2];if((u&192)===128&&(c&192)===128){l=(s&15)<<12|(u&63)<<6|c&63;if(l>2047&&(l<55296||l>57343)){a=l}}break;case 4:u=e[i+1];c=e[i+2];f=e[i+3];if((u&192)===128&&(c&192)===128&&(f&192)===128){l=(s&15)<<18|(u&63)<<12|(c&63)<<6|f&63;if(l>65535&&l<1114112){a=l}}}}if(a===null){a=65533;o=1}else if(a>65535){a-=65536;n.push(a>>>10&1023|55296);a=56320|a&1023}n.push(a);i+=o}return R(n)}var L=4096;function R(e){var t=e.length;if(t<=L){return String.fromCharCode.apply(String,e)}var r="";var n=0;while(n<t){r+=String.fromCharCode.apply(String,e.slice(n,n+=L))}return r}function I(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;i++){n+=String.fromCharCode(e[i]&127)}return n}function N(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;i++){n+=String.fromCharCode(e[i])}return n}function B(e,t,r){var n=e.length;if(!t||t<0)t=0;if(!r||r<0||r>n)r=n;var i="";for(var s=t;s<r;s++){i+=Y(e[s])}return i}function D(e,t,r){var n=e.slice(t,r);var i="";for(var s=0;s<n.length;s+=2){i+=String.fromCharCode(n[s]+n[s+1]*256)}return i}c.prototype.slice=function de(e,t){var r=this.length;e=~~e;t=t===undefined?r:~~t;if(e<0){e+=r;if(e<0)e=0}else if(e>r){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(t<e)t=e;var n;if(c.TYPED_ARRAY_SUPPORT){n=c._augment(this.subarray(e,t))}else{var i=t-e;n=new c(i,undefined);for(var s=0;s<i;s++){n[s]=this[s+e]}}if(n.length)n.parent=this.parent||this;return n};function P(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUIntLE=function ve(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var s=0;while(++s<t&&(i*=256)){n+=this[e+s]*i}return n};c.prototype.readUIntBE=function ge(e,t,r){e=e|0;t=t|0;if(!r){P(e,t,this.length)}var n=this[e+--t];var i=1;while(t>0&&(i*=256)){n+=this[e+--t]*i}return n};c.prototype.readUInt8=function me(e,t){if(!t)P(e,1,this.length);return this[e]};c.prototype.readUInt16LE=function be(e,t){if(!t)P(e,2,this.length);return this[e]|this[e+1]<<8};c.prototype.readUInt16BE=function ye(e,t){if(!t)P(e,2,this.length);return this[e]<<8|this[e+1]};c.prototype.readUInt32LE=function we(e,t){if(!t)P(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};c.prototype.readUInt32BE=function _e(e,t){if(!t)P(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};c.prototype.readIntLE=function ke(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var s=0;while(++s<t&&(i*=256)){n+=this[e+s]*i}i*=128;if(n>=i)n-=Math.pow(2,8*t);return n};c.prototype.readIntBE=function xe(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=t;var i=1;var s=this[e+--n];while(n>0&&(i*=256)){s+=this[e+--n]*i}i*=128;if(s>=i)s-=Math.pow(2,8*t);return s};c.prototype.readInt8=function Ee(e,t){if(!t)P(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};c.prototype.readInt16LE=function Ae(e,t){if(!t)P(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};c.prototype.readInt16BE=function Se(e,t){if(!t)P(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};c.prototype.readInt32LE=function Ce(e,t){if(!t)P(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};c.prototype.readInt32BE=function Te(e,t){if(!t)P(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};c.prototype.readFloatLE=function qe(e,t){if(!t)P(e,4,this.length);return i.read(this,e,true,23,4)};c.prototype.readFloatBE=function je(e,t){if(!t)P(e,4,this.length);return i.read(this,e,false,23,4)};c.prototype.readDoubleLE=function Oe(e,t){if(!t)P(e,8,this.length);return i.read(this,e,true,52,8)};c.prototype.readDoubleBE=function Le(e,t){if(!t)P(e,8,this.length);return i.read(this,e,false,52,8)};function M(e,t,r,n,i,s){if(!c.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||t<s)throw new RangeError("value is out of bounds");if(r+n>e.length)throw new RangeError("index out of range")}c.prototype.writeUIntLE=function Re(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n)M(this,e,t,r,Math.pow(2,8*r),0);var i=1;var s=0;this[t]=e&255;while(++s<r&&(i*=256)){this[t+s]=e/i&255}return t+r};c.prototype.writeUIntBE=function Ie(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n)M(this,e,t,r,Math.pow(2,8*r),0);var i=r-1;var s=1;this[t+i]=e&255;while(--i>=0&&(s*=256)){this[t+i]=e/s&255}return t+r};c.prototype.writeUInt8=function Ne(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,255,0);if(!c.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e&255;return t+1};function U(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,s=Math.min(e.length-r,2);i<s;i++){e[r+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}}c.prototype.writeUInt16LE=function Be(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(c.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else{U(this,e,t,true)}return t+2};c.prototype.writeUInt16BE=function De(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else{U(this,e,t,false)}return t+2};function F(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,s=Math.min(e.length-r,4);i<s;i++){e[r+i]=t>>>(n?i:3-i)*8&255}}c.prototype.writeUInt32LE=function Pe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(c.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e&255}else{F(this,e,t,true)}return t+4};c.prototype.writeUInt32BE=function Me(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e&255}else{F(this,e,t,false)}return t+4};c.prototype.writeIntLE=function Ue(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var s=0;var a=1;var o=e<0?1:0;this[t]=e&255;while(++s<r&&(a*=256)){this[t+s]=(e/a>>0)-o&255}return t+r};c.prototype.writeIntBE=function Fe(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var s=r-1;var a=1;var o=e<0?1:0;this[t+s]=e&255;while(--s>=0&&(a*=256)){this[t+s]=(e/a>>0)-o&255}return t+r};c.prototype.writeInt8=function ze(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,127,-128);if(!c.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e&255;return t+1};c.prototype.writeInt16LE=function Ve(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(c.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else{U(this,e,t,true)}return t+2};c.prototype.writeInt16BE=function He(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else{U(this,e,t,false)}return t+2};c.prototype.writeInt32LE=function We(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(c.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{F(this,e,t,true)}return t+4};c.prototype.writeInt32BE=function Ge(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e&255}else{F(this,e,t,false)}return t+4};function z(e,t,r,n,i,s){if(t>i||t<s)throw new RangeError("value is out of bounds");if(r+n>e.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function V(e,t,r,n,s){if(!s){z(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,r,n,23,4);return r+4}c.prototype.writeFloatLE=function $e(e,t,r){return V(this,e,t,true,r)};c.prototype.writeFloatBE=function Ke(e,t,r){return V(this,e,t,false,r)};function H(e,t,r,n,s){if(!s){z(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,r,n,52,8);return r+8}c.prototype.writeDoubleLE=function Ye(e,t,r){return H(this,e,t,true,r)};c.prototype.writeDoubleBE=function Ze(e,t,r){return H(this,e,t,false,r)};c.prototype.copy=function Je(e,t,r,n){if(!r)r=0;if(!n&&n!==0)n=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(n>0&&n<r)n=r;if(n===r)return 0;if(e.length===0||this.length===0)return 0;if(t<0){throw new RangeError("targetStart out of bounds")}if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-t<n-r){n=e.length-t+r}var i=n-r;var s;if(this===e&&r<t&&t<n){for(s=i-1;s>=0;s--){e[s+t]=this[s+r]}}else if(i<1e3||!c.TYPED_ARRAY_SUPPORT){for(s=0;s<i;s++){e[s+t]=this[s+r]}}else{e._set(this.subarray(r,r+i),t)}return i};c.prototype.fill=function Qe(e,t,r){if(!e)e=0;if(!t)t=0;if(!r)r=this.length;if(r<t)throw new RangeError("end < start");if(r===t)return;if(this.length===0)return;if(t<0||t>=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var n;if(typeof e==="number"){for(n=t;n<r;n++){this[n]=e}}else{var i=Z(e.toString());var s=i.length;for(n=t;n<r;n++){this[n]=i[n%s]}}return this};c.prototype.toArrayBuffer=function Xe(){if(typeof Uint8Array!=="undefined"){if(c.TYPED_ARRAY_SUPPORT){return new c(this).buffer}else{var e=new Uint8Array(this.length);for(var t=0,r=e.length;t<r;t+=1){e[t]=this[t]}return e.buffer}}else{throw new TypeError("Buffer.toArrayBuffer not supported in this browser")}};var W=c.prototype;c._augment=function et(e){e.constructor=c;e._isBuffer=true;e._set=e.set;e.get=W.get;e.set=W.set;e.write=W.write;e.toString=W.toString;e.toLocaleString=W.toString;e.toJSON=W.toJSON;e.equals=W.equals;e.compare=W.compare;e.indexOf=W.indexOf;e.copy=W.copy;e.slice=W.slice;e.readUIntLE=W.readUIntLE;e.readUIntBE=W.readUIntBE;e.readUInt8=W.readUInt8;e.readUInt16LE=W.readUInt16LE;e.readUInt16BE=W.readUInt16BE;e.readUInt32LE=W.readUInt32LE;e.readUInt32BE=W.readUInt32BE;e.readIntLE=W.readIntLE;e.readIntBE=W.readIntBE;e.readInt8=W.readInt8;e.readInt16LE=W.readInt16LE;e.readInt16BE=W.readInt16BE;e.readInt32LE=W.readInt32LE;e.readInt32BE=W.readInt32BE;e.readFloatLE=W.readFloatLE;e.readFloatBE=W.readFloatBE;e.readDoubleLE=W.readDoubleLE;e.readDoubleBE=W.readDoubleBE;e.writeUInt8=W.writeUInt8;e.writeUIntLE=W.writeUIntLE;e.writeUIntBE=W.writeUIntBE;e.writeUInt16LE=W.writeUInt16LE;e.writeUInt16BE=W.writeUInt16BE;e.writeUInt32LE=W.writeUInt32LE;e.writeUInt32BE=W.writeUInt32BE;e.writeIntLE=W.writeIntLE;e.writeIntBE=W.writeIntBE;e.writeInt8=W.writeInt8;e.writeInt16LE=W.writeInt16LE;e.writeInt16BE=W.writeInt16BE;e.writeInt32LE=W.writeInt32LE;e.writeInt32BE=W.writeInt32BE;e.writeFloatLE=W.writeFloatLE;e.writeFloatBE=W.writeFloatBE;e.writeDoubleLE=W.writeDoubleLE;e.writeDoubleBE=W.writeDoubleBE;e.fill=W.fill;e.inspect=W.inspect;e.toArrayBuffer=W.toArrayBuffer;return e};var G=/[^+\/0-9A-Za-z-_]/g;function $(e){e=K(e).replace(G,"");if(e.length<2)return"";while(e.length%4!==0){e=e+"="}return e}function K(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function Y(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function Z(e,t){t=t||Infinity;var r;var n=e.length;var i=null;var s=[];for(var a=0;a<n;a++){r=e.charCodeAt(a);if(r>55295&&r<57344){if(!i){if(r>56319){if((t-=3)>-1)s.push(239,191,189);continue}else if(a+1===n){if((t-=3)>-1)s.push(239,191,189);continue}i=r;continue}if(r<56320){if((t-=3)>-1)s.push(239,191,189);i=r;continue}r=(i-55296<<10|r-56320)+65536}else if(i){if((t-=3)>-1)s.push(239,191,189)}i=null;if(r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return s}function J(e){var t=[];for(var r=0;r<e.length;r++){t.push(e.charCodeAt(r)&255)}return t}function Q(e,t){var r,n,i;var s=[];for(var a=0;a<e.length;a++){if((t-=2)<0)break;r=e.charCodeAt(a);n=r>>8;i=r%256;s.push(i);s.push(n)}return s}function X(e){return n.toByteArray($(e))}function ee(e,t,r,n){for(var i=0;i<n;i++){if(i+r>=t.length||i>=e.length)break;t[i+r]=e[i]}return i}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"base64-js":13,ieee754:60,isarray:16}],16:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return n.call(e)=="[object Array]"}},{}],17:[function(e,t,r){t.exports=n;function n(e){if(e)return i(e)}function i(e){for(var t in n.prototype){e[t]=n.prototype[t]}return e}n.prototype.on=n.prototype.addEventListener=function(e,t){this._callbacks=this._callbacks||{};(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t);return this};n.prototype.once=function(e,t){function r(){this.off(e,r);t.apply(this,arguments)}r.fn=t;this.on(e,r);return this};n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){this._callbacks=this._callbacks||{};if(0==arguments.length){this._callbacks={};return this}var r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length){delete this._callbacks["$"+e];return this}var n;for(var i=0;i<r.length;i++){n=r[i];if(n===t||n.fn===t){r.splice(i,1);break}}return this};n.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),r=this._callbacks["$"+e];if(r){r=r.slice(0);for(var n=0,i=r.length;n<i;++n){r[n].apply(this,t)}}return this};n.prototype.listeners=function(e){this._callbacks=this._callbacks||{};return this._callbacks["$"+e]||[]};n.prototype.hasListeners=function(e){return!!this.listeners(e).length}},{}],18:[function(e,t,r){(function(e){function t(e){if(Array.isArray){return Array.isArray(e)}return g(e)==="[object Array]"}r.isArray=t;function n(e){return typeof e==="boolean"}r.isBoolean=n;function i(e){return e===null}r.isNull=i;function s(e){return e==null}r.isNullOrUndefined=s;function a(e){return typeof e==="number"}r.isNumber=a;function o(e){return typeof e==="string"}r.isString=o;function u(e){return typeof e==="symbol"}r.isSymbol=u;function c(e){return e===void 0}r.isUndefined=c;function f(e){return g(e)==="[object RegExp]"}r.isRegExp=f;function l(e){return typeof e==="object"&&e!==null}r.isObject=l;function h(e){return g(e)==="[object Date]"}r.isDate=h;function p(e){return g(e)==="[object Error]"||e instanceof Error}r.isError=p;function d(e){return typeof e==="function"}r.isFunction=d;function v(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}r.isPrimitive=v;r.isBuffer=e.isBuffer;function g(e){return Object.prototype.toString.call(e)}}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":62}],19:[function(e,t,r){var n=e("buffer").Buffer;var i=".PYFGCRLAOEUIDHTNSQJKXBMWVZ_pyfgcrlaoeuidhtnsqjkxbmwvz1234567890".split("").sort().join("");t.exports=function(e,t){e=e||i;t=t||{};if(e.length!==64)throw new Error("a base 64 encoding requires 64 chars");var r=new n(128);r.fill();for(var s=0;s<64;s++){var a=e.charCodeAt(s);r[a]=s}t.encode=function(t){var r="",n=t.length,i=0;for(var s=0;s<n;s++){var a=t[s];switch(s%3){case 0:r+=e[a>>2];i=(a&3)<<4;break;case 1:r+=e[i|a>>4];i=(a&15)<<2;break;case 2:r+=e[i|a>>6];r+=e[a&63];i=0;break}}if(n%3)r+=e[i];return r};t.decode=function(e){var t=e.length,i=0;var s=new n(~~(t/4*3)),a=0;for(var o=0;o<t;o++){var u=r[e.charCodeAt(o)];switch(o%4){case 0:a=u<<2;break;case 1:s[i++]=a|u>>4;a=u<<4&255;break;case 2:s[i++]=a|u>>2;a=u<<6&255;break;case 3:s[i++]=a|u;break}}return s};return t};t.exports(i,t.exports)},{buffer:15}],20:[function(e,t,r){(function(r,n){var i=e("util"),s=e("abstract-leveldown").AbstractLevelDOWN,a=e("abstract-leveldown").AbstractIterator;function o(e){s.call(this,typeof e=="string"?e:"");this._db=undefined;this._operations=[];this._iterators=[]}i.inherits(o,s);o.prototype.setDb=function(e){this._db=e;this._operations.forEach(function(t){e[t.method].apply(e,t.args)});this._iterators.forEach(function(t){t.setDb(e)})};o.prototype._open=function(e,t){return n.nextTick(t)};o.p