PageSourceSearch

https://www.youngla.com/cdn/shop/t/205/assets/product-carousel.js?v=113669322309654328651784155078

js youngla.com collected 2026-09-25 18:53:02 UTC 7,959 bytes, 2 lines download raw bytes

1typeof jQuery>"u"&&console.error("jQuery must be loaded before product-carousel.js");const initProductCarousels=()=>{const carouselOptions={slidesToShow:1,slidesToScroll:1,infinite:!1,dots:!1,draggable:!0,arrows:!0,prevArrow:'<button type="button" class="slick-prev" style="display: none !important;"></button>',nextArrow:'<button type="button" class="slick-next"></button>',useCSS:!0,useTransform:!0},debounce=(func,wait)=>{let timeout;return function(...args){const later=()=>{clearTimeout(timeout),func(...args)};clearTimeout(timeout),timeout=setTimeout(later,wait)}},initializedCarousels=new WeakSet;let carouselObserver;const warmImage=(img,priority)=>{!img||img.dataset.carouselWarmed==="true"||(img.dataset.carouselWarmed="true",img.loading="eager",priority&&img.setAttribute("fetchpriority",priority),typeof img.decode=="function"&&!img.complete&&img.decode().catch(()=>{}))},eagerLoadSlide=$slide=>{$slide.find('img[loading="lazy"]').each(function(){warmImage(this,"auto")})},warmSlideVideo=$slide=>{const video=$slide.find("video[data-card-video]")[0];if(!(!video||video.dataset.videoWarmed==="true")){video.dataset.videoWarmed="true",video.preload="auto";try{video.load()}catch{}}},forceCarouselImagesLoad=$carousel=>{$carousel.find(".carousel-slide").slice(0,2).each(function(){eagerLoadSlide($(this))});const firstImg=$carousel.find(".carousel-slide:first-child img").first()[0]||$carousel.find("img").first()[0];warmImage(firstImg,"high")},warmCarouselImages=$carousel=>{if($carousel.data("warmed"))return;$carousel.data("warmed",!0);const imgs=$carousel.find('img[loading="lazy"]').toArray();let index=0;const pump=()=>{const startedAt=performance.now();for(;index<imgs.length&&performance.now()-startedAt<8;)warmImage(imgs[index],"auto"),index+=1;index<imgs.length&&setTimeout(pump,60)};pump()},initializeCarousel=$carousel=>{const element=$carousel[0];if(initializedCarousels.has(element)){$carousel.hasClass("slick-initialized")&&$carousel.slick("setPosition");return}initializedCarousels.add(element),forceCarouselImagesLoad($carousel),$carousel.on("init",function(){$carousel.find("img").each(function(){this.complete||this.addEventListener("load",()=>{$carousel.hasClass("slick-initialized")&&$carousel.slick("setPosition")},{once:!0})})}),$carousel.on("beforeChange",function(event,slick,current,next){const $slides=slick.$slides;[next,next+1,next-1].forEach(i=>{i>
1=0&&i<$slides.length&&eagerLoadSlide($($slides[i]))}),next>=0&&next<$slides.length&&warmSlideVideo($($slides[next]))}),$carousel.on("touchstart pointerdown swipe beforeChange",function(){if($carousel.hasClass("slick-initialized")){const slick=$carousel.slick("getSlick"),current=slick.currentSlide;[current-1,current+1].forEach(i=>{i>=0&&i<slick.$slides.length&&warmSlideVideo($(slick.$slides[i]))})}warmCarouselImages($carousel)});try{$carousel.slick(carouselOptions)}catch(error){console.error("Error initializing carousel:",error),initializedCarousels.delete(element)}},batchInitialize=$carousels=>{$carousels.length!==0&&requestAnimationFrame(()=>{let processed=0;const batchSize=3,processBatch=()=>{$carousels.slice(processed,processed+batchSize).each(function(){initializeCarousel($(this))}),processed+=batchSize,processed<$carousels.length&&requestAnimationFrame(processBatch)};processBatch()})},initializeAllCarousels=()=>{const $carousels=$(".swipable-card");batchInitialize($carousels)};let firstImageObserver;const observeFirstCarouselImages=(root=document)=>{const selector='.swipable-card .carousel-slide:first-child img[loading="lazy"]:not([data-carousel-observed="true"])';if(!("IntersectionObserver"in window)){root.querySelectorAll(selector).forEach(img=>{img.dataset.carouselObserved="true",warmImage(img,"high")});return}firstImageObserver||(firstImageObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting&&(warmImage(entry.target,"high"),firstImageObserver.unobserve(entry.target))})},{rootMargin:"700px 0px"})),root.querySelectorAll(selector).forEach(img=>{img.dataset.carouselObserved="true",firstImageObserver.observe(img)})};observeFirstCarouselImages();let cardVideoObserver;const revealVideoOnFrame=video=>{if(video.dataset.revealed==="true")return;const show=()=>{video.dataset.revealed="true",video.classList.add("is-playing")};typeof video.requestVideoFrameCallback=="function"?video.requestVideoFrameCallback(()=>show()):video.readyState>=2?show():video.addEventListener("loadeddata",show,{once:!0})},playCardVideo=video=>{const played=video.play();played&&typeof played.then=="function"?played.then(()=>revealVideoOnFrame(video)).catch(()=>{}):revealVideoOnFrame(video)},observeCardVideos=(root=document)=>{const videos=root.querySelectorAll('video[data-card-video]:not([data-video-observed="true"])');if(videos.length){if(!("IntersectionObserver"in window)){videos.forEach(video=>{video.dataset.videoObserved="true",playCardVideo(video)});return}cardVideoObserver||(cardVideoObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{const video=entry.target;entry.isIntersecting?playCardVideo(video):video.pause()})},{threshold:.5})),videos.forEach(video=>{video.dataset.videoObserved="true",cardVideoObserver.observe(video)})}};observeCardVideos(),"IntersectionObserver"in window?(carouselObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{if(entry.isIntersecting){const $carousel=$(entry.target);$carousel.hasClass("slick-initialized")||initializeCarousel($carousel),carouselObserver.unobserve(entry.target)}})},{rootMargin:"600px 0px"}),$(".swipable-card").each(function(){carouselObserver.observe(this)})):initializeAllCarousels(),$(document).on("click",".color-swatch",function(){const color=$(this).attr("data-tooltip"),productHandle=$(this).closest(".product-card").attr("class").match(/product-card-([^\s]+)/)?.[1];if(!productHandle)return;const carousel=$(`.product-card-${productHandle} .swipable-card:visible`);if(carousel.length)try{const slides=carousel.slick("getSlick").$slides;if(slides?.length){for(let i=0;i<slides.length;i++)if($(slides[i]).attr("data-variant-color")===color){carousel.slick("slickGoTo",i);break}}}catch(error){console.error("Error handling color swatch click:",error)}});const debouncedReinitialize=debounce(()=>{document.body.offsetHeight,observeFirstCarouselImages(),observeCardVideos(),$(".swipable-card:visible").each(function(){const $carousel=$(this);$carousel.hasClass("slick-initialized")?$carousel.slick("setPosition"):"IntersectionObserver"in window?carouselObserver.observe(this):initializeCarousel($carousel)})},150),handleDynamicContent=()=>debouncedReinitialize();$(document).on("shopify:section:load shopify:section:select",handleDynamicContent).on("page:load page:change turbolinks:load pjax:end",handleDynamicContent),document.documentElement.addEventListener("theme:loading:end",()=>{setTimeout(handleDynamicContent,100),setTimeout(handleDynamicContent,500)}),$(document).on("click","collection-layout-switch button",handleDynamicContent),$(document).on("click","carousel-navigation button",function(){const buttonId=$(this).attr("id");setTimeout(()=>{$(`.featured-collections-carousel__item[data-tab-id="${buttonId}"]`).find(".color-swatch").first().trigger("click")},200)}),new MutationObserver(debounce(mutations=>{let needsUpdate=!1;mutations.forEach(mutation=>{mutation.type==="attributes"&&mutation.attributeName==="class"&&(needsUpdate=!0),mutation.type==="childList"&&mutation.addedNodes.length>0&&(needsUpdate=!0)}),needsUpdate&&handleDynamicContent()},150)).observe(document.body,{attributes:!0,attributeFilter:["class"],childList:!0,subtree:!0})};$(document).ready(()=>{try{if(typeof $.fn.slick>"u"){console.error("Slick carousel must be loaded before product-carou
1sel.js");return}requestAnimationFrame(()=>{initProductCarousels()})}catch(error){console.error("Error initializing product carousels:",error)}});
2//# sourceMappingURL=/cdn/shop/t/205/assets/product-carousel.js.map?v=113669322309654328651784155078

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.