1document.addEventListener("DOMContentLoaded",function(){const availabilityMap={good:{class:"good",text:"Hyvin saatavilla"},low:{class:"low",text:"Viel\xE4 muutama"},"out of stock":{class:"out-of-stock",text:"Ei saatavilla"},default:{class:"not-available",text:"Ei saatavilla"}},currentProductId=document.querySelector("[data-product-id]")?.getAttribute("data-product-id"),statusLocations=document.querySelectorAll(".single_store");statusLocations.forEach(location=>{location.addEventListener("click",function(){statusLocations.forEach(loc=>loc.classList.remove("highlight")),location.classList.add("highlight");const storeData={city:location.getAttribute("data-city"),name:location.getAttribute("data-name"),availability:location.getAttribute("data-availability"),productId:currentProductId};localStorage.setItem("storeData",JSON.stringify(storeData)),updateStoreDisplay()})});function updateStoreDisplay(){const retrievedStoreData=JSON.parse(localStorage.getItem("storeData")),targetDiv=document.querySelector("#target-item");console.log("STORAGE DATA USED:",retrievedStoreData);const currentProductId2=document.querySelector("[data-product-id]")?.getAttribute("data-product-id");console.log(currentProductId2,"SECOND ID");const availableStores=[...document.querySelectorAll(".single_store")].map(store=>({name:store.getAttribute("data-name"),availability:store.getAttribute("data-availability")}));if(retrievedStoreData&&retrievedStoreData.productId!==currentProductId2){const matchingStore=availableStores.find(store=>store.name===retrievedStoreData.name);if(matchingStore)console.log("Switching products, updating availability for existing store."),retrievedStoreData.availability=matchingStore.availability,localStorage.setItem("storeData",JSON.stringify(retrievedStoreData));else{localStorage.removeItem("storeData");return}}if(retrievedStoreData&&targetDiv){let storeDiv=targetDiv.nextElementSibling;if(!storeDiv||!storeDiv.classList.contains("single_store")){storeDiv=document.createElement("div"),storeDiv.className="single_store";const{availability}=retrievedStoreData,{class:statusClass,text:statusText2}=availabilityMap[availability]||availabilityMap.default;storeDiv.innerHTML=` 2 <div class="store-availability-container"> 3 <p id="status-location-text" class="status-location"></p> 4 <div class="dots-container" style="display:flex; align-items:center;"> 5 <span class="status-dot ${statusClass}"></span> 6 <p is="toggle-button" aria-controls="{{ drawer_id }}" aria-expanded="false" id="status-location-status"> 7 ${statusText2} 8 </p> 9 </div> 10 </div> 11 `,targetDiv.insertAdjacentElement("afterend",storeDiv)}storeDiv.querySelector(".status-location").textContent=`${retrievedStoreData.city}: ${retrievedStoreData.name}`;const statusDot=storeDiv.querySelector(".status-dot");statusDot.classList.forEach(className=>{className!=="status-dot"&&statusDot.classList.remove(className)});let safeClassName=retrievedStoreData.availability.replace(/\s+/g,"-");statusDot.classList.add(safeClassName);const statusText=storeDiv.querySelector("#status-location-status"),availabilityData=availabilityMap[retrievedStoreData.availability]||availabilityMap.default;statusText.textContent=availabilityData.text}}updateStoreDisplay(),window.addEventListener("storage",function(event){event.key==="storeData"&&updateStoreDisplay()})}); 12//# sourceMappingURL=/cdn/shop/t/225/assets/store-checker.js.map?v=51479892294304548561773395829
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.