"use strict";var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"])_i["return"]();}finally{if(_d)throw _e;}}return _arr;}return function(arr,i){if(Array.isArray(arr)){return arr;}else if(Symbol.iterator in Object(arr)){return sliceIterator(arr,i);}else{throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _createClass=function(){function defineProperties(target,props){for(var i=0;i does not exist in ",""],["<","> does not exist in ",""]),_templateObject11=_taggedTemplateLiteral([""," is not a promise"],[""," is not a promise"]),_templateObject12=_taggedTemplateLiteral(["'","' does not resolve to '","'"],["'","' does not resolve to '","'"]),_templateObject13=_taggedTemplateLiteral(["'","' is not of type '","'"],["'","' is not of type '","'"]),_templateObject14=_taggedTemplateLiteral(["'","' is not greater than ",""],["'","' is not greater than ",""]),_templateObject15=_taggedTemplateLiteral(["'","' is not less than ",""],["'","' is not less than ",""]),_templateObject16=_taggedTemplateLiteral(["'","' is less than ",""],["'","' is less than ",""]),_templateObject17=_taggedTemplateLiteral(["'","' is greater than ",""],["'","' is greater than ",""]);function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}function _taggedTemplateLiteral(strings,raw){return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toArray(arr){return Array.isArray(arr)?arr:Array.from(arr);}function _classCallCheck2(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperty2(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _toConsumableArray2(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i} arr Array of Promises. * @param {Function} functor Function to call resolved values. */var PromiseMap=function PromiseMap(arr,functor){return Promise.all(arr.map(function(x){return Promise.resolve(x).then(functor);}));};/** * Resolve a flat object's promises. * @param {Object} * @returns {Object} */var ResolveObject=function ResolveObject(obj){return Promise.all(Object.keys(obj).map(function(key){return Promise.resolve(obj[key]).then(function(val){return obj[key]=val;});})).then(function(_){return obj;});};/** * Recursively resolves deep objects with nested promises. * @param {Object} object Object or value to resolve. * @returns {Object} Resolved object. */var PromiseObject=function PromiseObject(object){var shouldReplaceSelf=false;var ResolveDeepObject=function ResolveDeepObject(obj){return Promise.resolve(obj).then(function(resolvedObject){if(Array.isArray(resolvedObject)){// Promise and map every item to recursively deep resolve. return PromiseMap(resolvedObject,function(obj){return ResolveDeepObject(obj);});}else if(isObject(resolvedObject)){return ResolveObject(Object.keys(resolvedObject).reduce(function(acc,key){if(resolvedObject[key]===object){shouldReplaceSelf=true;return _extends2({},acc,_defineProperty2({},key,$SELF));}return _extends2({},acc,_defineProperty2({},key,ResolveDeepObject(resolvedObject[key])));},{}));}return resolvedObject;});};return ResolveDeepObject(object).then(function(obj){// Replace $SELF with reference to obj if(shouldReplaceSelf)makeCyclic(obj,$SELF);return obj;});};module.exports=PromiseObject;},{}],5:[function(require,module,exports){(function(global){'use strict';// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js // original notice: /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */function compare(a,b){if(a===b){return 0;}var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the 'Software'), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. var util=require('util/');var hasOwn=Object.prototype.hasOwnProperty;var pSlice=Array.prototype.slice;var functionsHaveNames=function(){return function foo(){}.name==='foo';}();function pToString(obj){return Object.prototype.toString.call(obj);}function isView(arrbuf){if(isBuffer(arrbuf)){return false;}if(typeof global.ArrayBuffer!=='function'){return false;}if(typeof ArrayBuffer.isView==='function'){return ArrayBuffer.isView(arrbuf);}if(!arrbuf){return false;}if(arrbuf instanceof DataView){return true;}if(arrbuf.buffer&&arrbuf.buffer instanceof ArrayBuffer){return true;}return false;}// 1. The assert module provides functions that throw // AssertionError's when particular conditions are not met. The // assert module must conform to the following interface. var assert=module.exports=ok;// 2. The AssertionError is defined in assert. // new assert.AssertionError({ message: message, // actual: actual, // expected: expected }) var regex=/\s*function\s+([^\(\s]*)\s*/;// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js function getName(func){if(!util.isFunction(func)){return;}if(functionsHaveNames){return func.name;}var str=func.toString();var match=str.match(regex);return match&&match[1];}assert.AssertionError=function AssertionError(options){this.name='AssertionError';this.actual=options.actual;this.expected=options.expected;this.operator=options.operator;if(options.message){this.message=options.message;this.generatedMessage=false;}else{this.message=getMessage(this);this.generatedMessage=true;}var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace){Error.captureStackTrace(this,stackStartFunction);}else{// non v8 browsers so we can have a stacktrace var err=new Error();if(err.stack){var out=err.stack;// try to strip useless frames var fn_name=getName(stackStartFunction);var idx=out.indexOf('\n'+fn_name);if(idx>=0){// once we have located the function frame // we need to strip out everything before it (and its line) var next_line=out.indexOf('\n',idx+1);out=out.substring(next_line+1);}this.stack=out;}}};// assert.AssertionError instanceof Error util.inherits(assert.AssertionError,Error);function truncate(s,n){if(typeof s==='string'){return s.length=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],strict,actualVisitedObjects))return false;}return true;}// 8. The non-equivalence assertion tests for any deep inequality. // assert.notDeepEqual(actual, expected, message_opt); assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected,false)){fail(actual,expected,message,'notDeepEqual',assert.notDeepEqual);}};assert.notDeepStrictEqual=notDeepStrictEqual;function notDeepStrictEqual(actual,expected,message){if(_deepEqual(actual,expected,true)){fail(actual,expected,message,'notDeepStrictEqual',notDeepStrictEqual);}}// 9. The strict equality assertion tests strict equality, as determined by ===. // assert.strictEqual(actual, expected, message_opt); assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,'===',assert.strictEqual);}};// 10. The strict non-equality assertion tests for strict inequality, as // determined by !==. assert.notStrictEqual(actual, expected, message_opt); assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,'!==',assert.notStrictEqual);}};function expectedException(actual,expected){if(!actual||!expected){return false;}if(Object.prototype.toString.call(expected)=='[object RegExp]'){return expected.test(actual);}try{if(actual instanceof expected){return true;}}catch(e){// Ignore. The instanceof check doesn't work for arrow functions. }if(Error.isPrototypeOf(expected)){return false;}return expected.call({},actual)===true;}function _tryBlock(block){var error;try{block();}catch(e){error=e;}return error;}function _throws(shouldThrow,block,expected,message){var actual;if(typeof block!=='function'){throw new TypeError('"block" argument must be a function');}if(typeof expected==='string'){message=expected;expected=null;}actual=_tryBlock(block);message=(expected&&expected.name?' ('+expected.name+').':'.')+(message?' '+message:'.');if(shouldThrow&&!actual){fail(actual,expected,'Missing expected exception'+message);}var userProvidedMessage=typeof message==='string';var isUnwantedException=!shouldThrow&&util.isError(actual);var isUnexpectedException=!shouldThrow&&actual&&!expected;if(isUnwantedException&&userProvidedMessage&&expectedException(actual,expected)||isUnexpectedException){fail(actual,expected,'Got unwanted exception'+message);}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual;}}// 11. Expected to throw an error: // assert.throws(block, Error_opt, message_opt); assert.throws=function(block,/*optional*/error,/*optional*/message){_throws(true,block,error,message);};// EXTENSION! This is annoying to write outside this module. assert.doesNotThrow=function(block,/*optional*/error,/*optional*/message){_throws(false,block,error,message);};assert.ifError=function(err){if(err)throw err;};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key);}return keys;};}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"util/":214}],6:[function(require,module,exports){'use strict';exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=='undefined'?Uint8Array:Array;var code='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';for(var i=0,len=code.length;i0){throw new Error('Invalid string. Length must be a multiple of 4');}// Trim off extra bytes after placeholder bytes are found // See: https://github.com/beatgammit/base64-js/issues/42 var validLen=b64.indexOf('=');if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen];}// base64 is 4/3 + up to two characters of the original data function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen;}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen;}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;// if there are placeholders, only get up to the last complete 4 chars var len=placeHoldersLen>0?validLen-4:validLen;for(var i=0;i>16&0xFF;arr[curByte++]=tmp>>8&0xFF;arr[curByte++]=tmp&0xFF;}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&0xFF;}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&0xFF;arr[curByte++]=tmp&0xFF;}return arr;}function tripletToBase64(num){return lookup[num>>18&0x3F]+lookup[num>>12&0x3F]+lookup[num>>6&0x3F]+lookup[num&0x3F];}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;ilen2?len2:i+maxChunkLength));}// pad the end with zeros, but make sure to not forget the extra bytes if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&0x3F]+'==');}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&0x3F]+lookup[tmp<<2&0x3F]+'=');}return parts.join('');}},{}],7:[function(require,module,exports){},{}],8:[function(require,module,exports){/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT *//* eslint-disable no-proto */'use strict';var base64=require('base64-js');var ieee754=require('ieee754');exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=0x7fffffff;exports.kMaxLength=K_MAX_LENGTH;/** * If `Buffer.TYPED_ARRAY_SUPPORT`: * === true Use Uint8Array implementation (fastest) * === false Print warning and recommend using `buffer` v4.x which has an Object * implementation (most compatible, even IE6) * * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, * Opera 11.6+, iOS 4.2+. * * We report that the browser does not support typed arrays if the are not subclassable * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support * for __proto__ and has a buggy typed array implementation. */Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=='undefined'&&typeof console.error==='function'){console.error('This browser lacks typed array (Uint8Array) support which is required by '+'`buffer` v5.x. Use `buffer` v4.x if you require old browser support.');}function typedArraySupport(){// Can typed array instances can be augmented? try{var arr=new Uint8Array(1);arr.__proto__={__proto__:Uint8Array.prototype,foo:function foo(){return 42;}};return arr.foo()===42;}catch(e){return false;}}Object.defineProperty(Buffer.prototype,'parent',{enumerable:true,get:function get(){if(!Buffer.isBuffer(this))return undefined;return this.buffer;}});Object.defineProperty(Buffer.prototype,'offset',{enumerable:true,get:function get(){if(!Buffer.isBuffer(this))return undefined;return this.byteOffset;}});function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"');}// Return an augmented `Uint8Array` instance var buf=new Uint8Array(length);buf.__proto__=Buffer.prototype;return buf;}/** * The Buffer constructor returns instances of `Uint8Array` that have their * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of * `Uint8Array`, so the returned instances will have all the node `Buffer` methods * and the `Uint8Array` methods. Square bracket notation works as expected -- it * returns a single octet. * * The `Uint8Array` prototype remains unmodified. */function Buffer(arg,encodingOrOffset,length){// Common case. if(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The "string" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 if(typeof Symbol!=='undefined'&&Symbol.species!=null&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false});}Buffer.poolSize=8192;// not used by this implementation function from(value,encodingOrOffset,length){if(typeof value==='string'){return fromString(value,encodingOrOffset);}if(ArrayBuffer.isView(value)){return fromArrayLike(value);}if(value==null){throw TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, '+'or Array-like Object. Received type '+(typeof value==="undefined"?"undefined":_typeof2(value)));}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length);}if(typeof value==='number'){throw new TypeError('The "value" argument must not be of type number. Received type number');}var valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length);}var b=fromObject(value);if(b)return b;if(typeof Symbol!=='undefined'&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==='function'){return Buffer.from(value[Symbol.toPrimitive]('string'),encodingOrOffset,length);}throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, '+'or Array-like Object. Received type '+(typeof value==="undefined"?"undefined":_typeof2(value)));}/** * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError * if value is a number. * Buffer.from(str[, encoding]) * Buffer.from(array) * Buffer.from(buffer) * Buffer.from(arrayBuffer[, byteOffset[, length]]) **/Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length);};// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: // https://github.com/feross/buffer/pull/148 Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;function assertSize(size){if(typeof size!=='number'){throw new TypeError('"size" argument must be of type number');}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"');}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size);}if(fill!==undefined){// Only pay attention to encoding if it's a string. This // prevents accidentally sending in a number that would // be interpretted as a start offset. return typeof encoding==='string'?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill);}return createBuffer(size);}/** * Creates a new filled Buffer instance. * alloc(size[, fill[, encoding]]) **/Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding);};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0);}/** * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. * */Buffer.allocUnsafe=function(size){return allocUnsafe(size);};/** * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. */Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size);};function fromString(string,encoding){if(typeof encoding!=='string'||encoding===''){encoding='utf8';}if(!Buffer.isEncoding(encoding)){throw new TypeError('Unknown encoding: '+encoding);}var length=byteLength(string,encoding)|0;var buf=createBuffer(length);var actual=buf.write(string,encoding);if(actual!==length){// Writing a hex string, for example, that contains invalid characters will // cause everything after the first invalid character to be ignored. (e.g. // 'abxxcd' will be treated as 'ab') buf=buf.slice(0,actual);}return buf;}function fromArrayLike(array){var length=array.length<0?0:checked(array.length)|0;var buf=createBuffer(length);for(var i=0;i=K_MAX_LENGTH){throw new RangeError('Attempt to allocate Buffer larger than maximum '+'size: 0x'+K_MAX_LENGTH.toString(16)+' bytes');}return length|0;}function SlowBuffer(length){if(+length!=length){// eslint-disable-line eqeqeq length=0;}return Buffer.alloc(+length);}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true&&b!==Buffer.prototype;// so Buffer.isBuffer(Buffer.prototype) will be false };Buffer.compare=function compare(a,b){if(isInstance(a,Uint8Array))a=Buffer.from(a,a.offset,a.byteLength);if(isInstance(b,Uint8Array))b=Buffer.from(b,b.offset,b.byteLength);if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');}if(a===b)return 0;var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i2&&arguments[2]===true;if(!mustMatch&&len===0)return 0;// Use a for loop to avoid recursion var loweredCase=false;for(;;){switch(encoding){case'ascii':case'latin1':case'binary':return len;case'utf8':case'utf-8':return utf8ToBytes(string).length;case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return len*2;case'hex':return len>>>1;case'base64':return base64ToBytes(string).length;default:if(loweredCase){return mustMatch?-1:utf8ToBytes(string).length;// assume utf8 }encoding=(''+encoding).toLowerCase();loweredCase=true;}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){var loweredCase=false;// No need to verify that "this.length <= MAX_UINT32" since it's a read-only // property of a typed array. // This behaves neither like String nor Uint8Array in that we set start/end // to their upper/lower bounds if the value passed is out of range. // undefined is handled specially as per ECMA-262 6th Edition, // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. if(start===undefined||start<0){start=0;}// Return early if start > this.length. Done here to prevent potential uint32 // coercion fail below. if(start>this.length){return'';}if(end===undefined||end>this.length){end=this.length;}if(end<=0){return'';}// Force coersion to uint32. This will also coerce falsey/NaN values to 0. end>>>=0;start>>>=0;if(end<=start){return'';}if(!encoding)encoding='utf8';while(true){switch(encoding){case'hex':return hexSlice(this,start,end);case'utf8':case'utf-8':return utf8Slice(this,start,end);case'ascii':return asciiSlice(this,start,end);case'latin1':case'binary':return latin1Slice(this,start,end);case'base64':return base64Slice(this,start,end);case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError('Unknown encoding: '+encoding);encoding=(encoding+'').toLowerCase();loweredCase=true;}}}// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) // to detect a Buffer instance. It's not possible to use `instanceof Buffer` // reliably in a browserify context because there could be multiple different // copies of the 'buffer' package in use. This method works even for Buffer // instances that were created from another copy of the `buffer` package. // See: https://github.com/feross/buffer/issues/154 Buffer.prototype._isBuffer=true;function swap(b,n,m){var i=b[n];b[n]=b[m];b[m]=i;}Buffer.prototype.swap16=function swap16(){var len=this.length;if(len%2!==0){throw new RangeError('Buffer size must be a multiple of 16-bits');}for(var i=0;imax)str+=' ... ';return'';};Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)){target=Buffer.from(target,target.offset,target.byteLength);}if(!Buffer.isBuffer(target)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+'Received type '+(typeof target==="undefined"?"undefined":_typeof2(target)));}if(start===undefined){start=0;}if(end===undefined){end=target?target.length:0;}if(thisStart===undefined){thisStart=0;}if(thisEnd===undefined){thisEnd=this.length;}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError('out of range index');}if(thisStart>=thisEnd&&start>=end){return 0;}if(thisStart>=thisEnd){return-1;}if(start>=end){return 1;}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;var x=thisEnd-thisStart;var y=end-start;var len=Math.min(x,y);var thisCopy=this.slice(thisStart,thisEnd);var targetCopy=target.slice(start,end);for(var i=0;i= `byteOffset`, // OR the last index of `val` in `buffer` at offset <= `byteOffset`. // // Arguments: // - buffer - a Buffer to search // - val - a string, Buffer, or number // - byteOffset - an index into `buffer`; will be clamped to an int32 // - encoding - an optional encoding, relevant is val is a string // - dir - true for indexOf, false for lastIndexOf function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match if(buffer.length===0)return-1;// Normalize byteOffset if(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number. if(numberIsNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer byteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val if(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf if(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails if(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255] if(typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var indexSize=1;var arrLength=arr.length;var valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==='ucs2'||encoding==='ucs-2'||encoding==='utf16le'||encoding==='utf-16le'){if(arr.length<2||val.length<2){return-1;}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2;}}function read(buf,i){if(indexSize===1){return buf[i];}else{return buf.readUInt16BE(i*indexSize);}}var i;if(dir){var foundIndex=-1;for(i=byteOffset;iarrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){var found=true;for(var j=0;jremaining){length=remaining;}}var strLen=string.length;if(length>strLen/2){length=strLen/2;}for(var i=0;i>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding='utf8';}else{encoding=length;length=undefined;}}else{throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');}var remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError('Attempt to write outside buffer bounds');}if(!encoding)encoding='utf8';var loweredCase=false;for(;;){switch(encoding){case'hex':return hexWrite(this,string,offset,length);case'utf8':case'utf-8':return utf8Write(this,string,offset,length);case'ascii':return asciiWrite(this,string,offset,length);case'latin1':case'binary':return latin1Write(this,string,offset,length);case'base64':// Warning: maxLength not taken into account in base64Write return base64Write(this,string,offset,length);case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError('Unknown encoding: '+encoding);encoding=(''+encoding).toLowerCase();loweredCase=true;}}};Buffer.prototype.toJSON=function toJSON(){return{type:'Buffer',data:Array.prototype.slice.call(this._arr||this,0)};};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf);}else{return base64.fromByteArray(buf.slice(start,end));}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);var res=[];var i=start;while(i0xEF?4:firstByte>0xDF?3:firstByte>0xBF?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<0x80){codePoint=firstByte;}break;case 2:secondByte=buf[i+1];if((secondByte&0xC0)===0x80){tempCodePoint=(firstByte&0x1F)<<0x6|secondByte&0x3F;if(tempCodePoint>0x7F){codePoint=tempCodePoint;}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&0xC0)===0x80&&(thirdByte&0xC0)===0x80){tempCodePoint=(firstByte&0xF)<<0xC|(secondByte&0x3F)<<0x6|thirdByte&0x3F;if(tempCodePoint>0x7FF&&(tempCodePoint<0xD800||tempCodePoint>0xDFFF)){codePoint=tempCodePoint;}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&0xC0)===0x80&&(thirdByte&0xC0)===0x80&&(fourthByte&0xC0)===0x80){tempCodePoint=(firstByte&0xF)<<0x12|(secondByte&0x3F)<<0xC|(thirdByte&0x3F)<<0x6|fourthByte&0x3F;if(tempCodePoint>0xFFFF&&tempCodePoint<0x110000){codePoint=tempCodePoint;}}}}if(codePoint===null){// we did not generate a valid codePoint so insert a // replacement char (U+FFFD) and advance only 1 byte codePoint=0xFFFD;bytesPerSequence=1;}else if(codePoint>0xFFFF){// encode to utf16 (surrogate pair dance) codePoint-=0x10000;res.push(codePoint>>>10&0x3FF|0xD800);codePoint=0xDC00|codePoint&0x3FF;}res.push(codePoint);i+=bytesPerSequence;}return decodeCodePointsArray(res);}// Based on http://stackoverflow.com/a/22747272/680742, the browser with // the lowest limit is Chrome, with 0x10000 args. // We go 1 magnitude less, for safety var MAX_ARGUMENTS_LENGTH=0x1000;function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints);// avoid extra slice() }// Decode in chunks to avoid "call stack size exceeded". var res='';var i=0;while(ilen)end=len;var out='';for(var i=start;ilen){start=len;}if(end<0){end+=len;if(end<0)end=0;}else if(end>len){end=len;}if(endlength)throw new RangeError('Trying to access beyond buffer length');}Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length);}var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=0x100)){val+=this[offset+--byteLength]*mul;}return val;};Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset];};Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8;};Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1];};Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*0x1000000;};Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*0x1000000+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3]);};Buffer.prototype.readIntLE=function readIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i=mul)val-=Math.pow(2,8*byteLength);return val;};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=0x100)){val+=this[offset+--i]*mul;}mul*=0x80;if(val>=mul)val-=Math.pow(2,8*byteLength);return val;};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&0x80))return this[offset];return(0xff-this[offset]+1)*-1;};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&0x8000?val|0xFFFF0000:val;};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&0x8000?val|0xFFFF0000:val;};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24;};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3];};Buffer.prototype.readFloatLE=function readFloatLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4);};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4);};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8);};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8);};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError('Index out of range');}Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0);}var mul=1;var i=0;this[offset]=value&0xFF;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0);}var i=byteLength-1;var mul=1;this[offset+i]=value&0xFF;while(--i>=0&&(mul*=0x100)){this[offset+i]=value/mul&0xFF;}return offset+byteLength;};Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,0xff,0);this[offset]=value&0xff;return offset+1;};Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,0xffff,0);this[offset]=value&0xff;this[offset+1]=value>>>8;return offset+2;};Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,0xffff,0);this[offset]=value>>>8;this[offset+1]=value&0xff;return offset+2;};Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,0xffffffff,0);this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&0xff;return offset+4;};Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,0xffffffff,0);this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&0xff;return offset+4;};Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit);}var i=0;var mul=1;var sub=0;this[offset]=value&0xFF;while(++i>0)-sub&0xFF;}return offset+byteLength;};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit);}var i=byteLength-1;var mul=1;var sub=0;this[offset+i]=value&0xFF;while(--i>=0&&(mul*=0x100)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1;}this[offset+i]=(value/mul>>0)-sub&0xFF;}return offset+byteLength;};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,0x7f,-0x80);if(value<0)value=0xff+value+1;this[offset]=value&0xff;return offset+1;};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,0x7fff,-0x8000);this[offset]=value&0xff;this[offset+1]=value>>>8;return offset+2;};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,0x7fff,-0x8000);this[offset]=value>>>8;this[offset+1]=value&0xff;return offset+2;};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,0x7fffffff,-0x80000000);this[offset]=value&0xff;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4;};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,0x7fffffff,-0x80000000);if(value<0)value=0xffffffff+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&0xff;return offset+4;};function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError('Index out of range');if(offset<0)throw new RangeError('Index out of range');}function writeFloat(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4,3.4028234663852886e+38,-3.4028234663852886e+38);}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4;}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert);};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert);};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8,1.7976931348623157E+308,-1.7976931348623157E+308);}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8;}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert);};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert);};// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError('argument should be a Buffer');if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end=this.length)throw new RangeError('Index out of range');if(end<0)throw new RangeError('sourceEnd out of bounds');// Are we oob? if(end>this.length)end=this.length;if(target.length-targetStart=0;--i){target[i+targetStart]=this[i+start];}}else{Uint8Array.prototype.set.call(target,this.subarray(start,end),targetStart);}return len;};// Usage: // buffer.fill(number[, offset[, end]]) // buffer.fill(buffer[, offset[, end]]) // buffer.fill(string[, offset[, end]][, encoding]) Buffer.prototype.fill=function fill(val,start,end,encoding){// Handle string cases: if(typeof val==='string'){if(typeof start==='string'){encoding=start;start=0;end=this.length;}else if(typeof end==='string'){encoding=end;end=this.length;}if(encoding!==undefined&&typeof encoding!=='string'){throw new TypeError('encoding must be a string');}if(typeof encoding==='string'&&!Buffer.isEncoding(encoding)){throw new TypeError('Unknown encoding: '+encoding);}if(val.length===1){var code=val.charCodeAt(0);if(encoding==='utf8'&&code<128||encoding==='latin1'){// Fast path: If `val` fits into a single byte, use that numeric value. val=code;}}}else if(typeof val==='number'){val=val&255;}// Invalid ranges are not set to a default, so can range check early. if(start<0||this.length>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;var i;if(typeof val==='number'){for(i=start;i0xD7FF&&codePoint<0xE000){// last char was a lead if(!leadSurrogate){// no lead yet if(codePoint>0xDBFF){// unexpected trail if((units-=3)>-1)bytes.push(0xEF,0xBF,0xBD);continue;}else if(i+1===length){// unpaired lead if((units-=3)>-1)bytes.push(0xEF,0xBF,0xBD);continue;}// valid lead leadSurrogate=codePoint;continue;}// 2 leads in a row if(codePoint<0xDC00){if((units-=3)>-1)bytes.push(0xEF,0xBF,0xBD);leadSurrogate=codePoint;continue;}// valid surrogate pair codePoint=(leadSurrogate-0xD800<<10|codePoint-0xDC00)+0x10000;}else if(leadSurrogate){// valid bmp char, but last char was a lead if((units-=3)>-1)bytes.push(0xEF,0xBF,0xBD);}leadSurrogate=null;// encode utf8 if(codePoint<0x80){if((units-=1)<0)break;bytes.push(codePoint);}else if(codePoint<0x800){if((units-=2)<0)break;bytes.push(codePoint>>0x6|0xC0,codePoint&0x3F|0x80);}else if(codePoint<0x10000){if((units-=3)<0)break;bytes.push(codePoint>>0xC|0xE0,codePoint>>0x6&0x3F|0x80,codePoint&0x3F|0x80);}else if(codePoint<0x110000){if((units-=4)<0)break;bytes.push(codePoint>>0x12|0xF0,codePoint>>0xC&0x3F|0x80,codePoint>>0x6&0x3F|0x80,codePoint&0x3F|0x80);}else{throw new Error('Invalid code point');}}return bytes;}function asciiToBytes(str){var byteArray=[];for(var i=0;i>8;lo=c%256;byteArray.push(lo);byteArray.push(hi);}return byteArray;}function base64ToBytes(str){return base64.toByteArray(base64clean(str));}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length)break;dst[i+offset]=src[i];}return i;}// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass // the `instanceof` check but they should be treated as of that type. // See: https://github.com/feross/buffer/issues/166 function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name;}function numberIsNaN(obj){// For IE11 support return obj!==obj;// eslint-disable-line no-self-compare }},{"base64-js":6,"ieee754":12}],9:[function(require,module,exports){(function(Buffer){// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(arg){if(Array.isArray){return Array.isArray(arg);}return objectToString(arg)==='[object Array]';}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==="undefined"?"undefined":_typeof2(arg))==='symbol';}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0;}exports.isUndefined=isUndefined;function isRegExp(re){return objectToString(re)==='[object RegExp]';}exports.isRegExp=isRegExp;function isObject(arg){return(typeof arg==="undefined"?"undefined":_typeof2(arg))==='object'&&arg!==null;}exports.isObject=isObject;function isDate(d){return objectToString(d)==='[object Date]';}exports.isDate=isDate;function isError(e){return objectToString(e)==='[object Error]'||e instanceof 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==="undefined"?"undefined":_typeof2(arg))==='symbol'||// ES6 symbol typeof arg==='undefined';}exports.isPrimitive=isPrimitive;exports.isBuffer=Buffer.isBuffer;function objectToString(o){return Object.prototype.toString.call(o);}}).call(this,{"isBuffer":require("../../../../../is-buffer/1.1.6/node_modules/is-buffer/index.js")});},{"../../../../../is-buffer/1.1.6/node_modules/is-buffer/index.js":15}],10:[function(require,module,exports){var Stream=require("stream");var writeMethods=["write","end","destroy"];var readMethods=["resume","pause"];var readEvents=["data","close"];var slice=Array.prototype.slice;module.exports=duplex;function forEach(arr,fn){if(arr.forEach){return arr.forEach(fn);}for(var i=0;i1)er=arguments[1];if(er instanceof Error){throw er;// Unhandled 'error' event }else{// At least give some kind of context to the user var err=new Error('Unhandled "error" event. ('+er+')');err.context=er;throw err;}return false;}handler=events[type];if(!handler)return false;var isFn=typeof handler==='function';len=arguments.length;switch(len){// fast cases case 1:emitNone(handler,isFn,this);break;case 2:emitOne(handler,isFn,this,arguments[1]);break;case 3:emitTwo(handler,isFn,this,arguments[1],arguments[2]);break;case 4:emitThree(handler,isFn,this,arguments[1],arguments[2],arguments[3]);break;// slower default:args=new Array(len-1);for(i=1;i0&&existing.length>m){existing.warned=true;var w=new Error('Possible EventEmitter memory leak detected. '+existing.length+' "'+String(type)+'" listeners '+'added. Use emitter.setMaxListeners() to '+'increase limit.');w.name='MaxListenersExceededWarning';w.emitter=target;w.type=type;w.count=existing.length;if((typeof console==="undefined"?"undefined":_typeof2(console))==='object'&&console.warn){console.warn('%s: %s',w.name,w.message);}}}}return target;}EventEmitter.prototype.addListener=function addListener(type,listener){return _addListener(this,type,listener,false);};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.prependListener=function prependListener(type,listener){return _addListener(this,type,listener,true);};function onceWrapper(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;switch(arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:var args=new Array(arguments.length);for(var i=0;i=0;i--){if(list[i]===listener||list[i].listener===listener){originalListener=list[i].listener;position=i;break;}}if(position<0)return this;if(position===0)list.shift();else spliceOne(list,position);if(list.length===1)events[type]=list[0];if(events.removeListener)this.emit('removeListener',type,originalListener||listener);}return this;};EventEmitter.prototype.removeAllListeners=function removeAllListeners(type){var listeners,events,i;events=this._events;if(!events)return this;// not listening for removeListener, no need to emit if(!events.removeListener){if(arguments.length===0){this._events=objectCreate(null);this._eventsCount=0;}else if(events[type]){if(--this._eventsCount===0)this._events=objectCreate(null);else delete events[type];}return this;}// emit removeListener for all listeners on all events if(arguments.length===0){var keys=objectKeys(events);var key;for(i=0;i=0;i--){this.removeListener(type,listeners[i]);}}return this;};function _listeners(target,type,unwrap){var events=target._events;if(!events)return[];var evlistener=events[type];if(!evlistener)return[];if(typeof evlistener==='function')return unwrap?[evlistener.listener||evlistener]:[evlistener];return unwrap?unwrapListeners(evlistener):arrayClone(evlistener,evlistener.length);}EventEmitter.prototype.listeners=function listeners(type){return _listeners(this,type,true);};EventEmitter.prototype.rawListeners=function rawListeners(type){return _listeners(this,type,false);};EventEmitter.listenerCount=function(emitter,type){if(typeof emitter.listenerCount==='function'){return emitter.listenerCount(type);}else{return listenerCount.call(emitter,type);}};EventEmitter.prototype.listenerCount=listenerCount;function listenerCount(type){var events=this._events;if(events){var evlistener=events[type];if(typeof evlistener==='function'){return 1;}else if(evlistener){return evlistener.length;}}return 0;}EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[];};// About 1.5x faster than the two-arg version of Array#splice(). function spliceOne(list,index){for(var i=index,k=i+1,n=list.length;k>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=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;}else if(e===eMax){return m?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){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=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;}else if(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&0xff,i+=d,m/=256,mLen-=8){}e=e<0;buffer[offset+i]=e&0xff,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128;};},{}],13:[function(require,module,exports){if(typeof Object.create==='function'){// implementation from standard node.js 'util' module module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}});};}else{// old school shim for old browsers module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function TempCtor(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor();ctor.prototype.constructor=ctor;};}},{}],14:[function(require,module,exports){arguments[4][13][0].apply(exports,arguments);},{"dup":13}],15:[function(require,module,exports){/*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */// The _isBuffer check is for Safari 5-7 support, because it's missing // Object.prototype.constructor. Remove this eventually module.exports=function(obj){return obj!=null&&(isBuffer(obj)||isSlowBuffer(obj)||!!obj._isBuffer);};function isBuffer(obj){return!!obj.constructor&&typeof obj.constructor.isBuffer==='function'&&obj.constructor.isBuffer(obj);}// For Node v0.10 support. Remove this eventually. function isSlowBuffer(obj){return typeof obj.readFloatLE==='function'&&typeof obj.slice==='function'&&isBuffer(obj.slice(0,0));}},{}],16:[function(require,module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return toString.call(arr)=='[object Array]';};},{}],17:[function(require,module,exports){'use strict';var yaml=require('./lib/js-yaml.js');module.exports=yaml;},{"./lib/js-yaml.js":18}],18:[function(require,module,exports){'use strict';var loader=require('./js-yaml/loader');var dumper=require('./js-yaml/dumper');function deprecated(name){return function(){throw new Error('Function '+name+' is deprecated and cannot be used.');};}module.exports.Type=require('./js-yaml/type');module.exports.Schema=require('./js-yaml/schema');module.exports.FAILSAFE_SCHEMA=require('./js-yaml/schema/failsafe');module.exports.JSON_SCHEMA=require('./js-yaml/schema/json');module.exports.CORE_SCHEMA=require('./js-yaml/schema/core');module.exports.DEFAULT_SAFE_SCHEMA=require('./js-yaml/schema/default_safe');module.exports.DEFAULT_FULL_SCHEMA=require('./js-yaml/schema/default_full');module.exports.load=loader.load;module.exports.loadAll=loader.loadAll;module.exports.safeLoad=loader.safeLoad;module.exports.safeLoadAll=loader.safeLoadAll;module.exports.dump=dumper.dump;module.exports.safeDump=dumper.safeDump;module.exports.YAMLException=require('./js-yaml/exception');// Deprecated schema names from JS-YAML 2.0.x module.exports.MINIMAL_SCHEMA=require('./js-yaml/schema/failsafe');module.exports.SAFE_SCHEMA=require('./js-yaml/schema/default_safe');module.exports.DEFAULT_SCHEMA=require('./js-yaml/schema/default_full');// Deprecated functions from JS-YAML 1.x.x module.exports.scan=deprecated('scan');module.exports.parse=deprecated('parse');module.exports.compose=deprecated('compose');module.exports.addConstructor=deprecated('addConstructor');},{"./js-yaml/dumper":20,"./js-yaml/exception":21,"./js-yaml/loader":22,"./js-yaml/schema":24,"./js-yaml/schema/core":25,"./js-yaml/schema/default_full":26,"./js-yaml/schema/default_safe":27,"./js-yaml/schema/failsafe":28,"./js-yaml/schema/json":29,"./js-yaml/type":30}],19:[function(require,module,exports){'use strict';function isNothing(subject){return typeof subject==='undefined'||subject===null;}function isObject(subject){return(typeof subject==="undefined"?"undefined":_typeof2(subject))==='object'&&subject!==null;}function toArray(sequence){if(Array.isArray(sequence))return sequence;else if(isNothing(sequence))return[];return[sequence];}function extend(target,source){var index,length,key,sourceKeys;if(source){sourceKeys=Object.keys(source);for(index=0,length=sourceKeys.length;index */var CHAR_QUESTION=0x3F;/* ? */var CHAR_COMMERCIAL_AT=0x40;/* @ */var CHAR_LEFT_SQUARE_BRACKET=0x5B;/* [ */var CHAR_RIGHT_SQUARE_BRACKET=0x5D;/* ] */var CHAR_GRAVE_ACCENT=0x60;/* ` */var CHAR_LEFT_CURLY_BRACKET=0x7B;/* { */var CHAR_VERTICAL_LINE=0x7C;/* | */var CHAR_RIGHT_CURLY_BRACKET=0x7D;/* } */var ESCAPE_SEQUENCES={};ESCAPE_SEQUENCES[0x00]='\\0';ESCAPE_SEQUENCES[0x07]='\\a';ESCAPE_SEQUENCES[0x08]='\\b';ESCAPE_SEQUENCES[0x09]='\\t';ESCAPE_SEQUENCES[0x0A]='\\n';ESCAPE_SEQUENCES[0x0B]='\\v';ESCAPE_SEQUENCES[0x0C]='\\f';ESCAPE_SEQUENCES[0x0D]='\\r';ESCAPE_SEQUENCES[0x1B]='\\e';ESCAPE_SEQUENCES[0x22]='\\"';ESCAPE_SEQUENCES[0x5C]='\\\\';ESCAPE_SEQUENCES[0x85]='\\N';ESCAPE_SEQUENCES[0xA0]='\\_';ESCAPE_SEQUENCES[0x2028]='\\L';ESCAPE_SEQUENCES[0x2029]='\\P';var DEPRECATED_BOOLEANS_SYNTAX=['y','Y','yes','Yes','YES','on','On','ON','n','N','no','No','NO','off','Off','OFF'];function compileStyleMap(schema,map){var result,keys,index,length,tag,style,type;if(map===null)return{};result={};keys=Object.keys(map);for(index=0,length=keys.length;index” | “'” | “"” &&c!==CHAR_SHARP&&c!==CHAR_AMPERSAND&&c!==CHAR_ASTERISK&&c!==CHAR_EXCLAMATION&&c!==CHAR_VERTICAL_LINE&&c!==CHAR_GREATER_THAN&&c!==CHAR_SINGLE_QUOTE&&c!==CHAR_DOUBLE_QUOTE// | “%” | “@” | “`”) &&c!==CHAR_PERCENT&&c!==CHAR_COMMERCIAL_AT&&c!==CHAR_GRAVE_ACCENT;}// Determines whether block indentation indicator is required. function needIndentIndicator(string){var leadingSpaceRe=/^\n* /;return leadingSpaceRe.test(string);}var STYLE_PLAIN=1,STYLE_SINGLE=2,STYLE_LITERAL=3,STYLE_FOLDED=4,STYLE_DOUBLE=5;// Determines which scalar styles are possible and returns the preferred style. // lineWidth = -1 => no limit. // Pre-conditions: str.length > 0. // Post-conditions: // STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. // STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). // STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). function chooseScalarStyle(string,singleLineOnly,indentPerLevel,lineWidth,testAmbiguousType){var i;var char;var hasLineBreak=false;var hasFoldableLine=false;// only checked if shouldTrackWidth var shouldTrackWidth=lineWidth!==-1;var previousLineBreak=-1;// count the first line correctly var plain=isPlainSafeFirst(string.charCodeAt(0))&&!isWhitespace(string.charCodeAt(string.length-1));if(singleLineOnly){// Case: no block styles. // Check for disallowed characters to rule out plain and single. for(i=0;ilineWidth&&string[previousLineBreak+1]!==' ';previousLineBreak=i;}}else if(!isPrintable(char)){return STYLE_DOUBLE;}plain=plain&&isPlainSafe(char);}// in case the end is missing a \n hasFoldableLine=hasFoldableLine||shouldTrackWidth&&i-previousLineBreak-1>lineWidth&&string[previousLineBreak+1]!==' ';}// Although every style can represent \n without escaping, prefer block styles // for multiline, since they're more readable and they don't add empty lines. // Also prefer folding a super-long line. if(!hasLineBreak&&!hasFoldableLine){// Strings interpretable as another type have to be quoted; // e.g. the string 'true' vs. the boolean true. return plain&&!testAmbiguousType(string)?STYLE_PLAIN:STYLE_SINGLE;}// Edge case: block indentation indicator can only have one digit. if(indentPerLevel>9&&needIndentIndicator(string)){return STYLE_DOUBLE;}// At this point we know block styles are valid. // Prefer literal style unless we want to fold. return hasFoldableLine?STYLE_FOLDED:STYLE_LITERAL;}// Note: line breaking/folding is implemented for only the folded style. // NB. We drop the last trailing newline (if any) of a returned block scalar // since the dumper adds its own newline. This always works: // • No ending newline => unaffected; already using strip "-" chomping. // • Ending newline => removed then restored. // Importantly, this keeps the "+" chomp indicator from gaining an extra line. function writeScalar(state,string,level,iskey){state.dump=function(){if(string.length===0){return"''";}if(!state.noCompatMode&&DEPRECATED_BOOLEANS_SYNTAX.indexOf(string)!==-1){return"'"+string+"'";}var indent=state.indent*Math.max(1,level);// no 0-indent scalars // As indentation gets deeper, let the width decrease monotonically // to the lower bound min(state.lineWidth, 40). // Note that this implies // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. // state.lineWidth > 40 + state.indent: width decreases until the lower bound. // This behaves better than a constant minimum width which disallows narrower options, // or an indent threshold which causes the width to suddenly increase. var lineWidth=state.lineWidth===-1?-1:Math.max(Math.min(state.lineWidth,40),state.lineWidth-indent);// Without knowing if keys are implicit/explicit, assume implicit for safety. var singleLineOnly=iskey// No block styles in flow mode. ||state.flowLevel>-1&&level>=state.flowLevel;function testAmbiguity(string){return testImplicitResolving(state,string);}switch(chooseScalarStyle(string,singleLineOnly,state.indent,lineWidth,testAmbiguity)){case STYLE_PLAIN:return string;case STYLE_SINGLE:return"'"+string.replace(/'/g,"''")+"'";case STYLE_LITERAL:return'|'+blockHeader(string,state.indent)+dropEndingNewline(indentString(string,indent));case STYLE_FOLDED:return'>'+blockHeader(string,state.indent)+dropEndingNewline(indentString(foldString(string,lineWidth),indent));case STYLE_DOUBLE:return'"'+escapeString(string,lineWidth)+'"';default:throw new YAMLException('impossible error: invalid scalar style');}}();}// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. function blockHeader(string,indentPerLevel){var indentIndicator=needIndentIndicator(string)?String(indentPerLevel):'';// note the special case: the string '\n' counts as a "trailing" empty line. var clip=string[string.length-1]==='\n';var keep=clip&&(string[string.length-2]==='\n'||string==='\n');var chomp=keep?'+':clip?'':'-';return indentIndicator+chomp+'\n';}// (See the note for writeScalar.) function dropEndingNewline(string){return string[string.length-1]==='\n'?string.slice(0,-1):string;}// Note: a long line without a suitable break point will exceed the width limit. // Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. function foldString(string,width){// In folded style, $k$ consecutive newlines output as $k+1$ newlines— // unless they're before or after a more-indented line, or at the very // beginning or end, in which case $k$ maps to $k$. // Therefore, parse each chunk as newline(s) followed by a content line. var lineRe=/(\n+)([^\n]*)/g;// first line (possibly an empty line) var result=function(){var nextLF=string.indexOf('\n');nextLF=nextLF!==-1?nextLF:string.length;lineRe.lastIndex=nextLF;return foldLine(string.slice(0,nextLF),width);}();// If we haven't reached the first content line yet, don't add an extra \n. var prevMoreIndented=string[0]==='\n'||string[0]===' ';var moreIndented;// rest of the lines var match;while(match=lineRe.exec(string)){var prefix=match[1],line=match[2];moreIndented=line[0]===' ';result+=prefix+(!prevMoreIndented&&!moreIndented&&line!==''?'\n':'')+foldLine(line,width);prevMoreIndented=moreIndented;}return result;}// Greedy line breaking. // Picks the longest line under the limit each time, // otherwise settles for the shortest line over the limit. // NB. More-indented lines *cannot* be folded, as that would add an extra \n. function foldLine(line,width){if(line===''||line[0]===' ')return line;// Since a more-indented line adds a \n, breaks can't be followed by a space. var breakRe=/ [^ ]/g;// note: the match index will always be <= length-2. var match;// start is an inclusive index. end, curr, and next are exclusive. var start=0,end,curr=0,next=0;var result='';// Invariants: 0 <= start <= length-1. // 0 <= curr <= next <= max(0, length-2). curr - start <= width. // Inside the loop: // A match implies length >= 2, so curr and next are <= length-2. while(match=breakRe.exec(line)){next=match.index;// maintain invariant: curr - start <= width if(next-start>width){end=curr>start?curr:next;// derive end <= length-2 result+='\n'+line.slice(start,end);// skip the space that was output as \n start=end+1;// derive start <= length-1 }curr=next;}// By the invariants, start <= length-1, so there is something left over. // It is either the whole string or a part starting from non-whitespace. result+='\n';// Insert a break if the remainder is too long and there is a break available. if(line.length-start>width&&curr>start){result+=line.slice(start,curr)+'\n'+line.slice(curr+1);}else{result+=line.slice(start);}return result.slice(1);// drop extra \n joiner }// Escapes a double-quoted string. function escapeString(string){var result='';var char,nextChar;var escapeSeq;for(var i=0;i=0xD800&&char<=0xDBFF/* high surrogate */){nextChar=string.charCodeAt(i+1);if(nextChar>=0xDC00&&nextChar<=0xDFFF/* low surrogate */){// Combine the surrogate pair and store it escaped. result+=encodeHex((char-0xD800)*0x400+nextChar-0xDC00+0x10000);// Advance index one extra since we already used that char here. i++;continue;}}escapeSeq=ESCAPE_SEQUENCES[char];result+=!escapeSeq&&isPrintable(char)?string[i]:escapeSeq||encodeHex(char);}return result;}function writeFlowSequence(state,level,object){var _result='',_tag=state.tag,index,length;for(index=0,length=object.length;index1024)pairBuffer+='? ';pairBuffer+=state.dump+(state.condenseFlow?'"':'')+':'+(state.condenseFlow?'':' ');if(!writeNode(state,level,objectValue,false,false)){continue;// Skip this pair because of invalid value. }pairBuffer+=state.dump;// Both key and value are valid. _result+=pairBuffer;}state.tag=_tag;state.dump='{'+_result+'}';}function writeBlockMapping(state,level,object,compact){var _result='',_tag=state.tag,objectKeyList=Object.keys(object),index,length,objectKey,objectValue,explicitPair,pairBuffer;// Allow sorting keys so that the output file is deterministic if(state.sortKeys===true){// Default sorting objectKeyList.sort();}else if(typeof state.sortKeys==='function'){// Custom sort function objectKeyList.sort(state.sortKeys);}else if(state.sortKeys){// Something is wrong throw new YAMLException('sortKeys must be a boolean or a function');}for(index=0,length=objectKeyList.length;index1024;if(explicitPair){if(state.dump&&CHAR_LINE_FEED===state.dump.charCodeAt(0)){pairBuffer+='?';}else{pairBuffer+='? ';}}pairBuffer+=state.dump;if(explicitPair){pairBuffer+=generateNextLine(state,level);}if(!writeNode(state,level+1,objectValue,true,explicitPair)){continue;// Skip this pair because of invalid value. }if(state.dump&&CHAR_LINE_FEED===state.dump.charCodeAt(0)){pairBuffer+=':';}else{pairBuffer+=': ';}pairBuffer+=state.dump;// Both key and value are valid. _result+=pairBuffer;}state.tag=_tag;state.dump=_result||'{}';// Empty mapping if no valid pairs. }function detectType(state,object,explicit){var _result,typeList,index,length,type,style;typeList=explicit?state.explicitTypes:state.implicitTypes;for(index=0,length=typeList.length;index tag resolver accepts not "'+style+'" style');}state.dump=_result;}return true;}}return false;}// Serializes `object` and writes it to global `result`. // Returns true on success, or false on invalid object. // function writeNode(state,level,object,block,compact,iskey){state.tag=null;state.dump=object;if(!detectType(state,object,false)){detectType(state,object,true);}var type=_toString.call(state.dump);if(block){block=state.flowLevel<0||state.flowLevel>level;}var objectOrArray=type==='[object Object]'||type==='[object Array]',duplicateIndex,duplicate;if(objectOrArray){duplicateIndex=state.duplicates.indexOf(object);duplicate=duplicateIndex!==-1;}if(state.tag!==null&&state.tag!=='?'||duplicate||state.indent!==2&&level>0){compact=false;}if(duplicate&&state.usedDuplicates[duplicateIndex]){state.dump='*ref_'+duplicateIndex;}else{if(objectOrArray&&duplicate&&!state.usedDuplicates[duplicateIndex]){state.usedDuplicates[duplicateIndex]=true;}if(type==='[object Object]'){if(block&&Object.keys(state.dump).length!==0){writeBlockMapping(state,level,state.dump,compact);if(duplicate){state.dump='&ref_'+duplicateIndex+state.dump;}}else{writeFlowMapping(state,level,state.dump);if(duplicate){state.dump='&ref_'+duplicateIndex+' '+state.dump;}}}else if(type==='[object Array]'){if(block&&state.dump.length!==0){writeBlockSequence(state,level,state.dump,compact);if(duplicate){state.dump='&ref_'+duplicateIndex+state.dump;}}else{writeFlowSequence(state,level,state.dump);if(duplicate){state.dump='&ref_'+duplicateIndex+' '+state.dump;}}}else if(type==='[object String]'){if(state.tag!=='?'){writeScalar(state,state.dump,level,iskey);}}else{if(state.skipInvalid)return false;throw new YAMLException('unacceptable kind of an object to dump '+type);}if(state.tag!==null&&state.tag!=='?'){state.dump='!<'+state.tag+'> '+state.dump;}}return true;}function getDuplicateReferences(object,state){var objects=[],duplicatesIndexes=[],index,length;inspectNode(object,objects,duplicatesIndexes);for(index=0,length=duplicatesIndexes.length;index>10)+0xD800,(c-0x010000&0x03FF)+0xDC00);}var simpleEscapeCheck=new Array(256);// integer, for fast access var simpleEscapeMap=new Array(256);for(var i=0;i<256;i++){simpleEscapeCheck[i]=simpleEscapeSequence(i)?1:0;simpleEscapeMap[i]=simpleEscapeSequence(i);}function State(input,options){this.input=input;this.filename=options['filename']||null;this.schema=options['schema']||DEFAULT_FULL_SCHEMA;this.onWarning=options['onWarning']||null;this.legacy=options['legacy']||false;this.json=options['json']||false;this.listener=options['listener']||null;this.implicitTypes=this.schema.compiledImplicit;this.typeMap=this.schema.compiledTypeMap;this.length=input.length;this.position=0;this.line=0;this.lineStart=0;this.lineIndent=0;this.documents=[];/* this.version; this.checkLineBreaks; this.tagMap; this.anchorMap; this.tag; this.anchor; this.kind; this.result;*/}function generateError(state,message){return new YAMLException(message,new Mark(state.filename,state.input,state.position,state.line,state.position-state.lineStart));}function throwError(state,message){throw generateError(state,message);}function throwWarning(state,message){if(state.onWarning){state.onWarning.call(null,generateError(state,message));}}var directiveHandlers={YAML:function handleYamlDirective(state,name,args){var match,major,minor;if(state.version!==null){throwError(state,'duplication of %YAML directive');}if(args.length!==1){throwError(state,'YAML directive accepts exactly one argument');}match=/^([0-9]+)\.([0-9]+)$/.exec(args[0]);if(match===null){throwError(state,'ill-formed argument of the YAML directive');}major=parseInt(match[1],10);minor=parseInt(match[2],10);if(major!==1){throwError(state,'unacceptable YAML version of the document');}state.version=args[0];state.checkLineBreaks=minor<2;if(minor!==1&&minor!==2){throwWarning(state,'unsupported YAML version of the document');}},TAG:function handleTagDirective(state,name,args){var handle,prefix;if(args.length!==2){throwError(state,'TAG directive accepts exactly two arguments');}handle=args[0];prefix=args[1];if(!PATTERN_TAG_HANDLE.test(handle)){throwError(state,'ill-formed tag handle (first argument) of the TAG directive');}if(_hasOwnProperty.call(state.tagMap,handle)){throwError(state,'there is a previously declared suffix for "'+handle+'" tag handle');}if(!PATTERN_TAG_URI.test(prefix)){throwError(state,'ill-formed tag prefix (second argument) of the TAG directive');}state.tagMap[handle]=prefix;}};function captureSegment(state,start,end,checkJson){var _position,_length,_character,_result;if(start1){state.result+=common.repeat('\n',count-1);}}function readPlainScalar(state,nodeIndent,withinFlowCollection){var preceding,following,captureStart,captureEnd,hasPendingContent,_line,_lineStart,_lineIndent,_kind=state.kind,_result=state.result,ch;ch=state.input.charCodeAt(state.position);if(is_WS_OR_EOL(ch)||is_FLOW_INDICATOR(ch)||ch===0x23/* # */||ch===0x26/* & */||ch===0x2A/* * */||ch===0x21/* ! */||ch===0x7C/* | */||ch===0x3E/* > */||ch===0x27/* ' */||ch===0x22/* " */||ch===0x25/* % */||ch===0x40/* @ */||ch===0x60/* ` */){return false;}if(ch===0x3F/* ? */||ch===0x2D/* - */){following=state.input.charCodeAt(state.position+1);if(is_WS_OR_EOL(following)||withinFlowCollection&&is_FLOW_INDICATOR(following)){return false;}}state.kind='scalar';state.result='';captureStart=captureEnd=state.position;hasPendingContent=false;while(ch!==0){if(ch===0x3A/* : */){following=state.input.charCodeAt(state.position+1);if(is_WS_OR_EOL(following)||withinFlowCollection&&is_FLOW_INDICATOR(following)){break;}}else if(ch===0x23/* # */){preceding=state.input.charCodeAt(state.position-1);if(is_WS_OR_EOL(preceding)){break;}}else if(state.position===state.lineStart&&testDocumentSeparator(state)||withinFlowCollection&&is_FLOW_INDICATOR(ch)){break;}else if(is_EOL(ch)){_line=state.line;_lineStart=state.lineStart;_lineIndent=state.lineIndent;skipSeparationSpace(state,false,-1);if(state.lineIndent>=nodeIndent){hasPendingContent=true;ch=state.input.charCodeAt(state.position);continue;}else{state.position=captureEnd;state.line=_line;state.lineStart=_lineStart;state.lineIndent=_lineIndent;break;}}if(hasPendingContent){captureSegment(state,captureStart,captureEnd,false);writeFoldedLines(state,state.line-_line);captureStart=captureEnd=state.position;hasPendingContent=false;}if(!is_WHITE_SPACE(ch)){captureEnd=state.position+1;}ch=state.input.charCodeAt(++state.position);}captureSegment(state,captureStart,captureEnd,false);if(state.result){return true;}state.kind=_kind;state.result=_result;return false;}function readSingleQuotedScalar(state,nodeIndent){var ch,captureStart,captureEnd;ch=state.input.charCodeAt(state.position);if(ch!==0x27/* ' */){return false;}state.kind='scalar';state.result='';state.position++;captureStart=captureEnd=state.position;while((ch=state.input.charCodeAt(state.position))!==0){if(ch===0x27/* ' */){captureSegment(state,captureStart,state.position,true);ch=state.input.charCodeAt(++state.position);if(ch===0x27/* ' */){captureStart=state.position;state.position++;captureEnd=state.position;}else{return true;}}else if(is_EOL(ch)){captureSegment(state,captureStart,captureEnd,true);writeFoldedLines(state,skipSeparationSpace(state,false,nodeIndent));captureStart=captureEnd=state.position;}else if(state.position===state.lineStart&&testDocumentSeparator(state)){throwError(state,'unexpected end of the document within a single quoted scalar');}else{state.position++;captureEnd=state.position;}}throwError(state,'unexpected end of the stream within a single quoted scalar');}function readDoubleQuotedScalar(state,nodeIndent){var captureStart,captureEnd,hexLength,hexResult,tmp,ch;ch=state.input.charCodeAt(state.position);if(ch!==0x22/* " */){return false;}state.kind='scalar';state.result='';state.position++;captureStart=captureEnd=state.position;while((ch=state.input.charCodeAt(state.position))!==0){if(ch===0x22/* " */){captureSegment(state,captureStart,state.position,true);state.position++;return true;}else if(ch===0x5C/* \ */){captureSegment(state,captureStart,state.position,true);ch=state.input.charCodeAt(++state.position);if(is_EOL(ch)){skipSeparationSpace(state,false,nodeIndent);// TODO: rework to inline fn with no type cast? }else if(ch<256&&simpleEscapeCheck[ch]){state.result+=simpleEscapeMap[ch];state.position++;}else if((tmp=escapedHexLen(ch))>0){hexLength=tmp;hexResult=0;for(;hexLength>0;hexLength--){ch=state.input.charCodeAt(++state.position);if((tmp=fromHexCode(ch))>=0){hexResult=(hexResult<<4)+tmp;}else{throwError(state,'expected hexadecimal character');}}state.result+=charFromCodepoint(hexResult);state.position++;}else{throwError(state,'unknown escape sequence');}captureStart=captureEnd=state.position;}else if(is_EOL(ch)){captureSegment(state,captureStart,captureEnd,true);writeFoldedLines(state,skipSeparationSpace(state,false,nodeIndent));captureStart=captureEnd=state.position;}else if(state.position===state.lineStart&&testDocumentSeparator(state)){throwError(state,'unexpected end of the document within a double quoted scalar');}else{state.position++;captureEnd=state.position;}}throwError(state,'unexpected end of the stream within a double quoted scalar');}function readFlowCollection(state,nodeIndent){var readNext=true,_line,_tag=state.tag,_result,_anchor=state.anchor,following,terminator,isPair,isExplicitPair,isMapping,overridableKeys={},keyNode,keyTag,valueNode,ch;ch=state.input.charCodeAt(state.position);if(ch===0x5B/* [ */){terminator=0x5D;/* ] */isMapping=false;_result=[];}else if(ch===0x7B/* { */){terminator=0x7D;/* } */isMapping=true;_result={};}else{return false;}if(state.anchor!==null){state.anchorMap[state.anchor]=_result;}ch=state.input.charCodeAt(++state.position);while(ch!==0){skipSeparationSpace(state,true,nodeIndent);ch=state.input.charCodeAt(state.position);if(ch===terminator){state.position++;state.tag=_tag;state.anchor=_anchor;state.kind=isMapping?'mapping':'sequence';state.result=_result;return true;}else if(!readNext){throwError(state,'missed comma between flow collection entries');}keyTag=keyNode=valueNode=null;isPair=isExplicitPair=false;if(ch===0x3F/* ? */){following=state.input.charCodeAt(state.position+1);if(is_WS_OR_EOL(following)){isPair=isExplicitPair=true;state.position++;skipSeparationSpace(state,true,nodeIndent);}}_line=state.line;composeNode(state,nodeIndent,CONTEXT_FLOW_IN,false,true);keyTag=state.tag;keyNode=state.result;skipSeparationSpace(state,true,nodeIndent);ch=state.input.charCodeAt(state.position);if((isExplicitPair||state.line===_line)&&ch===0x3A/* : */){isPair=true;ch=state.input.charCodeAt(++state.position);skipSeparationSpace(state,true,nodeIndent);composeNode(state,nodeIndent,CONTEXT_FLOW_IN,false,true);valueNode=state.result;}if(isMapping){storeMappingPair(state,_result,overridableKeys,keyTag,keyNode,valueNode);}else if(isPair){_result.push(storeMappingPair(state,null,overridableKeys,keyTag,keyNode,valueNode));}else{_result.push(keyNode);}skipSeparationSpace(state,true,nodeIndent);ch=state.input.charCodeAt(state.position);if(ch===0x2C/* , */){readNext=true;ch=state.input.charCodeAt(++state.position);}else{readNext=false;}}throwError(state,'unexpected end of the stream within a flow collection');}function readBlockScalar(state,nodeIndent){var captureStart,folding,chomping=CHOMPING_CLIP,didReadContent=false,detectedIndent=false,textIndent=nodeIndent,emptyLines=0,atMoreIndented=false,tmp,ch;ch=state.input.charCodeAt(state.position);if(ch===0x7C/* | */){folding=false;}else if(ch===0x3E/* > */){folding=true;}else{return false;}state.kind='scalar';state.result='';while(ch!==0){ch=state.input.charCodeAt(++state.position);if(ch===0x2B/* + */||ch===0x2D/* - */){if(CHOMPING_CLIP===chomping){chomping=ch===0x2B/* + */?CHOMPING_KEEP:CHOMPING_STRIP;}else{throwError(state,'repeat of a chomping mode identifier');}}else if((tmp=fromDecimalCode(ch))>=0){if(tmp===0){throwError(state,'bad explicit indentation width of a block scalar; it cannot be less than one');}else if(!detectedIndent){textIndent=nodeIndent+tmp-1;detectedIndent=true;}else{throwError(state,'repeat of an indentation width identifier');}}else{break;}}if(is_WHITE_SPACE(ch)){do{ch=state.input.charCodeAt(++state.position);}while(is_WHITE_SPACE(ch));if(ch===0x23/* # */){do{ch=state.input.charCodeAt(++state.position);}while(!is_EOL(ch)&&ch!==0);}}while(ch!==0){readLineBreak(state);state.lineIndent=0;ch=state.input.charCodeAt(state.position);while((!detectedIndent||state.lineIndenttextIndent){textIndent=state.lineIndent;}if(is_EOL(ch)){emptyLines++;continue;}// End of the scalar. if(state.lineIndentnodeIndent)&&ch!==0){throwError(state,'bad indentation of a sequence entry');}else if(state.lineIndentnodeIndent){if(composeNode(state,nodeIndent,CONTEXT_BLOCK_OUT,true,allowCompact)){if(atExplicitKey){keyNode=state.result;}else{valueNode=state.result;}}if(!atExplicitKey){storeMappingPair(state,_result,overridableKeys,keyTag,keyNode,valueNode,_line,_pos);keyTag=keyNode=valueNode=null;}skipSeparationSpace(state,true,-1);ch=state.input.charCodeAt(state.position);}if(state.lineIndent>nodeIndent&&ch!==0){throwError(state,'bad indentation of a mapping entry');}else if(state.lineIndent */);if(state.positionparent, 0: this=parent, -1: thisparentIndent){indentStatus=1;}else if(state.lineIndent===parentIndent){indentStatus=0;}else if(state.lineIndentparentIndent){indentStatus=1;}else if(state.lineIndent===parentIndent){indentStatus=0;}else if(state.lineIndent tag; it should be "'+type.kind+'", not "'+state.kind+'"');}if(!type.resolve(state.result)){// `state.result` updated in resolver if matched throwError(state,'cannot resolve a node with !<'+state.tag+'> explicit tag');}else{state.result=type.construct(state.result);if(state.anchor!==null){state.anchorMap[state.anchor]=state.result;}}}else{throwError(state,'unknown tag !<'+state.tag+'>');}}if(state.listener!==null){state.listener('close',state);}return state.tag!==null||state.anchor!==null||hasContent;}function readDocument(state){var documentStart=state.position,_position,directiveName,directiveArgs,hasDirectives=false,ch;state.version=null;state.checkLineBreaks=state.legacy;state.tagMap={};state.anchorMap={};while((ch=state.input.charCodeAt(state.position))!==0){skipSeparationSpace(state,true,-1);ch=state.input.charCodeAt(state.position);if(state.lineIndent>0||ch!==0x25/* % */){break;}hasDirectives=true;ch=state.input.charCodeAt(++state.position);_position=state.position;while(ch!==0&&!is_WS_OR_EOL(ch)){ch=state.input.charCodeAt(++state.position);}directiveName=state.input.slice(_position,state.position);directiveArgs=[];if(directiveName.length<1){throwError(state,'directive name must not be less than one character in length');}while(ch!==0){while(is_WHITE_SPACE(ch)){ch=state.input.charCodeAt(++state.position);}if(ch===0x23/* # */){do{ch=state.input.charCodeAt(++state.position);}while(ch!==0&&!is_EOL(ch));break;}if(is_EOL(ch))break;_position=state.position;while(ch!==0&&!is_WS_OR_EOL(ch)){ch=state.input.charCodeAt(++state.position);}directiveArgs.push(state.input.slice(_position,state.position));}if(ch!==0)readLineBreak(state);if(_hasOwnProperty.call(directiveHandlers,directiveName)){directiveHandlers[directiveName](state,directiveName,directiveArgs);}else{throwWarning(state,'unknown document directive "'+directiveName+'"');}}skipSeparationSpace(state,true,-1);if(state.lineIndent===0&&state.input.charCodeAt(state.position)===0x2D/* - */&&state.input.charCodeAt(state.position+1)===0x2D/* - */&&state.input.charCodeAt(state.position+2)===0x2D/* - */){state.position+=3;skipSeparationSpace(state,true,-1);}else if(hasDirectives){throwError(state,'directives end mark is expected');}composeNode(state,state.lineIndent-1,CONTEXT_BLOCK_OUT,false,true);skipSeparationSpace(state,true,-1);if(state.checkLineBreaks&&PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart,state.position))){throwWarning(state,'non-ASCII line breaks are interpreted as content');}state.documents.push(state.result);if(state.position===state.lineStart&&testDocumentSeparator(state)){if(state.input.charCodeAt(state.position)===0x2E/* . */){state.position+=3;skipSeparationSpace(state,true,-1);}return;}if(state.position0&&"\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(start-1))===-1){start-=1;if(this.position-start>maxLength/2-1){head=' ... ';start+=5;break;}}tail='';end=this.position;while(endmaxLength/2-1){tail=' ... ';end-=5;break;}}snippet=this.buffer.slice(start,end);return common.repeat(' ',indent)+head+snippet+tail+'\n'+common.repeat(' ',indent+this.position-start+head.length)+'^';};Mark.prototype.toString=function toString(compact){var snippet,where='';if(this.name){where+='in "'+this.name+'" ';}where+='at line '+(this.line+1)+', column '+(this.column+1);if(!compact){snippet=this.getSnippet();if(snippet){where+=':\n'+snippet;}}return where;};module.exports=Mark;},{"./common":19}],24:[function(require,module,exports){'use strict';/*eslint-disable max-len*/var common=require('./common');var YAMLException=require('./exception');var Type=require('./type');function compileList(schema,name,result){var exclude=[];schema.include.forEach(function(includedSchema){result=compileList(includedSchema,name,result);});schema[name].forEach(function(currentType){result.forEach(function(previousType,previousIndex){if(previousType.tag===currentType.tag&&previousType.kind===currentType.kind){exclude.push(previousIndex);}});result.push(currentType);});return result.filter(function(type,index){return exclude.indexOf(index)===-1;});}function compileMap()/* lists... */{var result={scalar:{},sequence:{},mapping:{},fallback:{}},index,length;function collectType(type){result[type.kind][type.tag]=result['fallback'][type.tag]=type;}for(index=0,length=arguments.length;index [ padding, CR, LF ] var BASE64_MAP='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';function resolveYamlBinary(data){if(data===null)return false;var code,idx,bitlen=0,max=data.length,map=BASE64_MAP;// Convert one by one. for(idx=0;idx64)continue;// Fail on illegal characters if(code<0)return false;bitlen+=6;}// If there are any bits left, source was corrupted return bitlen%8===0;}function constructYamlBinary(data){var idx,tailbits,input=data.replace(/[\r\n=]/g,''),// remove CR/LF & padding to simplify scan max=input.length,map=BASE64_MAP,bits=0,result=[];// Collect by 6*4 bits (3 bytes) for(idx=0;idx>16&0xFF);result.push(bits>>8&0xFF);result.push(bits&0xFF);}bits=bits<<6|map.indexOf(input.charAt(idx));}// Dump tail tailbits=max%4*6;if(tailbits===0){result.push(bits>>16&0xFF);result.push(bits>>8&0xFF);result.push(bits&0xFF);}else if(tailbits===18){result.push(bits>>10&0xFF);result.push(bits>>2&0xFF);}else if(tailbits===12){result.push(bits>>4&0xFF);}// Wrap into Buffer for NodeJS and leave Array for browser if(NodeBuffer){// Support node 6.+ Buffer API when available return NodeBuffer.from?NodeBuffer.from(result):new NodeBuffer(result);}return result;}function representYamlBinary(object/*, style*/){var result='',bits=0,idx,tail,max=object.length,map=BASE64_MAP;// Convert every three bytes to 4 ASCII characters. for(idx=0;idx>18&0x3F];result+=map[bits>>12&0x3F];result+=map[bits>>6&0x3F];result+=map[bits&0x3F];}bits=(bits<<8)+object[idx];}// Dump tail tail=max%3;if(tail===0){result+=map[bits>>18&0x3F];result+=map[bits>>12&0x3F];result+=map[bits>>6&0x3F];result+=map[bits&0x3F];}else if(tail===2){result+=map[bits>>10&0x3F];result+=map[bits>>4&0x3F];result+=map[bits<<2&0x3F];result+=map[64];}else if(tail===1){result+=map[bits>>2&0x3F];result+=map[bits<<4&0x3F];result+=map[64];result+=map[64];}return result;}function isBinary(object){return NodeBuffer&&NodeBuffer.isBuffer(object);}module.exports=new Type('tag:yaml.org,2002:binary',{kind:'scalar',resolve:resolveYamlBinary,construct:constructYamlBinary,predicate:isBinary,represent:representYamlBinary});},{"../type":30}],32:[function(require,module,exports){'use strict';var Type=require('../type');function resolveYamlBoolean(data){if(data===null)return false;var max=data.length;return max===4&&(data==='true'||data==='True'||data==='TRUE')||max===5&&(data==='false'||data==='False'||data==='FALSE');}function constructYamlBoolean(data){return data==='true'||data==='True'||data==='TRUE';}function isBoolean(object){return Object.prototype.toString.call(object)==='[object Boolean]';}module.exports=new Type('tag:yaml.org,2002:bool',{kind:'scalar',resolve:resolveYamlBoolean,construct:constructYamlBoolean,predicate:isBoolean,represent:{lowercase:function lowercase(object){return object?'true':'false';},uppercase:function uppercase(object){return object?'TRUE':'FALSE';},camelcase:function camelcase(object){return object?'True':'False';}},defaultStyle:'lowercase'});},{"../type":30}],33:[function(require,module,exports){'use strict';var common=require('../common');var Type=require('../type');var YAML_FLOAT_PATTERN=new RegExp(// 2.5e4, 2.5 and integers '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?'+// .2e4, .2 // special case, seems not from spec '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?'+// 20:59 '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*'+// .inf '|[-+]?\\.(?:inf|Inf|INF)'+// .nan '|\\.(?:nan|NaN|NAN))$');function resolveYamlFloat(data){if(data===null)return false;if(!YAML_FLOAT_PATTERN.test(data)||// Quick hack to not allow integers end with `_` // Probably should update regexp & check speed data[data.length-1]==='_'){return false;}return true;}function constructYamlFloat(data){var value,sign,base,digits;value=data.replace(/_/g,'').toLowerCase();sign=value[0]==='-'?-1:1;digits=[];if('+-'.indexOf(value[0])>=0){value=value.slice(1);}if(value==='.inf'){return sign===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;}else if(value==='.nan'){return NaN;}else if(value.indexOf(':')>=0){value.split(':').forEach(function(v){digits.unshift(parseFloat(v,10));});value=0.0;base=1;digits.forEach(function(d){value+=d*base;base*=60;});return sign*value;}return sign*parseFloat(value,10);}var SCIENTIFIC_WITHOUT_DOT=/^[-+]?[0-9]+e/;function representYamlFloat(object,style){var res;if(isNaN(object)){switch(style){case'lowercase':return'.nan';case'uppercase':return'.NAN';case'camelcase':return'.NaN';}}else if(Number.POSITIVE_INFINITY===object){switch(style){case'lowercase':return'.inf';case'uppercase':return'.INF';case'camelcase':return'.Inf';}}else if(Number.NEGATIVE_INFINITY===object){switch(style){case'lowercase':return'-.inf';case'uppercase':return'-.INF';case'camelcase':return'-.Inf';}}else if(common.isNegativeZero(object)){return'-0.0';}res=object.toString(10);// JS stringifier can build scientific format without dots: 5e-100, // while YAML requres dot: 5.e-100. Fix it with simple hack return SCIENTIFIC_WITHOUT_DOT.test(res)?res.replace('e','.e'):res;}function isFloat(object){return Object.prototype.toString.call(object)==='[object Number]'&&(object%1!==0||common.isNegativeZero(object));}module.exports=new Type('tag:yaml.org,2002:float',{kind:'scalar',resolve:resolveYamlFloat,construct:constructYamlFloat,predicate:isFloat,represent:representYamlFloat,defaultStyle:'lowercase'});},{"../common":19,"../type":30}],34:[function(require,module,exports){'use strict';var common=require('../common');var Type=require('../type');function isHexCode(c){return 0x30/* 0 */<=c&&c<=0x39/* 9 */||0x41/* A */<=c&&c<=0x46/* F */||0x61/* a */<=c&&c<=0x66/* f */;}function isOctCode(c){return 0x30/* 0 */<=c&&c<=0x37/* 7 */;}function isDecCode(c){return 0x30/* 0 */<=c&&c<=0x39/* 9 */;}function resolveYamlInteger(data){if(data===null)return false;var max=data.length,index=0,hasDigits=false,ch;if(!max)return false;ch=data[index];// sign if(ch==='-'||ch==='+'){ch=data[++index];}if(ch==='0'){// 0 if(index+1===max)return true;ch=data[++index];// base 2, base 8, base 16 if(ch==='b'){// base 2 index++;for(;index=0?'0b'+obj.toString(2):'-0b'+obj.toString(2).slice(1);},octal:function octal(obj){return obj>=0?'0'+obj.toString(8):'-0'+obj.toString(8).slice(1);},decimal:function decimal(obj){return obj.toString(10);},/* eslint-disable max-len */hexadecimal:function hexadecimal(obj){return obj>=0?'0x'+obj.toString(16).toUpperCase():'-0x'+obj.toString(16).toUpperCase().slice(1);}},defaultStyle:'decimal',styleAliases:{binary:[2,'bin'],octal:[8,'oct'],decimal:[10,'dec'],hexadecimal:[16,'hex']}});},{"../common":19,"../type":30}],35:[function(require,module,exports){'use strict';var esprima;// Browserified version does not have esprima // // 1. For node.js just require module as deps // 2. For browser try to require mudule via external AMD system. // If not found - try to fallback to window.esprima. If not // found too - then fail to parse. // try{// workaround to exclude package from browserify list. var _require=require;esprima=_require('esprima');}catch(_){/*global window */if(typeof window!=='undefined')esprima=window.esprima;}var Type=require('../../type');function resolveJavascriptFunction(data){if(data===null)return false;try{var source='('+data+')',ast=esprima.parse(source,{range:true});if(ast.type!=='Program'||ast.body.length!==1||ast.body[0].type!=='ExpressionStatement'||ast.body[0].expression.type!=='ArrowFunctionExpression'&&ast.body[0].expression.type!=='FunctionExpression'){return false;}return true;}catch(err){return false;}}function constructJavascriptFunction(data){/*jslint evil:true*/var source='('+data+')',ast=esprima.parse(source,{range:true}),params=[],body;if(ast.type!=='Program'||ast.body.length!==1||ast.body[0].type!=='ExpressionStatement'||ast.body[0].expression.type!=='ArrowFunctionExpression'&&ast.body[0].expression.type!=='FunctionExpression'){throw new Error('Failed to resolve function');}ast.body[0].expression.params.forEach(function(param){params.push(param.name);});body=ast.body[0].expression.body.range;// Esprima's ranges include the first '{' and the last '}' characters on // function expressions. So cut them out. if(ast.body[0].expression.body.type==='BlockStatement'){/*eslint-disable no-new-func*/return new Function(params,source.slice(body[0]+1,body[1]-1));}// ES6 arrow functions can omit the BlockStatement. In that case, just return // the body. /*eslint-disable no-new-func*/return new Function(params,'return '+source.slice(body[0],body[1]));}function representJavascriptFunction(object/*, style*/){return object.toString();}function isFunction(object){return Object.prototype.toString.call(object)==='[object Function]';}module.exports=new Type('tag:yaml.org,2002:js/function',{kind:'scalar',resolve:resolveJavascriptFunction,construct:constructJavascriptFunction,predicate:isFunction,represent:representJavascriptFunction});},{"../../type":30}],36:[function(require,module,exports){'use strict';var Type=require('../../type');function resolveJavascriptRegExp(data){if(data===null)return false;if(data.length===0)return false;var regexp=data,tail=/\/([gim]*)$/.exec(data),modifiers='';// if regexp starts with '/' it can have modifiers and must be properly closed // `/foo/gim` - modifiers tail can be maximum 3 chars if(regexp[0]==='/'){if(tail)modifiers=tail[1];if(modifiers.length>3)return false;// if expression starts with /, is should be properly terminated if(regexp[regexp.length-modifiers.length-1]!=='/')return false;}return true;}function constructJavascriptRegExp(data){var regexp=data,tail=/\/([gim]*)$/.exec(data),modifiers='';// `/foo/gim` - tail can be maximum 4 chars if(regexp[0]==='/'){if(tail)modifiers=tail[1];regexp=regexp.slice(1,regexp.length-modifiers.length-1);}return new RegExp(regexp,modifiers);}function representJavascriptRegExp(object/*, style*/){var result='/'+object.source+'/';if(object.global)result+='g';if(object.multiline)result+='m';if(object.ignoreCase)result+='i';return result;}function isRegExp(object){return Object.prototype.toString.call(object)==='[object RegExp]';}module.exports=new Type('tag:yaml.org,2002:js/regexp',{kind:'scalar',resolve:resolveJavascriptRegExp,construct:constructJavascriptRegExp,predicate:isRegExp,represent:representJavascriptRegExp});},{"../../type":30}],37:[function(require,module,exports){'use strict';var Type=require('../../type');function resolveJavascriptUndefined(){return true;}function constructJavascriptUndefined(){/*eslint-disable no-undefined*/return undefined;}function representJavascriptUndefined(){return'';}function isUndefined(object){return typeof object==='undefined';}module.exports=new Type('tag:yaml.org,2002:js/undefined',{kind:'scalar',resolve:resolveJavascriptUndefined,construct:constructJavascriptUndefined,predicate:isUndefined,represent:representJavascriptUndefined});},{"../../type":30}],38:[function(require,module,exports){'use strict';var Type=require('../type');module.exports=new Type('tag:yaml.org,2002:map',{kind:'mapping',construct:function construct(data){return data!==null?data:{};}});},{"../type":30}],39:[function(require,module,exports){'use strict';var Type=require('../type');function resolveYamlMerge(data){return data==='<<'||data===null;}module.exports=new Type('tag:yaml.org,2002:merge',{kind:'scalar',resolve:resolveYamlMerge});},{"../type":30}],40:[function(require,module,exports){'use strict';var Type=require('../type');function resolveYamlNull(data){if(data===null)return true;var max=data.length;return max===1&&data==='~'||max===4&&(data==='null'||data==='Null'||data==='NULL');}function constructYamlNull(){return null;}function isNull(object){return object===null;}module.exports=new Type('tag:yaml.org,2002:null',{kind:'scalar',resolve:resolveYamlNull,construct:constructYamlNull,predicate:isNull,represent:{canonical:function canonical(){return'~';},lowercase:function lowercase(){return'null';},uppercase:function uppercase(){return'NULL';},camelcase:function camelcase(){return'Null';}},defaultStyle:'lowercase'});},{"../type":30}],41:[function(require,module,exports){'use strict';var Type=require('../type');var _hasOwnProperty=Object.prototype.hasOwnProperty;var _toString=Object.prototype.toString;function resolveYamlOmap(data){if(data===null)return true;var objectKeys=[],index,length,pair,pairKey,pairHasKey,object=data;for(index=0,length=object.length;index0){var thisPos=stack.indexOf(this);~thisPos?stack.splice(thisPos+1):stack.push(this);~thisPos?keys.splice(thisPos,Infinity,key):keys.push(key);if(~stack.indexOf(value))value=cycleReplacer.call(this,key,value);}else stack.push(value);return replacer==null?value:replacer.call(this,key,value);};}},{}],48:[function(require,module,exports){var getNative=require('./_getNative'),root=require('./_root');/* Built-in method references that are verified to be native. */var DataView=getNative(root,'DataView');module.exports=DataView;},{"./_getNative":112,"./_root":149}],49:[function(require,module,exports){var hashClear=require('./_hashClear'),hashDelete=require('./_hashDelete'),hashGet=require('./_hashGet'),hashHas=require('./_hashHas'),hashSet=require('./_hashSet');/** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */function Hash(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;customizer=assigner.length>3&&typeof customizer=='function'?(length--,customizer):undefined;if(guard&&isIterateeCall(sources[0],sources[1],guard)){customizer=length<3?undefined:customizer;length=1;}object=Object(object);while(++indexarrLength)){return false;}// Assume cyclic values are equal. var stacked=stack.get(array);if(stacked&&stack.get(other)){return stacked==other;}var index=-1,result=true,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache():undefined;stack.set(array,other);stack.set(other,array);// Ignore non-index properties. while(++index-1&&value%1==0&&value-1;}module.exports=listCacheHas;},{"./_assocIndexOf":68}],134:[function(require,module,exports){var assocIndexOf=require('./_assocIndexOf');/** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){++this.size;data.push([key,value]);}else{data[index][1]=value;}return this;}module.exports=listCacheSet;},{"./_assocIndexOf":68}],135:[function(require,module,exports){var Hash=require('./_Hash'),ListCache=require('./_ListCache'),Map=require('./_Map');/** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}module.exports=mapCacheClear;},{"./_Hash":49,"./_ListCache":50,"./_Map":51}],136:[function(require,module,exports){var getMapData=require('./_getMapData');/** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */function mapCacheDelete(key){var result=getMapData(this,key)['delete'](key);this.size-=result?1:0;return result;}module.exports=mapCacheDelete;},{"./_getMapData":110}],137:[function(require,module,exports){var getMapData=require('./_getMapData');/** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */function mapCacheGet(key){return getMapData(this,key).get(key);}module.exports=mapCacheGet;},{"./_getMapData":110}],138:[function(require,module,exports){var getMapData=require('./_getMapData');/** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */function mapCacheHas(key){return getMapData(this,key).has(key);}module.exports=mapCacheHas;},{"./_getMapData":110}],139:[function(require,module,exports){var getMapData=require('./_getMapData');/** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */function mapCacheSet(key,value){var data=getMapData(this,key),size=data.size;data.set(key,value);this.size+=data.size==size?0:1;return this;}module.exports=mapCacheSet;},{"./_getMapData":110}],140:[function(require,module,exports){/** * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. * @returns {Array} Returns the key-value pairs. */function mapToArray(map){var index=-1,result=Array(map.size);map.forEach(function(value,key){result[++index]=[key,value];});return result;}module.exports=mapToArray;},{}],141:[function(require,module,exports){/** * A specialized version of `matchesProperty` for source values suitable * for strict equality comparisons, i.e. `===`. * * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */function matchesStrictComparable(key,srcValue){return function(object){if(object==null){return false;}return object[key]===srcValue&&(srcValue!==undefined||key in Object(object));};}module.exports=matchesStrictComparable;},{}],142:[function(require,module,exports){var memoize=require('./memoize');/** Used as the maximum memoize cache size. */var MAX_MEMOIZE_SIZE=500;/** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */function memoizeCapped(func){var result=memoize(func,function(key){if(cache.size===MAX_MEMOIZE_SIZE){cache.clear();}return key;});var cache=result.cache;return result;}module.exports=memoizeCapped;},{"./memoize":183}],143:[function(require,module,exports){var getNative=require('./_getNative');/* Built-in method references that are verified to be native. */var nativeCreate=getNative(Object,'create');module.exports=nativeCreate;},{"./_getNative":112}],144:[function(require,module,exports){var overArg=require('./_overArg');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeKeys=overArg(Object.keys,Object);module.exports=nativeKeys;},{"./_overArg":147}],145:[function(require,module,exports){var freeGlobal=require('./_freeGlobal');/** Detect free variable `exports`. */var freeExports=(typeof exports==="undefined"?"undefined":_typeof2(exports))=='object'&&exports&&!exports.nodeType&&exports;/** Detect free variable `module`. */var freeModule=freeExports&&(typeof module==="undefined"?"undefined":_typeof2(module))=='object'&&module&&!module.nodeType&&module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports=freeModule&&freeModule.exports===freeExports;/** Detect free variable `process` from Node.js. */var freeProcess=moduleExports&&freeGlobal.process;/** Used to access faster Node.js helpers. */var nodeUtil=function(){try{// Use `util.types` for Node.js 10+. var types=freeModule&&freeModule.require&&freeModule.require('util').types;if(types){return types;}// Legacy `process.binding('util')` for Node.js < 10. return freeProcess&&freeProcess.binding&&freeProcess.binding('util');}catch(e){}}();module.exports=nodeUtil;},{"./_freeGlobal":108}],146:[function(require,module,exports){/** Used for built-in method references. */var objectProto=Object.prototype;/** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */var nativeObjectToString=objectProto.toString;/** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */function objectToString(value){return nativeObjectToString.call(value);}module.exports=objectToString;},{}],147:[function(require,module,exports){/** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */function overArg(func,transform){return function(arg){return func(transform(arg));};}module.exports=overArg;},{}],148:[function(require,module,exports){var apply=require('./_apply');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax=Math.max;/** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */function overRest(func,start,transform){start=nativeMax(start===undefined?func.length-1:start,0);return function(){var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);while(++index0){if(++count>=HOT_COUNT){return arguments[0];}}else{count=0;}return func.apply(undefined,arguments);};}module.exports=shortOut;},{}],155:[function(require,module,exports){var ListCache=require('./_ListCache');/** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */function stackClear(){this.__data__=new ListCache();this.size=0;}module.exports=stackClear;},{"./_ListCache":50}],156:[function(require,module,exports){/** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */function stackDelete(key){var data=this.__data__,result=data['delete'](key);this.size=data.size;return result;}module.exports=stackDelete;},{}],157:[function(require,module,exports){/** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */function stackGet(key){return this.__data__.get(key);}module.exports=stackGet;},{}],158:[function(require,module,exports){/** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */function stackHas(key){return this.__data__.has(key);}module.exports=stackHas;},{}],159:[function(require,module,exports){var ListCache=require('./_ListCache'),Map=require('./_Map'),MapCache=require('./_MapCache');/** Used as the size to enable large array optimizations. */var LARGE_ARRAY_SIZE=200;/** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */function stackSet(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length { 'a': 1, 'c': 3 } */var assign=createAssigner(function(object,source){if(isPrototype(source)||isArrayLike(source)){copyObject(source,keys(source),object);return;}for(var key in source){if(hasOwnProperty.call(source,key)){assignValue(object,key,source[key]);}}});module.exports=assign;},{"./_assignValue":67,"./_copyObject":99,"./_createAssigner":101,"./_isPrototype":128,"./isArrayLike":173,"./keys":182}],164:[function(require,module,exports){/** * Creates a function that returns `value`. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. * @returns {Function} Returns the new constant function. * @example * * var objects = _.times(2, _.constant({ 'a': 1 })); * * console.log(objects); * // => [{ 'a': 1 }, { 'a': 1 }] * * console.log(objects[0] === objects[1]); * // => true */function constant(value){return function(){return value;};}module.exports=constant;},{}],165:[function(require,module,exports){var baseAssign=require('./_baseAssign'),baseCreate=require('./_baseCreate');/** * Creates an object that inherits from the `prototype` object. If a * `properties` object is given, its own enumerable string keyed properties * are assigned to the created object. * * @static * @memberOf _ * @since 2.3.0 * @category Object * @param {Object} prototype The object to inherit from. * @param {Object} [properties] The properties to assign to the object. * @returns {Object} Returns the new object. * @example * * function Shape() { * this.x = 0; * this.y = 0; * } * * function Circle() { * Shape.call(this); * } * * Circle.prototype = _.create(Shape.prototype, { * 'constructor': Circle * }); * * var circle = new Circle; * circle instanceof Circle; * // => true * * circle instanceof Shape; * // => true */function create(prototype,properties){var result=baseCreate(prototype);return properties==null?result:baseAssign(result,properties);}module.exports=create;},{"./_baseAssign":69,"./_baseCreate":71}],166:[function(require,module,exports){/** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */function eq(value,other){return value===other||value!==value&&other!==other;}module.exports=eq;},{}],167:[function(require,module,exports){var arrayEvery=require('./_arrayEvery'),baseEvery=require('./_baseEvery'),baseIteratee=require('./_baseIteratee'),isArray=require('./isArray'),isIterateeCall=require('./_isIterateeCall');/** * Checks if `predicate` returns truthy for **all** elements of `collection`. * Iteration is stopped once `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index|key, collection). * * **Note:** This method returns `true` for * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of * elements of empty collections. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. * @example * * _.every([true, 1, null, 'yes'], Boolean); * // => false * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.every(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.every(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.every(users, 'active'); * // => false */function every(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;if(guard&&isIterateeCall(collection,predicate,guard)){predicate=undefined;}return func(collection,baseIteratee(predicate,3));}module.exports=every;},{"./_arrayEvery":61,"./_baseEvery":73,"./_baseIteratee":86,"./_isIterateeCall":124,"./isArray":172}],168:[function(require,module,exports){var baseGet=require('./_baseGet');/** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */function get(object,path,defaultValue){var result=object==null?undefined:baseGet(object,path);return result===undefined?defaultValue:result;}module.exports=get;},{"./_baseGet":76}],169:[function(require,module,exports){var baseHasIn=require('./_baseHasIn'),hasPath=require('./_hasPath');/** * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * * _.hasIn(object, 'a.b'); * // => true * * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */function hasIn(object,path){return object!=null&&hasPath(object,path,baseHasIn);}module.exports=hasIn;},{"./_baseHasIn":79,"./_hasPath":117}],170:[function(require,module,exports){/** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */function identity(value){return value;}module.exports=identity;},{}],171:[function(require,module,exports){var baseIsArguments=require('./_baseIsArguments'),isObjectLike=require('./isObjectLike');/** Used for built-in method references. */var objectProto=Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty=objectProto.hasOwnProperty;/** Built-in value references. */var propertyIsEnumerable=objectProto.propertyIsEnumerable;/** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */var isArguments=baseIsArguments(function(){return arguments;}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,'callee')&&!propertyIsEnumerable.call(value,'callee');};module.exports=isArguments;},{"./_baseIsArguments":80,"./isObjectLike":179}],172:[function(require,module,exports){/** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */var isArray=Array.isArray;module.exports=isArray;},{}],173:[function(require,module,exports){var isFunction=require('./isFunction'),isLength=require('./isLength');/** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */function isArrayLike(value){return value!=null&&isLength(value.length)&&!isFunction(value);}module.exports=isArrayLike;},{"./isFunction":176,"./isLength":177}],174:[function(require,module,exports){var root=require('./_root'),stubFalse=require('./stubFalse');/** Detect free variable `exports`. */var freeExports=(typeof exports==="undefined"?"undefined":_typeof2(exports))=='object'&&exports&&!exports.nodeType&&exports;/** Detect free variable `module`. */var freeModule=freeExports&&(typeof module==="undefined"?"undefined":_typeof2(module))=='object'&&module&&!module.nodeType&&module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports=freeModule&&freeModule.exports===freeExports;/** Built-in value references. */var Buffer=moduleExports?root.Buffer:undefined;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeIsBuffer=Buffer?Buffer.isBuffer:undefined;/** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */var isBuffer=nativeIsBuffer||stubFalse;module.exports=isBuffer;},{"./_root":149,"./stubFalse":186}],175:[function(require,module,exports){var baseKeys=require('./_baseKeys'),getTag=require('./_getTag'),isArguments=require('./isArguments'),isArray=require('./isArray'),isArrayLike=require('./isArrayLike'),isBuffer=require('./isBuffer'),isPrototype=require('./_isPrototype'),isTypedArray=require('./isTypedArray');/** `Object#toString` result references. */var mapTag='[object Map]',setTag='[object Set]';/** Used for built-in method references. */var objectProto=Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty=objectProto.hasOwnProperty;/** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * _.isEmpty(null); * // => true * * _.isEmpty(true); * // => true * * _.isEmpty(1); * // => true * * _.isEmpty([1, 2, 3]); * // => false * * _.isEmpty({ 'a': 1 }); * // => false */function isEmpty(value){if(value==null){return true;}if(isArrayLike(value)&&(isArray(value)||typeof value=='string'||typeof value.splice=='function'||isBuffer(value)||isTypedArray(value)||isArguments(value))){return!value.length;}var tag=getTag(value);if(tag==mapTag||tag==setTag){return!value.size;}if(isPrototype(value)){return!baseKeys(value).length;}for(var key in value){if(hasOwnProperty.call(value,key)){return false;}}return true;}module.exports=isEmpty;},{"./_baseKeys":87,"./_getTag":115,"./_isPrototype":128,"./isArguments":171,"./isArray":172,"./isArrayLike":173,"./isBuffer":174,"./isTypedArray":181}],176:[function(require,module,exports){var baseGetTag=require('./_baseGetTag'),isObject=require('./isObject');/** `Object#toString` result references. */var asyncTag='[object AsyncFunction]',funcTag='[object Function]',genTag='[object GeneratorFunction]',proxyTag='[object Proxy]';/** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */function isFunction(value){if(!isObject(value)){return false;}// The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag;}module.exports=isFunction;},{"./_baseGetTag":78,"./isObject":178}],177:[function(require,module,exports){/** Used as references for various `Number` constants. */var MAX_SAFE_INTEGER=9007199254740991;/** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */function isLength(value){return typeof value=='number'&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER;}module.exports=isLength;},{}],178:[function(require,module,exports){/** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */function isObject(value){var type=typeof value==="undefined"?"undefined":_typeof2(value);return value!=null&&(type=='object'||type=='function');}module.exports=isObject;},{}],179:[function(require,module,exports){/** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */function isObjectLike(value){return value!=null&&(typeof value==="undefined"?"undefined":_typeof2(value))=='object';}module.exports=isObjectLike;},{}],180:[function(require,module,exports){var baseGetTag=require('./_baseGetTag'),isObjectLike=require('./isObjectLike');/** `Object#toString` result references. */var symbolTag='[object Symbol]';/** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */function isSymbol(value){return(typeof value==="undefined"?"undefined":_typeof2(value))=='symbol'||isObjectLike(value)&&baseGetTag(value)==symbolTag;}module.exports=isSymbol;},{"./_baseGetTag":78,"./isObjectLike":179}],181:[function(require,module,exports){var baseIsTypedArray=require('./_baseIsTypedArray'),baseUnary=require('./_baseUnary'),nodeUtil=require('./_nodeUtil');/* Node.js helper references. */var nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;/** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */var isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;module.exports=isTypedArray;},{"./_baseIsTypedArray":85,"./_baseUnary":96,"./_nodeUtil":145}],182:[function(require,module,exports){var arrayLikeKeys=require('./_arrayLikeKeys'),baseKeys=require('./_baseKeys'),isArrayLike=require('./isArrayLike');/** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object);}module.exports=keys;},{"./_arrayLikeKeys":63,"./_baseKeys":87,"./isArrayLike":173}],183:[function(require,module,exports){var MapCache=require('./_MapCache');/** Error message constants. */var FUNC_ERROR_TEXT='Expected a function';/** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */function memoize(func,resolver){if(typeof func!='function'||resolver!=null&&typeof resolver!='function'){throw new TypeError(FUNC_ERROR_TEXT);}var memoized=function memoized(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key)){return cache.get(key);}var result=func.apply(this,args);memoized.cache=cache.set(key,result)||cache;return result;};memoized.cache=new(memoize.Cache||MapCache)();return memoized;}// Expose `MapCache`. memoize.Cache=MapCache;module.exports=memoize;},{"./_MapCache":52}],184:[function(require,module,exports){var baseProperty=require('./_baseProperty'),basePropertyDeep=require('./_basePropertyDeep'),isKey=require('./_isKey'),toKey=require('./_toKey');/** * Creates a function that returns the value at `path` of a given object. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. * @example * * var objects = [ * { 'a': { 'b': 2 } }, * { 'a': { 'b': 1 } } * ]; * * _.map(objects, _.property('a.b')); * // => [2, 1] * * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); * // => [1, 2] */function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path);}module.exports=property;},{"./_baseProperty":90,"./_basePropertyDeep":91,"./_isKey":125,"./_toKey":161}],185:[function(require,module,exports){/** * This method returns a new empty array. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {Array} Returns the new empty array. * @example * * var arrays = _.times(2, _.stubArray); * * console.log(arrays); * // => [[], []] * * console.log(arrays[0] === arrays[1]); * // => false */function stubArray(){return[];}module.exports=stubArray;},{}],186:[function(require,module,exports){/** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */function stubFalse(){return false;}module.exports=stubFalse;},{}],187:[function(require,module,exports){var baseToString=require('./_baseToString');/** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */function toString(value){return value==null?'':baseToString(value);}module.exports=toString;},{"./_baseToString":95}],188:[function(require,module,exports){(function(process){'use strict';if(!process.version||process.version.indexOf('v0.')===0||process.version.indexOf('v1.')===0&&process.version.indexOf('v1.8.')!==0){module.exports={nextTick:nextTick};}else{module.exports=process;}function nextTick(fn,arg1,arg2,arg3){if(typeof fn!=='function'){throw new TypeError('"callback" argument must be a function');}var len=arguments.length;var args,i;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function afterTickOne(){fn.call(null,arg1);});case 3:return process.nextTick(function afterTickTwo(){fn.call(null,arg1,arg2);});case 4:return process.nextTick(function afterTickThree(){fn.call(null,arg1,arg2,arg3);});default:args=new Array(len-1);i=0;while(i1){for(var i=1;i*/var pna=require('process-nextick-args');/**//**/var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){keys.push(key);}return keys;};/**/module.exports=Duplex;/**/var util=require('core-util-is');util.inherits=require('inherits');/**/var Readable=require('./_stream_readable');var Writable=require('./_stream_writable');util.inherits(Duplex,Readable);{// avoid scope creep, the keys array can then be collected var keys=objectKeys(Writable.prototype);for(var v=0;v*/var util=require('core-util-is');util.inherits=require('inherits');/**/util.inherits(PassThrough,Transform);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options);}PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk);};},{"./_stream_transform":194,"core-util-is":9,"inherits":14}],193:[function(require,module,exports){(function(process,global){// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict';/**/var pna=require('process-nextick-args');/**/module.exports=Readable;/**/var isArray=require('isarray');/**//**/var Duplex;/**/Readable.ReadableState=ReadableState;/**/var EE=require('events').EventEmitter;var EElistenerCount=function EElistenerCount(emitter,type){return emitter.listeners(type).length;};/**//**/var Stream=require('./internal/streams/stream');/**//**/var Buffer=require('safe-buffer').Buffer;var OurUint8Array=global.Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer.from(chunk);}function _isUint8Array(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array;}/**//**/var util=require('core-util-is');util.inherits=require('inherits');/**//**/var debugUtil=require('util');var debug=void 0;if(debugUtil&&debugUtil.debuglog){debug=debugUtil.debuglog('stream');}else{debug=function debug(){};}/**/var BufferList=require('./internal/streams/BufferList');var destroyImpl=require('./internal/streams/destroy');var StringDecoder;util.inherits(Readable,Stream);var kProxyEvents=['error','close','destroy','pause','resume'];function prependListener(emitter,event,fn){// Sadly this is not cacheable as some libraries bundle their own // event emitter implementation with them. if(typeof emitter.prependListener==='function')return emitter.prependListener(event,fn);// This is a hack to make sure that our error handler is attached before any // userland ones. NEVER DO THIS. This is here only because this code needs // to continue to work with older versions of Node.js that do not include // the prependListener() method. The goal is to eventually remove this hack. if(!emitter._events||!emitter._events[event])emitter.on(event,fn);else if(isArray(emitter._events[event]))emitter._events[event].unshift(fn);else emitter._events[event]=[fn,emitter._events[event]];}function ReadableState(options,stream){Duplex=Duplex||require('./_stream_duplex');options=options||{};// Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. var isDuplex=stream instanceof Duplex;// object stream flag. Used to make read(n) ignore n and to // make all the buffer merging and length checks go away this.objectMode=!!options.objectMode;if(isDuplex)this.objectMode=this.objectMode||!!options.readableObjectMode;// the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" var hwm=options.highWaterMark;var readableHwm=options.readableHighWaterMark;var defaultHwm=this.objectMode?16:16*1024;if(hwm||hwm===0)this.highWaterMark=hwm;else if(isDuplex&&(readableHwm||readableHwm===0))this.highWaterMark=readableHwm;else this.highWaterMark=defaultHwm;// cast to ints. this.highWaterMark=Math.floor(this.highWaterMark);// A linked list is used to store data chunks instead of an array because the // linked list can remove elements from the beginning faster than // array.shift() this.buffer=new BufferList();this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;// a flag to be able to tell if the event 'readable'/'data' is emitted // immediately, or on a later tick. We set this to true at first, because // any actions that shouldn't happen until "later" should generally also // not happen before the first read call. this.sync=true;// whenever we return null, then we set a flag to say // that we're awaiting a 'readable' event emission. this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;// has it been destroyed this.destroyed=false;// Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding=options.defaultEncoding||'utf8';// the number of writers that are awaiting a drain event in .pipe()s this.awaitDrain=0;// if true, a maybeReadMore has been scheduled this.readingMore=false;this.decoder=null;this.encoding=null;if(options.encoding){if(!StringDecoder)StringDecoder=require('string_decoder/').StringDecoder;this.decoder=new StringDecoder(options.encoding);this.encoding=options.encoding;}}function Readable(options){Duplex=Duplex||require('./_stream_duplex');if(!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this);// legacy this.readable=true;if(options){if(typeof options.read==='function')this._read=options.read;if(typeof options.destroy==='function')this._destroy=options.destroy;}Stream.call(this);}Object.defineProperty(Readable.prototype,'destroyed',{get:function get(){if(this._readableState===undefined){return false;}return this._readableState.destroyed;},set:function set(value){// we ignore the value if the stream // has not been initialized yet if(!this._readableState){return;}// backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed=value;}});Readable.prototype.destroy=destroyImpl.destroy;Readable.prototype._undestroy=destroyImpl.undestroy;Readable.prototype._destroy=function(err,cb){this.push(null);cb(err);};// Manually shove something into the read() buffer. // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. Readable.prototype.push=function(chunk,encoding){var state=this._readableState;var skipChunkCheck;if(!state.objectMode){if(typeof chunk==='string'){encoding=encoding||state.defaultEncoding;if(encoding!==state.encoding){chunk=Buffer.from(chunk,encoding);encoding='';}skipChunkCheck=true;}}else{skipChunkCheck=true;}return readableAddChunk(this,chunk,encoding,false,skipChunkCheck);};// Unshift should *always* be something directly out of read() Readable.prototype.unshift=function(chunk){return readableAddChunk(this,chunk,null,true,false);};function readableAddChunk(stream,chunk,encoding,addToFront,skipChunkCheck){var state=stream._readableState;if(chunk===null){state.reading=false;onEofChunk(stream,state);}else{var er;if(!skipChunkCheck)er=chunkInvalid(state,chunk);if(er){stream.emit('error',er);}else if(state.objectMode||chunk&&chunk.length>0){if(typeof chunk!=='string'&&!state.objectMode&&Object.getPrototypeOf(chunk)!==Buffer.prototype){chunk=_uint8ArrayToBuffer(chunk);}if(addToFront){if(state.endEmitted)stream.emit('error',new Error('stream.unshift() after end event'));else addChunk(stream,state,chunk,true);}else if(state.ended){stream.emit('error',new Error('stream.push() after EOF'));}else{state.reading=false;if(state.decoder&&!encoding){chunk=state.decoder.write(chunk);if(state.objectMode||chunk.length!==0)addChunk(stream,state,chunk,false);else maybeReadMore(stream,state);}else{addChunk(stream,state,chunk,false);}}}else if(!addToFront){state.reading=false;}}return needMoreData(state);}function addChunk(stream,state,chunk,addToFront){if(state.flowing&&state.length===0&&!state.sync){stream.emit('data',chunk);stream.read(0);}else{// update the buffer info. state.length+=state.objectMode?1:chunk.length;if(addToFront)state.buffer.unshift(chunk);else state.buffer.push(chunk);if(state.needReadable)emitReadable(stream);}maybeReadMore(stream,state);}function chunkInvalid(state,chunk){var er;if(!_isUint8Array(chunk)&&typeof chunk!=='string'&&chunk!==undefined&&!state.objectMode){er=new TypeError('Invalid non-string/buffer chunk');}return er;}// if it's past the high water mark, we can push in some more. // Also, if we have no data yet, we can stand some // more bytes. This is to work around cases where hwm=0, // such as the repl. Also, if the push() triggered a // readable event, and the user called read(largeNumber) such that // needReadable was set, then we ought to push more, so that another // 'readable' event will be triggered. function needMoreData(state){return!state.ended&&(state.needReadable||state.length 8MB var MAX_HWM=0x800000;function computeNewHighWaterMark(n){if(n>=MAX_HWM){n=MAX_HWM;}else{// Get the next highest power of 2 to prevent increasing hwm excessively in // tiny amounts n--;n|=n>>>1;n|=n>>>2;n|=n>>>4;n|=n>>>8;n|=n>>>16;n++;}return n;}// This function is designed to be inlinable, so please take care when making // changes to the function body. function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time if(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm. if(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough if(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below. Readable.prototype.read=function(n){debug('read',n);n=parseInt(n,10);var state=this._readableState;var nOrig=n;if(n!==0)state.emittedReadable=false;// if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. 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);else emitReadable(this);return null;}n=howMuchToRead(n,state);// if we've ended, and we're now clear, then finish it up. if(n===0&&state.ended){if(state.length===0)endReadable(this);return null;}// All the actual chunk generation logic needs to be // *below* the call to _read. The reason is that in certain // synthetic stream cases, such as passthrough streams, _read // may be a completely synchronous operation which may change // the state of the read buffer, providing enough data when // before there was *not* enough. // // So, the steps are: // 1. Figure out what the state of things will be after we do // a read from the buffer. // // 2. If that resulting state will trigger a _read, then call _read. // Note that this may be asynchronous, or synchronous. Yes, it is // deeply ugly to write APIs this way, but that still doesn't mean // that the Readable class should behave improperly, as streams are // designed to be sync/async agnostic. // Take note if the _read call is sync or async (ie, if the read call // has returned yet), so that we know whether or not it's safe to emit // 'readable' etc. // // 3. Actually pull the requested chunks out of the buffer and return. // if we need a readable event, then we need to do some reading. var doRead=state.needReadable;debug('need readable',doRead);// if we currently have less than the highWaterMark, then also read some if(state.length===0||state.length-n0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0;}else{state.length-=n;}if(state.length===0){// If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. if(!state.ended)state.needReadable=true;// If we tried to read() past the EOF, then emit end on the next tick. if(nOrig!==n&&state.ended)endReadable(this);}if(ret!==null)this.emit('data',ret);return ret;};function onEofChunk(stream,state){if(state.ended)return;if(state.decoder){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length;}}state.ended=true;// emit 'readable' now to make sure it gets picked up. emitReadable(stream);}// Don't emit readable right away in sync mode, because this can trigger // another read() call => stack overflow. This way, it might trigger // a nextTick recursion warning, but that's not so bad. function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug('emitReadable',state.flowing);state.emittedReadable=true;if(state.sync)pna.nextTick(emitReadable_,stream);else emitReadable_(stream);}}function emitReadable_(stream){debug('emit readable');stream.emit('readable');flow(stream);}// at this point, the user has presumably seen the 'readable' event, // and called read() to consume some data. that may have triggered // in turn another _read(n) call, in which case reading = true if // it's in progress. // However, if we're not ended, or reading, and the length < hwm, // then go ahead and try to read some more preemptively. function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state);}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length Introduce a guard on increasing awaitDrain. var increasedAwaitDrain=false;src.on('data',ondata);function ondata(chunk){debug('ondata');increasedAwaitDrain=false;var ret=dest.write(chunk);if(false===ret&&!increasedAwaitDrain){// If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. // => Check whether `dest` is still a piping destination. if((state.pipesCount===1&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp){debug('false write response, pause',src._readableState.awaitDrain);src._readableState.awaitDrain++;increasedAwaitDrain=true;}src.pause();}}// if the dest has an error, then stop piping into it. // however, don't suppress the throwing behavior for this. function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones. prependListener(dest,'error',onerror);// Both close and finish should trigger unpipe, but only once. function onclose(){dest.removeListener('finish',onfinish);unpipe();}dest.once('close',onclose);function onfinish(){debug('onfinish');dest.removeListener('close',onclose);unpipe();}dest.once('finish',onfinish);function unpipe(){debug('unpipe');src.unpipe(dest);}// tell the dest that it's being piped to dest.emit('pipe',src);// start the flow if it hasn't been started already. if(!state.flowing){debug('pipe resume');src.resume();}return dest;};function pipeOnDrain(src){return function(){var state=src._readableState;debug('pipeOnDrain',state.awaitDrain);if(state.awaitDrain)state.awaitDrain--;if(state.awaitDrain===0&&EElistenerCount(src,'data')){state.flowing=true;flow(src);}};}Readable.prototype.unpipe=function(dest){var state=this._readableState;var unpipeInfo={hasUnpiped:false};// if we're not piping anywhere, then do nothing. if(state.pipesCount===0)return this;// just one destination. most common case. if(state.pipesCount===1){// passed in one, but it's not the right one. if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;// got a match. state.pipes=null;state.pipesCount=0;state.flowing=false;if(dest)dest.emit('unpipe',this,unpipeInfo);return this;}// slow case. multiple pipe destinations. if(!dest){// remove all. var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;state.flowing=false;for(var i=0;i=state.length){// read it all, truncate the list if(state.decoder)ret=state.buffer.join('');else if(state.buffer.length===1)ret=state.buffer.head.data;else ret=state.buffer.concat(state.length);state.buffer.clear();}else{// read part of list ret=fromListPartial(n,state.buffer,state.decoder);}return ret;}// Extracts only enough buffered data to satisfy the amount requested. // This function is designed to be inlinable, so please take care when making // changes to the function body. function fromListPartial(n,list,hasStrings){var ret;if(nstr.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list.head=p;p.data=str.slice(nb);}break;}++c;}list.length-=c;return ret;}// Copies a specified amount of bytes from the list of buffered data chunks. // This function is designed to be inlinable, so please take care when making // changes to the function body. function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n);var p=list.head;var c=1;p.data.copy(ret);n-=p.data.length;while(p=p.next){var buf=p.data;var nb=n>buf.length?buf.length:n;buf.copy(ret,ret.length-n,0,nb);n-=nb;if(n===0){if(nb===buf.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list.head=p;p.data=buf.slice(nb);}break;}++c;}list.length-=c;return ret;}function endReadable(stream){var state=stream._readableState;// If we get here before consuming all the bytes, then that is a // bug in node. Should never happen. if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!state.endEmitted){state.ended=true;pna.nextTick(endReadableNT,state,stream);}}function endReadableNT(state,stream){// Check that we didn't get one last unshift. if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit('end');}}function indexOf(xs,x){for(var i=0,l=xs.length;i*/var util=require('core-util-is');util.inherits=require('inherits');/**/util.inherits(Transform,Duplex);function afterTransform(er,data){var ts=this._transformState;ts.transforming=false;var cb=ts.writecb;if(!cb){return this.emit('error',new Error('write callback called multiple times'));}ts.writechunk=null;ts.writecb=null;if(data!=null)// single equals check for both `null` and `undefined` this.push(data);cb(er);var rs=this._readableState;rs.reading=false;if(rs.needReadable||rs.length*/var pna=require('process-nextick-args');/**/module.exports=Writable;/* */function WriteReq(chunk,encoding,cb){this.chunk=chunk;this.encoding=encoding;this.callback=cb;this.next=null;}// It seems a linked list but it is not // there will be only 2 of these for each stream function CorkedRequest(state){var _this=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(_this,state);};}/* *//**/var asyncWrite=!process.browser&&['v0.10','v0.9.'].indexOf(process.version.slice(0,5))>-1?setImmediate:pna.nextTick;/**//**/var Duplex;/**/Writable.WritableState=WritableState;/**/var util=require('core-util-is');util.inherits=require('inherits');/**//**/var internalUtil={deprecate:require('util-deprecate')};/**//**/var Stream=require('./internal/streams/stream');/**//**/var Buffer=require('safe-buffer').Buffer;var OurUint8Array=global.Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer.from(chunk);}function _isUint8Array(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array;}/**/var destroyImpl=require('./internal/streams/destroy');util.inherits(Writable,Stream);function nop(){}function WritableState(options,stream){Duplex=Duplex||require('./_stream_duplex');options=options||{};// Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. var isDuplex=stream instanceof Duplex;// object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode=!!options.objectMode;if(isDuplex)this.objectMode=this.objectMode||!!options.writableObjectMode;// the point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if // the entire buffer is not flushed immediately on write() var hwm=options.highWaterMark;var writableHwm=options.writableHighWaterMark;var defaultHwm=this.objectMode?16:16*1024;if(hwm||hwm===0)this.highWaterMark=hwm;else if(isDuplex&&(writableHwm||writableHwm===0))this.highWaterMark=writableHwm;else this.highWaterMark=defaultHwm;// cast to ints. this.highWaterMark=Math.floor(this.highWaterMark);// if _final has been called this.finalCalled=false;// drain event flag. this.needDrain=false;// at the start of calling end() this.ending=false;// when end() has been called, and returned this.ended=false;// when 'finish' is emitted this.finished=false;// has it been destroyed this.destroyed=false;// should we decode strings into buffers before passing to _write? // this is here so that some node-core streams can optimize string // handling at a lower level. var noDecode=options.decodeStrings===false;this.decodeStrings=!noDecode;// Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding=options.defaultEncoding||'utf8';// not an actual buffer we keep track of, but a measurement // of how much we're waiting to get pushed to some underlying // socket or file. this.length=0;// a flag to see when we're in the middle of a write. this.writing=false;// when true all writes will be buffered until .uncork() call this.corked=0;// a flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. this.sync=true;// a flag to know if we're processing previously buffered items, which // may call the _write() callback in the same tick, so that we don't // end up in an overlapped onwrite situation. this.bufferProcessing=false;// the callback that's passed to _write(chunk,cb) this.onwrite=function(er){onwrite(stream,er);};// the callback that the user supplies to write(chunk,encoding,cb) this.writecb=null;// the amount that is being written when _write is called. this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;// number of pending user-supplied write callbacks // this must be 0 before 'finish' can be emitted this.pendingcb=0;// emit prefinish if the only thing we're waiting for is _write cbs // This is relevant for synchronous Transform streams this.prefinished=false;// True if the error was already emitted and should not be thrown again this.errorEmitted=false;// count buffered requests this.bufferedRequestCount=0;// allocate the first CorkedRequest, there is always // one allocated and free to use, and we maintain at most two this.corkedRequestsFree=new CorkedRequest(this);}WritableState.prototype.getBuffer=function getBuffer(){var current=this.bufferedRequest;var out=[];while(current){out.push(current);current=current.next;}return out;};(function(){try{Object.defineProperty(WritableState.prototype,'buffer',{get:internalUtil.deprecate(function(){return this.getBuffer();},'_writableState.buffer is deprecated. Use _writableState.getBuffer '+'instead.','DEP0003')});}catch(_){}})();// Test _writableState for inheritance to account for Duplex streams, // whose prototype chain only points to Readable. var realHasInstance;if(typeof Symbol==='function'&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==='function'){realHasInstance=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function value(object){if(realHasInstance.call(this,object))return true;if(this!==Writable)return false;return object&&object._writableState instanceof WritableState;}});}else{realHasInstance=function realHasInstance(object){return object instanceof this;};}function Writable(options){Duplex=Duplex||require('./_stream_duplex');// Writable ctor is applied to Duplexes, too. // `realHasInstance` is necessary because using plain `instanceof` // would return false, as no `_writableState` property is attached. // Trying to use the custom `instanceof` for Writable here will also break the // Node.js LazyTransform implementation, which has a non-trivial getter for // `_writableState` that would lead to infinite recursion. if(!realHasInstance.call(Writable,this)&&!(this instanceof Duplex)){return new Writable(options);}this._writableState=new WritableState(options,this);// legacy. this.writable=true;if(options){if(typeof options.write==='function')this._write=options.write;if(typeof options.writev==='function')this._writev=options.writev;if(typeof options.destroy==='function')this._destroy=options.destroy;if(typeof options.final==='function')this._final=options.final;}Stream.call(this);}// Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe=function(){this.emit('error',new Error('Cannot pipe, not readable'));};function writeAfterEnd(stream,cb){var er=new Error('write after end');// TODO: defer error events consistently everywhere, not just the cb stream.emit('error',er);pna.nextTick(cb,er);}// Checks that a user-supplied chunk is valid, especially for the particular // mode the stream is in. Currently this means that `null` is never accepted // and undefined/non-string values are only allowed in object mode. function validChunk(stream,state,chunk,cb){var valid=true;var er=false;if(chunk===null){er=new TypeError('May not write null values to stream');}else if(typeof chunk!=='string'&&chunk!==undefined&&!state.objectMode){er=new TypeError('Invalid non-string/buffer chunk');}if(er){stream.emit('error',er);pna.nextTick(cb,er);valid=false;}return valid;}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;var isBuf=!state.objectMode&&_isUint8Array(chunk);if(isBuf&&!Buffer.isBuffer(chunk)){chunk=_uint8ArrayToBuffer(chunk);}if(typeof encoding==='function'){cb=encoding;encoding=null;}if(isBuf)encoding='buffer';else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=='function')cb=nop;if(state.ended)writeAfterEnd(this,cb);else if(isBuf||validChunk(this,state,chunk,cb)){state.pendingcb++;ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb);}return ret;};Writable.prototype.cork=function(){var state=this._writableState;state.corked++;};Writable.prototype.uncork=function(){var state=this._writableState;if(state.corked){state.corked--;if(!state.writing&&!state.corked&&!state.finished&&!state.bufferProcessing&&state.bufferedRequest)clearBuffer(this,state);}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(encoding){// node::ParseEncoding() requires lower case. if(typeof encoding==='string')encoding=encoding.toLowerCase();if(!(['hex','utf8','utf-8','ascii','binary','base64','ucs2','ucs-2','utf16le','utf-16le','raw'].indexOf((encoding+'').toLowerCase())>-1))throw new TypeError('Unknown encoding: '+encoding);this._writableState.defaultEncoding=encoding;return this;};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==='string'){chunk=Buffer.from(chunk,encoding);}return chunk;}Object.defineProperty(Writable.prototype,'writableHighWaterMark',{// making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable:false,get:function get(){return this._writableState.highWaterMark;}});// if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);if(chunk!==newChunk){isBuf=true;encoding='buffer';chunk=newChunk;}}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length*/asyncWrite(afterWrite,stream,state,finished,cb);/**/}else{afterWrite(stream,state,finished,cb);}}}function afterWrite(stream,state,finished,cb){if(!finished)onwriteDrain(stream,state);state.pendingcb--;cb();finishMaybe(stream,state);}// Must force callback to be called on nextTick, so that we don't // emit 'drain' before the write() consumer gets the 'false' return // value, and has a chance to attach a 'drain' listener. function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it function clearBuffer(stream,state){state.bufferProcessing=true;var entry=state.bufferedRequest;if(stream._writev&&entry&&entry.next){// Fast case, write everything using _writev() var l=state.bufferedRequestCount;var buffer=new Array(l);var holder=state.corkedRequestsFree;holder.entry=entry;var count=0;var allBuffers=true;while(entry){buffer[count]=entry;if(!entry.isBuf)allBuffers=false;entry=entry.next;count+=1;}buffer.allBuffers=allBuffers;doWrite(stream,state,true,state.length,buffer,'',holder.finish);// doWrite is almost always async, defer these to save a bit of time // as the hot path ends with doWrite state.pendingcb++;state.lastBufferedRequest=null;if(holder.next){state.corkedRequestsFree=holder.next;holder.next=null;}else{state.corkedRequestsFree=new CorkedRequest(state);}state.bufferedRequestCount=0;}else{// Slow case, write chunks one-by-one while(entry){var chunk=entry.chunk;var encoding=entry.encoding;var cb=entry.callback;var len=state.objectMode?1:chunk.length;doWrite(stream,state,false,len,chunk,encoding,cb);entry=entry.next;state.bufferedRequestCount--;// if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. if(state.writing){break;}}if(entry===null)state.lastBufferedRequest=null;}state.bufferedRequest=entry;state.bufferProcessing=false;}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error('_write() is not implemented'));};Writable.prototype._writev=null;Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;if(typeof chunk==='function'){cb=chunk;chunk=null;encoding=null;}else if(typeof encoding==='function'){cb=encoding;encoding=null;}if(chunk!==null&&chunk!==undefined)this.write(chunk,encoding);// .end() fully uncorks if(state.corked){state.corked=1;this.uncork();}// ignore unnecessary end() calls. if(!state.ending&&!state.finished)endWritable(this,state,cb);};function needFinish(state){return state.ending&&state.length===0&&state.bufferedRequest===null&&!state.finished&&!state.writing;}function callFinal(stream,state){stream._final(function(err){state.pendingcb--;if(err){stream.emit('error',err);}state.prefinished=true;stream.emit('prefinish');finishMaybe(stream,state);});}function prefinish(stream,state){if(!state.prefinished&&!state.finalCalled){if(typeof stream._final==='function'){state.pendingcb++;state.finalCalled=true;pna.nextTick(callFinal,stream,state);}else{state.prefinished=true;stream.emit('prefinish');}}}function finishMaybe(stream,state){var need=needFinish(state);if(need){prefinish(stream,state);if(state.pendingcb===0){state.finished=true;stream.emit('finish');}}return need;}function endWritable(stream,state,cb){state.ending=true;finishMaybe(stream,state);if(cb){if(state.finished)pna.nextTick(cb);else stream.once('finish',cb);}state.ended=true;stream.writable=false;}function onCorkedFinish(corkReq,state,err){var entry=corkReq.entry;corkReq.entry=null;while(entry){var cb=entry.callback;state.pendingcb--;cb(err);entry=entry.next;}if(state.corkedRequestsFree){state.corkedRequestsFree.next=corkReq;}else{state.corkedRequestsFree=corkReq;}}Object.defineProperty(Writable.prototype,'destroyed',{get:function get(){if(this._writableState===undefined){return false;}return this._writableState.destroyed;},set:function set(value){// we ignore the value if the stream // has not been initialized yet if(!this._writableState){return;}// backward compatibility, the user is explicitly // managing destroyed this._writableState.destroyed=value;}});Writable.prototype.destroy=destroyImpl.destroy;Writable.prototype._undestroy=destroyImpl.undestroy;Writable.prototype._destroy=function(err,cb){this.end();cb(err);};}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("timers").setImmediate);},{"./_stream_duplex":191,"./internal/streams/destroy":197,"./internal/streams/stream":198,"_process":189,"core-util-is":9,"inherits":14,"process-nextick-args":188,"safe-buffer":203,"timers":211,"util-deprecate":212}],196:[function(require,module,exports){'use strict';function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}var Buffer=require('safe-buffer').Buffer;var util=require('util');function copyBuffer(src,target,offset){src.copy(target,offset);}module.exports=function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0;}BufferList.prototype.push=function push(v){var entry={data:v,next:null};if(this.length>0)this.tail.next=entry;else this.head=entry;this.tail=entry;++this.length;};BufferList.prototype.unshift=function unshift(v){var entry={data:v,next:this.head};if(this.length===0)this.tail=entry;this.head=entry;++this.length;};BufferList.prototype.shift=function shift(){if(this.length===0)return;var ret=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return ret;};BufferList.prototype.clear=function clear(){this.head=this.tail=null;this.length=0;};BufferList.prototype.join=function join(s){if(this.length===0)return'';var p=this.head;var ret=''+p.data;while(p=p.next){ret+=s+p.data;}return ret;};BufferList.prototype.concat=function concat(n){if(this.length===0)return Buffer.alloc(0);if(this.length===1)return this.head.data;var ret=Buffer.allocUnsafe(n>>>0);var p=this.head;var i=0;while(p){copyBuffer(p.data,ret,i);i+=p.data.length;p=p.next;}return ret;};return BufferList;}();if(util&&util.inspect&&util.inspect.custom){module.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+' '+obj;};}},{"safe-buffer":203,"util":7}],197:[function(require,module,exports){'use strict';/**/var pna=require('process-nextick-args');/**/// undocumented cb() API, needed for core, not for public API function destroy(err,cb){var _this=this;var readableDestroyed=this._readableState&&this._readableState.destroyed;var writableDestroyed=this._writableState&&this._writableState.destroyed;if(readableDestroyed||writableDestroyed){if(cb){cb(err);}else if(err&&(!this._writableState||!this._writableState.errorEmitted)){pna.nextTick(emitErrorNT,this,err);}return this;}// we set destroyed to true before firing error callbacks in order // to make it re-entrance safe in case destroy() is called within callbacks if(this._readableState){this._readableState.destroyed=true;}// if this is a duplex stream mark the writable part as destroyed as well if(this._writableState){this._writableState.destroyed=true;}this._destroy(err||null,function(err){if(!cb&&err){pna.nextTick(emitErrorNT,_this,err);if(_this._writableState){_this._writableState.errorEmitted=true;}}else if(cb){cb(err);}});return this;}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false;}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finished=false;this._writableState.errorEmitted=false;}}function emitErrorNT(self,err){self.emit('error',err);}module.exports={destroy:destroy,undestroy:undestroy};},{"process-nextick-args":188}],198:[function(require,module,exports){module.exports=require('events').EventEmitter;},{"events":11}],199:[function(require,module,exports){module.exports=require('./readable').PassThrough;},{"./readable":200}],200:[function(require,module,exports){exports=module.exports=require('./lib/_stream_readable.js');exports.Stream=exports;exports.Readable=exports;exports.Writable=require('./lib/_stream_writable.js');exports.Duplex=require('./lib/_stream_duplex.js');exports.Transform=require('./lib/_stream_transform.js');exports.PassThrough=require('./lib/_stream_passthrough.js');},{"./lib/_stream_duplex.js":191,"./lib/_stream_passthrough.js":192,"./lib/_stream_readable.js":193,"./lib/_stream_transform.js":194,"./lib/_stream_writable.js":195}],201:[function(require,module,exports){module.exports=require('./readable').Transform;},{"./readable":200}],202:[function(require,module,exports){module.exports=require('./lib/_stream_writable.js');},{"./lib/_stream_writable.js":195}],203:[function(require,module,exports){/* eslint-disable node/no-deprecated-api */var buffer=require('buffer');var Buffer=buffer.Buffer;// alternative to using Object.keys for old browsers function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}if(Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow){module.exports=buffer;}else{// Copy properties from require('buffer') copyProps(buffer,exports);exports.Buffer=SafeBuffer;}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length);}// Copy static methods from Buffer copyProps(Buffer,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg==='number'){throw new TypeError('Argument must not be a number');}return Buffer(arg,encodingOrOffset,length);};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}var buf=Buffer(size);if(fill!==undefined){if(typeof encoding==='string'){buf.fill(fill,encoding);}else{buf.fill(fill);}}else{buf.fill(0);}return buf;};SafeBuffer.allocUnsafe=function(size){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}return Buffer(size);};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}return buffer.SlowBuffer(size);};},{"buffer":8}],204:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. module.exports=Stream;var EE=require('events').EventEmitter;var inherits=require('inherits');inherits(Stream,EE);Stream.Readable=require('readable-stream/readable.js');Stream.Writable=require('readable-stream/writable.js');Stream.Duplex=require('readable-stream/duplex.js');Stream.Transform=require('readable-stream/transform.js');Stream.PassThrough=require('readable-stream/passthrough.js');// Backwards-compat with node 0.4.x Stream.Stream=Stream;// old-style streams. Note that the pipe method (the only relevant // part of this class) is overridden in the Readable class. function Stream(){EE.call(this);}Stream.prototype.pipe=function(dest,options){var source=this;function ondata(chunk){if(dest.writable){if(false===dest.write(chunk)&&source.pause){source.pause();}}}source.on('data',ondata);function ondrain(){if(source.readable&&source.resume){source.resume();}}dest.on('drain',ondrain);// If the 'end' option is not supplied, dest.end() will be called when // source gets the 'end' or 'close' events. Only dest.end() once. if(!dest._isStdio&&(!options||options.end!==false)){source.on('end',onend);source.on('close',onclose);}var didOnEnd=false;function onend(){if(didOnEnd)return;didOnEnd=true;dest.end();}function onclose(){if(didOnEnd)return;didOnEnd=true;if(typeof dest.destroy==='function')dest.destroy();}// don't leave dangling pipes when there are errors. function onerror(er){cleanup();if(EE.listenerCount(this,'error')===0){throw er;// Unhandled stream error in pipe. }}source.on('error',onerror);dest.on('error',onerror);// remove all the event listeners that were added. function cleanup(){source.removeListener('data',ondata);dest.removeListener('drain',ondrain);source.removeListener('end',onend);source.removeListener('close',onclose);source.removeListener('error',onerror);dest.removeListener('error',onerror);source.removeListener('end',cleanup);source.removeListener('close',cleanup);dest.removeListener('close',cleanup);}source.on('end',cleanup);source.on('close',cleanup);dest.on('close',cleanup);dest.emit('pipe',source);// Allow for unix-like usage: A.pipe(B).pipe(C) return dest;};},{"events":11,"inherits":14,"readable-stream/duplex.js":190,"readable-stream/passthrough.js":199,"readable-stream/readable.js":200,"readable-stream/transform.js":201,"readable-stream/writable.js":202}],205:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict';/**/var Buffer=require('safe-buffer').Buffer;/**/var isEncoding=Buffer.isEncoding||function(encoding){encoding=''+encoding;switch(encoding&&encoding.toLowerCase()){case'hex':case'utf8':case'utf-8':case'ascii':case'binary':case'base64':case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':case'raw':return true;default:return false;}};function _normalizeEncoding(enc){if(!enc)return'utf8';var retried;while(true){switch(enc){case'utf8':case'utf-8':return'utf8';case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return'utf16le';case'latin1':case'binary':return'latin1';case'base64':case'ascii':case'hex':return enc;default:if(retried)return;// undefined enc=(''+enc).toLowerCase();retried=true;}}};// Do not cache `Buffer.isEncoding` when checking encoding names as some // modules monkey-patch it to support additional encodings function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if(typeof nenc!=='string'&&(Buffer.isEncoding===isEncoding||!isEncoding(enc)))throw new Error('Unknown encoding: '+enc);return nenc||enc;}// StringDecoder provides an interface for efficiently splitting a series of // buffers into a series of JS strings without breaking apart multi-byte // characters. exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case'utf16le':this.text=utf16Text;this.end=utf16End;nb=4;break;case'utf8':this.fillLast=utf8FillLast;nb=4;break;case'base64':this.text=base64Text;this.end=base64End;nb=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return;}this.lastNeed=0;this.lastTotal=0;this.lastChar=Buffer.allocUnsafe(nb);}StringDecoder.prototype.write=function(buf){if(buf.length===0)return'';var r;var i;if(this.lastNeed){r=this.fillLast(buf);if(r===undefined)return'';i=this.lastNeed;this.lastNeed=0;}else{i=0;}if(i>5===0x06)return 2;else if(byte>>4===0x0E)return 3;else if(byte>>3===0x1E)return 4;return byte>>6===0x02?-1:-2;}// Checks at most 3 bytes at the end of a Buffer in order to detect an // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) // needed to complete the UTF-8 character (if applicable) are returned. function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j=0){if(nb>0)self.lastNeed=nb-1;return nb;}if(--j=0){if(nb>0)self.lastNeed=nb-2;return nb;}if(--j=0){if(nb>0){if(nb===2)nb=0;else self.lastNeed=nb-3;}return nb;}return 0;}// Validates as many continuation bytes for a multi-byte UTF-8 character as // needed or are available. If we see a non-continuation byte where we expect // one, we "replace" the validated continuation bytes we've seen so far with // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding // behavior. The continuation byte check is included three times in the case // where all of the continuation bytes for a character exist in the same buffer. // It is also done this way as a slight performance increase instead of using a // loop. function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return"\uFFFD";}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return"\uFFFD";}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return"\uFFFD";}}}}// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,buf,p);if(r!==undefined)return r;if(this.lastNeed<=buf.length){buf.copy(this.lastChar,p,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal);}buf.copy(this.lastChar,p,0,buf.length);this.lastNeed-=buf.length;}// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a // partial character, the character's bytes are buffered until the required // number of bytes are available. function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString('utf8',i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString('utf8',i,end);}// For UTF-8, a replacement character is added when ending on a partial // character. function utf8End(buf){var r=buf&&buf.length?this.write(buf):'';if(this.lastNeed)return r+"\uFFFD";return r;}// UTF-16LE typically needs two bytes per character, but even if we have an even // number of bytes available, we need to check if we end on a leading/high // surrogate. In that case, we need to wait for the next two bytes in order to // decode the last character properly. function utf16Text(buf,i){if((buf.length-i)%2===0){var r=buf.toString('utf16le',i);if(r){var c=r.charCodeAt(r.length-1);if(c>=0xD800&&c<=0xDBFF){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];return r.slice(0,-1);}}return r;}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=buf[buf.length-1];return buf.toString('utf16le',i,buf.length-1);}// For UTF-16LE we do not explicitly append special replacement characters if we // end on a partial character, we simply let v8 handle that. function utf16End(buf){var r=buf&&buf.length?this.write(buf):'';if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString('utf16le',0,end);}return r;}function base64Text(buf,i){var n=(buf.length-i)%3;if(n===0)return buf.toString('base64',i);this.lastNeed=3-n;this.lastTotal=3;if(n===1){this.lastChar[0]=buf[buf.length-1];}else{this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];}return buf.toString('base64',i,buf.length-n);}function base64End(buf){var r=buf&&buf.length?this.write(buf):'';if(this.lastNeed)return r+this.lastChar.toString('base64',0,3-this.lastNeed);return r;}// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) function simpleWrite(buf){return buf.toString(this.encoding);}function simpleEnd(buf){return buf&&buf.length?this.write(buf):'';}},{"safe-buffer":203}],206:[function(require,module,exports){(function(process,Buffer){// Transforms a stream of TAP into a stream of result objects // and string comments. Emits "results" event with summary. var Writable=require('stream').Writable;if(!Writable){try{Writable=require('readable-stream').Writable;}catch(er){throw new Error('Please install "readable-stream" to use this module '+'with Node.js v0.8 and before');}}var yaml=require('js-yaml');var util=require('util');var assert=require('assert');util.inherits(Parser,Writable);module.exports=Parser;var testPointRE=/^(not )?ok(?: ([0-9]+))?(?:(?: - )?(.*))?\n$/;function parseDirective(line){line=line.trim();var time=line.match(/^time=((?:[1-9][0-9]*|0)(?:\.[0-9]+)?)(ms|s)$/i);if(time){var n=+time[1];if(time[2]==='s')n*=1000;return['time',n];}var type=line.match(/^(todo|skip)\b/i);if(!type)return false;return[type[1].toLowerCase(),line.substr(type[1].length).trim()||true];}function Result(line,count){var parsed=line.match(testPointRE);assert(parsed,'invalid line to Result');var ok=!parsed[1];var id=+(parsed[2]||count+1);this.ok=ok;this.id=id;var src=line;Object.defineProperty(this,'src',{value:line,writable:true,enumerable:false,configurable:false});this.src=line;var rest=parsed[3]||'';var name;rest=rest.replace(/([^\\]|^)((?:\\\\)*)#/g,'$1\n$2').split('\n');name=rest.shift();rest=rest.filter(function(r){return r.trim();}).join('#');// now, let's see if there's a directive in there. var dir=parseDirective(rest.trim());if(!dir)name+=rest?'#'+rest:'';else this[dir[0]]=dir[1];if(name)this.name=name.trim();return this;}Object.defineProperty(Result.prototype,'toString',{value:function value(){return this.src;},enumerable:false,writable:true,configurable:true});function Parser(options,onComplete){if(typeof options==='function'){onComplete=options;options={};}if(!(this instanceof Parser))return new Parser(options,onComplete);options=options||{};if(onComplete)this.on('complete',onComplete);this.sawValidTap=false;this.failures=[];this.indent=options.indent||'';this.level=options.level||0;Writable.call(this);this.buffer='';this.bailedOut=false;this.planStart=-1;this.planEnd=-1;this.planComment='';this.yamlish='';this.yind='';this.child=null;this.current=null;this.commentQueue=[];this.count=0;this.pass=0;this.fail=0;this.todo=0;this.skip=0;this.ok=true;this.strict=false;this.postPlan=false;}Parser.prototype.createResult=function(line){if(!testPointRE.test(line))return null;this.emitResult();return new Result(line,this.count);};Parser.prototype.nonTap=function(data){if(this.strict){this.failures.push({tapError:'Non-TAP data encountered in strict mode',data:data});this.ok=false;}this.emit('extra',data);};Parser.prototype.processYamlish=function(){var yamlish=this.yamlish;this.yamlish='';this.yind='';if(!this.current){this.nonTap(yamlish);return;}try{var diags=yaml.safeLoad(yamlish);}catch(er){this.nonTap(yamlish);return;}this.current.src+=yamlish;this.current.diag=diags;this.emitResult();};Parser.prototype.write=function(chunk,encoding,cb){if(typeof encoding==='string'&&encoding!=='utf8')chunk=new Buffer(chunk,encoding);if(Buffer.isBuffer(chunk))chunk+='';if(typeof encoding==='function'){cb=encoding;encoding=null;}if(this.bailedOut){if(cb)process.nextTick(cb);return true;}this.buffer+=chunk;do{var match=this.buffer.match(/^.*\r?\n/);if(!match||this.bailedOut)break;this.buffer=this.buffer.substr(match[0].length);this._parse(match[0]);}while(this.buffer.length);if(cb)process.nextTick(cb);return true;};Parser.prototype.end=function(chunk,encoding,cb){if(chunk){if(typeof encoding==='function'){cb=encoding;encoding=null;}this.write(chunk,encoding);}if(this.buffer)this.write('\n');// if we have yamlish, means we didn't finish with a ... if(this.yamlish)this.nonTap(this.yamlish);this.emitResult();var skipAll;if(this.planEnd===0&&this.planStart===1){this.ok=true;skipAll=true;}else if(this.count!==this.planEnd-this.planStart+1)this.ok=false;if(this.ok&&!skipAll&&this.first!==this.planStart)this.ok=false;if(this.ok&&!skipAll&&this.last!==this.planEnd)this.ok=false;var final={ok:this.ok,count:this.count,pass:this.pass};if(this.fail)final.fail=this.fail;if(this.bailedOut)final.bailout=this.bailedOut;if(this.todo)final.todo=this.todo;if(this.skip)final.skip=this.skip;if(this.planStart!==-1){final.plan={start:this.planStart,end:this.planEnd};if(skipAll){final.plan.skipAll=true;if(this.planComment)final.plan.skipReason=this.planComment;}}// We didn't get any actual tap, so just treat this like a // 1..0 test, because it was probably just console.log junk if(!this.sawValidTap){final.plan={start:1,end:0};final.ok=true;}if(this.failures.length)final.failures=this.failures;this.emit('complete',final);Writable.prototype.end.call(this,null,null,cb);};Parser.prototype.bailout=function(reason){this.bailedOut=reason||true;this.ok=false;this.emit('bailout',reason);};Parser.prototype.clearCommentQueue=function(){for(var c=0;c\nfoo\n\nbar\n is yaml for `"foo\nbar"` // >\nfoo\nbar\n is yaml for `"foo bar"` if(line==='\n'||line.trim()===''){if(this.child){this.child.write('\n');}else if(this.yind){this.yamlish+='\n';}return;}// After a bailout, everything is ignored if(this.bailedOut)return;this.emit('line',line);// The only Pragma supported is strict. Others may be added. var pragma=line.match(/^pragma ([+-])strict\n$/);if(pragma){this.strict=pragma[1]==='+';this.emit('pragma',{strict:this.strict});return;}var bailout=line.match(/^bail out!(.*)\n$/i);if(bailout){this.sawValidTap=true;var reason=bailout[1].trim();this.bailout(reason);return;}// If version is specified, must be at the very beginning. var version=line.match(/^TAP version ([0-9]+)\n$/i);if(version){version=parseInt(version[1],10);if(version>=13&&this.planStart===-1&&this.count===0)this.emit('version',version);else this.nonTap(line);return;}// still belongs to the child. if(this.child){if(line.indexOf(this.child.indent)===0){line=line.substr(this.child.indent.length);this.child.write(line);return;}if(line.trim().charAt(0)==='#'){this.emitComment(line);return;}// a child test can only end when we get an test point line. // anything else is extra. if(this.child.sawValidTap&&!/^(not )?ok/.test(line)){this.nonTap(line);return;}}// comment, but let "# Subtest:" comments start a child var c=line.match(/^(\s+)?#(.*)/);if(c&&!(c[1]&&/^ Subtest: /.test(c[2]))){this.emitComment(line);return;}// if we got a plan at the end, or a 1..0 plan, then we can't // have any more results, yamlish, or child sets. if(this.postPlan){this.nonTap(line);return;}var indent=line.match(/^[ \t]+/);if(indent){indent=indent[0];// if we don't have a current res, then it can't be yamlish. // If it is a subtest command, then it's a child test. if(!this.current){this.startChild(indent,line);return;}// if we are not currently processing yamlish, then it has to // be either the start of a child, or the start of yamlish. if(!this.yind){// either this starts yamlish, or it is a child. if(line===indent+'---\n')this.yind=indent;else this.startChild(indent,line);return;}// now we know it is yamlish // if it's not as indented, then it's broken. // The whole yamlish chunk is garbage. if(indent.indexOf(this.yind)!==0){// oops! was not actually yamlish, I guess. // treat as garbage this.nonTap(this.yamlish+line);this.emitResult();return;}// yamlish ends with "...\n" if(line===this.yind+'...\n'){this.processYamlish();return;}// ok! it is valid yamlish indentation, and not the ... // save it to parse later. this.yamlish+=line;return;}// not indented. if we were doing yamlish, then it didn't go good if(this.yind){this.nonTap(this.yamlish);this.yamlish='';this.yind='';}var plan=line.match(/^([0-9]+)\.\.([0-9]+)(?:\s+(?:#\s*(.*)))?\n$/);if(plan){if(this.planStart!==-1){// this is not valid tap, just garbage this.nonTap(line);return;}this.sawValidTap=true;this.emitResult();var start=+plan[1];var end=+plan[2];var comment=plan[3];this.planStart=start;this.planEnd=end;var p={start:start,end:end};if(comment)this.planComment=p.comment=comment;this.emit('plan',p);// This means that the plan is coming at the END of all the tests // Plans MUST be either at the beginning or the very end. We treat // plans like '1..0' the same, since they indicate that no tests // will be coming. if(this.count!==0||this.planEnd===0)this.postPlan=true;return;}var res=this.createResult(line);if(!res){this.nonTap(line);return;}if(this.planStart!==-1){var lessThanStart=+res.idthis.planEnd;if(lessThanStart||greaterThanEnd){this.ok=false;if(lessThanStart)res.tapError='id less than plan start';else res.tapError='id greater than plan end';this.failures.push(res);}}this.sawValidTap=true;if(res.id){if(!this.first||res.idthis.last)this.last=res.id;}// hold onto it, because we might get yamlish diagnostics this.current=res;};}).call(this,require('_process'),require("buffer").Buffer);},{"_process":189,"assert":5,"buffer":8,"js-yaml":17,"readable-stream":200,"stream":204,"util":216}],207:[function(require,module,exports){var parser=require('tap-parser');var through=require('through2');var duplexer=require('duplexer');var extend=require('xtend');var serialize=require('./serialize');module.exports=converter;var defaults={// Whether the TAP comments should not be used as test-suite names dontUseCommentsAsTestNames:false,// Whether . in test-suite names should be replaced with Unicode dot // NOTE: this feature exist because many xUnit reporters assume . in // test-suite name implies package hierarchy, which may not be the case. replaceWithUnicodeDot:false,// If specified, all test-suites will be prefixed with the given // package name. // NOTE: replaceWithUnicodeDot does not apply to package and . can be // used to specify package hierarchy. package:'',// Whether tap parser should be in strict mode or not, false by default. strict:false};function converter(options){options=extend(defaults,options);var outStream=through();var tapParser=parser();tapParser.strict=options.strict;var testSuites=[];var testCase;var noMoreTests=false;var exitCode=0;var planPresent=false;tapParser.on('comment',function(comment){// comment specifies boundaries between testsuites, unless feature disabled. if(options.dontUseCommentsAsTestNames){return;}if(noMoreTests){return;}// create new test testCase=newTest(comment);});tapParser.on('plan',function(){planPresent=true;});tapParser.on('assert',function(assert){// no test name was given, so all asserts go in a single test if(!testCase){testCase=newTest('Default');}testCase.asserts.push(assert);});tapParser.on('extra',function(e){if(testCase){testCase.extra.push(e);}});tapParser.on('extra',function(line){});tapParser.on('plan',function(p){noMoreTests=true;});tapParser.on('complete',function(r){// output any parse errors if(testCase&&!testSuites.filter(function(ts){return ts.id===testCase.id;}).length){testSuites.push(testCase);}if(r.failures){r.failures.forEach(function(fail){if(fail.tapError){var err=new Error('TAP parse error: '+fail.tapError);exitCode=1;outStream.emit('error',err);}});}// treat # SKIP and # TODO the same // see https://github.com/aghassemi/tap-xunit/issues/8 testSuites.forEach(function(suite){suite.asserts.forEach(function(a){a.skip=a.skip||a.todo;if(!a.ok&&!a.skip){exitCode=1;}});});if(tapParser.sawValidTap&&planPresent){var xmlString=serialize(testSuites);outStream.push(xmlString+'\n');}else{// Fail, no valid tap found (normally means no plan line present) // Note that is a less strict check than TapParser's strict mode. exitCode=1;}result.exitCode=exitCode;outStream.emit('end');});var result=duplexer(tapParser,outStream);return result;function newTest(testName){testSuites.push({id:testSuites.length,extra:[],asserts:[],testName:formatTestName(testName)});return testSuites[testSuites.length-1];}function formatTestName(testName){if(options.replaceWithUnicodeDot){var unicodeDot="\uFF0E";//full width unicode dot testName=testName.replace(/\./g,unicodeDot);}if(options.package){testName=options.package+'.'+testName;}if(testName.indexOf('#')===0){testName=testName.substr(1);}return testName.trim();}}},{"./serialize":209,"duplexer":10,"tap-parser":206,"through2":210,"xtend":234}],208:[function(require,module,exports){var NOT_SAFE_IN_XML_1_0=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm;module.exports=function sanitizeString(str){return str.replace(NOT_SAFE_IN_XML_1_0,'');};},{}],209:[function(require,module,exports){var xmlbuilder=require('xmlbuilder');var sanitizeString=require('./sanitize-string');module.exports=function serialize(testCases){var rootXml=xmlbuilder.create('testsuites');testCases.forEach(function(suite){var suiteElement=rootXml.ele('testsuite');var skipped;var failureElement;suiteElement.att('tests',suite.asserts.length);skipped=suite.asserts.filter(function(a){return a.skip;}).length;if(skipped){suiteElement.att('skipped',skipped);}suiteElement.att('failures',suite.asserts.filter(function(a){return!a.ok&&!a.skip;}).length);suiteElement.att('errors','0');suiteElement.att('name',suite.testName||'');suite.asserts.forEach(function(a,i){var testCaseElement=suiteElement.ele('testcase',{name:'#'+a.id+' '+a.name});if(a.skip){testCaseElement.ele('skipped');}if(!a.ok&&!a.skip){failureElement=testCaseElement.ele('failure');if(a.diag){failureElement.txt(formatFailure(a.diag));}}if(i===suite.asserts.length-1){suite.extra.forEach(function(extraContent){testCaseElement.ele('system-out',sanitizeString(extraContent));});}});});return rootXml.end({pretty:true,indent:' ',newline:'\n'});};function formatFailure(diag){var text='\n ---\n';for(var key in diag){if(diag.hasOwnProperty(key)&&diag[key]!==undefined){var value=diag[key];text+=' '+key+': '+((typeof value==="undefined"?"undefined":_typeof2(value))==='object'?JSON.stringify(value):value)+'\n';}}text+=' ...\n ';return text;}},{"./sanitize-string":208,"xmlbuilder":233}],210:[function(require,module,exports){(function(process){var Transform=require('readable-stream/transform'),inherits=require('util').inherits,xtend=require('xtend');function DestroyableTransform(opts){Transform.call(this,opts);this._destroyed=false;}inherits(DestroyableTransform,Transform);DestroyableTransform.prototype.destroy=function(err){if(this._destroyed)return;this._destroyed=true;var self=this;process.nextTick(function(){if(err)self.emit('error',err);self.emit('close');});};// a noop _transform function function noop(chunk,enc,callback){callback(null,chunk);}// create a new export function, used by both the main export and // the .ctor export, contains common logic for dealing with arguments function through2(construct){return function(options,transform,flush){if(typeof options=='function'){flush=transform;transform=options;options={};}if(typeof transform!='function')transform=noop;if(typeof flush!='function')flush=null;return construct(options,transform,flush);};}// main export, just make me a transform stream! module.exports=through2(function(options,transform,flush){var t2=new DestroyableTransform(options);t2._transform=transform;if(flush)t2._flush=flush;return t2;});// make me a reusable prototype that I can `new`, or implicitly `new` // with a constructor call module.exports.ctor=through2(function(options,transform,flush){function Through2(override){if(!(this instanceof Through2))return new Through2(override);this.options=xtend(options,override);DestroyableTransform.call(this,this.options);}inherits(Through2,DestroyableTransform);Through2.prototype._transform=transform;if(flush)Through2.prototype._flush=flush;return Through2;});module.exports.obj=through2(function(options,transform,flush){var t2=new DestroyableTransform(xtend({objectMode:true,highWaterMark:16},options));t2._transform=transform;if(flush)t2._flush=flush;return t2;});}).call(this,require('_process'));},{"_process":189,"readable-stream/transform":201,"util":216,"xtend":234}],211:[function(require,module,exports){(function(setImmediate,clearImmediate){var nextTick=require('process/browser.js').nextTick;var apply=Function.prototype.apply;var slice=Array.prototype.slice;var immediateIds={};var nextImmediateId=0;// DOM APIs, for completeness exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout);};exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval);};exports.clearTimeout=exports.clearInterval=function(timeout){timeout.close();};function Timeout(id,clearFn){this._id=id;this._clearFn=clearFn;}Timeout.prototype.unref=Timeout.prototype.ref=function(){};Timeout.prototype.close=function(){this._clearFn.call(window,this._id);};// Does not start the time, just sets up the members needed. exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId);item._idleTimeout=msecs;};exports.unenroll=function(item){clearTimeout(item._idleTimeoutId);item._idleTimeout=-1;};exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;if(msecs>=0){item._idleTimeoutId=setTimeout(function onTimeout(){if(item._onTimeout)item._onTimeout();},msecs);}};// That's not how node.js implements it but the exposed api is the same. exports.setImmediate=typeof setImmediate==="function"?setImmediate:function(fn){var id=nextImmediateId++;var args=arguments.length<2?false:slice.call(arguments,1);immediateIds[id]=true;nextTick(function onNextTick(){if(immediateIds[id]){// fn.call() is faster so we optimize for the common use-case // @see http://jsperf.com/call-apply-segu if(args){fn.apply(null,args);}else{fn.call(null);}// Prevent ids from leaking exports.clearImmediate(id);}});return id;};exports.clearImmediate=typeof clearImmediate==="function"?clearImmediate:function(id){delete immediateIds[id];};}).call(this,require("timers").setImmediate,require("timers").clearImmediate);},{"process/browser.js":189,"timers":211}],212:[function(require,module,exports){(function(global){/** * Module exports. */module.exports=deprecate;/** * Mark that a method should not be used. * Returns a modified function which warns once by default. * * If `localStorage.noDeprecation = true` is set, then it is a no-op. * * If `localStorage.throwDeprecation = true` is set, then deprecated functions * will throw an Error when invoked. * * If `localStorage.traceDeprecation = true` is set, then deprecated functions * will invoke `console.trace()` instead of `console.error()`. * * @param {Function} fn - the function to deprecate * @param {String} msg - the string to print to the console when `fn` is invoked * @returns {Function} a new "deprecated" version of `fn` * @api public */function deprecate(fn,msg){if(config('noDeprecation')){return fn;}var warned=false;function deprecated(){if(!warned){if(config('throwDeprecation')){throw new Error(msg);}else if(config('traceDeprecation')){console.trace(msg);}else{console.warn(msg);}warned=true;}return fn.apply(this,arguments);}return deprecated;}/** * Checks `localStorage` for boolean values for the given `name`. * * @param {String} name * @returns {Boolean} * @api private */function config(name){// accessing global.localStorage can trigger a DOMException in sandboxed iframes try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==='true';}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],213:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&(typeof arg==="undefined"?"undefined":_typeof2(arg))==='object'&&typeof arg.copy==='function'&&typeof arg.fill==='function'&&typeof arg.readUInt8==='function';};},{}],214:[function(require,module,exports){(function(process,global){// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;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=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){// legacy... ctx.showHidden=opts;}else if(opts){// got an "options" object exports._extend(ctx,opts);}// set default options 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;// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics 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]};// Don't use 'blue' not visible on cmd.exe inspect.styles={'special':'cyan','number':'yellow','boolean':'yellow','undefined':'grey','null':'bold','string':'green','date':'magenta',// "name": intentionally not styling 'regexp':'red'};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"\x1B["+inspect.colors[style][0]+'m'+str+"\x1B["+inspect.colors[style][1]+'m';}else{return str;}}function stylizeNoColor(str,styleType){return str;}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true;});return hash;}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,ctx);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=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value);}// IE doesn't make error fields non-enumerable // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx if(isError(value)&&(keys.indexOf('message')>=0||keys.indexOf('description')>=0)){return formatError(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);}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');// For some reason typeof null is "object", so special case here. 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-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=output.reduce(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];}// NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(ar){return Array.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==="undefined"?"undefined":_typeof2(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==="undefined"?"undefined":_typeof2(arg))==='object'&&arg!==null;}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]'||e instanceof 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==="undefined"?"undefined":_typeof2(arg))==='symbol'||// ES6 symbol typeof arg==='undefined';}exports.isPrimitive=isPrimitive;exports.isBuffer=require('./support/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'];// 26 Feb 16:19:34 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(' ');}// log is just a thin wrapper to console.log that prepends a timestamp exports.log=function(){console.log('%s - %s',timestamp(),exports.format.apply(exports,arguments));};/** * Inherit the prototype methods from one constructor into another. * * The Function.prototype.inherits from lang.js rewritten as a standalone * function (not on Function.prototype). NOTE: If this file is to be loaded * during bootstrapping this function needs to be rewritten using some native * functions as prototype setup using normal JavaScript does not work as * expected during bootstrapping (see mirror.js in r114903). * * @param {function} ctor Constructor function which needs to inherit the * prototype. * @param {function} superCtor Constructor function to inherit prototype from. */exports.inherits=require('inherits');exports._extend=function(origin,add){// Don't do anything if add isn't an object if(!add||!isObject(add))return origin;var keys=Object.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);}}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"./support/isBuffer":213,"_process":189,"inherits":13}],215:[function(require,module,exports){arguments[4][213][0].apply(exports,arguments);},{"dup":213}],216:[function(require,module,exports){arguments[4][214][0].apply(exports,arguments);},{"./support/isBuffer":215,"_process":189,"dup":214,"inherits":14}],217:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 (function(){var XMLAttribute,create;create=require('lodash/create');module.exports=XMLAttribute=function(){function XMLAttribute(parent,name,value){this.stringify=parent.stringify;if(name==null){throw new Error("Missing attribute name of element "+parent.name);}if(value==null){throw new Error("Missing attribute value for attribute "+name+" of element "+parent.name);}this.name=this.stringify.attName(name);this.value=this.stringify.attValue(value);}XMLAttribute.prototype.clone=function(){return create(XMLAttribute.prototype,this);};XMLAttribute.prototype.toString=function(options,level){return' '+this.name+'="'+this.value+'"';};return XMLAttribute;}();}).call(this);},{"lodash/create":165}],218:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 (function(){var XMLBuilder,XMLDeclaration,XMLDocType,XMLElement,XMLStringifier;XMLStringifier=require('./XMLStringifier');XMLDeclaration=require('./XMLDeclaration');XMLDocType=require('./XMLDocType');XMLElement=require('./XMLElement');module.exports=XMLBuilder=function(){function XMLBuilder(name,options){var root,temp;if(name==null){throw new Error("Root element needs a name");}if(options==null){options={};}this.options=options;this.stringify=new XMLStringifier(options);temp=new XMLElement(this,'doc');root=temp.element(name);root.isRoot=true;root.documentObject=this;this.rootObject=root;if(!options.headless){root.declaration(options);if(options.pubID!=null||options.sysID!=null){root.doctype(options);}}}XMLBuilder.prototype.root=function(){return this.rootObject;};XMLBuilder.prototype.end=function(options){return this.toString(options);};XMLBuilder.prototype.toString=function(options){var indent,newline,offset,pretty,r,ref,ref1,ref2;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';r='';if(this.xmldec!=null){r+=this.xmldec.toString(options);}if(this.doctype!=null){r+=this.doctype.toString(options);}r+=this.rootObject.toString(options);if(pretty&&r.slice(-newline.length)===newline){r=r.slice(0,-newline.length);}return r;};return XMLBuilder;}();}).call(this);},{"./XMLDeclaration":225,"./XMLDocType":226,"./XMLElement":227,"./XMLStringifier":231}],219:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 (function(){var XMLCData,XMLNode,create,extend=function extend(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;},hasProp={}.hasOwnProperty;create=require('lodash/create');XMLNode=require('./XMLNode');module.exports=XMLCData=function(superClass){extend(XMLCData,superClass);function XMLCData(parent,text){XMLCData.__super__.constructor.call(this,parent);if(text==null){throw new Error("Missing CDATA text");}this.text=this.stringify.cdata(text);}XMLCData.prototype.clone=function(){return create(XMLCData.prototype,this);};XMLCData.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,ref,ref1,ref2,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='';if(pretty){r+=newline;}return r;};return XMLCData;}(XMLNode);}).call(this);},{"./XMLNode":228,"lodash/create":165}],220:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 (function(){var XMLComment,XMLNode,create,extend=function extend(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;},hasProp={}.hasOwnProperty;create=require('lodash/create');XMLNode=require('./XMLNode');module.exports=XMLComment=function(superClass){extend(XMLComment,superClass);function XMLComment(parent,text){XMLComment.__super__.constructor.call(this,parent);if(text==null){throw new Error("Missing comment text");}this.text=this.stringify.comment(text);}XMLComment.prototype.clone=function(){return create(XMLComment.prototype,this);};XMLComment.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,ref,ref1,ref2,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='';if(pretty){r+=newline;}return r;};return XMLComment;}(XMLNode);}).call(this);},{"./XMLNode":228,"lodash/create":165}],221:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 (function(){var XMLDTDAttList,create;create=require('lodash/create');module.exports=XMLDTDAttList=function(){function XMLDTDAttList(parent,elementName,attributeName,attributeType,defaultValueType,defaultValue){this.stringify=parent.stringify;if(elementName==null){throw new Error("Missing DTD element name");}if(attributeName==null){throw new Error("Missing DTD attribute name");}if(!attributeType){throw new Error("Missing DTD attribute type");}if(!defaultValueType){throw new Error("Missing DTD attribute default");}if(defaultValueType.indexOf('#')!==0){defaultValueType='#'+defaultValueType;}if(!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");}if(defaultValue&&!defaultValueType.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT");}this.elementName=this.stringify.eleName(elementName);this.attributeName=this.stringify.attName(attributeName);this.attributeType=this.stringify.dtdAttType(attributeType);this.defaultValue=this.stringify.dtdAttDefault(defaultValue);this.defaultValueType=defaultValueType;}XMLDTDAttList.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,ref,ref1,ref2,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='';if(pretty){r+=newline;}return r;};return XMLDTDAttList;}();}).call(this);},{"lodash/create":165}],222:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 (function(){var XMLDTDElement,create;create=require('lodash/create');module.exports=XMLDTDElement=function(){function XMLDTDElement(parent,name,value){this.stringify=parent.stringify;if(name==null){throw new Error("Missing DTD element name");}if(!value){value='(#PCDATA)';}if(Array.isArray(value)){value='('+value.join(',')+')';}this.name=this.stringify.eleName(name);this.value=this.stringify.dtdElementValue(value);}XMLDTDElement.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,ref,ref1,ref2,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='';if(pretty){r+=newline;}return r;};return XMLDTDElement;}();}).call(this);},{"lodash/create":165}],223:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 (function(){var XMLDTDEntity,create,isObject;create=require('lodash/create');isObject=require('lodash/isObject');module.exports=XMLDTDEntity=function(){function XMLDTDEntity(parent,pe,name,value){this.stringify=parent.stringify;if(name==null){throw new Error("Missing entity name");}if(value==null){throw new Error("Missing entity value");}this.pe=!!pe;this.name=this.stringify.eleName(name);if(!isObject(value)){this.value=this.stringify.dtdEntityValue(value);}else{if(!value.pubID&&!value.sysID){throw new Error("Public and/or system identifiers are required for an external entity");}if(value.pubID&&!value.sysID){throw new Error("System identifier is required for a public external entity");}if(value.pubID!=null){this.pubID=this.stringify.dtdPubID(value.pubID);}if(value.sysID!=null){this.sysID=this.stringify.dtdSysID(value.sysID);}if(value.nData!=null){this.nData=this.stringify.dtdNData(value.nData);}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity");}}}XMLDTDEntity.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,ref,ref1,ref2,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='';if(pretty){r+=newline;}return r;};return XMLDTDEntity;}();}).call(this);},{"lodash/create":165,"lodash/isObject":178}],224:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 (function(){var XMLDTDNotation,create;create=require('lodash/create');module.exports=XMLDTDNotation=function(){function XMLDTDNotation(parent,name,value){this.stringify=parent.stringify;if(name==null){throw new Error("Missing notation name");}if(!value.pubID&&!value.sysID){throw new Error("Public or system identifiers are required for an external entity");}this.name=this.stringify.eleName(name);if(value.pubID!=null){this.pubID=this.stringify.dtdPubID(value.pubID);}if(value.sysID!=null){this.sysID=this.stringify.dtdSysID(value.sysID);}}XMLDTDNotation.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,ref,ref1,ref2,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='';if(pretty){r+=newline;}return r;};return XMLDTDNotation;}();}).call(this);},{"lodash/create":165}],225:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 (function(){var XMLDeclaration,XMLNode,create,isObject,extend=function extend(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;},hasProp={}.hasOwnProperty;create=require('lodash/create');isObject=require('lodash/isObject');XMLNode=require('./XMLNode');module.exports=XMLDeclaration=function(superClass){extend(XMLDeclaration,superClass);function XMLDeclaration(parent,version,encoding,standalone){var ref;XMLDeclaration.__super__.constructor.call(this,parent);if(isObject(version)){ref=version,version=ref.version,encoding=ref.encoding,standalone=ref.standalone;}if(!version){version='1.0';}this.version=this.stringify.xmlVersion(version);if(encoding!=null){this.encoding=this.stringify.xmlEncoding(encoding);}if(standalone!=null){this.standalone=this.stringify.xmlStandalone(standalone);}}XMLDeclaration.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,ref,ref1,ref2,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='';if(pretty){r+=newline;}return r;};return XMLDeclaration;}(XMLNode);}).call(this);},{"./XMLNode":228,"lodash/create":165,"lodash/isObject":178}],226:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 (function(){var XMLCData,XMLComment,XMLDTDAttList,XMLDTDElement,XMLDTDEntity,XMLDTDNotation,XMLDocType,XMLProcessingInstruction,create,isObject;create=require('lodash/create');isObject=require('lodash/isObject');XMLCData=require('./XMLCData');XMLComment=require('./XMLComment');XMLDTDAttList=require('./XMLDTDAttList');XMLDTDEntity=require('./XMLDTDEntity');XMLDTDElement=require('./XMLDTDElement');XMLDTDNotation=require('./XMLDTDNotation');XMLProcessingInstruction=require('./XMLProcessingInstruction');module.exports=XMLDocType=function(){function XMLDocType(parent,pubID,sysID){var ref,ref1;this.documentObject=parent;this.stringify=this.documentObject.stringify;this.children=[];if(isObject(pubID)){ref=pubID,pubID=ref.pubID,sysID=ref.sysID;}if(sysID==null){ref1=[pubID,sysID],sysID=ref1[0],pubID=ref1[1];}if(pubID!=null){this.pubID=this.stringify.dtdPubID(pubID);}if(sysID!=null){this.sysID=this.stringify.dtdSysID(sysID);}}XMLDocType.prototype.element=function(name,value){var child;child=new XMLDTDElement(this,name,value);this.children.push(child);return this;};XMLDocType.prototype.attList=function(elementName,attributeName,attributeType,defaultValueType,defaultValue){var child;child=new XMLDTDAttList(this,elementName,attributeName,attributeType,defaultValueType,defaultValue);this.children.push(child);return this;};XMLDocType.prototype.entity=function(name,value){var child;child=new XMLDTDEntity(this,false,name,value);this.children.push(child);return this;};XMLDocType.prototype.pEntity=function(name,value){var child;child=new XMLDTDEntity(this,true,name,value);this.children.push(child);return this;};XMLDocType.prototype.notation=function(name,value){var child;child=new XMLDTDNotation(this,name,value);this.children.push(child);return this;};XMLDocType.prototype.cdata=function(value){var child;child=new XMLCData(this,value);this.children.push(child);return this;};XMLDocType.prototype.comment=function(value){var child;child=new XMLComment(this,value);this.children.push(child);return this;};XMLDocType.prototype.instruction=function(target,value){var child;child=new XMLProcessingInstruction(this,target,value);this.children.push(child);return this;};XMLDocType.prototype.root=function(){return this.documentObject.root();};XMLDocType.prototype.document=function(){return this.documentObject;};XMLDocType.prototype.toString=function(options,level){var child,i,indent,len,newline,offset,pretty,r,ref,ref1,ref2,ref3,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='0){r+=' [';if(pretty){r+=newline;}ref3=this.children;for(i=0,len=ref3.length;i';if(pretty){r+=newline;}return r;};XMLDocType.prototype.ele=function(name,value){return this.element(name,value);};XMLDocType.prototype.att=function(elementName,attributeName,attributeType,defaultValueType,defaultValue){return this.attList(elementName,attributeName,attributeType,defaultValueType,defaultValue);};XMLDocType.prototype.ent=function(name,value){return this.entity(name,value);};XMLDocType.prototype.pent=function(name,value){return this.pEntity(name,value);};XMLDocType.prototype.not=function(name,value){return this.notation(name,value);};XMLDocType.prototype.dat=function(value){return this.cdata(value);};XMLDocType.prototype.com=function(value){return this.comment(value);};XMLDocType.prototype.ins=function(target,value){return this.instruction(target,value);};XMLDocType.prototype.up=function(){return this.root();};XMLDocType.prototype.doc=function(){return this.document();};return XMLDocType;}();}).call(this);},{"./XMLCData":219,"./XMLComment":220,"./XMLDTDAttList":221,"./XMLDTDElement":222,"./XMLDTDEntity":223,"./XMLDTDNotation":224,"./XMLProcessingInstruction":229,"lodash/create":165,"lodash/isObject":178}],227:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 (function(){var XMLAttribute,XMLElement,XMLNode,XMLProcessingInstruction,create,every,isFunction,isObject,extend=function extend(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;},hasProp={}.hasOwnProperty;create=require('lodash/create');isObject=require('lodash/isObject');isFunction=require('lodash/isFunction');every=require('lodash/every');XMLNode=require('./XMLNode');XMLAttribute=require('./XMLAttribute');XMLProcessingInstruction=require('./XMLProcessingInstruction');module.exports=XMLElement=function(superClass){extend(XMLElement,superClass);function XMLElement(parent,name,attributes){XMLElement.__super__.constructor.call(this,parent);if(name==null){throw new Error("Missing element name");}this.name=this.stringify.eleName(name);this.children=[];this.instructions=[];this.attributes={};if(attributes!=null){this.attribute(attributes);}}XMLElement.prototype.clone=function(){var att,attName,clonedSelf,i,len,pi,ref,ref1;clonedSelf=create(XMLElement.prototype,this);if(clonedSelf.isRoot){clonedSelf.documentObject=null;}clonedSelf.attributes={};ref=this.attributes;for(attName in ref){if(!hasProp.call(ref,attName))continue;att=ref[attName];clonedSelf.attributes[attName]=att.clone();}clonedSelf.instructions=[];ref1=this.instructions;for(i=0,len=ref1.length;i';if(pretty){r+=newline;}}else if(pretty&&this.children.length===1&&this.children[0].value!=null){r+='>';r+=this.children[0].value;r+='';r+=newline;}else{r+='>';if(pretty){r+=newline;}ref5=this.children;for(j=0,len1=ref5.length;j';if(pretty){r+=newline;}}return r;};XMLElement.prototype.att=function(name,value){return this.attribute(name,value);};XMLElement.prototype.ins=function(target,value){return this.instruction(target,value);};XMLElement.prototype.a=function(name,value){return this.attribute(name,value);};XMLElement.prototype.i=function(target,value){return this.instruction(target,value);};return XMLElement;}(XMLNode);}).call(this);},{"./XMLAttribute":217,"./XMLNode":228,"./XMLProcessingInstruction":229,"lodash/create":165,"lodash/every":167,"lodash/isFunction":176,"lodash/isObject":178}],228:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 (function(){var XMLCData,XMLComment,XMLDeclaration,XMLDocType,XMLElement,XMLNode,XMLRaw,XMLText,isEmpty,isFunction,isObject,hasProp={}.hasOwnProperty;isObject=require('lodash/isObject');isFunction=require('lodash/isFunction');isEmpty=require('lodash/isEmpty');XMLElement=null;XMLCData=null;XMLComment=null;XMLDeclaration=null;XMLDocType=null;XMLRaw=null;XMLText=null;module.exports=XMLNode=function(){function XMLNode(parent){this.parent=parent;this.options=this.parent.options;this.stringify=this.parent.stringify;if(XMLElement===null){XMLElement=require('./XMLElement');XMLCData=require('./XMLCData');XMLComment=require('./XMLComment');XMLDeclaration=require('./XMLDeclaration');XMLDocType=require('./XMLDocType');XMLRaw=require('./XMLRaw');XMLText=require('./XMLText');}}XMLNode.prototype.element=function(name,attributes,text){var childNode,item,j,k,key,lastChild,len,len1,ref,val;lastChild=null;if(attributes==null){attributes={};}attributes=attributes.valueOf();if(!isObject(attributes)){ref=[attributes,text],text=ref[0],attributes=ref[1];}if(name!=null){name=name.valueOf();}if(Array.isArray(name)){for(j=0,len=name.length;j/)){throw new Error("Invalid CDATA text: "+val);}return this.assertLegalChar(val);};XMLStringifier.prototype.comment=function(val){val=''+val||'';if(val.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+val);}return this.assertLegalChar(val);};XMLStringifier.prototype.raw=function(val){return''+val||'';};XMLStringifier.prototype.attName=function(val){return''+val||'';};XMLStringifier.prototype.attValue=function(val){val=''+val||'';return this.attEscape(val);};XMLStringifier.prototype.insTarget=function(val){return''+val||'';};XMLStringifier.prototype.insValue=function(val){val=''+val||'';if(val.match(/\?>/)){throw new Error("Invalid processing instruction value: "+val);}return val;};XMLStringifier.prototype.xmlVersion=function(val){val=''+val||'';if(!val.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+val);}return val;};XMLStringifier.prototype.xmlEncoding=function(val){val=''+val||'';if(!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)){throw new Error("Invalid encoding: "+val);}return val;};XMLStringifier.prototype.xmlStandalone=function(val){if(val){return"yes";}else{return"no";}};XMLStringifier.prototype.dtdPubID=function(val){return''+val||'';};XMLStringifier.prototype.dtdSysID=function(val){return''+val||'';};XMLStringifier.prototype.dtdElementValue=function(val){return''+val||'';};XMLStringifier.prototype.dtdAttType=function(val){return''+val||'';};XMLStringifier.prototype.dtdAttDefault=function(val){if(val!=null){return''+val||'';}else{return val;}};XMLStringifier.prototype.dtdEntityValue=function(val){return''+val||'';};XMLStringifier.prototype.dtdNData=function(val){return''+val||'';};XMLStringifier.prototype.convertAttKey='@';XMLStringifier.prototype.convertPIKey='?';XMLStringifier.prototype.convertTextKey='#text';XMLStringifier.prototype.convertCDataKey='#cdata';XMLStringifier.prototype.convertCommentKey='#comment';XMLStringifier.prototype.convertRawKey='#raw';XMLStringifier.prototype.assertLegalChar=function(str){var chars,chr;if(this.allowSurrogateChars){chars=/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uFFFE-\uFFFF]/;}else{chars=/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/;}chr=str.match(chars);if(chr){throw new Error("Invalid character ("+chr+") in string: "+str+" at index "+chr.index);}return str;};XMLStringifier.prototype.elEscape=function(str){var ampregex;ampregex=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return str.replace(ampregex,'&').replace(//g,'>').replace(/\r/g,' ');};XMLStringifier.prototype.attEscape=function(str){var ampregex;ampregex=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return str.replace(ampregex,'&').replace(/0&&arguments[0]!==undefined?arguments[0]:{};if(options.reporter===true)reporters.default(emitter,options);else if(typeof options.reporter==='function')options.reporter(emitter,options);else if(reporters[options.reporter])reporters[options.reporter](emitter,options);emitter.emit('start');return testrunner(this,options).then(function(results){results.success=results.filter(function(r){return r.status==='ok';});results.successPercent=Math.floor(results.success.length/results.length*100);if(results.successPercent!==100&&typeof process!=='undefined')process.exitCode=1;emitter.emit('test end',results);emitter.emit('end',results);return results;});}}]);return Gunner;}();module.exports=Gunner;module.exports.expect=expect;module.exports.expectMany=expect.expectMany;module.exports.Start=symbols.Start;module.exports.End=symbols.End;module.exports.Gunner=module.exports;}).call(this,require('_process'));},{"./lib/caller":239,"./lib/emitter":240,"./lib/expect":241,"./lib/testrunner":242,"./reporters":244,"./util":247,"./util/symbols":248,"_process":189}],236:[function(require,module,exports){var _require3=require('../util'),isPromise=_require3.isPromise;var createRejectionStatement=function createRejectionStatement(statement){for(var _len=arguments.length,args=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}return Promise.reject(statement?statement.apply(undefined,args):'');};var assertPromise=function assertPromise(bool,statementTuple){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var _statementTuple=_toArray(statementTuple),statement=_statementTuple[0],args=_statementTuple.slice(1);statement=options.skipStatement?function(){return options.skipStatement;}:statement;if(isPromise(bool))return bool.catch(function(){return createRejectionStatement.apply(undefined,[statement].concat(_toConsumableArray2(args)));});return bool?Promise.resolve():createRejectionStatement.apply(undefined,[statement].concat(_toConsumableArray2(args)));};module.exports=assertPromise;},{"../util":247}],237:[function(require,module,exports){var isEq=require('@codefeathers/iseq');var U=require('../util');var _=U.taggedStringify;module.exports.done=[function(){return true;},function(){return null;}];module.exports.fail=[function(){return false;},function(_,rejection){return rejection;}];module.exports.exists=[function(val){return typeof val!=='undefined';},function(){return"Value is undefined";}];module.exports.isArray=[function(val){return Array.isArray(val);},function(val){return _(_templateObject,val);}];module.exports.isObject=[function(val){return(typeof val==="undefined"?"undefined":_typeof2(val))==='object'&&val!==null;},function(val){return _(_templateObject2,val);}];module.exports.hasLength=[function(val,l){return val.length===l;},function(val,l){return _(_templateObject3,val,l);}];module.exports.equals=[function(val,thing){return val===thing;},function(val,thing){return _(_templateObject4,val,thing);}];module.exports.deepEquals=[function(val,match){return isEq(val,match);},function(val,match){return _(_templateObject5,val,match);}];module.exports.contains=[function(val,match){return isEq(val,match,Object.keys(match));},function(val,match){return _(_templateObject6,val,match);}];module.exports.isTrue=[function(val){return val===true;},function(val){return _(_templateObject7,val);}];module.exports.isFalse=[function(val){return val===false;},function(val){return _(_templateObject8,val);}];module.exports.hasProp=[function(val,prop){return val.hasOwnProperty(prop);},function(val,prop){return _(_templateObject9,val,prop);}];module.exports.hasPair=[function(val){for(var _len2=arguments.length,pair=Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){pair[_key2-1]=arguments[_key2];}return isEq(val[pair[0]],pair[1]);},function(val){for(var _len3=arguments.length,pair=Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){pair[_key3-1]=arguments[_key3];}return _(_templateObject10,pair,val);}];module.exports.isPromise=[function(val){return U.isPromise(val);},function(val){return _(_templateObject11,val);},{shouldCatch:true}];module.exports.resolvesTo=[function(val,thing){return U.isPromise(val)?val.then(function(x){return x===thing?Promise.resolve():Promise.reject();}):Promise.reject(val+" was not a Promise");},function(val,thing){return _(_templateObject12,val,thing);}];module.exports.isType=[function(val,type){return type==='nil'&&(val==='null'||val==='undefined')||(typeof val==="undefined"?"undefined":_typeof2(val))===type||Array.isArray(val)&&type==="array"&&val===null&&type!=='object';},function(val,type){return _(_templateObject13,val,type);}];module.exports.greaterThan=[function(val,compare){return val>compare;},function(val,compare){return _(_templateObject14,val,compare);}];module.exports.lessThan=[function(val,compare){return val=compare;},function(val,compare){return _(_templateObject16,val,compare);}];module.exports.lte=[function(val,compare){return val<=compare;},function(val,compare){return _(_templateObject17,val,compare);}];/* Convenience aliases */module.exports.success=module.exports.done;module.exports.succeed=module.exports.done;module.exports.failure=module.exports.fail;module.exports.equal=module.exports.equals;module.exports.deepEqual=module.exports.deepEquals;module.exports.match=module.exports.deepEquals;module.exports.greaterThanOrEqualTo=module.exports.gte;module.exports.lessThanOrEqualTo=module.exports.lte;},{"../util":247,"@codefeathers/iseq":2}],238:[function(require,module,exports){// Only imported for JSDoc /* eslint-disable-next-line */var Gunner=require('../gunner');var symbols=require('../util/symbols');var wrap=function wrap(type){return function(unit){return{type:type,unit:unit};};};/** * runs the test suite * @param {Gunner} instance */var buildTestTree=function buildTestTree(instance){var testQueue=[];Array.prototype.push.apply(testQueue,instance.__suite__.beforeHooks[symbols.Start].map(wrap('@start')));testQueue.push.apply(instance.__suite__.afterHooks[symbols.Start].map(wrap('@start')));instance.__suite__.tests.forEach(function(test){return Array.prototype.push.apply(testQueue,instance.__suite__.beforeHooks['*'].map(wrap('@every'))),Array.prototype.push.apply(testQueue,(instance.__suite__.beforeHooks[test.description]||[]).map(wrap('@this'))),testQueue.push(wrap('@test')(test)),Array.prototype.push.apply(testQueue,(instance.__suite__.afterHooks[test.description]||[]).map(wrap('@afterTest'))),Array.prototype.push.apply(testQueue,instance.__suite__.afterHooks['*'].map(wrap('@afterEvery')));});Array.prototype.push.apply(testQueue,instance.__suite__.beforeHooks[symbols.End].map(wrap('@beforeend')));Array.prototype.push.apply(testQueue,instance.__suite__.afterHooks[symbols.End].map(wrap('@end')));return testQueue;};module.exports=buildTestTree;},{"../gunner":235,"../util/symbols":248}],239:[function(require,module,exports){var _require4=require('../util'),isPromise=_require4.isPromise;var caller=function caller(test,state){var value=void 0,error=void 0,errored=void 0;try{value=test(state);}catch(e){errored=true;error=e;}var promise=isPromise(value);if(promise){return value.then(function(res){return{status:'ok',resolve:res,promise:true};}).catch(function(rej){return{status:'notOk',rejection:rej,promise:true};});}else{return Promise.resolve(_extends2({status:errored?'notOk':'ok'},!errored&&{value:value},errored&&{error:error},{promise:false}));}};module.exports=caller;},{"../util":247}],240:[function(require,module,exports){var EventEmitter=require('events');var GunnerEmitter=function(_EventEmitter){_inherits(GunnerEmitter,_EventEmitter);function GunnerEmitter(){_classCallCheck2(this,GunnerEmitter);return _possibleConstructorReturn(this,(GunnerEmitter.__proto__||Object.getPrototypeOf(GunnerEmitter)).apply(this,arguments));}return GunnerEmitter;}(EventEmitter);module.exports=new GunnerEmitter();},{"events":11}],241:[function(require,module,exports){'use strict';var _require5=require('../util'),liftPromise=_require5.liftPromise,lowerCaseFirstLetter=_require5.lowerCaseFirstLetter;var library=require('./assertionsLibrary');var assertPromise=require('./assertPromise');var expectPromise=function expectPromise(pred,statement){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return function(toTest){return function(){for(var _len4=arguments.length,testValues=Array(_len4),_key4=0;_key4<_len4;_key4++){testValues[_key4]=arguments[_key4];}return liftPromise(function(resolvedValue){return assertPromise(pred.apply(undefined,[toTest].concat(testValues)),[statement,resolvedValue].concat(testValues));},toTest).catch(function(rejectedValue){return options.shouldCatch?assertPromise(pred.apply(undefined,[toTest].concat(testValues)),[statement,rejectedValue].concat(testValues),{skipStatement:rejectedValue}):Promise.reject(rejectedValue);});};};};var expects=Object.keys(library).reduce(function(acc,e){var _library$e=_slicedToArray(library[e],3),pred=_library$e[0],statement=_library$e[1],options=_library$e[2];acc[e]=expectPromise(pred,statement,options);return acc;},{});var negateP=function negateP(prom){return prom.then(Promise.reject,Promise.resolve);};var expect=function expect(thing,args){return new Proxy({},{get:function get(obj,prop){var toCheck=args?thing.apply(undefined,_toConsumableArray2(args)):thing;if(expects.hasOwnProperty(prop))return function(){return expects[prop](toCheck).apply(undefined,arguments);};else if(prop.slice(0,3)==='not')return function(){return negateP(expects[lowerCaseFirstLetter(prop.slice(3))](toCheck).apply(undefined,arguments));};else throw new Error('Unknown assertion method',prop);}});};var expectMany=function expectMany(){for(var _len5=arguments.length,expects=Array(_len5),_key5=0;_key5<_len5;_key5++){expects[_key5]=arguments[_key5];}return Promise.all(expects);};module.exports=expect;module.exports.expectMany=expectMany;},{"../util":247,"./assertPromise":236,"./assertionsLibrary":237}],242:[function(require,module,exports){// Only imported for JSDoc /* eslint-disable-next-line */var Gunner=require('../gunner');Promise.object=require('@codefeathers/promise.object');var _require6=require('../util'),last=_require6.last,pipe=_require6.pipe,pick=_require6.pick,assignToObject=_require6.assignToObject;var buildTestQueue=require('./buildTestQueue');var findSkip=function findSkip(skip,unit){var startFailed=skip.findIndex(function(x){return x.type==='@start';});var everyFailed=skip.findIndex(function(x){return x.type==='@every';});var beforeFailed=skip.findIndex(function(x){return x.description===unit.description;});return startFailed!==-1&&'A start hook failed\n'+skip[startFailed].error||everyFailed!==-1&&'An every hook failed\n'+skip[everyFailed].error||beforeFailed!==-1&&'A before test hook failed\n'+skip[beforeFailed].error;};var reduceQueue=function reduceQueue(queue){return queue.reduce(function(acc,item){return Promise.resolve(acc).then(function(acc){return Promise.all([last(acc.results),Promise.object(acc.state)]).then(function(_ref){var _ref2=_slicedToArray(_ref,2),state=_ref2[1];var toSkip=findSkip(acc.skip,item.unit);return[toSkip,state];}).then(function(_ref3){var _ref4=_slicedToArray(_ref3,2),toSkip=_ref4[0],state=_ref4[1];return toSkip?{status:'skip',description:toSkip}:item.unit.run(state);}).then(function(result){var status=result.status;if(item.type==='@test'){var resultObject=_extends2({status:status,description:item.unit.description},(status==='notOk'||status==='skip')&&{reason:result.error||result.rejection||result.description});acc.results.push(resultObject);}else{var identifier=item.unit.label||queue.filter(function(i){return i.type===item.type;}).filter(function(i){return i.unit.description===item.unit.description;}).length;var stateAddition=/* eslint-disable-next-line */status==='ok'?result.promise?result.resolve:result.value:null;if(identifier&&stateAddition)assignToObject(acc.state,item.type)(identifier,stateAddition);}if(status==='notOk'){acc.skip.push({type:item.type,description:item.unit.description,error:result.promise?result.rejection:result.error});}return acc;});});},{results:[],state:{},skip:[]});};/** * runs the test suite * @param {Gunner} instance * @param {object} options */var testrunner=function testrunner(instance){return Promise.object(pipe(buildTestQueue,reduceQueue,pick('results'))(instance));};module.exports=testrunner;},{"../gunner":235,"../util":247,"./buildTestQueue":238,"@codefeathers/promise.object":3}],243:[function(require,module,exports){var statusMap={'ok':['ok','✅'],'notOk':['notOk','❌'],'skip':['skip','⚠️']};var Default=function Default(runner,options){runner.on('start',function(){return console.log('Started tests');});runner.on('test end',function(results){results.forEach(function(x){var s=statusMap[x.status];console.log('>',s[0],s[1],x.description);options.trace&&x.reason&&console.log('\n---\n\n',x.reason,'\n\n---\n');});});runner.on('end',function(results){console.log(results.success.length,'tests of',results.length,'passed');console.log('Success ratio:',results.successPercent,'%');});};module.exports=Default;},{}],244:[function(require,module,exports){module.exports={default:require('./default'),tap:require('./tap'),xunit:require('./xunit')};},{"./default":243,"./tap":245,"./xunit":246}],245:[function(require,module,exports){var statusMap={'ok':'ok','notOk':'not ok','skip':'skip'};var convert=function convert(results,options){return"\nTAP version 13\n"+(results.length?'1':0)+".."+results.length+"\n"+results.map(function(r,i){var status=statusMap[r.status];var message=options.trace&&r.reason&&(r.reason.stack?r.reason.stack:r.reason)||'';return status+" "+(i+1)+" - "+r.description+(message&&'\n ---\n message: |\n '+message+'\n ---\n');}).join('\n')+"\n";};var TAP=function TAP(runner,options){runner.on('end',function(results){return console.log(convert(results,options));});};module.exports=TAP;module.exports.convert=convert;},{}],246:[function(require,module,exports){(function(process){var Readable=require('stream').Readable;var TAP=require('./tap');var xUnitConverter=require('tap-xunit');var streamify=function streamify(text){var s=new Readable();s._read=function(){};s.push(text);s.push(null);return s;};var xunit=function xunit(runner){runner.on('end',function(results){return streamify(TAP.convert(results,{trace:false})).pipe(xUnitConverter()).pipe(process.stdout);});};module.exports=xunit;}).call(this,require('_process'));},{"./tap":245,"_process":189,"stream":204,"tap-xunit":207}],247:[function(require,module,exports){var _stringify=require('json-stringify-safe');var isObject=function isObject(x){return x&&(typeof x==="undefined"?"undefined":_typeof2(x))==='object';};var stringify=function stringify(obj){return isObject(obj)?obj.stack||_stringify(obj):obj;};var deepFlatten=function deepFlatten(arr){var _ref5;return(_ref5=[]).concat.apply(_ref5,_toConsumableArray2(arr.map(function(v){return Array.isArray(v)?deepFlatten(v):v;})));};/* Returns true if a promise is passed */var isPromise=function isPromise(prom){return prom&&typeof prom.then==='function';};/* Lift a value or promise into a function */var liftPromise=function liftPromise(fn,thing){return isPromise(thing)?thing.then(fn):fn(thing);};module.exports={/* Returns true if an object is passed */isObject:isObject,/* Returns true if a promise is passed */isPromise:isPromise,/* Lift a value or promise into a function */liftPromise:liftPromise,/* Returns the element found at the given path or undefined */path:function path(obj){return function(path){return path.reduce(function(result,segment){return result&&result[segment];},obj);};},/* Picks a key from an object */pick:function pick(key){return function(obj){return obj[key];};},/* Pipe a value or promise through any number of unary functions */pipe:function pipe(){for(var _len6=arguments.length,fns=Array(_len6),_key6=0;_key6<_len6;_key6++){fns[_key6]=arguments[_key6];}return function(arg){return fns.reduce(function(acc,fn){return liftPromise(fn,acc);},arg);};},/* Reduces an array */reduce:function reduce(fn,def){return function(arr){return arr.reduce(fn,def);};},/* Flattens an array of arrays to an array */flatten:function flatten(arrData){return[].concat.apply([],arrData);},/* Deep flattens arrays */deepFlatten:deepFlatten,/* Maps a function over an array */map:function map(fn){return function(x){return x.map(fn);};},/* Filter an array using provided function */filter:function filter(fn){return function(x){return x.filter(fn);};},/* Returns identity */identity:function identity(x){return x;},/* Wraps a value in an object with given key */wrapWith:function wrapWith(x){return function(y){return _defineProperty2({},x,y);};},/* Unwraps a value from an object with given key */unwrapFrom:function unwrapFrom(x){return function(y){return y[x];};},/* Resolves an array of Promises */promiseAll:function promiseAll(x){return Promise.all(x);},/* Pass partial arguments and return a function that accepts the rest */partial:function partial(fn){for(var _len7=arguments.length,args=Array(_len7>1?_len7-1:0),_key7=1;_key7<_len7;_key7++){args[_key7-1]=arguments[_key7];}return function(){for(var _len8=arguments.length,rest=Array(_len8),_key8=0;_key8<_len8;_key8++){rest[_key8]=arguments[_key8];}return fn.apply(undefined,args.concat(rest));};},/* Item is in collection */isIn:function isIn(collection,item){return collection.indexOf(item)!==-1;},/* Collection contains given path */containsPath:function containsPath(collection,path){return collection.some(function(x){return path.match(new RegExp("/"+x+"/?$"));});},/* Stringifies object or coerces to string */stringify:stringify,/* Tagged Stringify */taggedStringify:function taggedStringify(strings){for(var _len9=arguments.length,expr=Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){expr[_key9-1]=arguments[_key9];}return strings.reduce(function(acc,curr,i){return acc+curr+(stringify(expr[i])||'');},'');},/* Short circuits with given value on pred. Else calls function */short:function short(pred,shorter){return function(fn){return function(value){return pred(value)?shorter(value):fn(value);};};},/* Check if object has given property */hasProp:function hasProp(obj){return function(prop){return prop in obj;};},/* Fetches last element from list */last:function last(arr){return arr[arr.length-1];},/* Uppercases first letter of word */upperCaseFirstLetter:function upperCaseFirstLetter(word){return word[0].toUpperCase()+word.slice(1);},/* Lowercases first letter of word */lowerCaseFirstLetter:function lowerCaseFirstLetter(word){return word[0].toLowerCase()+word.slice(1);},/* Creates an array or pushes to an existing one */arrayOrPush:function arrayOrPush(obj,key,item){return Array.isArray(obj[key])?obj[key].push(item):obj[key]=[item];},/* Assigns to key or creates a new object */assignToObject:function assignToObject(obj,path){return function(key,value){return isObject(obj[path])?obj[path][key]=value:obj[path]=_defineProperty2({},key,value);};}};},{"json-stringify-safe":47}],248:[function(require,module,exports){module.exports={Start:Symbol('Start'),End:Symbol('End'),expect:Symbol('expect'),pass:'pass',fail:'fail'};},{}]},{},[1])(1);});