!function(t){"use strict";t.WS_Form.prototype.set_is_admin=function(){return!1},t.WS_Form.prototype.init=function(){this.data_cache_build(),this.set_globals()},t.WS_Form.prototype.init_after_get_submit=function(e){t.WS_Form.debug_rendered&&(!1!==this.submit_auto_populate&&this.log("debug_action_get",this.submit_auto_populate.action_label),!1!==this.submit&&this.log("debug_submit_loaded")),this.form_build()},t.WS_Form.prototype.set_globals=function(){if(this.framework_id=t.WS_Form.settings_plugin.framework,this.framework=t.WS_Form.frameworks.types[this.framework_id],t.WS_Form.debug_rendered&&this.debug_info("debug_info_framework",this.framework.name),this.framework_fields=this.framework.fields.public,void 0!==this.form_obj.attr("action")){var e=this.form_obj.attr("action"),i=ws_form_settings.url_ajax_namespace+"/submit",a="rest_route="+encodeURIComponent("/"+ws_form_settings.url_ajax_namespace+"/submit");this.form_action_custom=-1===e.indexOf(i)&&-1===e.indexOf(a)}else this.form_action_custom=!0;var o=void 0!==this.framework.fields.public.class_form_validated?this.framework.fields.public.class_form_validated:[];if(this.class_validated=o.join(" "),this.selector_validated="."+o.join(",."),ws_form_settings.wsf_hash&&"object"==typeof ws_form_settings.wsf_hash){for(var r in ws_form_settings.wsf_hash)if(ws_form_settings.wsf_hash.hasOwnProperty(r)){var s=ws_form_settings.wsf_hash[r];void 0!==s.id&&void 0!==s.hash&&void 0!==s.token&&s.id==this.form_id&&this.hash_set(s.hash,s.token,!0)}}else this.hash_set(this.cookie_get("hash",""),!1,!0);this.visual_editor=void 0!==this.form_canvas_obj.attr("data-visual-builder");var _=this;if(this.hash){var n="submit/hash/"+this.hash+"/";this.token&&(n+=this.token+"/"),t.WS_Form.this.api_call(n,"GET",!1,function(t){void 0!==t.data&&(_.submit=t.data),_.init_after_get_submit(!0),_.submit=!1},function(t){_.read_json_populate(),_.init_after_get_submit(!1)})}else this.read_json_populate(),this.init_after_get_submit(!1)},t.WS_Form.prototype.read_json_populate=function(){"undefined"!=typeof wsf_form_json_populate&&void 0!==wsf_form_json_populate[this.form_id]&&(this.submit_auto_populate=wsf_form_json_populate[this.form_id])},t.WS_Form.prototype.log=function(e,i,a){return void 0===i&&(i=""),void 0===a&&(a=""),!!t.WS_Form.debug_rendered&&this.debug_audit_add("log",this.language(e,i,!1).replace(/%s/g,i),a)},t.WS_Form.prototype.error=function(e,i,a){void 0===i&&(i=""),void 0===a&&(a="");var o=this.language(e,i,!1).replace(/%s/g,i);return t.WS_Form.debug_rendered&&this.debug_audit_add("error",o,a),o},t.WS_Form.prototype.form_render=function(){if(this.form_timer(),"function"==typeof this.form_calc_log&&this.form_calc_log(),void 0!==this.form.meta.action)for(var t in this.form.meta.action)if(this.form.meta.action.hasOwnProperty(t)){var e=this.form.meta.action[t],i=e.id.toString();this.conditional_actions_run_action.push(i),e.save&&this.conditional_actions_run_save.push(i),e.submit&&this.conditional_actions_run_submit.push(i),"google"==e.conversion_type&&(this.action_ga=!0)}this.conditional_actions_changed=!1,this.signatures=[],this.signatures_by_name=[],this.recaptchas=[],this.recaptchas_v2_default=[],this.recaptchas_v2_invisible=[],this.recaptchas_v3_default=[],this.recaptchas_conditions=[],this.hcaptchas=[],this.hcaptchas_default=[],this.hcaptchas_invisible=[],this.hcpatchas_conditions=[],this.turnstiles=[],this.turnstiles_default=[],this.turnstiles_conditions=[],this.captchafoxes=[],this.captchafoxes_default=[],this.captchafoxes_invisible=[],this.captchafoxes_conditions=[],this.form.meta.style_id&&void 0===this.form_obj.attr("data-wsf-style-id")&&this.form_obj.attr("data-wsf-style-id",this.form.meta.style_id),this.form_framework(),this.form_preview(),"function"==typeof this.form_tab&&this.form_tab(),"function"==typeof this.form_section_repeatable&&this.form_section_repeatable(),this.form_navigation(),"function"==typeof this.form_analytics&&this.form_analytics(),this.form_validation(),"function"==typeof this.form_select&&this.form_select(),"function"==typeof this.form_select_min_max&&this.form_select_min_max(),"function"==typeof this.form_select2&&this.form_select2(),"function"==typeof this.form_dedupe_value_scope&&this.form_dedupe_value_scope(),"function"==typeof this.form_checkbox_min_max&&this.form_checkbox_min_max(),"function"==typeof this.form_checkbox_select_all&&this.form_checkbox_select_all(),"function"==typeof this.form_radio_validation&&this.form_radio_validation(),this.form_character_word_count(),"function"==typeof this.form_tel&&this.form_tel(),"function"==typeof this.form_date&&this.form_date(),"function"==typeof this.form_color&&this.form_color(),"function"==typeof this.form_signature&&this.form_signature(),"function"==typeof this.form_ssn&&this.form_ssn(),this.form_honeypot(),"function"==typeof this.form_recaptcha&&this.form_recaptcha(),"function"==typeof this.form_hcaptcha&&this.form_hcaptcha(),"function"==typeof this.form_turnstile&&this.form_turnstile(),"function"==typeof this.form_captchafox&&this.form_captchafox(),"function"==typeof this.form_email&&this.form_email(),this.form_label(),this.form_css_var(),"function"==typeof this.form_legal&&this.form_legal(),"function"==typeof this.form_rating&&this.form_rating(),"function"==typeof this.form_google_map&&this.form_google_map(),"function"==typeof this.form_google_address&&this.form_google_address(),"function"==typeof this.form_google_route&&this.form_google_route(),"function"==typeof this.form_ecommerce&&this.form_ecommerce(),"function"==typeof this.form_file&&this.form_file(),"function"==typeof this.form_media_capture&&this.form_media_capture(),"function"==typeof this.form_conditional&&this.form_conditional(!0),"function"==typeof this.form_conversational&&this.form_conversational(),"function"==typeof this.form_progress&&this.form_progress(),this.form_help_value(),"function"==typeof this.form_textarea&&this.form_textarea(),"function"==typeof this.form_consent&&this.form_consent(),this.form_required(),this.form_inputmask(),"function"==typeof this.form_tracking&&this.form_tracking(),"function"==typeof this.form_password_visibility_toggle&&this.form_password_visibility_toggle(),"function"==typeof this.form_password_generate&&this.form_password_generate(),"function"==typeof this.form_password_strength_meter&&this.form_password_strength_meter(),this.form_credit_card(),this.form_transform(),this.form_bypass_enabled=!0,this.form_bypass(!1),this.form_validate_real_time(),"function"==typeof this.form_validate_field&&this.form_validate_field("init"),"function"==typeof this.form_calc&&this.form_calc(),this.form_stat(),"function"==typeof this.form_cascade&&this.form_cascade(),"function"==typeof this.form_geo&&this.form_geo(),"function"==typeof this.form_tab_validation&&this.form_tab_validation(),this.form_accessibility(),"function"==typeof this.section_repeatable_hidden_field&&this.section_repeatable_hidden_field(),this.log("debug_form_rendered"),"function"==typeof this.form_loader_hide&&this.form_loader_hide(!1),this.trigger("rendered"),this.form_obj.attr("data-wsf-rendered",""),"function"==typeof this.styler&&this.styler(),"function"==typeof this.styler_scheme&&this.styler_scheme(!this.visual_editor,!0)},t.WS_Form.prototype.form_timer=function(){this.date_start=this.cookie_get("date_start",!1),(!1===this.date_start||isNaN(this.date_start)||""==this.date_start)&&(this.date_start=(new Date).getTime(),"on"==this.get_object_meta_value(this.form,"tracking_duration","")&&this.cookie_set("date_start",this.date_start,!1))},t.WS_Form.prototype.form_timer_reset=function(){this.date_start=!1,"on"==this.get_object_meta_value(this.form,"tracking_duration","")&&this.cookie_set("date_start","",!1)},t.WS_Form.prototype.trigger=function(e){var i="wsf-"+e;t(document).trigger(i,[this.form,this.form_id,this.form_instance_id,this.form_obj,this.form_canvas_obj,this.group_index]),this.log("log_trigger",i,"event");var a="wsf-"+e+"-instance-"+this.form_instance_id;t(window).trigger(a);var o="wsf-"+e+"-form-"+this.form_id;t(window).trigger(o)},t.WS_Form.prototype.form_framework=function(){if(void 0!==this.framework.form.public&&"object"==typeof this.framework.form.public.attributes)for(var e in this.framework.form.public.attributes){var i=this.framework.form.public.attributes[e];this.form_obj.attr(e,i)}if(void 0!==this.framework.init_js){var a={form_canvas_selector:"#"+this.form_obj_id},o=this.mask_parse(this.framework.init_js,a);try{t.globalEval("(function($){\n"+o+"\n})(jQuery);")}catch(t){this.error("error_js",o)}}},t.WS_Form.prototype.form_reset=function(e){var i=this;for(var a in this.trigger("reset-before"),this.form_canvas_obj.removeClass(this.class_validated),this.form_obj[0].reset(),this.field_data_cache)if(this.field_data_cache.hasOwnProperty(a)){var o=this.field_data_cache[a],r=o.id,s=this.field_name_prefix+r,_=t.WS_Form.field_type_cache[o.type],n=void 0!==_.trigger?_.trigger:"change",c=t('[name="'+this.esc_selector(s)+'"], [name^="'+this.esc_selector(s)+'["]',this.form_canvas_obj);switch(o.type){case"textarea":c.each(function(){"function"==typeof i.textarea_set_value&&i.textarea_set_value(t(this),t(this).val()),t(this).trigger(n)});break;case"color":c.each(function(){t(this).trigger(n),"undefined"!=typeof Coloris&&t(this)[0].dispatchEvent(new Event("input",{bubbles:!0}))});break;case"file":c.each(function(){t(this).trigger(n)}),"function"==typeof i.form_file_dropzonejs_populate&&"undefined"!=typeof Dropzone&&t('[name="'+this.esc_selector(s)+'"][data-file-type="dropzonejs"], [name^="'+this.esc_selector(s)+'["][data-file-type="dropzonejs"]',this.form_canvas_obj).each(function(){i.form_file_dropzonejs_populate(t(this),!1)});break;default:c.each(function(){t(this).trigger(n)})}}"function"==typeof this.signatures_clear&&this.signatures_clear(),"function"==typeof this.recaptcha_reset&&this.recaptcha_reset(),"function"==typeof this.hcaptcha_reset&&this.hcaptcha_reset(),"function"==typeof this.turnstile_reset&&this.turnstile_reset(),"function"==typeof this.captchafox_reset&&this.captchafox_reset(),"function"==typeof this.form_conditional&&this.form_conditional(),this.trigger("reset-complete")},t.WS_Form.prototype.form_clear=function(){var e=this;for(var i in this.trigger("clear-before"),this.form_canvas_obj.removeClass(this.class_validated),this.field_data_cache)if(this.field_data_cache.hasOwnProperty(i)){var a=this.field_data_cache[i],o=a.id,r=this.field_name_prefix+o,s=t.WS_Form.field_type_cache[a.type],_=void 0!==s.trigger?s.trigger:"change",n=t('[name="'+this.esc_selector(r)+'"], [name^="'+this.esc_selector(r)+'["]',this.form_canvas_obj);switch(a.type){case"checkbox":case"price_checkbox":case"radio":case"price_radio":n.each(function(){t(this).is(":checked")&&t(this).prop("checked",!1).trigger(_)});break;case"select":case"price_select":t('[name="'+this.esc_selector(r)+'"], [name^="'+this.esc_selector(r)+'["] option',this.form_canvas_obj).each(function(){t(this).is(":selected")&&(t(this).prop("selected",!1),t(this).closest("select").trigger(_))});break;case"textarea":n.each(function(){""!=t(this).val()&&(t(this).val("").trigger(_),"function"==typeof e.textarea_set_value&&e.textarea_set_value(t(this),""))});break;case"color":n.each(function(){""!=t(this).val()&&(t(this).val("").trigger(_),"undefined"!=typeof Coloris&&t(this)[0].dispatchEvent(new Event("input",{bubbles:!0})))});break;case"file":n.each(function(){""!=t(this).val()&&t(this).val("").trigger(_)}),"function"==typeof e.form_file_dropzonejs_populate&&"undefined"!=typeof Dropzone&&t('[name="'+this.esc_selector(r)+'"][data-file-type="dropzonejs"], [name^="'+this.esc_selector(r)+'["][data-file-type="dropzonejs"]',this.form_canvas_obj).each(function(){e.form_file_dropzonejs_populate(t(this),!0)});break;default:n.each(function(){""!=t(this).val()&&t(this).val("").trigger(_)})}}"function"==typeof this.signatures_clear&&this.signatures_clear(),"function"==typeof this.recaptcha_reset&&this.recaptcha_reset(),"function"==typeof this.hcaptcha_reset&&this.hcaptcha_reset(),"function"==typeof this.turnstile_reset&&this.turnstile_reset(),"function"==typeof this.captchafox_reset&&this.captchafox_reset(),"function"==typeof this.form_conditional&&this.form_conditional(),this.trigger("clear-complete")},t.WS_Form.prototype.form_reload=function(){for(var e in this.form_events_reset)if(this.form_events_reset.hasOwnProperty(e)){var i=this.form_events_reset[e];i.obj.off(i.event)}this.form_obj.off(),this.form_canvas_obj.off(),this.form_events_reset=[],this.calc=[];var a=this;""!=this.hash?t.WS_Form.this.api_call("submit/hash/"+this.hash,"GET",!1,function(t){a.submit=t.data,a.form_reload_after_get_submit(!0),a.submit=!1},function(t){a.form_reload_after_get_submit(!1)}):(this.submit=!1,this.form_reload_after_get_submit(!1))},t.WS_Form.prototype.form_reload_after_get_submit=function(e){t('[data-wsf-message][data-wsf-instance-id="'+this.form_instance_id+'"]').remove(),this.form_canvas_obj.show(),this.form_canvas_obj.removeClass(this.class_validated),this.form_validation_real_time_hooks=[],this.form_canvas_obj.empty(),"function"==typeof this.form_loader&&this.form_loader(),"function"==typeof this.form_loader_show&&this.form_loader_show("render"),this.form_build()},t.WS_Form.prototype.form_hash_clear=function(){this.hash="",this.cookie_clear("hash"),t.WS_Form.debug_rendered&&(this.debug_info("debug_info_hash",this.language("debug_hash_empty")),this.debug_info("debug_info_submit_count",0)),this.log("log_hash_clear")},t.WS_Form.prototype.form_transform=function(){var e=this;t("[data-wsf-transform]:not([data-wsf-transform-init])",this.form_canvas_obj).each(function(){t(this).attr("data-wsf-transform-init","");var i=t(this).attr("data-wsf-transform");t(this).on("change input",function(){e.form_transform_process(t(this),i)}),e.form_transform_process(t(this),i)})},t.WS_Form.prototype.form_transform_process=function(t,e){var i=t.val();switch(t.attr("type")){case"email":var a=!1;break;default:a=!0}if(i&&"string"==typeof i){if(a)var o=t[0].selectionStart,r=t[0].selectionEnd;switch(e){case"uc":t.val(i.toUpperCase());break;case"lc":t.val(i.toLowerCase());break;case"capitalize":t.val(this.ucwords(i.toLowerCase()));break;case"sentence":t.val(this.ucfirst(i.toLowerCase()))}a&&t[0].setSelectionRange(o,r)}},t.WS_Form.prototype.form_credit_card=function(){t("input[data-credit-card]:not([data-init-credit-card])",this.form_canvas_obj).each(function(){t(this).attr("data-init-credit-card",""),t(this).on("input",function(){if(void 0!==t(this).inputmask){var e,i=t(this).val().replace(/\D/g,"");e=/^3[47]\d{0,13}$/.test(i)?"9999 999999 99999":/^3(?:0[0-5]|[68]\d)\d{0,11}$/.test(i)?"9999 999999 9999":/^\d{0,16}$/.test(i)?"9999 9999 9999 9999":"remove",t(this).attr("data-currentmask")!=e&&(t(this).attr("data-currentmask",e),t(this).inputmask(e,{placeholder:"",clearMaskOnLostFocus:!1}))}})})},t.WS_Form.prototype.form_email=function(){var e=this;t('input[type="email"]:not([data-init-email])',this.form_canvas_obj).each(function(){var i=e.get_field(t(this)),a=e.get_object_meta_value(i,"allow_deny",""),o=e.get_object_meta_value(i,"allow_deny_values",[]);""!==a&&-1!==["allow","deny"].indexOf(a)&&"object"==typeof o&&(e.form_email_allow_deny(t(this)),t(this).on("change",function(){e.form_email_allow_deny(t(this))})),t(this).attr("data-init-email","")})},t.WS_Form.prototype.form_email_allow_deny=function(t){var e=t.val();if(""!=e){var i=this.get_field(t),a=this.get_object_meta_value(i,"allow_deny",""),o=this.get_object_meta_value(i,"allow_deny_values",[]),r="deny"===a;for(var s in o)if(o.hasOwnProperty(s)){var _=o[s].allow_deny_value;new RegExp(_.replace("*",".*")+"$").test(e)&&(r="allow"===a)}if(r)this.set_invalid_feedback(t,"");else{var n=this.get_object_meta_value(i,"allow_deny_message","");n||(n=this.language("error_email_allow_deny_message")),this.set_invalid_feedback(t,n)}}},t.WS_Form.prototype.form_navigation=function(){var e=this,i=this.get_group_count();t('[data-action="wsf-tab_next"]',this.form_canvas_obj).each(function(){t(this).off("click");var a=t(this).closest("[data-group-index]").nextAll(":not([data-wsf-group-hidden])").first();i<=1||!a.length?t(this).prop("disabled",!0).attr("data-wsf-disabled",""):void 0!==t(this).attr("data-wsf-disabled")&&t(this).prop("disabled",!1).removeAttr("data-wsf-disabled"),void 0===t(this).attr("disabled")&&t(this).on("click",function(){var i=e.get_object_meta_value(e.form,"tab_validation"),o=e.get_object_meta_value(e.form,"tab_validation_show");if(i&&o){var r=e.get_group(t(this));r&&void 0===r.attr("data-wsf-validated")?(r.addClass(e.class_validated),e.form_accessibility(),e.get_object_meta_value(e.form,"invalid_field_focus",!0)&&e.get_field_elements(r).each(function(){if(e.is_invalid(t(this)))return t(this).focus().trigger("focus"),!1})):(r.removeClass(this.class_validated),"function"==typeof e.form_tab_group_index_new&&e.form_tab_group_index_new(t(this),a.attr("data-group-index")))}else"function"==typeof e.form_tab_group_index_new&&e.form_tab_group_index_new(t(this),a.attr("data-group-index"))})}),t('[data-action="wsf-tab_previous"]',this.form_canvas_obj).each(function(){t(this).off("click");var a=t(this).closest("[data-group-index]").prevAll(":not([data-wsf-group-hidden])").first();i<=1||!a.length?t(this).prop("disabled",!0).attr("data-wsf-disabled",""):void 0!==t(this).attr("data-wsf-disabled")&&t(this).prop("disabled",!1).removeAttr("data-wsf-disabled"),void 0===t(this).attr("disabled")&&"function"==typeof e.form_tab_group_index_new&&t(this).on("click",function(){e.form_tab_group_index_new(t(this),a.attr("data-group-index"))})}),this.form_canvas_obj.off("click",'[data-action="wsf-save"]').on("click",'[data-action="wsf-save"]',function(){var i=e.get_field(t(this));void 0!==i&&(e.get_object_meta_value(i,"validate_form","")?e.form_post_if_validated("save"):e.form_post("save"))}),this.form_canvas_obj.off("click",'[data-action="wsf-reset"]').on("click",'[data-action="wsf-reset"]',function(t){t.preventDefault(),e.form_reset()}),this.form_canvas_obj.off("click",'[data-action="wsf-clear"]').on("click",'[data-action="wsf-clear"]',function(){e.form_clear()})},t.WS_Form.prototype.get_group_index=function(t){var e=this.get_group(t);if(!1===e)return!1;var i=e.first().attr("data-group-index");return null!=i&&parseInt(i,10)},t.WS_Form.prototype.get_group_count=function(){t(".wsf-group-tabs",this.form_canvas_obj).children(":not([data-wsf-group-hidden])").length},t.WS_Form.prototype.get_group=function(t){if(this.get_group_count()<=1)return!1;var e=t.closest("[data-group-index]");return 0!=e.length&&e},t.WS_Form.prototype.get_group_id=function(t){var e=t.closest("[data-id]").attr("data-id");return void 0!==e&&parseInt(e,10)},t.WS_Form.prototype.get_section=function(t){var e=t.closest("fieldset");return 0!=e.length&&e},t.WS_Form.prototype.get_section_id=function(t){var e=t.closest('[id^="'+this.form_id_prefix+'section-"]').attr("data-id");return void 0!==e&&parseInt(e,10)},t.WS_Form.prototype.get_section_repeatable_index=function(t){var e=t.closest('[id^="'+this.form_id_prefix+'section-"]').attr("data-repeatable-index");return e>0?parseInt(e,10):0},t.WS_Form.prototype.get_section_repeatable_suffix=function(t){var e=this.get_section_repeatable_index(t);return e?"-repeat-"+e:""},t.WS_Form.prototype.get_field_elements=function(e){return t("input,select,textarea",e).filter(':not([data-hidden],[data-hidden-section],[data-hidden-group],[disabled],[type="hidden"])')},t.WS_Form.prototype.get_field=function(t){var e=this.get_field_id(t);return!!e&&this.field_data_cache[e]},t.WS_Form.prototype.get_field_wrapper=function(t){return t.closest("[data-id]")},t.WS_Form.prototype.get_field_id=function(t){var e;return(e=t.closest("[data-type][data-id]").attr("data-id"))?parseInt(e,10):!!(e=t.attr("data-id-hidden"))&&parseInt(e,10)},t.WS_Form.prototype.get_field_type=function(t){var e=t.closest("[data-type]").attr("data-type");return void 0!==e&&e},t.WS_Form.prototype.get_field_object_row_id=function(t){var e=t.closest("[data-row-radio][data-row-id],[data-row-checkbox][data-row-id]");if(0==e.length)return!1;var i=e.attr("data-row-id");return void 0!==i&&parseInt(i,10)},t.WS_Form.prototype.get_label_obj=function(e){var i=this.get_field_id(e),a=this.get_section_repeatable_suffix(e);return t("#"+this.form_id_prefix+"label-"+i+a,this.form_canvas_obj)},t.WS_Form.prototype.get_checkbox_min_max_obj=function(e){var i=this.get_field_id(e),a=this.get_section_repeatable_suffix(e);return t("#"+this.form_id_prefix+"checkbox-min-max-"+i+a,this.form_canvas_obj)},t.WS_Form.prototype.get_checkbox_row_count=function(e){var i=this.get_field_wrapper(e),a=t('[data-row-checkbox]:not([style*="display: none"]) input:not([data-hidden],[data-hidden-section],[data-hidden-group])',i);return a?a.length:0},t.WS_Form.prototype.get_radio_row_count=function(e){var i=this.get_field_wrapper(e),a=t('[data-row-radio]:not([style*="display: none"]) input:not([data-hidden],[data-hidden-section],[data-hidden-group])',i);return a?a.length:0},t.WS_Form.prototype.get_help_obj=function(e){var i=this.get_field_id(e),a=this.get_section_repeatable_suffix(e);return t("#"+this.form_id_prefix+"help-"+i+a,this.form_canvas_obj)},t.WS_Form.prototype.get_invalid_feedback_obj=function(e,i){return t("#"+this.get_invalid_feedback_id(e,i))},t.WS_Form.prototype.get_invalid_feedback_id=function(t,e){var i=this.get_field_id(t),a=this.get_section_repeatable_suffix(t),o=e?"-row-"+e:"";return this.form_id_prefix+"invalid-feedback-"+i+o+a},t.WS_Form.prototype.get_invalid_feedback=function(t){return!(!t.length||void 0===t[0].validationMessage)&&t[0].validationMessage},t.WS_Form.prototype.set_invalid_feedback=function(t,e,i){this.is_not_number(i)&&(i=0),"object"==typeof i&&void 0!==i[0]&&(i=i[0]);var a=this.get_invalid_feedback_obj(t,i),o=this.get_section_id(t),r=this.get_section_repeatable_index(t),s=this.get_field_id(t);!1===e&&(e=a.html()),t.length&&t[0].willValidate&&(""!==e?(void 0===this.validation_message_cache[o]&&(this.validation_message_cache[o]=[]),void 0===this.validation_message_cache[o][r]&&(this.validation_message_cache[o][r]=[]),void 0===this.validation_message_cache[o][r][s]&&(this.validation_message_cache[o][r][s]=[]),this.validation_message_cache[o][r][s][i]=e):void 0!==this.validation_message_cache[o]&&void 0!==this.validation_message_cache[o][r]&&void 0!==this.validation_message_cache[o][r][s]&&void 0!==this.validation_message_cache[o][r][s][i]&&delete this.validation_message_cache[o][r][s][i],t[0].setCustomValidity(e),this.form_validate_real_time_process(!1,!1)),a.length&&(""!==e?(void 0===this.invalid_feedback_cache[o]&&(this.invalid_feedback_cache[o]=[]),void 0===this.invalid_feedback_cache[o][r]&&(this.invalid_feedback_cache[o][r]=[]),void 0===this.invalid_feedback_cache[o][r][s]&&(this.invalid_feedback_cache[o][r][s]=[]),void 0===this.invalid_feedback_cache[o][r][s][i]&&(this.invalid_feedback_cache[o][r][s][i]=a.html()),a.html(e)):void 0!==this.invalid_feedback_cache[o]&&void 0!==this.invalid_feedback_cache[o][r]&&void 0!==this.invalid_feedback_cache[o][r][s]&&void 0!==this.invalid_feedback_cache[o][r][s][i]&&(a.html(this.invalid_feedback_cache[o][r][s][i]),delete this.invalid_feedback_cache[o][r][s][i]))},t.WS_Form.prototype.form_preview=function(){this.form_canvas_obj[0].hasAttribute("data-preview")&&this.form_add_hidden_input("wsf_preview","true")},t.WS_Form.prototype.form_honeypot=function(){if(this.get_object_meta_value(this.form,"honeypot",!1)){var e=""!=this.form.published_checksum?this.form.published_checksum:"honeypot_unpublished_"+this.form_id,i=t.WS_Form.settings_plugin.framework,a=(t.WS_Form.frameworks.types[i],this.framework.fields.public),o=void 0!==a.honeypot_attributes?" "+a.honeypot_attributes.join(" "):"",r='<label for="field_'+e+'" aria-hidden="true" style="position: absolute !important; '+(ws_form_settings.rtl?"right":"left")+': -9999em !important; height: 0 !important; margin: 0 !important; padding: 0 !important;">'+this.esc_html(e)+'<input type="text" id="field_'+this.esc_attr(e)+'" name="field_'+this.esc_attr(e)+'" value="" autocomplete="off" tab-index="-1" style="display: none !important;"'+o+"></label>";this.form_canvas_obj.append(r),this.log("log_honeypot","","spam-protect")}},t.WS_Form.prototype.get_css_var=function(t,e){void 0===e&&(e="");var i=getComputedStyle(this.form_obj[0]);if(!i)return e;var a=i.getPropertyValue(t);return void 0===a?e:a.trim()},t.WS_Form.prototype.form_css_var=function(){switch(this.get_css_var("--wsf-field-label-inside-mode","move")){case"hide":this.form_obj.addClass("wsf-label-position-inside-hide")}switch(this.get_css_var("--wsf-field-border-placement","all")){case"bottom":this.form_obj.addClass("wsf-field-border-placement-bottom")}},t.WS_Form.prototype.form_label=function(e){void 0===e&&(e=this.form_canvas_obj);var i=this;t(".wsf-label-position-inside:not([wsf-label-position-inside-init]):visible",e).each(function(){var e=t(".wsf-input-group-prepend",t(this)),a=t(".iti",t(this));if(e.length&&!a.length){var o=t("label",t(this)),r=parseFloat(o.css("left").replace("px",""))+e.outerWidth();o.css("left",r+"px")}var s=i.get_help_obj(t(this));if(s.length){var _=i.get_field_id(t(this)),n=i.field_data_cache[_];if("top"==i.get_help_position(n)){var c=parseFloat(s.outerHeight()),d=parseFloat(s.css("margin-bottom")),h=(o=i.get_label_obj(t(this)),parseFloat(o.css("top")));h+=c+d,o.css("top",h+"px")}}t(this).attr("wsf-label-position-inside-init","")})},t.WS_Form.prototype.form_required=function(){var e=this;if(!this.get_object_meta_value(this.form,"label_required",!1))return!1;if(""==(i=this.get_object_meta_value(this.form,"label_mask_required","",!0,!0))){var i,a=t.WS_Form.settings_plugin.framework,o=(t.WS_Form.frameworks.types[a],this.framework.fields.public);if(void 0===o.mask_required_label)return!1;if(""==(i=o.mask_required_label))return!1}t("label",this.form_canvas_obj).each(function(){var a=t(this).attr("for");if(void 0!==a){if(!(r=t('[id="'+e.esc_selector(a)+'"]',e.form_canvas_obj)).length)return;if(void 0!==r.attr("data-init-required"))return;var o=void 0!==r.attr("data-required")}else{var r;if(!(r=e.get_checkbox_min_max_obj(t(this))).length)return;o=void 0!==r.attr("min")&&parseInt(r.attr("min"),10)>0}var s=t(this).attr("data-label-required-id");if(void 0!==s&&!1!==s)var _=t("#"+s,e.form_canvas_obj);else _=t(this);var n=t(".wsf-required-wrapper",_);if(!n.length&&o){var c=_.children("div,[name]").first();c.length?c.before('<span class="wsf-required-wrapper"></span>'):_.append('<span class="wsf-required-wrapper"></span>'),n=t(".wsf-required-wrapper",_)}o?(n.html(i),r.attr("data-init-required","")):(n.html(""),r.removeAttr("data-init-required"))})},t.WS_Form.prototype.form_bypass=function(e){if(!this.form_bypass_enabled)return!1;var i=this;t('input[type="number"]:not([step]):not([data-step-bypass])',this.form_canvas_obj).attr("step",1);var a=this.form_bypass_attributes();for(var o in a)if(a.hasOwnProperty(o)){var r=a[o],s=r.bypass,_=r.not,n=void 0!==r.replace&&r.replace;t("["+s+"-group]",this.form_canvas_obj).length&&t('[id^="'+this.form_id_prefix+'group-"]:not([data-wsf-group-hidden]) ['+s+"-group]:not("+_+")",this.form_canvas_obj).attr(o,function(){return t(this).attr(s+"-group")}).removeAttr(s+"-group"),t("["+o+"]",this.form_canvas_obj).length&&t('[id^="'+this.form_id_prefix+'group-"][data-wsf-group-hidden] ['+o+"]:not("+_+",["+s+'-group]), [id^="'+this.form_id_prefix+'group-"][data-wsf-group-hidden] ['+o+"]:not("+_+",["+s+"-group])").attr(s+"-group",function(){return i.form_bypass_hidden(t(this),o,n)}),t("["+s+"]",this.form_canvas_obj).length&&t('[id^="'+this.form_id_prefix+'group-"][data-wsf-group-hidden] ['+s+"]:not("+_+'), [id^="'+this.form_id_prefix+'group-"][data-wsf-group-hidden] ['+s+"]:not("+_+")").attr(s+"-group",function(){return i.form_bypass_visible(t(this),s)}).removeAttr(s),t("["+s+"-section]",this.form_canvas_obj).length&&t('[id^="'+this.form_id_prefix+'section-"]:not([style*="display:none"],[style*="display: none"]) ['+s+"-section]:not("+_+")",this.form_canvas_obj).attr(o,function(){return t(this).attr(s+"-section")}).removeAttr(s+"-section"),t("["+o+"]",this.form_canvas_obj).length&&t('[id^="'+this.form_id_prefix+'section-"][style*="display:none"] ['+o+"]:not("+_+",["+s+'-section]), [id^="'+this.form_id_prefix+'section-"][style*="display: none"] ['+o+"]:not("+_+",["+s+"-section])").attr(s+"-section",function(){return i.form_bypass_hidden(t(this),o,n)}),t("["+s+"]",this.form_canvas_obj).length&&t('[id^="'+this.form_id_prefix+'section-"][style*="display:none"] ['+s+"]:not("+_+'), [id^="'+this.form_id_prefix+'section-"][style*="display: none"] ['+s+"]:not("+_+")").attr(s+"-section",function(){return i.form_bypass_visible(t(this),s)}).removeAttr(s),t("["+s+"]",this.form_canvas_obj).length&&t('[id^="'+this.form_id_prefix+'field-wrapper-"]:not([style*="display:none"],[style*="display: none"]) ['+s+"]:not("+_+")",this.form_canvas_obj).attr(o,function(){return i.form_bypass_visible(t(this),s)}).removeAttr(s),t("["+o+"]",this.form_canvas_obj).length&&t('[id^="'+this.form_id_prefix+'field-wrapper-"][style*="display:none"] ['+o+"]:not("+_+",["+s+']), [id^="'+this.form_id_prefix+'field-wrapper-"][style*="display: none"] ['+o+"]:not("+_+",["+s+"])",this.form_canvas_obj).attr(s,function(){return i.form_bypass_hidden(t(this),o,n)}),t("["+s+"]",this.form_canvas_obj).length&&t('[id^="'+this.form_id_prefix+'field-wrapper-"]:not([style*="display:none"],[style*="display: none"]) [data-row-checkbox]:not([style*="display:none"],[style*="display: none"]) > input[type="checkbox"] ['+s+"]:not("+_+")",this.form_canvas_obj).attr(o,function(){return i.form_bypass_visible(t(this),s)}).removeAttr(s),t("["+o+"]",this.form_canvas_obj).length&&t('[id^="'+this.form_id_prefix+'field-wrapper-"] [data-row-checkbox][style*="display:none"] > input[type="checkbox"]['+o+"]:not("+_+",["+s+']), [id^="'+this.form_id_prefix+'field-wrapper-"] [data-row-checkbox][style*="display: none"] > input[type="checkbox"]['+o+"]:not("+_+",["+s+"])",this.form_canvas_obj).attr(s,function(){return i.form_bypass_hidden(t(this),o,n)}),t("["+s+"]",this.form_canvas_obj).length&&t('[id^="'+this.form_id_prefix+'field-wrapper-"]:not([style*="display:none"],[style*="display: none"]) [data-row-radio]:not([style*="display:none"],[style*="display: none"]) > input[type="radio"] ['+s+"]:not("+_+")",this.form_canvas_obj).attr(o,function(){return i.form_bypass_visible(t(this),s)}).removeAttr(s),t("["+o+"]",this.form_canvas_obj).length&&t('[id^="'+this.form_id_prefix+'field-wrapper-"] [data-row-radio][style*="display:none"] > input[type="radio"]['+o+"]:not("+_+",["+s+']), [id^="'+this.form_id_prefix+'field-wrapper-"] [data-row-radio][style*="display: none"] > input[type="radio"]['+o+"]:not("+_+",["+s+"])",this.form_canvas_obj).attr(s,function(){return i.form_bypass_hidden(t(this),o,n)})}return t('[id^="'+this.form_id_prefix+'group-"]:not([data-wsf-group-hidden])',this.form_canvas_obj).find('[name]:not([type="hidden"]),[data-static],[data-recaptcha],[data-hcaptcha],[data-turnstile],[data-captchafox]').each(function(){i.form_bypass_process(t(this),"-group",!1)}),t('[id^="'+this.form_id_prefix+'group-"][data-wsf-group-hidden]',this.form_canvas_obj).find('[name]:not([type="hidden"]),[data-static],[data-recaptcha],[data-hcaptcha],[data-turnstile],[data-captchafox]').each(function(){i.form_bypass_process(t(this),"-group",!0)}),t('[id^="'+this.form_id_prefix+'section-"]:not([style*="display:none"],[style*="display: none"])',this.form_canvas_obj).find('[name]:not([type="hidden"],[data-hidden-group]),[data-static],[data-recaptcha],[data-hcaptcha],[data-turnstile],[data-captchafox]').each(function(){i.form_bypass_process(t(this),"-section",!1)}),t('[id^="'+this.form_id_prefix+'section-"][style*="display:none"], [id^="'+this.form_id_prefix+'section-"][style*="display: none"]').find('[name]:not([type="hidden"]),[data-static],[data-recaptcha],[data-hcaptcha],[data-turnstile],[data-captchafox]').each(function(){i.form_bypass_process(t(this),"-section",!0)}),t('[id^="'+this.form_id_prefix+'field-wrapper-"]:not([style*="display:none"],[style*="display: none"])',this.form_canvas_obj).find('[name]:not([type="hidden"],[data-hidden-section],[data-hidden-group]),[data-static],[data-recaptcha],[data-hcaptcha],[data-turnstile],[data-captchafox]').each(function(){i.form_bypass_process(t(this),"",!1)}),t('[id^="'+this.form_id_prefix+'field-wrapper-"][style*="display:none"], [id^="'+this.form_id_prefix+'field-wrapper-"][style*="display: none"]',this.form_canvas_obj).find('[name]:not([type="hidden"]),[data-static],[data-recaptcha],[data-hcaptcha],[data-turnstile],[data-captchafox]').each(function(){i.form_bypass_process(t(this),"",!0)}),t('[id^="'+this.form_id_prefix+'field-wrapper-"]:not([style*="display:none"],[style*="display: none"]) [data-row-checkbox]:not([style*="display:none"],[style*="display: none"]) input[type="checkbox"]',this.form_canvas_obj).each(function(){i.form_bypass_process(t(this),"",!1)}),t('[id^="'+this.form_id_prefix+'field-wrapper-"] [data-row-checkbox][style*="display:none"] input[type="checkbox"], [id^="'+this.form_id_prefix+'field-wrapper-"] [data-row-checkbox][style*="display: none"] input[type="checkbox"]',this.form_canvas_obj).each(function(){i.form_bypass_process(t(this),"",!0)}),t('[id^="'+this.form_id_prefix+'field-wrapper-"]:not([style*="display:none"],[style*="display: none"]) [data-row-radio]:not([style*="display:none"],[style*="display: none"]) input[type="radio"]',this.form_canvas_obj).each(function(){i.form_bypass_process(t(this),"",!1)}),t('[id^="'+this.form_id_prefix+'field-wrapper-"] [data-row-radio][style*="display:none"] input[type="radio"], [id^="'+this.form_id_prefix+'field-wrapper-"] [data-row-radio][style*="display: none"] input[type="radio"]',this.form_canvas_obj).each(function(){i.form_bypass_process(t(this),"",!0)}),"function"==typeof this.form_progress_process&&this.form_progress_process(),this.has_ecommerce&&"function"==typeof this.form_ecommerce_calculate&&this.form_ecommerce_calculate(),this.form_validate_real_time_process(e,!1),!0},t.WS_Form.prototype.form_bypass_attributes=function(){return{required:{bypass:"data-required-bypass",not:'[type="hidden"]'},"aria-required":{bypass:"data-aria-required-bypass",not:'[type="hidden"]'},min:{bypass:"data-min-bypass",not:'[type="hidden"],[type="range"]'},max:{bypass:"data-max-bypass",not:'[type="hidden"],[type="range"]'},minlength:{bypass:"data-minlength-bypass",not:'[type="hidden"]'},maxlength:{bypass:"data-maxlength-bypass",not:'[type="hidden"]'},pattern:{bypass:"data-pattern-bypass",not:'[type="hidden"]'},step:{bypass:"data-step-bypass",not:'[type="hidden"],[type="range"]',replace:"any"},"data-ecommerce-price":{bypass:"data-ecommerce-price-bypass",not:"[data-ecommerce-persist]"},"data-ecommerce-cart-price":{bypass:"data-ecommerce-cart-price-bypass",not:"[data-ecommerce-persist]"}}},t.WS_Form.prototype.form_bypass_obj_reset=function(t){var e=this.form_bypass_attributes();for(var i in e)if(e.hasOwnProperty(i)){var a=e[i].bypass;t.attr(a+"-group")&&t.attr(i,t.attr(a+"-group")).removeAttr(a+"-group"),t.attr(a+"-section")&&t.attr(i,t.attr(a+"-section")).removeAttr(a+"-section"),t.attr(a)&&t.attr(i,t.attr(a)).removeAttr(a)}},t.WS_Form.prototype.form_bypass_hidden=function(t,e,i){var a=t.attr(e);return i?t.attr(e,i):t.removeAttr(e),a},t.WS_Form.prototype.form_bypass_visible=function(t,e){return t.attr(e)},t.WS_Form.prototype.form_bypass_process=function(t,e,i){var a=this.get_section_id(t),o=this.get_section_repeatable_index(t),r=this.get_field_id(t),s=this.get_field_object_row_id(t);s||(s=0);var _=t[0];i?(_.willValidate&&_.validity&&_.validity.customError&&""!==_.validationMessage&&(void 0===this.validation_message_cache[a]&&(this.validation_message_cache[a]=[]),void 0===this.validation_message_cache[a][o]&&(this.validation_message_cache[a][o]=[]),void 0===this.validation_message_cache[a][o][r]&&(this.validation_message_cache[a][o][r]=[]),this.validation_message_cache[a][o][r][s]=_.validationMessage,_.setCustomValidity("")),t.attr("data-hidden"+e,"")):(_.willValidate&&void 0!==this.validation_message_cache[a]&&void 0!==this.validation_message_cache[a][o]&&void 0!==this.validation_message_cache[a][o][r]&&void 0!==this.validation_message_cache[a][o][r][s]&&(_.setCustomValidity(this.validation_message_cache[a][o][r][s]),delete this.validation_message_cache[a][o][r][s]),t.removeAttr("data-hidden"+e))},t.WS_Form.prototype.form_inputmask=function(){var e=this;t("[data-inputmask]",this.form_canvas_obj).each(function(){void 0!==t(this).inputmask&&(t(this).inputmask().off("invalid"),void 0!==t(this).attr("data-inputmask-validate")&&(t(this).on("change input",function(){e.form_inputmask_validate(t(this))}),e.form_inputmask_validate(t(this))))})},t.WS_Form.prototype.form_inputmask_validate=function(t){t.inputmask("isComplete")?this.set_invalid_feedback(t,""):this.set_invalid_feedback(t)},t.WS_Form.prototype.form_validation=function(){var t=this;this.get_object_meta_value(this.form,"submit_on_enter",!1)||(this.form_obj.on("keydown",":input:not(textarea)",function(t){if(13==t.keyCode)return t.preventDefault(),!1}),this.form_events_reset.push({obj:this.form_obj,event:"keydown"})),this.form_obj.on("submit",function(e){e.preventDefault(),e.stopPropagation(),t.form_post_if_validated("submit")}),this.form_events_reset.push({obj:this.form_obj,event:"submit"})},t.WS_Form.prototype.form_post_if_validated=function(t){this.trigger(t+"-before"),this.form_post_locked||(this.has_ecommerce&&"function"==typeof this.form_ecommerce_calculate&&this.form_ecommerce_calculate(),this.form_canvas_obj.addClass(this.class_validated),this.form_validate(this.form_obj)?(this.trigger(t+"-validate-success"),this.recaptchas_v2_invisible.length>0?this.recaptcha_v2_invisible_execute():this.recaptchas_v3_default.length>0?this.recaptcha_v3_default_execute():this.hcaptchas_invisible.length>0?this.hcaptcha_invisible_execute():this.captchafoxes_invisible.length>0?this.captchafox_invisible_execute():this.form_post(t)):("function"==typeof this.form_validate_field&&this.form_validate_field("submit"),this.trigger(t+"-validate-fail")))},t.WS_Form.prototype.form_validate=function(e){void 0===e&&(e=this.form_obj),this.trigger("validate-before");var i,a=!1,o=!1,r=e[0].checkValidity();if(!r){var s=this;this.get_field_elements(e).each(function(){if(s.is_invalid(t(this)))return o=t(this),!1}),!1!==o&&(a=this.get_group_index(o))}"function"==typeof this.form_validate_captcha&&("object"==typeof(i=this.form_validate_captcha(this.recaptchas_v2_default,"recaptcha",e))&&(r=!1,!1===o&&(o=i.object_focus),!1===a&&(a=i.group_index_focus)),"object"==typeof(i=this.form_validate_captcha(this.hcaptchas_default,"hcaptcha",e))&&(r=!1,!1===o&&(o=i.object_focus),!1===a&&(a=i.group_index_focus)),"object"==typeof(i=this.form_validate_captcha(this.turnstiles_default,"turnstile",e))&&(r=!1,!1===o&&(o=i.object_focus),!1===a&&(a=i.group_index_focus)),"object"==typeof(i=this.form_validate_captcha(this.captchafoxes_default,"captchafox",e))&&(r=!1,!1===o&&(o=i.object_focus),!1===a&&(a=i.group_index_focus)));return this.form_accessibility(),r||(!1!==o&&this.get_object_meta_value(this.form,"invalid_field_focus",!0)&&(!1!==a?this.object_focus=o:o.trigger("focus")),"function"==typeof this.form_tab_group_index_set&&!1!==a&&this.form_tab_group_index_set(a)),this.trigger("validate-after"),r},t.WS_Form.prototype.form_validate_real_time=function(){var e=this;for(var i in this.field_data_cache)if(this.field_data_cache.hasOwnProperty(i)){var a=this.field_data_cache[i].type,o=t.WS_Form.field_type_cache[a];if(void 0!==o.events){var r=o.events.event,s=this.field_data_cache[i].id,_=void 0!==o.submit_array&&o.submit_array;t('div[data-type][data-id="'+this.esc_selector(s)+'"],input[type="hidden"][data-id-hidden="'+this.esc_selector(s)+'"]',this.form_canvas_obj).each(function(){var i=t(this).attr("data-repeatable-index"),n=i>0?"["+i+"]":"",c=("hidden"==a?'input[type="hidden"]':"")+'[name="'+e.esc_selector(ws_form_settings.field_prefix+s+n)+(_?"[]":"")+'"]:not([data-init-validate-real-time])',d=t(c,"hidden"==a?e.form_canvas_obj:t(this));if(d.length){d.attr("data-init-validate-real-time","");var h=void 0!==o.event_validate_bypass&&o.event_validate_bypass;d.on(r+" blur",function(i){if(h||e.form_validate_real_time_process(!1,!1),"blur"!==i.type){var a=t(this).attr("id");a&&"function"==typeof e.form_calc&&e.form_calc(a)}})}})}}t("[data-wsf-section-validated-class]:not([data-wsf-section-validated-class-init])",this.form_canvas_obj).each(function(){t(this).attr("data-wsf-section-validated-class-init",""),t('input:not([type="hidden"]),textarea,select',t(this)).on("change blur",function(i){var a=t(this).closest("[data-wsf-section-validated-class]"),o=e.get_field_wrapper(t(this));if(o.length){var r=a.attr("data-wsf-section-validated-class");o.addClass(r).off(i)}})}),t("[data-wsf-field-validated-class]:not([data-wsf-field-validated-class-init])",this.form_canvas_obj).each(function(){t(this).attr("data-wsf-field-validated-class-init",""),t('input:not([type="hidden"]),textarea,select',t(this)).on("change blur",function(i){var a=e.get_field_wrapper(t(this));if(a.length){var o=a.attr("data-wsf-field-validated-class");a.addClass(o).removeAttr("data-wsf-field-validated-class data-wsf-field-validated-class-init").off(i)}})}),this.form_validate_real_time_process(!1,!0)},t.WS_Form.prototype.form_validate_real_time_process=function(t,e){for(var i in this.form_valid=this.form_validate_silent(this.form_obj),!e&&(null!==this.form_valid_old&&this.form_valid_old==this.form_valid||t)||this.form_canvas_obj.trigger("wsf-validate"),t||this.form_canvas_obj.trigger("wsf-validate-silent"),this.form_valid_old=this.form_valid,this.form_validation_real_time_hooks)if(this.form_validation_real_time_hooks.hasOwnProperty(i)){var a=this.form_validation_real_time_hooks[i];void 0===a?delete this.form_validation_real_time_hooks[i]:a(this.form_valid,this.form,this.form_id,this.form_instance_id,this.form_obj,this.form_canvas_obj)}return"function"==typeof this.form_validate_field&&this.form_validate_field("real_time"),this.form_valid},t.WS_Form.prototype.form_validate_real_time_register_hook=function(t){this.form_validation_real_time_hooks.push(t)},t.WS_Form.prototype.form_validate_silent=function(t){var e=t[0];if(this.form_accessibility(t),!e.checkValidity())return!1;if("function"==typeof this.form_validate_silent_captchas){if(!this.form_validate_silent_captchas(this.recaptchas_v2_default,"recaptcha",t))return!1;if(!this.form_validate_silent_captchas(this.hcaptchas_default,"hcaptcha",t))return!1;if(!this.form_validate_silent_captchas(this.turnstiles_default,"turnstile",t))return!1;if(!this.form_validate_silent_captchas(this.captchafoxes_default,"captchafox",t))return!1}return!0},t.WS_Form.prototype.form_accessibility=function(e){var i=this;void 0===e&&(e=this.form_canvas_obj);var a=e.is(this.selector_validated)?"":this.selector_validated+" ",o=t(a+"input,"+a+"select,"+a+"textarea",e).filter(':not([data-hidden],[data-hidden-section],[data-hidden-group],[disabled],[type="hidden"])');o.filter('[aria-invalid="true"]').each(function(){i.is_valid(t(this))&&(t(this).removeAttr("aria-invalid"),i.attribute_remove_item(t(this),"aria-describedby",i.get_invalid_feedback_id(t(this))),i.get_invalid_feedback_obj(t(this)).attr("aria-hidden","true"))}),o.filter(':not([aria-invalid="true"])').each(function(){i.is_invalid(t(this))&&(t(this).attr("aria-invalid","true"),i.attribute_add_item(t(this),"aria-describedby",i.get_invalid_feedback_id(t(this))),i.get_invalid_feedback_obj(t(this)).removeAttr("aria-hidden"))})},t.WS_Form.prototype.object_validate=function(e){var i=[];if(void 0===e)return!1;var a=this,o=!0;return this.get_field_elements(e).each(function(){var e=a.get_field(t(this)).type,r=a.get_section_repeatable_index(t(this)),s=r>0?"["+r+"]":"",_=ws_form_settings.field_prefix+a.get_field_id(t(this))+s,n=!1;switch(e){case"radio":case"price_radio":if(void 0!==i[_])return;n=t(this)[0].checkValidity();break;default:n=t(this)[0].checkValidity()}if(i[_]=!0,!n)return o=!1,!1}),o},t.WS_Form.prototype.hex_to_hsl=function(t){var e=this.hex_to_rgb(t);return!1!==e&&this.rgb_to_hsl(e)},t.WS_Form.prototype.hex_to_rgb=function(t){if(""==t)return!1;var e="#"==t[0];if(e&&7!=t.length)return!1;if(!e&&6!=t.length)return!1;t=e?t.substr(1):t;return{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16)}},t.WS_Form.prototype.rgb_to_hsl=function(t){if(void 0===t.r)return!1;if(void 0===t.g)return!1;if(void 0===t.b)return!1;var e=t.r,i=t.g,a=t.b;e/=255,i/=255,a/=255;var o,r,s=Math.max(e,i,a),_=Math.min(e,i,a),n=(s+_)/2;if(s==_)o=r=0;else{var c=s-_;switch(r=n>.5?c/(2-s-_):c/(s+_),s){case e:o=(i-a)/c+(i<a?6:0);break;case i:o=(a-e)/c+2;break;case a:o=(e-i)/c+4}o/=6}return{h:o,s:r,l:n}},t.WS_Form.prototype.group_fields_reset=function(t,e){if(void 0===this.group_data_cache[t])return!1;var i=this.group_data_cache[t];if(void 0===i.sections)return!1;var a=i.sections;for(var o in a)if(a.hasOwnProperty(o)){var r=a[o];this.section_fields_reset(r.id,e,!1)}},t.WS_Form.prototype.section_fields_reset=function(e,i,a){if(void 0===this.section_data_cache[e])return!1;var o=this.section_data_cache[e];if(void 0===o.fields)return!1;var r=o.fields;for(var s in r)if(r.hasOwnProperty(s)){var _=r[s],n=_.id;if(!1===a)var c='[id^="'+this.esc_selector(this.form_id_prefix+"field-wrapper-"+n)+'"][data-id="'+this.esc_selector(_.id)+'"]';else c="#"+this.form_id_prefix+"field-wrapper-"+n+"-repeat-"+a;var d=t(c,this.form_canvas_obj);this.field_reset(n,i,d)}},t.WS_Form.prototype.field_reset=function(e,i,a){var o=this;if(void 0===a&&(a=!1),void 0!==this.field_data_cache[e]){var r=this.field_data_cache[e],s=t.WS_Form.field_type_cache[r.type],_=void 0!==s.trigger?s.trigger:"change";switch(r.type){case"select":case"price_select":t("option",a).each(function(){var e=!i&&t(this).prop("defaultSelected"),a=t(this).prop("selected")!==e;t(this).prop("selected",e),a&&t(this).trigger(_)});break;case"checkbox":case"price_checkbox":t('input[type="checkbox"]',a).each(function(){var e=!i&&t(this).prop("defaultChecked"),a=t(this).prop("checked")!==e;t(this).prop("checked",e),a&&t(this).trigger(_)});break;case"radio":case"price_radio":t('input[type="radio"]',a).each(function(){var e=!i&&t(this).prop("defaultChecked"),a=t(this).prop("checked")!==e;t(this).prop("checked",e),a&&t(this).trigger(_)});break;case"textarea":t("textarea",a).each(function(){var e=i?"":t(this).prop("defaultValue"),a=t(this).val()!==e;t(this).val(e),"function"==typeof o.textarea_set_value&&o.textarea_set_value(t(this),e),a&&t(this).trigger("change")});break;case"color":t("input",a).each(function(){var e=i?"":t(this).prop("defaultValue"),a=t(this).val()!==e;t(this).val(e),a&&(t(this).trigger("change"),"undefined"!=typeof Coloris&&t(this)[0].dispatchEvent(new Event("input",{bubbles:!0})))});break;case"hidden":var n=i?"":a.attr("data-default-value"),c=a.val()!==n;a.val(n),c&&a.trigger(_);break;case"googlemap":t("input",a).each(function(){var e=i?"":t(this).attr("data-default-value"),a=t(this).val()!==e;t(this).val(e),a&&t(this).trigger(_)});break;case"file":t('input[type="file"]',a).each(function(){var e=""!==t(this).val();t(this).val(""),e&&t(this).trigger(_)}),"function"==typeof o.form_file_dropzonejs_populate&&"undefined"!=typeof Dropzone&&t('input[data-file-type="dropzonejs"]',a).each(function(){var e=t(this).val();o.form_file_dropzonejs_populate(t(this),i),t(this).val()!==e&&t(this).trigger(_)});break;default:t("input",a).each(function(){var e=i?"":t(this).prop("defaultValue"),a=t(this).val()!==e;t(this).val(e),a&&t(this).trigger(_)})}}},t.WS_Form.prototype.form_post=function(e,i){void 0===e&&(e="save"),void 0===i&&(i=0);var a="submit"==e;this.trigger(e);var o=this;this.form_add_hidden_input("wsf_form_id",this.form_id),this.form_add_hidden_input("wsf_hash",this.hash),ws_form_settings.wsf_nonce&&this.form_add_hidden_input(ws_form_settings.wsf_nonce_field_name,ws_form_settings.wsf_nonce),"on"==this.get_object_meta_value(this.form,"tracking_duration","")&&this.form_add_hidden_input("wsf_duration",Math.round(((new Date).getTime()-this.date_start)/1e3)),"function"==typeof this.section_repeatable_hidden_field&&this.section_repeatable_hidden_field(),"submit"==e&&(this.form_timer_reset(),this.form_timer()),void 0!==ws_form_settings.post_id&&ws_form_settings.post_id>0&&this.form_add_hidden_input("wsf_post_id",ws_form_settings.post_id),this.form_add_hidden_input("wsf_post_mode",e);var r=t("[data-hidden],[data-hidden-section],[data-hidden-group]",this.form_canvas_obj).filter(":not([data-hidden-bypass])").map(function(){var e;if(void 0===(e=t(this).attr("name"))&&void 0===(e=t(this).attr("data-name")))return"";switch(e=e.replace("[]",""),o.get_field_type(t(this))){case"checkbox":case"price_checkbox":if(o.get_checkbox_row_count(t(this)))return"";break;case"radio":case"price_radio":if(o.get_radio_row_count(t(this)))return""}return e}).get(),s=(r=r.filter(function(t,e,i){return i.indexOf(t)===e&&""!==t})).join();this.form_add_hidden_input("wsf_hidden",s);var _=t("[data-required-bypass],[data-required-bypass-section],[data-required-bypass-group],[data-conditional-logic-bypass]",this.form_canvas_obj).map(function(){var e=t(this).attr("name");return e=e.replace("[]","")}).get(),n=(_=_.filter(function(t,e,i){return i.indexOf(t)===e})).join();if(this.form_add_hidden_input("wsf_bypass_required",n),this.form.submit_hidden_fields&&"object"==typeof this.form.submit_hidden_fields)for(var c in this.form.submit_hidden_fields)if(this.form.submit_hidden_fields.hasOwnProperty(c)){var d=this.form.submit_hidden_fields[c];if(void 0!==d.name&&void 0!==d.value&&void 0!==d.type){switch(d.type){case"local_storage":d.value=this.local_storage_get_raw(d.value)}void 0===d.id&&(d.id=!1),void 0===d.attributes&&(d.attributes=!1),this.form_add_hidden_input(d.name,d.value,d.id,d.attributes)}}"function"==typeof this.signature_form_post&&this.signature_form_post(),t('input[type="hidden"][name="wsf_actions_run[]"]',this.form_canvas_obj).remove();var h=[];if(this.conditional_actions_changed){for(var f in!a&&this.conditional_actions_run_save.length>0&&(h=this.conditional_actions_run_save),a&&this.conditional_actions_run_submit.length>0&&(h=this.conditional_actions_run_submit),h)if(h.hasOwnProperty(f)){var l=h[f];h.indexOf(l)==f&&this.form_add_hidden_input("wsf_actions_run[]",l)}0==t('input[type="hidden"][name="wsf_actions_run[]"]',this.form_canvas_obj).length&&this.form_add_hidden_input("wsf_actions_run[]",-1)}if(this.log(a?"log_form_submit":"log_form_save"),a&&0==i&&!1===this.form_ajax)return this.form_hash_clear(),this.trigger(e+"-complete"),void this.trigger("complete");this.form_post_lock("progress",!1,!1,!0),"function"==typeof this.form_loader_show&&this.form_loader_show(e),o.trigger(e+"-before-ajax");var p=new FormData(this.form_obj[0]);i>0&&p.append("wsf_row_id_filter",i),"submit"!==e&&(p.delete("quantity"),p.delete("add-to-cart"),p.delete("product_id"),p.delete("variation_id")),"function"==typeof this.form_tel_post&&this.form_tel_post(p),"function"==typeof this.form_media_capture_post&&this.form_media_capture_post(p),this.api_call("submit","POST",p,function(t){a&&("function"==typeof o.recaptcha_reset&&o.recaptcha_reset(),"function"==typeof o.hcaptcha_reset&&o.hcaptcha_reset(),"function"==typeof o.turnstile_reset&&o.turnstile_reset(),"function"==typeof o.captchafox_reset&&o.captchafox_reset());var i=void 0!==t.error_validation&&t.error_validation,r=void 0!==t.data&&void 0!==t.data.errors&&t.data.errors.length,s=!1;if("object"==typeof t.data&&"object"==typeof t.data.js){var _=t.data.js;for(var n in _)if(_.hasOwnProperty(n)){var c=_[n];if("redirect"==o.js_action_get_parameter(c,"action")){s=!0;break}}}if(!s){var d=void 0===t.data||"save"==e||i||r;o.form_post_unlock("progress",!d,d,!0),"function"==typeof o.form_loader_hide&&o.form_loader_hide(!d)}if(r||i?(o.trigger(e+"-error"),o.trigger("error")):(o.trigger(e+"-success"),o.trigger("success")),!a||i||r||(o.form_hash_clear(),o.get_object_meta_value(o.form,"submit_reload",!0)&&!s&&o.form_reload()),r&&o.get_object_meta_value(o.form,"submit_show_errors",!0))for(var h in t.data.errors)if(t.data.errors.hasOwnProperty(h)){var f=t.data.errors[h];o.action_message(f)}return o.trigger(e+"-complete"),o.trigger("complete"),!r},function(t){o.form_post_unlock("progress",!0,!0,!0),"function"==typeof o.form_loader_hide&&o.form_loader_hide(!0),"function"==typeof o.recaptcha_reset&&o.recaptcha_reset(),"function"==typeof o.hcaptcha_reset&&o.hcaptcha_reset(),"function"==typeof o.turnstile_reset&&o.turnstile_reset(),"function"==typeof o.captchafox_reset&&o.captchafox_reset(),void 0!==t.error_message&&o.action_message(t.error_message),o.trigger(e+"-error"),o.trigger("error")},i>0||!a)},t.WS_Form.prototype.form_post_lock=function(e,i,a,o){void 0===e&&(e="progress"),void 0===i&&(i=!1),void 0===a&&(a=!1),void 0===o&&(o=!1),this.form_post_lock_start=new Date;var r=this.get_form_post_lock_class(o);this.form_obj.hasClass(r)||(i||this.get_object_meta_value(this.form,"submit_lock",!1))&&(a&&(this.form_ecommerce_calculate_enabled=!1),this.get_form_post_lock_button_objs(o).each(function(){void 0!==t(this).attr("disabled")?t(this).attr("data-form-lock-disabled-bypass",""):t(this).prop("disabled",!0)}),this.form_obj.addClass(r+(e?" wsf-form-post-lock-"+e:"")),this.form_post_locked=!0,this.trigger("lock"),this.log("log_submit_lock","","duplicate-protect"))},t.WS_Form.prototype.form_post_unlock=function(e,i,a,o){void 0===e&&(e="progress"),void 0===i&&(i=!0),void 0===a&&(a=!1),void 0===o&&(o=!1);var r=this.get_form_post_lock_class(o);if(this.form_obj.hasClass(r)){var s=this,_=function(){s.form_ecommerce_calculate_enabled=!0,s.form_obj.removeClass(r+(e?" wsf-form-post-lock-"+e:"")),s.get_form_post_lock_button_objs(o).each(function(){void 0!==t(this).attr("data-form-lock-disabled-bypass")?t(this).removeAttr("data-form-lock-disabled-bypass"):t(this).prop("disabled",!1)}),s.form_post_locked=!1,"function"==typeof s.form_progress_api_call_reset&&s.form_progress_api_call_reset(),s.trigger("unlock"),s.log("log_submit_unlock","","duplicate-protect"),s.form_validate_real_time_process(!1,!1)};if(a||this.get_object_meta_value(this.form,"submit_unlock",!1)){var n=new Date-this.form_post_lock_start,c=Math.max(this.form_post_lock_duration_max-n,0);i?setTimeout(function(){_()},c):_()}}},t.WS_Form.prototype.get_form_post_lock_button_objs=function(e){return t("string"==typeof e?e:e='button[type="submit"].wsf-button, input[type="submit"].wsf-button, button[data-action="wsf-save"].wsf-button, button[data-ecommerce-payment].wsf-button, [data-post-lock]'+(e?', button[type="button"].wsf-button':""),this.form_canvas_obj)},t.WS_Form.prototype.get_form_post_lock_class=function(t){var e="wsf-form-post-lock";return"string"==typeof t&&(e+="-custom-selector"),e},t.WS_Form.prototype.api_call=function(e,i,a,o,r,s){void 0===i&&(i="POST"),a||(a=new FormData),void 0===s&&(s=!1);var _=this,n=new Date;if(ws_form_settings.use_rest_route){var c=e.split("?");e=encodeURIComponent(c[0])+(c[1]?"&"+c[1]:"")}var d=s?ws_form_settings.url_ajax+e:"submit"==e?this.form_obj.attr("action"):ws_form_settings.url_ajax+e;if(!s&&this.form_action_custom&&"submit"==e)return this.form_obj.off("submit"),this.form_obj.trigger("submit"),!0;if(void 0!==a.get&&null!==a.get(ws_form_settings.wsf_nonce_field_name)||!ws_form_settings.wsf_nonce||a.append(ws_form_settings.wsf_nonce_field_name,ws_form_settings.wsf_nonce),"GET"===i){for(var h={},f=a.entries(),l=f.next();!l.done;){var p=l.value;h[p[0]]=p[1],l=f.next()}a=h}this.action_js_process_validation_focus=!0;var m={method:i,url:d,contentType:!1,processData:"GET"===i,beforeSend:function(t){ws_form_settings.x_wp_nonce&&t.setRequestHeader("X-WP-Nonce",ws_form_settings.x_wp_nonce)},success:function(t){_.api_call_hander_success(t,o,n)},error:function(t,e,i){_.api_call_handler_error(t,e,i,o,r,n,d)}};!1!==a&&(m.data=a);var u=t('[data-source="post_progress"]',this.form_canvas_obj);return u.length&&(m.xhr=function(){var t=new window.XMLHttpRequest;return t.upload.addEventListener("progress",function(t){_.form_progress_api_call(u,t)},!1),t.addEventListener("progress",function(t){_.form_progress_api_call(u,t)},!1),t}),t.ajax(m)},t.WS_Form.prototype.api_call_hander_success=function(e,i,a){if(this.api_call_hash(e)&&t.WS_Form.debug_rendered){var o=new Date-a;this.debug_info("debug_info_submit_count",e.data.count),this.debug_info("debug_info_submit_duration_user",this.get_nice_duration(e.data.submit_duration_user)),this.debug_info("debug_info_submit_duration_client",o+" ms"),this.debug_info("debug_info_submit_duration_server",e.data.submit_duration_server+" ms")}if(t.WS_Form.debug_rendered&&void 0!==e.data){if("object"==typeof e.data.logs)for(var r in e.data.logs)e.data.logs.hasOwnProperty(r)&&this.log("log_action",e.data.logs[r],"action");if("object"==typeof e.data.errors)for(var s in e.data.errors)if(e.data.errors.hasOwnProperty(s)){var _=e.data.errors[s];_?this.error("error_action",_,"action"):this.error("error_action_no_message","","action")}}void 0!==e.x_wp_nonce&&(ws_form_settings.x_wp_nonce=e.x_wp_nonce),void 0!==e.wsf_nonce&&(ws_form_settings.wsf_nonce=e.wsf_nonce);var n="function"!=typeof i||i(e);return void 0!==e.data&&n&&"object"==typeof e.data.js&&this.action_js_init(e.data.js),!0},t.WS_Form.prototype.api_call_handler_error=function(t,e,i,a,o,r,s){var _=void 0!==t.responseJSON&&t.responseJSON,n=t.status,c=this.language("error_api_call_unknown");switch(n){case 200:if("string"==typeof i)c=this.error("error_api_call_response_error",i);else if(i instanceof Error)c=this.error("error_api_call_response_error",i.message);else try{c=this.error("error_api_call_response_error",JSON.stringify(i))}catch(t){c=this.error("error_api_call_response_error",this.language("error_api_call_unknown"))}this.error("error_api_call_response_text",this.esc_html(t.responseText)),_={error:!0,error_message:c};break;case 400:case 401:case 403:case 404:case 500:_&&_.error?c=_.error_message?this.error("error_api_call_"+n,_.error_message):this.error("error_api_call_"+n,s):_={error:!0,error_message:c=this.error("error_api_call_"+n,s)}}"function"==typeof o&&o(_)},t.WS_Form.prototype.api_call_hash=function(t){if("string"!=typeof t.hash)return!1;var e=t.hash;if("clear"==e)return this.log("log_hash_not_found"),this.form_hash_clear(),!1;if(32!=e.length)return!1;return!!/^[a-fA-F0-9]{32}$/gi.test(e)&&(this.hash_set(e),!0)},t.WS_Form.prototype.hash_set=function(e,i,a){(void 0===i&&(i=!1),void 0===a&&(a=!1),e!=this.hash&&(this.hash=e,a=!0,this.log("log_hash_set",this.hash),t.WS_Form.debug_rendered&&this.debug_info("debug_info_hash",this.hash,"clear_hash")),i&&(this.token=i,this.log("log_token_set",this.token)),a)&&(this.get_object_value(t.WS_Form.settings_plugin,"cookie_hash")&&this.cookie_set("hash",this.hash))},t.WS_Form.prototype.action_js_init=function(t){this.trigger("actions-start"),this.action_js=t,this.action_js_process_next()},t.WS_Form.prototype.action_js_process_next=function(){if(0==this.action_js.length)return this.trigger("actions-finish"),!1;var e=this.action_js.shift();switch(this.js_action_get_parameter(e,"action")){case"redirect":return!1!==this.js_action_get_parameter(e,"url")&&(location.href=e.url),!0;case"message":var i=this.js_action_get_parameter(e,"message"),a=this.js_action_get_parameter(e,"type"),o=this.js_action_get_parameter(e,"method"),r=this.js_action_get_parameter(e,"duration"),s=this.js_action_get_parameter(e,"form_hide"),_=this.js_action_get_parameter(e,"clear"),n=this.js_action_get_parameter(e,"scroll_top"),c=this.js_action_get_parameter(e,"scroll_top_offset"),d=this.js_action_get_parameter(e,"scroll_top_duration"),h=this.js_action_get_parameter(e,"form_show"),f=this.js_action_get_parameter(e,"message_hide");this.action_message(i,a,o,r,s,_,n,c,d,h,f);break;case"conversion":if("function"==typeof this.action_conversion){a=this.js_action_get_parameter(e,"type");var l=this.js_action_get_parameter(e,"parse_values"),p=this.js_action_get_parameter(e,"data_layer_reset");this.action_conversion(a,l,p)}break;case"javascript":var m=this.js_action_get_parameter(e,"javascript");this.action_javascript(m);break;case"field_invalid_feedback":var u=parseInt(this.js_action_get_parameter(e,"field_id"),10),v=(W=parseInt(this.js_action_get_parameter(e,"section_repeatable_index"),10))?"-repeat-"+W:"",g=(i=this.js_action_get_parameter(e,"message"),t("#"+this.form_id_prefix+"field-"+u+v,this.form_canvas_obj));this.set_invalid_feedback(g,i),this.log("error_invalid_feedback",u+" ("+this.esc_html(i)+")");var b=this;if(g.one("change input",function(){b.set_invalid_feedback(t(this),"")}),this.get_object_meta_value(this.form,"invalid_field_focus",!0)&&this.action_js_process_validation_focus){var y=this.get_group_index(g);!1!==y?this.object_focus=g:g.trigger("focus"),"function"==typeof this.form_tab_group_index_set&&!1!==y&&this.form_tab_group_index_set(y),this.action_js_process_validation_focus=!1}this.form_canvas_obj.addClass(this.class_validated),this.form_accessibility(),this.action_js_process_next(),"function"==typeof this.form_validate_field&&this.form_validate_field("field_invalid_feedback");break;case"field_value":u=parseInt(this.js_action_get_parameter(e,"field_id"),10),v=(W=parseInt(this.js_action_get_parameter(e,"section_repeatable_index"),10))?"-repeat-"+W:"";var w=this.js_action_get_parameter(e,"value"),j=this.js_action_get_parameter(e,"check",!0),k=this.js_action_get_parameter(e,"append"),x=this.js_action_get_parameter(e,"prepend"),S=t("#"+this.form_id_prefix+"field-wrapper-"+u+v,this.form_canvas_obj),F=t("#"+this.form_id_prefix+"field-"+u+v,this.form_canvas_obj);this.field_value_set(S,F,w,j,k,x),this.log("log_field_value",u,"field_value, append, prepend"),this.action_js_process_next();break;case"field_dropzonejs_file_objects":u=parseInt(this.js_action_get_parameter(e,"field_id"),10),v=(W=parseInt(this.js_action_get_parameter(e,"section_repeatable_index"),10))?"-repeat-"+W:"";var W,O=this.js_action_get_parameter(e,"file_objects");(g=t("#"+this.form_id_prefix+"field-"+u+v,this.form_canvas_obj)).attr("data-default-value",JSON.stringify(O)),this.form_file_dropzonejs_populate(g),this.log("log_field_dropzonejs_file_objects",u),this.action_js_process_next();break;case"trigger":var I=this.js_action_get_parameter(e,"event"),C=this.js_action_get_parameter(e,"params");t(document).trigger(I,C),this.action_js_process_next()}},t.WS_Form.prototype.field_value_set=function(e,i,a,o,r,s){if(e.length)_=e.attr("data-type");else{if(!i.length)return;switch(i.attr("type")){case"hidden":var _="hidden";break;default:return}}void 0===o&&(o=!0),void 0===r&&(r=!1),void 0===s&&(s=!1);var n=!!i.length&&i[0].nodeName;if("string"==typeof n)switch(n.toLowerCase()){case"button":_="button"}switch(_){case"select":case"price_select":var c=t('option[value="'+this.esc_selector(a)+'"]',i).prop("selected")!==o;t('option[value="'+this.esc_selector(a)+'"]',i).prop("selected",o),c&&i.trigger("change");break;case"checkbox":case"price_checkbox":case"radio":case"price_radio":c=t('input[value="'+this.esc_selector(a)+'"]',e).prop("checked")!==o;t('input[value="'+this.esc_selector(a)+'"]',e).prop("checked",o),c&&t('input[value="'+this.esc_selector(a)+'"]',e).trigger("change");break;case"button":i.html(a);break;case"html":case"texteditor":case"message":r?t("[data-html],[data-text-editor]",e).append(a):s?t("[data-html],[data-text-editor]",e).prepend(a):t("[data-html],[data-text-editor]",e).html(a);break;case"color":i.attr("data-value-old",function(){return t(this).val()}).val(a).filter(function(){return t(this).val()!==t(this).attr("data-value-old")}).trigger("change").removeAttr("data-value-old"),"undefined"!=typeof Coloris&&i[0].dispatchEvent(new Event("input",{bubbles:!0}));break;case"price":case"cart_price":if(""!==a){if(isNaN(a))a=this.get_number(a);a=this.get_price(a,this.get_currency(),!1)}i.attr("data-value-old",function(){return t(this).val()}).val(a).filter(function(){return t(this).val()!==t(this).attr("data-value-old")}).trigger("change").removeAttr("data-value-old");break;default:r?a=i.val()+a:s&&(a+=i.val()),i.attr("data-value-old",function(){return t(this).val()}).val(a).filter(function(){return t(this).val()!==t(this).attr("data-value-old")}).trigger("change").removeAttr("data-value-old"),"textarea"==_&&"function"==typeof this.textarea_set_value&&this.textarea_set_value(i,a)}},t.WS_Form.prototype.js_action_get_parameter=function(t,e,i=!1){return void 0!==t[e]?t[e]:i},t.WS_Form.prototype.get_framework_config_value=function(t,e){return void 0===this.framework[t]?(this.error("error_api_call_framework_invalid"),!1):void 0===this.framework[t].public?(this.error("error_api_call_framework_invalid"),!1):void 0!==this.framework[t].public[e]&&this.framework[t].public[e]},t.WS_Form.prototype.action_message=function(e,i,a,o,r,s,_,n,c,d,h){if(e){void 0===i&&(i=this.get_object_meta_value(this.form,"error_type","danger")),void 0===a&&(a=this.get_object_meta_value(this.form,"error_method","after")),void 0===o&&(o=parseInt(this.get_object_meta_value(this.form,"error_duration","4000"),10)),void 0===r&&(r="on"==this.get_object_meta_value(this.form,"error_form_hide","")),void 0===s&&(s="on"==this.get_object_meta_value(this.form,"error_clear","")),void 0===_&&(_="on"==this.get_object_meta_value(this.form,"error_scroll_top","")),void 0===n&&(n=parseInt(this.get_object_meta_value(this.form,"error_scroll_top_offset","0"),10)),n=""==n?0:parseInt(n,10),void 0===c&&(c=parseInt(this.get_object_meta_value(this.form,"error_scroll_top_duration","400"),10)),void 0===d&&(d="on"==this.get_object_meta_value(this.form,"error_form_show","")),void 0===h&&(h="on"==this.get_object_meta_value(this.form,"error_message_hide","on"));var f=this.form_canvas_obj.offset().top-n;(o=parseInt(o,10))<0&&(o=0);var l=this.get_framework_config_value("message","mask_wrapper"),p=this.get_framework_config_value("message","types"),m=void 0!==(i=void 0!==p[i]&&p[i]).mask_wrapper_class?i.mask_wrapper_class:"";switch(s&&t('[data-wsf-message][data-wsf-instance-id="'+this.form_instance_id+'"]').remove(),_){case"instant":case"on":t("html,body").scrollTop(f);break;case"smooth":c=""==c?0:parseInt(c,10),t("html,body").animate({scrollTop:f},c)}var u={message:e,mask_wrapper_class:m},v=void 0!==this.form_canvas_obj.attr("data-wsf-style-id")&&this.form_canvas_obj.attr("data-wsf-style-id");v&&(u.style_id=v);var g=t("<div/>",{html:this.mask_parse(l,u)});switch(g.attr("role","alert"),g.attr("data-wsf-message",""),g.attr("data-wsf-instance-id",this.form_instance_id),v&&t("#wsf-styler").length&&g.attr("style",this.form_canvas_obj.attr("style")),r&&(this.form_obj.hide(),this.form_timer_reset()),a){case"before":g.insertBefore(this.form_obj);break;default:g.insertAfter(this.form_obj)}this.conversational&&t(".wsf-form-conversational-nav").length&&g.css("bottom",t(".wsf-form-conversational-nav").outerHeight()+"px");var b=this;(o=parseInt(o,10))>0?setTimeout(function(){h&&g.remove(),d&&(b.form_obj.show(),b.form_timer()),b.action_js_process_next()},o):b.action_js_process_next()}},t.WS_Form.prototype.action_javascript=function(e){try{t.globalEval("(function($){\n"+e+"\n})(jQuery);"),this.log("log_javascript","action")}catch(t){this.error("error_js",e)}this.action_js_process_next()},t.WS_Form.prototype.form_character_word_count=function(e){var i=this;for(var a in void 0===e&&(e=this.form_canvas_obj),this.field_data_cache)if(this.field_data_cache.hasOwnProperty(a)){var o=this.field_data_cache[a],r=this.get_object_meta_value(o,"help","",!1,!0),s=-1!==r.indexOf("#character_")||-1!==r.indexOf("#word_");if(this.has_object_meta_key(o,"min_length")||this.has_object_meta_key(o,"max_length")||this.has_object_meta_key(o,"min_length_words")||this.has_object_meta_key(o,"max_length_words")||s){var _=t("#"+this.form_id_prefix+"field-"+a,e);_.length||(_=t('[id^="'+this.form_id_prefix+"field-"+a+'-"]:not([data-init-char-word-count]):not(iframe)',e)),_.each(function(){t(this).attr("data-init-char-word-count",""),i.form_character_word_count_process(t(this))&&t(this).on("change input",function(){i.form_character_word_count_process(t(this))})})}}},t.WS_Form.prototype.form_character_word_count_process=function(t){var e=this.get_field(t),i=this.get_object_meta_value(e,"min_length","");i=parseInt(i,10)>0&&parseInt(i,10);var a=this.get_object_meta_value(e,"max_length","");a=parseInt(a,10)>0&&parseInt(a,10);var o=this.get_object_meta_value(e,"min_length_words","");o=parseInt(o,10)>0&&parseInt(o,10);var r=this.get_object_meta_value(e,"max_length_words","");r=parseInt(r,10)>0&&parseInt(r,10);var s=t.val();if("string"==typeof s){var _=s.length,n=!1!==a&&a-_;n<0&&(n=0);var c=this.get_word_count(s),d=!1!==r&&r-c;d<0&&(d=0);var h=!1,f=[];!1!==i&&_<i&&(f.push(this.language("error_min_length",i)),h=!0),!1!==a&&_>a&&(f.push(this.language("error_max_length",a)),h=!0),!1!==o&&c<o&&(f.push(this.language("error_min_length_words",o)),h=!0),!1!==r&&c>r&&(f.push(this.language("error_max_length_words",r)),h=!0),(void 0!==t.attr("required")||s.length>0)&&h?this.set_invalid_feedback(t,f.join(" / ")):this.set_invalid_feedback(t,""),this.form_bypass();var l=this.get_object_meta_value(e,"help","",!1,!0);if(-1===l.indexOf("#character_")&&-1===l.indexOf("#word_"))return!0;var p=this.language("character_singular"),m=this.language("character_plural"),u=this.language("word_singular"),v=this.language("word_plural"),g={character_count:_,character_count_label:1==_?p:m,character_remaining:!1!==n?n:"",character_remaining_label:1==n?p:m,character_min:!1!==i?i:"",character_min_label:!1!==i?1==i?p:m:"",character_max:!1!==a?a:"",character_max_label:!1!==a?1==a?p:m:"",word_count:c,word_count_label:1==c?u:v,word_remaining:!1!==d?d:"",word_remaining_label:1==d?u:v,word_min:!1!==o?o:"",word_min_label:!1!==o?1==o?u:v:"",word_max:!1!==r?r:"",word_max_label:!1!==r?1==r?u:v:""},b=this.mask_parse(l,g);return this.get_help_obj(t).html(b),!0}},t.WS_Form.prototype.get_word_count=function(t){return 0==(t=t.trim()).length?0:t.trim().replace(/\s+/gi," ").split(" ").length},t.WS_Form.prototype.form_stat=function(){ws_form_settings.stat&&this.form_stat_add_view()},t.WS_Form.prototype.form_stat_add_view=function(){this.form_stat_add_lock||(t.ajax({method:"POST",url:ws_form_settings.add_view_url,data:{wsffid:this.form_id}}),this.form_stat_add_lock=!0)},t.WS_Form.prototype.form_google_maps_js_api_await=function(e){var i=this,a=(new Date).getTime();return new Promise(function(o){!function r(){if((new Date).getTime()-a>i.timeout_google_maps)return i.error("error_timeout_google_maps_api_js",e),o(!1);var s=!window.google||!window.google.maps;switch(t.WS_Form.settings_plugin.google_maps_js_api_version){case"2":break;default:switch(e){case"googleaddress":s=s||!window.google.maps.Geocoder||!window.google.maps.places||!window.google.maps.places.Autocomplete;break;case"googlemap":s=s||!window.google||!window.google.maps||!window.google.maps.Geocoder||!window.google.maps.marker||!window.google.maps.marker.AdvancedMarkerElement||!window.google.maps.places||!window.google.maps.places.SearchBox;break;case"googleroute":s=s||!window.google||!window.google.maps||!window.google.maps.DirectionsRenderer||!window.google.maps.DirectionsService}}if(!s)return i.log("log_google_maps_api_js_init_complete",e,"google-maps-js-api"),o(!0);setTimeout(r,i.timeout_interval)}()})},t.WS_Form.prototype.form_google_maps_js_api_import_libraries=function(e){var i=this;return async function(){switch(i.log("log_google_maps_api_js_init",e,"google-maps-js-api"),t.WS_Form.settings_plugin.google_maps_js_api_version){case"2":switch(e){case"googleaddress":await google.maps.importLibrary("geocoding"),await google.maps.importLibrary("places");break;case"googlemap":await google.maps.importLibrary("geocoding"),await google.maps.importLibrary("maps"),await google.maps.importLibrary("marker"),await google.maps.importLibrary("places");break;case"googleroute":await google.maps.importLibrary("routes")}i.log("log_google_maps_api_js_library_import",e,"google-maps-js-api")}}()},window.wsf_form_instances=[],window.wsf_form_init=function(e,i,a){if(void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===a)var o=t(".wsf-form");else o=t(".wsf-form",a);if(o.length){var r=0,s=[];t(".wsf-form").each(function(){if(void 0!==t(this).attr("data-instance-id")){var e=parseInt(t(this).attr("data-instance-id"),10);-1!==s.indexOf(e)?t(this).removeAttr("data-instance-id"):e>r&&(r=e),s.push(e)}}),r++,o.each(function(){if(e||void 0===t(this).attr("data-wsf-rendered")){i&&t(this).off(),void 0===t(this).attr("data-instance-id")&&(void 0===t(this).attr("data-wsf-custom-id")&&t(this).attr("id","ws-form-"+r),t(this).attr("data-instance-id",r),r++);var a=t(this).attr("id"),o=t(this).attr("data-id"),s=t(this).attr("data-instance-id");if(a&&o&&s){var _=new t.WS_Form;window.wsf_form_instances[s]=_,_.render({obj:t(this),form_id:o})}}})}},t(function(){wsf_form_init()})}(jQuery);