(()=>{"use strict";var wpcf7_redirect;(function($){function Wpcf7_redirect(){this.init=function(){this.wpcf7_redirect_mailsent_handler()},this.wpcf7_redirect_mailsent_handler=function(){document.addEventListener("wpcf7mailsent",(function(e){if($(document.body).trigger("wpcf7r-mailsent",[e]),void 0!==e.detail.apiResponse&&e.detail.apiResponse){const i=e.detail.apiResponse;let t=0;void 0!==i.api_url_request&&i.api_url_request&&wpcf7_redirect.handle_api_action(i.api_url_request),void 0!==i.api_json_xml_request&&i.api_json_xml_request&&wpcf7_redirect.handle_api_action(i.api_json_xml_request),void 0!==i.FireScript&&i.FireScript&&(t=void 0!==i.FireScript.delay_redirect?i.FireScript.delay_redirect:t,window.setTimeout((function(){wpcf7_redirect.handle_javascript_action(i.FireScript)}),t)),void 0!==i.popup&&i.popup&&wpcf7_redirect.handle_popups(i.popup,e),void 0!==i.redirect_to_paypal&&i.redirect_to_paypal&&(t=void 0!==i.redirect_to_paypal.delay_redirect?i.redirect_to_paypal.delay_redirect:t,window.setTimeout((function(){wpcf7_redirect.handle_redirect_action(i.redirect_to_paypal)}),t)),void 0!==i.redirect&&i.redirect&&(t=void 0!==i.redirect.delay_redirect?i.redirect.delay_redirect:t,window.setTimeout((function(){wpcf7_redirect.handle_redirect_action(i.redirect)}),t))}}),!1),document.addEventListener("wpcf7invalid",(function(e){if($(document.body).trigger("wpcf7r-invalid",[e]),void 0!==e.detail.apiResponse&&e.detail.apiResponse){const i=e.detail.apiResponse;i.invalidFields&&wpcf7_redirect.ninja_multistep_mov_to_invalid_tab(e,i)}}))},this.handle_popups=function(e,i){$(document.body).trigger("wpcf7r-before-open-popup",[i]),$.each(e,(function(e,i){var t=$(i["popup-template"]);$(document.body).append(t),$(document.body).addClass(i["template-name"]),window.setTimeout((function(){$(document.body).addClass("modal-popup-open"),t.addClass("is-open")}),1e3),t.find(".close-button").on("click",(function(){t.removeClass("is-open").addClass("fade"),$(document.body).removeClass("modal-popup-open"),window.setTimeout((function(){$(".wpcf7r-modal").remove(),$(document.body).trigger("wpcf7r-popup-removed",[t])}),4e3)})),$(document.body).trigger("wpcf7r-popup-appended",[t])}))},this.handle_api_action=function(send_to_api_result){$.each(send_to_api_result,(function(k,v){try{if(!v.result_javascript||"string"!=typeof v.result_javascript)return;v.api_response&&"string"==typeof v.api_response&&""!==v.api_response.trim()&&(window.rcf7_response=JSON.parse(v.api_response)),eval(v.result_javascript)}catch(e){console.error("Error handling API action:",e)}}))},this.ninja_multistep_mov_to_invalid_tab=function(e,i){if($(".fieldset-cf7mls-wrapper").length){const t=$(e.target),r=i.invalidFields[0],n=$(r.into).parents("fieldset"),o=t.find(".cf7mls_current_fs"),d=n;t.find(".fieldset-cf7mls").removeClass("cf7mls_current_fs"),n.addClass("cf7mls_current_fs").removeClass("cf7mls_back_fs"),t.find(".cf7mls_progress_bar").length&&(t.find(".cf7mls_progress_bar li").eq(t.find("fieldset.fieldset-cf7mls").index(d)).addClass("current"),t.find(".cf7mls_progress_bar li").eq(t.find("fieldset.fieldset-cf7mls").index(o)).removeClass("active current"))}},this.handle_redirect_action=function(e){$(document.body).trigger("wpcf7r-handle_redirect_action",[e]),$.each(e,(function(e,i){const t=1e3*(i.delay||0);window.setTimeout((function(e){const i=e.redirect_url||"",t=e.type||"";void 0!==e.form&&e.form?($("body").append(e.form),$("#cf7r-result-form").submit()):i&&"redirect"==t?window.location=i:i&&"new_tab"==t&&window.open(i)}),t,i)}))},this.handle_javascript_action=function(scripts){$(document.body).trigger("wpcf7r-handle_javascript_action",[scripts]),$.each(scripts,(function(k,script){eval(script)}))},this.htmlspecialchars_decode=function(e){var i={"&amp;":"&","&#038;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#039;":"'","&#8217;":"’","&#8216;":"‘","&#8211;":"–","&#8212;":"—","&#8230;":"…","&#8221;":"”"};return e.replace(/\&[\w\d\#]{2,5}\;/g,(function(e){return i[e]}))},this.init()}wpcf7_redirect=new Wpcf7_redirect})(jQuery)})();
(function($){
function initUACF7MultiStep($context){
$context.find('.wpcf7').each(function(){
var repeater_count=jQuery(this).find('.uacf7-repeater-count').val();
var uacf7_sid=1;
var form_id=jQuery(this).find("input[name=_wpcf7]").val();
var uacf7_next=jQuery(this).find('.uacf7-next[data-form-id="' + form_id + '"]');
var uacf7_prev=jQuery(this).find('.uacf7-prev[data-form-id="' + form_id + '"]');
var uacf7_step='.uacf7-step-' + form_id;
var total_steps=jQuery(uacf7_step, this).length;
jQuery(uacf7_step, this).each(function (){
var $this=jQuery(this);
$this.attr('id', form_id + 'step-' + uacf7_sid);
$this.attr('step-id', uacf7_sid);
if(uacf7_sid==1){
$this.addClass('step-start');
}
if(total_steps==uacf7_sid){
$this.addClass('step-end');
}
uacf7_sid++;
});
uacf7_prev.on('click', function (e){
e.preventDefault();
});
uacf7_next.on('click', function (e){
e.preventDefault();
var $this=jQuery(this);
uacf7_step_validation($this, uacf7_step, form_id, repeater_count);
});
});
}
function uacf7_step_validation($this, uacf7_step, form_id, repeater_count){
var uacf7_current_step=jQuery($this).closest(uacf7_step);
var uacf7_next_step=1 + parseInt(uacf7_current_step.attr('step-id'));
var uacf7_current_step_fields=uacf7_current_step.find('input, select, textarea').filter(function (){
return this.offsetParent!==null&&this.name;
}).map(function (){
return this.name.replace(/\[\]$/, '');
}).get();
function uacf7_onlyUnique(value, index, self){
return self.indexOf(value)===index;
}
var uacf7_current_step_fields=uacf7_current_step_fields.filter(uacf7_onlyUnique);
var uacf7_form_ids='';
var fields_to_check_serialized=jQuery(uacf7_current_step).find(".wpcf7-form-control").serialize();
uacf7_current_step.find('input[type="radio"]').each(function (){
var name=this.name;
if(fields_to_check_serialized.indexOf(name + '=')===-1){
var checkedVal=jQuery('input[name="' + name + '"]:checked').val();
if(typeof checkedVal!=='undefined'){
fields_to_check_serialized +='&' + encodeURIComponent(name) + '=' + encodeURIComponent(checkedVal);
}}
});
uacf7_current_step.find('input[type="radio"], input[type="checkbox"]').each(function (){
var name=this.name;
var isChecked=jQuery(this).is(':checked');
if(fields_to_check_serialized.indexOf(encodeURIComponent(name) + '=')===-1&&isChecked){
var val=jQuery(this).val();
fields_to_check_serialized +='&' + encodeURIComponent(name) + '=' + encodeURIComponent(val);
}});
if(jQuery(uacf7_current_step).find(".wpcf7-form-control[type='file']").length > 0){
jQuery(uacf7_current_step).find(".wpcf7-form-control[type='file']").each(function (i, n){
fields_to_check_serialized +="&" + jQuery(this).attr('name') + "=" + jQuery(this).val();
if(jQuery(this)[0].files.length > 0){
var file_size=jQuery(this)[0].files[0].size;
fields_to_check_serialized +="&" + jQuery(this).attr('name') + "_size=" + file_size;
}});
}
var validation_fields=[];
for (let i=0; i < uacf7_current_step_fields.length; i++){
if(uacf7_current_step_fields[i]!=''){
var type=jQuery("[name=" + uacf7_current_step_fields[i] + "]");
if(typeof type[0]==='undefined'){
type=jQuery('[name="' + uacf7_current_step_fields[i] + '[]"]');
}
type=type[0].localName;
if(typeof repeater_count!='undefined'){
var value=jQuery("[name=" + uacf7_current_step_fields[i] + "]").val();
var valuecheckbox=jQuery("[name=" + uacf7_current_step_fields[i] + "][type='checkbox']");
if(value==''||valuecheckbox.length > 0){
validation_fields.push('' + type + ':' + uacf7_current_step_fields[i] + '');
}}else{
validation_fields.push('' + type + ':' + uacf7_current_step_fields[i] + '');
}}
}
var data=fields_to_check_serialized +
'&' + 'action=' + 'check_fields_validation' +
'&' + 'form_id=' + form_id +
'&' + 'validation_fields=' + validation_fields +
'&' + 'current_fields_to_check=' + uacf7_current_step_fields +
'&' + 'ajax_nonce=' + uacf7_multistep_obj.nonce;
jQuery.ajax({
url: uacf7_multistep_obj.ajax_url,
type: 'post',
dataType: "json",
data: data,
beforeSend: function (){
jQuery($this).closest(".uacf7-step").find('.uacf7-ajax-loader').addClass('is-active');
},
success: function (response){
jQuery($this).closest(".uacf7-step").find('.uacf7-ajax-loader').removeClass('is-active');
var json_result=(typeof response==='object') ? response:JSON.parse(response);
var $form=jQuery('form');
clear_error_messages($form, uacf7_current_step);
try {
if(json_result.is_valid){
var curStep=jQuery($this).closest(".uacf7-step"),
curStepBtn=curStep.attr("id"),
nextStepWizard=jQuery('div.setup-panel div a[href="#' + curStepBtn + '"]').parent().next().children("a");
jQuery('.steps-step').find('a[data-form-id="' + form_id + '"]').removeClass('uacf7-btn-active');
uacf7_current_step.hide();
uacf7_current_step.addClass('completed');
jQuery('#' + form_id + 'step-' + uacf7_next_step).show();
jQuery('.steps-step').find('a[href="#' + curStepBtn + '"]').addClass('completed');
jQuery('.steps-step').find('a[href="#' + form_id + 'step-' + uacf7_next_step + '"]').addClass('uacf7-btn-active');
jQuery('.steps-step').find('a[href="#' + form_id + 'step-' + uacf7_next_step + '"]').parent().addClass('step-complete');
jQuery('.current-step-title').find('.step-title').hide();
jQuery('.current-step-title').find('.step-title.step-' + uacf7_next_step).show();
}else{
jQuery.each(json_result.invalid_fields, function (i, n){
jQuery(n.into, 'form').each(function (){
jQuery('.wpcf7-form-control', this).addClass('wpcf7-not-valid');
jQuery('[aria-invalid]', this).attr('aria-invalid', 'true');
jQuery(this).append('<span class="wpcf7-not-valid-tip" aria-hidden="true">' + n.message + '</span>');
});
});
}} catch (e){
console.log("error: " + e);
}
if(typeof uacf7_multistep_scroll!=='undefined'&&uacf7_multistep_scroll.scroll_top==1){
multistep_scroll_to_top($this.parents('form'));
}},
error: function (e){
alert('Error ajax load' + e);
}});
}
function clear_error_messages($form, uacf7_current_step){
$form.removeClass('invalid');
jQuery('.wpcf7-response-output', $form).removeClass('wpcf7-validation-errors');
jQuery('.wpcf7-form-control', uacf7_current_step).removeClass('wpcf7-not-valid');
jQuery('[aria-invalid]', uacf7_current_step).attr('aria-invalid', 'false');
jQuery('.wpcf7-not-valid-tip', uacf7_current_step).remove();
}
function multistep_scroll_to_top(element){
jQuery([document.documentElement, document.body]).animate({
scrollTop: jQuery(element).offset().top - 120
}, 500);
}
function acceptance_validation($this, uacf7_next, uacf7_step){
var $this=$this.closest(uacf7_step);
var acceptance=$this.find('.wpcf7-acceptance');
if(acceptance.length==0){
return false;
}
acceptance.each(function (){
if(jQuery(this).hasClass('invert')){
var invert=true;
}else{
var invert=false;
}
if(jQuery(this).hasClass('optional')){
var optional=true;
}else{
var optional=false;
}
acceptance_validation_disabled_button($this, invert, optional, uacf7_next, this.checked);
jQuery(this).find('input[type="checkbox"]').change(function (){
acceptance_validation_disabled_button($this, invert, optional, uacf7_next, this.checked);
});
});
}
function acceptance_validation_disabled_button($this, invert, optional, uacf7_next, checked){
if(invert==true&&checked==false){
var next_disable=false
}else if(invert==false&&checked==true){
var next_disable=false
}else{
var next_disable=true
}
if(next_disable==true){
$this.find(uacf7_next).prop("disabled", true)
}else{
$this.find(uacf7_next).prop("disabled", false)
}
if(optional==true){
$this.find(uacf7_next).prop("disabled", false)
}}
$(document).ready(function(){
initUACF7MultiStep($(document));
});
$(document).on('elementor/popup/show', function(event, id, instance){
var $popup=$(instance.$element);
initUACF7MultiStep($popup);
});
})(jQuery);
(function ($){
function initUacf7Progressbar($scope){
$scope.find('.wpcf7-form').each(function (){
var form_id=$(this).find("input[name=_wpcf7]").val(),
navListItems=$(this).find('.uacf7-steps div.setup-panel div a[data-form-id="' + form_id + '"]'),
allWells=$(this).find('.uacf7-step'),
allNextBtn=$(this).find('.uacf7-next[data-form-id="' + form_id + '"]'),
allPrevBtn=$(this).find('.uacf7-prev[data-form-id="' + form_id + '"]'),
allStepTitle=$(this).find('.step-title[data-form-id="' + form_id + '"]');
allWells.hide();
navListItems.click(function (e){
e.preventDefault();
var $target=$($(this).attr('href')),
title=$($(this).attr('title-id')),
$item=$(this);
if(!$item.hasClass('completed')){
var validated_steps=parseInt($item.attr('data-current-steps')) - 1 ;
if(!$('#'+form_id+'step-'+validated_steps+'').hasClass('completed')){
$('#'+form_id+'step-'+validated_steps+'').find('.uacf7-next').trigger('click');
}else{
navListItems.removeClass('uacf7-btn-active').addClass('uacf7-btn-default');
$item.addClass('uacf7-btn-active');
allWells.hide();
$target.show();
allStepTitle.hide();
title.show();
$target.find('input:eq(0)').focus();
}}else{
if(!$item.hasClass('disabled')){
navListItems.removeClass('uacf7-btn-active').addClass('uacf7-btn-default');
$item.addClass('uacf7-btn-active');
allWells.hide();
$target.show();
allStepTitle.hide();
title.show();
$target.find('input:eq(0)').focus();
}}
});
allPrevBtn.click(function (){
var curStep=$(this).closest(".uacf7-step"),
curStepBtn=curStep.attr("id"),
prevStepSteps=$('div.setup-panel div a[href="#' + curStepBtn + '"]').parent().prev().children("a");
prevStepSteps.removeAttr('disabled').trigger('click');
});
allNextBtn.click(function (){
var curStep=$(this).closest(".uacf7-step"),
curStepBtn=curStep.attr("id"),
nextStepWizard=$('div.setup-panel div a[href="#' + curStepBtn + '"]').parent().next().children("a"),
curInputs=curStep.find("input[type='text'],input[type='url']"),
isValid=true;
$(".form-group").removeClass("has-error");
for (var i=0; i < curInputs.length; i++){
if(!curInputs[i].validity.valid){
isValid=false;
$(curInputs[i]).closest(".form-group").addClass("has-error");
}}
});
$('#'+form_id+'step-1.uacf7-step.step-content.step-start').show();
});
}
$(document).ready(function (){
initUacf7Progressbar($(document));
});
$(document).on('elementor/popup/show', function (event, id, instance){
var $popup=$(instance.$element);
initUacf7Progressbar($popup);
});
})(jQuery);