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