{"version":3,"sources":["webpack:///./cartridges/app_accelerator_core/cartridge/client/default/js/product/productImageGalleryItem.js"],"names":["_setProgressbarPosition","event","slick","currentSlide","nextSlide","_ele","$","currentTarget","parents","_sliderProgress","find","_imgLength","length","_sliderProgressWidth","_sliderProgressLeft","_getScreenDirection","attr","css","width","marginRight","marginLeft","_setProgressbarPositionOnLoad","ImageItem","addClass","productImageGalleryItemInit","product_pdp","document","querySelector","slickList","allsilckTrack","forEach","call","on"],"mappings":";;;;;;;;;;AACA;AAAA;AAAA;AAAA;AAAa;;AAEN,SAASA,uBAAuBA,CAACC,KAAK,EAAEC,KAAK,EAAEC,YAAY,EAAEC,SAAS,EAAE;EAC3E,IAAIC,IAAI,GAAGC,CAAC,CAACL,KAAK,CAACM,aAAa,CAAC,CAACC,OAAO,CAAC,2BAA2B,CAAC;IAClEC,eAAe,GAAGJ,IAAI,CAACK,IAAI,CAAC,wBAAwB,CAAC;IACrDC,UAAU,GAAGL,CAAC,CAACL,KAAK,CAACM,aAAa,CAAC,CAACG,IAAI,CAAC,uBAAuB,CAAC,CAACE,MAAM;IACxEC,oBAAoB,GAAG,GAAG,GAAGF,UAAU;IACvCG,mBAAmB,GAAGD,oBAAoB,GAAGT,SAAS;IACtDW,mBAAmB,GAAGT,CAAC,CAACL,KAAK,CAACM,aAAa,CAAC,CAACC,OAAO,CAAC,MAAM,CAAC,CAACQ,IAAI,CAAC,KAAK,CAAC;EAC5EP,eAAe,CAACQ,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;EACpCR,eAAe,CAACS,KAAK,CAACL,oBAAoB,GAAG,GAAG,CAAC;EACjD,IAAIE,mBAAmB,IAAI,KAAK,EAAE;IAC9BN,eAAe,CAACQ,GAAG,CAAC;MAAEE,WAAW,EAAEL,mBAAmB,GAAG;IAAI,CAAC,CAAC;EACnE,CAAC,MAAM;IACHL,eAAe,CAACQ,GAAG,CAAC;MAAEG,UAAU,EAAEN,mBAAmB,GAAG;IAAI,CAAC,CAAC;EAClE;AACJ;AAEO,SAASO,6BAA6BA,CAACC,SAAS,EAAE;EACrD,IAAIjB,IAAI,GAAGC,CAAC,CAACgB,SAAS,CAAC;IACnBX,UAAU,GAAGN,IAAI,CAACK,IAAI,CAAC,uBAAuB,CAAC,CAACE,MAAM;IACtDC,oBAAoB,GAAG,GAAG,GAAGF,UAAU;EAC3CL,CAAC,CAAC,wBAAwB,CAAC,CAACW,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;EAChD,IAAIN,UAAU,GAAG,CAAC,EAAE;IAChBL,CAAC,CAAC,wBAAwB,CAAC,CAACY,KAAK,CAACL,oBAAoB,GAAG,GAAG,CAAC;EACjE,CAAC,MAAM;IACHP,CAAC,CAAC,wBAAwB,CAAC,CAACiB,QAAQ,CAAC,QAAQ,CAAC;EAClD;AACJ;AAEO,SAASC,2BAA2BA,CAAA,EAAG;EAC1C,IAAIC,WAAW,GAAGC,QAAQ,CAACC,aAAa,CAAC,uBAAuB,CAAC;IAC7DC,SAAS,GAAGtB,CAAC,CAACmB,WAAW,CAAC,CAACf,IAAI,CAAC,aAAa,CAAC;IAC9CmB,aAAa,GAAGvB,CAAC,CAACsB,SAAS,CAAC,CAAClB,IAAI,CAAC,cAAc,CAAC;EACrD,EAAE,CAACoB,OAAO,CAACC,IAAI,CAACF,aAAa,EAAE,UAASP,SAAS,EAAE;IAC/CD,6BAA6B,CAACC,SAAS,CAAC;EAC5C,CAAC,CAAC;EACFhB,CAAC,CAAC,uBAAuB,CAAC,CAAC0B,EAAE,CAAC,cAAc,EAAE,UAAS/B,KAAK,EAAEC,KAAK,EAAEC,YAAY,EAAEC,SAAS,EAAE;IAC1FJ,uBAAuB,CAACC,KAAK,EAAEC,KAAK,EAAEC,YAAY,EAAEC,SAAS,CAAC;EAClE,CAAC,CAAC;AAEN,C","file":"1.js","sourcesContent":["\n'use strict';\n\nexport function _setProgressbarPosition(event, slick, currentSlide, nextSlide) {\n let _ele = $(event.currentTarget).parents('.product-gallery__wrapper'),\n _sliderProgress = _ele.find('.swiper-scrollbar-drag'),\n _imgLength = $(event.currentTarget).find('.product-gallery__col').length,\n _sliderProgressWidth = 100 / _imgLength,\n _sliderProgressLeft = _sliderProgressWidth * nextSlide,\n _getScreenDirection = $(event.currentTarget).parents('html').attr('dir');\n _sliderProgress.css('bottom', '7px');\n _sliderProgress.width(_sliderProgressWidth + '%');\n if (_getScreenDirection == 'rtl') {\n _sliderProgress.css({ marginRight: _sliderProgressLeft + '%' });\n } else {\n _sliderProgress.css({ marginLeft: _sliderProgressLeft + '%' });\n }\n}\n\nexport function _setProgressbarPositionOnLoad(ImageItem) {\n let _ele = $(ImageItem),\n _imgLength = _ele.find('.product-gallery__col').length,\n _sliderProgressWidth = 100 / _imgLength;\n $('.swiper-scrollbar-drag').css('bottom', '7px');\n if (_imgLength > 1) {\n $('.swiper-scrollbar-drag').width(_sliderProgressWidth + '%');\n } else {\n $('.swiper-scrollbar-drag').addClass('hidden');\n }\n}\n\nexport function productImageGalleryItemInit() {\n let product_pdp = document.querySelector('.product-gallery--pdp'),\n slickList = $(product_pdp).find('.slick-list'),\n allsilckTrack = $(slickList).find('.slick-track');\n [].forEach.call(allsilckTrack, function(ImageItem) {\n _setProgressbarPositionOnLoad(ImageItem);\n });\n $('.product-gallery--pdp').on('beforeChange', function(event, slick, currentSlide, nextSlide) {\n _setProgressbarPosition(event, slick, currentSlide, nextSlide);\n });\n\n}\n"],"sourceRoot":""}