text: !function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,g.SearchIndex=f()}}(function(){var define;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){const bunyan=require("bunyan"),level=require("levelup"),down=require("leveldown"),SearchIndexAdder=require("search-index-adder"),SearchIndexSearcher=require("search-index-searcher");module.exports=function(givenOptions,moduleReady){const adderLoaded=function(err,SearchIndex){if(err)return moduleReady(err);getSearcher(SearchIndex,searcherLoaded)},searcherLoaded=function(err,SearchIndex){return err?moduleReady(err):moduleReady(err,SearchIndex)};getOptions(givenOptions,function(err,SearchIndex){const siUtil=require("./siUtil.js")(SearchIndex.options);if(err)return moduleReady(err);SearchIndex.close=siUtil.close,SearchIndex.countDocs=siUtil.countDocs,getAdder(SearchIndex,adderLoaded)})};const getAdder=function(SearchIndex,done){SearchIndexAdder(SearchIndex.options,function(err,searchIndexAdder){SearchIndex.add=searchIndexAdder.add,SearchIndex.callbackyAdd=searchIndexAdder.concurrentAdd,SearchIndex.concurrentAdd=searchIndexAdder.concurrentAdd,SearchIndex.concurrentDel=searchIndexAdder.concurrentDel,SearchIndex.createWriteStream=searchIndexAdder.createWriteStream,SearchIndex.dbWriteStream=searchIndexAdder.dbWriteStream,SearchIndex.defaultPipeline=searchIndexAdder.defaultPipeline,SearchIndex.del=searchIndexAdder.deleter,SearchIndex.deleteStream=searchIndexAdder.deleteStream,SearchIndex.feed=searchIndexAdder.feed,SearchIndex.flush=searchIndexAdder.flush,done(err,SearchIndex)})},getSearcher=function(SearchIndex,done){SearchIndexSearcher(SearchIndex.options,function(err,searchIndexSearcher){SearchIndex.availableFields=searchIndexSearcher.availableFields,SearchIndex.buckets=searchIndexSearcher.bucketStream,SearchIndex.categorize=searchIndexSearcher.categoryStream,SearchIndex.classify=searchIndexSearcher.classify,SearchIndex.dbReadStream=searchIndexSearcher.dbReadStream,SearchIndex.get=searchIndexSearcher.get,SearchIndex.match=searchIndexSearcher.match,SearchIndex.scan=searchIndexSearcher.scan,SearchIndex.search=searchIndexSearcher.search,SearchIndex.totalHits=searchIndexSearcher.totalHits,done(err,SearchIndex)})},getOptions=function(options,done){var SearchIndex={};if(SearchIndex.options=Object.assign({},{indexPath:"si",keySeparator:"￮",logLevel:"error"},options),options.log=bunyan.createLogger({name:"search-index",level:options.logLevel}),options.indexes)return done(null,SearchIndex);level(SearchIndex.options.indexPath||"si",{valueEncoding:"json",db:down},function(err,db){return SearchIndex.options.indexes=db,done(err,SearchIndex)})}},{"./siUtil.js":2,bunyan:10,leveldown:59,levelup:72,"search-index-adder":105,"search-index-searcher":109}],2:[function(require,module,exports){module.exports=function(siOptions){var siUtil={};return siUtil.countDocs=function(callback){var count=0;const gte="DOCUMENT"+siOptions.keySeparator,lte="DOCUMENT"+siOptions.keySeparator+siOptions.keySeparator;siOptions.indexes.createReadStream({gte:gte,lte:lte}).on("data",function(data){count++}).on("error",function(err){return callback(err,null)}).on("end",function(){return callback(null,count)})},siUtil.close=function(callback){siOptions.indexes.close(function(err){for(;!siOptions.indexes.isClosed();)siOptions.log&&siOptions.log.info("closing...");siOptions.indexes.isClosed()&&(siOptions.log&&siOptions.log.info("closed..."),callback(err))})},siUtil}},{}],3:[function(require,module,exports){(function(process,Buffer){"use strict";function check(x,y){return"string"==typeof x?y==x:x&&"function"==typeof x.exec?x.exec(y):"boolean"==typeof x||"object"==typeof x?x:"function"==typeof x&&x(y)}var Parser=require("jsonparse"),through=require("through");exports.parse=function(path,map){function setHeaderFooter(key,value){!1!==header&&(header=header||{},header[key]=value),!1!==footer&&!1===header&&(footer=footer||{},footer[key]=value)}var header,footer,parser=new Parser,stream=through(function(chunk){"string"==typeof chunk&&(chunk=new Buffer(chunk)),parser.write(chunk)},function(data){data&&stream.write(data),header&&stream.emit("header",header),footer&&stream.emit("footer",footer),stream.queue(null)});"string"==typeof path&&(path=path.split(".").map(function(e){return"$*"===e?{emitKey:!0}:"*"===e||(""===e?{recurse:!0}:e)}));var count=0;return path&&path.length||(path=null),parser.onValue=function(value){if(this.root||(stream.root=value),path){for(var i=0,j=0,emitKey=!1,emitPath=!1;i<path.length;){var c,key=path[i];if(j++,key&&!key.recurse){if(!(c=j===this.stack.length?this:this.stack[j]))return;if(!check(key,c.key))return void setHeaderFooter(c.key,value);emitKey=!!key.emitKey,emitPath=!!key.emitPath,i++}else{i++;var nextKey=path[i];if(!nextKey)return;for(;;){if(!(c=j===this.stack.length?this:this.stack[j]))return;if(check(nextKey,c.key)){i++,Object.isFrozen(this.stack[j])||(this.stack[j].value=null);break}setHeaderFooter(c.key,value),j++}}}if(header&&(stream.emit("header",header),header=!1),j===this.stack.length){count++;var actualPath=this.stack.slice(1).map(function(element){return element.key}).concat([this.key]),data=this.value[this.key];null!=data&&null!=(data=map?map(data,actualPath):data)&&((emitKey||emitPath)&&(data={value:data},emitKey&&(data.key=this.key),emitPath&&(data.path=actualPath)),stream.queue(data)),delete this.value[this.key];for(var k in this.stack)Object.isFrozen(this.stack[k])||(this.stack[k].value=null)}}},parser._onToken=parser.onToken,parser.onToken=function(token,value){parser._onToken(token,value),0===this.stack.length&&stream.root&&(path||stream.queue(stream.root),count=0,stream.root=null)},parser.onError=function(err){err.message.indexOf("at position")>-1&&(err.message="Invalid JSON ("+err.message+")"),stream.emit("error",err)},stream},exports.stringify=function(op,sep,cl,indent){indent=indent||0,!1===op?(op="",sep="\n",cl=""):null==op&&(op="[\n",sep="\n,\n",cl="\n]\n");var stream,first=!0,anyData=!1;return stream=through(function(data){anyData=!0;try{var json=JSON.stringify(data,null,indent)}catch(err){return stream.emit("error",err)}first?(first=!1,stream.queue(op+json)):stream.queue(sep+json)},function(data){anyData||stream.queue(op),stream.queue(cl),stream.queue(null)})},exports.stringifyObject=function(op,sep,cl,indent){indent=indent||0,!1===op?(op="",sep="\n",cl=""):null==op&&(op="{\n",sep="\n,\n",cl="\n}\n");var first=!0,anyData=!1;return through(function(data){anyData=!0;var json=JSON.stringify(data[0])+":"+JSON.stringify(data[1],null,indent);first?(first=!1,this.queue(op+json)):this.queue(sep+json)},function(data){anyData||this.queue(op),this.queue(cl),this.queue(null)})},module.parent||"browser"===process.title||process.stdin.pipe(exports.parse(process.argv[2])).pipe(exports.stringify("[",",\n","]\n",2)).pipe(process.stdout)}).call(this,require("_process"),require("buffer").Buffer)},{_process:86,buffer:9,jsonparse:46,through:132}],4:[function(require,module,exports){(function(global){"use strict";function compare(a,b){if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i<len;++i)if(a[i]!==b[i]){x=a[i],y=b[i];break}return x<y?-1:y<x?1:0}function isBuffer(b){return global.Buffer&&"function"==typeof global.Buffer.isBuffer?global.Buffer.isBuffer(b):!(null==b||!b._isBuffer)}function pToString(obj){return Object.prototype.toString.call(obj)}function isView(arrbuf){return!isBuffer(arrbuf)&&("function"==typeof global.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(arrbuf):!!arrbuf&&(arrbuf instanceof DataView||!!(arrbuf.buffer&&arrbuf.buffer instanceof ArrayBuffer))))}function getName(func){if(util.isFunction(func)){if(functionsHaveNames)return func.name;var str=func.toString(),match=str.match(regex);return match&&match[1]}}function truncate(s,n){return"string"==typeof s?s.length<n?s:s.slice(0,n):s}function inspect(something){if(functionsHaveNames||!util.isFunction(something))return util.inspect(something);var rawname=getName(something);return"[Function"+(rawname?": "+rawname:"")+"]"}function getMessage(self){return truncate(inspect(self.actual),128)+" "+self.operator+" "+truncate(inspect(self.expected),128)}function fail(actual,expected,message,operator,stackStartFunction){throw new assert.AssertionError({message:message,actual:actual,expected:expected,operator:operator,stackStartFunction:stackStartFunction})}function ok(value,message){value||fail(value,!0,message,"==",assert.ok)}function _deepEqual(actual,expected,strict,memos){if(actual===expected)return!0;if(isBuffer(actual)&&isBuffer(expected))return 0===compare(actual,expected);if(util.isDate(actual)&&util.isDate(expected))return actual.getTime()===expected.getTime();if(util.isRegExp(actual)&&util.isRegExp(expected))return actual.source===expected.source&&actual.global===expected.global&&actual.multiline===expected.multiline&&actual.lastIndex===expected.lastIndex&&actual.ignoreCase===expected.ignoreCase;if(null!==actual&&"object"==typeof actual||null!==expected&&"object"==typeof expected){if(isView(actual)&&isView(expected)&&pToString(actual)===pToString(expected)&&!(actual instanceof Float32Array||actual instanceof Float64Array))return 0===compare(new Uint8Array(actual.buffer),new Uint8Array(expected.buffer));if(isBuffer(actual)!==isBuffer(expected))return!1;memos=memos||{actual:[],expected:[]};var actualIndex=memos.actual.indexOf(actual);return-1!==actualIndex&&actualIndex===memos.expected.indexOf(expected)||(memos.actual.push(actual),memos.expected.push(expected),objEquiv(actual,expected,strict,memos))}return strict?actual===expected:actual==expected}function isArguments(object){return"[object Arguments]"==Object.prototype.toString.call(object)}function objEquiv(a,b,strict,actualVisitedObjects){if(null===a||void 0===a||null===b||void 0===b)return!1;if(util.isPrimitive(a)||util.isPrimitive(b))return a===b;if(strict&&Object.getPrototypeOf(a)!==Object.getPrototypeOf(b))return!1;var aIsArgs=isArguments(a),bIsArgs=isArguments(b);if(aIsArgs&&!bIsArgs||!aIsArgs&&bIsArgs)return!1;if(aIsArgs)return a=pSlice.call(a),b=pSlice.call(b),_deepEqual(a,b,strict);var key,i,ka=objectKeys(a),kb=objectKeys(b);if(ka.length!==kb.length)return!1;for(ka.sort(),kb.sort(),i=ka.length-1;i>=0;i--)if(ka[i]!==kb[i])return!1;for(i=ka.length-1;i>=0;i--)if(key=ka[i],!_deepEqual(a[key],b[key],strict,actualVisitedObjects))return!1;return!0}function notDeepStrictEqual(actual,expected,message){_deepEqual(actual,expected,!0)&&fail(actual,expected,message,"notDeepStrictEqual",notDeepStrictEqual)}function expectedException(actual,expected){if(!actual||!expected)return!1;if("[object RegExp]"==Object.prototype.toString.call(expected))return expected.test(actual);try{if(actual instanceof expected)return!0}catch(e){}return!Error.isPrototypeOf(expected)&&!0===expected.call({},actual)}function _tryBlock(block){var error;try{block()}catch(e){error=e}return error}function _throws(shouldThrow,block,expected,message){var actual;if("function"!=typeof block)throw new TypeError('"block" argument must be a function');"string"==typeof expected&&(message=expected,expected=null),actual=_tryBlock(block),message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:"."),shouldThrow&&!actual&&fail(actual,expected,"Missing expected exception"+message);var userProvidedMessage="string"==typeof message,isUnwantedException=!shouldThrow&&util.isError(actual),isUnexpectedException=!shouldThrow&&actual&&!expected;if((isUnwantedException&&userProvidedMessage&&expectedException(actual,expected)||isUnexpectedException)&&fail(actual,expected,"Got unwanted exception"+message),shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual)throw actual}var util=require("util/"),hasOwn=Object.prototype.hasOwnProperty,pSlice=Array.prototype.slice,functionsHaveNames=function(){return"foo"===function(){}.name}(),assert=module.exports=ok,regex=/\s*function\s+([^\(\s]*)\s*/;assert.AssertionError=function(options){this.name="AssertionError",this.actual=options.actual,this.expected=options.expected,this.operator=options.operator,options.message?(this.message=options.message,this.generatedMessage=!1):(this.message=getMessage(this),this.generatedMessage=!0);var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,stackStartFunction);else{var err=new Error;if(err.stack){var out=err.stack,fn_name=getName(stackStartFunction),idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}},util.inherits(assert.AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=function(actual,expected,message){actual!=expected&&fail(actual,expected,message,"==",assert.equal)},assert.notEqual=function(actual,expected,message){actual==expected&&fail(actual,expected,message,"!=",assert.notEqual)},assert.deepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)||fail(actual,expected,message,"deepEqual",assert.deepEqual)},assert.deepStrictEqual=function(actual,expected,message){_deepEqual(actual,expected,!0)||fail(actual,expected,message,"deepStrictEqual",assert.deepStrictEqual)},assert.notDeepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)&&fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)},assert.notDeepStrictEqual=notDeepStrictEqual,assert.strictEqual=function(actual,expected,message){actual!==expected&&fail(actual,expected,message,"===",assert.strictEqual)},assert.notStrictEqual=function(actual,expected,message){actual===expected&&fail(actual,expected,message,"!==",assert.notStrictEqual)},assert.throws=function(block,error,message){_throws(!0,block,error,message)},assert.doesNotThrow=function(block,error,message){_throws(!1,block,error,message)},assert.ifError=function(err){if(err)throw err};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)hasOwn.call(obj,key)&&keys.push(key);return keys}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":137}],5:[function(require,module,exports){(function(process,global){!function(global,factory){"object"==typeof exports&&void 0!==module?factory(exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory(global.async=global.async||{})}(this,function(exports){"use strict";function slice(arrayLike,start){start|=0;for(var newLen=Math.max(arrayLike.length-start,0),newArr=Array(newLen),idx=0;idx<newLen;idx++)newArr[idx]=arrayLike[start+idx];return newArr}function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}function fallback(fn){setTimeout(fn,0)}function wrap(defer){return function(fn){var args=slice(arguments,1);defer(function(){fn.apply(null,args)})}}function asyncify(func){return initialParams(function(args,callback){var result;try{result=func.apply(this,args)}catch(e){return callback(e)}isObject(result)&&"function"==typeof result.then?result.then(function(value){invokeCallback(callback,null,value)},function(err){invokeCallback(callback,err.message?err:new Error(err))}):callback(null,result)})}function invokeCallback(callback,error,value){try{callback(error,value)}catch(e){setImmediate$1(rethrow,e)}}function rethrow(error){throw error}function isAsync(fn){return supportsSymbol&&"AsyncFunction"===fn[Symbol.toStringTag]}function wrapAsync(asyncFn){return isAsync(asyncFn)?asyncify(asyncFn):asyncFn}function applyEach$1(eachfn){return function(fns){var args=slice(arguments,1),go=initialParams(function(args,callback){var that=this;return eachfn(fns,function(fn,cb){wrapAsync(fn).apply(that,args.concat(cb))},callback)});return args.length?go.apply(this,args):go}}function getRawTag(value){var isOwn=hasOwnProperty.call(value,symToStringTag$1),tag=value[symToStringTag$1];try{value[symToStringTag$1]=void 0;var unmasked=!0}catch(e){}var result=nativeObjectToString.call(value);return unmasked&&(isOwn?value[symToStringTag$1]=tag:delete value[symToStringTag$1]),result}function objectToString(value){return nativeObjectToString$1.call(value)}function baseGetTag(value){return null==value?void 0===value?undefinedTag:nullTag:(value=Object(value),symToStringTag&&symToStringTag in value?getRawTag(value):objectToString(value))}function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function noop(){}function once(fn){return function(){if(null!==fn){var callFn=fn;fn=null,callFn.apply(this,arguments)}}}function baseTimes(n,iteratee){for(var index=-1,result=Array(n);++index<n;)result[index]=iteratee(index);return result}function isObjectLike(value){return null!=value&&"object"==typeof value}function baseIsArguments(value){return isObjectLike(value)&&baseGetTag(value)==argsTag}function stubFalse(){return!1}function isIndex(value,length){return!!(length=null==length?MAX_SAFE_INTEGER$1:length)&&("number"==typeof value||reIsUint.test(value))&&value>-1&&value%1==0&&value<length}function baseIsTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)]}function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value)!inherited&&!hasOwnProperty$1.call(value,key)||skipIndexes&&("length"==key||isBuff&&("offset"==key||"parent"==key)||isType&&("buffer"==key||"byteLength"==key||"byteOffset"==key)||isIndex(key,length))||result.push(key);return result}function isPrototype(value){var Ctor=value&&value.constructor;return value===("function"==typeof Ctor&&Ctor.prototype||objectProto$5)}function baseKeys(object){if(!isPrototype(object))return nativeKeys(object);var result=[];for(var key in Object(object))hasOwnProperty$3.call(object,key)&&"constructor"!=key&&result.push(key);return result}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function createArrayIterator(coll){var i=-1,len=coll.length;return function(){return++i<len?{value:coll[i],key:i}:null}}function createES2015Iterator(iterator){var i=-1;return function(){var item=iterator.next();return item.done?null:(i++,{value:item.value,key:i})}}function createObjectIterator(obj){var okeys=keys(obj),i=-1,len=okeys.length;return function(){var key=okeys[++i];return i<len?{value:obj[key],key:key}:null}}function iterator(coll){if(isArrayLike(coll))return createArrayIterator(coll);var iterator=getIterator(coll);return iterator?createES2015Iterator(iterator):createObjectIterator(coll)}function onlyOnce(fn){return function(){if(null===fn)throw new Error("Callback was already called.");var callFn=fn;fn=null,callFn.apply(this,arguments)}}function _eachOfLimit(limit){return function(obj,iteratee,callback){function iterateeCallback(err,value){if(running-=1,err)done=!0,callback(err);else{if(value===breakLoop||done&&running<=0)return done=!0,callback(null);replenish()}}function replenish(){for(;running<limit&&!done;){var elem=nextElem();if(null===elem)return done=!0,void(running<=0&&callback(null));running+=1,iteratee(elem.value,elem.key,onlyOnce(iterateeCallback))}}if(callback=once(callback||noop),limit<=0||!obj)return callback(null);var nextElem=iterator(obj),done=!1,running=0;replenish()}}function eachOfLimit(coll,limit,iteratee,callback){_eachOfLimit(limit)(coll,wrapAsync(iteratee),callback)}function doLimit(fn,limit){return function(iterable,iteratee,callback){return fn(iterable,limit,iteratee,callback)}}function eachOfArrayLike(coll,iteratee,callback){function iteratorCallback(err,value){err?callback(err):++completed!==length&&value!==breakLoop||callback(null)}callback=once(callback||noop);var index=0,completed=0,length=coll.length;for(0===length&&callback(null);index<length;index++)iteratee(coll[index],index,onlyOnce(iteratorCallback))}function doParallel(fn){return function(obj,iteratee,callback){return fn(eachOf,obj,wrapAsync(iteratee),callback)}}function _asyncMap(eachfn,arr,iteratee,callback){callback=callback||noop,arr=arr||[];var results=[],counter=0,_iteratee=wrapAsync(iteratee);eachfn(arr,function(value,_,callback){var index=counter++;_iteratee(value,function(err,v){results[index]=v,callback(err)})},function(err){callback(err,results)})}function doParallelLimit(fn){return function(obj,limit,iteratee,callback){return fn(_eachOfLimit(limit),obj,wrapAsync(iteratee),callback)}}function arrayEach(array,iteratee){for(var index=-1,length=null==array?0:array.length;++index<length&&!1!==iteratee(array[index],index,array););return array}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseFindIndex(array,predicate,fromIndex,fromRight){for(var length=array.length,index=fromIndex+(fromRight?1:-1);fromRight?index--:++index<length;)if(predicate(array[index],index,array))return index;return-1}function baseIsNaN(value){return value!==value}function strictIndexOf(array,value,fromIndex){for(var index=fromIndex-1,length=array.length;++index<length;)if(array[index]===value)return index;return-1}function baseIndexOf(array,value,fromIndex){return value===value?strictIndexOf(array,value,fromIndex):baseFindIndex(array,baseIsNaN,fromIndex)}function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&baseGetTag(value)==symbolTag}function baseToString(value){if("string"==typeof value)return value;if(isArray(value))return arrayMap(value,baseToString)+"";if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-INFINITY?"-0":result}function baseSlice(array,start,end){var index=-1,length=array.length;start<0&&(start=-start>length?0:length+start),end=end>length?length:end,end<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index<length;)result[index]=array[index+start];return result}function castSlice(array,start,end){var length=array.length;return end=void 0===end?length:end,!start&&end>=length?array:baseSlice(array,start,end)}function charsEndIndex(strSymbols,chrSymbols){for(var index=strSymbols.length;index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function charsStartIndex(strSymbols,chrSymbols){for(var index=-1,length=strSymbols.length;++index<length&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function asciiToArray(string){return string.split("")}function hasUnicode(string){return reHasUnicode.test(string)}function unicodeToArray(string){return string.match(reUnicode)||[]}function stringToArray(string){return hasUnicode(string)?unicodeToArray(string):asciiToArray(string)}function toString(value){return null==value?"":baseToString(value)}function trim(string,chars,guard){if((string=toString(string))&&(guard||void 0===chars))return string.replace(reTrim,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars);return castSlice(strSymbols,charsStartIndex(strSymbols,chrSymbols),charsEndIndex(strSymbols,chrSymbols)+1).join("")}function parseParams(func){return func=func.toString().replace(STRIP_COMMENTS,""),func=func.match(FN_ARGS)[2].replace(" ",""),func=func?func.split(FN_ARG_SPLIT):[],func=func.map(function(arg){return trim(arg.replace(FN_ARG,""))})}function autoInject(tasks,callback){var newTasks={};baseForOwn(tasks,function(taskFn,key){function newTask(results,taskCb){var newArgs=arrayMap(params,function(name){return results[name]});newArgs.push(taskCb),wrapAsync(taskFn).apply(null,newArgs)}var params,fnIsAsync=isAsync(taskFn),hasNoDeps=!fnIsAsync&&1===taskFn.length||fnIsAsync&&0===taskFn.length;if(isArray(taskFn))params=taskFn.slice(0,-1),taskFn=taskFn[taskFn.length-1],newTasks[key]=params.concat(params.length>0?newTask:taskFn);else if(hasNoDeps)newTasks[key]=taskFn;else{if(params=parseParams(taskFn),0===taskFn.length&&!fnIsAsync&&0===params.length)throw new Error("autoInject task functions require explicit parameters.");fnIsAsync||params.pop(),newTasks[key]=params.concat(newTask)}}),auto(newTasks,callback)}function DLL(){this.head=this.tail=null,this.length=0}function setInitial(dll,node){dll.length=1,dll.head=dll.tail=node}function queue(worker,concurrency,payload){function _insert(data,insertAtFront,callback){if(null!=callback&&"function"!=typeof callback)throw new Error("task callback must be a function");if(q.started=!0,isArray(data)||(data=[data]),0===data.length&&q.idle())return setImmediate$1(function(){q.drain()});for(var i=0,l=data.length;i<l;i++){var item={data:data[i],callback:callback||noop};insertAtFront?q._tasks.unshift(item):q._tasks.push(item)}setImmediate$1(q.process)}function _next(tasks){return function(err){numRunning-=1;for(var i=0,l=tasks.length;i<l;i++){var task=tasks[i],index=baseIndexOf(workersList,task,0);index>=0&&workersList.splice(index),task.callback.apply(task,arguments),null!=err&&q.error(err,task.data)}numRunning<=q.concurrency-q.buffer&&q.unsaturated(),q.idle()&&q.drain(),q.process()}}if(null==concurrency)concurrency=1;else if(0===concurrency)throw new Error("Concurrency must not be zero");var _worker=wrapAsync(worker),numRunning=0,workersList=[],isProcessing=!1,q={_tasks:new DLL,concurrency:concurrency,payload:payload,saturated:noop,unsaturated:noop,buffer:concurrency/4,empty:noop,drain:noop,error:noop,started:!1,paused:!1,push:function(data,callback){_insert(data,!1,callback)},kill:function(){q.drain=noop,q._tasks.empty()},unshift:function(data,callback){_insert(data,!0,callback)},remove:function(testFn){q._tasks.remove(testFn)},process:function(){if(!isProcessing){for(isProcessing=!0;!q.paused&&numRunning<q.concurrency&&q._tasks.length;){var tasks=[],data=[],l=q._tasks.length;q.payload&&(l=Math.min(l,q.payload));for(var i=0;i<l;i++){var node=q._tasks.shift();tasks.push(node),data.push(node.data)}numRunning+=1,workersList.push(tasks[0]),0===q._tasks.length&&q.empty(),numRunning===q.concurrency&&q.saturated();var cb=onlyOnce(_next(tasks));_worker(data,cb)}isProcessing=!1}},length:function(){return q._tasks.length},running:function(){return numRunning},workersList:function(){return workersList},idle:function(){return q._tasks.length+numRunning===0},pause:function(){q.paused=!0},resume:function(){!1!==q.paused&&(q.paused=!1,setImmediate$1(q.process))}};return q}function cargo(worker,payload){return queue(worker,1,payload)}function reduce(coll,memo,iteratee,callback){callback=once(callback||noop);var _iteratee=wrapAsync(iteratee);eachOfSeries(coll,function(x,i,callback){_iteratee(memo,x,function(err,v){memo=v,callback(err)})},function(err){callback(err,memo)})}function seq(){var _functions=arrayMap(arguments,wrapAsync);return function(){var args=slice(arguments),that=this,cb=args[args.length-1];"function"==typeof cb?args.pop():cb=noop,reduce(_functions,args,function(newargs,fn,cb){fn.apply(that,newargs.concat(function(err){var nextargs=slice(arguments,1);cb(err,nextargs)}))},function(err,results){cb.apply(that,[err].concat(results))})}}function concat$1(eachfn,arr,fn,callback){var result=[];eachfn(arr,function(x,index,cb){fn(x,function(err,y){result=result.concat(y||[]),cb(err)})},function(err){callback(err,result)})}function identity(value){return value}function _createTester(check,getResult){return function(eachfn,arr,iteratee,cb){cb=cb||noop;var testResult,testPassed=!1;eachfn(arr,function(value,_,callback){iteratee(value,function(err,result){err?callback(err):check(result)&&!testResult?(testPassed=!0,testResult=getResult(!0,value),callback(null,breakLoop)):callback()})},function(err){err?cb(err):cb(null,testPassed?testResult:getResult(!1))})}}function _findGetResult(v,x){return x}function consoleFunc(name){return function(fn){var args=slice(arguments,1);args.push(function(err){var args=slice(arguments,1);"object"==typeof console&&(err?console.error&&console.error(err):console[name]&&arrayEach(args,function(x){console[name](x)}))}),wrapAsync(fn).apply(null,args)}}function doDuring(fn,test,callback){function next(err){if(err)return callback(err);var args=slice(arguments,1);args.push(check),_test.apply(this,args)}function check(err,truth){return err?callback(err):truth?void _fn(next):callback(null)}callback=onlyOnce(callback||noop);var _fn=wrapAsync(fn),_test=wrapAsync(test);check(null,!0)}function doWhilst(iteratee,test,callback){callback=onlyOnce(callback||noop);var _iteratee=wrapAsync(iteratee),next=function(err){if(err)return callback(err);var args=slice(arguments,1);if(test.apply(this,args))return _iteratee(next);callback.apply(null,[null].concat(args))};_iteratee(next)}function doUntil(iteratee,test,callback){doWhilst(iteratee,function(){return!test.apply(this,arguments)},callback)}function during(test,fn,callback){function next(err){if(err)return callback(err);_test(check)}function check(err,truth){return err?callback(err):truth?void _fn(next):callback(null)}callback=onlyOnce(callback||noop);var _fn=wrapAsync(fn),_test=wrapAsync(test);_test(check)}function _withoutIndex(iteratee){return function(value,index,callback){return iteratee(value,callback)}}function eachLimit(coll,iteratee,callback){eachOf(coll,_withoutIndex(wrapAsync(iteratee)),callback)}function eachLimit$1(coll,limit,iteratee,callback){_eachOfLimit(limit)(coll,_withoutIndex(wrapAsync(iteratee)),callback)}function ensureAsync(fn){return isAsync(fn)?fn:initialParams(function(args,callback){var sync=!0;args.push(function(){var innerArgs=arguments;sync?setImmediate$1(function(){callback.apply(null,innerArgs)}):callback.apply(null,innerArgs)}),fn.apply(this,args),sync=!1})}function notId(v){return!v}function baseProperty(key){return function(object){return null==object?void 0:object[key]}}function filterArray(eachfn,arr,iteratee,callback){var truthValues=new Array(arr.length);eachfn(arr,function(x,index,callback){iteratee(x,function(err,v){truthValues[index]=!!v,callback(err)})},function(err){if(err)return callback(err);for(var results=[],i=0;i<arr.length;i++)truthValues[i]&&results.push(arr[i]);callback(null,results)})}function filterGeneric(eachfn,coll,iteratee,callback){var results=[];eachfn(coll,function(x,index,callback){iteratee(x,function(err,v){err?callback(err):(v&&results.push({index:index,value:x}),callback())})},function(err){err?callback(err):callback(null,arrayMap(results.sort(function(a,b){return a.index-b.index}),baseProperty("value")))})}function _filter(eachfn,coll,iteratee,callback){(isArrayLike(coll)?filterArray:filterGeneric)(eachfn,coll,wrapAsync(iteratee),callback||noop)}function forever(fn,errback){function next(err){if(err)return done(err);task(next)}var done=onlyOnce(errback||noop),task=wrapAsync(ensureAsync(fn));next()}function mapValuesLimit(obj,limit,iteratee,callback){callback=once(callback||noop);var newObj={},_iteratee=wrapAsync(iteratee);eachOfLimit(obj,limit,function(val,key,next){_iteratee(val,key,function(err,result){
  if(err)return next(err);newObj[key]=result,next()})},function(err){callback(err,newObj)})}function has(obj,key){return key in obj}function memoize(fn,hasher){var memo=Object.create(null),queues=Object.create(null);hasher=hasher||identity;var _fn=wrapAsync(fn),memoized=initialParams(function(args,callback){var key=hasher.apply(null,args);has(memo,key)?setImmediate$1(function(){callback.apply(null,memo[key])}):has(queues,key)?queues[key].push(callback):(queues[key]=[callback],_fn.apply(null,args.concat(function(){var args=slice(arguments);memo[key]=args;var q=queues[key];delete queues[key];for(var i=0,l=q.length;i<l;i++)q[i].apply(null,args)})))});return memoized.memo=memo,memoized.unmemoized=fn,memoized}function _parallel(eachfn,tasks,callback){callback=callback||noop;var results=isArrayLike(tasks)?[]:{};eachfn(tasks,function(task,key,callback){wrapAsync(task)(function(err,result){arguments.length>2&&(result=slice(arguments,1)),results[key]=result,callback(err)})},function(err){callback(err,results)})}function parallelLimit(tasks,callback){_parallel(eachOf,tasks,callback)}function parallelLimit$1(tasks,limit,callback){_parallel(_eachOfLimit(limit),tasks,callback)}function race(tasks,callback){if(callback=once(callback||noop),!isArray(tasks))return callback(new TypeError("First argument to race must be an array of functions"));if(!tasks.length)return callback();for(var i=0,l=tasks.length;i<l;i++)wrapAsync(tasks[i])(callback)}function reduceRight(array,memo,iteratee,callback){reduce(slice(array).reverse(),memo,iteratee,callback)}function reflect(fn){var _fn=wrapAsync(fn);return initialParams(function(args,reflectCallback){return args.push(function(error,cbArg){if(error)reflectCallback(null,{error:error});else{var value;value=arguments.length<=2?cbArg:slice(arguments,1),reflectCallback(null,{value:value})}}),_fn.apply(this,args)})}function reject$1(eachfn,arr,iteratee,callback){_filter(eachfn,arr,function(value,cb){iteratee(value,function(err,v){cb(err,!v)})},callback)}function reflectAll(tasks){var results;return isArray(tasks)?results=arrayMap(tasks,reflect):(results={},baseForOwn(tasks,function(task,key){results[key]=reflect.call(this,task)})),results}function constant$1(value){return function(){return value}}function retry(opts,task,callback){function retryAttempt(){_task(function(err){err&&attempt++<options.times&&("function"!=typeof options.errorFilter||options.errorFilter(err))?setTimeout(retryAttempt,options.intervalFunc(attempt)):callback.apply(null,arguments)})}var DEFAULT_TIMES=5,DEFAULT_INTERVAL=0,options={times:DEFAULT_TIMES,intervalFunc:constant$1(DEFAULT_INTERVAL)};if(arguments.length<3&&"function"==typeof opts?(callback=task||noop,task=opts):(!function(acc,t){if("object"==typeof t)acc.times=+t.times||DEFAULT_TIMES,acc.intervalFunc="function"==typeof t.interval?t.interval:constant$1(+t.interval||DEFAULT_INTERVAL),acc.errorFilter=t.errorFilter;else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");acc.times=+t||DEFAULT_TIMES}}(options,opts),callback=callback||noop),"function"!=typeof task)throw new Error("Invalid arguments for async.retry");var _task=wrapAsync(task),attempt=1;retryAttempt()}function series(tasks,callback){_parallel(eachOfSeries,tasks,callback)}function sortBy(coll,iteratee,callback){function comparator(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0}var _iteratee=wrapAsync(iteratee);map(coll,function(x,callback){_iteratee(x,function(err,criteria){if(err)return callback(err);callback(null,{value:x,criteria:criteria})})},function(err,results){if(err)return callback(err);callback(null,arrayMap(results.sort(comparator),baseProperty("value")))})}function timeout(asyncFn,milliseconds,info){var fn=wrapAsync(asyncFn);return initialParams(function(args,callback){function timeoutCallback(){var name=asyncFn.name||"anonymous",error=new Error('Callback function "'+name+'" timed out.');error.code="ETIMEDOUT",info&&(error.info=info),timedOut=!0,callback(error)}var timer,timedOut=!1;args.push(function(){timedOut||(callback.apply(null,arguments),clearTimeout(timer))}),timer=setTimeout(timeoutCallback,milliseconds),fn.apply(null,args)})}function baseRange(start,end,step,fromRight){for(var index=-1,length=nativeMax(nativeCeil((end-start)/(step||1)),0),result=Array(length);length--;)result[fromRight?length:++index]=start,start+=step;return result}function timeLimit(count,limit,iteratee,callback){var _iteratee=wrapAsync(iteratee);mapLimit(baseRange(0,count,1),limit,_iteratee,callback)}function transform(coll,accumulator,iteratee,callback){arguments.length<=3&&(callback=iteratee,iteratee=accumulator,accumulator=isArray(coll)?[]:{}),callback=once(callback||noop);var _iteratee=wrapAsync(iteratee);eachOf(coll,function(v,k,cb){_iteratee(accumulator,v,k,cb)},function(err){callback(err,accumulator)})}function tryEach(tasks,callback){var result,error=null;callback=callback||noop,eachSeries(tasks,function(task,callback){wrapAsync(task)(function(err,res){result=arguments.length>2?slice(arguments,1):res,error=err,callback(!err)})},function(){callback(error,result)})}function unmemoize(fn){return function(){return(fn.unmemoized||fn).apply(null,arguments)}}function whilst(test,iteratee,callback){callback=onlyOnce(callback||noop);var _iteratee=wrapAsync(iteratee);if(!test())return callback(null);var next=function(err){if(err)return callback(err);if(test())return _iteratee(next);var args=slice(arguments,1);callback.apply(null,[null].concat(args))};_iteratee(next)}function until(test,iteratee,callback){whilst(function(){return!test.apply(this,arguments)},iteratee,callback)}var _defer,initialParams=function(fn){return function(){var args=slice(arguments),callback=args.pop();fn.call(this,args,callback)}},hasSetImmediate="function"==typeof setImmediate&&setImmediate,hasNextTick="object"==typeof process&&"function"==typeof process.nextTick;_defer=hasSetImmediate?setImmediate:hasNextTick?process.nextTick:fallback;var setImmediate$1=wrap(_defer),supportsSymbol="function"==typeof Symbol,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol$1=root.Symbol,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0,objectProto$1=Object.prototype,nativeObjectToString$1=objectProto$1.toString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0,asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]",MAX_SAFE_INTEGER=9007199254740991,breakLoop={},iteratorSymbol="function"==typeof Symbol&&Symbol.iterator,getIterator=function(coll){return iteratorSymbol&&coll[iteratorSymbol]&&coll[iteratorSymbol]()},argsTag="[object Arguments]",objectProto$3=Object.prototype,hasOwnProperty$2=objectProto$3.hasOwnProperty,propertyIsEnumerable=objectProto$3.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty$2.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")},isArray=Array.isArray,freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer=moduleExports?root.Buffer:void 0,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse,MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1;var freeExports$1="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,freeProcess=moduleExports$1&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray,objectProto$2=Object.prototype,hasOwnProperty$1=objectProto$2.hasOwnProperty,objectProto$5=Object.prototype,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,eachOfGeneric=doLimit(eachOfLimit,1/0),eachOf=function(coll,iteratee,callback){(isArrayLike(coll)?eachOfArrayLike:eachOfGeneric)(coll,wrapAsync(iteratee),callback)},map=doParallel(_asyncMap),applyEach=applyEach$1(map),mapLimit=doParallelLimit(_asyncMap),mapSeries=doLimit(mapLimit,1),applyEachSeries=applyEach$1(mapSeries),apply=function(fn){var args=slice(arguments,1);return function(){var callArgs=slice(arguments);return fn.apply(null,args.concat(callArgs))}},baseFor=function(fromRight){return function(object,iteratee,keysFunc){for(var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;length--;){var key=props[fromRight?length:++index];if(!1===iteratee(iterable[key],key,iterable))break}return object}}(),auto=function(tasks,concurrency,callback){function enqueueTask(key,task){readyTasks.push(function(){runTask(key,task)})}function processQueue(){if(0===readyTasks.length&&0===runningTasks)return callback(null,results);for(;readyTasks.length&&runningTasks<concurrency;){readyTasks.shift()()}}function addListener(taskName,fn){var taskListeners=listeners[taskName];taskListeners||(taskListeners=listeners[taskName]=[]),taskListeners.push(fn)}function taskComplete(taskName){arrayEach(listeners[taskName]||[],function(fn){fn()}),processQueue()}function runTask(key,task){if(!hasError){var taskCallback=onlyOnce(function(err,result){if(runningTasks--,arguments.length>2&&(result=slice(arguments,1)),err){var safeResults={};baseForOwn(results,function(val,rkey){safeResults[rkey]=val}),safeResults[key]=result,hasError=!0,listeners=Object.create(null),callback(err,safeResults)}else results[key]=result,taskComplete(key)});runningTasks++;var taskFn=wrapAsync(task[task.length-1]);task.length>1?taskFn(results,taskCallback):taskFn(taskCallback)}}function getDependents(taskName){var result=[];return baseForOwn(tasks,function(task,key){isArray(task)&&baseIndexOf(task,taskName,0)>=0&&result.push(key)}),result}"function"==typeof concurrency&&(callback=concurrency,concurrency=null),callback=once(callback||noop);var keys$$1=keys(tasks),numTasks=keys$$1.length;if(!numTasks)return callback(null);concurrency||(concurrency=numTasks);var results={},runningTasks=0,hasError=!1,listeners=Object.create(null),readyTasks=[],readyToCheck=[],uncheckedDependencies={};baseForOwn(tasks,function(task,key){if(!isArray(task))return enqueueTask(key,[task]),void readyToCheck.push(key);var dependencies=task.slice(0,task.length-1),remainingDependencies=dependencies.length;if(0===remainingDependencies)return enqueueTask(key,task),void readyToCheck.push(key);uncheckedDependencies[key]=remainingDependencies,arrayEach(dependencies,function(dependencyName){if(!tasks[dependencyName])throw new Error("async.auto task `"+key+"` has a non-existent dependency `"+dependencyName+"` in "+dependencies.join(", "));addListener(dependencyName,function(){0===--remainingDependencies&&enqueueTask(key,task)})})}),function(){for(var currentTask,counter=0;readyToCheck.length;)currentTask=readyToCheck.pop(),counter++,arrayEach(getDependents(currentTask),function(dependent){0==--uncheckedDependencies[dependent]&&readyToCheck.push(dependent)});if(counter!==numTasks)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),processQueue()},symbolTag="[object Symbol]",INFINITY=1/0,symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0,reHasUnicode=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),rsCombo="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",reOptMod="(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?",rsOptJoin="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",rsRegional,rsSurrPair].join("|")+")[\\ufe0e\\ufe0f]?"+reOptMod+")*",rsSeq="[\\ufe0e\\ufe0f]?"+reOptMod+rsOptJoin,rsSymbol="(?:"+["[^\\ud800-\\udfff]"+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,"[\\ud800-\\udfff]"].join("|")+")",reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g"),reTrim=/^\s+|\s+$/g,FN_ARGS=/^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,FN_ARG_SPLIT=/,/,FN_ARG=/(=.+)?(\s*)$/,STRIP_COMMENTS=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;DLL.prototype.removeLink=function(node){return node.prev?node.prev.next=node.next:this.head=node.next,node.next?node.next.prev=node.prev:this.tail=node.prev,node.prev=node.next=null,this.length-=1,node},DLL.prototype.empty=function(){for(;this.head;)this.shift();return this},DLL.prototype.insertAfter=function(node,newNode){newNode.prev=node,newNode.next=node.next,node.next?node.next.prev=newNode:this.tail=newNode,node.next=newNode,this.length+=1},DLL.prototype.insertBefore=function(node,newNode){newNode.prev=node.prev,newNode.next=node,node.prev?node.prev.next=newNode:this.head=newNode,node.prev=newNode,this.length+=1},DLL.prototype.unshift=function(node){this.head?this.insertBefore(this.head,node):setInitial(this,node)},DLL.prototype.push=function(node){this.tail?this.insertAfter(this.tail,node):setInitial(this,node)},DLL.prototype.shift=function(){return this.head&&this.removeLink(this.head)},DLL.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)},DLL.prototype.toArray=function(){for(var arr=Array(this.length),curr=this.head,idx=0;idx<this.length;idx++)arr[idx]=curr.data,curr=curr.next;return arr},DLL.prototype.remove=function(testFn){for(var curr=this.head;curr;){var next=curr.next;testFn(curr)&&this.removeLink(curr),curr=next}return this};var _defer$1,eachOfSeries=doLimit(eachOfLimit,1),compose=function(){return seq.apply(null,slice(arguments).reverse())},concat=doParallel(concat$1),concatSeries=function(fn){return function(obj,iteratee,callback){return fn(eachOfSeries,obj,wrapAsync(iteratee),callback)}}(concat$1),constant=function(){var values=slice(arguments),args=[null].concat(values);return function(){return arguments[arguments.length-1].apply(this,args)}},detect=doParallel(_createTester(identity,_findGetResult)),detectLimit=doParallelLimit(_createTester(identity,_findGetResult)),detectSeries=doLimit(detectLimit,1),dir=consoleFunc("dir"),eachSeries=doLimit(eachLimit$1,1),every=doParallel(_createTester(notId,notId)),everyLimit=doParallelLimit(_createTester(notId,notId)),everySeries=doLimit(everyLimit,1),filter=doParallel(_filter),filterLimit=doParallelLimit(_filter),filterSeries=doLimit(filterLimit,1),groupByLimit=function(coll,limit,iteratee,callback){callback=callback||noop;var _iteratee=wrapAsync(iteratee);mapLimit(coll,limit,function(val,callback){_iteratee(val,function(err,key){return err?callback(err):callback(null,{key:key,val:val})})},function(err,mapResults){for(var result={},hasOwnProperty=Object.prototype.hasOwnProperty,i=0;i<mapResults.length;i++)if(mapResults[i]){var key=mapResults[i].key,val=mapResults[i].val;hasOwnProperty.call(result,key)?result[key].push(val):result[key]=[val]}return callback(err,result)})},groupBy=doLimit(groupByLimit,1/0),groupBySeries=doLimit(groupByLimit,1),log=consoleFunc("log"),mapValues=doLimit(mapValuesLimit,1/0),mapValuesSeries=doLimit(mapValuesLimit,1);_defer$1=hasNextTick?process.nextTick:hasSetImmediate?setImmediate:fallback;var nextTick=wrap(_defer$1),queue$1=function(worker,concurrency){var _worker=wrapAsync(worker);return queue(function(items,cb){_worker(items[0],cb)},concurrency,1)},priorityQueue=function(worker,concurrency){var q=queue$1(worker,concurrency);return q.push=function(data,priority,callback){if(null==callback&&(callback=noop),"function"!=typeof callback)throw new Error("task callback must be a function");if(q.started=!0,isArray(data)||(data=[data]),0===data.length)return setImmediate$1(function(){q.drain()});priority=priority||0;for(var nextNode=q._tasks.head;nextNode&&priority>=nextNode.priority;)nextNode=nextNode.next;for(var i=0,l=data.length;i<l;i++){var item={data:data[i],priority:priority,callback:callback};nextNode?q._tasks.insertBefore(nextNode,item):q._tasks.push(item)}setImmediate$1(q.process)},delete q.unshift,q},reject=doParallel(reject$1),rejectLimit=doParallelLimit(reject$1),rejectSeries=doLimit(rejectLimit,1),retryable=function(opts,task){task||(task=opts,opts=null);var _task=wrapAsync(task);return initialParams(function(args,callback){function taskFn(cb){_task.apply(null,args.concat(cb))}opts?retry(opts,taskFn,callback):retry(taskFn,callback)})},some=doParallel(_createTester(Boolean,identity)),someLimit=doParallelLimit(_createTester(Boolean,identity)),someSeries=doLimit(someLimit,1),nativeCeil=Math.ceil,nativeMax=Math.max,times=doLimit(timeLimit,1/0),timesSeries=doLimit(timeLimit,1),waterfall=function(tasks,callback){function nextTask(args){var task=wrapAsync(tasks[taskIndex++]);args.push(onlyOnce(next)),task.apply(null,args)}function next(err){if(err||taskIndex===tasks.length)return callback.apply(null,arguments);nextTask(slice(arguments,1))}if(callback=once(callback||noop),!isArray(tasks))return callback(new Error("First argument to waterfall must be an array of functions"));if(!tasks.length)return callback();var taskIndex=0;nextTask([])},index={applyEach:applyEach,applyEachSeries:applyEachSeries,apply:apply,asyncify:asyncify,auto:auto,autoInject:autoInject,cargo:cargo,compose:compose,concat:concat,concatSeries:concatSeries,constant:constant,detect:detect,detectLimit:detectLimit,detectSeries:detectSeries,dir:dir,doDuring:doDuring,doUntil:doUntil,doWhilst:doWhilst,during:during,each:eachLimit,eachLimit:eachLimit$1,eachOf:eachOf,eachOfLimit:eachOfLimit,eachOfSeries:eachOfSeries,eachSeries:eachSeries,ensureAsync:ensureAsync,every:every,everyLimit:everyLimit,everySeries:everySeries,filter:filter,filterLimit:filterLimit,filterSeries:filterSeries,forever:forever,groupBy:groupBy,groupByLimit:groupByLimit,groupBySeries:groupBySeries,log:log,map:map,mapLimit:mapLimit,mapSeries:mapSeries,mapValues:mapValues,mapValuesLimit:mapValuesLimit,mapValuesSeries:mapValuesSeries,memoize:memoize,nextTick:nextTick,parallel:parallelLimit,parallelLimit:parallelLimit$1,priorityQueue:priorityQueue,queue:queue$1,race:race,reduce:reduce,reduceRight:reduceRight,reflect:reflect,reflectAll:reflectAll,reject:reject,rejectLimit:rejectLimit,rejectSeries:rejectSeries,retry:retry,retryable:retryable,seq:seq,series:series,setImmediate:setImmediate$1,some:some,someLimit:someLimit,someSeries:someSeries,sortBy:sortBy,timeout:timeout,times:times,timesLimit:timeLimit,timesSeries:timesSeries,transform:transform,tryEach:tryEach,unmemoize:unmemoize,until:until,waterfall:waterfall,whilst:whilst,all:every,any:some,forEach:eachLimit,forEachSeries:eachSeries,forEachLimit:eachLimit$1,forEachOf:eachOf,forEachOfSeries:eachOfSeries,forEachOfLimit:eachOfLimit,inject:reduce,foldl:reduce,foldr:reduceRight,select:filter,selectLimit:filterLimit,selectSeries:filterSeries,wrapSync:asyncify};exports.default=index,exports.applyEach=applyEach,exports.applyEachSeries=applyEachSeries,exports.apply=apply,exports.asyncify=asyncify,exports.auto=auto,exports.autoInject=autoInject,exports.cargo=cargo,exports.compose=compose,exports.concat=concat,exports.concatSeries=concatSeries,exports.constant=constant,exports.detect=detect,exports.detectLimit=detectLimit,exports.detectSeries=detectSeries,exports.dir=dir,exports.doDuring=doDuring,exports.doUntil=doUntil,exports.doWhilst=doWhilst,exports.during=during,exports.each=eachLimit,exports.eachLimit=eachLimit$1,exports.eachOf=eachOf,exports.eachOfLimit=eachOfLimit,exports.eachOfSeries=eachOfSeries,exports.eachSeries=eachSeries,exports.ensureAsync=ensureAsync,exports.every=every,exports.everyLimit=everyLimit,exports.everySeries=everySeries,exports.filter=filter,exports.filterLimit=filterLimit,exports.filterSeries=filterSeries,exports.forever=forever,exports.groupBy=groupBy,exports.groupByLimit=groupByLimit,exports.groupBySeries=groupBySeries,exports.log=log,exports.map=map,exports.mapLimit=mapLimit,exports.mapSeries=mapSeries,exports.mapValues=mapValues,exports.mapValuesLimit=mapValuesLimit,exports.mapValuesSeries=mapValuesSeries,exports.memoize=memoize,exports.nextTick=nextTick,exports.parallel=parallelLimit,exports.parallelLimit=parallelLimit$1,exports.priorityQueue=priorityQueue,exports.queue=queue$1,exports.race=race,exports.reduce=reduce,exports.reduceRight=reduceRight,exports.reflect=reflect,exports.reflectAll=reflectAll,exports.reject=reject,exports.rejectLimit=rejectLimit,exports.rejectSeries=rejectSeries,exports.retry=retry,exports.retryable=retryable,exports.seq=seq,exports.series=series,exports.setImmediate=setImmediate$1,exports.some=some,exports.someLimit=someLimit,exports.someSeries=someSeries,exports.sortBy=sortBy,exports.timeout=timeout,exports.times=times,exports.timesLimit=timeLimit,exports.timesSeries=timesSeries,exports.transform=transform,exports.tryEach=tryEach,exports.unmemoize=unmemoize,exports.until=until,exports.waterfall=waterfall,exports.whilst=whilst,exports.all=every,exports.allLimit=everyLimit,exports.allSeries=everySeries,exports.any=some,exports.anyLimit=someLimit,exports.anySeries=someSeries,exports.find=detect,exports.findLimit=detectLimit,exports.findSeries=detectSeries,exports.forEach=eachLimit,exports.forEachSeries=eachSeries,exports.forEachLimit=eachLimit$1,exports.forEachOf=eachOf,exports.forEachOfSeries=eachOfSeries,exports.forEachOfLimit=eachOfLimit,exports.inject=reduce,exports.foldl=reduce,exports.foldr=reduceRight,exports.select=filter,exports.selectLimit=filterLimit,exports.selectSeries=filterSeries,exports.wrapSync=asyncify,Object.defineProperty(exports,"__esModule",{value:!0})})}).call(this,require("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:86}],6:[function(require,module,exports){"use strict";function placeHoldersCount(b64){var len=b64.length;if(len%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===b64[len-2]?2:"="===b64[len-1]?1:0}function byteLength(b64){return 3*b64.length/4-placeHoldersCount(b64)}function toByteArray(b64){var i,l,tmp,placeHolders,arr,len=b64.length;placeHolders=placeHoldersCount(b64),arr=new Arr(3*len/4-placeHolders),l=placeHolders>0?len-4:len;var L=0;for(i=0;i<l;i+=4)tmp=revLookup[b64.charCodeAt(i)]<<18|revLookup[b64.charCodeAt(i+1)]<<12|revLookup[b64.charCodeAt(i+2)]<<6|revLookup[b64.charCodeAt(i+3)],arr[L++]=tmp>>16&255,arr[L++]=tmp>>8&255,arr[L++]=255&tmp;return 2===placeHolders?(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[L++]=255&tmp):1===placeHolders&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[L++]=tmp>>8&255,arr[L++]=255&tmp),arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]}function encodeChunk(uint8,start,end){for(var tmp,output=[],i=start;i<end;i+=3)tmp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2],output.push(tripletToBase64(tmp));return output.join("")}function fromByteArray(uint8){for(var tmp,len=uint8.length,extraBytes=len%3,output="",parts=[],i=0,len2=len-extraBytes;i<len2;i+=16383)parts.push(encodeChunk(uint8,i,i+16383>len2?len2:i+16383));return 1===extraBytes?(tmp=uint8[len-1],output+=lookup[tmp>>2],output+=lookup[tmp<<4&63],output+="=="):2===extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],output+=lookup[tmp>>10],output+=lookup[tmp>>4&63],output+=lookup[tmp<<2&63],output+="="),parts.push(output),parts.join("")}exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63},{}],7:[function(require,module,exports){},{}],8:[function(require,module,exports){arguments[4][7][0].apply(exports,arguments)},{dup:7}],9:[function(require,module,exports){(function(global){"use strict";function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()<length)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(that=new Uint8Array(length),that.__proto__=Buffer.prototype):(null===that&&(that=new Buffer(length)),that.length=length),that}function Buffer(arg,encodingOrOffset,length){if(!(Buffer.TYPED_ARRAY_SUPPORT||this instanceof Buffer))return new Buffer(arg,encodingOrOffset,length);if("number"==typeof arg){if("string"==typeof encodingOrOffset)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,arg)}return from(this,arg,encodingOrOffset,length)}function from(that,value,encodingOrOffset,length){if("number"==typeof value)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&value instanceof ArrayBuffer?fromArrayBuffer(that,value,encodingOrOffset,length):"string"==typeof value?fromString(that,value,encodingOrOffset):fromObject(that,value)}function assertSize(size){if("number"!=typeof size)throw new TypeError('"size" argument must be a number');if(size<0)throw new RangeError('"size" argument must not be negative')}function alloc(that,size,fill,encoding){return assertSize(size),size<=0?createBuffer(that,size):void 0!==fill?"string"==typeof encoding?createBuffer(that,size).fill(fill,encoding):createBuffer(that,size).fill(fill):createBuffer(that,size)}function allocUnsafe(that,size){if(assertSize(size),that=createBuffer(that,size<0?0:0|checked(size)),!Buffer.TYPED_ARRAY_SUPPORT)for(var i=0;i<size;++i)that[i]=0;return that}function fromString(that,string,encoding){if("string"==typeof encoding&&""!==encoding||(encoding="utf8"),!Buffer.isEncoding(encoding))throw new TypeError('"encoding" must be a valid string encoding');var length=0|byteLength(string,encoding);that=createBuffer(that,length);var actual=that.write(string,encoding);return actual!==length&&(that=that.slice(0,actual)),that}function fromArrayLike(that,array){var length=array.length<0?0:0|checked(array.length);that=createBuffer(that,length);for(var i=0;i<length;i+=1)that[i]=255&array[i];return that}function fromArrayBuffer(that,array,byteOffset,length){if(array.byteLength,byteOffset<0||array.byteLength<byteOffset)throw new RangeError("'offset' is out of bounds");if(array.byteLength<byteOffset+(length||0))throw new RangeError("'length' is out of bounds");return array=void 0===byteOffset&&void 0===length?new Uint8Array(array):void 0===length?new Uint8Array(array,byteOffset):new Uint8Array(array,byteOffset,length),Buffer.TYPED_ARRAY_SUPPORT?(that=array,that.__proto__=Buffer.prototype):that=fromArrayLike(that,array),that}function fromObject(that,obj){if(Buffer.isBuffer(obj)){var len=0|checked(obj.length);return that=createBuffer(that,len),0===that.length?that:(obj.copy(that,0,0,len),that)}if(obj){if("undefined"!=typeof ArrayBuffer&&obj.buffer instanceof ArrayBuffer||"length"in obj)return"number"!=typeof obj.length||isnan(obj.length)?createBuffer(that,0):fromArrayLike(that,obj);if("Buffer"===obj.type&&isArray(obj.data))return fromArrayLike(that,obj.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(length){if(length>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function SlowBuffer(length){return+length!=length&&(length=0),Buffer.alloc(+length)}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function slowToString(encoding,start,end){var loweredCase=!1;if((void 0===start||start<0)&&(start=0),start>this.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if(end>>>=0,start>>>=0,end<=start)return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):byteOffset>2147483647?byteOffset=2147483647:byteOffset<-2147483648&&(byteOffset=-2147483648),byteOffset=+byteOffset,isNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1),byteOffset<0&&(byteOffset=buffer.length+byteOffset),byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}var indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;indexSize=2,arrLength/=2,
  valLength/=2,byteOffset/=2}var i;if(dir){var foundIndex=-1;for(i=byteOffset;i<arrLength;i++)if(read(arr,i)===read(val,-1===foundIndex?0:i-foundIndex)){if(-1===foundIndex&&(foundIndex=i),i-foundIndex+1===valLength)return foundIndex*indexSize}else-1!==foundIndex&&(i-=i-foundIndex),foundIndex=-1}else for(byteOffset+valLength>arrLength&&(byteOffset=arrLength-valLength),i=byteOffset;i>=0;i--){for(var found=!0,j=0;j<valLength;j++)if(read(arr,i+j)!==read(val,j)){found=!1;break}if(found)return i}return-1}function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;length?(length=Number(length))>remaining&&(length=remaining):length=remaining;var strLen=string.length;if(strLen%2!=0)throw new TypeError("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0;i<length;++i){var parsed=parseInt(string.substr(2*i,2),16);if(isNaN(parsed))return i;buf[offset+i]=parsed}return i}function utf8Write(buf,string,offset,length){return blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length)}function asciiWrite(buf,string,offset,length){return blitBuffer(asciiToBytes(string),buf,offset,length)}function latin1Write(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){return blitBuffer(base64ToBytes(string),buf,offset,length)}function ucs2Write(buf,string,offset,length){return blitBuffer(utf16leToBytes(string,buf.length-offset),buf,offset,length)}function base64Slice(buf,start,end){return 0===start&&end===buf.length?base64.fromByteArray(buf):base64.fromByteArray(buf.slice(start,end))}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);for(var res=[],i=start;i<end;){var firstByte=buf[i],codePoint=null,bytesPerSequence=firstByte>239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:firstByte<128&&(codePoint=firstByte);break;case 2:secondByte=buf[i+1],128==(192&secondByte)&&(tempCodePoint=(31&firstByte)<<6|63&secondByte)>127&&(codePoint=tempCodePoint);break;case 3:secondByte=buf[i+1],thirdByte=buf[i+2],128==(192&secondByte)&&128==(192&thirdByte)&&(tempCodePoint=(15&firstByte)<<12|(63&secondByte)<<6|63&thirdByte)>2047&&(tempCodePoint<55296||tempCodePoint>57343)&&(codePoint=tempCodePoint);break;case 4:secondByte=buf[i+1],thirdByte=buf[i+2],fourthByte=buf[i+3],128==(192&secondByte)&&128==(192&thirdByte)&&128==(192&fourthByte)&&(tempCodePoint=(15&firstByte)<<18|(63&secondByte)<<12|(63&thirdByte)<<6|63&fourthByte)>65535&&tempCodePoint<1114112&&(codePoint=tempCodePoint)}}null===codePoint?(codePoint=65533,bytesPerSequence=1):codePoint>65535&&(codePoint-=65536,res.push(codePoint>>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return decodeCodePointsArray(res)}function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);for(var res="",i=0;i<len;)res+=String.fromCharCode.apply(String,codePoints.slice(i,i+=MAX_ARGUMENTS_LENGTH));return res}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i)ret+=String.fromCharCode(127&buf[i]);return ret}function latin1Slice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i)ret+=String.fromCharCode(buf[i]);return ret}function hexSlice(buf,start,end){var len=buf.length;(!start||start<0)&&(start=0),(!end||end<0||end>len)&&(end=len);for(var out="",i=start;i<end;++i)out+=toHex(buf[i]);return out}function utf16leSlice(buf,start,end){for(var bytes=buf.slice(start,end),res="",i=0;i<bytes.length;i+=2)res+=String.fromCharCode(bytes[i]+256*bytes[i+1]);return res}function checkOffset(offset,ext,length){if(offset%1!=0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||value<min)throw new RangeError('"value" argument is out of bounds');if(offset+ext>buf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){value<0&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i<j;++i)buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){value<0&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i<j;++i)buf[offset+i]=value>>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}function base64clean(str){if(str=stringtrim(str).replace(INVALID_BASE64_RE,""),str.length<2)return"";for(;str.length%4!=0;)str+="=";return str}function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}function toHex(n){return n<16?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(string,units){units=units||1/0;for(var codePoint,length=string.length,leadSurrogate=null,bytes=[],i=0;i<length;++i){if((codePoint=string.charCodeAt(i))>55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){(units-=3)>-1&&bytes.push(239,191,189);continue}if(i+1===length){(units-=3)>-1&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){(units-=3)>-1&&bytes.push(239,191,189),leadSurrogate=codePoint;continue}codePoint=65536+(leadSurrogate-55296<<10|codePoint-56320)}else leadSurrogate&&(units-=3)>-1&&bytes.push(239,191,189);if(leadSurrogate=null,codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function asciiToBytes(str){for(var byteArray=[],i=0;i<str.length;++i)byteArray.push(255&str.charCodeAt(i));return byteArray}function utf16leToBytes(str,units){for(var c,hi,lo,byteArray=[],i=0;i<str.length&&!((units-=2)<0);++i)c=str.charCodeAt(i),hi=c>>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i<length&&!(i+offset>=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}function isnan(val){return val!==val}var base64=require("base64-js"),ieee754=require("ieee754"),isArray=require("isarray");exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==global.TYPED_ARRAY_SUPPORT?global.TYPED_ARRAY_SUPPORT:function(){try{var arr=new Uint8Array(1);return arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===arr.foo()&&"function"==typeof arr.subarray&&0===arr.subarray(1,1).byteLength}catch(e){return!1}}(),exports.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(arr){return arr.__proto__=Buffer.prototype,arr},Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(size,fill,encoding){return alloc(null,size,fill,encoding)},Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)},Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)},Buffer.isBuffer=function(b){return!(null==b||!b._isBuffer)},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i<len;++i)if(a[i]!==b[i]){x=a[i],y=b[i];break}return x<y?-1:y<x?1:0},Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(list,length){if(!isArray(list))throw new TypeError('"list" argument must be an Array of Buffers');if(0===list.length)return Buffer.alloc(0);var i;if(void 0===length)for(length=0,i=0;i<list.length;++i)length+=list[i].length;var buffer=Buffer.allocUnsafe(length),pos=0;for(i=0;i<list.length;++i){var buf=list[i];if(!Buffer.isBuffer(buf))throw new TypeError('"list" argument must be an Array of Buffers');buf.copy(buffer,pos),pos+=buf.length}return buffer},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var len=this.length;if(len%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<len;i+=2)swap(this,i,i+1);return this},Buffer.prototype.swap32=function(){var len=this.length;if(len%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<len;i+=4)swap(this,i,i+3),swap(this,i+1,i+2);return this},Buffer.prototype.swap64=function(){var len=this.length;if(len%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<len;i+=8)swap(this,i,i+7),swap(this,i+1,i+6),swap(this,i+2,i+5),swap(this,i+3,i+4);return this},Buffer.prototype.toString=function(){var length=0|this.length;return 0===length?"":0===arguments.length?utf8Slice(this,0,length):slowToString.apply(this,arguments)},Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||0===Buffer.compare(this,b)},Buffer.prototype.inspect=function(){var str="",max=exports.INSPECT_MAX_BYTES;return this.length>0&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... ")),"<Buffer "+str+">"},Buffer.prototype.compare=function(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;if(start>>>=0,end>>>=0,thisStart>>>=0,thisEnd>>>=0,this===target)return 0;for(var x=thisEnd-thisStart,y=end-start,len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;i<len;++i)if(thisCopy[i]!==targetCopy[i]){x=thisCopy[i],y=targetCopy[i];break}return x<y?-1:y<x?1:0},Buffer.prototype.includes=function(val,byteOffset,encoding){return-1!==this.indexOf(val,byteOffset,encoding)},Buffer.prototype.indexOf=function(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!0)},Buffer.prototype.lastIndexOf=function(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!1)},Buffer.prototype.write=function(string,offset,length,encoding){if(void 0===offset)encoding="utf8",length=this.length,offset=0;else if(void 0===length&&"string"==typeof offset)encoding=offset,length=this.length,offset=0;else{if(!isFinite(offset))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");offset|=0,isFinite(length)?(length|=0,void 0===encoding&&(encoding="utf8")):(encoding=length,length=void 0)}var remaining=this.length-offset;if((void 0===length||length>remaining)&&(length=remaining),string.length>0&&(length<0||offset<0)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start,end=void 0===end?len:~~end,start<0?(start+=len)<0&&(start=0):start>len&&(start=len),end<0?(end+=len)<0&&(end=0):end>len&&(end=len),end<start&&(end=start);var newBuf;if(Buffer.TYPED_ARRAY_SUPPORT)newBuf=this.subarray(start,end),newBuf.__proto__=Buffer.prototype;else{var sliceLen=end-start;newBuf=new Buffer(sliceLen,void 0);for(var i=0;i<sliceLen;++i)newBuf[i]=this[i+start]}return newBuf},Buffer.prototype.readUIntLE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i<byteLength&&(mul*=256);)val+=this[offset+i]*mul;return val},Buffer.prototype.readUIntBE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset+--byteLength],mul=1;byteLength>0&&(mul*=256);)val+=this[offset+--byteLength]*mul;return val},Buffer.prototype.readUInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i<byteLength&&(mul*=256);)val+=this[offset+i]*mul;return mul*=128,val>=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var i=byteLength,mul=1,val=this[offset+--i];i>0&&(mul*=256);)val+=this[offset+--i]*mul;return mul*=128,val>=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),128&this[offset]?-1*(255-this[offset]+1):this[offset]},Buffer.prototype.readInt16LE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!1,52,8)},Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,byteLength|=0,!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0)}var mul=1,i=0;for(this[offset]=255&value;++i<byteLength&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,byteLength|=0,!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0)}var i=byteLength-1,mul=1;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),this[offset]=255&value,offset+1},Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i<byteLength&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i-1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),end>0&&end<start&&(end=start),end===start)return 0;if(0===target.length||0===this.length)return 0;if(targetStart<0)throw new RangeError("targetStart out of bounds");if(start<0||start>=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart<end-start&&(end=target.length-targetStart+start);var i,len=end-start;if(this===target&&start<targetStart&&targetStart<end)for(i=len-1;i>=0;--i)target[i+targetStart]=this[i+start];else if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i<len;++i)target[i+targetStart]=this[i+start];else Uint8Array.prototype.set.call(target,this.subarray(start,start+len),targetStart);return len},Buffer.prototype.fill=function(val,start,end,encoding){if("string"==typeof val){if("string"==typeof start?(encoding=start,start=0,end=this.length):"string"==typeof end&&(encoding=end,end=this.length),1===val.length){var code=val.charCodeAt(0);code<256&&(val=code)}if(void 0!==encoding&&"string"!=typeof encoding)throw new TypeError("encoding must be a string");if("string"==typeof encoding&&!Buffer.isEncoding(encoding))throw new TypeError("Unknown encoding: "+encoding)}else"number"==typeof val&&(val&=255);if(start<0||this.length<start||this.length<end)throw new RangeError("Out of range index");if(end<=start)return this;start>>>=0,end=void 0===end?this.length:end>>>0,val||(val=0);var i;if("number"==typeof val)for(i=start;i<end;++i)this[i]=val;else{var bytes=Buffer.isBuffer(val)?val:utf8ToBytes(new Buffer(val,encoding).toString()),len=bytes.length;for(i=0;i<end-start;++i)this[i+start]=bytes[i%len]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":6,ieee754:40,isarray:44}],10:[function(require,module,exports){(function(Buffer,process){function objCopy(obj){if(null==obj)return obj;if(Array.isArray(obj))return obj.slice();if("object"==typeof obj){var copy={};return Object.keys(obj).forEach(function(k){copy[k]=obj[k]}),copy}return obj}function getCaller3Info(){if(void 0!==this){var obj={},saveLimit=Error.stackTraceLimit,savePrepare=Error.prepareStackTrace;return Error.stackTraceLimit=3,Error.prepareStackTrace=function(_,stack){var caller=stack[2];sourceMapSupport&&(caller=sourceMapSupport.wrapCallSite(caller)),obj.file=caller.getFileName(),obj.line=caller.getLineNumber();var func=caller.getFunctionName();func&&(obj.func=func)},Error.captureStackTrace(this,getCaller3Info),this.stack,Error.stackTraceLimit=saveLimit,Error.prepareStackTrace=savePrepare,obj}}function _indent(s,indent){return indent||(indent="    "),indent+s.split(/\r?\n/g).join("\n"+indent)}function _warn(msg,dedupKey){if(assert.ok(msg),dedupKey){if(_warned[dedupKey])return;_warned[dedupKey]=!0}process.stderr.write(msg+"\n")}function _haveWarned(dedupKey){return _warned[dedupKey]}function ConsoleRawStream(){}function resolveLevel(nameOrNum){var level,type=typeof nameOrNum;if("string"===type){if(!(level=levelFromName[nameOrNum.toLowerCase()]))throw new Error(format('unknown level name: "%s"',nameOrNum))}else{if("number"!==type)throw new TypeError(format("cannot resolve level: invalid arg (%s):",type,nameOrNum));if(nameOrNum<0||Math.floor(nameOrNum)!==nameOrNum)throw new TypeError(format("level is not a positive integer: %s",nameOrNum));level=nameOrNum}return level}function isWritable(obj){return obj instanceof stream.Writable||"function"==typeof obj.write}function Logger(options,_childOptions,_childSimple){if(xxx("Logger start:",options),!(this instanceof Logger))return new Logger(options,_childOptions);var parent;if(void 0!==_childOptions&&(parent=options,options=_childOptions,!(parent instanceof Logger)))throw new TypeError("invalid Logger creation: do not pass a second arg");if(!options)throw new TypeError("options (object) is required");if(parent){if(options.name)throw new TypeError("invalid options.name: child cannot set logger name")}else if(!options.name)throw new TypeError("options.name (string) is required");if(options.stream&&options.streams)throw new TypeError('cannot mix "streams" and "stream" options');if(options.streams&&!Array.isArray(options.streams))throw new TypeError("invalid options.streams: must be an array");if(options.serializers&&("object"!=typeof options.serializers||Array.isArray(options.serializers)))throw new TypeError("invalid options.serializers: must be an object");if(EventEmitter.call(this),parent&&_childSimple){this._isSimpleChild=!0,this._level=parent._level,this.streams=parent.streams,this.serializers=parent.serializers,this.src=parent.src;for(var fields=this.fields={},parentFieldNames=Object.keys(parent.fields),i=0;i<parentFieldNames.length;i++){var name=parentFieldNames[i];fields[name]=parent.fields[name]}for(var names=Object.keys(options),i=0;i<names.length;i++){var name=names[i];fields[name]=options[name]}}else{var self=this;if(parent){this._level=parent._level,this.streams=[];for(var i=0;i<parent.streams.length;i++){var s=objCopy(parent.streams[i]);s.closeOnExit=!1,this.streams.push(s)}this.serializers=objCopy(parent.serializers),this.src=parent.src,this.fields=objCopy(parent.fields),options.level&&this.level(options.level)}else this._level=Number.POSITIVE_INFINITY,this.streams=[],this.serializers=null,this.src=!1,this.fields={};if(!dtp&&dtrace){dtp=dtrace.createDTraceProvider("bunyan");for(var level in levelFromName){var probe;probes[levelFromName[level]]=probe=dtp.addProbe("log-"+level,"char *"),probe.dtp=dtp}dtp.enable()}options.stream?self.addStream({type:"stream",stream:options.stream,closeOnExit:!1,level:options.level}):options.streams?options.streams.forEach(function(s){self.addStream(s,options.level)}):parent&&options.level?this.level(options.level):parent||("browser"===runtimeEnv?self.addStream({type:"raw",stream:new ConsoleRawStream,closeOnExit:!1,level:options.level}):self.addStream({type:"stream",stream:process.stdout,closeOnExit:!1,level:options.level})),options.serializers&&self.addSerializers(options.serializers),options.src&&(this.src=!0),xxx("Logger: ",self);var fields=objCopy(options);delete fields.stream,delete fields.level,delete fields.streams,delete fields.serializers,delete fields.src,this.serializers&&this._applySerializers(fields),fields.hostname||self.fields.hostname||(fields.hostname=os.hostname()),fields.pid||(fields.pid=process.pid),Object.keys(fields).forEach(function(k){self.fields[k]=fields[k]})}}function mkRecord(log,minLevel,args){var excludeFields,fields,msgArgs;args[0]instanceof Error?(fields={err:log.serializers&&log.serializers.err?log.serializers.err(args[0]):Logger.stdSerializers.err(args[0])},excludeFields={err:!0},msgArgs=1===args.length?[fields.err.message]:args.slice(1)):"object"!=typeof args[0]||Array.isArray(args[0])?(fields=null,msgArgs=args.slice()):Buffer.isBuffer(args[0])?(fields=null,msgArgs=args.slice(),msgArgs[0]=util.inspect(msgArgs[0])):(fields=args[0],msgArgs=fields&&1===args.length&&fields.err&&fields.err instanceof Error?[fields.err.message]:args.slice(1));var rec=objCopy(log.fields),recFields=(rec.level=minLevel,fields?objCopy(fields):null);return recFields&&(log.serializers&&log._applySerializers(recFields,excludeFields),Object.keys(recFields).forEach(function(k){rec[k]=recFields[k]})),rec.msg=format.apply(log,msgArgs),rec.time||(rec.time=new Date),log.src&&!rec.src&&(rec.src=getCaller3Info()),rec.v=LOG_VERSION,rec}function mkProbeArgs(str,log,minLevel,msgArgs){return[str||log._emit(mkRecord(log,minLevel,msgArgs),!0)]}function mkLogEmitter(minLevel){return function(){var log=this,str=null,rec=null;if(this._emit){if(0===arguments.length)return this._level<=minLevel;for(var msgArgs=new Array(arguments.length),i=0;i<msgArgs.length;++i)msgArgs[i]=arguments[i];this._level<=minLevel&&(rec=mkRecord(log,minLevel,msgArgs),str=this._emit(rec)),probes&&probes[minLevel].fire(mkProbeArgs,str,log,minLevel,msgArgs)}else{if(!_haveWarned.unbound){var caller=getCaller3Info();_warn(format("bunyan usage error: %s:%s: attempt to log with an unbound log method: `this` is: %s",caller.file,caller.line,util.inspect(this)),"unbound")}}}}function getFullErrorStack(ex){var ret=ex.stack||ex.toString();if(ex.cause&&"function"==typeof ex.cause){var cex=ex.cause();cex&&(ret+="\nCaused by: "+getFullErrorStack(cex))}return ret}function safeCyclesSet(){var seen=new Set;return function(key,val){return val&&"object"==typeof val?seen.has(val)?"[Circular]":(seen.add(val),val):val}}function safeCyclesArray(){var seen=[];return function(key,val){return val&&"object"==typeof val?-1!==seen.indexOf(val)?"[Circular]":(seen.push(val),val):val}}function fastAndSafeJsonStringify(rec){try{return JSON.stringify(rec)}catch(ex){try{return JSON.stringify(rec,safeCycles())}catch(e){if(safeJsonStringify)return safeJsonStringify(rec);var dedupKey=e.stack.split(/\n/g,3).join("\n");return _warn('bunyan: ERROR: Exception in `JSON.stringify(rec)`. You can install the "safe-json-stringify" module to have Bunyan fallback to safer stringification. Record:\n'+_indent(format("%s\n%s",util.inspect(rec),e.stack)),dedupKey),format("(Exception in JSON.stringify(rec): %j. See stderr for details.)",e.message)}}}function RingBuffer(options){this.limit=options&&options.limit?options.limit:100,this.writable=!0,this.records=[],EventEmitter.call(this)}var runtimeEnv,LOG_VERSION=0,xxx=function(s){var args=["XXX: "+s].concat(Array.prototype.slice.call(arguments,1));console.error.apply(this,args)},xxx=function(){};if(void 0!==process&&process.versions&&(process.versions.nw?runtimeEnv="nw":process.versions.node&&(runtimeEnv="node")),runtimeEnv||"undefined"==typeof window||window.window!==window||(runtimeEnv="browser"),!runtimeEnv)throw new Error("unknown runtime environment");var os,fs,dtrace;if("browser"===runtimeEnv)os={hostname:function(){return window.location.host}},fs={},dtrace=null;else{os=require("os"),fs=require("fs");try{dtrace=require("dtrace-provider")}catch(e){dtrace=null}}
  var util=require("util"),assert=require("assert"),EventEmitter=require("events").EventEmitter,stream=require("stream");try{var safeJsonStringify=require("safe-json-stringify")}catch(e){safeJsonStringify=null}process.env.BUNYAN_TEST_NO_SAFE_JSON_STRINGIFY&&(safeJsonStringify=null);try{var mv=require("mv")}catch(e){mv=null}try{var sourceMapSupport=require("source-map-support")}catch(_){sourceMapSupport=null}var format=util.format;if(!format){var inspect=util.inspect,formatRegExp=/%[sdj%]/g;format=function(f){if("string"!=typeof f){for(var objects=[],i=0;i<arguments.length;i++)objects.push(inspect(arguments[i]));return objects.join(" ")}for(var i=1,args=arguments,len=args.length,str=String(f).replace(formatRegExp,function(x){if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":return fastAndSafeJsonStringify(args[i++]);case"%%":return"%";default:return x}}),x=args[i];i<len;x=args[++i])str+=null===x||"object"!=typeof x?" "+x:" "+inspect(x);return str}}var _warned={};ConsoleRawStream.prototype.write=function(rec){rec.level<INFO?console.log(rec):rec.level<WARN?console.info(rec):rec.level<ERROR?console.warn(rec):console.error(rec)};var INFO=30,WARN=40,ERROR=50,levelFromName={trace:10,debug:20,info:INFO,warn:WARN,error:ERROR,fatal:60},nameFromLevel={};Object.keys(levelFromName).forEach(function(name){nameFromLevel[levelFromName[name]]=name});var dtp=void 0,probes=dtrace&&{};util.inherits(Logger,EventEmitter),Logger.prototype.addStream=function(s,defaultLevel){var self=this;switch(null!==defaultLevel&&void 0!==defaultLevel||(defaultLevel=INFO),s=objCopy(s),s.type||(s.stream?s.type="stream":s.path&&(s.type="file")),s.raw="raw"===s.type,void 0!==s.level?s.level=resolveLevel(s.level):s.level=resolveLevel(defaultLevel),s.level<self._level&&(self._level=s.level),s.type){case"stream":assert.ok(isWritable(s.stream),'"stream" stream is not writable: '+util.inspect(s.stream)),s.closeOnExit||(s.closeOnExit=!1);break;case"file":void 0===s.reemitErrorEvents&&(s.reemitErrorEvents=!0),s.stream?s.closeOnExit||(s.closeOnExit=!1):(s.stream=fs.createWriteStream(s.path,{flags:"a",encoding:"utf8"}),s.closeOnExit||(s.closeOnExit=!0));break;case"rotating-file":assert.ok(!s.stream,'"rotating-file" stream should not give a "stream"'),assert.ok(s.path),assert.ok(mv,'"rotating-file" stream type is not supported: missing "mv" module'),s.stream=new RotatingFileStream(s),s.closeOnExit||(s.closeOnExit=!0);break;case"raw":s.closeOnExit||(s.closeOnExit=!1);break;default:throw new TypeError('unknown stream type "'+s.type+'"')}s.reemitErrorEvents&&"function"==typeof s.stream.on&&s.stream.on("error",function(err){self.emit("error",err,s)}),self.streams.push(s),delete self.haveNonRawStreams},Logger.prototype.addSerializers=function(serializers){var self=this;self.serializers||(self.serializers={}),Object.keys(serializers).forEach(function(field){var serializer=serializers[field];if("function"!=typeof serializer)throw new TypeError(format('invalid serializer for "%s" field: must be a function',field));self.serializers[field]=serializer})},Logger.prototype.child=function(options,simple){return new this.constructor(this,options||{},simple)},Logger.prototype.reopenFileStreams=function(){var self=this;self.streams.forEach(function(s){"file"===s.type&&(s.stream&&(s.stream.end(),s.stream.destroySoon(),delete s.stream),s.stream=fs.createWriteStream(s.path,{flags:"a",encoding:"utf8"}),s.stream.on("error",function(err){self.emit("error",err,s)}))})},Logger.prototype.level=function(value){if(void 0===value)return this._level;for(var newLevel=resolveLevel(value),len=this.streams.length,i=0;i<len;i++)this.streams[i].level=newLevel;this._level=newLevel},Logger.prototype.levels=function(name,value){if(void 0===name)return assert.equal(value,void 0),this.streams.map(function(s){return s.level});var stream;if("number"==typeof name){if(void 0===(stream=this.streams[name]))throw new Error("invalid stream index: "+name)}else{for(var len=this.streams.length,i=0;i<len;i++){var s=this.streams[i];if(s.name===name){stream=s;break}}if(!stream)throw new Error(format('no stream with name "%s"',name))}if(void 0===value)return stream.level;var newLevel=resolveLevel(value);stream.level=newLevel,newLevel<this._level&&(this._level=newLevel)},Logger.prototype._applySerializers=function(fields,excludeFields){var self=this;xxx("_applySerializers: excludeFields",excludeFields),Object.keys(this.serializers).forEach(function(name){if(!(void 0===fields[name]||excludeFields&&excludeFields[name])){xxx('_applySerializers; apply to "%s" key',name);try{fields[name]=self.serializers[name](fields[name])}catch(err){_warn(format('bunyan: ERROR: Exception thrown from the "%s" Bunyan serializer. This should never happen. This is a bug in that serializer function.\n%s',name,err.stack||err)),fields[name]=format('(Error in Bunyan log "%s" serializer broke field. See stderr for details.)',name)}}})},Logger.prototype._emit=function(rec,noemit){var i;if(void 0===this.haveNonRawStreams)for(this.haveNonRawStreams=!1,i=0;i<this.streams.length;i++)if(!this.streams[i].raw){this.haveNonRawStreams=!0;break}var str;if((noemit||this.haveNonRawStreams)&&(str=fastAndSafeJsonStringify(rec)+"\n"),noemit)return str;var level=rec.level;for(i=0;i<this.streams.length;i++){var s=this.streams[i];s.level<=level&&(xxx('writing log rec "%s" to "%s" stream (%d <= %d): %j',rec.msg,s.type,s.level,level,rec),s.stream.write(s.raw?rec:str))}return str},Logger.prototype.trace=mkLogEmitter(10),Logger.prototype.debug=mkLogEmitter(20),Logger.prototype.info=mkLogEmitter(INFO),Logger.prototype.warn=mkLogEmitter(WARN),Logger.prototype.error=mkLogEmitter(ERROR),Logger.prototype.fatal=mkLogEmitter(60),Logger.stdSerializers={},Logger.stdSerializers.req=function(req){return req&&req.connection?{method:req.method,url:req.url,headers:req.headers,remoteAddress:req.connection.remoteAddress,remotePort:req.connection.remotePort}:req},Logger.stdSerializers.res=function(res){return res&&res.statusCode?{statusCode:res.statusCode,header:res._header}:res};var safeCycles=(Logger.stdSerializers.err=function(err){return err&&err.stack?{message:err.message,name:err.name,stack:getFullErrorStack(err),code:err.code,signal:err.signal}:err},"undefined"!=typeof Set?safeCyclesSet:safeCyclesArray),RotatingFileStream=null;mv&&(RotatingFileStream=function(options){if(this.path=options.path,this.count=null==options.count?10:options.count,assert.equal(typeof this.count,"number",format('rotating-file stream "count" is not a number: %j (%s) in %j',this.count,typeof this.count,this)),assert.ok(this.count>=0,format('rotating-file stream "count" is not >= 0: %j in %j',this.count,this)),options.period){var period={hourly:"1h",daily:"1d",weekly:"1w",monthly:"1m",yearly:"1y"}[options.period]||options.period,m=/^([1-9][0-9]*)([hdwmy]|ms)$/.exec(period);if(!m)throw new Error(format('invalid period: "%s"',options.period));this.periodNum=Number(m[1]),this.periodScope=m[2]}else this.periodNum=1,this.periodScope="d";var lastModified=null;try{lastModified=fs.statSync(this.path).mtime.getTime()}catch(err){}var rotateAfterOpen=!1;if(lastModified){lastModified<this._calcRotTime(0)&&(rotateAfterOpen=!0)}this.stream=fs.createWriteStream(this.path,{flags:"a",encoding:"utf8"}),this.rotQueue=[],this.rotating=!1,rotateAfterOpen?(this._debug("rotateAfterOpen -> call rotate()"),this.rotate()):this._setupNextRot()},util.inherits(RotatingFileStream,EventEmitter),RotatingFileStream.prototype._debug=function(){return!1},RotatingFileStream.prototype._setupNextRot=function(){this.rotAt=this._calcRotTime(1),this._setRotationTimer()},RotatingFileStream.prototype._setRotationTimer=function(){var self=this,delay=this.rotAt-Date.now();delay>2147483647&&(delay=2147483647),this.timeout=setTimeout(function(){self._debug("_setRotationTimer timeout -> call rotate()"),self.rotate()},delay),"function"==typeof this.timeout.unref&&this.timeout.unref()},RotatingFileStream.prototype._calcRotTime=function(periodOffset){this._debug("_calcRotTime: %s%s",this.periodNum,this.periodScope);var d=new Date;this._debug("  now local: %s",d),this._debug("    now utc: %s",d.toISOString());var rotAt;switch(this.periodScope){case"ms":rotAt=this.rotAt?this.rotAt+this.periodNum*periodOffset:Date.now()+this.periodNum*periodOffset;break;case"h":rotAt=this.rotAt?this.rotAt+60*this.periodNum*60*1e3*periodOffset:Date.UTC(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate(),d.getUTCHours()+periodOffset);break;case"d":rotAt=this.rotAt?this.rotAt+24*this.periodNum*60*60*1e3*periodOffset:Date.UTC(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()+periodOffset);break;case"w":if(this.rotAt)rotAt=this.rotAt+7*this.periodNum*24*60*60*1e3*periodOffset;else{var dayOffset=7-d.getUTCDay();periodOffset<1&&(dayOffset=-d.getUTCDay()),(periodOffset>1||periodOffset<-1)&&(dayOffset+=7*periodOffset),rotAt=Date.UTC(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()+dayOffset)}break;case"m":rotAt=this.rotAt?Date.UTC(d.getUTCFullYear(),d.getUTCMonth()+this.periodNum*periodOffset,1):Date.UTC(d.getUTCFullYear(),d.getUTCMonth()+periodOffset,1);break;case"y":rotAt=this.rotAt?Date.UTC(d.getUTCFullYear()+this.periodNum*periodOffset,0,1):Date.UTC(d.getUTCFullYear()+periodOffset,0,1);break;default:assert.fail(format('invalid period scope: "%s"',this.periodScope))}if(this._debug()){this._debug("  **rotAt**: %s (utc: %s)",rotAt,new Date(rotAt).toUTCString());var now=Date.now();this._debug("        now: %s (%sms == %smin == %sh to go)",now,rotAt-now,(rotAt-now)/1e3/60,(rotAt-now)/1e3/60/60)}return rotAt},RotatingFileStream.prototype.rotate=function(){function moves(){if(0===self.count||n<0)return finish();var before=self.path,after=self.path+"."+String(n);n>0&&(before+="."+String(n-1)),n-=1,fs.exists(before,function(exists){exists?(self._debug("  mv %s %s",before,after),mv(before,after,function(mvErr){mvErr?(self.emit("error",mvErr),finish()):moves()})):moves()})}function finish(){self._debug("  open %s",self.path),self.stream=fs.createWriteStream(self.path,{flags:"a",encoding:"utf8"});for(var q=self.rotQueue,len=q.length,i=0;i<len;i++)self.stream.write(q[i]);self.rotQueue=[],self.rotating=!1,self.emit("drain"),self._setupNextRot()}var self=this;if(self.rotAt&&self.rotAt>Date.now())return self._setRotationTimer();if(this._debug("rotate"),self.rotating)throw new TypeError("cannot start a rotation when already rotating");self.rotating=!0,self.stream.end();var n=this.count;!function(){var toDel=self.path+"."+String(n-1);0===n&&(toDel=self.path),n-=1,self._debug("  rm %s",toDel),fs.unlink(toDel,function(delErr){moves()})}()},RotatingFileStream.prototype.write=function(s){return this.rotating?(this.rotQueue.push(s),!1):this.stream.write(s)},RotatingFileStream.prototype.end=function(s){this.stream.end()},RotatingFileStream.prototype.destroy=function(s){this.stream.destroy()},RotatingFileStream.prototype.destroySoon=function(s){this.stream.destroySoon()}),util.inherits(RingBuffer,EventEmitter),RingBuffer.prototype.write=function(record){if(!this.writable)throw new Error("RingBuffer has been ended already");return this.records.push(record),this.records.length>this.limit&&this.records.shift(),!0},RingBuffer.prototype.end=function(){arguments.length>0&&this.write.apply(this,Array.prototype.slice.call(arguments)),this.writable=!1},RingBuffer.prototype.destroy=function(){this.writable=!1,this.emit("close")},RingBuffer.prototype.destroySoon=function(){this.destroy()},module.exports=Logger,module.exports.TRACE=10,module.exports.DEBUG=20,module.exports.INFO=INFO,module.exports.WARN=WARN,module.exports.ERROR=ERROR,module.exports.FATAL=60,module.exports.resolveLevel=resolveLevel,module.exports.levelFromName=levelFromName,module.exports.nameFromLevel=nameFromLevel,module.exports.VERSION="1.8.10",module.exports.LOG_VERSION=LOG_VERSION,module.exports.createLogger=function(options){return new Logger(options)},module.exports.RingBuffer=RingBuffer,module.exports.RotatingFileStream=RotatingFileStream,module.exports.safeCycles=safeCycles}).call(this,{isBuffer:require("../../is-buffer/index.js")},require("_process"))},{"../../is-buffer/index.js":43,_process:86,assert:4,events:38,fs:8,os:84,"safe-json-stringify":104,stream:127,util:137}],11:[function(require,module,exports){(function(Buffer){function isArray(arg){return Array.isArray?Array.isArray(arg):"[object Array]"===objectToString(arg)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return"[object Date]"===objectToString(d)}function isError(e){return"[object Error]"===objectToString(e)||e instanceof Error}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg}function objectToString(o){return Object.prototype.toString.call(o)}exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=Buffer.isBuffer}).call(this,{isBuffer:require("../../is-buffer/index.js")})},{"../../is-buffer/index.js":43}],12:[function(require,module,exports){function DeferredIterator(options){AbstractIterator.call(this,options),this._options=options,this._iterator=null,this._operations=[]}var util=require("util"),AbstractIterator=require("abstract-leveldown").AbstractIterator;util.inherits(DeferredIterator,AbstractIterator),DeferredIterator.prototype.setDb=function(db){var it=this._iterator=db.iterator(this._options);this._operations.forEach(function(op){it[op.method].apply(it,op.args)})},DeferredIterator.prototype._operation=function(method,args){if(this._iterator)return this._iterator[method].apply(this._iterator,args);this._operations.push({method:method,args:args})},"next end".split(" ").forEach(function(m){DeferredIterator.prototype["_"+m]=function(){this._operation(m,arguments)}}),module.exports=DeferredIterator},{"abstract-leveldown":17,util:137}],13:[function(require,module,exports){(function(Buffer,process){function DeferredLevelDOWN(location){AbstractLevelDOWN.call(this,"string"==typeof location?location:""),this._db=void 0,this._operations=[],this._iterators=[]}var util=require("util"),AbstractLevelDOWN=require("abstract-leveldown").AbstractLevelDOWN,DeferredIterator=require("./deferred-iterator");util.inherits(DeferredLevelDOWN,AbstractLevelDOWN),DeferredLevelDOWN.prototype.setDb=function(db){this._db=db,this._operations.forEach(function(op){db[op.method].apply(db,op.args)}),this._iterators.forEach(function(it){it.setDb(db)})},DeferredLevelDOWN.prototype._open=function(options,callback){return process.nextTick(callback)},DeferredLevelDOWN.prototype._operation=function(method,args){if(this._db)return this._db[method].apply(this._db,args);this._operations.push({method:method,args:args})},"put get del batch approximateSize".split(" ").forEach(function(m){DeferredLevelDOWN.prototype["_"+m]=function(){this._operation(m,arguments)}}),DeferredLevelDOWN.prototype._isBuffer=function(obj){return Buffer.isBuffer(obj)},DeferredLevelDOWN.prototype._iterator=function(options){if(this._db)return this._db.iterator.apply(this._db,arguments);var it=new DeferredIterator(options);return this._iterators.push(it),it},module.exports=DeferredLevelDOWN,module.exports.DeferredIterator=DeferredIterator}).call(this,{isBuffer:require("../is-buffer/index.js")},require("_process"))},{"../is-buffer/index.js":43,"./deferred-iterator":12,_process:86,"abstract-leveldown":17,util:137}],14:[function(require,module,exports){(function(process){function AbstractChainedBatch(db){this._db=db,this._operations=[],this._written=!1}AbstractChainedBatch.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},AbstractChainedBatch.prototype.put=function(key,value){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),this._db._isBuffer(value)||(value=String(value)),"function"==typeof this._put?this._put(key,value):this._operations.push({type:"put",key:key,value:value}),this},AbstractChainedBatch.prototype.del=function(key){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),"function"==typeof this._del?this._del(key):this._operations.push({type:"del",key:key}),this},AbstractChainedBatch.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},AbstractChainedBatch.prototype.write=function(options,callback){if(this._checkWritten(),"function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("write() requires a callback argument");return"object"!=typeof options&&(options={}),this._written=!0,"function"==typeof this._write?this._write(callback):"function"==typeof this._db._batch?this._db._batch(this._operations,options,callback):void process.nextTick(callback)},module.exports=AbstractChainedBatch}).call(this,require("_process"))},{_process:86}],15:[function(require,module,exports){(function(process){function AbstractIterator(db){this.db=db,this._ended=!1,this._nexting=!1}AbstractIterator.prototype.next=function(callback){var self=this;if("function"!=typeof callback)throw new Error("next() requires a callback argument");return self._ended?callback(new Error("cannot call next() after end()")):self._nexting?callback(new Error("cannot call next() before previous next() has completed")):(self._nexting=!0,"function"==typeof self._next?self._next(function(){self._nexting=!1,callback.apply(null,arguments)}):void process.nextTick(function(){self._nexting=!1,callback()}))},AbstractIterator.prototype.end=function(callback){if("function"!=typeof callback)throw new Error("end() requires a callback argument");return this._ended?callback(new Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(callback):void process.nextTick(callback))},module.exports=AbstractIterator}).call(this,require("_process"))},{_process:86}],16:[function(require,module,exports){(function(Buffer,process){function AbstractLevelDOWN(location){if(!arguments.length||void 0===location)throw new Error("constructor requires at least a location argument");if("string"!=typeof location)throw new Error("constructor requires a location string argument");this.location=location,this.status="new"}var xtend=require("xtend"),AbstractIterator=require("./abstract-iterator"),AbstractChainedBatch=require("./abstract-chained-batch");AbstractLevelDOWN.prototype.open=function(options,callback){var self=this,oldStatus=this.status;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("open() requires a callback argument");"object"!=typeof options&&(options={}),options.createIfMissing=0!=options.createIfMissing,options.errorIfExists=!!options.errorIfExists,"function"==typeof this._open?(this.status="opening",this._open(options,function(err){if(err)return self.status=oldStatus,callback(err);self.status="open",callback()})):(this.status="open",process.nextTick(callback))},AbstractLevelDOWN.prototype.close=function(callback){var self=this,oldStatus=this.status;if("function"!=typeof callback)throw new Error("close() requires a callback argument");"function"==typeof this._close?(this.status="closing",this._close(function(err){if(err)return self.status=oldStatus,callback(err);self.status="closed",callback()})):(this.status="closed",process.nextTick(callback))},AbstractLevelDOWN.prototype.get=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("get() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),options.asBuffer=0!=options.asBuffer,"function"==typeof this._get?this._get(key,options,callback):void process.nextTick(function(){callback(new Error("NotFound"))}))},AbstractLevelDOWN.prototype.put=function(key,value,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("put() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),null==value||this._isBuffer(value)||process.browser||(value=String(value)),"object"!=typeof options&&(options={}),"function"==typeof this._put?this._put(key,value,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.del=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("del() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),"function"==typeof this._del?this._del(key,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.batch=function(array,options,callback){if(!arguments.length)return this._chainedBatch();if("function"==typeof options&&(callback=options),"function"==typeof array&&(callback=array),"function"!=typeof callback)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(array))return callback(new Error("batch(array) requires an array argument"));options&&"object"==typeof options||(options={});for(var e,err,i=0,l=array.length;i<l;i++)if("object"==typeof(e=array[i])){if(err=this._checkKey(e.type,"type",this._isBuffer))return callback(err);if(err=this._checkKey(e.key,"key",this._isBuffer))return callback(err)}if("function"==typeof this._batch)return this._batch(array,options,callback);process.nextTick(callback)},AbstractLevelDOWN.prototype.approximateSize=function(start,end,callback){if(null==start||null==end||"function"==typeof start||"function"==typeof end)throw new Error("approximateSize() requires valid `start`, `end` and `callback` arguments");if("function"!=typeof callback)throw new Error("approximateSize() requires a callback argument");if(this._isBuffer(start)||(start=String(start)),this._isBuffer(end)||(end=String(end)),"function"==typeof this._approximateSize)return this._approximateSize(start,end,callback);process.nextTick(function(){callback(null,0)})},AbstractLevelDOWN.prototype._setupIteratorOptions=function(options){var self=this;return options=xtend(options),["start","end","gt","gte","lt","lte"].forEach(function(o){options[o]&&self._isBuffer(options[o])&&0===options[o].length&&delete options[o]}),options.reverse=!!options.reverse,options.keys=0!=options.keys,options.values=0!=options.values,options.limit="limit"in options?options.limit:-1,options.keyAsBuffer=0!=options.keyAsBuffer,options.valueAsBuffer=0!=options.valueAsBuffer,options},AbstractLevelDOWN.prototype.iterator=function(options){return"object"!=typeof options&&(options={}),options=this._setupIteratorOptions(options),"function"==typeof this._iterator?this._iterator(options):new AbstractIterator(this)},AbstractLevelDOWN.prototype._chainedBatch=function(){return new AbstractChainedBatch(this)},AbstractLevelDOWN.prototype._isBuffer=function(obj){return Buffer.isBuffer(obj)},AbstractLevelDOWN.prototype._checkKey=function(obj,type){if(null===obj||void 0===obj)return new Error(type+" cannot be `null` or `undefined`");if(this._isBuffer(obj)){if(0===obj.length)return new Error(type+" cannot be an empty Buffer")}else if(""===String(obj))return new Error(type+" cannot be an empty String")},module.exports=AbstractLevelDOWN}).call(this,{isBuffer:require("../../../is-buffer/index.js")},require("_process"))},{"../../../is-buffer/index.js":43,"./abstract-chained-batch":14,"./abstract-iterator":15,_process:86,xtend:139}],17:[function(require,module,exports){exports.AbstractLevelDOWN=require("./abstract-leveldown"),exports.AbstractIterator=require("./abstract-iterator"),exports.AbstractChainedBatch=require("./abstract-chained-batch"),exports.isLevelDOWN=require("./is-leveldown")},{"./abstract-chained-batch":14,"./abstract-iterator":15,"./abstract-leveldown":16,"./is-leveldown":18}],18:[function(require,module,exports){function isLevelDOWN(db){return!(!db||"object"!=typeof db)&&Object.keys(AbstractLevelDOWN.prototype).filter(function(name){return"_"!=name[0]&&"approximateSize"!=name}).every(function(name){return"function"==typeof db[name]})}var AbstractLevelDOWN=require("./abstract-leveldown");module.exports=isLevelDOWN},{"./abstract-leveldown":16}],19:[function(require,module,exports){const pumpify=require("pumpify"),stopwords=[],CalculateTermFrequency=exports.CalculateTermFrequency=require("./pipeline/CalculateTermFrequency.js"),CreateCompositeVector=exports.CreateCompositeVector=require("./pipeline/CreateCompositeVector.js"),CreateSortVectors=exports.CreateSortVectors=require("./pipeline/CreateSortVectors.js"),CreateStoredDocument=exports.CreateStoredDocument=require("./pipeline/CreateStoredDocument.js"),FieldedSearch=exports.FieldedSearch=require("./pipeline/FieldedSearch.js"),IngestDoc=exports.IngestDoc=require("./pipeline/IngestDoc.js"),LowCase=exports.LowCase=require("./pipeline/LowCase.js"),NormaliseFields=exports.NormaliseFields=require("./pipeline/NormaliseFields.js"),RemoveStopWords=exports.RemoveStopWords=require("./pipeline/RemoveStopWords.js"),Tokeniser=(exports.Spy=require("./pipeline/Spy.js"),exports.Tokeniser=require("./pipeline/Tokeniser.js"));exports.pipeline=function(options){options=Object.assign({},{separator:/[|' .,\-|(\\\n)]+/,searchable:!0,stopwords:stopwords,nGramLength:1,fieldedSearch:!0},options);var pl=[new IngestDoc(options),new CreateStoredDocument,new NormaliseFields,new LowCase,new Tokeniser,new RemoveStopWords,new CalculateTermFrequency,new CreateCompositeVector,new CreateSortVectors,new FieldedSearch];return pumpify.obj.apply(this,pl)},exports.customPipeline=function(pl){return pumpify.obj.apply(this,pl)}},{"./pipeline/CalculateTermFrequency.js":20,"./pipeline/CreateCompositeVector.js":21,"./pipeline/CreateSortVectors.js":22,"./pipeline/CreateStoredDocument.js":23,"./pipeline/FieldedSearch.js":24,"./pipeline/IngestDoc.js":25,"./pipeline/LowCase.js":26,"./pipeline/NormaliseFields.js":27,"./pipeline/RemoveStopWords.js":28,"./pipeline/Spy.js":29,"./pipeline/Tokeniser.js":30,pumpify:89}],20:[function(require,module,exports){const tv=require("term-vector"),tf=require("term-frequency"),Transform=require("stream").Transform,util=require("util"),objectify=function(result,item){return result[item[0].join(" ")]=item[1],result},CalculateTermFrequency=function(options){Transform.call(this,{objectMode:!0})};module.exports=CalculateTermFrequency,util.inherits(CalculateTermFrequency,Transform),CalculateTermFrequency.prototype._transform=function(doc,encoding,end){var options=Object.assign({},{fieldOptions:{},nGramLength:1,searchable:!0,weight:0},doc.options||{});for(var fieldName in doc.tokenised){var fieldOptions=Object.assign({},{nGramLength:options.nGramLength,searchable:options.searchable,weight:options.weight},options.fieldOptions[fieldName]),field=doc.tokenised[fieldName];fieldOptions.searchable&&(doc.vector[fieldName]=tf.getTermFrequency(tv.getVector(field,fieldOptions.nGramLength),{scheme:tf.doubleNormalization0point5,weight:fieldOptions.weight}).reduce(objectify,{}),doc.vector[fieldName]["*"]=1)}return this.push(doc),end()}},{stream:127,"term-frequency":130,"term-vector":131,util:137}],21:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),CreateCompositeVector=function(options){Transform.call(this,{objectMode:!0})};module.exports=CreateCompositeVector,util.inherits(CreateCompositeVector,Transform),CreateCompositeVector.prototype._transform=function(doc,encoding,end){var options=Object.assign({},{fieldOptions:{},searchable:!0},doc.options||{});doc.vector["*"]={};for(var fieldName in doc.vector){if(Object.assign({},{searchable:options.searchable},options.fieldOptions[fieldName]).searchable){var vec=doc.vector[fieldName];for(var token in vec)doc.vector["*"][token]=doc.vector["*"][token]||vec[token],doc.vector["*"][token]=(doc.vector["*"][token]+vec[token])/2}}return this.push(doc),end()}},{stream:127,util:137}],22:[function(require,module,exports){const tf=require("term-frequency"),tv=require("term-vector"),Transform=require("stream").Transform,util=require("util"),objectify=function(result,item){return result[item[0]]=item[1],result},CreateSortVectors=function(options){Transform.call(this,{objectMode:!0})};module.exports=CreateSortVectors,util.inherits(CreateSortVectors,Transform),CreateSortVectors.prototype._transform=function(doc,encoding,end){var options=Object.assign({},{fieldOptions:{},sortable:!1},doc.options||{});for(var fieldName in doc.vector){Object.assign({},{sortable:options.sortable},options.fieldOptions[fieldName]).sortable&&(doc.vector[fieldName]=tf.getTermFrequency(tv.getVector(doc.tokenised[fieldName]),{scheme:tf.selfString}).reduce(objectify,{}))}return this.push(doc),end()}},{stream:127,"term-frequency":130,"term-vector":131,util:137}],23:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),CreateStoredDocument=function(options){Transform.call(this,{objectMode:!0})};module.exports=CreateStoredDocument,util.inherits(CreateStoredDocument,Transform),CreateStoredDocument.prototype._transform=function(doc,encoding,end){var options=Object.assign({},{fieldOptions:{},storeable:!0},doc.options||{});for(var fieldName in doc.raw){var fieldOptions=Object.assign({},{storeable:options.storeable},options.fieldOptions[fieldName]);"id"===fieldName&&(fieldOptions.storeable=!0),fieldOptions.storeable&&(doc.stored[fieldName]=JSON.parse(JSON.stringify(doc.raw[fieldName])))}return this.push(doc),end()}},{stream:127,util:137}],24:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),FieldedSearch=function(options){Transform.call(this,{objectMode:!0})};module.exports=FieldedSearch,util.inherits(FieldedSearch,Transform),FieldedSearch.prototype._transform=function(doc,encoding,end){var options=Object.assign({},{fieldOptions:{},fieldedSearch:!0},doc.options||{});for(var fieldName in doc.vector){Object.assign({},{fieldedSearch:options.fieldedSearch},options.fieldOptions[fieldName]).fieldedSearch||"*"===fieldName||delete doc.vector[fieldName]}return options.log&&options.log.info(doc),this.push(doc),end()}},{stream:127,util:137}],25:[function(require,module,exports){const util=require("util"),Transform=require("stream").Transform,IngestDoc=function(options){this.options=options,this.i=0,Transform.call(this,{objectMode:!0})};module.exports=IngestDoc,util.inherits(IngestDoc,Transform),IngestDoc.prototype._transform=function(doc,encoding,end){var that=this,ingestedDoc={normalised:{},options:that.options,raw:JSON.parse(JSON.stringify(doc)),stored:{},tokenised:{},vector:{}};return doc.id?ingestedDoc.id=String(doc.id):ingestedDoc.id=Date.now()+"-"+ ++this.i,this.push(ingestedDoc),end()}},{stream:127,util:137}],26:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),LowCase=function(){Transform.call(this,{objectMode:!0})};module.exports=LowCase,util.inherits(LowCase,Transform),
  LowCase.prototype._transform=function(doc,encoding,end){var options=this.options=Object.assign({},{fieldOptions:{},preserveCase:!1},doc.options||{});for(var fieldName in doc.normalised)if("id"!==fieldName){var fieldOptions=Object.assign({},{preserveCase:options.preserveCase},options.fieldOptions[fieldName]);fieldOptions.preserveCase||("[object Array]"===Object.prototype.toString.call(doc.normalised[fieldName])?doc.normalised[fieldName].map(function(token){return token.toLowerCase()}):doc.normalised[fieldName]=doc.normalised[fieldName].toLowerCase())}return this.push(doc),end()}},{stream:127,util:137}],27:[function(require,module,exports){const util=require("util"),Transform=require("stream").Transform,NormaliseFields=function(){Transform.call(this,{objectMode:!0})};module.exports=NormaliseFields,util.inherits(NormaliseFields,Transform),NormaliseFields.prototype._transform=function(doc,encoding,end){for(var fieldName in doc.raw)"[object Array]"===Object.prototype.toString.call(doc.raw[fieldName])?doc.normalised[fieldName]=doc.raw[fieldName].map(function(item){return JSON.stringify(item).split(/[[\],{}:"]+/).join(" ").trim()}):"[object String]"!==Object.prototype.toString.call(doc.raw[fieldName])?doc.normalised[fieldName]=JSON.stringify(doc.raw[fieldName]).split(/[[\],{}:"]+/).join(" ").trim():doc.normalised[fieldName]=doc.raw[fieldName].trim();return this.push(doc),end()}},{stream:127,util:137}],28:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),RemoveStopWords=function(options){Transform.call(this,{objectMode:!0})};module.exports=RemoveStopWords,util.inherits(RemoveStopWords,Transform),RemoveStopWords.prototype._transform=function(doc,encoding,end){var options=Object.assign({},{fieldOptions:{},stopwords:[]},doc.options||{});for(var fieldName in doc.normalised){var fieldOptions=Object.assign({},{stopwords:options.stopwords},options.fieldOptions[fieldName]);doc.tokenised[fieldName]=doc.tokenised[fieldName].filter(function(item){return-1===fieldOptions.stopwords.indexOf(item)}).filter(function(i){return i})}return this.push(doc),end()}},{stream:127,util:137}],29:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),Spy=function(){Transform.call(this,{objectMode:!0})};module.exports=Spy,util.inherits(Spy,Transform),Spy.prototype._transform=function(doc,encoding,end){return console.log(JSON.stringify(doc,null,2)),this.push(doc),end()}},{stream:127,util:137}],30:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),Tokeniser=function(options){Transform.call(this,{objectMode:!0})};module.exports=Tokeniser,util.inherits(Tokeniser,Transform),Tokeniser.prototype._transform=function(doc,encoding,end){var options=this.options=Object.assign({},{fieldOptions:{},separator:/\\n|[|' ><.,\-|]+|\\u0003/},doc.options||{});for(var fieldName in doc.normalised){var fieldOptions=Object.assign({},{separator:options.separator},options.fieldOptions[fieldName]);"[object Array]"===Object.prototype.toString.call(doc.normalised[fieldName])?doc.tokenised[fieldName]=doc.normalised[fieldName]:doc.tokenised[fieldName]=doc.normalised[fieldName].split(fieldOptions.separator)}return this.push(doc),end()}},{stream:127,util:137}],31:[function(require,module,exports){(function(process,Buffer){var stream=require("readable-stream"),eos=require("end-of-stream"),inherits=require("inherits"),shift=require("stream-shift"),SIGNAL_FLUSH=new Buffer([0]),onuncork=function(self,fn){self._corked?self.once("uncork",fn):fn()},destroyer=function(self,end){return function(err){err?self.destroy("premature close"===err.message?null:err):end&&!self._ended&&self.end()}},end=function(ws,fn){return ws?ws._writableState&&ws._writableState.finished?fn():ws._writableState?ws.end(fn):(ws.end(),void fn()):fn()},toStreams2=function(rs){return new stream.Readable({objectMode:!0,highWaterMark:16}).wrap(rs)},Duplexify=function(writable,readable,opts){if(!(this instanceof Duplexify))return new Duplexify(writable,readable,opts);stream.Duplex.call(this,opts),this._writable=null,this._readable=null,this._readable2=null,this._forwardDestroy=!opts||!1!==opts.destroy,this._forwardEnd=!opts||!1!==opts.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,writable&&this.setWritable(writable),readable&&this.setReadable(readable)};inherits(Duplexify,stream.Duplex),Duplexify.obj=function(writable,readable,opts){return opts||(opts={}),opts.objectMode=!0,opts.highWaterMark=16,new Duplexify(writable,readable,opts)},Duplexify.prototype.cork=function(){1==++this._corked&&this.emit("cork")},Duplexify.prototype.uncork=function(){this._corked&&0==--this._corked&&this.emit("uncork")},Duplexify.prototype.setWritable=function(writable){if(this._unwrite&&this._unwrite(),this.destroyed)return void(writable&&writable.destroy&&writable.destroy());if(null===writable||!1===writable)return void this.end();var self=this,unend=eos(writable,{writable:!0,readable:!1},destroyer(this,this._forwardEnd)),ondrain=function(){var ondrain=self._ondrain;self._ondrain=null,ondrain&&ondrain()},clear=function(){self._writable.removeListener("drain",ondrain),unend()};this._unwrite&&process.nextTick(ondrain),this._writable=writable,this._writable.on("drain",ondrain),this._unwrite=clear,this.uncork()},Duplexify.prototype.setReadable=function(readable){if(this._unread&&this._unread(),this.destroyed)return void(readable&&readable.destroy&&readable.destroy());if(null===readable||!1===readable)return this.push(null),void this.resume();var self=this,unend=eos(readable,{writable:!1,readable:!0},destroyer(this)),onreadable=function(){self._forward()},onend=function(){self.push(null)},clear=function(){self._readable2.removeListener("readable",onreadable),self._readable2.removeListener("end",onend),unend()};this._drained=!0,this._readable=readable,this._readable2=readable._readableState?readable:toStreams2(readable),this._readable2.on("readable",onreadable),this._readable2.on("end",onend),this._unread=clear,this._forward()},Duplexify.prototype._read=function(){this._drained=!0,this._forward()},Duplexify.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){this._forwarding=!0;for(var data;this._drained&&null!==(data=shift(this._readable2));)this.destroyed||(this._drained=this.push(data));this._forwarding=!1}},Duplexify.prototype.destroy=function(err){if(!this.destroyed){this.destroyed=!0;var self=this;process.nextTick(function(){self._destroy(err)})}},Duplexify.prototype._destroy=function(err){if(err){var ondrain=this._ondrain;this._ondrain=null,ondrain?ondrain(err):this.emit("error",err)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},Duplexify.prototype._write=function(data,enc,cb){return this.destroyed?cb():this._corked?onuncork(this,this._write.bind(this,data,enc,cb)):data===SIGNAL_FLUSH?this._finish(cb):this._writable?void(!1===this._writable.write(data)?this._ondrain=cb:cb()):cb()},Duplexify.prototype._finish=function(cb){var self=this;this.emit("preend"),onuncork(this,function(){end(self._forwardEnd&&self._writable,function(){!1===self._writableState.prefinished&&(self._writableState.prefinished=!0),self.emit("prefinish"),onuncork(self,cb)})})},Duplexify.prototype.end=function(data,enc,cb){return"function"==typeof data?this.end(null,null,data):"function"==typeof enc?this.end(data,null,enc):(this._ended=!0,data&&this.write(data),this._writableState.ending||this.write(SIGNAL_FLUSH),stream.Writable.prototype.end.call(this,cb))},module.exports=Duplexify}).call(this,require("_process"),require("buffer").Buffer)},{_process:86,buffer:9,"end-of-stream":32,inherits:41,"readable-stream":100,"stream-shift":128}],32:[function(require,module,exports){var once=require("once"),noop=function(){},isRequest=function(stream){return stream.setHeader&&"function"==typeof stream.abort},eos=function(stream,opts,callback){if("function"==typeof opts)return eos(stream,null,opts);opts||(opts={}),callback=once(callback||noop);var ws=stream._writableState,rs=stream._readableState,readable=opts.readable||!1!==opts.readable&&stream.readable,writable=opts.writable||!1!==opts.writable&&stream.writable,onlegacyfinish=function(){stream.writable||onfinish()},onfinish=function(){writable=!1,readable||callback()},onend=function(){readable=!1,writable||callback()},onclose=function(){return(!readable||rs&&rs.ended)&&(!writable||ws&&ws.ended)?void 0:callback(new Error("premature close"))},onrequest=function(){stream.req.on("finish",onfinish)};return isRequest(stream)?(stream.on("complete",onfinish),stream.on("abort",onclose),stream.req?onrequest():stream.on("request",onrequest)):writable&&!ws&&(stream.on("end",onlegacyfinish),stream.on("close",onlegacyfinish)),stream.on("end",onend),stream.on("finish",onfinish),!1!==opts.error&&stream.on("error",callback),stream.on("close",onclose),function(){stream.removeListener("complete",onfinish),stream.removeListener("abort",onclose),stream.removeListener("request",onrequest),stream.req&&stream.req.removeListener("finish",onfinish),stream.removeListener("end",onlegacyfinish),stream.removeListener("close",onlegacyfinish),stream.removeListener("finish",onfinish),stream.removeListener("end",onend),stream.removeListener("error",callback),stream.removeListener("close",onclose)}};module.exports=eos},{once:33}],33:[function(require,module,exports){function once(fn){var f=function(){return f.called?f.value:(f.called=!0,f.value=fn.apply(this,arguments))};return f.called=!1,f}var wrappy=require("wrappy");module.exports=wrappy(once),once.proto=once(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:!0})})},{wrappy:138}],34:[function(require,module,exports){var once=require("once"),noop=function(){},isRequest=function(stream){return stream.setHeader&&"function"==typeof stream.abort},isChildProcess=function(stream){return stream.stdio&&Array.isArray(stream.stdio)&&3===stream.stdio.length},eos=function(stream,opts,callback){if("function"==typeof opts)return eos(stream,null,opts);opts||(opts={}),callback=once(callback||noop);var ws=stream._writableState,rs=stream._readableState,readable=opts.readable||!1!==opts.readable&&stream.readable,writable=opts.writable||!1!==opts.writable&&stream.writable,onlegacyfinish=function(){stream.writable||onfinish()},onfinish=function(){writable=!1,readable||callback.call(stream)},onend=function(){readable=!1,writable||callback.call(stream)},onexit=function(exitCode){callback.call(stream,exitCode?new Error("exited with error code: "+exitCode):null)},onclose=function(){return(!readable||rs&&rs.ended)&&(!writable||ws&&ws.ended)?void 0:callback.call(stream,new Error("premature close"))},onrequest=function(){stream.req.on("finish",onfinish)};return isRequest(stream)?(stream.on("complete",onfinish),stream.on("abort",onclose),stream.req?onrequest():stream.on("request",onrequest)):writable&&!ws&&(stream.on("end",onlegacyfinish),stream.on("close",onlegacyfinish)),isChildProcess(stream)&&stream.on("exit",onexit),stream.on("end",onend),stream.on("finish",onfinish),!1!==opts.error&&stream.on("error",callback),stream.on("close",onclose),function(){stream.removeListener("complete",onfinish),stream.removeListener("abort",onclose),stream.removeListener("request",onrequest),stream.req&&stream.req.removeListener("finish",onfinish),stream.removeListener("end",onlegacyfinish),stream.removeListener("close",onlegacyfinish),stream.removeListener("finish",onfinish),stream.removeListener("exit",onexit),stream.removeListener("end",onend),stream.removeListener("error",callback),stream.removeListener("close",onclose)}};module.exports=eos},{once:83}],35:[function(require,module,exports){function init(type,message,cause){prr(this,{type:type,name:type,cause:"string"!=typeof message?message:cause,message:message&&"string"!=typeof message?message.message:message},"ewr")}function CustomError(message,cause){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee),init.call(this,"CustomError",message,cause)}function createError(errno,type,proto){var err=function(message,cause){init.call(this,type,message,cause),"FilesystemError"==type&&(this.code=this.cause.code,this.path=this.cause.path,this.errno=this.cause.errno,this.message=(errno.errno[this.cause.errno]?errno.errno[this.cause.errno].description:this.cause.message)+(this.cause.path?" ["+this.cause.path+"]":"")),Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee)};return err.prototype=proto?new proto:new CustomError,err}var prr=require("prr");CustomError.prototype=new Error,module.exports=function(errno){var ce=function(type,proto){return createError(errno,type,proto)};return{CustomError:CustomError,FilesystemError:ce("FilesystemError"),createError:ce}}},{prr:37}],36:[function(require,module,exports){var all=module.exports.all=[{errno:-2,code:"ENOENT",description:"no such file or directory"},{errno:-1,code:"UNKNOWN",description:"unknown error"},{errno:0,code:"OK",description:"success"},{errno:1,code:"EOF",description:"end of file"},{errno:2,code:"EADDRINFO",description:"getaddrinfo error"},{errno:3,code:"EACCES",description:"permission denied"},{errno:4,code:"EAGAIN",description:"resource temporarily unavailable"},{errno:5,code:"EADDRINUSE",description:"address already in use"},{errno:6,code:"EADDRNOTAVAIL",description:"address not available"},{errno:7,code:"EAFNOSUPPORT",description:"address family not supported"},{errno:8,code:"EALREADY",description:"connection already in progress"},{errno:9,code:"EBADF",description:"bad file descriptor"},{errno:10,code:"EBUSY",description:"resource busy or locked"},{errno:11,code:"ECONNABORTED",description:"software caused connection abort"},{errno:12,code:"ECONNREFUSED",description:"connection refused"},{errno:13,code:"ECONNRESET",description:"connection reset by peer"},{errno:14,code:"EDESTADDRREQ",description:"destination address required"},{errno:15,code:"EFAULT",description:"bad address in system call argument"},{errno:16,code:"EHOSTUNREACH",description:"host is unreachable"},{errno:17,code:"EINTR",description:"interrupted system call"},{errno:18,code:"EINVAL",description:"invalid argument"},{errno:19,code:"EISCONN",description:"socket is already connected"},{errno:20,code:"EMFILE",description:"too many open files"},{errno:21,code:"EMSGSIZE",description:"message too long"},{errno:22,code:"ENETDOWN",description:"network is down"},{errno:23,code:"ENETUNREACH",description:"network is unreachable"},{errno:24,code:"ENFILE",description:"file table overflow"},{errno:25,code:"ENOBUFS",description:"no buffer space available"},{errno:26,code:"ENOMEM",description:"not enough memory"},{errno:27,code:"ENOTDIR",description:"not a directory"},{errno:28,code:"EISDIR",description:"illegal operation on a directory"},{errno:29,code:"ENONET",description:"machine is not on the network"},{errno:31,code:"ENOTCONN",description:"socket is not connected"},{errno:32,code:"ENOTSOCK",description:"socket operation on non-socket"},{errno:33,code:"ENOTSUP",description:"operation not supported on socket"},{errno:34,code:"ENOENT",description:"no such file or directory"},{errno:35,code:"ENOSYS",description:"function not implemented"},{errno:36,code:"EPIPE",description:"broken pipe"},{errno:37,code:"EPROTO",description:"protocol error"},{errno:38,code:"EPROTONOSUPPORT",description:"protocol not supported"},{errno:39,code:"EPROTOTYPE",description:"protocol wrong type for socket"},{errno:40,code:"ETIMEDOUT",description:"connection timed out"},{errno:41,code:"ECHARSET",description:"invalid Unicode character"},{errno:42,code:"EAIFAMNOSUPPORT",description:"address family for hostname not supported"},{errno:44,code:"EAISERVICE",description:"servname not supported for ai_socktype"},{errno:45,code:"EAISOCKTYPE",description:"ai_socktype not supported"},{errno:46,code:"ESHUTDOWN",description:"cannot send after transport endpoint shutdown"},{errno:47,code:"EEXIST",description:"file already exists"},{errno:48,code:"ESRCH",description:"no such process"},{errno:49,code:"ENAMETOOLONG",description:"name too long"},{errno:50,code:"EPERM",description:"operation not permitted"},{errno:51,code:"ELOOP",description:"too many symbolic links encountered"},{errno:52,code:"EXDEV",description:"cross-device link not permitted"},{errno:53,code:"ENOTEMPTY",description:"directory not empty"},{errno:54,code:"ENOSPC",description:"no space left on device"},{errno:55,code:"EIO",description:"i/o error"},{errno:56,code:"EROFS",description:"read-only file system"},{errno:57,code:"ENODEV",description:"no such device"},{errno:58,code:"ESPIPE",description:"invalid seek"},{errno:59,code:"ECANCELED",description:"operation canceled"}];module.exports.errno={},module.exports.code={},all.forEach(function(error){module.exports.errno[error.errno]=error,module.exports.code[error.code]=error}),module.exports.custom=require("./custom")(module.exports),module.exports.create=module.exports.custom.createError},{"./custom":35}],37:[function(require,module,exports){!function(name,context,definition){void 0!==module&&module.exports?module.exports=definition():context.prr=definition()}(0,this,function(){var setProperty="function"==typeof Object.defineProperty?function(obj,key,options){return Object.defineProperty(obj,key,options),obj}:function(obj,key,options){return obj[key]=options.value,obj},makeOptions=function(value,options){var oo="object"==typeof options,os=!oo&&"string"==typeof options,op=function(p){return oo?!!options[p]:!!os&&options.indexOf(p[0])>-1};return{enumerable:op("enumerable"),configurable:op("configurable"),writable:op("writable"),value:value}};return function(obj,key,value,options){var k;if(options=makeOptions(value,options),"object"==typeof key){for(k in key)Object.hasOwnProperty.call(key,k)&&(options.value=key[k],setProperty(obj,k,options));return obj}return setProperty(obj,key,options)}})},{}],38:[function(require,module,exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if((er=arguments[1])instanceof Error)throw er;var err=new Error('Uncaught, unspecified "error" event. ('+er+")");throw err.context=er,err}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1),handler.apply(this,args)}else if(isObject(handler))for(args=Array.prototype.slice.call(arguments,1),listeners=handler.slice(),len=listeners.length,i=0;i<len;i++)listeners[i].apply(this,args);return!0},EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener),this._events[type]?isObject(this._events[type])?this._events[type].push(listener):this._events[type]=[this._events[type],listener]:this._events[type]=listener,isObject(this._events[type])&&!this._events[type].warned&&(m=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners)&&m>0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace()),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-- >0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(position<0)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else if(listeners)for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){return this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;if(evlistener)return evlistener.length}return 0},EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)}},{}],39:[function(require,module,exports){!function(name,definition,global){"use strict";"function"==typeof define?define(definition):void 0!==module&&module.exports?module.exports=definition():global.IDBStore=definition()}(0,function(){"use strict";function mixin(target,source){var name,s;for(name in source)(s=source[name])!==empty[name]&&s!==target[name]&&(target[name]=s);return target}function hasVersionError(errorEvent){return"error"in errorEvent.target?"VersionError"==errorEvent.target.error.name:"errorCode"in errorEvent.target&&12==errorEvent.target.errorCode}var defaultErrorHandler=function(error){throw error},defaultSuccessHandler=function(){},defaults={storeName:"Store",storePrefix:"IDBWrapper-",dbVersion:1,keyPath:"id",autoIncrement:!0,onStoreReady:function(){},onError:defaultErrorHandler,indexes:[],implementationPreference:["indexedDB","webkitIndexedDB","mozIndexedDB","shimIndexedDB"]},IDBStore=function(kwArgs,onStoreReady){void 0===onStoreReady&&"function"==typeof kwArgs&&(onStoreReady=kwArgs),"[object Object]"!=Object.prototype.toString.call(kwArgs)&&(kwArgs={});for(var key in defaults)this[key]=void 0!==kwArgs[key]?kwArgs[key]:defaults[key];this.dbName=this.storePrefix+this.storeName,this.dbVersion=parseInt(this.dbVersion,10)||1,onStoreReady&&(this.onStoreReady=onStoreReady);var env="object"==typeof window?window:self,availableImplementations=this.implementationPreference.filter(function(implName){return implName in env});this.implementation=availableImplementations[0],this.idb=env[this.implementation],this.keyRange=env.IDBKeyRange||env.webkitIDBKeyRange||env.mozIDBKeyRange,this.consts={READ_ONLY:"readonly",READ_WRITE:"readwrite",VERSION_CHANGE:"versionchange",NEXT:"next",NEXT_NO_DUPLICATE:"nextunique",PREV:"prev",PREV_NO_DUPLICATE:"prevunique"},this.openDB()},proto={constructor:IDBStore,version:"1.7.1",db:null,dbName:null,dbVersion:null,store:null,storeName:null,storePrefix:null,keyPath:null,autoIncrement:null,indexes:null,implementationPreference:null,implementation:"",onStoreReady:null,onError:null,_insertIdCount:0,openDB:function(){var openRequest=this.idb.open(this.dbName,this.dbVersion),preventSuccessCallback=!1;openRequest.onerror=function(errorEvent){if(hasVersionError(errorEvent))this.onError(new Error("The version number provided is lower than the existing one."));else{var error;if(errorEvent.target.error)error=errorEvent.target.error;else{var errorMessage="IndexedDB unknown error occurred when opening DB "+this.dbName+" version "+this.dbVersion;"errorCode"in errorEvent.target&&(errorMessage+=" with error code "+errorEvent.target.errorCode),error=new Error(errorMessage)}this.onError(error)}}.bind(this),openRequest.onsuccess=function(event){if(!preventSuccessCallback){if(this.db)return void this.onStoreReady();if(this.db=event.target.result,"string"==typeof this.db.version)return void this.onError(new Error("The IndexedDB implementation in this browser is outdated. Please upgrade your browser."));if(!this.db.objectStoreNames.contains(this.storeName))return void this.onError(new Error("Object store couldn't be created."));var emptyTransaction=this.db.transaction([this.storeName],this.consts.READ_ONLY);this.store=emptyTransaction.objectStore(this.storeName);var existingIndexes=Array.prototype.slice.call(this.getIndexList());this.indexes.forEach(function(indexData){var indexName=indexData.name;if(!indexName)return preventSuccessCallback=!0,void this.onError(new Error("Cannot create index: No index name given."));if(this.normalizeIndexData(indexData),this.hasIndex(indexName)){var actualIndex=this.store.index(indexName);this.indexComplies(actualIndex,indexData)||(preventSuccessCallback=!0,this.onError(new Error('Cannot modify index "'+indexName+'" for current version. Please bump version number to '+(this.dbVersion+1)+"."))),existingIndexes.splice(existingIndexes.indexOf(indexName),1)}else preventSuccessCallback=!0,this.onError(new Error('Cannot create new index "'+indexName+'" for current version. Please bump version number to '+(this.dbVersion+1)+"."))},this),existingIndexes.length&&(preventSuccessCallback=!0,this.onError(new Error('Cannot delete index(es) "'+existingIndexes.toString()+'" for current version. Please bump version number to '+(this.dbVersion+1)+"."))),preventSuccessCallback||this.onStoreReady()}}.bind(this),openRequest.onupgradeneeded=function(event){if(this.db=event.target.result,this.db.objectStoreNames.contains(this.storeName))this.store=event.target.transaction.objectStore(this.storeName);else{var optionalParameters={autoIncrement:this.autoIncrement};null!==this.keyPath&&(optionalParameters.keyPath=this.keyPath),this.store=this.db.createObjectStore(this.storeName,optionalParameters)}var existingIndexes=Array.prototype.slice.call(this.getIndexList());this.indexes.forEach(function(indexData){var indexName=indexData.name;if(indexName||(preventSuccessCallback=!0,this.onError(new Error("Cannot create index: No index name given."))),this.normalizeIndexData(indexData),this.hasIndex(indexName)){var actualIndex=this.store.index(indexName);this.indexComplies(actualIndex,indexData)||(this.store.deleteIndex(indexName),this.store.createIndex(indexName,indexData.keyPath,{unique:indexData.unique,multiEntry:indexData.multiEntry})),existingIndexes.splice(existingIndexes.indexOf(indexName),1)}else this.store.createIndex(indexName,indexData.keyPath,{unique:indexData.unique,multiEntry:indexData.multiEntry})},this),existingIndexes.length&&existingIndexes.forEach(function(_indexName){this.store.deleteIndex(_indexName)},this)}.bind(this)},deleteDatabase:function(onSuccess,onError){if(this.idb.deleteDatabase){this.db.close();var deleteRequest=this.idb.deleteDatabase(this.dbName);deleteRequest.onsuccess=onSuccess,deleteRequest.onerror=onError}else onError(new Error("Browser does not support IndexedDB deleteDatabase!"))},put:function(key,value,onSuccess,onError){null!==this.keyPath&&(onError=onSuccess,onSuccess=value,value=key),onError||(onError=defaultErrorHandler),onSuccess||(onSuccess=defaultSuccessHandler);var putRequest,hasSuccess=!1,result=null,putTransaction=this.db.transaction([this.storeName],this.consts.READ_WRITE);return putTransaction.oncomplete=function(){(hasSuccess?onSuccess:onError)(result)},putTransaction.onabort=onError,putTransaction.onerror=onError,null!==this.keyPath?(this._addIdPropertyIfNeeded(value),putRequest=putTransaction.objectStore(this.storeName).put(value)):putRequest=putTransaction.objectStore(this.storeName).put(value,key),putRequest.onsuccess=function(event){hasSuccess=!0,result=event.target.result},putRequest.onerror=onError,putTransaction},get:function(key,onSuccess,onError){onError||(onError=defaultErrorHandler),onSuccess||(onSuccess=defaultSuccessHandler);var hasSuccess=!1,result=null,getTransaction=this.db.transaction([this.storeName],this.consts.READ_ONLY);getTransaction.oncomplete=function(){(hasSuccess?onSuccess:onError)(result)},getTransaction.onabort=onError,getTransaction.onerror=onError;var getRequest=getTransaction.objectStore(this.storeName).get(key);return getRequest.onsuccess=function(event){hasSuccess=!0,result=event.target.result},getRequest.onerror=onError,getTransaction},remove:function(key,onSuccess,onError){onError||(onError=defaultErrorHandler),onSuccess||(onSuccess=defaultSuccessHandler);var hasSuccess=!1,result=null,removeTransaction=this.db.transaction([this.storeName],this.consts.READ_WRITE);removeTransaction.oncomplete=function(){(hasSuccess?onSuccess:onError)(result)},removeTransaction.onabort=onError,removeTransaction.onerror=onError;var deleteRequest=removeTransaction.objectStore(this.storeName).delete(key);return deleteRequest.onsuccess=function(event){hasSuccess=!0,result=event.target.result},deleteRequest.onerror=onError,removeTransaction},batch:function(dataArray,onSuccess,onError){if(onError||(onError=defaultErrorHandler),onSuccess||(onSuccess=defaultSuccessHandler),"[object Array]"!=Object.prototype.toString.call(dataArray))onError(new Error("dataArray argument must be of type Array."));else if(0===dataArray.length)return onSuccess(!0);var count=dataArray.length,called=!1,hasSuccess=!1,batchTransaction=this.db.transaction([this.storeName],this.consts.READ_WRITE);batchTransaction.oncomplete=function(){(hasSuccess?onSuccess:onError)(hasSuccess)},batchTransaction.onabort=onError,batchTransaction.onerror=onError;var onItemSuccess=function(){0!==--count||called||(called=!0,hasSuccess=!0)};return dataArray.forEach(function(operation){var type=operation.type,key=operation.key,value=operation.value,onItemError=function(err){batchTransaction.abort(),called||(called=!0,onError(err,type,key))};if("remove"==type){var deleteRequest=batchTransaction.objectStore(this.storeName).delete(key);deleteRequest.onsuccess=onItemSuccess,deleteRequest.onerror=onItemError}else if("put"==type){var putRequest;null!==this.keyPath?(this._addIdPropertyIfNeeded(value),putRequest=batchTransaction.objectStore(this.storeName).put(value)):putRequest=batchTransaction.objectStore(this.storeName).put(value,key),putRequest.onsuccess=onItemSuccess,putRequest.onerror=onItemError}},this),batchTransaction},putBatch:function(dataArray,onSuccess,onError){var batchData=dataArray.map(function(item){return{type:"put",value:item}})
  ;return this.batch(batchData,onSuccess,onError)},upsertBatch:function(dataArray,options,onSuccess,onError){"function"==typeof options&&(onSuccess=options,onError=onSuccess,options={}),onError||(onError=defaultErrorHandler),onSuccess||(onSuccess=defaultSuccessHandler),options||(options={}),"[object Array]"!=Object.prototype.toString.call(dataArray)&&onError(new Error("dataArray argument must be of type Array."));var keyField=options.keyField||this.keyPath,count=dataArray.length,called=!1,hasSuccess=!1,index=0,batchTransaction=this.db.transaction([this.storeName],this.consts.READ_WRITE);batchTransaction.oncomplete=function(){hasSuccess?onSuccess(dataArray):onError(!1)},batchTransaction.onabort=onError,batchTransaction.onerror=onError;var onItemSuccess=function(event){dataArray[index++][keyField]=event.target.result,0!==--count||called||(called=!0,hasSuccess=!0)};return dataArray.forEach(function(record){var putRequest,key=record.key,onItemError=function(err){batchTransaction.abort(),called||(called=!0,onError(err))};null!==this.keyPath?(this._addIdPropertyIfNeeded(record),putRequest=batchTransaction.objectStore(this.storeName).put(record)):putRequest=batchTransaction.objectStore(this.storeName).put(record,key),putRequest.onsuccess=onItemSuccess,putRequest.onerror=onItemError},this),batchTransaction},removeBatch:function(keyArray,onSuccess,onError){var batchData=keyArray.map(function(key){return{type:"remove",key:key}});return this.batch(batchData,onSuccess,onError)},getBatch:function(keyArray,onSuccess,onError,arrayType){if(onError||(onError=defaultErrorHandler),onSuccess||(onSuccess=defaultSuccessHandler),arrayType||(arrayType="sparse"),"[object Array]"!=Object.prototype.toString.call(keyArray))onError(new Error("keyArray argument must be of type Array."));else if(0===keyArray.length)return onSuccess([]);var data=[],count=keyArray.length,called=!1,hasSuccess=!1,result=null,batchTransaction=this.db.transaction([this.storeName],this.consts.READ_ONLY);batchTransaction.oncomplete=function(){(hasSuccess?onSuccess:onError)(result)},batchTransaction.onabort=onError,batchTransaction.onerror=onError;var onItemSuccess=function(event){event.target.result||"dense"==arrayType?data.push(event.target.result):"sparse"==arrayType&&data.length++,0===--count&&(called=!0,hasSuccess=!0,result=data)};return keyArray.forEach(function(key){var onItemError=function(err){called=!0,result=err,onError(err),batchTransaction.abort()},getRequest=batchTransaction.objectStore(this.storeName).get(key);getRequest.onsuccess=onItemSuccess,getRequest.onerror=onItemError},this),batchTransaction},getAll:function(onSuccess,onError){onError||(onError=defaultErrorHandler),onSuccess||(onSuccess=defaultSuccessHandler);var getAllTransaction=this.db.transaction([this.storeName],this.consts.READ_ONLY),store=getAllTransaction.objectStore(this.storeName);return store.getAll?this._getAllNative(getAllTransaction,store,onSuccess,onError):this._getAllCursor(getAllTransaction,store,onSuccess,onError),getAllTransaction},_getAllNative:function(getAllTransaction,store,onSuccess,onError){var hasSuccess=!1,result=null;getAllTransaction.oncomplete=function(){(hasSuccess?onSuccess:onError)(result)},getAllTransaction.onabort=onError,getAllTransaction.onerror=onError;var getAllRequest=store.getAll();getAllRequest.onsuccess=function(event){hasSuccess=!0,result=event.target.result},getAllRequest.onerror=onError},_getAllCursor:function(getAllTransaction,store,onSuccess,onError){var all=[],hasSuccess=!1,result=null;getAllTransaction.oncomplete=function(){(hasSuccess?onSuccess:onError)(result)},getAllTransaction.onabort=onError,getAllTransaction.onerror=onError;var cursorRequest=store.openCursor();cursorRequest.onsuccess=function(event){var cursor=event.target.result;cursor?(all.push(cursor.value),cursor.continue()):(hasSuccess=!0,result=all)},cursorRequest.onError=onError},clear:function(onSuccess,onError){onError||(onError=defaultErrorHandler),onSuccess||(onSuccess=defaultSuccessHandler);var hasSuccess=!1,result=null,clearTransaction=this.db.transaction([this.storeName],this.consts.READ_WRITE);clearTransaction.oncomplete=function(){(hasSuccess?onSuccess:onError)(result)},clearTransaction.onabort=onError,clearTransaction.onerror=onError;var clearRequest=clearTransaction.objectStore(this.storeName).clear();return clearRequest.onsuccess=function(event){hasSuccess=!0,result=event.target.result},clearRequest.onerror=onError,clearTransaction},_addIdPropertyIfNeeded:function(dataObj){void 0===dataObj[this.keyPath]&&(dataObj[this.keyPath]=this._insertIdCount+++Date.now())},getIndexList:function(){return this.store.indexNames},hasIndex:function(indexName){return this.store.indexNames.contains(indexName)},normalizeIndexData:function(indexData){indexData.keyPath=indexData.keyPath||indexData.name,indexData.unique=!!indexData.unique,indexData.multiEntry=!!indexData.multiEntry},indexComplies:function(actual,expected){return["keyPath","unique","multiEntry"].every(function(key){if("multiEntry"==key&&void 0===actual[key]&&!1===expected[key])return!0;if("keyPath"==key&&"[object Array]"==Object.prototype.toString.call(expected[key])){var exp=expected.keyPath,act=actual.keyPath;if("string"==typeof act)return exp.toString()==act;if("function"!=typeof act.contains&&"function"!=typeof act.indexOf)return!1;if(act.length!==exp.length)return!1;for(var i=0,m=exp.length;i<m;i++)if(!(act.contains&&act.contains(exp[i])||act.indexOf(-1!==exp[i])))return!1;return!0}return expected[key]==actual[key]})},iterate:function(onItem,options){options=mixin({index:null,order:"ASC",autoContinue:!0,filterDuplicates:!1,keyRange:null,writeAccess:!1,onEnd:null,onError:defaultErrorHandler,limit:1/0,offset:0,allowItemRejection:!1},options||{});var directionType="desc"==options.order.toLowerCase()?"PREV":"NEXT";options.filterDuplicates&&(directionType+="_NO_DUPLICATE");var hasSuccess=!1,cursorTransaction=this.db.transaction([this.storeName],this.consts[options.writeAccess?"READ_WRITE":"READ_ONLY"]),cursorTarget=cursorTransaction.objectStore(this.storeName);options.index&&(cursorTarget=cursorTarget.index(options.index));var recordCount=0;cursorTransaction.oncomplete=function(){if(!hasSuccess)return void options.onError(null);options.onEnd?options.onEnd():onItem(null)},cursorTransaction.onabort=options.onError,cursorTransaction.onerror=options.onError;var cursorRequest=cursorTarget.openCursor(options.keyRange,this.consts[directionType]);return cursorRequest.onerror=options.onError,cursorRequest.onsuccess=function(event){var cursor=event.target.result;if(cursor)if(options.offset)cursor.advance(options.offset),options.offset=0;else{var onItemReturn=onItem(cursor.value,cursor,cursorTransaction);options.allowItemRejection&&!1===onItemReturn||recordCount++,options.autoContinue&&(recordCount+options.offset<options.limit?cursor.continue():hasSuccess=!0)}else hasSuccess=!0},cursorTransaction},query:function(onSuccess,options){var result=[],processedItems=0;return options=options||{},options.autoContinue=!0,options.writeAccess=!1,options.allowItemRejection=!!options.filter,options.onEnd=function(){onSuccess(result,processedItems)},this.iterate(function(item){processedItems++;var accept=!options.filter||options.filter(item);return!1!==accept&&result.push(item),accept},options)},count:function(onSuccess,options){options=mixin({index:null,keyRange:null},options||{});var onError=options.onError||defaultErrorHandler,hasSuccess=!1,result=null,cursorTransaction=this.db.transaction([this.storeName],this.consts.READ_ONLY);cursorTransaction.oncomplete=function(){(hasSuccess?onSuccess:onError)(result)},cursorTransaction.onabort=onError,cursorTransaction.onerror=onError;var cursorTarget=cursorTransaction.objectStore(this.storeName);options.index&&(cursorTarget=cursorTarget.index(options.index));var countRequest=cursorTarget.count(options.keyRange);return countRequest.onsuccess=function(evt){hasSuccess=!0,result=evt.target.result},countRequest.onError=onError,cursorTransaction},makeKeyRange:function(options){var keyRange,hasLower=void 0!==options.lower,hasUpper=void 0!==options.upper,isOnly=void 0!==options.only;switch(!0){case isOnly:keyRange=this.keyRange.only(options.only);break;case hasLower&&hasUpper:keyRange=this.keyRange.bound(options.lower,options.upper,options.excludeLower,options.excludeUpper);break;case hasLower:keyRange=this.keyRange.lowerBound(options.lower,options.excludeLower);break;case hasUpper:keyRange=this.keyRange.upperBound(options.upper,options.excludeUpper);break;default:throw new Error('Cannot create KeyRange. Provide one or both of "lower" or "upper" value, or an "only" value.')}return keyRange}},empty={};return IDBStore.prototype=proto,IDBStore.version=proto.version,IDBStore},this)},{}],40:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;nBits>0;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;nBits>0;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?NaN:1/0*(s?-1:1);m+=Math.pow(2,mLen),e-=eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)},exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),value+=e+eBias>=1?rt/c:rt*Math.pow(2,1-eBias),value*c>=2&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):e+eBias>=1?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));mLen>=8;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<<mLen|m,eLen+=mLen;eLen>0;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}},{}],41:[function(require,module,exports){"function"==typeof Object.create?module.exports=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}},{}],42:[function(require,module,exports){var Readable=require("stream").Readable;exports.getIntersectionStream=function(sortedSets){for(var s=new Readable,i=0,ii=[],k=0;k<sortedSets.length;k++)ii[k]=0;if(0===sortedSets.length);else if(1===sortedSets.length)sortedSets[0].forEach(function(item){s.push(item+"")});else for(var finished=!1;!finished;)if(sortedSets[i][ii[i]]<sortedSets[i+1][ii[i+1]])ii[i]++;else if(sortedSets[i][ii[i]]>sortedSets[i+1][ii[i+1]])ii[i+1]++;else if(i+2<sortedSets.length)ii[i]++,i++;else{s.push(sortedSets[i][ii[i]]+""),ii[i]++,ii[i+1]++;for(var k=0;k<sortedSets.length;k++)ii[k]>=sortedSets[k].length&&(finished=!0);i=0}return s.push(null),s}},{stream:127}],43:[function(require,module,exports){function isBuffer(obj){return!!obj.constructor&&"function"==typeof obj.constructor.isBuffer&&obj.constructor.isBuffer(obj)}function isSlowBuffer(obj){return"function"==typeof obj.readFloatLE&&"function"==typeof obj.slice&&isBuffer(obj.slice(0,0))}module.exports=function(obj){return null!=obj&&(isBuffer(obj)||isSlowBuffer(obj)||!!obj._isBuffer)}},{}],44:[function(require,module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},{}],45:[function(require,module,exports){function isBuffer(o){return Buffer.isBuffer(o)||/\[object (.+Array|Array.+)\]/.test(Object.prototype.toString.call(o))}var Buffer=require("buffer").Buffer;module.exports=isBuffer},{buffer:9}],46:[function(require,module,exports){(function(Buffer){function Parser(){this.tState=START,this.value=void 0,this.string=void 0,this.stringBuffer=Buffer.alloc?Buffer.alloc(STRING_BUFFER_SIZE):new Buffer(STRING_BUFFER_SIZE),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=VALUE,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new Buffer(2),3:new Buffer(3),4:new Buffer(4)},this.offset=-1}var C={},LEFT_BRACE=C.LEFT_BRACE=1,RIGHT_BRACE=C.RIGHT_BRACE=2,LEFT_BRACKET=C.LEFT_BRACKET=3,RIGHT_BRACKET=C.RIGHT_BRACKET=4,COLON=C.COLON=5,COMMA=C.COMMA=6,TRUE=C.TRUE=7,FALSE=C.FALSE=8,NULL=C.NULL=9,STRING=C.STRING=10,NUMBER=C.NUMBER=11,START=C.START=17,STOP=C.STOP=18,TRUE1=C.TRUE1=33,TRUE2=C.TRUE2=34,TRUE3=C.TRUE3=35,FALSE1=C.FALSE1=49,FALSE2=C.FALSE2=50,FALSE3=C.FALSE3=51,FALSE4=C.FALSE4=52,NULL1=C.NULL1=65,NULL2=C.NULL2=66,NULL3=C.NULL3=67,NUMBER1=C.NUMBER1=81,NUMBER3=C.NUMBER3=83,STRING1=C.STRING1=97,STRING2=C.STRING2=98,STRING3=C.STRING3=99,STRING4=C.STRING4=100,STRING5=C.STRING5=101,STRING6=C.STRING6=102,VALUE=C.VALUE=113,KEY=C.KEY=114,OBJECT=C.OBJECT=129,ARRAY=C.ARRAY=130,BACK_SLASH="\\".charCodeAt(0),FORWARD_SLASH="/".charCodeAt(0),BACKSPACE="\b".charCodeAt(0),FORM_FEED="\f".charCodeAt(0),NEWLINE="\n".charCodeAt(0),CARRIAGE_RETURN="\r".charCodeAt(0),TAB="\t".charCodeAt(0),STRING_BUFFER_SIZE=65536;Parser.toknam=function(code){for(var keys=Object.keys(C),i=0,l=keys.length;i<l;i++){var key=keys[i];if(C[key]===code)return key}return code&&"0x"+code.toString(16)};var proto=Parser.prototype;proto.onError=function(err){throw err},proto.charError=function(buffer,i){this.tState=STOP,this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(buffer[i]))+" at position "+i+" in state "+Parser.toknam(this.tState)))},proto.appendStringChar=function(char){this.stringBufferOffset>=STRING_BUFFER_SIZE&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=char},proto.appendStringBuf=function(buf,start,end){var size=buf.length;"number"==typeof start&&(size="number"==typeof end?end<0?buf.length-start+end:end-start:buf.length-start),size<0&&(size=0),this.stringBufferOffset+size>STRING_BUFFER_SIZE&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),buf.copy(this.stringBuffer,this.stringBufferOffset,start,end),this.stringBufferOffset+=size},proto.write=function(buffer){"string"==typeof buffer&&(buffer=new Buffer(buffer));for(var n,i=0,l=buffer.length;i<l;i++)if(this.tState===START){if(n=buffer[i],this.offset++,123===n)this.onToken(LEFT_BRACE,"{");else if(125===n)this.onToken(RIGHT_BRACE,"}");else if(91===n)this.onToken(LEFT_BRACKET,"[");else if(93===n)this.onToken(RIGHT_BRACKET,"]");else if(58===n)this.onToken(COLON,":");else if(44===n)this.onToken(COMMA,",");else if(116===n)this.tState=TRUE1;else if(102===n)this.tState=FALSE1;else if(110===n)this.tState=NULL1;else if(34===n)this.string="",this.stringBufferOffset=0,this.tState=STRING1;else if(45===n)this.string="-",this.tState=NUMBER1;else if(n>=48&&n<64)this.string=String.fromCharCode(n),this.tState=NUMBER3;else if(32!==n&&9!==n&&10!==n&&13!==n)return this.charError(buffer,i)}else if(this.tState===STRING1)if(n=buffer[i],this.bytes_remaining>0){for(var j=0;j<this.bytes_remaining;j++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+j]=buffer[j];this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]),this.bytes_in_sequence=this.bytes_remaining=0,i=i+j-1}else if(0===this.bytes_remaining&&n>=128){if(n<=193||n>244)return this.onError(new Error("Invalid UTF-8 character at position "+i+" in state "+Parser.toknam(this.tState)));if(n>=194&&n<=223&&(this.bytes_in_sequence=2),n>=224&&n<=239&&(this.bytes_in_sequence=3),n>=240&&n<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+i>buffer.length){for(var k=0;k<=buffer.length-1-i;k++)this.temp_buffs[this.bytes_in_sequence][k]=buffer[i+k];this.bytes_remaining=i+this.bytes_in_sequence-buffer.length,i=buffer.length-1}else this.appendStringBuf(buffer,i,i+this.bytes_in_sequence),i=i+this.bytes_in_sequence-1}else if(34===n)this.tState=START,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(STRING,this.string),this.offset+=Buffer.byteLength(this.string,"utf8")+1,this.string=void 0;else if(92===n)this.tState=STRING2;else{if(!(n>=32))return this.charError(buffer,i);this.appendStringChar(n)}else if(this.tState===STRING2)if(34===(n=buffer[i]))this.appendStringChar(n),this.tState=STRING1;else if(92===n)this.appendStringChar(BACK_SLASH),this.tState=STRING1;else if(47===n)this.appendStringChar(FORWARD_SLASH),this.tState=STRING1;else if(98===n)this.appendStringChar(BACKSPACE),this.tState=STRING1;else if(102===n)this.appendStringChar(FORM_FEED),this.tState=STRING1;else if(110===n)this.appendStringChar(NEWLINE),this.tState=STRING1;else if(114===n)this.appendStringChar(CARRIAGE_RETURN),this.tState=STRING1;else if(116===n)this.appendStringChar(TAB),this.tState=STRING1;else{if(117!==n)return this.charError(buffer,i);this.unicode="",this.tState=STRING3}else if(this.tState===STRING3||this.tState===STRING4||this.tState===STRING5||this.tState===STRING6){if(!((n=buffer[i])>=48&&n<64||n>64&&n<=70||n>96&&n<=102))return this.charError(buffer,i);if(this.unicode+=String.fromCharCode(n),this.tState++===STRING6){var intVal=parseInt(this.unicode,16);this.unicode=void 0,void 0!==this.highSurrogate&&intVal>=56320&&intVal<57344?(this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate,intVal))),this.highSurrogate=void 0):void 0===this.highSurrogate&&intVal>=55296&&intVal<56320?this.highSurrogate=intVal:(void 0!==this.highSurrogate&&(this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new Buffer(String.fromCharCode(intVal)))),this.tState=STRING1}}else if(this.tState===NUMBER1||this.tState===NUMBER3)switch(n=buffer[i]){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(n),this.tState=NUMBER3;break;default:this.tState=START;var result=Number(this.string);if(isNaN(result))return this.charError(buffer,i);this.string.match(/[0-9]+/)==this.string&&result.toString()!=this.string?this.onToken(STRING,this.string):this.onToken(NUMBER,result),this.offset+=this.string.length-1,this.string=void 0,i--}else if(this.tState===TRUE1){if(114!==buffer[i])return this.charError(buffer,i);this.tState=TRUE2}else if(this.tState===TRUE2){if(117!==buffer[i])return this.charError(buffer,i);this.tState=TRUE3}else if(this.tState===TRUE3){if(101!==buffer[i])return this.charError(buffer,i);this.tState=START,this.onToken(TRUE,!0),this.offset+=3}else if(this.tState===FALSE1){if(97!==buffer[i])return this.charError(buffer,i);this.tState=FALSE2}else if(this.tState===FALSE2){if(108!==buffer[i])return this.charError(buffer,i);this.tState=FALSE3}else if(this.tState===FALSE3){if(115!==buffer[i])return this.charError(buffer,i);this.tState=FALSE4}else if(this.tState===FALSE4){if(101!==buffer[i])return this.charError(buffer,i);this.tState=START,this.onToken(FALSE,!1),this.offset+=4}else if(this.tState===NULL1){if(117!==buffer[i])return this.charError(buffer,i);this.tState=NULL2}else if(this.tState===NULL2){if(108!==buffer[i])return this.charError(buffer,i);this.tState=NULL3}else if(this.tState===NULL3){if(108!==buffer[i])return this.charError(buffer,i);this.tState=START,this.onToken(NULL,null),this.offset+=3}},proto.onToken=function(token,value){},proto.parseError=function(token,value){this.tState=STOP,this.onError(new Error("Unexpected "+Parser.toknam(token)+(value?"("+JSON.stringify(value)+")":"")+" in state "+Parser.toknam(this.state)))},proto.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},proto.pop=function(){var value=this.value,parent=this.stack.pop();this.value=parent.value,this.key=parent.key,this.mode=parent.mode,this.emit(value),this.mode||(this.state=VALUE)},proto.emit=function(value){this.mode&&(this.state=COMMA),this.onValue(value)},proto.onValue=function(value){},proto.onToken=function(token,value){if(this.state===VALUE)if(token===STRING||token===NUMBER||token===TRUE||token===FALSE||token===NULL)this.value&&(this.value[this.key]=value),this.emit(value);else if(token===LEFT_BRACE)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=KEY,this.mode=OBJECT;else if(token===LEFT_BRACKET)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=ARRAY,this.state=VALUE;else if(token===RIGHT_BRACE){if(this.mode!==OBJECT)return this.parseError(token,value);this.pop()}else{if(token!==RIGHT_BRACKET)return this.parseError(token,value);if(this.mode!==ARRAY)return this.parseError(token,value);this.pop()}else if(this.state===KEY)if(token===STRING)this.key=value,this.state=COLON;else{if(token!==RIGHT_BRACE)return this.parseError(token,value);this.pop()}else if(this.state===COLON){if(token!==COLON)return this.parseError(token,value);this.state=VALUE}else{if(this.state!==COMMA)return this.parseError(token,value);if(token===COMMA)this.mode===ARRAY?(this.key++,this.state=VALUE):this.mode===OBJECT&&(this.state=KEY);else{if(!(token===RIGHT_BRACKET&&this.mode===ARRAY||token===RIGHT_BRACE&&this.mode===OBJECT))return this.parseError(token,value);this.pop()}}},Parser.C=C,module.exports=Parser}).call(this,require("buffer").Buffer)},{buffer:9}],47:[function(require,module,exports){function Codec(opts){this.opts=opts||{},this.encodings=encodings}var encodings=require("./lib/encodings");module.exports=Codec,Codec.prototype._encoding=function(encoding){return"string"==typeof encoding&&(encoding=encodings[encoding]),encoding||(encoding=encodings.id),encoding},Codec.prototype._keyEncoding=function(opts,batchOpts){return this._encoding(batchOpts&&batchOpts.keyEncoding||opts&&opts.keyEncoding||this.opts.keyEncoding)},Codec.prototype._valueEncoding=function(opts,batchOpts){return this._encoding(batchOpts&&(batchOpts.valueEncoding||batchOpts.encoding)||opts&&(opts.valueEncoding||opts.encoding)||this.opts.valueEncoding||this.opts.encoding)},Codec.prototype.encodeKey=function(key,opts,batchOpts){return this._keyEncoding(opts,batchOpts).encode(key)},Codec.prototype.encodeValue=function(value,opts,batchOpts){return this._valueEncoding(opts,batchOpts).encode(value)},Codec.prototype.decodeKey=function(key,opts){return this._keyEncoding(opts).decode(key)},Codec.prototype.decodeValue=function(value,opts){return this._valueEncoding(opts).decode(value)},Codec.prototype.encodeBatch=function(ops,opts){var self=this;return ops.map(function(_op){var op={type:_op.type,key:self.encodeKey(_op.key,opts,_op)};return self.keyAsBuffer(opts,_op)&&(op.keyEncoding="binary"),_op.prefix&&(op.prefix=_op.prefix),"value"in _op&&(op.value=self.encodeValue(_op.value,opts,_op),self.valueAsBuffer(opts,_op)&&(op.valueEncoding="binary")),op})};var ltgtKeys=["lt","gt","lte","gte","start","end"];Codec.prototype.encodeLtgt=function(ltgt){var self=this,ret={};return Object.keys(ltgt).forEach(function(key){ret[key]=ltgtKeys.indexOf(key)>-1?self.encodeKey(ltgt[key],ltgt):ltgt[key]}),ret},Codec.prototype.createStreamDecoder=function(opts){var self=this;return opts.keys&&opts.values?function(key,value){return{key:self.decodeKey(key,opts),value:self.decodeValue(value,opts)}}:opts.keys?function(key){return self.decodeKey(key,opts)}:opts.values?function(_,value){return self.decodeValue(value,opts)}:function(){}},Codec.prototype.keyAsBuffer=function(opts){return this._keyEncoding(opts).buffer},Codec.prototype.valueAsBuffer=function(opts){return this._valueEncoding(opts).buffer}},{"./lib/encodings":48}],48:[function(require,module,exports){(function(Buffer){function identity(value){return value}function isBinary(data){return void 0===data||null===data||Buffer.isBuffer(data)}exports.utf8=exports["utf-8"]={encode:function(data){return isBinary(data)?data:String(data)},decode:identity,buffer:!1,type:"utf8"},exports.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},exports.binary={encode:function(data){return isBinary(data)?data:new Buffer(data)},decode:identity,buffer:!0,type:"binary"},exports.id={encode:function(data){return data},decode:function(data){return data},buffer:!1,type:"id"},["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"].forEach(function(type){exports[type]={encode:function(data){return isBinary(data)?data:new Buffer(data,type)},decode:function(buffer){return buffer.toString(type)},buffer:!0,type:type}})}).call(this,require("buffer").Buffer)},{buffer:9}],49:[function(require,module,exports){var createError=require("errno").create,LevelUPError=createError("LevelUPError"),NotFoundError=createError("NotFoundError",LevelUPError);NotFoundError.prototype.notFound=!0,NotFoundError.prototype.status=404,module.exports={LevelUPError:LevelUPError,InitializationError:createError("InitializationError",LevelUPError),OpenError:createError("OpenError",LevelUPError),ReadError:createError("ReadError",LevelUPError),WriteError:createError("WriteError",LevelUPError),NotFoundError:NotFoundError,EncodingError:createError("EncodingError",LevelUPError)}},{errno:36}],50:[function(require,module,exports){function ReadStream(iterator,options){if(!(this instanceof ReadStream))return new ReadStream(iterator,options);Readable.call(this,extend(options,{objectMode:!0})),this._iterator=iterator,this._destroyed=!1,this._decoder=null,options&&options.decoder&&(this._decoder=options.decoder),this.on("end",this._cleanup.bind(this))}var inherits=require("inherits"),Readable=require("readable-stream").Readable,extend=require("xtend"),EncodingError=require("level-errors").EncodingError;module.exports=ReadStream,inherits(ReadStream,Readable),ReadStream.prototype._read=function(){var self=this;this._destroyed||this._iterator.next(function(err,key,value){if(!self._destroyed){if(err)return self.emit("error",err);if(void 0===key&&void 0===value)self.push(null);else{if(!self._decoder)return self.push({key:key,value:value});try{var value=self._decoder(key,value)}catch(err){return self.emit("error",new EncodingError(err)),void self.push(null)}self.push(value)}}})},ReadStream.prototype.destroy=ReadStream.prototype._cleanup=function(){var self=this;this._destroyed||(this._destroyed=!0,this._iterator.end(function(err){if(err)return self.emit("error",err);self.emit("close")}))}},{inherits:41,"level-errors":49,"readable-stream":57,xtend:139}],51:[function(require,module,exports){module.exports=Array.isArray||function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}},{}],52:[function(require,module,exports){(function(process){function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options),Writable.call(this,options),options&&!1===options.readable&&(this.readable=!1),options&&!1===options.writable&&(this.writable=!1),this.allowHalfOpen=!0,options&&!1===options.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||process.nextTick(this.end.bind(this))}module.exports=Duplex;var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys},util=require("core-util-is");util.inherits=require("inherits");var Readable=require("./_stream_readable"),Writable=require("./_stream_writable");util.inherits(Duplex,Readable),function(xs,f){for(var i=0,l=xs.length;i<l;i++)f(xs[i],i)}(objectKeys(Writable.prototype),function(method){Duplex.prototype[method]||(Duplex.prototype[method]=Writable.prototype[method])})}).call(this,require("_process"))},{"./_stream_readable":54,"./_stream_writable":56,_process:86,"core-util-is":11,inherits:41}],53:[function(require,module,exports){function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=require("./_stream_transform"),util=require("core-util-is");util.inherits=require("inherits"),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},{"./_stream_transform":55,"core-util-is":11,inherits:41}],54:[function(require,module,exports){(function(process){function ReadableState(options,stream){var Duplex=require("./_stream_duplex");options=options||{};var hwm=options.highWaterMark,defaultHwm=options.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode),this.defaultEncoding=options.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=require("string_decoder/").StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){require("./_stream_duplex");if(!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,Stream.call(this)}function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er)stream.emit("error",er);else if(util.isNullOrUndefined(chunk))state.reading=!1,state.ended||onEofChunk(stream,state);else if(state.objectMode||chunk&&chunk.length>0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk)),addToFront||(state.reading=!1),state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state);else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||0===state.length)}function roundUpToNextPowerOf2(n){if(n>=MAX_HWM)n=MAX_HWM;else{n--;for(var p=1;p<32;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){return 0===state.length&&state.ended?0:state.objectMode?0===n?0:1:isNaN(n)||util.isNull(n)?state.flowing&&state.buffer.length?state.buffer[0].length:state.length:n<=0?0:(n>state.highWaterMark&&(state.highWaterMark=roundUpToNextPowerOf2(n)),n>state.length?state.ended?state.length:(state.needReadable=!0,0):n)}function chunkInvalid(state,chunk){var er=null;return util.isBuffer(chunk)||util.isString(chunk)||util.isNullOrUndefined(chunk)||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?process.nextTick(function(){emitReadable_(stream)}):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,process.nextTick(function(){maybeReadMore_(stream,state)}))}function maybeReadMore_(stream,state){
  for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark&&(debug("maybeReadMore read 0"),stream.read(0),len!==state.length);)len=state.length;state.readingMore=!1}function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain),state.awaitDrain&&state.awaitDrain--,0===state.awaitDrain&&EE.listenerCount(src,"data")&&(state.flowing=!0,flow(src))}}function resume(stream,state){state.resumeScheduled||(state.resumeScheduled=!0,process.nextTick(function(){resume_(stream,state)}))}function resume_(stream,state){state.resumeScheduled=!1,stream.emit("resume"),flow(stream),state.flowing&&!state.reading&&stream.read(0)}function flow(stream){var state=stream._readableState;if(debug("flow",state.flowing),state.flowing)do{var chunk=stream.read()}while(null!==chunk&&state.flowing)}function fromList(n,state){var ret,list=state.buffer,length=state.length,stringMode=!!state.decoder,objectMode=!!state.objectMode;if(0===list.length)return null;if(0===length)ret=null;else if(objectMode)ret=list.shift();else if(!n||n>=length)ret=stringMode?list.join(""):Buffer.concat(list,length),list.length=0;else if(n<list[0].length){var buf=list[0];ret=buf.slice(0,n),list[0]=buf.slice(n)}else if(n===list[0].length)ret=list.shift();else{ret=stringMode?"":new Buffer(n);for(var c=0,i=0,l=list.length;i<l&&c<n;i++){var buf=list[0],cpy=Math.min(n-c,buf.length);stringMode?ret+=buf.slice(0,cpy):buf.copy(ret,c,0,cpy),cpy<buf.length?list[0]=buf.slice(cpy):list.shift(),c+=cpy}}return ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error("endReadable called on non-empty stream");state.endEmitted||(state.ended=!0,process.nextTick(function(){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}))}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++)f(xs[i],i)}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++)if(xs[i]===x)return i;return-1}module.exports=Readable;var isArray=require("isarray"),Buffer=require("buffer").Buffer;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter;EE.listenerCount||(EE.listenerCount=function(emitter,type){return emitter.listeners(type).length});var Stream=require("stream"),util=require("core-util-is");util.inherits=require("inherits");var StringDecoder,debug=require("util");debug=debug&&debug.debuglog?debug.debuglog("stream"):function(){},util.inherits(Readable,Stream),Readable.prototype.push=function(chunk,encoding){var state=this._readableState;return util.isString(chunk)&&!state.objectMode&&(encoding=encoding||state.defaultEncoding)!==state.encoding&&(chunk=new Buffer(chunk,encoding),encoding=""),readableAddChunk(this,state,chunk,encoding,!1)},Readable.prototype.unshift=function(chunk){return readableAddChunk(this,this._readableState,chunk,"",!0)},Readable.prototype.setEncoding=function(enc){return StringDecoder||(StringDecoder=require("string_decoder/").StringDecoder),this._readableState.decoder=new StringDecoder(enc),this._readableState.encoding=enc,this};var MAX_HWM=8388608;Readable.prototype.read=function(n){debug("read",n);var state=this._readableState,nOrig=n;if((!util.isNumber(n)||n>0)&&(state.emittedReadable=!1),0===n&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n<state.highWaterMark)&&(doRead=!0,debug("length less than watermark",doRead)),(state.ended||state.reading)&&(doRead=!1,debug("reading or ended",doRead)),doRead&&(debug("do read"),state.reading=!0,state.sync=!0,0===state.length&&(state.needReadable=!0),this._read(state.highWaterMark),state.sync=!1),doRead&&!state.reading&&(n=howMuchToRead(nOrig,state));var ret;return ret=n>0?fromList(n,state):null,util.isNull(ret)&&(state.needReadable=!0,n=0),state.length-=n,0!==state.length||state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&0===state.length&&endReadable(this),util.isNull(ret)||this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),!1===dest.write(chunk)&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EE.listenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||!1!==pipeOpts.end)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?process.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);return dest.on("drain",ondrain),src.on("data",ondata),dest._events&&dest._events.error?isArray(dest._events.error)?dest._events.error.unshift(onerror):dest._events.error=[onerror,dest._events.error]:dest.on("error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i<len;i++)dests[i].emit("unpipe",this);return this}var i=indexOf(state.pipes,dest);return-1===i?this:(state.pipes.splice(i,1),state.pipesCount-=1,1===state.pipesCount&&(state.pipes=state.pipes[0]),dest.emit("unpipe",this),this)},Readable.prototype.on=function(ev,fn){var res=Stream.prototype.on.call(this,ev,fn);if("data"===ev&&!1!==this._readableState.flowing&&this.resume(),"readable"===ev&&this.readable){var state=this._readableState;if(!state.readableListening)if(state.readableListening=!0,state.emittedReadable=!1,state.needReadable=!0,state.reading)state.length&&emitReadable(this);else{var self=this;process.nextTick(function(){debug("readable nexttick read 0"),self.read(0)})}}return res},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.resume=function(){var state=this._readableState;return state.flowing||(debug("resume"),state.flowing=!0,state.reading||(debug("resume read 0"),this.read(0)),resume(this,state)),this},Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Readable.prototype.wrap=function(stream){var state=this._readableState,paused=!1,self=this;stream.on("end",function(){if(debug("wrapped end"),state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&self.push(chunk)}self.push(null)}),stream.on("data",function(chunk){if(debug("wrapped data"),state.decoder&&(chunk=state.decoder.write(chunk)),chunk&&(state.objectMode||chunk.length)){self.push(chunk)||(paused=!0,stream.pause())}});for(var i in stream)util.isFunction(stream[i])&&util.isUndefined(this[i])&&(this[i]=function(method){return function(){return stream[method].apply(stream,arguments)}}(i));return forEach(["error","close","destroy","pause","resume"],function(ev){stream.on(ev,self.emit.bind(self,ev))}),self._read=function(n){debug("wrapped _read",n),paused&&(paused=!1,stream.resume())},self},Readable._fromList=fromList}).call(this,require("_process"))},{"./_stream_duplex":52,_process:86,buffer:9,"core-util-is":11,events:38,inherits:41,isarray:51,stream:127,"string_decoder/":58,util:7}],55:[function(require,module,exports){function TransformState(options,stream){this.afterTransform=function(er,data){return afterTransform(stream,er,data)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function afterTransform(stream,er,data){var ts=stream._transformState;ts.transforming=!1;var cb=ts.writecb;if(!cb)return stream.emit("error",new Error("no writecb in Transform class"));ts.writechunk=null,ts.writecb=null,util.isNullOrUndefined(data)||stream.push(data),cb&&cb(er);var rs=stream._readableState;rs.reading=!1,(rs.needReadable||rs.length<rs.highWaterMark)&&stream._read(rs.highWaterMark)}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex.call(this,options),this._transformState=new TransformState(options,this);var stream=this;this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("prefinish",function(){util.isFunction(this._flush)?this._flush(function(er){done(stream,er)}):done(stream)})}function done(stream,er){if(er)return stream.emit("error",er);var ws=stream._writableState,ts=stream._transformState;if(ws.length)throw new Error("calling transform done when ws.length != 0");if(ts.transforming)throw new Error("calling transform done when still transforming");return stream.push(null)}module.exports=Transform;var Duplex=require("./_stream_duplex"),util=require("core-util-is");util.inherits=require("inherits"),util.inherits(Transform,Duplex),Transform.prototype.push=function(chunk,encoding){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,chunk,encoding)},Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("not implemented")},Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;if(ts.writecb=cb,ts.writechunk=chunk,ts.writeencoding=encoding,!ts.transforming){var rs=this._readableState;(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}},Transform.prototype._read=function(n){var ts=this._transformState;util.isNull(ts.writechunk)||!ts.writecb||ts.transforming?ts.needTransform=!0:(ts.transforming=!0,this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform))}},{"./_stream_duplex":52,"core-util-is":11,inherits:41}],56:[function(require,module,exports){(function(process){function WriteReq(chunk,encoding,cb){this.chunk=chunk,this.encoding=encoding,this.callback=cb}function WritableState(options,stream){var Duplex=require("./_stream_duplex");options=options||{};var hwm=options.highWaterMark,defaultHwm=options.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode),this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var noDecode=!1===options.decodeStrings;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream,er)},this.writecb=null,this.writelen=0,this.buffer=[],this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1}function Writable(options){var Duplex=require("./_stream_duplex");if(!(this instanceof Writable||this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,Stream.call(this)}function writeAfterEnd(stream,state,cb){var er=new Error("write after end");stream.emit("error",er),process.nextTick(function(){cb(er)})}function validChunk(stream,state,chunk,cb){var valid=!0;if(!(util.isBuffer(chunk)||util.isString(chunk)||util.isNullOrUndefined(chunk)||state.objectMode)){var er=new TypeError("Invalid non-string/buffer chunk");stream.emit("error",er),process.nextTick(function(){cb(er)}),valid=!1}return valid}function decodeChunk(state,chunk,encoding){return!state.objectMode&&!1!==state.decodeStrings&&util.isString(chunk)&&(chunk=new Buffer(chunk,encoding)),chunk}function writeOrBuffer(stream,state,chunk,encoding,cb){chunk=decodeChunk(state,chunk,encoding),util.isBuffer(chunk)&&(encoding="buffer");var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;return ret||(state.needDrain=!0),state.writing||state.corked?state.buffer.push(new WriteReq(chunk,encoding,cb)):doWrite(stream,state,!1,len,chunk,encoding,cb),ret}function doWrite(stream,state,writev,len,chunk,encoding,cb){state.writelen=len,state.writecb=cb,state.writing=!0,state.sync=!0,writev?stream._writev(chunk,state.onwrite):stream._write(chunk,encoding,state.onwrite),state.sync=!1}function onwriteError(stream,state,sync,er,cb){sync?process.nextTick(function(){state.pendingcb--,cb(er)}):(state.pendingcb--,cb(er)),stream._writableState.errorEmitted=!0,stream.emit("error",er)}function onwriteStateUpdate(state){state.writing=!1,state.writecb=null,state.length-=state.writelen,state.writelen=0}function onwrite(stream,er){var state=stream._writableState,sync=state.sync,cb=state.writecb;if(onwriteStateUpdate(state),er)onwriteError(stream,state,sync,er,cb);else{var finished=needFinish(stream,state);finished||state.corked||state.bufferProcessing||!state.buffer.length||clearBuffer(stream,state),sync?process.nextTick(function(){afterWrite(stream,state,finished,cb)}):afterWrite(stream,state,finished,cb)}}function afterWrite(stream,state,finished,cb){finished||onwriteDrain(stream,state),state.pendingcb--,cb(),finishMaybe(stream,state)}function onwriteDrain(stream,state){0===state.length&&state.needDrain&&(state.needDrain=!1,stream.emit("drain"))}function clearBuffer(stream,state){if(state.bufferProcessing=!0,stream._writev&&state.buffer.length>1){for(var cbs=[],c=0;c<state.buffer.length;c++)cbs.push(state.buffer[c].callback);state.pendingcb++,doWrite(stream,state,!0,state.length,state.buffer,"",function(err){for(var i=0;i<cbs.length;i++)state.pendingcb--,cbs[i](err)}),state.buffer=[]}else{for(var c=0;c<state.buffer.length;c++){var entry=state.buffer[c],chunk=entry.chunk,encoding=entry.encoding,cb=entry.callback,len=state.objectMode?1:chunk.length;if(doWrite(stream,state,!1,len,chunk,encoding,cb),state.writing){c++;break}}c<state.buffer.length?state.buffer=state.buffer.slice(c):state.buffer.length=0}state.bufferProcessing=!1}function needFinish(stream,state){return state.ending&&0===state.length&&!state.finished&&!state.writing}function prefinish(stream,state){state.prefinished||(state.prefinished=!0,stream.emit("prefinish"))}function finishMaybe(stream,state){var need=needFinish(stream,state);return need&&(0===state.pendingcb?(prefinish(stream,state),state.finished=!0,stream.emit("finish")):prefinish(stream,state)),need}function endWritable(stream,state,cb){state.ending=!0,finishMaybe(stream,state),cb&&(state.finished?process.nextTick(cb):stream.once("finish",cb)),state.ended=!0}module.exports=Writable;var Buffer=require("buffer").Buffer;Writable.WritableState=WritableState;var util=require("core-util-is");util.inherits=require("inherits");var Stream=require("stream");util.inherits(Writable,Stream),Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1;return util.isFunction(encoding)&&(cb=encoding,encoding=null),util.isBuffer(chunk)?encoding="buffer":encoding||(encoding=state.defaultEncoding),util.isFunction(cb)||(cb=function(){}),state.ended?writeAfterEnd(this,state,cb):validChunk(this,state,chunk,cb)&&(state.pendingcb++,ret=writeOrBuffer(this,state,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.buffer.length||clearBuffer(this,state))},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;util.isFunction(chunk)?(cb=chunk,chunk=null,encoding=null):util.isFunction(encoding)&&(cb=encoding,encoding=null),util.isNullOrUndefined(chunk)||this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)}}).call(this,require("_process"))},{"./_stream_duplex":52,_process:86,buffer:9,"core-util-is":11,inherits:41,stream:127}],57:[function(require,module,exports){(function(process){exports=module.exports=require("./lib/_stream_readable.js"),exports.Stream=require("stream"),exports.Readable=exports,exports.Writable=require("./lib/_stream_writable.js"),exports.Duplex=require("./lib/_stream_duplex.js"),exports.Transform=require("./lib/_stream_transform.js"),exports.PassThrough=require("./lib/_stream_passthrough.js"),process.browser||"disable"!==process.env.READABLE_STREAM||(module.exports=require("stream"))}).call(this,require("_process"))},{"./lib/_stream_duplex.js":52,"./lib/_stream_passthrough.js":53,"./lib/_stream_readable.js":54,"./lib/_stream_transform.js":55,"./lib/_stream_writable.js":56,_process:86,stream:127}],58:[function(require,module,exports){function assertEncoding(encoding){if(encoding&&!isBufferEncoding(encoding))throw new Error("Unknown encoding: "+encoding)}function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2,this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3,this.charLength=this.charReceived?3:0}var Buffer=require("buffer").Buffer,isBufferEncoding=Buffer.isEncoding||function(encoding){switch(encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},StringDecoder=exports.StringDecoder=function(encoding){switch(this.encoding=(encoding||"utf8").toLowerCase().replace(/[-_]/,""),assertEncoding(encoding),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=base64DetectIncompleteChar;break;default:return void(this.write=passThroughWrite)}this.charBuffer=new Buffer(6),this.charReceived=0,this.charLength=0};StringDecoder.prototype.write=function(buffer){for(var charStr="";this.charLength;){var available=buffer.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;if(buffer.copy(this.charBuffer,this.charReceived,0,available),this.charReceived+=available,this.charReceived<this.charLength)return"";buffer=buffer.slice(available,buffer.length),charStr=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var charCode=charStr.charCodeAt(charStr.length-1);if(!(charCode>=55296&&charCode<=56319)){if(this.charReceived=this.charLength=0,0===buffer.length)return charStr;break}this.charLength+=this.surrogateSize,charStr=""}this.detectIncompleteChar(buffer);var end=buffer.length;this.charLength&&(buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end),end-=this.charReceived),charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1,charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;return this.charLength+=size,this.charReceived+=size,this.charBuffer.copy(this.charBuffer,size,0,size),buffer.copy(this.charBuffer,0,0,size),charStr.substring(0,end)}return charStr},StringDecoder.prototype.detectIncompleteChar=function(buffer){for(var i=buffer.length>=3?3:buffer.length;i>0;i--){var c=buffer[buffer.length-i];if(1==i&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i},StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length&&(res=this.write(buffer)),this.charReceived){var cr=this.charReceived,buf=this.charBuffer,enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res}},{buffer:9}],59:[function(require,module,exports){(function(Buffer){function Level(location){if(!(this instanceof Level))return new Level(location);if(!location)throw new Error("constructor requires at least a location argument");this.IDBOptions={},this.location=location}module.exports=Level;var IDB=require("idb-wrapper"),AbstractLevelDOWN=require("abstract-leveldown").AbstractLevelDOWN,util=require("util"),Iterator=require("./iterator"),isBuffer=require("isbuffer"),xtend=require("xtend"),toBuffer=require("typedarray-to-buffer");util.inherits(Level,AbstractLevelDOWN),Level.prototype._open=function(options,callback){var self=this,idbOpts={storeName:this.location,autoIncrement:!1,keyPath:null,onStoreReady:function(){callback&&callback(null,self.idb)},onError:function(err){callback&&callback(err)}};xtend(idbOpts,options),this.IDBOptions=idbOpts,this.idb=new IDB(idbOpts)},Level.prototype._get=function(key,options,callback){this.idb.get(key,function(value){if(void 0===value)return callback(new Error("NotFound"));var asBuffer=!0;return!1===options.asBuffer&&(asBuffer=!1),options.raw&&(asBuffer=!1),asBuffer&&(value=value instanceof Uint8Array?toBuffer(value):new Buffer(String(value))),callback(null,value,key)},callback)},Level.prototype._del=function(id,options,callback){this.idb.remove(id,callback,callback)},Level.prototype._put=function(key,value,options,callback){value instanceof ArrayBuffer&&(value=toBuffer(new Uint8Array(value)));var obj=this.convertEncoding(key,value,options);Buffer.isBuffer(obj.value)&&("function"==typeof value.toArrayBuffer?obj.value=new Uint8Array(value.toArrayBuffer()):obj.value=new Uint8Array(value)),this.idb.put(obj.key,obj.value,function(){callback()},callback)},Level.prototype.convertEncoding=function(key,value,options){if(options.raw)return{key:key,value:value};if(value){var stringed=value.toString();"NaN"===stringed&&(value="NaN")}var valEnc=options.valueEncoding,obj={key:key,value:value};return!value||valEnc&&"binary"===valEnc||"object"!=typeof obj.value&&(obj.value=stringed),obj},Level.prototype.iterator=function(options){return"object"!=typeof options&&(options={}),new Iterator(this.idb,options)},Level.prototype._batch=function(array,options,callback){var i,k,copiedOp,currentOp,modified=[];if(0===array.length)return setTimeout(callback,0);for(i=0;i<array.length;i++){copiedOp={},currentOp=array[i],modified[i]=copiedOp;var converted=this.convertEncoding(currentOp.key,currentOp.value,options);currentOp.key=converted.key,currentOp.value=converted.value;for(k in currentOp)"type"===k&&"del"==currentOp[k]?copiedOp[k]="remove":copiedOp[k]=currentOp[k]}return this.idb.batch(modified,function(){callback()},callback)},Level.prototype._close=function(callback){this.idb.db.close(),callback()},Level.prototype._approximateSize=function(start,end,callback){var err=new Error("Not implemented");if(callback)return callback(err);throw err},Level.prototype._isBuffer=function(obj){return Buffer.isBuffer(obj)},Level.destroy=function(db,callback){if("object"==typeof db)var prefix=db.IDBOptions.storePrefix||"IDBWrapper-",dbname=db.location;else var prefix="IDBWrapper-",dbname=db;var request=indexedDB.deleteDatabase(prefix+dbname);request.onsuccess=function(){callback()},request.onerror=function(err){callback(err)}};Level.prototype._checkKeyValue=function(obj,type){return null===obj||void 0===obj?new Error(type+" cannot be `null` or `undefined`"):null===obj||void 0===obj?new Error(type+" cannot be `null` or `undefined`"):isBuffer(obj)&&0===obj.byteLength?new Error(type+" cannot be an empty ArrayBuffer"):""===String(obj)?new Error(type+" cannot be an empty String"):0===obj.length?new Error(type+" cannot be an empty Array"):void 0}}).call(this,require("buffer").Buffer)},{"./iterator":60,"abstract-leveldown":63,buffer:9,"idb-wrapper":39,isbuffer:45,"typedarray-to-buffer":133,util:137,xtend:70}],60:[function(require,module,exports){function Iterator(db,options){options||(options={}),this.options=options,AbstractIterator.call(this,db),this._order=options.reverse?"DESC":"ASC",this._limit=options.limit,this._count=0,this._done=!1;var lower=ltgt.lowerBound(options),upper=ltgt.upperBound(options);try{this._keyRange=lower||upper?this.db.makeKeyRange({lower:lower,upper:upper,excludeLower:ltgt.lowerBoundExclusive(options),excludeUpper:ltgt.upperBoundExclusive(options)}):null}catch(e){this._keyRangeError=!0}this.callback=null}var util=require("util"),AbstractIterator=require("abstract-leveldown").AbstractIterator,ltgt=require("ltgt");module.exports=Iterator,util.inherits(Iterator,AbstractIterator),Iterator.prototype.createIterator=function(){var self=this;self.iterator=self.db.iterate(function(){self.onItem.apply(self,arguments)},{keyRange:self._keyRange,autoContinue:!1,order:self._order,onError:function(err){console.log("horrible error",err)}})},Iterator.prototype.onItem=function(value,cursor,cursorTransaction){if(!cursor&&this.callback)return this.callback(),void(this.callback=!1);var shouldCall=!0;this._limit&&this._limit>0&&this._count++>=this._limit&&(shouldCall=!1),shouldCall&&this.callback(!1,cursor.key,cursor.value),cursor&&cursor.continue()},Iterator.prototype._next=function(callback){return callback?this._keyRangeError?callback():(this._started||(this.createIterator(),this._started=!0),void(this.callback=callback)):new Error("next() requires a callback argument")}},{"abstract-leveldown":63,ltgt:81,util:137}],61:[function(require,module,exports){(function(process){function AbstractChainedBatch(db){this._db=db,this._operations=[],this._written=!1}AbstractChainedBatch.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},AbstractChainedBatch.prototype.put=function(key,value){this._checkWritten();var err=this._db._checkKeyValue(key,"key",this._db._isBuffer);if(err)throw err;if(err=this._db._checkKeyValue(value,"value",this._db._isBuffer))throw err;return this._db._isBuffer(key)||(key=String(key)),this._db._isBuffer(value)||(value=String(value)),"function"==typeof this._put?this._put(key,value):this._operations.push({type:"put",key:key,value:value}),this},AbstractChainedBatch.prototype.del=function(key){this._checkWritten();var err=this._db._checkKeyValue(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),"function"==typeof this._del?this._del(key):this._operations.push({type:"del",key:key}),this},AbstractChainedBatch.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},AbstractChainedBatch.prototype.write=function(options,callback){if(this._checkWritten(),"function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("write() requires a callback argument");return"object"!=typeof options&&(options={}),this._written=!0,"function"==typeof this._write?this._write(callback):"function"==typeof this._db._batch?this._db._batch(this._operations,options,callback):void process.nextTick(callback)},module.exports=AbstractChainedBatch}).call(this,require("_process"))},{_process:86}],62:[function(require,module,exports){arguments[4][15][0].apply(exports,arguments)},{_process:86,dup:15}],63:[function(require,module,exports){(function(Buffer,process){function AbstractLevelDOWN(location){if(!arguments.length||void 0===location)throw new Error("constructor requires at least a location argument");if("string"!=typeof location)throw new Error("constructor requires a location string argument");this.location=location}var xtend=require("xtend"),AbstractIterator=require("./abstract-iterator"),AbstractChainedBatch=require("./abstract-chained-batch");AbstractLevelDOWN.prototype.open=function(options,callback){if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("open() requires a callback argument");if("object"!=typeof options&&(options={}),"function"==typeof this._open)return this._open(options,callback);process.nextTick(callback)},AbstractLevelDOWN.prototype.close=function(callback){if("function"!=typeof callback)throw new Error("close() requires a callback argument");if("function"==typeof this._close)return this._close(callback);process.nextTick(callback)},AbstractLevelDOWN.prototype.get=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("get() requires a callback argument");return(err=this._checkKeyValue(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),"function"==typeof this._get?this._get(key,options,callback):void process.nextTick(function(){callback(new Error("NotFound"))}))},AbstractLevelDOWN.prototype.put=function(key,value,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("put() requires a callback argument");return(err=this._checkKeyValue(key,"key",this._isBuffer))?callback(err):(err=this._checkKeyValue(value,"value",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),this._isBuffer(value)||process.browser||(value=String(value)),"object"!=typeof options&&(options={}),"function"==typeof this._put?this._put(key,value,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.del=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("del() requires a callback argument");return(err=this._checkKeyValue(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),"function"==typeof this._del?this._del(key,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.batch=function(array,options,callback){if(!arguments.length)return this._chainedBatch();if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(array))return callback(new Error("batch(array) requires an array argument"));"object"!=typeof options&&(options={});for(var e,err,i=0,l=array.length;i<l;i++)if("object"==typeof(e=array[i])){if(err=this._checkKeyValue(e.type,"type",this._isBuffer))return callback(err);if(err=this._checkKeyValue(e.key,"key",this._isBuffer))return callback(err);if("put"==e.type&&(err=this._checkKeyValue(e.value,"value",this._isBuffer)))return callback(err)}if("function"==typeof this._batch)return this._batch(array,options,callback);process.nextTick(callback)},AbstractLevelDOWN.prototype.approximateSize=function(start,end,callback){if(null==start||null==end||"function"==typeof start||"function"==typeof end)throw new Error("approximateSize() requires valid `start`, `end` and `callback` arguments")
  ;if("function"!=typeof callback)throw new Error("approximateSize() requires a callback argument");if(this._isBuffer(start)||(start=String(start)),this._isBuffer(end)||(end=String(end)),"function"==typeof this._approximateSize)return this._approximateSize(start,end,callback);process.nextTick(function(){callback(null,0)})},AbstractLevelDOWN.prototype._setupIteratorOptions=function(options){var self=this;return options=xtend(options),["start","end","gt","gte","lt","lte"].forEach(function(o){options[o]&&self._isBuffer(options[o])&&0===options[o].length&&delete options[o]}),options.reverse=!!options.reverse,options.reverse&&options.lt&&(options.start=options.lt),options.reverse&&options.lte&&(options.start=options.lte),!options.reverse&&options.gt&&(options.start=options.gt),!options.reverse&&options.gte&&(options.start=options.gte),(options.reverse&&options.lt&&!options.lte||!options.reverse&&options.gt&&!options.gte)&&(options.exclusiveStart=!0),options},AbstractLevelDOWN.prototype.iterator=function(options){return"object"!=typeof options&&(options={}),options=this._setupIteratorOptions(options),"function"==typeof this._iterator?this._iterator(options):new AbstractIterator(this)},AbstractLevelDOWN.prototype._chainedBatch=function(){return new AbstractChainedBatch(this)},AbstractLevelDOWN.prototype._isBuffer=function(obj){return Buffer.isBuffer(obj)},AbstractLevelDOWN.prototype._checkKeyValue=function(obj,type){if(null===obj||void 0===obj)return new Error(type+" cannot be `null` or `undefined`");if(this._isBuffer(obj)){if(0===obj.length)return new Error(type+" cannot be an empty Buffer")}else if(""===String(obj))return new Error(type+" cannot be an empty String")},module.exports.AbstractLevelDOWN=AbstractLevelDOWN,module.exports.AbstractIterator=AbstractIterator,module.exports.AbstractChainedBatch=AbstractChainedBatch}).call(this,{isBuffer:require("../../../is-buffer/index.js")},require("_process"))},{"../../../is-buffer/index.js":43,"./abstract-chained-batch":61,"./abstract-iterator":62,_process:86,xtend:64}],64:[function(require,module,exports){function extend(){for(var target={},i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source)source.hasOwnProperty(key)&&(target[key]=source[key])}return target}module.exports=extend},{}],65:[function(require,module,exports){var hasOwn=Object.prototype.hasOwnProperty,toString=Object.prototype.toString,isFunction=function(fn){var isFunc="function"==typeof fn&&!(fn instanceof RegExp)||"[object Function]"===toString.call(fn);return isFunc||"undefined"==typeof window||(isFunc=fn===window.setTimeout||fn===window.alert||fn===window.confirm||fn===window.prompt),isFunc};module.exports=function(obj,fn){if(!isFunction(fn))throw new TypeError("iterator must be a function");var i,k,isString="string"==typeof obj,l=obj.length,context=arguments.length>2?arguments[2]:null;if(l===+l)for(i=0;i<l;i++)null===context?fn(isString?obj.charAt(i):obj[i],i,obj):fn.call(context,isString?obj.charAt(i):obj[i],i,obj);else for(k in obj)hasOwn.call(obj,k)&&(null===context?fn(obj[k],k,obj):fn.call(context,obj[k],k,obj))}},{}],66:[function(require,module,exports){module.exports=Object.keys||require("./shim")},{"./shim":68}],67:[function(require,module,exports){var toString=Object.prototype.toString;module.exports=function(value){var str=toString.call(value),isArguments="[object Arguments]"===str;return isArguments||(isArguments="[object Array]"!==str&&null!==value&&"object"==typeof value&&"number"==typeof value.length&&value.length>=0&&"[object Function]"===toString.call(value.callee)),isArguments}},{}],68:[function(require,module,exports){!function(){"use strict";var keysShim,has=Object.prototype.hasOwnProperty,toString=Object.prototype.toString,forEach=require("./foreach"),isArgs=require("./isArguments"),hasDontEnumBug=!{toString:null}.propertyIsEnumerable("toString"),hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];keysShim=function(object){var isObject=null!==object&&"object"==typeof object,isFunction="[object Function]"===toString.call(object),isArguments=isArgs(object),theKeys=[];if(!isObject&&!isFunction&&!isArguments)throw new TypeError("Object.keys called on a non-object");if(isArguments)forEach(object,function(value){theKeys.push(value)});else{var name,skipProto=hasProtoEnumBug&&isFunction;for(name in object)skipProto&&"prototype"===name||!has.call(object,name)||theKeys.push(name)}if(hasDontEnumBug){var ctor=object.constructor,skipConstructor=ctor&&ctor.prototype===object;forEach(dontEnums,function(dontEnum){skipConstructor&&"constructor"===dontEnum||!has.call(object,dontEnum)||theKeys.push(dontEnum)})}return theKeys},module.exports=keysShim}()},{"./foreach":65,"./isArguments":67}],69:[function(require,module,exports){function hasKeys(source){return null!==source&&("object"==typeof source||"function"==typeof source)}module.exports=hasKeys},{}],70:[function(require,module,exports){function extend(){for(var target={},i=0;i<arguments.length;i++){var source=arguments[i];if(hasKeys(source))for(var keys=Keys(source),j=0;j<keys.length;j++){var name=keys[j];target[name]=source[name]}}return target}var Keys=require("object-keys"),hasKeys=require("./has-keys");module.exports=extend},{"./has-keys":69,"object-keys":66}],71:[function(require,module,exports){function Batch(levelup,codec){this._levelup=levelup,this._codec=codec,this.batch=levelup.db.batch(),this.ops=[],this.length=0}var util=require("./util"),WriteError=require("level-errors").WriteError,getOptions=util.getOptions,dispatchError=util.dispatchError;Batch.prototype.put=function(key_,value_,options){options=getOptions(options);var key=this._codec.encodeKey(key_,options),value=this._codec.encodeValue(value_,options);try{this.batch.put(key,value)}catch(e){throw new WriteError(e)}return this.ops.push({type:"put",key:key,value:value}),this.length++,this},Batch.prototype.del=function(key_,options){options=getOptions(options);var key=this._codec.encodeKey(key_,options);try{this.batch.del(key)}catch(err){throw new WriteError(err)}return this.ops.push({type:"del",key:key}),this.length++,this},Batch.prototype.clear=function(){try{this.batch.clear()}catch(err){throw new WriteError(err)}return this.ops=[],this.length=0,this},Batch.prototype.write=function(callback){var levelup=this._levelup,ops=this.ops;try{this.batch.write(function(err){if(err)return dispatchError(levelup,new WriteError(err),callback);levelup.emit("batch",ops),callback&&callback()})}catch(err){throw new WriteError(err)}},module.exports=Batch},{"./util":73,"level-errors":49}],72:[function(require,module,exports){(function(process){function getCallback(options,callback){return"function"==typeof options?options:callback}function LevelUP(location,options,callback){if(!(this instanceof LevelUP))return new LevelUP(location,options,callback);var error;if(EventEmitter.call(this),this.setMaxListeners(1/0),"function"==typeof location?(options="object"==typeof options?options:{},options.db=location,location=null):"object"==typeof location&&"function"==typeof location.db&&(options=location,location=null),"function"==typeof options&&(callback=options,options={}),(!options||"function"!=typeof options.db)&&"string"!=typeof location){if(error=new InitializationError("Must provide a location for the database"),callback)return process.nextTick(function(){callback(error)});throw error}options=getOptions(options),this.options=extend(defaultOptions,options),this._codec=new Codec(this.options),this._status="new",prr(this,"location",location,"e"),this.open(callback)}function maybeError(db,options,callback){if(!db._isOpening()&&!db.isOpen())return dispatchError(db,new ReadError("Database is not open"),callback),!0}function writeError(db,message,callback){dispatchError(db,new WriteError(message),callback)}function readError(db,message,callback){dispatchError(db,new ReadError(message),callback)}function utilStatic(name){return function(location,callback){getLevelDOWN()[name](location,callback||function(){})}}var EventEmitter=require("events").EventEmitter,inherits=require("util").inherits,deprecate=require("util").deprecate,extend=require("xtend"),prr=require("prr"),DeferredLevelDOWN=require("deferred-leveldown"),IteratorStream=require("level-iterator-stream"),errors=require("level-errors"),WriteError=errors.WriteError,ReadError=errors.ReadError,NotFoundError=errors.NotFoundError,OpenError=errors.OpenError,EncodingError=errors.EncodingError,InitializationError=errors.InitializationError,LevelUPError=errors.LevelUPError,util=require("./util"),Batch=require("./batch"),Codec=require("level-codec"),getOptions=util.getOptions,defaultOptions=util.defaultOptions,getLevelDOWN=require("./leveldown"),dispatchError=util.dispatchError;util.isDefined;inherits(LevelUP,EventEmitter),LevelUP.prototype.open=function(callback){var dbFactory,db,self=this;if(this.isOpen())return callback&&process.nextTick(function(){callback(null,self)}),this;if(this._isOpening())return callback&&this.once("open",function(){callback(null,self)});if(this.emit("opening"),this._status="opening",this.db=new DeferredLevelDOWN(this.location),"function"!=typeof this.options.db&&"function"!=typeof getLevelDOWN)throw new LevelUPError("missing db factory, you need to set options.db");dbFactory=this.options.db||getLevelDOWN(),db=dbFactory(this.location),db.open(this.options,function(err){if(err)return dispatchError(self,new OpenError(err),callback);self.db.setDb(db),self.db=db,self._status="open",callback&&callback(null,self),self.emit("open"),self.emit("ready")})},LevelUP.prototype.close=function(callback){var self=this;if(this.isOpen())this._status="closing",this.db.close(function(){self._status="closed",self.emit("closed"),callback&&callback.apply(null,arguments)}),this.emit("closing"),this.db=new DeferredLevelDOWN(this.location);else{if("closed"==this._status&&callback)return process.nextTick(callback);"closing"==this._status&&callback?this.once("closed",callback):this._isOpening()&&this.once("open",function(){self.close(callback)})}},LevelUP.prototype.isOpen=function(){return"open"==this._status},LevelUP.prototype._isOpening=function(){return"opening"==this._status},LevelUP.prototype.isClosed=function(){return/^clos/.test(this._status)},LevelUP.prototype.get=function(key_,options,callback){var key,self=this;if(callback=getCallback(options,callback),!maybeError(this,options,callback)){if(null===key_||void 0===key_||"function"!=typeof callback)return readError(this,"get() requires key and callback arguments",callback);options=util.getOptions(options),key=this._codec.encodeKey(key_,options),options.asBuffer=this._codec.valueAsBuffer(options),this.db.get(key,options,function(err,value){if(err)return err=/notfound/i.test(err)||err.notFound?new NotFoundError("Key not found in database ["+key_+"]",err):new ReadError(err),dispatchError(self,err,callback);if(callback){try{value=self._codec.decodeValue(value,options)}catch(e){return callback(new EncodingError(e))}callback(null,value)}})}},LevelUP.prototype.put=function(key_,value_,options,callback){var key,value,self=this;if(callback=getCallback(options,callback),null===key_||void 0===key_)return writeError(this,"put() requires a key argument",callback);maybeError(this,options,callback)||(options=getOptions(options),key=this._codec.encodeKey(key_,options),value=this._codec.encodeValue(value_,options),this.db.put(key,value,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("put",key_,value_),callback&&callback()}))},LevelUP.prototype.del=function(key_,options,callback){var key,self=this;if(callback=getCallback(options,callback),null===key_||void 0===key_)return writeError(this,"del() requires a key argument",callback);maybeError(this,options,callback)||(options=getOptions(options),key=this._codec.encodeKey(key_,options),this.db.del(key,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("del",key_),callback&&callback()}))},LevelUP.prototype.batch=function(arr_,options,callback){var arr,self=this;return arguments.length?(callback=getCallback(options,callback),Array.isArray(arr_)?void(maybeError(this,options,callback)||(options=getOptions(options),arr=self._codec.encodeBatch(arr_,options),arr=arr.map(function(op){return op.type||void 0===op.key||void 0===op.value||(op.type="put"),op}),this.db.batch(arr,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("batch",arr_),callback&&callback()}))):writeError(this,"batch() requires an array argument",callback)):new Batch(this,this._codec)},LevelUP.prototype.approximateSize=deprecate(function(start_,end_,options,callback){var start,end,self=this;if(callback=getCallback(options,callback),options=getOptions(options),null===start_||void 0===start_||null===end_||void 0===end_||"function"!=typeof callback)return readError(this,"approximateSize() requires start, end and callback arguments",callback);start=this._codec.encodeKey(start_,options),end=this._codec.encodeKey(end_,options),this.db.approximateSize(start,end,function(err,size){if(err)return dispatchError(self,new OpenError(err),callback);callback&&callback(null,size)})},"db.approximateSize() is deprecated. Use db.db.approximateSize() instead"),LevelUP.prototype.readStream=LevelUP.prototype.createReadStream=function(options){return options=extend({keys:!0,values:!0},this.options,options),options.keyEncoding=options.keyEncoding,options.valueEncoding=options.valueEncoding,options=this._codec.encodeLtgt(options),options.keyAsBuffer=this._codec.keyAsBuffer(options),options.valueAsBuffer=this._codec.valueAsBuffer(options),"number"!=typeof options.limit&&(options.limit=-1),new IteratorStream(this.db.iterator(options),extend(options,{decoder:this._codec.createStreamDecoder(options)}))},LevelUP.prototype.keyStream=LevelUP.prototype.createKeyStream=function(options){return this.createReadStream(extend(options,{keys:!0,values:!1}))},LevelUP.prototype.valueStream=LevelUP.prototype.createValueStream=function(options){return this.createReadStream(extend(options,{keys:!1,values:!0}))},LevelUP.prototype.toString=function(){return"LevelUP"},module.exports=LevelUP,module.exports.errors=require("level-errors"),module.exports.destroy=deprecate(utilStatic("destroy"),"levelup.destroy() is deprecated. Use leveldown.destroy() instead"),module.exports.repair=deprecate(utilStatic("repair"),"levelup.repair() is deprecated. Use leveldown.repair() instead")}).call(this,require("_process"))},{"./batch":71,"./leveldown":7,"./util":73,_process:86,"deferred-leveldown":13,events:38,"level-codec":47,"level-errors":49,"level-iterator-stream":50,prr:87,util:137,xtend:139}],73:[function(require,module,exports){function getOptions(options){return"string"==typeof options&&(options={valueEncoding:options}),"object"!=typeof options&&(options={}),options}function dispatchError(db,error,callback){"function"==typeof callback?callback(error):db.emit("error",error)}function isDefined(v){return void 0!==v}var defaultOptions=(require("xtend"),{createIfMissing:!0,errorIfExists:!1,keyEncoding:"utf8",valueEncoding:"utf8",compression:!0});module.exports={defaultOptions:defaultOptions,getOptions:getOptions,dispatchError:dispatchError,isDefined:isDefined}},{xtend:139}],74:[function(require,module,exports){(function(global){function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}function arrayIncludes(array,value){return!!(array?array.length:0)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index<length;)if(comparator(value,array[index]))return!0;return!1}function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}function baseFindIndex(array,predicate,fromIndex,fromRight){for(var length=array.length,index=fromIndex+(fromRight?1:-1);fromRight?index--:++index<length;)if(predicate(array[index],index,array))return index;return-1}function baseIndexOf(array,value,fromIndex){if(value!==value)return baseFindIndex(array,baseIsNaN,fromIndex);for(var index=fromIndex-1,length=array.length;++index<length;)if(array[index]===value)return index;return-1}function baseIsNaN(value){return value!==value}function baseUnary(func){return function(value){return func(value)}}function cacheHas(cache,key){return cache.has(key)}function getValue(object,key){return null==object?void 0:object[key]}function isHostObject(value){var result=!1;if(null!=value&&"function"!=typeof value.toString)try{result=!!(value+"")}catch(e){}return result}function Hash(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{}}function hashDelete(key){return this.has(key)&&delete this.__data__[key]}function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?void 0:result}return hasOwnProperty.call(data,key)?data[key]:void 0}function hashHas(key){var data=this.__data__;return nativeCreate?void 0!==data[key]:hasOwnProperty.call(data,key)}function hashSet(key,value){return this.__data__[key]=nativeCreate&&void 0===value?HASH_UNDEFINED:value,this}function ListCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function listCacheClear(){this.__data__=[]}function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),!0)}function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?void 0:data[index][1]}function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function mapCacheClear(){this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(key){return getMapData(this,key).delete(key)}function mapCacheGet(key){return getMapData(this,key).get(key)}function mapCacheHas(key){return getMapData(this,key).has(key)}function mapCacheSet(key,value){return getMapData(this,key).set(key,value),this}function SetCache(values){var index=-1,length=values?values.length:0;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function setCacheAdd(value){return this.__data__.set(value,HASH_UNDEFINED),this}function setCacheHas(value){return this.__data__.has(value)}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}function baseDifference(array,values,iteratee,comparator){var index=-1,includes=arrayIncludes,isCommon=!0,length=array.length,result=[],valuesLength=values.length;if(!length)return result;iteratee&&(values=arrayMap(values,baseUnary(iteratee))),comparator?(includes=arrayIncludesWith,isCommon=!1):values.length>=LARGE_ARRAY_SIZE&&(includes=cacheHas,isCommon=!1,values=new SetCache(values));outer:for(;++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=comparator||0!==value?value:0,isCommon&&computed===computed){for(var valuesIndex=valuesLength;valuesIndex--;)if(values[valuesIndex]===computed)continue outer;result.push(value)}else includes(values,computed,comparator)||result.push(value)}return result}function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];depth>0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseIsNative(value){return!(!isObject(value)||isMasked(value))&&(isFunction(value)||isHostObject(value)?reIsNative:reIsHostCtor).test(toSource(value))}function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data["string"==typeof key?"string":"hash"]:data.map}function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:void 0}function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function isKeyable(value){var type=typeof value;return"string"==type||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value}function isMasked(func){return!!maskSrcKey&&maskSrcKey in func}function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}function eq(value,other){return value===other||value!==value&&other!==other}function isArguments(value){return isArrayLikeObject(value)&&hasOwnProperty.call(value,"callee")&&(!propertyIsEnumerable.call(value,"callee")||objectToString.call(value)==argsTag)}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0,nativeMax=Math.max,Map=getNative(root,"Map"),nativeCreate=getNative(Object,"create");Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;var difference=function(func,start){return start=nativeMax(void 0===start?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index<length;)array[index]=args[start+index];index=-1;for(var otherArgs=Array(start+1);++index<start;)otherArgs[index]=args[index];return otherArgs[start]=array,apply(func,this,otherArgs)}}(function(array,values){return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0)):[]}),isArray=Array.isArray;module.exports=difference}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],75:[function(require,module,exports){(function(global){function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}function arrayIncludes(array,value){return!!(array?array.length:0)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index<length;)if(comparator(value,array[index]))return!0;return!1}function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}function baseFindIndex(array,predicate,fromIndex,fromRight){for(var length=array.length,index=fromIndex+(fromRight?1:-1);fromRight?index--:++index<length;)if(predicate(array[index],index,array))return index;return-1}function baseIndexOf(array,value,fromIndex){if(value!==value)return baseFindIndex(array,baseIsNaN,fromIndex);for(var index=fromIndex-1,length=array.length;++index<length;)if(array[index]===value)return index;return-1}function baseIsNaN(value){return value!==value}function baseUnary(func){return function(value){return func(value)}}function cacheHas(cache,key){return cache.has(key)}function getValue(object,key){return null==object?void 0:object[key]}function isHostObject(value){var result=!1;if(null!=value&&"function"!=typeof value.toString)try{result=!!(value+"")}catch(e){}return result}function Hash(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{}}function hashDelete(key){return this.has(key)&&delete this.__data__[key]}function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?void 0:result}return hasOwnProperty.call(data,key)?data[key]:void 0}function hashHas(key){var data=this.__data__;return nativeCreate?void 0!==data[key]:hasOwnProperty.call(data,key)}function hashSet(key,value){return this.__data__[key]=nativeCreate&&void 0===value?HASH_UNDEFINED:value,this}function ListCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function listCacheClear(){this.__data__=[]}function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),!0)}function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?void 0:data[index][1]}function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function mapCacheClear(){this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(key){return getMapData(this,key).delete(key)}function mapCacheGet(key){return getMapData(this,key).get(key)}function mapCacheHas(key){return getMapData(this,key).has(key)}function mapCacheSet(key,value){return getMapData(this,key).set(key,value),this}function SetCache(values){var index=-1,length=values?values.length:0;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function setCacheAdd(value){return this.__data__.set(value,HASH_UNDEFINED),this}function setCacheHas(value){return this.__data__.has(value)}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}function baseIntersection(arrays,iteratee,comparator){for(var includes=comparator?arrayIncludesWith:arrayIncludes,length=arrays[0].length,othLength=arrays.length,othIndex=othLength,caches=Array(othLength),maxLength=1/0,result=[];othIndex--;){var array=arrays[othIndex];othIndex&&iteratee&&(array=arrayMap(array,baseUnary(iteratee))),maxLength=nativeMin(array.length,maxLength),caches[othIndex]=!comparator&&(iteratee||length>=120&&array.length>=120)?new SetCache(othIndex&&array):void 0}array=arrays[0];var index=-1,seen=caches[0];outer:for(;++index<length&&result.length<maxLength;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=comparator||0!==value?value:0,!(seen?cacheHas(seen,computed):includes(result,computed,comparator))){for(othIndex=othLength;--othIndex;){var cache=caches[othIndex];if(!(cache?cacheHas(cache,computed):includes(arrays[othIndex],computed,comparator)))continue outer}seen&&seen.push(computed),result.push(value)}}return result}function baseIsNative(value){return!(!isObject(value)||isMasked(value))&&(isFunction(value)||isHostObject(value)?reIsNative:reIsHostCtor).test(toSource(value))}function castArrayLikeObject(value){return isArrayLikeObject(value)?value:[]}function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data["string"==typeof key?"string":"hash"]:data.map}function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:void 0}function isKeyable(value){var type=typeof value;return"string"==type||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value}function isMasked(func){return!!maskSrcKey&&maskSrcKey in func}function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}function eq(value,other){return value===other||value!==value&&other!==other}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}var HASH_UNDEFINED="__lodash_hash_undefined__",MAX_SAFE_INTEGER=9007199254740991,funcTag="[object Function]",genTag="[object GeneratorFunction]",reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""
  }(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),splice=arrayProto.splice,nativeMax=Math.max,nativeMin=Math.min,Map=getNative(root,"Map"),nativeCreate=getNative(Object,"create");Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;var intersection=function(func,start){return start=nativeMax(void 0===start?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index<length;)array[index]=args[start+index];index=-1;for(var otherArgs=Array(start+1);++index<start;)otherArgs[index]=args[index];return otherArgs[start]=array,apply(func,this,otherArgs)}}(function(arrays){var mapped=arrayMap(arrays,castArrayLikeObject);return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped):[]});module.exports=intersection}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],76:[function(require,module,exports){(function(global){function arrayFilter(array,predicate){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}function arraySome(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(predicate(array[index],index,array))return!0;return!1}function baseTimes(n,iteratee){for(var index=-1,result=Array(n);++index<n;)result[index]=iteratee(index);return result}function cacheHas(cache,key){return cache.has(key)}function getValue(object,key){return null==object?void 0:object[key]}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach(function(value){result[++index]=value}),result}function Hash(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(key){var result=this.has(key)&&delete this.__data__[key];return this.size-=result?1:0,result}function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?void 0:result}return hasOwnProperty.call(data,key)?data[key]:void 0}function hashHas(key){var data=this.__data__;return nativeCreate?void 0!==data[key]:hasOwnProperty.call(data,key)}function hashSet(key,value){var data=this.__data__;return this.size+=this.has(key)?0:1,data[key]=nativeCreate&&void 0===value?HASH_UNDEFINED:value,this}function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function listCacheClear(){this.__data__=[],this.size=0}function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),--this.size,!0)}function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?void 0:data[index][1]}function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}function MapCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(key){var result=getMapData(this,key).delete(key);return this.size-=result?1:0,result}function mapCacheGet(key){return getMapData(this,key).get(key)}function mapCacheHas(key){return getMapData(this,key).has(key)}function mapCacheSet(key,value){var data=getMapData(this,key),size=data.size;return data.set(key,value),this.size+=data.size==size?0:1,this}function SetCache(values){var index=-1,length=null==values?0:values.length;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function setCacheAdd(value){return this.__data__.set(value,HASH_UNDEFINED),this}function setCacheHas(value){return this.__data__.has(value)}function Stack(entries){var data=this.__data__=new ListCache(entries);this.size=data.size}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(key){var data=this.__data__,result=data.delete(key);return this.size=data.size,result}function stackGet(key){return this.__data__.get(key)}function stackHas(key){return this.__data__.has(key)}function stackSet(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length<LARGE_ARRAY_SIZE-1)return pairs.push([key,value]),this.size=++data.size,this;data=this.__data__=new MapCache(pairs)}return data.set(key,value),this.size=data.size,this}function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value)!inherited&&!hasOwnProperty.call(value,key)||skipIndexes&&("length"==key||isBuff&&("offset"==key||"parent"==key)||isType&&("buffer"==key||"byteLength"==key||"byteOffset"==key)||isIndex(key,length))||result.push(key);return result}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function baseGetTag(value){return null==value?void 0===value?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value)}function baseIsArguments(value){return isObjectLike(value)&&baseGetTag(value)==argsTag}function baseIsEqual(value,other,bitmask,customizer,stack){return value===other||(null==value||null==other||!isObjectLike(value)&&!isObjectLike(other)?value!==value&&other!==other:baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual,stack))}function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?arrayTag:getTag(object),othTag=othIsArr?arrayTag:getTag(other);objTag=objTag==argsTag?objectTag:objTag,othTag=othTag==argsTag?objectTag:othTag;var objIsObj=objTag==objectTag,othIsObj=othTag==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other))return!1;objIsArr=!0,objIsObj=!1}if(isSameTag&&!objIsObj)return stack||(stack=new Stack),objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):equalByTag(object,other,objTag,bitmask,customizer,equalFunc,stack);if(!(bitmask&COMPARE_PARTIAL_FLAG)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;return stack||(stack=new Stack),equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack)}}return!!isSameTag&&(stack||(stack=new Stack),equalObjects(object,other,bitmask,customizer,equalFunc,stack))}function baseIsNative(value){return!(!isObject(value)||isMasked(value))&&(isFunction(value)?reIsNative:reIsHostCtor).test(toSource(value))}function baseIsTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)]}function baseKeys(object){if(!isPrototype(object))return nativeKeys(object);var result=[];for(var key in Object(object))hasOwnProperty.call(object,key)&&"constructor"!=key&&result.push(key);return result}function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var arrValue=array[index],othValue=other[index];if(customizer)var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);if(void 0!==compared){if(compared)continue;result=!1;break}if(seen){if(!arraySome(other,function(othValue,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue||equalFunc(arrValue,othValue,bitmask,customizer,stack)))return seen.push(othIndex)})){result=!1;break}}else if(arrValue!==othValue&&!equalFunc(arrValue,othValue,bitmask,customizer,stack)){result=!1;break}}return stack.delete(array),stack.delete(other),result}function equalByTag(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case dataViewTag:if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case arrayBufferTag:return!(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array(object),new Uint8Array(other)));case boolTag:case dateTag:case numberTag:return eq(+object,+other);case errorTag:return object.name==other.name&&object.message==other.message;case regexpTag:case stringTag:return object==other+"";case mapTag:var convert=mapToArray;case setTag:var isPartial=bitmask&COMPARE_PARTIAL_FLAG;if(convert||(convert=setToArray),object.size!=other.size&&!isPartial)return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=COMPARE_UNORDERED_FLAG,stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);return stack.delete(object),result;case symbolTag:if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}function equalObjects(object,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG,objProps=getAllKeys(object),objLength=objProps.length;if(objLength!=getAllKeys(other).length&&!isPartial)return!1;for(var index=objLength;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty.call(other,key)))return!1}var stacked=stack.get(object);if(stacked&&stack.get(other))return stacked==other;var result=!0;stack.set(object,other),stack.set(other,object);for(var skipCtor=isPartial;++index<objLength;){key=objProps[index];var objValue=object[key],othValue=other[key];if(customizer)var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);if(!(void 0===compared?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=!1;break}skipCtor||(skipCtor="constructor"==key)}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;objCtor!=othCtor&&"constructor"in object&&"constructor"in other&&!("function"==typeof objCtor&&objCtor instanceof objCtor&&"function"==typeof othCtor&&othCtor instanceof othCtor)&&(result=!1)}return stack.delete(object),stack.delete(other),result}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data["string"==typeof key?"string":"hash"]:data.map}function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:void 0}function getRawTag(value){var isOwn=hasOwnProperty.call(value,symToStringTag),tag=value[symToStringTag];try{value[symToStringTag]=void 0;var unmasked=!0}catch(e){}var result=nativeObjectToString.call(value);return unmasked&&(isOwn?value[symToStringTag]=tag:delete value[symToStringTag]),result}function isIndex(value,length){return!!(length=null==length?MAX_SAFE_INTEGER:length)&&("number"==typeof value||reIsUint.test(value))&&value>-1&&value%1==0&&value<length}function isKeyable(value){var type=typeof value;return"string"==type||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value}function isMasked(func){return!!maskSrcKey&&maskSrcKey in func}function isPrototype(value){var Ctor=value&&value.constructor;return value===("function"==typeof Ctor&&Ctor.prototype||objectProto)}function objectToString(value){return nativeObjectToString.call(value)}function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}function eq(value,other){return value===other||value!==value&&other!==other}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isEqual(value,other){return baseIsEqual(value,other)}function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}function isObjectLike(value){return null!=value&&"object"==typeof value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function stubArray(){return[]}function stubFalse(){return!1}var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",asyncTag="[object AsyncFunction]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",nullTag="[object Null]",objectTag="[object Object]",proxyTag="[object Proxy]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",undefinedTag="[object Undefined]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),nativeObjectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=moduleExports?root.Buffer:void 0,Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,symToStringTag=Symbol?Symbol.toStringTag:void 0,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var getSymbols=nativeGetSymbols?function(object){return null==object?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable.call(object,symbol)}))}:stubArray,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=baseGetTag(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):"";if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")},isArray=Array.isArray,isBuffer=nativeIsBuffer||stubFalse,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=isEqual}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],77:[function(require,module,exports){function baseSortedIndex(array,value,retHighest){var low=0,high=array?array.length:low;if("number"==typeof value&&value===value&&high<=HALF_MAX_ARRAY_LENGTH){for(;low<high;){var mid=low+high>>>1,computed=array[mid];null!==computed&&!isSymbol(computed)&&(retHighest?computed<=value:computed<value)?low=mid+1:high=mid}return high}return baseSortedIndexBy(array,value,identity,retHighest)}function baseSortedIndexBy(array,value,iteratee,retHighest){value=iteratee(value);for(var low=0,high=array?array.length:0,valIsNaN=value!==value,valIsNull=null===value,valIsSymbol=isSymbol(value),valIsUndefined=void 0===value;low<high;){var mid=nativeFloor((low+high)/2),computed=iteratee(array[mid]),othIsDefined=void 0!==computed,othIsNull=null===computed,othIsReflexive=computed===computed,othIsSymbol=isSymbol(computed);if(valIsNaN)var setLow=retHighest||othIsReflexive;else setLow=valIsUndefined?othIsReflexive&&(retHighest||othIsDefined):valIsNull?othIsReflexive&&othIsDefined&&(retHighest||!othIsNull):valIsSymbol?othIsReflexive&&othIsDefined&&!othIsNull&&(retHighest||!othIsSymbol):!othIsNull&&!othIsSymbol&&(retHighest?computed<=value:computed<value);setLow?low=mid+1:high=mid}return nativeMin(high,MAX_ARRAY_INDEX)}function sortedIndexOf(array,value){var length=array?array.length:0;if(length){var index=baseSortedIndex(array,value);if(index<length&&eq(array[index],value))return index}return-1}function eq(value,other){return value===other||value!==value&&other!==other}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function identity(value){return value}var MAX_ARRAY_INDEX=4294967294,HALF_MAX_ARRAY_LENGTH=2147483647,symbolTag="[object Symbol]",objectProto=Object.prototype,objectToString=objectProto.toString,nativeFloor=Math.floor,nativeMin=Math.min;module.exports=sortedIndexOf},{}],78:[function(require,module,exports){function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}function baseRest(func,start){return start=nativeMax(void 0===start?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index<length;)array[index]=args[start+index];index=-1;for(var otherArgs=Array(start+1);++index<start;)otherArgs[index]=args[index];return otherArgs[start]=array,apply(func,this,otherArgs)}}function baseSlice(array,start,end){var index=-1,length=array.length;start<0&&(start=-start>length?0:length+start),end=end>length?length:end,end<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index<length;)result[index]=array[index+start];return result}function castSlice(array,start,end){var length=array.length;return end=void 0===end?length:end,!start&&end>=length?array:baseSlice(array,start,end)}function spread(func,start){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return start=void 0===start?0:nativeMax(toInteger(start),0),baseRest(function(args){var array=args[start],otherArgs=castSlice(args,0,start);return array&&arrayPush(otherArgs,array),apply(func,this,otherArgs)})}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toFinite(value){if(!value)return 0===value?value:0;if((value=toNumber(value))===INFINITY||value===-INFINITY){return(value<0?-1:1)*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}var FUNC_ERROR_TEXT="Expected a function",INFINITY=1/0,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max;module.exports=spread},{}],79:[function(require,module,exports){(function(global){function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}function arrayIncludes(array,value){return!!(array?array.length:0)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index<length;)if(comparator(value,array[index]))return!0;return!1}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}function baseFindIndex(array,predicate,fromIndex,fromRight){for(var length=array.length,index=fromIndex+(fromRight?1:-1);fromRight?index--:++index<length;)if(predicate(array[index],index,array))return index;return-1}function baseIndexOf(array,value,fromIndex){if(value!==value)return baseFindIndex(array,baseIsNaN,fromIndex);for(var index=fromIndex-1,length=array.length;++index<length;)if(array[index]===value)return index;return-1}function baseIsNaN(value){return value!==value}function cacheHas(cache,key){return cache.has(key)}function getValue(object,key){return null==object?void 0:object[key]}function isHostObject(value){var result=!1;if(null!=value&&"function"!=typeof value.toString)try{result=!!(value+"")}catch(e){}return result}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach(function(value){result[++index]=value}),result}function Hash(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{}}function hashDelete(key){return this.has(key)&&delete this.__data__[key]}function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?void 0:result}return hasOwnProperty.call(data,key)?data[key]:void 0}function hashHas(key){var data=this.__data__;return nativeCreate?void 0!==data[key]:hasOwnProperty.call(data,key)}function hashSet(key,value){return this.__data__[key]=nativeCreate&&void 0===value?HASH_UNDEFINED:value,this}function ListCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function listCacheClear(){this.__data__=[]}function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),!0)}function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?void 0:data[index][1]}function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function mapCacheClear(){this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(key){return getMapData(this,key).delete(key)}function mapCacheGet(key){return getMapData(this,key).get(key)}function mapCacheHas(key){return getMapData(this,key).has(key)}function mapCacheSet(key,value){return getMapData(this,key).set(key,value),this}function SetCache(values){var index=-1,length=values?values.length:0;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function setCacheAdd(value){return this.__data__.set(value,HASH_UNDEFINED),this}function setCacheHas(value){return this.__data__.has(value)}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];depth>0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseIsNative(value){return!(!isObject(value)||isMasked(value))&&(isFunction(value)||isHostObject(value)?reIsNative:reIsHostCtor).test(toSource(value))}function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=!0,result=[],seen=result;if(comparator)isCommon=!1,includes=arrayIncludesWith;else if(length>=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=comparator||0!==value?value:0,isCommon&&computed===computed){for(var seenIndex=seen.length;seenIndex--;)if(seen[seenIndex]===computed)continue outer;iteratee&&seen.push(computed),result.push(value)}else includes(seen,computed,comparator)||(seen!==result&&seen.push(computed),result.push(value))}return result}function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data["string"==typeof key?"string":"hash"]:data.map}function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:void 0}function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function isKeyable(value){var type=typeof value;return"string"==type||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value}function isMasked(func){return!!maskSrcKey&&maskSrcKey in func}function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}function eq(value,other){return value===other||value!==value&&other!==other}function isArguments(value){return isArrayLikeObject(value)&&hasOwnProperty.call(value,"callee")&&(!propertyIsEnumerable.call(value,"callee")||objectToString.call(value)==argsTag)}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function noop(){}
  var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0,nativeMax=Math.max,Map=getNative(root,"Map"),Set=getNative(root,"Set"),nativeCreate=getNative(Object,"create");Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;var createSet=Set&&1/setToArray(new Set([,-0]))[1]==1/0?function(values){return new Set(values)}:noop,union=function(func,start){return start=nativeMax(void 0===start?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index<length;)array[index]=args[start+index];index=-1;for(var otherArgs=Array(start+1);++index<start;)otherArgs[index]=args[index];return otherArgs[start]=array,apply(func,this,otherArgs)}}(function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0))}),isArray=Array.isArray;module.exports=union}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],80:[function(require,module,exports){(function(global){function arrayIncludes(array,value){return!!(array?array.length:0)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index<length;)if(comparator(value,array[index]))return!0;return!1}function baseFindIndex(array,predicate,fromIndex,fromRight){for(var length=array.length,index=fromIndex+(fromRight?1:-1);fromRight?index--:++index<length;)if(predicate(array[index],index,array))return index;return-1}function baseIndexOf(array,value,fromIndex){if(value!==value)return baseFindIndex(array,baseIsNaN,fromIndex);for(var index=fromIndex-1,length=array.length;++index<length;)if(array[index]===value)return index;return-1}function baseIsNaN(value){return value!==value}function cacheHas(cache,key){return cache.has(key)}function getValue(object,key){return null==object?void 0:object[key]}function isHostObject(value){var result=!1;if(null!=value&&"function"!=typeof value.toString)try{result=!!(value+"")}catch(e){}return result}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach(function(value){result[++index]=value}),result}function Hash(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{}}function hashDelete(key){return this.has(key)&&delete this.__data__[key]}function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?void 0:result}return hasOwnProperty.call(data,key)?data[key]:void 0}function hashHas(key){var data=this.__data__;return nativeCreate?void 0!==data[key]:hasOwnProperty.call(data,key)}function hashSet(key,value){return this.__data__[key]=nativeCreate&&void 0===value?HASH_UNDEFINED:value,this}function ListCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function listCacheClear(){this.__data__=[]}function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),!0)}function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?void 0:data[index][1]}function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function mapCacheClear(){this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(key){return getMapData(this,key).delete(key)}function mapCacheGet(key){return getMapData(this,key).get(key)}function mapCacheHas(key){return getMapData(this,key).has(key)}function mapCacheSet(key,value){return getMapData(this,key).set(key,value),this}function SetCache(values){var index=-1,length=values?values.length:0;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function setCacheAdd(value){return this.__data__.set(value,HASH_UNDEFINED),this}function setCacheHas(value){return this.__data__.has(value)}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}function baseIsNative(value){return!(!isObject(value)||isMasked(value))&&(isFunction(value)||isHostObject(value)?reIsNative:reIsHostCtor).test(toSource(value))}function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=!0,result=[],seen=result;if(comparator)isCommon=!1,includes=arrayIncludesWith;else if(length>=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=comparator||0!==value?value:0,isCommon&&computed===computed){for(var seenIndex=seen.length;seenIndex--;)if(seen[seenIndex]===computed)continue outer;iteratee&&seen.push(computed),result.push(value)}else includes(seen,computed,comparator)||(seen!==result&&seen.push(computed),result.push(value))}return result}function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data["string"==typeof key?"string":"hash"]:data.map}function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:void 0}function isKeyable(value){var type=typeof value;return"string"==type||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value}function isMasked(func){return!!maskSrcKey&&maskSrcKey in func}function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}function uniq(array){return array&&array.length?baseUniq(array):[]}function eq(value,other){return value===other||value!==value&&other!==other}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function noop(){}var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",funcTag="[object Function]",genTag="[object GeneratorFunction]",reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),splice=arrayProto.splice,Map=getNative(root,"Map"),Set=getNative(root,"Set"),nativeCreate=getNative(Object,"create");Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;var createSet=Set&&1/setToArray(new Set([,-0]))[1]==1/0?function(values){return new Set(values)}:noop;module.exports=uniq}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],81:[function(require,module,exports){(function(Buffer){function has(obj,key){return Object.hasOwnProperty.call(obj,key)}function isDef(val){return void 0!==val&&""!==val}function has(range,name){return Object.hasOwnProperty.call(range,name)}function hasKey(range,name){return Object.hasOwnProperty.call(range,name)&&name}function id(e){return e}exports.compare=function(a,b){if(Buffer.isBuffer(a)){for(var l=Math.min(a.length,b.length),i=0;i<l;i++){var cmp=a[i]-b[i];if(cmp)return cmp}return a.length-b.length}return a<b?-1:a>b?1:0};var lowerBoundKey=exports.lowerBoundKey=function(range){return hasKey(range,"gt")||hasKey(range,"gte")||hasKey(range,"min")||(range.reverse?hasKey(range,"end"):hasKey(range,"start"))||void 0},lowerBound=exports.lowerBound=function(range,def){var k=lowerBoundKey(range);return k?range[k]:def},lowerBoundInclusive=exports.lowerBoundInclusive=function(range){return!has(range,"gt")},upperBoundInclusive=exports.upperBoundInclusive=function(range){return!has(range,"lt")},lowerBoundExclusive=exports.lowerBoundExclusive=function(range){return!lowerBoundInclusive(range)},upperBoundExclusive=exports.upperBoundExclusive=function(range){return!upperBoundInclusive(range)},upperBoundKey=exports.upperBoundKey=function(range){return hasKey(range,"lt")||hasKey(range,"lte")||hasKey(range,"max")||(range.reverse?hasKey(range,"start"):hasKey(range,"end"))||void 0},upperBound=exports.upperBound=function(range,def){var k=upperBoundKey(range);return k?range[k]:def};exports.start=function(range,def){return range.reverse?upperBound(range,def):lowerBound(range,def)},exports.end=function(range,def){return range.reverse?lowerBound(range,def):upperBound(range,def)},exports.startInclusive=function(range){return range.reverse?upperBoundInclusive(range):lowerBoundInclusive(range)},exports.endInclusive=function(range){return range.reverse?lowerBoundInclusive(range):upperBoundInclusive(range)},exports.toLtgt=function(range,_range,map,lower,upper){_range=_range||{},map=map||id;var defaults=arguments.length>3,lb=exports.lowerBoundKey(range),ub=exports.upperBoundKey(range);return lb?"gt"===lb?_range.gt=map(range.gt,!1):_range.gte=map(range[lb],!1):defaults&&(_range.gte=map(lower,!1)),ub?"lt"===ub?_range.lt=map(range.lt,!0):_range.lte=map(range[ub],!0):defaults&&(_range.lte=map(upper,!0)),null!=range.reverse&&(_range.reverse=!!range.reverse),has(_range,"max")&&delete _range.max,has(_range,"min")&&delete _range.min,has(_range,"start")&&delete _range.start,has(_range,"end")&&delete _range.end,_range},exports.contains=function(range,key,compare){compare=compare||exports.compare;var lb=lowerBound(range);if(isDef(lb)){var cmp=compare(key,lb);if(cmp<0||0===cmp&&lowerBoundExclusive(range))return!1}var ub=upperBound(range);if(isDef(ub)){var cmp=compare(key,ub);if(cmp>0||0===cmp&&upperBoundExclusive(range))return!1}return!0},exports.filter=function(range,compare){return function(key){return exports.contains(range,key,compare)}}}).call(this,{isBuffer:require("../is-buffer/index.js")})},{"../is-buffer/index.js":43}],82:[function(require,module,exports){const getNGramsOfMultipleLengths=function(inputArray,nGramLengths){var outputArray=[];return nGramLengths.forEach(function(len){outputArray=outputArray.concat(getNGramsOfSingleLength(inputArray,len))}),outputArray},getNGramsOfRangeOfLengths=function(inputArray,nGramLengths){for(var outputArray=[],i=nGramLengths.gte;i<=nGramLengths.lte;i++)outputArray=outputArray.concat(getNGramsOfSingleLength(inputArray,i));return outputArray},getNGramsOfSingleLength=function(inputArray,nGramLength){return inputArray.slice(nGramLength-1).map(function(item,i){return inputArray.slice(i,i+nGramLength)})};exports.ngram=function(inputArray,nGramLength){switch(nGramLength.constructor){case Array:return getNGramsOfMultipleLengths(inputArray,nGramLength);case Number:return getNGramsOfSingleLength(inputArray,nGramLength);case Object:return getNGramsOfRangeOfLengths(inputArray,nGramLength)}}},{}],83:[function(require,module,exports){function once(fn){var f=function(){return f.called?f.value:(f.called=!0,f.value=fn.apply(this,arguments))};return f.called=!1,f}function onceStrict(fn){var f=function(){if(f.called)throw new Error(f.onceError);return f.called=!0,f.value=fn.apply(this,arguments)},name=fn.name||"Function wrapped with `once`";return f.onceError=name+" shouldn't be called more than once",f.called=!1,f}var wrappy=require("wrappy");module.exports=wrappy(once),module.exports.strict=wrappy(onceStrict),once.proto=once(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:!0})})},{wrappy:138}],84:[function(require,module,exports){exports.endianness=function(){return"LE"},exports.hostname=function(){return"undefined"!=typeof location?location.hostname:""},exports.loadavg=function(){return[]},exports.uptime=function(){return 0},exports.freemem=function(){return Number.MAX_VALUE},exports.totalmem=function(){return Number.MAX_VALUE},exports.cpus=function(){return[]},exports.type=function(){return"Browser"},exports.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},exports.networkInterfaces=exports.getNetworkInterfaces=function(){return{}},exports.arch=function(){return"javascript"},exports.platform=function(){return"browser"},exports.tmpdir=exports.tmpDir=function(){return"/tmp"},exports.EOL="\n"},{}],85:[function(require,module,exports){(function(process){"use strict";function nextTick(fn,arg1,arg2,arg3){if("function"!=typeof fn)throw new TypeError('"callback" argument must be a function');var args,i,len=arguments.length;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function(){fn.call(null,arg1)});case 3:return process.nextTick(function(){fn.call(null,arg1,arg2)});case 4:return process.nextTick(function(){fn.call(null,arg1,arg2,arg3)});default:for(args=new Array(len-1),i=0;i<args.length;)args[i++]=arguments[i];return process.nextTick(function(){fn.apply(null,args)})}}!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?module.exports=nextTick:module.exports=process.nextTick}).call(this,require("_process"))},{_process:86}],86:[function(require,module,exports){function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}function cleanUpNextTick(){draining&&currentQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex<len;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,len=queue.length}currentQueue=null,draining=!1,runClearTimeout(timeout)}}function Item(fun,array){this.fun=fun,this.array=array}function noop(){}var cachedSetTimeout,cachedClearTimeout,process=module.exports={};!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];queue.push(new Item(fun,args)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(name){return[]},process.binding=function(name){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(dir){throw new Error("process.chdir is not supported")},process.umask=function(){return 0}},{}],87:[function(require,module,exports){arguments[4][37][0].apply(exports,arguments)},{dup:37}],88:[function(require,module,exports){var once=require("once"),eos=require("end-of-stream"),fs=require("fs"),noop=function(){},isFn=function(fn){return"function"==typeof fn},isFS=function(stream){return!!fs&&((stream instanceof(fs.ReadStream||noop)||stream instanceof(fs.WriteStream||noop))&&isFn(stream.close))},isRequest=function(stream){return stream.setHeader&&isFn(stream.abort)},destroyer=function(stream,reading,writing,callback){callback=once(callback);var closed=!1;stream.on("close",function(){closed=!0}),eos(stream,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=!0,callback()});var destroyed=!1;return function(err){if(!closed&&!destroyed)return destroyed=!0,isFS(stream)?stream.close():isRequest(stream)?stream.abort():isFn(stream.destroy)?stream.destroy():void callback(err||new Error("stream was destroyed"))}},call=function(fn){fn()},pipe=function(from,to){return from.pipe(to)},pump=function(){var streams=Array.prototype.slice.call(arguments),callback=isFn(streams[streams.length-1]||noop)&&streams.pop()||noop;if(Array.isArray(streams[0])&&(streams=streams[0]),streams.length<2)throw new Error("pump requires two streams per minimum");var error,destroys=streams.map(function(stream,i){var reading=i<streams.length-1;return destroyer(stream,reading,i>0,function(err){error||(error=err),err&&destroys.forEach(call),reading||(destroys.forEach(call),callback(error))})});return streams.reduce(pipe)};module.exports=pump},{"end-of-stream":34,fs:7,once:83}],89:[function(require,module,exports){var pump=require("pump"),inherits=require("inherits"),Duplexify=require("duplexify"),toArray=function(args){return args.length?Array.isArray(args[0])?args[0]:Array.prototype.slice.call(args):[]},define=function(opts){var Pumpify=function(){var streams=toArray(arguments);if(!(this instanceof Pumpify))return new Pumpify(streams);Duplexify.call(this,null,null,opts),streams.length&&this.setPipeline(streams)};return inherits(Pumpify,Duplexify),Pumpify.prototype.setPipeline=function(){var streams=toArray(arguments),self=this,ended=!1,w=streams[0],r=streams[streams.length-1];r=r.readable?r:null,w=w.writable?w:null;var onclose=function(){streams[0].emit("error",new Error("stream was destroyed"))};if(this.on("close",onclose),this.on("prefinish",function(){ended||self.cork()}),pump(streams,function(err){if(self.removeListener("close",onclose),err)return self.destroy(err);ended=!0,self.uncork()}),this.destroyed)return onclose();this.setWritable(w),this.setReadable(r)},Pumpify};module.exports=define({destroy:!1}),module.exports.obj=define({destroy:!1,objectMode:!0,highWaterMark:16})},{duplexify:31,inherits:41,pump:88}],90:[function(require,module,exports){module.exports=require("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":91}],91:[function(require,module,exports){"use strict";function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options),Writable.call(this,options),options&&!1===options.readable&&(this.readable=!1),options&&!1===options.writable&&(this.writable=!1),this.allowHalfOpen=!0,options&&!1===options.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||processNextTick(onEndNT,this)}function onEndNT(self){self.end()}var processNextTick=require("process-nextick-args"),objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};module.exports=Duplex;var util=require("core-util-is");util.inherits=require("inherits");var Readable=require("./_stream_readable"),Writable=require("./_stream_writable");util.inherits(Duplex,Readable);for(var keys=objectKeys(Writable.prototype),v=0;v<keys.length;v++){var method=keys[v];Duplex.prototype[method]||(Duplex.prototype[method]=Writable.prototype[method])}Object.defineProperty(Duplex.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(value){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=value,this._writableState.destroyed=value)}}),Duplex.prototype._destroy=function(err,cb){this.push(null),this.end(),processNextTick(cb,err)}},{"./_stream_readable":93,"./_stream_writable":95,"core-util-is":11,inherits:41,"process-nextick-args":85}],92:[function(require,module,exports){"use strict";function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=require("./_stream_transform"),util=require("core-util-is");util.inherits=require("inherits"),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},{"./_stream_transform":94,"core-util-is":11,inherits:41}],93:[function(require,module,exports){(function(process){"use strict";function _uint8ArrayToBuffer(chunk){return Buffer.from(chunk)}function _isUint8Array(obj){return"[object Uint8Array]"===Object.prototype.toString.call(obj)||Buffer.isBuffer(obj)}function prependListener(emitter,event,fn){if("function"==typeof emitter.prependListener)return emitter.prependListener(event,fn);emitter._events&&emitter._events[event]?isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]:emitter.on(event,fn)}function ReadableState(options,stream){Duplex=Duplex||require("./_stream_duplex"),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=require("string_decoder/").StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex=Duplex||require("./_stream_duplex"),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&("function"==typeof options.read&&(this._read=options.read),"function"==typeof options.destroy&&(this._destroy=options.destroy)),Stream.call(this)}function readableAddChunk(stream,chunk,encoding,addToFront,skipChunkCheck){var state=stream._readableState;if(null===chunk)state.reading=!1,onEofChunk(stream,state);else{var er;skipChunkCheck||(er=chunkInvalid(state,chunk)),er?stream.emit("error",er):state.objectMode||chunk&&chunk.length>0?("string"==typeof chunk||Object.getPrototypeOf(chunk)===Buffer.prototype||state.objectMode||(chunk=_uint8ArrayToBuffer(chunk)),addToFront?state.endEmitted?stream.emit("error",new Error("stream.unshift() after end event")):addChunk(stream,state,chunk,!0):state.ended?stream.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||0!==chunk.length?addChunk(stream,state,chunk,!1):maybeReadMore(stream,state)):addChunk(stream,state,chunk,!1))):addToFront||(state.reading=!1)}return needMoreData(state)}function addChunk(stream,state,chunk,addToFront){state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state)}function chunkInvalid(state,chunk){var er;return _isUint8Array(chunk)||"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||0===state.length)}function computeNewHighWaterMark(n){return n>=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark&&(debug("maybeReadMore read 0"),stream.read(0),len!==state.length);)len=state.length;state.readingMore=!1}function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain),state.awaitDrain&&state.awaitDrain--,0===state.awaitDrain&&EElistenerCount(src,"data")&&(state.flowing=!0,flow(src))}}function nReadingNextTick(self){debug("readable nexttick read 0"),self.read(0)}function resume(stream,state){state.resumeScheduled||(state.resumeScheduled=!0,processNextTick(resume_,stream,state))}function resume_(stream,state){state.reading||(debug("resume read 0"),stream.read(0)),state.resumeScheduled=!1,state.awaitDrain=0,stream.emit("resume"),flow(stream),state.flowing&&!state.reading&&stream.read(0)}function flow(stream){var state=stream._readableState;for(debug("flow",state.flowing);state.flowing&&null!==stream.read(););}function fromList(n,state){if(0===state.length)return null;var ret;return state.objectMode?ret=state.buffer.shift():!n||n>=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return n<list.head.data.length?(ret=list.head.data.slice(0,n),list.head.data=list.head.data.slice(n)):ret=n===list.head.data.length?list.shift():hasStrings?copyFromBufferString(n,list):copyFromBuffer(n,list),ret}function copyFromBufferString(n,list){var p=list.head,c=1,ret=p.data;for(n-=ret.length;p=p.next;){var str=p.data,nb=n>str.length?str.length:n;if(nb===str.length?ret+=str:ret+=str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++)if(xs[i]===x)return i;return-1}var processNextTick=require("process-nextick-args");module.exports=Readable;var Duplex,isArray=require("isarray");Readable.ReadableState=ReadableState;var EElistenerCount=(require("events").EventEmitter,function(emitter,type){return emitter.listeners(type).length}),Stream=require("./internal/streams/stream"),Buffer=require("safe-buffer").Buffer,util=require("core-util-is");util.inherits=require("inherits");var debugUtil=require("util"),debug=void 0;debug=debugUtil&&debugUtil.debuglog?debugUtil.debuglog("stream"):function(){};var StringDecoder,BufferList=require("./internal/streams/BufferList"),destroyImpl=require("./internal/streams/destroy");util.inherits(Readable,Stream);var kProxyEvents=["error","close","destroy","pause","resume"]
  ;Object.defineProperty(Readable.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(value){this._readableState&&(this._readableState.destroyed=value)}}),Readable.prototype.destroy=destroyImpl.destroy,Readable.prototype._undestroy=destroyImpl.undestroy,Readable.prototype._destroy=function(err,cb){this.push(null),cb(err)},Readable.prototype.push=function(chunk,encoding){var skipChunkCheck,state=this._readableState;return state.objectMode?skipChunkCheck=!0:"string"==typeof chunk&&(encoding=encoding||state.defaultEncoding,encoding!==state.encoding&&(chunk=Buffer.from(chunk,encoding),encoding=""),skipChunkCheck=!0),readableAddChunk(this,chunk,encoding,!1,skipChunkCheck)},Readable.prototype.unshift=function(chunk){return readableAddChunk(this,chunk,null,!0,!1)},Readable.prototype.isPaused=function(){return!1===this._readableState.flowing},Readable.prototype.setEncoding=function(enc){return StringDecoder||(StringDecoder=require("string_decoder/").StringDecoder),this._readableState.decoder=new StringDecoder(enc),this._readableState.encoding=enc,this};var MAX_HWM=8388608;Readable.prototype.read=function(n){debug("read",n),n=parseInt(n,10);var state=this._readableState,nOrig=n;if(0!==n&&(state.emittedReadable=!1),0===n&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n<state.highWaterMark)&&(doRead=!0,debug("length less than watermark",doRead)),state.ended||state.reading?(doRead=!1,debug("reading or ended",doRead)):doRead&&(debug("do read"),state.reading=!0,state.sync=!0,0===state.length&&(state.needReadable=!0),this._read(state.highWaterMark),state.sync=!1,state.reading||(n=howMuchToRead(nOrig,state)));var ret;return ret=n>0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&!1===unpipeInfo.hasUnpiped&&(unpipeInfo.hasUnpiped=!0,cleanup())}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&-1!==indexOf(state.pipes,dest))&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||!1!==pipeOpts.end)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:unpipe;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i<len;i++)dests[i].emit("unpipe",this,unpipeInfo);return this}var index=indexOf(state.pipes,dest);return-1===index?this:(state.pipes.splice(index,1),state.pipesCount-=1,1===state.pipesCount&&(state.pipes=state.pipes[0]),dest.emit("unpipe",this,unpipeInfo),this)},Readable.prototype.on=function(ev,fn){var res=Stream.prototype.on.call(this,ev,fn);if("data"===ev)!1!==this._readableState.flowing&&this.resume();else if("readable"===ev){var state=this._readableState;state.endEmitted||state.readableListening||(state.readableListening=state.needReadable=!0,state.emittedReadable=!1,state.reading?state.length&&emitReadable(this):processNextTick(nReadingNextTick,this))}return res},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.resume=function(){var state=this._readableState;return state.flowing||(debug("resume"),state.flowing=!0,resume(this,state)),this},Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Readable.prototype.wrap=function(stream){var state=this._readableState,paused=!1,self=this;stream.on("end",function(){if(debug("wrapped end"),state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&self.push(chunk)}self.push(null)}),stream.on("data",function(chunk){if(debug("wrapped data"),state.decoder&&(chunk=state.decoder.write(chunk)),(!state.objectMode||null!==chunk&&void 0!==chunk)&&(state.objectMode||chunk&&chunk.length)){self.push(chunk)||(paused=!0,stream.pause())}});for(var i in stream)void 0===this[i]&&"function"==typeof stream[i]&&(this[i]=function(method){return function(){return stream[method].apply(stream,arguments)}}(i));for(var n=0;n<kProxyEvents.length;n++)stream.on(kProxyEvents[n],self.emit.bind(self,kProxyEvents[n]));return self._read=function(n){debug("wrapped _read",n),paused&&(paused=!1,stream.resume())},self},Readable._fromList=fromList}).call(this,require("_process"))},{"./_stream_duplex":91,"./internal/streams/BufferList":96,"./internal/streams/destroy":97,"./internal/streams/stream":98,_process:86,"core-util-is":11,events:38,inherits:41,isarray:44,"process-nextick-args":85,"safe-buffer":103,"string_decoder/":129,util:7}],94:[function(require,module,exports){"use strict";function TransformState(stream){this.afterTransform=function(er,data){return afterTransform(stream,er,data)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function afterTransform(stream,er,data){var ts=stream._transformState;ts.transforming=!1;var cb=ts.writecb;if(!cb)return stream.emit("error",new Error("write callback called multiple times"));ts.writechunk=null,ts.writecb=null,null!==data&&void 0!==data&&stream.push(data),cb(er);var rs=stream._readableState;rs.reading=!1,(rs.needReadable||rs.length<rs.highWaterMark)&&stream._read(rs.highWaterMark)}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex.call(this,options),this._transformState=new TransformState(this);var stream=this;this._readableState.needReadable=!0,this._readableState.sync=!1,options&&("function"==typeof options.transform&&(this._transform=options.transform),"function"==typeof options.flush&&(this._flush=options.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(er,data){done(stream,er,data)}):done(stream)})}function done(stream,er,data){if(er)return stream.emit("error",er);null!==data&&void 0!==data&&stream.push(data);var ws=stream._writableState,ts=stream._transformState;if(ws.length)throw new Error("Calling transform done when ws.length != 0");if(ts.transforming)throw new Error("Calling transform done when still transforming");return stream.push(null)}module.exports=Transform;var Duplex=require("./_stream_duplex"),util=require("core-util-is");util.inherits=require("inherits"),util.inherits(Transform,Duplex),Transform.prototype.push=function(chunk,encoding){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,chunk,encoding)},Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("_transform() is not implemented")},Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;if(ts.writecb=cb,ts.writechunk=chunk,ts.writeencoding=encoding,!ts.transforming){var rs=this._readableState;(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}},Transform.prototype._read=function(n){var ts=this._transformState;null!==ts.writechunk&&ts.writecb&&!ts.transforming?(ts.transforming=!0,this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)):ts.needTransform=!0},Transform.prototype._destroy=function(err,cb){var _this=this;Duplex.prototype._destroy.call(this,err,function(err2){cb(err2),_this.emit("close")})}},{"./_stream_duplex":91,"core-util-is":11,inherits:41}],95:[function(require,module,exports){(function(process){"use strict";function CorkedRequest(state){var _this=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(_this,state)}}function _uint8ArrayToBuffer(chunk){return Buffer.from(chunk)}function _isUint8Array(obj){return"[object Uint8Array]"===Object.prototype.toString.call(obj)||Buffer.isBuffer(obj)}function nop(){}function WritableState(options,stream){Duplex=Duplex||require("./_stream_duplex"),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var noDecode=!1===options.decodeStrings;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(options){if(Duplex=Duplex||require("./_stream_duplex"),!(realHasInstance.call(Writable,this)||this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,options&&("function"==typeof options.write&&(this._write=options.write),"function"==typeof options.writev&&(this._writev=options.writev),"function"==typeof options.destroy&&(this._destroy=options.destroy),"function"==typeof options.final&&(this._final=options.final)),Stream.call(this)}function writeAfterEnd(stream,cb){var er=new Error("write after end");stream.emit("error",er),processNextTick(cb,er)}function validChunk(stream,state,chunk,cb){var valid=!0,er=!1;return null===chunk?er=new TypeError("May not write null values to stream"):"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream.emit("error",er),processNextTick(cb,er),valid=!1),valid}function decodeChunk(state,chunk,encoding){return state.objectMode||!1===state.decodeStrings||"string"!=typeof chunk||(chunk=Buffer.from(chunk,encoding)),chunk}function writeOrBuffer(stream,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);chunk!==newChunk&&(isBuf=!0,encoding="buffer",chunk=newChunk)}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(ret||(state.needDrain=!0),state.writing||state.corked){var last=state.lastBufferedRequest;state.lastBufferedRequest={chunk:chunk,encoding:encoding,isBuf:isBuf,callback:cb,next:null},last?last.next=state.lastBufferedRequest:state.bufferedRequest=state.lastBufferedRequest,state.bufferedRequestCount+=1}else doWrite(stream,state,!1,len,chunk,encoding,cb);return ret}function doWrite(stream,state,writev,len,chunk,encoding,cb){state.writelen=len,state.writecb=cb,state.writing=!0,state.sync=!0,writev?stream._writev(chunk,state.onwrite):stream._write(chunk,encoding,state.onwrite),state.sync=!1}function onwriteError(stream,state,sync,er,cb){--state.pendingcb,sync?(processNextTick(cb,er),processNextTick(finishMaybe,stream,state),stream._writableState.errorEmitted=!0,stream.emit("error",er)):(cb(er),stream._writableState.errorEmitted=!0,stream.emit("error",er),finishMaybe(stream,state))}function onwriteStateUpdate(state){state.writing=!1,state.writecb=null,state.length-=state.writelen,state.writelen=0}function onwrite(stream,er){var state=stream._writableState,sync=state.sync,cb=state.writecb;if(onwriteStateUpdate(state),er)onwriteError(stream,state,sync,er,cb);else{var finished=needFinish(state);finished||state.corked||state.bufferProcessing||!state.bufferedRequest||clearBuffer(stream,state),sync?asyncWrite(afterWrite,stream,state,finished,cb):afterWrite(stream,state,finished,cb)}}function afterWrite(stream,state,finished,cb){finished||onwriteDrain(stream,state),state.pendingcb--,cb(),finishMaybe(stream,state)}function onwriteDrain(stream,state){0===state.length&&state.needDrain&&(state.needDrain=!1,stream.emit("drain"))}function clearBuffer(stream,state){state.bufferProcessing=!0;var entry=state.bufferedRequest;if(stream._writev&&entry&&entry.next){var l=state.bufferedRequestCount,buffer=new Array(l),holder=state.corkedRequestsFree;holder.entry=entry;for(var count=0,allBuffers=!0;entry;)buffer[count]=entry,entry.isBuf||(allBuffers=!1),entry=entry.next,count+=1;buffer.allBuffers=allBuffers,doWrite(stream,state,!0,state.length,buffer,"",holder.finish),state.pendingcb++,state.lastBufferedRequest=null,holder.next?(state.corkedRequestsFree=holder.next,holder.next=null):state.corkedRequestsFree=new CorkedRequest(state)}else{for(;entry;){var chunk=entry.chunk,encoding=entry.encoding,cb=entry.callback;if(doWrite(stream,state,!1,state.objectMode?1:chunk.length,chunk,encoding,cb),entry=entry.next,state.writing)break}null===entry&&(state.lastBufferedRequest=null)}state.bufferedRequestCount=0,state.bufferedRequest=entry,state.bufferProcessing=!1}function needFinish(state){return state.ending&&0===state.length&&null===state.bufferedRequest&&!state.finished&&!state.writing}function callFinal(stream,state){stream._final(function(err){state.pendingcb--,err&&stream.emit("error",err),state.prefinished=!0,stream.emit("prefinish"),finishMaybe(stream,state)})}function prefinish(stream,state){state.prefinished||state.finalCalled||("function"==typeof stream._final?(state.pendingcb++,state.finalCalled=!0,processNextTick(callFinal,stream,state)):(state.prefinished=!0,stream.emit("prefinish")))}function finishMaybe(stream,state){var need=needFinish(state);return need&&(prefinish(stream,state),0===state.pendingcb&&(state.finished=!0,stream.emit("finish"))),need}function endWritable(stream,state,cb){state.ending=!0,finishMaybe(stream,state),cb&&(state.finished?processNextTick(cb):stream.once("finish",cb)),state.ended=!0,stream.writable=!1}function onCorkedFinish(corkReq,state,err){var entry=corkReq.entry;for(corkReq.entry=null;entry;){var cb=entry.callback;state.pendingcb--,cb(err),entry=entry.next}state.corkedRequestsFree?state.corkedRequestsFree.next=corkReq:state.corkedRequestsFree=corkReq}var processNextTick=require("process-nextick-args");module.exports=Writable;var Duplex,asyncWrite=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=require("core-util-is");util.inherits=require("inherits");var internalUtil={deprecate:require("util-deprecate")},Stream=require("./internal/streams/stream"),Buffer=require("safe-buffer").Buffer,destroyImpl=require("./internal/streams/destroy");util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=_isUint8Array(chunk)&&!state.objectMode;return isBuf&&!Buffer.isBuffer(chunk)&&(chunk=_uint8ArrayToBuffer(chunk)),"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)},Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}}),Writable.prototype.destroy=destroyImpl.destroy,Writable.prototype._undestroy=destroyImpl.undestroy,Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}).call(this,require("_process"))},{"./_stream_duplex":91,"./internal/streams/destroy":97,"./internal/streams/stream":98,_process:86,"core-util-is":11,inherits:41,"process-nextick-args":85,"safe-buffer":103,"util-deprecate":134}],96:[function(require,module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function copyBuffer(src,target,offset){src.copy(target,offset)}var Buffer=require("safe-buffer").Buffer;module.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return Buffer.alloc(0);if(1===this.length)return this.head.data;for(var ret=Buffer.allocUnsafe(n>>>0),p=this.head,i=0;p;)copyBuffer(p.data,ret,i),i+=p.data.length,p=p.next;return ret},BufferList}()},{"safe-buffer":103}],97:[function(require,module,exports){"use strict";function destroy(err,cb){var _this=this,readableDestroyed=this._readableState&&this._readableState.destroyed,writableDestroyed=this._writableState&&this._writableState.destroyed;if(readableDestroyed||writableDestroyed)return void(cb?cb(err):!err||this._writableState&&this._writableState.errorEmitted||processNextTick(emitErrorNT,this,err));this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(err||null,function(err){!cb&&err?(processNextTick(emitErrorNT,_this,err),_this._writableState&&(_this._writableState.errorEmitted=!0)):cb&&cb(err)})}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(self,err){self.emit("error",err)}var processNextTick=require("process-nextick-args");module.exports={destroy:destroy,undestroy:undestroy}},{"process-nextick-args":85}],98:[function(require,module,exports){module.exports=require("events").EventEmitter},{events:38}],99:[function(require,module,exports){module.exports=require("./readable").PassThrough},{"./readable":100}],100:[function(require,module,exports){exports=module.exports=require("./lib/_stream_readable.js"),exports.Stream=exports,exports.Readable=exports,exports.Writable=require("./lib/_stream_writable.js"),exports.Duplex=require("./lib/_stream_duplex.js"),exports.Transform=require("./lib/_stream_transform.js"),exports.PassThrough=require("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":91,"./lib/_stream_passthrough.js":92,"./lib/_stream_readable.js":93,"./lib/_stream_transform.js":94,"./lib/_stream_writable.js":95}],101:[function(require,module,exports){module.exports=require("./readable").Transform},{"./readable":100}],102:[function(require,module,exports){module.exports=require("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":95}],103:[function(require,module,exports){function copyProps(src,dst){for(var key in src)dst[key]=src[key]}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length)}var buffer=require("buffer"),Buffer=buffer.Buffer;Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?module.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer),copyProps(Buffer,SafeBuffer),SafeBuffer.from=function(arg,encodingOrOffset,length){if("number"==typeof arg)throw new TypeError("Argument must not be a number");return Buffer(arg,encodingOrOffset,length)},SafeBuffer.alloc=function(size,fill,encoding){if("number"!=typeof size)throw new TypeError("Argument must be a number");var buf=Buffer(size);return void 0!==fill?"string"==typeof encoding?buf.fill(fill,encoding):buf.fill(fill):buf.fill(0),buf},SafeBuffer.allocUnsafe=function(size){if("number"!=typeof size)throw new TypeError("Argument must be a number");return Buffer(size)},SafeBuffer.allocUnsafeSlow=function(size){if("number"!=typeof size)throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}},{buffer:9}],104:[function(require,module,exports){function throwsMessage(err){return"[Throws: "+(err?err.message:"?")+"]"}function safeGetValueFromPropertyOnObject(obj,property){if(hasProp.call(obj,property))try{return obj[property]}catch(err){return throwsMessage(err)}return obj[property]}function ensureProperties(obj){function visit(obj){if(null===obj||"object"!=typeof obj)return obj;if(-1!==seen.indexOf(obj))return"[Circular]";if(seen.push(obj),"function"==typeof obj.toJSON)try{return visit(obj.toJSON())}catch(err){return throwsMessage(err)}return Array.isArray(obj)?obj.map(visit):Object.keys(obj).reduce(function(result,prop){return result[prop]=visit(safeGetValueFromPropertyOnObject(obj,prop)),result},{})}var seen=[];return visit(obj)}var hasProp=Object.prototype.hasOwnProperty;module.exports=function(data){return JSON.stringify(ensureProperties(data))},module.exports.ensureProperties=ensureProperties},{}],105:[function(require,module,exports){const DBEntries=require("./lib/delete.js").DBEntries,DBWriteCleanStream=require("./lib/replicate.js").DBWriteCleanStream,DBWriteMergeStream=require("./lib/replicate.js").DBWriteMergeStream,DocVector=require("./lib/delete.js").DocVector,IndexBatch=require("./lib/add.js").IndexBatch,JSONStream=require("JSONStream"),Readable=require("stream").Readable,RecalibrateDB=require("./lib/delete.js").RecalibrateDB,bunyan=require("bunyan"),del=require("./lib/delete.js"),docProc=require("docproc"),levelup=require("levelup"),pumpify=require("pumpify"),async=require("async");module.exports=function(givenOptions,callback){getOptions(givenOptions,function(err,options){var Indexer={};Indexer.options=options;var q=async.queue(function(batch,done){var s;"add"===batch.operation?(s=new Readable({objectMode:!0}),batch.batch.forEach(function(doc){s.push(doc)}),s.push(null),s.pipe(Indexer.defaultPipeline(batch.batchOps)).pipe(Indexer.add()).on("finish",function(){return done()}).on("error",function(err){return done(err)})):"delete"===batch.operation&&(s=new Readable,batch.docIds.forEach(function(docId){s.push(JSON.stringify(docId))}),s.push(null),s.pipe(Indexer.deleteStream(options)).on("data",function(){}).on("end",function(){done(null)}))},1);return Indexer.add=function(){return pumpify.obj(new IndexBatch(Indexer),new DBWriteMergeStream(options))},Indexer.concurrentAdd=function(batchOps,batch,done){q.push({batch:batch,batchOps:batchOps,operation:"add"},function(err){done(err)})},Indexer.concurrentDel=function(docIds,done){q.push({docIds:docIds,operation:"delete"},function(err){done(err)})},Indexer.close=function(callback){options.indexes.close(function(err){for(;!options.indexes.isClosed();)options.log.debug("closing...");options.indexes.isClosed()&&(options.log.debug("closed..."),callback(err))})},Indexer.dbWriteStream=function(streamOps){return streamOps=Object.assign({},{merge:!0},streamOps),streamOps.merge?new DBWriteMergeStream(options):new DBWriteCleanStream(options)},Indexer.defaultPipeline=function(batchOptions){return batchOptions=Object.assign({},options,batchOptions),docProc.pipeline(batchOptions)},Indexer.deleteStream=function(options){return pumpify.obj(new DocVector(options),new DBEntries(options),new RecalibrateDB(options))},Indexer.deleter=function(docIds,done){const s=new Readable;docIds.forEach(function(docId){s.push(JSON.stringify(docId))}),s.push(null),s.pipe(Indexer.deleteStream(options)).on("data",function(){}).on("end",function(){done(null)})},Indexer.feed=function(ops){return ops&&ops.objectMode?pumpify.obj(Indexer.defaultPipeline(ops),Indexer.add(ops)):pumpify(JSONStream.parse(),Indexer.defaultPipeline(ops),Indexer.add(ops))},Indexer.flush=function(APICallback){del.flush(options,function(err){return APICallback(err)})},callback(err,Indexer)})};const getOptions=function(options,done){if(options=Object.assign({},{deletable:!0,batchSize:1e3,fieldedSearch:!0,fieldOptions:{},preserveCase:!1,keySeparator:"￮",storeable:!0,searchable:!0,indexPath:"si",logLevel:"error",nGramLength:1,nGramSeparator:" ",separator:/\s|\\n|\\u0003|[-.,<>]/,stopwords:[],weight:0},options),options.log=bunyan.createLogger({name:"search-index",level:options.logLevel}),options.indexes)done(null,options);else{const leveldown=require("leveldown");levelup(options.indexPath||"si",{valueEncoding:"json",db:leveldown},function(err,db){options.indexes=db,done(err,options)})}}},{"./lib/add.js":106,"./lib/delete.js":107,"./lib/replicate.js":108,JSONStream:3,async:5,bunyan:10,docproc:19,leveldown:59,levelup:72,pumpify:89,stream:127}],106:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),emitIndexKeys=function(s){for(var key in s.deltaIndex)s.push({key:key,value:s.deltaIndex[key]});s.deltaIndex={}},IndexBatch=function(indexer){this.indexer=indexer,this.deltaIndex={},Transform.call(this,{objectMode:!0})};exports.IndexBatch=IndexBatch,util.inherits(IndexBatch,Transform),IndexBatch.prototype._transform=function(ingestedDoc,encoding,end){const sep=this.indexer.options.keySeparator;var that=this;this.indexer.deleter([ingestedDoc.id],function(err){err&&that.indexer.log.info(err),that.indexer.options.log.info("processing doc "+ingestedDoc.id),that.deltaIndex["DOCUMENT"+sep+ingestedDoc.id+sep]=ingestedDoc.stored;for(var fieldName in ingestedDoc.vector){that.deltaIndex["FIELD"+sep+fieldName]=fieldName;for(var token in ingestedDoc.vector[fieldName]){var vMagnitude=ingestedDoc.vector[fieldName][token],tfKeyName="TF"+sep+fieldName+sep+token,dfKeyName="DF"+sep+fieldName+sep+token;that.deltaIndex[tfKeyName]=that.deltaIndex[tfKeyName]||[],that.deltaIndex[tfKeyName].push([vMagnitude,ingestedDoc.id]),that.deltaIndex[dfKeyName]=that.deltaIndex[dfKeyName]||[],that.deltaIndex[dfKeyName].push(ingestedDoc.id)}that.deltaIndex["DOCUMENT-VECTOR"+sep+ingestedDoc.id+sep+fieldName+sep]=ingestedDoc.vector[fieldName]}var totalKeys=Object.keys(that.deltaIndex).length;return totalKeys>that.indexer.options.batchSize&&(that.push({totalKeys:totalKeys}),that.indexer.options.log.info("deltaIndex is "+totalKeys+" long, emitting"),emitIndexKeys(that)),end()})},IndexBatch.prototype._flush=function(end){return emitIndexKeys(this),end()}},{stream:127,util:137}],107:[function(require,module,exports){const util=require("util"),Transform=require("stream").Transform;exports.flush=function(options,callback){const sep=options.keySeparator;var deleteOps=[];options.indexes.createKeyStream({gte:"0",lte:sep}).on("data",function(data){deleteOps.push({type:"del",key:data})}).on("error",function(err){return options.log.error(err," failed to empty index"),callback(err)}).on("end",function(){options.indexes.batch(deleteOps,callback)})};const DocVector=function(options){this.options=options,Transform.call(this,{objectMode:!0})};exports.DocVector=DocVector,util.inherits(DocVector,Transform),DocVector.prototype._transform=function(docId,encoding,end){docId=JSON.parse(docId);const sep=this.options.keySeparator;var that=this;this.options.indexes.createReadStream({gte:"DOCUMENT-VECTOR"+sep+docId+sep,lte:"DOCUMENT-VECTOR"+sep+docId+sep+sep}).on("data",function(data){that.push(data)}).on("close",function(){return end()})};const DBEntries=function(options){this.options=options,Transform.call(this,{objectMode:!0})};exports.DBEntries=DBEntries,
  util.inherits(DBEntries,Transform),DBEntries.prototype._transform=function(vector,encoding,end){const sep=this.options.keySeparator;var docId;for(var k in vector.value){docId=vector.key.split(sep)[1];var field=vector.key.split(sep)[2];this.push({key:"TF"+sep+field+sep+k,value:docId}),this.push({key:"DF"+sep+field+sep+k,value:docId})}return this.push({key:vector.key}),this.push({key:"DOCUMENT"+sep+docId+sep}),end()};const RecalibrateDB=function(options){this.options=options,Transform.call(this,{objectMode:!0})};exports.RecalibrateDB=RecalibrateDB,util.inherits(RecalibrateDB,Transform),RecalibrateDB.prototype._transform=function(dbEntry,encoding,end){const sep=this.options.keySeparator;var that=this;this.options.indexes.get(dbEntry.key,function(err,value){err&&that.options.log.info(err),value||(value=[]);var docId=dbEntry.value,dbInstruction={};dbInstruction.key=dbEntry.key,dbEntry.key.substring(0,3)==="TF"+sep?(dbInstruction.value=value.filter(function(item){return item[1]!==docId}),0===dbInstruction.value.length?dbInstruction.type="del":dbInstruction.type="put"):dbEntry.key.substring(0,3)==="DF"+sep?(value.splice(value.indexOf(docId),1),dbInstruction.value=value,0===dbInstruction.value.length?dbInstruction.type="del":dbInstruction.type="put"):dbEntry.key.substring(0,9)==="DOCUMENT"+sep?dbInstruction.type="del":dbEntry.key.substring(0,16)==="DOCUMENT-VECTOR"+sep&&(dbInstruction.type="del"),that.options.indexes.batch([dbInstruction],function(err){return end()})})}},{stream:127,util:137}],108:[function(require,module,exports){const Transform=require("stream").Transform,Writable=require("stream").Writable,util=require("util"),DBWriteMergeStream=function(options){this.options=options,Writable.call(this,{objectMode:!0})};exports.DBWriteMergeStream=DBWriteMergeStream,util.inherits(DBWriteMergeStream,Writable),DBWriteMergeStream.prototype._write=function(data,encoding,end){if(data.totalKeys)return end();const sep=this.options.keySeparator;var that=this;this.options.indexes.get(data.key,function(err,val){var newVal;newVal=data.key.substring(0,3)==="TF"+sep?data.value.concat(val||[]).sort(function(a,b){return a[0]<b[0]?1:a[0]>b[0]?-1:a[1]<b[1]?1:a[1]>b[1]?-1:0}):data.key.substring(0,3)==="DF"+sep?data.value.concat(val||[]).sort():"DOCUMENT-COUNT"===data.key?+val+(+data.value||0):data.value,that.options.indexes.put(data.key,newVal,function(err){end()})})};const DBWriteCleanStream=function(options){this.currentBatch=[],this.options=options,Transform.call(this,{objectMode:!0})};util.inherits(DBWriteCleanStream,Transform),DBWriteCleanStream.prototype._transform=function(data,encoding,end){var that=this;this.currentBatch.push(data),this.currentBatch.length%this.options.batchSize==0?this.options.indexes.batch(this.currentBatch,function(err){that.push("indexing batch"),that.currentBatch=[],end()}):end()},DBWriteCleanStream.prototype._flush=function(end){var that=this;this.options.indexes.batch(this.currentBatch,function(err){that.push("remaining data indexed"),end()})},exports.DBWriteCleanStream=DBWriteCleanStream},{stream:127,util:137}],109:[function(require,module,exports){const AvailableFields=require("./lib/AvailableFields.js").AvailableFields,CalculateBuckets=require("./lib/CalculateBuckets.js").CalculateBuckets,CalculateCategories=require("./lib/CalculateCategories.js").CalculateCategories,CalculateEntireResultSet=require("./lib/CalculateEntireResultSet.js").CalculateEntireResultSet,CalculateResultSetPerClause=require("./lib/CalculateResultSetPerClause.js").CalculateResultSetPerClause,CalculateTopScoringDocs=require("./lib/CalculateTopScoringDocs.js").CalculateTopScoringDocs,CalculateTotalHits=require("./lib/CalculateTotalHits.js").CalculateTotalHits,Classify=require("./lib/Classify.js").Classify,FetchDocsFromDB=require("./lib/FetchDocsFromDB.js").FetchDocsFromDB,FetchStoredDoc=require("./lib/FetchStoredDoc.js").FetchStoredDoc,GetIntersectionStream=require("./lib/GetIntersectionStream.js").GetIntersectionStream,MergeOrConditions=require("./lib/MergeOrConditions.js").MergeOrConditions,Readable=require("stream").Readable,ScoreDocsOnField=require("./lib/ScoreDocsOnField.js").ScoreDocsOnField,ScoreTopScoringDocsTFIDF=require("./lib/ScoreTopScoringDocsTFIDF.js").ScoreTopScoringDocsTFIDF,SortTopScoringDocs=require("./lib/SortTopScoringDocs.js").SortTopScoringDocs,bunyan=require("bunyan"),levelup=require("levelup"),matcher=require("./lib/matcher.js"),siUtil=require("./lib/siUtil.js"),initModule=function(err,Searcher,moduleReady){return Searcher.bucketStream=function(q){q=siUtil.getQueryDefaults(q);const s=new Readable({objectMode:!0});return q.query.forEach(function(clause){s.push(clause)}),s.push(null),s.pipe(new CalculateResultSetPerClause(Searcher.options,q.filter||{})).pipe(new CalculateEntireResultSet(Searcher.options)).pipe(new CalculateBuckets(Searcher.options,q.filter||{},q.buckets))},Searcher.categoryStream=function(q){q=siUtil.getQueryDefaults(q);const s=new Readable({objectMode:!0});return q.query.forEach(function(clause){s.push(clause)}),s.push(null),s.pipe(new CalculateResultSetPerClause(Searcher.options,q.filter||{})).pipe(new CalculateEntireResultSet(Searcher.options)).pipe(new CalculateCategories(Searcher.options,q))},Searcher.classify=function(ops){return new Classify(Searcher,ops)},Searcher.close=function(callback){Searcher.options.indexes.close(function(err){for(;!Searcher.options.indexes.isClosed();)Searcher.options.log.debug("closing...");Searcher.options.indexes.isClosed()&&(Searcher.options.log.debug("closed..."),callback(err))})},Searcher.availableFields=function(){const sep=Searcher.options.keySeparator;return Searcher.options.indexes.createReadStream({gte:"FIELD"+sep,lte:"FIELD"+sep+sep}).pipe(new AvailableFields(Searcher.options))},Searcher.get=function(docIDs){var s=new Readable({objectMode:!0});return docIDs.forEach(function(id){s.push(id)}),s.push(null),s.pipe(new FetchDocsFromDB(Searcher.options))},Searcher.fieldNames=function(){return Searcher.options.indexes.createReadStream({gte:"FIELD",lte:"FIELD"})},Searcher.match=function(q){return matcher.match(q,Searcher.options)},Searcher.dbReadStream=function(){return Searcher.options.indexes.createReadStream()},Searcher.search=function(q){q=siUtil.getQueryDefaults(q);const s=new Readable({objectMode:!0});return q.query.forEach(function(clause){s.push(clause)}),s.push(null),q.sort?s.pipe(new CalculateResultSetPerClause(Searcher.options)).pipe(new CalculateTopScoringDocs(Searcher.options,q.offset+q.pageSize)).pipe(new ScoreDocsOnField(Searcher.options,q.offset+q.pageSize,q.sort)).pipe(new MergeOrConditions(q)).pipe(new SortTopScoringDocs(q)).pipe(new FetchStoredDoc(Searcher.options)):s.pipe(new CalculateResultSetPerClause(Searcher.options)).pipe(new CalculateTopScoringDocs(Searcher.options,q.offset+q.pageSize)).pipe(new ScoreTopScoringDocsTFIDF(Searcher.options)).pipe(new MergeOrConditions(q)).pipe(new SortTopScoringDocs(q)).pipe(new FetchStoredDoc(Searcher.options))},Searcher.scan=function(q){q=siUtil.getQueryDefaults(q);var s=new Readable({objectMode:!0});return s.push("init"),s.push(null),s.pipe(new GetIntersectionStream(Searcher.options,siUtil.getKeySet(q.query[0].AND,Searcher.options.keySeparator))).pipe(new FetchDocsFromDB(Searcher.options))},Searcher.totalHits=function(q,callback){q=siUtil.getQueryDefaults(q);const s=new Readable({objectMode:!0});q.query.forEach(function(clause){s.push(clause)}),s.push(null),s.pipe(new CalculateResultSetPerClause(Searcher.options,q.filter||{})).pipe(new CalculateEntireResultSet(Searcher.options)).pipe(new CalculateTotalHits(Searcher.options)).on("data",function(totalHits){return callback(null,totalHits)})},moduleReady(err,Searcher)},getOptions=function(options,done){var Searcher={};if(Searcher.options=Object.assign({},{deletable:!0,fieldedSearch:!0,store:!0,indexPath:"si",keySeparator:"￮",logLevel:"error",nGramLength:1,nGramSeparator:" ",separator:/[|' .,\-|(\n)]+/,stopwords:[]},options),Searcher.options.log=bunyan.createLogger({name:"search-index",level:options.logLevel}),options.indexes)return done(null,Searcher);levelup(Searcher.options.indexPath||"si",{valueEncoding:"json"},function(err,db){return Searcher.options.indexes=db,done(err,Searcher)})};module.exports=function(givenOptions,moduleReady){getOptions(givenOptions,function(err,Searcher){initModule(err,Searcher,moduleReady)})}},{"./lib/AvailableFields.js":110,"./lib/CalculateBuckets.js":111,"./lib/CalculateCategories.js":112,"./lib/CalculateEntireResultSet.js":113,"./lib/CalculateResultSetPerClause.js":114,"./lib/CalculateTopScoringDocs.js":115,"./lib/CalculateTotalHits.js":116,"./lib/Classify.js":117,"./lib/FetchDocsFromDB.js":118,"./lib/FetchStoredDoc.js":119,"./lib/GetIntersectionStream.js":120,"./lib/MergeOrConditions.js":121,"./lib/ScoreDocsOnField.js":122,"./lib/ScoreTopScoringDocsTFIDF.js":123,"./lib/SortTopScoringDocs.js":124,"./lib/matcher.js":125,"./lib/siUtil.js":126,bunyan:10,levelup:72,stream:127}],110:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),AvailableFields=function(options){this.options=options,Transform.call(this,{objectMode:!0})};exports.AvailableFields=AvailableFields,util.inherits(AvailableFields,Transform),AvailableFields.prototype._transform=function(field,encoding,end){return this.push(field.key.split(this.options.keySeparator)[1]),end()}},{stream:127,util:137}],111:[function(require,module,exports){const _intersection=require("lodash.intersection"),_uniq=require("lodash.uniq"),Transform=require("stream").Transform,util=require("util"),CalculateBuckets=function(options,filter,requestedBuckets){this.buckets=requestedBuckets||[],this.filter=filter,this.options=options,Transform.call(this,{objectMode:!0})};exports.CalculateBuckets=CalculateBuckets,util.inherits(CalculateBuckets,Transform),CalculateBuckets.prototype._transform=function(mergedQueryClauses,encoding,end){const that=this,sep=this.options.keySeparator;var bucketsProcessed=0;that.buckets.forEach(function(bucket){const gte="DF"+sep+bucket.field+sep+bucket.gte,lte="DF"+sep+bucket.field+sep+bucket.lte+sep;that.options.indexes.createReadStream({gte:gte,lte:lte}).on("data",function(data){var IDSet=_intersection(data.value,mergedQueryClauses.set);IDSet.length>0&&(bucket.value=bucket.value||[],bucket.value=_uniq(bucket.value.concat(IDSet).sort()))}).on("close",function(){if(bucket.set||(bucket.value=bucket.value.length),that.push(bucket),++bucketsProcessed===that.buckets.length)return end()})})}},{"lodash.intersection":75,"lodash.uniq":80,stream:127,util:137}],112:[function(require,module,exports){const _intersection=require("lodash.intersection"),Transform=require("stream").Transform,util=require("util"),CalculateCategories=function(options,q){var category=q.category||[];category.values=[],this.offset=+q.offset,this.pageSize=+q.pageSize,this.category=category,this.options=options,this.query=q.query,Transform.call(this,{objectMode:!0})};exports.CalculateCategories=CalculateCategories,util.inherits(CalculateCategories,Transform),CalculateCategories.prototype._transform=function(mergedQueryClauses,encoding,end){if(!this.category.field)return end(new Error("you need to specify a category"));const sep=this.options.keySeparator,that=this,gte="DF"+sep+this.category.field+sep,lte="DF"+sep+this.category.field+sep+sep;this.category.values=this.category.values||[];var i=this.offset+this.pageSize,j=0;const rs=that.options.indexes.createReadStream({gte:gte,lte:lte});rs.on("data",function(data){if(!(that.offset>j++)){var IDSet=_intersection(data.value,mergedQueryClauses.set);if(IDSet.length>0){var key=data.key.split(sep)[2],value=IDSet.length;that.category.set&&(value=IDSet);var result={key:key,value:value};if(1===that.query.length)try{that.query[0].AND[that.category.field].indexOf(key)>-1&&(result.filter=!0)}catch(e){}i-- >that.offset?that.push(result):rs.destroy()}}}).on("close",function(){return end()})}},{"lodash.intersection":75,stream:127,util:137}],113:[function(require,module,exports){const Transform=require("stream").Transform,_union=require("lodash.union"),util=require("util"),CalculateEntireResultSet=function(options){this.options=options,this.setSoFar=[],Transform.call(this,{objectMode:!0})};exports.CalculateEntireResultSet=CalculateEntireResultSet,util.inherits(CalculateEntireResultSet,Transform),CalculateEntireResultSet.prototype._transform=function(queryClause,encoding,end){return this.setSoFar=_union(queryClause.set,this.setSoFar),end()},CalculateEntireResultSet.prototype._flush=function(end){return this.push({set:this.setSoFar}),end()}},{"lodash.union":79,stream:127,util:137}],114:[function(require,module,exports){const Transform=require("stream").Transform,_difference=require("lodash.difference"),_intersection=require("lodash.intersection"),_spread=require("lodash.spread"),siUtil=require("./siUtil.js"),util=require("util"),CalculateResultSetPerClause=function(options){this.options=options,Transform.call(this,{objectMode:!0})};exports.CalculateResultSetPerClause=CalculateResultSetPerClause,util.inherits(CalculateResultSetPerClause,Transform),CalculateResultSetPerClause.prototype._transform=function(queryClause,encoding,end){const sep=this.options.keySeparator,that=this,frequencies=[];var NOT=function(includeResults){const bigIntersect=_spread(_intersection);var include=bigIntersect(includeResults);if(0===siUtil.getKeySet(queryClause.NOT,sep).length)return that.push({queryClause:queryClause,set:include,termFrequencies:frequencies,BOOST:queryClause.BOOST||0}),end();var i=0,excludeResults=[];siUtil.getKeySet(queryClause.NOT,sep).forEach(function(item){var excludeSet={};that.options.indexes.createReadStream({gte:item[0],lte:item[1]+sep}).on("data",function(data){for(var i=0;i<data.value.length;i++)excludeSet[data.value[i]]=1}).on("error",function(err){that.options.log.debug(err)}).on("end",function(){var exclude=Object.keys(excludeSet);if(excludeResults.push(exclude.sort()),++i===siUtil.getKeySet(queryClause.NOT,sep).length)return excludeResults.forEach(function(excludeSet){include=_difference(include,excludeSet)}),that.push({queryClause:queryClause,set:include,termFrequencies:frequencies,BOOST:queryClause.BOOST||0}),end()})})},IDSets=[];siUtil.getKeySet(queryClause.AND,sep).forEach(function(item){var includeSet={},setLength=0;that.options.indexes.createReadStream({gte:item[0],lte:item[1]}).on("data",function(data){setLength+=data.value.length;for(var i=0;i<data.value.length;i++)includeSet[data.value[i]]=1}).on("error",function(err){that.options.log.debug(err)}).on("end",function(){var include=Object.keys(includeSet);frequencies.push({gte:item[0].split(sep)[1]+sep+item[0].split(sep)[2],lte:item[1].split(sep)[1]+sep+item[1].split(sep)[2],tf:include.length,setLength:setLength}),IDSets.push(include.sort()),IDSets.length===siUtil.getKeySet(queryClause.AND,sep).length&&NOT(IDSets)})})}},{"./siUtil.js":126,"lodash.difference":74,"lodash.intersection":75,"lodash.spread":78,stream:127,util:137}],115:[function(require,module,exports){const Transform=require("stream").Transform,_sortedIndexOf=require("lodash.sortedindexof"),util=require("util"),CalculateTopScoringDocs=function(options,seekLimit){this.options=options,this.seekLimit=seekLimit,Transform.call(this,{objectMode:!0})};exports.CalculateTopScoringDocs=CalculateTopScoringDocs,util.inherits(CalculateTopScoringDocs,Transform),CalculateTopScoringDocs.prototype._transform=function(clauseSet,encoding,end){const sep=this.options.keySeparator,that=this,lowestFrequency=clauseSet.termFrequencies.sort(function(a,b){return a.setLength-b.setLength})[0],gte="TF"+sep+lowestFrequency.gte,lte="TF"+sep+lowestFrequency.lte+sep;var topScoringDocs=[];that.options.indexes.createReadStream({gte:gte,lte:lte}).on("data",function(data){for(var intersections=[],i=0;i<data.value.length&&intersections.length<that.seekLimit;i++)-1!==_sortedIndexOf(clauseSet.set,data.value[i][1])&&intersections.push(data.value[i]);topScoringDocs=topScoringDocs.concat(intersections)}).on("error",function(err){that.options.log.debug(err)}).on("end",function(){return clauseSet.topScoringDocs=topScoringDocs,that.push(clauseSet),end()})}},{"lodash.sortedindexof":77,stream:127,util:137}],116:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),CalculateTotalHits=function(options,filter,requestedBuckets){this.buckets=requestedBuckets||[],this.filter=filter,this.options=options,Transform.call(this,{objectMode:!0})};exports.CalculateTotalHits=CalculateTotalHits,util.inherits(CalculateTotalHits,Transform),CalculateTotalHits.prototype._transform=function(mergedQueryClauses,encoding,end){this.push(mergedQueryClauses.set.length),end()}},{stream:127,util:137}],117:[function(require,module,exports){const Transform=require("stream").Transform,ngraminator=require("ngraminator"),util=require("util"),checkTokens=function(that,potentialMatches,field,done){var match=function(i){if(i===potentialMatches.length)return done();var matchQuery={beginsWith:potentialMatches[i],field:field,type:"ID",threshold:0,limit:1};that.searcher.match(matchQuery).on("data",function(match){match.token===potentialMatches[i]&&that.push(match)}).on("end",function(){match(++i)})};match(0)},Classify=function(searcher,options){this.options=Object.assign({},searcher.options,options),this.searcher=searcher,this.maxNGramLength=this.options.maxNGramLength||1,this.field=this.options.field||"*",this.stack=[],Transform.call(this,{objectMode:!0})};exports.Classify=Classify,util.inherits(Classify,Transform),Classify.prototype._transform=function(token,encoding,end){var stack=this.stack,t=token.toString(),that=this,potentialMatches=[];if(stack.push(t),stack.length<this.maxNGramLength)return end();stack.forEach(function(item,i){potentialMatches.push(stack.slice(0,1+i).join(" ").toLowerCase())}),checkTokens(that,potentialMatches,this.field,function(){return stack.shift(),end()})},Classify.prototype._flush=function(end){var that=this,stack=this.stack,potentialMatches=ngraminator.ngram(stack,{gte:1,lte:that.maxNGramLength}).map(function(token){return token.join(" ").toLowerCase()});checkTokens(that,potentialMatches,this.field,function(){return end()})}},{ngraminator:82,stream:127,util:137}],118:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),FetchDocsFromDB=function(options){this.options=options,Transform.call(this,{objectMode:!0})};exports.FetchDocsFromDB=FetchDocsFromDB,util.inherits(FetchDocsFromDB,Transform),FetchDocsFromDB.prototype._transform=function(line,encoding,end){const sep=this.options.keySeparator,that=this;this.options.indexes.get("DOCUMENT"+sep+line.toString()+sep,function(err,doc){err||that.push(doc),end()})}},{stream:127,util:137}],119:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),FetchStoredDoc=function(options){this.options=options,Transform.call(this,{objectMode:!0})};exports.FetchStoredDoc=FetchStoredDoc,util.inherits(FetchStoredDoc,Transform),FetchStoredDoc.prototype._transform=function(doc,encoding,end){const sep=this.options.keySeparator;var that=this;that.options.indexes.get("DOCUMENT"+sep+doc.id+sep,function(err,stored){return err&&that.options.log.debug(err),doc.document=stored,that.push(doc),end()})}},{stream:127,util:137}],120:[function(require,module,exports){const Transform=require("stream").Transform,iats=require("intersect-arrays-to-stream"),util=require("util"),GetIntersectionStream=function(options,ANDKeys){this.ANDKeys=ANDKeys,this.options=options,Transform.call(this,{objectMode:!0})};exports.GetIntersectionStream=GetIntersectionStream,util.inherits(GetIntersectionStream,Transform),GetIntersectionStream.prototype._transform=function(line,encoding,end){const that=this;var IDSets=[];this.ANDKeys.forEach(function(item){var ANDSetIDs=[];that.options.indexes.createReadStream({gte:item[0],lte:item[1]}).on("data",function(data){ANDSetIDs=ANDSetIDs.concat(data.value).sort()}).on("end",function(){IDSets.push(ANDSetIDs),IDSets.length===that.ANDKeys.length&&iats.getIntersectionStream(IDSets).on("data",function(data){that.push(data)}).on("end",function(){end()})})})}},{"intersect-arrays-to-stream":42,stream:127,util:137}],121:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),MergeOrConditions=function(q){this.resultSet=[],this.q=q,Transform.call(this,{objectMode:!0})};exports.MergeOrConditions=MergeOrConditions,util.inherits(MergeOrConditions,Transform),MergeOrConditions.prototype._transform=function(doc,encoding,end){return this.resultSet.push(doc),end()},MergeOrConditions.prototype._flush=function(end){var that=this,mergedResultSet=this.resultSet.sort(function(a,b){return a.id<b.id?1:a.id>b.id?-1:0}).reduce(function(merged,cur){var lastDoc=merged[merged.length-1];return 0===merged.length||cur.id!==lastDoc.id?merged.push(cur):cur.id===lastDoc.id&&(lastDoc.scoringCriteria=lastDoc.scoringCriteria.concat(cur.scoringCriteria)),merged},[]);return mergedResultSet.map(function(item){return item.scoringCriteria&&(item.score=item.scoringCriteria.reduce(function(acc,val){return{score:+acc.score+ +val.score}},{score:0}).score,item.score=item.score/item.scoringCriteria.length),item}),mergedResultSet.forEach(function(item){that.push(item)}),end()}},{stream:127,util:137}],122:[function(require,module,exports){const Transform=require("stream").Transform,_sortedIndexOf=require("lodash.sortedindexof"),util=require("util"),ScoreDocsOnField=function(options,seekLimit,sort){this.options=options,this.seekLimit=seekLimit,this.sort=sort,Transform.call(this,{objectMode:!0})};exports.ScoreDocsOnField=ScoreDocsOnField,util.inherits(ScoreDocsOnField,Transform),ScoreDocsOnField.prototype._transform=function(clauseSet,encoding,end){const sep=this.options.keySeparator,that=this,gte="TF"+sep+this.sort.field+sep,lte="TF"+sep+this.sort.field+sep+sep;that.options.indexes.createReadStream({gte:gte,lte:lte}).on("data",function(data){for(var i=0;i<data.value.length&&i<that.seekLimit;i++)-1!==_sortedIndexOf(clauseSet.set,data.value[i][1])&&that.push({id:data.value[i][1],score:data.value[i][0]})}).on("end",function(){return end()})}},{"lodash.sortedindexof":77,stream:127,util:137}],123:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),ScoreTopScoringDocsTFIDF=function(options){this.options=options,Transform.call(this,{objectMode:!0})};exports.ScoreTopScoringDocsTFIDF=ScoreTopScoringDocsTFIDF,util.inherits(ScoreTopScoringDocsTFIDF,Transform),ScoreTopScoringDocsTFIDF.prototype._transform=function(clause,encoding,end){const sep=this.options.keySeparator,that=this;clause.queryClause.BOOST=clause.queryClause.BOOST||0;const fields=Object.keys(clause.queryClause.AND);var i=0;if(0===clause.topScoringDocs.length)return end();clause.topScoringDocs.forEach(function(docID){docID=docID[1];var tfVectors={},fieldFetchCounter=0;fields.forEach(function(field){that.options.indexes.get("DOCUMENT-VECTOR"+sep+docID+sep+field+sep,function(err,docVector){if(err&&console.log(err),clause.queryClause.AND[field].forEach(function(token){tfVectors[field+sep+token]=docVector[token]}),++fieldFetchCounter===fields.length){var documentFrequencies=clause.termFrequencies;const tfidf={};for(var j=0;j<=documentFrequencies.length;j++){var item=documentFrequencies[j];if(item){var tf=+item.tf,df=+tfVectors[item.gte],idf=Math.log10(1+1/df);tfidf[item.gte]=tf*idf}}var score=Object.keys(tfidf).reduce(function(prev,cur){return(tfidf[prev]||0)+tfidf[cur]},0)/Object.keys(tfidf).length;if(that.push({id:docID,scoringCriteria:[{tf:tfVectors,df:documentFrequencies,tfidf:tfidf,boost:+clause.queryClause.BOOST,score:score-+clause.queryClause.BOOST}],score:score-+clause.queryClause.BOOST}),++i===clause.topScoringDocs.length)return end()}})})})}},{stream:127,util:137}],124:[function(require,module,exports){const Transform=require("stream").Transform,util=require("util"),SortTopScoringDocs=function(q){this.resultSet=[],this.q=q,q.sort&&q.sort.direction&&(this.sortDirection=q.sort.direction),Transform.call(this,{objectMode:!0})};exports.SortTopScoringDocs=SortTopScoringDocs,util.inherits(SortTopScoringDocs,Transform),SortTopScoringDocs.prototype._transform=function(doc,encoding,end){return this.resultSet.push(doc),end()},SortTopScoringDocs.prototype._flush=function(end){const that=this;return"desc"===this.sortDirection?this.resultSet=this.resultSet.sort(function(a,b){return a.score<b.score?2:a.score>b.score?-2:a.id<b.id?1:a.id>b.id?-1:0}):this.resultSet=this.resultSet.sort(function(a,b){return a.score>b.score?2:a.score<b.score?-2:a.id<b.id?1:a.id>b.id?-1:0}),this.resultSet=this.resultSet.slice(this.q.offset,this.q.offset+this.q.pageSize),this.resultSet.forEach(function(hit){that.push(hit)}),end()}},{stream:127,util:137}],125:[function(require,module,exports){const Readable=require("stream").Readable,Transform=require("stream").Transform,util=require("util"),MatcherStream=function(q,options){this.options=options,Transform.call(this,{objectMode:!0})};util.inherits(MatcherStream,Transform),MatcherStream.prototype._transform=function(q,encoding,end){const sep=this.options.keySeparator,that=this;var results=[];this.options.indexes.createReadStream({start:"DF"+sep+q.field+sep+q.beginsWith,end:"DF"+sep+q.field+sep+q.beginsWith+sep}).on("data",function(data){results.push(data)}).on("error",function(err){that.options.log.error("Oh my!",err)}).on("end",function(){return results.sort(function(a,b){return b.value.length-a.value.length}).slice(0,q.limit).forEach(function(item){var m={};switch(q.type){case"ID":m={token:item.key.split(sep)[2],documents:item.value};break;case"count":m={token:item.key.split(sep)[2],documentCount:item.value.length};break;default:m=item.key.split(sep)[2]}that.push(m)}),end()})},exports.match=function(q,options){var s=new Readable({objectMode:!0});return q=Object.assign({},{beginsWith:"",field:"*",threshold:3,limit:10,type:"simple"},q),q.beginsWith.length<q.threshold?(s.push(null),s):(s.push(q),s.push(null),s.pipe(new MatcherStream(q,options)))}},{stream:127,util:137}],126:[function(require,module,exports){exports.getKeySet=function(clause,sep){var keySet=[];for(var fieldName in clause)clause[fieldName].forEach(function(token){var gte=token.gte||token,lte=token.lte||token;keySet.push(["DF"+sep+fieldName+sep+gte,"DF"+sep+fieldName+sep+lte])});return keySet},exports.getQueryDefaults=function(q){"string"==typeof q&&(q={query:[{AND:{"*":q.split(" ")}}]}),q&&q.query&&"[object Array]"!==Object.prototype.toString.call(q.query)&&(q.query=[q.query]);try{q.offset&&(q.offset=parseInt(q.offset))}catch(e){}try{q.pageSize&&(q.pageSize=parseInt(q.pageSize))}catch(e){}return Object.assign({},{query:[{AND:{"*":["*"]}}],offset:0,pageSize:20},q)}},{}],127:[function(require,module,exports){function Stream(){EE.call(this)}module.exports=Stream;var EE=require("events").EventEmitter;require("inherits")(Stream,EE),Stream.Readable=require("readable-stream/readable.js"),Stream.Writable=require("readable-stream/writable.js"),Stream.Duplex=require("readable-stream/duplex.js"),Stream.Transform=require("readable-stream/transform.js"),Stream.PassThrough=require("readable-stream/passthrough.js"),Stream.Stream=Stream,Stream.prototype.pipe=function(dest,options){function ondata(chunk){dest.writable&&!1===dest.write(chunk)&&source.pause&&source.pause()}function ondrain(){source.readable&&source.resume&&source.resume()}function onend(){didOnEnd||(didOnEnd=!0,dest.end())}function onclose(){didOnEnd||(didOnEnd=!0,"function"==typeof dest.destroy&&dest.destroy())}function onerror(er){if(cleanup(),0===EE.listenerCount(this,"error"))throw er}function cleanup(){source.removeListener("data",ondata),dest.removeListener("drain",ondrain),source.removeListener("end",onend),source.removeListener("close",onclose),source.removeListener("error",onerror),dest.removeListener("error",onerror),source.removeListener("end",cleanup),source.removeListener("close",cleanup),dest.removeListener("close",cleanup)}var source=this;source.on("data",ondata),dest.on("drain",ondrain),dest._isStdio||options&&!1===options.end||(source.on("end",onend),source.on("close",onclose));var didOnEnd=!1;return source.on("error",onerror),dest.on("error",onerror),source.on("end",cleanup),source.on("close",cleanup),dest.on("close",cleanup),dest.emit("pipe",source),dest}},{events:38,inherits:41,"readable-stream/duplex.js":90,"readable-stream/passthrough.js":99,"readable-stream/readable.js":100,"readable-stream/transform.js":101,"readable-stream/writable.js":102}],128:[function(require,module,exports){function shift(stream){var rs=stream._readableState;return rs?rs.objectMode?stream.read():stream.read(getStateLength(rs)):null}function getStateLength(state){return state.buffer.length?state.buffer.head?state.buffer.head.data.length:state.buffer[0].length:state.length}module.exports=shift},{}],129:[function(require,module,exports){"use strict";function _normalizeEncoding(enc){if(!enc)return"utf8";for(var retried;;)switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase(),retried=!0}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if("string"!=typeof nenc&&(Buffer.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,nb=4;break;case"utf8":this.fillLast=utf8FillLast,nb=4;break;case"base64":this.text=base64Text,this.end=base64End,nb=3;break;default:return this.write=simpleWrite,void(this.end=simpleEnd)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer.allocUnsafe(nb)}function utf8CheckByte(byte){return byte<=127?0:byte>>5==6?2:byte>>4==14?3:byte>>3==30?4:-1}function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);return nb>=0?(nb>0&&(self.lastNeed=nb-1),nb):--j<i?0:(nb=utf8CheckByte(buf[j]))>=0?(nb>0&&(self.lastNeed=nb-2),nb):--j<i?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(2===nb?nb=0:self.lastNeed=nb-3),nb):0)}function utf8CheckExtraBytes(self,buf,p){if(128!=(192&buf[0]))return self.lastNeed=0,"�".repeat(p);if(self.lastNeed>1&&buf.length>1){if(128!=(192&buf[1]))return self.lastNeed=1,"�".repeat(p+1);if(self.lastNeed>2&&buf.length>2&&128!=(192&buf[2]))return self.lastNeed=2,"�".repeat(p+2)}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r=utf8CheckExtraBytes(this,buf,p);return void 0!==r?r:this.lastNeed<=buf.length?(buf.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(buf.copy(this.lastChar,p,0,buf.length),void(this.lastNeed-=buf.length))}function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString("utf8",i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);return buf.copy(this.lastChar,0,end),buf.toString("utf8",i,end)}function utf8End(buf){var r=buf&&buf.length?this.write(buf):"";return this.lastNeed?r+"�".repeat(this.lastTotal-this.lastNeed):r}function utf16Text(buf,i){if((buf.length-i)%2==0){var r=buf.toString("utf16le",i);if(r){var c=r.charCodeAt(r.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=buf[buf.length-1],buf.toString("utf16le",i,buf.length-1)}function utf16End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,end)}return r}function base64Text(buf,i){var n=(buf.length-i)%3;return 0===n?buf.toString("base64",i):(this.lastNeed=3-n,this.lastTotal=3,
  1===n?this.lastChar[0]=buf[buf.length-1]:(this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1]),buf.toString("base64",i,buf.length-n))}function base64End(buf){var r=buf&&buf.length?this.write(buf):"";return this.lastNeed?r+this.lastChar.toString("base64",0,3-this.lastNeed):r}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}var Buffer=require("safe-buffer").Buffer,isEncoding=Buffer.isEncoding||function(encoding){switch((encoding=""+encoding)&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};exports.StringDecoder=StringDecoder,StringDecoder.prototype.write=function(buf){if(0===buf.length)return"";var r,i;if(this.lastNeed){if(void 0===(r=this.fillLast(buf)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<buf.length?r?r+this.text(buf,i):this.text(buf,i):r||""},StringDecoder.prototype.end=utf8End,StringDecoder.prototype.text=utf8Text,StringDecoder.prototype.fillLast=function(buf){if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,buf.length),this.lastNeed-=buf.length}},{"safe-buffer":103}],130:[function(require,module,exports){exports.doubleNormalization0point5="doubleNormalization0point5",exports.logNormalization="logNormalization",exports.raw="raw",exports.selfString="selfString",exports.selfNumeric="selfNumeric",exports.getTermFrequency=function(docVector,options){if(options=Object.assign({},{scheme:"raw",weight:0},options),!docVector)return[];if(0===docVector.length)return[];if("logNormalization"===options.scheme)return docVector.map(function(item){return[item[0],+options.weight+Math.log(+item[1]+1)]});if("doubleNormalization0point5"===options.scheme){var maxFreq=docVector.sort(function(a,b){return b[1]-a[1]})[0][1];return docVector.map(function(item){return[item[0],+options.weight+.5+.5*+item[1]/maxFreq]})}return"raw"===options.scheme?docVector.map(function(item){return[item[0],+options.weight+item[1]]}):"selfString"===options.scheme?docVector.map(function(item){return[item[0],item[0][0]+""]}):"selfNumeric"===options.scheme?docVector.map(function(item){var value=item[0][0];return!isNaN(parseFloat(value))&&isFinite(value)&&(value=+options.weight+ +item[0][0]),[item[0],value]}):void 0}},{}],131:[function(require,module,exports){const _isEqual=require("lodash.isequal");exports.getVector=function(tokens,nGramLength){if(nGramLength=nGramLength||1,"[object Array]"!==Object.prototype.toString.call(tokens))throw new Error("error: input must be an Array");if(0===nGramLength)throw new Error("error: nGramLength must be greater than 0");var vec=[];if(isNaN(nGramLength)){if("[object Array]"===Object.prototype.toString.call(nGramLength)){for(var i=0;i<nGramLength.length;i++)vec=vec.concat(getTermVectorForNgramLength(tokens,nGramLength[i]));return vec}if(parseInt(nGramLength.gte)<=parseInt(nGramLength.lte)){for(var j=parseInt(nGramLength.gte);j<=nGramLength.lte&&tokens[j-1];)vec=vec.concat(getTermVectorForNgramLength(tokens,j++));return vec}throw new Error("nGramLength seems to be maformed- see docs")}return getTermVectorForNgramLength(tokens,nGramLength)};var getTermVectorForNgramLength=function(tokens,nGramLength){if(nGramLength>tokens.length)return[];for(var ngrams=[],i=0;i<=tokens.length-nGramLength;i++)ngrams.push(tokens.slice(i,i+nGramLength));if(ngrams=ngrams.sort(),1===ngrams.length)return[[ngrams[0],1]];for(var counter=1,lastToken=ngrams[0],vector=[],j=1;j<ngrams.length;j++)_isEqual(ngrams[j],lastToken)?counter++:(vector.push([lastToken,counter]),counter=1,lastToken=ngrams[j]);return vector.push([ngrams[i-1],counter]),vector}},{"lodash.isequal":76}],132:[function(require,module,exports){(function(process){function through(write,end,opts){function drain(){for(;buffer.length&&!stream.paused;){var data=buffer.shift();if(null===data)return stream.emit("end");stream.emit("data",data)}}function _end(){stream.writable=!1,end.call(stream),!stream.readable&&stream.autoDestroy&&stream.destroy()}write=write||function(data){this.queue(data)},end=end||function(){this.queue(null)};var ended=!1,destroyed=!1,buffer=[],_ended=!1,stream=new Stream;return stream.readable=stream.writable=!0,stream.paused=!1,stream.autoDestroy=!(opts&&!1===opts.autoDestroy),stream.write=function(data){return write.call(this,data),!stream.paused},stream.queue=stream.push=function(data){return _ended?stream:(null===data&&(_ended=!0),buffer.push(data),drain(),stream)},stream.on("end",function(){stream.readable=!1,!stream.writable&&stream.autoDestroy&&process.nextTick(function(){stream.destroy()})}),stream.end=function(data){if(!ended)return ended=!0,arguments.length&&stream.write(data),_end(),stream},stream.destroy=function(){if(!destroyed)return destroyed=!0,ended=!0,buffer.length=0,stream.writable=stream.readable=!1,stream.emit("close"),stream},stream.pause=function(){if(!stream.paused)return stream.paused=!0,stream},stream.resume=function(){return stream.paused&&(stream.paused=!1,stream.emit("resume")),drain(),stream.paused||stream.emit("drain"),stream},stream}var Stream=require("stream");exports=module.exports=through,through.through=through}).call(this,require("_process"))},{_process:86,stream:127}],133:[function(require,module,exports){(function(Buffer){module.exports=function(arr){return"function"==typeof Buffer._augment&&Buffer.TYPED_ARRAY_SUPPORT?Buffer._augment(arr):new Buffer(arr)}}).call(this,require("buffer").Buffer)},{buffer:9}],134:[function(require,module,exports){(function(global){function deprecate(fn,msg){function deprecated(){if(!warned){if(config("throwDeprecation"))throw new Error(msg);config("traceDeprecation")?console.trace(msg):console.warn(msg),warned=!0}return fn.apply(this,arguments)}if(config("noDeprecation"))return fn;var warned=!1;return deprecated}function config(name){try{if(!global.localStorage)return!1}catch(_){return!1}var val=global.localStorage[name];return null!=val&&"true"===String(val).toLowerCase()}module.exports=deprecate}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],135:[function(require,module,exports){arguments[4][41][0].apply(exports,arguments)},{dup:41}],136:[function(require,module,exports){module.exports=function(arg){return arg&&"object"==typeof arg&&"function"==typeof arg.copy&&"function"==typeof arg.fill&&"function"==typeof arg.readUInt8}},{}],137:[function(require,module,exports){(function(process,global){function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(ctx.depth=arguments[2]),arguments.length>=4&&(ctx.colors=arguments[3]),isBoolean(opts)?ctx.showHidden=opts:opts&&exports._extend(ctx,opts),isUndefined(ctx.showHidden)&&(ctx.showHidden=!1),isUndefined(ctx.depth)&&(ctx.depth=2),isUndefined(ctx.colors)&&(ctx.colors=!1),isUndefined(ctx.customInspect)&&(ctx.customInspect=!0),ctx.colors&&(ctx.stylize=stylizeWithColor),formatValue(ctx,obj,ctx.depth)}function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];return style?"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m":str}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};return array.forEach(function(val,idx){hash[val]=!0}),hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&(!value.constructor||value.constructor.prototype!==value)){var ret=value.inspect(recurseTimes,ctx);return isString(ret)||(ret=formatValue(ctx,ret,recurseTimes)),ret}var primitive=formatPrimitive(ctx,value);if(primitive)return primitive;var keys=Object.keys(value),visibleKeys=arrayToHash(keys);if(ctx.showHidden&&(keys=Object.getOwnPropertyNames(value)),isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0))return formatError(value);if(0===keys.length){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value))return ctx.stylize(RegExp.prototype.toString.call(value),"regexp");if(isDate(value))return ctx.stylize(Date.prototype.toString.call(value),"date");if(isError(value))return formatError(value)}var base="",array=!1,braces=["{","}"];if(isArray(value)&&(array=!0,braces=["[","]"]),isFunction(value)){base=" [Function"+(value.name?": "+value.name:"")+"]"}if(isRegExp(value)&&(base=" "+RegExp.prototype.toString.call(value)),isDate(value)&&(base=" "+Date.prototype.toUTCString.call(value)),isError(value)&&(base=" "+formatError(value)),0===keys.length&&(!array||0==value.length))return braces[0]+base+braces[1];if(recurseTimes<0)return isRegExp(value)?ctx.stylize(RegExp.prototype.toString.call(value),"regexp"):ctx.stylize("[Object]","special");ctx.seen.push(value);var output;return output=array?formatArray(ctx,value,recurseTimes,visibleKeys,keys):keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)}),ctx.seen.pop(),reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}return isNumber(value)?ctx.stylize(""+value,"number"):isBoolean(value)?ctx.stylize(""+value,"boolean"):isNull(value)?ctx.stylize("null","null"):void 0}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){for(var output=[],i=0,l=value.length;i<l;++i)hasOwnProperty(value,String(i))?output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),!0)):output.push("");return keys.forEach(function(key){key.match(/^\d+$/)||output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,!0))}),output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;if(desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]},desc.get?str=desc.set?ctx.stylize("[Getter/Setter]","special"):ctx.stylize("[Getter]","special"):desc.set&&(str=ctx.stylize("[Setter]","special")),hasOwnProperty(visibleKeys,key)||(name="["+key+"]"),str||(ctx.seen.indexOf(desc.value)<0?(str=isNull(recurseTimes)?formatValue(ctx,desc.value,null):formatValue(ctx,desc.value,recurseTimes-1),str.indexOf("\n")>-1&&(str=array?str.split("\n").map(function(line){return"  "+line}).join("\n").substr(2):"\n"+str.split("\n").map(function(line){return"   "+line}).join("\n"))):str=ctx.stylize("[Circular]","special")),isUndefined(name)){if(array&&key.match(/^\d+$/))return str;name=JSON.stringify(""+key),name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(name=name.substr(1,name.length-2),name=ctx.stylize(name,"name")):(name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),name=ctx.stylize(name,"string"))}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;return output.reduce(function(prev,cur){return numLinesEst++,cur.indexOf("\n")>=0&&numLinesEst++,prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?braces[0]+(""===base?"":base+"\n ")+" "+output.join(",\n  ")+" "+braces[1]:braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return isObject(re)&&"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return isObject(d)&&"[object Date]"===objectToString(d)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg}function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}function timestamp(){var d=new Date,time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){for(var objects=[],i=0;i<arguments.length;i++)objects.push(inspect(arguments[i]));return objects.join(" ")}for(var i=1,args=arguments,len=args.length,str=String(f).replace(formatRegExp,function(x){if("%%"===x)return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}}),x=args[i];i<len;x=args[++i])isNull(x)||!isObject(x)?str+=" "+x:str+=" "+inspect(x);return str},exports.deprecate=function(fn,msg){function deprecated(){if(!warned){if(process.throwDeprecation)throw new Error(msg);process.traceDeprecation?console.trace(msg):console.error(msg),warned=!0}return fn.apply(this,arguments)}if(isUndefined(global.process))return function(){return exports.deprecate(fn,msg).apply(this,arguments)};if(!0===process.noDeprecation)return fn;var warned=!1;return deprecated};var debugEnviron,debugs={};exports.debuglog=function(set){if(isUndefined(debugEnviron)&&(debugEnviron=process.env.NODE_DEBUG||""),set=set.toUpperCase(),!debugs[set])if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else debugs[set]=function(){};return debugs[set]},exports.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=require("./support/isBuffer");var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))},exports.inherits=require("inherits"),exports._extend=function(origin,add){if(!add||!isObject(add))return origin;for(var keys=Object.keys(add),i=keys.length;i--;)origin[keys[i]]=add[keys[i]];return origin}}).call(this,require("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":136,_process:86,inherits:135}],138:[function(require,module,exports){function wrappy(fn,cb){function wrapper(){for(var args=new Array(arguments.length),i=0;i<args.length;i++)args[i]=arguments[i];var ret=fn.apply(this,args),cb=args[args.length-1];return"function"==typeof ret&&ret!==cb&&Object.keys(cb).forEach(function(k){ret[k]=cb[k]}),ret}if(fn&&cb)return wrappy(fn)(cb);if("function"!=typeof fn)throw new TypeError("need wrapper function");return Object.keys(fn).forEach(function(k){wrapper[k]=fn[k]}),wrapper}module.exports=wrappy},{}],139:[function(require,module,exports){function extend(){for(var target={},i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source)hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target}module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty},{}]},{},[1])(1)});
  