var V=(o,f)=>()=>(f||o((f={exports:{}}).exports,f),f.exports);var x=V((y,m)=>{(function(o,f){typeof y=="object"&&typeof m<"u"?m.exports=f():typeof define=="function"&&define.amd?define(f):(o=typeof globalThis<"u"?globalThis:o||self,o.FormValidation=o.FormValidation||{},o.FormValidation.plugins=o.FormValidation.plugins||{},o.FormValidation.plugins.Bootstrap5=f())})(void 0,function(){function o(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function f(t,n){for(var l=0;l<n.length;l++){var r=n[l];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function g(t,n,l){return n&&f(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function b(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&d(t,n)}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},c(t)}function d(t,n){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},d(t,n)}function E(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function h(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _(t,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}function O(t){var n=E();return function(){var r=c(t),e;if(n){var i=c(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return _(this,e)}}function k(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&(t=c(t),t!==null););return t}function p(){return typeof Reflect<"u"&&Reflect.get?p=Reflect.get.bind():p=function(n,l,r){var e=k(n,l);if(e){var i=Object.getOwnPropertyDescriptor(e,l);return i.get?i.get.call(arguments.length<3?n:r):i.value}},p.apply(this,arguments)}var s=FormValidation.utils.classSet,a=FormValidation.utils.hasClass,w=FormValidation.plugins.Framework,P=function(t){b(l,t);var n=O(l);function l(r){var e;return o(this,l),e=n.call(this,Object.assign({},{eleInvalidClass:"is-invalid",eleValidClass:"is-valid",formClass:"fv-plugins-bootstrap5",rowInvalidClass:"fv-plugins-bootstrap5-row-invalid",rowPattern:/^(.*)(col|offset)(-(sm|md|lg|xl))*-[0-9]+(.*)$/,rowSelector:".row",rowValidClass:"fv-plugins-bootstrap5-row-valid"},r)),e.eleValidatedHandler=e.handleElementValidated.bind(h(e)),e}return g(l,[{key:"install",value:function(){p(c(l.prototype),"install",this).call(this),this.core.on("core.element.validated",this.eleValidatedHandler)}},{key:"uninstall",value:function(){p(c(l.prototype),"install",this).call(this),this.core.off("core.element.validated",this.eleValidatedHandler)}},{key:"handleElementValidated",value:function(e){var i=e.element.getAttribute("type");if((i==="checkbox"||i==="radio")&&e.elements.length>1&&a(e.element,"form-check-input")){var u=e.element.parentElement;a(u,"form-check")&&a(u,"form-check-inline")&&s(u,{"is-invalid":!e.valid,"is-valid":e.valid})}}},{key:"onIconPlaced",value:function(e){s(e.element,{"fv-plugins-icon-input":!0});var i=e.element.parentElement;a(i,"input-group")&&(i.parentElement.insertBefore(e.iconElement,i.nextSibling),e.element.nextElementSibling&&a(e.element.nextElementSibling,"input-group-text")&&s(e.iconElement,{"fv-plugins-icon-input-group":!0}));var u=e.element.getAttribute("type");if(u==="checkbox"||u==="radio"){var v=i.parentElement;a(i,"form-check")?(s(e.iconElement,{"fv-plugins-icon-check":!0}),i.parentElement.insertBefore(e.iconElement,i.nextSibling)):a(i.parentElement,"form-check")&&(s(e.iconElement,{"fv-plugins-icon-check":!0}),v.parentElement.insertBefore(e.iconElement,v.nextSibling))}}},{key:"onMessagePlaced",value:function(e){e.messageElement.classList.add("invalid-feedback");var i=e.element.parentElement;if(a(i,"input-group")){i.appendChild(e.messageElement),s(i,{"has-validation":!0});return}var u=e.element.getAttribute("type");(u==="checkbox"||u==="radio")&&a(e.element,"form-check-input")&&a(i,"form-check")&&!a(i,"form-check-inline")&&e.elements[e.elements.length-1].parentElement.appendChild(e.messageElement)}}]),l}(w);return P})});export default x();
