!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@hookform/resolvers"),require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","react-hook-form"],r):r((e||self).hookformResolversJoi={},e.hookformResolvers,e.ReactHookForm)}(this,function(e,r,o){e.joiResolver=function(e,t,n){return void 0===t&&(t={abortEarly:!1}),void 0===n&&(n={}),function(i,s,a){try{var l=function(){return c.error?{values:{},errors:r.toNestErrors((e=c.error,t=!a.shouldUseNativeValidation&&"all"===a.criteriaMode,e.details.length?e.details.reduce(function(e,r){var n=r.path.join(".");if(e[n]||(e[n]={message:r.message,type:r.type}),t){var i=e[n].types,s=i&&i[r.type];e[n]=o.appendErrors(n,t,e,r.type,s?[].concat(s,r.message):r.message)}return e},Object.create(null)):{}),a)}:(a.shouldUseNativeValidation&&r.validateFieldsNatively({},a),{errors:{},values:c.value});var e,t},u=Object.assign({},t,{context:s}),c={},f=function(){if("sync"===n.mode)c=e.validate(i,u);else{var r=function(e,r){try{var o=e()}catch(e){return r(e)}return o&&o.then?o.then(void 0,r):o}(function(){return Promise.resolve(e.validateAsync(i,u)).then(function(e){c.value=e})},function(e){c.error=e});if(r&&r.then)return r.then(function(){})}}();return Promise.resolve(f&&f.then?f.then(l):l())}catch(e){return Promise.reject(e)}}}});
//# sourceMappingURL=joi.umd.js.map
