/**
 * almond 0.1.4 Copyright (c) 2011, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/jrburke/almond for details
 */

/**
   * Inspects an object.
   *
   * @see taken from node.js `util` module (copyright Joyent, MIT license)
   * @api private
   */

/**
   * Asserts deep equality
   *
   * @see taken from node.js `assert` module (copyright Joyent, MIT license)
   * @api private
   */

/*!
 * mocha
 * Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
 * MIT Licensed
 */

/*
 * - BUNYIP - http://github.com/ryanseddon/bunyip
 * Yeti Mocha adaptor, drop this in a test suite that will run through Yeti.
 * See readme.md for specific instructions.
 * MIT License - Copyright (c) 2012 Ryan Seddon
 * http://github.com/ryanseddon/yeti-adpators
*/

var requirejs,require,define;(function(e){function a(e,t){var n,r,i,o,u,a,f,l,c,h,p=t&&t.split("/"),d=s.map,v=d&&d["*"]||{};if(e&&e.charAt(0)==="."&&t){p=p.slice(0,p.length-1),e=p.concat(e.split("/"));for(l=0;l<e.length;l+=1){h=e[l];if(h===".")e.splice(l,1),l-=1;else if(h===".."){if(l===1&&(e[2]===".."||e[0]===".."))break;l>0&&(e.splice(l-1,2),l-=2)}}e=e.join("/")}if((p||v)&&d){n=e.split("/");for(l=n.length;l>0;l-=1){r=n.slice(0,l).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){o=i,u=l;break}}}if(o)break;!a&&v&&v[r]&&(a=v[r],f=l)}!o&&a&&(o=a,u=f),o&&(n.splice(0,u,o),e=n.join("/"))}return e}function f(t,r){return function(){return n.apply(e,u.call(arguments,0).concat([t,r]))}}function l(e){return function(t){return a(t,e)}}function c(e){return function(t){r[e]=t}}function h(n){if(i.hasOwnProperty(n)){var s=i[n];delete i[n],o[n]=!0,t.apply(e,s)}if(!r.hasOwnProperty(n))throw new Error("No "+n);return r[n]}function p(e,t){var n,r,i=e.indexOf("!");return i!==-1?(n=a(e.slice(0,i),t),e=e.slice(i+1),r=h(n),r&&r.normalize?e=r.normalize(e,l(t)):e=a(e,t)):e=a(e,t),{f:n?n+"!"+e:e,n:e,p:r}}function d(e){return function(){return s&&s.config&&s.config[e]||{}}}var t,n,r={},i={},s={},o={},u=[].slice;t=function(t,n,s,u){var a,l,v,m,g,y=[],b;u=u||t;if(typeof s=="function"){n=!n.length&&s.length?["require","exports","module"]:n;for(g=0;g<n.length;g+=1){m=p(n[g],u),l=m.f;if(l==="require")y[g]=f(t);else if(l==="exports")y[g]=r[t]={},b=!0;else if(l==="module")a=y[g]={id:t,uri:"",exports:r[t],config:d(t)};else if(r.hasOwnProperty(l)||i.hasOwnProperty(l))y[g]=h(l);else if(m.p)m.p.load(m.n,f(u,!0),c(l),{}),y[g]=r[l];else if(!o[l])throw new Error(t+" missing "+l)}v=s.apply(r[t],y);if(t)if(a&&a.exports!==e&&a.exports!==r[t])r[t]=a.exports;else if(v!==e||!b)r[t]=v}else t&&(r[t]=s)},requirejs=require=n=function(r,i,o,u,a){return typeof r=="string"?h(p(r,i).f):(r.splice||(s=r,i.splice?(r=i,i=o,o=null):r=e),i=i||function(){},typeof o=="function"&&(o=u,u=a),u?t(e,r,i,o):setTimeout(function(){t(e,r,i,o)},15),n)},n.config=function(e){return s=e,n},define=function(e,t,n){t.splice||(n=t,t=[]),i[e]=[e,t,n]},define.amd={jQuery:!0}})(),define("almond",[],function(){}),function(global,module){function expect(e){return new Assertion(e)}function Assertion(e,t,n){this.obj=e,this.flags={};if(undefined!=n){this.flags[t]=!0;for(var r in n.flags)n.flags.hasOwnProperty(r)&&(this.flags[r]=!0)}var i=t?flags[t]:keys(flags),s=this;if(i)for(var r=0,o=i.length;r<o;r++){if(this.flags[i[r]])continue;var u=i[r],a=new Assertion(this.obj,u,this);if("function"==typeof Assertion.prototype[u]){var f=this[u];this[u]=function(){return f.apply(s,arguments)};for(var l in Assertion.prototype)Assertion.prototype.hasOwnProperty(l)&&l!=u&&(this[u][l]=bind(a[l],a))}else this[u]=a}}function bind(e,t){return function(){return e.apply(t,arguments)}}function every(e,t,n){var r=n||global;for(var i=0,s=e.length;i<s;++i)if(!t.call(r,e[i],i,e))return!1;return!0}function indexOf(e,t,n){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t,n);if(e.length===undefined)return-1;for(var r=e.length,n=n<0?n+r<0?0:n+r:n||0;n<r&&e[n]!==t;n++);return r<=n?-1:n}function i(e,t,n){function i(e){return e}function s(e,n){if(e&&typeof e.inspect=="function"&&e!==exports&&(!e.constructor||e.constructor.prototype!==e))return e.inspect(n);switch(typeof e){case"undefined":return i("undefined","undefined");case"string":var o="'"+json.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return i(o,"string");case"number":return i(""+e,"number");case"boolean":return i(""+e,"boolean")}if(e===null)return i("null","null");if(isDOMElement(e))return getOuterHTML(e);var u=keys(e),a=t?Object.getOwnPropertyNames(e):u;if(typeof e=="function"&&a.length===0){if(isRegExp(e))return i(""+e,"regexp");var f=e.name?": "+e.name:"";return i("[Function"+f+"]","special")}if(isDate(e)&&a.length===0)return i(e.toUTCString(),"date");var l,c,h;isArray(e)?(c="Array",h=["[","]"]):(c="Object",h=["{","}"]);if(typeof e=="function"){var p=e.name?": "+e.name:"";l=isRegExp(e)?" "+e:" [Function"+p+"]"}else l="";isDate(e)&&(l=" "+e.toUTCString());if(a.length===0)return h[0]+l+h[1];if(n<0)return isRegExp(e)?i(""+e,"regexp"):i("[Object]","special");r.push(e);var d=map(a,function(t){var o,a;e.__lookupGetter__&&(e.__lookupGetter__(t)?e.__lookupSetter__(t)?a=i("[Getter/Setter]","special"):a=i("[Getter]","special"):e.__lookupSetter__(t)&&(a=i("[Setter]","special"))),indexOf(u,t)<0&&(o="["+t+"]"),a||(indexOf(r,e[t])<0?(n===null?a=s(e[t]):a=s(e[t],n-1),a.indexOf("\n")>-1&&(isArray(e)?a=map(a.split("\n"),function(e){return"  "+e}).join("\n").substr(2):a="\n"+map(a.split("\n"),function(e){return"   "+e}).join("\n"))):a=i("[Circular]","special"));if(typeof o=="undefined"){if(c==="Array"&&t.match(/^\d+$/))return a;o=json.stringify(""+t),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=i(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=i(o,"string"))}return o+": "+a});r.pop();var v=0,m=reduce(d,function(e,t){return v++,indexOf(t,"\n")>=0&&v++,e+t.length+1},0);return m>50?d=h[0]+(l===""?"":l+"\n ")+" "+d.join(",\n  ")+" "+h[1]:d=h[0]+l+" "+d.join(", ")+" "+h[1],d}var r=[];return s(e,typeof n=="undefined"?2:n)}function isArray(e){return Object.prototype.toString.call(e)=="[object Array]"}function isRegExp(e){var t=""+e;return e instanceof RegExp||typeof e=="function"&&e.constructor.name==="RegExp"&&e.compile&&e.test&&e.exec&&t.match(/^\/.*\/[gim]{0,3}$/)}function isDate(e){return e instanceof Date?!0:!1}function keys(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}function map(e,t,n){if(Array.prototype.map)return Array.prototype.map.call(e,t,n);var r=new Array(e.length);for(var i=0,s=e.length;i<s;i++)i in e&&(r[i]=t.call(n,e[i],i,e));return r}function reduce(e,t){if(Array.prototype.reduce)return Array.prototype.reduce.apply(e,Array.prototype.slice.call(arguments,1));var n=+this.length;if(typeof t!="function")throw new TypeError;if(n===0&&arguments.length===1)throw new TypeError;var r=0;if(arguments.length>=2)var i=arguments[1];else do{if(r in this){i=this[r++];break}if(++r>=n)throw new TypeError}while(!0);for(;r<n;r++)r in this&&(i=t.call(null,i,this[r],r,this));return i}function isUndefinedOrNull(e){return e===null||e===undefined}function isArguments(e){return Object.prototype.toString.call(e)=="[object Arguments]"}function objEquiv(e,t){if(isUndefinedOrNull(e)||isUndefinedOrNull(t))return!1;if(e.prototype!==t.prototype)return!1;if(isArguments(e))return isArguments(t)?(e=pSlice.call(e),t=pSlice.call(t),expect.eql(e,t)):!1;try{var n=keys(e),r=keys(t),i,s}catch(o){return!1}if(n.length!=r.length)return!1;n.sort(),r.sort();for(s=n.length-1;s>=0;s--)if(n[s]!=r[s])return!1;for(s=n.length-1;s>=0;s--){i=n[s];if(!expect.eql(e[i],t[i]))return!1}return!0}if("undefined"==typeof module)var module={exports:{}},exports=module.exports;module.exports=expect,expect.Assertion=Assertion,expect.version="0.1.2";var flags={not:["to","be","have","include","only"],to:["be","have","include","only","not"],only:["have"],have:["own"],be:["an"]};Assertion.prototype.assert=function(e,t,n){var t=this.flags.not?n:t,r=this.flags.not?!e:e;if(!r)throw new Error(t.call(this));this.and=new Assertion(this.obj)},Assertion.prototype.ok=function(){this.assert(!!this.obj,function(){return"expected "+i(this.obj)+" to be truthy"},function(){return"expected "+i(this.obj)+" to be falsy"})},Assertion.prototype.throwError=Assertion.prototype.throwException=function(e){expect(this.obj).to.be.a("function");var t=!1,n=this.flags.not;try{this.obj()}catch(r){if("function"==typeof e)e(r);else if("object"==typeof e){var i="string"==typeof r?r:r.message;n?expect(i).to.not.match(e):expect(i).to.match(e)}t=!0}"object"==typeof e&&n&&(this.flags.not=!1);var s=this.obj.name||"fn";this.assert(t,function(){return"expected "+s+" to throw an exception"},function(){return"expected "+s+" not to throw an exception"})},Assertion.prototype.empty=function(){var e;return"object"==typeof this.obj&&null!==this.obj&&!isArray(this.obj)?"number"==typeof this.obj.length?e=!this.obj.length:e=!keys(this.obj).length:("string"!=typeof this.obj&&expect(this.obj).to.be.an("object"),expect(this.obj).to.have.property("length"),e=!this.obj.length),this.assert(e,function(){return"expected "+i(this.obj)+" to be empty"},function(){return"expected "+i(this.obj)+" to not be empty"}),this},Assertion.prototype.be=Assertion.prototype.equal=function(e){return this.assert(e===this.obj,function(){return"expected "+i(this.obj)+" to equal "+i(e)},function(){return"expected "+i(this.obj)+" to not equal "+i(e)}),this},Assertion.prototype.eql=function(e){return this.assert(expect.eql(e,this.obj),function(){return"expected "+i(this.obj)+" to sort of equal "+i(e)},function(){return"expected "+i(this.obj)+" to sort of not equal "+i(e)}),this},Assertion.prototype.within=function(e,t){var n=e+".."+t;return this.assert(this.obj>=e&&this.obj<=t,function(){return"expected "+i(this.obj)+" to be within "+n},function(){return"expected "+i(this.obj)+" to not be within "+n}),this},Assertion.prototype.a=Assertion.prototype.an=function(e){if("string"==typeof e){var t=/^[aeiou]/.test(e)?"n":"";this.assert("array"==e?isArray(this.obj):"object"==e?"object"==typeof this.obj&&null!==this.obj:e==typeof this.obj,function(){return"expected "+i(this.obj)+" to be a"+t+" "+e},function(){return"expected "+i(this.obj)+" not to be a"+t+" "+e})}else{var n=e.name||"supplied constructor";this.assert(this.obj instanceof e,function(){return"expected "+i(this.obj)+" to be an instance of "+n},function(){return"expected "+i(this.obj)+" not to be an instance of "+n})}return this},Assertion.prototype.greaterThan=Assertion.prototype.above=function(e){return this.assert(this.obj>e,function(){return"expected "+i(this.obj)+" to be above "+e},function(){return"expected "+i(this.obj)+" to be below "+e}),this},Assertion.prototype.lessThan=Assertion.prototype.below=function(e){return this.assert(this.obj<e,function(){return"expected "+i(this.obj)+" to be below "+e},function(){return"expected "+i(this.obj)+" to be above "+e}),this},Assertion.prototype.match=function(e){return this.assert(e.exec(this.obj),function(){return"expected "+i(this.obj)+" to match "+e},function(){return"expected "+i(this.obj)+" not to match "+e}),this},Assertion.prototype.length=function(e){expect(this.obj).to.have.property("length");var t=this.obj.length;return this.assert(e==t,function(){return"expected "+i(this.obj)+" to have a length of "+e+" but got "+t},function(){return"expected "+i(this.obj)+" to not have a length of "+t}),this},Assertion.prototype.property=function(e,t){if(this.flags.own)return this.assert(Object.prototype.hasOwnProperty.call(this.obj,e),function(){return"expected "+i(this.obj)+" to have own property "+i(e)},function(){return"expected "+i(this.obj)+" to not have own property "+i(e)}),this;if(this.flags.not&&undefined!==t){if(undefined===this.obj[e])throw new Error(i(this.obj)+" has no property "+i(e))}else{var n;try{n=e in this.obj}catch(r){n=undefined!==this.obj[e]}this.assert(n,function(){return"expected "+i(this.obj)+" to have a property "+i(e)},function(){return"expected "+i(this.obj)+" to not have a property "+i(e)})}return undefined!==t&&this.assert(t===this.obj[e],function(){return"expected "+i(this.obj)+" to have a property "+i(e)+" of "+i(t)+", but got "+i(this.obj[e])},function(){return"expected "+i(this.obj)+" to not have a property "+i(e)+" of "+i(t)}),this.obj=this.obj[e],this},Assertion.prototype.string=Assertion.prototype.contain=function(e){return"string"==typeof this.obj?this.assert(~this.obj.indexOf(e),function(){return"expected "+i(this.obj)+" to contain "+i(e)},function(){return"expected "+i(this.obj)+" to not contain "+i(e)}):this.assert(~indexOf(this.obj,e),function(){return"expected "+i(this.obj)+" to contain "+i(e)},function(){return"expected "+i(this.obj)+" to not contain "+i(e)}),this},Assertion.prototype.key=Assertion.prototype.keys=function(e){var t,n=!0;e=isArray(e)?e:Array.prototype.slice.call(arguments);if(!e.length)throw new Error("keys required");var r=keys(this.obj),s=e.length;n=every(e,function(e){return~indexOf(r,e)}),!this.flags.not&&this.flags.only&&(n=n&&e.length==r.length);if(s>1){e=map(e,function(e){return i(e)});var o=e.pop();t=e.join(", ")+", and "+o}else t=i(e[0]);return t=(s>1?"keys ":"key ")+t,t=(this.flags.only?"only have ":"include ")+t,this.assert(n,function(){return"expected "+i(this.obj)+" to "+t},function(){return"expected "+i(this.obj)+" to not "+t}),this},Assertion.prototype.fail=function(e){return e=e||"explicit failure",this.assert(!1,e,e),this};var getOuterHTML=function(e){if("outerHTML"in e)return e.outerHTML;var t="http://www.w3.org/1999/xhtml",n=document.createElementNS(t,"_"),r=(window.HTMLElement||window.Element).prototype,i=new XMLSerializer,s;return document.xmlVersion?i.serializeToString(e):(n.appendChild(e.cloneNode(!1)),s=n.innerHTML.replace("><",">"+e.innerHTML+"<"),n.innerHTML="",s)},isDOMElement=function(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string"};expect.eql=function(t,n){if(t===n)return!0;if("undefined"!=typeof Buffer&&Buffer.isBuffer(t)&&Buffer.isBuffer(n)){if(t.length!=n.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}return t instanceof Date&&n instanceof Date?t.getTime()===n.getTime():typeof t!="object"&&typeof n!="object"?t==n:objEquiv(t,n)};var json=function(){function f(e){return e<10?"0"+e:e}function date(e,t){return isFinite(e.valueOf())?e.getUTCFullYear()+"-"+f(e.getUTCMonth()+1)+"-"+f(e.getUTCDate())+"T"+f(e.getUTCHours())+":"+f(e.getUTCMinutes())+":"+f(e.getUTCSeconds())+"Z":null}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a instanceof Date&&(a=date(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n<s;n+=1)u[n]=str(n,a)||"null";return i=u.length===0?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+o+"]":"["+u.join(",")+"]",gap=o,i}if(rep&&typeof rep=="object"){s=rep.length;for(n=0;n<s;n+=1)typeof rep[n]=="string"&&(r=rep[n],i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i))}else for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i));return i=u.length===0?"{}":gap?"{\n"+gap+u.join(",\n"+gap)+"\n"+o+"}":"{"+u.join(",")+"}",gap=o,i}}if("object"==typeof JSON&&JSON.parse&&JSON.stringify)return{parse:nativeJSON.parse,stringify:nativeJSON.stringify};var JSON={},cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;return JSON.stringify=function(e,t,n){var r;gap="",indent="";if(typeof n=="number")for(r=0;r<n;r+=1)indent+=" ";else typeof n=="string"&&(indent=n);rep=t;if(!t||typeof t=="function"||typeof t=="object"&&typeof t.length=="number")return str("",{"":e});throw new Error("JSON.stringify")},JSON.parse=function(text,reviver){function walk(e,t){var n,r,i=e[t];if(i&&typeof i=="object")for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r=walk(i,n),r!==undefined?i[n]=r:delete i[n]);return reviver.call(e,t,i)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")},JSON}();"undefined"!=typeof window&&(window.expect=module.exports)}(this,"undefined"!=typeof module?module:{},"undefined"!=typeof exports?exports:{}),define("expect",[],function(){}),function(){function e(t){var n=e.resolve(t),r=e.modules[n];if(!r)throw new Error('failed to require "'+t+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,e.relative(n))),r.exports}e.modules={},e.resolve=function(t){var n=t,r=t+".js",i=t+"/index.js";return e.modules[r]&&r||e.modules[i]&&i||n},e.register=function(t,n){e.modules[t]=n},e.relative=function(t){return function(n){if("."!=n.charAt(0))return e(n);var r=t.split("/"),i=n.split("/");r.pop();for(var s=0;s<i.length;s++){var o=i[s];".."==o?r.pop():"."!=o&&r.push(o)}return e(r.join("/"))}},e.register("browser/debug.js",function(e,t,n){e.exports=function(e){return function(){}}}),e.register("browser/diff.js",function(e,t,n){}),e.register("browser/events.js",function(e,t,n){function r(e){return"[object Array]"=={}.toString.call(e)}function i(){}t.EventEmitter=i,i.prototype.on=function(e,t){return this.$events||(this.$events={}),this.$events[e]?r(this.$events[e])?this.$events[e].push(t):this.$events[e]=[this.$events[e],t]:this.$events[e]=t,this},i.prototype.addListener=i.prototype.on,i.prototype.once=function(e,t){function r(){n.removeListener(e,r),t.apply(this,arguments)}var n=this;return r.listener=t,this.on(e,r),this},i.prototype.removeListener=function(e,t){if(this.$events&&this.$events[e]){var n=this.$events[e];if(r(n)){var i=-1;for(var s=0,o=n.length;s<o;s++)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(i<0)return this;n.splice(i,1),n.length||delete this.$events[e]}else(n===t||n.listener&&n.listener===t)&&delete this.$events[e]}return this},i.prototype.removeAllListeners=function(e){return e===undefined?(this.$events={},this):(this.$events&&this.$events[e]&&(this.$events[e]=null),this)},i.prototype.listeners=function(e){return this.$events||(this.$events={}),this.$events[e]||(this.$events[e]=[]),r(this.$events[e])||(this.$events[e]=[this.$events[e]]),this.$events[e]},i.prototype.emit=function(e){if(!this.$events)return!1;var t=this.$events[e];if(!t)return!1;var n=[].slice.call(arguments,1);if("function"==typeof t)t.apply(this,n);else{if(!r(t))return!1;var i=t.slice();for(var s=0,o=i.length;s<o;s++)i[s].apply(this,n)}return!0}}),e.register("browser/fs.js",function(e,t,n){}),e.register("browser/path.js",function(e,t,n){}),e.register("browser/progress.js",function(e,t,n){function r(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}e.exports=r,r.prototype.size=function(e){return this._size=e,this},r.prototype.text=function(e){return this._text=e,this},r.prototype.fontSize=function(e){return this._fontSize=e,this},r.prototype.font=function(e){return this._font=e,this},r.prototype.update=function(e){return this.percent=e,this},r.prototype.draw=function(e){var t=Math.min(this.percent,100),n=this._size,r=n/2,i=r,s=r,o=r-1,u=this._fontSize;e.font=u+"px "+this._font;var a=Math.PI*2*(t/100);e.clearRect(0,0,n,n),e.strokeStyle="#9f9f9f",e.beginPath(),e.arc(i,s,o,0,a,!1),e.stroke(),e.strokeStyle="#eee",e.beginPath(),e.arc(i,s,o-1,0,a,!0),e.stroke();var f=this._text||(t|0)+"%",l=e.measureText(f).width;return e.fillText(f,i-l/2+1,s+u/2-1),this}}),e.register("browser/tty.js",function(e,t,n){t.isatty=function(){return!0},t.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),e.register("context.js",function(e,t,n){function r(){}e.exports=r,r.prototype.runnable=function(e){return 0==arguments.length?this._runnable:(this.test=this._runnable=e,this)},r.prototype.timeout=function(e){return this.runnable().timeout(e),this},r.prototype.inspect=function(){return JSON.stringify(this,function(e,t){if("_runnable"==e)return;if("test"==e)return;return t},2)}}),e.register("hook.js",function(e,t,n){function i(e,t){r.call(this,e,t),this.type="hook"}var r=n("./runnable");e.exports=i,i.prototype=new r,i.prototype.constructor=i,i.prototype.error=function(e){if(0==arguments.length){var e=this._error;return this._error=null,e}this._error=e}}),e.register("interfaces/bdd.js",function(e,t,n){var r=n("../suite"),i=n("../test");e.exports=function(e){var t=[e];e.on("pre-require",function(e,n,s){e.before=function(e){t[0].beforeAll(e)},e.after=function(e){t[0].afterAll(e)},e.beforeEach=function(e){t[0].beforeEach(e)},e.afterEach=function(e){t[0].afterEach(e)},e.describe=e.context=function(e,n){var i=r.create(t[0],e);return t.unshift(i),n(),t.shift(),i},e.xdescribe=e.xcontext=e.describe.skip=function(e,n){var i=r.create(t[0],e);i.pending=!0,t.unshift(i),n(),t.shift()},e.describe.only=function(t,n){var r=e.describe(t,n);s.grep(r.fullTitle())},e.it=e.specify=function(e,n){var r=t[0];if(r.pending)var n=null;var s=new i(e,n);return r.addTest(s),s},e.it.only=function(t,n){var r=e.it(t,n);s.grep(r.fullTitle())},e.xit=e.xspecify=e.it.skip=function(t){e.it(t)}})}}),e.register("interfaces/exports.js",function(e,t,n){var r=n("../suite"),i=n("../test");e.exports=function(e){function n(e){var s;for(var o in e)if("function"==typeof e[o]){var u=e[o];switch(o){case"before":t[0].beforeAll(u);break;case"after":t[0].afterAll(u);break;case"beforeEach":t[0].beforeEach(u);break;case"afterEach":t[0].afterEach(u);break;default:t[0].addTest(new i(o,u))}}else{var s=r.create(t[0],o);t.unshift(s),n(e[o]),t.shift()}}var t=[e];e.on("require",n)}}),e.register("interfaces/index.js",function(e,t,n){t.bdd=n("./bdd"),t.tdd=n("./tdd"),t.qunit=n("./qunit"),t.exports=n("./exports")}),e.register("interfaces/qunit.js",function(e,t,n){var r=n("../suite"),i=n("../test");e.exports=function(e){var t=[e];e.on("pre-require",function(e){e.before=function(e){t[0].beforeAll(e)},e.after=function(e){t[0].afterAll(e)},e.beforeEach=function(e){t[0].beforeEach(e)},e.afterEach=function(e){t[0].afterEach(e)},e.suite=function(e){t.length>1&&t.shift();var n=r.create(t[0],e);t.unshift(n)},e.test=function(e,n){t[0].addTest(new i(e,n))}})}}),e.register("interfaces/tdd.js",function(e,t,n){var r=n("../suite"),i=n("../test");e.exports=function(e){var t=[e];e.on("pre-require",function(e,n,s){e.setup=function(e){t[0].beforeEach(e)},e.teardown=function(e){t[0].afterEach(e)},e.suiteSetup=function(e){t[0].beforeAll(e)},e.suiteTeardown=function(e){t[0].afterAll(e)},e.suite=function(e,n){var i=r.create(t[0],e);return t.unshift(i),n(),t.shift(),i},e.suite.only=function(t,n){var r=e.suite(t,n);s.grep(r.fullTitle())},e.test=function(e,n){var r=new i(e,n);return t[0].addTest(r),r},e.test.only=function(t,n){var r=e.test(t,n);s.grep(r.fullTitle())}})}}),e.register("mocha.js",function(e,t,n){function s(e){return __dirname+"/../images/"+e+".png"}function o(e){e=e||{},this.files=[],this.options=e,this.grep(e.grep),this.suite=new t.Suite("",new t.Context),this.ui(e.ui),this.reporter(e.reporter),e.timeout&&this.timeout(e.timeout)}var r=n("browser/path"),i=n("./utils");t=e.exports=o,t.utils=i,t.interfaces=n("./interfaces"),t.reporters=n("./reporters"),t.Runnable=n("./runnable"),t.Context=n("./context"),t.Runner=n("./runner"),t.Suite=n("./suite"),t.Hook=n("./hook"),t.Test=n("./test"),o.prototype.addFile=function(e){return this.files.push(e),this},o.prototype.reporter=function(e){if("function"==typeof e)this._reporter=e;else{e=e||"dot";try{this._reporter=n("./reporters/"+e)}catch(t){this._reporter=n(e)}if(!this._reporter)throw new Error('invalid reporter "'+e+'"')}return this},o.prototype.ui=function(e){e=e||"bdd",this._ui=t.interfaces[e];if(!this._ui)throw new Error('invalid interface "'+e+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(e){var t=this,i=this.suite,s=this.files.length;this.files.forEach(function(o){o=r.resolve(o),i.emit("pre-require",global,o,t),i.emit("require",n(o),o,t),i.emit("post-require",global,o,t),--s||e&&e()})},o.prototype._growl=function(e,t){var r=n("growl");e.on("end",function(){var n=t.stats;if(n.failures){var i=n.failures+" of "+e.total+" tests failed";r(i,{name:"mocha",title:"Failed",image:s("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:s("ok")})})},o.prototype.grep=function(e){return this.options.grep="string"==typeof e?new RegExp(i.escapeRegexp(e)):e,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(e){return this.options.globals=(this.options.globals||[]).concat(e),this},o.prototype.timeout=function(e){return this.suite.timeout(e),this},o.prototype.run=function(e){this.loadFiles();var n=this.suite,r=this.options,i=new t.Runner(n),s=new this._reporter(i);return i.ignoreLeaks=r.ignoreLeaks,r.grep&&i.grep(r.grep,r.invert),r.globals&&i.globals(r.globals),r.growl&&this._growl(i,s),i.run(e)}}),e.register("reporters/base.js",function(e,t,n){function h(e){var n=this,r=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},i=this.failures=[];if(!e)return;this.runner=e,e.on("start",function(){r.start=new s}),e.on("suite",function(e){r.suites=r.suites||0,e.root||r.suites++}),e.on("test end",function(e){r.tests=r.tests||0,r.tests++}),e.on("pass",function(e){r.passes=r.passes||0;var n=t.slow/2;e.speed=e.duration>t.slow?"slow":e.duration>n?"medium":"fast",r.passes++}),e.on("fail",function(e,t){r.failures=r.failures||0,r.failures++,e.err=t,i.push(e)}),e.on("end",function(){r.end=new s,r.duration=new s-r.start}),e.on("pending",function(){r.pending++})}function p(e,t){return e=String(e),Array(t-e.length+1).join(" ")+e}function d(e,t){return i["diff"+t](e.actual,e.expected).map(function(e){return/^(\n+)$/.test(e.value)&&(e.value=Array(++RegExp.$1.length).join("<newline>")),e.added?v("diff added",e.value):e.removed?v("diff removed",e.value):e.value}).join("")}function v(e,t){return t.split("\n").map(function(t){return c(e,t)}).join("\n")}var r=n("browser/tty"),i=n("browser/diff"),s=global.Date,o=global.setTimeout,u=global.setInterval,a=global.clearTimeout,f=global.clearInterval,l=r.isatty(1)&&r.isatty(2);t=e.exports=h,t.useColors=l,t.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var c=t.color=function(e,n){return t.useColors?"["+t.colors[e]+"m"+n+"[0m":n};t.window={width:l?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:r.getWindowSize()[1]:75},t.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("[2K")},beginningOfLine:function(){process.stdout.write("[0G")},CR:function(){t.cursor.deleteLine(),t.cursor.beginningOfLine()}},t.slow=75,t.list=function(e){console.error(),e.forEach(function(e,t){var n=c("error title","  %s) %s:\n")+c("error message","     %s")+c("error stack","\n%s\n"),r=e.err,i=r.message||"",s=r.stack||i,o=s.indexOf(i)+i.length,u=s.slice(0,o),a=r.actual,f=r.expected;if("string"==typeof a&&"string"==typeof f){var l=Math.max(a.length,f.length);l<20?u=d(r,"Chars"):u=d(r,"Words");var h=u.split("\n");if(h.length>4){var v=String(h.length).length;u=h.map(function(e,t){return p(++t,v)+" |"+" "+e}).join("\n")}u="\n"+c("diff removed","actual")+" "+c("diff added","expected")+"\n\n"+u+"\n",u=u.replace(/^/gm,"      "),n=c("error title","  %s) %s:\n%s")+c("error stack","\n%s\n")}s=s.slice(o?o+1:o).replace(/^/gm,"  "),console.error(n,t+1,e.fullTitle(),u,s)})},h.prototype.epilogue=function(){function r(e){return 1==e?"test":"tests"}var e=this.stats,t,n;console.log();if(e.failures){t=c("bright fail","  ✖")+c("fail"," %d of %d %s failed")+c("light",":"),console.error(t,e.failures,this.runner.total,r(this.runner.total)),h.list(this.failures),console.error();return}t=c("bright pass","  ✔")+c("green"," %d %s complete")+c("light"," (%dms)"),console.log(t,e.tests||0,r(e.tests),e.duration),e.pending&&(t=c("pending","  •")+c("pending"," %d %s pending"),console.log(t,e.pending,r(e.pending))),console.log()}}),e.register("reporters/doc.js",function(e,t,n){function s(e){function u(){return Array(o).join("  ")}r.call(this,e);var t=this,n=this.stats,s=e.total,o=2;e.on("suite",function(e){if(e.root)return;++o,console.log('%s<section class="suite">',u()),++o,console.log("%s<h1>%s</h1>",u(),e.title),console.log("%s<dl>",u())}),e.on("suite end",function(e){if(e.root)return;console.log("%s</dl>",u()),--o,console.log("%s</section>",u()),--o}),e.on("pass",function(e){console.log("%s  <dt>%s</dt>",u(),e.title);var t=i.escape(i.clean(e.fn.toString()));console.log("%s  <dd><pre><code>%s</code></pre></dd>",u(),t)})}var r=n("./base"),i=n("../utils");t=e.exports=s}),e.register("reporters/dot.js",function(e,t,n){function s(e){r.call(this,e);var t=this,n=this.stats,s=r.window.width*.75|0,o="․",u=0;e.on("start",function(){process.stdout.write("\n  ")}),e.on("pending",function(e){process.stdout.write(i("pending",o))}),e.on("pass",function(e){++u%s==0&&process.stdout.write("\n  "),"slow"==e.speed?process.stdout.write(i("bright yellow",o)):process.stdout.write(i(e.speed,o))}),e.on("fail",function(e,t){++u%s==0&&process.stdout.write("\n  "),process.stdout.write(i("fail",o))}),e.on("end",function(){console.log(),t.epilogue()})}var r=n("./base"),i=r.color;t=e.exports=s,s.prototype=new r,s.prototype.constructor=s}),e.register("reporters/html-cov.js",function(e,t,n){function s(e){var t=n("jade"),s=__dirname+"/templates/coverage.jade",u=i.readFileSync(s,"utf8"),a=t.compile(u,{filename:s}),f=this;r.call(this,e,!1),e.on("end",function(){process.stdout.write(a({cov:f.cov,coverageClass:o}))})}function o(e){return e>=75?"high":e>=50?"medium":e>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");t=e.exports=s}),e.register("reporters/html.js",function(e,t,n){function p(e,t){r.call(this,e);var n=this,a=this.stats,f=e.total,l=v(h),c=l.getElementsByTagName("li"),p=c[1].getElementsByTagName("em")[0],y=c[1].getElementsByTagName("a")[0],b=c[2].getElementsByTagName("em")[0],w=c[2].getElementsByTagName("a")[0],E=c[3].getElementsByTagName("em")[0],S=l.getElementsByTagName("canvas")[0],x=v('<ul id="report"></ul>'),T=[x],N,C;t=t||document.getElementById("mocha");if(S.getContext){var k=window.devicePixelRatio||1;S.style.width=S.width,S.style.height=S.height,S.width*=k,S.height*=k,C=S.getContext("2d"),C.scale(k,k),N=new s}if(!t)return d("#mocha div missing, add it to your document");g(y,"click",function(){var e=/pass/.test(x.className)?"":" pass";x.className=x.className.replace(/fail|pass/g,"")+e}),g(w,"click",function(){var e=/fail/.test(x.className)?"":" fail";x.className=x.className.replace(/fail|pass/g,"")+e}),t.appendChild(l),t.appendChild(x),N&&N.size(40),e.on("suite",function(e){if(e.root)return;var t="?grep="+encodeURIComponent(e.fullTitle()),n=v('<li class="suite"><h1><a href="%s">%s</a></h1></li>',t,o(e.title));T[0].appendChild(n),T.unshift(document.createElement("ul")),n.appendChild(T[0])}),e.on("suite end",function(e){if(e.root)return;T.shift()}),e.on("fail",function(t,n){("hook"==t.type||n.uncaught)&&e.emit("test end",t)}),e.on("test end",function(e){window.scrollTo(0,document.body.scrollHeight);var t=a.tests/f*100|0;N&&N.update(t).draw(C);var n=new u-a.start;m(p,a.passes),m(b,a.failures),m(E,(n/1e3).toFixed(2));if("passed"==e.state)var r=v('<li class="test pass %e"><h2>%e<span class="duration">%ems</span></h2></li>',e.speed,e.title,e.duration);else if(e.pending)var r=v('<li class="test pass pending"><h2>%e</h2></li>',e.title);else{var r=v('<li class="test fail"><h2>%e</h2></li>',e.title),s=e.err.stack||e.err.toString();~s.indexOf(e.err.message)||(s=e.err.message+"\n"+s),"[object Error]"==s&&(s=e.err.message),!e.err.stack&&e.err.sourceURL&&e.err.line!==undefined&&(s+="\n("+e.err.sourceURL+":"+e.err.line+")"),r.appendChild(v('<pre class="error">%e</pre>',s))}if(!e.pending){var o=r.getElementsByTagName("h2")[0];g(o,"click",function(){l.style.display="none"==l.style.display?"inline-block":"none"});var l=v("<pre><code>%e</code></pre>",i.clean(e.fn.toString()));r.appendChild(l),l.style.display="none"}T[0].appendChild(r)})}function d(e){document.body.appendChild(v('<div id="error">%s</div>',e))}function v(e){var t=arguments,n=document.createElement("div"),r=1;return n.innerHTML=e.replace(/%([se])/g,function(e,n){switch(n){case"s":return String(t[r++]);case"e":return o(t[r++])}}),n.firstChild}function m(e,t){e.textContent?e.textContent=t:e.innerText=t}function g(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}var r=n("./base"),i=n("../utils"),s=n("../browser/progress"),o=i.escape,u=global.Date,a=global.setTimeout,f=global.setInterval,l=global.clearTimeout,c=global.clearInterval;t=e.exports=p;var h='<ul id="stats"><li class="progress"><canvas width="40" height="40"></canvas></li><li class="passes"><a href="#">passes:</a> <em>0</em></li><li class="failures"><a href="#">failures:</a> <em>0</em></li><li class="duration">duration: <em>0</em>s</li></ul>'}),e.register("reporters/index.js",function(e,t,n){t.Base=n("./base"),t.Dot=n("./dot"),t.Doc=n("./doc"),t.TAP=n("./tap"),t.JSON=n("./json"),t.HTML=n("./html"),t.List=n("./list"),t.Min=n("./min"),t.Spec=n("./spec"),t.Nyan=n("./nyan"),t.XUnit=n("./xunit"),t.Markdown=n("./markdown"),t.Progress=n("./progress"),t.Landing=n("./landing"),t.JSONCov=n("./json-cov"),t.HTMLCov=n("./html-cov"),t.JSONStream=n("./json-stream"),t.Teamcity=n("./teamcity")}),e.register("reporters/json-cov.js",function(e,t,n){function i(e,t){var n=this,t=1==arguments.length?!0:t;r.call(this,e);var i=[],o=[],a=[];e.on("test end",function(e){i.push(e)}),e.on("pass",function(e){a.push(e)}),e.on("fail",function(e){o.push(e)}),e.on("end",function(){var e=global._$jscoverage||{},r=n.cov=s(e);r.stats=n.stats,r.tests=i.map(u),r.failures=o.map(u),r.passes=a.map(u);if(!t)return;process.stdout.write(JSON.stringify(r,null,2))})}function s(e){var t={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in e){var r=o(n,e[n]);t.files.push(r),t.hits+=r.hits,t.misses+=r.misses,t.sloc+=r.sloc}return t.sloc>0&&(t.coverage=t.hits/t.sloc*100),t}function o(e,t){var n={filename:e,coverage:0,hits:0,misses:0,sloc:0,source:{}};return t.source.forEach(function(e,r){r++,t[r]===0?(n.misses++,n.sloc++):t[r]!==undefined&&(n.hits++,n.sloc++),n.source[r]={source:e,coverage:t[r]===undefined?"":t[r]}}),n.coverage=n.hits/n.sloc*100,n}function u(e){return{title:e.title,fullTitle:e.fullTitle(),duration:e.duration}}var r=n("./base");t=e.exports=i}),e.register("reporters/json-stream.js",function(e,t,n){function s(e){r.call(this,e);var t=this,n=this.stats,i=e.total;e.on("start",function(){console.log(JSON.stringify(["start",{total:i}]))}),e.on("pass",function(e){console.log(JSON.stringify(["pass",o(e)]))}),e.on("fail",function(e,t){console.log(JSON.stringify(["fail",o(e)]))}),e.on("end",function(){process.stdout.write(JSON.stringify(["end",t.stats]))})}function o(e){return{title:e.title,fullTitle:e.fullTitle(),duration:e.duration}}var r=n("./base"),i=r.color;t=e.exports=s}),e.register("reporters/json.js",function(e,t,n){function o(e){var t=this;r.call(this,e);var n=[],i=[],s=[];e.on("test end",function(e){n.push(e)}),e.on("pass",function(e){s.push(e)}),e.on("fail",function(e){i.push(e)}),e.on("end",function(){var e={stats:t.stats,tests:n.map(u),failures:i.map(u),passes:s.map(u)};process.stdout.write(JSON.stringify(e,null,2))})}function u(e){return{title:e.title,fullTitle:e.fullTitle(),duration:e.duration}}var r=n("./base"),i=r.cursor,s=r.color;t=e.exports=o}),e.register("reporters/landing.js",function(e,t,n){function o(e){function h(){var e=Array(o).join("-");return"  "+s("runway",e)}r.call(this,e);var t=this,n=this.stats,o=r.window.width*.75|0,u=e.total,a=process.stdout,f=s("plane","✈"),l=-1,c=0;e.on("start",function(){a.write("\n  "),i.hide()}),e.on("test end",function(e){var t=-1==l?o*++c/u|0:l;"failed"==e.state&&(f=s("plane crash","✈"),l=t),a.write("[4F\n\n"),a.write(h()),a.write("\n  "),a.write(s("runway",Array(t).join("⋅"))),a.write(f),a.write(s("runway",Array(o-t).join("⋅")+"\n")),a.write(h()),a.write("[0m")}),e.on("end",function(){i.show(),console.log(),t.epilogue()})}var r=n("./base"),i=r.cursor,s=r.color;t=e.exports=o,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,o.prototype=new r,o.prototype.constructor=o}),e.register("reporters/list.js",function(e,t,n){function o(e){r.call(this,e);var t=this,n=this.stats,o=0;e.on("start",function(){console.log()}),e.on("test",function(e){process.stdout.write(s("pass","    "+e.fullTitle()+": "))}),e.on("pending",function(e){var t=s("checkmark","  -")+s("pending"," %s");console.log(t,e.fullTitle())}),e.on("pass",function(e){var t=s("checkmark","  ✓")+s("pass"," %s: ")+s(e.speed,"%dms");i.CR(),console.log(t,e.fullTitle(),e.duration)}),e.on("fail",function(e,t){i.CR(),console.log(s("fail","  %d) %s"),++o,e.fullTitle())}),e.on("end",t.epilogue.bind(t))}var r=n("./base"),i=r.cursor,s=r.color;t=e.exports=o,o.prototype=new r,o.prototype.constructor=o}),e.register("reporters/markdown.js",function(e,t,n){function s(e){function a(e){return Array(o).join("#")+" "+e}function f(){return Array(o).join("  ")}function l(e,t){var n=t;return t=t[e.title]=t[e.title]||{suite:e},e.suites.forEach(function(e){l(e,t)}),n}function c(e,t){++t;var n="",r;for(var s in e){if("suite"==s)continue;s&&(r=" - ["+s+"](#"+i.slug(e[s].suite.fullTitle())+")\n"),s&&(n+=Array(t).join("  ")+r),n+=c(e[s],t)}return--t,n}function h(e){var t=l(e,{});return c(t,0)}r.call(this,e);var t=this,n=this.stats,s=e.total,o=0,u="";h(e.suite),e.on("suite",function(e){++o;var t=i.slug(e.fullTitle());u+='<a name="'+t+'" />'+"\n",u+=a(e.title)+"\n"}),e.on("suite end",function(e){--o}),e.on("pass",function(e){var t=i.clean(e.fn.toString());u+=e.title+".\n",u+="\n```js\n",u+=t+"\n",u+="```\n\n"}),e.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(h(e.suite)),process.stdout.write(u)})}var r=n("./base"),i=n("../utils");t=e.exports=s}),e.register("reporters/min.js",function(e,t,n){function i(e){r.call(this,e),e.on("start",function(){process.stdout.write("[2J"),process.stdout.write("[1;3H")}),e.on("end",this.epilogue.bind(this))}var r=n("./base");t=e.exports=i,i.prototype=new r,i.prototype.constructor=i}),e.register("reporters/nyan.js",function(e,t,n){function s(e){r.call(this,e);var t=this,n=this.stats,i=r.window.width*.75|0,s=this.rainbowColors=t.generateColors(),u=this.colorIndex=0,a=this.numberOfLines=4,f=this.trajectories=[[],[],[],[]],l=this.nyanCatWidth=11,c=this.trajectoryWidthMax=i-l,h=this.scoreboardWidth=5,p=this.tick=0,d=0;e.on("start",function(){r.cursor.hide(),t.draw("start")}),e.on("pending",function(e){t.draw("pending")}),e.on("pass",function(e){t.draw("pass")}),e.on("fail",function(e,n){t.draw("fail")}),e.on("end",function(){r.cursor.show();for(var e=0;e<t.numberOfLines;e++)o("\n");t.epilogue()})}function o(e){process.stdout.write(e)}var r=n("./base"),i=r.color;t=e.exports=s,s.prototype.draw=function(e){this.appendRainbow(),this.drawScoreboard(),this.drawRainbow(),this.drawNyanCat(e),this.tick=!this.tick},s.prototype.drawScoreboard=function(){function n(e,t){o(" "),o("["+e+"m"+t+"[0m"),o("\n")}var e=this.stats,t=r.colors;n(t.green,e.passes),n(t.fail,e.failures),n(t.pending,e.pending),o("\n"),this.cursorUp(this.numberOfLines)},s.prototype.appendRainbow=function(){var e=this.tick?"_":"-",t=this.rainbowify(e);for(var n=0;n<this.numberOfLines;n++){var r=this.trajectories[n];r.length>=this.trajectoryWidthMax&&r.shift(),r.push(t)}},s.prototype.drawRainbow=function(){var e=this;this.trajectories.forEach(function(t,n){o("["+e.scoreboardWidth+"C"),o(t.join("")),o("\n")}),this.cursorUp(this.numberOfLines)},s.prototype.drawNyanCat=function(e){var t=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(r){o("["+n+"C");switch(r){case 0:o("_,------,"),o("\n");break;case 1:var i=t.tick?"  ":"   ";o("_|"+i+"/\\_/\\ "),o("\n");break;case 2:var i=t.tick?"_":"__",s=t.tick?"~":"^",u;switch(e){case"pass":u="( ^ .^)";break;case"fail":u="( o .o)";break;default:u="( - .-)"}o(s+"|"+i+u+" "),o("\n");break;case 3:var i=t.tick?" ":"  ";o(i+'""  "" '),o("\n")}}),this.cursorUp(this.numberOfLines)},s.prototype.cursorUp=function(e){o("["+e+"A")},s.prototype.cursorDown=function(e){o("["+e+"B")},s.prototype.generateColors=function(){var e=[];for(var t=0;t<42;t++){var n=Math.floor(Math.PI/3),r=t*(1/6),i=Math.floor(3*Math.sin(r)+3),s=Math.floor(3*Math.sin(r+2*n)+3),o=Math.floor(3*Math.sin(r+4*n)+3);e.push(36*i+6*s+o+16)}return e},s.prototype.rainbowify=function(e){var t=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+t+"m"+e+"[0m"},s.prototype=new r,s.prototype.constructor=s}),e.register("reporters/progress.js",function(e,t,n){function o(e,t){r.call(this,e);var n=this,t=t||{},o=this.stats,u=r.window.width*.5|0,a=e.total,f=0,l=Math.max;t.open=t.open||"[",t.complete=t.complete||"▬",t.incomplete=t.incomplete||"⋅",t.close=t.close||"]",t.verbose=!1,e.on("start",function(){console.log(),i.hide()}),e.on("test end",function(){f++;var e=a-f,n=f/a,r=u*n|0,o=u-r;i.CR(),process.stdout.write("[J"),process.stdout.write(s("progress","  "+t.open)),process.stdout.write(Array(r).join(t.complete)),process.stdout.write(Array(o).join(t.incomplete)),process.stdout.write(s("progress",t.close)),t.verbose&&process.stdout.write(s("progress"," "+f+" of "+a))}),e.on("end",function(){i.show(),console.log(),n.epilogue()})}var r=n("./base"),i=r.cursor,s=r.color;t=e.exports=o,r.colors.progress=90,o.prototype=new r,o.prototype.constructor=o}),e.register("reporters/spec.js",function(e,t,n){function o(e){function a(){return Array(o).join("  ")}r.call(this,e);var t=this,n=this.stats,o=0,u=0;e.on("start",function(){console.log()}),e.on("suite",function(e){++o,console.log(s("suite","%s%s"),a(),e.title)}),e.on("suite end",function(e){--o,1==o&&console.log()}),e.on("test",function(e){process.stdout.write(a()+s("pass","  ◦ "+e.title+": "))}),e.on("pending",function(e){var t=a()+s("pending","  - %s");console.log(t,e.title)}),e.on("pass",function(e){if("fast"==e.speed){var t=a()+s("checkmark","  ✓")+s("pass"," %s ");i.CR(),console.log(t,e.title)}else{var t=a()+s("checkmark","  ✓")+s("pass"," %s ")+s(e.speed,"(%dms)");i.CR(),console.log(t,e.title,e.duration)}}),e.on("fail",function(e,t){i.CR(),console.log(a()+s("fail","  %d) %s"),++u,e.title)}),e.on("end",t.epilogue.bind(t))}var r=n("./base"),i=r.cursor,s=r.color;t=e.exports=o,o.prototype=new r,o.prototype.constructor=o}),e.register("reporters/tap.js",function(e,t,n){function o(e){r.call(this,e);var t=this,n=this.stats,i=e.total,s=1;e.on("start",function(){console.log("%d..%d",1,i)}),e.on("test end",function(){++s}),e.on("pending",function(e){console.log("ok %d %s # SKIP -",s,u(e))}),e.on("pass",function(e){console.log("ok %d %s",s,u(e))}),e.on("fail",function(e,t){console.log("not ok %d %s",s,u(e)),console.log(t.stack.replace(/^/gm,"  "))})}function u(e){return e.fullTitle().replace(/#/g,"")}var r=n("./base"),i=r.cursor,s=r.color;t=e.exports=o}),e.register("reporters/teamcity.js",function(e,t,n){function i(e){r.call(this,e);var t=this.stats;e.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),e.on("test",function(e){console.log("##teamcity[testStarted name='"+s(e.fullTitle())+"']")}),e.on("fail",function(e,t){console.log("##teamcity[testFailed name='"+s(e.fullTitle())+"' message='"+s(t.message)+"']")}),e.on("pending",function(e){console.log("##teamcity[testIgnored name='"+s(e.fullTitle())+"' message='pending']")}),e.on("test end",function(e){console.log("##teamcity[testFinished name='"+s(e.fullTitle())+"' duration='"+e.duration+"']")}),e.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+t.duration+"']")})}function s(e){return e.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var r=n("./base");t=e.exports=i}),e.register("reporters/xunit.js",function(e,t,n){function c(e){r.call(this,e);var t=this.stats,n=[],i=this;e.on("pass",function(e){n.push(e)}),e.on("fail",function(e){n.push(e)}),e.on("end",function(){console.log(p("testsuite",{name:"Mocha Tests",tests:t.tests,failures:t.failures,errors:t.failures,skip:t.tests-t.failures-t.passes,timestamp:(new o).toUTCString(),time:t.duration/1e3},!1)),n.forEach(h),console.log("</testsuite>")})}function h(e){var t={classname:e.parent.fullTitle(),name:e.title,time:e.duration/1e3};if("failed"==e.state){var n=e.err;t.message=s(n.message),console.log(p("testcase",t,!1,p("failure",t,!1,d(n.stack))))}else e.pending?console.log(p("testcase",t,!1,p("skipped",{},!0))):console.log(p("testcase",t,!0))}function p(e,t,n,r){var i=n?"/>":">",o=[],u;for(var a in t)o.push(a+'="'+s(t[a])+'"');return u="<"+e+(o.length?" "+o.join(" "):"")+i,r&&(u+=r+"</"+e+i),u}function d(e){return"<![CDATA["+s(e)+"]]>"}var r=n("./base"),i=n("../utils"),s=i.escape,o=global.Date,u=global.setTimeout,a=global.setInterval,f=global.clearTimeout,l=global.clearInterval;t=e.exports=c,c.prototype=new r,c.prototype.constructor=c}),e.register("runnable.js",function(e,t,n){function l(e,t){this.title=e,this.fn=t,this.async=t&&t.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runnable"),s=global.Date,o=global.setTimeout,u=global.setInterval,a=global.clearTimeout,f=global.clearInterval;e.exports=l,l.prototype=new r,l.prototype.constructor=l,l.prototype.timeout=function(e){return 0==arguments.length?this._timeout:(i("timeout %d",e),this._timeout=e,this.timer&&this.resetTimeout(),this)},l.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},l.prototype.clearTimeout=function(){a(this.timer)},l.prototype.inspect=function(){return JSON.stringify(this,function(e,t){if("_"==e[0])return;return"parent"==e?"#<Suite>":"ctx"==e?"#<Context>":t},2)},l.prototype.resetTimeout=function(){var e=this,t=this.timeout();this.clearTimeout(),t&&(this.timer=o(function(){e.callback(new Error("timeout of "+t+"ms exceeded")),e.timedOut=!0},t))},l.prototype.run=function(e){function f(e){if(a)return;a=!0,t.emit("error",e||new Error("done() called multiple times"))}function l(n){if(t.timedOut)return;if(u)return f(n);t.clearTimeout(),t.duration=new s-r,u=!0,e(n)}var t=this,n=this.timeout(),r=new s,i=this.ctx,u,a;i&&i.runnable(this),this.async&&n&&(this.timer=o(function(){l(new Error("timeout of "+n+"ms exceeded")),t.timedOut=!0},n)),this.callback=l;if(this.async){try{this.fn.call(i,function(e){if(e instanceof Error)return l(e);if(null!=e)return l(new Error("done() invoked with non-Error: "+e));l()})}catch(c){l(c)}return}try{this.pending||this.fn.call(i),this.duration=new s-r,e()}catch(c){e(c)}}}),e.register("runner.js",function(e,t,n){function l(e){var t=this;this._globals=[],this.suite=e,this.total=e.total(),this.failures=0,this.on("test end",function(e){t.checkGlobals(e)}),this.on("hook end",function(e){t.checkGlobals(e)}),this.grep(/.*/),this.globals(o.keys(global).concat(["errno"]))}function c(e){return u(a(global),function(t){var n=u(e,function(e){return~e.indexOf("*")?0==t.indexOf(e.split("*")[0]):t==e});return n.length==0&&(!global.navigator||"onerror"!==t)})}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runner"),s=n("./test"),o=n("./utils"),u=o.filter,a=o.keys,f=function(){};e.exports=l,l.prototype=new r,l.prototype.constructor=l,l.prototype.grep=function(e,t){return i("grep %s",e),this._grep=e,this._invert=t,this.total=this.grepTotal(this.suite),this},l.prototype.grepTotal=function(e){var t=this,n=0;return e.eachTest(function(e){var r=t._grep.test(e.fullTitle());t._invert&&(r=!r),r&&n++}),n},l.prototype.globals=function(e){return 0==arguments.length?this._globals:(i("globals %j",e),o.forEach(e,function(e){this._globals.push(e)},this),this)},l.prototype.checkGlobals=function(e){if(this.ignoreLeaks)return;var t=c(this._globals);this._globals=this._globals.concat(t),t.length>1?this.fail(e,new Error("global leaks detected: "+t.join(", ")+"")):t.length&&this.fail(e,new Error("global leak detected: "+t[0]))},l.prototype.fail=function(e,t){++this.failures,e.state="failed","string"==typeof t&&(t=new Error('the string "'+t+'" was thrown, throw an Error :)')),this.emit("fail",e,t)},l.prototype.failHook=function(e,t){this.fail(e,t),this.emit("end")},l.prototype.hook=function(e,t){function u(e){var n=r[e];if(!n)return t();s.currentRunnable=n,s.emit("hook",n),n.on("error",function(e){s.failHook(n,e)}),n.run(function(t){n.removeAllListeners("error");var r=n.error();r&&s.fail(s.test,r);if(t)return s.failHook(n,t);s.emit("hook end",n),u(++e)})}var n=this.suite,r=n["_"+e],i=n._timeout,s=this,o;process.nextTick(function(){u(0)})},l.prototype.hooks=function(e,t,n){function s(o){r.suite=o;if(!o)return r.suite=i,n();r.hook(e,function(e){if(e)return r.suite=i,n(e);s(t.pop())})}var r=this,i=this.suite;s(t.pop())},l.prototype.hookUp=function(e,t){var n=[this.suite].concat(this.parents()).reverse();this.hooks(e,n,t)},l.prototype.hookDown=function(e,t){var n=[this.suite].concat(this.parents());this.hooks(e,n,t)},l.prototype.parents=function(){var e=this.suite,t=[];while(e=e.parent)t.push(e);return t},l.prototype.runTest=function(e){var t=this.test,n=this;try{t.on("error",function(e){n.fail(t,e)}),t.run(e)}catch(r){e(r)}},l.prototype.runTests=function(e,t){function s(o){if(n.failures&&e._bail)return t();i=r.shift();if(!i)return t();var u=n._grep.test(i.fullTitle());n._invert&&(u=!u);if(!u)return s();if(i.pending)return n.emit("pending",i),n.emit("test end",i),s();n.emit("test",n.test=i),n.hookDown("beforeEach",function(){n.currentRunnable=n.test,n.runTest(function(e){i=n.test;if(e)return n.fail(i,e),n.emit("test end",i),n.hookUp("afterEach",s);i.state="passed",n.emit("pass",i),n.emit("test end",i),n.hookUp("afterEach",s)})})}var n=this,r=e.tests,i;this.next=s,s()},l.prototype.runSuite=function(e,t){function o(){var t=e.suites[s++];if(!t)return u();r.runSuite(t,o)}function u(){r.suite=e,r.hook("afterAll",function(){r.emit("suite end",e),t()})}var n=this.grepTotal(e),r=this,s=0;i("run suite %s",e.fullTitle());if(!n)return t();this.emit("suite",this.suite=e),this.hook("beforeAll",function(){r.runTests(e,o)})},l.prototype.uncaught=function(e){i("uncaught exception %s",e.message);var t=this.currentRunnable;if(!t||"failed"==t.state)return;t.clearTimeout(),e.uncaught=!0,this.fail(t,e);if("test"==t.type){this.emit("test end",t),this.hookUp("afterEach",this.next);return}this.emit("end")},l.prototype.run=function(e){function n(e){t.uncaught(e)}var t=this,e=e||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",n),e(t.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),t.emit("end")}),process.on("uncaughtException",n),this}}),e.register("suite.js",function(e,t,n){function u(e,t){this.title=e,this.ctx=t,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!e,this._timeout=2e3,this._bail=!1}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:suite"),s=n("./utils"),o=n("./hook");t=e.exports=u,t.create=function(e,t){var n=new u(t,e.ctx);return n.parent=e,e.pending&&(n.pending=!0),t=n.fullTitle(),e.addSuite(n),n},u.prototype=new r,u.prototype.constructor=u,u.prototype.clone=function(){var e=new u(this.title);return i("clone"),e.ctx=this.ctx,e.timeout(this.timeout()),e.bail(this.bail()),e},u.prototype.timeout=function(e){return 0==arguments.length?this._timeout:(String(e).match(/s$/)&&(e=parseFloat(e)*1e3),i("timeout %d",e),this._timeout=parseInt(e,10),this)},u.prototype.bail=function(e){return 0==arguments.length?this._bail:(i("bail %s",e),this._bail=e,this)},u.prototype.beforeAll=function(e){if(this.pending)return this;var t=new o('"before all" hook',e);return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this._beforeAll.push(t),this.emit("beforeAll",t),this},u.prototype.afterAll=function(e){if(this.pending)return this;var t=new o('"after all" hook',e);return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this._afterAll.push(t),this.emit("afterAll",t),this},u.prototype.beforeEach=function(e){if(this.pending)return this;var t=new o('"before each" hook',e);return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this._beforeEach.push(t),this.emit("beforeEach",t),this},u.prototype.afterEach=function(e){if(this.pending)return this;var t=new o('"after each" hook',e);return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this._afterEach.push(t),this.emit("afterEach",t),this},u.prototype.addSuite=function(e){return e.parent=this,e.timeout(this.timeout()),e.bail(this.bail()),this.suites.push(e),this.emit("suite",e),this},u.prototype.addTest=function(e){return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this.tests.push(e),this.emit("test",e),this},u.prototype.fullTitle=function(){if(this.parent){var e=this.parent.fullTitle();if(e)return e+" "+this.title}return this.title},u.prototype.total=function(){return s.reduce(this.suites,function(e,t){return e+t.total()},0)+this.tests.length},u.prototype.eachTest=function(e){return s.forEach(this.tests,e),s.forEach(this.suites,function(t){t.eachTest(e)}),this}}),e.register("test.js",function(e,t,n){function i(e,t){r.call(this,e,t),this.pending=!t,this.type="test"}var r=n("./runnable");e.exports=i,i.prototype=new r,i.prototype.constructor=i}),e.register("utils.js",function(e,t,n){function a(e){return!~u.indexOf(e)}function f(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\/\/(.*)/gm,'<span class="comment">//$1</span>').replace(/('.*?')/gm,'<span class="string">$1</span>').replace(/(\d+\.\d+)/gm,'<span class="number">$1</span>').replace(/(\d+)/gm,'<span class="number">$1</span>').replace(/\bnew *(\w+)/gm,'<span class="keyword">new</span> <span class="init">$1</span>').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'<span class="keyword">$1</span>')}var r=n("browser/fs"),i=n("browser/path"),s=i.join,o=n("browser/debug")("mocha:watch"),u=["node_modules",".git"];t.escape=function(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},t.forEach=function(e,t,n){for(var r=0,i=e.length;r<i;r++)t.call(n,e[r],r)},t.indexOf=function(e,t,n){for(var r=n||0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1},t.reduce=function(e,t,n,r){var i=n;for(var s=0,o=e.length;s<o;s++)i=t.call(r,i,e[s],s,e);return i},t.filter=function(e,t,n){var r=[];for(var i=0,s=e.length;i<s;i++){var o=e[i];t.call(n,o,i,e)&&r.push(o)}return r},t.keys=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var r in e)n.call(e,r)&&t.push(r);return t},t.watch=function(e,t){var n={interval:100};e.forEach(function(e){o("file %s",e),r.watchFile(e,n,function(n,r){r.mtime<n.mtime&&t(e)})})},t.files=function(e,n){return n=n||[],r.readdirSync(e).filter(a).forEach(function(i){i=s(e,i),r.statSync(i).isDirectory()?t.files(i,n):i.match(/\.(js|coffee)$/)&&n.push(i)}),n},t.slug=function(e){return e.toLowerCase().replace(/ +/g,"-").replace(/[^-\w]/g,"")},t.clean=function(e){e=e.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var n=e.match(/^\n?( *)/)[1].length,r=new RegExp("^ {"+n+"}","gm");return e=e.replace(r,""),t.trim(e)},t.escapeRegexp=function(e){return e.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},t.trim=function(e){return e.replace(/^\s+|\s+$/g,"")},t.parseQuery=function(e){return t.reduce(e.replace("?","").split("&"),function(e,t){var n=t.indexOf("="),r=t.slice(0,n),i=t.slice(++n);return e[r]=decodeURIComponent(i),e},{})},t.highlightTags=function(e){var t=document.getElementsByTagName(e);for(var n=0,r=t.length;n<r;++n)t[n].innerHTML=f(t[n].innerHTML)}}),process={},process.exit=function(e){},process.stdout={},global=window,process.nextTick=function(){if(window.ActiveXObject||!window.postMessage)return function(e){e()};var e=[],t="mocha-zero-timeout";return window.addEventListener("message",function(n){n.source==window&&n.data==t&&(n.stopPropagation&&n.stopPropagation(),e.length&&e.shift()())},!0),function(n){e.push(n),window.postMessage(t,"*")}}(),process.removeListener=function(e){"uncaughtException"==e&&(window.onerror=null)},process.on=function(e,t){"uncaughtException"==e&&(window.onerror=t)},function(){var t=window.Mocha=e("mocha"),n=window.mocha=new t({reporter:"html"});n.ui=function(e){return t.prototype.ui.call(this,e),this.suite.emit("pre-require",window,null,this),this},n.setup=function(e){"string"==typeof e&&(e={ui:e});for(var t in e)this[t](e[t]);return this},n.run=function(e){var r=n.options;n.globals("location");var i=t.utils.parseQuery(window.location.search||"");return i.grep&&n.grep(i.grep),t.prototype.run.call(n,function(){t.utils.highlightTags("code"),e&&e()})}}()}(),define("mocha",[],function(){});var BUNYIP=BUNYIP||{};(function(e,t){function f(n){e.$yetify!==t&&$yetify.tower.emit("results",n)}var n={},r,i={}.toString,s={},o=0,u=0,a=0;BUNYIP=n,BUNYIP.hookup=function(e){var t={},n={},r=0,i=0,s=0;e.on("test end",function(e){var t=e.title;n[t]={message:e.state==="failed"?e.err.message:"",result:e.state==="passed"?!0:"fail",name:t},r=e.state==="passed"?r+1:r,i=e.state==="failed"?i+1:i,s+=1}),e.on("suite end",function(e){if(e.suites.length===0){var o=e.fullTitle();t[o]={name:o,passed:r,failed:i,total:s};for(var u in n)t[o][n[u].name]={result:n[u].result,message:n[u].message,name:n[u].name};n={},r=i=s=0}}),e.on("end",function(n){var r=t;r.passed=e.total-e.failures||0,r.failed=e.failures||0,r.total=e.total,r.duration=0,r.name=document.title,delete r.hookup,f(r)})}})(this),define("mocha_yeti",[],function(){}),function(){function t(e){describe("Array",function(){describe("#indexOf()",function(){it("should return -1 when the value is not present",function(){e([1,2,3].indexOf(5)).to.be(-1),e([1,2,3].indexOf(0)).to.be(-1)})}),describe("#length",function(){it("should return 3 for [1,2,3]",function(){e([1,2,3].length).to.be(3)}),it("should return 0 for []",function(){e([].length).to.be(0)})})})}var e=this.define;e?define("test/test",[],function(){t(expect)}):t(require("expect.js"))}(),define("specs",["test/test"],function(){}),require.config({baseUrl:".",urlArgs:"v="+(new Date).getTime(),shim:{mocha:{exports:"mocha"},expect:{exports:"expect"},mocha_yeti:{exports:"BUNYIP"}},paths:{mocha_yeti:"lib/mocha-yeti-adaptor",specs:"specs",mocha:"lib/mocha",expect:"lib/assertion/expect"}}),require(["require","expect","mocha","mocha_yeti"],function(e){this.mocha.setup("bdd"),e(["specs"],function(){var e=this.mocha.run();this.BUNYIP.hookup(e)})}),define("tests",[],function(){})