{"version":3,"sources":["webpack://[name]/./src/js/components/SectionsCarouselComponent.js","webpack://[name]/./src/js/abstracts/BaseCarousel.js"],"names":["SectionsCarouselComponent","_BaseCarousel","element","_this","_classCallCheck","_callSuper","$el","addEventListener","event","glide","detail","on","updateCarouselPosition","setTimeout","mount","$options","_inherits","_createClass","key","value","position","this","querySelector","textContent","replace","index","toString","padStart","BaseCarousel","_BaseComponent","get","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","options","conf","_objectSpread","BASE_CONF","Glide","updateArrows","updateSlides","selector","dispatchEvent","CustomEvent","querySelectorAll","forEach","item","style","display","length","parseInt","settings","Array","from","visible","classList","glideTrack","slideHeight","outerHeight","height","el","offsetHeight","window","getComputedStyle","marginTop","marginBottom","BaseComponent"],"mappings":"keAAqD,IAEhCA,EAAyB,SAAAC,GAC5C,SAAAD,EAAYE,GAAS,IAAAC,EAUwC,OAVxCC,IAAA,KAAAJ,IACnBG,EAAAE,EAAA,KAAAL,EAAA,CAAME,KAEDI,IAAIC,iBAAiB,qBAAqB,SAAAC,GAC7C,IAAMC,EAAQD,EAAME,OAAOD,MAC3BA,EAAME,GAAG,aAAa,WACpBR,EAAKS,uBAAuBH,SAIhCI,YAAW,kBAAMV,EAAKW,MAAMX,EAAKG,IAAKH,EAAKY,YAAW,KAAKZ,EAC5D,OAAAa,IAAAhB,EAAAC,GAAAgB,IAAAjB,EAAA,EAAAkB,IAAA,yBAAAC,MAED,SAAuBV,GACrB,IAAIW,EAAWC,KAAKf,IAAIgB,cAAc,+BACjCF,IAGLA,EAASG,YAAcH,EAASG,YAAYC,QAAQ,OAAQf,EAAMgB,MAAQ,GAAGC,WAAWC,SAAS,EAAG,WAnB1D,C,OAASC,I,0+BCEX,IAEv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AI,OAC7C,MACF,KAAK,EACH,IAAMsD,EAAStE,EAAM8D,SAASG,iBAAiB,iBAAiBK,OAChEH,EAAKC,MAAMC,QAAWrE,EAAMgB,MAAQsD,EAASC,SAASvE,EAAMwE,SAAShD,SAAY,GAAI,aAM7F,CAAAf,IAAA,eAAAC,MACA,SAAaV,GACXyE,MAAMC,KAAK1E,EAAM8D,SAASG,iBAAiB,kBAAkBC,SAAQ,SAACC,EAAMnD,GAC1E,IAAM2D,EAAU3E,EAAMgB,OAASA,GAASA,EAAShB,EAAMgB,MAAQuD,SAASvE,EAAMwE,SAAShD,SACvF2C,EAAKS,UAAUD,EAAU,MAAQ,UAAU,8BAE9C,CAAAlE,IAAA,oBAAAC,MAED,SAAkBV,GAChB,IAAI6E,EAAa7E,EAAM8D,SAASjD,cAAc,iBAE1CiE,GADclE,KAAKmE,YAAYF,GACjBjE,KAAKmE,YAAY/E,EAAM8D,SAASjD,cAAc,2BAC5DiE,IAAgBD,IAClBA,EAAWT,MAAMY,OAASF,KAE7B,CAAArE,IAAA,cAAAC,MAED,SAAYuE,GACV,GAAKA,EAAL,CACA,IAAID,EAASC,EAAGC,aACZd,EAAQe,OAAOC,iBAAiBH,GAGpC,OADAD,GAAUT,SAASH,EAAMiB,UAAW,IAAMd,SAASH,EAAMkB,aAAc,SAjR1C,C,OAASC","file":"js/component-SectionsCarouselComponent-js.chunks.js","sourcesContent":["import BaseCarousel from '../abstracts/BaseCarousel';\n\nexport default class SectionsCarouselComponent extends BaseCarousel {\n  constructor(element) {\n    super(element);\n\n    this.$el.addEventListener('glide.build.after', event => {\n      const glide = event.detail.glide;\n      glide.on('run.after', () => {\n        this.updateCarouselPosition(glide);\n      });\n    });\n\n    setTimeout(() => this.mount(this.$el, this.$options), 100);\n  }\n\n  updateCarouselPosition(glide) {\n    let position = this.$el.querySelector('.sections-carousel-position');\n    if (!position) {\n      return;\n    }\n    position.textContent = position.textContent.replace(/\\d+/, (glide.index + 1).toString().padStart(2, '0'));\n  }\n}\n","//import '@glidejs/glide/src/assets/sass/glide.core.scss';\n//import '@glidejs/glide/src/assets/sass/glide.theme.scss';\nimport Glide from '@glidejs/glide';\n// import Glide from './glide.esm';\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\n    glide.on('build.after', () => {\n      this.updateArrows(glide);\n      this.updateSlides(glide);\n      // this.updateTrackHeight(glide); PITTI20-128\n\n      glide.selector.dispatchEvent(new CustomEvent('glide.build.after', {\n        detail: {\n          'glide': glide\n        }\n      }));\n    });\n\n    glide.on('run.after', () => {\n      this.updateArrows(glide);\n      this.updateSlides(glide);\n      // this.updateTrackHeight(glide); PITTI20-128\n    });\n\n    glide.mount();\n  }\n\n  // https://github.com/glidejs/glide/issues/307\n  updateArrows(glide) {\n    glide.selector.querySelectorAll('.glide__arrow').forEach((item, index) => {\n      switch (index) {\n        case 0:\n          item.style.display = (glide.index > 0) ? '': 'none';\n          break;\n        case 1:\n          const length = glide.selector.querySelectorAll('.glide__slide').length;\n          item.style.display = (glide.index < length - parseInt(glide.settings.perView)) ? '': 'none';\n          break;\n      }\n    });\n  }\n\n  // https://github.com/glidejs/glide/issues/303\n  updateSlides(glide) {\n    Array.from(glide.selector.querySelectorAll('.glide__slide')).forEach((item, index) => {\n      const visible = glide.index <= index && index < (glide.index + parseInt(glide.settings.perView));\n      item.classList[visible ? 'add' : 'remove']('glide__slide--visible');\n    })\n  }\n\n  updateTrackHeight(glide) {\n    var glideTrack = glide.selector.querySelector('.glide__track');\n    var trackHeight = this.outerHeight(glideTrack);\n    var slideHeight = this.outerHeight(glide.selector.querySelector('.glide__slide--active'));\n    if (slideHeight !== glideTrack) {\n      glideTrack.style.height = slideHeight;\n    }\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"],"sourceRoot":""}