{"version":3,"sources":["webpack:///./src/js/abstracts/BaseComponent.js","webpack:///./src/js/abstracts/BaseCarousel.js","webpack:///./src/js/components/CarouselComponent.js"],"names":["BaseComponent","element","_componentElement","setAttribute","this","compOptions","options","$el","dataset","Object","keys","filter","entry","includes","forEach","optionValue","cleanEntry","cleanOptionKey","JSON","parse","replace","e2","convertType","e","console","error","Freeze","getAttribute","events","cb","elements","Bean","on","stopPropagation","one","off","fire","container","message","EMIT","CUSTOM_MESSAGES","LOADER_EVENTS","show","icon","hide","option","optionReturn","Number","key","str","charAt","toLocaleLowerCase","slice","CommonInterface","BaseCarousel","type","startAt","perView","focusAt","gap","autoplay","hoverpause","keyboard","bound","swipeThreshold","dragThreshold","perTouch","touchRatio","touchAngle","animationDuration","rewind","rewindDuration","animationTimingFunc","throttle","direction","peek","breakpoints","classes","ltr","rtl","slider","carousel","swipeable","dragging","cloneSlide","activeNav","activeSlide","disabledArrow","self","conf","BASE_CONF","glide","Glide","slideHeight","outerHeight","document","querySelector","newHeight","style","height","mount","el","offsetHeight","window","getComputedStyle","parseInt","marginTop","marginBottom","CarouselComponent","$options"],"mappings":"4dAKqBA,E,YA2CnB,WAAYC,GAAS,0BACnB,+BACKC,kBAAoBD,EACzB,EAAKC,kBAAkBC,aAAa,uBAAuB,GAHxC,E,iDAzCnB,OAAOC,KAAKF,oB,+BAGC,WACPG,EAAc,GACdC,E,iVAAU,CAAH,GAAQF,KAAKG,IAAIC,SAuB9B,OAtBuBC,OAAOC,KAAKJ,GAASK,QAAO,SAAAC,GAAK,OAAIA,EAAMC,SAAS,aAC5DC,SAAQ,SAACF,GACtB,IACE,IACIG,EADEC,EAAahB,EAAciB,eAAeL,GAEhD,GAAIN,EAAQM,GAAOC,SAAS,MAAQP,EAAQM,GAAOC,SAAS,KAG1D,IACEE,EAAcG,KAAKC,MAAMb,EAAQM,GAAOQ,QAAQ,KAAM,MACtD,MAAOC,GACPN,EAAcG,KAAKC,MAAMb,EAAQM,SAInCG,EAAcf,EA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,iBAAiBH,GAGpC,OADAF,GAAUM,SAASP,EAAMQ,UAAW,IAAMD,SAASP,EAAMS,aAAc,S,UA/OjC3G,I,mJCHrB4G,E,YACnB,WAAY3G,GAAS,0BACnB,4BAAMA,KACDmG,MAAM,EAAK7F,IAAK,EAAKsG,UAFP,E,0BADwBvD","file":"js/component-CarouselComponent-js.chunks.js","sourcesContent":["\nimport Bean from 'bean';\nimport Freeze from '../utilities/Freeze';\nimport CommonInterface from './CommonInterface';\n\nexport default class BaseComponent extends CommonInterface {\n get $el() {\n return this._componentElement;\n }\n\n get $options() {\n const compOptions = {};\n const options = { ...this.$el.dataset };\n const optionsEntires = Object.keys(options).filter(entry => entry.includes('option'));\n optionsEntires.forEach((entry) => {\n try {\n const cleanEntry = BaseComponent.cleanOptionKey(entry);\n let optionValue;\n if (options[entry].includes('{') && options[entry].includes('}')) {\n\n // PDB-786 JSON.parse(\"{\\\"address1\\\":\\\"2 Rue d'Orsel\\\"}\".replace(/'/g, '\"')) => SyntaxError: Unexpected token O in JSON at position 21\n try {\n optionValue = JSON.parse(options[entry].replace(/'/g, '\"'));\n } catch (e2) {\n optionValue = JSON.parse(options[entry]);\n }\n\n } else {\n optionValue = BaseComponent.convertType(options[entry]);\n }\n compOptions[cleanEntry] = optionValue;\n } catch (e) {\n console.error('get $options() from component => ', this._componentElement, e);\n }\n });\n return Freeze(compOptions);\n }\n\n get COMPONENT_NAME() {\n return this.$el.getAttribute('data-component');\n }\n\n /**\n *\n * constructor\n *\n * @param {Element} element\n */\n constructor(element) {\n super();\n this._componentElement = element;\n this._componentElement.setAttribute('data-component-init', true);\n }\n\n static convertType(option) {\n let optionReturn;\n if (Number(option)) return Number(option);\n switch (option) {\n case 'false':\n optionReturn = false;\n break;\n case 'true':\n optionReturn = true;\n break;\n case 'null':\n optionReturn = null;\n break;\n default:\n optionReturn = option;\n break;\n }\n\n return optionReturn;\n }\n\n static cleanOptionKey(key) {\n const str = key.replace('option', '');\n const cleanedKey = `${str.charAt(0).toLocaleLowerCase()}${str.slice(1)}`;\n return cleanedKey;\n }\n\n /**\n *\n * $on\n *\n * @param {String} events\n * @param {Function} cb\n * @param {Element} [element = this.$el]\n * @param {Array|String|Element} [elements = null]\n */\n $on(events, cb, element = this.$el, elements = null) {\n if (!element || !events || !cb) return;\n if (!elements) {\n Bean.on(element, events, (e) => {\n if (e) e.stopPropagation();\n cb(e);\n });\n } else {\n Bean.on(element, events, elements, (e) => {\n if (e) e.stopPropagation();\n cb(e);\n });\n }\n }\n\n /**\n *\n * $one\n *\n * @param {String} events\n * @param {Function} cb\n * @param {Element} [element = this.$el]\n */\n $one(events, cb, element = this.$el) {\n Bean.one(element, events, cb);\n }\n\n /**\n *\n * $off\n *\n * @param {String} events\n * @param {Element} [element = this.$el]\n */\n $off(events, element = this.$el) {\n Bean.off(element, events);\n }\n\n /**\n *\n * $fire\n *\n * @param {String} events\n * @param {Element} [element = this.$el]\n */\n $fire(events, element = this.$el) {\n Bean.fire(element, events);\n }\n\n /**\n *\n * @param {HTMLElement} [container]\n */\n loading(container, message) {\n this.EMIT(this.CUSTOM_MESSAGES.LOADER_EVENTS.show, {\n container: container || this.$el,\n message\n });\n }\n\n /**\n *\n * @param {HTMLElement} [container]\n * @param {String} [message]\n * @param {String} [icon]\n * @param {Boolean} [error=false]\n */\n endLoading(container, message, error = false, icon) {\n this.EMIT(this.CUSTOM_MESSAGES.LOADER_EVENTS.hide, {\n container: container || this.$el,\n message,\n icon,\n error\n });\n }\n}\n","import '@glidejs/glide/src/assets/sass/glide.core.scss';\nimport '@glidejs/glide/src/assets/sass/glide.theme.scss';\nimport Glide from '@glidejs/glide';\nimport BaseComponent from './BaseComponent';\n\nexport default class BaseCarousel extends BaseComponent {\n get BASE_CONF() {\n return {\n /**\n * Type of the movement.\n *\n * Available types:\n * `slider` - Rewinds slider to the start/end when it reaches the first or last slide.\n * `carousel` - Changes slides without starting over when it reaches the first or last slide.\n *\n * @type {String}\n */\n type: 'slider',\n\n /**\n * Start at specific slide number defined with zero-based index.\n *\n * @type {Number}\n */\n startAt: 0,\n\n /**\n * A number of slides visible on the single viewport.\n *\n * @type {Number}\n */\n perView: 1,\n\n /**\n * Focus currently active slide at a specified position in the track.\n *\n * Available inputs:\n * `center` - Current slide will be always focused at the center of a track.\n * `0,1,2,3...` - Current slide will be focused on the specified zero-based index.\n *\n * @type {String|Number}\n */\n focusAt: 0,\n\n /**\n * A size of the gap added between slides.\n *\n * @type {Number}\n */\n gap: 10,\n\n /**\n * Change slides after a specified interval. Use `false` for turning off autoplay.\n *\n * @type {Number|Boolean}\n */\n autoplay: false,\n\n /**\n * Stop autoplay on mouseover event.\n *\n * @type {Boolean}\n */\n hoverpause: true,\n\n /**\n * Allow for changing slides with left and right keyboard arrows.\n *\n * @type {Boolean}\n */\n keyboard: true,\n\n /**\n * Stop running `perView` number of slides from the end. Use this\n * option if you don't want to have an empty space after\n * a slider. Works only with `slider` type and a\n * non-centered `focusAt` setting.\n *\n * @type {Boolean}\n */\n bound: false,\n\n /**\n * Minimal swipe distance needed to change the slide. Use `false` for turning off a swiping.\n *\n * @type {Number|Boolean}\n */\n swipeThreshold: 15,\n\n /**\n * Minimal mouse drag distance needed to change the slide. Use `false` for turning off a dragging.\n *\n * @type {Number|Boolean}\n */\n dragThreshold: 10,\n\n /**\n * A maximum number of slides to which movement will be made on swiping or dragging. Use `false` for unlimited.\n *\n * @type {Number|Boolean}\n */\n perTouch: false,\n\n /**\n * Moving distance ratio of the slides on a swiping and dragging.\n *\n * @type {Number}\n */\n touchRatio: 0.5,\n\n /**\n * Angle required to activate slides moving on swiping or dragging.\n *\n * @type {Number}\n */\n touchAngle: 45,\n\n /**\n * Duration of the animation in milliseconds.\n *\n * @type {Number}\n */\n animationDuration: 600,\n\n /**\n * Allows looping the `slider` type. Slider will rewind to the first/last slide when it's at the start/end.\n *\n * @type {Boolean}\n */\n rewind: false,\n\n /**\n * Duration of the rewinding animation of the `slider` type in milliseconds.\n *\n * @type {Number}\n */\n rewindDuration: 1000,\n\n /**\n * Easing function for the animation.\n *\n * @type {String}\n */\n animationTimingFunc: 'cubic-bezier(.165, .840, .440, 1)',\n\n /**\n * Throttle costly events at most once per every wait milliseconds.\n *\n * @type {Number}\n */\n throttle: 10,\n\n /**\n * Moving direction mode.\n *\n * Available inputs:\n * - 'ltr' - left to right movement,\n * - 'rtl' - right to left movement.\n *\n * @type {String}\n */\n direction: 'ltr',\n\n /**\n * The distance value of the next and previous viewports which\n * have to peek in the current view. Accepts number and\n * pixels as a string. Left and right peeking can be\n * set up separately with a directions object.\n *\n * For example:\n * `100` - Peek 100px on the both sides.\n * { before: 100, after: 50 }` - Peek 100px on the left side and 50px on the right side.\n *\n * @type {Number|String|Object}\n */\n peek: 0,\n\n /**\n * Collection of options applied at specified media breakpoints.\n * For example: display two slides per view under 800px.\n * `{\n * '800px': {\n * perView: 2\n * }\n * }`\n */\n breakpoints: {},\n\n /**\n * Collection of internally used HTML classes.\n *\n * @todo Refactor `slider` and `carousel` properties to single `type: { slider: '', carousel: '' }` object\n * @type {Object}\n */\n classes: {\n direction: {\n ltr: 'glide--ltr',\n rtl: 'glide--rtl'\n },\n slider: 'glide--slider',\n carousel: 'glide--carousel',\n swipeable: 'glide--swipeable',\n dragging: 'glide--dragging',\n cloneSlide: 'glide__slide--clone',\n activeNav: 'glide__bullet--active',\n activeSlide: 'glide__slide--active',\n disabledArrow: 'glide__arrow--disabled'\n }\n };\n }\n\n constructor(element) {\n super(element);\n }\n\n mount(element, options) {\n let self = this;\n const conf = { ...this.BASE_CONF, ...options };\n let glide = new Glide(element, conf);\n glide.on('build.after', function () {\n var slideHeight = self.outerHeight(document.querySelector('.glide__slide--active'));\n var glideTrack = self.outerHeight(document.querySelector('.glide__track'));\n if (slideHeight !== glideTrack) {\n var newHeight = slideHeight;\n document.querySelector('.glide__track').style.height = newHeight;\n }\n });\n\n glide.on('run.after', function () {\n var slideHeight = self.outerHeight(document.querySelector('.glide__slide--active'));\n var glideTrack = self.outerHeight(document.querySelector('.glide__track'));\n if (slideHeight !== glideTrack) {\n var newHeight = slideHeight;\n document.querySelector('.glide__track').style.height = newHeight;\n }\n });\n glide.mount();\n }\n\n outerHeight(el) {\n if (!el) return;\n var height = el.offsetHeight;\n var style = window.getComputedStyle(el);\n\n height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);\n return height;\n }\n}\n","import BaseCarousel from '../abstracts/BaseCarousel';\n\nexport default class CarouselComponent extends BaseCarousel {\n constructor(element) {\n super(element);\n this.mount(this.$el, this.$options);\n }\n}\n"],"sourceRoot":""}