PageSourceSearch

https://vanketo.co/cdn/shop/t/71/assets/variant-metafields.js?v=39263697972020567981773762304

js vanketo.co collected 2026-10-04 21:03:48 UTC 3,563 bytes, 2 lines download raw bytes

1(function(){function getContainerFromTarget(target){return target.closest("[data-custom-metafield]")}function setHiddenValue(container,value){const input=container.querySelector(".custom-metafield-input");input&&(input.value=value,input.setAttribute("value",value))}function syncToggle(container){const radios=container.querySelectorAll('input[type="radio"]'),toggle=container.querySelector(".custom-metafield-toggle");if(!radios.length||!toggle)return;const checkedRadio=Array.from(radios).find(radio=>radio.checked)||radios[0],checkedIndex=Array.from(radios).indexOf(checkedRadio);setHiddenValue(container,checkedRadio.value),toggle.classList.toggle("active",checkedIndex===1),toggle.classList.toggle("is-on",checkedIndex===1),toggle.setAttribute("aria-pressed",checkedIndex===1?"true":"false")}function syncPills(container){const active=container.querySelector(".custom-metafield-pill.active"),first=container.querySelector(".custom-metafield-pill"),current=active||first;current&&(container.querySelectorAll(".custom-metafield-pill").forEach(btn=>{btn.classList.remove("active")}),current.classList.add("active"),setHiddenValue(container,current.dataset.value||""))}function initCustomMetafields(scope){scope.querySelectorAll("[data-custom-metafield]").forEach(container=>{const type=container.dataset.type;type==="pills"&&syncPills(container),type==="toggle"&&syncToggle(container)})}function stopCustomEvent(event){getContainerFromTarget(event.target)&&event.stopPropagation()}document.addEventListener("click",function(event){stopCustomEvent(event);const pill=event.target.closest(".custom-metafield-pill");if(!pill)return;event.preventDefault();const container=pill.closest('[data-custom-metafield][data-type="pills"]');if(!container)return;container.querySelectorAll(".custom-metafield-pill").forEach(btn=>btn.classList.remove("active")),pill.classList.add("active"),setHiddenValue(container,pill.dataset.value||"")},!0),document.addEventListener("keydown",function(event){const toggle=event.target.closest(".custom-metafield-toggle");if(!toggle||(stopCustomEvent(event),event.key!=="Enter"&&event.key!==" "))return;event.preventDefault();const container=toggle.closest('[data-custom-metafield][data-type="toggle"]');if(!container)return;const radios=container.querySelectorAll('input[type="radio"]');if(radios.length<2)return;const secondChecked=radios[1].checked;radios[0].checked=secondChecked,radios[1].checked=!secondChecked,syncToggle(container)},!0),document.addEventListener("click",function(event){const toggle=event.target.closest(".custom-metafield-toggle");if(!toggle)return;stopCustomEvent(event),event.preventDefault();const container=toggle.closest('[data-custom-metafield][data-type="toggle"]');if(!container)return;const radios=container.querySelectorAll('input[type="radio"]');if(radios.length<2)return;const secondChecked=radios[1].checked;radios[0].checked=secondChecked,radios[1].checked=!secondChecked,syncToggle(container)},!0),document.addEventListener("change",function(event){const radio=event.target.closest('[data-custom-metafield][data-type="toggle"] input[type="radio"]');if(!radio)return;stopCustomEvent(event);const container=radio.closest('[data-custom-metafield][data-type="toggle"]');container&&syncToggle(container)},!0),document.addEventListener("DOMContentLoaded",function(){initCustomMetafields(document)}),document.addEventListener("shopify:section:load",function(event){initCustomMetafields(event.target)})})();
2//# sourceMappingURL=/cdn/shop/t/71/assets/variant-metafields.js.map?v=39263697972020567981773762304

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.