!function(){function e(e,a){(e=e.find("[data-pafe-form-builder-select-autocomplete]")).length&&a.each(e,function(e,t){a(t).selectize({dropdownParent:null})})}jQuery(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/pafe-form-builder-field.default",e)})}(),jQuery(document).ready(function(d){var t,a,i;function e(){d("[data-pafe-form-builder-payment-methods-select-field]").each(function(){var e=d(this).attr("type"),t=d(this).attr("data-pafe-form-builder-form-id"),t=d(document).find('[data-pafe-form-builder-submit-form-id="'+t+'"]');(e="radio"==e||"checkbox"==e?d(this).closest(".elementor-element").find("input:checked").val():d(this).val().trim())!=d(this).attr("data-pafe-form-builder-payment-methods-select-field-value-for-stripe")?void 0!==t.attr("data-pafe-form-builder-stripe-currency")&&t.removeAttr("data-pafe-form-builder-stripe-submit"):void 0!==t.attr("data-pafe-form-builder-stripe-currency")&&t.attr("data-pafe-form-builder-stripe-submit",""),e!=d(this).attr("data-pafe-form-builder-payment-methods-select-field-value-for-paypal")?void 0!==t.attr("data-pafe-form-builder-paypal-submit-enable")&&(t.removeAttr("data-pafe-form-builder-paypal-submit"),t.closest(".elementor-element").find(".pafe-form-builder-paypal").hide()):void 0!==t.attr("data-pafe-form-builder-paypal-submit-enable")&&(t.attr("data-pafe-form-builder-paypal-submit",""),t.closest(".elementor-element").find(".pafe-form-builder-paypal").show())})}d(document).on("elementor/popup/show",function(e,t,a){d(document).find(".dialog-widget [data-pafe-form-builder-select-autocomplete]").each(function(){var e='[data-id="'+d(this).closest("[data-id]").data("id")+'"]';d(this).selectize({dropdownParent:e})})}),d(document).on("change keyup paste",'[type="number"][data-pafe-form-builder-form-id]',(t=function(e){var t=d(this).val(),a=d(this).attr("min"),i=d(this).attr("max"),r=!1;parseInt(a)>parseInt(t)?(r=!0,d(this).val(a)):parseInt(t)>parseInt(i)&&(r=!0,d(this).val(i)),r&&d(this).change()},a=500,i=0,function(){var e=this;clearTimeout(i),i=setTimeout(function(){t.apply(e)},a)})),d('[type="number"][data-pafe-form-builder-form-id]').bind("paste",function(e){var i=this,r=d(this).attr("min"),o=d(this).attr("max");setTimeout(function(e){var t=!1,a=d(i).val();parseInt(r)>parseInt(a)?(t=!0,d(i).val(r)):parseInt(a)>parseInt(o)&&(t=!0,d(i).val(o)),t&&d(this).change()},0)}),d("[data-pafe-form-builder-delete-post]").click(function(e){e.preventDefault();var e={action:"pafe_delete_post",id:d(this).data("pafe-form-builder-delete-post"),force_delete:d(this).data("pafe-form-builder-delete-post-force")},t=d(this).data("pafe-form-builder-delete-post-redirect");d.post(d("[data-pafe-ajax-url]").data("pafe-ajax-url"),e,function(e){""!=e.trim()&&(window.location.href=t)})}),d(document).on("focus",".pafe-form-builder-field [data-pafe-form-builder-form-id]",function(){var e=d(this).closest(".pafe-form-builder-field");e.addClass("pafe-form-builder-field-focus"),e.addClass("pafe-form-builder-label-animated")}),d(document).on("blur",".pafe-form-builder-field [data-pafe-form-builder-form-id]",function(){var e=d(this).closest(".pafe-form-builder-field");e.removeClass("pafe-form-builder-field-focus"),""===d(this).val()&&e.removeClass("pafe-form-builder-label-animated")}),d(document).on("click",'[data-pafe-show_password-icon="true"]',function(){var e=d(this).attr("data-pafe-password-name"),t=d(this).closest(".pafe-field-container").find('[name="form_fields['+e+']"]').attr("type"),a=d(this).closest(".pafe-field-container").find("#eyeIcon-"+e);"password"===t?(d(this).closest(".pafe-field-container").find('[name="form_fields['+e+']"]').attr("type","text"),a.addClass("fa-eye-slash")):(d(this).closest(".pafe-field-container").find('[name="form_fields['+e+']"]').attr("type","password"),a.removeClass("fa-eye-slash"))}),d(document).on("change",'.elementor-field-option input[type="checkbox"]',function(e){var t=d(this).closest(".elementor-field-group").find('.elementor-field-option input[type="checkbox"]'),a=d(this).data("pafe-checkbox-limit-multiple");t.filter(":checked").length>a&&(this.checked=!1)}),d(".pafe-select-type-select2").each(function(){d(this).select2({tags:!0})}),e(),d(document).on("change","[data-pafe-form-builder-payment-methods-select-field]",function(){e()})});