1jQuery(document).ready(function($){function debounce(func,wait){let timeout;return function executedFunction(...args){const later=()=>{clearTimeout(timeout);func(...args)};clearTimeout(timeout);timeout=setTimeout(later,wait)}} 2function showLoading($showcase){$showcase.find('.loading-overlay').fadeIn(150);$showcase.find('.products-grid').addClass('loading')} 3function hideLoading($showcase){$showcase.find('.loading-overlay').fadeOut(150);$showcase.find('.products-grid').removeClass('loading')} 4const handleTabClick=debounce(function($button){const $showcase=$button.closest('.product-showcase-block');const category=$button.data('category');if($button.hasClass('active')){return} 5$showcase.find('.tab-button').removeClass('active');$button.addClass('active');loadProducts($showcase,category,1)},200);$(document).on('click','.product-showcase-block .tab-button',function(e){e.preventDefault();handleTabClick($(this))});$(document).on('click','.product-showcase-block .pagination-wrapper a',function(e){e.preventDefault();const $link=$(this);const $showcase=$link.closest('.product-showcase-block');const page=parseInt($link.data('page'))||1;const category=$showcase.find('.tab-button.active').data('category')||'all';loadProducts($showcase,category,page);$('html, body').animate({scrollTop:$showcase.offset().top-100},300)});let currentRequest=null;function loadProducts($showcase,category,page){if(currentRequest&¤tRequest.readyState!==4){currentRequest.abort()} 6const $grid=$showcase.find('.products-grid');const $pagination=$showcase.find('.product-pagination');showLoading($showcase);const postsPerPage=$showcase.data('posts-per-page')||4;currentRequest=$.ajax({url:productShowcaseAjax.ajaxUrl,type:'POST',data:{action:'product_showcase_filter',category:category,paged:page,postsPerPage:postsPerPage,},timeout:10000,success:function(response){if(response.success&&response.data){$grid.fadeOut(150,function(){$grid.html(response.data.products_html);$grid.fadeIn(150);triggerLazyLoading($grid)});if(response.data.pagination_html){$pagination.html(response.data.pagination_html)}else{$pagination.empty()}}else{console.error('Error loading products:',response);$grid.html('<p class="no-products">Error loading products. Please try again.</p>')}},error:function(xhr,status,error){if(status!=='abort'){console.error('AJAX Error:',error);$grid.html('<p class="no-products">Error loading products. Please check your connection and try again.</p>')}},complete:function(xhr,status){if(status!=='abort'){hideLoading($showcase)} 7currentRequest=null}})} 8function triggerLazyLoading($container){if('IntersectionObserver' in window){const imageObserver=new IntersectionObserver(function(entries,observer){entries.forEach(function(entry){if(entry.isIntersecting){const img=entry.target;if(img.dataset.src){img.src=img.dataset.src;img.removeAttribute('data-src')} 9img.classList.remove('lazy');observer.unobserve(img)}})});$container.find('img[loading="lazy"]').each(function(){imageObserver.observe(this)})}} 10const handleResize=debounce(function(){$('.products-grid').each(function(){const $grid=$(this);if($grid.is(':visible')){$grid[0].offsetHeight}})},250);$(window).on('resize',handleResize);let isProcessing=!1;$(document).on('click','.tab-button, .pagination-wrapper a',function(e){if(isProcessing){e.preventDefault();return!1} 11isProcessing=!0;setTimeout(()=>{isProcessing=!1},500)});$(document).on('mouseenter','.pagination-wrapper .next',function(){const $link=$(this);const $showcase=$link.closest('.product-showcase-block');const nextPage=parseInt($link.data('page'));const category=$showcase.find('.tab-button.active').data('category')||'all';const postsPerPage=$showcase.data('posts-per-page')||4;$.ajax({url:productShowcaseAjax.ajaxUrl,type:'POST',data:{action:'product_showcase_filter',category:category,paged:nextPage,postsPerPage:postsPerPage,},timeout:5000,success:function(response){},error:function(){}})});$(document).ready(function(){$('.product-showcase-block').each(function(){triggerLazyLoading($(this))})})})
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.