{"version":3,"file":"productCarousel-BEV0J5u9.js","sources":["../../../app/javascript/modules/productCarousel.js"],"sourcesContent":["import Flickity from \"flickity\";\n\nwindow.initializeProductCarousel = () => {\n // Loop through and set up any product carousels\n // (product page, landing page, the fold)\n const carousels = document.querySelectorAll(\".products-carousel\");\n\n carousels.forEach(carousel => {\n const isFold = !!carousel.closest(\".article-products-carousel\");\n const options = {\n pageDots: true,\n contain: true,\n cellAlign: isFold ? \"center\" : \"left\",\n groupCells: true,\n imagesLoaded: true,\n cellSelector: \".carousel-cell\",\n // These events work around ios 11.3+ bug\n // https://github.com/metafizzy/flickity/issues/740\n on: {\n dragStart() {\n document.ontouchmove = e => {\n e.preventDefault();\n };\n },\n\n dragEnd() {\n document.ontouchmove = () => {\n return true;\n };\n }\n }\n };\n\n const flkty = new Flickity(carousel, options);\n\n flkty.on(\"resize\", () => {\n const isSingleSlide = flkty.slides.length < 2;\n carousel.classList.toggle(\"is-single-slide\", isSingleSlide);\n });\n\n // Trigger a resize event to\n flkty.resize();\n });\n};\n\nwindow.initializeProductCarousel();\n"],"names":["carousel","options","e","flkty","Flickity","isSingleSlide"],"mappings":"wCAEA,OAAO,0BAA4B,IAAM,CAGrB,SAAS,iBAAiB,oBAAoB,EAEtD,QAAQA,GAAY,CAE5B,MAAMC,EAAU,CACd,SAAU,GACV,QAAS,GACT,UAJa,CAAC,CAACD,EAAS,QAAQ,4BAA4B,EAIxC,SAAW,OAC/B,WAAY,GACZ,aAAc,GACd,aAAc,iBAGd,GAAI,CACF,WAAY,CACV,SAAS,YAAcE,GAAK,CAC1BA,EAAE,eAAgB,CACnB,CACF,EAED,SAAU,CACR,SAAS,YAAc,IACd,EAEnB,CACA,CACK,EAEKC,EAAQ,IAAIC,EAASJ,EAAUC,CAAO,EAE5CE,EAAM,GAAG,SAAU,IAAM,CACvB,MAAME,EAAgBF,EAAM,OAAO,OAAS,EAC5CH,EAAS,UAAU,OAAO,kBAAmBK,CAAa,CAChE,CAAK,EAGDF,EAAM,OAAQ,CAClB,CAAG,CACH,EAEA,OAAO,0BAA2B"}