PageSourceSearch

https://shop.trustico.co.uk/cdn/shop/t/27/assets/local-site-bar.js?v=6841531312481169841789079771

js trustico.co.uk collected 2026-10-06 20:37:35 UTC 2,914 bytes, 2 lines download raw bytes

1(function(){var DISMISSED_KEY="local-site-bar-dismissed",SUGGESTION_KEY="local-site-bar-suggestion";function read(store,key){try{return window[store].getItem(key)}catch(e){return null}}function write(store,key,value){try{window[store].setItem(key,value)}catch(e){}}function hasLocalSite(code,isDefaultCountry){var alternate=document.querySelector('link[rel="alternate"][hreflang$="-'+code+'"]');return!alternate&&isDefaultCountry&&(alternate=document.querySelector('link[rel="alternate"][hreflang="x-default"]')),alternate?new URL(alternate.href).host!==window.location.host:!1}function pick(payload){var first=payload&&payload.suggestions&&payload.suggestions[0],country=first&&first.parts&&first.parts.country;return country?{code:country.handle,name:country.name}:null}function init(bar){if(bar.dataset.localSiteBarReady)return;bar.dataset.localSiteBarReady="true";var config=JSON.parse(bar.querySelector("[data-local-site-config]").textContent),message=bar.querySelector("[data-local-site-message]"),country=bar.querySelector("[data-local-site-country]"),flag=bar.querySelector("[data-local-site-flag]"),arrow=bar.querySelector("[data-local-site-arrow]");flag&&flag.addEventListener("error",function(){flag.hidden=!0,arrow&&(arrow.hidden=!1)});function show(name,code,flagCode){message.textContent=config.text.replace("[country]",name),country.value=code,flag&&flagCode&&(flag.src=config.flagUrl.replace("{code}",flagCode.toLowerCase()),flag.hidden=!1,arrow&&(arrow.hidden=!0)),bar.hidden=!1}function apply(suggestion){suggestion&&hasLocalSite(suggestion.code,suggestion.code===config.defaultCountry)&&show(config.names[suggestion.code]||suggestion.name,suggestion.code,suggestion.code)}if(bar.querySelector("[data-local-site-dismiss]").addEventListener("click",function(){bar.hidden=!0,config.designMode||write("localStorage",DISMISSED_KEY,"true")}),config.designMode){show(config.sampleCountry,"",config.sampleCode);return}if(!read("localStorage",DISMISSED_KEY)){var cached=read("sessionStorage",SUGGESTION_KEY);if(cached!==null){apply(JSON.parse(cached));return}var query="browsing_context_suggestions.json?country[enabled]=true";window.Shopify.country&&(query+="&country[exclude]="+encodeURIComponent(window.Shopify.country)),fetch(window.Shopify.routes.root+query,{headers:{Accept:"application/json"}}).then(function(response){if(!response.ok)throw new Error("SUGGESTION REQUEST REFUSED : HTTP "+response.status);return response.json()}).then(function(payload){var suggestion=pick(payload);write("sessionStorage",SUGGESTION_KEY,JSON.stringify(suggestion)),apply(suggestion)}).catch(function(){})}}document.querySelectorAll("[data-local-site-bar]").forEach(init),document.addEventListener("shopify:section:load",function(event){var bar=event.target.querySelector("[data-local-site-bar]");bar&&init(bar)})})();
2//# sourceMappingURL=/cdn/shop/t/27/assets/local-site-bar.js.map?v=6841531312481169841789079771

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.