import{get as r,set as e}from"react-hook-form";var t=function(e,t,i){if(e&&"reportValidity"in e){var n=r(i,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},i=function(r,e){var i=function(i){var n=e.fields[i];n&&n.ref&&"reportValidity"in n.ref?t(n.ref,i,r):n&&n.refs&&n.refs.forEach(function(e){return t(e,i,r)})};for(var n in e.fields)i(n)},n=function(t,n){n.shouldUseNativeValidation&&i(t,n);var o={};for(var f in t){var s=r(n.fields,f),c=Object.assign(t[f]||{},{ref:s&&s.ref});if(a(n.names||Object.keys(t),f)){var u=Object.assign({},r(o,f));e(u,"root",c),e(o,f,u)}else e(o,f,c)}return o},a=function(r,e){var t=o(e).replace(/[.*+?^${}()|\\]/g,"\\$&");return r.some(function(r){return o(r).match("^"+t+"\\.\\d+")})};function o(r){return r.replace(/[\[\]]/g,"")}export{n as toNestErrors,i as validateFieldsNatively};
//# sourceMappingURL=resolvers.module.js.map
