jQuery(function(a){function b(){wc_geolocation_params.geolocation&&a("a[href^='"+wc_geolocation_params.home_url+"'], a[href^='/']").each(function(){var b=a(this),c=b.attr("href");c.indexOf("location=")>0||(c.indexOf("?")>0?b.attr("href",c+"&location="+wc_geolocation_params.geolocation):b.attr("href",c+"?location="+wc_geolocation_params.geolocation))})}function c(a,b){if(a!==wc_geolocation_params.base_country||b!==wc_geolocation_params.base_state){var c=window.location.toString();b&&(b=":"+b),c=c.indexOf("?")>0?c+"&location="+a+b:c+"?location="+a+b,window.location=c}}var d;try{d="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc")}catch(e){d=!1}if(d&&"1"===wc_geolocation_params.is_woocommerce){var f={url:wc_geolocation_params.wc_ajax_url+"geolocate",type:"GET",success:function(a){a.success&&a.data.country&&(sessionStorage.setItem("wc_geolocated_country",a.data.country),sessionStorage.setItem("wc_geolocated_state",a.data.state),c(a.data.country,a.data.state))}};window.location.toString().indexOf("location=")<0&&(sessionStorage.getItem("wc_geolocated_country")?c(sessionStorage.getItem("wc_geolocated_country"),sessionStorage.getItem("wc_geolocated_state")):a.ajax(f))}a(document.body).on("added_to_cart",function(){b()}),b()});