Example #1
0
QueryString.stringify = QueryString.encode = function(obj, sep, eq, name) {
  sep = sep || '&';
  eq = eq || '=';
  if (util.isNull(obj)) {
    obj = undefined;
  }

  if (util.isObject(obj)) {
    return shims.map(shims.keys(obj), function(k) {
      var ks = QueryString.escape(stringifyPrimitive(k)) + eq;
      if (util.isArray(obj[k])) {
        return shims.map(obj[k], function(v) {
          return ks + QueryString.escape(stringifyPrimitive(v));
        }).join(sep);
      } else {
        return ks + QueryString.escape(stringifyPrimitive(obj[k]));
      }
    }).join(sep);

  }

  if (!name) return '';
  return QueryString.escape(stringifyPrimitive(name)) + eq +
         QueryString.escape(stringifyPrimitive(obj));
};
Example #2
0
function objEquiv(a, b) {
  if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b))
    return false;
  // an identical 'prototype' property.
  if (a.prototype !== b.prototype) return false;
  //~~~I've managed to break Object.keys through screwy arguments passing.
  //   Converting to array solves the problem.
  if (isArguments(a)) {
    if (!isArguments(b)) {
      return false;
    }
    a = pSlice.call(a);
    b = pSlice.call(b);
    return _deepEqual(a, b);
  }
  try {
    var ka = shims.keys(a),
        kb = shims.keys(b),
        key, i;
  } catch (e) {//happens when one is a string literal and the other isn't
    return false;
  }
  // having the same number of owned properties (keys incorporates
  // hasOwnProperty)
  if (ka.length != kb.length)
    return false;
  //the same set of keys (although not necessarily the same order),
  ka.sort();
  kb.sort();
  //~~~cheap key test
  for (i = ka.length - 1; i >= 0; i--) {
    if (ka[i] != kb[i])
      return false;
  }
  //equivalent values for every corresponding key, and
  //~~~possibly expensive deep test
  for (i = ka.length - 1; i >= 0; i--) {
    key = ka[i];
    if (!_deepEqual(a[key], b[key])) return false;
  }
  return true;
}
exports._extend = function(origin, add) {
  // Don't do anything if add isn't an object
  if (!add || !isObject(add)) return origin;

  var keys = shims.keys(add);
  var i = keys.length;
  while (i--) {
    origin[keys[i]] = add[keys[i]];
  }
  return origin;
};
function formatValue(ctx, value, recurseTimes) {
  // Provide a hook for user-specified inspect functions.
  // Check that value is an object with an inspect function on it
  if (ctx.customInspect &&
      value &&
      isFunction(value.inspect) &&
      // Filter out the util module, it's inspect function is special
      value.inspect !== exports.inspect &&
      // Also filter out any prototype objects using the circular check.
      !(value.constructor && value.constructor.prototype === value)) {
    var ret = value.inspect(recurseTimes);
    if (!isString(ret)) {
      ret = formatValue(ctx, ret, recurseTimes);
    }
    return ret;
  }

  // Primitive types cannot have properties
  var primitive = formatPrimitive(ctx, value);
  if (primitive) {
    return primitive;
  }

  // Look up the keys of the object.
  var keys = shims.keys(value);
  var visibleKeys = arrayToHash(keys);

  if (ctx.showHidden) {
    keys = shims.getOwnPropertyNames(value);
  }

  // Some type of object without properties can be shortcutted.
  if (keys.length === 0) {
    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 = false, braces = ['{', '}'];

  // Make Array say that they are Array
  if (isArray(value)) {
    array = true;
    braces = ['[', ']'];
  }

  // Make functions say that they are functions
  if (isFunction(value)) {
    var n = value.name ? ': ' + value.name : '';
    base = ' [Function' + n + ']';
  }

  // Make RegExps say that they are RegExps
  if (isRegExp(value)) {
    base = ' ' + RegExp.prototype.toString.call(value);
  }

  // Make dates with properties first say the date
  if (isDate(value)) {
    base = ' ' + Date.prototype.toUTCString.call(value);
  }

  // Make error with message first say the error
  if (isError(value)) {
    base = ' ' + formatError(value);
  }

  if (keys.length === 0 && (!array || value.length == 0)) {
    return braces[0] + base + braces[1];
  }

  if (recurseTimes < 0) {
    if (isRegExp(value)) {
      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
    } else {
      return ctx.stylize('[Object]', 'special');
    }
  }

  ctx.seen.push(value);

  var output;
  if (array) {
    output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  } else {
    output = keys.map(function(key) {
      return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
    });
  }

  ctx.seen.pop();

  return reduceToSingleString(output, base, braces);
}
Example #5
0
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var toString=Object.prototype.toString;var hasOwnProperty=Object.prototype.hasOwnProperty;function isArray(xs){return toString.call(xs)==="[object Array]"}exports.isArray=typeof Array.isArray==="function"?Array.isArray:isArray;exports.indexOf=function indexOf(xs,x){if(xs.indexOf)return xs.indexOf(x);for(var i=0;i<xs.length;i++){if(x===xs[i])return i}return-1};exports.filter=function filter(xs,fn){if(xs.filter)return xs.filter(fn);var res=[];for(var i=0;i<xs.length;i++){if(fn(xs[i],i,xs))res.push(xs[i])}return res};exports.forEach=function forEach(xs,fn,self){if(xs.forEach)return xs.forEach(fn,self);for(var i=0;i<xs.length;i++){fn.call(self,xs[i],i,xs)}};exports.map=function map(xs,fn){if(xs.map)return xs.map(fn);var out=new Array(xs.length);for(var i=0;i<xs.length;i++){out[i]=fn(xs[i],i,xs)}return out};exports.reduce=function reduce(array,callback,opt_initialValue){if(array.reduce)return array.reduce(callback,opt_initialValue);var value,isValueSet=false;if(2<arguments.length){value=opt_initialValue;isValueSet=true}for(var i=0,l=array.length;l>i;++i){if(array.hasOwnProperty(i)){if(isValueSet){value=callback(value,array[i],i,array)}else{value=array[i];isValueSet=true}}}return value};if("ab".substr(-1)!=="b"){exports.substr=function(str,start,length){if(start<0)start=str.length+start;return str.substr(start,length)}}else{exports.substr=function(str,start,length){return str.substr(start,length)}}exports.trim=function(str){if(str.trim)return str.trim();return str.replace(/^\s+|\s+$/g,"")};exports.bind=function(){var args=Array.prototype.slice.call(arguments);var fn=args.shift();if(fn.bind)return fn.bind.apply(fn,args);var self=args.shift();return function(){fn.apply(self,args.concat([Array.prototype.slice.call(arguments)]))}};function create(prototype,properties){var object;if(prototype===null){object={__proto__:null}}else{if(typeof prototype!=="object"){throw new TypeError("typeof prototype["+typeof prototype+"] != 'object'")}var Type=function(){};Type.prototype=prototype;object=new Type;object.__proto__=prototype}if(typeof properties!=="undefined"&&Object.defineProperties){Object.defineProperties(object,properties)}return object}exports.create=typeof Object.create==="function"?Object.create:create;function notObject(object){return typeof object!="object"&&typeof object!="function"||object===null}function keysShim(object){if(notObject(object)){throw new TypeError("Object.keys called on a non-object")}var result=[];for(var name in object){if(hasOwnProperty.call(object,name)){result.push(name)}}return result}function propertyShim(object){if(notObject(object)){throw new TypeError("Object.getOwnPropertyNames called on a non-object")}var result=keysShim(object);if(exports.isArray(object)&&exports.indexOf(object,"length")===-1){result.push("length")}return result}var keys=typeof Object.keys==="function"?Object.keys:keysShim;var getOwnPropertyNames=typeof Object.getOwnPropertyNames==="function"?Object.getOwnPropertyNames:propertyShim;if((new Error).hasOwnProperty("description")){var ERROR_PROPERTY_FILTER=function(obj,array){if(toString.call(obj)==="[object Error]"){array=exports.filter(array,function(name){return name!=="description"&&name!=="number"&&name!=="message"})}return array};exports.keys=function(object){return ERROR_PROPERTY_FILTER(object,keys(object))};exports.getOwnPropertyNames=function(object){return ERROR_PROPERTY_FILTER(object,getOwnPropertyNames(object))}}else{exports.keys=keys;exports.getOwnPropertyNames=getOwnPropertyNames}function valueObject(value,key){return{value:value[key]}}if(typeof Object.getOwnPropertyDescriptor==="function"){try{Object.getOwnPropertyDescriptor({a:1},"a");exports.getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor}catch(e){exports.getOwnPropertyDescriptor=function(value,key){try{return Object.getOwnPropertyDescriptor(value,key)}catch(e){return valueObject(value,key)}}}}else{exports.getOwnPropertyDescriptor=valueObject}},{}],2:[function(require,module,exports){var util=require("util");function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!util.isNumber(n)||n<0)throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||util.isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}else{throw TypeError('Uncaught, unspecified "error" event.')}return false}}handler=this._events[type];if(util.isUndefined(handler))return false;if(util.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:len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];handler.apply(this,args)}}else if(util.isObject(handler)){len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++)listeners[i].apply(this,args)}return true};EventEmitter.prototype.addListener=function(type,listener){var m;if(!util.isFunction(listener))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",type,util.isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])this._events[type]=listener;else if(util.isObject(this._events[type]))this._events[type].push(listener);else this._events[type]=[this._events[type],listener];if(util.isObject(this._events[type])&&!this._events[type].warned){var m;if(!util.isUndefined(this._maxListeners)){m=this._maxListeners}else{m=EventEmitter.defaultMaxListeners}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);console.trace()}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!util.isFunction(listener))throw TypeError("listener must be a function");function g(){this.removeListener(type,g);listener.apply(this,arguments)}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!util.isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||util.isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(util.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;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(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){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(util.isFunction(listeners)){this.removeListener(type,listeners)}else{while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(util.isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.listenerCount=function(emitter,type){var ret;if(!emitter._events||!emitter._events[type])ret=0;else if(util.isFunction(emitter._events[type]))ret=1;else ret=emitter._events[type].length;return ret}},{util:3}],3:[function(require,module,exports){var shims=require("_shims");var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var 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}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}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"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};shims.forEach(array,function(val,idx){hash[val]=true});return 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);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=shims.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=shims.getOwnPropertyNames(value)}if(keys.length===0){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=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return 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")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}shims.forEach(keys,function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}});return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=shims.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(shims.indexOf(ctx.seen,desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map(function(line){return"  "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return"   "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=shims.reduce(output,function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n  ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return shims.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&objectToString(e)==="[object Error]"}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.binarySlice==="function"}exports.isBuffer=isBuffer;function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=function(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=shims.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})};exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=shims.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}},{_shims:1}],4:[function(require,module,exports){(function(){var Base,events,_ref,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};events=require("events");module.exports=Base=function(_super){__extends(Base,_super);function Base(){_ref=Base.__super__.constructor.apply(this,arguments);return _ref}Base.prototype.state="ready";Base.prototype.transition=function(state,f){var handler;if(!(state in this.states)){throw new Error("Invalid Transition "+(""+this.state+" -> "+state))}if(this.state==="ready"){if(typeof f==="function"){f()}this.state=state;if(typeof(handler=this.states[state])==="string"){return typeof this[handler]==="function"?this[handler]():void 0}}};return Base}(events.EventEmitter)}).call(this)},{events:2}],5:[function(require,module,exports){(function(){var Evaluation,Monitor,Result;Monitor=require("./Monitor");Result=require("./Result");module.exports=Evaluation=function(){function Evaluation(func){this.func=func}Evaluation.prototype.run=function(){var e,_ref,_ref1;try{return new Result({result:this.func(),monitor:(_ref=this.m)!=null?_ref.public_api:void 0})}catch(_error){e=_error;return new Result({error:e,monitor:(_ref1=this.m)!=null?_ref1.public_api:void 0})}finally{delete this.func;delete this.m}};Evaluation.prototype.monitor=function(){return this.m!=null?this.m:this.m=new Monitor};Evaluation.prototype.notifier=function(){var _ref;return(_ref=this.monitor().evaluation$create_notifier())!=null?_ref.public_api:void 0};return Evaluation}()}).call(this)},{"./Monitor":6,"./Result":8}],6:[function(require,module,exports){(function(){var Base,Monitor,Notifier,util,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};Notifier=require("./Notifier");Base=require("./Base");util=require("./util");module.exports=Monitor=function(_super){__extends(Monitor,_super);Monitor.prototype.states={ready:null,changed:"handle_change",cancelled:"handle_cancel"};Monitor.prototype.cancelled_notifiers=0;function Monitor(){this.user$cancel=__bind(this.user$cancel,this);this.notifier$cancel_notifier=__bind(this.notifier$cancel_notifier,this);this.evaluation$create_notifier=__bind(this.evaluation$create_notifier,this);var f,_this=this;this.notifiers=[];this.public_api=f=function(h){return _this.once("change",h)};util.copy_event_emitter_methods(this,f);f.cancel=function(){return _this.user$cancel()};f.state=function(){return _this.state}}Monitor.prototype.handle_cancel=function(){this.emit("cancel");return this.emit("destroy")};Monitor.prototype.handle_change=function(){this.emit("change");return this.emit("destroy")};Monitor.prototype.evaluation$create_notifier=function(){var n;this.notifiers.push(n=new Notifier(this));return n};Monitor.prototype.notifier$cancel_notifier=function(){if(this.notifiers.length===++this.cancelled_notifiers){return this.transition("cancelled")}};Monitor.prototype.notifier$change=function(){var _this=this;return this.transition("changed",function(){var x,_i,_len,_ref,_results;_ref=_this.notifiers;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){x=_ref[_i];if(x.state==="ready"){_results.push(x.monitor$cancel())}}return _results})};Monitor.prototype.user$cancel=function(){var _this=this;return this.transition("cancelled",function(){var x,_i,_len,_ref,_results;_ref=_this.notifiers;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){x=_ref[_i];if(x.state==="ready"){_results.push(x.monitor$cancel())}}return _results})};return Monitor}(Base)}).call(this)},{"./Base":4,"./Notifier":7,"./util":14}],7:[function(require,module,exports){(function(){var Base,Notifier,util,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};Base=require("./Base");util=require("./util");module.exports=Notifier=function(_super){__extends(Notifier,_super);Notifier.prototype.states={ready:null,cancelled:"handle_cancel",changed:"handle_change"};function Notifier(monitor){var f,_this=this;this.monitor=monitor;this.user$cancel=__bind(this.user$cancel,this);this.user$change=__bind(this.user$change,this);this.public_api=f=function(){return _this.user$change()};util.copy_event_emitter_methods(this,f);f.state=function(){return _this.state};f.cancel=this.user$cancel;f.change=this.user$change}Notifier.prototype.handle_cancel=function(){this.emit("cancel");return this.emit("destroy")};Notifier.prototype.handle_change=function(){this.emit("change");return this.emit("destroy")};Notifier.prototype.user$change=function(){var _this=this;return this.transition("changed",function(){return _this.monitor.notifier$change()})};Notifier.prototype.user$cancel=function(){var _this=this;return this.transition("cancelled",function(){return _this.monitor.notifier$cancel_notifier()})};Notifier.prototype.monitor$cancel=function(){return this.transition("cancelled")};return Notifier}(Base)}).call(this)},{"./Base":4,"./util":14}],8:[function(require,module,exports){(function(){var Result;module.exports=Result=function(){function Result(_arg){this.error=_arg.error,this.result=_arg.result,this.monitor=_arg.monitor}return Result}()}).call(this)},{}],9:[function(require,module,exports){(function(){var Box;Box=function(){function Box(){}Box.prototype.do_get=function(){if(this.is_error){throw this.v}else{return this.v}};Box.prototype.do_set=function(e,r){var is_error,new_v;new_v=(is_error=e!=null)?e:r;if(new_v===this.v){return false}this.is_error=is_error;this.v=new_v;return true};Box.prototype.do_set_auto=function(){var a;a=arguments;if(a.length===2){return this.do_set.apply(this,a)}if(a[0]instanceof Error){return this.do_set(a[0],null)}else{return this.do_set(null,a[0])}};return Box}();module.exports=function(_arg){var active,cell,notifier;notifier=_arg.notifier,active=_arg.active;return cell=function(){var box,f,notifiers;box=new Box;notifiers=void 0;f=function(){var a,cb,notifiers_,_i,_len;a=arguments;if(a.length===0){if(active()){(notifiers!=null?notifiers:notifiers=[]).push(notifier())}return box.do_get()}if(box.do_set_auto.apply(box,a)){if((notifiers_=notifiers)!=null){notifiers=void 0;for(_i=0,_len=notifiers_.length;_i<_len;_i++){cb=notifiers_[_i];cb()}}}return void 0};return f}}}).call(this)},{}],10:[function(require,module,exports){(function(){var Evaluation;Evaluation=require("./Evaluation");module.exports=function(){var active,notifier,run,stack;stack=[];run=function(f){var ev;try{stack.push(ev=new Evaluation(f));return ev.run()}finally{stack.pop()}};notifier=function(){var _ref;return(_ref=stack[stack.length-1])!=null?_ref.notifier():void 0};active=function(){return stack.length!==0};return{notifier:notifier,active:active,run:run}}}).call(this)},{"./Evaluation":5}],11:[function(require,module,exports){var global=typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};(function(){var GLOBAL,build,conditional_build,core,util,version,_cell,_poll,_subscribe;core=require("./core");_poll=require("./poll");_subscribe=require("./subscribe");version=require("./version");util=require("./util");_cell=require("./cell");build=function(){var active,cell,main,notifier,poll,run,subscribe,_c,_ref;_ref=_c=core(),notifier=_ref.notifier,active=_ref.active,run=_ref.run;subscribe=_subscribe(_c);poll=_poll(_c);cell=_cell(_c);main=function(){var c;c=cell();if(arguments.length===1){c(arguments[0])}return c};main.notifier=notifier;main.active=active;main.run=run;main.subscribe=subscribe;main.poll=poll;main.cell=cell;main.version=version;return main};GLOBAL=global||window;(conditional_build=function(){var create,other,other_version;create=false;if((other=GLOBAL.reactivity)!=null){other_version=other.version||"0.0.0";if(util.compare_semver(version,other_version)==="GT"){create=true}}else{create=true}if(create){return GLOBAL.reactivity=build()}})();module.exports=GLOBAL.reactivity}).call(this)},{"./cell":9,"./core":10,"./poll":12,"./subscribe":13,"./util":14,"./version":15}],12:[function(require,module,exports){(function(){module.exports=function(_arg){var EQ,active,build_compare,delay,notifier,poll,run;notifier=_arg.notifier,active=_arg.active,run=_arg.run;EQ=function(a,b){return a===b};delay=function(){return setTimeout(arguments[1],arguments[0])};build_compare=function(eq){return function(out1,out2){return eq(out1.result,out2.result)&&eq(out1.error,out2.error)}};poll=function(f,interval,eq){var compare,run_;if(interval==null){interval=100}if(eq==null){eq=EQ}run_=function(){return function(args){return run(function(){return f.apply(null,args)})}(arguments)};compare=build_compare(eq);return function(){var b,error,iter,monitor,out,result,stopped,_ref;if(active()){_ref=out=run_(),result=_ref.result,error=_ref.error,monitor=_ref.monitor;if(monitor!=null){monitor.once("change",notifier())}else{b=notifier();stopped=false;b.once("cancel",function(){return stopped=true});(iter=function(){if(!stopped){return delay(interval,function(){if(!stopped){if(compare(out,run_())){return iter()}else{return b()}}})}})()}if(out.error!=null){throw out.error}return out.result}else{return f()}}};return poll}}).call(this)},{}],13:[function(require,module,exports){(function(){module.exports=function(_arg){var active,notifier,run;notifier=_arg.notifier,active=_arg.active,run=_arg.run;return function(func,cb){var iter,mon,stopped,stopper;mon=null;stopped=false;stopper=function(){stopped=true;return mon!=null?mon.removeListener("change",iter):void 0};(iter=function(){var r;if(!stopped){r=run(func);if(typeof cb==="function"){cb(r.error,r.result,r.monitor,stopper)}mon=r.monitor;return mon!=null?mon.once("change",iter):void 0}})();stopper.stop=stopper;return stopper}}}).call(this)},{}],14:[function(require,module,exports){(function(){var ee;ee="addListener on once removeListener removeAllListeners setMaxListeners listeners".split(" ");module.exports={copy_event_emitter_methods:function(source,target){var n,_i,_len,_results;_results=[];for(_i=0,_len=ee.length;_i<_len;_i++){n=ee[_i];_results.push(function(n){return target[n]=function(){return source[n].apply(source,arguments)}}(n))}return _results},compare_semver:function(v1,v2){var arr,i,x,x1,x2,_i,_len;v1=function(){var _i,_len,_ref,_results;_ref=v1.split(".");_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){x=_ref[_i];_results.push(Number(x))}return _results}();v2=function(){var _i,_len,_ref,_results;_ref=v2.split(".");_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){x=_ref[_i];_results.push(Number(x))}return _results}();arr=function(){var _i,_len,_results;_results=[];for(i=_i=0,_len=v1.length;_i<_len;i=++_i){x1=v1[i];x2=v2[i];if(x1>x2){_results.push("GT")}else if(x1<x2){_results.push("LT")}else{_results.push("EQ")}}return _results}();for(_i=0,_len=arr.length;_i<_len;_i++){x=arr[_i];if(x==="GT"){return"GT"}else if(x==="LT"){return"LT"}}return"EQ"}}}).call(this)},{}],15:[function(require,module,exports){(function(){module.exports="2.0.2"}).call(this)},{}],16:[function(require,module,exports){(function(){var refmap;module.exports=refmap=function(){var arr,clear,del,entry,exists,f,get,get_or_else,keys,set,size,values;arr=[];entry=function(k){var x,_i,_len;for(_i=0,_len=arr.length;_i<_len;_i++){x=arr[_i];if(x[0]===k){return x}}return void 0};get=function(k){var _ref;return(_ref=entry(k))!=null?_ref[1]:void 0};exists=function(k){return entry(k)instanceof Array};del=function(k){var kv;if(exists(k)){arr=function(){var _i,_len,_results;_results=[];for(_i=0,_len=arr.length;_i<_len;_i++){kv=arr[_i];if(kv[0]!==k){_results.push(kv)}}return _results}();return true}else{return false}};set=function(k,v){var e;if((e=entry(k))!=null){if(e[1]===v){return false}e[1]=v}else{arr.push([k,v])}return true};keys=function(){var kv,_i,_len,_results;_results=[];for(_i=0,_len=arr.length;_i<_len;_i++){kv=arr[_i];_results.push(kv[0])}return _results};values=function(){var kv,_i,_len,_results;_results=[];for(_i=0,_len=arr.length;_i<_len;_i++){kv=arr[_i];_results.push(kv[1])}return _results};clear=function(){return arr=[]};size=function(){return arr.length};get_or_else=function(k,block){var e,v;if((e=entry(k))!=null){return e[1]}else{arr.push([k,v=block()]);return v}};f=function(){var a;a=arguments;switch(a.length){case 1:return get(a[0]);case 2:return set(a[0],a[1]);default:throw new Error("refmap takes 1 or 2 parameters")}};f.get=get;f.set=set;f.exists=exists;f.del=del;f.get_or_else=get_or_else;f.keys=keys;f.values=values;f.clear=clear;f.size=size;return f}}).call(this)},{}],17:[function(require,module,exports){(function(){var StackVal,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};StackVal=function(){function StackVal(){this.defined=__bind(this.defined,this);this.get=__bind(this.get,this);this.attach=__bind(this.attach,this);this._stack=[]}StackVal.prototype.attach=function(f,generator){var sv;if(typeof f!=="function"){throw new Error("function argument required")}sv=this;return function(){try{sv._stack.push(generator());return f.apply(this,arguments)}finally{sv._stack.pop()}}};StackVal.prototype.get=function(){if(this.defined()){return this._stack[this._stack.length-1]}else{throw new Error("No stackval found upstack")}};StackVal.prototype.defined=function(){return this._stack.length!==0};return StackVal}();module.exports=function(){var main,s;s=new StackVal;main=function(){var a;a=arguments;if(a.length===2){return s.attach(a[0],a[1])}else{return s.get()}};main.attach=function(){return s.attach.apply(s,arguments)};main.get=function(){return s.get.apply(s,arguments)};main.defined=function(){return s.defined.apply(s,arguments)};return main}}).call(this)},{}],18:[function(require,module,exports){(function(){var Busy,KEY,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};KEY="___SOME_PATIENCE_PLEASE___";module.exports=Busy=function(_super){__extends(Busy,_super);function Busy(){this[KEY]=true
},assert.ifError=function(err){if(err)throw err}},{_shims:5,util:7}],7:[function(require,module,exports){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){return str}function arrayToHash(array){var hash={};return shims.forEach(array,function(val){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);return isString(ret)||(ret=formatValue(ctx,ret,recurseTimes)),ret}var primitive=formatPrimitive(ctx,value);if(primitive)return primitive;var keys=shims.keys(value),visibleKeys=arrayToHash(keys);if(ctx.showHidden&&(keys=shims.getOwnPropertyNames(value)),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)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}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(0>recurseTimes)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;l>i;++i)hasOwnProperty(value,String(i))?output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),!0)):output.push("");return shims.forEach(keys,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=shims.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||(shims.indexOf(ctx.seen,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,length=shims.reduce(output,function(prev,cur){return numLinesEst++,cur.indexOf("\n")>=0&&numLinesEst++,prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);return length>60?braces[0]+(""===base?"":base+"\n ")+" "+output.join(",\n  ")+" "+braces[1]:braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return shims.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&&arg}function isDate(d){return isObject(d)&&"[object Date]"===objectToString(d)}function isError(e){return isObject(e)&&"[object Error]"===objectToString(e)}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||"undefined"==typeof arg}function isBuffer(arg){return arg instanceof Buffer}function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return 10>n?"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 shims=require("_shims"),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];len>i;x=args[++i])str+=isNull(x)||!isObject(x)?" "+x:" "+inspect(x);return str},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=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=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=shims.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})},exports._extend=function(origin,add){if(!add||!isObject(add))return origin;for(var keys=shims.keys(add),i=keys.length;i--;)origin[keys[i]]=add[keys[i]];return origin}},{_shims:5}]},{},[]),module.exports=require("buffer-browserify")},{}]},{},[2]);
!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);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.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){function fromBase64(base64string){return base64string.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function toBase64(base64UrlString){const b64str=padString(base64UrlString).replace(/\-/g,"+").replace(/_/g,"/");return b64str}function padString(string){const segmentLength=4,stringLength=string.length,diff=string.length%segmentLength;if(!diff)return string;var position=stringLength,padLength=segmentLength-diff;const paddedStringLength=stringLength+padLength,buffer=Buffer(paddedStringLength);for(buffer.write(string);padLength--;)buffer.write("=",position++);return buffer.toString()}function decodeBase64Url(base64UrlString,encoding){return Buffer(toBase64(base64UrlString),"base64").toString(encoding)}function base64url(stringOrBuffer){return fromBase64(Buffer(stringOrBuffer).toString("base64"))}function toBuffer(base64string){return Buffer(toBase64(base64string),"base64")}var Buffer=require("__browserify_Buffer").Buffer;base64url.toBase64=toBase64,base64url.fromBase64=fromBase64,base64url.decode=decodeBase64Url,base64url.toBuffer=toBuffer,module.exports=base64url},{__browserify_Buffer:3}],2:[function(require){const base64url=require("base64url"),OpenBadges={};OpenBadges.issue=function(badges){const params=base64url(JSON.stringify(badges)),location="http://localhost:5000/shim.html?badges="+params,features="height=400,width=533,resizable=yes,scrollbars=no,menubar=no";window.open(location,"_blank",features)},OpenBadges.register=function(){const location="http://localhost:5000/register.html?backpack="+window.location.origin,features="height=400,width=533,resizable=yes,scrollbars=no,menubar=no";window.open(location,"_blank",features)},window.OpenBadges=OpenBadges},{base64url:1}],3:[function(require,module){require=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);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.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){exports.readIEEE754=function(buffer,offset,isBE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isBE?0:nBytes-1,d=isBE?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?0/0:1/0*(s?-1:1);m+=Math.pow(2,mLen),e-=eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)},exports.writeIEEE754=function(buffer,value,offset,isBE,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=isBE?nBytes-1:0,d=isBE?-1:1,s=0>value||0===value&&0>1/value?1:0;for(value=Math.abs(value),isNaN(value)||1/0===value?(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}},{}],q9TxCC:[function(require,module,exports){function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}function Buffer(subject,encoding,offset){if(assert||(assert=require("assert")),!(this instanceof Buffer))return new Buffer(subject,encoding,offset);if(this.parent=this,this.offset=0,"base64"==encoding&&"string"==typeof subject)for(subject=stringtrim(subject);0!=subject.length%4;)subject+="=";var type;if("number"==typeof offset){this.length=coerce(encoding);for(var i=0;i<this.length;i++)this[i]=subject.get(i+offset)}else{switch(type=typeof subject){case"number":this.length=coerce(subject);break;case"string":this.length=Buffer.byteLength(subject,encoding);break;case"object":this.length=coerce(subject.length);break;default:throw new Error("First argument needs to be a number, array or string.")}if(isArrayIsh(subject))for(var i=0;i<this.length;i++)this[i]=subject instanceof Buffer?subject.readUInt8(i):subject[i];else if("string"==type)this.length=this.write(subject,0,encoding);else if("number"===type)for(var i=0;i<this.length;i++)this[i]=0}}function clamp(index,len,defaultValue){return"number"!=typeof index?defaultValue:(index=~~index,index>=len?len:index>=0?index:(index+=len,index>=0?index:0))}function coerce(length){return length=~~Math.ceil(+length),0>length?0:length}function isArray(subject){return(Array.isArray||function(subject){return"[object Array]"=={}.toString.apply(subject)})(subject)}function isArrayIsh(subject){return isArray(subject)||Buffer.isBuffer(subject)||subject&&"object"==typeof subject&&"number"==typeof subject.length}function toHex(n){return 16>n?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(str){for(var byteArray=[],i=0;i<str.length;i++)if(str.charCodeAt(i)<=127)byteArray.push(str.charCodeAt(i));else for(var h=encodeURIComponent(str.charAt(i)).substr(1).split("%"),j=0;j<h.length;j++)byteArray.push(parseInt(h[j],16));return byteArray}function asciiToBytes(str){for(var byteArray=[],i=0;i<str.length;i++)byteArray.push(255&str.charCodeAt(i));return byteArray}function base64ToBytes(str){return require("base64-js").toByteArray(str)}function blitBuffer(src,dst,offset,length){for(var i=0;length>i&&!(i+offset>=dst.length||i>=src.length);)dst[i+offset]=src[i],i++;return i}function decodeUtf8Char(str){try{return decodeURIComponent(str)}catch(err){return String.fromCharCode(65533)}}function readUInt16(buffer,offset,isBigEndian,noAssert){var val=0;return noAssert||(assert.ok("boolean"==typeof isBigEndian,"missing or invalid endian"),assert.ok(void 0!==offset&&null!==offset,"missing offset"),assert.ok(offset+1<buffer.length,"Trying to read beyond buffer length")),offset>=buffer.length?0:(isBigEndian?(val=buffer[offset]<<8,offset+1<buffer.length&&(val|=buffer[offset+1])):(val=buffer[offset],offset+1<buffer.length&&(val|=buffer[offset+1]<<8)),val)}function readUInt32(buffer,offset,isBigEndian,noAssert){var val=0;return noAssert||(assert.ok("boolean"==typeof isBigEndian,"missing or invalid endian"),assert.ok(void 0!==offset&&null!==offset,"missing offset"),assert.ok(offset+3<buffer.length,"Trying to read beyond buffer length")),offset>=buffer.length?0:(isBigEndian?(offset+1<buffer.length&&(val=buffer[offset+1]<<16),offset+2<buffer.length&&(val|=buffer[offset+2]<<8),offset+3<buffer.length&&(val|=buffer[offset+3]),val+=buffer[offset]<<24>>>0):(offset+2<buffer.length&&(val=buffer[offset+2]<<16),offset+1<buffer.length&&(val|=buffer[offset+1]<<8),val|=buffer[offset],offset+3<buffer.length&&(val+=buffer[offset+3]<<24>>>0)),val)}function readInt16(buffer,offset,isBigEndian,noAssert){var neg,val;return noAssert||(assert.ok("boolean"==typeof isBigEndian,"missing or invalid endian"),assert.ok(void 0!==offset&&null!==offset,"missing offset"),assert.ok(offset+1<buffer.length,"Trying to read beyond buffer length")),val=readUInt16(buffer,offset,isBigEndian,noAssert),neg=32768&val,neg?-1*(65535-val+1):val}function readInt32(buffer,offset,isBigEndian,noAssert){var neg,val;return noAssert||(assert.ok("boolean"==typeof isBigEndian,"missing or invalid endian"),assert.ok(void 0!==offset&&null!==offset,"missing offset"),assert.ok(offset+3<buffer.length,"Trying to read beyond buffer length")),val=readUInt32(buffer,offset,isBigEndian,noAssert),neg=2147483648&val,neg?-1*(4294967295-val+1):val}function readFloat(buffer,offset,isBigEndian,noAssert){return noAssert||(assert.ok("boolean"==typeof isBigEndian,"missing or invalid endian"),assert.ok(offset+3<buffer.length,"Trying to read beyond buffer length")),require("./buffer_ieee754").readIEEE754(buffer,offset,isBigEndian,23,4)}function readDouble(buffer,offset,isBigEndian,noAssert){return noAssert||(assert.ok("boolean"==typeof isBigEndian,"missing or invalid endian"),assert.ok(offset+7<buffer.length,"Trying to read beyond buffer length")),require("./buffer_ieee754").readIEEE754(buffer,offset,isBigEndian,52,8)}function verifuint(value,max){assert.ok("number"==typeof value,"cannot write a non-number as a number"),assert.ok(value>=0,"specified a negative value for writing an unsigned value"),assert.ok(max>=value,"value is larger than maximum value for type"),assert.ok(Math.floor(value)===value,"value has a fractional component")}function writeUInt16(buffer,value,offset,isBigEndian,noAssert){noAssert||(assert.ok(void 0!==value&&null!==value,"missing value"),assert.ok("boolean"==typeof isBigEndian,"missing or invalid endian"),assert.ok(void 0!==offset&&null!==offset,"missing offset"),assert.ok(offset+1<buffer.length,"trying to write beyond buffer length"),verifuint(value,65535));for(var i=0;i<Math.min(buffer.length-offset,2);i++)buffer[offset+i]=(value&255<<8*(isBigEndian?1-i:i))>>>8*(isBigEndian?1-i:i)}function writeUInt32(buffer,value,offset,isBigEndian,noAssert){noAssert||(assert.ok(void 0!==value&&null!==value,"missing value"),assert.ok("boolean"==typeof isBigEndian,"missing or invalid endian"),assert.ok(void 0!==offset&&null!==offset,"missing offset"),assert.ok(offset+3<buffer.length,"trying to write beyond buffer length"),verifuint(value,4294967295));for(var i=0;i<Math.min(buffer.length-offset,4);i++)buffer[offset+i]=255&value>>>8*(isBigEndian?3-i:i)}function verifsint(value,max,min){assert.ok("number"==typeof value,"cannot write a non-number as a number"),assert.ok(max>=value,"value larger than maximum allowed value"),assert.ok(value>=min,"value smaller than minimum allowed value"),assert.ok(Math.floor(value)===value,"value has a fractional component")}function verifIEEE754(value,max,min){assert.ok("number"==typeof value,"cannot write a non-number as a number"),assert.ok(max>=value,"value larger than maximum allowed value"),assert.ok(value>=min,"value smaller than minimum allowed value")}function writeInt16(buffer,value,offset,isBigEndian,noAssert){noAssert||(assert.ok(void 0!==value&&null!==value,"missing value"),assert.ok("boolean"==typeof isBigEndian,"missing or invalid endian"),assert.ok(void 0!==offset&&null!==offset,"missing offset"),assert.ok(offset+1<buffer.length,"Trying to write beyond buffer length"),verifsint(value,32767,-32768)),value>=0?writeUInt16(buffer,value,offset,isBigEndian,noAssert):writeUInt16(buffer,65535+value+1,offset,isBigEndian,noAssert)}function writeInt32(buffer,value,offset,isBigEndian,noAssert){noAssert||(assert.ok(void 0!==value&&null!==value,"missing value"),assert.ok("boolean"==typeof isBigEndian,"missing or invalid endian"),assert.ok(void 0!==offset&&null!==offset,"missing offset"),assert.ok(offset+3<buffer.length,"Trying to write beyond buffer length"),verifsint(value,2147483647,-2147483648)),value>=0?writeUInt32(buffer,value,offset,isBigEndian,noAssert):writeUInt32(buffer,4294967295+value+1,offset,isBigEndian,noAssert)}function writeFloat(buffer,value,offset,isBigEndian,noAssert){noAssert||(assert.ok(void 0!==value&&null!==value,"missing value"),assert.ok("boolean"==typeof isBigEndian,"missing or invalid endian"),assert.ok(void 0!==offset&&null!==offset,"missing offset"),assert.ok(offset+3<buffer.length,"Trying to write beyond buffer length"),verifIEEE754(value,3.4028234663852886e38,-3.4028234663852886e38)),require("./buffer_ieee754").writeIEEE754(buffer,value,offset,isBigEndian,23,4)}function writeDouble(buffer,value,offset,isBigEndian,noAssert){noAssert||(assert.ok(void 0!==value&&null!==value,"missing value"),assert.ok("boolean"==typeof isBigEndian,"missing or invalid endian"),assert.ok(void 0!==offset&&null!==offset,"missing offset"),assert.ok(offset+7<buffer.length,"Trying to write beyond buffer length"),verifIEEE754(value,1.7976931348623157e308,-1.7976931348623157e308)),require("./buffer_ieee754").writeIEEE754(buffer,value,offset,isBigEndian,52,8)}var assert;exports.Buffer=Buffer,exports.SlowBuffer=Buffer,Buffer.poolSize=8192,exports.INSPECT_MAX_BYTES=50,Buffer.prototype.get=function(i){if(0>i||i>=this.length)throw new Error("oob");return this[i]},Buffer.prototype.set=function(i,v){if(0>i||i>=this.length)throw new Error("oob");return this[i]=v},Buffer.byteLength=function(str,encoding){switch(encoding||"utf8"){case"hex":return str.length/2;case"utf8":case"utf-8":return utf8ToBytes(str).length;case"ascii":case"binary":return str.length;case"base64":return base64ToBytes(str).length;default:throw new Error("Unknown encoding")}},Buffer.prototype.utf8Write=function(string,offset,length){return Buffer._charsWritten=blitBuffer(utf8ToBytes(string),this,offset,length)},Buffer.prototype.asciiWrite=function(string,offset,length){return Buffer._charsWritten=blitBuffer(asciiToBytes(string),this,offset,length)},Buffer.prototype.binaryWrite=Buffer.prototype.asciiWrite,Buffer.prototype.base64Write=function(string,offset,length){return Buffer._charsWritten=blitBuffer(base64ToBytes(string),this,offset,length)},Buffer.prototype.base64Slice=function(){var bytes=Array.prototype.slice.apply(this,arguments);return require("base64-js").fromByteArray(bytes)},Buffer.prototype.utf8Slice=function(){for(var bytes=Array.prototype.slice.apply(this,arguments),res="",tmp="",i=0;i<bytes.length;)bytes[i]<=127?(res+=decodeUtf8Char(tmp)+String.fromCharCode(bytes[i]),tmp=""):tmp+="%"+bytes[i].toString(16),i++;return res+decodeUtf8Char(tmp)},Buffer.prototype.asciiSlice=function(){for(var bytes=Array.prototype.slice.apply(this,arguments),ret="",i=0;i<bytes.length;i++)ret+=String.fromCharCode(bytes[i]);return ret},Buffer.prototype.binarySlice=Buffer.prototype.asciiSlice,Buffer.prototype.inspect=function(){for(var out=[],len=this.length,i=0;len>i;i++)if(out[i]=toHex(this[i]),i==exports.INSPECT_MAX_BYTES){out[i+1]="...";break}return"<Buffer "+out.join(" ")+">"},Buffer.prototype.hexSlice=function(start,end){var len=this.length;(!start||0>start)&&(start=0),(!end||0>end||end>len)&&(end=len);for(var out="",i=start;end>i;i++)out+=toHex(this[i]);return out},Buffer.prototype.toString=function(encoding,start,end){if(encoding=String(encoding||"utf8").toLowerCase(),start=+start||0,"undefined"==typeof end&&(end=this.length),+end==start)return"";switch(encoding){case"hex":return this.hexSlice(start,end);case"utf8":case"utf-8":return this.utf8Slice(start,end);case"ascii":return this.asciiSlice(start,end);case"binary":return this.binarySlice(start,end);case"base64":return this.base64Slice(start,end);case"ucs2":case"ucs-2":return this.ucs2Slice(start,end);default:throw new Error("Unknown encoding")}},Buffer.prototype.hexWrite=function(string,offset,length){offset=+offset||0;var remaining=this.length-offset;length?(length=+length,length>remaining&&(length=remaining)):length=remaining;var strLen=string.length;if(strLen%2)throw new Error("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0;length>i;i++){var byte=parseInt(string.substr(2*i,2),16);if(isNaN(byte))throw new Error("Invalid hex string");this[offset+i]=byte}return Buffer._charsWritten=2*i,i},Buffer.prototype.write=function(string,offset,length,encoding){if(isFinite(offset))isFinite(length)||(encoding=length,length=void 0);else{var swap=encoding;encoding=offset,offset=length,length=swap}offset=+offset||0;var remaining=this.length-offset;switch(length?(length=+length,length>remaining&&(length=remaining)):length=remaining,encoding=String(encoding||"utf8").toLowerCase()){case"hex":return this.hexWrite(string,offset,length);case"utf8":case"utf-8":return this.utf8Write(string,offset,length);case"ascii":return this.asciiWrite(string,offset,length);case"binary":return this.binaryWrite(string,offset,length);case"base64":return this.base64Write(string,offset,length);case"ucs2":case"ucs-2":return this.ucs2Write(string,offset,length);default:throw new Error("Unknown encoding")}},Buffer.prototype.slice=function(start,end){var len=this.length;return start=clamp(start,len,0),end=clamp(end,len,len),new Buffer(this,end-start,+start)},Buffer.prototype.copy=function(target,target_start,start,end){var source=this;if(start||(start=0),(void 0===end||isNaN(end))&&(end=this.length),target_start||(target_start=0),start>end)throw new Error("sourceEnd < sourceStart");if(end===start)return 0;if(0==target.length||0==source.length)return 0;if(0>target_start||target_start>=target.length)throw new Error("targetStart out of bounds");if(0>start||start>=source.length)throw new Error("sourceStart out of bounds");if(0>end||end>source.length)throw new Error("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-target_start<end-start&&(end=target.length-target_start+start);for(var temp=[],i=start;end>i;i++)assert.ok("undefined"!=typeof this[i],"copying undefined buffer bytes!"),temp.push(this[i]);for(var i=target_start;i<target_start+temp.length;i++)target[i]=temp[i-target_start]},Buffer.prototype.fill=function(value,start,end){if(value||(value=0),start||(start=0),end||(end=this.length),"string"==typeof value&&(value=value.charCodeAt(0)),"number"!=typeof value||isNaN(value))throw new Error("value is not a number");if(start>end)throw new Error("end < start");if(end===start)return 0;if(0==this.length)return 0;if(0>start||start>=this.length)throw new Error("start out of bounds");if(0>end||end>this.length)throw new Error("end out of bounds");for(var i=start;end>i;i++)this[i]=value},Buffer.isBuffer=function(b){return b instanceof Buffer||b instanceof Buffer},Buffer.concat=function(list,totalLength){if(!isArray(list))throw new Error("Usage: Buffer.concat(list, [totalLength])\n       list should be an Array.");if(0===list.length)return new Buffer(0);if(1===list.length)return list[0];if("number"!=typeof totalLength){totalLength=0;for(var i=0;i<list.length;i++){var buf=list[i];totalLength+=buf.length}}for(var buffer=new Buffer(totalLength),pos=0,i=0;i<list.length;i++){var buf=list[i];buf.copy(buffer,pos),pos+=buf.length}return buffer},Buffer.isEncoding=function(encoding){switch((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}},Buffer.prototype.readUInt8=function(offset,noAssert){var buffer=this;return noAssert||(assert.ok(void 0!==offset&&null!==offset,"missing offset"),assert.ok(offset<buffer.length,"Trying to read beyond buffer length")),offset>=buffer.length?void 0:buffer[offset]},Buffer.prototype.readUInt16LE=function(offset,noAssert){return readUInt16(this,offset,!1,noAssert)},Buffer.prototype.readUInt16BE=function(offset,noAssert){return readUInt16(this,offset,!0,noAssert)},Buffer.prototype.readUInt32LE=function(offset,noAssert){return readUInt32(this,offset,!1,noAssert)},Buffer.prototype.readUInt32BE=function(offset,noAssert){return readUInt32(this,offset,!0,noAssert)},Buffer.prototype.readInt8=function(offset,noAssert){var neg,buffer=this;return noAssert||(assert.ok(void 0!==offset&&null!==offset,"missing offset"),assert.ok(offset<buffer.length,"Trying to read beyond buffer length")),offset>=buffer.length?void 0:(neg=128&buffer[offset],neg?-1*(255-buffer[offset]+1):buffer[offset])},Buffer.prototype.readInt16LE=function(offset,noAssert){return readInt16(this,offset,!1,noAssert)},Buffer.prototype.readInt16BE=function(offset,noAssert){return readInt16(this,offset,!0,noAssert)},Buffer.prototype.readInt32LE=function(offset,noAssert){return readInt32(this,offset,!1,noAssert)},Buffer.prototype.readInt32BE=function(offset,noAssert){return readInt32(this,offset,!0,noAssert)},Buffer.prototype.readFloatLE=function(offset,noAssert){return readFloat(this,offset,!1,noAssert)},Buffer.prototype.readFloatBE=function(offset,noAssert){return readFloat(this,offset,!0,noAssert)},Buffer.prototype.readDoubleLE=function(offset,noAssert){return readDouble(this,offset,!1,noAssert)},Buffer.prototype.readDoubleBE=function(offset,noAssert){return readDouble(this,offset,!0,noAssert)},Buffer.prototype.writeUInt8=function(value,offset,noAssert){var buffer=this;noAssert||(assert.ok(void 0!==value&&null!==value,"missing value"),assert.ok(void 0!==offset&&null!==offset,"missing offset"),assert.ok(offset<buffer.length,"trying to write beyond buffer length"),verifuint(value,255)),offset<buffer.length&&(buffer[offset]=value)},Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){writeUInt16(this,value,offset,!1,noAssert)},Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){writeUInt16(this,value,offset,!0,noAssert)},Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){writeUInt32(this,value,offset,!1,noAssert)},Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){writeUInt32(this,value,offset,!0,noAssert)},Buffer.prototype.writeInt8=function(value,offset,noAssert){var buffer=this;noAssert||(assert.ok(void 0!==value&&null!==value,"missing value"),assert.ok(void 0!==offset&&null!==offset,"missing offset"),assert.ok(offset<buffer.length,"Trying to write beyond buffer length"),verifsint(value,127,-128)),value>=0?buffer.writeUInt8(value,offset,noAssert):buffer.writeUInt8(255+value+1,offset,noAssert)},Buffer.prototype.writeInt16LE=function(value,offset,noAssert){writeInt16(this,value,offset,!1,noAssert)},Buffer.prototype.writeInt16BE=function(value,offset,noAssert){writeInt16(this,value,offset,!0,noAssert)},Buffer.prototype.writeInt32LE=function(value,offset,noAssert){writeInt32(this,value,offset,!1,noAssert)},Buffer.prototype.writeInt32BE=function(value,offset,noAssert){writeInt32(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatLE=function(value,offset,noAssert){writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeFloatBE=function(value,offset,noAssert){writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){writeDouble(this,value,offset,!0,noAssert)}},{"./buffer_ieee754":1,assert:6,"base64-js":4}],"buffer-browserify":[function(require,module){module.exports=require("q9TxCC")},{}],4:[function(require,module){!function(){"use strict";function b64ToByteArray(b64){var i,j,l,tmp,placeHolders,arr;if(b64.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(placeHolders=b64.indexOf("="),placeHolders=placeHolders>0?b64.length-placeHolders:0,arr=[],l=placeHolders>0?b64.length-4:b64.length,i=0,j=0;l>i;i+=4,j+=3)tmp=lookup.indexOf(b64[i])<<18|lookup.indexOf(b64[i+1])<<12|lookup.indexOf(b64[i+2])<<6|lookup.indexOf(b64[i+3]),arr.push((16711680&tmp)>>16),arr.push((65280&tmp)>>8),arr.push(255&tmp);return 2===placeHolders?(tmp=lookup.indexOf(b64[i])<<2|lookup.indexOf(b64[i+1])>>4,arr.push(255&tmp)):1===placeHolders&&(tmp=lookup.indexOf(b64[i])<<10|lookup.indexOf(b64[i+1])<<4|lookup.indexOf(b64[i+2])>>2,arr.push(255&tmp>>8),arr.push(255&tmp)),arr}function uint8ToBase64(uint8){function tripletToBase64(num){return lookup[63&num>>18]+lookup[63&num>>12]+lookup[63&num>>6]+lookup[63&num]}var i,temp,length,extraBytes=uint8.length%3,output="";for(i=0,length=uint8.length-extraBytes;length>i;i+=3)temp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2],output+=tripletToBase64(temp);switch(extraBytes){case 1:temp=uint8[uint8.length-1],output+=lookup[temp>>2],output+=lookup[63&temp<<4],output+="==";break;case 2:temp=(uint8[uint8.length-2]<<8)+uint8[uint8.length-1],output+=lookup[temp>>10],output+=lookup[63&temp>>4],output+=lookup[63&temp<<2],output+="="}return output}var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";module.exports.toByteArray=b64ToByteArray,module.exports.fromByteArray=uint8ToBase64}()},{}],5:[function(require,module,exports){function isArray(xs){return"[object Array]"===toString.call(xs)}function create(prototype,properties){var object;if(null===prototype)object={__proto__:null};else{if("object"!=typeof prototype)throw new TypeError("typeof prototype["+typeof prototype+"] != 'object'");var Type=function(){};Type.prototype=prototype,object=new Type,object.__proto__=prototype}return"undefined"!=typeof properties&&Object.defineProperties&&Object.defineProperties(object,properties),object}function notObject(object){return"object"!=typeof object&&"function"!=typeof object||null===object}function keysShim(object){if(notObject(object))throw new TypeError("Object.keys called on a non-object");var result=[];for(var name in object)hasOwnProperty.call(object,name)&&result.push(name);return result}function propertyShim(object){if(notObject(object))throw new TypeError("Object.getOwnPropertyNames called on a non-object");var result=keysShim(object);return exports.isArray(object)&&-1===exports.indexOf(object,"length")&&result.push("length"),result}function valueObject(value,key){return{value:value[key]}}var toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty;exports.isArray="function"==typeof Array.isArray?Array.isArray:isArray,exports.indexOf=function(xs,x){if(xs.indexOf)return xs.indexOf(x);for(var i=0;i<xs.length;i++)if(x===xs[i])return i;return-1},exports.filter=function(xs,fn){if(xs.filter)return xs.filter(fn);for(var res=[],i=0;i<xs.length;i++)fn(xs[i],i,xs)&&res.push(xs[i]);return res},exports.forEach=function(xs,fn,self){if(xs.forEach)return xs.forEach(fn,self);for(var i=0;i<xs.length;i++)fn.call(self,xs[i],i,xs)},exports.map=function(xs,fn){if(xs.map)return xs.map(fn);for(var out=new Array(xs.length),i=0;i<xs.length;i++)out[i]=fn(xs[i],i,xs);return out},exports.reduce=function(array,callback,opt_initialValue){if(array.reduce)return array.reduce(callback,opt_initialValue);var value,isValueSet=!1;2<arguments.length&&(value=opt_initialValue,isValueSet=!0);for(var i=0,l=array.length;l>i;++i)array.hasOwnProperty(i)&&(isValueSet?value=callback(value,array[i],i,array):(value=array[i],isValueSet=!0));return value},exports.substr="b"!=="ab".substr(-1)?function(str,start,length){return 0>start&&(start=str.length+start),str.substr(start,length)}:function(str,start,length){return str.substr(start,length)},exports.trim=function(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")},exports.bind=function(){var args=Array.prototype.slice.call(arguments),fn=args.shift();if(fn.bind)return fn.bind.apply(fn,args);var self=args.shift();return function(){fn.apply(self,args.concat([Array.prototype.slice.call(arguments)]))}},exports.create="function"==typeof Object.create?Object.create:create;var keys="function"==typeof Object.keys?Object.keys:keysShim,getOwnPropertyNames="function"==typeof Object.getOwnPropertyNames?Object.getOwnPropertyNames:propertyShim;if((new Error).hasOwnProperty("description")){var ERROR_PROPERTY_FILTER=function(obj,array){return"[object Error]"===toString.call(obj)&&(array=exports.filter(array,function(name){return"description"!==name&&"number"!==name&&"message"!==name})),array};exports.keys=function(object){return ERROR_PROPERTY_FILTER(object,keys(object))},exports.getOwnPropertyNames=function(object){return ERROR_PROPERTY_FILTER(object,getOwnPropertyNames(object))}}else exports.keys=keys,exports.getOwnPropertyNames=getOwnPropertyNames;if("function"==typeof Object.getOwnPropertyDescriptor)try{Object.getOwnPropertyDescriptor({a:1},"a"),exports.getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor}catch(e){exports.getOwnPropertyDescriptor=function(value,key){try{return Object.getOwnPropertyDescriptor(value,key)}catch(e){return valueObject(value,key)}}}else exports.getOwnPropertyDescriptor=valueObject},{}],6:[function(require,module){function replacer(key,value){return util.isUndefined(value)?""+value:!util.isNumber(value)||!isNaN(value)&&isFinite(value)?util.isFunction(value)||util.isRegExp(value)?value.toString():value:value.toString()}function truncate(s,n){return util.isString(s)?s.length<n?s:s.slice(0,n):s}function getMessage(self){return truncate(JSON.stringify(self.actual,replacer),128)+" "+self.operator+" "+truncate(JSON.stringify(self.expected,replacer),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){if(actual===expected)return!0;if(util.isBuffer(actual)&&util.isBuffer(expected)){if(actual.length!=expected.length)return!1;for(var i=0;i<actual.length;i++)if(actual[i]!==expected[i])return!1;return!0}return util.isDate(actual)&&util.isDate(expected)?actual.getTime()===expected.getTime():util.isRegExp(actual)&&util.isRegExp(expected)?actual.source===expected.source&&actual.global===expected.global&&actual.multiline===expected.multiline&&actual.lastIndex===expected.lastIndex&&actual.ignoreCase===expected.ignoreCase:util.isObject(actual)||util.isObject(expected)?objEquiv(actual,expected):actual==expected}function isArguments(object){return"[object Arguments]"==Object.prototype.toString.call(object)}function objEquiv(a,b){if(util.isNullOrUndefined(a)||util.isNullOrUndefined(b))return!1;if(a.prototype!==b.prototype)return!1;if(isArguments(a))return isArguments(b)?(a=pSlice.call(a),b=pSlice.call(b),_deepEqual(a,b)):!1;try{var key,i,ka=shims.keys(a),kb=shims.keys(b)}catch(e){return!1}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]))return!1;return!0}function expectedException(actual,expected){return actual&&expected?"[object RegExp]"==Object.prototype.toString.call(expected)?expected.test(actual):actual instanceof expected?!0:expected.call({},actual)===!0?!0:!1:!1}function _throws(shouldThrow,block,expected,message){var actual;util.isString(expected)&&(message=expected,expected=null);try{block()}catch(e){actual=e}if(message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:"."),shouldThrow&&!actual&&fail(actual,expected,"Missing expected exception"+message),!shouldThrow&&expectedException(actual,expected)&&fail(actual,expected,"Got unwanted exception"+message),shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual)throw actual}var util=require("util"),shims=require("_shims"),pSlice=Array.prototype.slice,assert=module.exports=ok;assert.AssertionError=function(options){this.name="AssertionError",this.actual=options.actual,this.expected=options.expected,this.operator=options.operator,this.message=options.message||getMessage(this)},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)||fail(actual,expected,message,"deepEqual",assert.deepEqual)},assert.notDeepEqual=function(actual,expected,message){_deepEqual(actual,expected)&&fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)},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(){_throws.apply(this,[!0].concat(pSlice.call(arguments)))},assert.doesNotThrow=function(){_throws.apply(this,[!1].concat(pSlice.call(arguments)))