var r=require("@hookform/resolvers"),e=require("ata-validator"),a=require("react-hook-form"),s=function(r,e){for(var s={},t=0;t<r.length;t+=1){var o=r[t],i=("required"===o.keyword?o.instancePath+"/"+o.params.missingProperty:o.instancePath).substring(1).replace(/\//g,".");if(s[i]||(s[i]={message:o.message,type:o.keyword}),e){var n=s[i].types,l=n&&n[o.keyword];s[i]=a.appendErrors(i,e,s,o.keyword,l?[].concat(l,o.message||""):o.message)}}return s};exports.ataResolver=function(a,t,o){void 0===o&&(o={});var i=new e.Validator(a,t);return function(e,a,t){try{var n=i.validate(e);return t.shouldUseNativeValidation&&r.validateFieldsNatively({},t),Promise.resolve(n.valid?{values:o.raw?Object.assign({},e):e,errors:{}}:{values:{},errors:r.toNestErrors(s(n.errors,!t.shouldUseNativeValidation&&"all"===t.criteriaMode),t)})}catch(r){return Promise.reject(r)}}};
//# sourceMappingURL=ata-validator.js.map
