vendor: 3,920 bytes, lines 1-104
1/** 2 * @file 3 * Behaviors of Boostrap Layout Builder local video background. 4 */ 5 6(function ($, _, Drupal, drupalSettings) { 7 "use strict"; 8 9 Drupal.behaviors.scrollEffectsInit = { 10 attach: function (context, settings) { 11 AOS.init(); 12 } 13 } 14 15})(window.jQuery, window._, window.Drupal, window.drupalSettings); 16; 17/******/ (function(modules) { // webpackBootstrap 18/******/ // The module cache 19/******/ var installedModules = {}; 20/******/ 21/******/ // The require function 22/******/ function __webpack_require__(moduleId) { 23/******/ 24/******/ // Check if module is in cache 25/******/ if(installedModules[moduleId]) { 26/******/ return installedModules[moduleId].exports; 27/******/ } 28/******/ // Create a new module (and put it into the cache) 29/******/ var module = installedModules[moduleId] = { 30/******/ i: moduleId, 31/******/ l: false, 32/******/ exports: {} 33/******/ }; 34/******/ 35/******/ // Execute the module function 36/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 37/******/ 38/******/ // Flag the module as loaded 39/******/ module.l = true; 40/******/ 41/******/ // Return the exports of the module 42/******/ return module.exports; 43/******/ } 44/******/ 45/******/ 46/******/ // expose the modules object (__webpack_modules__) 47/******/ __webpack_require__.m = modules; 48/******/ 49/******/ // expose the module cache 50/******/ __webpack_require__.c = installedModules; 51/******/ 52/******/ // define getter function for harmony exports 53/******/ __webpack_require__.d = function(exports, name, getter) { 54/******/ if(!__webpack_require__.o(exports, name)) { 55/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 56/******/ } 57/******/ }; 58/******/ 59/******/ // define __esModule on exports 60/******/ __webpack_require__.r = function(exports) { 61/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 62/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 63/******/ } 64/******/ Object.defineProperty(exports, '__esModule', { value: true }); 65/******/ }; 66/******/ 67/******/ // create a fake namespace object 68/******/ // mode & 1: value is a module id, require it 69/******/ // mode & 2: merge all properties of value into the ns 70/******/ // mode & 4: return value when already ns object 71/******/ // mode & 8|1: behave like require 72/******/ __webpack_require__.t = function(value, mode) { 73/******/ if(mode & 1) value = __webpack_require__(value); 74/******/ if(mode & 8) return value; 75/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 76/******/ var ns = Object.create(null); 77/******/ __webpack_require__.r(ns); 78/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 79/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 80/******/ return ns; 81/******/ }; 82/******/ 83/******/ // getDefaultExport function for compatibility with non-harmony modules 84/******/ __webpack_require__.n = function(module) { 85/******/ var getter = module && module.__esModule ? 86/******/ function getDefault() { return module['default']; } : 87/******/ function getModuleExports() { return module; }; 88/******/ __webpack_require__.d(getter, 'a', getter); 89/******/ return getter; 90/******/ }; 91/******/ 92/******/ // Object.prototype.hasOwnProperty.call 93/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 94/******/ 95/******/ // __webpack_public_path__ 96/******/ __webpack_require__.p = "/"; 97/******/ 98/******/ 99/******/ // Load entry module and return exports 100/******/ return __webpack_require__(__webpack_require__.s = 18); 101/******/ }) 102/************************************************************************/ 103/******/ ({ 104
vendor: 970 bytes, lines 105-127
105/***/ "./node_modules/tiny-slider/src/helpers/addCSSRule.js": 106/*!************************************************************!*\ 107 !*** ./node_modules/tiny-slider/src/helpers/addCSSRule.js ***! 108 \************************************************************/ 109/*! exports provided: addCSSRule */ 110/***/ (function(module, __webpack_exports__, __webpack_require__) { 111 112"use strict"; 113__webpack_require__.r(__webpack_exports__); 114/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addCSSRule", function() { return addCSSRule; }); 115/* harmony import */ var _raf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 116// cross browsers addRule method 117 118function addCSSRule(sheet, selector, rules, index) { 119 // return raf(function() { 120 'insertRule' in sheet ? 121 sheet.insertRule(selector + '{' + rules + '}', index) : 122 sheet.addRule(selector, rules, index); 123 // }); 124} 125 126/***/ }), 127
vendor: 1,082 bytes, lines 128-151
128/***/ "./node_modules/tiny-slider/src/helpers/addClass.js": 129/*!**********************************************************!*\ 130 !*** ./node_modules/tiny-slider/src/helpers/addClass.js ***! 131 \**********************************************************/ 132/*! exports provided: addClass */ 133/***/ (function(module, __webpack_exports__, __webpack_require__) { 134 135"use strict"; 136__webpack_require__.r(__webpack_exports__); 137/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return addClass; }); 138/* harmony import */ var _hasClass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 139 140var addClass = _hasClass_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 141 function (el, str) { 142 if (!Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.classList.add(str); } 143 } : 144 function (el, str) { 145 if (!Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.className += ' ' + str; } 146 }; 147 148 149 150/***/ }), 151
vendor: 1,023 bytes, lines 152-173
152/***/ "./node_modules/tiny-slider/src/helpers/addEvents.js": 153/*!***********************************************************!*\ 154 !*** ./node_modules/tiny-slider/src/helpers/addEvents.js ***! 155 \***********************************************************/ 156/*! exports provided: addEvents */ 157/***/ (function(module, __webpack_exports__, __webpack_require__) { 158 159"use strict"; 160__webpack_require__.r(__webpack_exports__); 161/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEvents", function() { return addEvents; }); 162/* harmony import */ var _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./passiveOption.js */ "./node_modules/tiny-slider/src/helpers/passiveOption.js"); 163 164 165function addEvents(el, obj, preventScrolling) { 166 for (var prop in obj) { 167 var option = ['touchstart', 'touchmove'].indexOf(prop) >= 0 && !preventScrolling ? _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__["passiveOption"] : false; 168 el.addEventListener(prop, obj[prop], option); 169 } 170} 171 172/***/ }), 173
vendor: 745 bytes, lines 174-193
174/***/ "./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js": 175/*!*******************************************************************!*\ 176 !*** ./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js ***! 177 \*******************************************************************/ 178/*! exports provided: arrayFromNodeList */ 179/***/ (function(module, __webpack_exports__, __webpack_require__) { 180 181"use strict"; 182__webpack_require__.r(__webpack_exports__); 183/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayFromNodeList", function() { return arrayFromNodeList; }); 184function arrayFromNodeList (nl) { 185 var arr = []; 186 for (var i = 0, l = nl.length; i < l; i++) { 187 arr.push(nl[i]); 188 } 189 return arr; 190} 191 192/***/ }), 193
vendor: 637 bytes, lines 194-212
194/***/ "./node_modules/tiny-slider/src/helpers/caf.js": 195/*!*****************************************************!*\ 196 !*** ./node_modules/tiny-slider/src/helpers/caf.js ***! 197 \*****************************************************/ 198/*! exports provided: caf */ 199/***/ (function(module, __webpack_exports__, __webpack_require__) { 200 201"use strict"; 202__webpack_require__.r(__webpack_exports__); 203/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "caf", function() { return caf; }); 204var win = window; 205 206var caf = win.cancelAnimationFrame 207 || win.mozCancelAnimationFrame 208 || function(id){ clearTimeout(id); }; 209 210 211/***/ }), 212
vendor: 1,914 bytes, lines 213-261
213/***/ "./node_modules/tiny-slider/src/helpers/calc.js": 214/*!******************************************************!*\ 215 !*** ./node_modules/tiny-slider/src/helpers/calc.js ***! 216 \******************************************************/ 217/*! exports provided: calc */ 218/***/ (function(module, __webpack_exports__, __webpack_require__) { 219 220"use strict"; 221__webpack_require__.r(__webpack_exports__); 222/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calc", function() { return calc; }); 223/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 224/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 225/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 226// get css-calc 227// @return - false | calc | -webkit-calc | -moz-calc 228// @usage - var calc = getCalc(); 229 230 231 232 233function calc() { 234 var doc = document, 235 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 236 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 237 div = doc.createElement('div'), 238 result = false; 239 240 body.appendChild(div); 241 try { 242 var str = '(10px * 10)', 243 vals = ['calc' + str, '-moz-calc' + str, '-webkit-calc' + str], 244 val; 245 for (var i = 0; i < 3; i++) { 246 val = vals[i]; 247 div.style.width = val; 248 if (div.offsetWidth === 100) { 249 result = val.replace(str, ''); 250 break; 251 } 252 } 253 } catch (e) {} 254 255 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : div.remove(); 256 257 return result; 258} 259 260/***/ }), 261
vendor: 722 bytes, lines 262-277
262/***/ "./node_modules/tiny-slider/src/helpers/checkStorageValue.js": 263/*!*******************************************************************!*\ 264 !*** ./node_modules/tiny-slider/src/helpers/checkStorageValue.js ***! 265 \*******************************************************************/ 266/*! exports provided: checkStorageValue */ 267/***/ (function(module, __webpack_exports__, __webpack_require__) { 268 269"use strict"; 270__webpack_require__.r(__webpack_exports__); 271/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkStorageValue", function() { return checkStorageValue; }); 272function checkStorageValue (value) { 273 return ['true', 'false'].indexOf(value) >= 0 ? JSON.parse(value) : value; 274} 275 276/***/ }), 277
vendor: 667 bytes, lines 278-291
278/***/ "./node_modules/tiny-slider/src/helpers/classListSupport.js": 279/*!******************************************************************!*\ 280 !*** ./node_modules/tiny-slider/src/helpers/classListSupport.js ***! 281 \******************************************************************/ 282/*! exports provided: classListSupport */ 283/***/ (function(module, __webpack_exports__, __webpack_require__) { 284 285"use strict"; 286__webpack_require__.r(__webpack_exports__); 287/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "classListSupport", function() { return classListSupport; }); 288var classListSupport = 'classList' in document.createElement('_'); 289 290/***/ }), 291
vendor: 1,359 bytes, lines 292-326
292/***/ "./node_modules/tiny-slider/src/helpers/createStyleSheet.js": 293/*!******************************************************************!*\ 294 !*** ./node_modules/tiny-slider/src/helpers/createStyleSheet.js ***! 295 \******************************************************************/ 296/*! exports provided: createStyleSheet */ 297/***/ (function(module, __webpack_exports__, __webpack_require__) { 298 299"use strict"; 300__webpack_require__.r(__webpack_exports__); 301/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStyleSheet", function() { return createStyleSheet; }); 302// create and append style sheet 303function createStyleSheet (media, nonce) { 304 // Create the <style> tag 305 var style = document.createElement("style"); 306 // style.setAttribute("type", "text/css"); 307 308 // Add a media (and/or media query) here if you'd like! 309 // style.setAttribute("media", "screen") 310 // style.setAttribute("media", "only screen and (max-width : 1024px)") 311 if (media) { style.setAttribute("media", media); } 312 313 // Add nonce attribute for Content Security Policy 314 if (nonce) { style.setAttribute("nonce", nonce); } 315 316 // WebKit hack :( 317 // style.appendChild(document.createTextNode("")); 318 319 // Add the <style> element to the page 320 document.querySelector('head').appendChild(style); 321 322 return style.sheet ? style.sheet : style.styleSheet; 323}; 324 325/***/ }), 326
vendor: 601 bytes, lines 327-340
327/***/ "./node_modules/tiny-slider/src/helpers/docElement.js": 328/*!************************************************************!*\ 329 !*** ./node_modules/tiny-slider/src/helpers/docElement.js ***! 330 \************************************************************/ 331/*! exports provided: docElement */ 332/***/ (function(module, __webpack_exports__, __webpack_require__) { 333 334"use strict"; 335__webpack_require__.r(__webpack_exports__); 336/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "docElement", function() { return docElement; }); 337var docElement = document.documentElement; 338 339/***/ }), 340
vendor: 1,234 bytes, lines 341-380
341/***/ "./node_modules/tiny-slider/src/helpers/events.js": 342/*!********************************************************!*\ 343 !*** ./node_modules/tiny-slider/src/helpers/events.js ***! 344 \********************************************************/ 345/*! exports provided: Events */ 346/***/ (function(module, __webpack_exports__, __webpack_require__) { 347 348"use strict"; 349__webpack_require__.r(__webpack_exports__); 350/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Events", function() { return Events; }); 351function Events() { 352 return { 353 topics: {}, 354 on: function (eventName, fn) { 355 this.topics[eventName] = this.topics[eventName] || []; 356 this.topics[eventName].push(fn); 357 }, 358 off: function(eventName, fn) { 359 if (this.topics[eventName]) { 360 for (var i = 0; i < this.topics[eventName].length; i++) { 361 if (this.topics[eventName][i] === fn) { 362 this.topics[eventName].splice(i, 1); 363 break; 364 } 365 } 366 } 367 }, 368 emit: function (eventName, data) { 369 data.type = eventName; 370 if (this.topics[eventName]) { 371 this.topics[eventName].forEach(function(fn) { 372 fn(data, eventName); 373 }); 374 } 375 } 376 }; 377}; 378 379/***/ }), 380
vendor: 947 bytes, lines 381-414
381/***/ "./node_modules/tiny-slider/src/helpers/extend.js": 382/*!********************************************************!*\ 383 !*** ./node_modules/tiny-slider/src/helpers/extend.js ***! 384 \********************************************************/ 385/*! exports provided: extend */ 386/***/ (function(module, __webpack_exports__, __webpack_require__) { 387 388"use strict"; 389__webpack_require__.r(__webpack_exports__); 390/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return extend; }); 391function extend() { 392 var obj, name, copy, 393 target = arguments[0] || {}, 394 i = 1, 395 length = arguments.length; 396 397 for (; i < length; i++) { 398 if ((obj = arguments[i]) !== null) { 399 for (name in obj) { 400 copy = obj[name]; 401 402 if (target === copy) { 403 continue; 404 } else if (copy !== undefined) { 405 target[name] = copy; 406 } 407 } 408 } 409 } 410 return target; 411} 412 413/***/ }), 414
vendor: 739 bytes, lines 415-433
415/***/ "./node_modules/tiny-slider/src/helpers/forEach.js": 416/*!*********************************************************!*\ 417 !*** ./node_modules/tiny-slider/src/helpers/forEach.js ***! 418 \*********************************************************/ 419/*! exports provided: forEach */ 420/***/ (function(module, __webpack_exports__, __webpack_require__) { 421 422"use strict"; 423__webpack_require__.r(__webpack_exports__); 424/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; }); 425// https://toddmotto.com/ditch-the-array-foreach-call-nodelist-hack/ 426function forEach (arr, callback, scope) { 427 for (var i = 0, l = arr.length; i < l; i++) { 428 callback.call(scope, arr[i], i); 429 } 430} 431 432/***/ }), 433
vendor: 600 bytes, lines 434-449
434/***/ "./node_modules/tiny-slider/src/helpers/getAttr.js": 435/*!*********************************************************!*\ 436 !*** ./node_modules/tiny-slider/src/helpers/getAttr.js ***! 437 \*********************************************************/ 438/*! exports provided: getAttr */ 439/***/ (function(module, __webpack_exports__, __webpack_require__) { 440 441"use strict"; 442__webpack_require__.r(__webpack_exports__); 443/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAttr", function() { return getAttr; }); 444function getAttr(el, attr) { 445 return el.getAttribute(attr); 446} 447 448/***/ }), 449
vendor: 702 bytes, lines 450-473
450/***/ "./node_modules/tiny-slider/src/helpers/getBody.js": 451/*!*********************************************************!*\ 452 !*** ./node_modules/tiny-slider/src/helpers/getBody.js ***! 453 \*********************************************************/ 454/*! exports provided: getBody */ 455/***/ (function(module, __webpack_exports__, __webpack_require__) { 456 457"use strict"; 458__webpack_require__.r(__webpack_exports__); 459/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBody", function() { return getBody; }); 460function getBody () { 461 var doc = document, 462 body = doc.body; 463 464 if (!body) { 465 body = doc.createElement('body'); 466 body.fake = true; 467 } 468 469 return body; 470} 471 472/***/ }), 473
vendor: 736 bytes, lines 474-490
474/***/ "./node_modules/tiny-slider/src/helpers/getCssRulesLength.js": 475/*!*******************************************************************!*\ 476 !*** ./node_modules/tiny-slider/src/helpers/getCssRulesLength.js ***! 477 \*******************************************************************/ 478/*! exports provided: getCssRulesLength */ 479/***/ (function(module, __webpack_exports__, __webpack_require__) { 480 481"use strict"; 482__webpack_require__.r(__webpack_exports__); 483/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCssRulesLength", function() { return getCssRulesLength; }); 484function getCssRulesLength(sheet) { 485 var rule = ('insertRule' in sheet) ? sheet.cssRules : sheet.rules; 486 return rule.length; 487} 488 489/***/ }), 490
vendor: 1,105 bytes, lines 491-518
491/***/ "./node_modules/tiny-slider/src/helpers/getEndProperty.js": 492/*!****************************************************************!*\ 493 !*** ./node_modules/tiny-slider/src/helpers/getEndProperty.js ***! 494 \****************************************************************/ 495/*! exports provided: getEndProperty */ 496/***/ (function(module, __webpack_exports__, __webpack_require__) { 497 498"use strict"; 499__webpack_require__.r(__webpack_exports__); 500/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEndProperty", function() { return getEndProperty; }); 501// get transitionend, animationend based on transitionDuration 502// @propin: string 503// @propOut: string, first-letter uppercase 504// Usage: getEndProperty('WebkitTransitionDuration', 'Transition') => webkitTransitionEnd 505function getEndProperty(propIn, propOut) { 506 var endProp = false; 507 if (/^Webkit/.test(propIn)) { 508 endProp = 'webkit' + propOut + 'End'; 509 } else if (/^O/.test(propIn)) { 510 endProp = 'o' + propOut + 'End'; 511 } else if (propIn) { 512 endProp = propOut.toLowerCase() + 'end'; 513 } 514 return endProp; 515} 516 517/***/ }), 518
vendor: 678 bytes, lines 519-537
519/***/ "./node_modules/tiny-slider/src/helpers/getSlideId.js": 520/*!************************************************************!*\ 521 !*** ./node_modules/tiny-slider/src/helpers/getSlideId.js ***! 522 \************************************************************/ 523/*! exports provided: getSlideId */ 524/***/ (function(module, __webpack_exports__, __webpack_require__) { 525 526"use strict"; 527__webpack_require__.r(__webpack_exports__); 528/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSlideId", function() { return getSlideId; }); 529function getSlideId() { 530 var id = window.tnsId; 531 window.tnsId = !id ? 1 : id + 1; 532 533 return 'tns' + window.tnsId; 534} 535 536/***/ }), 537
vendor: 867 bytes, lines 538-562
538/***/ "./node_modules/tiny-slider/src/helpers/getTouchDirection.js": 539/*!*******************************************************************!*\ 540 !*** ./node_modules/tiny-slider/src/helpers/getTouchDirection.js ***! 541 \*******************************************************************/ 542/*! exports provided: getTouchDirection */ 543/***/ (function(module, __webpack_exports__, __webpack_require__) { 544 545"use strict"; 546__webpack_require__.r(__webpack_exports__); 547/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTouchDirection", function() { return getTouchDirection; }); 548function getTouchDirection(angle, range) { 549 var direction = false, 550 gap = Math.abs(90 - Math.abs(angle)); 551 552 if (gap >= 90 - range) { 553 direction = 'horizontal'; 554 } else if (gap <= range) { 555 direction = 'vertical'; 556 } 557 558 return direction; 559} 560 561/***/ }), 562
vendor: 1,957 bytes, lines 563-606
563/***/ "./node_modules/tiny-slider/src/helpers/has3DTransforms.js": 564/*!*****************************************************************!*\ 565 !*** ./node_modules/tiny-slider/src/helpers/has3DTransforms.js ***! 566 \*****************************************************************/ 567/*! exports provided: has3DTransforms */ 568/***/ (function(module, __webpack_exports__, __webpack_require__) { 569 570"use strict"; 571__webpack_require__.r(__webpack_exports__); 572/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "has3DTransforms", function() { return has3DTransforms; }); 573/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 574/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 575/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 576 577 578 579 580function has3DTransforms(tf){ 581 if (!tf) { return false; } 582 if (!window.getComputedStyle) { return false; } 583 584 var doc = document, 585 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 586 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 587 el = doc.createElement('p'), 588 has3d, 589 cssTF = tf.length > 9 ? '-' + tf.slice(0, -9).toLowerCase() + '-' : ''; 590 591 cssTF += 'transform'; 592 593 // Add it to the body to get the computed style 594 body.insertBefore(el, null); 595 596 el.style[tf] = 'translate3d(1px,1px,1px)'; 597 has3d = window.getComputedStyle(el).getPropertyValue(cssTF); 598 599 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : el.remove(); 600 601 return (has3d !== undefined && has3d.length > 0 && has3d !== "none"); 602} 603 604 605/***/ }), 606
vendor: 600 bytes, lines 607-622
607/***/ "./node_modules/tiny-slider/src/helpers/hasAttr.js": 608/*!*********************************************************!*\ 609 !*** ./node_modules/tiny-slider/src/helpers/hasAttr.js ***! 610 \*********************************************************/ 611/*! exports provided: hasAttr */ 612/***/ (function(module, __webpack_exports__, __webpack_require__) { 613 614"use strict"; 615__webpack_require__.r(__webpack_exports__); 616/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasAttr", function() { return hasAttr; }); 617function hasAttr(el, attr) { 618 return el.hasAttribute(attr); 619} 620 621/***/ }), 622
vendor: 1,162 bytes, lines 623-645
623/***/ "./node_modules/tiny-slider/src/helpers/hasClass.js": 624/*!**********************************************************!*\ 625 !*** ./node_modules/tiny-slider/src/helpers/hasClass.js ***! 626 \**********************************************************/ 627/*! exports provided: classListSupport, hasClass */ 628/***/ (function(module, __webpack_exports__, __webpack_require__) { 629 630"use strict"; 631__webpack_require__.r(__webpack_exports__); 632/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasClass", function() { return hasClass; }); 633/* harmony import */ var _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classListSupport.js */ "./node_modules/tiny-slider/src/helpers/classListSupport.js"); 634/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "classListSupport", function() { return _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"]; }); 635 636 637 638var hasClass = _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 639 function (el, str) { return el.classList.contains(str); } : 640 function (el, str) { return el.className.indexOf(str) >= 0; }; 641 642 643 644/***/ }), 645
vendor: 671 bytes, lines 646-661
646/***/ "./node_modules/tiny-slider/src/helpers/hideElement.js": 647/*!*************************************************************!*\ 648 !*** ./node_modules/tiny-slider/src/helpers/hideElement.js ***! 649 \*************************************************************/ 650/*! exports provided: hideElement */ 651/***/ (function(module, __webpack_exports__, __webpack_require__) { 652 653"use strict"; 654__webpack_require__.r(__webpack_exports__); 655/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hideElement", function() { return hideElement; }); 656function hideElement(el, forceHide) { 657 if (el.style.display !== 'none') { el.style.display = 'none'; } 658} 659 660/***/ }), 661
vendor: 673 bytes, lines 662-678
662/***/ "./node_modules/tiny-slider/src/helpers/isNodeList.js": 663/*!************************************************************!*\ 664 !*** ./node_modules/tiny-slider/src/helpers/isNodeList.js ***! 665 \************************************************************/ 666/*! exports provided: isNodeList */ 667/***/ (function(module, __webpack_exports__, __webpack_require__) { 668 669"use strict"; 670__webpack_require__.r(__webpack_exports__); 671/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNodeList", function() { return isNodeList; }); 672function isNodeList(el) { 673 // Only NodeList has the "item()" function 674 return typeof el.item !== "undefined"; 675} 676 677/***/ }), 678
vendor: 635 bytes, lines 679-694
679/***/ "./node_modules/tiny-slider/src/helpers/isVisible.js": 680/*!***********************************************************!*\ 681 !*** ./node_modules/tiny-slider/src/helpers/isVisible.js ***! 682 \***********************************************************/ 683/*! exports provided: isVisible */ 684/***/ (function(module, __webpack_exports__, __webpack_require__) { 685 686"use strict"; 687__webpack_require__.r(__webpack_exports__); 688/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isVisible", function() { return isVisible; }); 689function isVisible(el) { 690 return window.getComputedStyle(el).display !== 'none'; 691} 692 693/***/ }), 694
vendor: 1,205 bytes, lines 695-727
695/***/ "./node_modules/tiny-slider/src/helpers/jsTransform.js": 696/*!*************************************************************!*\ 697 !*** ./node_modules/tiny-slider/src/helpers/jsTransform.js ***! 698 \*************************************************************/ 699/*! exports provided: jsTransform */ 700/***/ (function(module, __webpack_exports__, __webpack_require__) { 701 702"use strict"; 703__webpack_require__.r(__webpack_exports__); 704/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jsTransform", function() { return jsTransform; }); 705function jsTransform(element, attr, prefix, postfix, to, duration, callback) { 706 var tick = Math.min(duration, 10), 707 unit = (to.indexOf('%') >= 0) ? '%' : 'px', 708 to = to.replace(unit, ''), 709 from = Number(element.style[attr].replace(prefix, '').replace(postfix, '').replace(unit, '')), 710 positionTick = (to - from) / duration * tick, 711 running; 712 713 setTimeout(moveElement, tick); 714 function moveElement() { 715 duration -= tick; 716 from += positionTick; 717 element.style[attr] = prefix + from + unit + postfix; 718 if (duration > 0) { 719 setTimeout(moveElement, tick); 720 } else { 721 callback(); 722 } 723 } 724} 725 726/***/ }), 727
vendor: 2,114 bytes, lines 728-779
728/***/ "./node_modules/tiny-slider/src/helpers/mediaquerySupport.js": 729/*!*******************************************************************!*\ 730 !*** ./node_modules/tiny-slider/src/helpers/mediaquerySupport.js ***! 731 \*******************************************************************/ 732/*! exports provided: mediaquerySupport */ 733/***/ (function(module, __webpack_exports__, __webpack_require__) { 734 735"use strict"; 736__webpack_require__.r(__webpack_exports__); 737/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mediaquerySupport", function() { return mediaquerySupport; }); 738/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 739/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 740/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 741 742 743 744 745function mediaquerySupport () { 746 if (window.matchMedia || window.msMatchMedia) { 747 return true; 748 } 749 750 var doc = document, 751 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 752 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 753 div = doc.createElement('div'), 754 style = doc.createElement('style'), 755 rule = '@media all and (min-width:1px){.tns-mq-test{position:absolute}}', 756 position; 757 758 style.type = 'text/css'; 759 div.className = 'tns-mq-test'; 760 761 body.appendChild(style); 762 body.appendChild(div); 763 764 if (style.styleSheet) { 765 style.styleSheet.cssText = rule; 766 } else { 767 style.appendChild(doc.createTextNode(rule)); 768 } 769 770 position = window.getComputedStyle ? window.getComputedStyle(div).position : div.currentStyle['position']; 771 772 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : div.remove(); 773 774 return position === "absolute"; 775} 776 777 778/***/ }), 779
vendor: 943 bytes, lines 780-803
780/***/ "./node_modules/tiny-slider/src/helpers/passiveOption.js": 781/*!***************************************************************!*\ 782 !*** ./node_modules/tiny-slider/src/helpers/passiveOption.js ***! 783 \***************************************************************/ 784/*! exports provided: passiveOption */ 785/***/ (function(module, __webpack_exports__, __webpack_require__) { 786 787"use strict"; 788__webpack_require__.r(__webpack_exports__); 789/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "passiveOption", function() { return passiveOption; }); 790// Test via a getter in the options object to see if the passive property is accessed 791var supportsPassive = false; 792try { 793 var opts = Object.defineProperty({}, 'passive', { 794 get: function() { 795 supportsPassive = true; 796 } 797 }); 798 window.addEventListener("test", null, opts); 799} catch (e) {} 800var passiveOption = supportsPassive ? { passive: true } : false; 801 802/***/ }), 803
vendor: 2,093 bytes, lines 804-854
804/***/ "./node_modules/tiny-slider/src/helpers/percentageLayout.js": 805/*!******************************************************************!*\ 806 !*** ./node_modules/tiny-slider/src/helpers/percentageLayout.js ***! 807 \******************************************************************/ 808/*! exports provided: percentageLayout */ 809/***/ (function(module, __webpack_exports__, __webpack_require__) { 810 811"use strict"; 812__webpack_require__.r(__webpack_exports__); 813/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "percentageLayout", function() { return percentageLayout; }); 814/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 815/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 816/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 817// get subpixel support value 818// @return - boolean 819 820 821 822 823function percentageLayout() { 824 // check subpixel layout supporting 825 var doc = document, 826 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 827 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 828 wrapper = doc.createElement('div'), 829 outer = doc.createElement('div'), 830 str = '', 831 count = 70, 832 perPage = 3, 833 supported = false; 834 835 wrapper.className = "tns-t-subp2"; 836 outer.className = "tns-t-ct"; 837 838 for (var i = 0; i < count; i++) { 839 str += '<div></div>'; 840 } 841 842 outer.innerHTML = str; 843 wrapper.appendChild(outer); 844 body.appendChild(wrapper); 845 846 supported = Math.abs(wrapper.getBoundingClientRect().left - outer.children[count - perPage].getBoundingClientRect().left) < 2; 847 848 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : wrapper.remove(); 849 850 return supported; 851} 852 853/***/ }), 854
vendor: 719 bytes, lines 855-875
855/***/ "./node_modules/tiny-slider/src/helpers/raf.js": 856/*!*****************************************************!*\ 857 !*** ./node_modules/tiny-slider/src/helpers/raf.js ***! 858 \*****************************************************/ 859/*! exports provided: raf */ 860/***/ (function(module, __webpack_exports__, __webpack_require__) { 861 862"use strict"; 863__webpack_require__.r(__webpack_exports__); 864/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "raf", function() { return raf; }); 865var win = window; 866 867var raf = win.requestAnimationFrame 868 || win.webkitRequestAnimationFrame 869 || win.mozRequestAnimationFrame 870 || win.msRequestAnimationFrame 871 || function(cb) { return setTimeout(cb, 16); }; 872 873 874/***/ }), 875
vendor: 1,105 bytes, lines 876-902
876/***/ "./node_modules/tiny-slider/src/helpers/removeAttrs.js": 877/*!*************************************************************!*\ 878 !*** ./node_modules/tiny-slider/src/helpers/removeAttrs.js ***! 879 \*************************************************************/ 880/*! exports provided: removeAttrs */ 881/***/ (function(module, __webpack_exports__, __webpack_require__) { 882 883"use strict"; 884__webpack_require__.r(__webpack_exports__); 885/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAttrs", function() { return removeAttrs; }); 886/* harmony import */ var _isNodeList_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isNodeList.js */ "./node_modules/tiny-slider/src/helpers/isNodeList.js"); 887 888 889function removeAttrs(els, attrs) { 890 els = (Object(_isNodeList_js__WEBPACK_IMPORTED_MODULE_0__["isNodeList"])(els) || els instanceof Array) ? els : [els]; 891 attrs = (attrs instanceof Array) ? attrs : [attrs]; 892 893 var attrLength = attrs.length; 894 for (var i = els.length; i--;) { 895 for (var j = attrLength; j--;) { 896 els[i].removeAttribute(attrs[j]); 897 } 898 } 899} 900 901/***/ }), 902
vendor: 933 bytes, lines 903-925
903/***/ "./node_modules/tiny-slider/src/helpers/removeCSSRule.js": 904/*!***************************************************************!*\ 905 !*** ./node_modules/tiny-slider/src/helpers/removeCSSRule.js ***! 906 \***************************************************************/ 907/*! exports provided: removeCSSRule */ 908/***/ (function(module, __webpack_exports__, __webpack_require__) { 909 910"use strict"; 911__webpack_require__.r(__webpack_exports__); 912/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCSSRule", function() { return removeCSSRule; }); 913/* harmony import */ var _raf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 914// cross browsers addRule method 915 916function removeCSSRule(sheet, index) { 917 // return raf(function() { 918 'deleteRule' in sheet ? 919 sheet.deleteRule(index) : 920 sheet.removeRule(index); 921 // }); 922} 923 924/***/ }), 925
vendor: 1,125 bytes, lines 926-949
926/***/ "./node_modules/tiny-slider/src/helpers/removeClass.js": 927/*!*************************************************************!*\ 928 !*** ./node_modules/tiny-slider/src/helpers/removeClass.js ***! 929 \*************************************************************/ 930/*! exports provided: removeClass */ 931/***/ (function(module, __webpack_exports__, __webpack_require__) { 932 933"use strict"; 934__webpack_require__.r(__webpack_exports__); 935/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeClass", function() { return removeClass; }); 936/* harmony import */ var _hasClass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 937 938var removeClass = _hasClass_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 939 function (el, str) { 940 if (Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.classList.remove(str); } 941 } : 942 function (el, str) { 943 if (Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.className = el.className.replace(str, ''); } 944 }; 945 946 947 948/***/ }), 949
vendor: 1,011 bytes, lines 950-971
950/***/ "./node_modules/tiny-slider/src/helpers/removeEvents.js": 951/*!**************************************************************!*\ 952 !*** ./node_modules/tiny-slider/src/helpers/removeEvents.js ***! 953 \**************************************************************/ 954/*! exports provided: removeEvents */ 955/***/ (function(module, __webpack_exports__, __webpack_require__) { 956 957"use strict"; 958__webpack_require__.r(__webpack_exports__); 959/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEvents", function() { return removeEvents; }); 960/* harmony import */ var _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./passiveOption.js */ "./node_modules/tiny-slider/src/helpers/passiveOption.js"); 961 962 963function removeEvents(el, obj) { 964 for (var prop in obj) { 965 var option = ['touchstart', 'touchmove'].indexOf(prop) >= 0 ? _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__["passiveOption"] : false; 966 el.removeEventListener(prop, obj[prop], option); 967 } 968} 969 970/***/ }), 971
vendor: 1,108 bytes, lines 972-996
972/***/ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js": 973/*!***************************************************************!*\ 974 !*** ./node_modules/tiny-slider/src/helpers/resetFakeBody.js ***! 975 \***************************************************************/ 976/*! exports provided: resetFakeBody */ 977/***/ (function(module, __webpack_exports__, __webpack_require__) { 978 979"use strict"; 980__webpack_require__.r(__webpack_exports__); 981/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resetFakeBody", function() { return resetFakeBody; }); 982/* harmony import */ var _docElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./docElement.js */ "./node_modules/tiny-slider/src/helpers/docElement.js"); 983 984 985function resetFakeBody (body, docOverflow) { 986 if (body.fake) { 987 body.remove(); 988 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow = docOverflow; 989 // Trigger layout so kinetic scrolling isn't disabled in iOS6+ 990 // eslint-disable-next-line 991 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].offsetHeight; 992 } 993} 994 995/***/ }), 996
vendor: 1,068 bytes, lines 997-1022
997/***/ "./node_modules/tiny-slider/src/helpers/setAttrs.js": 998/*!**********************************************************!*\ 999 !*** ./node_modules/tiny-slider/src/helpers/setAttrs.js ***! 1000 \**********************************************************/ 1001/*! exports provided: setAttrs */ 1002/***/ (function(module, __webpack_exports__, __webpack_require__) { 1003 1004"use strict"; 1005__webpack_require__.r(__webpack_exports__); 1006/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAttrs", function() { return setAttrs; }); 1007/* harmony import */ var _isNodeList_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isNodeList.js */ "./node_modules/tiny-slider/src/helpers/isNodeList.js"); 1008 1009 1010function setAttrs(els, attrs) { 1011 els = (Object(_isNodeList_js__WEBPACK_IMPORTED_MODULE_0__["isNodeList"])(els) || els instanceof Array) ? els : [els]; 1012 if (Object.prototype.toString.call(attrs) !== '[object Object]') { return; } 1013 1014 for (var i = els.length; i--;) { 1015 for(var key in attrs) { 1016 els[i].setAttribute(key, attrs[key]); 1017 } 1018 } 1019} 1020 1021/***/ }), 1022
vendor: 1,310 bytes, lines 1023-1051
1023/***/ "./node_modules/tiny-slider/src/helpers/setFakeBody.js": 1024/*!*************************************************************!*\ 1025 !*** ./node_modules/tiny-slider/src/helpers/setFakeBody.js ***! 1026 \*************************************************************/ 1027/*! exports provided: setFakeBody */ 1028/***/ (function(module, __webpack_exports__, __webpack_require__) { 1029 1030"use strict"; 1031__webpack_require__.r(__webpack_exports__); 1032/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setFakeBody", function() { return setFakeBody; }); 1033/* harmony import */ var _docElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./docElement.js */ "./node_modules/tiny-slider/src/helpers/docElement.js"); 1034 1035 1036function setFakeBody (body) { 1037 var docOverflow = ''; 1038 if (body.fake) { 1039 docOverflow = _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow; 1040 //avoid crashing IE8, if background image is used 1041 body.style.background = ''; 1042 //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible 1043 body.style.overflow = _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow = 'hidden'; 1044 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].appendChild(body); 1045 } 1046 1047 return docOverflow; 1048} 1049 1050/***/ }), 1051
vendor: 741 bytes, lines 1052-1070
1052/***/ "./node_modules/tiny-slider/src/helpers/setLocalStorage.js": 1053/*!*****************************************************************!*\ 1054 !*** ./node_modules/tiny-slider/src/helpers/setLocalStorage.js ***! 1055 \*****************************************************************/ 1056/*! exports provided: setLocalStorage */ 1057/***/ (function(module, __webpack_exports__, __webpack_require__) { 1058 1059"use strict"; 1060__webpack_require__.r(__webpack_exports__); 1061/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLocalStorage", function() { return setLocalStorage; }); 1062function setLocalStorage(storage, key, value, access) { 1063 if (access) { 1064 try { storage.setItem(key, value); } catch (e) {} 1065 } 1066 return value; 1067} 1068 1069/***/ }), 1070
vendor: 667 bytes, lines 1071-1086
1071/***/ "./node_modules/tiny-slider/src/helpers/showElement.js": 1072/*!*************************************************************!*\ 1073 !*** ./node_modules/tiny-slider/src/helpers/showElement.js ***! 1074 \*************************************************************/ 1075/*! exports provided: showElement */ 1076/***/ (function(module, __webpack_exports__, __webpack_require__) { 1077 1078"use strict"; 1079__webpack_require__.r(__webpack_exports__); 1080/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showElement", function() { return showElement; }); 1081function showElement(el, forceHide) { 1082 if (el.style.display === 'none') { el.style.display = ''; } 1083} 1084 1085/***/ }), 1086
vendor: 618 bytes, lines 1087-1102
1087/***/ "./node_modules/tiny-slider/src/helpers/toDegree.js": 1088/*!**********************************************************!*\ 1089 !*** ./node_modules/tiny-slider/src/helpers/toDegree.js ***! 1090 \**********************************************************/ 1091/*! exports provided: toDegree */ 1092/***/ (function(module, __webpack_exports__, __webpack_require__) { 1093 1094"use strict"; 1095__webpack_require__.r(__webpack_exports__); 1096/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDegree", function() { return toDegree; }); 1097function toDegree (y, x) { 1098 return Math.atan2(y, x) * (180 / Math.PI); 1099} 1100 1101/***/ }), 1102
vendor: 1,200 bytes, lines 1103-1140
1103/***/ "./node_modules/tiny-slider/src/helpers/whichProperty.js": 1104/*!***************************************************************!*\ 1105 !*** ./node_modules/tiny-slider/src/helpers/whichProperty.js ***! 1106 \***************************************************************/ 1107/*! exports provided: whichProperty */ 1108/***/ (function(module, __webpack_exports__, __webpack_require__) { 1109 1110"use strict"; 1111__webpack_require__.r(__webpack_exports__); 1112/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "whichProperty", function() { return whichProperty; }); 1113function whichProperty(props){ 1114 if (typeof props === 'string') { 1115 var arr = [props], 1116 Props = props.charAt(0).toUpperCase() + props.substr(1), 1117 prefixes = ['Webkit', 'Moz', 'ms', 'O']; 1118 1119 prefixes.forEach(function(prefix) { 1120 if (prefix !== 'ms' || props === 'transform') { 1121 arr.push(prefix + Props); 1122 } 1123 }); 1124 1125 props = arr; 1126 } 1127 1128 var el = document.createElement('fakeelement'), 1129 len = props.length; 1130 for(var i = 0; i < props.length; i++){ 1131 var prop = props[i]; 1132 if( el.style[prop] !== undefined ){ return prop; } 1133 } 1134 1135 return false; // explicit for ie9- 1136} 1137 1138 1139/***/ }), 1140
vendor: 109,421 bytes, lines 1141-3954
1141/***/ "./node_modules/tiny-slider/src/tiny-slider.js": 1142/*!*****************************************************!*\ 1143 !*** ./node_modules/tiny-slider/src/tiny-slider.js ***! 1144 \*****************************************************/ 1145/*! exports provided: tns */ 1146/***/ (function(module, __webpack_exports__, __webpack_require__) { 1147 1148"use strict"; 1149__webpack_require__.r(__webpack_exports__); 1150/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tns", function() { return tns; }); 1151/* harmony import */ var _helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 1152/* harmony import */ var _helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/caf.js */ "./node_modules/tiny-slider/src/helpers/caf.js"); 1153/* harmony import */ var _helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers/extend.js */ "./node_modules/tiny-slider/src/helpers/extend.js"); 1154/* harmony import */ var _helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers/checkStorageValue.js */ "./node_modules/tiny-slider/src/helpers/checkStorageValue.js"); 1155/* harmony import */ var _helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers/setLocalStorage.js */ "./node_modules/tiny-slider/src/helpers/setLocalStorage.js"); 1156/* harmony import */ var _helpers_getSlideId_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/getSlideId.js */ "./node_modules/tiny-slider/src/helpers/getSlideId.js"); 1157/* harmony import */ var _helpers_calc_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers/calc.js */ "./node_modules/tiny-slider/src/helpers/calc.js"); 1158/* harmony import */ var _helpers_percentageLayout_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers/percentageLayout.js */ "./node_modules/tiny-slider/src/helpers/percentageLayout.js"); 1159/* harmony import */ var _helpers_mediaquerySupport_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers/mediaquerySupport.js */ "./node_modules/tiny-slider/src/helpers/mediaquerySupport.js"); 1160/* harmony import */ var _helpers_createStyleSheet_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/createStyleSheet.js */ "./node_modules/tiny-slider/src/helpers/createStyleSheet.js"); 1161/* harmony import */ var _helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./helpers/addCSSRule.js */ "./node_modules/tiny-slider/src/helpers/addCSSRule.js"); 1162/* harmony import */ var _helpers_removeCSSRule_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/removeCSSRule.js */ "./node_modules/tiny-slider/src/helpers/removeCSSRule.js"); 1163/* harmony import */ var _helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/getCssRulesLength.js */ "./node_modules/tiny-slider/src/helpers/getCssRulesLength.js"); 1164/* harmony import */ var _helpers_toDegree_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./helpers/toDegree.js */ "./node_modules/tiny-slider/src/helpers/toDegree.js"); 1165/* harmony import */ var _helpers_getTouchDirection_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./helpers/getTouchDirection.js */ "./node_modules/tiny-slider/src/helpers/getTouchDirection.js"); 1166/* harmony import */ var _helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./helpers/forEach.js */ "./node_modules/tiny-slider/src/helpers/forEach.js"); 1167/* harmony import */ var _helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./helpers/hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 1168/* harmony import */ var _helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./helpers/addClass.js */ "./node_modules/tiny-slider/src/helpers/addClass.js"); 1169/* harmony import */ var _helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./helpers/removeClass.js */ "./node_modules/tiny-slider/src/helpers/removeClass.js"); 1170/* harmony import */ var _helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./helpers/hasAttr.js */ "./node_modules/tiny-slider/src/helpers/hasAttr.js"); 1171/* harmony import */ var _helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./helpers/getAttr.js */ "./node_modules/tiny-slider/src/helpers/getAttr.js"); 1172/* harmony import */ var _helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./helpers/setAttrs.js */ "./node_modules/tiny-slider/src/helpers/setAttrs.js"); 1173/* harmony import */ var _helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./helpers/removeAttrs.js */ "./node_modules/tiny-slider/src/helpers/removeAttrs.js"); 1174/* harmony import */ var _helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./helpers/arrayFromNodeList.js */ "./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js"); 1175/* harmony import */ var _helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./helpers/hideElement.js */ "./node_modules/tiny-slider/src/helpers/hideElement.js"); 1176/* harmony import */ var _helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./helpers/showElement.js */ "./node_modules/tiny-slider/src/helpers/showElement.js"); 1177/* harmony import */ var _helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./helpers/isVisible.js */ "./node_modules/tiny-slider/src/helpers/isVisible.js"); 1178/* harmony import */ var _helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./helpers/whichProperty.js */ "./node_modules/tiny-slider/src/helpers/whichProperty.js"); 1179/* harmony import */ var _helpers_has3DTransforms_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./helpers/has3DTransforms.js */ "./node_modules/tiny-slider/src/helpers/has3DTransforms.js"); 1180/* harmony import */ var _helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./helpers/getEndProperty.js */ "./node_modules/tiny-slider/src/helpers/getEndProperty.js"); 1181/* harmony import */ var _helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./helpers/addEvents.js */ "./node_modules/tiny-slider/src/helpers/addEvents.js"); 1182/* harmony import */ var _helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./helpers/removeEvents.js */ "./node_modules/tiny-slider/src/helpers/removeEvents.js"); 1183/* harmony import */ var _helpers_events_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./helpers/events.js */ "./node_modules/tiny-slider/src/helpers/events.js"); 1184/* harmony import */ var _helpers_jsTransform_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./helpers/jsTransform.js */ "./node_modules/tiny-slider/src/helpers/jsTransform.js"); 1185// Object.keys 1186if (!Object.keys) { 1187 Object.keys = function(object) { 1188 var keys = []; 1189 for (var name in object) { 1190 if (Object.prototype.hasOwnProperty.call(object, name)) { 1191 keys.push(name); 1192 } 1193 } 1194 return keys; 1195 }; 1196} 1197 1198// ChildNode.remove 1199if(!("remove" in Element.prototype)){ 1200 Element.prototype.remove = function(){ 1201 if(this.parentNode) { 1202 this.parentNode.removeChild(this); 1203 } 1204 }; 1205} 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242var tns = function(options) { 1243 options = Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__["extend"])({ 1244 container: '.slider', 1245 mode: 'carousel', 1246 axis: 'horizontal', 1247 items: 1, 1248 gutter: 0, 1249 edgePadding: 0, 1250 fixedWidth: false, 1251 autoWidth: false, 1252 viewportMax: false, 1253 slideBy: 1, 1254 center: false, 1255 controls: true, 1256 controlsPosition: 'top', 1257 controlsText: ['prev', 'next'], 1258 controlsContainer: false, 1259 prevButton: false, 1260 nextButton: false, 1261 nav: true, 1262 navPosition: 'top', 1263 navContainer: false, 1264 navAsThumbnails: false, 1265 arrowKeys: false, 1266 speed: 300, 1267 autoplay: false, 1268 autoplayPosition: 'top', 1269 autoplayTimeout: 5000, 1270 autoplayDirection: 'forward', 1271 autoplayText: ['start', 'stop'], 1272 autoplayHoverPause: false, 1273 autoplayButton: false, 1274 autoplayButtonOutput: true, 1275 autoplayResetOnVisibility: true, 1276 animateIn: 'tns-fadeIn', 1277 animateOut: 'tns-fadeOut', 1278 animateNormal: 'tns-normal', 1279 animateDelay: false, 1280 loop: true, 1281 rewind: false, 1282 autoHeight: false, 1283 responsive: false, 1284 lazyload: false, 1285 lazyloadSelector: '.tns-lazy-img', 1286 touch: true, 1287 mouseDrag: false, 1288 swipeAngle: 15, 1289 nested: false, 1290 preventActionWhenRunning: false, 1291 preventScrollOnTouch: false, 1292 freezable: true, 1293 onInit: false, 1294 useLocalStorage: true, 1295 nonce: false 1296 }, options || {}); 1297 1298 var doc = document, 1299 win = window, 1300 KEYS = { 1301 ENTER: 13, 1302 SPACE: 32, 1303 LEFT: 37, 1304 RIGHT: 39 1305 }, 1306 tnsStorage = {}, 1307 localStorageAccess = options.useLocalStorage; 1308 1309 if (localStorageAccess) { 1310 // check browser version and local storage access 1311 var browserInfo = navigator.userAgent; 1312 var uid = new Date; 1313 1314 try { 1315 tnsStorage = win.localStorage; 1316 if (tnsStorage) { 1317 tnsStorage.setItem(uid, uid); 1318 localStorageAccess = tnsStorage.getItem(uid) == uid; 1319 tnsStorage.removeItem(uid); 1320 } else { 1321 localStorageAccess = false; 1322 } 1323 if (!localStorageAccess) { tnsStorage = {}; } 1324 } catch(e) { 1325 localStorageAccess = false; 1326 } 1327 1328 if (localStorageAccess) { 1329 // remove storage when browser version changes 1330 if (tnsStorage['tnsApp'] && tnsStorage['tnsApp'] !== browserInfo) { 1331 ['tC', 'tPL', 'tMQ', 'tTf', 't3D', 'tTDu', 'tTDe', 'tADu', 'tADe', 'tTE', 'tAE'].forEach(function(item) { tnsStorage.removeItem(item); }); 1332 } 1333 // update browserInfo 1334 localStorage['tnsApp'] = browserInfo; 1335 } 1336 } 1337 1338 var CALC = tnsStorage['tC'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tC']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tC', Object(_helpers_calc_js__WEBPACK_IMPORTED_MODULE_6__["calc"])(), localStorageAccess), 1339 PERCENTAGELAYOUT = tnsStorage['tPL'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tPL']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tPL', Object(_helpers_percentageLayout_js__WEBPACK_IMPORTED_MODULE_7__["percentageLayout"])(), localStorageAccess), 1340 CSSMQ = tnsStorage['tMQ'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tMQ']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tMQ', Object(_helpers_mediaquerySupport_js__WEBPACK_IMPORTED_MODULE_8__["mediaquerySupport"])(), localStorageAccess), 1341 TRANSFORM = tnsStorage['tTf'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTf']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTf', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('transform'), localStorageAccess), 1342 HAS3DTRANSFORMS = tnsStorage['t3D'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['t3D']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 't3D', Object(_helpers_has3DTransforms_js__WEBPACK_IMPORTED_MODULE_28__["has3DTransforms"])(TRANSFORM), localStorageAccess), 1343 TRANSITIONDURATION = tnsStorage['tTDu'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTDu']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTDu', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('transitionDuration'), localStorageAccess), 1344 TRANSITIONDELAY = tnsStorage['tTDe'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTDe']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTDe', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('transitionDelay'), localStorageAccess), 1345 ANIMATIONDURATION = tnsStorage['tADu'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tADu']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tADu', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('animationDuration'), localStorageAccess), 1346 ANIMATIONDELAY = tnsStorage['tADe'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tADe']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tADe', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('animationDelay'), localStorageAccess), 1347 TRANSITIONEND = tnsStorage['tTE'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTE']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTE', Object(_helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_29__["getEndProperty"])(TRANSITIONDURATION, 'Transition'), localStorageAccess), 1348 ANIMATIONEND = tnsStorage['tAE'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tAE']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tAE', Object(_helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_29__["getEndProperty"])(ANIMATIONDURATION, 'Animation'), localStorageAccess); 1349 1350 // get element nodes from selectors 1351 var supportConsoleWarn = win.console && typeof win.console.warn === "function", 1352 tnsList = ['container', 'controlsContainer', 'prevButton', 'nextButton', 'navContainer', 'autoplayButton'], 1353 optionsElements = {}; 1354 1355 tnsList.forEach(function(item) { 1356 if (typeof options[item] === 'string') { 1357 var str = options[item], 1358 el = doc.querySelector(str); 1359 optionsElements[item] = str; 1360 1361 if (el && el.nodeName) { 1362 options[item] = el; 1363 } else { 1364 if (supportConsoleWarn) { console.warn('Can\'t find', options[item]); } 1365 return; 1366 } 1367 } 1368 }); 1369 1370 // make sure at least 1 slide 1371 if (options.container.children.length < 1) { 1372 if (supportConsoleWarn) { console.warn('No slides found in', options.container); } 1373 return; 1374 } 1375 1376 // update options 1377 var responsive = options.responsive, 1378 nested = options.nested, 1379 carousel = options.mode === 'carousel' ? true : false; 1380 1381 if (responsive) { 1382 // apply responsive[0] to options and remove it 1383 if (0 in responsive) { 1384 options = Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__["extend"])(options, responsive[0]); 1385 delete responsive[0]; 1386 } 1387 1388 var responsiveTem = {}; 1389 for (var key in responsive) { 1390 var val = responsive[key]; 1391 // update responsive 1392 // from: 300: 2 1393 // to: 1394 // 300: { 1395 // items: 2 1396 // } 1397 val = typeof val === 'number' ? {items: val} : val; 1398 responsiveTem[key] = val; 1399 } 1400 responsive = responsiveTem; 1401 responsiveTem = null; 1402 } 1403 1404 // update options 1405 function updateOptions (obj) { 1406 for (var key in obj) { 1407 if (!carousel) { 1408 if (key === 'slideBy') { obj[key] = 'page'; } 1409 if (key === 'edgePadding') { obj[key] = false; } 1410 if (key === 'autoHeight') { obj[key] = false; } 1411 } 1412 1413 // update responsive options 1414 if (key === 'responsive') { updateOptions(obj[key]); } 1415 } 1416 } 1417 if (!carousel) { updateOptions(options); } 1418 1419 1420 // === define and set variables === 1421 if (!carousel) { 1422 options.axis = 'horizontal'; 1423 options.slideBy = 'page'; 1424 options.edgePadding = false; 1425 1426 var animateIn = options.animateIn, 1427 animateOut = options.animateOut, 1428 animateDelay = options.animateDelay, 1429 animateNormal = options.animateNormal; 1430 } 1431 1432 var horizontal = options.axis === 'horizontal' ? true : false, 1433 outerWrapper = doc.createElement('div'), 1434 innerWrapper = doc.createElement('div'), 1435 middleWrapper, 1436 container = options.container, 1437 containerParent = container.parentNode, 1438 containerHTML = container.outerHTML, 1439 slideItems = container.children, 1440 slideCount = slideItems.length, 1441 breakpointZone, 1442 windowWidth = getWindowWidth(), 1443 isOn = false; 1444 if (responsive) { setBreakpointZone(); } 1445 if (carousel) { container.className += ' tns-vpfix'; } 1446 1447 // fixedWidth: viewport > rightBoundary > indexMax 1448 var autoWidth = options.autoWidth, 1449 fixedWidth = getOption('fixedWidth'), 1450 edgePadding = getOption('edgePadding'), 1451 gutter = getOption('gutter'), 1452 viewport = getViewportWidth(), 1453 center = getOption('center'), 1454 items = !autoWidth ? Math.floor(getOption('items')) : 1, 1455 slideBy = getOption('slideBy'), 1456 viewportMax = options.viewportMax || options.fixedWidthViewportWidth, 1457 arrowKeys = getOption('arrowKeys'), 1458 speed = getOption('speed'), 1459 rewind = options.rewind, 1460 loop = rewind ? false : options.loop, 1461 autoHeight = getOption('autoHeight'), 1462 controls = getOption('controls'), 1463 controlsText = getOption('controlsText'), 1464 nav = getOption('nav'), 1465 touch = getOption('touch'), 1466 mouseDrag = getOption('mouseDrag'), 1467 autoplay = getOption('autoplay'), 1468 autoplayTimeout = getOption('autoplayTimeout'), 1469 autoplayText = getOption('autoplayText'), 1470 autoplayHoverPause = getOption('autoplayHoverPause'), 1471 autoplayResetOnVisibility = getOption('autoplayResetOnVisibility'), 1472 sheet = Object(_helpers_createStyleSheet_js__WEBPACK_IMPORTED_MODULE_9__["createStyleSheet"])(null, getOption('nonce')), 1473 lazyload = options.lazyload, 1474 lazyloadSelector = options.lazyloadSelector, 1475 slidePositions, // collection of slide positions 1476 slideItemsOut = [], 1477 cloneCount = loop ? getCloneCountForLoop() : 0, 1478 slideCountNew = !carousel ? slideCount + cloneCount : slideCount + cloneCount * 2, 1479 hasRightDeadZone = (fixedWidth || autoWidth) && !loop ? true : false, 1480 rightBoundary = fixedWidth ? getRightBoundary() : null, 1481 updateIndexBeforeTransform = (!carousel || !loop) ? true : false, 1482 // transform 1483 transformAttr = horizontal ? 'left' : 'top', 1484 transformPrefix = '', 1485 transformPostfix = '', 1486 // index 1487 getIndexMax = (function () { 1488 if (fixedWidth) { 1489 return function() { return center && !loop ? slideCount - 1 : Math.ceil(- rightBoundary / (fixedWidth + gutter)); }; 1490 } else if (autoWidth) { 1491 return function() { 1492 for (var i = 0; i < slideCountNew; i++) { 1493 if (slidePositions[i] >= - rightBoundary) { return i; } 1494 } 1495 }; 1496 } else { 1497 return function() { 1498 if (center && carousel && !loop) { 1499 return slideCount - 1; 1500 } else { 1501 return loop || carousel ? Math.max(0, slideCountNew - Math.ceil(items)) : slideCountNew - 1; 1502 } 1503 }; 1504 } 1505 })(), 1506 index = getStartIndex(getOption('startIndex')), 1507 indexCached = index, 1508 displayIndex = getCurrentSlide(), 1509 indexMin = 0, 1510 indexMax = !autoWidth ? getIndexMax() : null, 1511 // resize 1512 resizeTimer, 1513 preventActionWhenRunning = options.preventActionWhenRunning, 1514 swipeAngle = options.swipeAngle, 1515 moveDirectionExpected = swipeAngle ? '?' : true, 1516 running = false, 1517 onInit = options.onInit, 1518 events = new _helpers_events_js__WEBPACK_IMPORTED_MODULE_32__["Events"](), 1519 // id, class 1520 newContainerClasses = ' tns-slider tns-' + options.mode, 1521 slideId = container.id || Object(_helpers_getSlideId_js__WEBPACK_IMPORTED_MODULE_5__["getSlideId"])(), 1522 disable = getOption('disable'), 1523 disabled = false, 1524 freezable = options.freezable, 1525 freeze = freezable && !autoWidth ? getFreeze() : false, 1526 frozen = false, 1527 controlsEvents = { 1528 'click': onControlsClick, 1529 'keydown': onControlsKeydown 1530 }, 1531 navEvents = { 1532 'click': onNavClick, 1533 'keydown': onNavKeydown 1534 }, 1535 hoverEvents = { 1536 'mouseover': mouseoverPause, 1537 'mouseout': mouseoutRestart 1538 }, 1539 visibilityEvent = {'visibilitychange': onVisibilityChange}, 1540 docmentKeydownEvent = {'keydown': onDocumentKeydown}, 1541 touchEvents = { 1542 'touchstart': onPanStart, 1543 'touchmove': onPanMove, 1544 'touchend': onPanEnd, 1545 'touchcancel': onPanEnd 1546 }, dragEvents = { 1547 'mousedown': onPanStart, 1548 'mousemove': onPanMove, 1549 'mouseup': onPanEnd, 1550 'mouseleave': onPanEnd 1551 }, 1552 hasControls = hasOption('controls'), 1553 hasNav = hasOption('nav'), 1554 navAsThumbnails = autoWidth ? true : options.navAsThumbnails, 1555 hasAutoplay = hasOption('autoplay'), 1556 hasTouch = hasOption('touch'), 1557 hasMouseDrag = hasOption('mouseDrag'), 1558 slideActiveClass = 'tns-slide-active', 1559 slideClonedClass = 'tns-slide-cloned', 1560 imgCompleteClass = 'tns-complete', 1561 imgEvents = { 1562 'load': onImgLoaded, 1563 'error': onImgFailed 1564 }, 1565 imgsComplete, 1566 liveregionCurrent, 1567 preventScroll = options.preventScrollOnTouch === 'force' ? true : false; 1568 1569 // controls 1570 if (hasControls) { 1571 var controlsContainer = options.controlsContainer, 1572 controlsContainerHTML = options.controlsContainer ? options.controlsContainer.outerHTML : '', 1573 prevButton = options.prevButton, 1574 nextButton = options.nextButton, 1575 prevButtonHTML = options.prevButton ? options.prevButton.outerHTML : '', 1576 nextButtonHTML = options.nextButton ? options.nextButton.outerHTML : '', 1577 prevIsButton, 1578 nextIsButton; 1579 } 1580 1581 // nav 1582 if (hasNav) { 1583 var navContainer = options.navContainer, 1584 navContainerHTML = options.navContainer ? options.navContainer.outerHTML : '', 1585 navItems, 1586 pages = autoWidth ? slideCount : getPages(), 1587 pagesCached = 0, 1588 navClicked = -1, 1589 navCurrentIndex = getCurrentNavIndex(), 1590 navCurrentIndexCached = navCurrentIndex, 1591 navActiveClass = 'tns-nav-active', 1592 navStr = 'Carousel Page ', 1593 navStrCurrent = ' (Current Slide)'; 1594 } 1595 1596 // autoplay 1597 if (hasAutoplay) { 1598 var autoplayDirection = options.autoplayDirection === 'forward' ? 1 : -1, 1599 autoplayButton = options.autoplayButton, 1600 autoplayButtonHTML = options.autoplayButton ? options.autoplayButton.outerHTML : '', 1601 autoplayHtmlStrings = ['<span class=\'tns-visually-hidden\'>', ' animation</span>'], 1602 autoplayTimer, 1603 animating, 1604 autoplayHoverPaused, 1605 autoplayUserPaused, 1606 autoplayVisibilityPaused; 1607 } 1608 1609 if (hasTouch || hasMouseDrag) { 1610 var initPosition = {}, 1611 lastPosition = {}, 1612 translateInit, 1613 disX, 1614 disY, 1615 panStart = false, 1616 rafIndex, 1617 getDist = horizontal ? 1618 function(a, b) { return a.x - b.x; } : 1619 function(a, b) { return a.y - b.y; }; 1620 } 1621 1622 // disable slider when slidecount <= items 1623 if (!autoWidth) { resetVariblesWhenDisable(disable || freeze); } 1624 1625 if (TRANSFORM) { 1626 transformAttr = TRANSFORM; 1627 transformPrefix = 'translate'; 1628 1629 if (HAS3DTRANSFORMS) { 1630 transformPrefix += horizontal ? '3d(' : '3d(0px, '; 1631 transformPostfix = horizontal ? ', 0px, 0px)' : ', 0px)'; 1632 } else { 1633 transformPrefix += horizontal ? 'X(' : 'Y('; 1634 transformPostfix = ')'; 1635 } 1636 1637 } 1638 1639 if (carousel) { container.className = container.className.replace('tns-vpfix', ''); } 1640 initStructure(); 1641 initSheet(); 1642 initSliderTransform(); 1643 1644 // === COMMON FUNCTIONS === // 1645 function resetVariblesWhenDisable (condition) { 1646 if (condition) { 1647 controls = nav = touch = mouseDrag = arrowKeys = autoplay = autoplayHoverPause = autoplayResetOnVisibility = false; 1648 } 1649 } 1650 1651 function getCurrentSlide () { 1652 var tem = carousel ? index - cloneCount : index; 1653 while (tem < 0) { tem += slideCount; } 1654 return tem%slideCount + 1; 1655 } 1656 1657 function getStartIndex (ind) { 1658 ind = ind ? Math.max(0, Math.min(loop ? slideCount - 1 : slideCount - items, ind)) : 0; 1659 return carousel ? ind + cloneCount : ind; 1660 } 1661 1662 function getAbsIndex (i) { 1663 if (i == null) { i = index; } 1664 1665 if (carousel) { i -= cloneCount; } 1666 while (i < 0) { i += slideCount; } 1667 1668 return Math.floor(i%slideCount); 1669 } 1670 1671 function getCurrentNavIndex () { 1672 var absIndex = getAbsIndex(), 1673 result; 1674 1675 result = navAsThumbnails ? absIndex : 1676 fixedWidth || autoWidth ? Math.ceil((absIndex + 1) * pages / slideCount - 1) : 1677 Math.floor(absIndex / items); 1678 1679 // set active nav to the last one when reaches the right edge 1680 if (!loop && carousel && index === indexMax) { result = pages - 1; } 1681 1682 return result; 1683 } 1684 1685 function getItemsMax () { 1686 // fixedWidth or autoWidth while viewportMax is not available 1687 if (autoWidth || (fixedWidth && !viewportMax)) { 1688 return slideCount - 1; 1689 // most cases 1690 } else { 1691 var str = fixedWidth ? 'fixedWidth' : 'items', 1692 arr = []; 1693 1694 if (fixedWidth || options[str] < slideCount) { arr.push(options[str]); } 1695 1696 if (responsive) { 1697 for (var bp in responsive) { 1698 var tem = responsive[bp][str]; 1699 if (tem && (fixedWidth || tem < slideCount)) { arr.push(tem); } 1700 } 1701 } 1702 1703 if (!arr.length) { arr.push(0); } 1704 1705 return Math.ceil(fixedWidth ? viewportMax / Math.min.apply(null, arr) : Math.max.apply(null, arr)); 1706 } 1707 } 1708 1709 function getCloneCountForLoop () { 1710 var itemsMax = getItemsMax(), 1711 result = carousel ? Math.ceil((itemsMax * 5 - slideCount)/2) : (itemsMax * 4 - slideCount); 1712 result = Math.max(itemsMax, result); 1713 1714 return hasOption('edgePadding') ? result + 1 : result; 1715 } 1716 1717 function getWindowWidth () { 1718 return win.innerWidth || doc.documentElement.clientWidth || doc.body.clientWidth; 1719 } 1720 1721 function getInsertPosition (pos) { 1722 return pos === 'top' ? 'afterbegin' : 'beforeend'; 1723 } 1724 1725 function getClientWidth (el) { 1726 if (el == null) { return; } 1727 var div = doc.createElement('div'), rect, width; 1728 el.appendChild(div); 1729 rect = div.getBoundingClientRect(); 1730 width = rect.right - rect.left; 1731 div.remove(); 1732 return width || getClientWidth(el.parentNode); 1733 } 1734 1735 function getViewportWidth () { 1736 var gap = edgePadding ? edgePadding * 2 - gutter : 0; 1737 return getClientWidth(containerParent) - gap; 1738 } 1739 1740 function hasOption (item) { 1741 if (options[item]) { 1742 return true; 1743 } else { 1744 if (responsive) { 1745 for (var bp in responsive) { 1746 if (responsive[bp][item]) { return true; } 1747 } 1748 } 1749 return false; 1750 } 1751 } 1752 1753 // get option: 1754 // fixed width: viewport, fixedWidth, gutter => items 1755 // others: window width => all variables 1756 // all: items => slideBy 1757 function getOption (item, ww) { 1758 if (ww == null) { ww = windowWidth; } 1759 1760 if (item === 'items' && fixedWidth) { 1761 return Math.floor((viewport + gutter) / (fixedWidth + gutter)) || 1; 1762 1763 } else { 1764 var result = options[item]; 1765 1766 if (responsive) { 1767 for (var bp in responsive) { 1768 // bp: convert string to number 1769 if (ww >= parseInt(bp)) { 1770 if (item in responsive[bp]) { result = responsive[bp][item]; } 1771 } 1772 } 1773 } 1774 1775 if (item === 'slideBy' && result === 'page') { result = getOption('items'); } 1776 if (!carousel && (item === 'slideBy' || item === 'items')) { result = Math.floor(result); } 1777 1778 return result; 1779 } 1780 } 1781 1782 function getSlideMarginLeft (i) { 1783 return CALC ? 1784 CALC + '(' + i * 100 + '% / ' + slideCountNew + ')' : 1785 i * 100 / slideCountNew + '%'; 1786 } 1787 1788 function getInnerWrapperStyles (edgePaddingTem, gutterTem, fixedWidthTem, speedTem, autoHeightBP) { 1789 var str = ''; 1790 1791 if (edgePaddingTem !== undefined) { 1792 var gap = edgePaddingTem; 1793 if (gutterTem) { gap -= gutterTem; } 1794 str = horizontal ? 1795 'margin: 0 ' + gap + 'px 0 ' + edgePaddingTem + 'px;' : 1796 'margin: ' + edgePaddingTem + 'px 0 ' + gap + 'px 0;'; 1797 } else if (gutterTem && !fixedWidthTem) { 1798 var gutterTemUnit = '-' + gutterTem + 'px', 1799 dir = horizontal ? gutterTemUnit + ' 0 0' : '0 ' + gutterTemUnit + ' 0'; 1800 str = 'margin: 0 ' + dir + ';' 1801 } 1802 1803 if (!carousel && autoHeightBP && TRANSITIONDURATION && speedTem) { str += getTransitionDurationStyle(speedTem); } 1804 return str; 1805 } 1806 1807 function getContainerWidth (fixedWidthTem, gutterTem, itemsTem) { 1808 if (fixedWidthTem) { 1809 return (fixedWidthTem + gutterTem) * slideCountNew + 'px'; 1810 } else { 1811 return CALC ? 1812 CALC + '(' + slideCountNew * 100 + '% / ' + itemsTem + ')' : 1813 slideCountNew * 100 / itemsTem + '%'; 1814 } 1815 } 1816 1817 function getSlideWidthStyle (fixedWidthTem, gutterTem, itemsTem) { 1818 var width; 1819 1820 if (fixedWidthTem) { 1821 width = (fixedWidthTem + gutterTem) + 'px'; 1822 } else { 1823 if (!carousel) { itemsTem = Math.floor(itemsTem); } 1824 var dividend = carousel ? slideCountNew : itemsTem; 1825 width = CALC ? 1826 CALC + '(100% / ' + dividend + ')' : 1827 100 / dividend + '%'; 1828 } 1829 1830 width = 'width:' + width; 1831 1832 // inner slider: overwrite outer slider styles 1833 return nested !== 'inner' ? width + ';' : width + ' !important;'; 1834 } 1835 1836 function getSlideGutterStyle (gutterTem) { 1837 var str = ''; 1838 1839 // gutter maybe interger || 0 1840 // so can't use 'if (gutter)' 1841 if (gutterTem !== false) { 1842 var prop = horizontal ? 'padding-' : 'margin-', 1843 dir = horizontal ? 'right' : 'bottom'; 1844 str = prop + dir + ': ' + gutterTem + 'px;'; 1845 } 1846 1847 return str; 1848 } 1849 1850 function getCSSPrefix (name, num) { 1851 var prefix = name.substring(0, name.length - num).toLowerCase(); 1852 if (prefix) { prefix = '-' + prefix + '-'; } 1853 1854 return prefix; 1855 } 1856 1857 function getTransitionDurationStyle (speed) { 1858 return getCSSPrefix(TRANSITIONDURATION, 18) + 'transition-duration:' + speed / 1000 + 's;'; 1859 } 1860 1861 function getAnimationDurationStyle (speed) { 1862 return getCSSPrefix(ANIMATIONDURATION, 17) + 'animation-duration:' + speed / 1000 + 's;'; 1863 } 1864 1865 function initStructure () { 1866 var classOuter = 'tns-outer', 1867 classInner = 'tns-inner', 1868 hasGutter = hasOption('gutter'); 1869 1870 outerWrapper.className = classOuter; 1871 innerWrapper.className = classInner; 1872 outerWrapper.id = slideId + '-ow'; 1873 innerWrapper.id = slideId + '-iw'; 1874 1875 // set container properties 1876 if (container.id === '') { container.id = slideId; } 1877 newContainerClasses += PERCENTAGELAYOUT || autoWidth ? ' tns-subpixel' : ' tns-no-subpixel'; 1878 newContainerClasses += CALC ? ' tns-calc' : ' tns-no-calc'; 1879 if (autoWidth) { newContainerClasses += ' tns-autowidth'; } 1880 newContainerClasses += ' tns-' + options.axis; 1881 container.className += newContainerClasses; 1882 1883 // add constrain layer for carousel 1884 if (carousel) { 1885 middleWrapper = doc.createElement('div'); 1886 middleWrapper.id = slideId + '-mw'; 1887 middleWrapper.className = 'tns-ovh'; 1888 1889 outerWrapper.appendChild(middleWrapper); 1890 middleWrapper.appendChild(innerWrapper); 1891 } else { 1892 outerWrapper.appendChild(innerWrapper); 1893 } 1894 1895 if (autoHeight) { 1896 var wp = middleWrapper ? middleWrapper : innerWrapper; 1897 wp.className += ' tns-ah'; 1898 } 1899 1900 containerParent.insertBefore(outerWrapper, container); 1901 innerWrapper.appendChild(container); 1902 1903 // add id, class, aria attributes 1904 // before clone slides 1905 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(item, i) { 1906 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, 'tns-item'); 1907 if (!item.id) { item.id = slideId + '-item' + i; } 1908 if (!carousel && animateNormal) { Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateNormal); } 1909 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(item, { 1910 'aria-hidden': 'true', 1911 'tabindex': '-1' 1912 }); 1913 }); 1914 1915 // ## clone slides 1916 // carousel: n + slides + n 1917 // gallery: slides + n 1918 if (cloneCount) { 1919 var fragmentBefore = doc.createDocumentFragment(), 1920 fragmentAfter = doc.createDocumentFragment(); 1921 1922 for (var j = cloneCount; j--;) { 1923 var num = j%slideCount, 1924 cloneFirst = slideItems[num].cloneNode(true); 1925 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(cloneFirst, slideClonedClass); 1926 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(cloneFirst, 'id'); 1927 fragmentAfter.insertBefore(cloneFirst, fragmentAfter.firstChild); 1928 1929 if (carousel) { 1930 var cloneLast = slideItems[slideCount - 1 - num].cloneNode(true); 1931 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(cloneLast, slideClonedClass); 1932 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(cloneLast, 'id'); 1933 fragmentBefore.appendChild(cloneLast); 1934 } 1935 } 1936 1937 container.insertBefore(fragmentBefore, container.firstChild); 1938 container.appendChild(fragmentAfter); 1939 slideItems = container.children; 1940 } 1941 1942 } 1943 1944 function initSliderTransform () { 1945 // ## images loaded/failed 1946 if (hasOption('autoHeight') || autoWidth || !horizontal) { 1947 var imgs = container.querySelectorAll('img'); 1948 1949 // add img load event listener 1950 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(imgs, function(img) { 1951 var src = img.src; 1952 1953 if (!lazyload) { 1954 // not data img 1955 if (src && src.indexOf('data:image') < 0) { 1956 img.src = ''; 1957 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(img, imgEvents); 1958 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'loading'); 1959 1960 img.src = src; 1961 // data img 1962 } else { 1963 imgLoaded(img); 1964 } 1965 } 1966 }); 1967 1968 // set imgsComplete 1969 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(Object(_helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_23__["arrayFromNodeList"])(imgs), function() { imgsComplete = true; }); }); 1970 1971 // reset imgs for auto height: check visible imgs only 1972 if (hasOption('autoHeight')) { imgs = getImageArray(index, Math.min(index + items - 1, slideCountNew - 1)); } 1973 1974 lazyload ? initSliderTransformStyleCheck() : Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(Object(_helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_23__["arrayFromNodeList"])(imgs), initSliderTransformStyleCheck); }); 1975 1976 } else { 1977 // set container transform property 1978 if (carousel) { doContainerTransformSilent(); } 1979 1980 // update slider tools and events 1981 initTools(); 1982 initEvents(); 1983 } 1984 } 1985 1986 function initSliderTransformStyleCheck () { 1987 if (autoWidth && slideCount > 1) { 1988 // check styles application 1989 var num = loop ? index : slideCount - 1; 1990 1991 (function stylesApplicationCheck() { 1992 var left = slideItems[num].getBoundingClientRect().left; 1993 var right = slideItems[num - 1].getBoundingClientRect().right; 1994 1995 (Math.abs(left - right) <= 1) ? 1996 initSliderTransformCore() : 1997 setTimeout(function(){ stylesApplicationCheck() }, 16); 1998 })(); 1999 2000 } else { 2001 initSliderTransformCore(); 2002 } 2003 } 2004 2005 2006 function initSliderTransformCore () { 2007 // run Fn()s which are rely on image loading 2008 if (!horizontal || autoWidth) { 2009 setSlidePositions(); 2010 2011 if (autoWidth) { 2012 rightBoundary = getRightBoundary(); 2013 if (freezable) { freeze = getFreeze(); } 2014 indexMax = getIndexMax(); // <= slidePositions, rightBoundary <= 2015 resetVariblesWhenDisable(disable || freeze); 2016 } else { 2017 updateContentWrapperHeight(); 2018 } 2019 } 2020 2021 // set container transform property 2022 if (carousel) { doContainerTransformSilent(); } 2023 2024 // update slider tools and events 2025 initTools(); 2026 initEvents(); 2027 } 2028 2029 function initSheet () { 2030 // gallery: 2031 // set animation classes and left value for gallery slider 2032 if (!carousel) { 2033 for (var i = index, l = index + Math.min(slideCount, items); i < l; i++) { 2034 var item = slideItems[i]; 2035 item.style.left = (i - index) * 100 / items + '%'; 2036 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateIn); 2037 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateNormal); 2038 } 2039 } 2040 2041 // #### LAYOUT 2042 2043 // ## INLINE-BLOCK VS FLOAT 2044 2045 // ## PercentageLayout: 2046 // slides: inline-block 2047 // remove blank space between slides by set font-size: 0 2048 2049 // ## Non PercentageLayout: 2050 // slides: float 2051 // margin-right: -100% 2052 // margin-left: ~ 2053 2054 // Resource: https://docs.google.com/spreadsheets/d/147up245wwTXeQYve3BRSAD4oVcvQmuGsFteJOeA5xNQ/edit?usp=sharing 2055 if (horizontal) { 2056 if (PERCENTAGELAYOUT || autoWidth) { 2057 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', 'font-size:' + win.getComputedStyle(slideItems[0]).fontSize + ';', Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 2058 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId, 'font-size:0;', Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 2059 } else if (carousel) { 2060 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function (slide, i) { 2061 slide.style.marginLeft = getSlideMarginLeft(i); 2062 }); 2063 } 2064 } 2065 2066 2067 // ## BASIC STYLES 2068 if (CSSMQ) { 2069 // middle wrapper style 2070 if (TRANSITIONDURATION) { 2071 var str = middleWrapper && options.autoHeight ? getTransitionDurationStyle(options.speed) : ''; 2072 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + '-mw', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 2073 } 2074 2075 // inner wrapper styles 2076 str = getInnerWrapperStyles(options.edgePadding, options.gutter, options.fixedWidth, options.speed, options.autoHeight); 2077 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + '-iw', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 2078 2079 // container styles 2080 if (carousel) { 2081 str = horizontal && !autoWidth ? 'width:' + getContainerWidth(options.fixedWidth, options.gutter, options.items) + ';' : ''; 2082 if (TRANSITIONDURATION) { str += getTransitionDurationStyle(speed); } 2083 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId, str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 2084 } 2085 2086 // slide styles 2087 str = horizontal && !autoWidth ? getSlideWidthStyle(options.fixedWidth, options.gutter, options.items) : ''; 2088 if (options.gutter) { str += getSlideGutterStyle(options.gutter); } 2089 // set gallery items transition-duration 2090 if (!carousel) { 2091 if (TRANSITIONDURATION) { str += getTransitionDurationStyle(speed); } 2092 if (ANIMATIONDURATION) { str += getAnimationDurationStyle(speed); } 2093 } 2094 if (str) { Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); } 2095 2096 // non CSS mediaqueries: IE8 2097 // ## update inner wrapper, container, slides if needed 2098 // set inline styles for inner wrapper & container 2099 // insert stylesheet (one line) for slides only (since slides are many) 2100 } else { 2101 // middle wrapper styles 2102 update_carousel_transition_duration(); 2103 2104 // inner wrapper styles 2105 innerWrapper.style.cssText = getInnerWrapperStyles(edgePadding, gutter, fixedWidth, autoHeight); 2106 2107 // container styles 2108 if (carousel && horizontal && !autoWidth) { 2109 container.style.width = getContainerWidth(fixedWidth, gutter, items); 2110 } 2111 2112 // slide styles 2113 var str = horizontal && !autoWidth ? getSlideWidthStyle(fixedWidth, gutter, items) : ''; 2114 if (gutter) { str += getSlideGutterStyle(gutter); } 2115 2116 // append to the last line 2117 if (str) { Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); } 2118 } 2119 2120 // ## MEDIAQUERIES 2121 if (responsive && CSSMQ) { 2122 for (var bp in responsive) { 2123 // bp: convert string to number 2124 bp = parseInt(bp); 2125 2126 var opts = responsive[bp], 2127 str = '', 2128 middleWrapperStr = '', 2129 innerWrapperStr = '', 2130 containerStr = '', 2131 slideStr = '', 2132 itemsBP = !autoWidth ? getOption('items', bp) : null, 2133 fixedWidthBP = getOption('fixedWidth', bp), 2134 speedBP = getOption('speed', bp), 2135 edgePaddingBP = getOption('edgePadding', bp), 2136 autoHeightBP = getOption('autoHeight', bp), 2137 gutterBP = getOption('gutter', bp); 2138 2139 // middle wrapper string 2140 if (TRANSITIONDURATION && middleWrapper && getOption('autoHeight', bp) && 'speed' in opts) { 2141 middleWrapperStr = '#' + slideId + '-mw{' + getTransitionDurationStyle(speedBP) + '}'; 2142 } 2143 2144 // inner wrapper string 2145 if ('edgePadding' in opts || 'gutter' in opts) { 2146 innerWrapperStr = '#' + slideId + '-iw{' + getInnerWrapperStyles(edgePaddingBP, gutterBP, fixedWidthBP, speedBP, autoHeightBP) + '}'; 2147 } 2148 2149 // container string 2150 if (carousel && horizontal && !autoWidth && ('fixedWidth' in opts || 'items' in opts || (fixedWidth && 'gutter' in opts))) { 2151 containerStr = 'width:' + getContainerWidth(fixedWidthBP, gutterBP, itemsBP) + ';'; 2152 } 2153 if (TRANSITIONDURATION && 'speed' in opts) { 2154 containerStr += getTransitionDurationStyle(speedBP); 2155 } 2156 if (containerStr) { 2157 containerStr = '#' + slideId + '{' + containerStr + '}'; 2158 } 2159 2160 // slide string 2161 if ('fixedWidth' in opts || (fixedWidth && 'gutter' in opts) || !carousel && 'items' in opts) { 2162 slideStr += getSlideWidthStyle(fixedWidthBP, gutterBP, itemsBP); 2163 } 2164 if ('gutter' in opts) { 2165 slideStr += getSlideGutterStyle(gutterBP); 2166 } 2167 // set gallery items transition-duration 2168 if (!carousel && 'speed' in opts) { 2169 if (TRANSITIONDURATION) { slideStr += getTransitionDurationStyle(speedBP); } 2170 if (ANIMATIONDURATION) { slideStr += getAnimationDurationStyle(speedBP); } 2171 } 2172 if (slideStr) { slideStr = '#' + slideId + ' > .tns-item{' + slideStr + '}'; } 2173 2174 // add up 2175 str = middleWrapperStr + innerWrapperStr + containerStr + slideStr; 2176 2177 if (str) { 2178 sheet.insertRule('@media (min-width: ' + bp / 16 + 'em) {' + str + '}', sheet.cssRules.length); 2179 } 2180 } 2181 } 2182 } 2183 2184 function initTools () { 2185 // == slides == 2186 updateSlideStatus(); 2187 2188 // == live region == 2189 outerWrapper.insertAdjacentHTML('afterbegin', '<div class="tns-liveregion tns-visually-hidden" aria-live="polite" aria-atomic="true">slide <span class="current">' + getLiveRegionStr() + '</span> of ' + slideCount + '</div>'); 2190 liveregionCurrent = outerWrapper.querySelector('.tns-liveregion .current'); 2191 2192 // == autoplayInit == 2193 if (hasAutoplay) { 2194 var txt = autoplay ? 'stop' : 'start'; 2195 if (autoplayButton) { 2196 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(autoplayButton, {'data-action': txt}); 2197 } else if (options.autoplayButtonOutput) { 2198 outerWrapper.insertAdjacentHTML(getInsertPosition(options.autoplayPosition), '<button type="button" data-action="' + txt + '">' + autoplayHtmlStrings[0] + txt + autoplayHtmlStrings[1] + autoplayText[0] + '</button>'); 2199 autoplayButton = outerWrapper.querySelector('[data-action]'); 2200 } 2201 2202 // add event 2203 if (autoplayButton) { 2204 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(autoplayButton, {'click': toggleAutoplay}); 2205 } 2206 2207 if (autoplay) { 2208 startAutoplay(); 2209 if (autoplayHoverPause) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, hoverEvents); } 2210 if (autoplayResetOnVisibility) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, visibilityEvent); } 2211 } 2212 } 2213 2214 // == navInit == 2215 if (hasNav) { 2216 var initIndex = !carousel ? 0 : cloneCount; 2217 // customized nav 2218 // will not hide the navs in case they're thumbnails 2219 if (navContainer) { 2220 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navContainer, {'aria-label': 'Carousel Pagination'}); 2221 navItems = navContainer.children; 2222 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(navItems, function(item, i) { 2223 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(item, { 2224 'data-nav': i, 2225 'tabindex': '-1', 2226 'aria-label': navStr + (i + 1), 2227 'aria-controls': slideId, 2228 }); 2229 }); 2230 2231 // generated nav 2232 } else { 2233 var navHtml = '', 2234 hiddenStr = navAsThumbnails ? '' : 'style="display:none"'; 2235 for (var i = 0; i < slideCount; i++) { 2236 // hide nav items by default 2237 navHtml += '<button type="button" data-nav="' + i +'" tabindex="-1" aria-controls="' + slideId + '" ' + hiddenStr + ' aria-label="' + navStr + (i + 1) +'"></button>'; 2238 } 2239 navHtml = '<div class="tns-nav" aria-label="Carousel Pagination">' + navHtml + '</div>'; 2240 outerWrapper.insertAdjacentHTML(getInsertPosition(options.navPosition), navHtml); 2241 2242 navContainer = outerWrapper.querySelector('.tns-nav'); 2243 navItems = navContainer.children; 2244 } 2245 2246 updateNavVisibility(); 2247 2248 // add transition 2249 if (TRANSITIONDURATION) { 2250 var prefix = TRANSITIONDURATION.substring(0, TRANSITIONDURATION.length - 18).toLowerCase(), 2251 str = 'transition: all ' + speed / 1000 + 's'; 2252 2253 if (prefix) { 2254 str = '-' + prefix + '-' + str; 2255 } 2256 2257 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '[aria-controls^=' + slideId + '-item]', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 2258 } 2259 2260 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navItems[navCurrentIndex], {'aria-label': navStr + (navCurrentIndex + 1) + navStrCurrent}); 2261 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(navItems[navCurrentIndex], 'tabindex'); 2262 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(navItems[navCurrentIndex], navActiveClass); 2263 2264 // add events 2265 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(navContainer, navEvents); 2266 } 2267 2268 2269 2270 // == controlsInit == 2271 if (hasControls) { 2272 if (!controlsContainer && (!prevButton || !nextButton)) { 2273 outerWrapper.insertAdjacentHTML(getInsertPosition(options.controlsPosition), '<div class="tns-controls" aria-label="Carousel Navigation" tabindex="0"><button type="button" data-controls="prev" tabindex="-1" aria-controls="' + slideId +'">' + controlsText[0] + '</button><button type="button" data-controls="next" tabindex="-1" aria-controls="' + slideId +'">' + controlsText[1] + '</button></div>'); 2274 2275 controlsContainer = outerWrapper.querySelector('.tns-controls'); 2276 } 2277 2278 if (!prevButton || !nextButton) { 2279 prevButton = controlsContainer.children[0]; 2280 nextButton = controlsContainer.children[1]; 2281 } 2282 2283 if (options.controlsContainer) { 2284 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(controlsContainer, { 2285 'aria-label': 'Carousel Navigation', 2286 'tabindex': '0' 2287 }); 2288 } 2289 2290 if (options.controlsContainer || (options.prevButton && options.nextButton)) { 2291 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])([prevButton, nextButton], { 2292 'aria-controls': slideId, 2293 'tabindex': '-1', 2294 }); 2295 } 2296 2297 if (options.controlsContainer || (options.prevButton && options.nextButton)) { 2298 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(prevButton, {'data-controls' : 'prev'}); 2299 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(nextButton, {'data-controls' : 'next'}); 2300 } 2301 2302 prevIsButton = isButton(prevButton); 2303 nextIsButton = isButton(nextButton); 2304 2305 updateControlsStatus(); 2306 2307 // add events 2308 if (controlsContainer) { 2309 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(controlsContainer, controlsEvents); 2310 } else { 2311 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(prevButton, controlsEvents); 2312 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(nextButton, controlsEvents); 2313 } 2314 } 2315 2316 // hide tools if needed 2317 disableUI(); 2318 } 2319 2320 function initEvents () { 2321 // add events 2322 if (carousel && TRANSITIONEND) { 2323 var eve = {}; 2324 eve[TRANSITIONEND] = onTransitionEnd; 2325 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, eve); 2326 } 2327 2328 if (touch) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, touchEvents, options.preventScrollOnTouch); } 2329 if (mouseDrag) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, dragEvents); } 2330 if (arrowKeys) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(doc, docmentKeydownEvent); } 2331 2332 if (nested === 'inner') { 2333 events.on('outerResized', function () { 2334 resizeTasks(); 2335 events.emit('innerLoaded', info()); 2336 }); 2337 } else if (responsive || fixedWidth || autoWidth || autoHeight || !horizontal) { 2338 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(win, {'resize': onResize}); 2339 } 2340 2341 if (autoHeight) { 2342 if (nested === 'outer') { 2343 events.on('innerLoaded', doAutoHeight); 2344 } else if (!disable) { doAutoHeight(); } 2345 } 2346 2347 doLazyLoad(); 2348 if (disable) { disableSlider(); } else if (freeze) { freezeSlider(); } 2349 2350 events.on('indexChanged', additionalUpdates); 2351 if (nested === 'inner') { events.emit('innerLoaded', info()); } 2352 if (typeof onInit === 'function') { onInit(info()); } 2353 isOn = true; 2354 } 2355 2356 function destroy () { 2357 // sheet 2358 sheet.disabled = true; 2359 if (sheet.ownerNode) { sheet.ownerNode.remove(); } 2360 2361 // remove win event listeners 2362 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(win, {'resize': onResize}); 2363 2364 // arrowKeys, controls, nav 2365 if (arrowKeys) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(doc, docmentKeydownEvent); } 2366 if (controlsContainer) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(controlsContainer, controlsEvents); } 2367 if (navContainer) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(navContainer, navEvents); } 2368 2369 // autoplay 2370 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, hoverEvents); 2371 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, visibilityEvent); 2372 if (autoplayButton) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(autoplayButton, {'click': toggleAutoplay}); } 2373 if (autoplay) { clearInterval(autoplayTimer); } 2374 2375 // container 2376 if (carousel && TRANSITIONEND) { 2377 var eve = {}; 2378 eve[TRANSITIONEND] = onTransitionEnd; 2379 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, eve); 2380 } 2381 if (touch) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, touchEvents); } 2382 if (mouseDrag) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, dragEvents); } 2383 2384 // cache Object values in options && reset HTML 2385 var htmlList = [containerHTML, controlsContainerHTML, prevButtonHTML, nextButtonHTML, navContainerHTML, autoplayButtonHTML]; 2386 2387 tnsList.forEach(function(item, i) { 2388 var el = item === 'container' ? outerWrapper : options[item]; 2389 2390 if (typeof el === 'object' && el) { 2391 var prevEl = el.previousElementSibling ? el.previousElementSibling : false, 2392 parentEl = el.parentNode; 2393 el.outerHTML = htmlList[i]; 2394 options[item] = prevEl ? prevEl.nextElementSibling : parentEl.firstElementChild; 2395 } 2396 }); 2397 2398 2399 // reset variables 2400 tnsList = animateIn = animateOut = animateDelay = animateNormal = horizontal = outerWrapper = innerWrapper = container = containerParent = containerHTML = slideItems = slideCount = breakpointZone = windowWidth = autoWidth = fixedWidth = edgePadding = gutter = viewport = items = slideBy = viewportMax = arrowKeys = speed = rewind = loop = autoHeight = sheet = lazyload = slidePositions = slideItemsOut = cloneCount = slideCountNew = hasRightDeadZone = rightBoundary = updateIndexBeforeTransform = transformAttr = transformPrefix = transformPostfix = getIndexMax = index = indexCached = indexMin = indexMax = resizeTimer = swipeAngle = moveDirectionExpected = running = onInit = events = newContainerClasses = slideId = disable = disabled = freezable = freeze = frozen = controlsEvents = navEvents = hoverEvents = visibilityEvent = docmentKeydownEvent = touchEvents = dragEvents = hasControls = hasNav = navAsThumbnails = hasAutoplay = hasTouch = hasMouseDrag = slideActiveClass = imgCompleteClass = imgEvents = imgsComplete = controls = controlsText = controlsContainer = controlsContainerHTML = prevButton = nextButton = prevIsButton = nextIsButton = nav = navContainer = navContainerHTML = navItems = pages = pagesCached = navClicked = navCurrentIndex = navCurrentIndexCached = navActiveClass = navStr = navStrCurrent = autoplay = autoplayTimeout = autoplayDirection = autoplayText = autoplayHoverPause = autoplayButton = autoplayButtonHTML = autoplayResetOnVisibility = autoplayHtmlStrings = autoplayTimer = animating = autoplayHoverPaused = autoplayUserPaused = autoplayVisibilityPaused = initPosition = lastPosition = translateInit = disX = disY = panStart = rafIndex = getDist = touch = mouseDrag = null; 2401 // check variables 2402 // [animateIn, animateOut, animateDelay, animateNormal, horizontal, outerWrapper, innerWrapper, container, containerParent, containerHTML, slideItems, slideCount, breakpointZone, windowWidth, autoWidth, fixedWidth, edgePadding, gutter, viewport, items, slideBy, viewportMax, arrowKeys, speed, rewind, loop, autoHeight, sheet, lazyload, slidePositions, slideItemsOut, cloneCount, slideCountNew, hasRightDeadZone, rightBoundary, updateIndexBeforeTransform, transformAttr, transformPrefix, transformPostfix, getIndexMax, index, indexCached, indexMin, indexMax, resizeTimer, swipeAngle, moveDirectionExpected, running, onInit, events, newContainerClasses, slideId, disable, disabled, freezable, freeze, frozen, controlsEvents, navEvents, hoverEvents, visibilityEvent, docmentKeydownEvent, touchEvents, dragEvents, hasControls, hasNav, navAsThumbnails, hasAutoplay, hasTouch, hasMouseDrag, slideActiveClass, imgCompleteClass, imgEvents, imgsComplete, controls, controlsText, controlsContainer, controlsContainerHTML, prevButton, nextButton, prevIsButton, nextIsButton, nav, navContainer, navContainerHTML, navItems, pages, pagesCached, navClicked, navCurrentIndex, navCurrentIndexCached, navActiveClass, navStr, navStrCurrent, autoplay, autoplayTimeout, autoplayDirection, autoplayText, autoplayHoverPause, autoplayButton, autoplayButtonHTML, autoplayResetOnVisibility, autoplayHtmlStrings, autoplayTimer, animating, autoplayHoverPaused, autoplayUserPaused, autoplayVisibilityPaused, initPosition, lastPosition, translateInit, disX, disY, panStart, rafIndex, getDist, touch, mouseDrag ].forEach(function(item) { if (item !== null) { console.log(item); } }); 2403 2404 for (var a in this) { 2405 if (a !== 'rebuild') { this[a] = null; } 2406 } 2407 isOn = false; 2408 } 2409 2410// === ON RESIZE === 2411 // responsive || fixedWidth || autoWidth || !horizontal 2412 function onResize (e) { 2413 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ resizeTasks(getEvent(e)); }); 2414 } 2415 2416 function resizeTasks (e) { 2417 if (!isOn) { return; } 2418 if (nested === 'outer') { events.emit('outerResized', info(e)); } 2419 windowWidth = getWindowWidth(); 2420 var bpChanged, 2421 breakpointZoneTem = breakpointZone, 2422 needContainerTransform = false; 2423 2424 if (responsive) { 2425 setBreakpointZone(); 2426 bpChanged = breakpointZoneTem !== breakpointZone; 2427 // if (hasRightDeadZone) { needContainerTransform = true; } // *? 2428 if (bpChanged) { events.emit('newBreakpointStart', info(e)); } 2429 } 2430 2431 var indChanged, 2432 itemsChanged, 2433 itemsTem = items, 2434 disableTem = disable, 2435 freezeTem = freeze, 2436 arrowKeysTem = arrowKeys, 2437 controlsTem = controls, 2438 navTem = nav, 2439 touchTem = touch, 2440 mouseDragTem = mouseDrag, 2441 autoplayTem = autoplay, 2442 autoplayHoverPauseTem = autoplayHoverPause, 2443 autoplayResetOnVisibilityTem = autoplayResetOnVisibility, 2444 indexTem = index; 2445 2446 if (bpChanged) { 2447 var fixedWidthTem = fixedWidth, 2448 autoHeightTem = autoHeight, 2449 controlsTextTem = controlsText, 2450 centerTem = center, 2451 autoplayTextTem = autoplayText; 2452 2453 if (!CSSMQ) { 2454 var gutterTem = gutter, 2455 edgePaddingTem = edgePadding; 2456 } 2457 } 2458 2459 // get option: 2460 // fixed width: viewport, fixedWidth, gutter => items 2461 // others: window width => all variables 2462 // all: items => slideBy 2463 arrowKeys = getOption('arrowKeys'); 2464 controls = getOption('controls'); 2465 nav = getOption('nav'); 2466 touch = getOption('touch'); 2467 center = getOption('center'); 2468 mouseDrag = getOption('mouseDrag'); 2469 autoplay = getOption('autoplay'); 2470 autoplayHoverPause = getOption('autoplayHoverPause'); 2471 autoplayResetOnVisibility = getOption('autoplayResetOnVisibility'); 2472 2473 if (bpChanged) { 2474 disable = getOption('disable'); 2475 fixedWidth = getOption('fixedWidth'); 2476 speed = getOption('speed'); 2477 autoHeight = getOption('autoHeight'); 2478 controlsText = getOption('controlsText'); 2479 autoplayText = getOption('autoplayText'); 2480 autoplayTimeout = getOption('autoplayTimeout'); 2481 2482 if (!CSSMQ) { 2483 edgePadding = getOption('edgePadding'); 2484 gutter = getOption('gutter'); 2485 } 2486 } 2487 // update options 2488 resetVariblesWhenDisable(disable); 2489 2490 viewport = getViewportWidth(); // <= edgePadding, gutter 2491 if ((!horizontal || autoWidth) && !disable) { 2492 setSlidePositions(); 2493 if (!horizontal) { 2494 updateContentWrapperHeight(); // <= setSlidePositions 2495 needContainerTransform = true; 2496 } 2497 } 2498 if (fixedWidth || autoWidth) { 2499 rightBoundary = getRightBoundary(); // autoWidth: <= viewport, slidePositions, gutter 2500 // fixedWidth: <= viewport, fixedWidth, gutter 2501 indexMax = getIndexMax(); // autoWidth: <= rightBoundary, slidePositions 2502 // fixedWidth: <= rightBoundary, fixedWidth, gutter 2503 } 2504 2505 if (bpChanged || fixedWidth) { 2506 items = getOption('items'); 2507 slideBy = getOption('slideBy'); 2508 itemsChanged = items !== itemsTem; 2509 2510 if (itemsChanged) { 2511 if (!fixedWidth && !autoWidth) { indexMax = getIndexMax(); } // <= items 2512 // check index before transform in case 2513 // slider reach the right edge then items become bigger 2514 updateIndex(); 2515 } 2516 } 2517 2518 if (bpChanged) { 2519 if (disable !== disableTem) { 2520 if (disable) { 2521 disableSlider(); 2522 } else { 2523 enableSlider(); // <= slidePositions, rightBoundary, indexMax 2524 } 2525 } 2526 } 2527 2528 if (freezable && (bpChanged || fixedWidth || autoWidth)) { 2529 freeze = getFreeze(); // <= autoWidth: slidePositions, gutter, viewport, rightBoundary 2530 // <= fixedWidth: fixedWidth, gutter, rightBoundary 2531 // <= others: items 2532 2533 if (freeze !== freezeTem) { 2534 if (freeze) { 2535 doContainerTransform(getContainerTransformValue(getStartIndex(0))); 2536 freezeSlider(); 2537 } else { 2538 unfreezeSlider(); 2539 needContainerTransform = true; 2540 } 2541 } 2542 } 2543 2544 resetVariblesWhenDisable(disable || freeze); // controls, nav, touch, mouseDrag, arrowKeys, autoplay, autoplayHoverPause, autoplayResetOnVisibility 2545 if (!autoplay) { autoplayHoverPause = autoplayResetOnVisibility = false; } 2546 2547 if (arrowKeys !== arrowKeysTem) { 2548 arrowKeys ? 2549 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(doc, docmentKeydownEvent) : 2550 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(doc, docmentKeydownEvent); 2551 } 2552 if (controls !== controlsTem) { 2553 if (controls) { 2554 if (controlsContainer) { 2555 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(controlsContainer); 2556 } else { 2557 if (prevButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(prevButton); } 2558 if (nextButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(nextButton); } 2559 } 2560 } else { 2561 if (controlsContainer) { 2562 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(controlsContainer); 2563 } else { 2564 if (prevButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(prevButton); } 2565 if (nextButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(nextButton); } 2566 } 2567 } 2568 } 2569 if (nav !== navTem) { 2570 if (nav) { 2571 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(navContainer); 2572 updateNavVisibility(); 2573 } else { 2574 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(navContainer) 2575 } 2576 } 2577 if (touch !== touchTem) { 2578 touch ? 2579 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, touchEvents, options.preventScrollOnTouch) : 2580 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, touchEvents); 2581 } 2582 if (mouseDrag !== mouseDragTem) { 2583 mouseDrag ? 2584 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, dragEvents) : 2585 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, dragEvents); 2586 } 2587 if (autoplay !== autoplayTem) { 2588 if (autoplay) { 2589 if (autoplayButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(autoplayButton); } 2590 if (!animating && !autoplayUserPaused) { startAutoplay(); } 2591 } else { 2592 if (autoplayButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(autoplayButton); } 2593 if (animating) { stopAutoplay(); } 2594 } 2595 } 2596 if (autoplayHoverPause !== autoplayHoverPauseTem) { 2597 autoplayHoverPause ? 2598 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, hoverEvents) : 2599 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, hoverEvents); 2600 } 2601 if (autoplayResetOnVisibility !== autoplayResetOnVisibilityTem) { 2602 autoplayResetOnVisibility ? 2603 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(doc, visibilityEvent) : 2604 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(doc, visibilityEvent); 2605 } 2606 2607 if (bpChanged) { 2608 if (fixedWidth !== fixedWidthTem || center !== centerTem) { needContainerTransform = true; } 2609 2610 if (autoHeight !== autoHeightTem) { 2611 if (!autoHeight) { innerWrapper.style.height = ''; } 2612 } 2613 2614 if (controls && controlsText !== controlsTextTem) { 2615 prevButton.innerHTML = controlsText[0]; 2616 nextButton.innerHTML = controlsText[1]; 2617 } 2618 2619 if (autoplayButton && autoplayText !== autoplayTextTem) { 2620 var i = autoplay ? 1 : 0, 2621 html = autoplayButton.innerHTML, 2622 len = html.length - autoplayTextTem[i].length; 2623 if (html.substring(len) === autoplayTextTem[i]) { 2624 autoplayButton.innerHTML = html.substring(0, len) + autoplayText[i]; 2625 } 2626 } 2627 } else { 2628 if (center && (fixedWidth || autoWidth)) { needContainerTransform = true; } 2629 } 2630 2631 if (itemsChanged || fixedWidth && !autoWidth) { 2632 pages = getPages(); 2633 updateNavVisibility(); 2634 } 2635 2636 indChanged = index !== indexTem; 2637 if (indChanged) { 2638 events.emit('indexChanged', info()); 2639 needContainerTransform = true; 2640 } else if (itemsChanged) { 2641 if (!indChanged) { additionalUpdates(); } 2642 } else if (fixedWidth || autoWidth) { 2643 doLazyLoad(); 2644 updateSlideStatus(); 2645 updateLiveRegion(); 2646 } 2647 2648 if (itemsChanged && !carousel) { updateGallerySlidePositions(); } 2649 2650 if (!disable && !freeze) { 2651 // non-mediaqueries: IE8 2652 if (bpChanged && !CSSMQ) { 2653 // middle wrapper styles 2654 2655 // inner wrapper styles 2656 if (edgePadding !== edgePaddingTem || gutter !== gutterTem) { 2657 innerWrapper.style.cssText = getInnerWrapperStyles(edgePadding, gutter, fixedWidth, speed, autoHeight); 2658 } 2659 2660 if (horizontal) { 2661 // container styles 2662 if (carousel) { 2663 container.style.width = getContainerWidth(fixedWidth, gutter, items); 2664 } 2665 2666 // slide styles 2667 var str = getSlideWidthStyle(fixedWidth, gutter, items) + 2668 getSlideGutterStyle(gutter); 2669 2670 // remove the last line and 2671 // add new styles 2672 Object(_helpers_removeCSSRule_js__WEBPACK_IMPORTED_MODULE_11__["removeCSSRule"])(sheet, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet) - 1); 2673 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 2674 } 2675 } 2676 2677 // auto height 2678 if (autoHeight) { doAutoHeight(); } 2679 2680 if (needContainerTransform) { 2681 doContainerTransformSilent(); 2682 indexCached = index; 2683 } 2684 } 2685 2686 if (bpChanged) { events.emit('newBreakpointEnd', info(e)); } 2687 } 2688 2689 2690 2691 2692 2693 // === INITIALIZATION FUNCTIONS === // 2694 function getFreeze () { 2695 if (!fixedWidth && !autoWidth) { 2696 var a = center ? items - (items - 1) / 2 : items; 2697 return slideCount <= a; 2698 } 2699 2700 var width = fixedWidth ? (fixedWidth + gutter) * slideCount : slidePositions[slideCount], 2701 vp = edgePadding ? viewport + edgePadding * 2 : viewport + gutter; 2702 2703 if (center) { 2704 vp -= fixedWidth ? (viewport - fixedWidth) / 2 : (viewport - (slidePositions[index + 1] - slidePositions[index] - gutter)) / 2; 2705 } 2706 2707 return width <= vp; 2708 } 2709 2710 function setBreakpointZone () { 2711 breakpointZone = 0; 2712 for (var bp in responsive) { 2713 bp = parseInt(bp); // convert string to number 2714 if (windowWidth >= bp) { breakpointZone = bp; } 2715 } 2716 } 2717 2718 // (slideBy, indexMin, indexMax) => index 2719 var updateIndex = (function () { 2720 return loop ? 2721 carousel ? 2722 // loop + carousel 2723 function () { 2724 var leftEdge = indexMin, 2725 rightEdge = indexMax; 2726 2727 leftEdge += slideBy; 2728 rightEdge -= slideBy; 2729 2730 // adjust edges when has edge paddings 2731 // or fixed-width slider with extra space on the right side 2732 if (edgePadding) { 2733 leftEdge += 1; 2734 rightEdge -= 1; 2735 } else if (fixedWidth) { 2736 if ((viewport + gutter)%(fixedWidth + gutter)) { rightEdge -= 1; } 2737 } 2738 2739 if (cloneCount) { 2740 if (index > rightEdge) { 2741 index -= slideCount; 2742 } else if (index < leftEdge) { 2743 index += slideCount; 2744 } 2745 } 2746 } : 2747 // loop + gallery 2748 function() { 2749 if (index > indexMax) { 2750 while (index >= indexMin + slideCount) { index -= slideCount; } 2751 } else if (index < indexMin) { 2752 while (index <= indexMax - slideCount) { index += slideCount; } 2753 } 2754 } : 2755 // non-loop 2756 function() { 2757 index = Math.max(indexMin, Math.min(indexMax, index)); 2758 }; 2759 })(); 2760 2761 function disableUI () { 2762 if (!autoplay && autoplayButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(autoplayButton); } 2763 if (!nav && navContainer) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(navContainer); } 2764 if (!controls) { 2765 if (controlsContainer) { 2766 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(controlsContainer); 2767 } else { 2768 if (prevButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(prevButton); } 2769 if (nextButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(nextButton); } 2770 } 2771 } 2772 } 2773 2774 function enableUI () { 2775 if (autoplay && autoplayButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(autoplayButton); } 2776 if (nav && navContainer) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(navContainer); } 2777 if (controls) { 2778 if (controlsContainer) { 2779 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(controlsContainer); 2780 } else { 2781 if (prevButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(prevButton); } 2782 if (nextButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(nextButton); } 2783 } 2784 } 2785 } 2786 2787 function freezeSlider () { 2788 if (frozen) { return; } 2789 2790 // remove edge padding from inner wrapper 2791 if (edgePadding) { innerWrapper.style.margin = '0px'; } 2792 2793 // add class tns-transparent to cloned slides 2794 if (cloneCount) { 2795 var str = 'tns-transparent'; 2796 for (var i = cloneCount; i--;) { 2797 if (carousel) { Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(slideItems[i], str); } 2798 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(slideItems[slideCountNew - i - 1], str); 2799 } 2800 } 2801 2802 // update tools 2803 disableUI(); 2804 2805 frozen = true; 2806 } 2807 2808 function unfreezeSlider () { 2809 if (!frozen) { return; } 2810 2811 // restore edge padding for inner wrapper 2812 // for mordern browsers 2813 if (edgePadding && CSSMQ) { innerWrapper.style.margin = ''; } 2814 2815 // remove class tns-transparent to cloned slides 2816 if (cloneCount) { 2817 var str = 'tns-transparent'; 2818 for (var i = cloneCount; i--;) { 2819 if (carousel) { Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(slideItems[i], str); } 2820 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(slideItems[slideCountNew - i - 1], str); 2821 } 2822 } 2823 2824 // update tools 2825 enableUI(); 2826 2827 frozen = false; 2828 } 2829 2830 function disableSlider () { 2831 if (disabled) { return; } 2832 2833 sheet.disabled = true; 2834 container.className = container.className.replace(newContainerClasses.substring(1), ''); 2835 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(container, ['style']); 2836 if (loop) { 2837 for (var j = cloneCount; j--;) { 2838 if (carousel) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(slideItems[j]); } 2839 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(slideItems[slideCountNew - j - 1]); 2840 } 2841 } 2842 2843 // vertical slider 2844 if (!horizontal || !carousel) { Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(innerWrapper, ['style']); } 2845 2846 // gallery 2847 if (!carousel) { 2848 for (var i = index, l = index + slideCount; i < l; i++) { 2849 var item = slideItems[i]; 2850 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(item, ['style']); 2851 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateIn); 2852 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateNormal); 2853 } 2854 } 2855 2856 // update tools 2857 disableUI(); 2858 2859 disabled = true; 2860 } 2861 2862 function enableSlider () { 2863 if (!disabled) { return; } 2864 2865 sheet.disabled = false; 2866 container.className += newContainerClasses; 2867 doContainerTransformSilent(); 2868 2869 if (loop) { 2870 for (var j = cloneCount; j--;) { 2871 if (carousel) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(slideItems[j]); } 2872 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(slideItems[slideCountNew - j - 1]); 2873 } 2874 } 2875 2876 // gallery 2877 if (!carousel) { 2878 for (var i = index, l = index + slideCount; i < l; i++) { 2879 var item = slideItems[i], 2880 classN = i < index + items ? animateIn : animateNormal; 2881 item.style.left = (i - index) * 100 / items + '%'; 2882 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, classN); 2883 } 2884 } 2885 2886 // update tools 2887 enableUI(); 2888 2889 disabled = false; 2890 } 2891 2892 function updateLiveRegion () { 2893 var str = getLiveRegionStr(); 2894 if (liveregionCurrent.innerHTML !== str) { liveregionCurrent.innerHTML = str; } 2895 } 2896 2897 function getLiveRegionStr () { 2898 var arr = getVisibleSlideRange(), 2899 start = arr[0] + 1, 2900 end = arr[1] + 1; 2901 return start === end ? start + '' : start + ' to ' + end; 2902 } 2903 2904 function getVisibleSlideRange (val) { 2905 if (val == null) { val = getContainerTransformValue(); } 2906 var start = index, end, rangestart, rangeend; 2907 2908 // get range start, range end for autoWidth and fixedWidth 2909 if (center || edgePadding) { 2910 if (autoWidth || fixedWidth) { 2911 rangestart = - (parseFloat(val) + edgePadding); 2912 rangeend = rangestart + viewport + edgePadding * 2; 2913 } 2914 } else { 2915 if (autoWidth) { 2916 rangestart = slidePositions[index]; 2917 rangeend = rangestart + viewport; 2918 } 2919 } 2920 2921 // get start, end 2922 // - check auto width 2923 if (autoWidth) { 2924 slidePositions.forEach(function(point, i) { 2925 if (i < slideCountNew) { 2926 if ((center || edgePadding) && point <= rangestart + 0.5) { start = i; } 2927 if (rangeend - point >= 0.5) { end = i; } 2928 } 2929 }); 2930 2931 // - check percentage width, fixed width 2932 } else { 2933 2934 if (fixedWidth) { 2935 var cell = fixedWidth + gutter; 2936 if (center || edgePadding) { 2937 start = Math.floor(rangestart/cell); 2938 end = Math.ceil(rangeend/cell - 1); 2939 } else { 2940 end = start + Math.ceil(viewport/cell) - 1; 2941 } 2942 2943 } else { 2944 if (center || edgePadding) { 2945 var a = items - 1; 2946 if (center) { 2947 start -= a / 2; 2948 end = index + a / 2; 2949 } else { 2950 end = index + a; 2951 } 2952 2953 if (edgePadding) { 2954 var b = edgePadding * items / viewport; 2955 start -= b; 2956 end += b; 2957 } 2958 2959 start = Math.floor(start); 2960 end = Math.ceil(end); 2961 } else { 2962 end = start + items - 1; 2963 } 2964 } 2965 2966 start = Math.max(start, 0); 2967 end = Math.min(end, slideCountNew - 1); 2968 } 2969 2970 return [start, end]; 2971 } 2972 2973 function doLazyLoad () { 2974 if (lazyload && !disable) { 2975 var arg = getVisibleSlideRange(); 2976 arg.push(lazyloadSelector); 2977 2978 getImageArray.apply(null, arg).forEach(function (img) { 2979 if (!Object(_helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_16__["hasClass"])(img, imgCompleteClass)) { 2980 // stop propagation transitionend event to container 2981 var eve = {}; 2982 eve[TRANSITIONEND] = function (e) { e.stopPropagation(); }; 2983 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(img, eve); 2984 2985 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(img, imgEvents); 2986 2987 // update src 2988 img.src = Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(img, 'data-src'); 2989 2990 // update srcset 2991 var srcset = Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(img, 'data-srcset'); 2992 if (srcset) { img.srcset = srcset; } 2993 2994 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'loading'); 2995 } 2996 }); 2997 } 2998 } 2999 3000 function onImgLoaded (e) { 3001 imgLoaded(getTarget(e)); 3002 } 3003 3004 function onImgFailed (e) { 3005 imgFailed(getTarget(e)); 3006 } 3007 3008 function imgLoaded (img) { 3009 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'loaded'); 3010 imgCompleted(img); 3011 } 3012 3013 function imgFailed (img) { 3014 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'failed'); 3015 imgCompleted(img); 3016 } 3017 3018 function imgCompleted (img) { 3019 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, imgCompleteClass); 3020 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(img, 'loading'); 3021 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(img, imgEvents); 3022 } 3023 3024 function getImageArray (start, end, imgSelector) { 3025 var imgs = []; 3026 if (!imgSelector) { imgSelector = 'img'; } 3027 3028 while (start <= end) { 3029 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems[start].querySelectorAll(imgSelector), function (img) { imgs.push(img); }); 3030 start++; 3031 } 3032 3033 return imgs; 3034 } 3035 3036 // check if all visible images are loaded 3037 // and update container height if it's done 3038 function doAutoHeight () { 3039 var imgs = getImageArray.apply(null, getVisibleSlideRange()); 3040 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(imgs, updateInnerWrapperHeight); }); 3041 } 3042 3043 function imgsLoadedCheck (imgs, cb) { 3044 // execute callback function if all images are complete 3045 if (imgsComplete) { return cb(); } 3046 3047 // check image classes 3048 imgs.forEach(function (img, index) { 3049 if (!lazyload && img.complete) { imgCompleted(img); } // Check image.complete 3050 if (Object(_helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_16__["hasClass"])(img, imgCompleteClass)) { imgs.splice(index, 1); } 3051 }); 3052 3053 // execute callback function if selected images are all complete 3054 if (!imgs.length) { return cb(); } 3055 3056 // otherwise execute this functiona again 3057 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(imgs, cb); }); 3058 } 3059 3060 function additionalUpdates () { 3061 doLazyLoad(); 3062 updateSlideStatus(); 3063 updateLiveRegion(); 3064 updateControlsStatus(); 3065 updateNavStatus(); 3066 } 3067 3068 3069 function update_carousel_transition_duration () { 3070 if (carousel && autoHeight) { 3071 middleWrapper.style[TRANSITIONDURATION] = speed / 1000 + 's'; 3072 } 3073 } 3074 3075 function getMaxSlideHeight (slideStart, slideRange) { 3076 var heights = []; 3077 for (var i = slideStart, l = Math.min(slideStart + slideRange, slideCountNew); i < l; i++) { 3078 heights.push(slideItems[i].offsetHeight); 3079 } 3080 3081 return Math.max.apply(null, heights); 3082 } 3083 3084 // update inner wrapper height 3085 // 1. get the max-height of the visible slides 3086 // 2. set transitionDuration to speed 3087 // 3. update inner wrapper height to max-height 3088 // 4. set transitionDuration to 0s after transition done 3089 function updateInnerWrapperHeight () { 3090 var maxHeight = autoHeight ? getMaxSlideHeight(index, items) : getMaxSlideHeight(cloneCount, slideCount), 3091 wp = middleWrapper ? middleWrapper : innerWrapper; 3092 3093 if (wp.style.height !== maxHeight) { wp.style.height = maxHeight + 'px'; } 3094 } 3095 3096 // get the distance from the top edge of the first slide to each slide 3097 // (init) => slidePositions 3098 function setSlidePositions () { 3099 slidePositions = [0]; 3100 var attr = horizontal ? 'left' : 'top', 3101 attr2 = horizontal ? 'right' : 'bottom', 3102 base = slideItems[0].getBoundingClientRect()[attr]; 3103 3104 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(item, i) { 3105 // skip the first slide 3106 if (i) { slidePositions.push(item.getBoundingClientRect()[attr] - base); } 3107 // add the end edge 3108 if (i === slideCountNew - 1) { slidePositions.push(item.getBoundingClientRect()[attr2] - base); } 3109 }); 3110 } 3111 3112 // update slide 3113 function updateSlideStatus () { 3114 var range = getVisibleSlideRange(), 3115 start = range[0], 3116 end = range[1]; 3117 3118 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(item, i) { 3119 // show slides 3120 if (i >= start && i <= end) { 3121 if (Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(item, 'aria-hidden')) { 3122 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(item, ['aria-hidden', 'tabindex']); 3123 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, slideActiveClass); 3124 } 3125 // hide slides 3126 } else { 3127 if (!Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(item, 'aria-hidden')) { 3128 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(item, { 3129 'aria-hidden': 'true', 3130 'tabindex': '-1' 3131 }); 3132 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, slideActiveClass); 3133 } 3134 } 3135 }); 3136 } 3137 3138 // gallery: update slide position 3139 function updateGallerySlidePositions () { 3140 var l = index + Math.min(slideCount, items); 3141 for (var i = slideCountNew; i--;) { 3142 var item = slideItems[i]; 3143 3144 if (i >= index && i < l) { 3145 // add transitions to visible slides when adjusting their positions 3146 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, 'tns-moving'); 3147 3148 item.style.left = (i - index) * 100 / items + '%'; 3149 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateIn); 3150 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateNormal); 3151 } else if (item.style.left) { 3152 item.style.left = ''; 3153 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateNormal); 3154 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateIn); 3155 } 3156 3157 // remove outlet animation 3158 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateOut); 3159 } 3160 3161 // removing '.tns-moving' 3162 setTimeout(function() { 3163 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(el) { 3164 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(el, 'tns-moving'); 3165 }); 3166 }, 300); 3167 } 3168 3169 // set tabindex on Nav 3170 function updateNavStatus () { 3171 // get current nav 3172 if (nav) { 3173 navCurrentIndex = navClicked >= 0 ? navClicked : getCurrentNavIndex(); 3174 navClicked = -1; 3175 3176 if (navCurrentIndex !== navCurrentIndexCached) { 3177 var navPrev = navItems[navCurrentIndexCached], 3178 navCurrent = navItems[navCurrentIndex]; 3179 3180 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navPrev, { 3181 'tabindex': '-1', 3182 'aria-label': navStr + (navCurrentIndexCached + 1) 3183 }); 3184 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(navPrev, navActiveClass); 3185 3186 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navCurrent, {'aria-label': navStr + (navCurrentIndex + 1) + navStrCurrent}); 3187 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(navCurrent, 'tabindex'); 3188 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(navCurrent, navActiveClass); 3189 3190 navCurrentIndexCached = navCurrentIndex; 3191 } 3192 } 3193 } 3194 3195 function getLowerCaseNodeName (el) { 3196 return el.nodeName.toLowerCase(); 3197 } 3198 3199 function isButton (el) { 3200 return getLowerCaseNodeName(el) === 'button'; 3201 } 3202 3203 function isAriaDisabled (el) { 3204 return el.getAttribute('aria-disabled') === 'true'; 3205 } 3206 3207 function disEnableElement (isButton, el, val) { 3208 if (isButton) { 3209 el.disabled = val; 3210 } else { 3211 el.setAttribute('aria-disabled', val.toString()); 3212 } 3213 } 3214 3215 // set 'disabled' to true on controls when reach the edges 3216 function updateControlsStatus () { 3217 if (!controls || rewind || loop) { return; } 3218 3219 var prevDisabled = (prevIsButton) ? prevButton.disabled : isAriaDisabled(prevButton), 3220 nextDisabled = (nextIsButton) ? nextButton.disabled : isAriaDisabled(nextButton), 3221 disablePrev = (index <= indexMin) ? true : false, 3222 disableNext = (!rewind && index >= indexMax) ? true : false; 3223 3224 if (disablePrev && !prevDisabled) { 3225 disEnableElement(prevIsButton, prevButton, true); 3226 } 3227 if (!disablePrev && prevDisabled) { 3228 disEnableElement(prevIsButton, prevButton, false); 3229 } 3230 if (disableNext && !nextDisabled) { 3231 disEnableElement(nextIsButton, nextButton, true); 3232 } 3233 if (!disableNext && nextDisabled) { 3234 disEnableElement(nextIsButton, nextButton, false); 3235 } 3236 } 3237 3238 // set duration 3239 function resetDuration (el, str) { 3240 if (TRANSITIONDURATION) { el.style[TRANSITIONDURATION] = str; } 3241 } 3242 3243 function getSliderWidth () { 3244 return fixedWidth ? (fixedWidth + gutter) * slideCountNew : slidePositions[slideCountNew]; 3245 } 3246 3247 function getCenterGap (num) { 3248 if (num == null) { num = index; } 3249 3250 var gap = edgePadding ? gutter : 0; 3251 return autoWidth ? ((viewport - gap) - (slidePositions[num + 1] - slidePositions[num] - gutter))/2 : 3252 fixedWidth ? (viewport - fixedWidth) / 2 : 3253 (items - 1) / 2; 3254 } 3255 3256 function getRightBoundary () { 3257 var gap = edgePadding ? gutter : 0, 3258 result = (viewport + gap) - getSliderWidth(); 3259 3260 if (center && !loop) { 3261 result = fixedWidth ? - (fixedWidth + gutter) * (slideCountNew - 1) - getCenterGap() : 3262 getCenterGap(slideCountNew - 1) - slidePositions[slideCountNew - 1]; 3263 } 3264 if (result > 0) { result = 0; } 3265 3266 return result; 3267 } 3268 3269 function getContainerTransformValue (num) { 3270 if (num == null) { num = index; } 3271 3272 var val; 3273 if (horizontal && !autoWidth) { 3274 if (fixedWidth) { 3275 val = - (fixedWidth + gutter) * num; 3276 if (center) { val += getCenterGap(); } 3277 } else { 3278 var denominator = TRANSFORM ? slideCountNew : items; 3279 if (center) { num -= getCenterGap(); } 3280 val = - num * 100 / denominator; 3281 } 3282 } else { 3283 val = - slidePositions[num]; 3284 if (center && autoWidth) { 3285 val += getCenterGap(); 3286 } 3287 } 3288 3289 if (hasRightDeadZone) { val = Math.max(val, rightBoundary); } 3290 3291 val += (horizontal && !autoWidth && !fixedWidth) ? '%' : 'px'; 3292 3293 return val; 3294 } 3295 3296 function doContainerTransformSilent (val) { 3297 resetDuration(container, '0s'); 3298 doContainerTransform(val); 3299 } 3300 3301 function doContainerTransform (val) { 3302 if (val == null) { val = getContainerTransformValue(); } 3303 container.style[transformAttr] = transformPrefix + val + transformPostfix; 3304 } 3305 3306 function animateSlide (number, classOut, classIn, isOut) { 3307 var l = number + items; 3308 if (!loop) { l = Math.min(l, slideCountNew); } 3309 3310 for (var i = number; i < l; i++) { 3311 var item = slideItems[i]; 3312 3313 // set item positions 3314 if (!isOut) { item.style.left = (i - index) * 100 / items + '%'; } 3315 3316 if (animateDelay && TRANSITIONDELAY) { 3317 item.style[TRANSITIONDELAY] = item.style[ANIMATIONDELAY] = animateDelay * (i - number) / 1000 + 's'; 3318 } 3319 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, classOut); 3320 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, classIn); 3321 3322 if (isOut) { slideItemsOut.push(item); } 3323 } 3324 } 3325 3326 // make transfer after click/drag: 3327 // 1. change 'transform' property for mordern browsers 3328 // 2. change 'left' property for legacy browsers 3329 var transformCore = (function () { 3330 return carousel ? 3331 function () { 3332 resetDuration(container, ''); 3333 if (TRANSITIONDURATION || !speed) { 3334 // for morden browsers with non-zero duration or 3335 // zero duration for all browsers 3336 doContainerTransform(); 3337 // run fallback function manually 3338 // when duration is 0 / container is hidden 3339 if (!speed || !Object(_helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_26__["isVisible"])(container)) { onTransitionEnd(); } 3340 3341 } else { 3342 // for old browser with non-zero duration 3343 Object(_helpers_jsTransform_js__WEBPACK_IMPORTED_MODULE_33__["jsTransform"])(container, transformAttr, transformPrefix, transformPostfix, getContainerTransformValue(), speed, onTransitionEnd); 3344 } 3345 3346 if (!horizontal) { updateContentWrapperHeight(); } 3347 } : 3348 function () { 3349 slideItemsOut = []; 3350 3351 var eve = {}; 3352 eve[TRANSITIONEND] = eve[ANIMATIONEND] = onTransitionEnd; 3353 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(slideItems[indexCached], eve); 3354 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(slideItems[index], eve); 3355 3356 animateSlide(indexCached, animateIn, animateOut, true); 3357 animateSlide(index, animateNormal, animateIn); 3358 3359 // run fallback function manually 3360 // when transition or animation not supported / duration is 0 3361 if (!TRANSITIONEND || !ANIMATIONEND || !speed || !Object(_helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_26__["isVisible"])(container)) { onTransitionEnd(); } 3362 }; 3363 })(); 3364 3365 function render (e, sliderMoved) { 3366 if (updateIndexBeforeTransform) { updateIndex(); } 3367 3368 // render when slider was moved (touch or drag) even though index may not change 3369 if (index !== indexCached || sliderMoved) { 3370 // events 3371 events.emit('indexChanged', info()); 3372 events.emit('transitionStart', info()); 3373 if (autoHeight) { doAutoHeight(); } 3374 3375 // pause autoplay when click or keydown from user 3376 if (animating && e && ['click', 'keydown'].indexOf(e.type) >= 0) { stopAutoplay(); } 3377 3378 running = true; 3379 transformCore(); 3380 } 3381 } 3382 3383 /* 3384 * Transfer prefixed properties to the same format 3385 * CSS: -Webkit-Transform => webkittransform 3386 * JS: WebkitTransform => webkittransform 3387 * @param {string} str - property 3388 * 3389 */ 3390 function strTrans (str) { 3391 return str.toLowerCase().replace(/-/g, ''); 3392 } 3393 3394 // AFTER TRANSFORM 3395 // Things need to be done after a transfer: 3396 // 1. check index 3397 // 2. add classes to visible slide 3398 // 3. disable controls buttons when reach the first/last slide in non-loop slider 3399 // 4. update nav status 3400 // 5. lazyload images 3401 // 6. update container height 3402 function onTransitionEnd (event) { 3403 // check running on gallery mode 3404 // make sure trantionend/animationend events run only once 3405 if (carousel || running) { 3406 events.emit('transitionEnd', info(event)); 3407 3408 if (!carousel && slideItemsOut.length > 0) { 3409 for (var i = 0; i < slideItemsOut.length; i++) { 3410 var item = slideItemsOut[i]; 3411 // set item positions 3412 item.style.left = ''; 3413 3414 if (ANIMATIONDELAY && TRANSITIONDELAY) { 3415 item.style[ANIMATIONDELAY] = ''; 3416 item.style[TRANSITIONDELAY] = ''; 3417 } 3418 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateOut); 3419 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateNormal); 3420 } 3421 } 3422 3423 /* update slides, nav, controls after checking ... 3424 * => legacy browsers who don't support 'event' 3425 * have to check event first, otherwise event.target will cause an error 3426 * => or 'gallery' mode: 3427 * + event target is slide item 3428 * => or 'carousel' mode: 3429 * + event target is container, 3430 * + event.property is the same with transform attribute 3431 */ 3432 if (!event || 3433 !carousel && event.target.parentNode === container || 3434 event.target === container && strTrans(event.propertyName) === strTrans(transformAttr)) { 3435 3436 if (!updateIndexBeforeTransform) { 3437 var indexTem = index; 3438 updateIndex(); 3439 if (index !== indexTem) { 3440 events.emit('indexChanged', info()); 3441 3442 doContainerTransformSilent(); 3443 } 3444 } 3445 3446 if (nested === 'inner') { events.emit('innerLoaded', info()); } 3447 running = false; 3448 indexCached = index; 3449 } 3450 } 3451 3452 } 3453 3454 // # ACTIONS 3455 function goTo (targetIndex, e) { 3456 if (freeze) { return; } 3457 3458 // prev slideBy 3459 if (targetIndex === 'prev') { 3460 onControlsClick(e, -1); 3461 3462 // next slideBy 3463 } else if (targetIndex === 'next') { 3464 onControlsClick(e, 1); 3465 3466 // go to exact slide 3467 } else { 3468 if (running) { 3469 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 3470 } 3471 3472 var absIndex = getAbsIndex(), 3473 indexGap = 0; 3474 3475 if (targetIndex === 'first') { 3476 indexGap = - absIndex; 3477 } else if (targetIndex === 'last') { 3478 indexGap = carousel ? slideCount - items - absIndex : slideCount - 1 - absIndex; 3479 } else { 3480 if (typeof targetIndex !== 'number') { targetIndex = parseInt(targetIndex); } 3481 3482 if (!isNaN(targetIndex)) { 3483 // from directly called goTo function 3484 if (!e) { targetIndex = Math.max(0, Math.min(slideCount - 1, targetIndex)); } 3485 3486 indexGap = targetIndex - absIndex; 3487 } 3488 } 3489 3490 // gallery: make sure new page won't overlap with current page 3491 if (!carousel && indexGap && Math.abs(indexGap) < items) { 3492 var factor = indexGap > 0 ? 1 : -1; 3493 indexGap += (index + indexGap - slideCount) >= indexMin ? slideCount * factor : slideCount * 2 * factor * -1; 3494 } 3495 3496 index += indexGap; 3497 3498 // make sure index is in range 3499 if (carousel && loop) { 3500 if (index < indexMin) { index += slideCount; } 3501 if (index > indexMax) { index -= slideCount; } 3502 } 3503 3504 // if index is changed, start rendering 3505 if (getAbsIndex(index) !== getAbsIndex(indexCached)) { 3506 render(e); 3507 } 3508 3509 } 3510 } 3511 3512 // on controls click 3513 function onControlsClick (e, dir) { 3514 if (running) { 3515 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 3516 } 3517 var passEventObject; 3518 3519 if (!dir) { 3520 e = getEvent(e); 3521 var target = getTarget(e); 3522 3523 while (target !== controlsContainer && [prevButton, nextButton].indexOf(target) < 0) { target = target.parentNode; } 3524 3525 var targetIn = [prevButton, nextButton].indexOf(target); 3526 if (targetIn >= 0) { 3527 passEventObject = true; 3528 dir = targetIn === 0 ? -1 : 1; 3529 } 3530 } 3531 3532 if (rewind) { 3533 if (index === indexMin && dir === -1) { 3534 goTo('last', e); 3535 return; 3536 } else if (index === indexMax && dir === 1) { 3537 goTo('first', e); 3538 return; 3539 } 3540 } 3541 3542 if (dir) { 3543 index += slideBy * dir; 3544 if (autoWidth) { index = Math.floor(index); } 3545 // pass e when click control buttons or keydown 3546 render((passEventObject || (e && e.type === 'keydown')) ? e : null); 3547 } 3548 } 3549 3550 // on nav click 3551 function onNavClick (e) { 3552 if (running) { 3553 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 3554 } 3555 3556 e = getEvent(e); 3557 var target = getTarget(e), navIndex; 3558 3559 // find the clicked nav item 3560 while (target !== navContainer && !Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(target, 'data-nav')) { target = target.parentNode; } 3561 if (Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(target, 'data-nav')) { 3562 var navIndex = navClicked = Number(Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(target, 'data-nav')), 3563 targetIndexBase = fixedWidth || autoWidth ? navIndex * slideCount / pages : navIndex * items, 3564 targetIndex = navAsThumbnails ? navIndex : Math.min(Math.ceil(targetIndexBase), slideCount - 1); 3565 goTo(targetIndex, e); 3566 3567 if (navCurrentIndex === navIndex) { 3568 if (animating) { stopAutoplay(); } 3569 navClicked = -1; // reset navClicked 3570 } 3571 } 3572 } 3573 3574 // autoplay functions 3575 function setAutoplayTimer () { 3576 autoplayTimer = setInterval(function () { 3577 onControlsClick(null, autoplayDirection); 3578 }, autoplayTimeout); 3579 3580 animating = true; 3581 } 3582 3583 function stopAutoplayTimer () { 3584 clearInterval(autoplayTimer); 3585 animating = false; 3586 } 3587 3588 function updateAutoplayButton (action, txt) { 3589 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(autoplayButton, {'data-action': action}); 3590 autoplayButton.innerHTML = autoplayHtmlStrings[0] + action + autoplayHtmlStrings[1] + txt; 3591 } 3592 3593 function startAutoplay () { 3594 setAutoplayTimer(); 3595 if (autoplayButton) { updateAutoplayButton('stop', autoplayText[1]); } 3596 } 3597 3598 function stopAutoplay () { 3599 stopAutoplayTimer(); 3600 if (autoplayButton) { updateAutoplayButton('start', autoplayText[0]); } 3601 } 3602 3603 // programaitcally play/pause the slider 3604 function play () { 3605 if (autoplay && !animating) { 3606 startAutoplay(); 3607 autoplayUserPaused = false; 3608 } 3609 } 3610 function pause () { 3611 if (animating) { 3612 stopAutoplay(); 3613 autoplayUserPaused = true; 3614 } 3615 } 3616 3617 function toggleAutoplay () { 3618 if (animating) { 3619 stopAutoplay(); 3620 autoplayUserPaused = true; 3621 } else { 3622 startAutoplay(); 3623 autoplayUserPaused = false; 3624 } 3625 } 3626 3627 function onVisibilityChange () { 3628 if (doc.hidden) { 3629 if (animating) { 3630 stopAutoplayTimer(); 3631 autoplayVisibilityPaused = true; 3632 } 3633 } else if (autoplayVisibilityPaused) { 3634 setAutoplayTimer(); 3635 autoplayVisibilityPaused = false; 3636 } 3637 } 3638 3639 function mouseoverPause () { 3640 if (animating) { 3641 stopAutoplayTimer(); 3642 autoplayHoverPaused = true; 3643 } 3644 } 3645 3646 function mouseoutRestart () { 3647 if (autoplayHoverPaused) { 3648 setAutoplayTimer(); 3649 autoplayHoverPaused = false; 3650 } 3651 } 3652 3653 // keydown events on document 3654 function onDocumentKeydown (e) { 3655 e = getEvent(e); 3656 var keyIndex = [KEYS.LEFT, KEYS.RIGHT].indexOf(e.keyCode); 3657 3658 if (keyIndex >= 0) { 3659 onControlsClick(e, keyIndex === 0 ? -1 : 1); 3660 } 3661 } 3662 3663 // on key control 3664 function onControlsKeydown (e) { 3665 e = getEvent(e); 3666 var keyIndex = [KEYS.LEFT, KEYS.RIGHT].indexOf(e.keyCode); 3667 3668 if (keyIndex >= 0) { 3669 if (keyIndex === 0) { 3670 if (!prevButton.disabled) { onControlsClick(e, -1); } 3671 } else if (!nextButton.disabled) { 3672 onControlsClick(e, 1); 3673 } 3674 } 3675 } 3676 3677 // set focus 3678 function setFocus (el) { 3679 el.focus(); 3680 } 3681 3682 // on key nav 3683 function onNavKeydown (e) { 3684 e = getEvent(e); 3685 var curElement = doc.activeElement; 3686 if (!Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(curElement, 'data-nav')) { return; } 3687 3688 // var code = e.keyCode, 3689 var keyIndex = [KEYS.LEFT, KEYS.RIGHT, KEYS.ENTER, KEYS.SPACE].indexOf(e.keyCode), 3690 navIndex = Number(Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(curElement, 'data-nav')); 3691 3692 if (keyIndex >= 0) { 3693 if (keyIndex === 0) { 3694 if (navIndex > 0) { setFocus(navItems[navIndex - 1]); } 3695 } else if (keyIndex === 1) { 3696 if (navIndex < pages - 1) { setFocus(navItems[navIndex + 1]); } 3697 } else { 3698 navClicked = navIndex; 3699 goTo(navIndex, e); 3700 } 3701 } 3702 } 3703 3704 function getEvent (e) { 3705 e = e || win.event; 3706 return isTouchEvent(e) ? e.changedTouches[0] : e; 3707 } 3708 function getTarget (e) { 3709 return e.target || win.event.srcElement; 3710 } 3711 3712 function isTouchEvent (e) { 3713 return e.type.indexOf('touch') >= 0; 3714 } 3715 3716 function preventDefaultBehavior (e) { 3717 e.preventDefault ? e.preventDefault() : e.returnValue = false; 3718 } 3719 3720 function getMoveDirectionExpected () { 3721 return Object(_helpers_getTouchDirection_js__WEBPACK_IMPORTED_MODULE_14__["getTouchDirection"])(Object(_helpers_toDegree_js__WEBPACK_IMPORTED_MODULE_13__["toDegree"])(lastPosition.y - initPosition.y, lastPosition.x - initPosition.x), swipeAngle) === options.axis; 3722 } 3723 3724 function onPanStart (e) { 3725 if (running) { 3726 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 3727 } 3728 3729 if (autoplay && animating) { stopAutoplayTimer(); } 3730 3731 panStart = true; 3732 if (rafIndex) { 3733 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__["caf"])(rafIndex); 3734 rafIndex = null; 3735 } 3736 3737 var $ = getEvent(e); 3738 events.emit(isTouchEvent(e) ? 'touchStart' : 'dragStart', info(e)); 3739 3740 if (!isTouchEvent(e) && ['img', 'a'].indexOf(getLowerCaseNodeName(getTarget(e))) >= 0) { 3741 preventDefaultBehavior(e); 3742 } 3743 3744 lastPosition.x = initPosition.x = $.clientX; 3745 lastPosition.y = initPosition.y = $.clientY; 3746 if (carousel) { 3747 translateInit = parseFloat(container.style[transformAttr].replace(transformPrefix, '')); 3748 resetDuration(container, '0s'); 3749 } 3750 } 3751 3752 function onPanMove (e) { 3753 if (panStart) { 3754 var $ = getEvent(e); 3755 lastPosition.x = $.clientX; 3756 lastPosition.y = $.clientY; 3757 3758 if (carousel) { 3759 if (!rafIndex) { rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ panUpdate(e); }); } 3760 } else { 3761 if (moveDirectionExpected === '?') { moveDirectionExpected = getMoveDirectionExpected(); } 3762 if (moveDirectionExpected) { preventScroll = true; } 3763 } 3764 3765 if ((typeof e.cancelable !== 'boolean' || e.cancelable) && preventScroll) { 3766 e.preventDefault(); 3767 } 3768 } 3769 } 3770 3771 function panUpdate (e) { 3772 if (!moveDirectionExpected) { 3773 panStart = false; 3774 return; 3775 } 3776 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__["caf"])(rafIndex); 3777 if (panStart) { rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ panUpdate(e); }); } 3778 3779 if (moveDirectionExpected === '?') { moveDirectionExpected = getMoveDirectionExpected(); } 3780 if (moveDirectionExpected) { 3781 if (!preventScroll && isTouchEvent(e)) { preventScroll = true; } 3782 3783 try { 3784 if (e.type) { events.emit(isTouchEvent(e) ? 'touchMove' : 'dragMove', info(e)); } 3785 } catch(err) {} 3786 3787 var x = translateInit, 3788 dist = getDist(lastPosition, initPosition); 3789 if (!horizontal || fixedWidth || autoWidth) { 3790 x += dist; 3791 x += 'px'; 3792 } else { 3793 var percentageX = TRANSFORM ? dist * items * 100 / ((viewport + gutter) * slideCountNew): dist * 100 / (viewport + gutter); 3794 x += percentageX; 3795 x += '%'; 3796 } 3797 3798 container.style[transformAttr] = transformPrefix + x + transformPostfix; 3799 } 3800 } 3801 3802 function onPanEnd (e) { 3803 if (panStart) { 3804 if (rafIndex) { 3805 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__["caf"])(rafIndex); 3806 rafIndex = null; 3807 } 3808 if (carousel) { resetDuration(container, ''); } 3809 panStart = false; 3810 3811 var $ = getEvent(e); 3812 lastPosition.x = $.clientX; 3813 lastPosition.y = $.clientY; 3814 var dist = getDist(lastPosition, initPosition); 3815 3816 if (Math.abs(dist)) { 3817 // drag vs click 3818 if (!isTouchEvent(e)) { 3819 // prevent "click" 3820 var target = getTarget(e); 3821 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(target, {'click': function preventClick (e) { 3822 preventDefaultBehavior(e); 3823 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(target, {'click': preventClick}); 3824 }}); 3825 } 3826 3827 if (carousel) { 3828 rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function() { 3829 if (horizontal && !autoWidth) { 3830 var indexMoved = - dist * items / (viewport + gutter); 3831 indexMoved = dist > 0 ? Math.floor(indexMoved) : Math.ceil(indexMoved); 3832 index += indexMoved; 3833 } else { 3834 var moved = - (translateInit + dist); 3835 if (moved <= 0) { 3836 index = indexMin; 3837 } else if (moved >= slidePositions[slideCountNew - 1]) { 3838 index = indexMax; 3839 } else { 3840 var i = 0; 3841 while (i < slideCountNew && moved >= slidePositions[i]) { 3842 index = i; 3843 if (moved > slidePositions[i] && dist < 0) { index += 1; } 3844 i++; 3845 } 3846 } 3847 } 3848 3849 render(e, dist); 3850 events.emit(isTouchEvent(e) ? 'touchEnd' : 'dragEnd', info(e)); 3851 }); 3852 } else { 3853 if (moveDirectionExpected) { 3854 onControlsClick(e, dist > 0 ? -1 : 1); 3855 } 3856 } 3857 } 3858 } 3859 3860 // reset 3861 if (options.preventScrollOnTouch === 'auto') { preventScroll = false; } 3862 if (swipeAngle) { moveDirectionExpected = '?'; } 3863 if (autoplay && !animating) { setAutoplayTimer(); } 3864 } 3865 3866 // === RESIZE FUNCTIONS === // 3867 // (slidePositions, index, items) => vertical_conentWrapper.height 3868 function updateContentWrapperHeight () { 3869 var wp = middleWrapper ? middleWrapper : innerWrapper; 3870 wp.style.height = slidePositions[index + items] - slidePositions[index] + 'px'; 3871 } 3872 3873 function getPages () { 3874 var rough = fixedWidth ? (fixedWidth + gutter) * slideCount / viewport : slideCount / items; 3875 return Math.min(Math.ceil(rough), slideCount); 3876 } 3877 3878 /* 3879 * 1. update visible nav items list 3880 * 2. add "hidden" attributes to previous visible nav items 3881 * 3. remove "hidden" attrubutes to new visible nav items 3882 */ 3883 function updateNavVisibility () { 3884 if (!nav || navAsThumbnails) { return; } 3885 3886 if (pages !== pagesCached) { 3887 var min = pagesCached, 3888 max = pages, 3889 fn = _helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"]; 3890 3891 if (pagesCached > pages) { 3892 min = pages; 3893 max = pagesCached; 3894 fn = _helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"]; 3895 } 3896 3897 while (min < max) { 3898 fn(navItems[min]); 3899 min++; 3900 } 3901 3902 // cache pages 3903 pagesCached = pages; 3904 } 3905 } 3906 3907 function info (e) { 3908 return { 3909 container: container, 3910 slideItems: slideItems, 3911 navContainer: navContainer, 3912 navItems: navItems, 3913 controlsContainer: controlsContainer, 3914 hasControls: hasControls, 3915 prevButton: prevButton, 3916 nextButton: nextButton, 3917 items: items, 3918 slideBy: slideBy, 3919 cloneCount: cloneCount, 3920 slideCount: slideCount, 3921 slideCountNew: slideCountNew, 3922 index: index, 3923 indexCached: indexCached, 3924 displayIndex: getCurrentSlide(), 3925 navCurrentIndex: navCurrentIndex, 3926 navCurrentIndexCached: navCurrentIndexCached, 3927 pages: pages, 3928 pagesCached: pagesCached, 3929 sheet: sheet, 3930 isOn: isOn, 3931 event: e || {}, 3932 }; 3933 } 3934 3935 return { 3936 version: '2.9.3', 3937 getInfo: info, 3938 events: events, 3939 goTo: goTo, 3940 play: play, 3941 pause: pause, 3942 isOn: isOn, 3943 updateSliderHeight: updateInnerWrapperHeight, 3944 refresh: initSliderTransform, 3945 destroy: destroy, 3946 rebuild: function() { 3947 return tns(Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__["extend"])(options, optionsElements)); 3948 } 3949 }; 3950}; 3951 3952 3953/***/ }), 3954
3955/***/ "./src/components/recipe-featured/recipe-featured.js": 3956/*!***********************************************************!*\ 3957 !*** ./src/components/recipe-featured/recipe-featured.js ***! 3958 \***********************************************************/ 3959/*! no exports provided */ 3960/***/ (function(module, __webpack_exports__, __webpack_require__) { 3961 3962"use strict"; 3963__webpack_require__.r(__webpack_exports__); 3964/* harmony import */ var _js_main_script__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../js/main.script */ "./src/js/main.script.js"); 3965 3966 3967 3968 3969(function ($, Drupal) { 3970 $(document).ready(function () { 3971 if ($('.carousel-three .recipe-featured__col').length >= 5) { 3972 $('.recipe-featured').addClass('five-or-more'); 3973 } // if( $('.carousel-three .recipe-featured__col').length > 3) { 3974 // Carousel 3 Items Max. 3975 3976 3977 var slider = document.tnsAda.init({ 3978 "container": ".carousel-three", 3979 "items": 3, 3980 "loop": true, 3981 "swipeAngle": false, 3982 "speed": 400, 3983 "nav": false, 3984 "controls": true, 3985 "gutter": 30, 3986 "controlsPosition": "top", 3987 "responsive": { 3988 "320": { 3989 "items": 1 3990 }, 3991 "728": { 3992 "items": 2 3993 }, 3994 "992": { 3995 "items": 3, 3996 "loop": false, 3997 "center": false 3998 } // "1400": { 3999 // } 4000 4001 } 4002 }); // } 4003 }); 4004})(jQuery, Drupal); 4005 4006/***/ }), 4007
4008/***/ "./src/js/main.script.js": 4009/*!*******************************!*\ 4010 !*** ./src/js/main.script.js ***! 4011 \*******************************/ 4012/*! no exports provided */ 4013/***/ (function(module, __webpack_exports__, __webpack_require__) { 4014 4015"use strict"; 4016__webpack_require__.r(__webpack_exports__); 4017/* harmony import */ var _polyfill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./polyfill */ "./src/js/polyfill.js"); 4018/* harmony import */ var _polyfill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_polyfill__WEBPACK_IMPORTED_MODULE_0__); 4019/* harmony import */ var _tnsAda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tnsAda */ "./src/js/tnsAda.js"); 4020 4021 4022 4023 // import 'bootstrap'; 4024 4025(function ($, Drupal, drupalSettings) { 4026 // Responsive check helper: 4027 // USAGE: if (Drupal.device.isMobile()) {} 4028 Drupal.device = { 4029 isDesktop: function isDesktop() { 4030 return $(window).innerWidth() > 980; 4031 }, 4032 isTablet: function isTablet() { 4033 return $(window).innerWidth() <= 980 && $(window).innerWidth() > 728; 4034 }, 4035 isMobile: function isMobile() { 4036 return $(window).innerWidth() <= 728; 4037 } 4038 }; // Let the document know when the mouse is being used 4039 4040 document.body.addEventListener('mousedown', function () { 4041 document.body.classList.add('using-mouse'); 4042 }); // Re-enable focus styling when Tab is pressed 4043 4044 document.body.addEventListener('keydown', function (event) { 4045 if (event.keyCode === 9) { 4046 document.body.classList.remove('using-mouse'); 4047 } 4048 }); 4049 $('#ajax-wrapper .js-form-item-image-upload small #edit-image-upload--description').append("<small> No file chosen.</small>"); 4050 Drupal.behaviors.Bc_brandTheme = { 4051 attach: function attach(context, settings) { 4052 var host = window.location.host; 4053 $('a[href^="http"]:not([href*="' + host + '"])').each(function (index) { 4054 $(this).attr('rel', 'noopener nofollow'); 4055 }); 4056 $('[data-toggle="popover"]').each(function (index) { 4057 var $this = $(this); 4058 var $container = $this.closest('div'); 4059 $container.addClass('has-popover'); 4060 $this.appendTo($container); 4061 $this.popover({ 4062 template: '<div class="popover" role="tooltip"><div class="popover-body"></div></div>', 4063 container: $container 4064 }); 4065 }); 4066 $(".popover-button").click(function () { 4067 var controls = $(this).attr("aria-describedby"); 4068 $(".popover-button").removeAttr("aria-describedby"); 4069 $(".popover-button").attr("aria-expanded", function (index, attr) { 4070 return attr == "false" ? "true" : "false"; 4071 }); 4072 $(".popover-button").attr("aria-controls", function (index, attr) { 4073 return attr = controls; 4074 }); 4075 }); 4076 $('.webform-submission-newsletter-form-form .form-item-postal-code input').inputmask({ 4077 mask: ['99999', '99999-9999', 'A9A 9A9'], 4078 placeholder: '', 4079 clearIncomplete: true 4080 }); 4081 /** 4082 * SHARE COMPONENT 4083 */ 4084 4085 /** 4086 * Determine the mobile operating system. 4087 * This function returns one of 'iOS', 'Android', 'Windows Phone', or 'unknown'. 4088 * Based on: https://stackoverflow.com/questions/21741841/detecting-ios-android-operating-system 4089 * @returns {String} 4090 */ 4091 4092 function isAndroidIOS() { 4093 var userAgent = navigator.userAgent || navigator.vendor || window.opera; 4094 4095 if (/android/i.test(userAgent)) { 4096 console.log("android detected"); 4097 4098 if ($(".page-node-type-blog").length) { 4099 $(window).bind('orientationchange', function () { 4100 if ($(window).width() >= 728) { 4101 $(".article-detail__section-abstract .info-share .share-button").attr("aria-controls", "sharebox"); 4102 $(".article-detail__section-abstract .info-share .sharebox").attr("id", "sharebox"); 4103 $('.article-detail__back-and-share .info-share .share-button').removeAttr("aria-controls"); 4104 $('.article-detail__back-and-share .info-share .sharebox').removeAttr("id"); // console.log('desktop'); 4105 } else { 4106 // console.log("mobile"); 4107 $('.article-detail__back-and-share .info-share .share-button').attr("aria-controls", "sharebox"); 4108 $('.article-detail__back-and-share .info-share .sharebox').attr("id", "sharebox"); 4109 $(".article-detail__section-abstract .info-share .share-button").removeAttr("aria-controls"); 4110 $(".article-detail__section-abstract .info-share .sharebox").removeAttr("id"); 4111 } 4112 }).bind(); 4113 } 4114 4115 return true; 4116 } // iOS detection from: http://stackoverflow.com/a/9039885/177710 4117 4118 4119 if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { 4120 console.log("ios detected"); 4121 return true; 4122 } //not Android or iOS 4123 4124 4125 return false;
4126 } 4127 4128 function getMeta(metaName) { 4129 var metas = document.getElementsByTagName('meta'); 4130 4131 for (var i = 0; i < metas.length; i++) { 4132 if (metas[i].getAttribute('name') === metaName) { 4133 return metas[i].getAttribute('content'); 4134 } 4135 } 4136 4137 return ''; 4138 } 4139 4140 $('.share-button', context).on('click', function () { 4141 var isMobile = isAndroidIOS(); 4142 console.log(isMobile); 4143 4144 if (navigator.share && isMobile) { 4145 navigator.share({ 4146 title: document.title, 4147 text: getMeta('description'), 4148 url: document.href 4149 }).then(function () { 4150 return console.log('Successful share'); 4151 })["catch"](function (error) { 4152 return console.log('Error sharing', error); 4153 }); 4154 return null; 4155 } // console.log(this); 4156 // $(this).toggleClass('opened'); 4157 // // $(this).find('.icon').toggleClass('icon-share-close icon-share'); 4158 // $('.sharebox').toggleClass('opened'); 4159 // if ($(this).hasClass('opened')) { 4160 // $(this).attr('aria-expanded', 'true'); 4161 // } else { 4162 // $(this).attr('aria-expanded', 'false'); 4163 // } 4164 // $('.sharebox .close').focus(); 4165 4166 }); // $('.share-button').on("click", function (e) { 4167 // e.preventDefault(); 4168 // // $('.search__filters li a').addClass('hidden'); 4169 // console.log('toggle share'); 4170 // }); 4171 // $('.sharebox .close').on('click', function () { 4172 // $(this).parents('.opened').removeClass('opened'); 4173 // }); 4174 4175 var $temp = $("<input>"); 4176 var $url = $(location).attr('href'); 4177 $('.sharebox .copybutton').on('click', function () { 4178 // $('.copyfield input')[0].select(); 4179 // document.execCommand('copy'); 4180 $("body").append($temp); 4181 $temp.val($url).select(); 4182 document.execCommand("copy"); 4183 $temp.remove(); 4184 $('.copyfield .copymessage').addClass('shown'); 4185 setTimeout(function () { 4186 $('.copyfield .copymessage').removeClass('shown'); 4187 }, 10000); 4188 }); //Change Element type 4189 4190 $.fn.changeElementType = function (newType) { 4191 this.each(function () { 4192 var attrs = {}; 4193 $.each(this.attributes, function (idx, attr) { 4194 attrs[attr.nodeName] = attr.nodeValue; 4195 }); 4196 $(this).replaceWith(function () { 4197 return $("<" + newType + "/>", attrs).append($(this).contents()); 4198 }); 4199 }); 4200 }; // Detect Valid Keyboard Clicks 4201 // https://karlgroves.com/2014/11/24/ridiculously-easy-trick-for-keyboard-accessibility 4202 4203 4204 function a11yClick(event) { 4205 if (event.type === 'click') { 4206 return true; 4207 } else if (event.type === 'keypress') { 4208 var code = event.charCode || event.keyCode; 4209 4210 if (code === 32 || code === 13) { 4211 return true; 4212 } 4213 } else { 4214 return false; 4215 } 4216 } // Juicer/Slick accessibility tweaks. 4217 // $("#block-juiceren .juicer-feed").changeElementType("div"); 4218 4219 4220 $("#block-juiceren .juicer-feed").on('init', function (e, slick) { 4221 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active"); 4222 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active").removeAttr("aria-hidden"); 4223 setTimeout(function () { 4224 // Set slick's accessibility option to false as recommended here: 4225 // https://hub.accessible360.com/kb/articles/521#heading-tip-3-disable-accessibility-mode 4226 if ($("#block-juiceren .juicer-feed").hasClass('slick-initialized')) { 4227 $("#block-juiceren .juicer-feed.slick-initialized").slick('slickSetOption', { 4228 accessibility: false 4229 }, true); 4230 } 4231 4232 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active").removeAttr("aria-hidden"); 4233 }, 1000); 4234 $("#block-juiceren .juicer-feed .slick-list .feed-item .j-text a").removeAttr("tabindex").css("color", "white").changeElementType("span"); 4235 $("#block-juiceren .juicer-feed .slick-list").find(".slick-track .feed-item").attr("role", "group"); 4236 $("#block-juiceren .juicer-feed .slick-list .feed-item .j-text .j-meta nav").addClass('j-meta-nav').changeElementType("div"); 4237 $('#block-juiceren .juicer-feed .slick-list .feed-item').on('click', function () { 4238 window.open($(this).find('a').attr('href')); // console.log('test'); 4239 4240 return false;
4241 }); // Play icon. 4242 4243 var $imageVideo = $("#block-juiceren .juicer-feed .slick-list .feed-item.j-video .j-image"); 4244 var playIcon = '<span class="j-video-icon" aria-hidden="true"></span>'; 4245 $imageVideo.append(playIcon); 4246 $("#block-juiceren .juicer-feed .slick-list .feed-item", context).each(function (i, e) { 4247 var alt = $(e).find(".j-image img").attr("alt"), 4248 message = $(e).find(".j-message").text(), 4249 label = Number($(e).attr("data-slick-index")) + 1, 4250 totalSlide = $("#block-juiceren .juicer-feed .slick-list .feed-item").length; 4251 $(e).attr({ 4252 "aria-label": "Slide " + label + " of " + totalSlide 4253 }); // if (alt) { 4254 // $(e).find(".j-image img").attr("alt", alt.replace('Photo from ', '')); 4255 // } 4256 4257 $(e).find(".j-image img").attr("alt", message); // Social icon screen reader text. 4258 4259 var $social = $(this).find('.j-social'); 4260 var socialIcon = '<span class="j-social-icon" aria-hidden="true"></span> <span class="sr-only">' + $social.attr('aria-label') + '</span>'; 4261 $social.append(socialIcon).removeAttr('aria-label'); 4262 }); 4263 $(".slick-next, .slick-prev").on("click keypress", function (event) { 4264 if (a11yClick(event) === true) { 4265 setTimeout(function () { 4266 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active a").first().focus(); 4267 }, 100); 4268 } 4269 }); //update all j-meta a tags to say comments or likes 4270 4271 $(".comments, .repins").each(function () { 4272 var numComments = $(this).text(); 4273 $(this).html(numComments + ' <span class="sr-only">comments</div>'); 4274 }); 4275 $(".likes").each(function () { 4276 var numLikes = $(this).text(); 4277 $(this).html(numLikes + ' <span class="sr-only">likes</div>'); 4278 }); 4279 }); 4280 $("#block-juiceren .juicer-feed").on('beforeChange', function (e, slick, currentSlide, nextSlide) { 4281 $("#block-juiceren .juicer-feed .slick-list .feed-item").removeAttr("aria-hidden"); 4282 }); 4283 $("#block-juiceren .juicer-feed").on('afterChange', function (e, slick, currentSlide) { 4284 setTimeout(function () { 4285 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active").removeAttr("aria-hidden"); 4286 }, 500); 4287 }); 4288 4289 if ($('#prodH1').length > 0) { 4290 var root = document.getElementById('prodH1'); 4291 root.style.setProperty('--h1-height', root.clientHeight + 'px'); 4292 $(".products--full").addClass("loaded"); 4293 console.log('root.clientHeight', root.clientHeight); 4294 } // if($(".error").length) { 4295 4296 4297 $('#user-login-form .form-submit').on('click', function () { 4298 // console.log("ERROR MESSAGE"); 4299 setTimeout(function () { 4300 if ($("label").hasClass("error")) { 4301 console.log("ERROR"); 4302 $("#user-login-form").addClass("login-errors"); 4303 } 4304 }, 600); 4305 }); 4306 $('#user-login-form input.required').on('input', function () { 4307 setTimeout(function () { 4308 if ($("label").hasClass("error")) { 4309 console.log("ERROR2"); 4310 $("#user-login-form").addClass("login-errors"); 4311 } 4312 4313 if ($('#user-login-form label').css('display') == 'none') { 4314 // true 4315 console.log("ERROR FIXED"); 4316 $("#user-login-form").removeClass("login-errors"); 4317 } 4318 }, 600); 4319 }); // } 4320 // var altTxt = $("img").attr('alt'); 4321 4322 if ($('.blog-callout__image img').length > 0) { 4323 $(".blog-callout__image img").attr('alt', ''); 4324 } 4325 4326 if ($('.recipe-featured__col img').length > 0) { 4327 $(".recipe-featured__col img").attr('alt', ''); 4328 } 4329 4330 if ($('.recipes--full__image-frame img').length > 0) { 4331 $(".recipes--full__image-frame img").attr('alt', ''); 4332 } 4333 4334 if ($('.blog-teaser__image img').length > 0) { 4335 $(".blog-teaser__image img").attr('alt', ''); 4336 } // setTimeout 4337 // if ($('.recipe-featured__card img').length > 0) { 4338 // $(".recipe-featured__card img").attr('alt', ''); 4339 // console.log('here') 4340 // } 4341 4342 4343 setTimeout(function () { 4344 if ($('.recipe-featured__card img').length > 0) { 4345 $(".recipe-featured__card img").attr('alt', ''); 4346 } 4347 }, 12000); //identitcal id issue on blog page fix 4348 4349 if ($(".page-node-type-blog").length) { 4350 $(window).resize(function () { 4351 if ($(window).width() >= 728) { 4352 $(".article-detail__section-abstract .info-share .share-button").attr("aria-controls", "sharebox"); 4353 $(".article-detail__section-abstract .info-share .sharebox").attr("id", "sharebox"); 4354 $('.article-detail__back-and-share .info-share .share-button').removeAttr("aria-controls"); 4355 $('.article-detail__back-and-share .info-share .sharebox').removeAttr("id"); // console.log('desktop'); 4356 } else { 4357 // console.log("mobile"); 4358 $('.article-detail__back-and-share .info-share .share-button').attr("aria-controls", "sharebox"); 4359 $('.article-detail__back-and-share .info-share .sharebox').attr("id", "sharebox"); 4360 $(".article-detail__section-abstract .info-share .share-button").removeAttr("aria-controls"); 4361 $(".article-detail__section-abstract .info-share .sharebox").removeAttr("id"); 4362 } 4363 }).resize(); 4364 } 4365 } 4366 }; 4367 $("form input#edit-image-upload-upload-button--2").focusin(function (e) { 4368 $('label[for="edit-image-upload-upload-button--2"]').addClass("focused"); 4369 }); 4370 $("form input#edit-image-upload-upload-button--2").focusout(function (e) { 4371 $('label[for="edit-image-upload-upload-button--2"]').removeClass("focused"); 4372 }); //share button fix 4373 4374 $('.share-button').on('click', function () { 4375 $(this).toggleClass('opened'); 4376 $('.sharebox').toggleClass('opened'); 4377 4378 if ($(this).hasClass('opened')) { 4379 $(this).attr('aria-expanded', 'true'); 4380 } else { 4381 $(this).attr('aria-expanded', 'false'); 4382 } 4383 }); // if($(".share-button").length > 0) { 4384 // $('.share-button').on('click', function () { 4385 // console.log("yup clicked"); 4386 // $(this).addClass('opened'); 4387 // $('.sharebox').toggleClass('opened'); 4388 // }) 4389 // } 4390 // $(document).ready(function () { 4391 // // Function to handle aria-hidden for all child elements 4392 // function updateAriaHiddenState(element) { 4393 // if ($(element).attr('aria-hidden') === 'true') { 4394 // // Add aria-hidden="true" to all children 4395 // $(element).find('*').attr('aria-hidden', 'true'); 4396 // } else { 4397 // // Remove aria-hidden from all children 4398 // $(element).find('*').removeAttr('aria-hidden'); 4399 // } 4400 // } 4401 // // Initial check to apply or remove aria-hidden 4402 // $('.blog-featured-medium__item').each(function () { 4403 // updateAriaHiddenState(this); 4404 // }); 4405 // // MutationObserver to watch for changes to aria-hidden attribute 4406 // var observer = new MutationObserver(function (mutations) { 4407 // mutations.forEach(function (mutation) { 4408 // if (mutation.type === 'attributes' && mutation.attributeName === 'aria-hidden') { 4409 // // Update the aria-hidden state for the mutated element 4410 // updateAriaHiddenState(mutation.target); 4411 // } 4412 // }); 4413 // }); 4414 // // Apply the MutationObserver to each blog-featured-medium__item 4415 // $('.blog-featured-medium__item').each(function () { 4416 // observer.observe(this, { attributes: true }); // Watch for attribute changes 4417 // }); 4418 // }); 4419})(jQuery, Drupal, drupalSettings); 4420 4421/***/ }), 4422
4423/***/ "./src/js/polyfill.js": 4424/*!****************************!*\ 4425 !*** ./src/js/polyfill.js ***! 4426 \****************************/ 4427/*! no static exports found */ 4428/***/ (function(module, exports) { 4429 4430// Add your JS/node package pollyfills here 4431 4432/***/ }), 4433
4434/***/ "./src/js/tnsAda.js": 4435/*!**************************!*\ 4436 !*** ./src/js/tnsAda.js ***! 4437 \**************************/ 4438/*! exports provided: tns */ 4439/***/ (function(module, __webpack_exports__, __webpack_require__) { 4440 4441"use strict"; 4442__webpack_require__.r(__webpack_exports__); 4443/* harmony import */ var _node_modules_tiny_slider_src_tiny_slider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/tiny-slider/src/tiny-slider */ "./node_modules/tiny-slider/src/tiny-slider.js"); 4444/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tns", function() { return _node_modules_tiny_slider_src_tiny_slider__WEBPACK_IMPORTED_MODULE_0__["tns"]; }); 4445 4446// Carousel ADA remediation for TNS slider 2.9.2 4447// https://hub.accessible360.com/kb/articles/476 4448// https://confluence.millenniumweb.com/display/CKB/Accessible+Carousels 4449// 4450// Usage Example: 4451// document.tnsAda.init({ 4452// // ===== Just use standard tns config options 4453// container: '.your-selector-for-wrapping-element', 4454// items: 1, 4455// slideBy: 'page', 4456// autoplay: false, 4457// // ===== Options used for custom ADA code **all optional 4458// nav: true, // BOOLEAN: Create ADA bullet nav? 4459// controls: true, // BOOLEAN: Create ADA prev and next buttons? 4460// reverseNextPrev: false, // BOOLEAN: Reverse prev/next buttons? 4461// adaText: { // OBJECT: Custom text for ADA elements 4462// nav: '<span aria-hidden="true">•</span>', // STRING: Custom bullet nav text 4463// prev: '<span class="sr-only">Previous Slide</span> <i class="icon icon-circle-arrow-left icon-fill-tertiary" aria-hidden="true"></i>', // STRING: Custom prev button text 4464// next: '<span class="sr-only">Next Slide</span> <i class="icon icon-circle-arrow-right icon-fill-tertiary" aria-hidden="true"></i>', // STRING: Custom next button text 4465// instructions: 'This is a carousel. Use Next and Previous buttons to navigate, or jump to a slide with the slide dots.', // STRING: Custom instructions text 4466// goTo: 'Go to slide [x]', // STRING: Custom go to slide text 4467// current: 'Slide [x] of [y]', // STRING: Custom current slide text 4468// } 4469// }); 4470// 4471// TODO: generate/find a unique id for the instance of the initialization. 4472// Use it to namespace all events so they can be unbound and the slider 4473// destroyed. could alternatively just put some logic in to prevent the 4474// same element from being initialized twice. 4475// 4476// TODO: import all currently hardcoded text strings so that the slider can be 4477// translatable. could use data-attributes. could grab them from the 4478// document.tnsAda object. could pass them in with the initialization. 4479// For drupal string translation having them in a template or block is 4480// probably easiest. 4481 4482 4483document.tnsAda = { 4484 init: function init(params) { 4485 //if the container element is not present. do nothing and exit. 4486 if (jQuery(params.container).length < 1) { 4487 return; 4488 } 4489 4490 var orig = this; // Definte options for ADA functions 4491 4492 var opt = { 4493 nav: params.nav, 4494 // Create a custom ADA bullet nav? 4495 controls: params.controls, 4496 // Create custom ADA prev and next buttons? 4497 reverseNextPrev: params.reverseNextPrev // Reverse the action of the next and previous buttons? 4498 4499 }; 4500 4501 if (!params.adaText) { 4502 params.adaText = {}; 4503 } 4504 4505 opt.adaText = { 4506 nav: params.adaText.nav || '<span aria-hidden="true">•</span>', 4507 prev: params.adaText.prev || '<span class="sr-only">Previous Slide</span> <i class="icon icon-circle-arrow-left icon-fill-tertiary" aria-hidden="true"></i>', 4508 next: params.adaText.next || '<span class="sr-only">Next Slide</span> <i class="icon icon-circle-arrow-right icon-fill-tertiary" aria-hidden="true"></i>', 4509 instructions: params.adaText.instructions || "This is a carousel. Use Next and Previous buttons to navigate, or jump to a slide with the slide dots.", 4510 goTo: params.adaText.goTo || "Go to slide [x]", 4511 current: params.adaText.current || "Slide [x] of [y]", 4512 slides: params.adaText.slides || "Slides" 4513 }; // Prepare params object for initialization 4514 4515 params.nav = false;
4516 params.controls = false; 4517 delete params.reverseNextPrev; 4518 delete params.adaText; // Initialize the slider and store it in our opt object. 4519 4520 opt.slider = Object(_node_modules_tiny_slider_src_tiny_slider__WEBPACK_IMPORTED_MODULE_0__["tns"])(params); 4521 4522 if (opt.controls) { 4523 orig.addControls(opt); 4524 } 4525 4526 if (opt.nav) { 4527 orig.addNav(opt); 4528 } 4529 4530 orig.oneTimeFixes(opt); 4531 }, 4532 oneTimeFixes: function oneTimeFixes(opt) { 4533 var orig = this, 4534 slider = opt.slider, 4535 info = slider.getInfo(), 4536 inner = jQuery(info.container).parents(".tns-inner"), 4537 outer = jQuery(info.container).parents(".tns-outer"), 4538 uiEnabled = true; // Add role attribute to the slides 4539 4540 inner.find(".tns-item").attr("role", "group"); // Remove non-compliant live region 4541 4542 outer.find(".tns-liveregion").removeAttr("aria-live").removeAttr("aria-atomic").attr("aria-hidden", "true").hide(); // Add role and label to the carousel incase its a ul 4543 4544 inner.find(".tns-carousel").attr("role", "presentation").attr("aria-label", opt.adaText.slides); // Add carousel instructions 4545 4546 outer.prepend('<p class="sr-only tns-custom-instructions">' + opt.adaText.instructions + "</p>"); // Hide controls if all items are displayed at once 4547 4548 jQuery(window).on("resize", function () { 4549 orig.updateActive("", opt); 4550 4551 if (slider.getInfo().items >= info.slideCount) { 4552 toggleUi("off"); 4553 } else { 4554 toggleUi("on"); 4555 } 4556 }); 4557 jQuery(window).trigger("resize"); 4558 4559 function toggleUi(dir) { 4560 if (dir == "off" && uiEnabled) { 4561 outer.find(".tns-custom-controls, .tns-custom-nav, .tns-custom-instructions").hide().attr("aria-hidden", "true"); 4562 orig.updateActive(0, opt); 4563 uiEnabled = false; 4564 } 4565 4566 if (dir == "on" && !uiEnabled) { 4567 outer.find(".tns-custom-controls, .tns-custom-nav, .tns-custom-instructions").show().removeAttr("aria-hidden"); 4568 uiEnabled = true; 4569 } 4570 } 4571 }, 4572 addControls: function addControls(opt) { 4573 var orig = this, 4574 slider = opt.slider, 4575 info = slider.getInfo(), 4576 inner = jQuery(info.container).parents(".tns-inner"); // Add prev/next buttons and events 4577 // Note: TNS sliders interpretation of "next and previous" is a bit conterintuitive. 4578 // I swapped them by default. The reverseNextPrev flag allows you to switch back. 4579 4580 if (opt.reverseNextPrev) { 4581 inner.prepend('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-prev product-category__carousel-prev">' + opt.adaText.prev + "</button></div>"); 4582 inner.append('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-next product-category__carousel-next">' + opt.adaText.next + "</button></div>"); 4583 } else { 4584 inner.prepend('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-prev tns-custom-reverse product-category__carousel-prev">' + opt.adaText.prev + "</button></div>"); 4585 inner.append('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-next tns-custom-reverse product-category__carousel-next">' + opt.adaText.next + "</button></div>"); 4586 } 4587 4588 inner.find(".tns-custom-next").on("click", function () { 4589 orig.updateActive("next", opt); 4590 }); 4591 inner.find(".tns-custom-prev").on("click", function () { 4592 orig.updateActive("prev", opt); 4593 }); 4594 }, 4595 addNav: function addNav(opt) { 4596 var orig = this, 4597 slider = opt.slider, 4598 info = slider.getInfo(), 4599 inner = jQuery(info.container).parents(".tns-inner"); // Add bullet nav and events 4600 4601 var newNav = '<ul class="tns-custom-nav">'; 4602 4603 for (var i = 0; i < info.slideCount; i++) { 4604 newNav = newNav + '<li><button type="button" class="tns-custom-nav-item" data-tns-custom-nav-id="' + i + '" aria-label="' + opt.adaText.goTo.replace("[x]", i + 1) + '">' + opt.navText + "</button></li>"; 4605 } 4606 4607 inner.append(newNav + "</ul>"); 4608 inner.find("[data-tns-custom-nav-id]").on("click", function () { 4609 var target = jQuery(this).attr("data-tns-custom-nav-id"); 4610 orig.updateActive(target, opt); 4611 }); 4612 }, 4613 updateActive: function updateActive(target, opt) { 4614 var focusable = "[href], button, input, select, textarea", 4615 slider = opt.slider, 4616 info = slider.getInfo(), 4617 inner = jQuery(info.container).parents(".tns-inner"); // Navigate to the target slide 4618 4619 if (target.length > 0) { 4620 slider.goTo(target); 4621 } // Modify slides and bullet nav to reflect the new active slide state 4622 4623 4624 setTimeout(function () { 4625 var newInfo = slider.getInfo(); // Make all focusable elements in hidden slides not focusable and update the aria properties of all slides 4626 4627 inner.find(".tns-item").removeAttr("aria-label").attr("tabindex", "-1").attr("aria-hidden", "true").find(focusable).attr("tabindex", "-1"); 4628 4629 for (var i = newInfo.index; i < newInfo.items + newInfo.index; i++) { 4630 inner.find(".tns-item").eq(i).removeAttr("tabindex").removeAttr("aria-hidden").attr("aria-label", opt.adaText.current.replace("[x]", i - newInfo.index + newInfo.displayIndex).replace("[y]", newInfo.slideCount)).find(focusable).removeAttr("tabindex"); 4631 } // Update the bullet nav to reflect the currently active slide. 4632 4633 4634 if (opt.nav) { 4635 var navBtns = inner.find("[data-tns-custom-nav-id]"), 4636 activeNavBtn = inner.find('[data-tns-custom-nav-id="' + (newInfo.displayIndex - 1) + '"]'); 4637 navBtns.removeAttr("aria-current"); 4638 activeNavBtn.attr("aria-current", "true"); 4639 } 4640 }, 100); 4641 } 4642}; 4643 4644/***/ }), 4645 4646/***/ 18: 4647/*!*****************************************************************!*\ 4648 !*** multi ./src/components/recipe-featured/recipe-featured.js ***! 4649 \*****************************************************************/ 4650/*! no static exports found */ 4651/***/ (function(module, exports, __webpack_require__) { 4652 4653module.exports = __webpack_require__(/*! /var/www/html/dev_bc_bonmatin/html/web/themes/custom/bc_brand/src/components/recipe-featured/recipe-featured.js */"./src/components/recipe-featured/recipe-featured.js"); 4654 4655 4656/***/ }) 4657 4658/******/ });; 4659/******/ (function(modules) { // webpackBootstrap 4660/******/ // The module cache 4661/******/ var installedModules = {}; 4662/******/ 4663/******/ // The require function 4664/******/ function __webpack_require__(moduleId) { 4665/******/ 4666/******/ // Check if module is in cache 4667/******/ if(installedModules[moduleId]) { 4668/******/ return installedModules[moduleId].exports; 4669/******/ } 4670/******/ // Create a new module (and put it into the cache) 4671/******/ var module = installedModules[moduleId] = { 4672/******/ i: moduleId, 4673/******/ l: false, 4674/******/ exports: {} 4675/******/ }; 4676/******/ 4677/******/ // Execute the module function 4678/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 4679/******/ 4680/******/ // Flag the module as loaded
vendor: 2,824 bytes, lines 4681-4746
4681/******/ module.l = true; 4682/******/ 4683/******/ // Return the exports of the module 4684/******/ return module.exports; 4685/******/ } 4686/******/ 4687/******/ 4688/******/ // expose the modules object (__webpack_modules__) 4689/******/ __webpack_require__.m = modules; 4690/******/ 4691/******/ // expose the module cache 4692/******/ __webpack_require__.c = installedModules; 4693/******/ 4694/******/ // define getter function for harmony exports 4695/******/ __webpack_require__.d = function(exports, name, getter) { 4696/******/ if(!__webpack_require__.o(exports, name)) { 4697/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 4698/******/ } 4699/******/ }; 4700/******/ 4701/******/ // define __esModule on exports 4702/******/ __webpack_require__.r = function(exports) { 4703/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 4704/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 4705/******/ } 4706/******/ Object.defineProperty(exports, '__esModule', { value: true }); 4707/******/ }; 4708/******/ 4709/******/ // create a fake namespace object 4710/******/ // mode & 1: value is a module id, require it 4711/******/ // mode & 2: merge all properties of value into the ns 4712/******/ // mode & 4: return value when already ns object 4713/******/ // mode & 8|1: behave like require 4714/******/ __webpack_require__.t = function(value, mode) { 4715/******/ if(mode & 1) value = __webpack_require__(value); 4716/******/ if(mode & 8) return value; 4717/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 4718/******/ var ns = Object.create(null); 4719/******/ __webpack_require__.r(ns); 4720/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 4721/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 4722/******/ return ns; 4723/******/ }; 4724/******/ 4725/******/ // getDefaultExport function for compatibility with non-harmony modules 4726/******/ __webpack_require__.n = function(module) { 4727/******/ var getter = module && module.__esModule ? 4728/******/ function getDefault() { return module['default']; } : 4729/******/ function getModuleExports() { return module; }; 4730/******/ __webpack_require__.d(getter, 'a', getter); 4731/******/ return getter; 4732/******/ }; 4733/******/ 4734/******/ // Object.prototype.hasOwnProperty.call 4735/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 4736/******/ 4737/******/ // __webpack_public_path__ 4738/******/ __webpack_require__.p = "/"; 4739/******/ 4740/******/ 4741/******/ // Load entry module and return exports 4742/******/ return __webpack_require__(__webpack_require__.s = 14); 4743/******/ }) 4744/************************************************************************/ 4745/******/ ({ 4746
4747/***/ "./src/components/product-categories/product-categories.js": 4748/*!*****************************************************************!*\ 4749 !*** ./src/components/product-categories/product-categories.js ***! 4750 \*****************************************************************/ 4751/*! no static exports found */ 4752/***/ (function(module, exports, __webpack_require__) { 4753 4754"use strict"; 4755 4756 4757(function ($, Drupal, once) { 4758 // $(document).ready(function () { 4759 Drupal.behaviors.productCategories = { 4760 attach: function attach(context) { 4761 once('productCategories', '.product-category', context).forEach(function (element) { 4762 var slider = document.tnsAda.init({ 4763 "container": ".product-category__row", 4764 "items": 3, 4765 "center": true, 4766 "loop": true, 4767 "swipeAngle": false, 4768 "speed": 400, 4769 "nav": false, 4770 "controls": true, 4771 "edgePadding": 100, 4772 "gutter": 20, 4773 "controlsPosition": "top", 4774 "responsive": { 4775 "320": { 4776 "disable": false, 4777 "items": 1, 4778 "gutter": 0, 4779 "edgePadding": 0 4780 }, 4781 "500": { 4782 "disable": false, 4783 "items": 1 4784 }, 4785 "628": { 4786 "disable": false, 4787 "items": 2 4788 }, 4789 "992": { 4790 "items": 2, 4791 "disable": false, 4792 "gutter": 0, 4793 "edgePadding": 50 4794 }, 4795 "1400": { 4796 "items": 6, 4797 "disable": true 4798 } 4799 } 4800 }); 4801 }); 4802 $(".tns-custom-prev").addClass("carousel-prev"); 4803 $(".tns-custom-next").addClass("carousel-next"); // if($(window).width() >= 1399) { 4804 // // if(!$(".product-category .product-category__col").hasClass("tns-slide-cloned")) { 4805 // $(".product-category .product-category__col").not(".tns-slide-cloned").attr("aria-hidden", "false"); 4806 // $(".product-category .product-category__col").not(".tns-slide-cloned").removeAttr("tabindex"); 4807 // $(".product-category .product-category__col a").not(".tns-slide-cloned").removeAttr("tabindex"); 4808 // // } 4809 // console.log("loaded over 1400^"); 4810 // } else { 4811 // console.log("loaded under 1400"); 4812 // } 4813 // $(window).resize(function () { 4814 // if($(window).width() >= 1399) { 4815 // $(".product-category .product-category__col").not(".tns-slide-cloned").attr("aria-hidden", "false"); 4816 // $(".product-category .product-category__col").not(".tns-slide-cloned").removeAttr("tabindex"); 4817 // $(".product-category .product-category__col a").not(".tns-slide-cloned").removeAttr("tabindex"); 4818 // console.log("resized larger 1400^"); 4819 // } else { 4820 // console.log("resized under 1400"); 4821 // } 4822 // }) 4823 } 4824 }; // Carousel 3 Items Max. 4825 // }); 4826})(jQuery, Drupal, once); 4827 4828/***/ }), 4829 4830/***/ 14: 4831/*!***********************************************************************!*\ 4832 !*** multi ./src/components/product-categories/product-categories.js ***! 4833 \***********************************************************************/ 4834/*! no static exports found */ 4835/***/ (function(module, exports, __webpack_require__) { 4836 4837module.exports = __webpack_require__(/*! /var/www/html/dev_bc_bonmatin/html/web/themes/custom/bc_brand/src/components/product-categories/product-categories.js */"./src/components/product-categories/product-categories.js"); 4838 4839 4840/***/ }) 4841 4842/******/ });; 4843/******/ (function(modules) { // webpackBootstrap 4844/******/ // The module cache 4845/******/ var installedModules = {}; 4846/******/ 4847/******/ // The require function 4848/******/ function __webpack_require__(moduleId) { 4849/******/ 4850/******/ // Check if module is in cache 4851/******/ if(installedModules[moduleId]) { 4852/******/ return installedModules[moduleId].exports; 4853/******/ } 4854/******/ // Create a new module (and put it into the cache) 4855/******/ var module = installedModules[moduleId] = { 4856/******/ i: moduleId, 4857/******/ l: false, 4858/******/ exports: {} 4859/******/ }; 4860/******/ 4861/******/ // Execute the module function 4862/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 4863/******/ 4864/******/ // Flag the module as loaded
vendor: 2,823 bytes, lines 4865-4930
4865/******/ module.l = true; 4866/******/ 4867/******/ // Return the exports of the module 4868/******/ return module.exports; 4869/******/ } 4870/******/ 4871/******/ 4872/******/ // expose the modules object (__webpack_modules__) 4873/******/ __webpack_require__.m = modules; 4874/******/ 4875/******/ // expose the module cache 4876/******/ __webpack_require__.c = installedModules; 4877/******/ 4878/******/ // define getter function for harmony exports 4879/******/ __webpack_require__.d = function(exports, name, getter) { 4880/******/ if(!__webpack_require__.o(exports, name)) { 4881/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 4882/******/ } 4883/******/ }; 4884/******/ 4885/******/ // define __esModule on exports 4886/******/ __webpack_require__.r = function(exports) { 4887/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 4888/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 4889/******/ } 4890/******/ Object.defineProperty(exports, '__esModule', { value: true }); 4891/******/ }; 4892/******/ 4893/******/ // create a fake namespace object 4894/******/ // mode & 1: value is a module id, require it 4895/******/ // mode & 2: merge all properties of value into the ns 4896/******/ // mode & 4: return value when already ns object 4897/******/ // mode & 8|1: behave like require 4898/******/ __webpack_require__.t = function(value, mode) { 4899/******/ if(mode & 1) value = __webpack_require__(value); 4900/******/ if(mode & 8) return value; 4901/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 4902/******/ var ns = Object.create(null); 4903/******/ __webpack_require__.r(ns); 4904/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 4905/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 4906/******/ return ns; 4907/******/ }; 4908/******/ 4909/******/ // getDefaultExport function for compatibility with non-harmony modules 4910/******/ __webpack_require__.n = function(module) { 4911/******/ var getter = module && module.__esModule ? 4912/******/ function getDefault() { return module['default']; } : 4913/******/ function getModuleExports() { return module; }; 4914/******/ __webpack_require__.d(getter, 'a', getter); 4915/******/ return getter; 4916/******/ }; 4917/******/ 4918/******/ // Object.prototype.hasOwnProperty.call 4919/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 4920/******/ 4921/******/ // __webpack_public_path__ 4922/******/ __webpack_require__.p = "/"; 4923/******/ 4924/******/ 4925/******/ // Load entry module and return exports 4926/******/ return __webpack_require__(__webpack_require__.s = 9); 4927/******/ }) 4928/************************************************************************/ 4929/******/ ({ 4930
vendor: 970 bytes, lines 4931-4953
4931/***/ "./node_modules/tiny-slider/src/helpers/addCSSRule.js": 4932/*!************************************************************!*\ 4933 !*** ./node_modules/tiny-slider/src/helpers/addCSSRule.js ***! 4934 \************************************************************/ 4935/*! exports provided: addCSSRule */ 4936/***/ (function(module, __webpack_exports__, __webpack_require__) { 4937 4938"use strict"; 4939__webpack_require__.r(__webpack_exports__); 4940/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addCSSRule", function() { return addCSSRule; }); 4941/* harmony import */ var _raf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 4942// cross browsers addRule method 4943 4944function addCSSRule(sheet, selector, rules, index) { 4945 // return raf(function() { 4946 'insertRule' in sheet ? 4947 sheet.insertRule(selector + '{' + rules + '}', index) : 4948 sheet.addRule(selector, rules, index); 4949 // }); 4950} 4951 4952/***/ }), 4953
vendor: 1,082 bytes, lines 4954-4977
4954/***/ "./node_modules/tiny-slider/src/helpers/addClass.js": 4955/*!**********************************************************!*\ 4956 !*** ./node_modules/tiny-slider/src/helpers/addClass.js ***! 4957 \**********************************************************/ 4958/*! exports provided: addClass */ 4959/***/ (function(module, __webpack_exports__, __webpack_require__) { 4960 4961"use strict"; 4962__webpack_require__.r(__webpack_exports__); 4963/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return addClass; }); 4964/* harmony import */ var _hasClass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 4965 4966var addClass = _hasClass_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 4967 function (el, str) { 4968 if (!Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.classList.add(str); } 4969 } : 4970 function (el, str) { 4971 if (!Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.className += ' ' + str; } 4972 }; 4973 4974 4975 4976/***/ }), 4977
vendor: 1,023 bytes, lines 4978-4999
4978/***/ "./node_modules/tiny-slider/src/helpers/addEvents.js": 4979/*!***********************************************************!*\ 4980 !*** ./node_modules/tiny-slider/src/helpers/addEvents.js ***! 4981 \***********************************************************/ 4982/*! exports provided: addEvents */ 4983/***/ (function(module, __webpack_exports__, __webpack_require__) { 4984 4985"use strict"; 4986__webpack_require__.r(__webpack_exports__); 4987/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEvents", function() { return addEvents; }); 4988/* harmony import */ var _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./passiveOption.js */ "./node_modules/tiny-slider/src/helpers/passiveOption.js"); 4989 4990 4991function addEvents(el, obj, preventScrolling) { 4992 for (var prop in obj) { 4993 var option = ['touchstart', 'touchmove'].indexOf(prop) >= 0 && !preventScrolling ? _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__["passiveOption"] : false; 4994 el.addEventListener(prop, obj[prop], option); 4995 } 4996} 4997 4998/***/ }), 4999
vendor: 745 bytes, lines 5000-5019
5000/***/ "./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js": 5001/*!*******************************************************************!*\ 5002 !*** ./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js ***! 5003 \*******************************************************************/ 5004/*! exports provided: arrayFromNodeList */ 5005/***/ (function(module, __webpack_exports__, __webpack_require__) { 5006 5007"use strict"; 5008__webpack_require__.r(__webpack_exports__); 5009/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayFromNodeList", function() { return arrayFromNodeList; }); 5010function arrayFromNodeList (nl) { 5011 var arr = []; 5012 for (var i = 0, l = nl.length; i < l; i++) { 5013 arr.push(nl[i]); 5014 } 5015 return arr; 5016} 5017 5018/***/ }), 5019
vendor: 637 bytes, lines 5020-5038
5020/***/ "./node_modules/tiny-slider/src/helpers/caf.js": 5021/*!*****************************************************!*\ 5022 !*** ./node_modules/tiny-slider/src/helpers/caf.js ***! 5023 \*****************************************************/ 5024/*! exports provided: caf */ 5025/***/ (function(module, __webpack_exports__, __webpack_require__) { 5026 5027"use strict"; 5028__webpack_require__.r(__webpack_exports__); 5029/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "caf", function() { return caf; }); 5030var win = window; 5031 5032var caf = win.cancelAnimationFrame 5033 || win.mozCancelAnimationFrame 5034 || function(id){ clearTimeout(id); }; 5035 5036 5037/***/ }), 5038
vendor: 1,914 bytes, lines 5039-5087
5039/***/ "./node_modules/tiny-slider/src/helpers/calc.js": 5040/*!******************************************************!*\ 5041 !*** ./node_modules/tiny-slider/src/helpers/calc.js ***! 5042 \******************************************************/ 5043/*! exports provided: calc */ 5044/***/ (function(module, __webpack_exports__, __webpack_require__) { 5045 5046"use strict"; 5047__webpack_require__.r(__webpack_exports__); 5048/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calc", function() { return calc; }); 5049/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 5050/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 5051/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 5052// get css-calc 5053// @return - false | calc | -webkit-calc | -moz-calc 5054// @usage - var calc = getCalc(); 5055 5056 5057 5058 5059function calc() { 5060 var doc = document, 5061 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 5062 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 5063 div = doc.createElement('div'), 5064 result = false; 5065 5066 body.appendChild(div); 5067 try { 5068 var str = '(10px * 10)', 5069 vals = ['calc' + str, '-moz-calc' + str, '-webkit-calc' + str], 5070 val; 5071 for (var i = 0; i < 3; i++) { 5072 val = vals[i]; 5073 div.style.width = val; 5074 if (div.offsetWidth === 100) { 5075 result = val.replace(str, ''); 5076 break; 5077 } 5078 } 5079 } catch (e) {} 5080 5081 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : div.remove(); 5082 5083 return result; 5084} 5085 5086/***/ }), 5087
vendor: 722 bytes, lines 5088-5103
5088/***/ "./node_modules/tiny-slider/src/helpers/checkStorageValue.js": 5089/*!*******************************************************************!*\ 5090 !*** ./node_modules/tiny-slider/src/helpers/checkStorageValue.js ***! 5091 \*******************************************************************/ 5092/*! exports provided: checkStorageValue */ 5093/***/ (function(module, __webpack_exports__, __webpack_require__) { 5094 5095"use strict"; 5096__webpack_require__.r(__webpack_exports__); 5097/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkStorageValue", function() { return checkStorageValue; }); 5098function checkStorageValue (value) { 5099 return ['true', 'false'].indexOf(value) >= 0 ? JSON.parse(value) : value; 5100} 5101 5102/***/ }), 5103
vendor: 667 bytes, lines 5104-5117
5104/***/ "./node_modules/tiny-slider/src/helpers/classListSupport.js": 5105/*!******************************************************************!*\ 5106 !*** ./node_modules/tiny-slider/src/helpers/classListSupport.js ***! 5107 \******************************************************************/ 5108/*! exports provided: classListSupport */ 5109/***/ (function(module, __webpack_exports__, __webpack_require__) { 5110 5111"use strict"; 5112__webpack_require__.r(__webpack_exports__); 5113/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "classListSupport", function() { return classListSupport; }); 5114var classListSupport = 'classList' in document.createElement('_'); 5115 5116/***/ }), 5117
vendor: 1,359 bytes, lines 5118-5152
5118/***/ "./node_modules/tiny-slider/src/helpers/createStyleSheet.js": 5119/*!******************************************************************!*\ 5120 !*** ./node_modules/tiny-slider/src/helpers/createStyleSheet.js ***! 5121 \******************************************************************/ 5122/*! exports provided: createStyleSheet */ 5123/***/ (function(module, __webpack_exports__, __webpack_require__) { 5124 5125"use strict"; 5126__webpack_require__.r(__webpack_exports__); 5127/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStyleSheet", function() { return createStyleSheet; }); 5128// create and append style sheet 5129function createStyleSheet (media, nonce) { 5130 // Create the <style> tag 5131 var style = document.createElement("style"); 5132 // style.setAttribute("type", "text/css"); 5133 5134 // Add a media (and/or media query) here if you'd like! 5135 // style.setAttribute("media", "screen") 5136 // style.setAttribute("media", "only screen and (max-width : 1024px)") 5137 if (media) { style.setAttribute("media", media); } 5138 5139 // Add nonce attribute for Content Security Policy 5140 if (nonce) { style.setAttribute("nonce", nonce); } 5141 5142 // WebKit hack :( 5143 // style.appendChild(document.createTextNode("")); 5144 5145 // Add the <style> element to the page 5146 document.querySelector('head').appendChild(style); 5147 5148 return style.sheet ? style.sheet : style.styleSheet; 5149}; 5150 5151/***/ }), 5152
vendor: 601 bytes, lines 5153-5166
5153/***/ "./node_modules/tiny-slider/src/helpers/docElement.js": 5154/*!************************************************************!*\ 5155 !*** ./node_modules/tiny-slider/src/helpers/docElement.js ***! 5156 \************************************************************/ 5157/*! exports provided: docElement */ 5158/***/ (function(module, __webpack_exports__, __webpack_require__) { 5159 5160"use strict"; 5161__webpack_require__.r(__webpack_exports__); 5162/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "docElement", function() { return docElement; }); 5163var docElement = document.documentElement; 5164 5165/***/ }), 5166
vendor: 1,234 bytes, lines 5167-5206
5167/***/ "./node_modules/tiny-slider/src/helpers/events.js": 5168/*!********************************************************!*\ 5169 !*** ./node_modules/tiny-slider/src/helpers/events.js ***! 5170 \********************************************************/ 5171/*! exports provided: Events */ 5172/***/ (function(module, __webpack_exports__, __webpack_require__) { 5173 5174"use strict"; 5175__webpack_require__.r(__webpack_exports__); 5176/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Events", function() { return Events; }); 5177function Events() { 5178 return { 5179 topics: {}, 5180 on: function (eventName, fn) { 5181 this.topics[eventName] = this.topics[eventName] || []; 5182 this.topics[eventName].push(fn); 5183 }, 5184 off: function(eventName, fn) { 5185 if (this.topics[eventName]) { 5186 for (var i = 0; i < this.topics[eventName].length; i++) { 5187 if (this.topics[eventName][i] === fn) { 5188 this.topics[eventName].splice(i, 1); 5189 break; 5190 } 5191 } 5192 } 5193 }, 5194 emit: function (eventName, data) { 5195 data.type = eventName; 5196 if (this.topics[eventName]) { 5197 this.topics[eventName].forEach(function(fn) { 5198 fn(data, eventName); 5199 }); 5200 } 5201 } 5202 }; 5203}; 5204 5205/***/ }), 5206
vendor: 947 bytes, lines 5207-5240
5207/***/ "./node_modules/tiny-slider/src/helpers/extend.js": 5208/*!********************************************************!*\ 5209 !*** ./node_modules/tiny-slider/src/helpers/extend.js ***! 5210 \********************************************************/ 5211/*! exports provided: extend */ 5212/***/ (function(module, __webpack_exports__, __webpack_require__) { 5213 5214"use strict"; 5215__webpack_require__.r(__webpack_exports__); 5216/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return extend; }); 5217function extend() { 5218 var obj, name, copy, 5219 target = arguments[0] || {}, 5220 i = 1, 5221 length = arguments.length; 5222 5223 for (; i < length; i++) { 5224 if ((obj = arguments[i]) !== null) { 5225 for (name in obj) { 5226 copy = obj[name]; 5227 5228 if (target === copy) { 5229 continue; 5230 } else if (copy !== undefined) { 5231 target[name] = copy; 5232 } 5233 } 5234 } 5235 } 5236 return target; 5237} 5238 5239/***/ }), 5240
vendor: 739 bytes, lines 5241-5259
5241/***/ "./node_modules/tiny-slider/src/helpers/forEach.js": 5242/*!*********************************************************!*\ 5243 !*** ./node_modules/tiny-slider/src/helpers/forEach.js ***! 5244 \*********************************************************/ 5245/*! exports provided: forEach */ 5246/***/ (function(module, __webpack_exports__, __webpack_require__) { 5247 5248"use strict"; 5249__webpack_require__.r(__webpack_exports__); 5250/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; }); 5251// https://toddmotto.com/ditch-the-array-foreach-call-nodelist-hack/ 5252function forEach (arr, callback, scope) { 5253 for (var i = 0, l = arr.length; i < l; i++) { 5254 callback.call(scope, arr[i], i); 5255 } 5256} 5257 5258/***/ }), 5259
vendor: 600 bytes, lines 5260-5275
5260/***/ "./node_modules/tiny-slider/src/helpers/getAttr.js": 5261/*!*********************************************************!*\ 5262 !*** ./node_modules/tiny-slider/src/helpers/getAttr.js ***! 5263 \*********************************************************/ 5264/*! exports provided: getAttr */ 5265/***/ (function(module, __webpack_exports__, __webpack_require__) { 5266 5267"use strict"; 5268__webpack_require__.r(__webpack_exports__); 5269/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAttr", function() { return getAttr; }); 5270function getAttr(el, attr) { 5271 return el.getAttribute(attr); 5272} 5273 5274/***/ }), 5275
vendor: 702 bytes, lines 5276-5299
5276/***/ "./node_modules/tiny-slider/src/helpers/getBody.js": 5277/*!*********************************************************!*\ 5278 !*** ./node_modules/tiny-slider/src/helpers/getBody.js ***! 5279 \*********************************************************/ 5280/*! exports provided: getBody */ 5281/***/ (function(module, __webpack_exports__, __webpack_require__) { 5282 5283"use strict"; 5284__webpack_require__.r(__webpack_exports__); 5285/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBody", function() { return getBody; }); 5286function getBody () { 5287 var doc = document, 5288 body = doc.body; 5289 5290 if (!body) { 5291 body = doc.createElement('body'); 5292 body.fake = true; 5293 } 5294 5295 return body; 5296} 5297 5298/***/ }), 5299
vendor: 736 bytes, lines 5300-5316
5300/***/ "./node_modules/tiny-slider/src/helpers/getCssRulesLength.js": 5301/*!*******************************************************************!*\ 5302 !*** ./node_modules/tiny-slider/src/helpers/getCssRulesLength.js ***! 5303 \*******************************************************************/ 5304/*! exports provided: getCssRulesLength */ 5305/***/ (function(module, __webpack_exports__, __webpack_require__) { 5306 5307"use strict"; 5308__webpack_require__.r(__webpack_exports__); 5309/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCssRulesLength", function() { return getCssRulesLength; }); 5310function getCssRulesLength(sheet) { 5311 var rule = ('insertRule' in sheet) ? sheet.cssRules : sheet.rules; 5312 return rule.length; 5313} 5314 5315/***/ }), 5316
vendor: 1,105 bytes, lines 5317-5344
5317/***/ "./node_modules/tiny-slider/src/helpers/getEndProperty.js": 5318/*!****************************************************************!*\ 5319 !*** ./node_modules/tiny-slider/src/helpers/getEndProperty.js ***! 5320 \****************************************************************/ 5321/*! exports provided: getEndProperty */ 5322/***/ (function(module, __webpack_exports__, __webpack_require__) { 5323 5324"use strict"; 5325__webpack_require__.r(__webpack_exports__); 5326/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEndProperty", function() { return getEndProperty; }); 5327// get transitionend, animationend based on transitionDuration 5328// @propin: string 5329// @propOut: string, first-letter uppercase 5330// Usage: getEndProperty('WebkitTransitionDuration', 'Transition') => webkitTransitionEnd 5331function getEndProperty(propIn, propOut) { 5332 var endProp = false; 5333 if (/^Webkit/.test(propIn)) { 5334 endProp = 'webkit' + propOut + 'End'; 5335 } else if (/^O/.test(propIn)) { 5336 endProp = 'o' + propOut + 'End'; 5337 } else if (propIn) { 5338 endProp = propOut.toLowerCase() + 'end'; 5339 } 5340 return endProp; 5341} 5342 5343/***/ }), 5344
vendor: 678 bytes, lines 5345-5363
5345/***/ "./node_modules/tiny-slider/src/helpers/getSlideId.js": 5346/*!************************************************************!*\ 5347 !*** ./node_modules/tiny-slider/src/helpers/getSlideId.js ***! 5348 \************************************************************/ 5349/*! exports provided: getSlideId */ 5350/***/ (function(module, __webpack_exports__, __webpack_require__) { 5351 5352"use strict"; 5353__webpack_require__.r(__webpack_exports__); 5354/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSlideId", function() { return getSlideId; }); 5355function getSlideId() { 5356 var id = window.tnsId; 5357 window.tnsId = !id ? 1 : id + 1; 5358 5359 return 'tns' + window.tnsId; 5360} 5361 5362/***/ }), 5363
vendor: 867 bytes, lines 5364-5388
5364/***/ "./node_modules/tiny-slider/src/helpers/getTouchDirection.js": 5365/*!*******************************************************************!*\ 5366 !*** ./node_modules/tiny-slider/src/helpers/getTouchDirection.js ***! 5367 \*******************************************************************/ 5368/*! exports provided: getTouchDirection */ 5369/***/ (function(module, __webpack_exports__, __webpack_require__) { 5370 5371"use strict"; 5372__webpack_require__.r(__webpack_exports__); 5373/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTouchDirection", function() { return getTouchDirection; }); 5374function getTouchDirection(angle, range) { 5375 var direction = false, 5376 gap = Math.abs(90 - Math.abs(angle)); 5377 5378 if (gap >= 90 - range) { 5379 direction = 'horizontal'; 5380 } else if (gap <= range) { 5381 direction = 'vertical'; 5382 } 5383 5384 return direction; 5385} 5386 5387/***/ }), 5388
vendor: 1,957 bytes, lines 5389-5432
5389/***/ "./node_modules/tiny-slider/src/helpers/has3DTransforms.js": 5390/*!*****************************************************************!*\ 5391 !*** ./node_modules/tiny-slider/src/helpers/has3DTransforms.js ***! 5392 \*****************************************************************/ 5393/*! exports provided: has3DTransforms */ 5394/***/ (function(module, __webpack_exports__, __webpack_require__) { 5395 5396"use strict"; 5397__webpack_require__.r(__webpack_exports__); 5398/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "has3DTransforms", function() { return has3DTransforms; }); 5399/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 5400/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 5401/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 5402 5403 5404 5405 5406function has3DTransforms(tf){ 5407 if (!tf) { return false; } 5408 if (!window.getComputedStyle) { return false; } 5409 5410 var doc = document, 5411 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 5412 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 5413 el = doc.createElement('p'), 5414 has3d, 5415 cssTF = tf.length > 9 ? '-' + tf.slice(0, -9).toLowerCase() + '-' : ''; 5416 5417 cssTF += 'transform'; 5418 5419 // Add it to the body to get the computed style 5420 body.insertBefore(el, null); 5421 5422 el.style[tf] = 'translate3d(1px,1px,1px)'; 5423 has3d = window.getComputedStyle(el).getPropertyValue(cssTF); 5424 5425 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : el.remove(); 5426 5427 return (has3d !== undefined && has3d.length > 0 && has3d !== "none"); 5428} 5429 5430 5431/***/ }), 5432
vendor: 600 bytes, lines 5433-5448
5433/***/ "./node_modules/tiny-slider/src/helpers/hasAttr.js": 5434/*!*********************************************************!*\ 5435 !*** ./node_modules/tiny-slider/src/helpers/hasAttr.js ***! 5436 \*********************************************************/ 5437/*! exports provided: hasAttr */ 5438/***/ (function(module, __webpack_exports__, __webpack_require__) { 5439 5440"use strict"; 5441__webpack_require__.r(__webpack_exports__); 5442/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasAttr", function() { return hasAttr; }); 5443function hasAttr(el, attr) { 5444 return el.hasAttribute(attr); 5445} 5446 5447/***/ }), 5448
vendor: 1,162 bytes, lines 5449-5471
5449/***/ "./node_modules/tiny-slider/src/helpers/hasClass.js": 5450/*!**********************************************************!*\ 5451 !*** ./node_modules/tiny-slider/src/helpers/hasClass.js ***! 5452 \**********************************************************/ 5453/*! exports provided: classListSupport, hasClass */ 5454/***/ (function(module, __webpack_exports__, __webpack_require__) { 5455 5456"use strict"; 5457__webpack_require__.r(__webpack_exports__); 5458/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasClass", function() { return hasClass; }); 5459/* harmony import */ var _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classListSupport.js */ "./node_modules/tiny-slider/src/helpers/classListSupport.js"); 5460/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "classListSupport", function() { return _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"]; }); 5461 5462 5463 5464var hasClass = _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 5465 function (el, str) { return el.classList.contains(str); } : 5466 function (el, str) { return el.className.indexOf(str) >= 0; }; 5467 5468 5469 5470/***/ }), 5471
vendor: 671 bytes, lines 5472-5487
5472/***/ "./node_modules/tiny-slider/src/helpers/hideElement.js": 5473/*!*************************************************************!*\ 5474 !*** ./node_modules/tiny-slider/src/helpers/hideElement.js ***! 5475 \*************************************************************/ 5476/*! exports provided: hideElement */ 5477/***/ (function(module, __webpack_exports__, __webpack_require__) { 5478 5479"use strict"; 5480__webpack_require__.r(__webpack_exports__); 5481/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hideElement", function() { return hideElement; }); 5482function hideElement(el, forceHide) { 5483 if (el.style.display !== 'none') { el.style.display = 'none'; } 5484} 5485 5486/***/ }), 5487
vendor: 673 bytes, lines 5488-5504
5488/***/ "./node_modules/tiny-slider/src/helpers/isNodeList.js": 5489/*!************************************************************!*\ 5490 !*** ./node_modules/tiny-slider/src/helpers/isNodeList.js ***! 5491 \************************************************************/ 5492/*! exports provided: isNodeList */ 5493/***/ (function(module, __webpack_exports__, __webpack_require__) { 5494 5495"use strict"; 5496__webpack_require__.r(__webpack_exports__); 5497/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNodeList", function() { return isNodeList; }); 5498function isNodeList(el) { 5499 // Only NodeList has the "item()" function 5500 return typeof el.item !== "undefined"; 5501} 5502 5503/***/ }), 5504
vendor: 635 bytes, lines 5505-5520
5505/***/ "./node_modules/tiny-slider/src/helpers/isVisible.js": 5506/*!***********************************************************!*\ 5507 !*** ./node_modules/tiny-slider/src/helpers/isVisible.js ***! 5508 \***********************************************************/ 5509/*! exports provided: isVisible */ 5510/***/ (function(module, __webpack_exports__, __webpack_require__) { 5511 5512"use strict"; 5513__webpack_require__.r(__webpack_exports__); 5514/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isVisible", function() { return isVisible; }); 5515function isVisible(el) { 5516 return window.getComputedStyle(el).display !== 'none'; 5517} 5518 5519/***/ }), 5520
vendor: 1,205 bytes, lines 5521-5553
5521/***/ "./node_modules/tiny-slider/src/helpers/jsTransform.js": 5522/*!*************************************************************!*\ 5523 !*** ./node_modules/tiny-slider/src/helpers/jsTransform.js ***! 5524 \*************************************************************/ 5525/*! exports provided: jsTransform */ 5526/***/ (function(module, __webpack_exports__, __webpack_require__) { 5527 5528"use strict"; 5529__webpack_require__.r(__webpack_exports__); 5530/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jsTransform", function() { return jsTransform; }); 5531function jsTransform(element, attr, prefix, postfix, to, duration, callback) { 5532 var tick = Math.min(duration, 10), 5533 unit = (to.indexOf('%') >= 0) ? '%' : 'px', 5534 to = to.replace(unit, ''), 5535 from = Number(element.style[attr].replace(prefix, '').replace(postfix, '').replace(unit, '')), 5536 positionTick = (to - from) / duration * tick, 5537 running; 5538 5539 setTimeout(moveElement, tick); 5540 function moveElement() { 5541 duration -= tick; 5542 from += positionTick; 5543 element.style[attr] = prefix + from + unit + postfix; 5544 if (duration > 0) { 5545 setTimeout(moveElement, tick); 5546 } else { 5547 callback(); 5548 } 5549 } 5550} 5551 5552/***/ }), 5553
vendor: 2,114 bytes, lines 5554-5605
5554/***/ "./node_modules/tiny-slider/src/helpers/mediaquerySupport.js": 5555/*!*******************************************************************!*\ 5556 !*** ./node_modules/tiny-slider/src/helpers/mediaquerySupport.js ***! 5557 \*******************************************************************/ 5558/*! exports provided: mediaquerySupport */ 5559/***/ (function(module, __webpack_exports__, __webpack_require__) { 5560 5561"use strict"; 5562__webpack_require__.r(__webpack_exports__); 5563/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mediaquerySupport", function() { return mediaquerySupport; }); 5564/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 5565/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 5566/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 5567 5568 5569 5570 5571function mediaquerySupport () { 5572 if (window.matchMedia || window.msMatchMedia) { 5573 return true; 5574 } 5575 5576 var doc = document, 5577 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 5578 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 5579 div = doc.createElement('div'), 5580 style = doc.createElement('style'), 5581 rule = '@media all and (min-width:1px){.tns-mq-test{position:absolute}}', 5582 position; 5583 5584 style.type = 'text/css'; 5585 div.className = 'tns-mq-test'; 5586 5587 body.appendChild(style); 5588 body.appendChild(div); 5589 5590 if (style.styleSheet) { 5591 style.styleSheet.cssText = rule; 5592 } else { 5593 style.appendChild(doc.createTextNode(rule)); 5594 } 5595 5596 position = window.getComputedStyle ? window.getComputedStyle(div).position : div.currentStyle['position']; 5597 5598 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : div.remove(); 5599 5600 return position === "absolute"; 5601} 5602 5603 5604/***/ }), 5605
vendor: 943 bytes, lines 5606-5629
5606/***/ "./node_modules/tiny-slider/src/helpers/passiveOption.js": 5607/*!***************************************************************!*\ 5608 !*** ./node_modules/tiny-slider/src/helpers/passiveOption.js ***! 5609 \***************************************************************/ 5610/*! exports provided: passiveOption */ 5611/***/ (function(module, __webpack_exports__, __webpack_require__) { 5612 5613"use strict"; 5614__webpack_require__.r(__webpack_exports__); 5615/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "passiveOption", function() { return passiveOption; }); 5616// Test via a getter in the options object to see if the passive property is accessed 5617var supportsPassive = false; 5618try { 5619 var opts = Object.defineProperty({}, 'passive', { 5620 get: function() { 5621 supportsPassive = true; 5622 } 5623 }); 5624 window.addEventListener("test", null, opts); 5625} catch (e) {} 5626var passiveOption = supportsPassive ? { passive: true } : false; 5627 5628/***/ }), 5629
vendor: 2,093 bytes, lines 5630-5680
5630/***/ "./node_modules/tiny-slider/src/helpers/percentageLayout.js": 5631/*!******************************************************************!*\ 5632 !*** ./node_modules/tiny-slider/src/helpers/percentageLayout.js ***! 5633 \******************************************************************/ 5634/*! exports provided: percentageLayout */ 5635/***/ (function(module, __webpack_exports__, __webpack_require__) { 5636 5637"use strict"; 5638__webpack_require__.r(__webpack_exports__); 5639/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "percentageLayout", function() { return percentageLayout; }); 5640/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 5641/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 5642/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 5643// get subpixel support value 5644// @return - boolean 5645 5646 5647 5648 5649function percentageLayout() { 5650 // check subpixel layout supporting 5651 var doc = document, 5652 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 5653 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 5654 wrapper = doc.createElement('div'), 5655 outer = doc.createElement('div'), 5656 str = '', 5657 count = 70, 5658 perPage = 3, 5659 supported = false; 5660 5661 wrapper.className = "tns-t-subp2"; 5662 outer.className = "tns-t-ct"; 5663 5664 for (var i = 0; i < count; i++) { 5665 str += '<div></div>'; 5666 } 5667 5668 outer.innerHTML = str; 5669 wrapper.appendChild(outer); 5670 body.appendChild(wrapper); 5671 5672 supported = Math.abs(wrapper.getBoundingClientRect().left - outer.children[count - perPage].getBoundingClientRect().left) < 2; 5673 5674 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : wrapper.remove(); 5675 5676 return supported; 5677} 5678 5679/***/ }), 5680
vendor: 719 bytes, lines 5681-5701
5681/***/ "./node_modules/tiny-slider/src/helpers/raf.js": 5682/*!*****************************************************!*\ 5683 !*** ./node_modules/tiny-slider/src/helpers/raf.js ***! 5684 \*****************************************************/ 5685/*! exports provided: raf */ 5686/***/ (function(module, __webpack_exports__, __webpack_require__) { 5687 5688"use strict"; 5689__webpack_require__.r(__webpack_exports__); 5690/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "raf", function() { return raf; }); 5691var win = window; 5692 5693var raf = win.requestAnimationFrame 5694 || win.webkitRequestAnimationFrame 5695 || win.mozRequestAnimationFrame 5696 || win.msRequestAnimationFrame 5697 || function(cb) { return setTimeout(cb, 16); }; 5698 5699 5700/***/ }), 5701
vendor: 1,105 bytes, lines 5702-5728
5702/***/ "./node_modules/tiny-slider/src/helpers/removeAttrs.js": 5703/*!*************************************************************!*\ 5704 !*** ./node_modules/tiny-slider/src/helpers/removeAttrs.js ***! 5705 \*************************************************************/ 5706/*! exports provided: removeAttrs */ 5707/***/ (function(module, __webpack_exports__, __webpack_require__) { 5708 5709"use strict"; 5710__webpack_require__.r(__webpack_exports__); 5711/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAttrs", function() { return removeAttrs; }); 5712/* harmony import */ var _isNodeList_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isNodeList.js */ "./node_modules/tiny-slider/src/helpers/isNodeList.js"); 5713 5714 5715function removeAttrs(els, attrs) { 5716 els = (Object(_isNodeList_js__WEBPACK_IMPORTED_MODULE_0__["isNodeList"])(els) || els instanceof Array) ? els : [els]; 5717 attrs = (attrs instanceof Array) ? attrs : [attrs]; 5718 5719 var attrLength = attrs.length; 5720 for (var i = els.length; i--;) { 5721 for (var j = attrLength; j--;) { 5722 els[i].removeAttribute(attrs[j]); 5723 } 5724 } 5725} 5726 5727/***/ }), 5728
vendor: 933 bytes, lines 5729-5751
5729/***/ "./node_modules/tiny-slider/src/helpers/removeCSSRule.js": 5730/*!***************************************************************!*\ 5731 !*** ./node_modules/tiny-slider/src/helpers/removeCSSRule.js ***! 5732 \***************************************************************/ 5733/*! exports provided: removeCSSRule */ 5734/***/ (function(module, __webpack_exports__, __webpack_require__) { 5735 5736"use strict"; 5737__webpack_require__.r(__webpack_exports__); 5738/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCSSRule", function() { return removeCSSRule; }); 5739/* harmony import */ var _raf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 5740// cross browsers addRule method 5741 5742function removeCSSRule(sheet, index) { 5743 // return raf(function() { 5744 'deleteRule' in sheet ? 5745 sheet.deleteRule(index) : 5746 sheet.removeRule(index); 5747 // }); 5748} 5749 5750/***/ }), 5751
vendor: 1,125 bytes, lines 5752-5775
5752/***/ "./node_modules/tiny-slider/src/helpers/removeClass.js": 5753/*!*************************************************************!*\ 5754 !*** ./node_modules/tiny-slider/src/helpers/removeClass.js ***! 5755 \*************************************************************/ 5756/*! exports provided: removeClass */ 5757/***/ (function(module, __webpack_exports__, __webpack_require__) { 5758 5759"use strict"; 5760__webpack_require__.r(__webpack_exports__); 5761/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeClass", function() { return removeClass; }); 5762/* harmony import */ var _hasClass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 5763 5764var removeClass = _hasClass_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 5765 function (el, str) { 5766 if (Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.classList.remove(str); } 5767 } : 5768 function (el, str) { 5769 if (Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.className = el.className.replace(str, ''); } 5770 }; 5771 5772 5773 5774/***/ }), 5775
vendor: 1,011 bytes, lines 5776-5797
5776/***/ "./node_modules/tiny-slider/src/helpers/removeEvents.js": 5777/*!**************************************************************!*\ 5778 !*** ./node_modules/tiny-slider/src/helpers/removeEvents.js ***! 5779 \**************************************************************/ 5780/*! exports provided: removeEvents */ 5781/***/ (function(module, __webpack_exports__, __webpack_require__) { 5782 5783"use strict"; 5784__webpack_require__.r(__webpack_exports__); 5785/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEvents", function() { return removeEvents; }); 5786/* harmony import */ var _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./passiveOption.js */ "./node_modules/tiny-slider/src/helpers/passiveOption.js"); 5787 5788 5789function removeEvents(el, obj) { 5790 for (var prop in obj) { 5791 var option = ['touchstart', 'touchmove'].indexOf(prop) >= 0 ? _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__["passiveOption"] : false; 5792 el.removeEventListener(prop, obj[prop], option); 5793 } 5794} 5795 5796/***/ }), 5797
vendor: 1,108 bytes, lines 5798-5822
5798/***/ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js": 5799/*!***************************************************************!*\ 5800 !*** ./node_modules/tiny-slider/src/helpers/resetFakeBody.js ***! 5801 \***************************************************************/ 5802/*! exports provided: resetFakeBody */ 5803/***/ (function(module, __webpack_exports__, __webpack_require__) { 5804 5805"use strict"; 5806__webpack_require__.r(__webpack_exports__); 5807/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resetFakeBody", function() { return resetFakeBody; }); 5808/* harmony import */ var _docElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./docElement.js */ "./node_modules/tiny-slider/src/helpers/docElement.js"); 5809 5810 5811function resetFakeBody (body, docOverflow) { 5812 if (body.fake) { 5813 body.remove(); 5814 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow = docOverflow; 5815 // Trigger layout so kinetic scrolling isn't disabled in iOS6+ 5816 // eslint-disable-next-line 5817 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].offsetHeight; 5818 } 5819} 5820 5821/***/ }), 5822
vendor: 1,068 bytes, lines 5823-5848
5823/***/ "./node_modules/tiny-slider/src/helpers/setAttrs.js": 5824/*!**********************************************************!*\ 5825 !*** ./node_modules/tiny-slider/src/helpers/setAttrs.js ***! 5826 \**********************************************************/ 5827/*! exports provided: setAttrs */ 5828/***/ (function(module, __webpack_exports__, __webpack_require__) { 5829 5830"use strict"; 5831__webpack_require__.r(__webpack_exports__); 5832/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAttrs", function() { return setAttrs; }); 5833/* harmony import */ var _isNodeList_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isNodeList.js */ "./node_modules/tiny-slider/src/helpers/isNodeList.js"); 5834 5835 5836function setAttrs(els, attrs) { 5837 els = (Object(_isNodeList_js__WEBPACK_IMPORTED_MODULE_0__["isNodeList"])(els) || els instanceof Array) ? els : [els]; 5838 if (Object.prototype.toString.call(attrs) !== '[object Object]') { return; } 5839 5840 for (var i = els.length; i--;) { 5841 for(var key in attrs) { 5842 els[i].setAttribute(key, attrs[key]); 5843 } 5844 } 5845} 5846 5847/***/ }), 5848
vendor: 1,310 bytes, lines 5849-5877
5849/***/ "./node_modules/tiny-slider/src/helpers/setFakeBody.js": 5850/*!*************************************************************!*\ 5851 !*** ./node_modules/tiny-slider/src/helpers/setFakeBody.js ***! 5852 \*************************************************************/ 5853/*! exports provided: setFakeBody */ 5854/***/ (function(module, __webpack_exports__, __webpack_require__) { 5855 5856"use strict"; 5857__webpack_require__.r(__webpack_exports__); 5858/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setFakeBody", function() { return setFakeBody; }); 5859/* harmony import */ var _docElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./docElement.js */ "./node_modules/tiny-slider/src/helpers/docElement.js"); 5860 5861 5862function setFakeBody (body) { 5863 var docOverflow = ''; 5864 if (body.fake) { 5865 docOverflow = _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow; 5866 //avoid crashing IE8, if background image is used 5867 body.style.background = ''; 5868 //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible 5869 body.style.overflow = _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow = 'hidden'; 5870 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].appendChild(body); 5871 } 5872 5873 return docOverflow; 5874} 5875 5876/***/ }), 5877
vendor: 741 bytes, lines 5878-5896
5878/***/ "./node_modules/tiny-slider/src/helpers/setLocalStorage.js": 5879/*!*****************************************************************!*\ 5880 !*** ./node_modules/tiny-slider/src/helpers/setLocalStorage.js ***! 5881 \*****************************************************************/ 5882/*! exports provided: setLocalStorage */ 5883/***/ (function(module, __webpack_exports__, __webpack_require__) { 5884 5885"use strict"; 5886__webpack_require__.r(__webpack_exports__); 5887/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLocalStorage", function() { return setLocalStorage; }); 5888function setLocalStorage(storage, key, value, access) { 5889 if (access) { 5890 try { storage.setItem(key, value); } catch (e) {} 5891 } 5892 return value; 5893} 5894 5895/***/ }), 5896
vendor: 667 bytes, lines 5897-5912
5897/***/ "./node_modules/tiny-slider/src/helpers/showElement.js": 5898/*!*************************************************************!*\ 5899 !*** ./node_modules/tiny-slider/src/helpers/showElement.js ***! 5900 \*************************************************************/ 5901/*! exports provided: showElement */ 5902/***/ (function(module, __webpack_exports__, __webpack_require__) { 5903 5904"use strict"; 5905__webpack_require__.r(__webpack_exports__); 5906/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showElement", function() { return showElement; }); 5907function showElement(el, forceHide) { 5908 if (el.style.display === 'none') { el.style.display = ''; } 5909} 5910 5911/***/ }), 5912
vendor: 618 bytes, lines 5913-5928
5913/***/ "./node_modules/tiny-slider/src/helpers/toDegree.js": 5914/*!**********************************************************!*\ 5915 !*** ./node_modules/tiny-slider/src/helpers/toDegree.js ***! 5916 \**********************************************************/ 5917/*! exports provided: toDegree */ 5918/***/ (function(module, __webpack_exports__, __webpack_require__) { 5919 5920"use strict"; 5921__webpack_require__.r(__webpack_exports__); 5922/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDegree", function() { return toDegree; }); 5923function toDegree (y, x) { 5924 return Math.atan2(y, x) * (180 / Math.PI); 5925} 5926 5927/***/ }), 5928
vendor: 1,200 bytes, lines 5929-5966
5929/***/ "./node_modules/tiny-slider/src/helpers/whichProperty.js": 5930/*!***************************************************************!*\ 5931 !*** ./node_modules/tiny-slider/src/helpers/whichProperty.js ***! 5932 \***************************************************************/ 5933/*! exports provided: whichProperty */ 5934/***/ (function(module, __webpack_exports__, __webpack_require__) { 5935 5936"use strict"; 5937__webpack_require__.r(__webpack_exports__); 5938/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "whichProperty", function() { return whichProperty; }); 5939function whichProperty(props){ 5940 if (typeof props === 'string') { 5941 var arr = [props], 5942 Props = props.charAt(0).toUpperCase() + props.substr(1), 5943 prefixes = ['Webkit', 'Moz', 'ms', 'O']; 5944 5945 prefixes.forEach(function(prefix) { 5946 if (prefix !== 'ms' || props === 'transform') { 5947 arr.push(prefix + Props); 5948 } 5949 }); 5950 5951 props = arr; 5952 } 5953 5954 var el = document.createElement('fakeelement'), 5955 len = props.length; 5956 for(var i = 0; i < props.length; i++){ 5957 var prop = props[i]; 5958 if( el.style[prop] !== undefined ){ return prop; } 5959 } 5960 5961 return false; // explicit for ie9- 5962} 5963 5964 5965/***/ }), 5966
vendor: 109,421 bytes, lines 5967-8780
5967/***/ "./node_modules/tiny-slider/src/tiny-slider.js": 5968/*!*****************************************************!*\ 5969 !*** ./node_modules/tiny-slider/src/tiny-slider.js ***! 5970 \*****************************************************/ 5971/*! exports provided: tns */ 5972/***/ (function(module, __webpack_exports__, __webpack_require__) { 5973 5974"use strict"; 5975__webpack_require__.r(__webpack_exports__); 5976/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tns", function() { return tns; }); 5977/* harmony import */ var _helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 5978/* harmony import */ var _helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/caf.js */ "./node_modules/tiny-slider/src/helpers/caf.js"); 5979/* harmony import */ var _helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers/extend.js */ "./node_modules/tiny-slider/src/helpers/extend.js"); 5980/* harmony import */ var _helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers/checkStorageValue.js */ "./node_modules/tiny-slider/src/helpers/checkStorageValue.js"); 5981/* harmony import */ var _helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers/setLocalStorage.js */ "./node_modules/tiny-slider/src/helpers/setLocalStorage.js"); 5982/* harmony import */ var _helpers_getSlideId_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/getSlideId.js */ "./node_modules/tiny-slider/src/helpers/getSlideId.js"); 5983/* harmony import */ var _helpers_calc_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers/calc.js */ "./node_modules/tiny-slider/src/helpers/calc.js"); 5984/* harmony import */ var _helpers_percentageLayout_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers/percentageLayout.js */ "./node_modules/tiny-slider/src/helpers/percentageLayout.js"); 5985/* harmony import */ var _helpers_mediaquerySupport_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers/mediaquerySupport.js */ "./node_modules/tiny-slider/src/helpers/mediaquerySupport.js"); 5986/* harmony import */ var _helpers_createStyleSheet_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/createStyleSheet.js */ "./node_modules/tiny-slider/src/helpers/createStyleSheet.js"); 5987/* harmony import */ var _helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./helpers/addCSSRule.js */ "./node_modules/tiny-slider/src/helpers/addCSSRule.js"); 5988/* harmony import */ var _helpers_removeCSSRule_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/removeCSSRule.js */ "./node_modules/tiny-slider/src/helpers/removeCSSRule.js"); 5989/* harmony import */ var _helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/getCssRulesLength.js */ "./node_modules/tiny-slider/src/helpers/getCssRulesLength.js"); 5990/* harmony import */ var _helpers_toDegree_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./helpers/toDegree.js */ "./node_modules/tiny-slider/src/helpers/toDegree.js"); 5991/* harmony import */ var _helpers_getTouchDirection_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./helpers/getTouchDirection.js */ "./node_modules/tiny-slider/src/helpers/getTouchDirection.js"); 5992/* harmony import */ var _helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./helpers/forEach.js */ "./node_modules/tiny-slider/src/helpers/forEach.js"); 5993/* harmony import */ var _helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./helpers/hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 5994/* harmony import */ var _helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./helpers/addClass.js */ "./node_modules/tiny-slider/src/helpers/addClass.js"); 5995/* harmony import */ var _helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./helpers/removeClass.js */ "./node_modules/tiny-slider/src/helpers/removeClass.js"); 5996/* harmony import */ var _helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./helpers/hasAttr.js */ "./node_modules/tiny-slider/src/helpers/hasAttr.js"); 5997/* harmony import */ var _helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./helpers/getAttr.js */ "./node_modules/tiny-slider/src/helpers/getAttr.js"); 5998/* harmony import */ var _helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./helpers/setAttrs.js */ "./node_modules/tiny-slider/src/helpers/setAttrs.js"); 5999/* harmony import */ var _helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./helpers/removeAttrs.js */ "./node_modules/tiny-slider/src/helpers/removeAttrs.js"); 6000/* harmony import */ var _helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./helpers/arrayFromNodeList.js */ "./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js"); 6001/* harmony import */ var _helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./helpers/hideElement.js */ "./node_modules/tiny-slider/src/helpers/hideElement.js"); 6002/* harmony import */ var _helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./helpers/showElement.js */ "./node_modules/tiny-slider/src/helpers/showElement.js"); 6003/* harmony import */ var _helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./helpers/isVisible.js */ "./node_modules/tiny-slider/src/helpers/isVisible.js"); 6004/* harmony import */ var _helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./helpers/whichProperty.js */ "./node_modules/tiny-slider/src/helpers/whichProperty.js"); 6005/* harmony import */ var _helpers_has3DTransforms_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./helpers/has3DTransforms.js */ "./node_modules/tiny-slider/src/helpers/has3DTransforms.js"); 6006/* harmony import */ var _helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./helpers/getEndProperty.js */ "./node_modules/tiny-slider/src/helpers/getEndProperty.js"); 6007/* harmony import */ var _helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./helpers/addEvents.js */ "./node_modules/tiny-slider/src/helpers/addEvents.js"); 6008/* harmony import */ var _helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./helpers/removeEvents.js */ "./node_modules/tiny-slider/src/helpers/removeEvents.js"); 6009/* harmony import */ var _helpers_events_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./helpers/events.js */ "./node_modules/tiny-slider/src/helpers/events.js"); 6010/* harmony import */ var _helpers_jsTransform_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./helpers/jsTransform.js */ "./node_modules/tiny-slider/src/helpers/jsTransform.js"); 6011// Object.keys 6012if (!Object.keys) { 6013 Object.keys = function(object) { 6014 var keys = []; 6015 for (var name in object) { 6016 if (Object.prototype.hasOwnProperty.call(object, name)) { 6017 keys.push(name); 6018 } 6019 } 6020 return keys; 6021 }; 6022} 6023 6024// ChildNode.remove 6025if(!("remove" in Element.prototype)){ 6026 Element.prototype.remove = function(){ 6027 if(this.parentNode) { 6028 this.parentNode.removeChild(this); 6029 } 6030 }; 6031} 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068var tns = function(options) { 6069 options = Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__["extend"])({ 6070 container: '.slider', 6071 mode: 'carousel', 6072 axis: 'horizontal', 6073 items: 1, 6074 gutter: 0, 6075 edgePadding: 0, 6076 fixedWidth: false, 6077 autoWidth: false, 6078 viewportMax: false, 6079 slideBy: 1, 6080 center: false, 6081 controls: true, 6082 controlsPosition: 'top', 6083 controlsText: ['prev', 'next'], 6084 controlsContainer: false, 6085 prevButton: false, 6086 nextButton: false, 6087 nav: true, 6088 navPosition: 'top', 6089 navContainer: false, 6090 navAsThumbnails: false, 6091 arrowKeys: false, 6092 speed: 300, 6093 autoplay: false, 6094 autoplayPosition: 'top', 6095 autoplayTimeout: 5000, 6096 autoplayDirection: 'forward', 6097 autoplayText: ['start', 'stop'], 6098 autoplayHoverPause: false, 6099 autoplayButton: false, 6100 autoplayButtonOutput: true, 6101 autoplayResetOnVisibility: true, 6102 animateIn: 'tns-fadeIn', 6103 animateOut: 'tns-fadeOut', 6104 animateNormal: 'tns-normal', 6105 animateDelay: false, 6106 loop: true, 6107 rewind: false, 6108 autoHeight: false, 6109 responsive: false, 6110 lazyload: false, 6111 lazyloadSelector: '.tns-lazy-img', 6112 touch: true, 6113 mouseDrag: false, 6114 swipeAngle: 15, 6115 nested: false, 6116 preventActionWhenRunning: false, 6117 preventScrollOnTouch: false, 6118 freezable: true, 6119 onInit: false, 6120 useLocalStorage: true, 6121 nonce: false 6122 }, options || {}); 6123 6124 var doc = document, 6125 win = window, 6126 KEYS = { 6127 ENTER: 13, 6128 SPACE: 32, 6129 LEFT: 37, 6130 RIGHT: 39 6131 }, 6132 tnsStorage = {}, 6133 localStorageAccess = options.useLocalStorage; 6134 6135 if (localStorageAccess) { 6136 // check browser version and local storage access 6137 var browserInfo = navigator.userAgent; 6138 var uid = new Date; 6139 6140 try { 6141 tnsStorage = win.localStorage; 6142 if (tnsStorage) { 6143 tnsStorage.setItem(uid, uid); 6144 localStorageAccess = tnsStorage.getItem(uid) == uid; 6145 tnsStorage.removeItem(uid); 6146 } else { 6147 localStorageAccess = false; 6148 } 6149 if (!localStorageAccess) { tnsStorage = {}; } 6150 } catch(e) { 6151 localStorageAccess = false; 6152 } 6153 6154 if (localStorageAccess) { 6155 // remove storage when browser version changes 6156 if (tnsStorage['tnsApp'] && tnsStorage['tnsApp'] !== browserInfo) { 6157 ['tC', 'tPL', 'tMQ', 'tTf', 't3D', 'tTDu', 'tTDe', 'tADu', 'tADe', 'tTE', 'tAE'].forEach(function(item) { tnsStorage.removeItem(item); }); 6158 } 6159 // update browserInfo 6160 localStorage['tnsApp'] = browserInfo; 6161 } 6162 } 6163 6164 var CALC = tnsStorage['tC'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tC']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tC', Object(_helpers_calc_js__WEBPACK_IMPORTED_MODULE_6__["calc"])(), localStorageAccess), 6165 PERCENTAGELAYOUT = tnsStorage['tPL'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tPL']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tPL', Object(_helpers_percentageLayout_js__WEBPACK_IMPORTED_MODULE_7__["percentageLayout"])(), localStorageAccess), 6166 CSSMQ = tnsStorage['tMQ'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tMQ']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tMQ', Object(_helpers_mediaquerySupport_js__WEBPACK_IMPORTED_MODULE_8__["mediaquerySupport"])(), localStorageAccess), 6167 TRANSFORM = tnsStorage['tTf'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTf']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTf', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('transform'), localStorageAccess), 6168 HAS3DTRANSFORMS = tnsStorage['t3D'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['t3D']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 't3D', Object(_helpers_has3DTransforms_js__WEBPACK_IMPORTED_MODULE_28__["has3DTransforms"])(TRANSFORM), localStorageAccess), 6169 TRANSITIONDURATION = tnsStorage['tTDu'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTDu']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTDu', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('transitionDuration'), localStorageAccess), 6170 TRANSITIONDELAY = tnsStorage['tTDe'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTDe']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTDe', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('transitionDelay'), localStorageAccess), 6171 ANIMATIONDURATION = tnsStorage['tADu'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tADu']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tADu', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('animationDuration'), localStorageAccess), 6172 ANIMATIONDELAY = tnsStorage['tADe'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tADe']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tADe', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('animationDelay'), localStorageAccess), 6173 TRANSITIONEND = tnsStorage['tTE'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTE']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTE', Object(_helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_29__["getEndProperty"])(TRANSITIONDURATION, 'Transition'), localStorageAccess), 6174 ANIMATIONEND = tnsStorage['tAE'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tAE']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tAE', Object(_helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_29__["getEndProperty"])(ANIMATIONDURATION, 'Animation'), localStorageAccess); 6175 6176 // get element nodes from selectors 6177 var supportConsoleWarn = win.console && typeof win.console.warn === "function", 6178 tnsList = ['container', 'controlsContainer', 'prevButton', 'nextButton', 'navContainer', 'autoplayButton'], 6179 optionsElements = {}; 6180 6181 tnsList.forEach(function(item) { 6182 if (typeof options[item] === 'string') { 6183 var str = options[item], 6184 el = doc.querySelector(str); 6185 optionsElements[item] = str; 6186 6187 if (el && el.nodeName) { 6188 options[item] = el; 6189 } else { 6190 if (supportConsoleWarn) { console.warn('Can\'t find', options[item]); } 6191 return; 6192 } 6193 } 6194 }); 6195 6196 // make sure at least 1 slide 6197 if (options.container.children.length < 1) { 6198 if (supportConsoleWarn) { console.warn('No slides found in', options.container); } 6199 return; 6200 } 6201 6202 // update options 6203 var responsive = options.responsive, 6204 nested = options.nested, 6205 carousel = options.mode === 'carousel' ? true : false; 6206 6207 if (responsive) { 6208 // apply responsive[0] to options and remove it 6209 if (0 in responsive) { 6210 options = Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__["extend"])(options, responsive[0]); 6211 delete responsive[0]; 6212 } 6213 6214 var responsiveTem = {}; 6215 for (var key in responsive) { 6216 var val = responsive[key]; 6217 // update responsive 6218 // from: 300: 2 6219 // to: 6220 // 300: { 6221 // items: 2 6222 // } 6223 val = typeof val === 'number' ? {items: val} : val; 6224 responsiveTem[key] = val; 6225 } 6226 responsive = responsiveTem; 6227 responsiveTem = null; 6228 } 6229 6230 // update options 6231 function updateOptions (obj) { 6232 for (var key in obj) { 6233 if (!carousel) { 6234 if (key === 'slideBy') { obj[key] = 'page'; } 6235 if (key === 'edgePadding') { obj[key] = false; } 6236 if (key === 'autoHeight') { obj[key] = false; } 6237 } 6238 6239 // update responsive options 6240 if (key === 'responsive') { updateOptions(obj[key]); } 6241 } 6242 } 6243 if (!carousel) { updateOptions(options); } 6244 6245 6246 // === define and set variables === 6247 if (!carousel) { 6248 options.axis = 'horizontal'; 6249 options.slideBy = 'page'; 6250 options.edgePadding = false; 6251 6252 var animateIn = options.animateIn, 6253 animateOut = options.animateOut, 6254 animateDelay = options.animateDelay, 6255 animateNormal = options.animateNormal; 6256 } 6257 6258 var horizontal = options.axis === 'horizontal' ? true : false, 6259 outerWrapper = doc.createElement('div'), 6260 innerWrapper = doc.createElement('div'), 6261 middleWrapper, 6262 container = options.container, 6263 containerParent = container.parentNode, 6264 containerHTML = container.outerHTML, 6265 slideItems = container.children, 6266 slideCount = slideItems.length, 6267 breakpointZone, 6268 windowWidth = getWindowWidth(), 6269 isOn = false; 6270 if (responsive) { setBreakpointZone(); } 6271 if (carousel) { container.className += ' tns-vpfix'; } 6272 6273 // fixedWidth: viewport > rightBoundary > indexMax 6274 var autoWidth = options.autoWidth, 6275 fixedWidth = getOption('fixedWidth'), 6276 edgePadding = getOption('edgePadding'), 6277 gutter = getOption('gutter'), 6278 viewport = getViewportWidth(), 6279 center = getOption('center'), 6280 items = !autoWidth ? Math.floor(getOption('items')) : 1, 6281 slideBy = getOption('slideBy'), 6282 viewportMax = options.viewportMax || options.fixedWidthViewportWidth, 6283 arrowKeys = getOption('arrowKeys'), 6284 speed = getOption('speed'), 6285 rewind = options.rewind, 6286 loop = rewind ? false : options.loop, 6287 autoHeight = getOption('autoHeight'), 6288 controls = getOption('controls'), 6289 controlsText = getOption('controlsText'), 6290 nav = getOption('nav'), 6291 touch = getOption('touch'), 6292 mouseDrag = getOption('mouseDrag'), 6293 autoplay = getOption('autoplay'), 6294 autoplayTimeout = getOption('autoplayTimeout'), 6295 autoplayText = getOption('autoplayText'), 6296 autoplayHoverPause = getOption('autoplayHoverPause'), 6297 autoplayResetOnVisibility = getOption('autoplayResetOnVisibility'), 6298 sheet = Object(_helpers_createStyleSheet_js__WEBPACK_IMPORTED_MODULE_9__["createStyleSheet"])(null, getOption('nonce')), 6299 lazyload = options.lazyload, 6300 lazyloadSelector = options.lazyloadSelector, 6301 slidePositions, // collection of slide positions 6302 slideItemsOut = [], 6303 cloneCount = loop ? getCloneCountForLoop() : 0, 6304 slideCountNew = !carousel ? slideCount + cloneCount : slideCount + cloneCount * 2, 6305 hasRightDeadZone = (fixedWidth || autoWidth) && !loop ? true : false, 6306 rightBoundary = fixedWidth ? getRightBoundary() : null, 6307 updateIndexBeforeTransform = (!carousel || !loop) ? true : false, 6308 // transform 6309 transformAttr = horizontal ? 'left' : 'top', 6310 transformPrefix = '', 6311 transformPostfix = '', 6312 // index 6313 getIndexMax = (function () { 6314 if (fixedWidth) { 6315 return function() { return center && !loop ? slideCount - 1 : Math.ceil(- rightBoundary / (fixedWidth + gutter)); }; 6316 } else if (autoWidth) { 6317 return function() { 6318 for (var i = 0; i < slideCountNew; i++) { 6319 if (slidePositions[i] >= - rightBoundary) { return i; } 6320 } 6321 }; 6322 } else { 6323 return function() { 6324 if (center && carousel && !loop) { 6325 return slideCount - 1; 6326 } else { 6327 return loop || carousel ? Math.max(0, slideCountNew - Math.ceil(items)) : slideCountNew - 1; 6328 } 6329 }; 6330 } 6331 })(), 6332 index = getStartIndex(getOption('startIndex')), 6333 indexCached = index, 6334 displayIndex = getCurrentSlide(), 6335 indexMin = 0, 6336 indexMax = !autoWidth ? getIndexMax() : null, 6337 // resize 6338 resizeTimer, 6339 preventActionWhenRunning = options.preventActionWhenRunning, 6340 swipeAngle = options.swipeAngle, 6341 moveDirectionExpected = swipeAngle ? '?' : true, 6342 running = false, 6343 onInit = options.onInit, 6344 events = new _helpers_events_js__WEBPACK_IMPORTED_MODULE_32__["Events"](), 6345 // id, class 6346 newContainerClasses = ' tns-slider tns-' + options.mode, 6347 slideId = container.id || Object(_helpers_getSlideId_js__WEBPACK_IMPORTED_MODULE_5__["getSlideId"])(), 6348 disable = getOption('disable'), 6349 disabled = false, 6350 freezable = options.freezable, 6351 freeze = freezable && !autoWidth ? getFreeze() : false, 6352 frozen = false, 6353 controlsEvents = { 6354 'click': onControlsClick, 6355 'keydown': onControlsKeydown 6356 }, 6357 navEvents = { 6358 'click': onNavClick, 6359 'keydown': onNavKeydown 6360 }, 6361 hoverEvents = { 6362 'mouseover': mouseoverPause, 6363 'mouseout': mouseoutRestart 6364 }, 6365 visibilityEvent = {'visibilitychange': onVisibilityChange}, 6366 docmentKeydownEvent = {'keydown': onDocumentKeydown}, 6367 touchEvents = { 6368 'touchstart': onPanStart, 6369 'touchmove': onPanMove, 6370 'touchend': onPanEnd, 6371 'touchcancel': onPanEnd 6372 }, dragEvents = { 6373 'mousedown': onPanStart, 6374 'mousemove': onPanMove, 6375 'mouseup': onPanEnd, 6376 'mouseleave': onPanEnd 6377 }, 6378 hasControls = hasOption('controls'), 6379 hasNav = hasOption('nav'), 6380 navAsThumbnails = autoWidth ? true : options.navAsThumbnails, 6381 hasAutoplay = hasOption('autoplay'), 6382 hasTouch = hasOption('touch'), 6383 hasMouseDrag = hasOption('mouseDrag'), 6384 slideActiveClass = 'tns-slide-active', 6385 slideClonedClass = 'tns-slide-cloned', 6386 imgCompleteClass = 'tns-complete', 6387 imgEvents = { 6388 'load': onImgLoaded, 6389 'error': onImgFailed 6390 }, 6391 imgsComplete, 6392 liveregionCurrent, 6393 preventScroll = options.preventScrollOnTouch === 'force' ? true : false; 6394 6395 // controls 6396 if (hasControls) { 6397 var controlsContainer = options.controlsContainer, 6398 controlsContainerHTML = options.controlsContainer ? options.controlsContainer.outerHTML : '', 6399 prevButton = options.prevButton, 6400 nextButton = options.nextButton, 6401 prevButtonHTML = options.prevButton ? options.prevButton.outerHTML : '', 6402 nextButtonHTML = options.nextButton ? options.nextButton.outerHTML : '', 6403 prevIsButton, 6404 nextIsButton; 6405 } 6406 6407 // nav 6408 if (hasNav) { 6409 var navContainer = options.navContainer, 6410 navContainerHTML = options.navContainer ? options.navContainer.outerHTML : '', 6411 navItems, 6412 pages = autoWidth ? slideCount : getPages(), 6413 pagesCached = 0, 6414 navClicked = -1, 6415 navCurrentIndex = getCurrentNavIndex(), 6416 navCurrentIndexCached = navCurrentIndex, 6417 navActiveClass = 'tns-nav-active', 6418 navStr = 'Carousel Page ', 6419 navStrCurrent = ' (Current Slide)'; 6420 } 6421 6422 // autoplay 6423 if (hasAutoplay) { 6424 var autoplayDirection = options.autoplayDirection === 'forward' ? 1 : -1, 6425 autoplayButton = options.autoplayButton, 6426 autoplayButtonHTML = options.autoplayButton ? options.autoplayButton.outerHTML : '', 6427 autoplayHtmlStrings = ['<span class=\'tns-visually-hidden\'>', ' animation</span>'], 6428 autoplayTimer, 6429 animating, 6430 autoplayHoverPaused, 6431 autoplayUserPaused, 6432 autoplayVisibilityPaused; 6433 } 6434 6435 if (hasTouch || hasMouseDrag) { 6436 var initPosition = {}, 6437 lastPosition = {}, 6438 translateInit, 6439 disX, 6440 disY, 6441 panStart = false, 6442 rafIndex, 6443 getDist = horizontal ? 6444 function(a, b) { return a.x - b.x; } : 6445 function(a, b) { return a.y - b.y; }; 6446 } 6447 6448 // disable slider when slidecount <= items 6449 if (!autoWidth) { resetVariblesWhenDisable(disable || freeze); } 6450 6451 if (TRANSFORM) { 6452 transformAttr = TRANSFORM; 6453 transformPrefix = 'translate'; 6454 6455 if (HAS3DTRANSFORMS) { 6456 transformPrefix += horizontal ? '3d(' : '3d(0px, '; 6457 transformPostfix = horizontal ? ', 0px, 0px)' : ', 0px)'; 6458 } else { 6459 transformPrefix += horizontal ? 'X(' : 'Y('; 6460 transformPostfix = ')'; 6461 } 6462 6463 } 6464 6465 if (carousel) { container.className = container.className.replace('tns-vpfix', ''); } 6466 initStructure(); 6467 initSheet(); 6468 initSliderTransform(); 6469 6470 // === COMMON FUNCTIONS === // 6471 function resetVariblesWhenDisable (condition) { 6472 if (condition) { 6473 controls = nav = touch = mouseDrag = arrowKeys = autoplay = autoplayHoverPause = autoplayResetOnVisibility = false; 6474 } 6475 } 6476 6477 function getCurrentSlide () { 6478 var tem = carousel ? index - cloneCount : index; 6479 while (tem < 0) { tem += slideCount; } 6480 return tem%slideCount + 1; 6481 } 6482 6483 function getStartIndex (ind) { 6484 ind = ind ? Math.max(0, Math.min(loop ? slideCount - 1 : slideCount - items, ind)) : 0; 6485 return carousel ? ind + cloneCount : ind; 6486 } 6487 6488 function getAbsIndex (i) { 6489 if (i == null) { i = index; } 6490 6491 if (carousel) { i -= cloneCount; } 6492 while (i < 0) { i += slideCount; } 6493 6494 return Math.floor(i%slideCount); 6495 } 6496 6497 function getCurrentNavIndex () { 6498 var absIndex = getAbsIndex(), 6499 result; 6500 6501 result = navAsThumbnails ? absIndex : 6502 fixedWidth || autoWidth ? Math.ceil((absIndex + 1) * pages / slideCount - 1) : 6503 Math.floor(absIndex / items); 6504 6505 // set active nav to the last one when reaches the right edge 6506 if (!loop && carousel && index === indexMax) { result = pages - 1; } 6507 6508 return result; 6509 } 6510 6511 function getItemsMax () { 6512 // fixedWidth or autoWidth while viewportMax is not available 6513 if (autoWidth || (fixedWidth && !viewportMax)) { 6514 return slideCount - 1; 6515 // most cases 6516 } else { 6517 var str = fixedWidth ? 'fixedWidth' : 'items', 6518 arr = []; 6519 6520 if (fixedWidth || options[str] < slideCount) { arr.push(options[str]); } 6521 6522 if (responsive) { 6523 for (var bp in responsive) { 6524 var tem = responsive[bp][str]; 6525 if (tem && (fixedWidth || tem < slideCount)) { arr.push(tem); } 6526 } 6527 } 6528 6529 if (!arr.length) { arr.push(0); } 6530 6531 return Math.ceil(fixedWidth ? viewportMax / Math.min.apply(null, arr) : Math.max.apply(null, arr)); 6532 } 6533 } 6534 6535 function getCloneCountForLoop () { 6536 var itemsMax = getItemsMax(), 6537 result = carousel ? Math.ceil((itemsMax * 5 - slideCount)/2) : (itemsMax * 4 - slideCount); 6538 result = Math.max(itemsMax, result); 6539 6540 return hasOption('edgePadding') ? result + 1 : result; 6541 } 6542 6543 function getWindowWidth () { 6544 return win.innerWidth || doc.documentElement.clientWidth || doc.body.clientWidth; 6545 } 6546 6547 function getInsertPosition (pos) { 6548 return pos === 'top' ? 'afterbegin' : 'beforeend'; 6549 } 6550 6551 function getClientWidth (el) { 6552 if (el == null) { return; } 6553 var div = doc.createElement('div'), rect, width; 6554 el.appendChild(div); 6555 rect = div.getBoundingClientRect(); 6556 width = rect.right - rect.left; 6557 div.remove(); 6558 return width || getClientWidth(el.parentNode); 6559 } 6560 6561 function getViewportWidth () { 6562 var gap = edgePadding ? edgePadding * 2 - gutter : 0; 6563 return getClientWidth(containerParent) - gap; 6564 } 6565 6566 function hasOption (item) { 6567 if (options[item]) { 6568 return true; 6569 } else { 6570 if (responsive) { 6571 for (var bp in responsive) { 6572 if (responsive[bp][item]) { return true; } 6573 } 6574 } 6575 return false; 6576 } 6577 } 6578 6579 // get option: 6580 // fixed width: viewport, fixedWidth, gutter => items 6581 // others: window width => all variables 6582 // all: items => slideBy 6583 function getOption (item, ww) { 6584 if (ww == null) { ww = windowWidth; } 6585 6586 if (item === 'items' && fixedWidth) { 6587 return Math.floor((viewport + gutter) / (fixedWidth + gutter)) || 1; 6588 6589 } else { 6590 var result = options[item]; 6591 6592 if (responsive) { 6593 for (var bp in responsive) { 6594 // bp: convert string to number 6595 if (ww >= parseInt(bp)) { 6596 if (item in responsive[bp]) { result = responsive[bp][item]; } 6597 } 6598 } 6599 } 6600 6601 if (item === 'slideBy' && result === 'page') { result = getOption('items'); } 6602 if (!carousel && (item === 'slideBy' || item === 'items')) { result = Math.floor(result); } 6603 6604 return result; 6605 } 6606 } 6607 6608 function getSlideMarginLeft (i) { 6609 return CALC ? 6610 CALC + '(' + i * 100 + '% / ' + slideCountNew + ')' : 6611 i * 100 / slideCountNew + '%'; 6612 } 6613 6614 function getInnerWrapperStyles (edgePaddingTem, gutterTem, fixedWidthTem, speedTem, autoHeightBP) { 6615 var str = ''; 6616 6617 if (edgePaddingTem !== undefined) { 6618 var gap = edgePaddingTem; 6619 if (gutterTem) { gap -= gutterTem; } 6620 str = horizontal ? 6621 'margin: 0 ' + gap + 'px 0 ' + edgePaddingTem + 'px;' : 6622 'margin: ' + edgePaddingTem + 'px 0 ' + gap + 'px 0;'; 6623 } else if (gutterTem && !fixedWidthTem) { 6624 var gutterTemUnit = '-' + gutterTem + 'px', 6625 dir = horizontal ? gutterTemUnit + ' 0 0' : '0 ' + gutterTemUnit + ' 0'; 6626 str = 'margin: 0 ' + dir + ';' 6627 } 6628 6629 if (!carousel && autoHeightBP && TRANSITIONDURATION && speedTem) { str += getTransitionDurationStyle(speedTem); } 6630 return str; 6631 } 6632 6633 function getContainerWidth (fixedWidthTem, gutterTem, itemsTem) { 6634 if (fixedWidthTem) { 6635 return (fixedWidthTem + gutterTem) * slideCountNew + 'px'; 6636 } else { 6637 return CALC ? 6638 CALC + '(' + slideCountNew * 100 + '% / ' + itemsTem + ')' : 6639 slideCountNew * 100 / itemsTem + '%'; 6640 } 6641 } 6642 6643 function getSlideWidthStyle (fixedWidthTem, gutterTem, itemsTem) { 6644 var width; 6645 6646 if (fixedWidthTem) { 6647 width = (fixedWidthTem + gutterTem) + 'px'; 6648 } else { 6649 if (!carousel) { itemsTem = Math.floor(itemsTem); } 6650 var dividend = carousel ? slideCountNew : itemsTem; 6651 width = CALC ? 6652 CALC + '(100% / ' + dividend + ')' : 6653 100 / dividend + '%'; 6654 } 6655 6656 width = 'width:' + width; 6657 6658 // inner slider: overwrite outer slider styles 6659 return nested !== 'inner' ? width + ';' : width + ' !important;'; 6660 } 6661 6662 function getSlideGutterStyle (gutterTem) { 6663 var str = ''; 6664 6665 // gutter maybe interger || 0 6666 // so can't use 'if (gutter)' 6667 if (gutterTem !== false) { 6668 var prop = horizontal ? 'padding-' : 'margin-', 6669 dir = horizontal ? 'right' : 'bottom'; 6670 str = prop + dir + ': ' + gutterTem + 'px;'; 6671 } 6672 6673 return str; 6674 } 6675 6676 function getCSSPrefix (name, num) { 6677 var prefix = name.substring(0, name.length - num).toLowerCase(); 6678 if (prefix) { prefix = '-' + prefix + '-'; } 6679 6680 return prefix; 6681 } 6682 6683 function getTransitionDurationStyle (speed) { 6684 return getCSSPrefix(TRANSITIONDURATION, 18) + 'transition-duration:' + speed / 1000 + 's;'; 6685 } 6686 6687 function getAnimationDurationStyle (speed) { 6688 return getCSSPrefix(ANIMATIONDURATION, 17) + 'animation-duration:' + speed / 1000 + 's;'; 6689 } 6690 6691 function initStructure () { 6692 var classOuter = 'tns-outer', 6693 classInner = 'tns-inner', 6694 hasGutter = hasOption('gutter'); 6695 6696 outerWrapper.className = classOuter; 6697 innerWrapper.className = classInner; 6698 outerWrapper.id = slideId + '-ow'; 6699 innerWrapper.id = slideId + '-iw'; 6700 6701 // set container properties 6702 if (container.id === '') { container.id = slideId; } 6703 newContainerClasses += PERCENTAGELAYOUT || autoWidth ? ' tns-subpixel' : ' tns-no-subpixel'; 6704 newContainerClasses += CALC ? ' tns-calc' : ' tns-no-calc'; 6705 if (autoWidth) { newContainerClasses += ' tns-autowidth'; } 6706 newContainerClasses += ' tns-' + options.axis; 6707 container.className += newContainerClasses; 6708 6709 // add constrain layer for carousel 6710 if (carousel) { 6711 middleWrapper = doc.createElement('div'); 6712 middleWrapper.id = slideId + '-mw'; 6713 middleWrapper.className = 'tns-ovh'; 6714 6715 outerWrapper.appendChild(middleWrapper); 6716 middleWrapper.appendChild(innerWrapper); 6717 } else { 6718 outerWrapper.appendChild(innerWrapper); 6719 } 6720 6721 if (autoHeight) { 6722 var wp = middleWrapper ? middleWrapper : innerWrapper; 6723 wp.className += ' tns-ah'; 6724 } 6725 6726 containerParent.insertBefore(outerWrapper, container); 6727 innerWrapper.appendChild(container); 6728 6729 // add id, class, aria attributes 6730 // before clone slides 6731 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(item, i) { 6732 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, 'tns-item'); 6733 if (!item.id) { item.id = slideId + '-item' + i; } 6734 if (!carousel && animateNormal) { Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateNormal); } 6735 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(item, { 6736 'aria-hidden': 'true', 6737 'tabindex': '-1' 6738 }); 6739 }); 6740 6741 // ## clone slides 6742 // carousel: n + slides + n 6743 // gallery: slides + n 6744 if (cloneCount) { 6745 var fragmentBefore = doc.createDocumentFragment(), 6746 fragmentAfter = doc.createDocumentFragment(); 6747 6748 for (var j = cloneCount; j--;) { 6749 var num = j%slideCount, 6750 cloneFirst = slideItems[num].cloneNode(true); 6751 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(cloneFirst, slideClonedClass); 6752 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(cloneFirst, 'id'); 6753 fragmentAfter.insertBefore(cloneFirst, fragmentAfter.firstChild); 6754 6755 if (carousel) { 6756 var cloneLast = slideItems[slideCount - 1 - num].cloneNode(true); 6757 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(cloneLast, slideClonedClass); 6758 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(cloneLast, 'id'); 6759 fragmentBefore.appendChild(cloneLast); 6760 } 6761 } 6762 6763 container.insertBefore(fragmentBefore, container.firstChild); 6764 container.appendChild(fragmentAfter); 6765 slideItems = container.children; 6766 } 6767 6768 } 6769 6770 function initSliderTransform () { 6771 // ## images loaded/failed 6772 if (hasOption('autoHeight') || autoWidth || !horizontal) { 6773 var imgs = container.querySelectorAll('img'); 6774 6775 // add img load event listener 6776 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(imgs, function(img) { 6777 var src = img.src; 6778 6779 if (!lazyload) { 6780 // not data img 6781 if (src && src.indexOf('data:image') < 0) { 6782 img.src = ''; 6783 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(img, imgEvents); 6784 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'loading'); 6785 6786 img.src = src; 6787 // data img 6788 } else { 6789 imgLoaded(img); 6790 } 6791 } 6792 }); 6793 6794 // set imgsComplete 6795 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(Object(_helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_23__["arrayFromNodeList"])(imgs), function() { imgsComplete = true; }); }); 6796 6797 // reset imgs for auto height: check visible imgs only 6798 if (hasOption('autoHeight')) { imgs = getImageArray(index, Math.min(index + items - 1, slideCountNew - 1)); } 6799 6800 lazyload ? initSliderTransformStyleCheck() : Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(Object(_helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_23__["arrayFromNodeList"])(imgs), initSliderTransformStyleCheck); }); 6801 6802 } else { 6803 // set container transform property 6804 if (carousel) { doContainerTransformSilent(); } 6805 6806 // update slider tools and events 6807 initTools(); 6808 initEvents(); 6809 } 6810 } 6811 6812 function initSliderTransformStyleCheck () { 6813 if (autoWidth && slideCount > 1) { 6814 // check styles application 6815 var num = loop ? index : slideCount - 1; 6816 6817 (function stylesApplicationCheck() { 6818 var left = slideItems[num].getBoundingClientRect().left; 6819 var right = slideItems[num - 1].getBoundingClientRect().right; 6820 6821 (Math.abs(left - right) <= 1) ? 6822 initSliderTransformCore() : 6823 setTimeout(function(){ stylesApplicationCheck() }, 16); 6824 })(); 6825 6826 } else { 6827 initSliderTransformCore(); 6828 } 6829 } 6830 6831 6832 function initSliderTransformCore () { 6833 // run Fn()s which are rely on image loading 6834 if (!horizontal || autoWidth) { 6835 setSlidePositions(); 6836 6837 if (autoWidth) { 6838 rightBoundary = getRightBoundary(); 6839 if (freezable) { freeze = getFreeze(); } 6840 indexMax = getIndexMax(); // <= slidePositions, rightBoundary <= 6841 resetVariblesWhenDisable(disable || freeze); 6842 } else { 6843 updateContentWrapperHeight(); 6844 } 6845 } 6846 6847 // set container transform property 6848 if (carousel) { doContainerTransformSilent(); } 6849 6850 // update slider tools and events 6851 initTools(); 6852 initEvents(); 6853 } 6854 6855 function initSheet () { 6856 // gallery: 6857 // set animation classes and left value for gallery slider 6858 if (!carousel) { 6859 for (var i = index, l = index + Math.min(slideCount, items); i < l; i++) { 6860 var item = slideItems[i]; 6861 item.style.left = (i - index) * 100 / items + '%'; 6862 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateIn); 6863 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateNormal); 6864 } 6865 } 6866 6867 // #### LAYOUT 6868 6869 // ## INLINE-BLOCK VS FLOAT 6870 6871 // ## PercentageLayout: 6872 // slides: inline-block 6873 // remove blank space between slides by set font-size: 0 6874 6875 // ## Non PercentageLayout: 6876 // slides: float 6877 // margin-right: -100% 6878 // margin-left: ~ 6879 6880 // Resource: https://docs.google.com/spreadsheets/d/147up245wwTXeQYve3BRSAD4oVcvQmuGsFteJOeA5xNQ/edit?usp=sharing 6881 if (horizontal) { 6882 if (PERCENTAGELAYOUT || autoWidth) { 6883 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', 'font-size:' + win.getComputedStyle(slideItems[0]).fontSize + ';', Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 6884 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId, 'font-size:0;', Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 6885 } else if (carousel) { 6886 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function (slide, i) { 6887 slide.style.marginLeft = getSlideMarginLeft(i); 6888 }); 6889 } 6890 } 6891 6892 6893 // ## BASIC STYLES 6894 if (CSSMQ) { 6895 // middle wrapper style 6896 if (TRANSITIONDURATION) { 6897 var str = middleWrapper && options.autoHeight ? getTransitionDurationStyle(options.speed) : ''; 6898 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + '-mw', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 6899 } 6900 6901 // inner wrapper styles 6902 str = getInnerWrapperStyles(options.edgePadding, options.gutter, options.fixedWidth, options.speed, options.autoHeight); 6903 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + '-iw', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 6904 6905 // container styles 6906 if (carousel) { 6907 str = horizontal && !autoWidth ? 'width:' + getContainerWidth(options.fixedWidth, options.gutter, options.items) + ';' : ''; 6908 if (TRANSITIONDURATION) { str += getTransitionDurationStyle(speed); } 6909 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId, str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 6910 } 6911 6912 // slide styles 6913 str = horizontal && !autoWidth ? getSlideWidthStyle(options.fixedWidth, options.gutter, options.items) : ''; 6914 if (options.gutter) { str += getSlideGutterStyle(options.gutter); } 6915 // set gallery items transition-duration 6916 if (!carousel) { 6917 if (TRANSITIONDURATION) { str += getTransitionDurationStyle(speed); } 6918 if (ANIMATIONDURATION) { str += getAnimationDurationStyle(speed); } 6919 } 6920 if (str) { Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); } 6921 6922 // non CSS mediaqueries: IE8 6923 // ## update inner wrapper, container, slides if needed 6924 // set inline styles for inner wrapper & container 6925 // insert stylesheet (one line) for slides only (since slides are many) 6926 } else { 6927 // middle wrapper styles 6928 update_carousel_transition_duration(); 6929 6930 // inner wrapper styles 6931 innerWrapper.style.cssText = getInnerWrapperStyles(edgePadding, gutter, fixedWidth, autoHeight); 6932 6933 // container styles 6934 if (carousel && horizontal && !autoWidth) { 6935 container.style.width = getContainerWidth(fixedWidth, gutter, items); 6936 } 6937 6938 // slide styles 6939 var str = horizontal && !autoWidth ? getSlideWidthStyle(fixedWidth, gutter, items) : ''; 6940 if (gutter) { str += getSlideGutterStyle(gutter); } 6941 6942 // append to the last line 6943 if (str) { Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); } 6944 } 6945 6946 // ## MEDIAQUERIES 6947 if (responsive && CSSMQ) { 6948 for (var bp in responsive) { 6949 // bp: convert string to number 6950 bp = parseInt(bp); 6951 6952 var opts = responsive[bp], 6953 str = '', 6954 middleWrapperStr = '', 6955 innerWrapperStr = '', 6956 containerStr = '', 6957 slideStr = '', 6958 itemsBP = !autoWidth ? getOption('items', bp) : null, 6959 fixedWidthBP = getOption('fixedWidth', bp), 6960 speedBP = getOption('speed', bp), 6961 edgePaddingBP = getOption('edgePadding', bp), 6962 autoHeightBP = getOption('autoHeight', bp), 6963 gutterBP = getOption('gutter', bp); 6964 6965 // middle wrapper string 6966 if (TRANSITIONDURATION && middleWrapper && getOption('autoHeight', bp) && 'speed' in opts) { 6967 middleWrapperStr = '#' + slideId + '-mw{' + getTransitionDurationStyle(speedBP) + '}'; 6968 } 6969 6970 // inner wrapper string 6971 if ('edgePadding' in opts || 'gutter' in opts) { 6972 innerWrapperStr = '#' + slideId + '-iw{' + getInnerWrapperStyles(edgePaddingBP, gutterBP, fixedWidthBP, speedBP, autoHeightBP) + '}'; 6973 } 6974 6975 // container string 6976 if (carousel && horizontal && !autoWidth && ('fixedWidth' in opts || 'items' in opts || (fixedWidth && 'gutter' in opts))) { 6977 containerStr = 'width:' + getContainerWidth(fixedWidthBP, gutterBP, itemsBP) + ';'; 6978 } 6979 if (TRANSITIONDURATION && 'speed' in opts) { 6980 containerStr += getTransitionDurationStyle(speedBP); 6981 } 6982 if (containerStr) { 6983 containerStr = '#' + slideId + '{' + containerStr + '}'; 6984 } 6985 6986 // slide string 6987 if ('fixedWidth' in opts || (fixedWidth && 'gutter' in opts) || !carousel && 'items' in opts) { 6988 slideStr += getSlideWidthStyle(fixedWidthBP, gutterBP, itemsBP); 6989 } 6990 if ('gutter' in opts) { 6991 slideStr += getSlideGutterStyle(gutterBP); 6992 } 6993 // set gallery items transition-duration 6994 if (!carousel && 'speed' in opts) { 6995 if (TRANSITIONDURATION) { slideStr += getTransitionDurationStyle(speedBP); } 6996 if (ANIMATIONDURATION) { slideStr += getAnimationDurationStyle(speedBP); } 6997 } 6998 if (slideStr) { slideStr = '#' + slideId + ' > .tns-item{' + slideStr + '}'; } 6999 7000 // add up 7001 str = middleWrapperStr + innerWrapperStr + containerStr + slideStr; 7002 7003 if (str) { 7004 sheet.insertRule('@media (min-width: ' + bp / 16 + 'em) {' + str + '}', sheet.cssRules.length); 7005 } 7006 } 7007 } 7008 } 7009 7010 function initTools () { 7011 // == slides == 7012 updateSlideStatus(); 7013 7014 // == live region == 7015 outerWrapper.insertAdjacentHTML('afterbegin', '<div class="tns-liveregion tns-visually-hidden" aria-live="polite" aria-atomic="true">slide <span class="current">' + getLiveRegionStr() + '</span> of ' + slideCount + '</div>'); 7016 liveregionCurrent = outerWrapper.querySelector('.tns-liveregion .current'); 7017 7018 // == autoplayInit == 7019 if (hasAutoplay) { 7020 var txt = autoplay ? 'stop' : 'start'; 7021 if (autoplayButton) { 7022 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(autoplayButton, {'data-action': txt}); 7023 } else if (options.autoplayButtonOutput) { 7024 outerWrapper.insertAdjacentHTML(getInsertPosition(options.autoplayPosition), '<button type="button" data-action="' + txt + '">' + autoplayHtmlStrings[0] + txt + autoplayHtmlStrings[1] + autoplayText[0] + '</button>'); 7025 autoplayButton = outerWrapper.querySelector('[data-action]'); 7026 } 7027 7028 // add event 7029 if (autoplayButton) { 7030 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(autoplayButton, {'click': toggleAutoplay}); 7031 } 7032 7033 if (autoplay) { 7034 startAutoplay(); 7035 if (autoplayHoverPause) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, hoverEvents); } 7036 if (autoplayResetOnVisibility) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, visibilityEvent); } 7037 } 7038 } 7039 7040 // == navInit == 7041 if (hasNav) { 7042 var initIndex = !carousel ? 0 : cloneCount; 7043 // customized nav 7044 // will not hide the navs in case they're thumbnails 7045 if (navContainer) { 7046 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navContainer, {'aria-label': 'Carousel Pagination'}); 7047 navItems = navContainer.children; 7048 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(navItems, function(item, i) { 7049 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(item, { 7050 'data-nav': i, 7051 'tabindex': '-1', 7052 'aria-label': navStr + (i + 1), 7053 'aria-controls': slideId, 7054 }); 7055 }); 7056 7057 // generated nav 7058 } else { 7059 var navHtml = '', 7060 hiddenStr = navAsThumbnails ? '' : 'style="display:none"'; 7061 for (var i = 0; i < slideCount; i++) { 7062 // hide nav items by default 7063 navHtml += '<button type="button" data-nav="' + i +'" tabindex="-1" aria-controls="' + slideId + '" ' + hiddenStr + ' aria-label="' + navStr + (i + 1) +'"></button>'; 7064 } 7065 navHtml = '<div class="tns-nav" aria-label="Carousel Pagination">' + navHtml + '</div>'; 7066 outerWrapper.insertAdjacentHTML(getInsertPosition(options.navPosition), navHtml); 7067 7068 navContainer = outerWrapper.querySelector('.tns-nav'); 7069 navItems = navContainer.children; 7070 } 7071 7072 updateNavVisibility(); 7073 7074 // add transition 7075 if (TRANSITIONDURATION) { 7076 var prefix = TRANSITIONDURATION.substring(0, TRANSITIONDURATION.length - 18).toLowerCase(), 7077 str = 'transition: all ' + speed / 1000 + 's'; 7078 7079 if (prefix) { 7080 str = '-' + prefix + '-' + str; 7081 } 7082 7083 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '[aria-controls^=' + slideId + '-item]', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 7084 } 7085 7086 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navItems[navCurrentIndex], {'aria-label': navStr + (navCurrentIndex + 1) + navStrCurrent}); 7087 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(navItems[navCurrentIndex], 'tabindex'); 7088 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(navItems[navCurrentIndex], navActiveClass); 7089 7090 // add events 7091 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(navContainer, navEvents); 7092 } 7093 7094 7095 7096 // == controlsInit == 7097 if (hasControls) { 7098 if (!controlsContainer && (!prevButton || !nextButton)) { 7099 outerWrapper.insertAdjacentHTML(getInsertPosition(options.controlsPosition), '<div class="tns-controls" aria-label="Carousel Navigation" tabindex="0"><button type="button" data-controls="prev" tabindex="-1" aria-controls="' + slideId +'">' + controlsText[0] + '</button><button type="button" data-controls="next" tabindex="-1" aria-controls="' + slideId +'">' + controlsText[1] + '</button></div>'); 7100 7101 controlsContainer = outerWrapper.querySelector('.tns-controls'); 7102 } 7103 7104 if (!prevButton || !nextButton) { 7105 prevButton = controlsContainer.children[0]; 7106 nextButton = controlsContainer.children[1]; 7107 } 7108 7109 if (options.controlsContainer) { 7110 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(controlsContainer, { 7111 'aria-label': 'Carousel Navigation', 7112 'tabindex': '0' 7113 }); 7114 } 7115 7116 if (options.controlsContainer || (options.prevButton && options.nextButton)) { 7117 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])([prevButton, nextButton], { 7118 'aria-controls': slideId, 7119 'tabindex': '-1', 7120 }); 7121 } 7122 7123 if (options.controlsContainer || (options.prevButton && options.nextButton)) { 7124 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(prevButton, {'data-controls' : 'prev'}); 7125 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(nextButton, {'data-controls' : 'next'}); 7126 } 7127 7128 prevIsButton = isButton(prevButton); 7129 nextIsButton = isButton(nextButton); 7130 7131 updateControlsStatus(); 7132 7133 // add events 7134 if (controlsContainer) { 7135 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(controlsContainer, controlsEvents); 7136 } else { 7137 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(prevButton, controlsEvents); 7138 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(nextButton, controlsEvents); 7139 } 7140 } 7141 7142 // hide tools if needed 7143 disableUI(); 7144 } 7145 7146 function initEvents () { 7147 // add events 7148 if (carousel && TRANSITIONEND) { 7149 var eve = {}; 7150 eve[TRANSITIONEND] = onTransitionEnd; 7151 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, eve); 7152 } 7153 7154 if (touch) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, touchEvents, options.preventScrollOnTouch); } 7155 if (mouseDrag) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, dragEvents); } 7156 if (arrowKeys) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(doc, docmentKeydownEvent); } 7157 7158 if (nested === 'inner') { 7159 events.on('outerResized', function () { 7160 resizeTasks(); 7161 events.emit('innerLoaded', info()); 7162 }); 7163 } else if (responsive || fixedWidth || autoWidth || autoHeight || !horizontal) { 7164 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(win, {'resize': onResize}); 7165 } 7166 7167 if (autoHeight) { 7168 if (nested === 'outer') { 7169 events.on('innerLoaded', doAutoHeight); 7170 } else if (!disable) { doAutoHeight(); } 7171 } 7172 7173 doLazyLoad(); 7174 if (disable) { disableSlider(); } else if (freeze) { freezeSlider(); } 7175 7176 events.on('indexChanged', additionalUpdates); 7177 if (nested === 'inner') { events.emit('innerLoaded', info()); } 7178 if (typeof onInit === 'function') { onInit(info()); } 7179 isOn = true; 7180 } 7181 7182 function destroy () { 7183 // sheet 7184 sheet.disabled = true; 7185 if (sheet.ownerNode) { sheet.ownerNode.remove(); } 7186 7187 // remove win event listeners 7188 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(win, {'resize': onResize}); 7189 7190 // arrowKeys, controls, nav 7191 if (arrowKeys) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(doc, docmentKeydownEvent); } 7192 if (controlsContainer) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(controlsContainer, controlsEvents); } 7193 if (navContainer) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(navContainer, navEvents); } 7194 7195 // autoplay 7196 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, hoverEvents); 7197 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, visibilityEvent); 7198 if (autoplayButton) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(autoplayButton, {'click': toggleAutoplay}); } 7199 if (autoplay) { clearInterval(autoplayTimer); } 7200 7201 // container 7202 if (carousel && TRANSITIONEND) { 7203 var eve = {}; 7204 eve[TRANSITIONEND] = onTransitionEnd; 7205 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, eve); 7206 } 7207 if (touch) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, touchEvents); } 7208 if (mouseDrag) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, dragEvents); } 7209 7210 // cache Object values in options && reset HTML 7211 var htmlList = [containerHTML, controlsContainerHTML, prevButtonHTML, nextButtonHTML, navContainerHTML, autoplayButtonHTML]; 7212 7213 tnsList.forEach(function(item, i) { 7214 var el = item === 'container' ? outerWrapper : options[item]; 7215 7216 if (typeof el === 'object' && el) { 7217 var prevEl = el.previousElementSibling ? el.previousElementSibling : false, 7218 parentEl = el.parentNode; 7219 el.outerHTML = htmlList[i]; 7220 options[item] = prevEl ? prevEl.nextElementSibling : parentEl.firstElementChild; 7221 } 7222 }); 7223 7224 7225 // reset variables 7226 tnsList = animateIn = animateOut = animateDelay = animateNormal = horizontal = outerWrapper = innerWrapper = container = containerParent = containerHTML = slideItems = slideCount = breakpointZone = windowWidth = autoWidth = fixedWidth = edgePadding = gutter = viewport = items = slideBy = viewportMax = arrowKeys = speed = rewind = loop = autoHeight = sheet = lazyload = slidePositions = slideItemsOut = cloneCount = slideCountNew = hasRightDeadZone = rightBoundary = updateIndexBeforeTransform = transformAttr = transformPrefix = transformPostfix = getIndexMax = index = indexCached = indexMin = indexMax = resizeTimer = swipeAngle = moveDirectionExpected = running = onInit = events = newContainerClasses = slideId = disable = disabled = freezable = freeze = frozen = controlsEvents = navEvents = hoverEvents = visibilityEvent = docmentKeydownEvent = touchEvents = dragEvents = hasControls = hasNav = navAsThumbnails = hasAutoplay = hasTouch = hasMouseDrag = slideActiveClass = imgCompleteClass = imgEvents = imgsComplete = controls = controlsText = controlsContainer = controlsContainerHTML = prevButton = nextButton = prevIsButton = nextIsButton = nav = navContainer = navContainerHTML = navItems = pages = pagesCached = navClicked = navCurrentIndex = navCurrentIndexCached = navActiveClass = navStr = navStrCurrent = autoplay = autoplayTimeout = autoplayDirection = autoplayText = autoplayHoverPause = autoplayButton = autoplayButtonHTML = autoplayResetOnVisibility = autoplayHtmlStrings = autoplayTimer = animating = autoplayHoverPaused = autoplayUserPaused = autoplayVisibilityPaused = initPosition = lastPosition = translateInit = disX = disY = panStart = rafIndex = getDist = touch = mouseDrag = null; 7227 // check variables 7228 // [animateIn, animateOut, animateDelay, animateNormal, horizontal, outerWrapper, innerWrapper, container, containerParent, containerHTML, slideItems, slideCount, breakpointZone, windowWidth, autoWidth, fixedWidth, edgePadding, gutter, viewport, items, slideBy, viewportMax, arrowKeys, speed, rewind, loop, autoHeight, sheet, lazyload, slidePositions, slideItemsOut, cloneCount, slideCountNew, hasRightDeadZone, rightBoundary, updateIndexBeforeTransform, transformAttr, transformPrefix, transformPostfix, getIndexMax, index, indexCached, indexMin, indexMax, resizeTimer, swipeAngle, moveDirectionExpected, running, onInit, events, newContainerClasses, slideId, disable, disabled, freezable, freeze, frozen, controlsEvents, navEvents, hoverEvents, visibilityEvent, docmentKeydownEvent, touchEvents, dragEvents, hasControls, hasNav, navAsThumbnails, hasAutoplay, hasTouch, hasMouseDrag, slideActiveClass, imgCompleteClass, imgEvents, imgsComplete, controls, controlsText, controlsContainer, controlsContainerHTML, prevButton, nextButton, prevIsButton, nextIsButton, nav, navContainer, navContainerHTML, navItems, pages, pagesCached, navClicked, navCurrentIndex, navCurrentIndexCached, navActiveClass, navStr, navStrCurrent, autoplay, autoplayTimeout, autoplayDirection, autoplayText, autoplayHoverPause, autoplayButton, autoplayButtonHTML, autoplayResetOnVisibility, autoplayHtmlStrings, autoplayTimer, animating, autoplayHoverPaused, autoplayUserPaused, autoplayVisibilityPaused, initPosition, lastPosition, translateInit, disX, disY, panStart, rafIndex, getDist, touch, mouseDrag ].forEach(function(item) { if (item !== null) { console.log(item); } }); 7229 7230 for (var a in this) { 7231 if (a !== 'rebuild') { this[a] = null; } 7232 } 7233 isOn = false; 7234 } 7235 7236// === ON RESIZE === 7237 // responsive || fixedWidth || autoWidth || !horizontal 7238 function onResize (e) { 7239 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ resizeTasks(getEvent(e)); }); 7240 } 7241 7242 function resizeTasks (e) { 7243 if (!isOn) { return; } 7244 if (nested === 'outer') { events.emit('outerResized', info(e)); } 7245 windowWidth = getWindowWidth(); 7246 var bpChanged, 7247 breakpointZoneTem = breakpointZone, 7248 needContainerTransform = false; 7249 7250 if (responsive) { 7251 setBreakpointZone(); 7252 bpChanged = breakpointZoneTem !== breakpointZone; 7253 // if (hasRightDeadZone) { needContainerTransform = true; } // *? 7254 if (bpChanged) { events.emit('newBreakpointStart', info(e)); } 7255 } 7256 7257 var indChanged, 7258 itemsChanged, 7259 itemsTem = items, 7260 disableTem = disable, 7261 freezeTem = freeze, 7262 arrowKeysTem = arrowKeys, 7263 controlsTem = controls, 7264 navTem = nav, 7265 touchTem = touch, 7266 mouseDragTem = mouseDrag, 7267 autoplayTem = autoplay, 7268 autoplayHoverPauseTem = autoplayHoverPause, 7269 autoplayResetOnVisibilityTem = autoplayResetOnVisibility, 7270 indexTem = index; 7271 7272 if (bpChanged) { 7273 var fixedWidthTem = fixedWidth, 7274 autoHeightTem = autoHeight, 7275 controlsTextTem = controlsText, 7276 centerTem = center, 7277 autoplayTextTem = autoplayText; 7278 7279 if (!CSSMQ) { 7280 var gutterTem = gutter, 7281 edgePaddingTem = edgePadding; 7282 } 7283 } 7284 7285 // get option: 7286 // fixed width: viewport, fixedWidth, gutter => items 7287 // others: window width => all variables 7288 // all: items => slideBy 7289 arrowKeys = getOption('arrowKeys'); 7290 controls = getOption('controls'); 7291 nav = getOption('nav'); 7292 touch = getOption('touch'); 7293 center = getOption('center'); 7294 mouseDrag = getOption('mouseDrag'); 7295 autoplay = getOption('autoplay'); 7296 autoplayHoverPause = getOption('autoplayHoverPause'); 7297 autoplayResetOnVisibility = getOption('autoplayResetOnVisibility'); 7298 7299 if (bpChanged) { 7300 disable = getOption('disable'); 7301 fixedWidth = getOption('fixedWidth'); 7302 speed = getOption('speed'); 7303 autoHeight = getOption('autoHeight'); 7304 controlsText = getOption('controlsText'); 7305 autoplayText = getOption('autoplayText'); 7306 autoplayTimeout = getOption('autoplayTimeout'); 7307 7308 if (!CSSMQ) { 7309 edgePadding = getOption('edgePadding'); 7310 gutter = getOption('gutter'); 7311 } 7312 } 7313 // update options 7314 resetVariblesWhenDisable(disable); 7315 7316 viewport = getViewportWidth(); // <= edgePadding, gutter 7317 if ((!horizontal || autoWidth) && !disable) { 7318 setSlidePositions(); 7319 if (!horizontal) { 7320 updateContentWrapperHeight(); // <= setSlidePositions 7321 needContainerTransform = true; 7322 } 7323 } 7324 if (fixedWidth || autoWidth) { 7325 rightBoundary = getRightBoundary(); // autoWidth: <= viewport, slidePositions, gutter 7326 // fixedWidth: <= viewport, fixedWidth, gutter 7327 indexMax = getIndexMax(); // autoWidth: <= rightBoundary, slidePositions 7328 // fixedWidth: <= rightBoundary, fixedWidth, gutter 7329 } 7330 7331 if (bpChanged || fixedWidth) { 7332 items = getOption('items'); 7333 slideBy = getOption('slideBy'); 7334 itemsChanged = items !== itemsTem; 7335 7336 if (itemsChanged) { 7337 if (!fixedWidth && !autoWidth) { indexMax = getIndexMax(); } // <= items 7338 // check index before transform in case 7339 // slider reach the right edge then items become bigger 7340 updateIndex(); 7341 } 7342 } 7343 7344 if (bpChanged) { 7345 if (disable !== disableTem) { 7346 if (disable) { 7347 disableSlider(); 7348 } else { 7349 enableSlider(); // <= slidePositions, rightBoundary, indexMax 7350 } 7351 } 7352 } 7353 7354 if (freezable && (bpChanged || fixedWidth || autoWidth)) { 7355 freeze = getFreeze(); // <= autoWidth: slidePositions, gutter, viewport, rightBoundary 7356 // <= fixedWidth: fixedWidth, gutter, rightBoundary 7357 // <= others: items 7358 7359 if (freeze !== freezeTem) { 7360 if (freeze) { 7361 doContainerTransform(getContainerTransformValue(getStartIndex(0))); 7362 freezeSlider(); 7363 } else { 7364 unfreezeSlider(); 7365 needContainerTransform = true; 7366 } 7367 } 7368 } 7369 7370 resetVariblesWhenDisable(disable || freeze); // controls, nav, touch, mouseDrag, arrowKeys, autoplay, autoplayHoverPause, autoplayResetOnVisibility 7371 if (!autoplay) { autoplayHoverPause = autoplayResetOnVisibility = false; } 7372 7373 if (arrowKeys !== arrowKeysTem) { 7374 arrowKeys ? 7375 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(doc, docmentKeydownEvent) : 7376 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(doc, docmentKeydownEvent); 7377 } 7378 if (controls !== controlsTem) { 7379 if (controls) { 7380 if (controlsContainer) { 7381 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(controlsContainer); 7382 } else { 7383 if (prevButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(prevButton); } 7384 if (nextButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(nextButton); } 7385 } 7386 } else { 7387 if (controlsContainer) { 7388 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(controlsContainer); 7389 } else { 7390 if (prevButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(prevButton); } 7391 if (nextButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(nextButton); } 7392 } 7393 } 7394 } 7395 if (nav !== navTem) { 7396 if (nav) { 7397 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(navContainer); 7398 updateNavVisibility(); 7399 } else { 7400 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(navContainer) 7401 } 7402 } 7403 if (touch !== touchTem) { 7404 touch ? 7405 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, touchEvents, options.preventScrollOnTouch) : 7406 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, touchEvents); 7407 } 7408 if (mouseDrag !== mouseDragTem) { 7409 mouseDrag ? 7410 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, dragEvents) : 7411 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, dragEvents); 7412 } 7413 if (autoplay !== autoplayTem) { 7414 if (autoplay) { 7415 if (autoplayButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(autoplayButton); } 7416 if (!animating && !autoplayUserPaused) { startAutoplay(); } 7417 } else { 7418 if (autoplayButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(autoplayButton); } 7419 if (animating) { stopAutoplay(); } 7420 } 7421 } 7422 if (autoplayHoverPause !== autoplayHoverPauseTem) { 7423 autoplayHoverPause ? 7424 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, hoverEvents) : 7425 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, hoverEvents); 7426 } 7427 if (autoplayResetOnVisibility !== autoplayResetOnVisibilityTem) { 7428 autoplayResetOnVisibility ? 7429 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(doc, visibilityEvent) : 7430 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(doc, visibilityEvent); 7431 } 7432 7433 if (bpChanged) { 7434 if (fixedWidth !== fixedWidthTem || center !== centerTem) { needContainerTransform = true; } 7435 7436 if (autoHeight !== autoHeightTem) { 7437 if (!autoHeight) { innerWrapper.style.height = ''; } 7438 } 7439 7440 if (controls && controlsText !== controlsTextTem) { 7441 prevButton.innerHTML = controlsText[0]; 7442 nextButton.innerHTML = controlsText[1]; 7443 } 7444 7445 if (autoplayButton && autoplayText !== autoplayTextTem) { 7446 var i = autoplay ? 1 : 0, 7447 html = autoplayButton.innerHTML, 7448 len = html.length - autoplayTextTem[i].length; 7449 if (html.substring(len) === autoplayTextTem[i]) { 7450 autoplayButton.innerHTML = html.substring(0, len) + autoplayText[i]; 7451 } 7452 } 7453 } else { 7454 if (center && (fixedWidth || autoWidth)) { needContainerTransform = true; } 7455 } 7456 7457 if (itemsChanged || fixedWidth && !autoWidth) { 7458 pages = getPages(); 7459 updateNavVisibility(); 7460 } 7461 7462 indChanged = index !== indexTem; 7463 if (indChanged) { 7464 events.emit('indexChanged', info()); 7465 needContainerTransform = true; 7466 } else if (itemsChanged) { 7467 if (!indChanged) { additionalUpdates(); } 7468 } else if (fixedWidth || autoWidth) { 7469 doLazyLoad(); 7470 updateSlideStatus(); 7471 updateLiveRegion(); 7472 } 7473 7474 if (itemsChanged && !carousel) { updateGallerySlidePositions(); } 7475 7476 if (!disable && !freeze) { 7477 // non-mediaqueries: IE8 7478 if (bpChanged && !CSSMQ) { 7479 // middle wrapper styles 7480 7481 // inner wrapper styles 7482 if (edgePadding !== edgePaddingTem || gutter !== gutterTem) { 7483 innerWrapper.style.cssText = getInnerWrapperStyles(edgePadding, gutter, fixedWidth, speed, autoHeight); 7484 } 7485 7486 if (horizontal) { 7487 // container styles 7488 if (carousel) { 7489 container.style.width = getContainerWidth(fixedWidth, gutter, items); 7490 } 7491 7492 // slide styles 7493 var str = getSlideWidthStyle(fixedWidth, gutter, items) + 7494 getSlideGutterStyle(gutter); 7495 7496 // remove the last line and 7497 // add new styles 7498 Object(_helpers_removeCSSRule_js__WEBPACK_IMPORTED_MODULE_11__["removeCSSRule"])(sheet, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet) - 1); 7499 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 7500 } 7501 } 7502 7503 // auto height 7504 if (autoHeight) { doAutoHeight(); } 7505 7506 if (needContainerTransform) { 7507 doContainerTransformSilent(); 7508 indexCached = index; 7509 } 7510 } 7511 7512 if (bpChanged) { events.emit('newBreakpointEnd', info(e)); } 7513 } 7514 7515 7516 7517 7518 7519 // === INITIALIZATION FUNCTIONS === // 7520 function getFreeze () { 7521 if (!fixedWidth && !autoWidth) { 7522 var a = center ? items - (items - 1) / 2 : items; 7523 return slideCount <= a; 7524 } 7525 7526 var width = fixedWidth ? (fixedWidth + gutter) * slideCount : slidePositions[slideCount], 7527 vp = edgePadding ? viewport + edgePadding * 2 : viewport + gutter; 7528 7529 if (center) { 7530 vp -= fixedWidth ? (viewport - fixedWidth) / 2 : (viewport - (slidePositions[index + 1] - slidePositions[index] - gutter)) / 2; 7531 } 7532 7533 return width <= vp; 7534 } 7535 7536 function setBreakpointZone () { 7537 breakpointZone = 0; 7538 for (var bp in responsive) { 7539 bp = parseInt(bp); // convert string to number 7540 if (windowWidth >= bp) { breakpointZone = bp; } 7541 } 7542 } 7543 7544 // (slideBy, indexMin, indexMax) => index 7545 var updateIndex = (function () { 7546 return loop ? 7547 carousel ? 7548 // loop + carousel 7549 function () { 7550 var leftEdge = indexMin, 7551 rightEdge = indexMax; 7552 7553 leftEdge += slideBy; 7554 rightEdge -= slideBy; 7555 7556 // adjust edges when has edge paddings 7557 // or fixed-width slider with extra space on the right side 7558 if (edgePadding) { 7559 leftEdge += 1; 7560 rightEdge -= 1; 7561 } else if (fixedWidth) { 7562 if ((viewport + gutter)%(fixedWidth + gutter)) { rightEdge -= 1; } 7563 } 7564 7565 if (cloneCount) { 7566 if (index > rightEdge) { 7567 index -= slideCount; 7568 } else if (index < leftEdge) { 7569 index += slideCount; 7570 } 7571 } 7572 } : 7573 // loop + gallery 7574 function() { 7575 if (index > indexMax) { 7576 while (index >= indexMin + slideCount) { index -= slideCount; } 7577 } else if (index < indexMin) { 7578 while (index <= indexMax - slideCount) { index += slideCount; } 7579 } 7580 } : 7581 // non-loop 7582 function() { 7583 index = Math.max(indexMin, Math.min(indexMax, index)); 7584 }; 7585 })(); 7586 7587 function disableUI () { 7588 if (!autoplay && autoplayButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(autoplayButton); } 7589 if (!nav && navContainer) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(navContainer); } 7590 if (!controls) { 7591 if (controlsContainer) { 7592 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(controlsContainer); 7593 } else { 7594 if (prevButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(prevButton); } 7595 if (nextButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(nextButton); } 7596 } 7597 } 7598 } 7599 7600 function enableUI () { 7601 if (autoplay && autoplayButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(autoplayButton); } 7602 if (nav && navContainer) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(navContainer); } 7603 if (controls) { 7604 if (controlsContainer) { 7605 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(controlsContainer); 7606 } else { 7607 if (prevButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(prevButton); } 7608 if (nextButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(nextButton); } 7609 } 7610 } 7611 } 7612 7613 function freezeSlider () { 7614 if (frozen) { return; } 7615 7616 // remove edge padding from inner wrapper 7617 if (edgePadding) { innerWrapper.style.margin = '0px'; } 7618 7619 // add class tns-transparent to cloned slides 7620 if (cloneCount) { 7621 var str = 'tns-transparent'; 7622 for (var i = cloneCount; i--;) { 7623 if (carousel) { Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(slideItems[i], str); } 7624 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(slideItems[slideCountNew - i - 1], str); 7625 } 7626 } 7627 7628 // update tools 7629 disableUI(); 7630 7631 frozen = true; 7632 } 7633 7634 function unfreezeSlider () { 7635 if (!frozen) { return; } 7636 7637 // restore edge padding for inner wrapper 7638 // for mordern browsers 7639 if (edgePadding && CSSMQ) { innerWrapper.style.margin = ''; } 7640 7641 // remove class tns-transparent to cloned slides 7642 if (cloneCount) { 7643 var str = 'tns-transparent'; 7644 for (var i = cloneCount; i--;) { 7645 if (carousel) { Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(slideItems[i], str); } 7646 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(slideItems[slideCountNew - i - 1], str); 7647 } 7648 } 7649 7650 // update tools 7651 enableUI(); 7652 7653 frozen = false; 7654 } 7655 7656 function disableSlider () { 7657 if (disabled) { return; } 7658 7659 sheet.disabled = true; 7660 container.className = container.className.replace(newContainerClasses.substring(1), ''); 7661 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(container, ['style']); 7662 if (loop) { 7663 for (var j = cloneCount; j--;) { 7664 if (carousel) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(slideItems[j]); } 7665 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(slideItems[slideCountNew - j - 1]); 7666 } 7667 } 7668 7669 // vertical slider 7670 if (!horizontal || !carousel) { Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(innerWrapper, ['style']); } 7671 7672 // gallery 7673 if (!carousel) { 7674 for (var i = index, l = index + slideCount; i < l; i++) { 7675 var item = slideItems[i]; 7676 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(item, ['style']); 7677 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateIn); 7678 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateNormal); 7679 } 7680 } 7681 7682 // update tools 7683 disableUI(); 7684 7685 disabled = true; 7686 } 7687 7688 function enableSlider () { 7689 if (!disabled) { return; } 7690 7691 sheet.disabled = false; 7692 container.className += newContainerClasses; 7693 doContainerTransformSilent(); 7694 7695 if (loop) { 7696 for (var j = cloneCount; j--;) { 7697 if (carousel) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(slideItems[j]); } 7698 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(slideItems[slideCountNew - j - 1]); 7699 } 7700 } 7701 7702 // gallery 7703 if (!carousel) { 7704 for (var i = index, l = index + slideCount; i < l; i++) { 7705 var item = slideItems[i], 7706 classN = i < index + items ? animateIn : animateNormal; 7707 item.style.left = (i - index) * 100 / items + '%'; 7708 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, classN); 7709 } 7710 } 7711 7712 // update tools 7713 enableUI(); 7714 7715 disabled = false; 7716 } 7717 7718 function updateLiveRegion () { 7719 var str = getLiveRegionStr(); 7720 if (liveregionCurrent.innerHTML !== str) { liveregionCurrent.innerHTML = str; } 7721 } 7722 7723 function getLiveRegionStr () { 7724 var arr = getVisibleSlideRange(), 7725 start = arr[0] + 1, 7726 end = arr[1] + 1; 7727 return start === end ? start + '' : start + ' to ' + end; 7728 } 7729 7730 function getVisibleSlideRange (val) { 7731 if (val == null) { val = getContainerTransformValue(); } 7732 var start = index, end, rangestart, rangeend; 7733 7734 // get range start, range end for autoWidth and fixedWidth 7735 if (center || edgePadding) { 7736 if (autoWidth || fixedWidth) { 7737 rangestart = - (parseFloat(val) + edgePadding); 7738 rangeend = rangestart + viewport + edgePadding * 2; 7739 } 7740 } else { 7741 if (autoWidth) { 7742 rangestart = slidePositions[index]; 7743 rangeend = rangestart + viewport; 7744 } 7745 } 7746 7747 // get start, end 7748 // - check auto width 7749 if (autoWidth) { 7750 slidePositions.forEach(function(point, i) { 7751 if (i < slideCountNew) { 7752 if ((center || edgePadding) && point <= rangestart + 0.5) { start = i; } 7753 if (rangeend - point >= 0.5) { end = i; } 7754 } 7755 }); 7756 7757 // - check percentage width, fixed width 7758 } else { 7759 7760 if (fixedWidth) { 7761 var cell = fixedWidth + gutter; 7762 if (center || edgePadding) { 7763 start = Math.floor(rangestart/cell); 7764 end = Math.ceil(rangeend/cell - 1); 7765 } else { 7766 end = start + Math.ceil(viewport/cell) - 1; 7767 } 7768 7769 } else { 7770 if (center || edgePadding) { 7771 var a = items - 1; 7772 if (center) { 7773 start -= a / 2; 7774 end = index + a / 2; 7775 } else { 7776 end = index + a; 7777 } 7778 7779 if (edgePadding) { 7780 var b = edgePadding * items / viewport; 7781 start -= b; 7782 end += b; 7783 } 7784 7785 start = Math.floor(start); 7786 end = Math.ceil(end); 7787 } else { 7788 end = start + items - 1; 7789 } 7790 } 7791 7792 start = Math.max(start, 0); 7793 end = Math.min(end, slideCountNew - 1); 7794 } 7795 7796 return [start, end]; 7797 } 7798 7799 function doLazyLoad () { 7800 if (lazyload && !disable) { 7801 var arg = getVisibleSlideRange(); 7802 arg.push(lazyloadSelector); 7803 7804 getImageArray.apply(null, arg).forEach(function (img) { 7805 if (!Object(_helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_16__["hasClass"])(img, imgCompleteClass)) { 7806 // stop propagation transitionend event to container 7807 var eve = {}; 7808 eve[TRANSITIONEND] = function (e) { e.stopPropagation(); }; 7809 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(img, eve); 7810 7811 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(img, imgEvents); 7812 7813 // update src 7814 img.src = Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(img, 'data-src'); 7815 7816 // update srcset 7817 var srcset = Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(img, 'data-srcset'); 7818 if (srcset) { img.srcset = srcset; } 7819 7820 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'loading'); 7821 } 7822 }); 7823 } 7824 } 7825 7826 function onImgLoaded (e) { 7827 imgLoaded(getTarget(e)); 7828 } 7829 7830 function onImgFailed (e) { 7831 imgFailed(getTarget(e)); 7832 } 7833 7834 function imgLoaded (img) { 7835 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'loaded'); 7836 imgCompleted(img); 7837 } 7838 7839 function imgFailed (img) { 7840 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'failed'); 7841 imgCompleted(img); 7842 } 7843 7844 function imgCompleted (img) { 7845 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, imgCompleteClass); 7846 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(img, 'loading'); 7847 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(img, imgEvents); 7848 } 7849 7850 function getImageArray (start, end, imgSelector) { 7851 var imgs = []; 7852 if (!imgSelector) { imgSelector = 'img'; } 7853 7854 while (start <= end) { 7855 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems[start].querySelectorAll(imgSelector), function (img) { imgs.push(img); }); 7856 start++; 7857 } 7858 7859 return imgs; 7860 } 7861 7862 // check if all visible images are loaded 7863 // and update container height if it's done 7864 function doAutoHeight () { 7865 var imgs = getImageArray.apply(null, getVisibleSlideRange()); 7866 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(imgs, updateInnerWrapperHeight); }); 7867 } 7868 7869 function imgsLoadedCheck (imgs, cb) { 7870 // execute callback function if all images are complete 7871 if (imgsComplete) { return cb(); } 7872 7873 // check image classes 7874 imgs.forEach(function (img, index) { 7875 if (!lazyload && img.complete) { imgCompleted(img); } // Check image.complete 7876 if (Object(_helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_16__["hasClass"])(img, imgCompleteClass)) { imgs.splice(index, 1); } 7877 }); 7878 7879 // execute callback function if selected images are all complete 7880 if (!imgs.length) { return cb(); } 7881 7882 // otherwise execute this functiona again 7883 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(imgs, cb); }); 7884 } 7885 7886 function additionalUpdates () { 7887 doLazyLoad(); 7888 updateSlideStatus(); 7889 updateLiveRegion(); 7890 updateControlsStatus(); 7891 updateNavStatus(); 7892 } 7893 7894 7895 function update_carousel_transition_duration () { 7896 if (carousel && autoHeight) { 7897 middleWrapper.style[TRANSITIONDURATION] = speed / 1000 + 's'; 7898 } 7899 } 7900 7901 function getMaxSlideHeight (slideStart, slideRange) { 7902 var heights = []; 7903 for (var i = slideStart, l = Math.min(slideStart + slideRange, slideCountNew); i < l; i++) { 7904 heights.push(slideItems[i].offsetHeight); 7905 } 7906 7907 return Math.max.apply(null, heights); 7908 } 7909 7910 // update inner wrapper height 7911 // 1. get the max-height of the visible slides 7912 // 2. set transitionDuration to speed 7913 // 3. update inner wrapper height to max-height 7914 // 4. set transitionDuration to 0s after transition done 7915 function updateInnerWrapperHeight () { 7916 var maxHeight = autoHeight ? getMaxSlideHeight(index, items) : getMaxSlideHeight(cloneCount, slideCount), 7917 wp = middleWrapper ? middleWrapper : innerWrapper; 7918 7919 if (wp.style.height !== maxHeight) { wp.style.height = maxHeight + 'px'; } 7920 } 7921 7922 // get the distance from the top edge of the first slide to each slide 7923 // (init) => slidePositions 7924 function setSlidePositions () { 7925 slidePositions = [0]; 7926 var attr = horizontal ? 'left' : 'top', 7927 attr2 = horizontal ? 'right' : 'bottom', 7928 base = slideItems[0].getBoundingClientRect()[attr]; 7929 7930 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(item, i) { 7931 // skip the first slide 7932 if (i) { slidePositions.push(item.getBoundingClientRect()[attr] - base); } 7933 // add the end edge 7934 if (i === slideCountNew - 1) { slidePositions.push(item.getBoundingClientRect()[attr2] - base); } 7935 }); 7936 } 7937 7938 // update slide 7939 function updateSlideStatus () { 7940 var range = getVisibleSlideRange(), 7941 start = range[0], 7942 end = range[1]; 7943 7944 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(item, i) { 7945 // show slides 7946 if (i >= start && i <= end) { 7947 if (Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(item, 'aria-hidden')) { 7948 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(item, ['aria-hidden', 'tabindex']); 7949 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, slideActiveClass); 7950 } 7951 // hide slides 7952 } else { 7953 if (!Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(item, 'aria-hidden')) { 7954 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(item, { 7955 'aria-hidden': 'true', 7956 'tabindex': '-1' 7957 }); 7958 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, slideActiveClass); 7959 } 7960 } 7961 }); 7962 } 7963 7964 // gallery: update slide position 7965 function updateGallerySlidePositions () { 7966 var l = index + Math.min(slideCount, items); 7967 for (var i = slideCountNew; i--;) { 7968 var item = slideItems[i]; 7969 7970 if (i >= index && i < l) { 7971 // add transitions to visible slides when adjusting their positions 7972 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, 'tns-moving'); 7973 7974 item.style.left = (i - index) * 100 / items + '%'; 7975 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateIn); 7976 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateNormal); 7977 } else if (item.style.left) { 7978 item.style.left = ''; 7979 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateNormal); 7980 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateIn); 7981 } 7982 7983 // remove outlet animation 7984 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateOut); 7985 } 7986 7987 // removing '.tns-moving' 7988 setTimeout(function() { 7989 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(el) { 7990 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(el, 'tns-moving'); 7991 }); 7992 }, 300); 7993 } 7994 7995 // set tabindex on Nav 7996 function updateNavStatus () { 7997 // get current nav 7998 if (nav) { 7999 navCurrentIndex = navClicked >= 0 ? navClicked : getCurrentNavIndex(); 8000 navClicked = -1; 8001 8002 if (navCurrentIndex !== navCurrentIndexCached) { 8003 var navPrev = navItems[navCurrentIndexCached], 8004 navCurrent = navItems[navCurrentIndex]; 8005 8006 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navPrev, { 8007 'tabindex': '-1', 8008 'aria-label': navStr + (navCurrentIndexCached + 1) 8009 }); 8010 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(navPrev, navActiveClass); 8011 8012 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navCurrent, {'aria-label': navStr + (navCurrentIndex + 1) + navStrCurrent}); 8013 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(navCurrent, 'tabindex'); 8014 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(navCurrent, navActiveClass); 8015 8016 navCurrentIndexCached = navCurrentIndex; 8017 } 8018 } 8019 } 8020 8021 function getLowerCaseNodeName (el) { 8022 return el.nodeName.toLowerCase(); 8023 } 8024 8025 function isButton (el) { 8026 return getLowerCaseNodeName(el) === 'button'; 8027 } 8028 8029 function isAriaDisabled (el) { 8030 return el.getAttribute('aria-disabled') === 'true'; 8031 } 8032 8033 function disEnableElement (isButton, el, val) { 8034 if (isButton) { 8035 el.disabled = val; 8036 } else { 8037 el.setAttribute('aria-disabled', val.toString()); 8038 } 8039 } 8040 8041 // set 'disabled' to true on controls when reach the edges 8042 function updateControlsStatus () { 8043 if (!controls || rewind || loop) { return; } 8044 8045 var prevDisabled = (prevIsButton) ? prevButton.disabled : isAriaDisabled(prevButton), 8046 nextDisabled = (nextIsButton) ? nextButton.disabled : isAriaDisabled(nextButton), 8047 disablePrev = (index <= indexMin) ? true : false, 8048 disableNext = (!rewind && index >= indexMax) ? true : false; 8049 8050 if (disablePrev && !prevDisabled) { 8051 disEnableElement(prevIsButton, prevButton, true); 8052 } 8053 if (!disablePrev && prevDisabled) { 8054 disEnableElement(prevIsButton, prevButton, false); 8055 } 8056 if (disableNext && !nextDisabled) { 8057 disEnableElement(nextIsButton, nextButton, true); 8058 } 8059 if (!disableNext && nextDisabled) { 8060 disEnableElement(nextIsButton, nextButton, false); 8061 } 8062 } 8063 8064 // set duration 8065 function resetDuration (el, str) { 8066 if (TRANSITIONDURATION) { el.style[TRANSITIONDURATION] = str; } 8067 } 8068 8069 function getSliderWidth () { 8070 return fixedWidth ? (fixedWidth + gutter) * slideCountNew : slidePositions[slideCountNew]; 8071 } 8072 8073 function getCenterGap (num) { 8074 if (num == null) { num = index; } 8075 8076 var gap = edgePadding ? gutter : 0; 8077 return autoWidth ? ((viewport - gap) - (slidePositions[num + 1] - slidePositions[num] - gutter))/2 : 8078 fixedWidth ? (viewport - fixedWidth) / 2 : 8079 (items - 1) / 2; 8080 } 8081 8082 function getRightBoundary () { 8083 var gap = edgePadding ? gutter : 0, 8084 result = (viewport + gap) - getSliderWidth(); 8085 8086 if (center && !loop) { 8087 result = fixedWidth ? - (fixedWidth + gutter) * (slideCountNew - 1) - getCenterGap() : 8088 getCenterGap(slideCountNew - 1) - slidePositions[slideCountNew - 1]; 8089 } 8090 if (result > 0) { result = 0; } 8091 8092 return result; 8093 } 8094 8095 function getContainerTransformValue (num) { 8096 if (num == null) { num = index; } 8097 8098 var val; 8099 if (horizontal && !autoWidth) { 8100 if (fixedWidth) { 8101 val = - (fixedWidth + gutter) * num; 8102 if (center) { val += getCenterGap(); } 8103 } else { 8104 var denominator = TRANSFORM ? slideCountNew : items; 8105 if (center) { num -= getCenterGap(); } 8106 val = - num * 100 / denominator; 8107 } 8108 } else { 8109 val = - slidePositions[num]; 8110 if (center && autoWidth) { 8111 val += getCenterGap(); 8112 } 8113 } 8114 8115 if (hasRightDeadZone) { val = Math.max(val, rightBoundary); } 8116 8117 val += (horizontal && !autoWidth && !fixedWidth) ? '%' : 'px'; 8118 8119 return val; 8120 } 8121 8122 function doContainerTransformSilent (val) { 8123 resetDuration(container, '0s'); 8124 doContainerTransform(val); 8125 } 8126 8127 function doContainerTransform (val) { 8128 if (val == null) { val = getContainerTransformValue(); } 8129 container.style[transformAttr] = transformPrefix + val + transformPostfix; 8130 } 8131 8132 function animateSlide (number, classOut, classIn, isOut) { 8133 var l = number + items; 8134 if (!loop) { l = Math.min(l, slideCountNew); } 8135 8136 for (var i = number; i < l; i++) { 8137 var item = slideItems[i]; 8138 8139 // set item positions 8140 if (!isOut) { item.style.left = (i - index) * 100 / items + '%'; } 8141 8142 if (animateDelay && TRANSITIONDELAY) { 8143 item.style[TRANSITIONDELAY] = item.style[ANIMATIONDELAY] = animateDelay * (i - number) / 1000 + 's'; 8144 } 8145 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, classOut); 8146 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, classIn); 8147 8148 if (isOut) { slideItemsOut.push(item); } 8149 } 8150 } 8151 8152 // make transfer after click/drag: 8153 // 1. change 'transform' property for mordern browsers 8154 // 2. change 'left' property for legacy browsers 8155 var transformCore = (function () { 8156 return carousel ? 8157 function () { 8158 resetDuration(container, ''); 8159 if (TRANSITIONDURATION || !speed) { 8160 // for morden browsers with non-zero duration or 8161 // zero duration for all browsers 8162 doContainerTransform(); 8163 // run fallback function manually 8164 // when duration is 0 / container is hidden 8165 if (!speed || !Object(_helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_26__["isVisible"])(container)) { onTransitionEnd(); } 8166 8167 } else { 8168 // for old browser with non-zero duration 8169 Object(_helpers_jsTransform_js__WEBPACK_IMPORTED_MODULE_33__["jsTransform"])(container, transformAttr, transformPrefix, transformPostfix, getContainerTransformValue(), speed, onTransitionEnd); 8170 } 8171 8172 if (!horizontal) { updateContentWrapperHeight(); } 8173 } : 8174 function () { 8175 slideItemsOut = []; 8176 8177 var eve = {}; 8178 eve[TRANSITIONEND] = eve[ANIMATIONEND] = onTransitionEnd; 8179 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(slideItems[indexCached], eve); 8180 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(slideItems[index], eve); 8181 8182 animateSlide(indexCached, animateIn, animateOut, true); 8183 animateSlide(index, animateNormal, animateIn); 8184 8185 // run fallback function manually 8186 // when transition or animation not supported / duration is 0 8187 if (!TRANSITIONEND || !ANIMATIONEND || !speed || !Object(_helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_26__["isVisible"])(container)) { onTransitionEnd(); } 8188 }; 8189 })(); 8190 8191 function render (e, sliderMoved) { 8192 if (updateIndexBeforeTransform) { updateIndex(); } 8193 8194 // render when slider was moved (touch or drag) even though index may not change 8195 if (index !== indexCached || sliderMoved) { 8196 // events 8197 events.emit('indexChanged', info()); 8198 events.emit('transitionStart', info()); 8199 if (autoHeight) { doAutoHeight(); } 8200 8201 // pause autoplay when click or keydown from user 8202 if (animating && e && ['click', 'keydown'].indexOf(e.type) >= 0) { stopAutoplay(); } 8203 8204 running = true; 8205 transformCore(); 8206 } 8207 } 8208 8209 /* 8210 * Transfer prefixed properties to the same format 8211 * CSS: -Webkit-Transform => webkittransform 8212 * JS: WebkitTransform => webkittransform 8213 * @param {string} str - property 8214 * 8215 */ 8216 function strTrans (str) { 8217 return str.toLowerCase().replace(/-/g, ''); 8218 } 8219 8220 // AFTER TRANSFORM 8221 // Things need to be done after a transfer: 8222 // 1. check index 8223 // 2. add classes to visible slide 8224 // 3. disable controls buttons when reach the first/last slide in non-loop slider 8225 // 4. update nav status 8226 // 5. lazyload images 8227 // 6. update container height 8228 function onTransitionEnd (event) { 8229 // check running on gallery mode 8230 // make sure trantionend/animationend events run only once 8231 if (carousel || running) { 8232 events.emit('transitionEnd', info(event)); 8233 8234 if (!carousel && slideItemsOut.length > 0) { 8235 for (var i = 0; i < slideItemsOut.length; i++) { 8236 var item = slideItemsOut[i]; 8237 // set item positions 8238 item.style.left = ''; 8239 8240 if (ANIMATIONDELAY && TRANSITIONDELAY) { 8241 item.style[ANIMATIONDELAY] = ''; 8242 item.style[TRANSITIONDELAY] = ''; 8243 } 8244 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateOut); 8245 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateNormal); 8246 } 8247 } 8248 8249 /* update slides, nav, controls after checking ... 8250 * => legacy browsers who don't support 'event' 8251 * have to check event first, otherwise event.target will cause an error 8252 * => or 'gallery' mode: 8253 * + event target is slide item 8254 * => or 'carousel' mode: 8255 * + event target is container, 8256 * + event.property is the same with transform attribute 8257 */ 8258 if (!event || 8259 !carousel && event.target.parentNode === container || 8260 event.target === container && strTrans(event.propertyName) === strTrans(transformAttr)) { 8261 8262 if (!updateIndexBeforeTransform) { 8263 var indexTem = index; 8264 updateIndex(); 8265 if (index !== indexTem) { 8266 events.emit('indexChanged', info()); 8267 8268 doContainerTransformSilent(); 8269 } 8270 } 8271 8272 if (nested === 'inner') { events.emit('innerLoaded', info()); } 8273 running = false; 8274 indexCached = index; 8275 } 8276 } 8277 8278 } 8279 8280 // # ACTIONS 8281 function goTo (targetIndex, e) { 8282 if (freeze) { return; } 8283 8284 // prev slideBy 8285 if (targetIndex === 'prev') { 8286 onControlsClick(e, -1); 8287 8288 // next slideBy 8289 } else if (targetIndex === 'next') { 8290 onControlsClick(e, 1); 8291 8292 // go to exact slide 8293 } else { 8294 if (running) { 8295 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 8296 } 8297 8298 var absIndex = getAbsIndex(), 8299 indexGap = 0; 8300 8301 if (targetIndex === 'first') { 8302 indexGap = - absIndex; 8303 } else if (targetIndex === 'last') { 8304 indexGap = carousel ? slideCount - items - absIndex : slideCount - 1 - absIndex; 8305 } else { 8306 if (typeof targetIndex !== 'number') { targetIndex = parseInt(targetIndex); } 8307 8308 if (!isNaN(targetIndex)) { 8309 // from directly called goTo function 8310 if (!e) { targetIndex = Math.max(0, Math.min(slideCount - 1, targetIndex)); } 8311 8312 indexGap = targetIndex - absIndex; 8313 } 8314 } 8315 8316 // gallery: make sure new page won't overlap with current page 8317 if (!carousel && indexGap && Math.abs(indexGap) < items) { 8318 var factor = indexGap > 0 ? 1 : -1; 8319 indexGap += (index + indexGap - slideCount) >= indexMin ? slideCount * factor : slideCount * 2 * factor * -1; 8320 } 8321 8322 index += indexGap; 8323 8324 // make sure index is in range 8325 if (carousel && loop) { 8326 if (index < indexMin) { index += slideCount; } 8327 if (index > indexMax) { index -= slideCount; } 8328 } 8329 8330 // if index is changed, start rendering 8331 if (getAbsIndex(index) !== getAbsIndex(indexCached)) { 8332 render(e); 8333 } 8334 8335 } 8336 } 8337 8338 // on controls click 8339 function onControlsClick (e, dir) { 8340 if (running) { 8341 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 8342 } 8343 var passEventObject; 8344 8345 if (!dir) { 8346 e = getEvent(e); 8347 var target = getTarget(e); 8348 8349 while (target !== controlsContainer && [prevButton, nextButton].indexOf(target) < 0) { target = target.parentNode; } 8350 8351 var targetIn = [prevButton, nextButton].indexOf(target); 8352 if (targetIn >= 0) { 8353 passEventObject = true; 8354 dir = targetIn === 0 ? -1 : 1; 8355 } 8356 } 8357 8358 if (rewind) { 8359 if (index === indexMin && dir === -1) { 8360 goTo('last', e); 8361 return; 8362 } else if (index === indexMax && dir === 1) { 8363 goTo('first', e); 8364 return; 8365 } 8366 } 8367 8368 if (dir) { 8369 index += slideBy * dir; 8370 if (autoWidth) { index = Math.floor(index); } 8371 // pass e when click control buttons or keydown 8372 render((passEventObject || (e && e.type === 'keydown')) ? e : null); 8373 } 8374 } 8375 8376 // on nav click 8377 function onNavClick (e) { 8378 if (running) { 8379 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 8380 } 8381 8382 e = getEvent(e); 8383 var target = getTarget(e), navIndex; 8384 8385 // find the clicked nav item 8386 while (target !== navContainer && !Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(target, 'data-nav')) { target = target.parentNode; } 8387 if (Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(target, 'data-nav')) { 8388 var navIndex = navClicked = Number(Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(target, 'data-nav')), 8389 targetIndexBase = fixedWidth || autoWidth ? navIndex * slideCount / pages : navIndex * items, 8390 targetIndex = navAsThumbnails ? navIndex : Math.min(Math.ceil(targetIndexBase), slideCount - 1); 8391 goTo(targetIndex, e); 8392 8393 if (navCurrentIndex === navIndex) { 8394 if (animating) { stopAutoplay(); } 8395 navClicked = -1; // reset navClicked 8396 } 8397 } 8398 } 8399 8400 // autoplay functions 8401 function setAutoplayTimer () { 8402 autoplayTimer = setInterval(function () { 8403 onControlsClick(null, autoplayDirection); 8404 }, autoplayTimeout); 8405 8406 animating = true; 8407 } 8408 8409 function stopAutoplayTimer () { 8410 clearInterval(autoplayTimer); 8411 animating = false; 8412 } 8413 8414 function updateAutoplayButton (action, txt) { 8415 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(autoplayButton, {'data-action': action}); 8416 autoplayButton.innerHTML = autoplayHtmlStrings[0] + action + autoplayHtmlStrings[1] + txt; 8417 } 8418 8419 function startAutoplay () { 8420 setAutoplayTimer(); 8421 if (autoplayButton) { updateAutoplayButton('stop', autoplayText[1]); } 8422 } 8423 8424 function stopAutoplay () { 8425 stopAutoplayTimer(); 8426 if (autoplayButton) { updateAutoplayButton('start', autoplayText[0]); } 8427 } 8428 8429 // programaitcally play/pause the slider 8430 function play () { 8431 if (autoplay && !animating) { 8432 startAutoplay(); 8433 autoplayUserPaused = false; 8434 } 8435 } 8436 function pause () { 8437 if (animating) { 8438 stopAutoplay(); 8439 autoplayUserPaused = true; 8440 } 8441 } 8442 8443 function toggleAutoplay () { 8444 if (animating) { 8445 stopAutoplay(); 8446 autoplayUserPaused = true; 8447 } else { 8448 startAutoplay(); 8449 autoplayUserPaused = false; 8450 } 8451 } 8452 8453 function onVisibilityChange () { 8454 if (doc.hidden) { 8455 if (animating) { 8456 stopAutoplayTimer(); 8457 autoplayVisibilityPaused = true; 8458 } 8459 } else if (autoplayVisibilityPaused) { 8460 setAutoplayTimer(); 8461 autoplayVisibilityPaused = false; 8462 } 8463 } 8464 8465 function mouseoverPause () { 8466 if (animating) { 8467 stopAutoplayTimer(); 8468 autoplayHoverPaused = true; 8469 } 8470 } 8471 8472 function mouseoutRestart () { 8473 if (autoplayHoverPaused) { 8474 setAutoplayTimer(); 8475 autoplayHoverPaused = false; 8476 } 8477 } 8478 8479 // keydown events on document 8480 function onDocumentKeydown (e) { 8481 e = getEvent(e); 8482 var keyIndex = [KEYS.LEFT, KEYS.RIGHT].indexOf(e.keyCode); 8483 8484 if (keyIndex >= 0) { 8485 onControlsClick(e, keyIndex === 0 ? -1 : 1); 8486 } 8487 } 8488 8489 // on key control 8490 function onControlsKeydown (e) { 8491 e = getEvent(e); 8492 var keyIndex = [KEYS.LEFT, KEYS.RIGHT].indexOf(e.keyCode); 8493 8494 if (keyIndex >= 0) { 8495 if (keyIndex === 0) { 8496 if (!prevButton.disabled) { onControlsClick(e, -1); } 8497 } else if (!nextButton.disabled) { 8498 onControlsClick(e, 1); 8499 } 8500 } 8501 } 8502 8503 // set focus 8504 function setFocus (el) { 8505 el.focus(); 8506 } 8507 8508 // on key nav 8509 function onNavKeydown (e) { 8510 e = getEvent(e); 8511 var curElement = doc.activeElement; 8512 if (!Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(curElement, 'data-nav')) { return; } 8513 8514 // var code = e.keyCode, 8515 var keyIndex = [KEYS.LEFT, KEYS.RIGHT, KEYS.ENTER, KEYS.SPACE].indexOf(e.keyCode), 8516 navIndex = Number(Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(curElement, 'data-nav')); 8517 8518 if (keyIndex >= 0) { 8519 if (keyIndex === 0) { 8520 if (navIndex > 0) { setFocus(navItems[navIndex - 1]); } 8521 } else if (keyIndex === 1) { 8522 if (navIndex < pages - 1) { setFocus(navItems[navIndex + 1]); } 8523 } else { 8524 navClicked = navIndex; 8525 goTo(navIndex, e); 8526 } 8527 } 8528 } 8529 8530 function getEvent (e) { 8531 e = e || win.event; 8532 return isTouchEvent(e) ? e.changedTouches[0] : e; 8533 } 8534 function getTarget (e) { 8535 return e.target || win.event.srcElement; 8536 } 8537 8538 function isTouchEvent (e) { 8539 return e.type.indexOf('touch') >= 0; 8540 } 8541 8542 function preventDefaultBehavior (e) { 8543 e.preventDefault ? e.preventDefault() : e.returnValue = false; 8544 } 8545 8546 function getMoveDirectionExpected () { 8547 return Object(_helpers_getTouchDirection_js__WEBPACK_IMPORTED_MODULE_14__["getTouchDirection"])(Object(_helpers_toDegree_js__WEBPACK_IMPORTED_MODULE_13__["toDegree"])(lastPosition.y - initPosition.y, lastPosition.x - initPosition.x), swipeAngle) === options.axis; 8548 } 8549 8550 function onPanStart (e) { 8551 if (running) { 8552 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 8553 } 8554 8555 if (autoplay && animating) { stopAutoplayTimer(); } 8556 8557 panStart = true; 8558 if (rafIndex) { 8559 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__["caf"])(rafIndex); 8560 rafIndex = null; 8561 } 8562 8563 var $ = getEvent(e); 8564 events.emit(isTouchEvent(e) ? 'touchStart' : 'dragStart', info(e)); 8565 8566 if (!isTouchEvent(e) && ['img', 'a'].indexOf(getLowerCaseNodeName(getTarget(e))) >= 0) { 8567 preventDefaultBehavior(e); 8568 } 8569 8570 lastPosition.x = initPosition.x = $.clientX; 8571 lastPosition.y = initPosition.y = $.clientY; 8572 if (carousel) { 8573 translateInit = parseFloat(container.style[transformAttr].replace(transformPrefix, '')); 8574 resetDuration(container, '0s'); 8575 } 8576 } 8577 8578 function onPanMove (e) { 8579 if (panStart) { 8580 var $ = getEvent(e); 8581 lastPosition.x = $.clientX; 8582 lastPosition.y = $.clientY; 8583 8584 if (carousel) { 8585 if (!rafIndex) { rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ panUpdate(e); }); } 8586 } else { 8587 if (moveDirectionExpected === '?') { moveDirectionExpected = getMoveDirectionExpected(); } 8588 if (moveDirectionExpected) { preventScroll = true; } 8589 } 8590 8591 if ((typeof e.cancelable !== 'boolean' || e.cancelable) && preventScroll) { 8592 e.preventDefault(); 8593 } 8594 } 8595 } 8596 8597 function panUpdate (e) { 8598 if (!moveDirectionExpected) { 8599 panStart = false; 8600 return; 8601 } 8602 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__["caf"])(rafIndex); 8603 if (panStart) { rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ panUpdate(e); }); } 8604 8605 if (moveDirectionExpected === '?') { moveDirectionExpected = getMoveDirectionExpected(); } 8606 if (moveDirectionExpected) { 8607 if (!preventScroll && isTouchEvent(e)) { preventScroll = true; } 8608 8609 try { 8610 if (e.type) { events.emit(isTouchEvent(e) ? 'touchMove' : 'dragMove', info(e)); } 8611 } catch(err) {} 8612 8613 var x = translateInit, 8614 dist = getDist(lastPosition, initPosition); 8615 if (!horizontal || fixedWidth || autoWidth) { 8616 x += dist; 8617 x += 'px'; 8618 } else { 8619 var percentageX = TRANSFORM ? dist * items * 100 / ((viewport + gutter) * slideCountNew): dist * 100 / (viewport + gutter); 8620 x += percentageX; 8621 x += '%'; 8622 } 8623 8624 container.style[transformAttr] = transformPrefix + x + transformPostfix; 8625 } 8626 } 8627 8628 function onPanEnd (e) { 8629 if (panStart) { 8630 if (rafIndex) { 8631 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__["caf"])(rafIndex); 8632 rafIndex = null; 8633 } 8634 if (carousel) { resetDuration(container, ''); } 8635 panStart = false; 8636 8637 var $ = getEvent(e); 8638 lastPosition.x = $.clientX; 8639 lastPosition.y = $.clientY; 8640 var dist = getDist(lastPosition, initPosition); 8641 8642 if (Math.abs(dist)) { 8643 // drag vs click 8644 if (!isTouchEvent(e)) { 8645 // prevent "click" 8646 var target = getTarget(e); 8647 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(target, {'click': function preventClick (e) { 8648 preventDefaultBehavior(e); 8649 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(target, {'click': preventClick}); 8650 }}); 8651 } 8652 8653 if (carousel) { 8654 rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function() { 8655 if (horizontal && !autoWidth) { 8656 var indexMoved = - dist * items / (viewport + gutter); 8657 indexMoved = dist > 0 ? Math.floor(indexMoved) : Math.ceil(indexMoved); 8658 index += indexMoved; 8659 } else { 8660 var moved = - (translateInit + dist); 8661 if (moved <= 0) { 8662 index = indexMin; 8663 } else if (moved >= slidePositions[slideCountNew - 1]) { 8664 index = indexMax; 8665 } else { 8666 var i = 0; 8667 while (i < slideCountNew && moved >= slidePositions[i]) { 8668 index = i; 8669 if (moved > slidePositions[i] && dist < 0) { index += 1; } 8670 i++; 8671 } 8672 } 8673 } 8674 8675 render(e, dist); 8676 events.emit(isTouchEvent(e) ? 'touchEnd' : 'dragEnd', info(e)); 8677 }); 8678 } else { 8679 if (moveDirectionExpected) { 8680 onControlsClick(e, dist > 0 ? -1 : 1); 8681 } 8682 } 8683 } 8684 } 8685 8686 // reset 8687 if (options.preventScrollOnTouch === 'auto') { preventScroll = false; } 8688 if (swipeAngle) { moveDirectionExpected = '?'; } 8689 if (autoplay && !animating) { setAutoplayTimer(); } 8690 } 8691 8692 // === RESIZE FUNCTIONS === // 8693 // (slidePositions, index, items) => vertical_conentWrapper.height 8694 function updateContentWrapperHeight () { 8695 var wp = middleWrapper ? middleWrapper : innerWrapper; 8696 wp.style.height = slidePositions[index + items] - slidePositions[index] + 'px'; 8697 } 8698 8699 function getPages () { 8700 var rough = fixedWidth ? (fixedWidth + gutter) * slideCount / viewport : slideCount / items; 8701 return Math.min(Math.ceil(rough), slideCount); 8702 } 8703 8704 /* 8705 * 1. update visible nav items list 8706 * 2. add "hidden" attributes to previous visible nav items 8707 * 3. remove "hidden" attrubutes to new visible nav items 8708 */ 8709 function updateNavVisibility () { 8710 if (!nav || navAsThumbnails) { return; } 8711 8712 if (pages !== pagesCached) { 8713 var min = pagesCached, 8714 max = pages, 8715 fn = _helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"]; 8716 8717 if (pagesCached > pages) { 8718 min = pages; 8719 max = pagesCached; 8720 fn = _helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"]; 8721 } 8722 8723 while (min < max) { 8724 fn(navItems[min]); 8725 min++; 8726 } 8727 8728 // cache pages 8729 pagesCached = pages; 8730 } 8731 } 8732 8733 function info (e) { 8734 return { 8735 container: container, 8736 slideItems: slideItems, 8737 navContainer: navContainer, 8738 navItems: navItems, 8739 controlsContainer: controlsContainer, 8740 hasControls: hasControls, 8741 prevButton: prevButton, 8742 nextButton: nextButton, 8743 items: items, 8744 slideBy: slideBy, 8745 cloneCount: cloneCount, 8746 slideCount: slideCount, 8747 slideCountNew: slideCountNew, 8748 index: index, 8749 indexCached: indexCached, 8750 displayIndex: getCurrentSlide(), 8751 navCurrentIndex: navCurrentIndex, 8752 navCurrentIndexCached: navCurrentIndexCached, 8753 pages: pages, 8754 pagesCached: pagesCached, 8755 sheet: sheet, 8756 isOn: isOn, 8757 event: e || {}, 8758 }; 8759 } 8760 8761 return { 8762 version: '2.9.3', 8763 getInfo: info, 8764 events: events, 8765 goTo: goTo, 8766 play: play, 8767 pause: pause, 8768 isOn: isOn, 8769 updateSliderHeight: updateInnerWrapperHeight, 8770 refresh: initSliderTransform, 8771 destroy: destroy, 8772 rebuild: function() { 8773 return tns(Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__["extend"])(options, optionsElements)); 8774 } 8775 }; 8776}; 8777 8778 8779/***/ }), 8780
8781/***/ "./src/components/heroes/heroes.js": 8782/*!*****************************************!*\ 8783 !*** ./src/components/heroes/heroes.js ***! 8784 \*****************************************/ 8785/*! no exports provided */ 8786/***/ (function(module, __webpack_exports__, __webpack_require__) { 8787 8788"use strict"; 8789__webpack_require__.r(__webpack_exports__); 8790/* harmony import */ var _js_main_script__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../js/main.script */ "./src/js/main.script.js"); 8791 8792 8793 8794 8795(function ($, Drupal) { 8796 $(document).ready(function () {// const tnsCarouselPrimary = document.querySelectorAll('.heroes-primary'); 8797 // tnsCarouselPrimary.forEach(slider => { 8798 // // if( $('.heroes-primary .heroes__item').length > 1) { 8799 // const heroes_primary__slider = document.tnsAda.init({ 8800 // container: slider.querySelector(".heroes__row"), 8801 // controlsContainer: slider.querySelector(".tns__controls"), 8802 // navContainer: slider.querySelector(".tns__dots"), 8803 // prevButton: slider.querySelector(".tns__arrow.prev"), 8804 // nextButton: slider.querySelector(".tns__arrow.next"), 8805 // navPosition: 'top', 8806 // gutter: 1, 8807 // 8808 // onInit(info) { 8809 // $('.path-home .heroes-primary .heroes').css("display","flex"); 8810 // 8811 // if( $(info).find('.heroes__item').length > 1) { 8812 // 8813 // info.controlsContainer.setAttribute('tabindex', -1); 8814 // info.nextButton.setAttribute('tabindex', 3); 8815 // info.prevButton.setAttribute('tabindex', 3); 8816 // 8817 // document.querySelectorAll('.tns-slide-cloned a').forEach(function(btn) { 8818 // btn.setAttribute('tabindex', -1); 8819 // }); 8820 // } 8821 // } 8822 // 8823 // }); 8824 // // } 8825 // }); 8826 // // if( $('.heroes-secondary .heroes__item').length > 1) { 8827 // const tnsCarouselSecondary = document.querySelectorAll('.heroes-secondary');
8828 // tnsCarouselSecondary.forEach(slider => { 8829 // const heroes_secondary__slider = document.tnsAda.init({ 8830 // container: slider.querySelector(".heroes__row"), 8831 // controlsContainer: slider.querySelector(".tns__controls"), 8832 // navContainer: slider.querySelector(".tns__dots"), 8833 // prevButton: slider.querySelector(".tns__arrow.prev"), 8834 // nextButton: slider.querySelector(".tns__arrow.next"), 8835 // navPosition: 'top', 8836 // 8837 // onInit(info) { 8838 // info.controlsContainer.setAttribute('tabindex', -1); 8839 // info.nextButton.setAttribute('tabindex', 3); 8840 // info.prevButton.setAttribute('tabindex', 3); 8841 // 8842 // document.querySelectorAll('.tns-slide-cloned a').forEach(function(btn) { 8843 // btn.setAttribute('tabindex', -1); 8844 // }); 8845 // } 8846 // }); 8847 // // } 8848 // }); 8849 }); 8850})(jQuery, Drupal); 8851 8852/***/ }), 8853
8854/***/ "./src/js/main.script.js": 8855/*!*******************************!*\ 8856 !*** ./src/js/main.script.js ***! 8857 \*******************************/ 8858/*! no exports provided */ 8859/***/ (function(module, __webpack_exports__, __webpack_require__) { 8860 8861"use strict"; 8862__webpack_require__.r(__webpack_exports__); 8863/* harmony import */ var _polyfill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./polyfill */ "./src/js/polyfill.js"); 8864/* harmony import */ var _polyfill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_polyfill__WEBPACK_IMPORTED_MODULE_0__); 8865/* harmony import */ var _tnsAda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tnsAda */ "./src/js/tnsAda.js"); 8866 8867 8868 8869 // import 'bootstrap'; 8870 8871(function ($, Drupal, drupalSettings) { 8872 // Responsive check helper: 8873 // USAGE: if (Drupal.device.isMobile()) {} 8874 Drupal.device = { 8875 isDesktop: function isDesktop() { 8876 return $(window).innerWidth() > 980; 8877 }, 8878 isTablet: function isTablet() { 8879 return $(window).innerWidth() <= 980 && $(window).innerWidth() > 728; 8880 }, 8881 isMobile: function isMobile() { 8882 return $(window).innerWidth() <= 728; 8883 } 8884 }; // Let the document know when the mouse is being used 8885 8886 document.body.addEventListener('mousedown', function () { 8887 document.body.classList.add('using-mouse'); 8888 }); // Re-enable focus styling when Tab is pressed 8889 8890 document.body.addEventListener('keydown', function (event) { 8891 if (event.keyCode === 9) { 8892 document.body.classList.remove('using-mouse'); 8893 } 8894 }); 8895 $('#ajax-wrapper .js-form-item-image-upload small #edit-image-upload--description').append("<small> No file chosen.</small>"); 8896 Drupal.behaviors.Bc_brandTheme = { 8897 attach: function attach(context, settings) { 8898 var host = window.location.host; 8899 $('a[href^="http"]:not([href*="' + host + '"])').each(function (index) { 8900 $(this).attr('rel', 'noopener nofollow'); 8901 }); 8902 $('[data-toggle="popover"]').each(function (index) { 8903 var $this = $(this); 8904 var $container = $this.closest('div'); 8905 $container.addClass('has-popover'); 8906 $this.appendTo($container); 8907 $this.popover({ 8908 template: '<div class="popover" role="tooltip"><div class="popover-body"></div></div>', 8909 container: $container 8910 }); 8911 }); 8912 $(".popover-button").click(function () { 8913 var controls = $(this).attr("aria-describedby"); 8914 $(".popover-button").removeAttr("aria-describedby"); 8915 $(".popover-button").attr("aria-expanded", function (index, attr) { 8916 return attr == "false" ? "true" : "false"; 8917 }); 8918 $(".popover-button").attr("aria-controls", function (index, attr) { 8919 return attr = controls; 8920 }); 8921 }); 8922 $('.webform-submission-newsletter-form-form .form-item-postal-code input').inputmask({ 8923 mask: ['99999', '99999-9999', 'A9A 9A9'], 8924 placeholder: '', 8925 clearIncomplete: true 8926 }); 8927 /** 8928 * SHARE COMPONENT 8929 */ 8930 8931 /** 8932 * Determine the mobile operating system. 8933 * This function returns one of 'iOS', 'Android', 'Windows Phone', or 'unknown'. 8934 * Based on: https://stackoverflow.com/questions/21741841/detecting-ios-android-operating-system 8935 * @returns {String} 8936 */ 8937 8938 function isAndroidIOS() { 8939 var userAgent = navigator.userAgent || navigator.vendor || window.opera; 8940 8941 if (/android/i.test(userAgent)) { 8942 console.log("android detected"); 8943 8944 if ($(".page-node-type-blog").length) { 8945 $(window).bind('orientationchange', function () { 8946 if ($(window).width() >= 728) { 8947 $(".article-detail__section-abstract .info-share .share-button").attr("aria-controls", "sharebox"); 8948 $(".article-detail__section-abstract .info-share .sharebox").attr("id", "sharebox"); 8949 $('.article-detail__back-and-share .info-share .share-button').removeAttr("aria-controls"); 8950 $('.article-detail__back-and-share .info-share .sharebox').removeAttr("id"); // console.log('desktop'); 8951 } else { 8952 // console.log("mobile"); 8953 $('.article-detail__back-and-share .info-share .share-button').attr("aria-controls", "sharebox"); 8954 $('.article-detail__back-and-share .info-share .sharebox').attr("id", "sharebox"); 8955 $(".article-detail__section-abstract .info-share .share-button").removeAttr("aria-controls"); 8956 $(".article-detail__section-abstract .info-share .sharebox").removeAttr("id"); 8957 } 8958 }).bind(); 8959 } 8960 8961 return true; 8962 } // iOS detection from: http://stackoverflow.com/a/9039885/177710 8963 8964 8965 if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { 8966 console.log("ios detected"); 8967 return true; 8968 } //not Android or iOS 8969 8970 8971 return false;
8972 } 8973 8974 function getMeta(metaName) { 8975 var metas = document.getElementsByTagName('meta'); 8976 8977 for (var i = 0; i < metas.length; i++) { 8978 if (metas[i].getAttribute('name') === metaName) { 8979 return metas[i].getAttribute('content'); 8980 } 8981 } 8982 8983 return ''; 8984 } 8985 8986 $('.share-button', context).on('click', function () { 8987 var isMobile = isAndroidIOS(); 8988 console.log(isMobile); 8989 8990 if (navigator.share && isMobile) { 8991 navigator.share({ 8992 title: document.title, 8993 text: getMeta('description'), 8994 url: document.href 8995 }).then(function () { 8996 return console.log('Successful share'); 8997 })["catch"](function (error) { 8998 return console.log('Error sharing', error); 8999 }); 9000 return null; 9001 } // console.log(this); 9002 // $(this).toggleClass('opened'); 9003 // // $(this).find('.icon').toggleClass('icon-share-close icon-share'); 9004 // $('.sharebox').toggleClass('opened'); 9005 // if ($(this).hasClass('opened')) { 9006 // $(this).attr('aria-expanded', 'true'); 9007 // } else { 9008 // $(this).attr('aria-expanded', 'false'); 9009 // } 9010 // $('.sharebox .close').focus(); 9011 9012 }); // $('.share-button').on("click", function (e) { 9013 // e.preventDefault(); 9014 // // $('.search__filters li a').addClass('hidden'); 9015 // console.log('toggle share'); 9016 // }); 9017 // $('.sharebox .close').on('click', function () { 9018 // $(this).parents('.opened').removeClass('opened'); 9019 // }); 9020 9021 var $temp = $("<input>"); 9022 var $url = $(location).attr('href'); 9023 $('.sharebox .copybutton').on('click', function () { 9024 // $('.copyfield input')[0].select(); 9025 // document.execCommand('copy'); 9026 $("body").append($temp); 9027 $temp.val($url).select(); 9028 document.execCommand("copy"); 9029 $temp.remove(); 9030 $('.copyfield .copymessage').addClass('shown'); 9031 setTimeout(function () { 9032 $('.copyfield .copymessage').removeClass('shown'); 9033 }, 10000); 9034 }); //Change Element type 9035 9036 $.fn.changeElementType = function (newType) { 9037 this.each(function () { 9038 var attrs = {}; 9039 $.each(this.attributes, function (idx, attr) { 9040 attrs[attr.nodeName] = attr.nodeValue; 9041 }); 9042 $(this).replaceWith(function () { 9043 return $("<" + newType + "/>", attrs).append($(this).contents()); 9044 }); 9045 }); 9046 }; // Detect Valid Keyboard Clicks 9047 // https://karlgroves.com/2014/11/24/ridiculously-easy-trick-for-keyboard-accessibility 9048 9049 9050 function a11yClick(event) { 9051 if (event.type === 'click') { 9052 return true; 9053 } else if (event.type === 'keypress') { 9054 var code = event.charCode || event.keyCode; 9055 9056 if (code === 32 || code === 13) { 9057 return true; 9058 } 9059 } else { 9060 return false; 9061 } 9062 } // Juicer/Slick accessibility tweaks. 9063 // $("#block-juiceren .juicer-feed").changeElementType("div"); 9064 9065 9066 $("#block-juiceren .juicer-feed").on('init', function (e, slick) { 9067 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active"); 9068 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active").removeAttr("aria-hidden"); 9069 setTimeout(function () { 9070 // Set slick's accessibility option to false as recommended here: 9071 // https://hub.accessible360.com/kb/articles/521#heading-tip-3-disable-accessibility-mode 9072 if ($("#block-juiceren .juicer-feed").hasClass('slick-initialized')) { 9073 $("#block-juiceren .juicer-feed.slick-initialized").slick('slickSetOption', { 9074 accessibility: false 9075 }, true); 9076 } 9077 9078 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active").removeAttr("aria-hidden"); 9079 }, 1000); 9080 $("#block-juiceren .juicer-feed .slick-list .feed-item .j-text a").removeAttr("tabindex").css("color", "white").changeElementType("span"); 9081 $("#block-juiceren .juicer-feed .slick-list").find(".slick-track .feed-item").attr("role", "group"); 9082 $("#block-juiceren .juicer-feed .slick-list .feed-item .j-text .j-meta nav").addClass('j-meta-nav').changeElementType("div"); 9083 $('#block-juiceren .juicer-feed .slick-list .feed-item').on('click', function () { 9084 window.open($(this).find('a').attr('href')); // console.log('test'); 9085 9086 return false;
9087 }); // Play icon. 9088 9089 var $imageVideo = $("#block-juiceren .juicer-feed .slick-list .feed-item.j-video .j-image"); 9090 var playIcon = '<span class="j-video-icon" aria-hidden="true"></span>'; 9091 $imageVideo.append(playIcon); 9092 $("#block-juiceren .juicer-feed .slick-list .feed-item", context).each(function (i, e) { 9093 var alt = $(e).find(".j-image img").attr("alt"), 9094 message = $(e).find(".j-message").text(), 9095 label = Number($(e).attr("data-slick-index")) + 1, 9096 totalSlide = $("#block-juiceren .juicer-feed .slick-list .feed-item").length; 9097 $(e).attr({ 9098 "aria-label": "Slide " + label + " of " + totalSlide 9099 }); // if (alt) { 9100 // $(e).find(".j-image img").attr("alt", alt.replace('Photo from ', '')); 9101 // } 9102 9103 $(e).find(".j-image img").attr("alt", message); // Social icon screen reader text. 9104 9105 var $social = $(this).find('.j-social'); 9106 var socialIcon = '<span class="j-social-icon" aria-hidden="true"></span> <span class="sr-only">' + $social.attr('aria-label') + '</span>'; 9107 $social.append(socialIcon).removeAttr('aria-label'); 9108 }); 9109 $(".slick-next, .slick-prev").on("click keypress", function (event) { 9110 if (a11yClick(event) === true) { 9111 setTimeout(function () { 9112 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active a").first().focus(); 9113 }, 100); 9114 } 9115 }); //update all j-meta a tags to say comments or likes 9116 9117 $(".comments, .repins").each(function () { 9118 var numComments = $(this).text(); 9119 $(this).html(numComments + ' <span class="sr-only">comments</div>'); 9120 }); 9121 $(".likes").each(function () { 9122 var numLikes = $(this).text(); 9123 $(this).html(numLikes + ' <span class="sr-only">likes</div>'); 9124 }); 9125 }); 9126 $("#block-juiceren .juicer-feed").on('beforeChange', function (e, slick, currentSlide, nextSlide) { 9127 $("#block-juiceren .juicer-feed .slick-list .feed-item").removeAttr("aria-hidden"); 9128 }); 9129 $("#block-juiceren .juicer-feed").on('afterChange', function (e, slick, currentSlide) { 9130 setTimeout(function () { 9131 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active").removeAttr("aria-hidden"); 9132 }, 500); 9133 }); 9134 9135 if ($('#prodH1').length > 0) { 9136 var root = document.getElementById('prodH1'); 9137 root.style.setProperty('--h1-height', root.clientHeight + 'px'); 9138 $(".products--full").addClass("loaded"); 9139 console.log('root.clientHeight', root.clientHeight); 9140 } // if($(".error").length) { 9141 9142 9143 $('#user-login-form .form-submit').on('click', function () { 9144 // console.log("ERROR MESSAGE"); 9145 setTimeout(function () { 9146 if ($("label").hasClass("error")) { 9147 console.log("ERROR"); 9148 $("#user-login-form").addClass("login-errors"); 9149 } 9150 }, 600); 9151 }); 9152 $('#user-login-form input.required').on('input', function () { 9153 setTimeout(function () { 9154 if ($("label").hasClass("error")) { 9155 console.log("ERROR2"); 9156 $("#user-login-form").addClass("login-errors"); 9157 } 9158 9159 if ($('#user-login-form label').css('display') == 'none') { 9160 // true 9161 console.log("ERROR FIXED"); 9162 $("#user-login-form").removeClass("login-errors"); 9163 } 9164 }, 600); 9165 }); // } 9166 // var altTxt = $("img").attr('alt'); 9167 9168 if ($('.blog-callout__image img').length > 0) { 9169 $(".blog-callout__image img").attr('alt', ''); 9170 } 9171 9172 if ($('.recipe-featured__col img').length > 0) { 9173 $(".recipe-featured__col img").attr('alt', ''); 9174 } 9175 9176 if ($('.recipes--full__image-frame img').length > 0) { 9177 $(".recipes--full__image-frame img").attr('alt', ''); 9178 } 9179 9180 if ($('.blog-teaser__image img').length > 0) { 9181 $(".blog-teaser__image img").attr('alt', ''); 9182 } // setTimeout 9183 // if ($('.recipe-featured__card img').length > 0) { 9184 // $(".recipe-featured__card img").attr('alt', ''); 9185 // console.log('here') 9186 // } 9187 9188 9189 setTimeout(function () { 9190 if ($('.recipe-featured__card img').length > 0) { 9191 $(".recipe-featured__card img").attr('alt', ''); 9192 } 9193 }, 12000); //identitcal id issue on blog page fix 9194 9195 if ($(".page-node-type-blog").length) { 9196 $(window).resize(function () { 9197 if ($(window).width() >= 728) { 9198 $(".article-detail__section-abstract .info-share .share-button").attr("aria-controls", "sharebox"); 9199 $(".article-detail__section-abstract .info-share .sharebox").attr("id", "sharebox"); 9200 $('.article-detail__back-and-share .info-share .share-button').removeAttr("aria-controls"); 9201 $('.article-detail__back-and-share .info-share .sharebox').removeAttr("id"); // console.log('desktop'); 9202 } else { 9203 // console.log("mobile"); 9204 $('.article-detail__back-and-share .info-share .share-button').attr("aria-controls", "sharebox"); 9205 $('.article-detail__back-and-share .info-share .sharebox').attr("id", "sharebox"); 9206 $(".article-detail__section-abstract .info-share .share-button").removeAttr("aria-controls"); 9207 $(".article-detail__section-abstract .info-share .sharebox").removeAttr("id"); 9208 } 9209 }).resize(); 9210 } 9211 } 9212 }; 9213 $("form input#edit-image-upload-upload-button--2").focusin(function (e) { 9214 $('label[for="edit-image-upload-upload-button--2"]').addClass("focused"); 9215 }); 9216 $("form input#edit-image-upload-upload-button--2").focusout(function (e) { 9217 $('label[for="edit-image-upload-upload-button--2"]').removeClass("focused"); 9218 }); //share button fix 9219 9220 $('.share-button').on('click', function () { 9221 $(this).toggleClass('opened'); 9222 $('.sharebox').toggleClass('opened'); 9223 9224 if ($(this).hasClass('opened')) { 9225 $(this).attr('aria-expanded', 'true'); 9226 } else { 9227 $(this).attr('aria-expanded', 'false'); 9228 } 9229 }); // if($(".share-button").length > 0) { 9230 // $('.share-button').on('click', function () { 9231 // console.log("yup clicked"); 9232 // $(this).addClass('opened'); 9233 // $('.sharebox').toggleClass('opened'); 9234 // }) 9235 // } 9236 // $(document).ready(function () { 9237 // // Function to handle aria-hidden for all child elements 9238 // function updateAriaHiddenState(element) { 9239 // if ($(element).attr('aria-hidden') === 'true') { 9240 // // Add aria-hidden="true" to all children 9241 // $(element).find('*').attr('aria-hidden', 'true'); 9242 // } else { 9243 // // Remove aria-hidden from all children 9244 // $(element).find('*').removeAttr('aria-hidden'); 9245 // } 9246 // } 9247 // // Initial check to apply or remove aria-hidden 9248 // $('.blog-featured-medium__item').each(function () { 9249 // updateAriaHiddenState(this); 9250 // }); 9251 // // MutationObserver to watch for changes to aria-hidden attribute 9252 // var observer = new MutationObserver(function (mutations) { 9253 // mutations.forEach(function (mutation) { 9254 // if (mutation.type === 'attributes' && mutation.attributeName === 'aria-hidden') { 9255 // // Update the aria-hidden state for the mutated element 9256 // updateAriaHiddenState(mutation.target); 9257 // } 9258 // }); 9259 // }); 9260 // // Apply the MutationObserver to each blog-featured-medium__item 9261 // $('.blog-featured-medium__item').each(function () { 9262 // observer.observe(this, { attributes: true }); // Watch for attribute changes 9263 // }); 9264 // }); 9265})(jQuery, Drupal, drupalSettings); 9266 9267/***/ }), 9268
9269/***/ "./src/js/polyfill.js": 9270/*!****************************!*\ 9271 !*** ./src/js/polyfill.js ***! 9272 \****************************/ 9273/*! no static exports found */ 9274/***/ (function(module, exports) { 9275 9276// Add your JS/node package pollyfills here 9277 9278/***/ }), 9279
9280/***/ "./src/js/tnsAda.js": 9281/*!**************************!*\ 9282 !*** ./src/js/tnsAda.js ***! 9283 \**************************/ 9284/*! exports provided: tns */ 9285/***/ (function(module, __webpack_exports__, __webpack_require__) { 9286 9287"use strict"; 9288__webpack_require__.r(__webpack_exports__); 9289/* harmony import */ var _node_modules_tiny_slider_src_tiny_slider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/tiny-slider/src/tiny-slider */ "./node_modules/tiny-slider/src/tiny-slider.js"); 9290/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tns", function() { return _node_modules_tiny_slider_src_tiny_slider__WEBPACK_IMPORTED_MODULE_0__["tns"]; }); 9291 9292// Carousel ADA remediation for TNS slider 2.9.2 9293// https://hub.accessible360.com/kb/articles/476 9294// https://confluence.millenniumweb.com/display/CKB/Accessible+Carousels 9295// 9296// Usage Example: 9297// document.tnsAda.init({ 9298// // ===== Just use standard tns config options 9299// container: '.your-selector-for-wrapping-element', 9300// items: 1, 9301// slideBy: 'page', 9302// autoplay: false, 9303// // ===== Options used for custom ADA code **all optional 9304// nav: true, // BOOLEAN: Create ADA bullet nav? 9305// controls: true, // BOOLEAN: Create ADA prev and next buttons? 9306// reverseNextPrev: false, // BOOLEAN: Reverse prev/next buttons? 9307// adaText: { // OBJECT: Custom text for ADA elements 9308// nav: '<span aria-hidden="true">•</span>', // STRING: Custom bullet nav text 9309// prev: '<span class="sr-only">Previous Slide</span> <i class="icon icon-circle-arrow-left icon-fill-tertiary" aria-hidden="true"></i>', // STRING: Custom prev button text 9310// next: '<span class="sr-only">Next Slide</span> <i class="icon icon-circle-arrow-right icon-fill-tertiary" aria-hidden="true"></i>', // STRING: Custom next button text 9311// instructions: 'This is a carousel. Use Next and Previous buttons to navigate, or jump to a slide with the slide dots.', // STRING: Custom instructions text 9312// goTo: 'Go to slide [x]', // STRING: Custom go to slide text 9313// current: 'Slide [x] of [y]', // STRING: Custom current slide text 9314// } 9315// }); 9316// 9317// TODO: generate/find a unique id for the instance of the initialization. 9318// Use it to namespace all events so they can be unbound and the slider 9319// destroyed. could alternatively just put some logic in to prevent the 9320// same element from being initialized twice. 9321// 9322// TODO: import all currently hardcoded text strings so that the slider can be 9323// translatable. could use data-attributes. could grab them from the 9324// document.tnsAda object. could pass them in with the initialization. 9325// For drupal string translation having them in a template or block is 9326// probably easiest. 9327 9328 9329document.tnsAda = { 9330 init: function init(params) { 9331 //if the container element is not present. do nothing and exit. 9332 if (jQuery(params.container).length < 1) { 9333 return; 9334 } 9335 9336 var orig = this; // Definte options for ADA functions 9337 9338 var opt = { 9339 nav: params.nav, 9340 // Create a custom ADA bullet nav? 9341 controls: params.controls, 9342 // Create custom ADA prev and next buttons? 9343 reverseNextPrev: params.reverseNextPrev // Reverse the action of the next and previous buttons? 9344 9345 }; 9346 9347 if (!params.adaText) { 9348 params.adaText = {}; 9349 } 9350 9351 opt.adaText = { 9352 nav: params.adaText.nav || '<span aria-hidden="true">•</span>', 9353 prev: params.adaText.prev || '<span class="sr-only">Previous Slide</span> <i class="icon icon-circle-arrow-left icon-fill-tertiary" aria-hidden="true"></i>', 9354 next: params.adaText.next || '<span class="sr-only">Next Slide</span> <i class="icon icon-circle-arrow-right icon-fill-tertiary" aria-hidden="true"></i>', 9355 instructions: params.adaText.instructions || "This is a carousel. Use Next and Previous buttons to navigate, or jump to a slide with the slide dots.", 9356 goTo: params.adaText.goTo || "Go to slide [x]", 9357 current: params.adaText.current || "Slide [x] of [y]", 9358 slides: params.adaText.slides || "Slides" 9359 }; // Prepare params object for initialization 9360 9361 params.nav = false;
9362 params.controls = false; 9363 delete params.reverseNextPrev; 9364 delete params.adaText; // Initialize the slider and store it in our opt object. 9365 9366 opt.slider = Object(_node_modules_tiny_slider_src_tiny_slider__WEBPACK_IMPORTED_MODULE_0__["tns"])(params); 9367 9368 if (opt.controls) { 9369 orig.addControls(opt); 9370 } 9371 9372 if (opt.nav) { 9373 orig.addNav(opt); 9374 } 9375 9376 orig.oneTimeFixes(opt); 9377 }, 9378 oneTimeFixes: function oneTimeFixes(opt) { 9379 var orig = this, 9380 slider = opt.slider, 9381 info = slider.getInfo(), 9382 inner = jQuery(info.container).parents(".tns-inner"), 9383 outer = jQuery(info.container).parents(".tns-outer"), 9384 uiEnabled = true; // Add role attribute to the slides 9385 9386 inner.find(".tns-item").attr("role", "group"); // Remove non-compliant live region 9387 9388 outer.find(".tns-liveregion").removeAttr("aria-live").removeAttr("aria-atomic").attr("aria-hidden", "true").hide(); // Add role and label to the carousel incase its a ul 9389 9390 inner.find(".tns-carousel").attr("role", "presentation").attr("aria-label", opt.adaText.slides); // Add carousel instructions 9391 9392 outer.prepend('<p class="sr-only tns-custom-instructions">' + opt.adaText.instructions + "</p>"); // Hide controls if all items are displayed at once 9393 9394 jQuery(window).on("resize", function () { 9395 orig.updateActive("", opt); 9396 9397 if (slider.getInfo().items >= info.slideCount) { 9398 toggleUi("off"); 9399 } else { 9400 toggleUi("on"); 9401 } 9402 }); 9403 jQuery(window).trigger("resize"); 9404 9405 function toggleUi(dir) { 9406 if (dir == "off" && uiEnabled) { 9407 outer.find(".tns-custom-controls, .tns-custom-nav, .tns-custom-instructions").hide().attr("aria-hidden", "true"); 9408 orig.updateActive(0, opt); 9409 uiEnabled = false; 9410 } 9411 9412 if (dir == "on" && !uiEnabled) { 9413 outer.find(".tns-custom-controls, .tns-custom-nav, .tns-custom-instructions").show().removeAttr("aria-hidden"); 9414 uiEnabled = true; 9415 } 9416 } 9417 }, 9418 addControls: function addControls(opt) { 9419 var orig = this, 9420 slider = opt.slider, 9421 info = slider.getInfo(), 9422 inner = jQuery(info.container).parents(".tns-inner"); // Add prev/next buttons and events 9423 // Note: TNS sliders interpretation of "next and previous" is a bit conterintuitive. 9424 // I swapped them by default. The reverseNextPrev flag allows you to switch back. 9425 9426 if (opt.reverseNextPrev) { 9427 inner.prepend('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-prev product-category__carousel-prev">' + opt.adaText.prev + "</button></div>"); 9428 inner.append('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-next product-category__carousel-next">' + opt.adaText.next + "</button></div>"); 9429 } else { 9430 inner.prepend('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-prev tns-custom-reverse product-category__carousel-prev">' + opt.adaText.prev + "</button></div>"); 9431 inner.append('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-next tns-custom-reverse product-category__carousel-next">' + opt.adaText.next + "</button></div>"); 9432 } 9433 9434 inner.find(".tns-custom-next").on("click", function () { 9435 orig.updateActive("next", opt); 9436 }); 9437 inner.find(".tns-custom-prev").on("click", function () { 9438 orig.updateActive("prev", opt); 9439 }); 9440 }, 9441 addNav: function addNav(opt) { 9442 var orig = this, 9443 slider = opt.slider, 9444 info = slider.getInfo(), 9445 inner = jQuery(info.container).parents(".tns-inner"); // Add bullet nav and events 9446 9447 var newNav = '<ul class="tns-custom-nav">'; 9448 9449 for (var i = 0; i < info.slideCount; i++) { 9450 newNav = newNav + '<li><button type="button" class="tns-custom-nav-item" data-tns-custom-nav-id="' + i + '" aria-label="' + opt.adaText.goTo.replace("[x]", i + 1) + '">' + opt.navText + "</button></li>"; 9451 } 9452 9453 inner.append(newNav + "</ul>"); 9454 inner.find("[data-tns-custom-nav-id]").on("click", function () { 9455 var target = jQuery(this).attr("data-tns-custom-nav-id"); 9456 orig.updateActive(target, opt); 9457 }); 9458 }, 9459 updateActive: function updateActive(target, opt) { 9460 var focusable = "[href], button, input, select, textarea", 9461 slider = opt.slider, 9462 info = slider.getInfo(), 9463 inner = jQuery(info.container).parents(".tns-inner"); // Navigate to the target slide 9464 9465 if (target.length > 0) { 9466 slider.goTo(target); 9467 } // Modify slides and bullet nav to reflect the new active slide state 9468 9469 9470 setTimeout(function () { 9471 var newInfo = slider.getInfo(); // Make all focusable elements in hidden slides not focusable and update the aria properties of all slides 9472 9473 inner.find(".tns-item").removeAttr("aria-label").attr("tabindex", "-1").attr("aria-hidden", "true").find(focusable).attr("tabindex", "-1"); 9474 9475 for (var i = newInfo.index; i < newInfo.items + newInfo.index; i++) { 9476 inner.find(".tns-item").eq(i).removeAttr("tabindex").removeAttr("aria-hidden").attr("aria-label", opt.adaText.current.replace("[x]", i - newInfo.index + newInfo.displayIndex).replace("[y]", newInfo.slideCount)).find(focusable).removeAttr("tabindex"); 9477 } // Update the bullet nav to reflect the currently active slide. 9478 9479 9480 if (opt.nav) { 9481 var navBtns = inner.find("[data-tns-custom-nav-id]"), 9482 activeNavBtn = inner.find('[data-tns-custom-nav-id="' + (newInfo.displayIndex - 1) + '"]'); 9483 navBtns.removeAttr("aria-current"); 9484 activeNavBtn.attr("aria-current", "true"); 9485 } 9486 }, 100); 9487 } 9488}; 9489 9490/***/ }), 9491 9492/***/ 9: 9493/*!***********************************************!*\ 9494 !*** multi ./src/components/heroes/heroes.js ***! 9495 \***********************************************/ 9496/*! no static exports found */ 9497/***/ (function(module, exports, __webpack_require__) { 9498 9499module.exports = __webpack_require__(/*! /var/www/html/dev_bc_bonmatin/html/web/themes/custom/bc_brand/src/components/heroes/heroes.js */"./src/components/heroes/heroes.js"); 9500 9501 9502/***/ }) 9503 9504/******/ });; 9505/******/ (function(modules) { // webpackBootstrap 9506/******/ // The module cache 9507/******/ var installedModules = {}; 9508/******/ 9509/******/ // The require function 9510/******/ function __webpack_require__(moduleId) { 9511/******/ 9512/******/ // Check if module is in cache 9513/******/ if(installedModules[moduleId]) { 9514/******/ return installedModules[moduleId].exports; 9515/******/ } 9516/******/ // Create a new module (and put it into the cache) 9517/******/ var module = installedModules[moduleId] = { 9518/******/ i: moduleId, 9519/******/ l: false, 9520/******/ exports: {} 9521/******/ }; 9522/******/ 9523/******/ // Execute the module function 9524/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 9525/******/ 9526/******/ // Flag the module as loaded
vendor: 2,823 bytes, lines 9527-9592
9527/******/ module.l = true; 9528/******/ 9529/******/ // Return the exports of the module 9530/******/ return module.exports; 9531/******/ } 9532/******/ 9533/******/ 9534/******/ // expose the modules object (__webpack_modules__) 9535/******/ __webpack_require__.m = modules; 9536/******/ 9537/******/ // expose the module cache 9538/******/ __webpack_require__.c = installedModules; 9539/******/ 9540/******/ // define getter function for harmony exports 9541/******/ __webpack_require__.d = function(exports, name, getter) { 9542/******/ if(!__webpack_require__.o(exports, name)) { 9543/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 9544/******/ } 9545/******/ }; 9546/******/ 9547/******/ // define __esModule on exports 9548/******/ __webpack_require__.r = function(exports) { 9549/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 9550/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 9551/******/ } 9552/******/ Object.defineProperty(exports, '__esModule', { value: true }); 9553/******/ }; 9554/******/ 9555/******/ // create a fake namespace object 9556/******/ // mode & 1: value is a module id, require it 9557/******/ // mode & 2: merge all properties of value into the ns 9558/******/ // mode & 4: return value when already ns object 9559/******/ // mode & 8|1: behave like require 9560/******/ __webpack_require__.t = function(value, mode) { 9561/******/ if(mode & 1) value = __webpack_require__(value); 9562/******/ if(mode & 8) return value; 9563/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 9564/******/ var ns = Object.create(null); 9565/******/ __webpack_require__.r(ns); 9566/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 9567/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 9568/******/ return ns; 9569/******/ }; 9570/******/ 9571/******/ // getDefaultExport function for compatibility with non-harmony modules 9572/******/ __webpack_require__.n = function(module) { 9573/******/ var getter = module && module.__esModule ? 9574/******/ function getDefault() { return module['default']; } : 9575/******/ function getModuleExports() { return module; }; 9576/******/ __webpack_require__.d(getter, 'a', getter); 9577/******/ return getter; 9578/******/ }; 9579/******/ 9580/******/ // Object.prototype.hasOwnProperty.call 9581/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 9582/******/ 9583/******/ // __webpack_public_path__ 9584/******/ __webpack_require__.p = "/"; 9585/******/ 9586/******/ 9587/******/ // Load entry module and return exports 9588/******/ return __webpack_require__(__webpack_require__.s = 8); 9589/******/ }) 9590/************************************************************************/ 9591/******/ ({ 9592
9593/***/ "./src/components/header/header.js": 9594/*!*****************************************!*\ 9595 !*** ./src/components/header/header.js ***! 9596 \*****************************************/ 9597/*! no static exports found */ 9598/***/ (function(module, exports, __webpack_require__) { 9599 9600"use strict"; 9601 9602 9603(function ($, Drupal) { 9604 var valueTerm = $("#term"); 9605 var searchToggle = false; 9606 var w = window.innerWidth; 9607 var $form = $(".search__header form"); //array of view names included in search 9608 9609 var searchViews = ['search_products', 'search_recipes', 'search_blog', 'search_basic_pages']; 9610 $("#search-container #close-search").removeAttr('aria-expanded'); 9611 $('#search-container .btn.submit').attr('tabindex', '-1'); 9612 $('#search-container input').attr('tabindex', '-1'); // ======================================================================================= 9613 // Hide Background from Screen Readers 9614 // ======================================================================================= 9615 9616 function hideModalBG(e) { 9617 var focusableElements = 'button:not(.hidden), [href]:not(.hidden), input:not(.hidden), select:not(.hidden), textarea:not(.hidden), [tabindex]:not([tabindex="-1"])'; // All focusable elements 9618 9619 var modalElements = $(e).find(focusableElements) + $('.open-search'); //on show 9620 //console.log("hide items", $("body > *").not(e)); 9621 9622 $("body > *").not(e).each(function () { 9623 var ariaHidden = $(this).attr("aria-hidden"); 9624 9625 if (typeof ariaHidden == "undefined") { 9626 ariaHidden = "false"; 9627 } 9628 9629 $(this).attr("data-aria-hidden", ariaHidden); 9630 }); 9631 $("body > *").not(e).attr("aria-hidden", true); 9632 $("body").find(focusableElements).not(e).each(function () { 9633 var eTabIndex = $(this).attr("tabindex"); 9634 9635 if (typeof eTabIndex == "undefined") { 9636 eTabIndex = 0; 9637 } 9638 9639 $(this).attr("data-tabindex", eTabIndex); 9640 }); 9641 $("body").find(focusableElements).not(modalElements).attr("tabindex", "-1"); 9642 } 9643 9644 function showModalBG(e) { 9645 var focusableElements = "button:not(.hidden), [href]:not(.hidden), input:not(.hidden), select:not(.hidden), textarea:not(.hidden)"; // All focusable elements 9646 //on hide 9647 9648 $("body > *").each(function (index, el) { 9649 var ariaHidden = $(el).attr("data-aria-hidden"); 9650 9651 if (ariaHidden == "false") { 9652 $(el).removeAttr("aria-hidden"); 9653 } else { 9654 $(el).attr("aria-hidden", ariaHidden); 9655 } 9656 }); 9657 $("body > *").removeAttr("data-aria-hidden"); 9658 $("body").find(focusableElements).each(function (index, el) { 9659 var eTabIndex = $(el).attr("data-tabindex"); 9660 9661 if (eTabIndex == 0) { 9662 $(el).removeAttr("tabindex"); 9663 } else { 9664 $(el).attr("tabindex", eTabIndex); 9665 } 9666 }); 9667 $("body").find(focusableElements).removeAttr("data-tabindex"); 9668 } //focus trap 9669 9670 9671 function focusTrap(trapSelector) { 9672 console.log('FOCUS TRAP RUNNING'); // Focus Trap: Causes the tab key to loop focus within the given selector. 9673 9674 var focusableElements = 'button:not(.hidden), [href]:not(.hidden), input:not(.hidden), select:not(.hidden), textarea:not(.hidden), [tabindex]:not([tabindex="-1"])'; // All focusable elements 9675 9676 document.addEventListener('keydown', function (e) { 9677 var trap = document.querySelector(trapSelector); // If the key pressed is not 'Tab' or the trap element is not present: do nothing 9678 9679 var isTabPressed = e.key === 'Tab' || e.keyCode === 9; 9680 9681 if (!isTabPressed || !trap) { 9682 return; 9683 } 9684 9685 var focusableContent = trap.querySelectorAll(focusableElements), 9686 firstFocusableElement = focusableContent[0], 9687 // first focusable element 9688 lastFocusableElement = focusableContent[focusableContent.length - 1]; // last focusable element 9689 9690 if (e.shiftKey) { 9691 // if shift + tab on first element, focus the last focusable element 9692 if (document.activeElement === firstFocusableElement) { 9693 lastFocusableElement.focus(); // 9694 9695 e.preventDefault(); // console.log("document.activeElement"); 9696 } 9697 } else { 9698 console.log(document.activeElement); // if tab on last element, focus the first focusable element 9699 9700 if (document.activeElement === lastFocusableElement) { 9701 firstFocusableElement.focus(); 9702 e.preventDefault(); // console.log("document.activeElement"); 9703 } 9704 } // console.log('FOCASABLE last',lastFocusableElement); 9705 // console.log('FOCASABLE first',firstFocusableElement); 9706 // console.log(document.activeElement); 9707 9708 }); 9709 } // focusTrap('#search-container'); 9710 9711 9712 Drupal.behaviors.header = { 9713 attach: function attach(context, settings) { 9714 //only attach once 9715 //https://www.lullabot.com/articles/understanding-javascript-behaviors-in-drupal 9716 //https://drupal.stackexchange.com/questions/244492/jquery-once-onload 9717 // $('.page__header', context).once('search-controls').each(function () { 9718 // $(context).find('.navbar-actions').once('search-controls').each(function(context){ 9719 // console.log("attach search-controls"); 9720 // let clearButton = $(".clear", context);
9721 $(context).find("#search-container #close-search").off("click.searchclose").on("click.searchclose", function (e) { 9722 Drupal.behaviors.header.toggleSearch(context); 9723 showModalBG("#search-container"); 9724 setTimeout(function () { 9725 $("button.open-search[aria-expanded]").focus(); 9726 }, 0); 9727 $('#search-container .btn.submit').attr('tabindex', '-1'); 9728 $('#search-container input').attr('tabindex', '-1'); 9729 }); 9730 $(context).find(".navbar-actions").once("search-controls").each(function (context) { 9731 // console.log("attach search-controls"); 9732 var clearButton = $(".clear", context); //open search 9733 // console.log($('.navbar-actions .icon', context)); 9734 9735 $(this).find('.open-search').on("click", function (e) { 9736 e.preventDefault(); 9737 Drupal.behaviors.header.toggleSearch(context); 9738 hideModalBG("#search-container"); 9739 $("#search-container").focus(); // $('.search__filters li a').addClass('hidden'); 9740 9741 console.log('toggle search'); 9742 }); 9743 $(".we-mega-menu-li", context).on("mousedown", function (e) { 9744 if (searchToggle) Drupal.behaviors.header.toggleSearch(context); 9745 }); 9746 $(window).resize(function () { 9747 var btnCloseMenu = $(".btn-close"); 9748 9749 if (w != window.innerWidth && window.innerWidth <= 991) { 9750 $("body").removeClass("page__header--active"); 9751 $("body").removeClass("toggled"); 9752 $(".navbar-we-mega-menu").removeClass("we-mobile-megamenu-active has-clicked"); 9753 $(".we-mega-menu-submenu").removeAttr("style"); 9754 btnCloseMenu.removeClass("d-none"); 9755 searchToggle = false; 9756 $('.navbar-actions .icon-search').attr('aria-expanded', 'false'); 9757 } 9758 }); // $("#main-menu-button").click(function () { 9759 // $("body").removeClass("page__header--active"); 9760 // // console.log("menu open"); 9761 // }); 9762 9763 valueTerm.on('input', function () { 9764 // console.log($(this).val()); 9765 if ($(this).val() == '') { 9766 clearButton.removeClass("d-inline-flex"); 9767 } else { 9768 clearButton.addClass("d-inline-flex"); 9769 } 9770 }); //search navigation 9771 9772 $(".search-results-filter button").click(function () { 9773 // console.log('test'); 9774 $(".search-results-filter button").attr("aria-pressed", "false"); 9775 $(this).attr("aria-pressed", "true"); 9776 var selected = $(this).attr("data-filter"); 9777 9778 if (selected) { 9779 $(".search-results .views-element-container").addClass("d-none"); 9780 $(".search-results .views-element-container" + selected).removeClass("d-none"); 9781 } else { 9782 //show all 9783 $(".search-results .views-element-container").removeClass("d-none"); 9784 Drupal.behaviors.header.checkEmpty(context); 9785 } 9786 }); 9787 var replaceState = window.history.replaceState; //history state is loaded (run search) 9788 9789 window.history.replaceState = function (e) { 9790 replaceState.apply(window.history, arguments); 9791 var urlParams = new URLSearchParams(window.location.search); 9792 var term = urlParams.get('term'); //update the values of the individual hidden forms 9793 9794 $(".search-wrapper input[data-drupal-selector='edit-term']").val(term); 9795 $(".search-wrapper input[data-drupal-selector='edit-term']").attr("value", term); //if search term found in query string 9796 9797 if (term) { 9798 console.log(term); 9799 $('.search-wrapper').addClass('d-none'); // clearButton.addClass("d-inline-flex"); 9800 // iterate through the various views instance names to find our views 9801 9802 var instances = Drupal.views.instances; 9803 var countViewsLeft = searchViews.length; //number of views specified 9804 9805 $.each(instances, function getInstance(index, element) { 9806 if (searchViews.includes(element.settings.view_name)) { 9807 console.log(element.settings.view_name); 9808 element.element_settings.url = "/views/ajax?term=" + term; 9809 element.settings.view_args = "term/" + term; 9810 element.element_settings.refreshViewAjax = "/views/ajax?term=" + term + "&_wrapper_format=drupal_ajax"; 9811 console.log(element); //callback function for Refresh View 9812 //from: https://www.vhinandrich.com/blog/drupal-8-show-drupal-throbber-button-manually-calls-views-ajax-refreshview 9813 9814 element.refreshViewAjax.success = function (response, status) { 9815 // Call the original callback 9816 Drupal.Ajax.prototype.success.call(this, response, status); //add custom callback functions below \/ 9817 9818 countViewsLeft -= 1; //remove one 9819 9820 Drupal.behaviors.header.updateSearchMsg(context, countViewsLeft); 9821 }; 9822 9823 $('.js-view-dom-id-' + element.settings.view_dom_id, context).trigger('RefreshView'); 9824 setTimeout(function () { 9825 $('.js-view-dom-id-' + element.settings.view_dom_id, context).trigger('RefreshView'); 9826 }, 3000); 9827 } 9828 }); 9829 } 9830 }; // search - submit 9831 9832 9833 $(".search__header .submit", context).on('click', function (e) { 9834 e.preventDefault(); //console.log($form.get(0).reportValidity()); 9835 9836 if ($form.get(0).reportValidity()) { 9837 var url = new URL(window.location); 9838 var userSearchTerm = $('#term', context).val(); // console.log(userSearchTerm); 9839 9840 url.searchParams.set('term', userSearchTerm); 9841 console.log("url", url); 9842 window.history.replaceState({}, '', url); 9843 } 9844 }); 9845 }); 9846 }, 9847 checkEmpty: function checkEmpty(context) { 9848 var $hasProducts = $(".view-search-products .views-row").length; 9849 var $hasRecipes = $(".view-search-recipes .views-row").length; 9850 var $hasArticles = $(".view-search-blog .views-row").length; 9851 var $hasBasicPages = $(".view-search-basic-pages .views-row").length; 9852 9853 if (!$hasProducts && !$hasRecipes && !$hasArticles && !$hasBasicPages) { 9854 // console.log('has no products or recipes or articles or basic pages'); 9855 $(".block-views-blocksearch-recipes-block-1").addClass('d-none'); 9856 $(".block-views-blocksearch-blog-block-1").addClass('d-none'); 9857 $(".block-views-blocksearch-basic-pages-block-1").addClass('d-none'); 9858 } else if (!$hasProducts) { 9859 // console.log('has no products'); 9860 // console.log('removed text') 9861 $(".block-views-blocksearch-products-block-1").addClass('d-none'); 9862 } else if (!$hasRecipes) { 9863 // console.log('has no recipes'); 9864 $(".block-views-blocksearch-recipes-block-1").addClass('d-none'); 9865 } else if (!$hasArticles) { 9866 // console.log('has no articles'); 9867 $(".block-views-blocksearch-blog-block-1").addClass('d-none'); 9868 } else if (!$hasBasicPages) { 9869 // console.log('has no basic pages'); 9870 $(".block-views-blocksearch-basic-pages-block-1").addClass('d-none'); 9871 } 9872 }, 9873 updateSearchMsg: function updateSearchMsg(context, countViewsLeft) { 9874 // console.log(context); 9875 console.log("countViewsLeft:", countViewsLeft); 9876 9877 if (countViewsLeft == 0) { 9878 setTimeout(function () { 9879 Drupal.behaviors.header.checkEmpty(context); //no views left to review, remove the display none class 9880 9881 $('.search-wrapper').removeClass('d-none'); 9882 }, 5500); 9883 } 9884 }, 9885 toggleSearch: function toggleSearch(context) { 9886 // $("main").toggleClass("overlay_filter"); 9887 // setTimeout(function() { 9888 var btnCloseMenu = $(".btn-close"); 9889 searchToggle = !searchToggle; 9890 9891 if (searchToggle) { 9892 if (window.innerWidth >= 991) { 9893 $(".we-mega-menu-li.dropdown-menu").removeClass("modal"); 9894 } 9895 9896 Drupal.behaviors.header.setFocusSearch(context); 9897 btnCloseMenu.addClass("d-none"); 9898 console.log('open'); 9899 $('.navbar-actions .open-search').attr('aria-expanded', 'true'); 9900 $('#search-container').removeClass('d-none'); 9901 $('#search-container').removeAttr('tabindex'); 9902 $('#search-container .btn').removeAttr('tabindex'); 9903 $('#search-container input').removeAttr('tabindex'); 9904 $('.page__content').attr('inert', true); 9905 $('.footer').attr('inert', true); 9906 $('.navbar-top').attr('inert', true); 9907 $('#main-menu .main-menu').attr('inert', true); 9908 $('#block-bc-brand-sitebranding').attr('inert', true); 9909 $('.skip-link').attr('inert', true); // $("button.open-search").attr('tabindex', '1'); 9910 // focusTrap('#block-bc-brand-search'); 9911 } else { 9912 btnCloseMenu.removeClass("d-none"); 9913 console.log('closed'); 9914 $('#search-container').addClass('d-none'); 9915 $('#search-container').attr('tabindex', '-1'); 9916 $('.navbar-actions .open-search').attr('aria-expanded', 'false'); 9917 $('#search-container .btn.submit').attr('tabindex', '-1'); 9918 $('#search-container input').attr('tabindex', '-1'); 9919 $('.page__content').removeAttr('inert'); 9920 $('.footer').removeAttr('inert'); 9921 $('.navbar-top').removeAttr('inert'); 9922 $('#main-menu .main-menu').removeAttr('inert'); 9923 $('#block-bc-brand-sitebranding').removeAttr('inert'); 9924 $('.skip-link').removeAttr('inert'); // $("button.open-search").attr('tabindex', '-1'); 9925 } 9926 9927 $("body").toggleClass("page__header--active"); // }, 3000); 9928 }, 9929 clearSearchTerm: function clearSearchTerm(context) { 9930 valueTerm.val(""); 9931 $('.search-wrapper').addClass('d-none'); 9932 }, 9933 setFocusSearch: function setFocusSearch(context) { 9934 valueTerm.focus(); 9935 } 9936 }; 9937})(jQuery, Drupal); 9938 9939/***/ }), 9940 9941/***/ 8: 9942/*!***********************************************!*\ 9943 !*** multi ./src/components/header/header.js ***! 9944 \***********************************************/ 9945/*! no static exports found */ 9946/***/ (function(module, exports, __webpack_require__) { 9947 9948module.exports = __webpack_require__(/*! /var/www/html/dev_bc_bonmatin/html/web/themes/custom/bc_brand/src/components/header/header.js */"./src/components/header/header.js"); 9949 9950 9951/***/ }) 9952 9953/******/ });; 9954/******/ (function(modules) { // webpackBootstrap 9955/******/ // The module cache 9956/******/ var installedModules = {}; 9957/******/ 9958/******/ // The require function 9959/******/ function __webpack_require__(moduleId) { 9960/******/ 9961/******/ // Check if module is in cache 9962/******/ if(installedModules[moduleId]) { 9963/******/ return installedModules[moduleId].exports; 9964/******/ } 9965/******/ // Create a new module (and put it into the cache) 9966/******/ var module = installedModules[moduleId] = { 9967/******/ i: moduleId, 9968/******/ l: false, 9969/******/ exports: {} 9970/******/ }; 9971/******/ 9972/******/ // Execute the module function 9973/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 9974/******/ 9975/******/ // Flag the module as loaded
vendor: 2,824 bytes, lines 9976-10041
9976/******/ module.l = true; 9977/******/ 9978/******/ // Return the exports of the module 9979/******/ return module.exports; 9980/******/ } 9981/******/ 9982/******/ 9983/******/ // expose the modules object (__webpack_modules__) 9984/******/ __webpack_require__.m = modules; 9985/******/ 9986/******/ // expose the module cache 9987/******/ __webpack_require__.c = installedModules; 9988/******/ 9989/******/ // define getter function for harmony exports 9990/******/ __webpack_require__.d = function(exports, name, getter) { 9991/******/ if(!__webpack_require__.o(exports, name)) { 9992/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 9993/******/ } 9994/******/ }; 9995/******/ 9996/******/ // define __esModule on exports 9997/******/ __webpack_require__.r = function(exports) { 9998/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 9999/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 10000/******/ } 10001/******/ Object.defineProperty(exports, '__esModule', { value: true }); 10002/******/ }; 10003/******/ 10004/******/ // create a fake namespace object 10005/******/ // mode & 1: value is a module id, require it 10006/******/ // mode & 2: merge all properties of value into the ns 10007/******/ // mode & 4: return value when already ns object 10008/******/ // mode & 8|1: behave like require 10009/******/ __webpack_require__.t = function(value, mode) { 10010/******/ if(mode & 1) value = __webpack_require__(value); 10011/******/ if(mode & 8) return value; 10012/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 10013/******/ var ns = Object.create(null); 10014/******/ __webpack_require__.r(ns); 10015/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 10016/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 10017/******/ return ns; 10018/******/ }; 10019/******/ 10020/******/ // getDefaultExport function for compatibility with non-harmony modules 10021/******/ __webpack_require__.n = function(module) { 10022/******/ var getter = module && module.__esModule ? 10023/******/ function getDefault() { return module['default']; } : 10024/******/ function getModuleExports() { return module; }; 10025/******/ __webpack_require__.d(getter, 'a', getter); 10026/******/ return getter; 10027/******/ }; 10028/******/ 10029/******/ // Object.prototype.hasOwnProperty.call 10030/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 10031/******/ 10032/******/ // __webpack_public_path__ 10033/******/ __webpack_require__.p = "/"; 10034/******/ 10035/******/ 10036/******/ // Load entry module and return exports 10037/******/ return __webpack_require__(__webpack_require__.s = 12); 10038/******/ }) 10039/************************************************************************/ 10040/******/ ({ 10041
10042/***/ "./src/components/navbar/navbar.js": 10043/*!*****************************************!*\ 10044 !*** ./src/components/navbar/navbar.js ***! 10045 \*****************************************/ 10046/*! no static exports found */ 10047/***/ (function(module, exports) { 10048 10049(function ($, Drupal) { 10050 Drupal.behaviors.navbar = { 10051 attach: function attach(context) { 10052 var $navbar = $('#navbar'), 10053 prevScroll = 0, 10054 scrollDir = 'up'; 10055 $(document).off('scroll.navdir').on('scroll.navdir', function () { 10056 var st = $(window).scrollTop(); 10057 10058 if (st < prevScroll && scrollDir === 'down') { 10059 //console.log('up',st); 10060 scrollDir = 'up'; 10061 $navbar.addClass('scroll-dir-up'); 10062 prevScroll = st; 10063 return; 10064 } 10065 10066 if (st > prevScroll && scrollDir === 'up' && st > 100) { 10067 //console.log('down',st); 10068 $navbar.removeClass('scroll-dir-up'); 10069 scrollDir = 'down'; 10070 } 10071 10072 prevScroll = st; 10073 return; 10074 }); 10075 } 10076 }; 10077})(jQuery, Drupal); 10078 10079/***/ }), 10080 10081/***/ 12: 10082/*!***********************************************!*\ 10083 !*** multi ./src/components/navbar/navbar.js ***! 10084 \***********************************************/ 10085/*! no static exports found */ 10086/***/ (function(module, exports, __webpack_require__) { 10087 10088module.exports = __webpack_require__(/*! /var/www/html/dev_bc_bonmatin/html/web/themes/custom/bc_brand/src/components/navbar/navbar.js */"./src/components/navbar/navbar.js"); 10089 10090 10091/***/ }) 10092 10093/******/ });; 10094/** 10095* DO NOT EDIT THIS FILE. 10096* See the following change record for more information, 10097* https://www.drupal.org/node/2815083 10098* @preserve 10099**/ 10100function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 10101function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } 10102function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } 10103function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 10104function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } 10105function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } 10106(function ($, Drupal, cookies) { 10107 var deprecatedMessageSuffix = "is deprecated in Drupal 9.0.0 and will be removed in Drupal 10.0.0. Use the core/js-cookie library instead. See https://www.drupal.org/node/3104677"; 10108 var isFunction = function isFunction(obj) { 10109 return Object.prototype.toString.call(obj) === '[object Function]'; 10110 }; 10111 var parseCookieValue = function parseCookieValue(value, parseJson) { 10112 if (value.indexOf('"') === 0) { 10113 value = value.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 10114 } 10115 try { 10116 value = decodeURIComponent(value.replace(/\+/g, ' ')); 10117 return parseJson ? JSON.parse(value) : value; 10118 } catch (e) {} 10119 }; 10120 var reader = function reader(cookieValue, cookieName, converter, readUnsanitized, parseJson) { 10121 var value = readUnsanitized ? cookieValue : parseCookieValue(cookieValue, parseJson); 10122 if (converter !== undefined && isFunction(converter)) { 10123 return converter(value, cookieName); 10124 } 10125 return value; 10126 };
10127 $.cookie = function (key) { 10128 var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; 10129 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; 10130 Drupal.deprecationError({ 10131 message: "jQuery.cookie() ".concat(deprecatedMessageSuffix) 10132 }); 10133 if (value !== undefined && !isFunction(value)) { 10134 var attributes = _objectSpread(_objectSpread({}, $.cookie.defaults), options); 10135 if (typeof attributes.expires === 'string' && attributes.expires !== '') { 10136 attributes.expires = new Date(attributes.expires); 10137 } 10138 var cookieSetter = cookies.withConverter({ 10139 write: function write(cookieValue) { 10140 return encodeURIComponent(cookieValue); 10141 } 10142 }); 10143 value = $.cookie.json && !$.cookie.raw ? JSON.stringify(value) : String(value); 10144 return cookieSetter.set(key, value, attributes); 10145 } 10146 var userProvidedConverter = value; 10147 var cookiesShim = cookies.withConverter({ 10148 read: function read(cookieValue, cookieName) { 10149 return reader(cookieValue, cookieName, userProvidedConverter, $.cookie.raw, $.cookie.json); 10150 } 10151 }); 10152 if (key !== undefined) { 10153 return cookiesShim.get(key); 10154 } 10155 var results = cookiesShim.get();
10156 Object.keys(results).forEach(function (resultKey) { 10157 if (results[resultKey] === undefined) { 10158 delete results[resultKey]; 10159 } 10160 }); 10161 return results; 10162 }; 10163 $.cookie.defaults = _objectSpread({ 10164 path: '' 10165 }, cookies.defaults); 10166 $.cookie.json = false; 10167 $.cookie.raw = false; 10168 $.removeCookie = function (key, options) { 10169 Drupal.deprecationError({ 10170 message: "jQuery.removeCookie() ".concat(deprecatedMessageSuffix) 10171 }); 10172 cookies.remove(key, _objectSpread(_objectSpread({}, $.cookie.defaults), options)); 10173 return !cookies.get(key); 10174 }; 10175})(jQuery, Drupal, window.Cookies);; 10176(function ($, Drupal) { 10177 Drupal.behaviors.provinceSelector = { 10178 attach: function (context, settings) { 10179 // When juicer.io block is enabled it breaks jQuery.once, The following 10180 // is a fix for this behavior. 10181 let queryString = window.location.search; 10182 let urlParams = new URLSearchParams(queryString); 10183 let regionFocus = urlParams.get('regionFocus'); 10184 if (regionFocus != null) { 10185 $("#region-select").focus(); 10186 var simpleLiveCurl=location.protocol + '//' + location.host + location.pathname; 10187 window.history.replaceState( {} , 'regionFocus', simpleLiveCurl); 10188 } 10189 let $selector = null; 10190 let $selector_mobile = null; 10191 if (typeof jQuery.fn.once !== "undefined") { 10192 $selector = $("#province-selector select").once("provinceSelector"); 10193 $selector_mobile = $("#province-selector-mobile select").once( 10194 "provinceSelector" 10195 ); 10196 } else { 10197 $selector = $("#province-selector select"); 10198 $selector_mobile = $("#province-selector-mobile select"); 10199 } 10200 provinceSelector.setDefault(); 10201 // Bypass megamenu caching issue 10202 const activeProvince = provinceSelector.getProvince(); 10203 10204 $('option', $selector_mobile).removeAttr('selected') 10205 $selector_mobile.val(activeProvince); 10206 10207 $selector.on("change", () => { 10208 const region = $("option:selected", $selector).data("region"); 10209 provinceSelector.setCookie($selector.val(), region); 10210 }); 10211 10212 $selector_mobile.on("change", () => { 10213 // Fix issue with variable undefined 10214 let $sMobile = $("#province-selector-mobile select"); 10215 const region = $("option:selected", $sMobile).data("region"); 10216 provinceSelector.setCookie($sMobile.val(), region); 10217 }); 10218 }, 10219 }; 10220 10221 // Helper object. 10222 const provinceSelector = { 10223 provinceCookie: "currentProvince", 10224 regionCookie: "currentRegion", 10225 setDefault: () => { 10226 // Get default province from backend integration. 10227 $.cookie( 10228 provinceSelector.provinceCookie, drupalSettings.defaultProvince, 10229 { path: "/" } 10230 ); 10231 $.cookie( 10232 provinceSelector.regionCookie, drupalSettings.defaultRegion, 10233 { path: "/" } 10234 ); 10235 }, 10236 setCookie: (province, region) => { 10237 $.cookie(provinceSelector.provinceCookie, province, { path: "/" }); 10238 $.cookie(provinceSelector.regionCookie, region, { path: "/" }); 10239 // document.location.reload(true); 10240 let queryString = window.location.search; 10241 let urlParams = new URLSearchParams(queryString); 10242 urlParams.delete('regionFocus'); 10243 urlParams.set('regionFocus', ''); 10244 document.location.href += '?' + urlParams; 10245 }, 10246 getProvince: () => { 10247 return $.cookie(provinceSelector.provinceCookie) 10248 } 10249 }; 10250})(jQuery, Drupal); 10251; 10252/*! 10253 * jQuery Form Plugin 10254 * version: 4.3.0 10255 * Requires jQuery v1.7.2 or later 10256 * Project repository: https://github.com/jquery-form/form 10257 10258 * Copyright 2017 Kevin Morris 10259 * Copyright 2006 M. Alsup 10260 10261 * Dual licensed under the LGPL-2.1+ or MIT licenses 10262 * https://github.com/jquery-form/form#license 10263 10264 * This library is free software; you can redistribute it and/or 10265 * modify it under the terms of the GNU Lesser General Public 10266 * License as published by the Free Software Foundation; either 10267 * version 2.1 of the License, or (at your option) any later version. 10268 * This library is distributed in the hope that it will be useful, 10269 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10270 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10271 * Lesser General Public License for more details. 10272 */ 10273!function(r){"function"==typeof define&&define.amd?define(["jquery"],r):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),r(t),t}:r(jQuery)}(function(q){"use strict";var m=/\r?\n/g,S={};S.fileapi=void 0!==q('<input type="file">').get(0).files,S.formdata=void 0!==window.FormData;var _=!!q.fn.prop;function o(e){var t=e.data;e.isDefaultPrevented()||(e.preventDefault(),q(e.target).closest("form").ajaxSubmit(t))}function i(e){var t=e.target,r=q(t);if(!r.is("[type=submit],[type=image]")){var a=r.closest("[type=submit]");if(0===a.length)return;t=a[0]}var n,o=t.form;"image"===(o.clk=t).type&&(void 0!==e.offsetX?(o.clk_x=e.offsetX,o.clk_y=e.offsetY):"function"==typeof q.fn.offset?(n=r.offset(),o.clk_x=e.pageX-n.left,o.clk_y=e.pageY-n.top):(o.clk_x=e.pageX-t.offsetLeft,o.clk_y=e.pageY-t.offsetTop)),setTimeout(function(){o.clk=o.clk_x=o.clk_y=null},100)}function N(){var e;q.fn.ajaxSubmit.debug&&(e="[jquery.form] "+Array.prototype.join.call(arguments,""),window.console&&window.console.log?window.console.log(e):window.opera&&window.opera.postError&&window.opera.postError(e))}q.fn.attr2=function(){if(!_)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},q.fn.ajaxSubmit=function(M,e,t,r){if(!this.length)return N("ajaxSubmit: ski
10273pping submit process - no element selected"),this;var O,a,n,o,X=this;"function"==typeof M?M={success:M}:"string"==typeof M||!1===M&&0<arguments.length?(M={url:M,data:e,dataType:t},"function"==typeof r&&(M.success=r)):void 0===M&&(M={}),O=M.method||M.type||this.attr2("method"),n=(n=(n="string"==typeof(a=M.url||this.attr2("action"))?q.trim(a):"")||window.location.href||"")&&(n.match(/^([^#]+)/)||[])[1],o=/(MSIE|Trident)/.test(navigator.userAgent||"")&&/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",M=q.extend(!0,{url:n,success:q.ajaxSettings.success,type:O||q.ajaxSettings.type,iframeSrc:o},M);var i={};if(this.trigger("form-pre-serialize",[this,M,i]),i.veto)return N("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(M.beforeSerialize&&!1===M.beforeSerialize(this,M))return N("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var s=M.traditional;void 0===s&&(s=q.ajaxSettings.traditional);var u,c,C=[],l=this.formToArray(M.semantic,C,M.filtering);if(M.data&&(c=q.isFunction(M.data)?M.data(l):M.data,M.extraData=c,u=q.param(c,s)),M.beforeSubmit&&!1===M.beforeSubmit(l,this,M))return N("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[l,this,M,i]),i.veto)return N("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var f=q.param(l,s);u&&(f=f?f+"&"+u:u),"GET"===M.type.toUpperCase()?(M.url+=(0<=M.url.indexOf("?")?"&":"?")+f,M.data=null):M.data=f;var d,m,p,h=[];M.resetForm&&h.push(function(){X.resetForm()}),M.clearForm&&h.push(function(){X.clearForm(M.includeHidden)}),!M.dataType&&M.target?(d=M.success||function(){},h.push(function(e,t,r){var a=arguments,n=M.replaceTarget?"replaceWith":"html";q(M.target)[n](e).each(function(){d.apply(this,a)})})):M.success&&(q.isArray(M.success)?q.merge(h,M.success):h.push(M.success)),M.success=function(e,t,r){for(var a=M.context||this,n=0,o=h.length;n<o;n++)h[n].apply(a,[e,t,r||X,X])},M.error&&(m=M.error,M.error=function(e,t,r){var a=M.context||this;m.apply(a,[e,t,r,X])}),M.complete&&(p=M.complete,M.complete=function(e,t){var r=M.context||this;p.apply(r,[e,t,X])});var v=0<q("input[type=file]:enabled",this).filter(function(){return""!==q(this).val()}).length,g="multipart/form-data",x=X.attr("enctype")===g||X.attr("encoding")===g,y=S.fileapi&&S.formdata;N("fileAPI :"+y);var b,T=(v||x)&&!y;!1!==M.iframe&&(M.iframe||T)?M.closeKeepAlive?q.get(M.closeKeepAlive,function(){b=w(l)}):b=w(l):b=(v||x)&&y?function(e){for(var r=new FormData,t=0;t<e.length;t++)r.append(e[t].name,e[t].value);if(M.extraData){var a=function(e){var t,r,a=q.param(e,M.traditional).split("&"),n=a.length,o=[];for(t=0;t<n;t++)a[t]=a[t].replace(/\+/g," "),r=a[t].split("="),o.push([decodeURIComponent(r[0]),decodeURIComponent(r[1])]);return o}(M.extraData);for(t=0;t<a.length;t++)a[t]&&r.append(a[t][0],a[t][1])}M.data=null;var n=q.extend(!0,{},q.ajaxSettings,M,{contentType:!1,processData:!1,cache:!1,type:O||"POST"});M.uploadProgress&&(n.xhr=function(){var e=q.ajaxSettings.xhr();return e.upload&&e.upload.addEventListener("progress",function(e){var t=0,r=e.loaded||e.position,a=e.total;e.lengthComputable&&(t=Math.ceil(r/a*100)),M.uploadProgress(e,r,a,t)},!1),e});n.data=null;var o=n.beforeSend;return n.beforeSend=function(e,t){M.formData?t.data=M.formData:t.data=r,o&&o.call(this,e,t)},q.ajax(n)}(l):q.ajax(M),X.removeData("jqxhr").data("jqxhr",b);for(var j=0;j<C.length;j++)C[j]=null;return this.trigger("form-submit-notify",[this,M]),this;function w(e){var t,r,l,f,o,d,m,p,a,n,h,v,i=X[0],g=q.Deferred();if(g.abort=function(e){p.abort(e)},e)for(r=0;r<C.length;r++)t=q(C[r]),_?t.prop("disabled",!1):t.removeAttr("disabled");(l=q.extend(!0,{},q.ajaxSettings,M)).context=l.context||l,o="jqFormIO"+(new Date).getTime();var s=i.ownerDocument,u=X.closest("body");if(l.iframeTarget?(n=(d=q(l.iframeTarget,s)).attr2("name"))?o=n:d.attr2("name",o):(d=q('<iframe name="'+o+'" src="'+l.iframeSrc+'" />',s)).css({position:"absolute",top:"-1000px",left:"-1000px"}),m=d[0],p={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(e){var t="timeout"===e?"timeout":"aborted";N("aborting upload... "+t),this.aborted=1;try{m.contentWindow.document.execCommand&&m.contentWindow.document.execCommand("Stop")}catch(e){}d.attr("src",l.iframeSrc),p.error=t,l.error&&l.error.call(l.context,p,t,e),f&&q.event.trigger("ajaxError",[p,l,t]),l.complete&&l.complete.call(l.context,p,t)}},(f=l.global)&&0==q.active++&&q.event.trigger("ajaxStart"),f&&q.event.trigger("ajaxSend",[p,l]),l.beforeSend&&!1===l.beforeSend.c
vendor: 9,900 bytes, line 10273
10273all(l.context,p,l))return l.global&&q.active--,g.reject(),g;if(p.aborted)return g.reject(),g;(a=i.clk)&&(n=a.name)&&!a.disabled&&(l.extraData=l.extraData||{},l.extraData[n]=a.value,"image"===a.type&&(l.extraData[n+".x"]=i.clk_x,l.extraData[n+".y"]=i.clk_y));var x=1,y=2;function b(t){var r=null;try{t.contentWindow&&(r=t.contentWindow.document)}catch(e){N("cannot get iframe.contentWindow document: "+e)}if(r)return r;try{r=t.contentDocument?t.contentDocument:t.document}catch(e){N("cannot get iframe.contentDocument: "+e),r=t.document}return r}var c=q("meta[name=csrf-token]").attr("content"),T=q("meta[name=csrf-param]").attr("content");function j(){var e=X.attr2("target"),t=X.attr2("action"),r=X.attr("enctype")||X.attr("encoding")||"multipart/form-data";i.setAttribute("target",o),O&&!/post/i.test(O)||i.setAttribute("method","POST"),t!==l.url&&i.setAttribute("action",l.url),l.skipEncodingOverride||O&&!/post/i.test(O)||X.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),l.timeout&&(v=setTimeout(function(){h=!0,A(x)},l.timeout));var a=[];try{if(l.extraData)for(var n in l.extraData)l.extraData.hasOwnProperty(n)&&(q.isPlainObject(l.extraData[n])&&l.extraData[n].hasOwnProperty("name")&&l.extraData[n].hasOwnProperty("value")?a.push(q('<input type="hidden" name="'+l.extraData[n].name+'">',s).val(l.extraData[n].value).appendTo(i)[0]):a.push(q('<input type="hidden" name="'+n+'">',s).val(l.extraData[n]).appendTo(i)[0]));l.iframeTarget||d.appendTo(u),m.attachEvent?m.attachEvent("onload",A):m.addEventListener("load",A,!1),setTimeout(function e(){try{var t=b(m).readyState;N("state = "+t),t&&"uninitialized"===t.toLowerCase()&&setTimeout(e,50)}catch(e){N("Server abort: ",e," (",e.name,")"),A(y),v&&clearTimeout(v),v=void 0}},15);try{i.submit()}catch(e){document.createElement("form").submit.apply(i)}}finally{i.setAttribute("action",t),i.setAttribute("enctype",r),e?i.setAttribute("target",e):X.removeAttr("target"),q(a).remove()}}T&&c&&(l.extraData=l.extraData||{},l.extraData[T]=c),l.forceSync?j():setTimeout(j,10);var w,S,k,D=50;function A(e){if(!p.aborted&&!k){if((S=b(m))||(N("cannot access response document"),e=y),e===x&&p)return p.abort("timeout"),void g.reject(p,"timeout");if(e===y&&p)return p.abort("server abort"),void g.reject(p,"error","server abort");if(S&&S.location.href!==l.iframeSrc||h){m.detachEvent?m.detachEvent("onload",A):m.removeEventListener("load",A,!1);var t,r="success";try{if(h)throw"timeout";var a="xml"===l.dataType||S.XMLDocument||q.isXMLDoc(S);if(N("isXml="+a),!a&&window.opera&&(null===S.body||!S.body.innerHTML)&&--D)return N("requeing onLoad callback, DOM not available"),void setTimeout(A,250);var n=S.body?S.body:S.documentElement;p.responseText=n?n.innerHTML:null,p.responseXML=S.XMLDocument?S.XMLDocument:S,a&&(l.dataType="xml"),p.getResponseHeader=function(e){return{"content-type":l.dataType}[e.toLowerCase()]},n&&(p.status=Number(n.getAttribute("status"))||p.status,p.statusText=n.getAttribute("statusText")||p.statusText);var o,i,s,u=(l.dataType||"").toLowerCase(),c=/(json|script|text)/.test(u);c||l.textarea?(o=S.getElementsByTagName("textarea")[0])?(p.responseText=o.value,p.status=Number(o.getAttribute("status"))||p.status,p.statusText=o.getAttribute("statusText")||p.statusText):c&&(i=S.getElementsByTagName("pre")[0],s=S.getElementsByTagName("body")[0],i?p.responseText=i.textContent?i.textContent:i.innerText:s&&(p.responseText=s.textContent?s.textContent:s.innerText)):"xml"===u&&!p.responseXML&&p.responseText&&(p.responseXML=F(p.responseText));try{w=E(p,u,l)}catch(e){r="parsererror",p.error=t=e||r}}catch(e){N("error caught: ",e),r="error",p.error=t=e||r}p.aborted&&(N("upload aborted"),r=null),p.status&&(r=200<=p.status&&p.status<300||304===p.status?"success":"error"),"success"===r?(l.success&&l.success.call(l.context,w,"success",p),g.resolve(p.responseText,"success",p),f&&q.event.trigger("ajaxSuccess",[p,l])):r&&(void 0===t&&(t=p.statusText),l.error&&l.error.call(l.context,p,r,t),g.reject(p,"error",t),f&&q.event.trigger("ajaxError",[p,l,t])),f&&q.event.trigger("ajaxComplete",[p,l]),f&&!--q.active&&q.event.trigger("ajaxStop"),l.complete&&l.complete.call(l.context,p,r),k=!0,l.timeout&&clearTimeout(v),setTimeout(function(){l.iframeTarget?d.attr("src",l.iframeSrc):d.remove(),p.responseXML=null},100)}}}var F=q.parseXML||function(e,t){return window.ActiveXObject?((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!==t.documentElement.nodeName?t:null},L=q.parseJSON||function(e){return window.eval("("+e+")")},E=function(e,t,r){var a=e.getResponseHeader("content-type")||"",n=("xml"===t||!t)&&0<=a.indexOf("xml"),o=n?e.responseXML:e.responseText;return n&&"parsererror"===o.documentElement.nodeName&&q.error&&q.error("parsererror"),r&&r.dataFilter&&(o=r.dataFilter(o,t)),"string"==typeof o&&(("json"===t||!t)&&0<=a.indexOf("json")?o=L(o):("script"===t||!t)&&0<=a.indexOf("javascript")&&q.globalEval(o)),o};return g}},q.fn.ajaxForm=function(e,t,r,a){if(("string"==typeof e||!1===e&&0<arguments.length)&&(e={url:e,data:t,dataType:r},"function"==typeof a&&(e.success=a)),(e=e||{}).delegation=e.delegation&&q.isFunction(q.fn.on),e.delegation||0!==this.length)return e.delegation?(q(document).off("submit.form-plugin",this.selector,o).off("click.form-plugin",this.selector,i).on("submit.form-plugin",this.selector,e,o).on("click.form-plugin",this.selector,e,i),this):(e.beforeFormUnbind&&e.beforeFormUnbind(this,e),this.ajaxFormUnbind().on("submit.form-plugin",e,o).on("click.form-plugin",e,i));var n={s:this.selector,c:this.context};return!q.isReady&&n.s?(N("DOM not ready, queuing ajaxForm"),q(function(){q(n.s,n.c).ajaxForm(e)})):N("terminating; zero elements found by selector"+(q.isReady?"":" (DOM not ready)")),this},q.fn.ajaxFormUnbind=function(){return this.off("submit.form-plugin click.form-plugin")},q.fn.formToArray=function(e,t,r){var a=[];if(0===this.length)return a;var n,o,i,s,u,c,l,f,d,m,p=this[0],h=this.attr("id"),v=(v=e||void 0===p.elements?p.getElementsByTagName("*"):p.elements)&&q.makeArray(v);if(h&&(e||/(Edge|Trident)\//.test(navigator.userAgent))&&(n=q(':input[form="'+h+'"]').get()).length&&(v=(v||[]).concat(n)),!v||!v.length)return a;for(q.isFunction(r)&&(v=q.map(v,r)),o=0,c=v.length;o<c;o++)if((m=(u=v[o]).name)&&!u.disabled)if(e&&p.clk&&"image"===u.type)p.clk===u&&(a.push({name:m,value:q(u).val(),type:u.type}),a.push({name:m+".x",value:p.clk_x},{name:m+".y",value:p.clk_y}));else if((s=q.fieldValue(u,!0))&&s.constructor===Array)for(t&&t.push(u),i=0,l=s.length;i<l;i++)a.push({name:m,value:s[i]});else if(S.fileapi&&"file"===u.type){t&&t.push(u);var g=u.files;if(g.length)for(i=0;i<g.length;i++)a.push({name:m,value:g[i],type:u.type});else a.push({name:m,value:"",type:u.type})}else null!=s&&(t&&t.push(u),a.push({name:m,value:s,type:u.type,required:u.required}));return e||!p.clk||(m=(d=(f=q(p.clk))[0]).name)&&!d.disabled&&"image"===d.type&&(a.push({name:m,value:f.val()}),a.push({name:m+".x",value:p.clk_x},{name:m+".y",value:p.clk_y})),a},q.fn.formSerialize=function(e){return q.param(this.formToArray(e))},q.fn.fieldSerialize=function(n){var o=[];return this.each(function(){var e=this.name;if(e){var t=q.fieldValue(this,n);if(t&&t.constructor===Array)for(var r=0,a=t.length;r<a;r++)o.push({name:e,value:t[r]});else null!=t&&o.push({name:this.name,value:t})}}),q.param(o)},q.fn.fieldValue=function(e){for(var t=[],r=0,a=this.length;r<a;r++){var n=this[r],o=q.fieldValue(n,e);null==o||o.constructor===Array&&!o.length||(o.constructor===Array?q.merge(t,o):t.push(o))}return t},q.fieldValue=function(e,t){var r=e.name,a=e.type,n=e.tagName.toLowerCase();if(void 0===t&&(t=!0),t&&(!r||e.disabled||"reset"===a||"button"===a||("checkbox"===a||"radio"===a)&&!e.checked||("submit"===a||"image"===a)&&e.form&&e.form.clk!==e||"select"===n&&-1===e.selectedIndex))return null;if("select"!==n)return q(e).val().replace(m,"\r\n");var o=e.selectedIndex;if(o<0)return null;for(var i=[],s=e.options,u="select-one"===a,c=u?o+1:s.length,l=u?o:0;l<c;l++){var f=s[l];if(f.selected&&!f.disabled){var d=(d=f.value)||(f.attributes&&f.attributes.value&&!f.attributes.value.specified?f.text:f.value);if(u)return d;i.push(d)}}return i},q.fn.clearForm=function(e){return this.each(function(){q("input,select,textarea",this).clearFields(e)})},q.fn.clearFields=q.fn.clearInputs=function(r){var a=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var e=this.type,t=this.tagName.toLowerCase();a.test(e)||"textarea"===t?this.value="":"checkbox"===e||"radio"===e?this.checked=!1:"select"===t?this.selectedIndex=-1:"file"===e?/MSIE/.test(navigator.userAgent)?q(this).replaceWith(q(this).clone(!0)):q(this).val(""):r&&(!0===r&&/hidden/.test(e)||"string"==typeof r&&q(this).is(r))&&(this.value="")})},q.fn.resetForm=function(){return this.each(function(){var t=q(this),e=this.tagName.toLowerCase();switch(e){case"input":this.checked=this.defaultChecked;case"textarea":return this.value=this.defaultValue,!0;case"option":case"optgroup":var r=t.parents("select");return r.length&&r[0].multiple?"option"===e?this.selected=this.defaultSelected:t.find("option").resetForm():r.resetForm(),!0;case"select":return t.find("option").each(function(e){if(this.selected=this.defaultSelected,this.defaultSelected&&!t[0].multiple)return t[0].selectedIndex=e,!1}),!0;case"label":var a=q(t.attr("for")),n=t.find("input,select,textarea");return a[0]&&n.unshift(a[0]),n.resetForm(),!0;case"form":return"function"!=typeof this.reset&&("object"!=typeof this.reset||this.reset.nodeType)||this.reset(),!0;default:return t.find("form,input,label,select,textarea").resetForm(),!0}})},q.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},q.fn.selected=function(r){return void 0===r&&(r=!0),this.each(function(){var e,t=this.t
10273ype;"checkbox"===t||"radio"===t?this.checked=r:"option"===this.tagName.toLowerCase()&&(e=q(this).parent("select"),r&&e[0]&&"select-one"===e[0].type&&e.find("option").selected(!1),this.selected=r)})},q.fn.ajaxSubmit.debug=!1}); 10274 10275; 10276/** 10277* DO NOT EDIT THIS FILE. 10278* See the following change record for more information, 10279* https://www.drupal.org/node/2815083 10280* @preserve 10281**/ 10282(function ($, Drupal, drupalSettings) { 10283 Drupal.Views = {}; 10284 Drupal.Views.parseQueryString = function (query) { 10285 var args = {}; 10286 var pos = query.indexOf('?'); 10287 if (pos !== -1) { 10288 query = query.substring(pos + 1); 10289 } 10290 var pair; 10291 var pairs = query.split('&'); 10292 for (var i = 0; i < pairs.length; i++) { 10293 pair = pairs[i].split('='); 10294 if (pair[0] !== 'q' && pair[1]) { 10295 args[decodeURIComponent(pair[0].replace(/\+/g, ' '))] = decodeURIComponent(pair[1].replace(/\+/g, ' ')); 10296 } 10297 } 10298 return args; 10299 }; 10300 Drupal.Views.parseViewArgs = function (href, viewPath) { 10301 var returnObj = {}; 10302 var path = Drupal.Views.getPath(href); 10303 var viewHref = Drupal.url(viewPath).substring(drupalSettings.path.baseUrl.length); 10304 if (viewHref && path.substring(0, viewHref.length + 1) === "".concat(viewHref, "/")) { 10305 returnObj.view_args = decodeURIComponent(path.substring(viewHref.length + 1, path.length)); 10306 returnObj.view_path = path; 10307 } 10308 return returnObj; 10309 }; 10310 Drupal.Views.pathPortion = function (href) { 10311 var protocol = window.location.protocol; 10312 if (href.substring(0, protocol.length) === protocol) { 10313 href = href.substring(href.indexOf('/', protocol.length + 2)); 10314 } 10315 return href; 10316 }; 10317 Drupal.Views.getPath = function (href) { 10318 href = Drupal.Views.pathPortion(href); 10319 href = href.substring(drupalSettings.path.baseUrl.length, href.length); 10320 if (href.substring(0, 3) === '?q=') { 10321 href = href.substring(3, href.length); 10322 } 10323 var chars = ['#', '?', '&']; 10324 for (var i = 0; i < chars.length; i++) { 10325 if (href.indexOf(chars[i]) > -1) { 10326 href = href.substr(0, href.indexOf(chars[i])); 10327 } 10328 } 10329 return href; 10330 }; 10331})(jQuery, Drupal, drupalSettings);; 10332/** 10333* DO NOT EDIT THIS FILE. 10334* See the following change record for more information, 10335* https://www.drupal.org/node/2815083 10336* @preserve 10337**/ 10338(function ($, Drupal, drupalSettings) { 10339 Drupal.behaviors.ViewsAjaxView = {}; 10340 Drupal.behaviors.ViewsAjaxView.attach = function (context, settings) { 10341 if (settings && settings.views && settings.views.ajaxViews) { 10342 var ajaxViews = settings.views.ajaxViews; 10343 Object.keys(ajaxViews || {}).forEach(function (i) { 10344 Drupal.views.instances[i] = new Drupal.views.ajaxView(ajaxViews[i]); 10345 }); 10346 } 10347 }; 10348 Drupal.behaviors.ViewsAjaxView.detach = function (context, settings, trigger) { 10349 if (trigger === 'unload') { 10350 if (settings && settings.views && settings.views.ajaxViews) { 10351 var ajaxViews = settings.views.ajaxViews; 10352 Object.keys(ajaxViews || {}).forEach(function (i) { 10353 var selector = ".js-view-dom-id-".concat(ajaxViews[i].view_dom_id); 10354 if ($(selector, context).length) { 10355 delete Drupal.views.instances[i]; 10356 delete settings.views.ajaxViews[i]; 10357 } 10358 }); 10359 } 10360 } 10361 }; 10362 Drupal.views = {}; 10363 Drupal.views.instances = {}; 10364 Drupal.views.ajaxView = function (settings) { 10365 var selector = ".js-view-dom-id-".concat(settings.view_dom_id); 10366 this.$view = $(selector); 10367 var ajaxPath = drupalSettings.views.ajax_path; 10368 if (ajaxPath.constructor.toString().indexOf('Array') !== -1) { 10369 ajaxPath = ajaxPath[0]; 10370 } 10371 var queryString = window.location.search || ''; 10372 if (queryString !== '') { 10373 queryString = queryString.slice(1).replace(/q=[^&]+&?|&?render=[^&]+/, ''); 10374 if (queryString !== '') { 10375 queryString = (/\?/.test(ajaxPath) ? '&' : '?') + queryString; 10376 } 10377 } 10378 this.element_settings = { 10379 url: ajaxPath + queryString, 10380 submit: settings, 10381 setClick: true, 10382 event: 'click', 10383 selector: selector, 10384 progress: { 10385 type: 'fullscreen' 10386 } 10387 }; 10388 this.settings = settings; 10389 this.$exposed_form = $("form#views-exposed-form-".concat(settings.view_name.replace(/_/g, '-'), "-").concat(settings.view_display_id.replace(/_/g, '-'))); 10390 once('exposed-form', this.$exposed_form).forEach($.proxy(this.attachExposedFormAjax, this));
10391 once('ajax-pager', this.$view.filter($.proxy(this.filterNestedViews, this))).forEach($.proxy(this.attachPagerAjax, this)); 10392 var selfSettings = $.extend({}, this.element_settings, { 10393 event: 'RefreshView', 10394 base: this.selector, 10395 element: this.$view.get(0) 10396 }); 10397 this.refreshViewAjax = Drupal.ajax(selfSettings); 10398 }; 10399 Drupal.views.ajaxView.prototype.attachExposedFormAjax = function () { 10400 var that = this; 10401 this.exposedFormAjax = []; 10402 $('input[type=submit], button[type=submit], input[type=image]', this.$exposed_form).not('[data-drupal-selector=edit-reset]').each(function (index) { 10403 var selfSettings = $.extend({}, that.element_settings, { 10404 base: $(this).attr('id'), 10405 element: this 10406 }); 10407 that.exposedFormAjax[index] = Drupal.ajax(selfSettings); 10408 }); 10409 }; 10410 Drupal.views.ajaxView.prototype.filterNestedViews = function () { 10411 return !this.$view.parents('.view').length; 10412 }; 10413 Drupal.views.ajaxView.prototype.attachPagerAjax = function () { 10414 this.$view.find('ul.js-pager__items > li > a, th.views-field a, .attachment .views-summary a').each($.proxy(this.attachPagerLinkAjax, this)); 10415 }; 10416 Drupal.views.ajaxView.prototype.attachPagerLinkAjax = function (id, link) { 10417 var $link = $(link); 10418 var viewData = {}; 10419 var href = $link.attr('href'); 10420 $.extend(viewData, this.settings, Drupal.Views.parseQueryString(href), Drupal.Views.parseViewArgs(href, this.settings.view_base_path)); 10421 var selfSettings = $.extend({}, this.element_settings, {
10422 submit: viewData, 10423 base: false, 10424 element: link 10425 }); 10426 this.pagerAjax = Drupal.ajax(selfSettings); 10427 }; 10428 Drupal.AjaxCommands.prototype.viewsScrollTop = function (ajax, response) { 10429 var offset = $(response.selector).offset(); 10430 var scrollTarget = response.selector; 10431 while ($(scrollTarget).scrollTop() === 0 && $(scrollTarget).parent()) { 10432 scrollTarget = $(scrollTarget).parent(); 10433 } 10434 if (offset.top - 10 < $(scrollTarget).scrollTop()) { 10435 $(scrollTarget).animate({ 10436 scrollTop: offset.top - 10 10437 }, 500); 10438 } 10439 }; 10440})(jQuery, Drupal, drupalSettings);; 10441/******/ (function(modules) { // webpackBootstrap 10442/******/ // The module cache 10443/******/ var installedModules = {}; 10444/******/ 10445/******/ // The require function 10446/******/ function __webpack_require__(moduleId) { 10447/******/ 10448/******/ // Check if module is in cache 10449/******/ if(installedModules[moduleId]) { 10450/******/ return installedModules[moduleId].exports; 10451/******/ } 10452/******/ // Create a new module (and put it into the cache) 10453/******/ var module = installedModules[moduleId] = { 10454/******/ i: moduleId, 10455/******/ l: false, 10456/******/ exports: {} 10457/******/ }; 10458/******/ 10459/******/ // Execute the module function 10460/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 10461/******/ 10462/******/ // Flag the module as loaded 10463/******/ module.l = true; 10464/******/ 10465/******/ // Return the exports of the module 10466/******/ return module.exports; 10467/******/ } 10468/******/ 10469/******/ 10470/******/ // expose the modules object (__webpack_modules__) 10471/******/ __webpack_require__.m = modules; 10472/******/ 10473/******/ // expose the module cache 10474/******/ __webpack_require__.c = installedModules; 10475/******/ 10476/******/ // define getter function for harmony exports 10477/******/ __webpack_require__.d = function(exports, name, getter) { 10478/******/ if(!__webpack_require__.o(exports, name)) { 10479/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 10480/******/ } 10481/******/ }; 10482/******/ 10483/******/ // define __esModule on exports 10484/******/ __webpack_require__.r = function(exports) { 10485/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 10486/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 10487/******/ } 10488/******/ Object.defineProperty(exports, '__esModule', { value: true }); 10489/******/ }; 10490/******/ 10491/******/ // create a fake namespace object 10492/******/ // mode & 1: value is a module id, require it 10493/******/ // mode & 2: merge all properties of value into the ns 10494/******/ // mode & 4: return value when already ns object 10495/******/ // mode & 8|1: behave like require 10496/******/ __webpack_require__.t = function(value, mode) { 10497/******/ if(mode & 1) value = __webpack_require__(value); 10498/******/ if(mode & 8) return value; 10499/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 10500/******/ var ns = Object.create(null); 10501/******/ __webpack_require__.r(ns); 10502/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 10503/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 10504/******/ return ns; 10505/******/ }; 10506/******/ 10507/******/ // getDefaultExport function for compatibility with non-harmony modules 10508/******/ __webpack_require__.n = function(module) { 10509/******/ var getter = module && module.__esModule ? 10510/******/ function getDefault() { return module['default']; } : 10511/******/ function getModuleExports() { return module; }; 10512/******/ __webpack_require__.d(getter, 'a', getter); 10513/******/ return getter; 10514/******/ }; 10515/******/ 10516/******/ // Object.prototype.hasOwnProperty.call 10517/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 10518/******/ 10519/******/ // __webpack_public_path__ 10520/******/ __webpack_require__.p = "/"; 10521/******/ 10522/******/ 10523/******/ // Load entry module and return exports 10524/******/ return __webpack_require__(__webpack_require__.s = 22); 10525/******/ }) 10526/************************************************************************/ 10527/******/ ({ 10528
10529/***/ "./src/components/search/search.js": 10530/*!*****************************************!*\ 10531 !*** ./src/components/search/search.js ***! 10532 \*****************************************/ 10533/*! no static exports found */ 10534/***/ (function(module, exports, __webpack_require__) { 10535 10536"use strict"; 10537 10538 10539(function ($, Drupal) { 10540 Drupal.behaviors.search = { 10541 attach: function attach(context) { 10542 var filterItem = $(".path-search-results .page__header .search__filters li a, .path-resultats-de-recherche .page__header .search__filters li a", context); 10543 var clearButton = $(".clear"); 10544 var submitButton = $(".submit"); 10545 filterItem.on("click", function () { 10546 filterItem.removeClass("is-active"); 10547 $(this).addClass("is-active"); 10548 var itemValue = $(this).attr("href"); 10549 10550 if (itemValue === "#all") { 10551 $(".view-search-products", context).show(); 10552 $(".view-search-recipes", context).show(); 10553 } else if (itemValue === "#products") { 10554 $(".view-search-products", context).show(); 10555 $(".view-search-recipes", context).hide(); 10556 } else { 10557 $(".view-search-products", context).hide(); 10558 $(".view-search-recipes", context).show(); 10559 } 10560 }); 10561 clearButton.on("click", function (context) { 10562 $(this).removeClass("d-inline-flex"); 10563 submitButton.removeClass("d-none"); 10564 Drupal.behaviors.header.clearSearchTerm(context); 10565 Drupal.behaviors.header.setFocusSearch(context); 10566 }); // setTimeout(() => { 10567 // //Product Search View 10568 // let $productSearch = $(".block-views-blocksearch-products-block-1"); 10569 // //Receipe Search View 10570 // let $recipeSearch = $(".block-views-blocksearch-recipes-block-1"); 10571 // //wrap in one div 10572 // if(!$('.search-results').length) { 10573 // $productSearch.add($recipeSearch).wrapAll("<div class='search-results'></div>"); 10574 // } 10575 // }, 200); 10576 10577 var params = new URLSearchParams(window.location.search); 10578 10579 if (params.has("term")) { 10580 //console.log('here 1'); 10581 if (context === document) { 10582 //console.log('here 2'); 10583 var $hasProducts = $(".view-search-products .views-row").length; 10584 var $hasRecipes = $(".view-search-recipes .views-row").length; 10585 clearButton.addClass("d-inline-flex"); 10586 submitButton.addClass("d-none"); //show search results wrapper 10587 // setTimeout(() => { 10588 // $('.search-results').removeClass('d-none'); 10589 // }, 300); 10590 // submitButton.click(function(){ 10591 // console.log('Search Clicked') 10592 // if (!$hasProducts && !$hasRecipes) { 10593 // console.log('has no products or recipes'); 10594 // // $(".layout-builder__layout .col-12").append( 10595 // // '<p class="no-results">No results found<p>' 10596 // // ); 10597 // } else if (!$hasProducts) { 10598 // console.log('has no products'); 10599 // console.log('removed text') 10600 // // $(".view-search-products").append( 10601 // // '<p class="no-results">No products found<p>' 10602 // // ); 10603 // $(".view-search-products .view-empty").html(''); 10604 // } else if (!$hasRecipes) { 10605 // console.log('has no recipes'); 10606 // // $(".view-search-recipes").append( 10607 // // '<p class="no-results">No recipes found<p>' 10608 // // ); 10609 // $(".view-search-recipes .view-empty").addClass('d-none'); 10610 // } 10611 // }); 10612 10613 if (window.innerWidth >= 991) { 10614 Drupal.behaviors.header.toggleSearch(context); 10615 } 10616 10617 $("#term").val(params.get("term")); 10618 } 10619 } 10620 } 10621 }; 10622 $('#search-container #block-bc-brand-search #term').attr('aria-label', 'search'); // $('#close-search').on('click', function(){ 10623 // setTimeout(() => { 10624 // $('#icon-search').focus(); 10625 // }, 100); 10626 // }) 10627})(jQuery, Drupal); 10628 10629/***/ }), 10630 10631/***/ 22: 10632/*!***********************************************!*\ 10633 !*** multi ./src/components/search/search.js ***! 10634 \***********************************************/ 10635/*! no static exports found */ 10636/***/ (function(module, exports, __webpack_require__) { 10637 10638module.exports = __webpack_require__(/*! /var/www/html/dev_bc_bonmatin/html/web/themes/custom/bc_brand/src/components/search/search.js */"./src/components/search/search.js"); 10639 10640 10641/***/ }) 10642 10643/******/ });; 10644/** 10645 * @file 10646 * Infinite Scroll JS. 10647 */ 10648 10649(function ($, Drupal, debounce) { 10650 "use strict"; 10651 10652 // Cached reference to $(window). 10653 var $window = $(window); 10654 10655 // The threshold for how far to the bottom you should reach before reloading. 10656 var scrollThreshold = 200; 10657 10658 // The selector for the automatic pager. 10659 var automaticPagerSelector = '[data-drupal-views-infinite-scroll-pager
10659="automatic"]'; 10660 10661 // The selector for both manual load and automatic pager. 10662 var pagerSelector = '[data-drupal-views-infinite-scroll-pager]'; 10663 10664 // The selector for the automatic pager. 10665 var contentWrapperSelector = '[data-drupal-views-infinite-scroll-content-wrapper]'; 10666 10667 // The event and namespace that is bound to window for automatic scrolling. 10668 var scrollEvent = 'scroll.views_infinite_scroll'; 10669 10670 /** 10671 * Insert a views infinite scroll view into the document. 10672 * 10673 * @param {jQuery} $newView 10674 * New content detached from the DOM. 10675 */ 10676 $.fn.infiniteScrollInsertView = function ($newView) { 10677 // Extract the view DOM ID from the view classes. 10678 var matches = /(js-view-dom-id-\w+)/.exec(this.attr('class')); 10679 10680 if (!matches) { 10681 return; 10682 } 10683 10684 var currentViewId = matches[1].replace('js-view-dom-id-', 'views_dom_id:'); 10685 10686 // Get the existing ajaxViews object. 10687 var view = Drupal.views.instances[currentViewId]; 10688 // Remove once so that the exposed form and pager are processed on 10689 // behavior attach. 10690 view.$view.removeOnce('ajax-pager'); 10691 view.$exposed_form.removeOnce('exposed-form'); 10692 // Make sure infinite scroll can be reinitialized. 10693 var $existingPager = view.$view.find(pagerSelector); 10694 $existingPager.removeOnce('infinite-scroll'); 10695 10696 var $newRows = $newView.find(contentWrapperSelector).children(); 10697 var $newPager = $newView.find(pagerSelector); 10698 10699 view.$view.find(contentWrapperSelector) 10700 // Trigger a jQuery event on the wrapper to inform that new content was 10701 // loaded and allow other scripts to respond to the event. 10702 .trigger('views_infinite_scroll.new_content', $newRows.clone()) 10703 // Add the new rows to existing view. 10704 .append($newRows); 10705 10706 // Replace the pager link with the new link and ajaxPageState values. 10707 $existingPager.replaceWith($newPager); 10708 10709 // Run views and VIS behaviors. 10710 Drupal.attachBehaviors(view.$view[0]); 10711 }; 10712 10713 /** 10714 * Handle the automatic paging based on the scroll amount. 10715 * 10716 * @type {Drupal~behavior} 10717 * 10718 * @prop {Drupal~behaviorAttach} attach 10719 * Initialize infinite scroll pagers and bind the scroll event. 10720 * @prop {Drupal~behaviorDetach} detach 10721 * During `unload` remove the scroll event binding. 10722 */ 10723 Drupal.behaviors.views_infinite_scroll_automatic = { 10724 attach : function (context, settings) { 10725 $(context).find(automaticPagerSelector).once('infinite-scroll').each(function () { 10726 var $pager = $(this); 10727 $pager.addClass('visually-hidden'); 10728 var isLoadNeeded = function () { 10729 return window.innerHeight + window.pageYOffset > $pager.offset().top - scrollThreshold; 10730 }; 10731 $window.on(scrollEvent, debounce(function () { 10732 if (isLoadNeeded()) { 10733 $pager.find('[rel=next]').click(); 10734 $window.off(scrollEvent); 10735 } 10736 }, 200)); 10737 if (isLoadNeeded()) { 10738 $window.trigger(scrollEvent); 10739 } 10740 }); 10741 }, 10742 detach: function (context, settings, trigger) { 10743 // In the case where the view is removed from the document, remove it's 10744 // events. This is important in the case a view being refreshed for a reason 10745 // other than a scroll. AJAX filters are a good example of the event needing 10746 // to be destroyed earlier than above. 10747 if (trigger === 'unload') { 10748 if ($(context).find(automaticPagerSelector).removeOnce('infinite-scroll').length) { 10749 $window.off(scrollEvent); 10750 } 10751 } 10752 } 10753 }; 10754 10755 /** 10756 * Views AJAX pagination filter. 10757 * 10758 * In case the Entity View Attachment is rendered in a view context, 10759 * the default filter function prevents the required 'Use AJAX' setting 10760 * to work. 10761 * 10762 * @return {Boolean} 10763 * Whether to apply the Views AJAX paginator. VIS requires this setting 10764 * for pagination. 10765 */ 10766 Drupal.views.ajaxView.prototype.filterNestedViews = function () { 10767 return this.$view.hasClass('view-eva') || !this.$view.parents('.view').length; 10768 }; 10769 10770})(jQuery, Drupal, Drupal.debounce); 10771; 10772/******/ (function(modules) { // webpackBootstrap 10773/******/ // The module cache 10774/******/ var installedModules = {}; 10775/******/ 10776/******/ // The require function 10777/******/ function __webpack_require__(moduleId) { 10778/******/ 10779/******/ // Check if module is in cache 10780/******/ if(installedModules[moduleId]) { 10781/******/ return installedModules[moduleId].exports; 10782/******/ } 10783/******/ // Create a new module (and put it into the cache) 10784/******/ var module = installedModules[moduleId] = { 10785/******/ i: moduleId, 10786/******/ l: false, 10787/******/ exports: {} 10788/******/ }; 10789/******/ 10790/******/ // Execute the module function 10791/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 10792/******/ 10793/******/ // Flag the module as loaded
vendor: 2,823 bytes, lines 10794-10859
10794/******/ module.l = true; 10795/******/ 10796/******/ // Return the exports of the module 10797/******/ return module.exports; 10798/******/ } 10799/******/ 10800/******/ 10801/******/ // expose the modules object (__webpack_modules__) 10802/******/ __webpack_require__.m = modules; 10803/******/ 10804/******/ // expose the module cache 10805/******/ __webpack_require__.c = installedModules; 10806/******/ 10807/******/ // define getter function for harmony exports 10808/******/ __webpack_require__.d = function(exports, name, getter) { 10809/******/ if(!__webpack_require__.o(exports, name)) { 10810/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 10811/******/ } 10812/******/ }; 10813/******/ 10814/******/ // define __esModule on exports 10815/******/ __webpack_require__.r = function(exports) { 10816/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 10817/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 10818/******/ } 10819/******/ Object.defineProperty(exports, '__esModule', { value: true }); 10820/******/ }; 10821/******/ 10822/******/ // create a fake namespace object 10823/******/ // mode & 1: value is a module id, require it 10824/******/ // mode & 2: merge all properties of value into the ns 10825/******/ // mode & 4: return value when already ns object 10826/******/ // mode & 8|1: behave like require 10827/******/ __webpack_require__.t = function(value, mode) { 10828/******/ if(mode & 1) value = __webpack_require__(value); 10829/******/ if(mode & 8) return value; 10830/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 10831/******/ var ns = Object.create(null); 10832/******/ __webpack_require__.r(ns); 10833/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 10834/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 10835/******/ return ns; 10836/******/ }; 10837/******/ 10838/******/ // getDefaultExport function for compatibility with non-harmony modules 10839/******/ __webpack_require__.n = function(module) { 10840/******/ var getter = module && module.__esModule ? 10841/******/ function getDefault() { return module['default']; } : 10842/******/ function getModuleExports() { return module; }; 10843/******/ __webpack_require__.d(getter, 'a', getter); 10844/******/ return getter; 10845/******/ }; 10846/******/ 10847/******/ // Object.prototype.hasOwnProperty.call 10848/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 10849/******/ 10850/******/ // __webpack_public_path__ 10851/******/ __webpack_require__.p = "/"; 10852/******/ 10853/******/ 10854/******/ // Load entry module and return exports 10855/******/ return __webpack_require__(__webpack_require__.s = 7); 10856/******/ }) 10857/************************************************************************/ 10858/******/ ({ 10859
10860/***/ "./src/components/form/form.js": 10861/*!*************************************!*\ 10862 !*** ./src/components/form/form.js ***! 10863 \*************************************/ 10864/*! no static exports found */ 10865/***/ (function(module, exports, __webpack_require__) { 10866 10867"use strict"; 10868 10869 10870(function ($, Drupal) { 10871 Drupal.behaviors.form = { 10872 attach: function attach(context) { 10873 if ($('.path-contact-us').length) { 10874 // var path = $('.webform-confirmation', context).length; 10875 // if(path) { 10876 // $('html, body').animate({ 10877 // scrollTop: ($('.hero-intro').first().offset().top + 300) 10878 // },800); 10879 // } 10880 //focus on fields with errors when form's submitted. 10881 $(".webform-button--submit").on("click", function () { 10882 var errorSubmission = $('.error:visible', context).not('strong.error'); // var countryConfirmation = $('#edit-country.has-value', context).length; 10883 // //Canada fields not filled 10884 // var provinceCANotFilled = $('#edit-province-state-canada', context).not('has-value').length; 10885 // var postaCANotFilled = $('#edit-postal-code-canada', context).not('has-value').length; 10886 // //USA fields not filled 10887 // var provinceUSANotFilled = $('#edit-province-state-usa', context).not('has-value').length; 10888 // var postaUSANotFilled = $('#edit-postal-code-usa', context).not('has-value').length; 10889 10890 if (errorSubmission.first().offset()) { 10891 //For the others fields with .error class 10892 $('html, body').animate({ 10893 scrollTop: errorSubmission.first().offset().top - 250 10894 }, 800, function () { 10895 // Callback after animation 10896 // Must change focus! 10897 errorSubmission.first().focus(); 10898 }); 10899 } // else if (countryConfirmation && provinceCANotFilled) { 10900 // //if country field are filled, but the .error class not appear on province and postal code fields, put a focus on them: 10901 // $('html, body').animate({ 10902 // scrollTop: ($('#edit-province-state-canada', context).not('has-value').first().offset().top - 250) 10903 // },800); 10904 // } else if (countryConfirmation && postaCANotFilled) { 10905 // $('html, body').animate({ 10906 // scrollTop: ($('#edit-postal-code-canada', context).not('has-value').first().offset().top - 250) 10907 // },800); 10908 // } else if (countryConfirmation && provinceUSANotFilled) { 10909 // $('html, body').animate({ 10910 // scrollTop: ($('#edit-province-state-usa', context).not('has-value').first().offset().top - 250) 10911 // },800); 10912 // } else if (countryConfirmation && postaUSANotFilled) { 10913 // $('html, body').animate({ 10914 // scrollTop: ($('#edit-postal-code-usa', context).not('has-value').first().offset().top - 250) 10915 // },800); 10916 // } else if ($('.path-frontpage')) { 10917 // var path = $('.webform-confirmation', context).length; 10918 // if(path) { 10919 // $('html, body').animate({ 10920 // scrollTop: ($('.newsletter-form').first().offset().top - 100) 10921 // },800); 10922 // } 10923 // } 10924 10925 }); // if($('#edit-container-product-information').length) { 10926 // } 10927 } 10928 10929 if (!$('.path-user').length) { 10930 $(".form-control").each(function () { 10931 Drupal.behaviors.form.checkForInput(this, context); 10932 }); 10933 $(".form-control").on("change keyup", function () { 10934 Drupal.behaviors.form.checkForInput(this, context); 10935 }); 10936 } 10937 10938 $('.js-form-type-managed-file .form-check-input', context).change(function () { 10939 $(this).parent().siblings('[name="image_upload_remove_button"]').trigger("mousedown"); 10940 }); // popovers 10941 10942 $('.popover-button').popover({ 10943 html: true, 10944 trigger: 'manual' 10945 }).click(function (e) { 10946 $('.popover-button').not(this).popover('hide').css('z-index', '7999'); 10947 $(this).popover('toggle').css('z-index', '8001'); 10948 }); 10949 $(document).click(function (e) { 10950 if (!$(e.target).is('.popover-button, .popover-title, .popover-content')) { 10951 $('.popover-button').popover('hide'); 10952 } 10953 }); 10954 $('.webform-submission-form select option', context).each(function () { 10955 if ($(this).val() == '') { 10956 $(this).text(''); 10957 } 10958 }); 10959 $('.trigger').on('focus', function () { 10960 $('.trigger').attr('aria-expanded', 'true'); 10961 }).on('focusout', function () { 10962 $('.trigger').attr('aria-expanded', 'false'); 10963 }); //AQA fixes for unique id/aria attributes 10964 10965 if (document.querySelectorAll('#helpText').length > 0) { 10966 // $('#helpText').each(function(){ 10967 $(document.querySelectorAll('#helpText')).attr('id', function (i) { 10968 return 'helpText' + (i + 1); 10969 }); // }) 10970 10971 $(document.querySelectorAll('button[aria-controls="helpText"]')).attr('aria-controls', function (i) { 10972 return 'helpText' + (i + 1); 10973 }); 10974 } 10975 }, 10976 checkForInput: function checkForInput(element, context) { 10977 var $label = $(element).siblings("label"); 10978 10979 if ($(element).val().length > 0) { 10980 $label.addClass("input-has-value"); 10981 $(element).addClass("has-value"); 10982 } else { 10983 $label.removeClass("input-has-value"); 10984 $(element).removeClass("has-value"); 10985 } 10986 } 10987 }; 10988 10989 if ($('#webform-submission-contact-node-13-add-form').length) { 10990 $('#edit-daytime-phone-phone').attr('autocomplete', 'tel'); 10991 $('#edit-adress-address').attr('autocomplete', 'address-line1'); 10992 } 10993})(jQuery, Drupal); 10994 10995/***/ })
10995, 10996 10997/***/ 7: 10998/*!*******************************************!*\ 10999 !*** multi ./src/components/form/form.js ***! 11000 \*******************************************/ 11001/*! no static exports found */ 11002/***/ (function(module, exports, __webpack_require__) { 11003 11004module.exports = __webpack_require__(/*! /var/www/html/dev_bc_bonmatin/html/web/themes/custom/bc_brand/src/components/form/form.js */"./src/components/form/form.js"); 11005 11006 11007/***/ }) 11008 11009/******/ });;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.