!function(i){function e(){const o=function(){let o,c;var e={hidden:"visibilitychange",webkitHidden:"webkitvisibilitychange",mozHidden:"mozvisibilitychange",msHidden:"msvisibilitychange"};for(o in e)if(o in document){c=e[o];break}return function(e){return e&&document.addEventListener(c,e),!document[o]}}();o(function(){var e=function(o){var c=document.cookie.split(";");for(let e=0;e'+t.replace(/\*/g,"").trim()+" "+cartflows.field_validation.error_msg+"")):e.find(".wcf-field-required-error").remove()}var e=(o=i("form.woocommerce-checkout")).find("input, textarea"),o=o.find("select");e.on("blur",function(){var e,o=i(this),c=o.attr("type"),t=o.closest("p.form-row"),a=o.val();r(a,t,o,c),"number"===c&&(c=o.attr("min"),e=o.attr("max"),a=Number(a),t=t,o=o,c=Number(c),e=Number(e),""===a||a'+cartflows.field_validation_msgs.number_field+c+" & "+e+"")):(o.removeClass("field-required"),t.find(".wcf-field-required-error").remove()))}),o.on("blur",function(){var e=i(this).closest("p.form-row"),o=e.find(".select2-container--default"),c=e.find("select").val();r(c,e,o,"select")})}function s(){if("yes"===cartflows.allow_persistence&&!1!==function(){var e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}()){var e="form.woocommerce-checkout #customer_details";const o={set(){const e=[];var o=i("form.woocommerce-checkout #customer_details");localStorage.removeItem("cartflows_checkout_form"),o.find("input[type=text], select, input[type=email], input[type=tel]").each(function(){e.push({name:this.name,value:this.value})}),cartflows_checkout_form=JSON.stringify(e),localStorage.setItem("cartflows_checkout_form",cartflows_checkout_form)},get(){if(null!==localStorage.getItem("cartflows_checkout_form")){checkout_data=JSON.parse(localStorage.getItem("cartflows_checkout_form"));for(let e=0;e()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(o))return c.after(''+cartflows.email_validation_msgs.error_msg+""),a.removeClass("wcf-show");clearTimeout(f);const r=++d;f=setTimeout(function(){i.ajax({url:cartflows.ajax_url,type:"POST",data:{action:"wcf_check_email_exists",email_address:e,security:cartflows.check_email_exist_nonce},success(e){r===d&&(t.remove(),e.data&&e.data.success&&a.hasClass("wcf-show")?c.after(''+cartflows.email_validation_msgs.success_msg+""):e.data&&e.data.success?(e.data.is_login_allowed&&(c.after(''+cartflows.email_validation_msgs.success_msg+""),a.slideDown(400).addClass("wcf-show")),i(".wcf-create-account-section").hide(),i(".woocommerce-billing-fields__customer-login-label").show()):(a.slideUp(400).removeClass("wcf-show"),i(".wcf-create-account-section .create-account label.checkbox").show(),i(".wcf-create-account-section").show(),i(".woocommerce-billing-fields__customer-login-label").hide()))}})},300)}else i(".wcf-create-account-section").hide(),i(".wcf-customer-login-section").hide(),i(".wcf-email-validation-block").hide(),i(".woocommerce-billing-fields__customer-login-label").show();var o}}i(function(){s(),e(),r(),i(document.body).on("click","#wcf-embed-checkout-form .wcf-remove-product",function(e){e.preventDefault();const o=i(this).attr("data-id");e={p_key:i(this).attr("data-item-key"),p_id:o,action:"wcf_woo_remove_cart_product",security:cartflows.wcf_validate_remove_cart_product_nonce};i.ajax({type:"POST",url:cartflows.ajax_url,data:e,success(e){e=JSON.parse(e);!1===e.need_shipping&&i("#wcf-embed-checkout-form").find("#ship-to-different-address-checkbox").attr("checked",!1),i("#wcf-embed-checkout-form").find(".woocommerce-notices-wrapper").first().html(e.msg),i(document).trigger("cartflows_remove_product",[o]),i("#wcf-embed-checkout-form").trigger("update_checkout")}})}),l.init(),jQuery.each(cartflows_checkout_optimized_fields,function(o,e){e.is_optimized&&(jQuery("#"+o).prepend(''+e.field_label+""),jQuery("#wcf_optimized_"+o).on("click",function(e){e.preventDefault(),jQuery("#"+o).removeClass("wcf-hide-field");e=o.replace(/_field/g,"");i("#"+e).trigger("focus"),jQuery(this).remove()}))}),n(),i(".wcf-customer-info #billing_email").on("input",function(){u()}),0