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