node-vitals
Version:
Do more with less. A simple, high-performing, functional JavaScript library.
101 lines • 50.4 kB
JavaScript
/* vitals.js v4.1.3 (http://vitalsjs.com)
* Copyright (c) 2016 Adam A Smith <adam@imaginate.life>
* The Apache License (http://vitalsjs.com/license) */
(function(r,A){function y(a,q){return"object"===a||!q&&"function"===a}function w(a,q){return(a=a&&q&&a.nodeType?!1:a)&&!q&&a.Object!==Object?!1:!!a}function E(a){a.vitals=A;a.Vitals=A}var C=y(typeof exports)&&w(exports,!0),G=y(typeof module)&&w(module,!0),H=y(typeof global,!0)&&w(global),F=y(typeof window)&&w(window),a=y(typeof self)&&w(self),B=y(typeof r)&&w(r);r=C&&G&&H?global:F&&window!==(r&&r.window)?window:a?self:B?r:Function("return this")();F&&E(window);a&&E(self);E(r);C&&G&&(module.exports===
exports?module.exports=A:E(exports));"function"===typeof define&&define.amd&&"object"===typeof define.amd&&define(function(){return A})})(this,function(r){function A(a,g){var h,k;h=a.length;for(k=-1;++k<h;)if(a[k]===g)return!0;return!1}function y(a){a="vitals."+a;var g=function(g,k){var n;k=k?a:a+"."+k;n=Error(g+" for "+k+" call.");n.__vitals=!0;n.vitals=!0;return n};g.type=function(g,k){var n;k=k?a:a+"."+k;n=new TypeError("Invalid "+(g+" param")+" in "+k+" call.");n.__vitals=!0;n.vitals=!0;return n};
g.range=function(g,k,n){n=n?a:a+"."+n;g="The "+(g+" param")+" was out-of-range for a "+n+" call.";k=new RangeError(g+(k?" The valid options are: "+k:""));k.__vitals=!0;k.vitals=!0;return k};return g}function w(a,g,h){var k,n;k=a.length;g=g?0>g?k+g:g:0;g=0>g?0:g;h=h===r||h>k?k:0>h?k+h:h;if(g>=h)return[];k=Array(h-g);--g;for(n=0;++g<h;)k[n++]=a[g];return k}function E(a,g,h){var k;k=a.length;g=g?0>g?k+g:g:0;g=0>g?0:g;h=h===r||h>k?k:0>h?k+h:h;return g>=h?"":a.substring(g,h)}var C=function(){var a=Object.prototype.hasOwnProperty;
return function(g){var h,k;h={};for(k in g)a.call(g,k)&&(h[k]=g[k]);return h}}(),G=function(){var a=/[\\^$.*+?|(){}[\]]/g;return function(g){return g.replace(a,"\\$&")}}(),H=function(){var a=Object.prototype.hasOwnProperty;return function(g,h){for(var k in g)if(a.call(g,k)&&g[k]===h)return!0;return!1}}(),F=function(){var a=String.prototype.includes?function(a,c){return a.includes(c)}:function(a,c){return-1!==a.indexOf(c)};return function(g,h){h=String(h);return g?h?a(g,h):!0:!h}}(),a=function(){var a=
{nil:function(a){return null===a},undefined:function(a){return a===r},bool:function(a){return"boolean"===typeof a},str:function(a){return"string"===typeof a},_str:function(a){return!!a&&"string"===typeof a},num:function(a){return"number"===typeof a&&a===a},_num:function(a){return!!a&&"number"===typeof a&&a===a},nan:function(a){return a!==a}},g=Object.prototype.toString;a.obj=function(a){return!!a&&"object"===typeof a};a._obj=function(a){return(a=!!a&&typeof a)&&("object"===a||"function"===a)};a.func=
function(a){return!!a&&"function"===typeof a};a.arr=function(a){return!!a&&"object"===typeof a&&"[object Array]"===g.call(a)};a._arr=function(n){if(!a.obj(n))return!1;n=g.call(n);return"[object Array]"===n||"[object Arguments]"===n};a.regex=function(a){return!!a&&"object"===typeof a&&"[object RegExp]"===g.call(a)};a.date=function(a){return!!a&&"object"===typeof a&&"[object Date]"===g.call(a)};a.err=function(a){return!!a&&"object"===typeof a&&"[object Error]"===g.call(a)};a.args=function(a){return!!a&&
"object"===typeof a&&"[object Arguments]"===g.call(a)};(function(){if(!a.args(arguments)){a._arr=function(a){return!!a&&"object"===typeof a&&("[object Array]"===g.call(a)||"callee"in a)};a.args=function(a){return!!a&&"object"===typeof a&&"callee"in a};try{a.args({})}catch(n){a._arr=a.arr,a.args=function(){return!1}}}})();a.doc=function(a){return!!a&&"object"===typeof a&&9===a.nodeType};a.elem=function(a){return!!a&&"object"===typeof a&&1===a.nodeType};var h=Object.prototype.hasOwnProperty;a.empty=
function(a){var c;if(!a)return!0;if("function"===typeof a)return!a.length;if("object"!==typeof a)return!1;if("[object Array]"===g.call(a))return!a.length;for(c in a)if(h.call(a,c))return!1;return!0};var k=/^(?:cr|lf|crlf)$/i;a.eol=function(a){return k.test(a)};a.frozen=function(){if(!Object.isFrozen)return function(a){return!1};try{return Object.isFrozen(function(){}),Object.isFrozen}catch(a){return function(a){return"object"===typeof a&&Object.isFrozen(a)}}}();a.whole=function(a){return!(a%1)};a.odd=
function(a){return!!(a%2)};a.even=function(a){return!(a%2)};a.un={};a.un.bool=function(a){return a===r||"boolean"===typeof a};a.un.str=function(a){return a===r||"string"===typeof a};a.un.num=function(a){return a===r||"number"===typeof a&&a===a};a.un.obj=function(a){return a===r||!!a&&"object"===typeof a};a.un.func=function(a){return a===r||!!a&&"function"===typeof a};a.un.arr=function(a){return a===r||!!a&&"object"===typeof a&&"[object Array]"===g.call(a)};a.un.regex=function(a){return a===r||!!a&&
"object"===typeof a&&"[object RegExp]"===g.call(a)};a.nil.bool=function(a){return null===a||"boolean"===typeof a};a.nil.str=function(a){return null===a||"string"===typeof a};a.nil.num=function(a){return null===a||"number"===typeof a&&a===a};a.nil.obj=function(a){return null===a||!!a&&"object"===typeof a};a.nil.func=function(a){return null===a||!!a&&"function"===typeof a};a.nil.arr=function(a){return null===a||!!a&&"object"===typeof a&&"[object Array]"===g.call(a)};a.nil.regex=function(a){return null===
a||!!a&&"object"===typeof a&&"[object RegExp]"===g.call(a)};a.nil.un={};a.nil.un.bool=function(a){return null===a||a===r||"boolean"===typeof a};a.nil.un.str=function(a){return null===a||a===r||"string"===typeof a};a.nil.un.num=function(a){return null===a||a===r||"number"===typeof a&&a===a};a.nil.un.obj=function(a){return null===a||a===r||!!a&&"object"===typeof a};a.nil.un.func=function(a){return null===a||a===r||!!a&&"undefined"===typeof a};a.nil.un.arr=function(a){return null===a||a===r||!!a&&"object"===
typeof a&&"[object Array]"===g.call(a)};a.nil.un.regex=function(a){return null===a||a===r||!!a&&"object"===typeof a&&"[object RegExp]"===g.call(a)};return a}(),B=function(){var a=Object.prototype.toString,g=String.prototype.includes?function(a,c){return a.includes(c)}:function(a,c){return-1!==a.indexOf(c)};return function(h,k){var n;k&&"object"===typeof k&&"[object RegExp]"===a.call(k)?n=k.test(h):(n=String(k),n=h?n?g(h,n):!0:!n);return n}}(),D=function(){var a=Object.prototype.hasOwnProperty;return function(g,
h){for(var k in h)a.call(h,k)&&(g[k]=h[k]);return g}}(),q=function(){var a=Object.prototype.hasOwnProperty;return function(g,h){return!!g&&a.call(g,h)}}(),L=function(){var a=Object.prototype.propertyIsEnumerable;return function(g,h){return!!g&&a.call(g,h)}}(),v=function(){var a=String.prototype.includes?function(a,c){return a.includes(c)}:function(a,c){return-1!==a.indexOf(c)};return function(g){var h;if(!g)return[""];h=a(g,", ")?", ":a(g,",")?",":a(g,"|")?"|":" ";return g.split(h)}}(),z=function(){function c(c,
g){var h,k;if(2>arguments.length)throw d("No type or val");if(!a._str(c))throw d.type("types");if(e["*"](c))return!0;a:{k=c;var n;e["="](k)&&(k+="|undefined");k=k.toLowerCase();k=k.replace(b,"");k=k.split("|");for(h=k.length;h--;){n="_"+k[h];if(!q(f,n)){k=null;break a}k[h]=f[n]}k=k.length?k:null}if(!k)throw d.range("types",l);h=c;n=e["?"](h);h=e["!"](h);h=(n&&h?0:n||h)?!h&&n:r;if(2<arguments.length)a:{n=arguments;var m;for(m=n.length;--m;)if(!p(k,n[m],h)){k=!1;break a}k=!0}else k=p(k,g,h);return k}
function g(a,b){var d;for(d=a.length;d--;)if(!b(a[d]))return!1;return!0}function h(b){if(a.nil(b))return!1;if(!a._obj(b))throw d.type("val","frozen");return a.frozen(b)}function k(b){if(!a.num(b))throw d.type("val","whole");return a.whole(b)}function n(b){if(!a.num(b))throw d.type("val","odd");if(!a.whole(b))throw d.range("val","whole numbers","odd");return a.odd(b)}function m(b){if(!a.num(b))throw d.type("val","even");if(!a.whole(b))throw d.range("val","whole numbers","even");return a.even(b)}function p(a,
b,d){var e;for(e=a.length;e--;)if(a[e](b,d))return!0;return!1}c["null"]=function(b){switch(arguments.length){case 0:throw d("Missing a val","null");case 1:return a.nil(b);default:return g(arguments,a.nil)}};c.nil=c["null"];c.undefined=function(b){switch(arguments.length){case 0:throw d("Missing a val","undefined");case 1:return a.undefined(b);default:return g(arguments,a.undefined)}};c["boolean"]=function(b){switch(arguments.length){case 0:throw d("Missing a val","boolean");case 1:return a.bool(b);
default:return g(arguments,a.bool)}};c.bool=c["boolean"];c.string=function(b){switch(arguments.length){case 0:throw d("Missing a val","string");case 1:return a.str(b);default:return g(arguments,a.str)}};c.str=c.string;c._string=function(b){switch(arguments.length){case 0:throw d("Missing a val","_string");case 1:return a._str(b);default:return g(arguments,a._str)}};c._str=c._string;c.number=function(b){switch(arguments.length){case 0:throw d("Missing a val","number");case 1:return a.num(b);default:return g(arguments,
a.num)}};c.num=c.number;c._number=function(b){switch(arguments.length){case 0:throw d("Missing a val","_number");case 1:return a._num(b);default:return g(arguments,a._num)}};c._num=c._number;c.nan=function(b){switch(arguments.length){case 0:throw d("Missing a val","nan");case 1:return a.nan(b);default:return g(arguments,a.nan)}};c.object=function(b){switch(arguments.length){case 0:throw d("Missing a val","object");case 1:return a.obj(b);default:return g(arguments,a.obj)}};c.obj=c.object;c._object=
function(b){switch(arguments.length){case 0:throw d("Missing a val","_object");case 1:return a._obj(b);default:return g(arguments,a._obj)}};c._obj=c._object;c.func=function(b){switch(arguments.length){case 0:throw d("Missing a val","function");case 1:return a.func(b);default:return g(arguments,a.func)}};c.fn=c.func;try{c["function"]=c.func}catch(I){}c.array=function(b){switch(arguments.length){case 0:throw d("Missing a val","array");case 1:return a.arr(b);default:return g(arguments,a.arr)}};c.arr=
c.array;c._array=function(b){switch(arguments.length){case 0:throw d("Missing a val","_array");case 1:return a._arr(b);default:return g(arguments,a._arr)}};c._arr=c._array;c.regexp=function(b){switch(arguments.length){case 0:throw d("Missing a val","regexp");case 1:return a.regex(b);default:return g(arguments,a.regex)}};c.regex=c.regexp;c.re=c.regexp;c.date=function(b){switch(arguments.length){case 0:throw d("Missing a val","date");case 1:return a.date(b);default:return g(arguments,a.date)}};c.error=
function(b){switch(arguments.length){case 0:throw d("Missing a val","error");case 1:return a.err(b);default:return g(arguments,a.err)}};c.err=c.error;c.args=function(b){switch(arguments.length){case 0:throw d("Missing a val","args");case 1:return a.args(b);default:return g(arguments,a.args)}};c.document=function(b){switch(arguments.length){case 0:throw d("Missing a val","document");case 1:return a.doc(b);default:return g(arguments,a.doc)}};c.doc=c.document;c.element=function(b){switch(arguments.length){case 0:throw d("Missing a val",
"element");case 1:return a.elem(b);default:return g(arguments,a.elem)}};c.elem=c.element;c.empty=function(b){switch(arguments.length){case 0:throw d("Missing a val","empty");case 1:return a.empty(b);default:return g(arguments,a.empty)}};c.frozen=function(a){switch(arguments.length){case 0:throw d("Missing a val","frozen");case 1:return h(a);default:return g(arguments,h)}};c.whole=function(a){switch(arguments.length){case 0:throw d("Missing a val","whole");case 1:return k(a);default:return g(arguments,
k)}};c.odd=function(a){switch(arguments.length){case 0:throw d("Missing a val","odd");case 1:return n(a);default:return g(arguments,n)}};c.even=function(a){switch(arguments.length){case 0:throw d("Missing a val","even");case 1:return m(a);default:return g(arguments,m)}};var f=function(){function b(a,f,c){for(var l in f)q(f,l)&&d(a,l,f[l],c);return e}function d(b,f,c,l){c=q(d,b)?d[b](c):c;l=!1!==l;e["_"+f]=function(b,d){d=a.bool(d)?d:l;return a.nil(b)?d:c(b)};return e}var e={};d.arrays=function(b){return function(d){var e;
if(!a.arr(d))return!1;for(e=d.length;e--;)if(!b(d[e]))return!1;return!0}};d.maps=function(b){return function(d){var e;if(!a.obj(d))return!1;for(e in d)if(q(d,e)&&!b(d[e]))return!1;return!0}};e=b("primitives",{undefined:a.undefined,"boolean":a.bool,string:a.str,number:a.num,nan:a.nan},!1);e=d("primitives","null",a.nil);e=b("js_objects",{object:a.obj,regexp:a.regex,array:a.arr,date:a.date,error:a.err});e=d("js_objects","arguments",a.args);e=d("js_objects","function",a.func,!1);e=b("dom_objects",{element:a.elem,
document:a.doc});e=d("others","empty",a.empty);e=b("arrays",{nulls:a.nil,booleans:a.bool,strings:a.str,numbers:a.num,nans:a.nan,objects:a.obj,functions:a.func,regexps:a.regex,arrays:a.arr,dates:a.date,errors:a.err,elements:a.elem,documents:a.doc});e=b("maps",{nullmap:a.nil,booleanmap:a.bool,stringmap:a.str,numbermap:a.num,nanmap:a.nan,objectmap:a.obj,functionmap:a.func,regexpmap:a.regex,arraymap:a.arr,datemap:a.date,errormap:a.err,elementmap:a.elem,documentmap:a.doc});return e=function(a){var b,d;
for(b in a)q(a,b)&&(d="_"+a[b],b="_"+b,e[b]=e[d]);return e}({nil:"null",bool:"boolean",str:"string",num:"number",obj:"object",func:"function",fn:"function",regex:"regexp",re:"regexp",arr:"array",err:"error",args:"arguments",elem:"element",doc:"document",nils:"nulls",strs:"strings",nums:"numbers",bools:"booleans",objs:"objects",funcs:"functions",fns:"functions",regexs:"regexps",res:"regexps",arrs:"arrays",errs:"errors",elems:"elements",docs:"documents",nilmap:"nullmap",strmap:"stringmap",nummap:"numbermap",
boolmap:"booleanmap",objmap:"objectmap",funcmap:"functionmap",fnmap:"functionmap",regexmap:"regexpmap",remap:"regexpmap",arrmap:"arraymap",errmap:"errormap",elemmap:"elementmap",docmap:"documentmap"})}(),b=/[^a-z\|]/g,e=function(a,b,d,e,f){return{"|":function(b){return a.test(b)},"!":function(a){return b.test(a)},"?":function(a){return d.test(a)},"=":function(a){return e.test(a)},"*":function(a){return f.test(a)}}}(/\|/,/\!/,/\?/,/\=/,/\*|any/),d=y("is"),l="https://github.com/imaginate/vitals/wiki/vitals.is-types";
return c}(),t=function(){function c(e,d){if(!arguments.length)throw b("Missing a val");if(!a.un.bool(d))throw b.type("deep");return a._obj(e)?a.func(e)?n(e,d):a._arr(e)?h(e,d):a.regex(e)?k(e):g(e,d):e}function g(a,b){return b?m({},a):D({},a)}function h(a,b){var f;f=Array(a.length);return b?m(f,a):D(f,a)}function k(b,d){var c,g;c=p(b.source);var h;g="";for(h in f)q(f,h)&&b[h]&&(g+=f[h]);g=a.undefined(d)?g:F(g,"g")?d?g:g.replace("g",""):d?g+"g":g;return g?new RegExp(c,g):new RegExp(c)}function n(a,
b){var f;f=function(){return a.apply(null,arguments)};return b?m(f,a):D(f,a)}function m(a,b){for(var f in b)q(b,f)&&(a[f]=c(b[f],!0));return a}c.object=function(e,d){if(!a.obj(e))throw b.type("obj","object");if(!a.un.bool(d))throw b.type("deep","object");return g(e,d)};c.obj=c.object;c.array=function(e,d){if(!a.obj(e))throw b.type("obj","array");if(!a.num(e.length))throw b.type("obj.length","array");if(!a.un.bool(d))throw b.type("deep","array");return h(e,d)};c.arr=c.array;c.args=c.array;c.regexp=
function(e,d){if(!a.regex(e))throw b.type("regex","regexp");if(!a.un.bool(d))throw b.type("forceGlobal","regexp");return k(e,d)};c.re=c.regexp;c.regex=c.regexp;c.func=function(e,d){if(!a.func(e))throw b.type("func","function");if(!a.un.bool(d))throw b.type("deep","function");return n(e,d)};try{c.fn=c.func,c["function"]=c.func}catch(e){}var p=function(){var a="\\n"!==/\n/.source?/\\/g:null;return a?function(b){return b.replace(a,"\\\\")}:function(a){return a}}(),f=D({ignoreCase:"i",multiline:"m",global:"g"},
"sticky"in RegExp.prototype?{sticky:"y"}:null),b=y("copy");return c}(),M=function(){function c(b,d,e){if(2>arguments.length)throw x("No val defined");if(a.str(b))return d=2<arguments.length?w(arguments,1):d,a.arr(d)?p(b,d):m(b,d);if(!a._obj(b))throw x.type("source");b=a.args(b)?w(b):b;if(a.func(d)){if(!a.nil.un.obj(e))throw x.type("thisArg");return a.arr(b)?v(b,d,e):r(b,d,e)}d=2<arguments.length?w(arguments,1):d;return a.arr(d)?h(b,d):g(b,d)}function g(e,c){return a.arr(e)?a.num(c)?d(e,c):I(e,c):
z("!str|regex",c)?f(e,c):b(e,c)}function h(b,d){var c;if(a.arr(b))c=z("nums",d)?l(b,d):K(b,d);else if(z("!str|regex",d[0])){c=b;var g,h,p;g=a.regex(d[0]);h=d.length;for(p=-1;++p<h;)c=f(c,d[p],g)}else c=e(b,d);return c}function k(b,d,e){var f;f=b.length;d=0>d?f+d:d;if(d>=f)return b;if(a.undefined(e)){if(0>d)return b;b.splice(d,1);return b}d=0>d?0:d;e=e>f?f:0>e?f+e:e;if(d>=e)return b;b.splice(d,e-d);return b}function n(d,e){return a.arr(d)?I(d,e):b(d,e)}function m(b,d){a.regex(d)||(d=String(d),d=G(d),
d=new RegExp(d,"g"));return b.replace(d,"")}function p(a,b){var d,e;d=b.length;for(e=-1;++e<d;)a=m(a,b[e]);return a}function f(b,d,e){e=a.undefined(e)?a.regex(d):e;if(!e)return q(b,d)&&delete b[d],b;e=d;for(d in b)q(b,d)&&B(d,e)&&delete b[d];return b}function b(a,b){for(var d in a)q(a,d)&&a[d]===b&&delete a[d];return a}function e(a,d){var e,f;e=d.length;for(f=-1;++f<e;)a=b(a,d[f]);return a}function d(a,b){var d;d=a.length;b=0>b?d+b:b;if(0>b||b>=d)return a;a.splice(b,1);return a}function l(a,b){var e,
f,c,l;if(!a.length||!b.length)return a;if(2>b.length)return d(a,b[0]);e=D(b,a.length);for(l=e.first.length;l--;)f=e.first[l],c=e.last[l]-f+1,a.splice(f,c);return a}function I(a,b){var d;for(d=a.length;d--;)a[d]===b&&a.splice(d,1);return a}function K(a,b){var d,e,f,c;e=b.length;for(c=a.length;c--;)for(d=a[c],f=e;f--;)if(b[f]===d){a.splice(c,1);break}return a}function r(b,d,e){var f;d=a.undefined(e)?d:C(d,e);e=2<d.length?t(b):b;switch(d.length){case 0:for(f in e)q(e,f)&&!d()&&delete b[f];break;case 1:for(f in e)q(e,
f)&&!d(e[f])&&delete b[f];break;case 2:for(f in e)q(e,f)&&!d(e[f],f)&&delete b[f];break;default:for(f in e)q(e,f)&&!d(e[f],f,e)&&delete b[f]}return b}function v(b,d,e){var f;d=a.undefined(e)?d:C(d,e);e=2<d.length?t.arr(b):b;f=e.length;switch(d.length){case 0:for(;f--;)d()||b.splice(f,1);break;case 1:for(;f--;)d(e[f])||b.splice(f,1);break;case 2:for(;f--;)d(e[f],f)||b.splice(f,1);break;default:for(;f--;)d(e[f],f,e)||b.splice(f,1)}return b}function C(a,b){switch(a.length){case 0:return function(){return a.call(b)};
case 1:return function(d){return a.call(b,d)};case 2:return function(d,e){return a.call(b,d,e)}}return function(d,e,f){return a.call(b,d,e,f)}}c.property=function(b,d,e){if(!a._obj(b))throw x.type("source","property");if(2>arguments.length)throw x("No val defined","property");b=a.args(b)?w(b):b;if(a.func(d)){if(!a.nil.un.obj(e))throw x.type("thisArg","property");return a.arr(b)?v(b,d,e):r(b,d,e)}return g(b,d)};c.prop=c.property;c.key=function(b,d){if(!a._obj(b))throw x.type("source","key");if(2>arguments.length)throw x("No key defined",
"key");delete b[d];return b};c.index=function(b,d,e){if(!a._obj(b))throw x.type("source","index");if(!a.num(b.length))throw x.type("source.length","index");if(!a.num(d))throw x.type("index","index");if(!a.un.num(e))throw x.type("toIndex","index");b=a.arr(b)?b:w(b);return k(b,d,e)};c.i=c.index;c.type=function(b,d){if(!a._obj(b))throw x.type("source","type");if(!a.str(d))throw x.type("type","type");b=a.args(b)?w(b):b;if(a.empty(b))return z(d,""),b;var e=b;if(a.arr(e)){var f;for(f=e.length;f--;)z(d,
e[f])&&e.splice(f,1)}else for(f in e)q(e,f)&&z(d,e[f])&&delete e[f];return e};c.value=function(b,d){if(!a._obj(b))throw x.type("source","value");if(2>arguments.length)throw x("No val defined","value");b=a.args(b)?w(b):b;return n(b,d)};c.val=c.value;c.pattern=function(b,d){if(!a.str(b))throw x.type("source","pattern");if(2>arguments.length)throw x("No pattern defined","pattern");return m(b,d)};c.properties=function(b,d){if(!a._obj(b))throw x.type("source","properties");if(2>arguments.length)throw x("No val defined",
"properties");b=a.args(b)?w(b):b;d=2<arguments.length?w(arguments,1):d;return a.arr(d)?h(b,d):g(b,d)};c.props=c.properties;c.keys=function(b,d){if(!a._obj(b))throw x.type("source","keys");if(2>arguments.length)throw x("No key defined","keys");d=2<arguments.length?w(arguments,1):d;var e;if(a.arr(d)){e=b;var f=d,c,l;c=f.length;for(l=-1;++l<c;)delete e[f[l]]}else e=b,delete e[d];return e};c.indexes=function(b,d){if(!a._obj(b))throw x.type("source","indexes");if(!a.num(b.length))throw x.type("source.length",
"indexes");if(2>arguments.length)throw x("No index defined","indexes");b=a.arr(b)?b:w(b);d=2<arguments.length?w(arguments,1):d;if(!a.arr(d)){if(!a.num(d))throw x.type("index","indexes");return k(b,d)}if(!z("!nums",d))throw x.type("index","indexes");return l(b,d)};c.ii=c.indexes;c.values=function(b,d){if(!a._obj(b))throw x.type("source","value");if(2>arguments.length)throw x("No val defined","value");b=a.args(b)?w(b):b;d=2<arguments.length?w(arguments,1):d;var f;if(a.arr(d)){f=b;var c=d;f=a.arr(f)?
K(f,c):e(f,c)}else f=n(b,d);return f};c.vals=c.values;c.patterns=function(b,d){if(!a.str(b))throw x.type("source","patterns");if(2>arguments.length)throw x("No pattern defined","patterns");d=2<arguments.length?w(arguments,1):d;return a.arr(d)?p(b,d):m(b,d)};var D=function(){function a(b,d){b=0>b?d+b:b;return 0>b||b>=d?-1:b}function b(a,f,c){var l;l=f+c>>>1;if(a<d[l]){var g,h;g=d[l];l?(c=l-1,h=e[c],a===--g?a===++h?(e[c]=e[l],d.splice(l,1),e.splice(l,1)):d[l]=a:a>h?a===++h?e[c]=a:(d.splice(l,0,a),e.splice(l,
0,a)):b(a,f,c)):a===--g?d[l]=a:(d.unshift(a),e.unshift(a))}else a>e[l]&&(f=l+1,h=e[l],f===e.length?a===++h?e[l]=a:(d.push(a),e.push(a)):(g=d[f],a===++h?a===--g?(e[l]=e[f],d.splice(f,1),e.splice(f,1)):e[l]=a:a<g?a===--g?d[f]=a:(d.splice(f,0,a),e.splice(f,0,a)):b(a,f,c)))}var d,e;return function(f,c){var l,g,h;d=[];e=[];g=f.length;h=0;for(l=a(f[h],c);-1===l&&++h<g;)l=a(f[h],c);d.push(l);for(e.push(l);++h<g;)l=a(f[h],c),-1!==l&&b(l,0,e.length);return{first:d,last:e}}}(),x=y("cut");return c}(),N=function(){function c(c,
f,b){if(!a.func(f))throw m.type("iteratee");if(!a.nil.un.obj(b))throw m.type("thisArg");if(a.num(c))return k(c,f,b);a.str(c)&&(c=v(c));if(!a._obj(c))throw m.type("source");return a._arr(c)?h(c,f,b):g(c,f,b)}function g(c,f,b){var e;c=2<f.length?t(c):c;f=a.undefined(b)?f:n(f,b);switch(f.length){case 0:for(e in c)q(c,e)&&f();break;case 1:for(e in c)q(c,e)&&f(c[e]);break;case 2:for(e in c)q(c,e)&&f(c[e],e);break;default:for(e in c)q(c,e)&&f(c[e],e,c)}return c}function h(c,f,b){var e;c=2<f.length?t.arr(c):
c;f=a.undefined(b)?f:n(f,b);b=c.length;e=-1;switch(f.length){case 0:for(;++e<b;)f();break;case 1:for(;++e<b;)f(c[e]);break;case 2:for(;++e<b;)f(c[e],e);break;default:for(;++e<b;)f(c[e],e,c)}return c}function k(c,f,b){f=a.undefined(b)?f:n(f,b);if(f.length)for(b=0;c--;)f(b++);else for(;c--;)f()}function n(a,f){switch(a.length){case 0:return function(){a.call(f)};case 1:return function(b){a.call(f,b)};case 2:return function(b,e){a.call(f,b,e)}}return function(b,e,d){a.call(f,b,e,d)}}c.object=function(c,
f,b){if(!a._obj(c))throw m.type("source","object");if(!a.func(f))throw m.type("iteratee","object");if(!a.nil.un.obj(b))throw m.type("thisArg","object");return g(c,f,b)};c.obj=c.object;c.array=function(c,f,b){a.str(c)&&(c=v(c));if(!a._obj(c))throw m.type("source","array");if(!a.num(c.length))throw m.type("source.length","array");if(!a.func(f))throw m.type("iteratee","array");if(!a.nil.un.obj(b))throw m.type("thisArg","array");return h(c,f,b)};c.arr=c.array;c.cycle=function(c,f,b){if(!a.num(c))throw m.type("count",
"cycle");if(!a.func(f))throw m.type("iteratee","cycle");if(!a.nil.un.obj(b))throw m.type("thisArg","cycle");return k(c,f,b)};c.time=c.cycle;var m=y("each");return c}(),O=function(){function c(c,f,b,e,d){if(2>arguments.length)throw m("No val defined");if(a.nil(c))return null;if(a.num(c))return n(c,f);if(!a._obj(c))throw m.type("source");if(a.arr(c)){d=e;e=b;b=f;if(!a.un.num(e))throw m.type("start");if(!a.un.num(d))throw m.type("end");return k(c,b,e,d)}if(2<arguments.length){f=a.str(f)?v(f):f;if(!a.arr(f))throw m.type("keys");
return h(c,f,b)}return g(c,f)}function g(a,f){for(var b in a)q(a,b)&&(a[b]=f);return a}function h(a,f,b){var e,d;e=f.length;for(d=-1;++d<e;)a[f[d]]=b;return a}function k(a,f,b,e){var d;d=a.length;b=b||0;b=0>b?d+b:b;b=0>b?0:b;e=e||d;e=e>d?d:0>e?d+e:e;if(b>=e)return a;for(--b;++b<e;)a[b]=f;return a}function n(a,f){var b;a=0>a?0:a;if(!a)return"";f=String(f);for(b="";a--;)b+=f;return b}c.object=function(c,f,b){if(!a._obj(c))throw m.type("obj","object");if(2>arguments.length)throw m("No val defined","object");
if(2<arguments.length){f=a.str(f)?v(f):f;if(!a.arr(f))throw m.type("keys","object");return h(c,f,b)}return g(c,f)};c.obj=c.object;c.array=function(c,f,b,e){c=a.num(c)?Array(c):c;if(2>arguments.length)throw m("No val defined","array");if(!a.arr(c))throw m.type("arr","array");if(!a.un.num(b))throw m.type("start","array");if(!a.un.num(e))throw m.type("end","array");return k(c,f,b,e)};c.arr=c.array;c.string=function(c,f){if(!a.num(c))throw m.type("count","string");if(2>arguments.length)throw m("No val defined",
"string");return n(c,f)};c.str=c.string;var m=y("fill");return c}(),P=function(){function c(b,e){if(2>arguments.length)throw f("No val defined");if(a.str(b))return e=2<arguments.length?w(arguments,1):e,a.arr(e)?p(b,e):b+e;if(!a._obj(b))throw f.type("dest");b=a.args(b)?w(b):b;if(a.arr(b))return 2<arguments.length?(e=w(arguments,1),m(b,e)):n(b,e);e=2<arguments.length?w(arguments,1):e;return a.arr(e)?h(b,e):g(b,e)}function g(b,e){if(a._obj(e))return D(b,e);a.nil(e)||(b[e]=r);return b}function h(a,e){var d,
f;d=e.length;for(f=-1;++f<d;)a=g(a,e[f]);return a}function k(a,e){q(a,e)||(a[e]=r);return a}function n(b,e){if(a.arr(e))return b.concat(e);a.nil(e)||b.push(e);return b}function m(a,e){var d,f;d=e.length;for(f=-1;++f<d;)a=n(a,e[f]);return a}function p(a,e){var d,f;d=e.length;for(f=-1;++f<d;)a+=e[f];return a}c.value=function(b,e){if(2>arguments.length)throw f("No val defined","value");if(a.str(b)){if(3>arguments.length)return b+e;e=w(arguments,1);return p(b,e)}if(!a._obj(b))throw f.type("dest","value");
b=a.args(b)?w(b):b;if(3>arguments.length){var d;a.arr(b)?(d=b,d.push(e)):(d=b,d[e]=r);return d}e=w(arguments,1);if(a.arr(b)){d=b;var c=e,g,h;g=c.length;for(h=-1;++h<g;)d.push(c[h])}else{d=b;var c=e,k;h=c.length;for(k=-1;++k<h;)g=c[k],d[g]=r}return d};c.val=c.value;c.value.start=function(b,e){if(2>arguments.length)throw f("No val defined","value.start");if(a.str(b)){if(3>arguments.length)return e+b;e=w(arguments,1);var d=b,c,g;c=e.length;for(g=-1;++g<c;)d=e[g]+d;return d}if(!a._obj(b))throw f.type("dest",
"value.start");b=a.args(b)?w(b):b;if(3>arguments.length)return a.arr(b)?(d=b,d.unshift(e)):d=k(b,e),d;e=w(arguments,1);if(a.arr(b)){d=b;c=e;var h;g=c.length;for(h=-1;++h<g;)d.unshift(c[h])}else for(d=b,c=e,g=c.length,h=-1;++h<g;)d=k(d,c[h]);return d};c.val.start=c.value.start;c.value.top=c.value.start;c.val.top=c.value.start;c.object=function(b,e){if(!a._obj(b))throw f.type("dest","object");if(2>arguments.length)throw f("No val defined","object");e=2<arguments.length?w(arguments,1):e;return a.arr(e)?
h(b,e):g(b,e)};c.obj=c.object;c.array=function(b,e){if(!a._arr(b))throw f.type("dest","array");if(2>arguments.length)throw f("No val defined","array");b=a.args(b)?w(b):b;return 2<arguments.length?(e=w(arguments,1),m(b,e)):n(b,e)};c.arr=c.array;c.string=function(b,e){if(!a.str(b))throw f.type("dest","string");if(2>arguments.length)throw f("No val defined","string");e=2<arguments.length?w(arguments,1):e;return a.arr(e)?p(b,e):b+e};c.str=c.string;var f=y("fuse");return c}(),Q=function(){function c(d,
c){if(a.str(d)){if(2>arguments.length)throw e("No val defined");return a.regex(c)?b(d,c):f(d,c)}if(!a._obj(d))throw e.type("source");return 2>arguments.length?a._arr(d)?m(d):g(d):a._arr(d)?p(d,c):a.regex(c)?n(d,c):k(d,c)}function g(a){var b,e;b=[];for(e in a)q(a,e)&&b.push(e);return b}function h(b,e){var f,c;e=a.regex(e)?e:String(e);f=[];for(c in b)q(b,c)&&B(c,e)&&f.push(c);return f}function k(a,b){var e,f;e=[];for(f in a)q(a,f)&&a[f]===b&&e.push(f);return e}function n(b,e){var f,c;e=a.regex(e)?e:
String(e);f=[];for(c in b)q(b,c)&&B(c,e)&&f.push(b[c]);return f}function m(a){var b,e;b=a.length;a=Array(b);for(e=-1;++e<b;)a[e]=e;return a}function p(a,b){var e,f,c;f=a.length;e=[];for(c=-1;++c<f;)a[c]===b&&e.push(c);return e}function f(b,e){var f;if(B(b,e)){if(a.regex(e)){var c,g;f=t.regex(e,!0);c=[];for(g=f.exec(b);g;)c.push(g.index),g=f.exec(b)}else for(f=String(e),c=[],g=b.indexOf(f);-1!==g;)c.push(g),g=b.indexOf(f,++g);f=c}else f=[];return f}function b(b,e){var f;if(B(b,e)){if(a.regex(e)){var c,
g;f=t.regex(e,!0);c=[];for(g=f.exec(b);g;)c.push(g[0]),g=f.exec(b)}else for(f=String(e),c=[],g=b.indexOf(f);-1!==g;)c.push(f),g=b.indexOf(f,++g);f=c}else f=[];return f}c.keys=function(b,f){if(!a._obj(b))throw e.type("source","keys");return 2>arguments.length?g(b):a.regex(f)?h(b,f):k(b,f)};c.keys.byKey=function(b,f){if(!a._obj(b))throw e.type("source","keys.byKey");if(2>arguments.length)throw e("No pattern defined","keys.byKey");return h(b,f)};c.keys.byValue=function(b,f){if(!a._obj(b))throw e.type("source",
"keys.byValue");if(2>arguments.length)throw e("No val defined","keys.byValue");return k(b,f)};c.keys.byVal=c.keys.byValue;c.indexes=function(b,c){if(a.str(b)){if(2>arguments.length)throw e("No val defined","indexes");return f(b,c)}if(!a._obj(b))throw e.type("source","indexes");if(!a.num(b.length))throw e.type("source.length","indexes");return 2>arguments.length?m(b):p(b,c)};c.ii=c.indexes;c.values=function(d,f){if(a.str(d)){if(2>arguments.length)throw e("No val defined","values");return b(d,f)}if(!a._obj(d))throw e.type("source",
"values");var c;if(2>arguments.length){var g;c=[];for(g in d)q(d,g)&&c.push(d[g])}else c=n(d,f);return c};c.vals=c.values;var e=y("get");return c}(),R=function(){function c(c,k){if(2>arguments.length)throw g("No val defined");if(a.nil(c))return!1;if(a.str(c))return B(c,k);if(!a._obj(c))throw g.type("source");return a._arr(c)?A(c,k):q(c,k)}c.key=function(c,k){if(2>arguments.length)throw g("No key defined","key");if(a.nil(c))return!1;if(!a._obj(c))throw g.type("source","key");return q(c,k)};c.value=
function(c,k){if(2>arguments.length)throw g("No val defined","value");if(a.nil(c))return!1;if(!a._obj(c))throw g.type("source","value");return a._arr(c)?A(c,k):H(c,k)};c.val=c.value;c.pattern=function(c,k){if(!a.str(c))throw g.type("source","pattern");if(2>arguments.length)throw g("No pattern defined","pattern");return B(c,k)};c.substring=function(c,k){if(!a.str(c))throw g.type("source","substring");if(2>arguments.length)throw g("No val defined","substring");return F(c,k)};c.substr=c.substring;c.enumerable=
function(c,k){if(2>arguments.length)throw g("No key defined","enumerable");if(a.nil(c))return!1;if(!a._obj(c))throw g.type("source","enumerable");return L(c,k)};try{c["enum"]=c.enumerable}catch(h){}var g=y("has");return c}(),S=function(){function c(f,b,e,d){if(a.str(f)){if(2>arguments.length)throw p("No iteratee defined");if(3>arguments.length)throw p("No replacement defined");if(!a.nil.un.obj(d))throw p.type("thisArg");return k(f,b,e,d)}d=e;if(!a._obj(f))throw p.type("source");if(!a.func(b))throw p.type("iteratee");
if(!a.nil.un.obj(d))throw p.type("thisArg");return a._arr(f)?h(f,b,d):g(f,b,d)}function g(f,b,e){var d,c;d={};f=2<b.length?t(f):f;b=a.undefined(e)?b:n(b,e);switch(b.length){case 0:for(c in f)q(f,c)&&(d[c]=b());break;case 1:for(c in f)q(f,c)&&(d[c]=b(f[c]));break;case 2:for(c in f)q(f,c)&&(d[c]=b(f[c],c));break;default:for(c in f)q(f,c)&&(d[c]=b(f[c],c,f))}return d}function h(c,b,e){var d,g;c=2<b.length?t.arr(c):c;b=a.undefined(e)?b:n(b,e);d=c.length;e=Array(d);g=-1;switch(b.length){case 0:for(;++g<
d;)e[g]=b();break;case 1:for(;++g<d;)e[g]=b(c[g]);break;case 2:for(;++g<d;)e[g]=b(c[g],g);break;default:for(;++g<d;)e[g]=b(c[g],g,c)}return e}function k(c,b,e,d){if(!c)return c;a.regex(b)||(b=String(b),b=G(b),b=new RegExp(b,"g"));e=a.func(e)?a.undefined(d)?e:m(e,d):String(e);return c.replace(b,e)}function n(a,b){switch(a.length){case 0:return function(){return a.call(b)};case 1:return function(e){return a.call(b,e)};case 2:return function(e,d){return a.call(b,e,d)}}return function(e,d,c){return a.call(b,
e,d,c)}}function m(a,b){switch(a.length){case 0:return function(){return a.call(b)};case 1:return function(e){return a.call(b,e)};case 2:return function(e,d){return a.call(b,e,d)};case 3:return function(e,d,c){return a.call(b,e,d,c)};case 4:return function(e,d,c,g){return a.call(b,e,d,c,g)};case 5:return function(e,d,c,g,h){return a.call(b,e,d,c,g,h)}}return function(){return a.apply(b,arguments)}}c.object=function(c,b,e){if(!a._obj(c))throw p.type("source","object");if(!a.func(b))throw p.type("iteratee",
"object");if(!a.nil.un.obj(e))throw p.type("thisArg","object");return g(c,b,e)};c.obj=c.object;c.array=function(c,b,e){a.str(c)&&(c=v(c));if(!a._obj(c))throw p.type("source","array");if(!a.num(c.length))throw p.type("source.length","array");if(!a.func(b))throw p.type("iteratee","array");if(!a.nil.un.obj(e))throw p.type("thisArg","array");return h(c,b,e)};c.arr=c.array;c.string=function(c,b,e,d){if(2>arguments.length)throw p("No pattern defined","string");if(3>arguments.length)throw p("No replacement defined",
"string");if(!a.str(c))throw p.type("source","string");if(!a.nil.un.obj(d))throw p.type("thisArg","string");return k(c,b,e,d)};c.str=c.string;var p=y("remap");return c}(),T=function(){function c(c,n,m,p){var f;if(2>arguments.length)throw h("No source or iteratee defined");2===arguments.length?(m=n,n=c):3!==arguments.length||a.func(m)?f=!0:(p=m,m=n,n=c);if(!a.func(m))throw h.type("iteratee");if(!a.nil.un.obj(p))throw h.type("thisArg");if(a.num(n)){if(!f)throw h("No base defined");var b=c,e=n,d=m,l=
p,d=a.undefined(l)?d:g(d,l);if(1<d.length)for(l=0;e--;)b=d(b,l++);else for(;e--;)b=d(b);return b}if(!a._obj(n))throw h.type("source");if(a._arr(n))if(f)switch(b=c,e=n,d=m,l=p,e=3<d.length?t.arr(e):e,d=a.undefined(l)?d:g(d,l),l=e.length,f=-1,d.length){case 0:case 1:for(;++f<l;)b=d(b);break;case 2:for(;++f<l;)b=d(b,e[f]);break;case 3:for(;++f<l;)b=d(b,e[f],f);break;default:for(;++f<l;)b=d(b,e[f],f,e)}else{b=n;e=m;d=p;b=3<e.length?t.arr(b):b;e=a.undefined(d)?e:g(e,d);d=b[0];l=b.length;f=0;switch(e.length){case 0:case 1:for(;++f<
l;)d=e(d);break;case 2:for(;++f<l;)d=e(d,b[f]);break;case 3:for(;++f<l;)d=e(d,b[f],f);break;default:for(;++f<l;)d=e(d,b[f],f,b)}b=d}else{if(f)switch(e=c,d=n,l=m,f=p,d=3<l.length?t(d):d,l=a.undefined(f)?l:g(l,f),l.length){case 0:case 1:for(b in d)q(d,b)&&(e=l(e));break;case 2:for(b in d)q(d,b)&&(e=l(e,d[b]));break;case 3:for(b in d)q(d,b)&&(e=l(e,d[b],b));break;default:for(b in d)q(d,b)&&(e=l(e,d[b],b,d))}else{b=n;f=m;var r=p,b=3<f.length?t(b):b;f=a.undefined(r)?f:g(f,r);switch(f.length){case 0:case 1:for(d in b)q(b,
d)&&(l?e=f(e):(e=b[d],l=!0));break;case 2:for(d in b)q(b,d)&&(l?e=f(e,b[d]):(e=b[d],l=!0));break;case 3:for(d in b)q(b,d)&&(l?e=f(e,b[d],d):(e=b[d],l=!0));break;default:for(d in b)q(b,d)&&(l?e=f(e,b[d],d,b):(e=b[d],l=!0))}}b=e}return b}function g(a,c){switch(a.length){case 0:return function(){return a.call(c)};case 1:return function(g){return a.call(c,g)};case 2:return function(g,h){return a.call(c,g,h)};case 3:return function(g,h,f){return a.call(c,g,h,f)}}return function(g,h,f,b){return a.call(c,
g,h,f,b)}}c.up=function(c,n,m,p){var f;if(2>arguments.length)throw h("No source or iteratee defined","up");2===arguments.length?(m=n,n=c):3!==arguments.length||a.func(m)?f=!0:(p=m,m=n,n=c);if(!a.func(m))throw h.type("iteratee","up");if(!a.nil.un.obj(p))throw h.type("thisArg","up");if(a.num(n)){if(!f)throw h("No base defined","up");var b=c,e=n,d=m,l=p,d=a.undefined(l)?d:g(d,l);if(d.length)for(l=0;e--;)b+=d(l++);else for(;e--;)b+=d();return b}if(!a._obj(n))throw h.type("source","up");if(a._arr(n))if(f)switch(b=
c,e=n,d=m,l=p,e=2<d.length?t.arr(e):e,d=a.undefined(l)?d:g(d,l),l=e.length,f=-1,d.length){case 0:for(;++f<l;)b+=d();break;case 1:for(;++f<l;)b+=d(e[f]);break;case 2:for(;++f<l;)b+=d(e[f],f);break;default:for(;++f<l;)b+=d(e[f],f,e)}else{b=n;e=m;d=p;b=2<e.length?t.arr(b):b;e=a.undefined(d)?e:g(e,d);d=b[0];l=b.length;f=0;switch(e.length){case 0:for(;++f<l;)d+=e();break;case 1:for(;++f<l;)d+=e(b[f]);break;case 2:for(;++f<l;)d+=e(b[f],f);break;default:for(;++f<l;)d+=e(b[f],f,b)}b=d}else{if(f)switch(e=
c,d=n,l=m,f=p,d=2<l.length?t(d):d,l=a.undefined(f)?l:g(l,f),l.length){case 0:for(b in d)q(d,b)&&(e+=l());break;case 1:for(b in d)q(d,b)&&(e+=l(d[b]));break;case 2:for(b in d)q(d,b)&&(e+=l(d[b],b));break;default:for(b in d)q(d,b)&&(e+=l(d[b],b,d))}else{b=n;f=m;var r=p,b=2<f.length?t(b):b;f=a.undefined(r)?f:g(f,r);switch(f.length){case 0:for(d in b)q(b,d)&&(l?e+=f():(e=b[d],l=!0));break;case 1:for(d in b)q(b,d)&&(l?e+=f(b[d]):(e=b[d],l=!0));break;case 2:for(d in b)q(b,d)&&(l?e+=f(b[d],d):(e=b[d],l=
!0));break;default:for(d in b)q(b,d)&&(l?e+=f(b[d],d,b):(e=b[d],l=!0))}}b=e}return b};c.down=function(c,n,m,p){var f;if(2>arguments.length)throw h("No source or iteratee defined","down");2===arguments.length?(m=n,n=c):3!==arguments.length||a.func(m)?f=!0:(p=m,m=n,n=c);if(!a.func(m))throw h.type("iteratee","down");if(!a.nil.un.obj(p))throw h.type("thisArg","down");if(a.num(n)){if(!f)throw h("No base defined","down");var b=c,e=n,d=m,l=p,d=a.undefined(l)?d:g(d,l);if(d.length)for(l=0;e--;)b-=d(l++);else for(;e--;)b-=
d();return b}if(!a._obj(n))throw h.type("source","down");if(a._arr(n))if(f)switch(b=c,e=n,d=m,l=p,e=2<d.length?t.arr(e):e,d=a.undefined(l)?d:g(d,l),l=e.length,f=-1,d.length){case 0:for(;++f<l;)b-=d();break;case 1:for(;++f<l;)b-=d(e[f]);break;case 2:for(;++f<l;)b-=d(e[f],f);break;default:for(;++f<l;)b-=d(e[f],f,e)}else{b=n;e=m;d=p;b=2<e.length?t.arr(b):b;e=a.undefined(d)?e:g(e,d);d=b[0];l=b.length;f=0;switch(e.length){case 0:for(;++f<l;)d-=e();break;case 1:for(;++f<l;)d-=e(b[f]);break;case 2:for(;++f<
l;)d-=e(b[f],f);break;default:for(;++f<l;)d-=e(b[f],f,b)}b=d}else{if(f)switch(e=c,d=n,l=m,f=p,d=2<l.length?t(d):d,l=a.undefined(f)?l:g(l,f),l.length){case 0:for(b in d)q(d,b)&&(e-=l());break;case 1:for(b in d)q(d,b)&&(e-=l(d[b]));break;case 2:for(b in d)q(d,b)&&(e-=l(d[b],b));break;default:for(b in d)q(d,b)&&(e-=l(d[b],b,d))}else{b=n;f=m;var r=p,b=2<f.length?t(b):b;f=a.undefined(r)?f:g(f,r);switch(f.length){case 0:for(d in b)q(b,d)&&(l?e-=f():(e=b[d],l=!0));break;case 1:for(d in b)q(b,d)&&(l?e-=f(b[d]):
(e=b[d],l=!0));break;case 2:for(d in b)q(b,d)&&(l?e-=f(b[d],d):(e=b[d],l=!0));break;default:for(d in b)q(b,d)&&(l?e-=f(b[d],d,b):(e=b[d],l=!0))}}b=e}return b};var h=y("roll");return c}(),U=function(){function a(c,k){if(2>arguments.length)throw g("Missing a val");return c===k}a.loose=function(a,c){if(2>arguments.length)throw g("Missing a val","loose");return a==c};a.ish=a.loose;var g=y("same");return a}(),V=function(){function c(c,k,n){if(!a.un.num(k))throw g.type("start");if(!a.un.num(n))throw g.type("end");
if(a.nil(c))return null;if(a.str(c))return E(c,k,n);if(!a._obj(c))throw g.type("source");if(!a.num(c.length))throw g.type("source.length");return w(c,k,n)}c.array=function(c,k,n){if(!a._obj(c))throw g.type("source","array");if(!a.num(c.length))throw g.type("source.length","array");if(!a.un.num(k))throw g.type("start","array");if(!a.un.num(n))throw g.type("end","array");return w(c,k,n)};c.arr=c.array;c.string=function(c,k,n){if(!a.str(c))throw g.type("str","string");if(!a.un.num(k))throw g.type("start",
"string");if(!a.un.num(n))throw g.type("end","string");return E(c,k,n)};c.str=c.string;var g=y("slice");return c}(),W=function(){var c={string:function(c,k){if(!arguments.length)throw g("Missing a val","string");if(!a.un.str(k))throw g.type("joiner","string");return a.arr(c)&&a.str(k)?c.join(k):String(c)}};c.str=c.string;c.number=function(c){if(!arguments.length)throw g("Missing a val","number");if(a.num(c))return c;if(a.nil.bool(c))return c?1:0;if(!a.str(c))throw g.type("val","number");c=Number(c);
if(a.nan(c))throw g.range("val","see github.com/imaginate/vitals/wiki/vitals.to#tonumber","number");return c};c.num=c.number;c["boolean"]=function(a){if(!arguments.length)throw g("Missing a val","boolean");return!!a};c.bool=c["boolean"];c.array=function(c,k){if(!arguments.length)throw g("Missing a val","array");if(a.num(c))return Array(c);if(!a.str(c))throw g.type("val","array");if(a.undefined(k))return v(c);k=a.regex(k)?k:String(k);return c.split(k)};c.arr=c.array;c.regexp=function(c,k){if(!arguments.length)throw g("Missing a source",
"regexp");if(!a.str(c))throw g.type("source","regexp");if(!a.un.str(k))throw g.type("flags","regexp");return k?new RegExp(c,k):new RegExp(c)};c.regex=c.regexp;c.re=c.regexp;c.upperCase=function(c){if(!arguments.length)throw g("Missing a str","upperCase");if(!a.str(c))throw g.type("source","upperCase");return c.toUpperCase()};c.upper=c.upperCase;c.lowerCase=function(c){if(!arguments.length)throw g("Missing a str","lowerCase");if(!a.str(c))throw g.type("source","lowerCase");return c.toLowerCase()};
c.lower=c.lowerCase;var g=y("to");return c}(),X=function(){function c(c,b,e,d){if(2>arguments.length)throw p("No end or iteratee defined");if(2===arguments.length){e=b;if(!a.func(e))throw p.type("iteratee");return g(c,e)}if(3===arguments.length&&a.func(b)&&a.nil.obj(e))return d=e,g(c,b,d);if(!a.func(e))throw p.type("iteratee");if(!a.nil.un.obj(d))throw p.type("thisArg");if(a.num(b))return n(c,b,e,d);a.str(b)&&(b=v(b));if(!a._obj(b))throw p.type("source");return a._arr(b)?k(c,b,e,d):h(c,b,e,d)}function g(c,
b,e){b=a.undefined(e)?b:m(b,e);if(b.length)for(e=0;b(e++)!==c;);else for(;b()!==c;);return!0}function h(c,b,e,d){var g;b=2<e.length?t(b):b;e=a.undefined(d)?e:m(e,d);switch(e.length){case 0:for(g in b)if(q(b,g)&&e()===c)return!0;break;case 1:for(g in b)if(q(b,g)&&e(b[g])===c)return!0;break;case 2:for(g in b)if(q(b,g)&&e(b[g],g)===c)return!0;break;default:for(g in b)if(q(b,g)&&e(b[g],g,b)===c)return!0}return!1}function k(c,b,e,d){var g;b=2<e.length?t.arr(b):b;e=a.undefined(d)?e:m(e,d);d=b.length;g=
-1;switch(e.length){case 0:for(;++g<d;)if(e()===c)return!0;break;case 1:for(;++g<d;)if(e(b[g])===c)return!0;break;case 2:for(;++g<d;)if(e(b[g],g)===c)return!0;break;default:for(;++g<d;)if(e(b[g],g,b)===c)return!0}return!1}function n(c,b,e,d){e=a.undefined(d)?e:m(e,d);if(e.length)for(d=0;b--;){if(e(d++)===c)return!0}else for(;b--;)if(e()===c)return!0;return!1}function m(a,b){switch(a.length){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,
d){return a.call(b,c,d)}}return function(c,d,g){return a.call(b,c,d,g)}}c.object=function(c,b,e,d){if(!a._obj(b))throw p.type("obj","object");if(!a.func(e))throw p.type("iteratee","object");if(!a.nil.un.obj(d))throw p.type("thisArg","object");return h(c,b,e,d)};c.obj=c.object;c.array=function(c,b,e,d){a.str(b)&&(b=v(b));if(!a._obj(b))throw p.type("source","array");if(!a.num(b.length))throw p.type("source.length","array");if(!a.func(e))throw p.type("iteratee","array");if(!a.nil.un.obj(d))throw p.type("thisArg",
"array");return k(c,b,e,d)};c.arr=c.array;c.cycle=function(c,b,e,d){if(!a.num(b))throw p.type("count","cycle");if(!a.func(e))throw p.type("action","cycle");if(!a.nil.un.obj(d))throw p.type("thisArg","cycle");return n(c,b,e,d)};c.time=c.cycle;var p=y("until");return c}(),J=function(){function c(b,c,d,e,f,n){var l,m;if(!a.obj(b))throw u.type("obj");a.str(c)&&(c=v(c));if(!a.obj(c))throw u.type("props");l=a.arr(c);m=arguments.length;if(l&&3>m)throw u("No val defined");!l&&2<m&&(n=f,f=e,e=d,d=r,++m);if(4===
m||5===m)m=g(m,e,f,n),e=m[0],f=m[1],n=m[2];if(!z("!obj=",e))throw u.type("descriptor");if(!z("str=",f))throw u.type("strongType");if(!z("func=",n))throw u.type("setter");if(f){if(l&&!z(f+"=",d))throw u("The val param is not a valid strongType");if(!l&&!h(f,c))throw u("A props value was not a valid strongType");}return k(b,c,d,e,f,n)}function g(b,c,d,e){switch(b){case 4:a.str(c)?(d=c,c=r):a.func(c)&&(e=c,c=r);break;case 5:a.func(d)&&(e=d,d=r,a.str(c)&&(d=c,c=r))}return[c,d,e]}function h(b,c){var d,
f;b+="=";for(d in c)if(q(c,d)){f=c[d];if(a.obj(f)&&e(f)){if(q(f,"writable"))continue;f=f.value}if(!z(b,f))return!1}return!0}function k(c,g,k,h,m,p){h=l(h||null,!!m||!!p);m=w(m);if(a.arr(g))if(m||p){var r=g,u=h,x;h={};g=r.length;for(x=-1;++x<g;)h[r[x]]=f(k,u,m,p);p=h}else p=n(g,k,h);else if(m||p){u=g;k=h;h={};for(r in u)if(q(u,r)){g=h;x=r;var t;a:{t=u[r];var y=m,z=p,v=void 0,v=C(k);if(e(t)){v=D(v,t);if(q(v,"writable")||d(v)){t=v;break a}t=v.value;var B=void 0,A=void 0,B={};for(A in v)q(v,A)&&"value"!==
A&&(B[A]=v[A]);v=B}t=v=b(t,v,y,z)}g[x]=t}p=h}else{p=g;r=h;k={};for(u in p)q(p,u)&&(m=k,h=u,g=p[u],x=void 0,x=C(r),g=e(g)?g:{value:g},g=D(x,g),m[h]=g);p=k}return F(c,p)}function n(a,b,c){var e,f,g,h;e=d(c)?function(a,b){return C(b)}:p;f={};g=a.length;for(h=-1;++h<g;)f[a[h]]=e(b,c);return f}function m(a,b){var c,d,e;c={};d=a.length;for(e=-1;++e<d;)c[a[e]]=b;return c}function p(a,b){var c;c=C(b);c.value=a;return c}function f(a,c,d,e){c=C(c);return c=b(a,c,d,e)}function b(a,b,c,d){var e;b.get=function(){return a};
b.set=c&&d?function(b){if(!c(b))throw e=new TypeError("Invalid type for object property value."),e.__setter=!0,e.__type=!0,e;a=d(b,a)}:c?function(b){if(!c(b))throw e=new TypeError("Invalid type for object property value."),e.__setter=!0,e.__type=!0,e;a=b}:function(b){a=d(b,a)};return b}function e(b){var c;if(!a.obj(b))return!1;for(c in b)if(q(b,c)&&!q(E,c))return!1;return!0}function d(a){return q(a,"get")||q(a,"set")}function l(b,c){var e;if(e=c)e=b,e=q(e,"value")||q(e,"writable");e&&(e={},a.bool(b.enumerable)&&
(e.enumerable=b.enumerable),a.bool(b.configurable)&&(e.configurable=b.configurable),b=e);e=c||d(b)?A:B;e=C(e);return D(e,b)}function w(a){return a&&function(b){return z(a,b)}}function t(a,b){for(var c in b)if(q(b,c)&&!q(a,c))return!1;return!0}c.config=function(b,c,d){if(!a.obj(b))throw u.type("obj","config");a.str(c)&&(c=v(c));if(!a.obj(c))throw u.type("props","config");if(a.arr(c)){if(!a.obj(d))throw u.type("descriptor","config");c=m(c,d)}else if(!z("objMap",c))throw u.type("props","config");if(!t(b,
c))throw u("A given prop was not defined in the obj","config");return F(b,c)};c.property=function(b,c,g,h,k,n){var m;if(!a.obj(b))throw u.type("obj","property");if(!a.str(c))throw u.type("key","property");m=arguments.length;if(3>m)throw u("No val or descriptor defined","property");if(2<m&&6>m){var t=g,v=h,y=k,A=n;switch(m){case 4:a.str(v)?(y=v,v=r):a.func(v)&&(A=v,v=r);break;case 5:a.func(y)&&(A=y,y=r,a.str(v)&&(y=v,v=r))}a.obj(t)&&e(t)&&(v=t,t=v.value);m=[t,v,y,A];g=m[0];h=m[1];k=m[2];n=m[3]}if(!z("!obj=",
h))throw u.type("descriptor","property");if(!z("str=",k))throw u.type("strongType","property");if(!z("func=",n))throw u.type("setter","property");if(k&&!z(k+"=",g))throw u("The val param is not a valid strongType","property");if(h&&(k||n)&&q(h,"writable"))throw u("A data descriptor may not be used with a strongType/setter","property");m=g;v=k;y=n;t=h||null;t=l(t,!!v||!!y);t=(v=w(v))||y?f(m,t,v,y):d(t)?C(t):p(m,t);return x(b,c,t)};c.prop=c.property;c.property.config=function(b,c,d){if(!a.obj(b))throw u.type("obj",
"property.config");if(!a.str(c))throw u.type("key","property.config");if(!a.obj(d))throw u.type("descriptor","property.config");if(!q(b,c))throw u("The key was not defined in the obj","property.config");return x(b,c,d)};c.prop.config=c.property.config;c.properties=function(b,c,d,e,f,n){var l,m;if(!a.obj(b))throw u.type("obj","properties");a.str(c)&&(c=v(c));if(!a.obj(c))throw u.type("props","properties");l=a.arr(c);m=arguments.length;if(l&&3>m)throw u("No val defined","properties");!l&&2<m&&(n=f,
f=e,e=d,d=r,++m);if(4===m||5===m)m=g(m,e,f,n),e=m[0],f=m[1],n=m[2];if(!z("!obj=",e))throw u.type("descriptor","properties");if(!z("str=",f))throw u.type("strongType","properties");if(!z("func=",n))throw u.type("setter","properties");if(f){if(l&&!z(f+"=",d))throw u("The val param is not a valid strongType","properties");if(!l&&!h(f,c))throw u("A props value was not a valid strongType","properties");}return k(b,c,d,e,f,n)};c.props=c.properties;c.properties.config=function(b,c,d){if(!a.obj(b))throw u.type("obj",
"properties.config");a.str(c)&&(c=v(c));if(!a.obj(c))throw u.type("props","properties.config");if(a.arr(c)){if(!a.obj(d))throw u.type("descriptor","properties.config");c=m(c,d)}else if(!z("objMap",c))throw u.type("props","properties.config");if(!t(b,c))throw u("A given prop was not defined in the obj","properties.config");return F(b,c)};c.props.config=c.properties.config;var B={writable:!0,enumerable:!0,configurable:!0},A={enumerable:!0,configurable:!0},E={get:!0,set:!0,value:!0,writable:!0,enumerable:!0,
configurable:!0},G=!!Object.defineProperties&&function(){var a,b,c;b={};a={enumerable:!1,value:b};try{for(c in Object.defineProperty(b,"prop",a),b)if("prop"===c)return!1}catch(d){return!1}return b.prop===b}(),x=G?Object.defineProperty:function(a,b,c){a[b]=q(c,"get")?c.get():c.value;return a},F=G?Object.defineProperties:function(a,b){var c,d;for(d in b)q(b,d)&&(c=b[d],a[d]=q(c,"get")?c.get():c.value);return a},u=y("amend");return c}(),Y=function(){function c(c,g,p,f,b,e){var d;if(!a.nil.obj(c))throw k.type("proto");
return 1<arguments.length?(d=w(arguments),d[0]=h(c),J.apply(null,d)):h(c)}function g(){}c.object=function(c,g,p,f,b,e){var d;if(!a.nil.obj(c))throw k.type("proto","object");return 1<arguments.length?(d=w(arguments),d[0]=h(c),J.apply(null,d)):h(c)};c.obj=c.object;var h=Object.create||function(a){g.prototype=a;a=new g;g.prototype=null;return a},k=y("create");return c}(),Z=function(){function c(c,m){if(a.nil(c))return null;if(!a._obj(c))throw k.type("obj");if(!a.un.bool(m))throw k.type("deep");return m?
g(c):h(c)}function g(c,k){for(var p in c)q(c,p)&&a._obj(c[p])&&g(c[p]);return h(c)}c.object=function(c,m){if(a.nil(c))return null;if(!a._obj(c))throw k.type("obj","object");if(!a.un.bool(m))throw k.type("deep","object");return m?g(c):h(c)};c.obj=c.object;var h=function(){if(!Object.freeze)return function(a){return a};try{return Object.freeze(function(){}),Object.freeze}catch(c){return function(c){return a.func(c)?c:Object.freeze(c)}}}(),k=y("freeze");return c}(),aa=function(){function c(c,m){if(a.nil(c))return null;
if(!a._obj(c))throw k.type("obj");if(!a.un.bool(m))throw k.type("deep");return m?h(c):g(c)}c.object=function(c,m){if(a.nil(c))return null;if(!a._obj(c))throw k.type("obj","seal");if(!a.un.bool(m))t