!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@hookform/resolvers"),require("ajv"),require("ajv-errors"),require("ajv-formats"),require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","ajv","ajv-errors","ajv-formats","react-hook-form"],r):r((e||self).hookformResolversAjv={},e.hookformResolvers,e.ajv,e.ajvErrors,e.ajvFormats,e.ReactHookForm)}(this,function(e,r,o,a,s,t){function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=/*#__PURE__*/n(o),f=/*#__PURE__*/n(a),u=/*#__PURE__*/n(s),l=function(e,r){for(var o={},a=function(e){"required"===e.keyword&&(e.instancePath+="/"+e.params.missingProperty);var a=e.instancePath.substring(1).replace(/\//g,".");if(o[a]||(o[a]={message:e.message,type:e.keyword}),r){var s=o[a].types,n=s&&s[e.keyword];o[a]=t.appendErrors(a,r,o,e.keyword,n?[].concat(n,e.message||""):e.message)}},s=function(){var r=e[n];"errorMessage"===r.keyword?r.params.errors.forEach(function(e){e.message=r.message,a(e)}):a(r)},n=0;n<e.length;n+=1)s();return o};e.ajvResolver=function(e,o,a){return void 0===a&&(a={}),function(s,t,n){try{var c=new i.default(Object.assign({},{allErrors:!0,validateSchema:!0},o));f.default(c),u.default(c);var d=c.compile(Object.assign({$async:a&&"async"===a.mode},e)),v=structuredClone(s),m=d(v);return n.shouldUseNativeValidation&&r.validateFieldsNatively({},n),Promise.resolve(m?{values:v,errors:{}}:{values:{},errors:r.toNestErrors(l(d.errors,!n.shouldUseNativeValidation&&"all"===n.criteriaMode),n)})}catch(e){return Promise.reject(e)}}}});
//# sourceMappingURL=ajv.umd.js.map
