import{toNestErrors as e}from"@hookform/resolvers";import{appendErrors as r}from"react-hook-form";import{safeParseAsync as s,getDotPath as t}from"valibot";function o(o,a,i){return void 0===i&&(i={}),function(n,u,c){try{var m=!c.shouldUseNativeValidation&&"all"===c.criteriaMode;return Promise.resolve(s(o,n,Object.assign({},a,{abortPipeEarly:!m}))).then(function(s){if(s.issues){for(var o=Object.create(null);s.issues.length;){var a=s.issues[0],u=t(a);if(u&&(o[u]||(o[u]={message:a.message,type:a.type}),m)){var l=o[u].types,f=l&&l[a.type];o[u]=r(u,m,o,a.type,f?[].concat(f,a.message):a.message)}s.issues.shift()}return{values:{},errors:e(o,c)}}return{values:i.raw?Object.assign({},n):s.output,errors:{}}})}catch(e){return Promise.reject(e)}}}export{o as valibotResolver};
//# sourceMappingURL=valibot.module.js.map
