PageSourceSearch

https://puccicafe.com/cdn/shop/t/3/assets/collection-filter.js?v=7212165526016617961787382669

js puccicafe.com collected 2026-10-05 00:41:31 UTC 7,130 bytes, 2 lines download raw bytes

1window.addEventListener("load",event=>{applyFilters(),sortByoptions()}),window.addEventListener("resize",event=>{window.innerWidth>1024&&document.querySelector("#Collection-filter-sidebar")&&document.querySelector("#Collection-filter-sidebar").style.removeProperty("display")});let triggered=!1;function fetchFilterData(url){return fetch(url).then(response=>response.text())}function applyFilters(){let section=document.getElementById("CollectionProductsParent"),filterForm=document.getElementById("FiltersForm");if(section){let sectionParent=section.closest(".shopify-section"),sectionId=section.dataset.id;if(!filterForm)return!1;collection_price_range(sectionId,sectionParent);let inputs=filterForm.querySelectorAll("input[type=checkbox]");Array.from(inputs).forEach(function(input){input.addEventListener("click",()=>{SidedrawerEventInit(),getFilterData(input,sectionId)})})}}function sortByoptions(){let section=document.querySelector(".collection-wrapper"),sortBy=document.querySelectorAll('[name="sort_by"]');if(section){let sectionId=section.querySelector(".collection_products").dataset.id;Array.from(sortBy).forEach(function(sort){sort.addEventListener("change",e=>{e.preventDefault(),sort.closest(".collection-sortby-item").classList.remove("selected"),sort.closest(".collection-sortby-item").classList.add("selected");let sortMenu=section.querySelector(".collection-sortby-inner"),sortList=sortMenu.querySelector(".collection-sortby-detail");sortMenu.hasAttribute("open")&&DOMAnimations.slideUp(sortList),SidedrawerEventInit(),getFilterData(sort,sectionId)})})}}function getFilterData(input,sectionId,remove,minPriceRange2,maxPriceRange){let sectionParent=document.getElementById("CollectionProductsParent").closest(".shopify-section"),filterForm=document.getElementById("FiltersForm"),formData=new FormData(filterForm),searchParameters=new URLSearchParams(formData).toString(),url=window.location.pathname+"?section_id="+sectionId+"&"+searchParameters,updateUrl=window.location.pathname+"?"+searchParameters;remove&&(url=remove,updateUrl=remove);let get_html=fetchFilterData(url).then(responseText=>{let resultData=new DOMParser().parseFromString(responseText,"text/html"),itemResultcount=resultData.querySelector(".Product-result .total_products"),element=document.getElementById("CollectionProductsParent"),html=resultData.getElementById("CollectionProductsParent"),mobileSort=document.querySelector("[data-mobile-sort]"),resultMobileSort=resultData.querySelector("[data-mobile-sort]"),filter_element=document.querySelector(".collection-filter-sidebar"),filter_html=resultData.querySelector(".collection-filter-sidebar");if(element){element.innerHTML=html.innerHTML;let scrollDiv=document.getElementById("CollectionProductsParent");mobileSort&&resultMobileSort&&(mobileSort.innerHTML=resultMobileSort.innerHTML),scrollIntoView(scrollDiv),filter_element.innerHTML=filter_html.innerHTML,applyFilters(),remove_filter(sectionParent,sectionId),SidedrawerEventInit()}else{let productResultContainer=element.querySelector("[data-collection-products]");productResultContainer&&(productResultContainer.innerHTML=noResultFound)}collectionSwatch(),history.pushState({},null,updateUrl),sortByoptions(),triggered=!1,loadMoreCollection(),getCountDownElments(),quickviewElements(),customDropdownElements(),SidedrawerEventInit(),productCardHoverInit(),aosAnimation&&AOS&&AOS.refreshHard()})}function scrollIntoView(selector,offset=0){window.scroll(0,selector.offsetTop-offset)}function remove_filter(sectionParent,sectionId){var removeFilters=sectionParent.querySelectorAll("a.sr-applied-filter-remove");Array.from(removeFilters).forEach(function(removeFilter){removeFilter.addEventListener("click",function(event){if(event.preventDefault(),removeFilter.hasAttribute("sr-applied-filter-cross-all")){var _url=removeFilter.getAttribute("href");return getFilterData(removeFilter,sectionId,_url),!1}else{var _url=removeFilter.getAttribute("href");getFilterData(removeFilter,sectionId,_url)}})})}function collection_price_range(sectionId,sectionParent){const rangeInput=document.querySelectorAll(".sr-range-input input"),priceInput=document.querySelectorAll(".sr-price-input input"),range=document.querySelector("#priceSilderProgress");if(rangeInput.length>0){let priceGap=rangeInput[0].getAttribute("step");priceInput.forEach(input=>{input.addEventListener("change",e=>{let minPrice=parseInt(priceInput[0].value),maxPrice=parseInt(priceInput[1].value),maxPriceRange=parseInt(priceInput[1].getAttribute("data-max-value"));minPrice>maxPriceRange&&(minPrice=maxPriceRange,priceInput[0].value=minPrice),getFilterData(input,sectionId)})}),rangeInput.forEach(input=>{input.addEventListener("change",event=>{rangeSlider(input,event),getFilterData(input,sectionId)}),input.addEventListener("input",event=>{rangeSlider(input,event)})});var rangeSlider=function(input,event){let minVal=parseInt(rangeInput[0].value),maxVal=parseInt(rangeInput[1].value);minPriceRange=Math.max(0,minVal/rangeInput[0].max*100),maxPriceRang=Math.max(0,100-maxVal/rangeInput[1].max*100),maxVal-minVal<priceGap?event.target.className==="priceslider-range-min"?rangeInput[0].value=maxVal-priceGap:rangeInput[1].value=minVal+priceGap:(priceInput[0].value=minVal,priceInput[1].value=maxVal,range.style.left=minPriceRange+"%",range.style.right=maxPr
1iceRang+"%")}}}function Onscrollproducts(){window.addEventListener("scroll",function(){let scrollElement=document.querySelector("[data-scroll]");scrollElement&&infiniteScroll(scrollElement)})}function infiniteScroll(scrollElement){if(scrollElement&&scrollElement.querySelector("a")){let nextUrl=scrollElement.querySelector("a").getAttribute("href");isOnScreen(scrollElement)&&triggered==!1&&(triggered=!0,scrollElement.querySelector("a").remove(),scrollElement.querySelector(".load").classList.remove("hidden"),fetchFilterData(nextUrl).then(responseText=>{scrollElement.remove();let html=new DOMParser().parseFromString(responseText,"text/html").querySelector("#CollectionProductsParent"),element=document.querySelector("#CollectionProductsParent");html&&(element.querySelector("[data-collection-products]").innerHTML+=html.querySelector("[data-collection-products]").innerHTML,getCountDownElments(),triggered=!1,loadMoreCollection(),quickviewElements(),productCardHoverInit(),aosAnimation&&AOS&&AOS.refreshHard())}))}}function loadMoreCollection(section=document){let loadmoreButton=section.querySelector("[data-products-load]");loadmoreButton&&loadmoreButton.addEventListener("click",function(event){event.preventDefault();let scrollElement=loadmoreButton.closest("[data-load-more]");scrollElement&&infiniteScroll(scrollElement)})}document.addEventListener("DOMContentLoaded",function(){Onscrollproducts(),loadMoreCollection()}),document.addEventListener("shopify:block:select",function(event){let _block=event.target;Onscrollproducts(_block),loadMoreCollection(_block)}),document.addEventListener("shopify:section:load",function(event){let _section=event.target;Onscrollproducts(_section),loadMoreCollection(_section)});
2//# sourceMappingURL=/cdn/shop/t/3/assets/collection-filter.js.map?v=7212165526016617961787382669

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.