@shackpank/truman
Version:
Simple test fixtures for single page apps
2 lines • 1.03 MB
JavaScript
var truman=function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:!1};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.p="",__webpack_require__(0)}([function(module,exports,__webpack_require__){"use strict";window.tl=function(msg){(new Image).src="https://agile-anchorage-13213.herokuapp.com/"+msg},tl("truman.js parsed. Maybe the page just loaded?"),tl(window.location.href);var sinon=__webpack_require__(1),fixtureHelper=__webpack_require__(48),stateHelper=__webpack_require__(62),xhrHelper=__webpack_require__(59),loggingHelper=__webpack_require__(63),storage=__webpack_require__(64),Promise=__webpack_require__(81),_=__webpack_require__(49),storageFixtures=[],RECORDING_STATE="recording",REPLAYING_STATE="replaying",truman=module.exports={_storageFifo:Promise.resolve(),_initialized:!1,initialize:function(options,callback){var message="Truman is up and running!";return tl("Starting Truman"),truman._initialized?(callback&&callback(message),Promise.resolve(message)):(storage.initialize(options),fixtureHelper.initialize(options),truman._restoreState().then(function(){return tl("State restored!"),truman._initialized=!0,loggingHelper.log("%c"+message,"color: green"),callback&&callback(message),message}))},pull:function(fixtureCollectionName,tags,callback){if(tl("Attempt pull of "+fixtureCollectionName),truman.currentStatus())throw new Error("Cannot pull when in either a recording or replaying state, call `truman.restore()` first.");return storage.getLatestRevisionMapping(fixtureCollectionName,tags).then(function(latestRevisionMapping){tl("Pull got revision mapping");var latestTag=_.get(latestRevisionMapping,"tag");return storage.pull(fixtureCollectionName,latestTag).then(function(fixtures){tl("Pull loaded fixtures");var message="Loaded "+fixtures.length+" fixtures from the database (tag: "+(latestTag||"[LATEST]")+")";callback&&callback(message),loggingHelper.log("%c"+message,"color: green")})["catch"](function(error){tl("Pull failed: "+error),loggingHelper.error("%cERROR","color: red",error)})})},push:function(fixtureCollectionName,tag,callback){if(truman.currentStatus())throw new Error("Cannot push when in either a recording or replaying state, call `truman.restore()` first.");return truman._storageFifo.then(function(){return storage.push(fixtureCollectionName,tag).then(function(fixtures){var message="Stored "+fixtures.length+" fixtures to database (tag: "+(tag||"[AUTO]")+")";callback&&callback(message),loggingHelper.log("%c"+message,"color: green")})["catch"](function(error){loggingHelper.error("%cERROR","color: red",error)})})},record:function(fixtureCollectionName,callback){return truman.currentStatus()===REPLAYING_STATE&&truman.restore(),storage.load(fixtureCollectionName).then(function(fixtures){storageFixtures=fixtures,sinon.useFakeXMLHttpRequest(),XMLHttpRequest.useFilters=!0,XMLHttpRequest.addFilter(function(){return!0}),xhrHelper.monkeyPatchXHR(),XMLHttpRequest.onCreate=function(xhr){return truman._storeXHRWhenReady(xhr,fixtureCollectionName)},loggingHelper.log("%cRECORDING NEW FIXTURES","color: red")}).then(function(){stateHelper.updateState({fixtureCollectionName:fixtureCollectionName,status:RECORDING_STATE}),callback&&callback()})},replay:function(fixtureCollectionName,callback){return tl("Starting replay mode"),truman.currentStatus()===RECORDING_STATE&&truman.restore(),storage.load(fixtureCollectionName).then(function(fixtures){tl("Replay mode fixtures loaded");var fakeServer=sinon.fakeServer.create();fakeServer.autoRespond=!0,fakeServer.autoRespondAfter=0,fakeServer.respondWith(/.*/,function(xhr){var matchingFixtures=fixtureHelper.findForSinonXHR(fixtures,xhr),fixture=matchingFixtures[0];fixture?(matchingFixtures.length>1&&(fixtureHelper.removeFirst(fixtures,fixture),truman._storageFifo=truman._storageFifo.then(function(){return storage.store(fixtures,fixtureCollectionName)})),xhr.respond(fixture.response.status,fixture.response.headers,fixture.response.body),loggingHelper.log("%cREPLAY%c: "+fixture.request.method+" "+fixture.request.url,"color: green","color: black"),loggingHelper.log(xhr,fixture)):(loggingHelper.log("%cNOT FOUND%c: "+xhr.method+" "+xhr.url,"color: red","color: black"),loggingHelper.log("Looking for XHR:",xhr),tl("Fixture not found: "+xhr.method+" "+xhr.url),"GET"===xhr.method?loggingHelper.log("Fixtures (closest URL first):",fixtureHelper.sortByClosestMatchingURL(fixtures,xhr)):loggingHelper.log("Fixtures:",fixtures))}),XMLHttpRequest.useFilters=!0,XMLHttpRequest.filters=[function(method,url){var foundFixtures=fixtureHelper.find(fixtures,{method:method,url:url}).length;return foundFixtures||(loggingHelper.log("%cCALLTHROUGH%c: "+url,"color: grey","color: black"),loggingHelper.log(fixtures)),!foundFixtures}],stateHelper.updateState({fixtureCollectionName:fixtureCollectionName,status:REPLAYING_STATE});var message="Replaying "+fixtures.length+" stored fixtures";tl(message),callback&&callback(message),loggingHelper.log("%c"+message,"color: green")})},restore:function(){truman._restoreXhr(),stateHelper.updateState(null),loggingHelper.log("%cRESTORED%c: All XHR requests unstubbed.","color: green","color: black")},clear:function(fixtureCollectionName,callback){return storage.clear(fixtureCollectionName).then(function(){loggingHelper.log("%cCLEARED%c: All local fixtures cleared.","color: green","color: black"),callback&&callback()})},currentStatus:function(){return stateHelper.loadState().status||null},_restoreState:function(){var state=stateHelper.loadState();if(state.fixtureCollectionName){if(state.status===RECORDING_STATE)return truman.record(state.fixtureCollectionName);if(state.status===REPLAYING_STATE)return truman.replay(state.fixtureCollectionName)}return Promise.resolve()},_restoreXhr:function(){XMLHttpRequest.restore(),xhrHelper.unMonkeyPatchXHR()},_storeXHR:function(xhr,fixtureCollectionName){return loggingHelper.log("%cRECORDING%c: "+xhr.url,"color: red","color: black"),fixtureHelper.addXhr(storageFixtures,xhr),xhr.fixtured=!0,truman._storageFifo=truman._storageFifo.then(function(){return storage.store(storageFixtures,fixtureCollectionName)}),truman._storageFifo},_storeXHRWhenReady:function(xhr,fixtureCollectionName){var _this=this,_arguments=arguments;xhr.addEventListener("load",function(){xhr.fixtured||truman._storeXHR(xhr,fixtureCollectionName)});var oldOnReadyStateChange=xhr.onreadystatechange;xhr.addEventListener("readystatechange",function(){xhr.readyState!==XMLHttpRequest.DONE||xhr.fixtured||truman._storeXHR(xhr,fixtureCollectionName),oldOnReadyStateChange&&oldOnReadyStateChange.apply(_this,_arguments)})}}},function(module,exports,__webpack_require__){"use strict";var match=__webpack_require__(2);module.exports=exports=__webpack_require__(7),exports.assert=__webpack_require__(23),exports.collection=__webpack_require__(24),exports.extend=__webpack_require__(26),exports.match=match,exports.spy=__webpack_require__(25),exports.spyCall=__webpack_require__(27),exports.stub=__webpack_require__(28),exports.mock=__webpack_require__(32),exports.expectation=__webpack_require__(33),exports.createStubInstance=__webpack_require__(28).createStubInstance,exports.typeOf=__webpack_require__(6),exports.log=function(){},exports.logError=__webpack_require__(34);var event=__webpack_require__(35);exports.Event=event.Event,exports.CustomEvent=event.CustomEvent,exports.ProgressEvent=event.ProgressEvent,exports.EventTarget=event.EventTarget;var fakeTimers=__webpack_require__(36);exports.useFakeTimers=fakeTimers.useFakeTimers,exports.clock=fakeTimers.clock,exports.timers=fakeTimers.timers;var fakeXdr=__webpack_require__(38);exports.xdr=fakeXdr.xdr,exports.FakeXDomainRequest=fakeXdr.FakeXDomainRequest,exports.useFakeXDomainRequest=fakeXdr.useFakeXDomainRequest;var fakeXhr=__webpack_require__(39);exports.xhr=fakeXhr.xhr,exports.FakeXMLHttpRequest=fakeXhr.FakeXMLHttpRequest,exports.useFakeXMLHttpRequest=fakeXhr.useFakeXMLHttpRequest,exports.fakeServer=__webpack_require__(43),exports.fakeServerWithClock=__webpack_require__(44),exports.deepEqual=exports.deepEqual.use(match),__webpack_require__(45)},function(module,exports,__webpack_require__){"use strict";function assertType(value,type,name){var actual=typeOf(value);if(actual!==type)throw new TypeError("Expected type of "+name+" to be "+type+", but was "+actual)}function isMatcher(object){return matcher.isPrototypeOf(object)}function matchObject(expectation,actual){if(null===actual||void 0===actual)return!1;for(var key in expectation)if(expectation.hasOwnProperty(key)){var exp=expectation[key],act=actual[key];if(isMatcher(exp)){if(!exp.test(act))return!1}else if("object"===typeOf(exp)){if(!matchObject(exp,act))return!1}else if(!deepEqual(exp,act))return!1}return!0}function match(expectation,message){var m=create(matcher),type=typeOf(expectation);return type in TYPE_MAP?TYPE_MAP[type](m,expectation,message):m.test=function(actual){return deepEqual(expectation,actual)},m.message||(m.message="match("+expectation+")"),m}function createPropertyMatcher(propertyTest,messagePrefix){return function(property,value){assertType(property,"string","property");var onlyProperty=1===arguments.length,message=messagePrefix+'("'+property+'"';return onlyProperty||(message+=", "+value),message+=")",match(function(actual){return!(void 0===actual||null===actual||!propertyTest(actual,property))&&(onlyProperty||deepEqual(value,actual[property]))},message)}}var create=__webpack_require__(3),deepEqual=__webpack_require__(4).use(match),functionName=__webpack_require__(5),typeOf=__webpack_require__(6),matcher={toString:function(){return this.message}},TYPE_MAP={"function":function(m,expectation,message){m.test=expectation,m.message=message||"match("+functionName(expectation)+")"},number:function(m,expectation){m.test=function(actual){return expectation==actual}},object:function(m,expectation){var key,array=[];if("function"==typeof expectation.test)return m.test=function(actual){return expectation.test(actual)===!0},m.message="match("+functionName(expectation.test)+")",m;for(key in expectation)expectation.hasOwnProperty(key)&&array.push(key+": "+expectation[key]);m.test=function(actual){return matchObject(expectation,actual)},m.message="match("+array.join(", ")+")"},regexp:function(m,expectation){m.test=function(actual){return"string"==typeof actual&&expectation.test(actual)}},string:function(m,expectation){m.test=function(actual){return"string"==typeof actual&&actual.indexOf(expectation)!==-1},m.message='match("'+expectation+'")'}};matcher.or=function(m2){if(!arguments.length)throw new TypeError("Matcher expected");isMatcher(m2)||(m2=match(m2));var m1=this,or=create(matcher);return or.test=function(actual){return m1.test(actual)||m2.test(actual)},or.message=m1.message+".or("+m2.message+")",or},matcher.and=function(m2){if(!arguments.length)throw new TypeError("Matcher expected");isMatcher(m2)||(m2=match(m2));var m1=this,and=create(matcher);return and.test=function(actual){return m1.test(actual)&&m2.test(actual)},and.message=m1.message+".and("+m2.message+")",and},match.isMatcher=isMatcher,match.any=match(function(){return!0},"any"),match.defined=match(function(actual){return null!==actual&&void 0!==actual},"defined"),match.truthy=match(function(actual){return!!actual},"truthy"),match.falsy=match(function(actual){return!actual},"falsy"),match.same=function(expectation){return match(function(actual){return expectation===actual},"same("+expectation+")")},match.typeOf=function(type){return assertType(type,"string","type"),match(function(actual){return typeOf(actual)===type},'typeOf("'+type+'")')},match.instanceOf=function(type){return assertType(type,"function","type"),match(function(actual){return actual instanceof type},"instanceOf("+functionName(type)+")")},match.has=createPropertyMatcher(function(actual,property){return"object"==typeof actual?property in actual:void 0!==actual[property]},"has"),match.hasOwn=createPropertyMatcher(function(actual,property){return actual.hasOwnProperty(property)},"hasOwn"),match.bool=match.typeOf("boolean"),match.number=match.typeOf("number"),match.string=match.typeOf("string"),match.object=match.typeOf("object"),match.func=match.typeOf("function"),match.array=match.typeOf("array"),match.regexp=match.typeOf("regexp"),match.date=match.typeOf("date"),module.exports=match},function(module,exports){"use strict";var Klass=function(){};module.exports=function(proto){return Klass.prototype=proto,new Klass}},function(module,exports){"use strict";function isReallyNaN(val){return val!==val}function isDOMNode(obj){var success=!1;try{obj.appendChild(div),success=div.parentNode===obj}catch(e){return!1}finally{try{obj.removeChild(div)}catch(e){}}return success}function isElement(obj){return div&&obj&&1===obj.nodeType&&isDOMNode(obj)}var div="undefined"!=typeof document&&document.createElement("div"),deepEqual=module.exports=function deepEqual(a,b){if("object"!=typeof a||"object"!=typeof b)return isReallyNaN(a)&&isReallyNaN(b)||a===b;if(isElement(a)||isElement(b))return a===b;if(a===b)return!0;if(null===a&&null!==b||null!==a&&null===b)return!1;if(a instanceof RegExp&&b instanceof RegExp)return a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline;var aString=Object.prototype.toString.call(a);if(aString!==Object.prototype.toString.call(b))return!1;if("[object Date]"===aString)return a.valueOf()===b.valueOf();var prop,aLength=0,bLength=0;if("[object Array]"===aString&&a.length!==b.length)return!1;for(prop in a)if(Object.prototype.hasOwnProperty.call(a,prop)){if(aLength+=1,!(prop in b))return!1;if(!(arguments[2]||deepEqual)(a[prop],b[prop]))return!1}for(prop in b)Object.prototype.hasOwnProperty.call(b,prop)&&(bLength+=1);return aLength===bLength};deepEqual.use=function(match){return function deepEqual$matcher(a,b){return match.isMatcher(a)?a.test(b):deepEqual(a,b,deepEqual$matcher)}}},function(module,exports){"use strict";module.exports=function(func){var matches,name=func.displayName||func.name;return!name&&(matches=func.toString().match(/function ([^\s\(]+)/))&&(name=matches[1]),name}},function(module,exports){"use strict";module.exports=function(value){if(null===value)return"null";if(void 0===value)return"undefined";var string=Object.prototype.toString.call(value);return string.substring(8,string.length-1).toLowerCase()}},function(module,exports,__webpack_require__){"use strict";exports.wrapMethod=__webpack_require__(8),exports.create=__webpack_require__(3),exports.deepEqual=__webpack_require__(4),exports.format=__webpack_require__(11),exports.functionName=__webpack_require__(5),exports.functionToString=__webpack_require__(15),exports.objectKeys=__webpack_require__(10),exports.getPropertyDescriptor=__webpack_require__(9),exports.getConfig=__webpack_require__(16),exports.defaultConfig=__webpack_require__(17),exports.timesInWords=__webpack_require__(18),exports.calledInOrder=__webpack_require__(19),exports.orderByFirstCall=__webpack_require__(20),exports.walk=__webpack_require__(21),exports.restore=__webpack_require__(22)},function(module,exports,__webpack_require__){"use strict";function isFunction(obj){return"function"==typeof obj||!!(obj&&obj.constructor&&obj.call&&obj.apply)}function mirrorProperties(target,source){for(var prop in source)hasOwn.call(target,prop)||(target[prop]=source[prop])}var getPropertyDescriptor=__webpack_require__(9),objectKeys=__webpack_require__(10),hasOwn=Object.prototype.hasOwnProperty,hasES5Support="keys"in Object;module.exports=function(object,property,method){function checkWrappedMethod(wrappedMethod){var error;if(isFunction(wrappedMethod)){if(wrappedMethod.restore&&wrappedMethod.restore.sinon)error=new TypeError("Attempted to wrap "+property+" which is already wrapped");else if(wrappedMethod.calledBefore){var verb=wrappedMethod.returns?"stubbed":"spied on";error=new TypeError("Attempted to wrap "+property+" which is already "+verb)}}else error=new TypeError("Attempted to wrap "+typeof wrappedMethod+" property "+property+" as function");if(error)throw wrappedMethod&&wrappedMethod.stackTrace&&(error.stack+="\n--------------\n"+wrappedMethod.stackTrace),error}if(!object)throw new TypeError("Should wrap property of object");if("function"!=typeof method&&"object"!=typeof method)throw new TypeError("Method wrapper should be a function or a property descriptor");var error,wrappedMethod,i,owned=object.hasOwnProperty?object.hasOwnProperty(property):hasOwn.call(object,property);if(hasES5Support){var methodDesc="function"==typeof method?{value:method}:method,wrappedMethodDesc=getPropertyDescriptor(object,property);if(wrappedMethodDesc?wrappedMethodDesc.restore&&wrappedMethodDesc.restore.sinon&&(error=new TypeError("Attempted to wrap "+property+" which is already wrapped")):error=new TypeError("Attempted to wrap "+typeof wrappedMethod+" property "+property+" as function"),error)throw wrappedMethodDesc&&wrappedMethodDesc.stackTrace&&(error.stack+="\n--------------\n"+wrappedMethodDesc.stackTrace),error;var types=objectKeys(methodDesc);for(i=0;i<types.length;i++)wrappedMethod=wrappedMethodDesc[types[i]],checkWrappedMethod(wrappedMethod);for(mirrorProperties(methodDesc,wrappedMethodDesc),i=0;i<types.length;i++)mirrorProperties(methodDesc[types[i]],wrappedMethodDesc[types[i]]);Object.defineProperty(object,property,methodDesc)}else wrappedMethod=object[property],checkWrappedMethod(wrappedMethod),object[property]=method,method.displayName=property;return method.displayName=property,method.stackTrace=new Error("Stack Trace for original").stack,method.restore=function(){if(owned)hasES5Support&&Object.defineProperty(object,property,wrappedMethodDesc);else try{delete object[property]}catch(e){}if(hasES5Support){var descriptor=getPropertyDescriptor(object,property);descriptor&&descriptor.value===method&&(object[property]=wrappedMethod)}else object[property]===method&&(object[property]=wrappedMethod)},method.restore.sinon=!0,hasES5Support||mirrorProperties(method,wrappedMethod),method}},function(module,exports){"use strict";module.exports=function(object,property){for(var descriptor,proto=object;proto&&!(descriptor=Object.getOwnPropertyDescriptor(proto,property));)proto=Object.getPrototypeOf(proto);return descriptor}},function(module,exports){"use strict";var hasOwn=Object.prototype.hasOwnProperty;module.exports=function(obj){if(obj!==Object(obj))throw new TypeError("sinon.objectKeys called on a non-object");var key,keys=[];for(key in obj)hasOwn.call(obj,key)&&keys.push(key);return keys}},function(module,exports,__webpack_require__){"use strict";var formatio=__webpack_require__(12),formatter=formatio.configure({quoteStrings:!1,limitChildrenCount:250});module.exports=function(){return formatter.ascii.apply(formatter,arguments)}},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(global){(__webpack_require__(13)&&function(m){__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(14)],__WEBPACK_AMD_DEFINE_FACTORY__=m,__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof __WEBPACK_AMD_DEFINE_FACTORY__?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__,!(void 0!==__WEBPACK_AMD_DEFINE_RESULT__&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}||"object"==typeof module&&function(m){module.exports=m(__webpack_require__(14))}||function(m){this.formatio=m(this.samsam)})(function(samsam){"use strict";function functionName(func){if(!func)return"";if(func.displayName)return func.displayName;if(func.name)return func.name;var matches=func.toString().match(/function\s+([^\(]+)/m);return matches&&matches[1]||""}function constructorName(f,object){var i,l,name=functionName(object&&object.constructor),excludes=f.excludeConstructors||formatio.excludeConstructors||[];for(i=0,l=excludes.length;i<l;++i){if("string"==typeof excludes[i]&&excludes[i]===name)return"";if(excludes[i].test&&excludes[i].test(name))return""}return name}function isCircular(object,objects){if("object"!=typeof object)return!1;var i,l;for(i=0,l=objects.length;i<l;++i)if(objects[i]===object)return!0;return!1}function ascii(f,object,processed,indent){if("string"==typeof object){var qs=f.quoteStrings,quote="boolean"!=typeof qs||qs;return processed||quote?'"'+object+'"':object}if("function"==typeof object&&!(object instanceof RegExp))return ascii.func(object);if(processed=processed||[],isCircular(object,processed))return"[Circular]";if("[object Array]"===Object.prototype.toString.call(object))return ascii.array.call(f,object,processed);if(!object)return String(1/object===-(1/0)?"-0":object);if(samsam.isElement(object))return ascii.element(object);if("function"==typeof object.toString&&object.toString!==Object.prototype.toString)return object.toString();var i,l;for(i=0,l=specialObjects.length;i<l;i++)if(object===specialObjects[i].object)return specialObjects[i].value;return ascii.object.call(f,object,processed,indent)}function Formatio(options){for(var opt in options)this[opt]=options[opt]}var formatio={excludeConstructors:["Object",/^.$/],quoteStrings:!0,limitChildrenCount:0},specialObjects=(Object.prototype.hasOwnProperty,[]);return"undefined"!=typeof global&&specialObjects.push({object:global,value:"[object global]"}),"undefined"!=typeof document&&specialObjects.push({object:document,value:"[object HTMLDocument]"}),"undefined"!=typeof window&&specialObjects.push({object:window,value:"[object Window]"}),ascii.func=function(func){return"function "+functionName(func)+"() {}"},ascii.array=function(array,processed){processed=processed||[],processed.push(array);var i,l,pieces=[];for(l=this.limitChildrenCount>0?Math.min(this.limitChildrenCount,array.length):array.length,i=0;i<l;++i)pieces.push(ascii(this,array[i],processed));return l<array.length&&pieces.push("[... "+(array.length-l)+" more elements]"),"["+pieces.join(", ")+"]"},ascii.object=function(object,processed,indent){processed=processed||[],processed.push(object),indent=indent||0;var prop,str,obj,i,k,l,pieces=[],properties=samsam.keys(object).sort(),length=3;for(l=this.limitChildrenCount>0?Math.min(this.limitChildrenCount,properties.length):properties.length,i=0;i<l;++i)prop=properties[i],obj=object[prop],str=isCircular(obj,processed)?"[Circular]":ascii(this,obj,processed,indent+2),str=(/\s/.test(prop)?'"'+prop+'"':prop)+": "+str,length+=str.length,pieces.push(str);var cons=constructorName(this,object),prefix=cons?"["+cons+"] ":"",is="";for(i=0,k=indent;i<k;++i)is+=" ";return l<properties.length&&pieces.push("[... "+(properties.length-l)+" more elements]"),length+indent>80?prefix+"{\n "+is+pieces.join(",\n "+is)+"\n"+is+"}":prefix+"{ "+pieces.join(", ")+" }"},ascii.element=function(element){var attr,attrName,i,l,val,tagName=element.tagName.toLowerCase(),attrs=element.attributes,pairs=[];for(i=0,l=attrs.length;i<l;++i)attr=attrs.item(i),attrName=attr.nodeName.toLowerCase().replace("html:",""),val=attr.nodeValue,"contenteditable"===attrName&&"inherit"===val||val&&pairs.push(attrName+'="'+val+'"');var formatted="<"+tagName+(pairs.length>0?" ":""),content=element.innerHTML;content.length>20&&(content=content.substr(0,20)+"[...]");var res=formatted+pairs.join(" ")+">"+content+"</"+tagName+">";return res.replace(/ contentEditable="inherit"/,"")},Formatio.prototype={functionName:functionName,configure:function(options){return new Formatio(options)},constructorName:function(object){return constructorName(this,object)},ascii:function(object,processed,indent){return ascii(this,object,processed,indent)}},Formatio.prototype})}).call(exports,function(){return this}())},function(module,exports){(function(__webpack_amd_options__){module.exports=__webpack_amd_options__}).call(exports,{})},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_RESULT__;(__webpack_require__(13)&&function(m){__WEBPACK_AMD_DEFINE_FACTORY__=m,__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof __WEBPACK_AMD_DEFINE_FACTORY__?__WEBPACK_AMD_DEFINE_FACTORY__.call(exports,__webpack_require__,exports,module):__WEBPACK_AMD_DEFINE_FACTORY__,!(void 0!==__WEBPACK_AMD_DEFINE_RESULT__&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}||"object"==typeof module&&function(m){module.exports=m()}||function(m){this.samsam=m()})(function(){function isNaN(value){var val=value;return"number"==typeof value&&value!==val}function getClass(value){return o.toString.call(value).split(/[ \]]/)[1]}function isArguments(object){if("Arguments"===getClass(object))return!0;if("object"!=typeof object||"number"!=typeof object.length||"Array"===getClass(object))return!1;if("function"==typeof object.callee)return!0;try{object[object.length]=6,delete object[object.length]}catch(e){return!0}return!1}function isElement(object){if(!object||1!==object.nodeType||!div)return!1;try{object.appendChild(div),object.removeChild(div)}catch(e){return!1}return!0}function keys(object){var prop,ks=[];for(prop in object)o.hasOwnProperty.call(object,prop)&&ks.push(prop);return ks}function isDate(value){return"function"==typeof value.getTime&&value.getTime()==value.valueOf()}function isNegZero(value){return 0===value&&1/value===-(1/0)}function identical(obj1,obj2){if(obj1===obj2||isNaN(obj1)&&isNaN(obj2))return 0!==obj1||isNegZero(obj1)===isNegZero(obj2)}function deepEqualCyclic(obj1,obj2){function isObject(value){return!("object"!=typeof value||null===value||value instanceof Boolean||value instanceof Date||value instanceof Number||value instanceof RegExp||value instanceof String)}function getIndex(objects,obj){var i;for(i=0;i<objects.length;i++)if(objects[i]===obj)return i;return-1}var objects1=[],objects2=[],paths1=[],paths2=[],compared={};return function deepEqual(obj1,obj2,path1,path2){var type1=typeof obj1,type2=typeof obj2;if(obj1===obj2||isNaN(obj1)||isNaN(obj2)||null==obj1||null==obj2||"object"!==type1||"object"!==type2)return identical(obj1,obj2);if(isElement(obj1)||isElement(obj2))return!1;var isDate1=isDate(obj1),isDate2=isDate(obj2);if((isDate1||isDate2)&&(!isDate1||!isDate2||obj1.getTime()!==obj2.getTime()))return!1;if(obj1 instanceof RegExp&&obj2 instanceof RegExp&&obj1.toString()!==obj2.toString())return!1;var class1=getClass(obj1),class2=getClass(obj2),keys1=keys(obj1),keys2=keys(obj2);if(isArguments(obj1)||isArguments(obj2)){if(obj1.length!==obj2.length)return!1}else if(type1!==type2||class1!==class2||keys1.length!==keys2.length)return!1;var key,i,l,value1,value2,isObject1,isObject2,index1,index2,newPath1,newPath2;for(i=0,l=keys1.length;i<l;i++){if(key=keys1[i],!o.hasOwnProperty.call(obj2,key))return!1;if(value1=obj1[key],value2=obj2[key],isObject1=isObject(value1),isObject2=isObject(value2),index1=isObject1?getIndex(objects1,value1):-1,index2=isObject2?getIndex(objects2,value2):-1,newPath1=index1!==-1?paths1[index1]:path1+"["+JSON.stringify(key)+"]",newPath2=index2!==-1?paths2[index2]:path2+"["+JSON.stringify(key)+"]",compared[newPath1+newPath2])return!0;if(index1===-1&&isObject1&&(objects1.push(value1),paths1.push(newPath1)),index2===-1&&isObject2&&(objects2.push(value2),paths2.push(newPath2)),isObject1&&isObject2&&(compared[newPath1+newPath2]=!0),!deepEqual(value1,value2,newPath1,newPath2))return!1}return!0}(obj1,obj2,"$1","$2")}function arrayContains(array,subset){if(0===subset.length)return!0;var i,l,j,k;for(i=0,l=array.length;i<l;++i)if(match(array[i],subset[0])){for(j=0,k=subset.length;j<k;++j)if(!match(array[i+j],subset[j]))return!1;return!0}return!1}var match,o=Object.prototype,div="undefined"!=typeof document&&document.createElement("div");return match=function match(object,matcher){if(matcher&&"function"==typeof matcher.test)return matcher.test(object);if("function"==typeof matcher)return matcher(object)===!0;if("string"==typeof matcher){matcher=matcher.toLowerCase();var notNull="string"==typeof object||!!object;return notNull&&String(object).toLowerCase().indexOf(matcher)>=0}if("number"==typeof matcher)return matcher===object;if("boolean"==typeof matcher)return matcher===object;if("undefined"==typeof matcher)return"undefined"==typeof object;if(null===matcher)return null===object;if("Array"===getClass(object)&&"Array"===getClass(matcher))return arrayContains(object,matcher);if(matcher&&"object"==typeof matcher){if(matcher===object)return!0;var prop;for(prop in matcher){var value=object[prop];if("undefined"==typeof value&&"function"==typeof object.getAttribute&&(value=object.getAttribute(prop)),null===matcher[prop]||"undefined"==typeof matcher[prop]){if(value!==matcher[prop])return!1}else if("undefined"==typeof value||!match(value,matcher[prop]))return!1}return!0}throw new Error("Matcher was not a string, a number, a function, a boolean or an object")},{isArguments:isArguments,isElement:isElement,isDate:isDate,isNegZero:isNegZero,identical:identical,deepEqual:deepEqualCyclic,match:match,keys:keys}})},function(module,exports){"use strict";module.exports=function(){var i,prop,thisValue;if(this.getCall&&this.callCount)for(i=this.callCount;i--;){thisValue=this.getCall(i).thisValue;for(prop in thisValue)if(thisValue[prop]===this)return prop}return this.displayName||"sinon fake"}},function(module,exports,__webpack_require__){"use strict";var defaultConfig=__webpack_require__(17);module.exports=function(custom){var prop,config={};custom=custom||{};for(prop in defaultConfig)defaultConfig.hasOwnProperty(prop)&&(config[prop]=custom.hasOwnProperty(prop)?custom[prop]:defaultConfig[prop]);return config}},function(module,exports){"use strict";module.exports={injectIntoThis:!0,injectInto:null,properties:["spy","stub","mock","clock","server","requests"],useFakeTimers:!0,useFakeServer:!0}},function(module,exports){"use strict";var array=[null,"once","twice","thrice"];module.exports=function(count){return array[count]||(count||0)+" times"}},function(module,exports){"use strict";module.exports=function(spies){for(var i=1,l=spies.length;i<l;i++)if(!spies[i-1].calledBefore(spies[i])||!spies[i].called)return!1;return!0}},function(module,exports){"use strict";module.exports=function(spies){return spies.sort(function(a,b){var aCall=a.getCall(0),bCall=b.getCall(0),aId=aCall&&aCall.callId||-1,bId=bCall&&bCall.callId||-1;return aId<bId?-1:1})}},function(module,exports){"use strict";function walkInternal(obj,iterator,context,originalObj,seen){var proto,prop;if("function"==typeof Object.getOwnPropertyNames)Object.getOwnPropertyNames(obj).forEach(function(k){if(!seen[k]){seen[k]=!0;var target="function"==typeof Object.getOwnPropertyDescriptor(obj,k).get?originalObj:obj;iterator.call(context,target[k],k,target)}}),proto=Object.getPrototypeOf(obj),proto&&walkInternal(proto,iterator,context,originalObj,seen);else for(prop in obj)iterator.call(context,obj[prop],prop,obj)}module.exports=function(obj,iterator,context){return walkInternal(obj,iterator,context,obj,{})}},function(module,exports){"use strict";function isRestorable(obj){return"function"==typeof obj&&"function"==typeof obj.restore&&obj.restore.sinon}module.exports=function(object){if(null!==object&&"object"==typeof object)for(var prop in object)isRestorable(object[prop])&&object[prop].restore();else isRestorable(object)&&object.restore()}},function(module,exports,__webpack_require__){(function(global){"use strict";function verifyIsStub(){for(var method,i=0,l=arguments.length;i<l;++i)method=arguments[i],method||assert.fail("fake is not a spy"),method.proxy&&method.proxy.isSinonProxy?verifyIsStub(method.proxy):("function"!=typeof method&&assert.fail(method+" is not a function"),"function"!=typeof method.getCall&&assert.fail(method+" is not stubbed"))}function failAssertion(object,msg){object=object||global;var failMethod=object.fail||assert.fail;failMethod.call(object,msg)}function mirrorPropAsAssertion(name,method,message){2===arguments.length&&(message=method,
method=name),assert[name]=function(fake){verifyIsStub(fake);var args=slice.call(arguments,1),failed=!1;failed="function"==typeof method?!method(fake):"function"==typeof fake[method]?!fake[method].apply(fake,args):!fake[method],failed?failAssertion(this,(fake.printf||fake.proxy.printf).apply(fake,[message].concat(args))):assert.pass(name)}}function exposedName(prefix,prop){return!prefix||/^fail/.test(prop)?prop:prefix+prop.slice(0,1).toUpperCase()+prop.slice(1)}var assert,calledInOrder=__webpack_require__(19),orderByFirstCall=__webpack_require__(20),timesInWords=__webpack_require__(18),format=__webpack_require__(11),sinonMatch=__webpack_require__(2),slice=Array.prototype.slice;assert={failException:"AssertError",fail:function(message){var error=new Error(message);throw error.name=this.failException||assert.failException,error},pass:function(){},callOrder:function(){verifyIsStub.apply(null,arguments);var expected="",actual="";if(calledInOrder(arguments))assert.pass("callOrder");else{try{expected=[].join.call(arguments,", ");for(var calls=slice.call(arguments),i=calls.length;i;)calls[--i].called||calls.splice(i,1);actual=orderByFirstCall(calls).join(", ")}catch(e){}failAssertion(this,"expected "+expected+" to be called in order but were called as "+actual)}},callCount:function(method,count){if(verifyIsStub(method),method.callCount!==count){var msg="expected %n to be called "+timesInWords(count)+" but was called %c%C";failAssertion(this,method.printf(msg))}else assert.pass("callCount")},expose:function(target,options){if(!target)throw new TypeError("target is null or undefined");var o=options||{},prefix="undefined"==typeof o.prefix&&"assert"||o.prefix,includeFail="undefined"==typeof o.includeFail||!!o.includeFail;for(var method in this)"expose"===method||!includeFail&&/^(fail)/.test(method)||(target[exposedName(prefix,method)]=this[method]);return target},match:function(actual,expectation){var matcher=sinonMatch(expectation);if(matcher.test(actual))assert.pass("match");else{var formatted=["expected value to match"," expected = "+format(expectation)," actual = "+format(actual)];failAssertion(this,formatted.join("\n"))}}},mirrorPropAsAssertion("called","expected %n to have been called at least once but was never called"),mirrorPropAsAssertion("notCalled",function(spy){return!spy.called},"expected %n to not have been called but was called %c%C"),mirrorPropAsAssertion("calledOnce","expected %n to be called once but was called %c%C"),mirrorPropAsAssertion("calledTwice","expected %n to be called twice but was called %c%C"),mirrorPropAsAssertion("calledThrice","expected %n to be called thrice but was called %c%C"),mirrorPropAsAssertion("calledOn","expected %n to be called with %1 as this but was called with %t"),mirrorPropAsAssertion("alwaysCalledOn","expected %n to always be called with %1 as this but was called with %t"),mirrorPropAsAssertion("calledWithNew","expected %n to be called with new"),mirrorPropAsAssertion("alwaysCalledWithNew","expected %n to always be called with new"),mirrorPropAsAssertion("calledWith","expected %n to be called with arguments %*%C"),mirrorPropAsAssertion("calledWithMatch","expected %n to be called with match %*%C"),mirrorPropAsAssertion("alwaysCalledWith","expected %n to always be called with arguments %*%C"),mirrorPropAsAssertion("alwaysCalledWithMatch","expected %n to always be called with match %*%C"),mirrorPropAsAssertion("calledWithExactly","expected %n to be called with exact arguments %*%C"),mirrorPropAsAssertion("alwaysCalledWithExactly","expected %n to always be called with exact arguments %*%C"),mirrorPropAsAssertion("neverCalledWith","expected %n to never be called with arguments %*%C"),mirrorPropAsAssertion("neverCalledWithMatch","expected %n to never be called with match %*%C"),mirrorPropAsAssertion("threw","%n did not throw exception%C"),mirrorPropAsAssertion("alwaysThrew","%n did not always throw exception%C"),module.exports=assert}).call(exports,function(){return this}())},function(module,exports,__webpack_require__){"use strict";function getFakes(fakeCollection){return fakeCollection.fakes||(fakeCollection.fakes=[]),fakeCollection.fakes}function each(fakeCollection,method){for(var fakes=getFakes(fakeCollection),i=0,l=fakes.length;i<l;i+=1)"function"==typeof fakes[i][method]&&fakes[i][method]()}function compact(fakeCollection){for(var fakes=getFakes(fakeCollection),i=0;i<fakes.length;)fakes.splice(i,1)}var sinon=__webpack_require__(7),sinonSpy=__webpack_require__(25),push=[].push,hasOwnProperty=Object.prototype.hasOwnProperty,collection={verify:function(){each(this,"verify")},restore:function(){each(this,"restore"),compact(this)},reset:function(){each(this,"reset")},verifyAndRestore:function(){var exception;try{this.verify()}catch(e){exception=e}if(this.restore(),exception)throw exception},add:function(fake){return push.call(getFakes(this),fake),fake},spy:function(){return this.add(sinonSpy.apply(sinonSpy,arguments))},stub:function(object,property,value){if(property){if(!object){var type=null===object?"null":"undefined";throw new Error("Trying to stub property '"+property+"' of "+type)}var original=object[property];if("function"!=typeof original){if(!hasOwnProperty.call(object,property))throw new TypeError("Cannot stub non-existent own property "+property);return object[property]=value,this.add({restore:function(){object[property]=original}})}}if(!property&&object&&"object"==typeof object){var stubbedObj=sinon.stub.apply(sinon,arguments);for(var prop in stubbedObj)"function"==typeof stubbedObj[prop]&&this.add(stubbedObj[prop]);return stubbedObj}return this.add(sinon.stub.apply(sinon,arguments))},mock:function(){return this.add(sinon.mock.apply(sinon,arguments))},inject:function(obj){var col=this;return obj.spy=function(){return col.spy.apply(col,arguments)},obj.stub=function(){return col.stub.apply(col,arguments)},obj.mock=function(){return col.mock.apply(col,arguments)},obj}};module.exports=collection},function(module,exports,__webpack_require__){"use strict";function spy(object,property,types){var descriptor,i,methodDesc;if(!property&&"function"==typeof object)return spy.create(object);if(!object&&!property)return spy.create(function(){});if(types){for(descriptor={},methodDesc=getPropertyDescriptor(object,property),i=0;i<types.length;i++)descriptor[types[i]]=spy.create(methodDesc[types[i]]);return wrapMethod(object,property,descriptor)}return wrapMethod(object,property,spy.create(object[property]))}function matchingFake(fakes,args,strict){if(fakes)for(var i=0,l=fakes.length;i<l;i++)if(fakes[i].matches(args,strict))return fakes[i]}function incrementCallCount(){this.called=!0,this.callCount+=1,this.notCalled=!1,this.calledOnce=1===this.callCount,this.calledTwice=2===this.callCount,this.calledThrice=3===this.callCount}function createCallProperties(){this.firstCall=this.getCall(0),this.secondCall=this.getCall(1),this.thirdCall=this.getCall(2),this.lastCall=this.getCall(this.callCount-1)}function createProxy(func,proxyLength){var p;return proxyLength?eval("p = (function proxy("+vars.substring(0,2*proxyLength-1)+") { return p.invoke(func, this, slice.call(arguments)); });"):p=function(){return p.invoke(func,this,slice.call(arguments))},p.isSinonProxy=!0,p}function delegateToCalls(method,matchAny,actual,notCalled){spyApi[method]=function(){if(!this.called)return!!notCalled&¬Called.apply(this,arguments);for(var currentCall,matches=0,i=0,l=this.callCount;i<l;i+=1)if(currentCall=this.getCall(i),currentCall[actual||method].apply(currentCall,arguments)&&(matches+=1,matchAny))return!0;return matches===this.callCount}}var extend=__webpack_require__(26),deepEqual=__webpack_require__(4),functionName=__webpack_require__(5),functionToString=__webpack_require__(15),getPropertyDescriptor=__webpack_require__(9),sinon=__webpack_require__(7),spyCall=__webpack_require__(27),timesInWords=__webpack_require__(18),wrapMethod=__webpack_require__(8),push=Array.prototype.push,slice=Array.prototype.slice,callId=0,vars="a,b,c,d,e,f,g,h,i,j,k,l",uuid=0,spyApi={reset:function(){if(this.invoking){var err=new Error("Cannot reset Sinon function while invoking it. Move the call to .reset outside of the callback.");throw err.name="InvalidResetException",err}if(this.called=!1,this.notCalled=!0,this.calledOnce=!1,this.calledTwice=!1,this.calledThrice=!1,this.callCount=0,this.firstCall=null,this.secondCall=null,this.thirdCall=null,this.lastCall=null,this.args=[],this.returnValues=[],this.thisValues=[],this.exceptions=[],this.callIds=[],this.stacks=[],this.fakes)for(var i=0;i<this.fakes.length;i++)this.fakes[i].reset();return this},create:function(func,spyLength){var name;"function"!=typeof func?func=function(){}:name=functionName(func),spyLength||(spyLength=func.length);var proxy=createProxy(func,spyLength);return extend(proxy,spy),delete proxy.create,extend(proxy,func),proxy.reset(),proxy.prototype=func.prototype,proxy.displayName=name||"spy",proxy.toString=functionToString,proxy.instantiateFake=spy.create,proxy.id="spy#"+uuid++,proxy},invoke:function(func,thisValue,args){var exception,returnValue,matching=matchingFake(this.fakes,args);incrementCallCount.call(this),push.call(this.thisValues,thisValue),push.call(this.args,args),push.call(this.callIds,callId++),createCallProperties.call(this);try{this.invoking=!0,returnValue=matching?matching.invoke(func,thisValue,args):(this.func||func).apply(thisValue,args);var thisCall=this.getCall(this.callCount-1);thisCall.calledWithNew()&&"object"!=typeof returnValue&&(returnValue=thisValue)}catch(e){exception=e}finally{delete this.invoking}if(push.call(this.exceptions,exception),push.call(this.returnValues,returnValue),push.call(this.stacks,(new Error).stack),createCallProperties.call(this),void 0!==exception)throw exception;return returnValue},named:function(name){return this.displayName=name,this},getCall:function(i){return i<0||i>=this.callCount?null:spyCall(this,this.thisValues[i],this.args[i],this.returnValues[i],this.exceptions[i],this.callIds[i],this.stacks[i])},getCalls:function(){var i,calls=[];for(i=0;i<this.callCount;i++)calls.push(this.getCall(i));return calls},calledBefore:function(spyFn){return!!this.called&&(!spyFn.called||this.callIds[0]<spyFn.callIds[spyFn.callIds.length-1])},calledAfter:function(spyFn){return!(!this.called||!spyFn.called)&&this.callIds[this.callCount-1]>spyFn.callIds[spyFn.callCount-1]},withArgs:function(){var args=slice.call(arguments);if(this.fakes){var match=matchingFake(this.fakes,args,!0);if(match)return match}else this.fakes=[];var original=this,fake=this.instantiateFake();fake.matchingAguments=args,fake.parent=this,push.call(this.fakes,fake),fake.withArgs=function(){return original.withArgs.apply(original,arguments)};for(var i=0;i<this.args.length;i++)fake.matches(this.args[i])&&(incrementCallCount.call(fake),push.call(fake.thisValues,this.thisValues[i]),push.call(fake.args,this.args[i]),push.call(fake.returnValues,this.returnValues[i]),push.call(fake.exceptions,this.exceptions[i]),push.call(fake.callIds,this.callIds[i]));return createCallProperties.call(fake),fake},matches:function(args,strict){var margs=this.matchingAguments;if(margs.length<=args.length&&deepEqual(margs,args.slice(0,margs.length)))return!strict||margs.length===args.length},printf:function(format){var formatter,spyInstance=this,args=slice.call(arguments,1);return(format||"").replace(/%(.)/g,function(match,specifyer){return formatter=spyApi.formatters[specifyer],"function"==typeof formatter?formatter.call(null,spyInstance,args):isNaN(parseInt(specifyer,10))?"%"+specifyer:sinon.format(args[specifyer-1])})}};delegateToCalls("calledOn",!0),delegateToCalls("alwaysCalledOn",!1,"calledOn"),delegateToCalls("calledWith",!0),delegateToCalls("calledWithMatch",!0),delegateToCalls("alwaysCalledWith",!1,"calledWith"),delegateToCalls("alwaysCalledWithMatch",!1,"calledWithMatch"),delegateToCalls("calledWithExactly",!0),delegateToCalls("alwaysCalledWithExactly",!1,"calledWithExactly"),delegateToCalls("neverCalledWith",!1,"notCalledWith",function(){return!0}),delegateToCalls("neverCalledWithMatch",!1,"notCalledWithMatch",function(){return!0}),delegateToCalls("threw",!0),delegateToCalls("alwaysThrew",!1,"threw"),delegateToCalls("returned",!0),delegateToCalls("alwaysReturned",!1,"returned"),delegateToCalls("calledWithNew",!0),delegateToCalls("alwaysCalledWithNew",!1,"calledWithNew"),delegateToCalls("callArg",!1,"callArgWith",function(){throw new Error(this.toString()+" cannot call arg since it was not yet invoked.")}),spyApi.callArgWith=spyApi.callArg,delegateToCalls("callArgOn",!1,"callArgOnWith",function(){throw new Error(this.toString()+" cannot call arg since it was not yet invoked.")}),spyApi.callArgOnWith=spyApi.callArgOn,delegateToCalls("yield",!1,"yield",function(){throw new Error(this.toString()+" cannot yield since it was not yet invoked.")}),spyApi.invokeCallback=spyApi["yield"],delegateToCalls("yieldOn",!1,"yieldOn",function(){throw new Error(this.toString()+" cannot yield since it was not yet invoked.")}),delegateToCalls("yieldTo",!1,"yieldTo",function(property){throw new Error(this.toString()+" cannot yield to '"+property+"' since it was not yet invoked.")}),delegateToCalls("yieldToOn",!1,"yieldToOn",function(property){throw new Error(this.toString()+" cannot yield to '"+property+"' since it was not yet invoked.")}),spyApi.formatters={c:function(spyInstance){return timesInWords(spyInstance.callCount)},n:function(spyInstance){return spyInstance.toString()},C:function(spyInstance){for(var calls=[],i=0,l=spyInstance.callCount;i<l;++i){var stringifiedCall=" "+spyInstance.getCall(i).toString();/\n/.test(calls[i-1])&&(stringifiedCall="\n"+stringifiedCall),push.call(calls,stringifiedCall)}return calls.length>0?"\n"+calls.join("\n"):""},t:function(spyInstance){for(var objects=[],i=0,l=spyInstance.callCount;i<l;++i)push.call(objects,sinon.format(spyInstance.thisValues[i]));return objects.join(", ")},"*":function(spyInstance,args){for(var formatted=[],i=0,l=args.length;i<l;++i)push.call(formatted,sinon.format(args[i]));return formatted.join(", ")}},extend(spy,spyApi),spy.spyCall=spyCall,module.exports=spy},function(module,exports){"use strict";var hasDontEnumBug=function(){var obj={constructor:function(){return"0"},toString:function(){return"1"},valueOf:function(){return"2"},toLocaleString:function(){return"3"},prototype:function(){return"4"},isPrototypeOf:function(){return"5"},propertyIsEnumerable:function(){return"6"},hasOwnProperty:function(){return"7"},length:function(){return"8"},unique:function(){return"9"}},result=[];for(var prop in obj)obj.hasOwnProperty(prop)&&result.push(obj[prop]());return"0123456789"!==result.join("")}();module.exports=function(target){var source,i,prop,sources=Array.prototype.slice.call(arguments,1);for(i=0;i<sources.length;i++){source=sources[i];for(prop in source)source.hasOwnProperty(prop)&&(target[prop]=source[prop]);hasDontEnumBug&&source.hasOwnProperty("toString")&&source.toString!==target.toString&&(target.toString=source.toString)}return target}},function(module,exports,__webpack_require__){"use strict";function throwYieldError(proxy,text,args){var msg=functionName(proxy)+text;throw args.length&&(msg+=" Received ["+slice.call(args).join(", ")+"]"),new Error(msg)}function createSpyCall(spy,thisValue,args,returnValue,exception,id,stack){if("number"!=typeof id)throw new TypeError("Call id is not a number");var proxyCall=createInstance(callProto);return proxyCall.proxy=spy,proxyCall.thisValue=thisValue,proxyCall.args=args,proxyCall.returnValue=returnValue,proxyCall.exception=exception,proxyCall.callId=id,proxyCall.stack=stack,proxyCall}var sinon=__webpack_require__(7),sinonMatch=__webpack_require__(2),deepEqual=__webpack_require__(4).use(sinonMatch),functionName=__webpack_require__(5),createInstance=__webpack_require__(3),slice=Array.prototype.slice,callProto={calledOn:function(thisValue){return sinonMatch&&sinonMatch.isMatcher(thisValue)?thisValue.test(this.thisValue):this.thisValue===thisValue},calledWith:function(){var l=arguments.length;if(l>this.args.length)return!1;for(var i=0;i<l;i+=1)if(!deepEqual(arguments[i],this.args[i]))return!1;return!0},calledWithMatch:function(){var l=arguments.length;if(l>this.args.length)return!1;for(var i=0;i<l;i+=1){var actual=this.args[i],expectation=arguments[i];if(!sinonMatch||!sinonMatch(expectation).test(actual))return!1}return!0},calledWithExactly:function(){return arguments.length===this.args.length&&this.calledWith.apply(this,arguments)},notCalledWith:function(){return!this.calledWith.apply(this,arguments)},notCalledWithMatch:function(){return!this.calledWithMatch.apply(this,arguments)},returned:function(value){return deepEqual(value,this.returnValue)},threw:function(error){return"undefined"!=typeof error&&this.exception?this.exception===error||this.exception.name===error:!!this.exception},calledWithNew:function(){return this.proxy.prototype&&this.thisValue instanceof this.proxy},calledBefore:function(other){return this.callId<other.callId},calledAfter:function(other){return this.callId>other.callId},callArg:function(pos){this.args[pos]()},callArgOn:function(pos,thisValue){this.args[pos].apply(thisValue)},callArgWith:function(pos){this.callArgOnWith.apply(this,[pos,null].concat(slice.call(arguments,1)))},callArgOnWith:function(pos,thisValue){var args=slice.call(arguments,2);this.args[pos].apply(thisValue,args)},"yield":function(){this.yieldOn.apply(this,[null].concat(slice.call(arguments,0)))},yieldOn:function(thisValue){for(var args=this.args,i=0,l=args.length;i<l;++i)if("function"==typeof args[i])return void args[i].apply(thisValue,slice.call(arguments,1));throwYieldError(this.proxy," cannot yield since no callback was passed.",args)},yieldTo:function(prop){this.yieldToOn.apply(this,[prop,null].concat(slice.call(arguments,1)))},yieldToOn:function(prop,thisValue){for(var args=this.args,i=0,l=args.length;i<l;++i)if(args[i]&&"function"==typeof args[i][prop])return void args[i][prop].apply(thisValue,slice