1/******/ (function() { // webpackBootstrap 2/******/ "use strict"; 3/******/ var __webpack_modules__ = ({ 4
vendor: 103,341 bytes, lines 5-3769
5/***/ "./node_modules/@splidejs/splide/dist/js/splide.esm.js": 6/*!*************************************************************!*\ 7 !*** ./node_modules/@splidejs/splide/dist/js/splide.esm.js ***! 8 \*************************************************************/ 9/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 10 11__webpack_require__.r(__webpack_exports__); 12/* harmony export */ __webpack_require__.d(__webpack_exports__, { 13/* harmony export */ "CLASSES": function() { return /* binding */ CLASSES; }, 14/* harmony export */ "CLASS_ACTIVE": function() { return /* binding */ CLASS_ACTIVE; }, 15/* harmony export */ "CLASS_ARROW": function() { return /* binding */ CLASS_ARROW; }, 16/* harmony export */ "CLASS_ARROWS": function() { return /* binding */ CLASS_ARROWS; }, 17/* harmony export */ "CLASS_ARROW_NEXT": function() { return /* binding */ CLASS_ARROW_NEXT; }, 18/* harmony export */ "CLASS_ARROW_PREV": function() { return /* binding */ CLASS_ARROW_PREV; }, 19/* harmony export */ "CLASS_CLONE": function() { return /* binding */ CLASS_CLONE; }, 20/* harmony export */ "CLASS_CONTAINER": function() { return /* binding */ CLASS_CONTAINER; }, 21/* harmony export */ "CLASS_FOCUS_IN": function() { return /* binding */ CLASS_FOCUS_IN; }, 22/* harmony export */ "CLASS_INITIALIZED": function() { return /* binding */ CLASS_INITIALIZED; }, 23/* harmony export */ "CLASS_LIST": function() { return /* binding */ CLASS_LIST; }, 24/* harmony export */ "CLASS_LOADING": function() { return /* binding */ CLASS_LOADING; }, 25/* harmony export */ "CLASS_NEXT": function() { return /* binding */ CLASS_NEXT; }, 26/* harmony export */ "CLASS_OVERFLOW": function() { return /* binding */ CLASS_OVERFLOW; }, 27/* harmony export */ "CLASS_PAGINATION": function() { return /* binding */ CLASS_PAGINATION; }, 28/* harmony export */ "CLASS_PAGINATION_PAGE": function() { return /* binding */ CLASS_PAGINATION_PAGE; }, 29/* harmony export */ "CLASS_PREV": function() { return /* binding */ CLASS_PREV; }, 30/* harmony export */ "CLASS_PROGRESS": function() { return /* binding */ CLASS_PROGRESS; }, 31/* harmony export */ "CLASS_PROGRESS_BAR": function() { return /* binding */ CLASS_PROGRESS_BAR; }, 32/* harmony export */ "CLASS_ROOT": function() { return /* binding */ CLASS_ROOT; }, 33/* harmony export */ "CLASS_SLIDE": function() { return /* binding */ CLASS_SLIDE; }, 34/* harmony export */ "CLASS_SPINNER": function() { return /* binding */ CLASS_SPINNER; }, 35/* harmony export */ "CLASS_SR": function() { return /* binding */ CLASS_SR; }, 36/* harmony export */ "CLASS_TOGGLE": function() { return /* binding */ CLASS_TOGGLE; }, 37/* harmony export */ "CLASS_TOGGLE_PAUSE": function() { return /* binding */ CLASS_TOGGLE_PAUSE; }, 38/* harmony export */ "CLASS_TOGGLE_PLAY": function() { return /* binding */ CLASS_TOGGLE_PLAY; }, 39/* harmony export */ "CLASS_TRACK": function() { return /* binding */ CLASS_TRACK; }, 40/* harmony export */ "CLASS_VISIBLE": function() { return /* binding */ CLASS_VISIBLE; }, 41/* harmony export */ "DEFAULTS": function() { return /* binding */ DEFAULTS; }, 42/* harmony export */ "EVENT_ACTIVE": function() { return /* binding */ EVENT_ACTIVE; }, 43/* harmony export */ "EVENT_ARROWS_MOUNTED": function() { return /* binding */ EVENT_ARROWS_MOUNTED; }, 44/* harmony export */ "EVENT_ARROWS_UPDATED": function() { return /* binding */ EVENT_ARROWS_UPDATED; }, 45/* harmony export */ "EVENT_AUTOPLAY_PAUSE": function() { return /* binding */ EVENT_AUTOPLAY_PAUSE; }, 46/* harmony export */ "EVENT_AUTOPLAY_PLAY": function() { return /* binding */ EVENT_AUTOPLAY_PLAY; }, 47/* harmony export */ "EVENT_AUTOPLAY_PLAYING": function() { return /* binding */ EVENT_AUTOPLAY_PLAYING; }, 48/* harmony export */ "EVENT_CLICK": function() { return /* binding */ EVENT_CLICK; }, 49/* harmony export */ "EVENT_DESTROY": function() { return /* binding */ EVENT_DESTROY; }, 50/* harmony export */ "EVENT_DRAG": function() { return /* binding */ EVENT_DRAG; }, 51/* harmony export */ "EVENT_DRAGGED": function() { return /* binding */ EVENT_DRAGGED; }, 52/* harmony export */ "EVENT_DRAGGING": function() { return /* binding */ EVENT_DRAGGING; }, 53/* harmony export */ "EVENT_END_INDEX_CHANGED": function() { return /* binding */ EVENT_END_INDEX_CHANGED; }, 54/* harmony export */ "EVENT_HIDDEN": function() { return /* binding */ EVENT_HIDDEN; }, 55/* harmony export */ "EVENT_INACTIVE": function() { return /* binding */ EVENT_INACTIVE; }, 56/* harmony export */ "EVENT_LAZYLOAD_LOADED": function() { return /* binding */ EVENT_LAZYLOAD_LOADED; }, 57/* harmony export */ "EVENT_MOUNTED": function() { return /* binding */ EVENT_MOUNTED; }, 58/* harmony export */ "EVENT_MOVE": function() { return /* binding */ EVENT_MOVE; }, 59/* harmony export */ "EVENT_MOVED": function() { return /* binding */ EVENT_MOVED; }, 60/* harmony export */ "EVENT_NAVIGATION_MOUNTED": function() { return /* binding */ EVENT_NAVIGATION_MOUNTED; }, 61/* harmony export */ "EVENT_OVERFLOW": function() { return /* binding */ EVENT_OVERFLOW; }, 62/* harmony export */ "EVENT_PAGINATION_MOUNTED": function() { return /* binding */ EVENT_PAGINATION_MOUNTED; }, 63/* harmony export */ "EVENT_PAGINATION_UPDATED": function() { return /* binding */ EVENT_PAGINATION_UPDATED; }, 64/* harmony export */ "EVENT_READY": function() { return /* binding */ EVENT_READY; }, 65/* harmony export */ "EVENT_REFRESH": function() { return /* binding */ EVENT_REFRESH; }, 66/* harmony export */ "EVENT_RESIZE": function() { return /* binding */ EVENT_RESIZE; }, 67/* harmony export */ "EVENT_RESIZED": function() { return /* binding */ EVENT_RESIZED; }, 68/* harmony export */ "EVENT_SCROLL": function() { return /* binding */ EVENT_SCROLL; }, 69/* harmony export */ "EVENT_SCROLLED": function() { return /* binding */ EVENT_SCROLLED; }, 70/* harmony export */ "EVENT_SHIFTED": function() { return /* binding */ EVENT_SHIFTED; }, 71/* harmony export */ "EVENT_SLIDE_KEYDOWN": function() { return /* binding */ EVENT_SLIDE_KEYDOWN; }, 72/* harmony export */ "EVENT_UPDATED": function() { return /* binding */ EVENT_UPDATED; }, 73/* harmony export */ "EVENT_VISIBLE": function() { return /* binding */ EVENT_VISIBLE; }, 74/* harmony export */ "EventBinder": function() { return /* binding */ EventBinder; }, 75/* harmony export */ "EventInterface": function() { return /* binding */ EventInterface; }, 76/* harmony export */ "FADE": function() { return /* binding */ FADE; }, 77/* harmony export */ "LOOP": function() { return /* binding */ LOOP; }, 78/* harmony export */ "LTR": function() { return /* binding */ LTR; }, 79/* harmony export */ "RTL": function() { return /* binding */ RTL; }, 80/* harmony export */ "RequestInterval": function() { return /* binding */ RequestInterval; }, 81/* harmony export */ "SLIDE": function() { return /* binding */ SLIDE; }, 82/* harmony export */ "STATUS_CLASSES": function() { return /* binding */ STATUS_CLASSES; }, 83/* harmony export */ "Splide": function() { return /* binding */ Splide; }, 84/* harmony export */ "SplideRenderer": function() { return /* binding */ SplideRenderer; }, 85/* harmony export */ "State": function() { return /* binding */ State; }, 86/* harmony export */ "TTB": function() { return /* binding */ TTB; }, 87/* harmony export */ "Throttle": function() { return /* binding */ Throttle; }, 88/* harmony export */ "default": function() { return /* binding */ Splide; } 89/* harmony export */ }); 90function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 91 92function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } 93 94/*! 95 * Splide.js 96 * Version : 4.1.4 97 * License : MIT 98 * Copyright: 2022 Naotoshi Fujita 99 */ 100var MEDIA_PREFERS_REDUCED_MOTION = "(prefers-reduced-motion: reduce)"; 101var CREATED = 1; 102var MOUNTED = 2; 103var IDLE = 3; 104var MOVING = 4; 105var SCROLLING = 5; 106var DRAGGING = 6; 107var DESTROYED = 7; 108var STATES = { 109 CREATED: CREATED, 110 MOUNTED: MOUNTED, 111 IDLE: IDLE, 112 MOVING: MOVING, 113 SCROLLING: SCROLLING, 114 DRAGGING: DRAGGING, 115 DESTROYED: DESTROYED 116}; 117 118function empty(array) { 119 array.length = 0; 120} 121 122function slice(arrayLike, start, end) { 123 return Array.prototype.slice.call(arrayLike, start, end); 124} 125 126function apply(func) { 127 return func.bind.apply(func, [null].concat(slice(arguments, 1))); 128} 129 130var nextTick = setTimeout; 131 132var noop = function noop() {}; 133 134function raf(func) { 135 return requestAnimationFrame(func); 136} 137 138function typeOf(type, subject) { 139 return typeof subject === type; 140} 141 142function isObject(subject) { 143 return !isNull(subject) && typeOf("object", subject); 144} 145 146var isArray = Array.isArray; 147var isFunction = apply(typeOf, "function"); 148var isString = apply(typeOf, "string"); 149var isUndefined = apply(typeOf, "undefined"); 150 151function isNull(subject) { 152 return subject === null; 153} 154 155function isHTMLElement(subject) { 156 try { 157 return subject instanceof (subject.ownerDocument.defaultView || window).HTMLElement; 158 } catch (e) { 159 return false; 160 } 161} 162 163function toArray(value) { 164 return isArray(value) ? value : [value]; 165} 166 167function forEach(values, iteratee) { 168 toArray(values).forEach(iteratee); 169} 170 171function includes(array, value) { 172 return array.indexOf(value) > -1; 173} 174 175function push(array, items) { 176 array.push.apply(array, toArray(items)); 177 return array; 178} 179 180function toggleClass(elm, classes, add) { 181 if (elm) { 182 forEach(classes, function (name) { 183 if (name) { 184 elm.classList[add ? "add" : "remove"](name); 185 } 186 }); 187 } 188} 189 190function addClass(elm, classes) { 191 toggleClass(elm, isString(classes) ? classes.split(" ") : classes, true); 192} 193 194function append(parent, children) { 195 forEach(children, parent.appendChild.bind(parent)); 196} 197 198function before(nodes, ref) { 199 forEach(nodes, function (node) { 200 var parent = (ref || node).parentNode; 201 202 if (parent) { 203 parent.insertBefore(node, ref); 204 } 205 }); 206} 207 208function matches(elm, selector) { 209 return isHTMLElement(elm) && (elm["msMatchesSelector"] || elm.matches).call(elm, selector); 210} 211 212function children(parent, selector) { 213 var children2 = parent ? slice(parent.children) : []; 214 return selector ? children2.filter(function (child) { 215 return matches(child, selector); 216 }) : children2; 217} 218 219function child(parent, selector) { 220 return selector ? children(parent, selector)[0] : parent.firstElementChild; 221} 222 223var ownKeys = Object.keys; 224 225function forOwn(object, iteratee, right) { 226 if (object) { 227 (right ? ownKeys(object).reverse() : ownKeys(object)).forEach(function (key) { 228 key !== "__proto__" && iteratee(object[key], key); 229 }); 230 } 231 232 return object; 233} 234 235function assign(object) { 236 slice(arguments, 1).forEach(function (source) { 237 forOwn(source, function (value, key) { 238 object[key] = source[key]; 239 }); 240 }); 241 return object; 242} 243 244function merge(object) { 245 slice(arguments, 1).forEach(function (source) { 246 forOwn(source, function (value, key) { 247 if (isArray(value)) { 248 object[key] = value.slice(); 249 } else if (isObject(value)) { 250 object[key] = merge({}, isObject(object[key]) ? object[key] : {}, value); 251 } else { 252 object[key] = value; 253 } 254 }); 255 }); 256 return object; 257} 258 259function omit(object, keys) { 260 forEach(keys || ownKeys(object), function (key) { 261 delete object[key]; 262 }); 263} 264 265function removeAttribute(elms, attrs) { 266 forEach(elms, function (elm) { 267 forEach(attrs, function (attr) { 268 elm && elm.removeAttribute(attr); 269 }); 270 }); 271} 272 273function setAttribute(elms, attrs, value) { 274 if (isObject(attrs)) { 275 forOwn(attrs, function (value2, name) { 276 setAttribute(elms, name, value2); 277 }); 278 } else { 279 forEach(elms, function (elm) { 280 isNull(value) || value === "" ? removeAttribute(elm, attrs) : elm.setAttribute(attrs, String(value)); 281 }); 282 } 283} 284 285function create(tag, attrs, parent) { 286 var elm = document.createElement(tag); 287 288 if (attrs) { 289 isString(attrs) ? addClass(elm, attrs) : setAttribute(elm, attrs); 290 } 291 292 parent && append(parent, elm); 293 return elm; 294} 295 296function style(elm, prop, value) { 297 if (isUndefined(value)) { 298 return getComputedStyle(elm)[prop]; 299 } 300 301 if (!isNull(value)) { 302 elm.style[prop] = "" + value; 303 } 304} 305 306function display(elm, display2) { 307 style(elm, "display", display2); 308} 309 310function focus(elm) { 311 elm["setActive"] && elm["setActive"]() || elm.focus({ 312 preventScroll: true 313 }); 314} 315 316function getAttribute(elm, attr) { 317 return elm.getAttribute(attr); 318} 319 320function hasClass(elm, className) { 321 return elm && elm.classList.contains(className); 322} 323 324function rect(target) { 325 return target.getBoundingClientRect(); 326} 327 328function remove(nodes) { 329 forEach(nodes, function (node) { 330 if (node && node.parentNode) { 331 node.parentNode.removeChild(node); 332 } 333 }); 334} 335 336function parseHtml(html) { 337 return child(new DOMParser().parseFromString(html, "text/html").body); 338} 339 340function prevent(e, stopPropagation) { 341 e.preventDefault(); 342 343 if (stopPropagation) { 344 e.stopPropagation(); 345 e.stopImmediatePropagation(); 346 } 347} 348 349function query(parent, selector) { 350 return parent && parent.querySelector(selector); 351} 352 353function queryAll(parent, selector) { 354 return selector ? slice(parent.querySelectorAll(selector)) : []; 355} 356 357function removeClass(elm, classes) { 358 toggleClass(elm, classes, false); 359} 360 361function timeOf(e) { 362 return e.timeStamp; 363} 364 365function unit(value) { 366 return isString(value) ? value : value ? value + "px" : ""; 367} 368 369var PROJECT_CODE = "splide"; 370var DATA_ATTRIBUTE = "data-" + PROJECT_CODE; 371 372function assert(condition, message) { 373 if (!condition) { 374 throw new Error("[" + PROJECT_CODE + "] " + (message || "")); 375 } 376} 377 378var min = Math.min, 379 max = Math.max, 380 floor = Math.floor, 381 ceil = Math.ceil, 382 abs = Math.abs; 383 384function approximatelyEqual(x, y, epsilon) { 385 return abs(x - y) < epsilon; 386} 387 388function between(number, x, y, exclusive) { 389 var minimum = min(x, y); 390 var maximum = max(x, y); 391 return exclusive ? minimum < number && number < maximum : minimum <= number && number <= maximum; 392} 393 394function clamp(number, x, y) { 395 var minimum = min(x, y); 396 var maximum = max(x, y); 397 return min(max(minimum, number), maximum); 398} 399 400function sign(x) { 401 return +(x > 0) - +(x < 0); 402} 403 404function camelToKebab(string) { 405 return string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); 406} 407 408function format(string, replacements) { 409 forEach(replacements, function (replacement) { 410 string = string.replace("%s", "" + replacement); 411 }); 412 return string; 413} 414 415function pad(number) { 416 return number < 10 ? "0" + number : "" + number; 417} 418 419var ids = {}; 420 421function uniqueId(prefix) { 422 return "" + prefix + pad(ids[prefix] = (ids[prefix] || 0) + 1); 423} 424 425function EventBinder() { 426 var listeners = []; 427 428 function bind(targets, events, callback, options) { 429 forEachEvent(targets, events, function (target, event, namespace) { 430 var isEventTarget = ("addEventListener" in target); 431 var remover = isEventTarget ? target.removeEventListener.bind(target, event, callback, options) : target["removeListener"].bind(target, callback); 432 isEventTarget ? target.addEventListener(event, callback, options) : target["addListener"](callback); 433 listeners.push([target, event, namespace, callback, remover]); 434 }); 435 } 436 437 function unbind(targets, events, callback) { 438 forEachEvent(targets, events, function (target, event, namespace) { 439 listeners = listeners.filter(function (listener) { 440 if (listener[0] === target && listener[1] === event && listener[2] === namespace && (!callback || listener[3] === callback)) { 441 listener[4](); 442 return false; 443 } 444 445 return true; 446 }); 447 }); 448 } 449 450 function dispatch(target, type, detail) { 451 var e; 452 var bubbles = true; 453 454 if (typeof CustomEvent === "function") { 455 e = new CustomEvent(type, { 456 bubbles: bubbles, 457 detail: detail 458 }); 459 } else { 460 e = document.createEvent("CustomEvent"); 461 e.initCustomEvent(type, bubbles, false, detail); 462 } 463 464 target.dispatchEvent(e); 465 return e; 466 } 467 468 function forEachEvent(targets, events, iteratee) { 469 forEach(targets, function (target) { 470 target && forEach(events, function (events2) { 471 events2.split(" ").forEach(function (eventNS) { 472 var fragment = eventNS.split("."); 473 iteratee(target, fragment[0], fragment[1]); 474 }); 475 }); 476 }); 477 } 478 479 function destroy() { 480 listeners.forEach(function (data) { 481 data[4](); 482 }); 483 empty(listeners); 484 } 485 486 return { 487 bind: bind, 488 unbind: unbind, 489 dispatch: dispatch, 490 destroy: destroy 491 }; 492} 493 494var EVENT_MOUNTED = "mounted"; 495var EVENT_READY = "ready"; 496var EVENT_MOVE = "move"; 497var EVENT_MOVED = "moved"; 498var EVENT_CLICK = "click"; 499var EVENT_ACTIVE = "active"; 500var EVENT_INACTIVE = "inactive"; 501var EVENT_VISIBLE = "visible"; 502var EVENT_HIDDEN = "hidden"; 503var EVENT_REFRESH = "refresh"; 504var EVENT_UPDATED = "updated"; 505var EVENT_RESIZE = "resize"; 506var EVENT_RESIZED = "resized"; 507var EVENT_DRAG = "drag"; 508var EVENT_DRAGGING = "dragging"; 509var EVENT_DRAGGED = "dragged"; 510var EVENT_SCROLL = "scroll"; 511var EVENT_SCROLLED = "scrolled"; 512var EVENT_OVERFLOW = "overflow"; 513var EVENT_DESTROY = "destroy"; 514var EVENT_ARROWS_MOUNTED = "arrows:mounted"; 515var EVENT_ARROWS_UPDATED = "arrows:updated"; 516var EVENT_PAGINATION_MOUNTED = "pagination:mounted"; 517var EVENT_PAGINATION_UPDATED = "pagination:updated"; 518var EVENT_NAVIGATION_MOUNTED = "navigation:mounted"; 519var EVENT_AUTOPLAY_PLAY = "autoplay:play"; 520var EVENT_AUTOPLAY_PLAYING = "autoplay:playing"; 521var EVENT_AUTOPLAY_PAUSE = "autoplay:pause"; 522var EVENT_LAZYLOAD_LOADED = "lazyload:loaded"; 523var EVENT_SLIDE_KEYDOWN = "sk"; 524var EVENT_SHIFTED = "sh"; 525var EVENT_END_INDEX_CHANGED = "ei"; 526 527function EventInterface(Splide2) { 528 var bus = Splide2 ? Splide2.event.bus : document.createDocumentFragment(); 529 var binder = EventBinder(); 530 531 function on(events, callback) { 532 binder.bind(bus, toArray(events).join(" "), function (e) { 533 callback.apply(callback, isArray(e.detail) ? e.detail : []); 534 }); 535 } 536 537 function emit(event) { 538 binder.dispatch(bus, event, slice(arguments, 1)); 539 } 540 541 if (Splide2) { 542 Splide2.event.on(EVENT_DESTROY, binder.destroy); 543 } 544 545 return assign(binder, { 546 bus: bus, 547 on: on, 548 off: apply(binder.unbind, bus), 549 emit: emit 550 }); 551} 552 553function RequestInterval(interval, onInterval, onUpdate, limit) { 554 var now = Date.now; 555 var startTime; 556 var rate = 0; 557 var id; 558 var paused = true; 559 var count = 0; 560 561 function update() { 562 if (!paused) { 563 rate = interval ? min((now() - startTime) / interval, 1) : 1; 564 onUpdate && onUpdate(rate); 565 566 if (rate >= 1) { 567 onInterval(); 568 startTime = now(); 569 570 if (limit && ++count >= limit) { 571 return pause(); 572 } 573 } 574 575 id = raf(update); 576 } 577 } 578 579 function start(resume) { 580 resume || cancel(); 581 startTime = now() - (resume ? rate * interval : 0); 582 paused = false; 583 id = raf(update); 584 } 585 586 function pause() { 587 paused = true; 588 } 589 590 function rewind() { 591 startTime = now(); 592 rate = 0; 593 594 if (onUpdate) { 595 onUpdate(rate); 596 } 597 } 598 599 function cancel() { 600 id && cancelAnimationFrame(id); 601 rate = 0; 602 id = 0; 603 paused = true; 604 } 605 606 function set(time) { 607 interval = time; 608 } 609 610 function isPaused() { 611 return paused; 612 } 613 614 return { 615 start: start, 616 rewind: rewind, 617 pause: pause, 618 cancel: cancel, 619 set: set, 620 isPaused: isPaused 621 }; 622} 623 624function State(initialState) { 625 var state = initialState; 626 627 function set(value) { 628 state = value; 629 } 630 631 function is(states) { 632 return includes(toArray(states), state); 633 } 634 635 return { 636 set: set, 637 is: is 638 }; 639} 640 641function Throttle(func, duration) { 642 var interval = RequestInterval(duration || 0, func, null, 1); 643 return function () { 644 interval.isPaused() && interval.start(); 645 }; 646} 647 648function Media(Splide2, Components2, options) { 649 var state = Splide2.state; 650 var breakpoints = options.breakpoints || {}; 651 var reducedMotion = options.reducedMotion || {}; 652 var binder = EventBinder(); 653 var queries = []; 654 655 function setup() { 656 var isMin = options.mediaQuery === "min"; 657 ownKeys(breakpoints).sort(function (n, m) { 658 return isMin ? +n - +m : +m - +n; 659 }).forEach(function (key) { 660 register(breakpoints[key], "(" + (isMin ? "min" : "max") + "-width:" + key + "px)"); 661 }); 662 register(reducedMotion, MEDIA_PREFERS_REDUCED_MOTION); 663 update(); 664 } 665 666 function destroy(completely) { 667 if (completely) { 668 binder.destroy(); 669 } 670 } 671 672 function register(options2, query) { 673 var queryList = matchMedia(query); 674 binder.bind(queryList, "change", update); 675 queries.push([options2, queryList]); 676 } 677 678 function update() { 679 var destroyed = state.is(DESTROYED); 680 var direction = options.direction; 681 var merged = queries.reduce(function (merged2, entry) { 682 return merge(merged2, entry[1].matches ? entry[0] : {}); 683 }, {}); 684 omit(options); 685 set(merged); 686 687 if (options.destroy) { 688 Splide2.destroy(options.destroy === "completely"); 689 } else if (destroyed) { 690 destroy(true); 691 Splide2.mount(); 692 } else { 693 direction !== options.direction && Splide2.refresh(); 694 } 695 } 696 697 function reduce(enable) { 698 if (matchMedia(MEDIA_PREFERS_REDUCED_MOTION).matches) { 699 enable ? merge(options, reducedMotion) : omit(options, ownKeys(reducedMotion)); 700 } 701 } 702 703 function set(opts, base, notify) { 704 merge(options, opts); 705 base && merge(Object.getPrototypeOf(options), opts); 706 707 if (notify || !state.is(CREATED)) { 708 Splide2.emit(EVENT_UPDATED, options); 709 } 710 } 711 712 return { 713 setup: setup, 714 destroy: destroy, 715 reduce: reduce, 716 set: set 717 }; 718} 719 720var ARROW = "Arrow"; 721var ARROW_LEFT = ARROW + "Left"; 722var ARROW_RIGHT = ARROW + "Right"; 723var ARROW_UP = ARROW + "Up"; 724var ARROW_DOWN = ARROW + "Down"; 725var LTR = "ltr"; 726var RTL = "rtl"; 727var TTB = "ttb"; 728var ORIENTATION_MAP = { 729 width: ["height"], 730 left: ["top", "right"], 731 right: ["bottom", "left"], 732 x: ["y"], 733 X: ["Y"], 734 Y: ["X"], 735 ArrowLeft: [ARROW_UP, ARROW_RIGHT], 736 ArrowRight: [ARROW_DOWN, ARROW_LEFT] 737}; 738 739function Direction(Splide2, Components2, options) { 740 function resolve(prop, axisOnly, direction) { 741 direction = direction || options.direction; 742 var index = direction === RTL && !axisOnly ? 1 : direction === TTB ? 0 : -1; 743 return ORIENTATION_MAP[prop] && ORIENTATION_MAP[prop][index] || prop.replace(/width|left|right/i, function (match, offset) { 744 var replacement = ORIENTATION_MAP[match.toLowerCase()][index] || match; 745 return offset > 0 ? replacement.charAt(0).toUpperCase() + replacement.slice(1) : replacement; 746 }); 747 } 748 749 function orient(value) { 750 return value * (options.direction === RTL ? 1 : -1); 751 } 752 753 return { 754 resolve: resolve, 755 orient: orient 756 }; 757} 758 759var ROLE = "role"; 760var TAB_INDEX = "tabindex"; 761var DISABLED = "disabled"; 762var ARIA_PREFIX = "aria-"; 763var ARIA_CONTROLS = ARIA_PREFIX + "controls"; 764var ARIA_CURRENT = ARIA_PREFIX + "current"; 765var ARIA_SELECTED = ARIA_PREFIX + "selected"; 766var ARIA_LABEL = ARIA_PREFIX + "label"; 767var ARIA_LABELLEDBY = ARIA_PREFIX + "labelledby"; 768var ARIA_HIDDEN = ARIA_PREFIX + "hidden"; 769var ARIA_ORIENTATION = ARIA_PREFIX + "orientation"; 770var ARIA_ROLEDESCRIPTION = ARIA_PREFIX + "roledescription"; 771var ARIA_LIVE = ARIA_PREFIX + "live"; 772var ARIA_BUSY = ARIA_PREFIX + "busy"; 773var ARIA_ATOMIC = ARIA_PREFIX + "atomic"; 774var ALL_ATTRIBUTES = [ROLE, TAB_INDEX, DISABLED, ARIA_CONTROLS, ARIA_CURRENT, ARIA_LABEL, ARIA_LABELLEDBY, ARIA_HIDDEN, ARIA_ORIENTATION, ARIA_ROLEDESCRIPTION]; 775var CLASS_PREFIX = PROJECT_CODE + "__"; 776var STATUS_CLASS_PREFIX = "is-"; 777var CLASS_ROOT = PROJECT_CODE; 778var CLASS_TRACK = CLASS_PREFIX + "track"; 779var CLASS_LIST = CLASS_PREFIX + "list"; 780var CLASS_SLIDE = CLASS_PREFIX + "slide"; 781var CLASS_CLONE = CLASS_SLIDE + "--clone"; 782var CLASS_CONTAINER = CLASS_SLIDE + "__container"; 783var CLASS_ARROWS = CLASS_PREFIX + "arrows"; 784var CLASS_ARROW = CLASS_PREFIX + "arrow"; 785var CLASS_ARROW_PREV = CLASS_ARROW + "--prev"; 786var CLASS_ARROW_NEXT = CLASS_ARROW + "--next"; 787var CLASS_PAGINATION = CLASS_PREFIX + "pagination"; 788var CLASS_PAGINATION_PAGE = CLASS_PAGINATION + "__page"; 789var CLASS_PROGRESS = CLASS_PREFIX + "progress"; 790var CLASS_PROGRESS_BAR = CLASS_PROGRESS + "__bar"; 791var CLASS_TOGGLE = CLASS_PREFIX + "toggle"; 792var CLASS_TOGGLE_PLAY = CLASS_TOGGLE + "__play"; 793var CLASS_TOGGLE_PAUSE = CLASS_TOGGLE + "__pause"; 794var CLASS_SPINNER = CLASS_PREFIX + "spinner"; 795var CLASS_SR = CLASS_PREFIX + "sr"; 796var CLASS_INITIALIZED = STATUS_CLASS_PREFIX + "initialized"; 797var CLASS_ACTIVE = STATUS_CLASS_PREFIX + "active"; 798var CLASS_PREV = STATUS_CLASS_PREFIX + "prev"; 799var CLASS_NEXT = STATUS_CLASS_PREFIX + "next"; 800var CLASS_VISIBLE = STATUS_CLASS_PREFIX + "visible"; 801var CLASS_LOADING = STATUS_CLASS_PREFIX + "loading"; 802var CLASS_FOCUS_IN = STATUS_CLASS_PREFIX + "focus-in"; 803var CLASS_OVERFLOW = STATUS_CLASS_PREFIX + "overflow"; 804var STATUS_CLASSES = [CLASS_ACTIVE, CLASS_VISIBLE, CLASS_PREV, CLASS_NEXT, CLASS_LOADING, CLASS_FOCUS_IN, CLASS_OVERFLOW]; 805var CLASSES = { 806 slide: CLASS_SLIDE, 807 clone: CLASS_CLONE, 808 arrows: CLASS_ARROWS, 809 arrow: CLASS_ARROW, 810 prev: CLASS_ARROW_PREV, 811 next: CLASS_ARROW_NEXT, 812 pagination: CLASS_PAGINATION, 813 page: CLASS_PAGINATION_PAGE, 814 spinner: CLASS_SPINNER 815}; 816 817function closest(from, selector) { 818 if (isFunction(from.closest)) { 819 return from.closest(selector); 820 } 821 822 var elm = from; 823 824 while (elm && elm.nodeType === 1) { 825 if (matches(elm, selector)) { 826 break; 827 } 828 829 elm = elm.parentElement; 830 } 831 832 return elm; 833} 834 835var FRICTION = 5; 836var LOG_INTERVAL = 200; 837var POINTER_DOWN_EVENTS = "touchstart mousedown"; 838var POINTER_MOVE_EVENTS = "touchmove mousemove"; 839var POINTER_UP_EVENTS = "touchend touchcancel mouseup click"; 840 841function Elements(Splide2, Components2, options) { 842 var _EventInterface = EventInterface(Splide2), 843 on = _EventInterface.on, 844 bind = _EventInterface.bind; 845 846 var root = Splide2.root; 847 var i18n = options.i18n; 848 var elements = {}; 849 var slides = []; 850 var rootClasses = []; 851 var trackClasses = []; 852 var track; 853 var list; 854 var isUsingKey; 855 856 function setup() { 857 collect(); 858 init(); 859 update(); 860 } 861 862 function mount() { 863 on(EVENT_REFRESH, destroy); 864 on(EVENT_REFRESH, setup); 865 on(EVENT_UPDATED, update); 866 bind(document, POINTER_DOWN_EVENTS + " keydown", function (e) { 867 isUsingKey = e.type === "keydown"; 868 }, { 869 capture: true 870 }); 871 bind(root, "focusin", function () { 872 toggleClass(root, CLASS_FOCUS_IN, !!isUsingKey); 873 }); 874 } 875 876 function destroy(completely) { 877 var attrs = ALL_ATTRIBUTES.concat("style"); 878 empty(slides); 879 removeClass(root, rootClasses); 880 removeClass(track, trackClasses); 881 removeAttribute([track, list], attrs); 882 removeAttribute(root, completely ? attrs : ["style", ARIA_ROLEDESCRIPTION]); 883 } 884 885 function update() { 886 removeClass(root, rootClasses); 887 removeClass(track, trackClasses); 888 rootClasses = getClasses(CLASS_ROOT); 889 trackClasses = getClasses(CLASS_TRACK); 890 addClass(root, rootClasses); 891 addClass(track, trackClasses); 892 setAttribute(root, ARIA_LABEL, options.label); 893 setAttribute(root, ARIA_LABELLEDBY, options.labelledby); 894 } 895 896 function collect() { 897 track = find("." + CLASS_TRACK); 898 list = child(track, "." + CLASS_LIST); 899 assert(track && list, "A track/list element is missing."); 900 push(slides, children(list, "." + CLASS_SLIDE + ":not(." + CLASS_CLONE + ")")); 901 forOwn({ 902 arrows: CLASS_ARROWS, 903 pagination: CLASS_PAGINATION, 904 prev: CLASS_ARROW_PREV, 905 next: CLASS_ARROW_NEXT, 906 bar: CLASS_PROGRESS_BAR, 907 toggle: CLASS_TOGGLE 908 }, function (className, key) { 909 elements[key] = find("." + className); 910 }); 911 assign(elements, { 912 root: root, 913 track: track, 914 list: list, 915 slides: slides 916 }); 917 } 918 919 function init() { 920 var id = root.id || uniqueId(PROJECT_CODE); 921 var role = options.role; 922 root.id = id; 923 track.id = track.id || id + "-track"; 924 list.id = list.id || id + "-list"; 925 926 if (!getAttribute(root, ROLE) && root.tagName !== "SECTION" && role) { 927 setAttribute(root, ROLE, role); 928 } 929 930 setAttribute(root, ARIA_ROLEDESCRIPTION, i18n.carousel); 931 setAttribute(list, ROLE, "presentation"); 932 } 933 934 function find(selector) { 935 var elm = query(root, selector); 936 return elm && closest(elm, "." + CLASS_ROOT) === root ? elm : void 0; 937 } 938 939 function getClasses(base) { 940 return [base + "--" + options.type, base + "--" + options.direction, options.drag && base + "--draggable", options.isNavigation && base + "--nav", base === CLASS_ROOT && CLASS_ACTIVE]; 941 } 942 943 return assign(elements, { 944 setup: setup, 945 mount: mount, 946 destroy: destroy 947 }); 948} 949 950var SLIDE = "slide"; 951var LOOP = "loop"; 952var FADE = "fade"; 953 954function Slide$1(Splide2, index, slideIndex, slide) { 955 var event = EventInterface(Splide2); 956 var on = event.on, 957 emit = event.emit, 958 bind = event.bind; 959 var Components = Splide2.Components, 960 root = Splide2.root, 961 options = Splide2.options; 962 var isNavigation = options.isNavigation, 963 updateOnMove = options.updateOnMove, 964 i18n = options.i18n, 965 pagination = options.pagination, 966 slideFocus = options.slideFocus; 967 var resolve = Components.Direction.resolve; 968 var styles = getAttribute(slide, "style"); 969 var label = getAttribute(slide, ARIA_LABEL); 970 var isClone = slideIndex > -1; 971 var container = child(slide, "." + CLASS_CONTAINER); 972 var destroyed; 973 974 function mount() { 975 if (!isClone) { 976 slide.id = root.id + "-slide" + pad(index + 1); 977 setAttribute(slide, ROLE, pagination ? "tabpanel" : "group"); 978 setAttribute(slide, ARIA_ROLEDESCRIPTION, i18n.slide); 979 setAttribute(slide, ARIA_LABEL, label || format(i18n.slideLabel, [index + 1, Splide2.length])); 980 } 981 982 listen(); 983 } 984 985 function listen() { 986 bind(slide, "click", apply(emit, EVENT_CLICK, self)); 987 bind(slide, "keydown", apply(emit, EVENT_SLIDE_KEYDOWN, self)); 988 on([EVENT_MOVED, EVENT_SHIFTED, EVENT_SCROLLED], update); 989 on(EVENT_NAVIGATION_MOUNTED, initNavigation); 990 991 if (updateOnMove) { 992 on(EVENT_MOVE, onMove); 993 } 994 } 995 996 function destroy() { 997 destroyed = true; 998 event.destroy(); 999 removeClass(slide, STATUS_CLASSES); 1000 removeAttribute(slide, ALL_ATTRIBUTES); 1001 setAttribute(slide, "style", styles); 1002 setAttribute(slide, ARIA_LABEL, label || ""); 1003 } 1004 1005 function initNavigation() { 1006 var controls = Splide2.splides.map(function (target) { 1007 var Slide2 = target.splide.Components.Slides.getAt(index); 1008 return Slide2 ? Slide2.slide.id : ""; 1009 }).join(" "); 1010 setAttribute(slide, ARIA_LABEL, format(i18n.slideX, (isClone ? slideIndex : index) + 1)); 1011 setAttribute(slide, ARIA_CONTROLS, controls); 1012 setAttribute(slide, ROLE, slideFocus ? "button" : ""); 1013 slideFocus && removeAttribute(slide, ARIA_ROLEDESCRIPTION); 1014 } 1015 1016 function onMove() { 1017 if (!destroyed) { 1018 update(); 1019 } 1020 } 1021 1022 function update() { 1023 if (!destroyed) { 1024 var curr = Splide2.index; 1025 updateActivity(); 1026 updateVisibility(); 1027 toggleClass(slide, CLASS_PREV, index === curr - 1); 1028 toggleClass(slide, CLASS_NEXT, index === curr + 1); 1029 } 1030 } 1031 1032 function updateActivity() { 1033 var active = isActive(); 1034 1035 if (active !== hasClass(slide, CLASS_ACTIVE)) { 1036 toggleClass(slide, CLASS_ACTIVE, active); 1037 setAttribute(slide, ARIA_CURRENT, isNavigation && active || ""); 1038 emit(active ? EVENT_ACTIVE : EVENT_INACTIVE, self); 1039 } 1040 } 1041 1042 function updateVisibility() { 1043 var visible = isVisible(); 1044 var hidden = !visible && (!isActive() || isClone); 1045 1046 if (!Splide2.state.is([MOVING, SCROLLING])) { 1047 setAttribute(slide, ARIA_HIDDEN, hidden || ""); 1048 } 1049 1050 setAttribute(queryAll(slide, options.focusableNodes || ""), TAB_INDEX, hidden ? -1 : ""); 1051 1052 if (slideFocus) { 1053 setAttribute(slide, TAB_INDEX, hidden ? -1 : 0); 1054 } 1055 1056 if (visible !== hasClass(slide, CLASS_VISIBLE)) { 1057 toggleClass(slide, CLASS_VISIBLE, visible); 1058 emit(visible ? EVENT_VISIBLE : EVENT_HIDDEN, self); 1059 } 1060 1061 if (!visible && document.activeElement === slide) { 1062 var Slide2 = Components.Slides.getAt(Splide2.index); 1063 Slide2 && focus(Slide2.slide); 1064 } 1065 } 1066 1067 function style$1(prop, value, useContainer) { 1068 style(useContainer && container || slide, prop, value); 1069 } 1070 1071 function isActive() { 1072 var curr = Splide2.index; 1073 return curr === index || options.cloneStatus && curr === slideIndex; 1074 } 1075 1076 function isVisible() { 1077 if (Splide2.is(FADE)) { 1078 return isActive(); 1079 } 1080 1081 var trackRect = rect(Components.Elements.track); 1082 var slideRect = rect(slide); 1083 var left = resolve("left", true); 1084 var right = resolve("right", true); 1085 return floor(trackRect[left]) <= ceil(slideRect[left]) && floor(slideRect[right]) <= ceil(trackRect[right]); 1086 } 1087 1088 function isWithin(from, distance) { 1089 var diff = abs(from - index); 1090 1091 if (!isClone && (options.rewind || Splide2.is(LOOP))) { 1092 diff = min(diff, Splide2.length - diff); 1093 } 1094 1095 return diff <= distance; 1096 } 1097 1098 var self = { 1099 index: index, 1100 slideIndex: slideIndex, 1101 slide: slide, 1102 container: container, 1103 isClone: isClone, 1104 mount: mount, 1105 destroy: destroy, 1106 update: update, 1107 style: style$1, 1108 isWithin: isWithin 1109 }; 1110 return self; 1111} 1112 1113function Slides(Splide2, Components2, options) { 1114 var _EventInterface2 = EventInterface(Splide2), 1115 on = _EventInterface2.on, 1116 emit = _EventInterface2.emit, 1117 bind = _EventInterface2.bind; 1118 1119 var _Components2$Elements = Components2.Elements, 1120 slides = _Components2$Elements.slides, 1121 list = _Components2$Elements.list; 1122 var Slides2 = []; 1123 1124 function mount() { 1125 init(); 1126 on(EVENT_REFRESH, destroy); 1127 on(EVENT_REFRESH, init); 1128 } 1129 1130 function init() { 1131 slides.forEach(function (slide, index) { 1132 register(slide, index, -1); 1133 }); 1134 } 1135 1136 function destroy() { 1137 forEach$1(function (Slide2) { 1138 Slide2.destroy(); 1139 }); 1140 empty(Slides2); 1141 } 1142 1143 function update() { 1144 forEach$1(function (Slide2) { 1145 Slide2.update(); 1146 }); 1147 } 1148 1149 function register(slide, index, slideIndex) { 1150 var object = Slide$1(Splide2, index, slideIndex, slide); 1151 object.mount(); 1152 Slides2.push(object); 1153 Slides2.sort(function (Slide1, Slide2) { 1154 return Slide1.index - Slide2.index; 1155 }); 1156 } 1157 1158 function get(excludeClones) { 1159 return excludeClones ? filter(function (Slide2) { 1160 return !Slide2.isClone; 1161 }) : Slides2; 1162 } 1163 1164 function getIn(page) { 1165 var Controller = Components2.Controller; 1166 var index = Controller.toIndex(page); 1167 var max = Controller.hasFocus() ? 1 : options.perPage; 1168 return filter(function (Slide2) { 1169 return between(Slide2.index, index, index + max - 1); 1170 }); 1171 } 1172 1173 function getAt(index) { 1174 return filter(index)[0]; 1175 } 1176 1177 function add(items, index) { 1178 forEach(items, function (slide) { 1179 if (isString(slide)) { 1180 slide = parseHtml(slide); 1181 } 1182 1183 if (isHTMLElement(slide)) { 1184 var ref = slides[index]; 1185 ref ? before(slide, ref) : append(list, slide); 1186 addClass(slide, options.classes.slide); 1187 observeImages(slide, apply(emit, EVENT_RESIZE)); 1188 } 1189 }); 1190 emit(EVENT_REFRESH); 1191 } 1192 1193 function remove$1(matcher) { 1194 remove(filter(matcher).map(function (Slide2) { 1195 return Slide2.slide; 1196 })); 1197 emit(EVENT_REFRESH); 1198 } 1199 1200 function forEach$1(iteratee, excludeClones) { 1201 get(excludeClones).forEach(iteratee); 1202 } 1203 1204 function filter(matcher) { 1205 return Slides2.filter(isFunction(matcher) ? matcher : function (Slide2) { 1206 return isString(matcher) ? matches(Slide2.slide, matcher) : includes(toArray(matcher), Slide2.index); 1207 }); 1208 } 1209 1210 function style(prop, value, useContainer) { 1211 forEach$1(function (Slide2) { 1212 Slide2.style(prop, value, useContainer); 1213 }); 1214 } 1215 1216 function observeImages(elm, callback) { 1217 var images = queryAll(elm, "img"); 1218 var length = images.length; 1219 1220 if (length) { 1221 images.forEach(function (img) { 1222 bind(img, "load error", function () { 1223 if (! --length) { 1224 callback(); 1225 } 1226 }); 1227 }); 1228 } else { 1229 callback(); 1230 } 1231 } 1232 1233 function getLength(excludeClones) { 1234 return excludeClones ? slides.length : Slides2.length; 1235 } 1236 1237 function isEnough() { 1238 return Slides2.length > options.perPage; 1239 } 1240 1241 return { 1242 mount: mount, 1243 destroy: destroy, 1244 update: update, 1245 register: register, 1246 get: get, 1247 getIn: getIn, 1248 getAt: getAt, 1249 add: add, 1250 remove: remove$1, 1251 forEach: forEach$1, 1252 filter: filter, 1253 style: style, 1254 getLength: getLength, 1255 isEnough: isEnough 1256 }; 1257} 1258 1259function Layout(Splide2, Components2, options) { 1260 var _EventInterface3 = EventInterface(Splide2), 1261 on = _EventInterface3.on, 1262 bind = _EventInterface3.bind, 1263 emit = _EventInterface3.emit; 1264 1265 var Slides = Components2.Slides; 1266 var resolve = Components2.Direction.resolve; 1267 var _Components2$Elements2 = Components2.Elements, 1268 root = _Components2$Elements2.root, 1269 track = _Components2$Elements2.track, 1270 list = _Components2$Elements2.list; 1271 var getAt = Slides.getAt, 1272 styleSlides = Slides.style; 1273 var vertical; 1274 var rootRect; 1275 var overflow; 1276 1277 function mount() { 1278 init(); 1279 bind(window, "resize load", Throttle(apply(emit, EVENT_RESIZE))); 1280 on([EVENT_UPDATED, EVENT_REFRESH], init); 1281 on(EVENT_RESIZE, resize); 1282 } 1283 1284 function init() { 1285 vertical = options.direction === TTB; 1286 style(root, "maxWidth", unit(options.width)); 1287 style(track, resolve("paddingLeft"), cssPadding(false)); 1288 style(track, resolve("paddingRight"), cssPadding(true)); 1289 resize(true); 1290 } 1291 1292 function resize(force) { 1293 var newRect = rect(root); 1294 1295 if (force || rootRect.width !== newRect.width || rootRect.height !== newRect.height) { 1296 style(track, "height", cssTrackHeight()); 1297 styleSlides(resolve("marginRight"), unit(options.gap)); 1298 styleSlides("width", cssSlideWidth()); 1299 styleSlides("height", cssSlideHeight(), true); 1300 rootRect = newRect; 1301 emit(EVENT_RESIZED); 1302 1303 if (overflow !== (overflow = isOverflow())) { 1304 toggleClass(root, CLASS_OVERFLOW, overflow); 1305 emit(EVENT_OVERFLOW, overflow); 1306 } 1307 } 1308 } 1309 1310 function cssPadding(right) { 1311 var padding = options.padding; 1312 var prop = resolve(right ? "right" : "left"); 1313 return padding && unit(padding[prop] || (isObject(padding) ? 0 : padding)) || "0px"; 1314 } 1315 1316 function cssTrackHeight() { 1317 var height = ""; 1318 1319 if (vertical) { 1320 height = cssHeight(); 1321 assert(height, "height or heightRatio is missing."); 1322 height = "calc(" + height + " - " + cssPadding(false) + " - " + cssPadding(true) + ")"; 1323 } 1324 1325 return height; 1326 } 1327 1328 function cssHeight() { 1329 return unit(options.height || rect(list).width * options.heightRatio); 1330 } 1331 1332 function cssSlideWidth() { 1333 return options.autoWidth ? null : unit(options.fixedWidth) || (vertical ? "" : cssSlideSize()); 1334 } 1335 1336 function cssSlideHeight() { 1337 return unit(options.fixedHeight) || (vertical ? options.autoHeight ? null : cssSlideSize() : cssHeight()); 1338 } 1339 1340 function cssSlideSize() { 1341 var gap = unit(options.gap); 1342 return "calc((100%" + (gap && " + " + gap) + ")/" + (options.perPage || 1) + (gap && " - " + gap) + ")"; 1343 } 1344 1345 function listSize() { 1346 return rect(list)[resolve("width")]; 1347 } 1348 1349 function slideSize(index, withoutGap) { 1350 var Slide = getAt(index || 0); 1351 return Slide ? rect(Slide.slide)[resolve("width")] + (withoutGap ? 0 : getGap()) : 0; 1352 } 1353 1354 function totalSize(index, withoutGap) { 1355 var Slide = getAt(index); 1356 1357 if (Slide) { 1358 var right = rect(Slide.slide)[resolve("right")]; 1359 var left = rect(list)[resolve("left")]; 1360 return abs(right - left) + (withoutGap ? 0 : getGap()); 1361 } 1362 1363 return 0; 1364 } 1365 1366 function sliderSize(withoutGap) { 1367 return totalSize(Splide2.length - 1) - totalSize(0) + slideSize(0, withoutGap); 1368 } 1369 1370 function getGap() { 1371 var Slide = getAt(0); 1372 return Slide && parseFloat(style(Slide.slide, resolve("marginRight"))) || 0; 1373 } 1374 1375 function getPadding(right) { 1376 return parseFloat(style(track, resolve("padding" + (right ? "Right" : "Left")))) || 0; 1377 } 1378 1379 function isOverflow() { 1380 return Splide2.is(FADE) || sliderSize(true) > listSize(); 1381 } 1382 1383 return { 1384 mount: mount, 1385 resize: resize, 1386 listSize: listSize, 1387 slideSize: slideSize, 1388 sliderSize: sliderSize, 1389 totalSize: totalSize, 1390 getPadding: getPadding, 1391 isOverflow: isOverflow 1392 }; 1393} 1394 1395var MULTIPLIER = 2; 1396 1397function Clones(Splide2, Components2, options) { 1398 var event = EventInterface(Splide2); 1399 var on = event.on; 1400 var Elements = Components2.Elements, 1401 Slides = Components2.Slides; 1402 var resolve = Components2.Direction.resolve; 1403 var clones = []; 1404 var cloneCount; 1405 1406 function mount() { 1407 on(EVENT_REFRESH, remount); 1408 on([EVENT_UPDATED, EVENT_RESIZE], observe); 1409 1410 if (cloneCount = computeCloneCount()) { 1411 generate(cloneCount); 1412 Components2.Layout.resize(true); 1413 } 1414 } 1415 1416 function remount() { 1417 destroy(); 1418 mount(); 1419 } 1420 1421 function destroy() { 1422 remove(clones); 1423 empty(clones); 1424 event.destroy(); 1425 } 1426 1427 function observe() { 1428 var count = computeCloneCount(); 1429 1430 if (cloneCount !== count) { 1431 if (cloneCount < count || !count) { 1432 event.emit(EVENT_REFRESH); 1433 } 1434 } 1435 } 1436 1437 function generate(count) { 1438 var slides = Slides.get().slice(); 1439 var length = slides.length; 1440 1441 if (length) { 1442 while (slides.length < count) { 1443 push(slides, slides); 1444 } 1445 1446 push(slides.slice(-count), slides.slice(0, count)).forEach(function (Slide, index) { 1447 var isHead = index < count; 1448 var clone = cloneDeep(Slide.slide, index); 1449 isHead ? before(clone, slides[0].slide) : append(Elements.list, clone); 1450 push(clones, clone); 1451 Slides.register(clone, index - count + (isHead ? 0 : length), Slide.index); 1452 }); 1453 } 1454 } 1455 1456 function cloneDeep(elm, index) { 1457 var clone = elm.cloneNode(true); 1458 addClass(clone, options.classes.clone); 1459 clone.id = Splide2.root.id + "-clone" + pad(index + 1); 1460 return clone; 1461 } 1462 1463 function computeCloneCount() { 1464 var clones2 = options.clones; 1465 1466 if (!Splide2.is(LOOP)) { 1467 clones2 = 0; 1468 } else if (isUndefined(clones2)) { 1469 var fixedSize = options[resolve("fixedWidth")] && Components2.Layout.slideSize(0); 1470 var fixedCount = fixedSize && ceil(rect(Elements.track)[resolve("width")] / fixedSize); 1471 clones2 = fixedCount || options[resolve("autoWidth")] && Splide2.length || options.perPage * MULTIPLIER; 1472 } 1473 1474 return clones2; 1475 } 1476 1477 return { 1478 mount: mount, 1479 destroy: destroy 1480 }; 1481} 1482 1483function Move(Splide2, Components2, options) { 1484 var _EventInterface4 = EventInterface(Splide2), 1485 on = _EventInterface4.on, 1486 emit = _EventInterface4.emit; 1487 1488 var set = Splide2.state.set; 1489 var _Components2$Layout = Components2.Layout, 1490 slideSize = _Components2$Layout.slideSize, 1491 getPadding = _Components2$Layout.getPadding, 1492 totalSize = _Components2$Layout.totalSize, 1493 listSize = _Components2$Layout.listSize, 1494 sliderSize = _Components2$Layout.sliderSize; 1495 var _Components2$Directio = Components2.Direction, 1496 resolve = _Components2$Directio.resolve, 1497 orient = _Components2$Directio.orient; 1498 var _Components2$Elements3 = Components2.Elements, 1499 list = _Components2$Elements3.list, 1500 track = _Components2$Elements3.track; 1501 var Transition; 1502 1503 function mount() { 1504 Transition = Components2.Transition; 1505 on([EVENT_MOUNTED, EVENT_RESIZED, EVENT_UPDATED, EVENT_REFRESH], reposition); 1506 } 1507 1508 function reposition() { 1509 if (!Components2.Controller.isBusy()) { 1510 Components2.Scroll.cancel(); 1511 jump(Splide2.index); 1512 Components2.Slides.update(); 1513 } 1514 } 1515 1516 function move(dest, index, prev, callback) { 1517 if (dest !== index && canShift(dest > prev)) { 1518 cancel(); 1519 translate(shift(getPosition(), dest > prev), true); 1520 } 1521 1522 set(MOVING); 1523 emit(EVENT_MOVE, index, prev, dest); 1524 Transition.start(index, function () { 1525 set(IDLE); 1526 emit(EVENT_MOVED, index, prev, dest); 1527 callback && callback(); 1528 }); 1529 } 1530 1531 function jump(index) { 1532 translate(toPosition(index, true)); 1533 } 1534 1535 function translate(position, preventLoop) { 1536 if (!Splide2.is(FADE)) { 1537 var destination = preventLoop ? position : loop(position); 1538 style(list, "transform", "translate" + resolve("X") + "(" + destination + "px)"); 1539 position !== destination && emit(EVENT_SHIFTED); 1540 } 1541 } 1542 1543 function loop(position) { 1544 if (Splide2.is(LOOP)) { 1545 var index = toIndex(position); 1546 var exceededMax = index > Components2.Controller.getEnd(); 1547 var exceededMin = index < 0; 1548 1549 if (exceededMin || exceededMax) { 1550 position = shift(position, exceededMax); 1551 } 1552 } 1553 1554 return position; 1555 } 1556 1557 function shift(position, backwards) { 1558 var excess = position - getLimit(backwards); 1559 var size = sliderSize(); 1560 position -= orient(size * (ceil(abs(excess) / size) || 1)) * (backwards ? 1 : -1); 1561 return position; 1562 } 1563 1564 function cancel() { 1565 translate(getPosition(), true); 1566 Transition.cancel(); 1567 } 1568 1569 function toIndex(position) { 1570 var Slides = Components2.Slides.get(); 1571 var index = 0; 1572 var minDistance = Infinity; 1573 1574 for (var i = 0; i < Slides.length; i++) { 1575 var slideIndex = Slides[i].index; 1576 var distance = abs(toPosition(slideIndex, true) - position); 1577 1578 if (distance <= minDistance) { 1579 minDistance = distance; 1580 index = slideIndex; 1581 } else { 1582 break; 1583 } 1584 } 1585 1586 return index; 1587 } 1588 1589 function toPosition(index, trimming) { 1590 var position = orient(totalSize(index - 1) - offset(index)); 1591 return trimming ? trim(position) : position; 1592 } 1593 1594 function getPosition() { 1595 var left = resolve("left"); 1596 return rect(list)[left] - rect(track)[left] + orient(getPadding(false)); 1597 } 1598 1599 function trim(position) { 1600 if (options.trimSpace && Splide2.is(SLIDE)) { 1601 position = clamp(position, 0, orient(sliderSize(true) - listSize())); 1602 } 1603 1604 return position; 1605 } 1606 1607 function offset(index) { 1608 var focus = options.focus; 1609 return focus === "center" ? (listSize() - slideSize(index, true)) / 2 : +focus * slideSize(index) || 0; 1610 } 1611 1612 function getLimit(max) { 1613 return toPosition(max ? Components2.Controller.getEnd() : 0, !!options.trimSpace); 1614 } 1615 1616 function canShift(backwards) { 1617 var shifted = orient(shift(getPosition(), backwards)); 1618 return backwards ? shifted >= 0 : shifted <= list[resolve("scrollWidth")] - rect(track)[resolve("width")]; 1619 } 1620 1621 function exceededLimit(max, position) { 1622 position = isUndefined(position) ? getPosition() : position; 1623 var exceededMin = max !== true && orient(position) < orient(getLimit(false)); 1624 var exceededMax = max !== false && orient(position) > orient(getLimit(true)); 1625 return exceededMin || exceededMax; 1626 } 1627 1628 return { 1629 mount: mount, 1630 move: move, 1631 jump: jump, 1632 translate: translate, 1633 shift: shift, 1634 cancel: cancel, 1635 toIndex: toIndex, 1636 toPosition: toPosition, 1637 getPosition: getPosition, 1638 getLimit: getLimit, 1639 exceededLimit: exceededLimit, 1640 reposition: reposition 1641 }; 1642} 1643 1644function Controller(Splide2, Components2, options) { 1645 var _EventInterface5 = EventInterface(Splide2), 1646 on = _EventInterface5.on, 1647 emit = _EventInterface5.emit; 1648 1649 var Move = Components2.Move; 1650 var getPosition = Move.getPosition, 1651 getLimit = Move.getLimit, 1652 toPosition = Move.toPosition; 1653 var _Components2$Slides = Components2.Slides, 1654 isEnough = _Components2$Slides.isEnough, 1655 getLength = _Components2$Slides.getLength; 1656 var omitEnd = options.omitEnd; 1657 var isLoop = Splide2.is(LOOP); 1658 var isSlide = Splide2.is(SLIDE); 1659 var getNext = apply(getAdjacent, false); 1660 var getPrev = apply(getAdjacent, true); 1661 var currIndex = options.start || 0; 1662 var endIndex; 1663 var prevIndex = currIndex; 1664 var slideCount; 1665 var perMove; 1666 var perPage; 1667 1668 function mount() { 1669 init(); 1670 on([EVENT_UPDATED, EVENT_REFRESH, EVENT_END_INDEX_CHANGED], init); 1671 on(EVENT_RESIZED, onResized); 1672 } 1673 1674 function init() { 1675 slideCount = getLength(true); 1676 perMove = options.perMove; 1677 perPage = options.perPage; 1678 endIndex = getEnd(); 1679 var index = clamp(currIndex, 0, omitEnd ? endIndex : slideCount - 1); 1680 1681 if (index !== currIndex) { 1682 currIndex = index; 1683 Move.reposition(); 1684 } 1685 } 1686 1687 function onResized() { 1688 if (endIndex !== getEnd()) { 1689 emit(EVENT_END_INDEX_CHANGED); 1690 } 1691 } 1692 1693 function go(control, allowSameIndex, callback) { 1694 if (!isBusy()) { 1695 var dest = parse(control); 1696 var index = loop(dest); 1697 1698 if (index > -1 && (allowSameIndex || index !== currIndex)) { 1699 setIndex(index); 1700 Move.move(dest, index, prevIndex, callback); 1701 } 1702 } 1703 } 1704 1705 function scroll(destination, duration, snap, callback) { 1706 Components2.Scroll.scroll(destination, duration, snap, function () { 1707 var index = loop(Move.toIndex(getPosition())); 1708 setIndex(omitEnd ? min(index, endIndex) : index); 1709 callback && callback(); 1710 }); 1711 } 1712 1713 function parse(control) { 1714 var index = currIndex; 1715 1716 if (isString(control)) { 1717 var _ref = control.match(/([+\-<>])(\d+)?/) || [], 1718 indicator = _ref[1], 1719 number = _ref[2]; 1720 1721 if (indicator === "+" || indicator === "-") { 1722 index = computeDestIndex(currIndex + +("" + indicator + (+number || 1)), currIndex); 1723 } else if (indicator === ">") { 1724 index = number ? toIndex(+number) : getNext(true); 1725 } else if (indicator === "<") { 1726 index = getPrev(true); 1727 } 1728 } else { 1729 index = isLoop ? control : clamp(control, 0, endIndex); 1730 } 1731 1732 return index; 1733 } 1734 1735 function getAdjacent(prev, destination) { 1736 var number = perMove || (hasFocus() ? 1 : perPage); 1737 var dest = computeDestIndex(currIndex + number * (prev ? -1 : 1), currIndex, !(perMove || hasFocus())); 1738 1739 if (dest === -1 && isSlide) { 1740 if (!approximatelyEqual(getPosition(), getLimit(!prev), 1)) { 1741 return prev ? 0 : endIndex; 1742 } 1743 } 1744 1745 return destination ? dest : loop(dest); 1746 } 1747 1748 function computeDestIndex(dest, from, snapPage) { 1749 if (isEnough() || hasFocus()) { 1750 var index = computeMovableDestIndex(dest); 1751 1752 if (index !== dest) { 1753 from = dest; 1754 dest = index; 1755 snapPage = false; 1756 } 1757 1758 if (dest < 0 || dest > endIndex) { 1759 if (!perMove && (between(0, dest, from, true) || between(endIndex, from, dest, true))) { 1760 dest = toIndex(toPage(dest)); 1761 } else { 1762 if (isLoop) { 1763 dest = snapPage ? dest < 0 ? -(slideCount % perPage || perPage) : slideCount : dest; 1764 } else if (options.rewind) { 1765 dest = dest < 0 ? endIndex : 0; 1766 } else { 1767 dest = -1; 1768 } 1769 } 1770 } else { 1771 if (snapPage && dest !== from) { 1772 dest = toIndex(toPage(from) + (dest < from ? -1 : 1)); 1773 } 1774 } 1775 } else { 1776 dest = -1; 1777 } 1778 1779 return dest; 1780 } 1781 1782 function computeMovableDestIndex(dest) { 1783 if (isSlide && options.trimSpace === "move" && dest !== currIndex) { 1784 var position = getPosition(); 1785 1786 while (position === toPosition(dest, true) && between(dest, 0, Splide2.length - 1, !options.rewind)) { 1787 dest < currIndex ? --dest : ++dest; 1788 } 1789 } 1790 1791 return dest; 1792 } 1793 1794 function loop(index) { 1795 return isLoop ? (index + slideCount) % slideCount || 0 : index; 1796 } 1797 1798 function getEnd() { 1799 var end = slideCount - (hasFocus() || isLoop && perMove ? 1 : perPage); 1800 1801 while (omitEnd && end-- > 0) { 1802 if (toPosition(slideCount - 1, true) !== toPosition(end, true)) { 1803 end++; 1804 break; 1805 } 1806 } 1807 1808 return clamp(end, 0, slideCount - 1); 1809 } 1810 1811 function toIndex(page) { 1812 return clamp(hasFocus() ? page : perPage * page, 0, endIndex); 1813 } 1814 1815 function toPage(index) { 1816 return hasFocus() ? min(index, endIndex) : floor((index >= endIndex ? slideCount - 1 : index) / perPage); 1817 } 1818 1819 function toDest(destination) { 1820 var closest = Move.toIndex(destination); 1821 return isSlide ? clamp(closest, 0, endIndex) : closest; 1822 } 1823 1824 function setIndex(index) { 1825 if (index !== currIndex) { 1826 prevIndex = currIndex; 1827 currIndex = index; 1828 } 1829 } 1830 1831 function getIndex(prev) { 1832 return prev ? prevIndex : currIndex; 1833 } 1834 1835 function hasFocus() { 1836 return !isUndefined(options.focus) || options.isNavigation; 1837 } 1838 1839 function isBusy() { 1840 return Splide2.state.is([MOVING, SCROLLING]) && !!options.waitForTransition; 1841 } 1842 1843 return { 1844 mount: mount, 1845 go: go, 1846 scroll: scroll, 1847 getNext: getNext, 1848 getPrev: getPrev, 1849 getAdjacent: getAdjacent, 1850 getEnd: getEnd, 1851 setIndex: setIndex, 1852 getIndex: getIndex, 1853 toIndex: toIndex, 1854 toPage: toPage, 1855 toDest: toDest, 1856 hasFocus: hasFocus, 1857 isBusy: isBusy 1858 }; 1859} 1860 1861var XML_NAME_SPACE = "http://www.w3.org/2000/svg"; 1862var PATH = "m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z"; 1863var SIZE = 40; 1864 1865function Arrows(Splide2, Components2, options) { 1866 var event = EventInterface(Splide2); 1867 var on = event.on, 1868 bind = event.bind, 1869 emit = event.emit; 1870 var classes = options.classes, 1871 i18n = options.i18n; 1872 var Elements = Components2.Elements, 1873 Controller = Components2.Controller; 1874 var placeholder = Elements.arrows, 1875 track = Elements.track; 1876 var wrapper = placeholder; 1877 var prev = Elements.prev; 1878 var next = Elements.next; 1879 var created; 1880 var wrapperClasses; 1881 var arrows = {}; 1882 1883 function mount() { 1884 init(); 1885 on(EVENT_UPDATED, remount); 1886 } 1887 1888 function remount() { 1889 destroy(); 1890 mount(); 1891 } 1892 1893 function init() { 1894 var enabled = options.arrows; 1895 1896 if (enabled && !(prev && next)) { 1897 createArrows(); 1898 } 1899 1900 if (prev && next) { 1901 assign(arrows, { 1902 prev: prev, 1903 next: next 1904 }); 1905 display(wrapper, enabled ? "" : "none"); 1906 addClass(wrapper, wrapperClasses = CLASS_ARROWS + "--" + options.direction); 1907 1908 if (enabled) { 1909 listen(); 1910 update(); 1911 setAttribute([prev, next], ARIA_CONTROLS, track.id); 1912 emit(EVENT_ARROWS_MOUNTED, prev, next); 1913 } 1914 } 1915 } 1916 1917 function destroy() { 1918 event.destroy(); 1919 removeClass(wrapper, wrapperClasses); 1920 1921 if (created) { 1922 remove(placeholder ? [prev, next] : wrapper); 1923 prev = next = null; 1924 } else { 1925 removeAttribute([prev, next], ALL_ATTRIBUTES); 1926 } 1927 } 1928 1929 function listen() { 1930 on([EVENT_MOUNTED, EVENT_MOVED, EVENT_REFRESH, EVENT_SCROLLED, EVENT_END_INDEX_CHANGED], update); 1931 bind(next, "click", apply(go, ">")); 1932 bind(prev, "click", apply(go, "<")); 1933 } 1934 1935 function go(control) { 1936 Controller.go(control, true); 1937 } 1938 1939 function createArrows() { 1940 wrapper = placeholder || create("div", classes.arrows); 1941 prev = createArrow(true); 1942 next = createArrow(false); 1943 created = true; 1944 append(wrapper, [prev, next]); 1945 !placeholder && before(wrapper, track); 1946 } 1947 1948 function createArrow(prev2) { 1949 var arrow = "<button class=\"" + classes.arrow + " " + (prev2 ? classes.prev : classes.next) + "\" type=\"button\"><svg xmlns=\"" + XML_NAME_SPACE + "\" viewBox=\"0 0 " + SIZE + " " + SIZE + "\" width=\"" + SIZE + "\" height=\"" + SIZE + "\" focusable=\"false\"><path d=\"" + (options.arrowPath || PATH) + "\" />"; 1950 return parseHtml(arrow); 1951 } 1952 1953 function update() { 1954 if (prev && next) { 1955 var index = Splide2.index; 1956 var prevIndex = Controller.getPrev(); 1957 var nextIndex = Controller.getNext(); 1958 var prevLabel = prevIndex > -1 && index < prevIndex ? i18n.last : i18n.prev; 1959 var nextLabel = nextIndex > -1 && index > nextIndex ? i18n.first : i18n.next; 1960 prev.disabled = prevIndex < 0; 1961 next.disabled = nextIndex < 0; 1962 setAttribute(prev, ARIA_LABEL, prevLabel); 1963 setAttribute(next, ARIA_LABEL, nextLabel); 1964 emit(EVENT_ARROWS_UPDATED, prev, next, prevIndex, nextIndex); 1965 } 1966 } 1967 1968 return { 1969 arrows: arrows, 1970 mount: mount, 1971 destroy: destroy, 1972 update: update 1973 }; 1974} 1975 1976var INTERVAL_DATA_ATTRIBUTE = DATA_ATTRIBUTE + "-interval"; 1977 1978function Autoplay(Splide2, Components2, options) { 1979 var _EventInterface6 = EventInterface(Splide2), 1980 on = _EventInterface6.on, 1981 bind = _EventInterface6.bind, 1982 emit = _EventInterface6.emit; 1983 1984 var interval = RequestInterval(options.interval, Splide2.go.bind(Splide2, ">"), onAnimationFrame); 1985 var isPaused = interval.isPaused; 1986 var Elements = Components2.Elements, 1987 _Components2$Elements4 = Components2.Elements, 1988 root = _Components2$Elements4.root, 1989 toggle = _Components2$Elements4.toggle; 1990 var autoplay = options.autoplay; 1991 var hovered; 1992 var focused; 1993 var stopped = autoplay === "pause"; 1994 1995 function mount() { 1996 if (autoplay) { 1997 listen(); 1998 toggle && setAttribute(toggle, ARIA_CONTROLS, Elements.track.id); 1999 stopped || play(); 2000 update(); 2001 } 2002 } 2003 2004 function listen() { 2005 if (options.pauseOnHover) { 2006 bind(root, "mouseenter mouseleave", function (e) { 2007 hovered = e.type === "mouseenter"; 2008 autoToggle(); 2009 }); 2010 } 2011 2012 if (options.pauseOnFocus) { 2013 bind(root, "focusin focusout", function (e) { 2014 focused = e.type === "focusin"; 2015 autoToggle(); 2016 }); 2017 } 2018 2019 if (toggle) { 2020 bind(toggle, "click", function () { 2021 stopped ? play() : pause(true); 2022 }); 2023 } 2024 2025 on([EVENT_MOVE, EVENT_SCROLL, EVENT_REFRESH], interval.rewind); 2026 on(EVENT_MOVE, onMove); 2027 } 2028 2029 function play() { 2030 if (isPaused() && Components2.Slides.isEnough()) { 2031 interval.start(!options.resetProgress); 2032 focused = hovered = stopped = false; 2033 update(); 2034 emit(EVENT_AUTOPLAY_PLAY); 2035 } 2036 } 2037 2038 function pause(stop) { 2039 if (stop === void 0) { 2040 stop = true; 2041 } 2042 2043 stopped = !!stop; 2044 update(); 2045 2046 if (!isPaused()) { 2047 interval.pause(); 2048 emit(EVENT_AUTOPLAY_PAUSE); 2049 } 2050 } 2051 2052 function autoToggle() { 2053 if (!stopped) { 2054 hovered || focused ? pause(false) : play(); 2055 } 2056 } 2057 2058 function update() { 2059 if (toggle) { 2060 toggleClass(toggle, CLASS_ACTIVE, !stopped); 2061 setAttribute(toggle, ARIA_LABEL, options.i18n[stopped ? "play" : "pause"]); 2062 } 2063 } 2064 2065 function onAnimationFrame(rate) { 2066 var bar = Elements.bar; 2067 bar && style(bar, "width", rate * 100 + "%"); 2068 emit(EVENT_AUTOPLAY_PLAYING, rate); 2069 } 2070 2071 function onMove(index) { 2072 var Slide = Components2.Slides.getAt(index); 2073 interval.set(Slide && +getAttribute(Slide.slide, INTERVAL_DATA_ATTRIBUTE) || options.interval); 2074 } 2075 2076 return { 2077 mount: mount, 2078 destroy: interval.cancel, 2079 play: play, 2080 pause: pause, 2081 isPaused: isPaused 2082 }; 2083} 2084 2085function Cover(Splide2, Components2, options) { 2086 var _EventInterface7 = EventInterface(Splide2), 2087 on = _EventInterface7.on; 2088 2089 function mount() { 2090 if (options.cover) { 2091 on(EVENT_LAZYLOAD_LOADED, apply(toggle, true)); 2092 on([EVENT_MOUNTED, EVENT_UPDATED, EVENT_REFRESH], apply(cover, true)); 2093 } 2094 } 2095 2096 function cover(cover2) { 2097 Components2.Slides.forEach(function (Slide) { 2098 var img = child(Slide.container || Slide.slide, "img"); 2099 2100 if (img && img.src) { 2101 toggle(cover2, img, Slide); 2102 } 2103 }); 2104 } 2105 2106 function toggle(cover2, img, Slide) { 2107 Slide.style("background", cover2 ? "center/cover no-repeat url(\"" + img.src + "\")" : "", true); 2108 display(img, cover2 ? "none" : ""); 2109 } 2110 2111 return { 2112 mount: mount, 2113 destroy: apply(cover, false) 2114 }; 2115} 2116 2117var BOUNCE_DIFF_THRESHOLD = 10; 2118var BOUNCE_DURATION = 600; 2119var FRICTION_FACTOR = 0.6; 2120var BASE_VELOCITY = 1.5; 2121var MIN_DURATION = 800; 2122 2123function Scroll(Splide2, Components2, options) { 2124 var _EventInterface8 = EventInterface(Splide2), 2125 on = _EventInterface8.on, 2126 emit = _EventInterface8.emit; 2127 2128 var set = Splide2.state.set; 2129 var Move = Components2.Move; 2130 var getPosition = Move.getPosition, 2131 getLimit = Move.getLimit, 2132 exceededLimit = Move.exceededLimit, 2133 translate = Move.translate; 2134 var isSlide = Splide2.is(SLIDE); 2135 var interval; 2136 var callback; 2137 var friction = 1; 2138 2139 function mount() { 2140 on(EVENT_MOVE, clear); 2141 on([EVENT_UPDATED, EVENT_REFRESH], cancel); 2142 } 2143 2144 function scroll(destination, duration, snap, onScrolled, noConstrain) { 2145 var from = getPosition(); 2146 clear(); 2147 2148 if (snap && (!isSlide || !exceededLimit())) { 2149 var size = Components2.Layout.sliderSize(); 2150 var offset = sign(destination) * size * floor(abs(destination) / size) || 0; 2151 destination = Move.toPosition(Components2.Controller.toDest(destination % size)) + offset; 2152 } 2153 2154 var noDistance = approximatelyEqual(from, destination, 1); 2155 friction = 1; 2156 duration = noDistance ? 0 : duration || max(abs(destination - from) / BASE_VELOCITY, MIN_DURATION); 2157 callback = onScrolled; 2158 interval = RequestInterval(duration, onEnd, apply(update, from, destination, noConstrain), 1); 2159 set(SCROLLING); 2160 emit(EVENT_SCROLL); 2161 interval.start(); 2162 } 2163 2164 function onEnd() { 2165 set(IDLE); 2166 callback && callback(); 2167 emit(EVENT_SCROLLED); 2168 } 2169 2170 function update(from, to, noConstrain, rate) { 2171 var position = getPosition(); 2172 var target = from + (to - from) * easing(rate); 2173 var diff = (target - position) * friction; 2174 translate(position + diff); 2175 2176 if (isSlide && !noConstrain && exceededLimit()) { 2177 friction *= FRICTION_FACTOR; 2178 2179 if (abs(diff) < BOUNCE_DIFF_THRESHOLD) { 2180 scroll(getLimit(exceededLimit(true)), BOUNCE_DURATION, false, callback, true); 2181 } 2182 } 2183 } 2184 2185 function clear() { 2186 if (interval) { 2187 interval.cancel(); 2188 } 2189 } 2190 2191 function cancel() { 2192 if (interval && !interval.isPaused()) { 2193 clear(); 2194 onEnd(); 2195 } 2196 } 2197 2198 function easing(t) { 2199 var easingFunc = options.easingFunc; 2200 return easingFunc ? easingFunc(t) : 1 - Math.pow(1 - t, 4); 2201 } 2202 2203 return { 2204 mount: mount, 2205 destroy: clear, 2206 scroll: scroll, 2207 cancel: cancel 2208 }; 2209} 2210 2211var SCROLL_LISTENER_OPTIONS = { 2212 passive: false, 2213 capture: true 2214}; 2215 2216function Drag(Splide2, Components2, options) { 2217 var _EventInterface9 = EventInterface(Splide2), 2218 on = _EventInterface9.on, 2219 emit = _EventInterface9.emit, 2220 bind = _EventInterface9.bind, 2221 unbind = _EventInterface9.unbind; 2222 2223 var state = Splide2.state; 2224 var Move = Components2.Move, 2225 Scroll = Components2.Scroll, 2226 Controller = Components2.Controller, 2227 track = Components2.Elements.track, 2228 reduce = Components2.Media.reduce; 2229 var _Components2$Directio2 = Components2.Direction, 2230 resolve = _Components2$Directio2.resolve, 2231 orient = _Components2$Directio2.orient; 2232 var getPosition = Move.getPosition, 2233 exceededLimit = Move.exceededLimit; 2234 var basePosition; 2235 var baseEvent; 2236 var prevBaseEvent; 2237 var isFree; 2238 var dragging; 2239 var exceeded = false; 2240 var clickPrevented; 2241 var disabled; 2242 var target; 2243 2244 function mount() { 2245 bind(track, POINTER_MOVE_EVENTS, noop, SCROLL_LISTENER_OPTIONS); 2246 bind(track, POINTER_UP_EVENTS, noop, SCROLL_LISTENER_OPTIONS); 2247 bind(track, POINTER_DOWN_EVENTS, onPointerDown, SCROLL_LISTENER_OPTIONS); 2248 bind(track, "click", onClick, { 2249 capture: true 2250 }); 2251 bind(track, "dragstart", prevent); 2252 on([EVENT_MOUNTED, EVENT_UPDATED], init); 2253 } 2254 2255 function init() { 2256 var drag = options.drag; 2257 disable(!drag); 2258 isFree = drag === "free"; 2259 } 2260 2261 function onPointerDown(e) { 2262 clickPrevented = false; 2263 2264 if (!disabled) { 2265 var isTouch = isTouchEvent(e); 2266 2267 if (isDraggable(e.target) && (isTouch || !e.button)) { 2268 if (!Controller.isBusy()) { 2269 target = isTouch ? track : window; 2270 dragging = state.is([MOVING, SCROLLING]); 2271 prevBaseEvent = null; 2272 bind(target, POINTER_MOVE_EVENTS, onPointerMove, SCROLL_LISTENER_OPTIONS); 2273 bind(target, POINTER_UP_EVENTS, onPointerUp, SCROLL_LISTENER_OPTIONS); 2274 Move.cancel(); 2275 Scroll.cancel(); 2276 save(e); 2277 } else { 2278 prevent(e, true); 2279 } 2280 } 2281 } 2282 } 2283 2284 function onPointerMove(e) { 2285 if (!state.is(DRAGGING)) { 2286 state.set(DRAGGING); 2287 emit(EVENT_DRAG); 2288 } 2289 2290 if (e.cancelable) { 2291 if (dragging) { 2292 Move.translate(basePosition + constrain(diffCoord(e))); 2293 var expired = diffTime(e) > LOG_INTERVAL; 2294 var hasExceeded = exceeded !== (exceeded = exceededLimit()); 2295 2296 if (expired || hasExceeded) { 2297 save(e); 2298 } 2299 2300 clickPrevented = true; 2301 emit(EVENT_DRAGGING); 2302 prevent(e); 2303 } else if (isSliderDirection(e)) { 2304 dragging = shouldStart(e); 2305 prevent(e); 2306 } 2307 } 2308 } 2309 2310 function onPointerUp(e) { 2311 if (state.is(DRAGGING)) { 2312 state.set(IDLE); 2313 emit(EVENT_DRAGGED); 2314 } 2315 2316 if (dragging) { 2317 move(e); 2318 prevent(e); 2319 } 2320 2321 unbind(target, POINTER_MOVE_EVENTS, onPointerMove); 2322 unbind(target, POINTER_UP_EVENTS, onPointerUp); 2323 dragging = false; 2324 } 2325 2326 function onClick(e) { 2327 if (!disabled && clickPrevented) { 2328 prevent(e, true); 2329 } 2330 } 2331 2332 function save(e) { 2333 prevBaseEvent = baseEvent; 2334 baseEvent = e; 2335 basePosition = getPosition(); 2336 } 2337 2338 function move(e) { 2339 var velocity = computeVelocity(e); 2340 var destination = computeDestination(velocity); 2341 var rewind = options.rewind && options.rewindByDrag; 2342 reduce(false); 2343 2344 if (isFree) { 2345 Controller.scroll(destination, 0, options.snap); 2346 } else if (Splide2.is(FADE)) { 2347 Controller.go(orient(sign(velocity)) < 0 ? rewind ? "<" : "-" : rewind ? ">" : "+"); 2348 } else if (Splide2.is(SLIDE) && exceeded && rewind) { 2349 Controller.go(exceededLimit(true) ? ">" : "<"); 2350 } else { 2351 Controller.go(Controller.toDest(destination), true); 2352 } 2353 2354 reduce(true); 2355 } 2356 2357 function shouldStart(e) { 2358 var thresholds = options.dragMinThreshold; 2359 var isObj = isObject(thresholds); 2360 var mouse = isObj && thresholds.mouse || 0; 2361 var touch = (isObj ? thresholds.touch : +thresholds) || 10; 2362 return abs(diffCoord(e)) > (isTouchEvent(e) ? touch : mouse); 2363 } 2364 2365 function isSliderDirection(e) { 2366 return abs(diffCoord(e)) > abs(diffCoord(e, true)); 2367 } 2368 2369 function computeVelocity(e) { 2370 if (Splide2.is(LOOP) || !exceeded) { 2371 var time = diffTime(e); 2372 2373 if (time && time < LOG_INTERVAL) { 2374 return diffCoord(e) / time; 2375 } 2376 } 2377 2378 return 0; 2379 } 2380 2381 function computeDestination(velocity) { 2382 return getPosition() + sign(velocity) * min(abs(velocity) * (options.flickPower || 600), isFree ? Infinity : Components2.Layout.listSize() * (options.flickMaxPages || 1)); 2383 } 2384 2385 function diffCoord(e, orthogonal) { 2386 return coordOf(e, orthogonal) - coordOf(getBaseEvent(e), orthogonal); 2387 } 2388 2389 function diffTime(e) { 2390 return timeOf(e) - timeOf(getBaseEvent(e)); 2391 } 2392 2393 function getBaseEvent(e) { 2394 return baseEvent === e && prevBaseEvent || baseEvent; 2395 } 2396 2397 function coordOf(e, orthogonal) { 2398 return (isTouchEvent(e) ? e.changedTouches[0] : e)["page" + resolve(orthogonal ? "Y" : "X")]; 2399 } 2400 2401 function constrain(diff) { 2402 return diff / (exceeded && Splide2.is(SLIDE) ? FRICTION : 1); 2403 } 2404 2405 function isDraggable(target2) { 2406 var noDrag = options.noDrag; 2407 return !matches(target2, "." + CLASS_PAGINATION_PAGE + ", ." + CLASS_ARROW) && (!noDrag || !matches(target2, noDrag)); 2408 } 2409 2410 function isTouchEvent(e) { 2411 return typeof TouchEvent !== "undefined" && e instanceof TouchEvent; 2412 } 2413 2414 function isDragging() { 2415 return dragging; 2416 } 2417 2418 function disable(value) { 2419 disabled = value; 2420 } 2421 2422 return { 2423 mount: mount, 2424 disable: disable, 2425 isDragging: isDragging 2426 }; 2427} 2428 2429var NORMALIZATION_MAP = { 2430 Spacebar: " ", 2431 Right: ARROW_RIGHT, 2432 Left: ARROW_LEFT, 2433 Up: ARROW_UP, 2434 Down: ARROW_DOWN 2435}; 2436 2437function normalizeKey(key) { 2438 key = isString(key) ? key : key.key; 2439 return NORMALIZATION_MAP[key] || key; 2440} 2441 2442var KEYBOARD_EVENT = "keydown"; 2443 2444function Keyboard(Splide2, Components2, options) { 2445 var _EventInterface10 = EventInterface(Splide2), 2446 on = _EventInterface10.on, 2447 bind = _EventInterface10.bind, 2448 unbind = _EventInterface10.unbind; 2449 2450 var root = Splide2.root; 2451 var resolve = Components2.Direction.resolve; 2452 var target; 2453 var disabled; 2454 2455 function mount() { 2456 init(); 2457 on(EVENT_UPDATED, destroy); 2458 on(EVENT_UPDATED, init); 2459 on(EVENT_MOVE, onMove); 2460 } 2461 2462 function init() { 2463 var keyboard = options.keyboard; 2464 2465 if (keyboard) { 2466 target = keyboard === "global" ? window : root; 2467 bind(target, KEYBOARD_EVENT, onKeydown); 2468 } 2469 } 2470 2471 function destroy() { 2472 unbind(target, KEYBOARD_EVENT); 2473 } 2474 2475 function disable(value) { 2476 disabled = value; 2477 } 2478 2479 function onMove() { 2480 var _disabled = disabled; 2481 disabled = true; 2482 nextTick(function () { 2483 disabled = _disabled; 2484 }); 2485 } 2486 2487 function onKeydown(e) { 2488 if (!disabled) { 2489 var key = normalizeKey(e); 2490 2491 if (key === resolve(ARROW_LEFT)) { 2492 Splide2.go("<"); 2493 } else if (key === resolve(ARROW_RIGHT)) { 2494 Splide2.go(">"); 2495 } 2496 } 2497 } 2498 2499 return { 2500 mount: mount, 2501 destroy: destroy, 2502 disable: disable 2503 }; 2504} 2505 2506var SRC_DATA_ATTRIBUTE = DATA_ATTRIBUTE + "-lazy"; 2507var SRCSET_DATA_ATTRIBUTE = SRC_DATA_ATTRIBUTE + "-srcset"; 2508var IMAGE_SELECTOR = "[" + SRC_DATA_ATTRIBUTE + "], [" + SRCSET_DATA_ATTRIBUTE + "]"; 2509 2510function LazyLoad(Splide2, Components2, options) { 2511 var _EventInterface11 = EventInterface(Splide2), 2512 on = _EventInterface11.on, 2513 off = _EventInterface11.off, 2514 bind = _EventInterface11.bind, 2515 emit = _EventInterface11.emit; 2516 2517 var isSequential = options.lazyLoad === "sequential"; 2518 var events = [EVENT_MOVED, EVENT_SCROLLED]; 2519 var entries = []; 2520 2521 function mount() { 2522 if (options.lazyLoad) { 2523 init(); 2524 on(EVENT_REFRESH, init); 2525 } 2526 } 2527 2528 function init() { 2529 empty(entries); 2530 register(); 2531 2532 if (isSequential) { 2533 loadNext(); 2534 } else { 2535 off(events); 2536 on(events, check); 2537 check(); 2538 } 2539 } 2540 2541 function register() { 2542 Components2.Slides.forEach(function (Slide) { 2543 queryAll(Slide.slide, IMAGE_SELECTOR).forEach(function (img) { 2544 var src = getAttribute(img, SRC_DATA_ATTRIBUTE); 2545 var srcset = getAttribute(img, SRCSET_DATA_ATTRIBUTE); 2546 2547 if (src !== img.src || srcset !== img.srcset) { 2548 var className = options.classes.spinner; 2549 var parent = img.parentElement; 2550 var spinner = child(parent, "." + className) || create("span", className, parent); 2551 entries.push([img, Slide, spinner]); 2552 img.src || display(img, "none"); 2553 } 2554 }); 2555 }); 2556 } 2557 2558 function check() { 2559 entries = entries.filter(function (data) { 2560 var distance = options.perPage * ((options.preloadPages || 1) + 1) - 1; 2561 return data[1].isWithin(Splide2.index, distance) ? load(data) : true; 2562 }); 2563 entries.length || off(events); 2564 } 2565 2566 function load(data) { 2567 var img = data[0]; 2568 addClass(data[1].slide, CLASS_LOADING); 2569 bind(img, "load error", apply(onLoad, data)); 2570 setAttribute(img, "src", getAttribute(img, SRC_DATA_ATTRIBUTE)); 2571 setAttribute(img, "srcset", getAttribute(img, SRCSET_DATA_ATTRIBUTE)); 2572 removeAttribute(img, SRC_DATA_ATTRIBUTE); 2573 removeAttribute(img, SRCSET_DATA_ATTRIBUTE); 2574 } 2575 2576 function onLoad(data, e) { 2577 var img = data[0], 2578 Slide = data[1]; 2579 removeClass(Slide.slide, CLASS_LOADING); 2580 2581 if (e.type !== "error") { 2582 remove(data[2]); 2583 display(img, ""); 2584 emit(EVENT_LAZYLOAD_LOADED, img, Slide); 2585 emit(EVENT_RESIZE); 2586 } 2587 2588 isSequential && loadNext(); 2589 } 2590 2591 function loadNext() { 2592 entries.length && load(entries.shift()); 2593 } 2594 2595 return { 2596 mount: mount, 2597 destroy: apply(empty, entries), 2598 check: check 2599 }; 2600} 2601 2602function Pagination(Splide2, Components2, options) { 2603 var event = EventInterface(Splide2); 2604 var on = event.on, 2605 emit = event.emit, 2606 bind = event.bind; 2607 var Slides = Components2.Slides, 2608 Elements = Components2.Elements, 2609 Controller = Components2.Controller; 2610 var hasFocus = Controller.hasFocus, 2611 getIndex = Controller.getIndex, 2612 go = Controller.go; 2613 var resolve = Components2.Direction.resolve; 2614 var placeholder = Elements.pagination; 2615 var items = []; 2616 var list; 2617 var paginationClasses; 2618 2619 function mount() { 2620 destroy(); 2621 on([EVENT_UPDATED, EVENT_REFRESH, EVENT_END_INDEX_CHANGED], mount); 2622 var enabled = options.pagination; 2623 placeholder && display(placeholder, enabled ? "" : "none"); 2624 2625 if (enabled) { 2626 on([EVENT_MOVE, EVENT_SCROLL, EVENT_SCROLLED], update); 2627 createPagination(); 2628 update(); 2629 emit(EVENT_PAGINATION_MOUNTED, { 2630 list: list, 2631 items: items 2632 }, getAt(Splide2.index)); 2633 } 2634 } 2635 2636 function destroy() { 2637 if (list) { 2638 remove(placeholder ? slice(list.children) : list); 2639 removeClass(list, paginationClasses); 2640 empty(items); 2641 list = null; 2642 } 2643 2644 event.destroy(); 2645 } 2646 2647 function createPagination() { 2648 var length = Splide2.length; 2649 var classes = options.classes, 2650 i18n = options.i18n, 2651 perPage = options.perPage; 2652 var max = hasFocus() ? Controller.getEnd() + 1 : ceil(length / perPage); 2653 list = placeholder || create("ul", classes.pagination, Elements.track.parentElement); 2654 addClass(list, paginationClasses = CLASS_PAGINATION + "--" + getDirection()); 2655 setAttribute(list, ROLE, "tablist"); 2656 setAttribute(list, ARIA_LABEL, i18n.select); 2657 setAttribute(list, ARIA_ORIENTATION, getDirection() === TTB ? "vertical" : ""); 2658 2659 for (var i = 0; i < max; i++) { 2660 var li = create("li", null, list); 2661 var button = create("button", { 2662 class: classes.page, 2663 type: "button" 2664 }, li); 2665 var controls = Slides.getIn(i).map(function (Slide) { 2666 return Slide.slide.id; 2667 }); 2668 var text = !hasFocus() && perPage > 1 ? i18n.pageX : i18n.slideX; 2669 bind(button, "click", apply(onClick, i)); 2670 2671 if (options.paginationKeyboard) { 2672 bind(button, "keydown", apply(onKeydown, i)); 2673 } 2674 2675 setAttribute(li, ROLE, "presentation"); 2676 setAttribute(button, ROLE, "tab"); 2677 setAttribute(button, ARIA_CONTROLS, controls.join(" ")); 2678 setAttribute(button, ARIA_LABEL, format(text, i + 1)); 2679 setAttribute(button, TAB_INDEX, -1); 2680 items.push({ 2681 li: li, 2682 button: button, 2683 page: i 2684 }); 2685 } 2686 } 2687 2688 function onClick(page) { 2689 go(">" + page, true); 2690 } 2691 2692 function onKeydown(page, e) { 2693 var length = items.length; 2694 var key = normalizeKey(e); 2695 var dir = getDirection(); 2696 var nextPage = -1; 2697 2698 if (key === resolve(ARROW_RIGHT, false, dir)) { 2699 nextPage = ++page % length; 2700 } else if (key === resolve(ARROW_LEFT, false, dir)) { 2701 nextPage = (--page + length) % length; 2702 } else if (key === "Home") { 2703 nextPage = 0; 2704 } else if (key === "End") { 2705 nextPage = length - 1; 2706 } 2707 2708 var item = items[nextPage]; 2709 2710 if (item) { 2711 focus(item.button); 2712 go(">" + nextPage); 2713 prevent(e, true); 2714 } 2715 } 2716 2717 function getDirection() { 2718 return options.paginationDirection || options.direction; 2719 } 2720 2721 function getAt(index) { 2722 return items[Controller.toPage(index)]; 2723 } 2724 2725 function update() { 2726 var prev = getAt(getIndex(true)); 2727 var curr = getAt(getIndex()); 2728 2729 if (prev) { 2730 var button = prev.button; 2731 removeClass(button, CLASS_ACTIVE); 2732 removeAttribute(button, ARIA_SELECTED); 2733 setAttribute(button, TAB_INDEX, -1); 2734 } 2735 2736 if (curr) { 2737 var _button = curr.button; 2738 addClass(_button, CLASS_ACTIVE); 2739 setAttribute(_button, ARIA_SELECTED, true); 2740 setAttribute(_button, TAB_INDEX, ""); 2741 } 2742 2743 emit(EVENT_PAGINATION_UPDATED, { 2744 list: list, 2745 items: items 2746 }, prev, curr); 2747 } 2748 2749 return { 2750 items: items, 2751 mount: mount, 2752 destroy: destroy, 2753 getAt: getAt, 2754 update: update 2755 }; 2756} 2757 2758var TRIGGER_KEYS = [" ", "Enter"]; 2759 2760function Sync(Splide2, Components2, options) { 2761 var isNavigation = options.isNavigation, 2762 slideFocus = options.slideFocus; 2763 var events = []; 2764 2765 function mount() { 2766 Splide2.splides.forEach(function (target) { 2767 if (!target.isParent) { 2768 sync(Splide2, target.splide); 2769 sync(target.splide, Splide2); 2770 } 2771 }); 2772 2773 if (isNavigation) { 2774 navigate(); 2775 } 2776 } 2777 2778 function destroy() { 2779 events.forEach(function (event) { 2780 event.destroy(); 2781 }); 2782 empty(events); 2783 } 2784 2785 function remount() { 2786 destroy(); 2787 mount(); 2788 } 2789 2790 function sync(splide, target) { 2791 var event = EventInterface(splide); 2792 event.on(EVENT_MOVE, function (index, prev, dest) { 2793 target.go(target.is(LOOP) ? dest : index); 2794 }); 2795 events.push(event); 2796 } 2797 2798 function navigate() { 2799 var event = EventInterface(Splide2); 2800 var on = event.on; 2801 on(EVENT_CLICK, onClick); 2802 on(EVENT_SLIDE_KEYDOWN, onKeydown); 2803 on([EVENT_MOUNTED, EVENT_UPDATED], update); 2804 events.push(event); 2805 event.emit(EVENT_NAVIGATION_MOUNTED, Splide2.splides); 2806 } 2807 2808 function update() { 2809 setAttribute(Components2.Elements.list, ARIA_ORIENTATION, options.direction === TTB ? "vertical" : ""); 2810 } 2811 2812 function onClick(Slide) { 2813 Splide2.go(Slide.index); 2814 } 2815 2816 function onKeydown(Slide, e) { 2817 if (includes(TRIGGER_KEYS, normalizeKey(e))) { 2818 onClick(Slide); 2819 prevent(e); 2820 } 2821 } 2822 2823 return { 2824 setup: apply(Components2.Media.set, { 2825 slideFocus: isUndefined(slideFocus) ? isNavigation : slideFocus 2826 }, true), 2827 mount: mount, 2828 destroy: destroy, 2829 remount: remount 2830 }; 2831} 2832 2833function Wheel(Splide2, Components2, options) { 2834 var _EventInterface12 = EventInterface(Splide2), 2835 bind = _EventInterface12.bind; 2836 2837 var lastTime = 0; 2838 2839 function mount() { 2840 if (options.wheel) { 2841 bind(Components2.Elements.track, "wheel", onWheel, SCROLL_LISTENER_OPTIONS); 2842 } 2843 } 2844 2845 function onWheel(e) { 2846 if (e.cancelable) { 2847 var deltaY = e.deltaY; 2848 var backwards = deltaY < 0; 2849 var timeStamp = timeOf(e); 2850 2851 var _min = options.wheelMinThreshold || 0; 2852 2853 var sleep = options.wheelSleep || 0; 2854 2855 if (abs(deltaY) > _min && timeStamp - lastTime > sleep) { 2856 Splide2.go(backwards ? "<" : ">"); 2857 lastTime = timeStamp; 2858 } 2859 2860 shouldPrevent(backwards) && prevent(e); 2861 } 2862 } 2863 2864 function shouldPrevent(backwards) { 2865 return !options.releaseWheel || Splide2.state.is(MOVING) || Components2.Controller.getAdjacent(backwards) !== -1; 2866 } 2867 2868 return { 2869 mount: mount 2870 }; 2871} 2872 2873var SR_REMOVAL_DELAY = 90; 2874 2875function Live(Splide2, Components2, options) { 2876 var _EventInterface13 = EventInterface(Splide2), 2877 on = _EventInterface13.on; 2878 2879 var track = Components2.Elements.track; 2880 var enabled = options.live && !options.isNavigation; 2881 var sr = create("span", CLASS_SR); 2882 var interval = RequestInterval(SR_REMOVAL_DELAY, apply(toggle, false)); 2883 2884 function mount() { 2885 if (enabled) { 2886 disable(!Components2.Autoplay.isPaused()); 2887 setAttribute(track, ARIA_ATOMIC, true); 2888 sr.textContent = "\u2026"; 2889 on(EVENT_AUTOPLAY_PLAY, apply(disable, true)); 2890 on(EVENT_AUTOPLAY_PAUSE, apply(disable, false)); 2891 on([EVENT_MOVED, EVENT_SCROLLED], apply(toggle, true)); 2892 } 2893 } 2894 2895 function toggle(active) { 2896 setAttribute(track, ARIA_BUSY, active); 2897 2898 if (active) { 2899 append(track, sr); 2900 interval.start(); 2901 } else { 2902 remove(sr); 2903 interval.cancel(); 2904 } 2905 } 2906 2907 function destroy() { 2908 removeAttribute(track, [ARIA_LIVE, ARIA_ATOMIC, ARIA_BUSY]); 2909 remove(sr); 2910 } 2911 2912 function disable(disabled) { 2913 if (enabled) { 2914 setAttribute(track, ARIA_LIVE, disabled ? "off" : "polite"); 2915 } 2916 } 2917 2918 return { 2919 mount: mount, 2920 disable: disable, 2921 destroy: destroy 2922 }; 2923} 2924 2925var ComponentConstructors = /*#__PURE__*/Object.freeze({ 2926 __proto__: null, 2927 Media: Media, 2928 Direction: Direction, 2929 Elements: Elements, 2930 Slides: Slides, 2931 Layout: Layout, 2932 Clones: Clones, 2933 Move: Move, 2934 Controller: Controller, 2935 Arrows: Arrows, 2936 Autoplay: Autoplay, 2937 Cover: Cover, 2938 Scroll: Scroll, 2939 Drag: Drag, 2940 Keyboard: Keyboard, 2941 LazyLoad: LazyLoad, 2942 Pagination: Pagination, 2943 Sync: Sync, 2944 Wheel: Wheel, 2945 Live: Live 2946}); 2947var I18N = { 2948 prev: "Previous slide", 2949 next: "Next slide", 2950 first: "Go to first slide", 2951 last: "Go to last slide", 2952 slideX: "Go to slide %s", 2953 pageX: "Go to page %s", 2954 play: "Start autoplay", 2955 pause: "Pause autoplay", 2956 carousel: "carousel", 2957 slide: "slide", 2958 select: "Select a slide to show", 2959 slideLabel: "%s of %s" 2960}; 2961var DEFAULTS = { 2962 type: "slide", 2963 role: "region", 2964 speed: 400, 2965 perPage: 1, 2966 cloneStatus: true, 2967 arrows: true, 2968 pagination: true, 2969 paginationKeyboard: true, 2970 interval: 5e3, 2971 pauseOnHover: true, 2972 pauseOnFocus: true, 2973 resetProgress: true, 2974 easing: "cubic-bezier(0.25, 1, 0.5, 1)", 2975 drag: true, 2976 direction: "ltr", 2977 trimSpace: true, 2978 focusableNodes: "a, button, textarea, input, select, iframe", 2979 live: true, 2980 classes: CLASSES, 2981 i18n: I18N, 2982 reducedMotion: { 2983 speed: 0, 2984 rewindSpeed: 0, 2985 autoplay: "pause" 2986 } 2987}; 2988 2989function Fade(Splide2, Components2, options) { 2990 var Slides = Components2.Slides; 2991 2992 function mount() { 2993 EventInterface(Splide2).on([EVENT_MOUNTED, EVENT_REFRESH], init); 2994 } 2995 2996 function init() { 2997 Slides.forEach(function (Slide) { 2998 Slide.style("transform", "translateX(-" + 100 * Slide.index + "%)"); 2999 }); 3000 } 3001 3002 function start(index, done) { 3003 Slides.style("transition", "opacity " + options.speed + "ms " + options.easing); 3004 nextTick(done); 3005 } 3006 3007 return { 3008 mount: mount, 3009 start: start, 3010 cancel: noop 3011 }; 3012} 3013 3014function Slide(Splide2, Components2, options) { 3015 var Move = Components2.Move, 3016 Controller = Components2.Controller, 3017 Scroll = Components2.Scroll; 3018 var list = Components2.Elements.list; 3019 var transition = apply(style, list, "transition"); 3020 var endCallback; 3021 3022 function mount() { 3023 EventInterface(Splide2).bind(list, "transitionend", function (e) { 3024 if (e.target === list && endCallback) { 3025 cancel(); 3026 endCallback(); 3027 } 3028 }); 3029 } 3030 3031 function start(index, done) { 3032 var destination = Move.toPosition(index, true); 3033 var position = Move.getPosition(); 3034 var speed = getSpeed(index); 3035 3036 if (abs(destination - position) >= 1 && speed >= 1) { 3037 if (options.useScroll) { 3038 Scroll.scroll(destination, speed, false, done); 3039 } else { 3040 transition("transform " + speed + "ms " + options.easing); 3041 Move.translate(destination, true); 3042 endCallback = done; 3043 } 3044 } else { 3045 Move.jump(index); 3046 done(); 3047 } 3048 } 3049 3050 function cancel() { 3051 transition(""); 3052 Scroll.cancel(); 3053 } 3054 3055 function getSpeed(index) { 3056 var rewindSpeed = options.rewindSpeed; 3057 3058 if (Splide2.is(SLIDE) && rewindSpeed) { 3059 var prev = Controller.getIndex(true); 3060 var end = Controller.getEnd(); 3061 3062 if (prev === 0 && index >= end || prev >= end && index === 0) { 3063 return rewindSpeed; 3064 } 3065 } 3066 3067 return options.speed; 3068 } 3069 3070 return { 3071 mount: mount, 3072 start: start, 3073 cancel: cancel 3074 }; 3075} 3076 3077var _Splide = /*#__PURE__*/function () { 3078 function _Splide(target, options) { 3079 this.event = EventInterface(); 3080 this.Components = {}; 3081 this.state = State(CREATED); 3082 this.splides = []; 3083 this._o = {}; 3084 this._E = {}; 3085 var root = isString(target) ? query(document, target) : target; 3086 assert(root, root + " is invalid."); 3087 this.root = root; 3088 options = merge({ 3089 label: getAttribute(root, ARIA_LABEL) || "", 3090 labelledby: getAttribute(root, ARIA_LABELLEDBY) || "" 3091 }, DEFAULTS, _Splide.defaults, options || {}); 3092 3093 try { 3094 merge(options, JSON.parse(getAttribute(root, DATA_ATTRIBUTE))); 3095 } catch (e) { 3096 assert(false, "Invalid JSON"); 3097 } 3098 3099 this._o = Object.create(merge({}, options)); 3100 } 3101 3102 var _proto = _Splide.prototype; 3103 3104 _proto.mount = function mount(Extensions, Transition) { 3105 var _this = this; 3106 3107 var state = this.state, 3108 Components2 = this.Components; 3109 assert(state.is([CREATED, DESTROYED]), "Already mounted!"); 3110 state.set(CREATED); 3111 this._C = Components2; 3112 this._T = Transition || this._T || (this.is(FADE) ? Fade : Slide); 3113 this._E = Extensions || this._E; 3114 var Constructors = assign({}, ComponentConstructors, this._E, { 3115 Transition: this._T 3116 }); 3117 forOwn(Constructors, function (Component, key) { 3118 var component = Component(_this, Components2, _this._o); 3119 Components2[key] = component; 3120 component.setup && component.setup(); 3121 }); 3122 forOwn(Components2, function (component) { 3123 component.mount && component.mount(); 3124 }); 3125 this.emit(EVENT_MOUNTED); 3126 addClass(this.root, CLASS_INITIALIZED); 3127 state.set(IDLE); 3128 this.emit(EVENT_READY); 3129 return this; 3130 }; 3131 3132 _proto.sync = function sync(splide) { 3133 this.splides.push({ 3134 splide: splide 3135 }); 3136 splide.splides.push({ 3137 splide: this, 3138 isParent: true 3139 }); 3140 3141 if (this.state.is(IDLE)) { 3142 this._C.Sync.remount(); 3143 3144 splide.Components.Sync.remount(); 3145 } 3146 3147 return this; 3148 }; 3149 3150 _proto.go = function go(control) { 3151 this._C.Controller.go(control); 3152 3153 return this; 3154 }; 3155 3156 _proto.on = function on(events, callback) { 3157 this.event.on(events, callback); 3158 return this; 3159 }; 3160 3161 _proto.off = function off(events) { 3162 this.event.off(events); 3163 return this; 3164 }; 3165 3166 _proto.emit = function emit(event) { 3167 var _this$event; 3168 3169 (_this$event = this.event).emit.apply(_this$event, [event].concat(slice(arguments, 1))); 3170 3171 return this; 3172 }; 3173 3174 _proto.add = function add(slides, index) { 3175 this._C.Slides.add(slides, index); 3176 3177 return this; 3178 }; 3179 3180 _proto.remove = function remove(matcher) { 3181 this._C.Slides.remove(matcher); 3182 3183 return this; 3184 }; 3185 3186 _proto.is = function is(type) { 3187 return this._o.type === type; 3188 }; 3189 3190 _proto.refresh = function refresh() { 3191 this.emit(EVENT_REFRESH); 3192 return this; 3193 }; 3194 3195 _proto.destroy = function destroy(completely) { 3196 if (completely === void 0) { 3197 completely = true; 3198 } 3199 3200 var event = this.event, 3201 state = this.state; 3202 3203 if (state.is(CREATED)) { 3204 EventInterface(this).on(EVENT_READY, this.destroy.bind(this, completely)); 3205 } else { 3206 forOwn(this._C, function (component) { 3207 component.destroy && component.destroy(completely); 3208 }, true); 3209 event.emit(EVENT_DESTROY); 3210 event.destroy(); 3211 completely && empty(this.splides); 3212 state.set(DESTROYED); 3213 } 3214 3215 return this; 3216 }; 3217 3218 _createClass(_Splide, [{ 3219 key: "options", 3220 get: function get() { 3221 return this._o; 3222 }, 3223 set: function set(options) { 3224 this._C.Media.set(options, true, true); 3225 } 3226 }, { 3227 key: "length", 3228 get: function get() { 3229 return this._C.Slides.getLength(true); 3230 } 3231 }, { 3232 key: "index", 3233 get: function get() { 3234 return this._C.Controller.getIndex(); 3235 } 3236 }]); 3237 3238 return _Splide; 3239}(); 3240 3241var Splide = _Splide; 3242Splide.defaults = {}; 3243Splide.STATES = STATES; 3244var CLASS_RENDERED = "is-rendered"; 3245var RENDERER_DEFAULT_CONFIG = { 3246 listTag: "ul", 3247 slideTag: "li" 3248}; 3249 3250var Style = /*#__PURE__*/function () { 3251 function Style(id, options) { 3252 this.styles = {}; 3253 this.id = id; 3254 this.options = options; 3255 } 3256 3257 var _proto2 = Style.prototype; 3258 3259 _proto2.rule = function rule(selector, prop, value, breakpoint) { 3260 breakpoint = breakpoint || "default"; 3261 var selectors = this.styles[breakpoint] = this.styles[breakpoint] || {}; 3262 var styles = selectors[selector] = selectors[selector] || {}; 3263 styles[prop] = value; 3264 }; 3265 3266 _proto2.build = function build() { 3267 var _this2 = this; 3268 3269 var css = ""; 3270 3271 if (this.styles.default) { 3272 css += this.buildSelectors(this.styles.default); 3273 } 3274 3275 Object.keys(this.styles).sort(function (n, m) { 3276 return _this2.options.mediaQuery === "min" ? +n - +m : +m - +n; 3277 }).forEach(function (breakpoint) { 3278 if (breakpoint !== "default") { 3279 css += "@media screen and (max-width: " + breakpoint + "px) {"; 3280 css += _this2.buildSelectors(_this2.styles[breakpoint]); 3281 css += "}"; 3282 } 3283 }); 3284 return css; 3285 }; 3286 3287 _proto2.buildSelectors = function buildSelectors(selectors) { 3288 var _this3 = this; 3289 3290 var css = ""; 3291 forOwn(selectors, function (styles, selector) { 3292 selector = ("#" + _this3.id + " " + selector).trim(); 3293 css += selector + " {"; 3294 forOwn(styles, function (value, prop) { 3295 if (value || value === 0) { 3296 css += prop + ": " + value + ";"; 3297 } 3298 }); 3299 css += "}"; 3300 }); 3301 return css; 3302 }; 3303 3304 return Style; 3305}(); 3306 3307var SplideRenderer = /*#__PURE__*/function () { 3308 function SplideRenderer(contents, options, config, defaults) { 3309 this.slides = []; 3310 this.options = {}; 3311 this.breakpoints = []; 3312 merge(DEFAULTS, defaults || {}); 3313 merge(merge(this.options, DEFAULTS), options || {}); 3314 this.contents = contents; 3315 this.config = assign({}, RENDERER_DEFAULT_CONFIG, config || {}); 3316 this.id = this.config.id || uniqueId("splide"); 3317 this.Style = new Style(this.id, this.options); 3318 this.Direction = Direction(null, null, this.options); 3319 assert(this.contents.length, "Provide at least 1 content."); 3320 this.init(); 3321 } 3322 3323 SplideRenderer.clean = function clean(splide) { 3324 var _EventInterface14 = EventInterface(splide), 3325 on = _EventInterface14.on; 3326 3327 var root = splide.root; 3328 var clones = queryAll(root, "." + CLASS_CLONE); 3329 on(EVENT_MOUNTED, function () { 3330 remove(child(root, "style")); 3331 }); 3332 remove(clones); 3333 }; 3334 3335 var _proto3 = SplideRenderer.prototype; 3336 3337 _proto3.init = function init() { 3338 this.parseBreakpoints(); 3339 this.initSlides(); 3340 this.registerRootStyles(); 3341 this.registerTrackStyles(); 3342 this.registerSlideStyles(); 3343 this.registerListStyles(); 3344 }; 3345 3346 _proto3.initSlides = function initSlides() { 3347 var _this4 = this; 3348 3349 push(this.slides, this.contents.map(function (content, index) { 3350 content = isString(content) ? { 3351 html: content 3352 } : content; 3353 content.styles = content.styles || {}; 3354 content.attrs = content.attrs || {}; 3355 3356 _this4.cover(content); 3357 3358 var classes = _this4.options.classes.slide + " " + (index === 0 ? CLASS_ACTIVE : ""); 3359 assign(content.attrs, { 3360 class: (classes + " " + (content.attrs.class || "")).trim(), 3361 style: _this4.buildStyles(content.styles) 3362 }); 3363 return content; 3364 })); 3365 3366 if (this.isLoop()) { 3367 this.generateClones(this.slides); 3368 } 3369 }; 3370 3371 _proto3.registerRootStyles = function registerRootStyles() { 3372 var _this5 = this; 3373 3374 this.breakpoints.forEach(function (_ref2) { 3375 var width = _ref2[0], 3376 options = _ref2[1]; 3377 3378 _this5.Style.rule(" ", "max-width", unit(options.width), width); 3379 }); 3380 }; 3381 3382 _proto3.registerTrackStyles = function registerTrackStyles() { 3383 var _this6 = this; 3384 3385 var Style2 = this.Style; 3386 var selector = "." + CLASS_TRACK; 3387 this.breakpoints.forEach(function (_ref3) { 3388 var width = _ref3[0], 3389 options = _ref3[1]; 3390 Style2.rule(selector, _this6.resolve("paddingLeft"), _this6.cssPadding(options, false), width); 3391 Style2.rule(selector, _this6.resolve("paddingRight"), _this6.cssPadding(options, true), width); 3392 Style2.rule(selector, "height", _this6.cssTrackHeight(options), width); 3393 }); 3394 }; 3395 3396 _proto3.registerListStyles = function registerListStyles() { 3397 var _this7 = this; 3398 3399 var Style2 = this.Style; 3400 var selector = "." + CLASS_LIST; 3401 this.breakpoints.forEach(function (_ref4) { 3402 var width = _ref4[0], 3403 options = _ref4[1]; 3404 Style2.rule(selector, "transform", _this7.buildTranslate(options), width); 3405 3406 if (!_this7.cssSlideHeight(options)) { 3407 Style2.rule(selector, "aspect-ratio", _this7.cssAspectRatio(options), width); 3408 } 3409 }); 3410 }; 3411 3412 _proto3.registerSlideStyles = function registerSlideStyles() { 3413 var _this8 = this; 3414 3415 var Style2 = this.Style; 3416 var selector = "." + CLASS_SLIDE; 3417 this.breakpoints.forEach(function (_ref5) { 3418 var width = _ref5[0], 3419 options = _ref5[1]; 3420 Style2.rule(selector, "width", _this8.cssSlideWidth(options), width); 3421 Style2.rule(selector, "height", _this8.cssSlideHeight(options) || "100%", width); 3422 Style2.rule(selector, _this8.resolve("marginRight"), unit(options.gap) || "0px", width); 3423 Style2.rule(selector + " > img", "display", options.cover ? "none" : "inline", width); 3424 }); 3425 }; 3426 3427 _proto3.buildTranslate = function buildTranslate(options) { 3428 var _this$Direction = this.Direction, 3429 resolve = _this$Direction.resolve, 3430 orient = _this$Direction.orient; 3431 var values = []; 3432 values.push(this.cssOffsetClones(options)); 3433 values.push(this.cssOffsetGaps(options)); 3434 3435 if (this.isCenter(options)) { 3436 values.push(this.buildCssValue(orient(-50), "%")); 3437 values.push.apply(values, this.cssOffsetCenter(options)); 3438 } 3439 3440 return values.filter(Boolean).map(function (value) { 3441 return "translate" + resolve("X") + "(" + value + ")"; 3442 }).join(" "); 3443 }; 3444 3445 _proto3.cssOffsetClones = function cssOffsetClones(options) { 3446 var _this$Direction2 = this.Direction, 3447 resolve = _this$Direction2.resolve, 3448 orient = _this$Direction2.orient; 3449 var cloneCount = this.getCloneCount(); 3450 3451 if (this.isFixedWidth(options)) { 3452 var _this$parseCssValue = this.parseCssValue(options[resolve("fixedWidth")]), 3453 value = _this$parseCssValue.value, 3454 unit2 = _this$parseCssValue.unit; 3455 3456 return this.buildCssValue(orient(value) * cloneCount, unit2); 3457 } 3458 3459 var percent = 100 * cloneCount / options.perPage; 3460 return orient(percent) + "%"; 3461 }; 3462 3463 _proto3.cssOffsetCenter = function cssOffsetCenter(options) { 3464 var _this$Direction3 = this.Direction, 3465 resolve = _this$Direction3.resolve, 3466 orient = _this$Direction3.orient; 3467 3468 if (this.isFixedWidth(options)) { 3469 var _this$parseCssValue2 = this.parseCssValue(options[resolve("fixedWidth")]), 3470 value = _this$parseCssValue2.value, 3471 unit2 = _this$parseCssValue2.unit; 3472 3473 return [this.buildCssValue(orient(value / 2), unit2)]; 3474 } 3475 3476 var values = []; 3477 var perPage = options.perPage, 3478 gap = options.gap; 3479 values.push(orient(50 / perPage) + "%"); 3480 3481 if (gap) { 3482 var _this$parseCssValue3 = this.parseCssValue(gap), 3483 _value = _this$parseCssValue3.value, 3484 _unit = _this$parseCssValue3.unit; 3485 3486 var gapOffset = (_value / perPage - _value) / 2; 3487 values.push(this.buildCssValue(orient(gapOffset), _unit)); 3488 } 3489 3490 return values; 3491 }; 3492 3493 _proto3.cssOffsetGaps = function cssOffsetGaps(options) { 3494 var cloneCount = this.getCloneCount(); 3495 3496 if (cloneCount && options.gap) { 3497 var orient = this.Direction.orient; 3498 3499 var _this$parseCssValue4 = this.parseCssValue(options.gap), 3500 value = _this$parseCssValue4.value, 3501 unit2 = _this$parseCssValue4.unit; 3502 3503 if (this.isFixedWidth(options)) { 3504 return this.buildCssValue(orient(value * cloneCount), unit2); 3505 } 3506 3507 var perPage = options.perPage; 3508 var gaps = cloneCount / perPage; 3509 return this.buildCssValue(orient(gaps * value), unit2); 3510 } 3511 3512 return ""; 3513 }; 3514 3515 _proto3.resolve = function resolve(prop) { 3516 return camelToKebab(this.Direction.resolve(prop)); 3517 }; 3518 3519 _proto3.cssPadding = function cssPadding(options, right) { 3520 var padding = options.padding; 3521 var prop = this.Direction.resolve(right ? "right" : "left", true); 3522 return padding && unit(padding[prop] || (isObject(padding) ? 0 : padding)) || "0px"; 3523 }; 3524 3525 _proto3.cssTrackHeight = function cssTrackHeight(options) { 3526 var height = ""; 3527 3528 if (this.isVertical()) { 3529 height = this.cssHeight(options); 3530 assert(height, '"height" is missing.'); 3531 height = "calc(" + height + " - " + this.cssPadding(options, false) + " - " + this.cssPadding(options, true) + ")"; 3532 } 3533 3534 return height; 3535 }; 3536 3537 _proto3.cssHeight = function cssHeight(options) { 3538 return unit(options.height); 3539 }; 3540 3541 _proto3.cssSlideWidth = function cssSlideWidth(options) { 3542 return options.autoWidth ? "" : unit(options.fixedWidth) || (this.isVertical() ? "" : this.cssSlideSize(options)); 3543 }; 3544 3545 _proto3.cssSlideHeight = function cssSlideHeight(options) { 3546 return unit(options.fixedHeight) || (this.isVertical() ? options.autoHeight ? "" : this.cssSlideSize(options) : this.cssHeight(options)); 3547 }; 3548 3549 _proto3.cssSlideSize = function cssSlideSize(options) { 3550 var gap = unit(options.gap); 3551 return "calc((100%" + (gap && " + " + gap) + ")/" + (options.perPage || 1) + (gap && " - " + gap) + ")"; 3552 }; 3553 3554 _proto3.cssAspectRatio = function cssAspectRatio(options) { 3555 var heightRatio = options.heightRatio; 3556 return heightRatio ? "" + 1 / heightRatio : ""; 3557 }; 3558 3559 _proto3.buildCssValue = function buildCssValue(value, unit2) { 3560 return "" + value + unit2; 3561 }; 3562 3563 _proto3.parseCssValue = function parseCssValue(value) { 3564 if (isString(value)) { 3565 var number = parseFloat(value) || 0; 3566 var unit2 = value.replace(/\d*(\.\d*)?/, "") || "px"; 3567 return { 3568 value: number, 3569 unit: unit2 3570 }; 3571 } 3572 3573 return { 3574 value: value, 3575 unit: "px" 3576 }; 3577 }; 3578 3579 _proto3.parseBreakpoints = function parseBreakpoints() { 3580 var _this9 = this; 3581 3582 var breakpoints = this.options.breakpoints; 3583 this.breakpoints.push(["default", this.options]); 3584 3585 if (breakpoints) { 3586 forOwn(breakpoints, function (options, width) { 3587 _this9.breakpoints.push([width, merge(merge({}, _this9.options), options)]); 3588 }); 3589 } 3590 }; 3591 3592 _proto3.isFixedWidth = function isFixedWidth(options) { 3593 return !!options[this.Direction.resolve("fixedWidth")]; 3594 }; 3595 3596 _proto3.isLoop = function isLoop() { 3597 return this.options.type === LOOP; 3598 }; 3599 3600 _proto3.isCenter = function isCenter(options) { 3601 if (options.focus === "center") { 3602 if (this.isLoop()) { 3603 return true; 3604 } 3605 3606 if (this.options.type === SLIDE) { 3607 return !this.options.trimSpace; 3608 } 3609 } 3610 3611 return false; 3612 }; 3613 3614 _proto3.isVertical = function isVertical() { 3615 return this.options.direction === TTB; 3616 }; 3617 3618 _proto3.buildClasses = function buildClasses() { 3619 var options = this.options; 3620 return [CLASS_ROOT, CLASS_ROOT + "--" + options.type, CLASS_ROOT + "--" + options.direction, options.drag && CLASS_ROOT + "--draggable", options.isNavigation && CLASS_ROOT + "--nav", CLASS_ACTIVE, !this.config.hidden && CLASS_RENDERED].filter(Boolean).join(" "); 3621 }; 3622 3623 _proto3.buildAttrs = function buildAttrs(attrs) { 3624 var attr = ""; 3625 forOwn(attrs, function (value, key) { 3626 attr += value ? " " + camelToKebab(key) + "=\"" + value + "\"" : ""; 3627 }); 3628 return attr.trim(); 3629 }; 3630 3631 _proto3.buildStyles = function buildStyles(styles) { 3632 var style = ""; 3633 forOwn(styles, function (value, key) { 3634 style += " " + camelToKebab(key) + ":" + value + ";"; 3635 }); 3636 return style.trim(); 3637 }; 3638 3639 _proto3.renderSlides = function renderSlides() { 3640 var _this10 = this; 3641 3642 var tag = this.config.slideTag; 3643 return this.slides.map(function (content) { 3644 return "<" + tag + " " + _this10.buildAttrs(content.attrs) + ">" + (content.html || "") + "</" + tag + ">"; 3645 }).join(""); 3646 }; 3647 3648 _proto3.cover = function cover(content) { 3649 var styles = content.styles, 3650 _content$html = content.html, 3651 html = _content$html === void 0 ? "" : _content$html; 3652 3653 if (this.options.cover && !this.options.lazyLoad) { 3654 var src = html.match(/<img.*?src\s*=\s*(['"])(.+?)\1.*?>/); 3655 3656 if (src && src[2]) { 3657 styles.background = "center/cover no-repeat url('" + src[2] + "')"; 3658 } 3659 } 3660 }; 3661 3662 _proto3.generateClones = function generateClones(contents) { 3663 var classes = this.options.classes; 3664 var count = this.getCloneCount(); 3665 var slides = contents.slice(); 3666 3667 while (slides.length < count) { 3668 push(slides, slides); 3669 } 3670 3671 push(slides.slice(-count).reverse(), slides.slice(0, count)).forEach(function (content, index) { 3672 var attrs = assign({}, content.attrs, { 3673 class: content.attrs.class + " " + classes.clone 3674 }); 3675 var clone = assign({}, content, { 3676 attrs: attrs 3677 }); 3678 index < count ? contents.unshift(clone) : contents.push(clone); 3679 }); 3680 }; 3681 3682 _proto3.getCloneCount = function getCloneCount() { 3683 if (this.isLoop()) { 3684 var options = this.options; 3685 3686 if (options.clones) { 3687 return options.clones; 3688 } 3689 3690 var perPage = max.apply(void 0, this.breakpoints.map(function (_ref6) { 3691 var options2 = _ref6[1]; 3692 return options2.perPage; 3693 })); 3694 return perPage * ((options.flickMaxPages || 1) + 1); 3695 } 3696 3697 return 0; 3698 }; 3699 3700 _proto3.renderArrows = function renderArrows() { 3701 var html = ""; 3702 html += "<div class=\"" + this.options.classes.arrows + "\">"; 3703 html += this.renderArrow(true); 3704 html += this.renderArrow(false); 3705 html += "</div>"; 3706 return html; 3707 }; 3708 3709 _proto3.renderArrow = function renderArrow(prev) { 3710 var _this$options = this.options, 3711 classes = _this$options.classes, 3712 i18n = _this$options.i18n; 3713 var attrs = { 3714 class: classes.arrow + " " + (prev ? classes.prev : classes.next), 3715 type: "button", 3716 ariaLabel: prev ? i18n.prev : i18n.next 3717 }; 3718 return "<button " + this.buildAttrs(attrs) + "><svg xmlns=\"" + XML_NAME_SPACE + "\" viewBox=\"0 0 " + SIZE + " " + SIZE + "\" width=\"" + SIZE + "\" height=\"" + SIZE + "\"><path d=\"" + (this.options.arrowPath || PATH) + "\" /></svg></button>"; 3719 }; 3720 3721 _proto3.html = function html() { 3722 var _this$config = this.config, 3723 rootClass = _this$config.rootClass, 3724 listTag = _this$config.listTag, 3725 arrows = _this$config.arrows, 3726 beforeTrack = _this$config.beforeTrack, 3727 afterTrack = _this$config.afterTrack, 3728 slider = _this$config.slider, 3729 beforeSlider = _this$config.beforeSlider, 3730 afterSlider = _this$config.afterSlider; 3731 var html = ""; 3732 html += "<div id=\"" + this.id + "\" class=\"" + this.buildClasses() + " " + (rootClass || "") + "\">"; 3733 html += "<style>" + this.Style.build() + "</style>"; 3734 3735 if (slider) { 3736 html += beforeSlider || ""; 3737 html += "<div class=\"splide__slider\">"; 3738 } 3739 3740 html += beforeTrack || ""; 3741 3742 if (arrows) { 3743 html += this.renderArrows(); 3744 } 3745 3746 html += "<div class=\"splide__track\">"; 3747 html += "<" + listTag + " class=\"splide__list\">"; 3748 html += this.renderSlides(); 3749 html += "</" + listTag + ">"; 3750 html += "</div>"; 3751 html += afterTrack || ""; 3752 3753 if (slider) { 3754 html += "</div>"; 3755 html += afterSlider || ""; 3756 } 3757 3758 html += "</div>"; 3759 return html; 3760 }; 3761 3762 return SplideRenderer; 3763}(); 3764 3765 3766 3767 3768/***/ }), 3769
3770/***/ "./source/00-config/_GESSO.es6.js": 3771/*!****************************************!*\ 3772 !*** ./source/00-config/_GESSO.es6.js ***! 3773 \****************************************/ 3774/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 3775 3776__webpack_require__.r(__webpack_exports__); 3777/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3778/* harmony export */ "BOX_SHADOW": function() { return /* binding */ BOX_SHADOW; }, 3779/* harmony export */ "BREAKPOINTS": function() { return /* binding */ BREAKPOINTS; }, 3780/* harmony export */ "COLORS": function() { return /* binding */ COLORS; }, 3781/* harmony export */ "CONSTRAINS": function() { return /* binding */ CONSTRAINS; }, 3782/* harmony export */ "GUTTER_WIDTH": function() { return /* binding */ GUTTER_WIDTH; }, 3783/* harmony export */ "PALETTE": function() { return /* binding */ PALETTE; }, 3784/* harmony export */ "SITE_MARGINS": function() { return /* binding */ SITE_MARGINS; }, 3785/* harmony export */ "SPACING": function() { return /* binding */ SPACING; }, 3786/* harmony export */ "TRANSITIONS": function() { return /* binding */ TRANSITIONS; }, 3787/* harmony export */ "TYPOGRAPHY": function() { return /* binding */ TYPOGRAPHY; }, 3788/* harmony export */ "Z_INDEX": function() { return /* binding */ Z_INDEX; } 3789/* harmony export */ }); 3790const PALETTE = { 3791 brand: { 3792 "orange-1": { 3793 base: "#ff4719" 3794 }, 3795 "orange-2": { 3796 base: "#c52d00" 3797 }, 3798 blue: { 3799 base: "#293745" 3800 } 3801 }, 3802 secondary: { 3803 blue: { 3804 "base-1": "#3caaff", 3805 "base-2": "#6e81ff" 3806 }, 3807 green: { 3808 base: "#00ce7c" 3809 }, 3810 red: { 3811 base: "#d4042c" 3812 }, 3813 yellow: { 3814 base: "#ffa800" 3815 }, 3816 purple: { 3817 base: "#7a199b" 3818 } 3819 }, 3820 grayscale: { 3821 white: "#ffffff", 3822 "gray-1": "#E8E8E8", 3823 "gray-2": "#EFEFEF", 3824 "gray-3": "#CFCFCF", 3825 "gray-4": "#9F9FA0", 3826 "gray-5": "#5F5F61", 3827 "gray-6": "#292929", 3828 black: "#000000" 3829 }, 3830 other: { 3831 yellow: { 3832 base: "#fad980", 3833 light: "#fff1d2" 3834 }, 3835 "yellow-neon": { 3836 base: "#ff0" 3837 }, 3838 green: { 3839 base: "#94bfa2", 3840 light: "#e7f4e4" 3841 }, 3842 red: { 3843 base: "#e31c3d", 3844 light: "#e59393", 3845 "light-1": "#f9dede", 3846 dark: "#cd2026", 3847 "dark-1": "#981b1e" 3848 } 3849 } 3850}; 3851const BOX_SHADOW = { 3852 0: "none", 3853 1: "0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24)", 3854 2: "0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23)", 3855 3: "0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23)", 3856 4: "0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22)", 3857 5: "0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22)" 3858}; 3859const CONSTRAINS = { 3860 sm: "800px", 3861 md: "1440px", 3862 lg: "2200px" 3863}; 3864const COLORS = { 3865 text: { 3866 primary: "#292929", 3867 secondary: "#5F5F61", 3868 header: "#293745", 3869 "on-light": "#292929", 3870 "on-dark": "#ffffff", 3871 link: "#c52d00", 3872 "link-hover": "#c52d00", 3873 "link-active": "#c52d00", 3874 "link-visited": "#7a199b" 3875 }, 3876 background: { 3877 site: "#ffffff" 3878 }, 3879 button: { 3880 primary: { 3881 background: "#ffffff", 3882 "background-hover": "#ffffff", 3883 "background-active": "#ffffff", 3884 border: "#293745", 3885 "border-hover": "#293745", 3886 text: "#293745", 3887 "text-hover": "#293745", 3888 "text-active": "#293745" 3889 }, 3890 "primary-on-dark": { 3891 background: "#293745", 3892 "background-hover": "#293745", 3893 "background-active": "#293745", 3894 border: "#ffffff", 3895 "border-hover": "#ffffff", 3896 text: "#ffffff", 3897 "text-hover": "#ffffff", 3898 "text-active": "#ffffff" 3899 }, 3900 secondary: { 3901 background: "#ffffff", 3902 "background-hover": "#ffffff", 3903 "background-active": "#ffffff", 3904 text: "#293745", 3905 "text-hover": "#293745", 3906 "text-active": "#293745" 3907 }, 3908 "secondary-on-dark": { 3909 background: "#293745", 3910 "background-hover": "#293745", 3911 "background-active": "#293745", 3912 text: "#ffffff", 3913 "text-hover": "#ffffff", 3914 "text-active": "#ffffff" 3915 }, 3916 disabled: { 3917 background: "#E8E8E8", 3918 border: "#E8E8E8", 3919 text: "#CFCFCF" 3920 }, 3921 "back-to-top": { 3922 background: "#CFCFCF", 3923 "background-hover": "#5F5F61", 3924 color: "#ffffff", 3925 "color-hover": "#ffffff" 3926 } 3927 }, 3928 form: { 3929 background: "#E8E8E8", 3930 "background-active": "#ffffff", 3931 "background-checked": "#ff4719", 3932 "background-unchecked": "#ffffff", 3933 border: "#EFEFEF", 3934 "border-dark": "#5F5F61", 3935 "border-light": "#E8E8E8", 3936 thumb: "#5F5F61", 3937 track: "#CFCFCF" 3938 }, 3939 mark: { 3940 background: "#ff0", 3941 text: "#292929" 3942 }, 3943 selection: { 3944 background: "#3caaff", 3945 text: "#292929" 3946 }, 3947 table: { 3948 border: "#5F5F61", 3949 background: "#ffffff", 3950 "background-head": "#E8E8E8", 3951 "background-foot": "#E8E8E8" 3952 }, 3953 ui: { 3954 generic: { 3955 background: "#CFCFCF", 3956 "background-darker": "#292929", 3957 "background-dark": "#292929", 3958 "background-light": "#E8E8E8", 3959 "background-lighter": "#E8E8E8", 3960 border: "#CFCFCF", 3961 "border-dark": "#292929", 3962 "border-light": "#E8E8E8", 3963 "border-blue": "#293745", 3964 "text-lighter": "#ffffff", 3965 "text-light": "#CFCFCF", 3966 "text-dark": "#5F5F61", 3967 "text-darker": "#292929", 3968 accent: "#ff4719", 3969 focus: "#ff4719" 3970 }, 3971 error: { 3972 background: "#f9dede", 3973 border: "#e59393" 3974 }, 3975 success: { 3976 background: "#e7f4e4", 3977 border: "#94bfa2" 3978 }, 3979 warning: { 3980 background: "#fff1d2", 3981 border: "#fad980" 3982 } 3983 } 3984}; 3985const TYPOGRAPHY = { 3986 "font-family": { 3987 primary: { 3988 name: "Primary", 3989 stack: '"Noto Sans", sans-serif' 3990 }, 3991 system: { 3992 name: "System", 3993 stack: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Oxygen-Sans", Ubuntu, Cantarell, "Fira Sans", Droid Sans, sans-serif' 3994 }, 3995 monospace: { 3996 name: "Monospace", 3997 stack: 'Menlo, Consolas, "Lucida Console", "Liberation Mono", "Courier New", monospace, sans-serif' 3998 } 3999 }, 4000 "base-font-size": "18px", 4001 "font-size": { 4002 1: "16px", 4003 2: "18px", 4004 3: "20px", 4005 4: "24px", 4006 5: "28px", 4007 6: "32px", 4008 7: "44px", 4009 8: "48px", 4010 9: "60px", 4011 10: "72px", 4012 .25: "12px", 4013 .5: "14px" 4014 }, 4015 "responsive-font-size-min-width": "360px", 4016 "responsive-font-size-max-width": "1600px", 4017 "responsive-font-size": { 4018 1: { 4019 min: "16px", 4020 val: "auto", 4021 max: "16px" 4022 }, 4023 2: { 4024 min: "18px", 4025 val: "auto", 4026 max: "18px" 4027 }, 4028 3: { 4029 min: "20px", 4030 val: "auto", 4031 max: "20px" 4032 }, 4033 4: { 4034 min: "20px", 4035 val: "auto", 4036 max: "24px" 4037 }, 4038 5: { 4039 min: "24px", 4040 val: "auto", 4041 max: "28px" 4042 }, 4043 6: { 4044 min: "28px", 4045 val: "auto", 4046 max: "32px" 4047 }, 4048 7: { 4049 min: "32px", 4050 val: "auto", 4051 max: "44px" 4052 }, 4053 8: { 4054 min: "32px", 4055 val: "auto", 4056 max: "48px" 4057 }, 4058 9: { 4059 min: "38px", 4060 val: "auto", 4061 max: "60px" 4062 }, 4063 10: { 4064 min: "48px", 4065 val: "auto", 4066 max: "72px" 4067 } 4068 }, 4069 "font-weight": { 4070 light: 300, 4071 regular: 400, 4072 semibold: 600, 4073 bold: 700, 4074 bolder: 800, 4075 extrabold: 900 4076 }, 4077 "line-height": { 4078 tight: 1.1, 4079 base: 1.45, 4080 loose: 1.7 4081 }, 4082 display: { 4083 display: { 4084 color: "#293745", 4085 "font-family": '"Noto Sans", sans-serif', 4086 "font-weight": 900, 4087 "line-height": 1.1, 4088 "responsive-font-size": 10 4089 }, 4090 h1: { 4091 color: "#293745", 4092 "font-family": '"Noto Sans", sans-serif', 4093 "font-weight": 800, 4094 "letter-spacing": "-.01em", 4095 "line-height": 1.1, 4096 "responsive-font-size": 9 4097 }, 4098 h2: { 4099 color: "#293745", 4100 "font-family": '"Noto Sans", sans-serif', 4101 "font-weight": 800, 4102 "letter-spacing": "-.01em", 4103 "line-height": 1.1, 4104 "responsive-font-size": 8 4105 },
4106 h3: { 4107 color: "#293745", 4108 "font-family": '"Noto Sans", sans-serif', 4109 "font-weight": 600, 4110 "line-height": 1.1, 4111 "responsive-font-size": 7 4112 }, 4113 h4: { 4114 color: "#293745", 4115 "font-family": '"Noto Sans", sans-serif', 4116 "font-weight": 600, 4117 "line-height": 1.45, 4118 "responsive-font-size": 6 4119 }, 4120 h5: { 4121 color: "#293745", 4122 "font-family": '"Noto Sans", sans-serif', 4123 "font-weight": 400, 4124 "line-height": 1.45, 4125 "responsive-font-size": 5 4126 }, 4127 h6: { 4128 color: "#293745", 4129 "font-family": '"Noto Sans", sans-serif', 4130 "font-weight": 600, 4131 "letter-spacing": "-0.04em", 4132 "line-height": 1.7, 4133 "text-transform": "uppercase", 4134 "responsive-font-size": 4 4135 }, 4136 blockquote: { 4137 color: "#293745", 4138 "font-family": '"Noto Sans", sans-serif', 4139 "font-weight": 400, 4140 "line-height": 1.45, 4141 "responsive-font-size": 5 4142 }, 4143 body: { 4144 color: "#292929", 4145 "font-family": '"Noto Sans", sans-serif', 4146 "font-size": "18px", 4147 "font-weight": 400, 4148 "line-height": 1.45 4149 }, 4150 "body-large": { 4151 color: "#292929", 4152 "font-family": '"Noto Sans", sans-serif', 4153 "font-size": "20px", 4154 "font-weight": 400, 4155 "line-height": 1.45 4156 }, 4157 "body-small": { 4158 color: "#292929", 4159 "font-family": '"Noto Sans", sans-serif', 4160 "font-size": "16px", 4161 "font-weight": 400, 4162 "line-height": 1.45 4163 }, 4164 "body-xsmall": { 4165 color: "#292929", 4166 "font-family": '"Noto Sans", sans-serif', 4167 "font-size": "14px", 4168 "font-weight": 400, 4169 "line-height": 1.45 4170 }, 4171 "body-xxsmall": { 4172 color: "#292929", 4173 "font-family": '"Noto Sans", sans-serif', 4174 "font-size": "12px", 4175 "font-weight": 400, 4176 "line-height": 1.45 4177 }, 4178 cite: { 4179 color: "#5F5F61", 4180 "font-family": '"Noto Sans", sans-serif', 4181 "font-size": "16px", 4182 "font-style": "normal", 4183 "font-weight": 600, 4184 "letter-spacing": ".02em", 4185 "line-height": 1.1 4186 } 4187 } 4188}; 4189const TRANSITIONS = { 4190 ease: { 4191 "ease-in-out": "cubic-bezier(0.4, 0, 0.2, 1)", 4192 "ease-out": "cubic-bezier(0.0, 0, 0.2, 1)", 4193 "ease-in": "cubic-bezier(0.4, 0, 1, 1)", 4194 sharp: "cubic-bezier(0.4, 0, 0.6, 1)" 4195 }, 4196 duration: { 4197 shortest: "150ms", 4198 short: "200ms", 4199 standard: "375ms", 4200 long: "400ms",
4201 intro: "270ms", 4202 outro: "195ms" 4203 } 4204}; 4205const Z_INDEX = { 4206 nav: 1e3, 4207 drawer: 1200, 4208 modal: 1300, 4209 search: 2500 4210}; 4211const SPACING = { 4212 0: 0, 4213 1: "8px", 4214 2: "16px", 4215 3: "24px", 4216 4: "32px", 4217 5: "40px", 4218 6: "48px", 4219 7: "56px", 4220 8: "64px", 4221 9: "72px", 4222 10: "80px", 4223 12: "96px", 4224 15: "120px", 4225 .5: "4px", 4226 1.5: "12px", 4227 2.5: "20px" 4228}; 4229const GUTTER_WIDTH = "32px"; 4230const SITE_MARGINS = { 4231 mobile: "16px", 4232 desktop: "32px" 4233}; 4234const BREAKPOINTS = { 4235 sidebar: "1000px" 4236}; 4237 4238/***/ })
vendor: 4,484 bytes, lines 4238-4338
4238, 4239 4240/***/ "@wordpress/dom-ready": 4241/*!**********************************!*\ 4242 !*** external ["wp","domReady"] ***! 4243 \**********************************/ 4244/***/ (function(module) { 4245 4246module.exports = window["wp"]["domReady"]; 4247 4248/***/ }) 4249 4250/******/ }); 4251/************************************************************************/ 4252/******/ // The module cache 4253/******/ var __webpack_module_cache__ = {}; 4254/******/ 4255/******/ // The require function 4256/******/ function __webpack_require__(moduleId) { 4257/******/ // Check if module is in cache 4258/******/ var cachedModule = __webpack_module_cache__[moduleId]; 4259/******/ if (cachedModule !== undefined) { 4260/******/ return cachedModule.exports; 4261/******/ } 4262/******/ // Create a new module (and put it into the cache) 4263/******/ var module = __webpack_module_cache__[moduleId] = { 4264/******/ // no module.id needed 4265/******/ // no module.loaded needed 4266/******/ exports: {} 4267/******/ }; 4268/******/ 4269/******/ // Execute the module function 4270/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 4271/******/ 4272/******/ // Return the exports of the module 4273/******/ return module.exports; 4274/******/ } 4275/******/ 4276/************************************************************************/ 4277/******/ /* webpack/runtime/compat get default export */ 4278/******/ !function() { 4279/******/ // getDefaultExport function for compatibility with non-harmony modules 4280/******/ __webpack_require__.n = function(module) { 4281/******/ var getter = module && module.__esModule ? 4282/******/ function() { return module['default']; } : 4283/******/ function() { return module; }; 4284/******/ __webpack_require__.d(getter, { a: getter }); 4285/******/ return getter; 4286/******/ }; 4287/******/ }(); 4288/******/ 4289/******/ /* webpack/runtime/define property getters */ 4290/******/ !function() { 4291/******/ // define getter functions for harmony exports 4292/******/ __webpack_require__.d = function(exports, definition) { 4293/******/ for(var key in definition) { 4294/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 4295/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 4296/******/ } 4297/******/ } 4298/******/ }; 4299/******/ }(); 4300/******/ 4301/******/ /* webpack/runtime/hasOwnProperty shorthand */ 4302/******/ !function() { 4303/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 4304/******/ }(); 4305/******/ 4306/******/ /* webpack/runtime/make namespace object */ 4307/******/ !function() { 4308/******/ // define __esModule on exports 4309/******/ __webpack_require__.r = function(exports) { 4310/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 4311/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 4312/******/ } 4313/******/ Object.defineProperty(exports, '__esModule', { value: true }); 4314/******/ }; 4315/******/ }(); 4316/******/ 4317/************************************************************************/ 4318var __webpack_exports__ = {}; 4319// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. 4320!function() { 4321/*!*****************************************!*\ 4322 !*** ./source/04-utility/splide.es6.js ***! 4323 \*****************************************/ 4324__webpack_require__.r(__webpack_exports__); 4325/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready"); 4326/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0__); 4327/* harmony import */ var _splidejs_splide__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @splidejs/splide */ "./node_modules/@splidejs/splide/dist/js/splide.esm.js"); 4328/* harmony import */ var _00_config_GESSO_es6__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../00-config/_GESSO.es6 */ "./source/00-config/_GESSO.es6.js"); 4329 4330 4331// _GESSO requires the design tokens to have been built first. This is fine 4332// when doing a normal theme build, but since "Theme Linting" in Buildkite 4333// runs in a docker container without any other build steps, _GESSO will not 4334// exist in that scenario only. 4335// eslint-disable-next-line import/no-unresolved 4336 4337_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0___default()(() => { 4338 const sliders = document.querySelectorAll('.related-cards__slider');
4339 sliders.forEach(slider => { 4340 const carousel = new _splidejs_splide__WEBPACK_IMPORTED_MODULE_1__["default"](slider, { 4341 easing: _00_config_GESSO_es6__WEBPACK_IMPORTED_MODULE_2__.TRANSITIONS.ease["ease-out"], 4342 speed: parseInt(_00_config_GESSO_es6__WEBPACK_IMPORTED_MODULE_2__.TRANSITIONS.duration.standard, 10), 4343 perPage: 1, 4344 perMove: 1, 4345 type: 'loop', 4346 focus: 'center', 4347 gap: '1rem', 4348 pagination: false, 4349 arrows: true, 4350 mediaQuery: 'min', 4351 padding: { 4352 left: 0, 4353 right: '7rem' 4354 }, 4355 breakpoints: { 4356 781: { 4357 type: 'slide', 4358 focus: undefined, 4359 perPage: 2, 4360 perMove: 1, 4361 padding: { 4362 left: 0, 4363 right: '8rem' 4364 } 4365 }, 4366 1280: { 4367 padding: { 4368 left: 0, 4369 right: '17rem' 4370 } 4371 } 4372 } 4373 }); 4374 const progressBar = slider.querySelector('.related-cards__progress'); 4375 if (progressBar) { 4376 carousel.on('mounted move', () => { 4377 const end = carousel.Components.Controller.getEnd() + 1; 4378 const rate = Math.min((carousel.index + 1) / end, 1); 4379 const percentWidth = `${100 * rate}%`; 4380 progressBar.style.setProperty('--related-cards-progress', percentWidth); 4381 progressBar.removeAttribute('aria-label'); 4382 }); 4383 } 4384 4385 // remove slide 1 on mobile 4386 carousel.on('resized', () => { 4387 const activeIntroSlide = carousel.Components.Slides.filter('.splide__slide--intro'); 4388 if (window.outerWidth <= 781) { 4389 activeIntroSlide[0].slide.style.display = 'none'; 4390 } else { 4391 activeIntroSlide[0].slide.style.display = 'block'; 4392 } 4393 }); 4394 carousel.mount(); 4395 }); 4396 const timelines = document.querySelectorAll('.timeline__cards');
4397 timelines.forEach(slider => { 4398 const timeline = new _splidejs_splide__WEBPACK_IMPORTED_MODULE_1__["default"](slider, { 4399 easing: _00_config_GESSO_es6__WEBPACK_IMPORTED_MODULE_2__.TRANSITIONS.ease["ease-out"], 4400 speed: parseInt(_00_config_GESSO_es6__WEBPACK_IMPORTED_MODULE_2__.TRANSITIONS.duration.standard, 10), 4401 perPage: 2, 4402 perMove: 1, 4403 type: 'slide', 4404 gap: '62px', 4405 pagination: false, 4406 arrows: true, 4407 padding: { 4408 left: 0 4409 }, 4410 breakpoints: { 4411 600: { 4412 type: 'slide', 4413 focus: undefined, 4414 gap: '30px', 4415 perPage: 1, 4416 perMove: 1, 4417 padding: { 4418 left: 0 4419 } 4420 } 4421 } 4422 }); 4423 timeline.mount(); 4424 }); 4425 const media5050sliders = document.querySelectorAll('.media-5050__slider'); 4426 if (media5050sliders) { 4427 media5050sliders.forEach(media5050slider => { 4428 const media5050sliderscarousel = new _splidejs_splide__WEBPACK_IMPORTED_MODULE_1__["default"](media5050slider, { 4429 easing: _00_config_GESSO_es6__WEBPACK_IMPORTED_MODULE_2__.TRANSITIONS.ease["ease-out"], 4430 speed: parseInt(_00_config_GESSO_es6__WEBPACK_IMPORTED_MODULE_2__.TRANSITIONS.duration.standard, 10), 4431 perPage: 1, 4432 perMove: 1, 4433 type: 'loop', 4434 focus: 'center', 4435 gap: 0, 4436 pagination: false, 4437 arrows: true 4438 }); 4439 const media5050progressBar = media5050slider.querySelector('.media-5050__progress'); 4440 if (media5050progressBar) { 4441 media5050sliderscarousel.on('mounted move', () => { 4442 const end = media5050sliderscarousel.Components.Controller.getEnd() + 1; 4443 const rate = Math.min((media5050sliderscarousel.index + 1) / end, 1); 4444 const percentWidth = `${100 * rate}%`; 4445 media5050progressBar.style.setProperty('--media-5050-progress', percentWidth); 4446 media5050progressBar.removeAttribute('aria-label'); 4447 }); 4448 } 4449 media5050sliderscarousel.mount(); 4450 }); 4451 } 4452}); 4453}(); 4454/******/ })() 4455; 4456//# sourceMappingURL=splide.es6.js.map
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.