{"version":3,"sources":["webpack:///./widgets/galleryCarousel.js","webpack:////Users/owenli/Documents/workspace/awi-woolmark-fe/node_modules/object-fit-images/dist/ofi.common-js.js"],"names":["CLS","WG","concat","GalleryCarousel","$el","_classCallCheck","this","$","isWpc","hasClass","key","value","_this2","$carousel","find","$wg","checkImage","on","slick","setLandscapeImage","handleLongCaption","$this","index","attr","siblings","removeClass","addClass","$sliderNavLine","detach","before","arrows","dots","centerMode","centerPadding","appendDots","draggable","slidesToShow","variableWidth","responsive","breakpoint","settings","adaptiveHeight","event","currentSlide","objectFitImages","handleWindowResize","handleSlidesLinks","_this3","window","carouselW","outerWidth","each","i","slide","$imgWrap","$caption","captionHtml","html","imgW","css","width","maxWidth","img","imgH","naturalHeight","naturalWidth","closest","wgW","utils","checkBP","$slide","$slickSlide","newW","height","$modal","clone","$iframe","e","data","preventDefault","append","document","length","remove","OFI","propRegex","testImg","Image","style","supportsObjectFit","supportsObjectPosition","supportsOFI","supportsCurrentSrc","currentSrc","nativeGetAttribute","getAttribute","nativeSetAttribute","setAttribute","autoModeEnabled","setPlaceholder","placeholder","call","onImageReady","callback","setTimeout","fixOne","el","parsed","getComputedStyle","fontFamily","props","exec","getStyle","ofi","skipTest","srcset","src","descriptors","get","prop","set","Object","defineProperty","ss","keepSrcUsable","err","console","picturefill","pf","_","ns","evaled","fillImg","reselect","curSrc","supported","polyfillCurrentSrc","backgroundImage","replace","backgroundPosition","backgroundRepeat","backgroundOrigin","test","backgroundSize","fix","imgs","opts","startAutoMode","getElementsByTagName","querySelectorAll","body","addEventListener","target","tagName","watchMQ","bind","getOfiImageMaybe","name","HTMLImageElement","prototype","String","hijackAttributes","module","exports"],"mappings":"i4BAIA,IACMA,EAAM,kBACNC,EAAK,IAAHC,OAAOF,EAAG,KAWLG,EAAe,WAK1B,O,EAJD,SAAAA,EAAYC,I,4FAAKC,CAAA,KAAAF,GAEhBG,KAAKF,IAAMG,EAAEH,GACbE,KAAKE,MAAQD,EAAE,QAAQE,SAAS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,GAAQ,MAEVvD,IAA2BwD,EAAKhC,WAAcvB,EAClD,OAAO,EAIK,QAATsD,EACHA,EAAOhE,SAASmE,qBAAqB,OACX,iBAATH,EACjBA,EAAOhE,SAASoE,iBAAiBJ,GACrB,WAAYA,IACxBA,EAAO,CAACA,IAIT,IAAK,IAAI7F,EAAI,EAAGA,EAAI6F,EAAK/D,OAAQ9B,IAChC6F,EAAK7F,GAAGgC,GAAO6D,EAAK7F,GAAGgC,IAAQ,CAC9B8B,SAAUgC,EAAKhC,UAEhBT,EAAOwC,EAAK7F,IAGT+F,IACHlE,SAASqE,KAAKC,iBAAiB,QAAQ,SAAU1E,GACvB,QAArBA,EAAE2E,OAAOC,SACZT,EAAInE,EAAE2E,OAAQ,CACbtC,SAAUgC,EAAKhC,cAGf,GACHhB,GAAkB,EAClB+C,EAAO,OAIJC,EAAKQ,SACR1G,OAAOuG,iBAAiB,SAAUP,EAAIW,KAAK,KAAMV,EAAM,CACtD/B,SAAUgC,EAAKhC,YAKlB8B,EAAIvD,kBAAoBA,EACxBuD,EAAItD,uBAAyBA,EA9D7B,WACC,SAASkE,EAAiBlD,EAAImD,GAC7B,OAAOnD,EAAGtB,IAAQsB,EAAGtB,GAAKtB,MAAiB,QAAT+F,GAA2B,WAATA,GAAqBnD,EAAGtB,GAAKtB,IAAM4C,EAEnFhB,IACJoE,iBAAiBC,UAAUhE,aAAe,SAAU8D,GACnD,OAAO/D,EAAmBO,KAAKuD,EAAiBtJ,KAAMuJ,GAAOA,IAG9DC,iBAAiBC,UAAU9D,aAAe,SAAU4D,EAAMlJ,GACzD,OAAOqF,EAAmBK,KAAKuD,EAAiBtJ,KAAMuJ,GAAOA,EAAMG,OAAOrJ,MAsD7EsJ,GAEAC,EAAOC,QAAUnB","file":"34.js","sourcesContent":["/* eslint-disable no-invalid-this */\n/* eslint-disable max-len */\n/* eslint-disable no-unused-vars */\n// CONSTANTS are all caps.\nconst NS = 'GalleryCarousel';\nconst CLS = 'galleryCarousel';\nconst WG = `.${CLS}-`;\n\n// Import stuff here if you need to or even better to import them dynamically\n// for ex. of dynamic import check out src/scripts/loadWg/galleryCarousel.js using Webpack dynamic imports as chunks.\n// import $ from 'jquery'\n\n// Polyfill object-fit/object-position on <img>: IE9, IE10, IE11, Edge, Safari, ... @https://npm.im/object-fit-images\nimport objectFitImages from 'object-fit-images';\nimport utils from '../utils';\n\n\nexport class GalleryCarousel {\n\tconstructor($el) {\n\t\t// $el is the widget node return by the loadGalleryCarousel function\n\t\tthis.$el = $($el);\n\t\tthis.isWpc = $('body').hasClass('is-wpc');\n\t}\n\n\tinit() {\n\t\tlet $carousel = this.$el.find(`${WG}carousel`);\n\t\tlet $wg = this.$el;\n\t\tlet _this = this;\n\t\tlet navActiveClass = 'is-active';\n\t\tthis.checkImage();\n\n\t\t$carousel.on('init', (slick) => {\n\t\t\tthis.setLandscapeImage();\n\t\t\tthis.handleLongCaption();\n\n\t\t\tthis.$el.find('.sliderNav-link').on('click', function() {\n\t\t\t\tlet $this = $(this);\n\t\t\t\tlet index = $this.attr('data-slide-index');\n\n\t\t\t\t$carousel.slick('slickGoTo', index);\n\t\t\t\t$this.siblings().removeClass(navActiveClass);\n\t\t\t\t$this.addClass(navActiveClass);\n\n\t\t\t\t// detach the line and put it before the active item\n\t\t\t\tlet $sliderNavLine = $wg.find('.sliderNav-line').detach();\n\t\t\t\t$this.before($sliderNavLine);\n\t\t\t});\n\t\t}).slick({\n\t\t\tarrows: this.isWpc ? true : false,\n\t\t\tdots: this.isWpc ? true : false,\n\t\t\tcenterMode: true,\n\t\t\tcenterPadding: '26.1%',\n\t\t\tappendDots: this.$el.find(`${WG}carouselDots`),\n\t\t\tdraggable: true,\n\t\t\tslidesToShow: 1,\n\t\t\tvariableWidth: true,\n\t\t\tresponsive: [\n\t\t\t\t{\n\t\t\t\t\tbreakpoint: 991,\n\t\t\t\t\tsettings: {\n\t\t\t\t\t\tcenterPadding: '15%',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tbreakpoint: 767,\n\t\t\t\t\tsettings: {\n\t\t\t\t\t\tcenterPadding: '15%',\n\t\t\t\t\t\tvariableWidth: true,\n\t\t\t\t\t\tdots: true,\n\t\t\t\t\t\tadaptiveHeight: true, // Added to fix \"Mobile – The gallery circle indicators should sit closer to the image/caption\"\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t}).on('afterChange', (event, slick, currentSlide) => {\n\t\t\tlet $sliderNavLine = $wg.find('.sliderNav-line').detach();\n\t\t\tthis.$el.find(`.sliderNav-link`).removeClass(navActiveClass);\n\t\t\tthis.$el.find(`.sliderNav-link[data-slide-index=${currentSlide}]`).addClass(navActiveClass).before($sliderNavLine);\n\t\t});\n\n\t\t// Polyfill object-fit/object-position on <img>: IE9, IE10, IE11, Edge, Safari, ... @https://npm.im/object-fit-images\n\n\t\tobjectFitImages();\n\t\tthis.handleWindowResize();\n\n\t\tthis.handleSlidesLinks();\n\t}\n\n\thandleWindowResize() {\n\t\t$(window).on('resize', () => {\n\t\t\tthis.setLandscapeImage();\n\t\t\tthis.handleLongCaption();\n\t\t});\n\t}\n\n\t// handle long caption by setting width to caption based on image's width\n\thandleLongCaption() {\n\t\tlet $wg = this.$el;\n\t\tlet carouselW = $wg.find(`${WG}carousel`).outerWidth();\n\n\t\t$wg.find(`${WG}slide`).each((i, slide) => {\n\t\t\tlet $imgWrap = $(slide).find(`${WG}slideImgWrap`);\n\t\t\tlet $caption = $(slide).find(`${WG}carouselCaption`);\n\n\t\t\tlet captionHtml = $caption.html();\n\t\t\t$caption.html('');\n\n\t\t\tlet imgW = `${$imgWrap.outerWidth()}px`;\n\t\t\t$caption.css({\n\t\t\t\twidth: imgW,\n\t\t\t\tmaxWidth: `${carouselW}px`,\n\t\t\t});\n\t\t\t$caption.html(captionHtml);\n\t\t});\n\t}\n\n\t// check image is landscape or portrait, then add \"--landscape\" modifier if true\n\tcheckImage() {\n\t\tlet $wg = this.$el;\n\n\t\t$wg.find(`${WG}slideImg`).each((i, img) => {\n\t\t\tlet imgH = img.naturalHeight;\n\t\t\tlet imgW = img.naturalWidth;\n\n\t\t\tif (imgW > imgH) {\n\t\t\t\t$(img).closest(`${WG}slide`).addClass(`${CLS}-slide--landscape`);\n\t\t\t}\n\t\t});\n\t}\n\n\t// set slick slide's width on mobile\n\tsetLandscapeImage() {\n\t\tlet $wg = this.$el;\n\t\tlet wgW = $wg.outerWidth();\n\n\t\tif (utils.checkBP('tp')) {\n\t\t\t$wg.find(`${WG}slide`).each((i, slide) => {\n\t\t\t\tlet $slide = $(slide);\n\t\t\t\tlet $slickSlide = $slide.closest('.slick-slide');\n\t\t\t\tlet newW = wgW - (wgW * 40/100);\n\n\t\t\t\t// check if image is landscape\n\t\t\t\tif ($slide.hasClass(`${CLS}-slide--landscape`)) {\n\t\t\t\t\t$slickSlide.css({\n\t\t\t\t\t\tmaxWidth: `${wgW - 30}px`,\n\t\t\t\t\t});\n\n\t\t\t\t\t$slide.find(`${WG}slideImgWrap`).css({\n\t\t\t\t\t\theight: 'auto',\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t$slickSlide.css({\n\t\t\t\t\t\tmaxWidth: `${newW}px`,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\t$wg.find(`.slick-slide`).css({\n\t\t\t\tmaxWidth: '',\n\t\t\t});\n\n\t\t\t$wg.find(`${WG}slideImgWrap`).css({\n\t\t\t\theight: '',\n\t\t\t});\n\t\t}\n\t}\n\n\thandleSlidesLinks() {\n\t\tlet $wg = this.$el;\n\t\tlet $modal = $wg.find(WG + 'modal').clone();\n\t\tlet $iframe = $modal.find('iframe');\n\n\t\tlet closeIframe = function() {\n\t\t\t$modal.removeClass('active').remove();\n\n\t\t\t$iframe.attr('src', '');\n\t\t};\n\n\t\t$wg.on('click', WG + 'slideLink', function(e) {\n\t\t\tif ($(this).data('iframe')) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\t$iframe.attr('src', $(this).attr('href'));\n\n\t\t\t\t$('body').append($modal);\n\n\t\t\t\t$modal.addClass('active');\n\t\t\t}\n\t\t});\n\n\t\t$(document).on('click', WG + 'modal-close,' + WG + 'modal', function(e) {\n\t\t\tlet $this = $(this);\n\n\t\t\tif ($this.closest(WG + 'modal-content').length === 0) {\n\t\t\t\tcloseIframe();\n\t\t\t}\n\t\t});\n\t}\n}\n","/*! npm.im/object-fit-images 3.2.4 */\n'use strict';\n\nvar OFI = 'bfred-it:object-fit-images';\nvar propRegex = /(object-fit|object-position)\\s*:\\s*([-.\\w\\s%]+)/g;\nvar testImg = typeof Image === 'undefined' ? {style: {'object-position': 1}} : new Image();\nvar supportsObjectFit = 'object-fit' in testImg.style;\nvar supportsObjectPosition = 'object-position' in testImg.style;\nvar supportsOFI = 'background-size' in testImg.style;\nvar supportsCurrentSrc = typeof testImg.currentSrc === 'string';\nvar nativeGetAttribute = testImg.getAttribute;\nvar nativeSetAttribute = testImg.setAttribute;\nvar autoModeEnabled = false;\n\nfunction createPlaceholder(w, h) {\n\treturn (\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='\" + w + \"' height='\" + h + \"'%3E%3C/svg%3E\");\n}\n\nfunction polyfillCurrentSrc(el) {\n\tif (el.srcset && !supportsCurrentSrc && window.picturefill) {\n\t\tvar pf = window.picturefill._;\n\t\t// parse srcset with picturefill where currentSrc isn't available\n\t\tif (!el[pf.ns] || !el[pf.ns].evaled) {\n\t\t\t// force synchronous srcset parsing\n\t\t\tpf.fillImg(el, {reselect: true});\n\t\t}\n\n\t\tif (!el[pf.ns].curSrc) {\n\t\t\t// force picturefill to parse srcset\n\t\t\tel[pf.ns].supported = false;\n\t\t\tpf.fillImg(el, {reselect: true});\n\t\t}\n\n\t\t// retrieve parsed currentSrc, if any\n\t\tel.currentSrc = el[pf.ns].curSrc || el.src;\n\t}\n}\n\nfunction getStyle(el) {\n\tvar style = getComputedStyle(el).fontFamily;\n\tvar parsed;\n\tvar props = {};\n\twhile ((parsed = propRegex.exec(style)) !== null) {\n\t\tprops[parsed[1]] = parsed[2];\n\t}\n\treturn props;\n}\n\nfunction setPlaceholder(img, width, height) {\n\t// Default: fill width, no height\n\tvar placeholder = createPlaceholder(width || 1, height || 0);\n\n\t// Only set placeholder if it's different\n\tif (nativeGetAttribute.call(img, 'src') !== placeholder) {\n\t\tnativeSetAttribute.call(img, 'src', placeholder);\n\t}\n}\n\nfunction onImageReady(img, callback) {\n\t// naturalWidth is only available when the image headers are loaded,\n\t// this loop will poll it every 100ms.\n\tif (img.naturalWidth) {\n\t\tcallback(img);\n\t} else {\n\t\tsetTimeout(onImageReady, 100, img, callback);\n\t}\n}\n\nfunction fixOne(el) {\n\tvar style = getStyle(el);\n\tvar ofi = el[OFI];\n\tstyle['object-fit'] = style['object-fit'] || 'fill'; // default value\n\n\t// Avoid running where unnecessary, unless OFI had already done its deed\n\tif (!ofi.img) {\n\t\t// fill is the default behavior so no action is necessary\n\t\tif (style['object-fit'] === 'fill') {\n\t\t\treturn;\n\t\t}\n\n\t\t// Where object-fit is supported and object-position isn't (Safari < 10)\n\t\tif (\n\t\t\t!ofi.skipTest && // unless user wants to apply regardless of browser support\n\t\t\tsupportsObjectFit && // if browser already supports object-fit\n\t\t\t!style['object-position'] // unless object-position is used\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// keep a clone in memory while resetting the original to a blank\n\tif (!ofi.img) {\n\t\tofi.img = new Image(el.width, el.height);\n\t\tofi.img.srcset = nativeGetAttribute.call(el, \"data-ofi-srcset\") || el.srcset;\n\t\tofi.img.src = nativeGetAttribute.call(el, \"data-ofi-src\") || el.src;\n\n\t\t// preserve for any future cloneNode calls\n\t\t// https://github.com/bfred-it/object-fit-images/issues/53\n\t\tnativeSetAttribute.call(el, \"data-ofi-src\", el.src);\n\t\tif (el.srcset) {\n\t\t\tnativeSetAttribute.call(el, \"data-ofi-srcset\", el.srcset);\n\t\t}\n\n\t\tsetPlaceholder(el, el.naturalWidth || el.width, el.naturalHeight || el.height);\n\n\t\t// remove srcset because it overrides src\n\t\tif (el.srcset) {\n\t\t\tel.srcset = '';\n\t\t}\n\t\ttry {\n\t\t\tkeepSrcUsable(el);\n\t\t} catch (err) {\n\t\t\tif (window.console) {\n\t\t\t\tconsole.warn('https://bit.ly/ofi-old-browser');\n\t\t\t}\n\t\t}\n\t}\n\n\tpolyfillCurrentSrc(ofi.img);\n\n\tel.style.backgroundImage = \"url(\\\"\" + ((ofi.img.currentSrc || ofi.img.src).replace(/\"/g, '\\\\\"')) + \"\\\")\";\n\tel.style.backgroundPosition = style['object-position'] || 'center';\n\tel.style.backgroundRepeat = 'no-repeat';\n\tel.style.backgroundOrigin = 'content-box';\n\n\tif (/scale-down/.test(style['object-fit'])) {\n\t\tonImageReady(ofi.img, function () {\n\t\t\tif (ofi.img.naturalWidth > el.width || ofi.img.naturalHeight > el.height) {\n\t\t\t\tel.style.backgroundSize = 'contain';\n\t\t\t} else {\n\t\t\t\tel.style.backgroundSize = 'auto';\n\t\t\t}\n\t\t});\n\t} else {\n\t\tel.style.backgroundSize = style['object-fit'].replace('none', 'auto').replace('fill', '100% 100%');\n\t}\n\n\tonImageReady(ofi.img, function (img) {\n\t\tsetPlaceholder(el, img.naturalWidth, img.naturalHeight);\n\t});\n}\n\nfunction keepSrcUsable(el) {\n\tvar descriptors = {\n\t\tget: function get(prop) {\n\t\t\treturn el[OFI].img[prop ? prop : 'src'];\n\t\t},\n\t\tset: function set(value, prop) {\n\t\t\tel[OFI].img[prop ? prop : 'src'] = value;\n\t\t\tnativeSetAttribute.call(el, (\"data-ofi-\" + prop), value); // preserve for any future cloneNode\n\t\t\tfixOne(el);\n\t\t\treturn value;\n\t\t}\n\t};\n\tObject.defineProperty(el, 'src', descriptors);\n\tObject.defineProperty(el, 'currentSrc', {\n\t\tget: function () { return descriptors.get('currentSrc'); }\n\t});\n\tObject.defineProperty(el, 'srcset', {\n\t\tget: function () { return descriptors.get('srcset'); },\n\t\tset: function (ss) { return descriptors.set(ss, 'srcset'); }\n\t});\n}\n\nfunction hijackAttributes() {\n\tfunction getOfiImageMaybe(el, name) {\n\t\treturn el[OFI] && el[OFI].img && (name === 'src' || name === 'srcset') ? el[OFI].img : el;\n\t}\n\tif (!supportsObjectPosition) {\n\t\tHTMLImageElement.prototype.getAttribute = function (name) {\n\t\t\treturn nativeGetAttribute.call(getOfiImageMaybe(this, name), name);\n\t\t};\n\n\t\tHTMLImageElement.prototype.setAttribute = function (name, value) {\n\t\t\treturn nativeSetAttribute.call(getOfiImageMaybe(this, name), name, String(value));\n\t\t};\n\t}\n}\n\nfunction fix(imgs, opts) {\n\tvar startAutoMode = !autoModeEnabled && !imgs;\n\topts = opts || {};\n\timgs = imgs || 'img';\n\n\tif ((supportsObjectPosition && !opts.skipTest) || !supportsOFI) {\n\t\treturn false;\n\t}\n\n\t// use imgs as a selector or just select all images\n\tif (imgs === 'img') {\n\t\timgs = document.getElementsByTagName('img');\n\t} else if (typeof imgs === 'string') {\n\t\timgs = document.querySelectorAll(imgs);\n\t} else if (!('length' in imgs)) {\n\t\timgs = [imgs];\n\t}\n\n\t// apply fix to all\n\tfor (var i = 0; i < imgs.length; i++) {\n\t\timgs[i][OFI] = imgs[i][OFI] || {\n\t\t\tskipTest: opts.skipTest\n\t\t};\n\t\tfixOne(imgs[i]);\n\t}\n\n\tif (startAutoMode) {\n\t\tdocument.body.addEventListener('load', function (e) {\n\t\t\tif (e.target.tagName === 'IMG') {\n\t\t\t\tfix(e.target, {\n\t\t\t\t\tskipTest: opts.skipTest\n\t\t\t\t});\n\t\t\t}\n\t\t}, true);\n\t\tautoModeEnabled = true;\n\t\timgs = 'img'; // reset to a generic selector for watchMQ\n\t}\n\n\t// if requested, watch media queries for object-fit change\n\tif (opts.watchMQ) {\n\t\twindow.addEventListener('resize', fix.bind(null, imgs, {\n\t\t\tskipTest: opts.skipTest\n\t\t}));\n\t}\n}\n\nfix.supportsObjectFit = supportsObjectFit;\nfix.supportsObjectPosition = supportsObjectPosition;\n\nhijackAttributes();\n\nmodule.exports = fix;\n"],"sourceRoot":""}