!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@hookform/resolvers"),require("@standard-schema/utils")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","@standard-schema/utils"],r):r((e||self).hookformResolversStandardSchema={},e.hookformResolvers,e.utils)}(this,function(e,r,t){function n(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},o.apply(null,arguments)}var a=Symbol("Schema root");function s(e,r){r&&(e.message=e.message?e.message+"\n"+r:r)}e.standardSchemaResolver=function(e,i,l){return void 0===l&&(l={}),function(i,u,f){try{var c=function(){if(d.issues){var e=function(e,r){for(var i=new Map,l=0;l<e.length;l++){var u=e[l],f=t.getDotPath(u)||a,c=i.get(f);if(c?f===a&&s(c,u.message):i.set(f,{message:u.message,type:""}),r){var d,v=i.get(f),m=v.types||{};v.types=o({},m,((d={})[Object.keys(m).length]=u.message,d))}}for(var h,y={},g=function(e){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,r){if(e){if("string"==typeof e)return n(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,r):void 0}}(e))){r&&(e=r);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(i);!(h=g()).done;){var p=h.value,b=p[0];b!==a&&(y[b]=p[1])}var j=i.get(a);return j&&(y.root?(s(y.root,j.message),function(e,r){if(r){for(var t=e.types||{},n=0,o=Object.values(r);n<o.length;n++){var a=o[n];t[Object.keys(t).length]=a}e.types=t}}(y.root,j.types)):y.root=j),y}(d.issues,!f.shouldUseNativeValidation&&"all"===f.criteriaMode);return{values:{},errors:r.toNestErrors(e,f)}}return f.shouldUseNativeValidation&&r.validateFieldsNatively({},f),{values:l.raw?Object.assign({},i):d.value,errors:{}}},d=e["~standard"].validate(i),v=function(){if(d instanceof Promise)return Promise.resolve(d).then(function(e){d=e})}();return Promise.resolve(v&&v.then?v.then(c):c())}catch(e){return Promise.reject(e)}}}});
//# sourceMappingURL=standard-schema.umd.js.map
