(function(f){if(typeofexports==="object"&&typeofmodule!=="undefined"){module.exports=f()}elseif(typeofdefine==="function"&&define.amd){define([],f)}else{varg;if(typeofwindow!=="undefined"){g=window}elseif(typeofglobal!=="undefined"){g=global}elseif(typeofself!=="undefined"){g=self}else{g=this}g.Syndicate=f()}})(function(){vardefine,module,exports;returnfunctione(t,n,r){functions(o,u){if(!n[o]){if(!t[o]){vara=typeofrequire=="function"&&require;if(!u&&a)returna(o,!0);if(i)returni(o,!0);varf=newError("Cannot find module '"+o+"'");throwf.code="MODULE_NOT_FOUND",f}varl=n[o]={exports:{}};t[o][0].call(l.exports,function(e){varn=t[o][1][e];returns(n?n:e)},l,l.exports,e,t,n,r)}returnn[o].exports}vari=typeofrequire=="function"&&require;for(varo=0;o<r.length;o++)s(r[o]);returns}({1:[function(require,module,exports){},{}],2:[function(require,module,exports){(function(global){"use strict";varbase64=require("base64-js");varieee754=require("ieee754");varisArray=require("isarray");exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=global.TYPED_ARRAY_SUPPORT!==undefined?global.TYPED_ARRAY_SUPPORT:typedArraySupport();exports.kMaxLength=kMaxLength();functiontypedArraySupport(){try{vararr=newUint8Array(1);arr.foo=function(){return42};returnarr.foo()===42&&typeofarr.subarray==="function"&&arr.subarray(1,1).byteLength===0}catch(e){returnfalse}}functionkMaxLength(){returnBuffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}functioncreateBuffer(that,length){if(kMaxLength()<length){thrownewRangeError("Invalid typed array length")}if(Buffer.TYPED_ARRAY_SUPPORT){that=newUint8Array(length);that.__proto__=Buffer.prototype}else{if(that===null){that=newBuffer(length)}that.length=length}returnthat}functionBuffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(thisinstanceofBuffer)){returnnewBuffer(arg,encodingOrOffset,length)}if(typeofarg==="number"){if(typeofencodingOrOffset==="string"){thrownewError("If encoding is specified then the first argument must be a string")}returnallocUnsafe(this,arg)}returnfrom(this,arg,encodingOrOffset,length)}Buffer.poolSize=8192;Buffer._augment=function(arr){arr.__proto__=Buffer.prototype;returnarr};functionfrom(that,value,encodingOrOffset,length){if(typeofvalue==="number"){thrownewTypeError('"value" argument must not be a number')}if(typeofArrayBuffer!=="undefined"&&valueinstanceofArrayBuffer){returnfromArrayBuffer(that,value,encodingOrOffset,length)}if(typeofvalue==="string"){returnfromString(that,value,encodingOrOffset)}returnfromObject(that,value)}Buffer.from=function(value,encodingOrOffset,length){returnfrom(null,value,encodingOrOffset,length)};if(Buffer.TYPED_ARRAY_SUPPORT){Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;if(typeofSymbol!=="undefined"&&Symbol.species&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true})}}functionassertSize(size){if(typeofsize!=="number"){thrownewTypeError('"size" argument must be a number')}}functionalloc(that,size,fill,encoding){assertSize(size);if(size<=0){returncreateBuffer(that,size)}if(fill!==undefined){returntypeofencoding==="string"?createBuffer(that,size).fill(fill,encoding):createBuffer(that,size).fill(fill)}returncreateBuffer(that,size)}Buffer.alloc=function(size,fill,encoding){returnalloc(null,size,fill,encoding)};functionallocUnsafe(that,size){assertSize(size);that=createBuffer(that,size<0?0:checked(size)|0);if(!Buffer.TYPED_ARRAY_SUPPORT){for(vari=0;i<size;i++){that[i]=0}}returnthat}Buffer.allocUnsafe=function(size){returnallocUnsafe(null,size)};Buffer.allocUnsafeSlow=function(size){returnallocUnsafe(null,size)};functionfromString(that,string,encoding){if(typeofencoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){thrownewTypeError('"encoding" must be a valid string encoding')}varlength=byteLength(string,encoding)|0;that=createBuffer(that,length);that.write(string,encoding);returnthat}functionfro
varArr=typeofUint8Array!=="undefined"?Uint8Array:Array;functioninit(){varcode="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(vari=0,len=code.length;i<len;++i){lookup[i]=code[i];revLookup[code.charCodeAt(i)]=i}revLookup["-".charCodeAt(0)]=62;revLookup["_".charCodeAt(0)]=63}init();functiontoByteArray(b64){vari,j,l,tmp,placeHolders,arr;varlen=b64.length;if(len%4>0){thrownewError("Invalid string. Length must be a multiple of 4")}placeHolders=b64[len-2]==="="?2:b64[len-1]==="="?1:0;arr=newArr(len*3/4-placeHolders);l=placeHolders>0?len-4:len;varL=0;for(i=0,j=0;i<l;i+=4,j+=3){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++]=tmp&255}if(placeHolders===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[L++]=tmp&255}elseif(placeHolders===1){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++]=tmp&255}returnarr}functiontripletToBase64(num){returnlookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}functionencodeChunk(uint8,start,end){vartmp;varoutput=[];for(vari=start;i<end;i+=3){tmp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2];output.push(tripletToBase64(tmp))}returnoutput.join("")}functionfromByteArray(uint8){vartmp;varlen=uint8.length;varextraBytes=len%3;varoutput="";varparts=[];varmaxChunkLength=16383;for(vari=0,len2=len-extraBytes;i<len2;i+=maxChunkLength){parts.push(encodeChunk(uint8,i,i+maxChunkLength>len2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];output+=lookup[tmp>>2];output+=lookup[tmp<<4&63];output+="=="}elseif(extraBytes===2){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);returnparts.join("")}},{}],4:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){vare,m;vareLen=nBytes*8-mLen-1;vareMax=(1<<eLen)-1;vareBias=eMax>>1;varnBits=-7;vari=isLE?nBytes-1:0;vard=isLE?-1:1;vars=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}elseif(e===eMax){returnm?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){vare,m,c;vareLen=nBytes*8-mLen-1;vareMax=(1<<eLen)-1;vareBias=eMax>>1;varrt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;vari=isLE?0:nBytes-1;vard=isLE?1:-1;vars=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}elseif(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128}},{}],5:[function(require,module,exports){vartoString={}.toString;module.exports=Array.isArray||function(arr){returntoString.call(arr)=="[object Array]"}},{}],6:[function(require,module,exports){"use strict";exports.randomBytes=exports.rng=exports.pseudoRandomBytes=exports.prng=require("randombytes");exports.createHash=exports.Hash=require("create-hash");exports.createHmac=exports.Hmac=require("create-hmac");varhashes=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(Object.keys(require("browserify-sign/algos")));exports.getHashes=function(){returnhashes};varp=require("pbkdf2");exports.pbkdf2=p.pbkdf2;exports.pbkdf2Sync=p.pbkdf2Sync;varaes=require("browserify-cipher");["Cipher","createCipher","Cipheriv","createC
this._des=mode.create({key:key,iv:iv,type:type})}DES.prototype._update=function(data){returnnewBuffer(this._des.update(data))};DES.prototype._final=function(){returnnewBuffer(this._des.final())}}).call(this,require("buffer").Buffer)},{buffer:2,"cipher-base":27,"des.js":28,inherits:199}],26:[function(require,module,exports){exports["des-ecb"]={key:8,iv:0};exports["des-cbc"]=exports.des={key:8,iv:8};exports["des-ede3-cbc"]=exports.des3={key:24,iv:8};exports["des-ede3"]={key:24,iv:0};exports["des-ede-cbc"]={key:16,iv:8};exports["des-ede"]={key:16,iv:0}},{}],27:[function(require,module,exports){arguments[4][23][0].apply(exports,arguments)},{buffer:2,dup:23,inherits:199,stream:216,string_decoder:217}],28:[function(require,module,exports){"use strict";exports.utils=require("./des/utils");exports.Cipher=require("./des/cipher");exports.DES=require("./des/des");exports.CBC=require("./des/cbc");exports.EDE=require("./des/ede")},{"./des/cbc":29,"./des/cipher":30,"./des/des":31,"./des/ede":32,"./des/utils":33}],29:[function(require,module,exports){"use strict";varassert=require("minimalistic-assert");varinherits=require("inherits");varproto={};functionCBCState(iv){assert.equal(iv.length,8,"Invalid IV length");this.iv=newArray(8);for(vari=0;i<this.iv.length;i++)this.iv[i]=iv[i]}functioninstantiate(Base){functionCBC(options){Base.call(this,options);this._cbcInit()}inherits(CBC,Base);varkeys=Object.keys(proto);for(vari=0;i<keys.length;i++){varkey=keys[i];CBC.prototype[key]=proto[key]}CBC.create=functioncreate(options){returnnewCBC(options)};returnCBC}exports.instantiate=instantiate;proto._cbcInit=function_cbcInit(){varstate=newCBCState(this.options.iv);this._cbcState=state};proto._update=function_update(inp,inOff,out,outOff){varstate=this._cbcState;varsuperProto=this.constructor.super_.prototype;variv=state.iv;if(this.type==="encrypt"){for(vari=0;i<this.blockSize;i++)iv[i]^=inp[inOff+i];superProto._update.call(this,iv,0,out,outOff);for(vari=0;i<this.blockSize;i++)iv[i]=out[outOff+i]}else{superProto._update.call(this,inp,inOff,out,outOff);for(vari=0;i<this.blockSize;i++)out[outOff+i]^=iv[i];for(vari=0;i<this.blockSize;i++)iv[i]=inp[inOff+i]}}},{inherits:199,"minimalistic-assert":34}],30:[function(require,module,exports){"use strict";varassert=require("minimalistic-assert");functionCipher(options){this.options=options;this.type=this.options.type;this.blockSize=8;this._init();this.buffer=newArray(this.blockSize);this.bufferOff=0}module.exports=Cipher;Cipher.prototype._init=function_init(){};Cipher.prototype.update=functionupdate(data){if(data.length===0)return[];if(this.type==="decrypt")returnthis._updateDecrypt(data);elsereturnthis._updateEncrypt(data)};Cipher.prototype._buffer=function_buffer(data,off){varmin=Math.min(this.buffer.length-this.bufferOff,data.length-off);for(vari=0;i<min;i++)this.buffer[this.bufferOff+i]=data[off+i];this.bufferOff+=min;returnmin};Cipher.prototype._flushBuffer=function_flushBuffer(out,off){this._update(this.buffer,0,out,off);this.bufferOff=0;returnthis.blockSize};Cipher.prototype._updateEncrypt=function_updateEncrypt(data){varinputOff=0;varoutputOff=0;varcount=(this.bufferOff+data.length)/this.blockSize|0;varout=newArray(count*this.blockSize);if(this.bufferOff!==0){inputOff+=this._buffer(data,inputOff);if(this.bufferOff===this.buffer.length)outputOff+=this._flushBuffer(out,outputOff)}varmax=data.length-(data.length-inputOff)%this.blockSize;for(;inputOff<max;inputOff+=this.blockSize){this._update(data,inputOff,out,outputOff);outputOff+=this.blockSize}for(;inputOff<data.length;inputOff++,this.bufferOff++)this.buffer[this.bufferOff]=data[inputOff];returnout};Cipher.prototype._updateDecrypt=function_updateDecrypt(data){varinputOff=0;varoutputOff=0;varcount=Math.ceil((this.bufferOff+data.length)/this.blockSize)-1;varout=newArray(count*this.blockSize);for(;count>0;count--){inputOff+=this._buffer(data,inputOff);outputOff+=this._flushBuffer(out,outputOff)}inputOff+=this._buffer(data,inputOff);returnout};Cipher.prototype.final=functionfinal(buffer){varfir
}prev>>>=22;input.words[i-10]=prev;if(prev===0&&input.length>10){input.length-=10}else{input.length-=9}};K256.prototype.imulK=functionimulK(num){num.words[num.length]=0;num.words[num.length+1]=0;num.length+=2;varlo=0;for(vari=0;i<num.length;i++){varw=num.words[i]|0;lo+=w*977;num.words[i]=lo&67108863;lo=w*64+(lo/67108864|0)}if(num.words[num.length-1]===0){num.length--;if(num.words[num.length-1]===0){num.length--}}returnnum};functionP224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}inherits(P224,MPrime);functionP192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}inherits(P192,MPrime);functionP25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}inherits(P25519,MPrime);P25519.prototype.imulK=functionimulK(num){varcarry=0;for(vari=0;i<num.length;i++){varhi=(num.words[i]|0)*19+carry;varlo=hi&67108863;hi>>>=26;num.words[i]=lo;carry=hi}if(carry!==0){num.words[num.length++]=carry}returnnum};BN._prime=functionprime(name){if(primes[name])returnprimes[name];varprime;if(name==="k256"){prime=newK256}elseif(name==="p224"){prime=newP224}elseif(name==="p192"){prime=newP192}elseif(name==="p25519"){prime=newP25519}else{thrownewError("Unknown prime "+name)}primes[name]=prime;returnprime};functionRed(m){if(typeofm==="string"){varprime=BN._prime(m);this.m=prime.p;this.prime=prime}else{assert(m.gtn(1),"modulus must be greater than 1");this.m=m;this.prime=null}}Red.prototype._verify1=function_verify1(a){assert(a.negative===0,"red works only with positives");assert(a.red,"red works only with red numbers")};Red.prototype._verify2=function_verify2(a,b){assert((a.negative|b.negative)===0,"red works only with positives");assert(a.red&&a.red===b.red,"red works only with red numbers")};Red.prototype.imod=functionimod(a){if(this.prime)returnthis.prime.ireduce(a)._forceRed(this);returna.umod(this.m)._forceRed(this)};Red.prototype.neg=functionneg(a){if(a.isZero()){returna.clone()}returnthis.m.sub(a)._forceRed(this)};Red.prototype.add=functionadd(a,b){this._verify2(a,b);varres=a.add(b);if(res.cmp(this.m)>=0){res.isub(this.m)}returnres._forceRed(this)};Red.prototype.iadd=functioniadd(a,b){this._verify2(a,b);varres=a.iadd(b);if(res.cmp(this.m)>=0){res.isub(this.m)}returnres};Red.prototype.sub=functionsub(a,b){this._verify2(a,b);varres=a.sub(b);if(res.cmpn(0)<0){res.iadd(this.m)}returnres._forceRed(this)};Red.prototype.isub=functionisub(a,b){this._verify2(a,b);varres=a.isub(b);if(res.cmpn(0)<0){res.iadd(this.m)}returnres};Red.prototype.shl=functionshl(a,num){this._verify1(a);returnthis.imod(a.ushln(num))};Red.prototype.imul=functionimul(a,b){this._verify2(a,b);returnthis.imod(a.imul(b))};Red.prototype.mul=functionmul(a,b){this._verify2(a,b);returnthis.imod(a.mul(b))};Red.prototype.isqr=functionisqr(a){returnthis.imul(a,a.clone())};Red.prototype.sqr=functionsqr(a){returnthis.mul(a,a)};Red.prototype.sqrt=functionsqrt(a){if(a.isZero())returna.clone();varmod3=this.m.andln(3);assert(mod3%2===1);if(mod3===3){varpow=this.m.add(newBN(1)).iushrn(2);returnthis.pow(a,pow)}varq=this.m.subn(1);vars=0;while(!q.isZero()&&q.andln(1)===0){s++;q.iushrn(1)}assert(!q.isZero());varone=newBN(1).toRed(this);varnOne=one.redNeg();varlpow=this.m.subn(1).iushrn(1);varz=this.m.bitLength();z=newBN(2*z*z).toRed(this);while(this.pow(z,lpow).cmp(nOne)!==0){z.redIAdd(nOne)}varc=this.pow(z,q);varr=this.pow(a,q.addn(1).iushrn(1));vart=this.pow(a,q);varm=s;while(t.cmp(one)!==0){vartmp=t;for(vari=0;tmp.cmp(one)!==0;i++){tmp=tmp.redSqr()}assert(i<m);varb=this.pow(c,newBN(1).iushln(m-i-1));r=r.redMul(b);c=b.redSqr();t=t.redMul(c);m=i}returnr};Red.prototype.invm=functioninvm(a){varinv=a._invmp(this.m);if(inv.negative!==0){inv.negative=0;returnthis.imod(inv).redNeg()}else{returnthis.imod(inv)}};Red.prototype.pow=functionpow(a,num){if(num.isZero())returnnewBN(1);if(num.cmpn(1)===0)returna.clone();varwindowSize=4;varwnd=newArray(1<<windowSize);wnd[0]=newBN(1).toRed(this);wn
varres=child._encode(data[child._baseState.key],reporter,data);reporter.leaveKey(prevKey);returnres},this).filter(function(child){returnchild});content=this._createEncoderBuffer(content)}else{if(state.tag==="seqof"||state.tag==="setof"){if(!(state.args&&state.args.length===1))returnreporter.error("Too many args for : "+state.tag);if(!Array.isArray(data))returnreporter.error("seqof/setof, but data is not Array");varchild=this.clone();child._baseState.implicit=null;content=this._createEncoderBuffer(data.map(function(item){varstate=this._baseState;returnthis._getUse(state.args[0],data)._encode(item,reporter)},child))}elseif(state.use!==null){result=this._getUse(state.use,parent)._encode(data,reporter)}else{content=this._encodePrimitive(state.tag,data);primitive=true}}varresult;if(!state.any&&state.choice===null){vartag=state.implicit!==null?state.implicit:state.tag;varcls=state.implicit===null?"universal":"context";if(tag===null){if(state.use===null)reporter.error("Tag could be ommited only for .use()")}else{if(state.use===null)result=this._encodeComposite(tag,primitive,cls,content)}}if(state.explicit!==null)result=this._encodeComposite(state.explicit,false,"context",result);returnresult};Node.prototype._encodeChoice=functionencodeChoice(data,reporter){varstate=this._baseState;varnode=state.choice[data.type];if(!node){assert(false,data.type+" not found in "+JSON.stringify(Object.keys(state.choice)))}returnnode._encode(data.value,reporter)};Node.prototype._encodePrimitive=functionencodePrimitive(tag,data){varstate=this._baseState;if(/str$/.test(tag))returnthis._encodeStr(data,tag);elseif(tag==="objid"&&state.args)returnthis._encodeObjid(data,state.reverseArgs[0],state.args[1]);elseif(tag==="objid")returnthis._encodeObjid(data,null,null);elseif(tag==="gentime"||tag==="utctime")returnthis._encodeTime(data,tag);elseif(tag==="null_")returnthis._encodeNull();elseif(tag==="int"||tag==="enum")returnthis._encodeInt(data,state.args&&state.reverseArgs[0]);elseif(tag==="bool")returnthis._encodeBool(data);elsethrownewError("Unsupported tag: "+tag)};Node.prototype._isNumstr=functionisNumstr(str){return/^[0-9 ]*$/.test(str)};Node.prototype._isPrintstr=functionisPrintstr(str){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str)}},{"../base":72,"minimalistic-assert":83}],74:[function(require,module,exports){varinherits=require("inherits");functionReporter(options){this._reporterState={obj:null,path:[],options:options||{},errors:[]}}exports.Reporter=Reporter;Reporter.prototype.isError=functionisError(obj){returnobjinstanceofReporterError};Reporter.prototype.save=functionsave(){varstate=this._reporterState;return{obj:state.obj,pathLen:state.path.length}};Reporter.prototype.restore=functionrestore(data){varstate=this._reporterState;state.obj=data.obj;state.path=state.path.slice(0,data.pathLen)};Reporter.prototype.enterKey=functionenterKey(key){returnthis._reporterState.path.push(key)};Reporter.prototype.leaveKey=functionleaveKey(index,key,value){varstate=this._reporterState;state.path=state.path.slice(0,index-1);if(state.obj!==null)state.obj[key]=value};Reporter.prototype.enterObject=functionenterObject(){varstate=this._reporterState;varprev=state.obj;state.obj={};returnprev};Reporter.prototype.leaveObject=functionleaveObject(prev){varstate=this._reporterState;varnow=state.obj;state.obj=prev;returnnow};Reporter.prototype.error=functionerror(msg){varerr;varstate=this._reporterState;varinherited=msginstanceofReporterError;if(inherited){err=msg}else{err=newReporterError(state.path.map(function(elem){return"["+JSON.stringify(elem)+"]"}).join(""),msg.message||msg,msg.stack)}if(!state.options.partial)throwerr;if(!inherited)state.errors.push(err);returnerr};Reporter.prototype.wrapResult=functionwrapResult(result){varstate=this._reporterState;if(!state.options.partial)returnresult;return{result:this.isError(result)?null:result,errors:state.errors}};functionReporterError(path,msg){this.path=path;this.rethrow(msg)}inherits(ReporterError,Error);ReporterError.prototype.rethrow=functio
if(addToFront)state.buffer.unshift(chunk);elsestate.buffer.push(chunk);if(state.needReadable)emitReadable(stream)}}maybeReadMore(stream,state)}}elseif(!addToFront){state.reading=false}returnneedMoreData(state)}functionneedMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}Readable.prototype.setEncoding=function(enc){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this._readableState.decoder=newStringDecoder(enc);this._readableState.encoding=enc;returnthis};varMAX_HWM=8388608;functioncomputeNewHighWaterMark(n){if(n>=MAX_HWM){n=MAX_HWM}else{n--;n|=n>>>1;n|=n>>>2;n|=n>>>4;n|=n>>>8;n|=n>>>16;n++}returnn}functionhowMuchToRead(n,state){if(state.length===0&&state.ended)return0;if(state.objectMode)returnn===0?0:1;if(n===null||isNaN(n)){if(state.flowing&&state.buffer.length)returnstate.buffer[0].length;elsereturnstate.length}if(n<=0)return0;if(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n>state.length){if(!state.ended){state.needReadable=true;return0}else{returnstate.length}}returnn}Readable.prototype.read=function(n){debug("read",n);varstate=this._readableState;varnOrig=n;if(typeofn!=="number"||n>0)state.emittedReadable=false;if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){debug("read: emitReadable",state.length,state.ended);if(state.length===0&&state.ended)endReadable(this);elseemitReadable(this);returnnull}n=howMuchToRead(n,state);if(n===0&&state.ended){if(state.length===0)endReadable(this);returnnull}vardoRead=state.needReadable;debug("need readable",doRead);if(state.length===0||state.length-n<state.highWaterMark){doRead=true;debug("length less than watermark",doRead)}if(state.ended||state.reading){doRead=false;debug("reading or ended",doRead)}if(doRead){debug("do read");state.reading=true;state.sync=true;if(state.length===0)state.needReadable=true;this._read(state.highWaterMark);state.sync=false}if(doRead&&!state.reading)n=howMuchToRead(nOrig,state);varret;if(n>0)ret=fromList(n,state);elseret=null;if(ret===null){state.needReadable=true;n=0}state.length-=n;if(state.length===0&&!state.ended)state.needReadable=true;if(nOrig!==n&&state.ended&&state.length===0)endReadable(this);if(ret!==null)this.emit("data",ret);returnret};functionchunkInvalid(state,chunk){varer=null;if(!Buffer.isBuffer(chunk)&&typeofchunk!=="string"&&chunk!==null&&chunk!==undefined&&!state.objectMode){er=newTypeError("Invalid non-string/buffer chunk")}returner}functiononEofChunk(stream,state){if(state.ended)return;if(state.decoder){varchunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;emitReadable(stream)}functionemitReadable(stream){varstate=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug("emitReadable",state.flowing);state.emittedReadable=true;if(state.sync)processNextTick(emitReadable_,stream);elseemitReadable_(stream)}}functionemitReadable_(stream){debug("emit readable");stream.emit("readable");flow(stream)}functionmaybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state)}}functionmaybeReadMore_(stream,state){varlen=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark){debug("maybeReadMore read 0");stream.read(0);if(len===state.length)break;elselen=state.length}state.readingMore=false}Readable.prototype._read=function(n){this.emit("error",newError("not implemented"))};Readable.prototype.pipe=function(dest,pipeOpts){varsrc=this;varstate=this._readableState;switch(state.pipesCount){case0:state.pipes=dest;break;case1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1;debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);vardoEnd=(!pipeOpts||pipeOpts.end!==false)&&dest!==process.stdout&&dest!==process.stderr;varendFn=doEnd?onend:cleanup;if(state.endEmitted)processNextTick(endFn);elsesrc.once("end",endF
functionContext(){}Context.prototype={};varScript=exports.Script=functionNodeScript(code){if(!(thisinstanceofScript))returnnewScript(code);this.code=code};Script.prototype.runInContext=function(context){if(!(contextinstanceofContext)){thrownewTypeError("needs a 'context' argument.")}variframe=document.createElement("iframe");if(!iframe.style)iframe.style={};iframe.style.display="none";document.body.appendChild(iframe);varwin=iframe.contentWindow;varwEval=win.eval,wExecScript=win.execScript;if(!wEval&&wExecScript){wExecScript.call(win,"null");wEval=win.eval}forEach(Object_keys(context),function(key){win[key]=context[key]});forEach(globals,function(key){if(context[key]){win[key]=context[key]}});varwinKeys=Object_keys(win);varres=wEval.call(win,this.code);forEach(Object_keys(win),function(key){if(keyincontext||indexOf(winKeys,key)===-1){context[key]=win[key]}});forEach(globals,function(key){if(!(keyincontext)){defineProp(context,key,win[key])}});document.body.removeChild(iframe);returnres};Script.prototype.runInThisContext=function(){returneval(this.code)};Script.prototype.runInNewContext=function(context){varctx=Script.createContext(context);varres=this.runInContext(ctx);forEach(Object_keys(ctx),function(key){context[key]=ctx[key]});returnres};forEach(Object_keys(Script.prototype),function(name){exports[name]=Script[name]=function(code){vars=Script(code);returns[name].apply(s,[].slice.call(arguments,1))}});exports.createScript=function(code){returnexports.Script(code)};exports.createContext=Script.createContext=function(context){varcopy=newContext;if(typeofcontext==="object"){forEach(Object_keys(context),function(key){copy[key]=context[key]})}returncopy}},{indexof:219}],219:[function(require,module,exports){varindexOf=[].indexOf;module.exports=function(arr,obj){if(indexOf)returnarr.indexOf(obj);for(vari=0;i<arr.length;++i){if(arr[i]===obj)returni}return-1}},{}],220:[function(require,module,exports){(function(global,factory){typeofexports==="object"&&typeofmodule!=="undefined"?module.exports=factory():typeofdefine==="function"&&define.amd?define(factory):global.Immutable=factory()})(this,function(){"use strict";varSLICE$0=Array.prototype.slice;functioncreateClass(ctor,superClass){if(superClass){ctor.prototype=Object.create(superClass.prototype)}ctor.prototype.constructor=ctor}functionIterable(value){returnisIterable(value)?value:Seq(value)}createClass(KeyedIterable,Iterable);functionKeyedIterable(value){returnisKeyed(value)?value:KeyedSeq(value)}createClass(IndexedIterable,Iterable);functionIndexedIterable(value){returnisIndexed(value)?value:IndexedSeq(value)}createClass(SetIterable,Iterable);functionSetIterable(value){returnisIterable(value)&&!isAssociative(value)?value:SetSeq(value)}functionisIterable(maybeIterable){return!!(maybeIterable&&maybeIterable[IS_ITERABLE_SENTINEL])}functionisKeyed(maybeKeyed){return!!(maybeKeyed&&maybeKeyed[IS_KEYED_SENTINEL])}functionisIndexed(maybeIndexed){return!!(maybeIndexed&&maybeIndexed[IS_INDEXED_SENTINEL])}functionisAssociative(maybeAssociative){returnisKeyed(maybeAssociative)||isIndexed(maybeAssociative)}functionisOrdered(maybeOrdered){return!!(maybeOrdered&&maybeOrdered[IS_ORDERED_SENTINEL])}Iterable.isIterable=isIterable;Iterable.isKeyed=isKeyed;Iterable.isIndexed=isIndexed;Iterable.isAssociative=isAssociative;Iterable.isOrdered=isOrdered;Iterable.Keyed=KeyedIterable;Iterable.Indexed=IndexedIterable;Iterable.Set=SetIterable;varIS_ITERABLE_SENTINEL="@@__IMMUTABLE_ITERABLE__@@";varIS_KEYED_SENTINEL="@@__IMMUTABLE_KEYED__@@";varIS_INDEXED_SENTINEL="@@__IMMUTABLE_INDEXED__@@";varIS_ORDERED_SENTINEL="@@__IMMUTABLE_ORDERED__@@";varDELETE="delete";varSHIFT=5;varSIZE=1<<SHIFT;varMASK=SIZE-1;varNOT_SET={};varCHANGE_LENGTH={value:false};varDID_ALTER={value:false};functionMakeRef(ref){ref.value=false;returnref}functionSetRef(ref){ref&&(ref.value=true)}functionOwnerID(){}functionarrCopy(arr,offset){offset=offset||0;varlen=Math.max(0,arr.length-offset);varnewArr=newArray(len);for(varii=0;ii<len;ii++){newArr[ii]=arr[ii+of
return{eventMap:Immutable.Map().withMutations(function(result){affectedPids.forEach(function(pid){varpatchForPid;if(pid===actingPid){varpart1=newPatch.Patch(echoCancelledTrie(Patch.biasedIntersection(newRoutingTable,delta.added)),echoCancelledTrie(Patch.biasedIntersection(oldRoutingTable,delta.removed)));varpart2=newPatch.Patch(Patch.biasedIntersection(deltaAggregateNoEcho.added,newMux.interestsOf(pid)),Patch.biasedIntersection(deltaAggregateNoEcho.removed,oldMux.interestsOf(pid)));patchForPid=part1.unsafeUnion(part2)}else{patchForPid=deltaAggregateNoEcho.viewFrom(oldMux.interestsOf(pid))}if(patchForPid.isNonEmpty()){result.set(pid,patchForPid)}})}),metaEvents:actingPid==="meta"?Immutable.List():Immutable.List.of(delta.computeAggregate(actingPid,oldRoutingTable,true).drop())}}functioncomputeAffectedPids(routingTable,delta){varcover=Trie._union(delta.added,delta.removed);routingTable=Trie.trieStep(routingTable,Patch.observe.meta.arity,Patch.observe.meta);returnTrie.matchTrie(cover,routingTable,Immutable.Set(),function(v1,v2,acc){returnacc.union(v2)})}Mux.prototype.routeMessage=function(body){if(Trie.matchValue(this.routingTable,body)===null){returnTrie.matchValue(this.routingTable,Patch.observe(body))||Immutable.Set()}else{returnImmutable.Set()}};Mux.prototype.interestsOf=function(pid){returnthis.interestTable.get(pid,Trie.emptyTrie)};module.exports.Mux=Mux;module.exports.computeEvents=computeEvents;module.exports.computeAffectedPids=computeAffectedPids},{"./patch.js":230,"./trie.js":237,immutable:220}],230:[function(require,module,exports){"use strict";varTrie=require("./trie.js");varStruct=require("./struct.js");varImmutable=require("immutable");var__=Trie.__;var_$=Trie._$;functionPatch(added,removed){this.added=added;this.removed=removed}varemptyPatch=newPatch(Trie.emptyTrie,Trie.emptyTrie);varremoveEverythingPatch=newPatch(Trie.emptyTrie,Trie.compilePattern(true,__));vartrueLabel=Trie.trieSuccess(true);varobserve=Struct.makeConstructor("observe",["assertion"]);varatMeta=Struct.makeConstructor("at-meta",["assertion"]);varadvertise=Struct.makeConstructor("advertise",["assertion"]);functionprependAtMeta(p,level){while(level--){p=atMeta(p)}returnp}functionstripAtMeta(p,level){while(level--){if(atMeta.isClassOf(p)){p=p[0]}else{returnnull}}returnp}functionobserveAtMeta(p,level){if(level===0){returnTrie.compilePattern(true,observe(p))}else{returnTrie._union(Trie.compilePattern(true,observe(prependAtMeta(p,level))),Trie.compilePattern(true,atMeta(Trie.embeddedTrie(observeAtMeta(p,level-1)))))}}function_check(p){if(pinstanceofPatch){thrownewError("Cannot construct patch pattern using an embedded patch")}returnp}functionassert(p,metaLevel){returnnewPatch(Trie.compilePattern(true,prependAtMeta(_check(p),metaLevel||0)),Trie.emptyTrie)}functionretract(p,metaLevel){returnnewPatch(Trie.emptyTrie,Trie.compilePattern(true,prependAtMeta(_check(p),metaLevel||0)))}functionsub(p,metaLevel){returnnewPatch(observeAtMeta(_check(p),metaLevel||0),Trie.emptyTrie)}functionunsub(p,metaLevel){returnnewPatch(Trie.emptyTrie,observeAtMeta(_check(p),metaLevel||0))}functionpub(p,metaLevel){returnassert(advertise(_check(p)),metaLevel)}functionunpub(p,metaLevel){returnretract(advertise(_check(p)),metaLevel)}Patch.prototype.equals=function(other){if(!(otherinstanceofPatch))returnfalse;returnImmutable.is(this.added,other.added)&&Immutable.is(this.removed,other.removed)};Patch.prototype.isEmpty=function(){returnthis.added===Trie.emptyTrie&&this.removed===Trie.emptyTrie};Patch.prototype.isNonEmpty=function(){return!this.isEmpty()};Patch.prototype.hasAdded=function(){return!Trie.is_emptyTrie(this.added)};Patch.prototype.hasRemoved=function(){return!Trie.is_emptyTrie(this.removed)};Patch.prototype.lift=function(){returnnewPatch(Trie.compilePattern(true,atMeta(Trie.embeddedTrie(this.added))),Trie.compilePattern(true,atMeta(Trie.embeddedTrie(this.removed))))};varatMetaProj=atMeta(_$);Patch.prototype.drop=function(){returnnewPatch(Trie.project(this.added,atMetaProj),Trie.project(this.removed,atMet