{"version":3,"sources":["hero-slider.js"],"names":["_toConsumableArray","arr","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","TypeError","o","minLen","_arrayLikeToArray","n","Object","prototype","toString","call","slice","constructor","name","Array","from","test","iter","Symbol","iterator","isArray","len","length","i","arr2","$","heroSlider","document","querySelector","heroSlides","querySelectorAll","fn","time","timeout","headlineContainer","setStyle","slide","styleClasses","classList","className","forEach","styleClass","includes","add","offsetHeight","height","getBoundingClientRect","subContainers","container","style","paddingTop","concat","slick","accessibility","slidesToShow","slidesToScroll","adaptiveHeight","draggable","swipe","dots","autoplay","autoplaySpeed","arrows","responsive","breakpoint","settings","on","event","currentSlide","nextSlide","$slides","get","window","addEventListener","_arguments","arguments","_this","this","clearTimeout","setTimeout","functionCall","apply","jQuery"],"mappings":"AAAA,aAEA,SAASA,mBAAmBC,GAAO,OAAOC,mBAAmBD,IAAQE,iBAAiBF,IAAQG,4BAA4BH,IAAQI,oBAAsB,CACxJ,SAASA,qBAAuB,MAAM,IAAIC,UAAU,uIAAyI,CAC7L,SAASF,4BAA4BG,EAAGC,GAAU,GAAKD,EAAL,CAAgB,GAAiB,iBAANA,EAAgB,OAAOE,kBAAkBF,EAAGC,GAAS,IAAIE,EAAIC,OAAOC,UAAUC,SAASC,KAAKP,GAAGQ,MAAM,GAAI,GAAiE,MAAnD,WAANL,GAAkBH,EAAES,cAAaN,EAAIH,EAAES,YAAYC,MAAgB,QAANP,GAAqB,QAANA,EAAoBQ,MAAMC,KAAKZ,GAAc,cAANG,GAAqB,2CAA2CU,KAAKV,GAAWD,kBAAkBF,EAAGC,QAAzG,CAA7O,CAA+V,CAC/Z,SAASL,iBAAiBkB,GAAQ,GAAsB,oBAAXC,QAAmD,MAAzBD,EAAKC,OAAOC,WAA2C,MAAtBF,EAAK,cAAuB,OAAOH,MAAMC,KAAKE,EAAO,CAC7J,SAASnB,mBAAmBD,GAAO,GAAIiB,MAAMM,QAAQvB,GAAM,OAAOQ,kBA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AgFT,WACRa,GACD,EAlFsBZ,EAkFnB,IA/EI,WAAA,IAAA0C,EAAAC,UAAAC,EAAAC,KAGNC,aAAc7C,GACdA,EAAU8C,YAHW,WAAfC,OAAqBjD,EAAGkD,MAAOL,EAAMD,EAAAA,GAGP3C,EACrC,GAjBD,CA8FD,CArGC,CAqGEkD","file":"../hero-slider.js","sourcesContent":["(function($) {\n\n\tconst heroSlider = document.querySelector( '.hero__slider' );\n\tconst heroSlides = document.querySelectorAll( '.hero__slide' );\n\n\tif ( !heroSlider ) {\n\t\treturn;\n\t}\n\n\tconst headlineContainer = document.querySelector( '.headline__container' );\n\n\t/**\n\t * Standard debounce function\n\t * @param {function} fn - The function to call\n\t * @param {function} time - How long to wait\n\t */\n\tconst debounce = ( fn, time ) => {\n\t\tlet timeout;\n\n\t\treturn function() {\n\t\t\tconst functionCall = () => fn.apply( this, arguments );\n\n\t\t\tclearTimeout( timeout );\n\t\t\ttimeout = setTimeout( functionCall, time );\n\t\t};\n\t};\n\n\t/**\n\t * Set header styles per slide\n\t * @param {Object} slide - The slide to target\n\t */\n\tconst setStyle = ( slide ) => {\n\t\tif ( !headlineContainer ) {\n\t\t\treturn;\n\t\t}\n\t\tconst styleClasses = [ ...slide.classList ];\n\t\theadlineContainer.className = 'headline__container';\n\t\tstyleClasses.forEach(styleClass => {\n\t\t\tif ( styleClass.includes( 'hero__slide' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\theadlineContainer.classList.add( styleClass );\n\t\t});\n\t}\n\n\t/**\n\t * Adjust subtitle offset by headline height\n\t */\n\tconst offsetHeight = () => {\n\t\tif ( !headlineContainer ) {\n\t\t\treturn;\n\t\t}\n\t\tconst height = headlineContainer.getBoundingClientRect().height;\n\t\tconst subContainers = document.querySelectorAll( '.content__container--top' );\n\t\tif ( subContainers.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\t\tsubContainers.forEach(container => {\n\t\t\tcontainer.style.paddingTop = `${height}px`;\n\t\t});\n\t}\n\n\tsetStyle(heroSlides[0]);\n\toffsetHeight();\n\n\tif ( heroSlides.length > 1 ) {\n\t\t// Initialize slick slider\n\t\t$( '.hero__slider' )\n\t\t\t.slick({\n\t\t\t\taccessibility: true,\n\t\t\t\tslidesToShow: 1,\n\t\t\t\tslidesToScroll: 1,\n\t\t\t\tadaptiveHeight: true,\n\t\t\t\tdraggable: true,\n\t\t\t\tswipe: true,\n\t\t\t\tdots: true,\n\t\t\t\tautoplay: true,\n\t\t\t\tautoplaySpeed: 6000,\n\t\t\t\tarrows: false,\n\t\t\t\tresponsive: [\n\t\t\t\t\t{\n\t\t\t\t\t\tbreakpoint: 768,\n\t\t\t\t\t\tsettings: {\n\t\t\t\t\t\t\tdots: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t})\n\t\t\t.on('beforeChange', function( event, slick, currentSlide, nextSlide ) {\n\t\t\t\tconst slide = slick.$slides.get( nextSlide ).querySelector( '.hero__slide' );\n\t\t\t\tsetStyle( slide );\n\t\t\t});\n\t}\n\n\twindow.addEventListener(\n\t\t'resize',\n\t\tdebounce(() => {\n\t\t\toffsetHeight();\n\t\t}, 300)\n\t);\n\n})(jQuery); // Using jQuery for Slick Slider\n"]}