1jQuery(document).ready(function(){var userAgent=navigator.userAgent;if(userAgent.toLowerCase().match(/(bot|spider|crawl)/)){return!0} 2if(!jQuery('body')[0].className.match(/(search|single-product|home|post-type-archive-product|tax-product)/)){jQuery('#wcacr-cache-support-css').remove();return!0} 3var productId=getCurrentProductId();if(productId&&window.location.href.indexOf('wcacra=')>-1){jQuery('form.cart').show();jQuery('.wcacr-add-to-cart-marker').parents('form').show();jQuery('.wcacr-price').show();return!0} 4function getRandomInt(min,max){min=Math.ceil(min);max=Math.floor(max);return Math.floor(Math.random()*(max-min+1))+min} 5function getCurrentProductId(){var id=null;var classes=jQuery('body')[0].className;if(classes.indexOf('single-product')>-1&&classes.indexOf(' postid-')>-1){id=parseInt(classes.replace(/.+ postid-(\d+) .+/,'$1'))} 6return id} 7function enforceProductRestrictions(restrictions){if(restrictions.product_type.indexOf('variable')>-1){if(jQuery('.wcacr-price').length&&restrictions.new_price){jQuery('.wcacr-price').replaceWith(restrictions.new_price)} 8if(restrictions.visible_variations_count>0&&!restrictions.is_product_restricted){if(wcacr_cache_support_data.wccr_allow_variations_redirection!=='no'){window.location.href=window.location.href.split('?')[0]+'?wcacra='+getRandomInt(1,9999999)}}else{restrictions.is_product_restricted=!0}} 9if(restrictions.is_product_restricted){if(restrictions.redirect_to){window.location.href=restrictions.redirect_to} 10jQuery('body').addClass('wcacr-restriction-applied');jQuery('.wcacr-add-to-cart-marker').parents('form').remove();if(jQuery('body').hasClass('restriction-method-disable_add_to_cart_prices')){jQuery('.wcacr-price').remove()}else{jQuery('.wcacr-price').show()}}else{jQuery('form.cart').show();jQuery('.wcacr-price').show();jQuery('.wcacr-add-to-cart-marker').parents('form').show()}} 11function enforceGlobalRestrictions(restrictions){var $prices=jQuery('.product .price');if(restrictions.is_shop_available){$prices.show()}else{jQuery('body').addClass('wcacr-restriction-applied');if(jQuery('body').hasClass('restriction-method-disable_add_to_cart_prices')){$prices.remove()}else{$prices.show()}} 12if(restrictions['li.wccr-country-selector.menu-item']){jQuery(restrictions['li.wccr-country-selector.menu-item']).replaceAll('li.wccr-country-selector.menu-item')}} 13function enforceRestrictions(restrictions,fromCache){jQuery('body').addClass(restrictions.body_classes);if(productId){enforceProductRestrictions(restrictions)} 14enforceGlobalRestrictions(restrictions);if(restrictions.notice_plain_message&&jQuery('body').hasClass('wcacr-restriction-applied')){var noticedShown=!1;jQuery('.woocommerce-error').each(function(){if(jQuery(this).html().indexOf(restrictions.notice_plain_message)>-1){noticedShown=!0}});if(!noticedShown){jQuery('.wcacr-notices-marker').after(restrictions.notices)}} 15if(!fromCache&&restrictions['li.wccr-country-selector.menu-item']){jQuery(restrictions['li.wccr-country-selector.menu-item']).replaceAll('li.wccr-country-selector.menu-item')}} 16function getCountry(){var country='';if(window.location.href.indexOf('wccr_country=')>-1){country=window.location.href.replace(/.+wccr_country=([A-Za-z]{2}).*/,'$1')}else if(wcacrGetCookie('wcacr_user_country')){country=wcacrGetCookie('wcacr_user_country')} 17return country} 18function getBaseCacheKey(){return'wcacr_ajax_checks'+getCountry()} 19function setCacheItem(cacheKey,value){var cache=jQuery.parseJSON(sessionStorage.getItem(getBaseCacheKey()));if(!cache){cache={}} 20cache[cacheKey]=value;try{sessionStorage.setItem(getBaseCacheKey(),JSON.stringify(cache))}catch(err){}} 21function getCacheItem(cacheKey){var out=null;try{var cache=jQuery.parseJSON(sessionStorage.getItem(getBaseCacheKey()));if(!cache){cache={}} 22if(typeof cache[cacheKey]!=='undefined'){out=cache[cacheKey];if(out.country){wcacrSetCookie('wcacr_user_country',out.country,30)}}}catch(err){} 23return out} 24function applyRestrictions(){if(productId&&getCacheItem('product'+productId)){enforceRestrictions(getCacheItem('product'+productId),!0);return!0}else if(!productId&&getCacheItem('global')){enforceRestrictions(getCacheItem('global'),!0);return!0} 25var url=(window.location.href.indexOf('?')>-1)?window.location.href+'&':window.location.href+'?';url+='&wcacr_ajax=1&wcacr=';jQuery.post(url+getRandomInt(1,9999999),{wcacr_cache_buster_product_id:productId},function(response){if(response.success){if(productId){cacheKey='product'+productId;setCacheItem(cacheKey,response.data)} 26setCacheItem('global',response.data);enforceRestrictions(response.data,!1)}})} 27applyRestrictions()})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.