// apiCheck.js v7.2.4 built with ♥ by Kent C. Dodds (ó ì_í)=óò=(ì_í ò) !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):"object"==typeof exports?exports.apiCheck=r():e.apiCheck=r()}(this,function(){return function(e){function r(n){if(t[n])return t[n].exports;var o=t[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var t={};return r.m=e,r.c=t,r.p="",r(0)}([function(e,r,t){"use strict";e.exports=t(3)},function(e){function r(e,r){var n=[],o=[];return r=r||function(e,r){return"[Circular "+t(r,n,o)+"]"},function(t,i){var a=i;return"object"==typeof i&&i&&(-1!==n.indexOf(i)?a=r(t,i):(n.push(i),o.push(t))),e&&(a=e(t,a)),a}}function t(e,r,t){var n=r.indexOf(e),o=[t[n]];for(n--;n>=0;n--)r[n][o[0]]===e&&(e=r[n],o.unshift(t[n]));return"~"+o.join(".")}function n(e,t,n,o){return JSON.stringify(e,r(t,o),n)}e.exports=n,n.getSerialize=r},function(e,r,t){"use strict";function n(e){var r=o(e),t=void 0;if("array"===r)t=[];else{if("object"!==r)return e;t={}}return p(e,function(e,r){t[r]=e}),t}function o(e){return Array.isArray(e)?"array":e instanceof RegExp?"object":typeof e}function i(e,r){var t=void 0,n=r&&r["short"];return t=n&&e.shortType?e.shortType:!n&&"object"==typeof e.type||"function"===e.type?a(e,r):a(e,r)||e.displayName||e.name}function a(e,r){var t=e.type;if("function"==typeof t){var n=t.__apiCheckData,o=t(r);t=_({__apiCheckData:n},n.type,o)}return t}function u(e){return e?Array.isArray(e)?e:[e]:[]}function p(e){return Array.isArray(e)?c.apply(void 0,arguments):f.apply(void 0,arguments)}function f(e,r,t){var n,o=Object.prototype.hasOwnProperty;for(var i in e)if(o.call(e,i)&&(n=r.call(t,e[i],i,e),n===!1))return n;return!0}function c(e,r,t){for(var n,o=e.length,i=0;o>i;i++)if(n=r.call(t,e[i],i,e),n===!1)return n;return!0}function s(e){return e instanceof Error}function l(e,r,t){e=u(e);var n=e.slice(),o=n.pop();return 1===n.length&&(r=" "),n.join(r)+(""+(n.length?r+t:"")+o)}function y(e,r,t){"function"==typeof t&&(t=t({"short":!0}));var n="object"!=typeof t?t:A(t);return new Error(""+h(e,r)+" must be "+d(n))}function h(e,r){var t=d(e||"value"),n=r?" at "+d(r):"";return""+t+n}function d(e){return"`"+e+"`"}function v(e){return"undefined"==typeof e}function g(e,r,t){return t&&(e=x(),e.isNoop=!0),"string"==typeof e.type&&(e.shortType=e.type),p(r,function(r,t){return e[t]=r}),e.displayName||(e.displayName="apiCheck "+d(e.shortType||e.type||e.name)+" type checker"),e.notRequired||(e=b(e,t)),e.notNullable||O(e,t),e.notOptional||m(e,t),e}function b(e,r){var t=r?x():function(r,t,n,o){if(v(r)&&!e.isOptional){var a=n?" in "+d(n):"",u=i(e,{"short":!0}),p="object"!=typeof u?u:A(u);return new Error("Required "+d(t)+" not specified"+a+". Must be "+d(p))}return e(r,t,n,o)};return C(e,t),t.originalChecker=e,t}function m(e,r){var t=r?x():function(r,t,n,o){return v(r)?void 0:e(r,t,n,o)};C(e,t),t.isOptional=!0,t.displayName=e.displayName+" (optional)",t.originalChecker=e,e.optional=t,k(e,e.optional)}function O(e,r){var t=r?x():function(r,t,n,o){return null!==r?e(r,t,n,o):void 0};C(e,t),t.isNullable=!0,t.displayName=e.displayName+" (nullable)",t.originalChecker=e,e.nullable=t,k(e,e.nullable),e.notOptional||m(e.nullable,r)}function k(e,r){if("object"==typeof r.type)r.type=n(r.type);else{if("function"!=typeof r.type)return void(r.type+=" (optional)");r.type=function(){return e.type.apply(e,arguments)}}r.type.__apiCheckData=n(e.type.__apiCheckData)||{},r.type.__apiCheckData.optional=!0}function C(e,r){p(Object.keys(e),function(t){return r[t]=e[t]})}function j(){}function x(){return function(){}}var _=function(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0})},A=t(1),w={addOptional:m,getRequiredVersion:b,setupChecker:g,addNullable:O};e.exports={each:p,copy:n,typeOf:o,arrayify:u,getCheckerDisplay:i,isError:s,list:l,getError:y,nAtL:h,t:d,undef:v,checkerHelpers:w,noop:j}},function(e,r,t){"use strict";function n(){function r(n,i,a){if(r.config.disabled||e.exports.globalConfig.disabled)return{apiTypes:{},argTypes:{},passed:!0,message:"",failed:!1};t(arguments),Array.isArray(n)?i=Array.prototype.slice.call(i):(n=[n],i=[i]);var u=p(n,i);u.length||(u=o(n,i));var f=c(n,i);return u.length?(f.message=r.getErrorMessage(n,i,u,a),f.failed=!0,f.passed=!1):(f.message="",f.failed=!1,f.passed=!0),f}function t(e){var t=e[0],n=e[1],i=Array.isArray(n)||n&&"object"==typeof n&&"number"==typeof n.length;if(Array.isArray(t)&&!i)throw new Error(a(t,[n],["If an array is provided for the api, an array must be provided for the args as well."],{prefix:"apiCheck"}));var u=o(C.checkApiCheckApi,e);if(u.length){var p=r.getErrorMessage(C.checkApiCheckApi,e,u,{prefix:"apiCheck"});r.handleErrorMessage(p,!0)}}function n(e){return function(t,n,o){var i=r(t,n,o);return r.handleErrorMessage(i.message,e),i}}function i(e,r){if(r&&e)throw new Error(e);e&&console.warn(e)}function a(e,t){function n(){var e=p.onlyPrefix;return e||(e=(""+(f.prefix||"")+" "+(p.prefix||"")).trim()),e}function o(){var e=p.onlySuffix;return e||(e=(""+(p.suffix||"")+" "+(f.suffix||"")).trim()),e}function i(){var e=p.url;return e||(e=f.docsBaseUrl&&p.urlSuffix&&(""+f.docsBaseUrl+p.urlSuffix).trim()),e}var a=void 0===arguments[2]?[]:arguments[2],p=void 0===arguments[3]?{}:arguments[3],f=r.config.output||{},c=n(),s=o(),l=i(),y="apiCheck failed! "+a.join(", "),h="\n\n"+u(e,t);return(""+c+" "+y+" "+s+" "+(l||"")+h).trim()}function u(e,r){function t(e){h(e,function(r,n){-1===f.indexOf(r)&&(f.push(r),"object"==typeof r?t(e):"function"==typeof r&&(e[n]=r.displayName||r.name||"anonymous function"))})}function n(e){return e&&e.length?(e&&1===e.length&&(e=e[0]),l(e,null,2)):"nothing"}function o(){var e="\n",t=!0;r&&1===r.length&&(t="object"==typeof r[0]?!!Object.keys(r[0]).length:!1);var n="type"+(t?"s":""),o=e+e;return"You passed:"+e+s+o+("With the "+n+":"+e+u+o)+("The API calls for:"+e+a)}var i=c(e,r),a=i.apiTypes,u=i.argTypes,p=Array.prototype.slice.call(r||[]),f=[];t(p);var s=n(p);return u=n(u),a=n(a),o()}function c(t,n){t=g(t),n=g(n);var o=t.map(function(t,o){var i=e.exports.globalConfig.hasOwnProperty("verbose");return b(t,{terse:i?!e.exports.globalConfig.verbose:!r.config.verbose,obj:n[o],addHelpers:!0})}),i=n.map(function(e){return f(e,[])});return{argTypes:i,apiTypes:o}}var s=void 0===arguments[0]?{}:arguments[0],d=void 0===arguments[1]?{}:arguments[1];j&&arguments.length&&j["throw"](C.getApiCheckInstanceCheckers,arguments,{prefix:"creating an apiCheck instance"});var v={"throw":n(!0),warn:n(!1),getErrorMessage:a,handleErrorMessage:i,config:{output:s.output||{prefix:"",suffix:"",docsBaseUrl:""},verbose:s.verbose||!1,disabled:s.disabled||!1},utils:y};h(v,function(e,t){return r[t]=e});var m=r.disabled||e.exports.globalConfig.disabled;return h(k.getCheckers(m),function(e,t){return r[t]=e}),h(d,function(e,t){return r[t]=e}),r}function o(e,r){for(var t=[],n=!1,o=0,i=0,u=void 0,p=void 0,f=void 0,c=void 0,s=void 0,l=void 0,y=void 0;(p=e[o++])&&i=e.length,y=o>1&&e[o-1].isOptional,l&&c||l&&!c&&!p.isOptional&&!y?(n=!0,t.push(a(f,p,u))):l&&p.isOptional?i--:t.push(""+v(s)+" passed");return n?t:[]}function i(e,r,t){var n=k.shape({type:k.string,optional:k.bool}),o=k.func.withProperties({__apiCheckData:n}),a=k.shape({__apiCheckData:n}),u=k.oneOfType([o,a])(e,r,t);return d(u)?u:"function"==typeof e||e.hasOwnProperty(e.__apiCheckData.type)?void 0:O(r,t,i.type)}function a(e,r,t){var n=u(r,t);return n=n?" - "+n:"",e.message+n}function u(e,r){var t=e.help;return t?("function"==typeof t&&(t=t(r)),t):""}function p(e,r){var t=e.filter(function(e){return!e.isOptional});return r.lengthe||e>t?y(o,i,n):void 0},{type:n},e)}function D(){var r="empty object";return b(function(e,t,n){return"object"!==a(e)||null===e||Object.keys(e).length?y(t,n,r):void 0},{type:r},e)}return{array:r("Array"),bool:r("Boolean"),number:r("Number"),string:r("String"),func:t(),object:n(),emptyObject:D(),instanceOf:i,oneOf:v,oneOfType:O,arrayOf:k,objectOf:C,typeOrArrayOf:j,range:T,shape:x(),args:_(),any:A(),"null":w()}}var o=t(1),i=t(2),a=i.typeOf,u=i.each,p=i.copy,f=i.getCheckerDisplay,c=i.isError,s=i.arrayify,l=i.list,y=i.getError,h=i.nAtL,d=i.t,v=i.checkerHelpers,g=i.undef,b=v.setupChecker,m=e.exports=n();e.exports.getCheckers=n}])}); //# sourceMappingURL=api-check.min.js.map