(window["webpackJsonpLIS"] = window["webpackJsonpLIS"] || []).push([["toubiz-swiper"],{

/***/ "./Packages/Plugins/Newland.AssetsNeos/Scripts/toubiz-swiper/index.js":
/*!****************************************************************************!*\
  !*** ./Packages/Plugins/Newland.AssetsNeos/Scripts/toubiz-swiper/index.js ***!
  \****************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ToubizSwiper; });\n/* harmony import */ var swiper_dist_js_swiper_esm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! swiper/dist/js/swiper.esm */ \"./node_modules/swiper/dist/js/swiper.esm.js\");\n/* harmony import */ var _nimius_dom_utility__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @nimius/dom-utility */ \"./node_modules/@nimius/dom-utility/index.js\");\n/* harmony import */ var _nimius_event_utility__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @nimius/event-utility */ \"./node_modules/@nimius/event-utility/index.js\");\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n\n\n\nswiper_dist_js_swiper_esm__WEBPACK_IMPORTED_MODULE_0__[\"Swiper\"].use([swiper_dist_js_swiper_esm__WEBPACK_IMPORTED_MODULE_0__[\"Navigation\"], swiper_dist_js_swiper_esm__WEBPACK_IMPORTED_MODULE_0__[\"Lazy\"], swiper_dist_js_swiper_esm__WEBPACK_IMPORTED_MODULE_0__[\"Keyboard\"], swiper_dist_js_swiper_esm__WEBPACK_IMPORTED_MODULE_0__[\"A11y\"], swiper_dist_js_swiper_esm__WEBPACK_IMPORTED_MODULE_0__[\"Pagination\"]]);\nvar defaultConfig = {\n  slidesPerView: 3,\n  slidesPerGroup: 1,\n  loop: false,\n  limitShake: false,\n  lazyLoad: true,\n  spaceBetween: 0,\n  freeMode: false,\n  autoHeight: false\n};\n\nvar ToubizSwiper = /*#__PURE__*/function () {\n  /**\n   * @param {HTMLElement} node\n   */\n  function ToubizSwiper(node) {\n    _classCallCheck(this, ToubizSwiper);\n\n    /** @private {HTMLElement} */\n    this.node = node;\n    var extractedConfig = Object(_nimius_dom_utility__WEBPACK_IMPORTED_MODULE_1__[\"extractPrefixedAttributesFromElement\"])(node, 'data-toubiz-swiper-');\n    var config = this.legacyConfigurationTransformation(_objectSpread(_objectSpread({}, defaultConfig), extractedConfig));\n\n    if (!config.id) {\n      console.error('## Toubiz Swiper Error: ID is required. Please configure an ID for your swiper instance via markup.');\n      return;\n    }\n    /** @private {Swiper} */\n\n\n    this.swiper = new swiper_dist_js_swiper_esm__WEBPACK_IMPORTED_MODULE_0__[\"Swiper\"](node, this.getFullConfig(config));\n  }\n  /**\n   * @param {object} config\n   * @returns {object}\n   * @private\n   */\n\n\n  _createClass(ToubizSwiper, [{\n    key: \"getFullConfig\",\n    value: function getFullConfig(config) {\n      var node = this.node;\n      return {\n        freeMode: config.freeMode,\n        autoHeight: config.autoHeight,\n        // Disable loop (otherwise lightgallery doesnt work correctly because of duplicate slides)\n        loop: config.loop,\n        // Accessibility settings\n        a11y: {\n          notificationClass: 'tb-swiper__notification'\n        },\n        // Set custom classnames to align with CGL\n        containerModifierClass: 'tb-swiper-',\n        wrapperClass: 'tb-swiper__wrapper',\n        slideClass: 'tb-swiper__slide',\n        slideNextClass: 'tb-swiper__slide--next',\n        slidePrevClass: 'tb-swiper__slide--prev',\n        slideVisibleClass: 'tb-swiper__slide--visible',\n        slideActiveClass: 'tb-swiper__slide--active',\n        pagination: config.enablePagination ? {\n          el: \".js-swiper-pagination-\".concat(config.id),\n          type: 'bullets',\n          clickable: true\n        } : {},\n        // Disable preloading of all images\n        preloadImages: false,\n        // Enable lazy loading\n        lazy: config.lazyLoad ? {\n          loadPrevNext: true,\n          loadPrevNextAmount: config.slidesPerView,\n          loadOnTransitionStart: false,\n          elementClass: 'tb-swiper__lazy-image',\n          loadingClass: 'tb-swiper__lazy-image--loading',\n          loadedClass: 'tb-swiper__lazy-image--loaded',\n          preloaderClass: 'tb-swiper__lazy-preloader'\n        } : false,\n        // Threshold value in px. If \"touch distance\" will be lower than this value then swiper will not move\n        threshold: 80,\n        // Navigation arrows\n        navigation: {\n          nextEl: \".js-swiper-next-\".concat(config.id),\n          prevEl: \".js-swiper-prev-\".concat(config.id),\n          disabledClass: 'tb-swiper__button--disabled',\n          hiddenClass: 'tb-swiper__button--hidden'\n        },\n        // Slides visible at the same time\n        slidesPerView: config.slidesPerView,\n        // Slides to scroll at the same time (should not be > 1 if slidesPerView <= 1)\n        slidesPerGroup: config.slidesPerGroup > config.slidesPerView ? config.slidesPerView : config.slidesPerGroup,\n        // Gutters between items\n        spaceBetween: config.spaceBetween,\n        // Responsive breakpoints\n        breakpoints: config.slidesPerView > 1 ? {\n          // When window width is <= 992px\n          992: {\n            slidesPerView: 2,\n            slidesPerGroup: 2\n          },\n          // When window width is <= 480px\n          480: {\n            slidesPerView: 1,\n            slidesPerGroup: 1\n          }\n        } : {},\n        on: {\n          init: function init() {\n            var _this = this;\n\n            if (!config.loop && config.limitShake) {\n              var swiperPrevButton = document.querySelector(\".js-swiper-prev-\".concat(config.id));\n              var swiperNextButton = document.querySelector(\".js-swiper-next-\".concat(config.id));\n              /*\n               * Do the limit shake (indicates to the user that the end/beginning\n               * of the swiper was reached and he can't go further)\n               */\n\n              if (swiperPrevButton && swiperNextButton) {\n                swiperPrevButton.addEventListener('click', function () {\n                  if (_this.isBeginning) {\n                    node.classList.add('js-animation--limit-shake');\n                    setTimeout(function () {\n                      return node.classList.remove('js-animation--limit-shake');\n                    }, 300);\n                  }\n                });\n                swiperNextButton.addEventListener('click', function () {\n                  if (_this.isEnd) {\n                    node.classList.add('js-animation--limit-shake');\n                    setTimeout(function () {\n                      return node.classList.remove('js-animation--limit-shake');\n                    }, 300);\n                  }\n                });\n              }\n            }\n            /*\n             * Trigger the window resize event as a workaround for issues with initial\n             * layout calculation. Might be resolved in future swiper releases.\n             *\n             * https://github.com/nolimits4web/swiper/issues/2218\n             */\n\n\n            var resizeCount = 0;\n\n            var resizeInterval = function resizeInterval() {\n              if (resizeCount > 2) {\n                clearInterval(resizeInterval);\n                return;\n              }\n\n              Object(_nimius_event_utility__WEBPACK_IMPORTED_MODULE_2__[\"fireEvent\"])(window, 'resize');\n              resizeCount++;\n            };\n\n            setInterval(resizeInterval, 500);\n          }\n        }\n      };\n    }\n    /**\n     * @param {object} config\n     * @returns {object}\n     * @private\n     */\n\n  }, {\n    key: \"legacyConfigurationTransformation\",\n    value: function legacyConfigurationTransformation(config) {\n      var _iterator = _createForOfIteratorHelper(this.getLegacyTransformationRules()),\n          _step;\n\n      try {\n        for (_iterator.s(); !(_step = _iterator.n()).done;) {\n          var transformation = _step.value;\n\n          if (transformation.check(config)) {\n            transformation.transform(config);\n            console.warn(\"\\n                    ## Toubiz Swiper Deprecation Notice\\n                    \".concat(transformation.warn(config), \"\\n                    This warning will turn into an error with the next version.\\n                \"));\n          }\n        }\n      } catch (err) {\n        _iterator.e(err);\n      } finally {\n        _iterator.f();\n      }\n\n      return config;\n    }\n    /**\n     * Returns transformations that each contain a check if the transformation should be applied,\n     * a transformation step and a warn step that returns a warning message.\n     *\n     * @returns {{ check: Function, transform: Function, warn: Function }[]}\n     * @private\n     */\n\n  }, {\n    key: \"getLegacyTransformationRules\",\n    value: function getLegacyTransformationRules() {\n      // Helper for int cast syntax\n      var intCast = function intCast(attribute) {\n        return {\n          check: function check(config) {\n            return typeof config[attribute] === 'string' && !isNaN(parseInt(config[attribute], 10));\n          },\n          transform: function transform(config) {\n            return config[attribute] = parseInt(config[attribute], 10);\n          },\n          warn: function warn() {\n            return \"\".concat(attribute, \": Please use cast syntax (e.g. \\\"(int) 3\\\" instead of \\\"3\\\"\");\n          }\n        };\n      }; // Helper for bool cast syntax\n\n\n      var boolCast = function boolCast(attribute) {\n        return {\n          check: function check(config) {\n            return typeof config[attribute] === 'string';\n          },\n          transform: function transform(config) {\n            return config[attribute] = config[attribute] === 'true';\n          },\n          warn: function warn() {\n            return \"\".concat(attribute, \": Please use cast syntax (e.g. \\\"(bool) true\\\" instead of \\\"true\\\"\");\n          }\n        };\n      };\n\n      return [intCast('slidesPerView'), intCast('slidesPerGroup'), intCast('spaceBetween'), boolCast('loop'), boolCast('enablePagination'), boolCast('lazyLoad'), boolCast('limitShake'), boolCast('autoHeight'), {\n        check: function check(config) {\n          return config.disableLazyLoad !== undefined;\n        },\n        transform: function transform(config) {\n          if (typeof config.disableLazyLoad === 'string') {\n            config.disableLazyLoad = config.disableLazyLoad === 'true';\n          }\n\n          config.lazyLoad = !config.disableLazyLoad;\n        },\n        warn: function warn() {\n          return 'Please use lazyLoad instead of disableLazyLoad';\n        }\n      }];\n    }\n  }]);\n\n  return ToubizSwiper;\n}();\n\n\n\n//# sourceURL=webpack://LIS/./Packages/Plugins/Newland.AssetsNeos/Scripts/toubiz-swiper/index.js?");

/***/ })

}]);