File: /var/www/html/wptuneprotect/wp-content/plugins/woocommerce/assets/js/frontend/geolocation.min.js
jQuery(function(n){var a=!1;var e,t=function(){a&&n('a[href^="'+wc_geolocation_params.home_url+'"]:not(a[href*="v="]), a[href^="/"]:not(a[href*="v="])').each(function(){var e=n(this),t=e.attr("href"),o=t.split("#");t=0<(t=o[0]).indexOf("?")?t+"&v="+a:t+"?v="+a,"undefined"!=typeof o[1]&&null!==o[1]&&(t=t+"#"+o[1]),e.attr("href",t)})},o={url:wc_geolocation_params.wc_ajax_url.toString().replace("%%endpoint%%","get_customer_location"),type:"GET",success:function(e){e.success&&e.data.hash&&e.data.hash!==a&&r(e.data.hash)}},r=function(e){Cookies.set("woocommerce_geo_hash",e,{expires:1/24});var t=0<(t=window.location.toString()).indexOf("?v=")||0<t.indexOf("&v=")?t.replace(/v=[^&]+/,"v="+e):0<t.indexOf("?")?t+"&v="+e:t+"?v="+e;window.location=t};("string"!=typeof(e=Cookies.get("woocommerce_geo_hash"))||!e.length||(a=e,0)||a&&new URLSearchParams(window.location.search).get("v")!==a)&&window.fetch(o.url,{method:o.type,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}).then(e=>{if(e.ok)return e.json();throw new Error(e.statusText)}).then(o.success),a&&n("form").each(function(){var e=n(this),t=e.attr("method"),o=0<e.find('input[name="v"]').length;t&&"get"===t.toLowerCase()&&!o?e.append('<input type="hidden" name="v" value="'+a+'" />'):(t=e.attr("action"))&&(0<t.indexOf("?")?e.attr("action",t+"&v="+a):e.attr("action",t+"?v="+a))}),t(),n(document.body).on("added_to_cart",function(){t()}),n(document.body).on("woocommerce_append_geo_hashes",function(){t()})});