(()=>{"use strict";var e=e||{};window.GerowTheme=e,toastr.options={positionClass:"toast-bottom-right"},e.showError=function(e){toastr.error(e)},e.showSuccess=function(e){toastr.success(e)},e.isRtl=function(){return"rtl"===document.body.dir},e.handleError=function(o){void 0!==o.errors&&o.errors.length?e.handleValidationError(o.errors):void 0!==o.responseJSON?void 0!==o.responseJSON.errors?422===o.status&&e.handleValidationError(o.responseJSON.errors):void 0!==o.responseJSON.message?e.showError(o.responseJSON.message):$.each(o.responseJSON,(function(o,t){$.each(t,(function(o,t){e.showError(t)}))})):e.showError(o.statusText)},e.handleValidationError=function(o){var t="";$.each(o,(function(e,o){""!==t&&(t+="<br />"),t+=o})),e.showError(t)},function(o){o(document).on("submit",".newsletter-form",(function(t){t.preventDefault(),t.stopPropagation();var r=o(t.target),s=r.find('button[type="submit"]');o.ajax({type:"POST",cache:!1,url:r.closest("form").prop("action"),data:new FormData(r.closest("form")[0]),contentType:!1,processData:!1,beforeSend:function(){s.addClass("button-loading"),s.attr("disable")},success:function(o){o.error?e.handleError(o.message):(r.closest("form").find("input[type=email]").val(""),e.showSuccess(o.message))},error:function(o){e.handleError(o)},complete:function(){"undefined"!=typeof refreshRecaptcha&&refreshRecaptcha(),s.removeClass("button-loading"),s.removeAttr("disable")}})})),o(document).on("submit",".cons-contact-form",(function(t){var r=this;t.preventDefault(),t.stopPropagation();var s=o(this).find('button[type="submit"]');o.ajax({type:"POST",cache:!1,url:o(this).closest("form").prop("action"),data:new FormData(o(this).closest("form")[0]),contentType:!1,processData:!1,beforeSend:function(){s.addClass("button-loading"),s.prop("disabled",!0)},success:function(t){var s=t.error,n=t.message;s?e.showError(n):(o(r).closest("form").find("input[type=text]").val(""),o(r).closest("form").find("input[type=email]").val(""),o(r).closest("form").find("textarea").val(""),e.showSuccess(n))},error:function(o){e.handleError(o)},complete:function(){"undefined"!=typeof refreshRecaptcha&&refreshRecaptcha(),s.removeClass("button-loading"),s.prop("disabled",!1)}})}))}(jQuery),$(document).on("submit","#request-quote-form",(function(o){o.preventDefault();var t=$(this),r=$(this).find('button[type="submit"]');$.ajax({url:t.prop("action"),method:"POST",data:t.serialize(),beforeSend:function(){r.addClass("button-loading")},success:function(o){var r=o.error,s=o.message;r?e.showError(s):(e.showSuccess(s),t.find('input[type="text"], input[type="number"], input[type="email"], select, textarea').val(""))},error:function(o){e.handleError(o)},complete:function(){r.removeClass("button-loading")}})}))})();