1/******/ (function (modules) { 2 // webpackBootstrap 3 /******/ // The module cache 4 /******/ var installedModules = {}; 5 /******/ 6 /******/ // The require function 7 /******/ function __webpack_require__(moduleId) { 8 /******/ 9 /******/ // Check if module is in cache 10 /******/ if (installedModules[moduleId]) { 11 /******/ return installedModules[moduleId].exports; 12 /******/ 13 } 14 /******/ // Create a new module (and put it into the cache) 15 /******/ var module = (installedModules[moduleId] = { 16 /******/ i: moduleId, 17 /******/ l: false, 18 /******/ exports: {}, 19 /******/ 20 }); 21 /******/ 22 /******/ // Execute the module function 23 /******/ modules[moduleId].call( 24 module.exports, 25 module, 26 module.exports, 27 __webpack_require__, 28 ); 29 /******/ 30 /******/ // Flag the module as loaded 31 /******/ module.l = true; 32 /******/ 33 /******/ // Return the exports of the module 34 /******/ return module.exports; 35 /******/ 36 } 37 /******/ 38 /******/ 39 /******/ // expose the modules object (__webpack_modules__) 40 /******/ __webpack_require__.m = modules; 41 /******/ 42 /******/ // expose the module cache 43 /******/ __webpack_require__.c = installedModules; 44 /******/ 45 /******/ // define getter function for harmony exports 46 /******/ __webpack_require__.d = function (exports, name, getter) { 47 /******/ if (!__webpack_require__.o(exports, name)) { 48 /******/ Object.defineProperty(exports, name, { 49 enumerable: true, 50 get: getter, 51 }); 52 /******/ 53 } 54 /******/ 55 }; 56 /******/ 57 /******/ // define __esModule on exports 58 /******/ __webpack_require__.r = function (exports) { 59 /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { 60 /******/ Object.defineProperty(exports, Symbol.toStringTag, { 61 value: "Module", 62 }); 63 /******/ 64 } 65 /******/ Object.defineProperty(exports, "__esModule", { value: true }); 66 /******/ 67 }; 68 /******/ 69 /******/ // create a fake namespace object 70 /******/ // mode & 1: value is a module id, require it 71 /******/ // mode & 2: merge all properties of value into the ns 72 /******/ // mode & 4: return value when already ns object 73 /******/ // mode & 8|1: behave like require 74 /******/ __webpack_require__.t = function (value, mode) { 75 /******/ if (mode & 1) value = __webpack_require__(value); 76 /******/ if (mode & 8) return value; 77 /******/ if ( 78 mode & 4 && 79 typeof value === "object" && 80 value && 81 value.__esModule 82 ) 83 return value; 84 /******/ var ns = Object.create(null); 85 /******/ __webpack_require__.r(ns); 86 /******/ Object.defineProperty(ns, "default", { 87 enumerable: true, 88 value: value, 89 }); 90 /******/ if (mode & 2 && typeof value != "string") 91 for (var key in value) 92 __webpack_require__.d( 93 ns, 94 key, 95 function (key) { 96 return value[key]; 97 }.bind(null, key), 98 ); 99 /******/ return ns; 100 /******/ 101 }; 102 /******/ 103 /******/ // getDefaultExport function for compatibility with non-harmony modules 104 /******/ __webpack_require__.n = function (module) { 105 /******/ var getter = 106 module && module.__esModule 107 ? /******/ function getDefault() { 108 return module["default"]; 109 } 110 : /******/ function getModuleExports() { 111 return module; 112 }; 113 /******/ __webpack_require__.d(getter, "a", getter); 114 /******/ return getter; 115 /******/ 116 }; 117 /******/ 118 /******/ // Object.prototype.hasOwnProperty.call 119 /******/ __webpack_require__.o = function (object, property) { 120 return Object.prototype.hasOwnProperty.call(object, property); 121 }; 122 /******/ 123 /******/ // __webpack_public_path__ 124 /******/ __webpack_require__.p = ""; 125 /******/ 126 /******/ 127 /******/ // Load entry module and return exports 128 /******/ return __webpack_require__((__webpack_require__.s = "./js/App.js")); 129 /******/ 130})( 131 /************************************************************************/ 132 /******/ { 133
vendor: 131,875 bytes, lines 133-4578
133/***/ "../node_modules/bootstrap/dist/js/bootstrap.js": 134 /*!******************************************************!*\ 135 !*** ../node_modules/bootstrap/dist/js/bootstrap.js ***! 136 \******************************************************/ 137 /*! no static exports found */ 138 /***/ function (module, exports, __webpack_require__) { 139 /*! 140 * Bootstrap v4.3.1 (https://getbootstrap.com/) 141 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 142 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 143 */ 144(function (global, factory) { 145 true ? factory(exports, __webpack_require__(/*! jquery */ "../node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! popper.js */ "../node_modules/popper.js/dist/esm/popper.js")) : 146 undefined; 147}(this, function (exports, $, Popper) { 'use strict'; 148 149 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 150 Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper; 151 152 function _defineProperties(target, props) { 153 for (var i = 0; i < props.length; i++) { 154 var descriptor = props[i]; 155 descriptor.enumerable = descriptor.enumerable || false; 156 descriptor.configurable = true; 157 if ("value" in descriptor) descriptor.writable = true; 158 Object.defineProperty(target, descriptor.key, descriptor); 159 } 160 } 161 162 function _createClass(Constructor, protoProps, staticProps) { 163 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 164 if (staticProps) _defineProperties(Constructor, staticProps); 165 return Constructor; 166 } 167 168 function _defineProperty(obj, key, value) { 169 if (key in obj) { 170 Object.defineProperty(obj, key, { 171 value: value, 172 enumerable: true, 173 configurable: true, 174 writable: true 175 }); 176 } else { 177 obj[key] = value; 178 } 179 180 return obj; 181 } 182 183 function _objectSpread(target) { 184 for (var i = 1; i < arguments.length; i++) { 185 var source = arguments[i] != null ? arguments[i] : {}; 186 var ownKeys = Object.keys(source); 187 188 if (typeof Object.getOwnPropertySymbols === 'function') { 189 ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { 190 return Object.getOwnPropertyDescriptor(source, sym).enumerable; 191 })); 192 } 193 194 ownKeys.forEach(function (key) { 195 _defineProperty(target, key, source[key]); 196 }); 197 } 198 199 return target; 200 } 201 202 function _inheritsLoose(subClass, superClass) { 203 subClass.prototype = Object.create(superClass.prototype); 204 subClass.prototype.constructor = subClass; 205 subClass.__proto__ = superClass; 206 } 207 208 /** 209 * -------------------------------------------------------------------------- 210 * Bootstrap (v4.3.1): util.js 211 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 212 * -------------------------------------------------------------------------- 213 */ 214 /** 215 * ------------------------------------------------------------------------ 216 * Private TransitionEnd Helpers 217 * ------------------------------------------------------------------------ 218 */ 219 220 var TRANSITION_END = 'transitionend'; 221 var MAX_UID = 1000000; 222 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 223 224 function toType(obj) { 225 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 226 } 227 228 function getSpecialTransitionEndEvent() { 229 return { 230 bindType: TRANSITION_END, 231 delegateType: TRANSITION_END, 232 handle: function handle(event) { 233 if ($(event.target).is(this)) { 234 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 235 } 236 237 return undefined; // eslint-disable-line no-undefined 238 } 239 }; 240 } 241 242 function transitionEndEmulator(duration) { 243 var _this = this; 244 245 var called = false; 246 $(this).one(Util.TRANSITION_END, function () { 247 called = true; 248 }); 249 setTimeout(function () { 250 if (!called) { 251 Util.triggerTransitionEnd(_this); 252 } 253 }, duration); 254 return this; 255 } 256 257 function setTransitionEndSupport() { 258 $.fn.emulateTransitionEnd = transitionEndEmulator; 259 $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 260 } 261 /** 262 * -------------------------------------------------------------------------- 263 * Public Util Api 264 * -------------------------------------------------------------------------- 265 */ 266 267 268 var Util = { 269 TRANSITION_END: 'bsTransitionEnd', 270 getUID: function getUID(prefix) { 271 do { 272 // eslint-disable-next-line no-bitwise 273 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 274 } while (document.getElementById(prefix)); 275 276 return prefix; 277 }, 278 getSelectorFromElement: function getSelectorFromElement(element) { 279 var selector = element.getAttribute('data-target'); 280 281 if (!selector || selector === '#') { 282 var hrefAttr = element.getAttribute('href'); 283 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 284 } 285 286 try { 287 return document.querySelector(selector) ? selector : null; 288 } catch (err) { 289 return null; 290 } 291 }, 292 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 293 if (!element) { 294 return 0; 295 } // Get transition-duration of the element 296 297 298 var transitionDuration = $(element).css('transition-duration'); 299 var transitionDelay = $(element).css('transition-delay'); 300 var floatTransitionDuration = parseFloat(transitionDuration); 301 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 302 303 if (!floatTransitionDuration && !floatTransitionDelay) { 304 return 0; 305 } // If multiple durations are defined, take the first 306 307 308 transitionDuration = transitionDuration.split(',')[0]; 309 transitionDelay = transitionDelay.split(',')[0]; 310 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 311 }, 312 reflow: function reflow(element) { 313 return element.offsetHeight; 314 }, 315 triggerTransitionEnd: function triggerTransitionEnd(element) { 316 $(element).trigger(TRANSITION_END); 317 }, 318 // TODO: Remove in v5 319 supportsTransitionEnd: function supportsTransitionEnd() { 320 return Boolean(TRANSITION_END); 321 }, 322 isElement: function isElement(obj) { 323 return (obj[0] || obj).nodeType; 324 }, 325 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 326 for (var property in configTypes) { 327 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 328 var expectedTypes = configTypes[property]; 329 var value = config[property]; 330 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 331 332 if (!new RegExp(expectedTypes).test(valueType)) { 333 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); 334 } 335 } 336 } 337 }, 338 findShadowRoot: function findShadowRoot(element) { 339 if (!document.documentElement.attachShadow) { 340 return null; 341 } // Can find the shadow root otherwise it'll return the document 342 343 344 if (typeof element.getRootNode === 'function') { 345 var root = element.getRootNode(); 346 return root instanceof ShadowRoot ? root : null; 347 } 348 349 if (element instanceof ShadowRoot) { 350 return element; 351 } // when we don't find a shadow root 352 353 354 if (!element.parentNode) { 355 return null; 356 } 357 358 return Util.findShadowRoot(element.parentNode); 359 } 360 }; 361 setTransitionEndSupport(); 362 363 /** 364 * ------------------------------------------------------------------------ 365 * Constants 366 * ------------------------------------------------------------------------ 367 */ 368 369 var NAME = 'alert'; 370 var VERSION = '4.3.1'; 371 var DATA_KEY = 'bs.alert'; 372 var EVENT_KEY = "." + DATA_KEY; 373 var DATA_API_KEY = '.data-api'; 374 var JQUERY_NO_CONFLICT = $.fn[NAME]; 375 var Selector = { 376 DISMISS: '[data-dismiss="alert"]' 377 }; 378 var Event = { 379 CLOSE: "close" + EVENT_KEY, 380 CLOSED: "closed" + EVENT_KEY, 381 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY 382 }; 383 var ClassName = { 384 ALERT: 'alert', 385 FADE: 'fade', 386 SHOW: 'show' 387 /** 388 * ------------------------------------------------------------------------ 389 * Class Definition 390 * ------------------------------------------------------------------------ 391 */ 392 393 }; 394 395 var Alert = 396 /*#__PURE__*/ 397 function () { 398 function Alert(element) { 399 this._element = element; 400 } // Getters 401 402 403 var _proto = Alert.prototype; 404 405 // Public 406 _proto.close = function close(element) { 407 var rootElement = this._element; 408 409 if (element) { 410 rootElement = this._getRootElement(element); 411 } 412 413 var customEvent = this._triggerCloseEvent(rootElement); 414 415 if (customEvent.isDefaultPrevented()) { 416 return; 417 } 418 419 this._removeElement(rootElement); 420 }; 421 422 _proto.dispose = function dispose() { 423 $.removeData(this._element, DATA_KEY); 424 this._element = null; 425 } // Private 426 ; 427 428 _proto._getRootElement = function _getRootElement(element) { 429 var selector = Util.getSelectorFromElement(element); 430 var parent = false; 431 432 if (selector) { 433 parent = document.querySelector(selector); 434 } 435 436 if (!parent) { 437 parent = $(element).closest("." + ClassName.ALERT)[0]; 438 } 439 440 return parent; 441 }; 442 443 _proto._triggerCloseEvent = function _triggerCloseEvent(element) { 444 var closeEvent = $.Event(Event.CLOSE); 445 $(element).trigger(closeEvent); 446 return closeEvent; 447 }; 448 449 _proto._removeElement = function _removeElement(element) { 450 var _this = this; 451 452 $(element).removeClass(ClassName.SHOW); 453 454 if (!$(element).hasClass(ClassName.FADE)) { 455 this._destroyElement(element); 456 457 return; 458 } 459 460 var transitionDuration = Util.getTransitionDurationFromElement(element); 461 $(element).one(Util.TRANSITION_END, function (event) { 462 return _this._destroyElement(element, event); 463 }).emulateTransitionEnd(transitionDuration); 464 }; 465 466 _proto._destroyElement = function _destroyElement(element) { 467 $(element).detach().trigger(Event.CLOSED).remove(); 468 } // Static 469 ; 470 471 Alert._jQueryInterface = function _jQueryInterface(config) { 472 return this.each(function () { 473 var $element = $(this); 474 var data = $element.data(DATA_KEY); 475 476 if (!data) { 477 data = new Alert(this); 478 $element.data(DATA_KEY, data); 479 } 480 481 if (config === 'close') { 482 data[config](this); 483 } 484 }); 485 }; 486 487 Alert._handleDismiss = function _handleDismiss(alertInstance) { 488 return function (event) { 489 if (event) { 490 event.preventDefault(); 491 } 492 493 alertInstance.close(this); 494 }; 495 }; 496 497 _createClass(Alert, null, [{ 498 key: "VERSION", 499 get: function get() { 500 return VERSION; 501 } 502 }]); 503 504 return Alert; 505 }(); 506 /** 507 * ------------------------------------------------------------------------ 508 * Data Api implementation 509 * ------------------------------------------------------------------------ 510 */ 511 512 513 $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); 514 /** 515 * ------------------------------------------------------------------------ 516 * jQuery 517 * ------------------------------------------------------------------------ 518 */ 519 520 $.fn[NAME] = Alert._jQueryInterface; 521 $.fn[NAME].Constructor = Alert; 522 523 $.fn[NAME].noConflict = function () { 524 $.fn[NAME] = JQUERY_NO_CONFLICT; 525 return Alert._jQueryInterface; 526 }; 527 528 /** 529 * ------------------------------------------------------------------------ 530 * Constants 531 * ------------------------------------------------------------------------ 532 */ 533 534 var NAME$1 = 'button'; 535 var VERSION$1 = '4.3.1'; 536 var DATA_KEY$1 = 'bs.button'; 537 var EVENT_KEY$1 = "." + DATA_KEY$1; 538 var DATA_API_KEY$1 = '.data-api'; 539 var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1]; 540 var ClassName$1 = { 541 ACTIVE: 'active', 542 BUTTON: 'btn', 543 FOCUS: 'focus' 544 }; 545 var Selector$1 = { 546 DATA_TOGGLE_CARROT: '[data-toggle^="button"]', 547 DATA_TOGGLE: '[data-toggle="buttons"]', 548 INPUT: 'input:not([type="hidden"])', 549 ACTIVE: '.active', 550 BUTTON: '.btn' 551 }; 552 var Event$1 = { 553 CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1, 554 FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1) 555 /** 556 * ------------------------------------------------------------------------ 557 * Class Definition 558 * ------------------------------------------------------------------------ 559 */ 560 561 }; 562 563 var Button = 564 /*#__PURE__*/ 565 function () { 566 function Button(element) { 567 this._element = element; 568 } // Getters 569 570 571 var _proto = Button.prototype; 572 573 // Public 574 _proto.toggle = function toggle() { 575 var triggerChangeEvent = true; 576 var addAriaPressed = true; 577 var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0]; 578 579 if (rootElement) { 580 var input = this._element.querySelector(Selector$1.INPUT); 581 582 if (input) { 583 if (input.type === 'radio') { 584 if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) { 585 triggerChangeEvent = false; 586 } else { 587 var activeElement = rootElement.querySelector(Selector$1.ACTIVE); 588 589 if (activeElement) { 590 $(activeElement).removeClass(ClassName$1.ACTIVE); 591 } 592 } 593 } 594 595 if (triggerChangeEvent) { 596 if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) { 597 return; 598 } 599 600 input.checked = !this._element.classList.contains(ClassName$1.ACTIVE); 601 $(input).trigger('change'); 602 } 603 604 input.focus(); 605 addAriaPressed = false; 606 } 607 } 608 609 if (addAriaPressed) { 610 this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE)); 611 } 612 613 if (triggerChangeEvent) { 614 $(this._element).toggleClass(ClassName$1.ACTIVE); 615 } 616 }; 617 618 _proto.dispose = function dispose() { 619 $.removeData(this._element, DATA_KEY$1); 620 this._element = null; 621 } // Static 622 ; 623 624 Button._jQueryInterface = function _jQueryInterface(config) { 625 return this.each(function () { 626 var data = $(this).data(DATA_KEY$1); 627 628 if (!data) { 629 data = new Button(this); 630 $(this).data(DATA_KEY$1, data); 631 } 632 633 if (config === 'toggle') { 634 data[config](); 635 } 636 }); 637 }; 638 639 _createClass(Button, null, [{ 640 key: "VERSION", 641 get: function get() { 642 return VERSION$1; 643 } 644 }]); 645 646 return Button; 647 }(); 648 /** 649 * ------------------------------------------------------------------------ 650 * Data Api implementation 651 * ------------------------------------------------------------------------ 652 */ 653 654 655 $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) { 656 event.preventDefault(); 657 var button = event.target; 658 659 if (!$(button).hasClass(ClassName$1.BUTTON)) { 660 button = $(button).closest(Selector$1.BUTTON); 661 } 662 663 Button._jQueryInterface.call($(button), 'toggle'); 664 }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) { 665 var button = $(event.target).closest(Selector$1.BUTTON)[0]; 666 $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type)); 667 }); 668 /** 669 * ------------------------------------------------------------------------ 670 * jQuery 671 * ------------------------------------------------------------------------ 672 */ 673 674 $.fn[NAME$1] = Button._jQueryInterface; 675 $.fn[NAME$1].Constructor = Button; 676 677 $.fn[NAME$1].noConflict = function () { 678 $.fn[NAME$1] = JQUERY_NO_CONFLICT$1; 679 return Button._jQueryInterface; 680 }; 681 682 /** 683 * ------------------------------------------------------------------------ 684 * Constants 685 * ------------------------------------------------------------------------ 686 */ 687 688 var NAME$2 = 'carousel'; 689 var VERSION$2 = '4.3.1'; 690 var DATA_KEY$2 = 'bs.carousel'; 691 var EVENT_KEY$2 = "." + DATA_KEY$2; 692 var DATA_API_KEY$2 = '.data-api'; 693 var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2]; 694 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 695 696 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 697 698 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 699 700 var SWIPE_THRESHOLD = 40; 701 var Default = { 702 interval: 5000, 703 keyboard: true, 704 slide: false, 705 pause: 'hover', 706 wrap: true, 707 touch: true 708 }; 709 var DefaultType = { 710 interval: '(number|boolean)', 711 keyboard: 'boolean', 712 slide: '(boolean|string)', 713 pause: '(string|boolean)', 714 wrap: 'boolean', 715 touch: 'boolean' 716 }; 717 var Direction = { 718 NEXT: 'next', 719 PREV: 'prev', 720 LEFT: 'left', 721 RIGHT: 'right' 722 }; 723 var Event$2 = { 724 SLIDE: "slide" + EVENT_KEY$2, 725 SLID: "slid" + EVENT_KEY$2, 726 KEYDOWN: "keydown" + EVENT_KEY$2, 727 MOUSEENTER: "mouseenter" + EVENT_KEY$2, 728 MOUSELEAVE: "mouseleave" + EVENT_KEY$2, 729 TOUCHSTART: "touchstart" + EVENT_KEY$2, 730 TOUCHMOVE: "touchmove" + EVENT_KEY$2, 731 TOUCHEND: "touchend" + EVENT_KEY$2, 732 POINTERDOWN: "pointerdown" + EVENT_KEY$2, 733 POINTERUP: "pointerup" + EVENT_KEY$2, 734 DRAG_START: "dragstart" + EVENT_KEY$2, 735 LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2, 736 CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2 737 }; 738 var ClassName$2 = { 739 CAROUSEL: 'carousel', 740 ACTIVE: 'active', 741 SLIDE: 'slide', 742 RIGHT: 'carousel-item-right', 743 LEFT: 'carousel-item-left', 744 NEXT: 'carousel-item-next', 745 PREV: 'carousel-item-prev', 746 ITEM: 'carousel-item', 747 POINTER_EVENT: 'pointer-event' 748 }; 749 var Selector$2 = { 750 ACTIVE: '.active', 751 ACTIVE_ITEM: '.active.carousel-item', 752 ITEM: '.carousel-item', 753 ITEM_IMG: '.carousel-item img', 754 NEXT_PREV: '.carousel-item-next, .carousel-item-prev', 755 INDICATORS: '.carousel-indicators', 756 DATA_SLIDE: '[data-slide], [data-slide-to]', 757 DATA_RIDE: '[data-ride="carousel"]' 758 }; 759 var PointerType = { 760 TOUCH: 'touch', 761 PEN: 'pen' 762 /** 763 * ------------------------------------------------------------------------ 764 * Class Definition 765 * ------------------------------------------------------------------------ 766 */ 767 768 }; 769 770 var Carousel = 771 /*#__PURE__*/ 772 function () { 773 function Carousel(element, config) { 774 this._items = null; 775 this._interval = null; 776 this._activeElement = null; 777 this._isPaused = false; 778 this._isSliding = false; 779 this.touchTimeout = null; 780 this.touchStartX = 0; 781 this.touchDeltaX = 0; 782 this._config = this._getConfig(config); 783 this._element = element; 784 this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS); 785 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 786 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 787 788 this._addEventListeners(); 789 } // Getters 790 791 792 var _proto = Carousel.prototype; 793 794 // Public 795 _proto.next = function next() { 796 if (!this._isSliding) { 797 this._slide(Direction.NEXT); 798 } 799 }; 800 801 _proto.nextWhenVisible = function nextWhenVisible() { 802 // Don't call next when the page isn't visible 803 // or the carousel or its parent isn't visible 804 if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') { 805 this.next(); 806 } 807 }; 808 809 _proto.prev = function prev() { 810 if (!this._isSliding) { 811 this._slide(Direction.PREV); 812 } 813 }; 814 815 _proto.pause = function pause(event) { 816 if (!event) { 817 this._isPaused = true; 818 } 819 820 if (this._element.querySelector(Selector$2.NEXT_PREV)) { 821 Util.triggerTransitionEnd(this._element); 822 this.cycle(true); 823 } 824 825 clearInterval(this._interval); 826 this._interval = null; 827 }; 828 829 _proto.cycle = function cycle(event) { 830 if (!event) { 831 this._isPaused = false; 832 } 833 834 if (this._interval) { 835 clearInterval(this._interval); 836 this._interval = null; 837 } 838 839 if (this._config.interval && !this._isPaused) { 840 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 841 } 842 }; 843 844 _proto.to = function to(index) { 845 var _this = this; 846 847 this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM); 848 849 var activeIndex = this._getItemIndex(this._activeElement); 850 851 if (index > this._items.length - 1 || index < 0) { 852 return; 853 } 854 855 if (this._isSliding) { 856 $(this._element).one(Event$2.SLID, function () { 857 return _this.to(index); 858 }); 859 return; 860 } 861 862 if (activeIndex === index) { 863 this.pause(); 864 this.cycle(); 865 return; 866 } 867 868 var direction = index > activeIndex ? Direction.NEXT : Direction.PREV; 869 870 this._slide(direction, this._items[index]); 871 }; 872 873 _proto.dispose = function dispose() { 874 $(this._element).off(EVENT_KEY$2); 875 $.removeData(this._element, DATA_KEY$2); 876 this._items = null; 877 this._config = null; 878 this._element = null; 879 this._interval = null; 880 this._isPaused = null; 881 this._isSliding = null; 882 this._activeElement = null; 883 this._indicatorsElement = null; 884 } // Private 885 ; 886 887 _proto._getConfig = function _getConfig(config) { 888 config = _objectSpread({}, Default, config); 889 Util.typeCheckConfig(NAME$2, config, DefaultType); 890 return config; 891 }; 892 893 _proto._handleSwipe = function _handleSwipe() { 894 var absDeltax = Math.abs(this.touchDeltaX); 895 896 if (absDeltax <= SWIPE_THRESHOLD) { 897 return; 898 } 899 900 var direction = absDeltax / this.touchDeltaX; // swipe left 901 902 if (direction > 0) { 903 this.prev(); 904 } // swipe right 905 906 907 if (direction < 0) { 908 this.next(); 909 } 910 }; 911 912 _proto._addEventListeners = function _addEventListeners() { 913 var _this2 = this; 914 915 if (this._config.keyboard) { 916 $(this._element).on(Event$2.KEYDOWN, function (event) { 917 return _this2._keydown(event); 918 }); 919 } 920 921 if (this._config.pause === 'hover') { 922 $(this._element).on(Event$2.MOUSEENTER, function (event) { 923 return _this2.pause(event); 924 }).on(Event$2.MOUSELEAVE, function (event) { 925 return _this2.cycle(event); 926 }); 927 } 928 929 if (this._config.touch) { 930 this._addTouchEventListeners(); 931 } 932 }; 933 934 _proto._addTouchEventListeners = function _addTouchEventListeners() { 935 var _this3 = this; 936 937 if (!this._touchSupported) { 938 return; 939 } 940 941 var start = function start(event) { 942 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 943 _this3.touchStartX = event.originalEvent.clientX; 944 } else if (!_this3._pointerEvent) { 945 _this3.touchStartX = event.originalEvent.touches[0].clientX; 946 } 947 }; 948 949 var move = function move(event) { 950 // ensure swiping with one touch and not pinching 951 if (event.originalEvent.touches && event.originalEvent.touches.length > 1) { 952 _this3.touchDeltaX = 0; 953 } else { 954 _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX; 955 } 956 }; 957 958 var end = function end(event) { 959 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 960 _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; 961 } 962 963 _this3._handleSwipe(); 964 965 if (_this3._config.pause === 'hover') { 966 // If it's a touch-enabled device, mouseenter/leave are fired as 967 // part of the mouse compatibility events on first tap - the carousel 968 // would stop cycling until user tapped out of it; 969 // here, we listen for touchend, explicitly pause the carousel 970 // (as if it's the second time we tap on it, mouseenter compat event 971 // is NOT fired) and after a timeout (to allow for mouse compatibility 972 // events to fire) we explicitly restart cycling 973 _this3.pause(); 974 975 if (_this3.touchTimeout) { 976 clearTimeout(_this3.touchTimeout); 977 } 978 979 _this3.touchTimeout = setTimeout(function (event) { 980 return _this3.cycle(event); 981 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 982 } 983 }; 984 985 $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) { 986 return e.preventDefault(); 987 }); 988 989 if (this._pointerEvent) { 990 $(this._element).on(Event$2.POINTERDOWN, function (event) { 991 return start(event); 992 }); 993 $(this._element).on(Event$2.POINTERUP, function (event) { 994 return end(event); 995 }); 996 997 this._element.classList.add(ClassName$2.POINTER_EVENT); 998 } else { 999 $(this._element).on(Event$2.TOUCHSTART, function (event) { 1000 return start(event); 1001 }); 1002 $(this._element).on(Event$2.TOUCHMOVE, function (event) { 1003 return move(event); 1004 }); 1005 $(this._element).on(Event$2.TOUCHEND, function (event) { 1006 return end(event); 1007 }); 1008 } 1009 }; 1010 1011 _proto._keydown = function _keydown(event) { 1012 if (/input|textarea/i.test(event.target.tagName)) { 1013 return; 1014 } 1015 1016 switch (event.which) { 1017 case ARROW_LEFT_KEYCODE: 1018 event.preventDefault(); 1019 this.prev(); 1020 break; 1021 1022 case ARROW_RIGHT_KEYCODE: 1023 event.preventDefault(); 1024 this.next(); 1025 break; 1026 1027 default: 1028 } 1029 }; 1030 1031 _proto._getItemIndex = function _getItemIndex(element) { 1032 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : []; 1033 return this._items.indexOf(element); 1034 }; 1035 1036 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { 1037 var isNextDirection = direction === Direction.NEXT; 1038 var isPrevDirection = direction === Direction.PREV; 1039 1040 var activeIndex = this._getItemIndex(activeElement); 1041 1042 var lastItemIndex = this._items.length - 1; 1043 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 1044 1045 if (isGoingToWrap && !this._config.wrap) { 1046 return activeElement; 1047 } 1048 1049 var delta = direction === Direction.PREV ? -1 : 1; 1050 var itemIndex = (activeIndex + delta) % this._items.length; 1051 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 1052 }; 1053 1054 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { 1055 var targetIndex = this._getItemIndex(relatedTarget); 1056 1057 var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM)); 1058 1059 var slideEvent = $.Event(Event$2.SLIDE, { 1060 relatedTarget: relatedTarget, 1061 direction: eventDirectionName, 1062 from: fromIndex, 1063 to: targetIndex 1064 }); 1065 $(this._element).trigger(slideEvent); 1066 return slideEvent; 1067 }; 1068 1069 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { 1070 if (this._indicatorsElement) { 1071 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE)); 1072 $(indicators).removeClass(ClassName$2.ACTIVE); 1073 1074 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 1075 1076 if (nextIndicator) { 1077 $(nextIndicator).addClass(ClassName$2.ACTIVE); 1078 } 1079 } 1080 }; 1081 1082 _proto._slide = function _slide(direction, element) { 1083 var _this4 = this; 1084 1085 var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM); 1086 1087 var activeElementIndex = this._getItemIndex(activeElement); 1088 1089 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 1090 1091 var nextElementIndex = this._getItemIndex(nextElement); 1092 1093 var isCycling = Boolean(this._interval); 1094 var directionalClassName; 1095 var orderClassName; 1096 var eventDirectionName; 1097 1098 if (direction === Direction.NEXT) { 1099 directionalClassName = ClassName$2.LEFT; 1100 orderClassName = ClassName$2.NEXT; 1101 eventDirectionName = Direction.LEFT; 1102 } else { 1103 directionalClassName = ClassName$2.RIGHT; 1104 orderClassName = ClassName$2.PREV; 1105 eventDirectionName = Direction.RIGHT; 1106 } 1107 1108 if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) { 1109 this._isSliding = false; 1110 return; 1111 } 1112 1113 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 1114 1115 if (slideEvent.isDefaultPrevented()) { 1116 return; 1117 } 1118 1119 if (!activeElement || !nextElement) { 1120 // Some weirdness is happening, so we bail 1121 return; 1122 } 1123 1124 this._isSliding = true; 1125 1126 if (isCycling) { 1127 this.pause(); 1128 } 1129 1130 this._setActiveIndicatorElement(nextElement); 1131 1132 var slidEvent = $.Event(Event$2.SLID, { 1133 relatedTarget: nextElement, 1134 direction: eventDirectionName, 1135 from: activeElementIndex, 1136 to: nextElementIndex 1137 }); 1138 1139 if ($(this._element).hasClass(ClassName$2.SLIDE)) { 1140 $(nextElement).addClass(orderClassName); 1141 Util.reflow(nextElement); 1142 $(activeElement).addClass(directionalClassName); 1143 $(nextElement).addClass(directionalClassName); 1144 var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10); 1145 1146 if (nextElementInterval) { 1147 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 1148 this._config.interval = nextElementInterval; 1149 } else { 1150 this._config.interval = this._config.defaultInterval || this._config.interval; 1151 } 1152 1153 var transitionDuration = Util.getTransitionDurationFromElement(activeElement); 1154 $(activeElement).one(Util.TRANSITION_END, function () { 1155 $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE); 1156 $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName); 1157 _this4._isSliding = false; 1158 setTimeout(function () { 1159 return $(_this4._element).trigger(slidEvent); 1160 }, 0); 1161 }).emulateTransitionEnd(transitionDuration); 1162 } else { 1163 $(activeElement).removeClass(ClassName$2.ACTIVE); 1164 $(nextElement).addClass(ClassName$2.ACTIVE); 1165 this._isSliding = false; 1166 $(this._element).trigger(slidEvent); 1167 } 1168 1169 if (isCycling) { 1170 this.cycle(); 1171 } 1172 } // Static 1173 ; 1174 1175 Carousel._jQueryInterface = function _jQueryInterface(config) { 1176 return this.each(function () { 1177 var data = $(this).data(DATA_KEY$2); 1178 1179 var _config = _objectSpread({}, Default, $(this).data()); 1180 1181 if (typeof config === 'object') { 1182 _config = _objectSpread({}, _config, config); 1183 } 1184 1185 var action = typeof config === 'string' ? config : _config.slide; 1186 1187 if (!data) { 1188 data = new Carousel(this, _config); 1189 $(this).data(DATA_KEY$2, data); 1190 } 1191 1192 if (typeof config === 'number') { 1193 data.to(config); 1194 } else if (typeof action === 'string') { 1195 if (typeof data[action] === 'undefined') { 1196 throw new TypeError("No method named \"" + action + "\""); 1197 } 1198 1199 data[action](); 1200 } else if (_config.interval && _config.ride) { 1201 data.pause(); 1202 data.cycle(); 1203 } 1204 }); 1205 }; 1206 1207 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { 1208 var selector = Util.getSelectorFromElement(this); 1209 1210 if (!selector) { 1211 return; 1212 } 1213 1214 var target = $(selector)[0]; 1215 1216 if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) { 1217 return; 1218 } 1219 1220 var config = _objectSpread({}, $(target).data(), $(this).data()); 1221 1222 var slideIndex = this.getAttribute('data-slide-to'); 1223 1224 if (slideIndex) { 1225 config.interval = false; 1226 } 1227 1228 Carousel._jQueryInterface.call($(target), config); 1229 1230 if (slideIndex) { 1231 $(target).data(DATA_KEY$2).to(slideIndex); 1232 } 1233 1234 event.preventDefault(); 1235 }; 1236 1237 _createClass(Carousel, null, [{ 1238 key: "VERSION", 1239 get: function get() { 1240 return VERSION$2; 1241 } 1242 }, { 1243 key: "Default", 1244 get: function get() { 1245 return Default; 1246 } 1247 }]); 1248 1249 return Carousel; 1250 }(); 1251 /** 1252 * ------------------------------------------------------------------------ 1253 * Data Api implementation 1254 * ------------------------------------------------------------------------ 1255 */ 1256 1257 1258 $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler); 1259 $(window).on(Event$2.LOAD_DATA_API, function () { 1260 var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE)); 1261 1262 for (var i = 0, len = carousels.length; i < len; i++) { 1263 var $carousel = $(carousels[i]); 1264 1265 Carousel._jQueryInterface.call($carousel, $carousel.data()); 1266 } 1267 }); 1268 /** 1269 * ------------------------------------------------------------------------ 1270 * jQuery 1271 * ------------------------------------------------------------------------ 1272 */ 1273 1274 $.fn[NAME$2] = Carousel._jQueryInterface; 1275 $.fn[NAME$2].Constructor = Carousel; 1276 1277 $.fn[NAME$2].noConflict = function () { 1278 $.fn[NAME$2] = JQUERY_NO_CONFLICT$2; 1279 return Carousel._jQueryInterface; 1280 }; 1281 1282 /** 1283 * ------------------------------------------------------------------------ 1284 * Constants 1285 * ------------------------------------------------------------------------ 1286 */ 1287 1288 var NAME$3 = 'collapse'; 1289 var VERSION$3 = '4.3.1'; 1290 var DATA_KEY$3 = 'bs.collapse'; 1291 var EVENT_KEY$3 = "." + DATA_KEY$3; 1292 var DATA_API_KEY$3 = '.data-api'; 1293 var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3]; 1294 var Default$1 = { 1295 toggle: true, 1296 parent: '' 1297 }; 1298 var DefaultType$1 = { 1299 toggle: 'boolean', 1300 parent: '(string|element)' 1301 }; 1302 var Event$3 = { 1303 SHOW: "show" + EVENT_KEY$3, 1304 SHOWN: "shown" + EVENT_KEY$3, 1305 HIDE: "hide" + EVENT_KEY$3, 1306 HIDDEN: "hidden" + EVENT_KEY$3, 1307 CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3 1308 }; 1309 var ClassName$3 = { 1310 SHOW: 'show', 1311 COLLAPSE: 'collapse', 1312 COLLAPSING: 'collapsing', 1313 COLLAPSED: 'collapsed' 1314 }; 1315 var Dimension = { 1316 WIDTH: 'width', 1317 HEIGHT: 'height' 1318 }; 1319 var Selector$3 = { 1320 ACTIVES: '.show, .collapsing', 1321 DATA_TOGGLE: '[data-toggle="collapse"]' 1322 /** 1323 * ------------------------------------------------------------------------ 1324 * Class Definition 1325 * ------------------------------------------------------------------------ 1326 */ 1327 1328 }; 1329 1330 var Collapse = 1331 /*#__PURE__*/ 1332 function () { 1333 function Collapse(element, config) { 1334 this._isTransitioning = false; 1335 this._element = element; 1336 this._config = this._getConfig(config); 1337 this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); 1338 var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE)); 1339 1340 for (var i = 0, len = toggleList.length; i < len; i++) { 1341 var elem = toggleList[i]; 1342 var selector = Util.getSelectorFromElement(elem); 1343 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { 1344 return foundElem === element; 1345 }); 1346 1347 if (selector !== null && filterElement.length > 0) { 1348 this._selector = selector; 1349 1350 this._triggerArray.push(elem); 1351 } 1352 } 1353 1354 this._parent = this._config.parent ? this._getParent() : null; 1355 1356 if (!this._config.parent) { 1357 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 1358 } 1359 1360 if (this._config.toggle) { 1361 this.toggle(); 1362 } 1363 } // Getters 1364 1365 1366 var _proto = Collapse.prototype; 1367 1368 // Public 1369 _proto.toggle = function toggle() { 1370 if ($(this._element).hasClass(ClassName$3.SHOW)) { 1371 this.hide(); 1372 } else { 1373 this.show(); 1374 } 1375 }; 1376 1377 _proto.show = function show() { 1378 var _this = this; 1379 1380 if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) { 1381 return; 1382 } 1383 1384 var actives; 1385 var activesData; 1386 1387 if (this._parent) { 1388 actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) { 1389 if (typeof _this._config.parent === 'string') { 1390 return elem.getAttribute('data-parent') === _this._config.parent; 1391 } 1392 1393 return elem.classList.contains(ClassName$3.COLLAPSE); 1394 }); 1395 1396 if (actives.length === 0) { 1397 actives = null; 1398 } 1399 } 1400 1401 if (actives) { 1402 activesData = $(actives).not(this._selector).data(DATA_KEY$3); 1403 1404 if (activesData && activesData._isTransitioning) { 1405 return; 1406 } 1407 } 1408 1409 var startEvent = $.Event(Event$3.SHOW); 1410 $(this._element).trigger(startEvent); 1411 1412 if (startEvent.isDefaultPrevented()) { 1413 return; 1414 } 1415 1416 if (actives) { 1417 Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide'); 1418 1419 if (!activesData) { 1420 $(actives).data(DATA_KEY$3, null); 1421 } 1422 } 1423 1424 var dimension = this._getDimension(); 1425 1426 $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING); 1427 this._element.style[dimension] = 0; 1428 1429 if (this._triggerArray.length) { 1430 $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true); 1431 } 1432 1433 this.setTransitioning(true); 1434 1435 var complete = function complete() { 1436 $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW); 1437 _this._element.style[dimension] = ''; 1438 1439 _this.setTransitioning(false); 1440 1441 $(_this._element).trigger(Event$3.SHOWN); 1442 }; 1443 1444 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 1445 var scrollSize = "scroll" + capitalizedDimension; 1446 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 1447 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 1448 this._element.style[dimension] = this._element[scrollSize] + "px"; 1449 }; 1450 1451 _proto.hide = function hide() { 1452 var _this2 = this; 1453 1454 if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) { 1455 return; 1456 } 1457 1458 var startEvent = $.Event(Event$3.HIDE); 1459 $(this._element).trigger(startEvent); 1460 1461 if (startEvent.isDefaultPrevented()) { 1462 return; 1463 } 1464 1465 var dimension = this._getDimension(); 1466 1467 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; 1468 Util.reflow(this._element); 1469 $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW); 1470 var triggerArrayLength = this._triggerArray.length; 1471 1472 if (triggerArrayLength > 0) { 1473 for (var i = 0; i < triggerArrayLength; i++) { 1474 var trigger = this._triggerArray[i]; 1475 var selector = Util.getSelectorFromElement(trigger); 1476 1477 if (selector !== null) { 1478 var $elem = $([].slice.call(document.querySelectorAll(selector))); 1479 1480 if (!$elem.hasClass(ClassName$3.SHOW)) { 1481 $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false); 1482 } 1483 } 1484 } 1485 } 1486 1487 this.setTransitioning(true); 1488 1489 var complete = function complete() { 1490 _this2.setTransitioning(false); 1491 1492 $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN); 1493 }; 1494 1495 this._element.style[dimension] = ''; 1496 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 1497 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 1498 }; 1499 1500 _proto.setTransitioning = function setTransitioning(isTransitioning) { 1501 this._isTransitioning = isTransitioning; 1502 }; 1503 1504 _proto.dispose = function dispose() { 1505 $.removeData(this._element, DATA_KEY$3); 1506 this._config = null; 1507 this._parent = null; 1508 this._element = null; 1509 this._triggerArray = null; 1510 this._isTransitioning = null; 1511 } // Private 1512 ; 1513 1514 _proto._getConfig = function _getConfig(config) { 1515 config = _objectSpread({}, Default$1, config); 1516 config.toggle = Boolean(config.toggle); // Coerce string values 1517 1518 Util.typeCheckConfig(NAME$3, config, DefaultType$1); 1519 return config; 1520 }; 1521 1522 _proto._getDimension = function _getDimension() { 1523 var hasWidth = $(this._element).hasClass(Dimension.WIDTH); 1524 return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; 1525 }; 1526 1527 _proto._getParent = function _getParent() { 1528 var _this3 = this; 1529 1530 var parent; 1531 1532 if (Util.isElement(this._config.parent)) { 1533 parent = this._config.parent; // It's a jQuery object 1534 1535 if (typeof this._config.parent.jquery !== 'undefined') { 1536 parent = this._config.parent[0]; 1537 } 1538 } else { 1539 parent = document.querySelector(this._config.parent); 1540 } 1541 1542 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; 1543 var children = [].slice.call(parent.querySelectorAll(selector)); 1544 $(children).each(function (i, element) { 1545 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); 1546 }); 1547 return parent; 1548 }; 1549 1550 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { 1551 var isOpen = $(element).hasClass(ClassName$3.SHOW); 1552 1553 if (triggerArray.length) { 1554 $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); 1555 } 1556 } // Static 1557 ; 1558 1559 Collapse._getTargetFromElement = function _getTargetFromElement(element) { 1560 var selector = Util.getSelectorFromElement(element); 1561 return selector ? document.querySelector(selector) : null; 1562 }; 1563 1564 Collapse._jQueryInterface = function _jQueryInterface(config) { 1565 return this.each(function () { 1566 var $this = $(this); 1567 var data = $this.data(DATA_KEY$3); 1568 1569 var _config = _objectSpread({}, Default$1, $this.data(), typeof config === 'object' && config ? config : {}); 1570 1571 if (!data && _config.toggle && /show|hide/.test(config)) { 1572 _config.toggle = false; 1573 } 1574 1575 if (!data) { 1576 data = new Collapse(this, _config); 1577 $this.data(DATA_KEY$3, data); 1578 } 1579 1580 if (typeof config === 'string') { 1581 if (typeof data[config] === 'undefined') { 1582 throw new TypeError("No method named \"" + config + "\""); 1583 } 1584 1585 data[config](); 1586 } 1587 }); 1588 }; 1589 1590 _createClass(Collapse, null, [{ 1591 key: "VERSION", 1592 get: function get() { 1593 return VERSION$3; 1594 } 1595 }, { 1596 key: "Default", 1597 get: function get() { 1598 return Default$1; 1599 } 1600 }]); 1601 1602 return Collapse; 1603 }(); 1604 /** 1605 * ------------------------------------------------------------------------ 1606 * Data Api implementation 1607 * ------------------------------------------------------------------------ 1608 */ 1609 1610 1611 $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) { 1612 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 1613 if (event.currentTarget.tagName === 'A') { 1614 event.preventDefault(); 1615 } 1616 1617 var $trigger = $(this); 1618 var selector = Util.getSelectorFromElement(this); 1619 var selectors = [].slice.call(document.querySelectorAll(selector)); 1620 $(selectors).each(function () { 1621 var $target = $(this); 1622 var data = $target.data(DATA_KEY$3); 1623 var config = data ? 'toggle' : $trigger.data(); 1624 1625 Collapse._jQueryInterface.call($target, config); 1626 }); 1627 }); 1628 /** 1629 * ------------------------------------------------------------------------ 1630 * jQuery 1631 * ------------------------------------------------------------------------ 1632 */ 1633 1634 $.fn[NAME$3] = Collapse._jQueryInterface; 1635 $.fn[NAME$3].Constructor = Collapse; 1636 1637 $.fn[NAME$3].noConflict = function () { 1638 $.fn[NAME$3] = JQUERY_NO_CONFLICT$3; 1639 return Collapse._jQueryInterface; 1640 }; 1641 1642 /** 1643 * ------------------------------------------------------------------------ 1644 * Constants 1645 * ------------------------------------------------------------------------ 1646 */ 1647 1648 var NAME$4 = 'dropdown'; 1649 var VERSION$4 = '4.3.1'; 1650 var DATA_KEY$4 = 'bs.dropdown'; 1651 var EVENT_KEY$4 = "." + DATA_KEY$4; 1652 var DATA_API_KEY$4 = '.data-api'; 1653 var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4]; 1654 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 1655 1656 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key 1657 1658 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key 1659 1660 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key 1661 1662 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key 1663 1664 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) 1665 1666 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE); 1667 var Event$4 = { 1668 HIDE: "hide" + EVENT_KEY$4, 1669 HIDDEN: "hidden" + EVENT_KEY$4, 1670 SHOW: "show" + EVENT_KEY$4, 1671 SHOWN: "shown" + EVENT_KEY$4, 1672 CLICK: "click" + EVENT_KEY$4, 1673 CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4, 1674 KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4, 1675 KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4 1676 }; 1677 var ClassName$4 = { 1678 DISABLED: 'disabled', 1679 SHOW: 'show', 1680 DROPUP: 'dropup', 1681 DROPRIGHT: 'dropright', 1682 DROPLEFT: 'dropleft', 1683 MENURIGHT: 'dropdown-menu-right', 1684 MENULEFT: 'dropdown-menu-left', 1685 POSITION_STATIC: 'position-static' 1686 }; 1687 var Selector$4 = { 1688 DATA_TOGGLE: '[data-toggle="dropdown"]', 1689 FORM_CHILD: '.dropdown form', 1690 MENU: '.dropdown-menu', 1691 NAVBAR_NAV: '.navbar-nav', 1692 VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)' 1693 }; 1694 var AttachmentMap = { 1695 TOP: 'top-start', 1696 TOPEND: 'top-end', 1697 BOTTOM: 'bottom-start', 1698 BOTTOMEND: 'bottom-end', 1699 RIGHT: 'right-start', 1700 RIGHTEND: 'right-end', 1701 LEFT: 'left-start', 1702 LEFTEND: 'left-end' 1703 }; 1704 var Default$2 = { 1705 offset: 0, 1706 flip: true, 1707 boundary: 'scrollParent', 1708 reference: 'toggle', 1709 display: 'dynamic' 1710 }; 1711 var DefaultType$2 = { 1712 offset: '(number|string|function)', 1713 flip: 'boolean', 1714 boundary: '(string|element)', 1715 reference: '(string|element)', 1716 display: 'string' 1717 /** 1718 * ------------------------------------------------------------------------ 1719 * Class Definition 1720 * ------------------------------------------------------------------------ 1721 */ 1722 1723 }; 1724 1725 var Dropdown = 1726 /*#__PURE__*/ 1727 function () { 1728 function Dropdown(element, config) { 1729 this._element = element; 1730 this._popper = null; 1731 this._config = this._getConfig(config); 1732 this._menu = this._getMenuElement(); 1733 this._inNavbar = this._detectNavbar(); 1734 1735 this._addEventListeners(); 1736 } // Getters 1737 1738 1739 var _proto = Dropdown.prototype; 1740 1741 // Public 1742 _proto.toggle = function toggle() { 1743 if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) { 1744 return; 1745 } 1746 1747 var parent = Dropdown._getParentFromElement(this._element); 1748 1749 var isActive = $(this._menu).hasClass(ClassName$4.SHOW); 1750 1751 Dropdown._clearMenus(); 1752 1753 if (isActive) { 1754 return; 1755 } 1756 1757 var relatedTarget = { 1758 relatedTarget: this._element 1759 }; 1760 var showEvent = $.Event(Event$4.SHOW, relatedTarget); 1761 $(parent).trigger(showEvent); 1762 1763 if (showEvent.isDefaultPrevented()) { 1764 return; 1765 } // Disable totally Popper.js for Dropdown in Navbar 1766 1767 1768 if (!this._inNavbar) { 1769 /** 1770 * Check for Popper dependency 1771 * Popper - https://popper.js.org 1772 */ 1773 if (typeof Popper === 'undefined') { 1774 throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)'); 1775 } 1776 1777 var referenceElement = this._element; 1778 1779 if (this._config.reference === 'parent') { 1780 referenceElement = parent; 1781 } else if (Util.isElement(this._config.reference)) { 1782 referenceElement = this._config.reference; // Check if it's jQuery element 1783 1784 if (typeof this._config.reference.jquery !== 'undefined') { 1785 referenceElement = this._config.reference[0]; 1786 } 1787 } // If boundary is not `scrollParent`, then set position to `static` 1788 // to allow the menu to "escape" the scroll parent's boundaries 1789 // https://github.com/twbs/bootstrap/issues/24251 1790 1791 1792 if (this._config.boundary !== 'scrollParent') { 1793 $(parent).addClass(ClassName$4.POSITION_STATIC); 1794 } 1795 1796 this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig()); 1797 } // If this is a touch-enabled device we add extra 1798 // empty mouseover listeners to the body's immediate children; 1799 // only needed because of broken event delegation on iOS 1800 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 1801 1802 1803 if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) { 1804 $(document.body).children().on('mouseover', null, $.noop); 1805 } 1806 1807 this._element.focus(); 1808 1809 this._element.setAttribute('aria-expanded', true); 1810 1811 $(this._menu).toggleClass(ClassName$4.SHOW); 1812 $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget)); 1813 }; 1814 1815 _proto.show = function show() { 1816 if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) { 1817 return; 1818 } 1819 1820 var relatedTarget = { 1821 relatedTarget: this._element 1822 }; 1823 var showEvent = $.Event(Event$4.SHOW, relatedTarget); 1824 1825 var parent = Dropdown._getParentFromElement(this._element); 1826 1827 $(parent).trigger(showEvent); 1828 1829 if (showEvent.isDefaultPrevented()) { 1830 return; 1831 } 1832 1833 $(this._menu).toggleClass(ClassName$4.SHOW); 1834 $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget)); 1835 }; 1836 1837 _proto.hide = function hide() { 1838 if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) { 1839 return; 1840 } 1841 1842 var relatedTarget = { 1843 relatedTarget: this._element 1844 }; 1845 var hideEvent = $.Event(Event$4.HIDE, relatedTarget); 1846 1847 var parent = Dropdown._getParentFromElement(this._element); 1848 1849 $(parent).trigger(hideEvent); 1850 1851 if (hideEvent.isDefaultPrevented()) { 1852 return; 1853 } 1854 1855 $(this._menu).toggleClass(ClassName$4.SHOW); 1856 $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget)); 1857 }; 1858 1859 _proto.dispose = function dispose() { 1860 $.removeData(this._element, DATA_KEY$4); 1861 $(this._element).off(EVENT_KEY$4); 1862 this._element = null; 1863 this._menu = null; 1864 1865 if (this._popper !== null) { 1866 this._popper.destroy(); 1867 1868 this._popper = null; 1869 } 1870 }; 1871 1872 _proto.update = function update() { 1873 this._inNavbar = this._detectNavbar(); 1874 1875 if (this._popper !== null) { 1876 this._popper.scheduleUpdate(); 1877 } 1878 } // Private 1879 ; 1880 1881 _proto._addEventListeners = function _addEventListeners() { 1882 var _this = this; 1883 1884 $(this._element).on(Event$4.CLICK, function (event) { 1885 event.preventDefault(); 1886 event.stopPropagation(); 1887 1888 _this.toggle(); 1889 }); 1890 }; 1891 1892 _proto._getConfig = function _getConfig(config) { 1893 config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config); 1894 Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType); 1895 return config; 1896 }; 1897 1898 _proto._getMenuElement = function _getMenuElement() { 1899 if (!this._menu) { 1900 var parent = Dropdown._getParentFromElement(this._element); 1901 1902 if (parent) { 1903 this._menu = parent.querySelector(Selector$4.MENU); 1904 } 1905 } 1906 1907 return this._menu; 1908 }; 1909 1910 _proto._getPlacement = function _getPlacement() { 1911 var $parentDropdown = $(this._element.parentNode); 1912 var placement = AttachmentMap.BOTTOM; // Handle dropup 1913 1914 if ($parentDropdown.hasClass(ClassName$4.DROPUP)) { 1915 placement = AttachmentMap.TOP; 1916 1917 if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) { 1918 placement = AttachmentMap.TOPEND; 1919 } 1920 } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) { 1921 placement = AttachmentMap.RIGHT; 1922 } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) { 1923 placement = AttachmentMap.LEFT; 1924 } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) { 1925 placement = AttachmentMap.BOTTOMEND; 1926 } 1927 1928 return placement; 1929 }; 1930 1931 _proto._detectNavbar = function _detectNavbar() { 1932 return $(this._element).closest('.navbar').length > 0; 1933 }; 1934 1935 _proto._getOffset = function _getOffset() { 1936 var _this2 = this; 1937 1938 var offset = {}; 1939 1940 if (typeof this._config.offset === 'function') { 1941 offset.fn = function (data) { 1942 data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {}); 1943 return data; 1944 }; 1945 } else { 1946 offset.offset = this._config.offset; 1947 } 1948 1949 return offset; 1950 }; 1951 1952 _proto._getPopperConfig = function _getPopperConfig() { 1953 var popperConfig = { 1954 placement: this._getPlacement(), 1955 modifiers: { 1956 offset: this._getOffset(), 1957 flip: { 1958 enabled: this._config.flip 1959 }, 1960 preventOverflow: { 1961 boundariesElement: this._config.boundary 1962 } 1963 } // Disable Popper.js if we have a static display 1964 1965 }; 1966 1967 if (this._config.display === 'static') { 1968 popperConfig.modifiers.applyStyle = { 1969 enabled: false 1970 }; 1971 } 1972 1973 return popperConfig; 1974 } // Static 1975 ; 1976 1977 Dropdown._jQueryInterface = function _jQueryInterface(config) { 1978 return this.each(function () { 1979 var data = $(this).data(DATA_KEY$4); 1980 1981 var _config = typeof config === 'object' ? config : null; 1982 1983 if (!data) { 1984 data = new Dropdown(this, _config); 1985 $(this).data(DATA_KEY$4, data); 1986 } 1987 1988 if (typeof config === 'string') { 1989 if (typeof data[config] === 'undefined') { 1990 throw new TypeError("No method named \"" + config + "\""); 1991 } 1992 1993 data[config](); 1994 } 1995 }); 1996 }; 1997 1998 Dropdown._clearMenus = function _clearMenus(event) { 1999 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { 2000 return; 2001 } 2002 2003 var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE)); 2004 2005 for (var i = 0, len = toggles.length; i < len; i++) { 2006 var parent = Dropdown._getParentFromElement(toggles[i]); 2007 2008 var context = $(toggles[i]).data(DATA_KEY$4); 2009 var relatedTarget = { 2010 relatedTarget: toggles[i] 2011 }; 2012 2013 if (event && event.type === 'click') { 2014 relatedTarget.clickEvent = event; 2015 } 2016 2017 if (!context) { 2018 continue; 2019 } 2020 2021 var dropdownMenu = context._menu; 2022 2023 if (!$(parent).hasClass(ClassName$4.SHOW)) { 2024 continue; 2025 } 2026 2027 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) { 2028 continue; 2029 } 2030 2031 var hideEvent = $.Event(Event$4.HIDE, relatedTarget); 2032 $(parent).trigger(hideEvent); 2033 2034 if (hideEvent.isDefaultPrevented()) { 2035 continue; 2036 } // If this is a touch-enabled device we remove the extra 2037 // empty mouseover listeners we added for iOS support 2038 2039 2040 if ('ontouchstart' in document.documentElement) { 2041 $(document.body).children().off('mouseover', null, $.noop); 2042 } 2043 2044 toggles[i].setAttribute('aria-expanded', 'false'); 2045 $(dropdownMenu).removeClass(ClassName$4.SHOW); 2046 $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget)); 2047 } 2048 }; 2049 2050 Dropdown._getParentFromElement = function _getParentFromElement(element) { 2051 var parent; 2052 var selector = Util.getSelectorFromElement(element); 2053 2054 if (selector) { 2055 parent = document.querySelector(selector); 2056 } 2057 2058 return parent || element.parentNode; 2059 } // eslint-disable-next-line complexity 2060 ; 2061 2062 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { 2063 // If not input/textarea: 2064 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 2065 // If input/textarea: 2066 // - If space key => not a dropdown command 2067 // - If key is other than escape 2068 // - If key is not up or down => not a dropdown command 2069 // - If trigger inside the menu => not a dropdown command 2070 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector$4.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { 2071 return; 2072 } 2073 2074 event.preventDefault(); 2075 event.stopPropagation(); 2076 2077 if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) { 2078 return; 2079 } 2080 2081 var parent = Dropdown._getParentFromElement(this); 2082 2083 var isActive = $(parent).hasClass(ClassName$4.SHOW); 2084 2085 if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { 2086 if (event.which === ESCAPE_KEYCODE) { 2087 var toggle = parent.querySelector(Selector$4.DATA_TOGGLE); 2088 $(toggle).trigger('focus'); 2089 } 2090 2091 $(this).trigger('click'); 2092 return; 2093 } 2094 2095 var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS)); 2096 2097 if (items.length === 0) { 2098 return; 2099 } 2100 2101 var index = items.indexOf(event.target); 2102 2103 if (event.which === ARROW_UP_KEYCODE && index > 0) { 2104 // Up 2105 index--; 2106 } 2107 2108 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { 2109 // Down 2110 index++; 2111 } 2112 2113 if (index < 0) { 2114 index = 0; 2115 } 2116 2117 items[index].focus(); 2118 }; 2119 2120 _createClass(Dropdown, null, [{ 2121 key: "VERSION", 2122 get: function get() { 2123 return VERSION$4; 2124 } 2125 }, { 2126 key: "Default", 2127 get: function get() { 2128 return Default$2; 2129 } 2130 }, { 2131 key: "DefaultType", 2132 get: function get() { 2133 return DefaultType$2; 2134 } 2135 }]); 2136 2137 return Dropdown; 2138 }(); 2139 /** 2140 * ------------------------------------------------------------------------ 2141 * Data Api implementation 2142 * ------------------------------------------------------------------------ 2143 */ 2144 2145 2146 $(document).on(Event$4.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event$4.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler).on(Event$4.CLICK_DATA_API + " " + Event$4.KEYUP_DATA_API, Dropdown._clearMenus).on(Event$4.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) { 2147 event.preventDefault(); 2148 event.stopPropagation(); 2149 2150 Dropdown._jQueryInterface.call($(this), 'toggle'); 2151 }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) { 2152 e.stopPropagation(); 2153 }); 2154 /** 2155 * ------------------------------------------------------------------------ 2156 * jQuery 2157 * ------------------------------------------------------------------------ 2158 */ 2159 2160 $.fn[NAME$4] = Dropdown._jQueryInterface; 2161 $.fn[NAME$4].Constructor = Dropdown; 2162 2163 $.fn[NAME$4].noConflict = function () { 2164 $.fn[NAME$4] = JQUERY_NO_CONFLICT$4; 2165 return Dropdown._jQueryInterface; 2166 }; 2167 2168 /** 2169 * ------------------------------------------------------------------------ 2170 * Constants 2171 * ------------------------------------------------------------------------ 2172 */ 2173 2174 var NAME$5 = 'modal'; 2175 var VERSION$5 = '4.3.1'; 2176 var DATA_KEY$5 = 'bs.modal'; 2177 var EVENT_KEY$5 = "." + DATA_KEY$5; 2178 var DATA_API_KEY$5 = '.data-api'; 2179 var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5]; 2180 var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key 2181 2182 var Default$3 = { 2183 backdrop: true, 2184 keyboard: true, 2185 focus: true, 2186 show: true 2187 }; 2188 var DefaultType$3 = { 2189 backdrop: '(boolean|string)', 2190 keyboard: 'boolean', 2191 focus: 'boolean', 2192 show: 'boolean' 2193 }; 2194 var Event$5 = { 2195 HIDE: "hide" + EVENT_KEY$5, 2196 HIDDEN: "hidden" + EVENT_KEY$5, 2197 SHOW: "show" + EVENT_KEY$5, 2198 SHOWN: "shown" + EVENT_KEY$5, 2199 FOCUSIN: "focusin" + EVENT_KEY$5, 2200 RESIZE: "resize" + EVENT_KEY$5, 2201 CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5, 2202 KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5, 2203 MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5, 2204 MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5, 2205 CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5 2206 }; 2207 var ClassName$5 = { 2208 SCROLLABLE: 'modal-dialog-scrollable', 2209 SCROLLBAR_MEASURER: 'modal-scrollbar-measure', 2210 BACKDROP: 'modal-backdrop', 2211 OPEN: 'modal-open', 2212 FADE: 'fade', 2213 SHOW: 'show' 2214 }; 2215 var Selector$5 = { 2216 DIALOG: '.modal-dialog', 2217 MODAL_BODY: '.modal-body', 2218 DATA_TOGGLE: '[data-toggle="modal"]', 2219 DATA_DISMISS: '[data-dismiss="modal"]', 2220 FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', 2221 STICKY_CONTENT: '.sticky-top' 2222 /** 2223 * ------------------------------------------------------------------------ 2224 * Class Definition 2225 * ------------------------------------------------------------------------ 2226 */ 2227 2228 }; 2229 2230 var Modal = 2231 /*#__PURE__*/ 2232 function () { 2233 function Modal(element, config) { 2234 this._config = this._getConfig(config); 2235 this._element = element; 2236 this._dialog = element.querySelector(Selector$5.DIALOG); 2237 this._backdrop = null; 2238 this._isShown = false; 2239 this._isBodyOverflowing = false; 2240 this._ignoreBackdropClick = false; 2241 this._isTransitioning = false; 2242 this._scrollbarWidth = 0; 2243 } // Getters 2244 2245 2246 var _proto = Modal.prototype; 2247 2248 // Public 2249 _proto.toggle = function toggle(relatedTarget) { 2250 return this._isShown ? this.hide() : this.show(relatedTarget); 2251 }; 2252 2253 _proto.show = function show(relatedTarget) { 2254 var _this = this; 2255 2256 if (this._isShown || this._isTransitioning) { 2257 return; 2258 } 2259 2260 if ($(this._element).hasClass(ClassName$5.FADE)) { 2261 this._isTransitioning = true; 2262 } 2263 2264 var showEvent = $.Event(Event$5.SHOW, { 2265 relatedTarget: relatedTarget 2266 }); 2267 $(this._element).trigger(showEvent); 2268 2269 if (this._isShown || showEvent.isDefaultPrevented()) { 2270 return; 2271 } 2272 2273 this._isShown = true; 2274 2275 this._checkScrollbar(); 2276 2277 this._setScrollbar(); 2278 2279 this._adjustDialog(); 2280 2281 this._setEscapeEvent(); 2282 2283 this._setResizeEvent(); 2284 2285 $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) { 2286 return _this.hide(event); 2287 }); 2288 $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () { 2289 $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) { 2290 if ($(event.target).is(_this._element)) { 2291 _this._ignoreBackdropClick = true; 2292 } 2293 }); 2294 }); 2295 2296 this._showBackdrop(function () { 2297 return _this._showElement(relatedTarget); 2298 }); 2299 }; 2300 2301 _proto.hide = function hide(event) { 2302 var _this2 = this; 2303 2304 if (event) { 2305 event.preventDefault(); 2306 } 2307 2308 if (!this._isShown || this._isTransitioning) { 2309 return; 2310 } 2311 2312 var hideEvent = $.Event(Event$5.HIDE); 2313 $(this._element).trigger(hideEvent); 2314 2315 if (!this._isShown || hideEvent.isDefaultPrevented()) { 2316 return; 2317 } 2318 2319 this._isShown = false; 2320 var transition = $(this._element).hasClass(ClassName$5.FADE); 2321 2322 if (transition) { 2323 this._isTransitioning = true; 2324 } 2325 2326 this._setEscapeEvent(); 2327 2328 this._setResizeEvent(); 2329 2330 $(document).off(Event$5.FOCUSIN); 2331 $(this._element).removeClass(ClassName$5.SHOW); 2332 $(this._element).off(Event$5.CLICK_DISMISS); 2333 $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS); 2334 2335 if (transition) { 2336 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 2337 $(this._element).one(Util.TRANSITION_END, function (event) { 2338 return _this2._hideModal(event); 2339 }).emulateTransitionEnd(transitionDuration); 2340 } else { 2341 this._hideModal(); 2342 } 2343 }; 2344 2345 _proto.dispose = function dispose() { 2346 [window, this._element, this._dialog].forEach(function (htmlElement) { 2347 return $(htmlElement).off(EVENT_KEY$5); 2348 }); 2349 /** 2350 * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API` 2351 * Do not move `document` in `htmlElements` array 2352 * It will remove `Event.CLICK_DATA_API` event that should remain 2353 */ 2354 2355 $(document).off(Event$5.FOCUSIN); 2356 $.removeData(this._element, DATA_KEY$5); 2357 this._config = null; 2358 this._element = null; 2359 this._dialog = null; 2360 this._backdrop = null; 2361 this._isShown = null; 2362 this._isBodyOverflowing = null; 2363 this._ignoreBackdropClick = null; 2364 this._isTransitioning = null; 2365 this._scrollbarWidth = null; 2366 }; 2367 2368 _proto.handleUpdate = function handleUpdate() { 2369 this._adjustDialog(); 2370 } // Private 2371 ; 2372 2373 _proto._getConfig = function _getConfig(config) { 2374 config = _objectSpread({}, Default$3, config); 2375 Util.typeCheckConfig(NAME$5, config, DefaultType$3); 2376 return config; 2377 }; 2378 2379 _proto._showElement = function _showElement(relatedTarget) { 2380 var _this3 = this; 2381 2382 var transition = $(this._element).hasClass(ClassName$5.FADE); 2383 2384 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 2385 // Don't move modal's DOM position 2386 document.body.appendChild(this._element); 2387 } 2388 2389 this._element.style.display = 'block'; 2390 2391 this._element.removeAttribute('aria-hidden'); 2392 2393 this._element.setAttribute('aria-modal', true); 2394 2395 if ($(this._dialog).hasClass(ClassName$5.SCROLLABLE)) { 2396 this._dialog.querySelector(Selector$5.MODAL_BODY).scrollTop = 0; 2397 } else { 2398 this._element.scrollTop = 0; 2399 } 2400 2401 if (transition) { 2402 Util.reflow(this._element); 2403 } 2404 2405 $(this._element).addClass(ClassName$5.SHOW); 2406 2407 if (this._config.focus) { 2408 this._enforceFocus(); 2409 } 2410 2411 var shownEvent = $.Event(Event$5.SHOWN, { 2412 relatedTarget: relatedTarget 2413 }); 2414 2415 var transitionComplete = function transitionComplete() { 2416 if (_this3._config.focus) { 2417 _this3._element.focus(); 2418 } 2419 2420 _this3._isTransitioning = false; 2421 $(_this3._element).trigger(shownEvent); 2422 }; 2423 2424 if (transition) { 2425 var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); 2426 $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); 2427 } else { 2428 transitionComplete(); 2429 } 2430 }; 2431 2432 _proto._enforceFocus = function _enforceFocus() { 2433 var _this4 = this; 2434 2435 $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop 2436 .on(Event$5.FOCUSIN, function (event) { 2437 if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) { 2438 _this4._element.focus(); 2439 } 2440 }); 2441 }; 2442 2443 _proto._setEscapeEvent = function _setEscapeEvent() { 2444 var _this5 = this; 2445 2446 if (this._isShown && this._config.keyboard) { 2447 $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) { 2448 if (event.which === ESCAPE_KEYCODE$1) { 2449 event.preventDefault(); 2450 2451 _this5.hide(); 2452 } 2453 }); 2454 } else if (!this._isShown) { 2455 $(this._element).off(Event$5.KEYDOWN_DISMISS); 2456 } 2457 }; 2458 2459 _proto._setResizeEvent = function _setResizeEvent() { 2460 var _this6 = this; 2461 2462 if (this._isShown) { 2463 $(window).on(Event$5.RESIZE, function (event) { 2464 return _this6.handleUpdate(event); 2465 }); 2466 } else { 2467 $(window).off(Event$5.RESIZE); 2468 } 2469 }; 2470 2471 _proto._hideModal = function _hideModal() { 2472 var _this7 = this; 2473 2474 this._element.style.display = 'none'; 2475 2476 this._element.setAttribute('aria-hidden', true); 2477 2478 this._element.removeAttribute('aria-modal'); 2479 2480 this._isTransitioning = false; 2481 2482 this._showBackdrop(function () { 2483 $(document.body).removeClass(ClassName$5.OPEN); 2484 2485 _this7._resetAdjustments(); 2486 2487 _this7._resetScrollbar(); 2488 2489 $(_this7._element).trigger(Event$5.HIDDEN); 2490 }); 2491 }; 2492 2493 _proto._removeBackdrop = function _removeBackdrop() { 2494 if (this._backdrop) { 2495 $(this._backdrop).remove(); 2496 this._backdrop = null; 2497 } 2498 }; 2499 2500 _proto._showBackdrop = function _showBackdrop(callback) { 2501 var _this8 = this; 2502 2503 var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : ''; 2504 2505 if (this._isShown && this._config.backdrop) { 2506 this._backdrop = document.createElement('div'); 2507 this._backdrop.className = ClassName$5.BACKDROP; 2508 2509 if (animate) { 2510 this._backdrop.classList.add(animate); 2511 } 2512 2513 $(this._backdrop).appendTo(document.body); 2514 $(this._element).on(Event$5.CLICK_DISMISS, function (event) { 2515 if (_this8._ignoreBackdropClick) { 2516 _this8._ignoreBackdropClick = false; 2517 return; 2518 } 2519 2520 if (event.target !== event.currentTarget) { 2521 return; 2522 } 2523 2524 if (_this8._config.backdrop === 'static') { 2525 _this8._element.focus(); 2526 } else { 2527 _this8.hide(); 2528 } 2529 }); 2530 2531 if (animate) { 2532 Util.reflow(this._backdrop); 2533 } 2534 2535 $(this._backdrop).addClass(ClassName$5.SHOW); 2536 2537 if (!callback) { 2538 return; 2539 } 2540 2541 if (!animate) { 2542 callback(); 2543 return; 2544 } 2545 2546 var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 2547 $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); 2548 } else if (!this._isShown && this._backdrop) { 2549 $(this._backdrop).removeClass(ClassName$5.SHOW); 2550 2551 var callbackRemove = function callbackRemove() { 2552 _this8._removeBackdrop(); 2553 2554 if (callback) { 2555 callback(); 2556 } 2557 }; 2558 2559 if ($(this._element).hasClass(ClassName$5.FADE)) { 2560 var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 2561 2562 $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); 2563 } else { 2564 callbackRemove(); 2565 } 2566 } else if (callback) { 2567 callback(); 2568 } 2569 } // ---------------------------------------------------------------------- 2570 // the following methods are used to handle overflowing modals 2571 // todo (fat): these should probably be refactored out of modal.js 2572 // ---------------------------------------------------------------------- 2573 ; 2574 2575 _proto._adjustDialog = function _adjustDialog() { 2576 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 2577 2578 if (!this._isBodyOverflowing && isModalOverflowing) { 2579 this._element.style.paddingLeft = this._scrollbarWidth + "px"; 2580 } 2581 2582 if (this._isBodyOverflowing && !isModalOverflowing) { 2583 this._element.style.paddingRight = this._scrollbarWidth + "px"; 2584 } 2585 }; 2586 2587 _proto._resetAdjustments = function _resetAdjustments() { 2588 this._element.style.paddingLeft = ''; 2589 this._element.style.paddingRight = ''; 2590 }; 2591 2592 _proto._checkScrollbar = function _checkScrollbar() { 2593 var rect = document.body.getBoundingClientRect(); 2594 this._isBodyOverflowing = rect.left + rect.right < window.innerWidth; 2595 this._scrollbarWidth = this._getScrollbarWidth(); 2596 }; 2597 2598 _proto._setScrollbar = function _setScrollbar() { 2599 var _this9 = this; 2600 2601 if (this._isBodyOverflowing) { 2602 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 2603 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 2604 var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT)); 2605 var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding 2606 2607 $(fixedContent).each(function (index, element) { 2608 var actualPadding = element.style.paddingRight; 2609 var calculatedPadding = $(element).css('padding-right'); 2610 $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px"); 2611 }); // Adjust sticky content margin 2612 2613 $(stickyContent).each(function (index, element) { 2614 var actualMargin = element.style.marginRight; 2615 var calculatedMargin = $(element).css('margin-right'); 2616 $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px"); 2617 }); // Adjust body padding 2618 2619 var actualPadding = document.body.style.paddingRight; 2620 var calculatedPadding = $(document.body).css('padding-right'); 2621 $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); 2622 } 2623 2624 $(document.body).addClass(ClassName$5.OPEN); 2625 }; 2626 2627 _proto._resetScrollbar = function _resetScrollbar() { 2628 // Restore fixed content padding 2629 var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT)); 2630 $(fixedContent).each(function (index, element) { 2631 var padding = $(element).data('padding-right'); 2632 $(element).removeData('padding-right'); 2633 element.style.paddingRight = padding ? padding : ''; 2634 }); // Restore sticky content 2635 2636 var elements = [].slice.call(document.querySelectorAll("" + Selector$5.STICKY_CONTENT)); 2637 $(elements).each(function (index, element) { 2638 var margin = $(element).data('margin-right'); 2639 2640 if (typeof margin !== 'undefined') { 2641 $(element).css('margin-right', margin).removeData('margin-right'); 2642 } 2643 }); // Restore body padding 2644 2645 var padding = $(document.body).data('padding-right'); 2646 $(document.body).removeData('padding-right'); 2647 document.body.style.paddingRight = padding ? padding : ''; 2648 }; 2649 2650 _proto._getScrollbarWidth = function _getScrollbarWidth() { 2651 // thx d.walsh 2652 var scrollDiv = document.createElement('div'); 2653 scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER; 2654 document.body.appendChild(scrollDiv); 2655 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 2656 document.body.removeChild(scrollDiv); 2657 return scrollbarWidth; 2658 } // Static 2659 ; 2660 2661 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { 2662 return this.each(function () { 2663 var data = $(this).data(DATA_KEY$5); 2664 2665 var _config = _objectSpread({}, Default$3, $(this).data(), typeof config === 'object' && config ? config : {}); 2666 2667 if (!data) { 2668 data = new Modal(this, _config); 2669 $(this).data(DATA_KEY$5, data); 2670 } 2671 2672 if (typeof config === 'string') { 2673 if (typeof data[config] === 'undefined') { 2674 throw new TypeError("No method named \"" + config + "\""); 2675 } 2676 2677 data[config](relatedTarget); 2678 } else if (_config.show) { 2679 data.show(relatedTarget); 2680 } 2681 }); 2682 }; 2683 2684 _createClass(Modal, null, [{ 2685 key: "VERSION", 2686 get: function get() { 2687 return VERSION$5; 2688 } 2689 }, { 2690 key: "Default", 2691 get: function get() { 2692 return Default$3; 2693 } 2694 }]); 2695 2696 return Modal; 2697 }(); 2698 /** 2699 * ------------------------------------------------------------------------ 2700 * Data Api implementation 2701 * ------------------------------------------------------------------------ 2702 */ 2703 2704 2705 $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) { 2706 var _this10 = this; 2707 2708 var target; 2709 var selector = Util.getSelectorFromElement(this); 2710 2711 if (selector) { 2712 target = document.querySelector(selector); 2713 } 2714 2715 var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data()); 2716 2717 if (this.tagName === 'A' || this.tagName === 'AREA') { 2718 event.preventDefault(); 2719 } 2720 2721 var $target = $(target).one(Event$5.SHOW, function (showEvent) { 2722 if (showEvent.isDefaultPrevented()) { 2723 // Only register focus restorer if modal will actually get shown 2724 return; 2725 } 2726 2727 $target.one(Event$5.HIDDEN, function () { 2728 if ($(_this10).is(':visible')) { 2729 _this10.focus(); 2730 } 2731 }); 2732 }); 2733 2734 Modal._jQueryInterface.call($(target), config, this); 2735 }); 2736 /** 2737 * ------------------------------------------------------------------------ 2738 * jQuery 2739 * ------------------------------------------------------------------------ 2740 */ 2741 2742 $.fn[NAME$5] = Modal._jQueryInterface; 2743 $.fn[NAME$5].Constructor = Modal; 2744 2745 $.fn[NAME$5].noConflict = function () { 2746 $.fn[NAME$5] = JQUERY_NO_CONFLICT$5; 2747 return Modal._jQueryInterface; 2748 }; 2749 2750 /** 2751 * -------------------------------------------------------------------------- 2752 * Bootstrap (v4.3.1): tools/sanitizer.js 2753 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 2754 * -------------------------------------------------------------------------- 2755 */ 2756 var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; 2757 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 2758 var DefaultWhitelist = { 2759 // Global attributes allowed on any supplied element below. 2760 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 2761 a: ['target', 'href', 'title', 'rel'], 2762 area: [], 2763 b: [], 2764 br: [], 2765 col: [], 2766 code: [], 2767 div: [], 2768 em: [], 2769 hr: [], 2770 h1: [], 2771 h2: [], 2772 h3: [], 2773 h4: [], 2774 h5: [], 2775 h6: [], 2776 i: [], 2777 img: ['src', 'alt', 'title', 'width', 'height'], 2778 li: [], 2779 ol: [], 2780 p: [], 2781 pre: [], 2782 s: [], 2783 small: [], 2784 span: [], 2785 sub: [], 2786 sup: [], 2787 strong: [], 2788 u: [], 2789 ul: [] 2790 /** 2791 * A pattern that recognizes a commonly useful subset of URLs that are safe. 2792 * 2793 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 2794 */ 2795 2796 }; 2797 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi; 2798 /** 2799 * A pattern that matches safe data URLs. Only matches image, video and audio types. 2800 * 2801 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 2802 */ 2803 2804 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i; 2805 2806 function allowedAttribute(attr, allowedAttributeList) { 2807 var attrName = attr.nodeName.toLowerCase(); 2808 2809 if (allowedAttributeList.indexOf(attrName) !== -1) { 2810 if (uriAttrs.indexOf(attrName) !== -1) { 2811 return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN)); 2812 } 2813 2814 return true; 2815 } 2816 2817 var regExp = allowedAttributeList.filter(function (attrRegex) { 2818 return attrRegex instanceof RegExp; 2819 }); // Check if a regular expression validates the attribute. 2820 2821 for (var i = 0, l = regExp.length; i < l; i++) { 2822 if (attrName.match(regExp[i])) { 2823 return true; 2824 } 2825 } 2826 2827 return false; 2828 } 2829 2830 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 2831 if (unsafeHtml.length === 0) { 2832 return unsafeHtml; 2833 } 2834 2835 if (sanitizeFn && typeof sanitizeFn === 'function') { 2836 return sanitizeFn(unsafeHtml); 2837 } 2838 2839 var domParser = new window.DOMParser(); 2840 var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 2841 var whitelistKeys = Object.keys(whiteList); 2842 var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); 2843 2844 var _loop = function _loop(i, len) { 2845 var el = elements[i]; 2846 var elName = el.nodeName.toLowerCase(); 2847 2848 if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { 2849 el.parentNode.removeChild(el); 2850 return "continue"; 2851 } 2852 2853 var attributeList = [].slice.call(el.attributes); 2854 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); 2855 attributeList.forEach(function (attr) { 2856 if (!allowedAttribute(attr, whitelistedAttributes)) { 2857 el.removeAttribute(attr.nodeName); 2858 } 2859 }); 2860 }; 2861 2862 for (var i = 0, len = elements.length; i < len; i++) { 2863 var _ret = _loop(i, len); 2864 2865 if (_ret === "continue") continue; 2866 } 2867 2868 return createdDocument.body.innerHTML; 2869 } 2870 2871 /** 2872 * ------------------------------------------------------------------------ 2873 * Constants 2874 * ------------------------------------------------------------------------ 2875 */ 2876 2877 var NAME$6 = 'tooltip'; 2878 var VERSION$6 = '4.3.1'; 2879 var DATA_KEY$6 = 'bs.tooltip'; 2880 var EVENT_KEY$6 = "." + DATA_KEY$6; 2881 var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6]; 2882 var CLASS_PREFIX = 'bs-tooltip'; 2883 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 2884 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; 2885 var DefaultType$4 = { 2886 animation: 'boolean', 2887 template: 'string', 2888 title: '(string|element|function)', 2889 trigger: 'string', 2890 delay: '(number|object)', 2891 html: 'boolean', 2892 selector: '(string|boolean)', 2893 placement: '(string|function)', 2894 offset: '(number|string|function)', 2895 container: '(string|element|boolean)', 2896 fallbackPlacement: '(string|array)', 2897 boundary: '(string|element)', 2898 sanitize: 'boolean', 2899 sanitizeFn: '(null|function)', 2900 whiteList: 'object' 2901 }; 2902 var AttachmentMap$1 = { 2903 AUTO: 'auto', 2904 TOP: 'top', 2905 RIGHT: 'right', 2906 BOTTOM: 'bottom', 2907 LEFT: 'left' 2908 }; 2909 var Default$4 = { 2910 animation: true, 2911 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', 2912 trigger: 'hover focus', 2913 title: '', 2914 delay: 0, 2915 html: false, 2916 selector: false, 2917 placement: 'top', 2918 offset: 0, 2919 container: false, 2920 fallbackPlacement: 'flip', 2921 boundary: 'scrollParent', 2922 sanitize: true, 2923 sanitizeFn: null, 2924 whiteList: DefaultWhitelist 2925 }; 2926 var HoverState = { 2927 SHOW: 'show', 2928 OUT: 'out' 2929 }; 2930 var Event$6 = { 2931 HIDE: "hide" + EVENT_KEY$6, 2932 HIDDEN: "hidden" + EVENT_KEY$6, 2933 SHOW: "show" + EVENT_KEY$6, 2934 SHOWN: "shown" + EVENT_KEY$6, 2935 INSERTED: "inserted" + EVENT_KEY$6, 2936 CLICK: "click" + EVENT_KEY$6, 2937 FOCUSIN: "focusin" + EVENT_KEY$6, 2938 FOCUSOUT: "focusout" + EVENT_KEY$6, 2939 MOUSEENTER: "mouseenter" + EVENT_KEY$6, 2940 MOUSELEAVE: "mouseleave" + EVENT_KEY$6 2941 }; 2942 var ClassName$6 = { 2943 FADE: 'fade', 2944 SHOW: 'show' 2945 }; 2946 var Selector$6 = { 2947 TOOLTIP: '.tooltip', 2948 TOOLTIP_INNER: '.tooltip-inner', 2949 ARROW: '.arrow' 2950 }; 2951 var Trigger = { 2952 HOVER: 'hover', 2953 FOCUS: 'focus', 2954 CLICK: 'click', 2955 MANUAL: 'manual' 2956 /** 2957 * ------------------------------------------------------------------------ 2958 * Class Definition 2959 * ------------------------------------------------------------------------ 2960 */ 2961 2962 }; 2963 2964 var Tooltip = 2965 /*#__PURE__*/ 2966 function () { 2967 function Tooltip(element, config) { 2968 /** 2969 * Check for Popper dependency 2970 * Popper - https://popper.js.org 2971 */ 2972 if (typeof Popper === 'undefined') { 2973 throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)'); 2974 } // private 2975 2976 2977 this._isEnabled = true; 2978 this._timeout = 0; 2979 this._hoverState = ''; 2980 this._activeTrigger = {}; 2981 this._popper = null; // Protected 2982 2983 this.element = element; 2984 this.config = this._getConfig(config); 2985 this.tip = null; 2986 2987 this._setListeners(); 2988 } // Getters 2989 2990 2991 var _proto = Tooltip.prototype; 2992 2993 // Public 2994 _proto.enable = function enable() { 2995 this._isEnabled = true; 2996 }; 2997 2998 _proto.disable = function disable() { 2999 this._isEnabled = false; 3000 }; 3001 3002 _proto.toggleEnabled = function toggleEnabled() { 3003 this._isEnabled = !this._isEnabled; 3004 }; 3005 3006 _proto.toggle = function toggle(event) { 3007 if (!this._isEnabled) { 3008 return; 3009 } 3010 3011 if (event) { 3012 var dataKey = this.constructor.DATA_KEY; 3013 var context = $(event.currentTarget).data(dataKey); 3014 3015 if (!context) { 3016 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 3017 $(event.currentTarget).data(dataKey, context); 3018 } 3019 3020 context._activeTrigger.click = !context._activeTrigger.click; 3021 3022 if (context._isWithActiveTrigger()) { 3023 context._enter(null, context); 3024 } else { 3025 context._leave(null, context); 3026 } 3027 } else { 3028 if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) { 3029 this._leave(null, this); 3030 3031 return; 3032 } 3033 3034 this._enter(null, this); 3035 } 3036 }; 3037 3038 _proto.dispose = function dispose() { 3039 clearTimeout(this._timeout); 3040 $.removeData(this.element, this.constructor.DATA_KEY); 3041 $(this.element).off(this.constructor.EVENT_KEY); 3042 $(this.element).closest('.modal').off('hide.bs.modal'); 3043 3044 if (this.tip) { 3045 $(this.tip).remove(); 3046 } 3047 3048 this._isEnabled = null; 3049 this._timeout = null; 3050 this._hoverState = null; 3051 this._activeTrigger = null; 3052 3053 if (this._popper !== null) { 3054 this._popper.destroy(); 3055 } 3056 3057 this._popper = null; 3058 this.element = null; 3059 this.config = null; 3060 this.tip = null; 3061 }; 3062 3063 _proto.show = function show() { 3064 var _this = this; 3065 3066 if ($(this.element).css('display') === 'none') { 3067 throw new Error('Please use show on visible elements'); 3068 } 3069 3070 var showEvent = $.Event(this.constructor.Event.SHOW); 3071 3072 if (this.isWithContent() && this._isEnabled) { 3073 $(this.element).trigger(showEvent); 3074 var shadowRoot = Util.findShadowRoot(this.element); 3075 var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); 3076 3077 if (showEvent.isDefaultPrevented() || !isInTheDom) { 3078 return; 3079 } 3080 3081 var tip = this.getTipElement(); 3082 var tipId = Util.getUID(this.constructor.NAME); 3083 tip.setAttribute('id', tipId); 3084 this.element.setAttribute('aria-describedby', tipId); 3085 this.setContent(); 3086 3087 if (this.config.animation) { 3088 $(tip).addClass(ClassName$6.FADE); 3089 } 3090 3091 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; 3092 3093 var attachment = this._getAttachment(placement); 3094 3095 this.addAttachmentClass(attachment); 3096 3097 var container = this._getContainer(); 3098 3099 $(tip).data(this.constructor.DATA_KEY, this); 3100 3101 if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) { 3102 $(tip).appendTo(container); 3103 } 3104 3105 $(this.element).trigger(this.constructor.Event.INSERTED); 3106 this._popper = new Popper(this.element, tip, { 3107 placement: attachment, 3108 modifiers: { 3109 offset: this._getOffset(), 3110 flip: { 3111 behavior: this.config.fallbackPlacement 3112 }, 3113 arrow: { 3114 element: Selector$6.ARROW 3115 }, 3116 preventOverflow: { 3117 boundariesElement: this.config.boundary 3118 } 3119 }, 3120 onCreate: function onCreate(data) { 3121 if (data.originalPlacement !== data.placement) { 3122 _this._handlePopperPlacementChange(data); 3123 } 3124 }, 3125 onUpdate: function onUpdate(data) { 3126 return _this._handlePopperPlacementChange(data); 3127 } 3128 }); 3129 $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra 3130 // empty mouseover listeners to the body's immediate children; 3131 // only needed because of broken event delegation on iOS 3132 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 3133 3134 if ('ontouchstart' in document.documentElement) { 3135 $(document.body).children().on('mouseover', null, $.noop); 3136 } 3137 3138 var complete = function complete() { 3139 if (_this.config.animation) { 3140 _this._fixTransition(); 3141 } 3142 3143 var prevHoverState = _this._hoverState; 3144 _this._hoverState = null; 3145 $(_this.element).trigger(_this.constructor.Event.SHOWN); 3146 3147 if (prevHoverState === HoverState.OUT) { 3148 _this._leave(null, _this); 3149 } 3150 }; 3151 3152 if ($(this.tip).hasClass(ClassName$6.FADE)) { 3153 var transitionDuration = Util.getTransitionDurationFromElement(this.tip); 3154 $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 3155 } else { 3156 complete(); 3157 } 3158 } 3159 }; 3160 3161 _proto.hide = function hide(callback) { 3162 var _this2 = this; 3163 3164 var tip = this.getTipElement(); 3165 var hideEvent = $.Event(this.constructor.Event.HIDE); 3166 3167 var complete = function complete() { 3168 if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) { 3169 tip.parentNode.removeChild(tip); 3170 } 3171 3172 _this2._cleanTipClass(); 3173 3174 _this2.element.removeAttribute('aria-describedby'); 3175 3176 $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); 3177 3178 if (_this2._popper !== null) { 3179 _this2._popper.destroy(); 3180 } 3181 3182 if (callback) { 3183 callback(); 3184 } 3185 }; 3186 3187 $(this.element).trigger(hideEvent); 3188 3189 if (hideEvent.isDefaultPrevented()) { 3190 return; 3191 } 3192 3193 $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra 3194 // empty mouseover listeners we added for iOS support 3195 3196 if ('ontouchstart' in document.documentElement) { 3197 $(document.body).children().off('mouseover', null, $.noop); 3198 } 3199 3200 this._activeTrigger[Trigger.CLICK] = false; 3201 this._activeTrigger[Trigger.FOCUS] = false; 3202 this._activeTrigger[Trigger.HOVER] = false; 3203 3204 if ($(this.tip).hasClass(ClassName$6.FADE)) { 3205 var transitionDuration = Util.getTransitionDurationFromElement(tip); 3206 $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 3207 } else { 3208 complete(); 3209 } 3210 3211 this._hoverState = ''; 3212 }; 3213 3214 _proto.update = function update() { 3215 if (this._popper !== null) { 3216 this._popper.scheduleUpdate(); 3217 } 3218 } // Protected 3219 ; 3220 3221 _proto.isWithContent = function isWithContent() { 3222 return Boolean(this.getTitle()); 3223 }; 3224 3225 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 3226 $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); 3227 }; 3228 3229 _proto.getTipElement = function getTipElement() { 3230 this.tip = this.tip || $(this.config.template)[0]; 3231 return this.tip; 3232 }; 3233 3234 _proto.setContent = function setContent() { 3235 var tip = this.getTipElement(); 3236 this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle()); 3237 $(tip).removeClass(ClassName$6.FADE + " " + ClassName$6.SHOW); 3238 }; 3239 3240 _proto.setElementContent = function setElementContent($element, content) { 3241 if (typeof content === 'object' && (content.nodeType || content.jquery)) { 3242 // Content is a DOM node or a jQuery 3243 if (this.config.html) { 3244 if (!$(content).parent().is($element)) { 3245 $element.empty().append(content); 3246 } 3247 } else { 3248 $element.text($(content).text()); 3249 } 3250 3251 return; 3252 } 3253 3254 if (this.config.html) { 3255 if (this.config.sanitize) { 3256 content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); 3257 } 3258 3259 $element.html(content); 3260 } else { 3261 $element.text(content); 3262 } 3263 }; 3264 3265 _proto.getTitle = function getTitle() { 3266 var title = this.element.getAttribute('data-original-title'); 3267 3268 if (!title) { 3269 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; 3270 } 3271 3272 return title; 3273 } // Private 3274 ; 3275 3276 _proto._getOffset = function _getOffset() { 3277 var _this3 = this; 3278 3279 var offset = {}; 3280 3281 if (typeof this.config.offset === 'function') { 3282 offset.fn = function (data) { 3283 data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {}); 3284 return data; 3285 }; 3286 } else { 3287 offset.offset = this.config.offset; 3288 } 3289 3290 return offset; 3291 }; 3292 3293 _proto._getContainer = function _getContainer() { 3294 if (this.config.container === false) { 3295 return document.body; 3296 } 3297 3298 if (Util.isElement(this.config.container)) { 3299 return $(this.config.container); 3300 } 3301 3302 return $(document).find(this.config.container); 3303 }; 3304 3305 _proto._getAttachment = function _getAttachment(placement) { 3306 return AttachmentMap$1[placement.toUpperCase()]; 3307 }; 3308 3309 _proto._setListeners = function _setListeners() { 3310 var _this4 = this; 3311 3312 var triggers = this.config.trigger.split(' '); 3313 triggers.forEach(function (trigger) { 3314 if (trigger === 'click') { 3315 $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) { 3316 return _this4.toggle(event); 3317 }); 3318 } else if (trigger !== Trigger.MANUAL) { 3319 var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN; 3320 var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT; 3321 $(_this4.element).on(eventIn, _this4.config.selector, function (event) { 3322 return _this4._enter(event); 3323 }).on(eventOut, _this4.config.selector, function (event) { 3324 return _this4._leave(event); 3325 }); 3326 } 3327 }); 3328 $(this.element).closest('.modal').on('hide.bs.modal', function () { 3329 if (_this4.element) { 3330 _this4.hide(); 3331 } 3332 }); 3333 3334 if (this.config.selector) { 3335 this.config = _objectSpread({}, this.config, { 3336 trigger: 'manual', 3337 selector: '' 3338 }); 3339 } else { 3340 this._fixTitle(); 3341 } 3342 }; 3343 3344 _proto._fixTitle = function _fixTitle() { 3345 var titleType = typeof this.element.getAttribute('data-original-title'); 3346 3347 if (this.element.getAttribute('title') || titleType !== 'string') { 3348 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); 3349 this.element.setAttribute('title', ''); 3350 } 3351 }; 3352 3353 _proto._enter = function _enter(event, context) { 3354 var dataKey = this.constructor.DATA_KEY; 3355 context = context || $(event.currentTarget).data(dataKey); 3356 3357 if (!context) { 3358 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 3359 $(event.currentTarget).data(dataKey, context); 3360 } 3361 3362 if (event) { 3363 context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true; 3364 } 3365 3366 if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) { 3367 context._hoverState = HoverState.SHOW; 3368 return; 3369 } 3370 3371 clearTimeout(context._timeout); 3372 context._hoverState = HoverState.SHOW; 3373 3374 if (!context.config.delay || !context.config.delay.show) { 3375 context.show(); 3376 return; 3377 } 3378 3379 context._timeout = setTimeout(function () { 3380 if (context._hoverState === HoverState.SHOW) { 3381 context.show(); 3382 } 3383 }, context.config.delay.show); 3384 }; 3385 3386 _proto._leave = function _leave(event, context) { 3387 var dataKey = this.constructor.DATA_KEY; 3388 context = context || $(event.currentTarget).data(dataKey); 3389 3390 if (!context) { 3391 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 3392 $(event.currentTarget).data(dataKey, context); 3393 } 3394 3395 if (event) { 3396 context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false; 3397 } 3398 3399 if (context._isWithActiveTrigger()) { 3400 return; 3401 } 3402 3403 clearTimeout(context._timeout); 3404 context._hoverState = HoverState.OUT; 3405 3406 if (!context.config.delay || !context.config.delay.hide) { 3407 context.hide(); 3408 return; 3409 } 3410 3411 context._timeout = setTimeout(function () { 3412 if (context._hoverState === HoverState.OUT) { 3413 context.hide(); 3414 } 3415 }, context.config.delay.hide); 3416 }; 3417 3418 _proto._isWithActiveTrigger = function _isWithActiveTrigger() { 3419 for (var trigger in this._activeTrigger) { 3420 if (this._activeTrigger[trigger]) { 3421 return true; 3422 } 3423 } 3424 3425 return false; 3426 }; 3427 3428 _proto._getConfig = function _getConfig(config) { 3429 var dataAttributes = $(this.element).data(); 3430 Object.keys(dataAttributes).forEach(function (dataAttr) { 3431 if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { 3432 delete dataAttributes[dataAttr]; 3433 } 3434 }); 3435 config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); 3436 3437 if (typeof config.delay === 'number') { 3438 config.delay = { 3439 show: config.delay, 3440 hide: config.delay 3441 }; 3442 } 3443 3444 if (typeof config.title === 'number') { 3445 config.title = config.title.toString(); 3446 } 3447 3448 if (typeof config.content === 'number') { 3449 config.content = config.content.toString(); 3450 } 3451 3452 Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType); 3453 3454 if (config.sanitize) { 3455 config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); 3456 } 3457 3458 return config; 3459 }; 3460 3461 _proto._getDelegateConfig = function _getDelegateConfig() { 3462 var config = {}; 3463 3464 if (this.config) { 3465 for (var key in this.config) { 3466 if (this.constructor.Default[key] !== this.config[key]) { 3467 config[key] = this.config[key]; 3468 } 3469 } 3470 } 3471 3472 return config; 3473 }; 3474 3475 _proto._cleanTipClass = function _cleanTipClass() { 3476 var $tip = $(this.getTipElement()); 3477 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); 3478 3479 if (tabClass !== null && tabClass.length) { 3480 $tip.removeClass(tabClass.join('')); 3481 } 3482 }; 3483 3484 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { 3485 var popperInstance = popperData.instance; 3486 this.tip = popperInstance.popper; 3487 3488 this._cleanTipClass(); 3489 3490 this.addAttachmentClass(this._getAttachment(popperData.placement)); 3491 }; 3492 3493 _proto._fixTransition = function _fixTransition() { 3494 var tip = this.getTipElement(); 3495 var initConfigAnimation = this.config.animation; 3496 3497 if (tip.getAttribute('x-placement') !== null) { 3498 return; 3499 } 3500 3501 $(tip).removeClass(ClassName$6.FADE); 3502 this.config.animation = false; 3503 this.hide(); 3504 this.show(); 3505 this.config.animation = initConfigAnimation; 3506 } // Static 3507 ; 3508 3509 Tooltip._jQueryInterface = function _jQueryInterface(config) { 3510 return this.each(function () { 3511 var data = $(this).data(DATA_KEY$6); 3512 3513 var _config = typeof config === 'object' && config; 3514 3515 if (!data && /dispose|hide/.test(config)) { 3516 return; 3517 } 3518 3519 if (!data) { 3520 data = new Tooltip(this, _config); 3521 $(this).data(DATA_KEY$6, data); 3522 } 3523 3524 if (typeof config === 'string') { 3525 if (typeof data[config] === 'undefined') { 3526 throw new TypeError("No method named \"" + config + "\""); 3527 } 3528 3529 data[config](); 3530 } 3531 }); 3532 }; 3533 3534 _createClass(Tooltip, null, [{ 3535 key: "VERSION", 3536 get: function get() { 3537 return VERSION$6; 3538 } 3539 }, { 3540 key: "Default", 3541 get: function get() { 3542 return Default$4; 3543 } 3544 }, { 3545 key: "NAME", 3546 get: function get() { 3547 return NAME$6; 3548 } 3549 }, { 3550 key: "DATA_KEY", 3551 get: function get() { 3552 return DATA_KEY$6; 3553 } 3554 }, { 3555 key: "Event", 3556 get: function get() { 3557 return Event$6; 3558 } 3559 }, { 3560 key: "EVENT_KEY", 3561 get: function get() { 3562 return EVENT_KEY$6; 3563 } 3564 }, { 3565 key: "DefaultType", 3566 get: function get() { 3567 return DefaultType$4; 3568 } 3569 }]); 3570 3571 return Tooltip; 3572 }(); 3573 /** 3574 * ------------------------------------------------------------------------ 3575 * jQuery 3576 * ------------------------------------------------------------------------ 3577 */ 3578 3579 3580 $.fn[NAME$6] = Tooltip._jQueryInterface; 3581 $.fn[NAME$6].Constructor = Tooltip; 3582 3583 $.fn[NAME$6].noConflict = function () { 3584 $.fn[NAME$6] = JQUERY_NO_CONFLICT$6; 3585 return Tooltip._jQueryInterface; 3586 }; 3587 3588 /** 3589 * ------------------------------------------------------------------------ 3590 * Constants 3591 * ------------------------------------------------------------------------ 3592 */ 3593 3594 var NAME$7 = 'popover'; 3595 var VERSION$7 = '4.3.1'; 3596 var DATA_KEY$7 = 'bs.popover'; 3597 var EVENT_KEY$7 = "." + DATA_KEY$7; 3598 var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7]; 3599 var CLASS_PREFIX$1 = 'bs-popover'; 3600 var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); 3601 3602 var Default$5 = _objectSpread({}, Tooltip.Default, { 3603 placement: 'right', 3604 trigger: 'click', 3605 content: '', 3606 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' 3607 }); 3608 3609 var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, { 3610 content: '(string|element|function)' 3611 }); 3612 3613 var ClassName$7 = { 3614 FADE: 'fade', 3615 SHOW: 'show' 3616 }; 3617 var Selector$7 = { 3618 TITLE: '.popover-header', 3619 CONTENT: '.popover-body' 3620 }; 3621 var Event$7 = { 3622 HIDE: "hide" + EVENT_KEY$7, 3623 HIDDEN: "hidden" + EVENT_KEY$7, 3624 SHOW: "show" + EVENT_KEY$7, 3625 SHOWN: "shown" + EVENT_KEY$7, 3626 INSERTED: "inserted" + EVENT_KEY$7, 3627 CLICK: "click" + EVENT_KEY$7, 3628 FOCUSIN: "focusin" + EVENT_KEY$7, 3629 FOCUSOUT: "focusout" + EVENT_KEY$7, 3630 MOUSEENTER: "mouseenter" + EVENT_KEY$7, 3631 MOUSELEAVE: "mouseleave" + EVENT_KEY$7 3632 /** 3633 * ------------------------------------------------------------------------ 3634 * Class Definition 3635 * ------------------------------------------------------------------------ 3636 */ 3637 3638 }; 3639 3640 var Popover = 3641 /*#__PURE__*/ 3642 function (_Tooltip) { 3643 _inheritsLoose(Popover, _Tooltip); 3644 3645 function Popover() { 3646 return _Tooltip.apply(this, arguments) || this; 3647 } 3648 3649 var _proto = Popover.prototype; 3650 3651 // Overrides 3652 _proto.isWithContent = function isWithContent() { 3653 return this.getTitle() || this._getContent(); 3654 }; 3655 3656 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 3657 $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment); 3658 }; 3659 3660 _proto.getTipElement = function getTipElement() { 3661 this.tip = this.tip || $(this.config.template)[0]; 3662 return this.tip; 3663 }; 3664 3665 _proto.setContent = function setContent() { 3666 var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events 3667 3668 this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle()); 3669 3670 var content = this._getContent(); 3671 3672 if (typeof content === 'function') { 3673 content = content.call(this.element); 3674 } 3675 3676 this.setElementContent($tip.find(Selector$7.CONTENT), content); 3677 $tip.removeClass(ClassName$7.FADE + " " + ClassName$7.SHOW); 3678 } // Private 3679 ; 3680 3681 _proto._getContent = function _getContent() { 3682 return this.element.getAttribute('data-content') || this.config.content; 3683 }; 3684 3685 _proto._cleanTipClass = function _cleanTipClass() { 3686 var $tip = $(this.getTipElement()); 3687 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1); 3688 3689 if (tabClass !== null && tabClass.length > 0) { 3690 $tip.removeClass(tabClass.join('')); 3691 } 3692 } // Static 3693 ; 3694 3695 Popover._jQueryInterface = function _jQueryInterface(config) { 3696 return this.each(function () { 3697 var data = $(this).data(DATA_KEY$7); 3698 3699 var _config = typeof config === 'object' ? config : null; 3700 3701 if (!data && /dispose|hide/.test(config)) { 3702 return; 3703 } 3704 3705 if (!data) { 3706 data = new Popover(this, _config); 3707 $(this).data(DATA_KEY$7, data); 3708 } 3709 3710 if (typeof config === 'string') { 3711 if (typeof data[config] === 'undefined') { 3712 throw new TypeError("No method named \"" + config + "\""); 3713 } 3714 3715 data[config](); 3716 } 3717 }); 3718 }; 3719 3720 _createClass(Popover, null, [{ 3721 key: "VERSION", 3722 // Getters 3723 get: function get() { 3724 return VERSION$7; 3725 } 3726 }, { 3727 key: "Default", 3728 get: function get() { 3729 return Default$5; 3730 } 3731 }, { 3732 key: "NAME", 3733 get: function get() { 3734 return NAME$7; 3735 } 3736 }, { 3737 key: "DATA_KEY", 3738 get: function get() { 3739 return DATA_KEY$7; 3740 } 3741 }, { 3742 key: "Event", 3743 get: function get() { 3744 return Event$7; 3745 } 3746 }, { 3747 key: "EVENT_KEY", 3748 get: function get() { 3749 return EVENT_KEY$7; 3750 } 3751 }, { 3752 key: "DefaultType", 3753 get: function get() { 3754 return DefaultType$5; 3755 } 3756 }]); 3757 3758 return Popover; 3759 }(Tooltip); 3760 /** 3761 * ------------------------------------------------------------------------ 3762 * jQuery 3763 * ------------------------------------------------------------------------ 3764 */ 3765 3766 3767 $.fn[NAME$7] = Popover._jQueryInterface; 3768 $.fn[NAME$7].Constructor = Popover; 3769 3770 $.fn[NAME$7].noConflict = function () { 3771 $.fn[NAME$7] = JQUERY_NO_CONFLICT$7; 3772 return Popover._jQueryInterface; 3773 }; 3774 3775 /** 3776 * ------------------------------------------------------------------------ 3777 * Constants 3778 * ------------------------------------------------------------------------ 3779 */ 3780 3781 var NAME$8 = 'scrollspy'; 3782 var VERSION$8 = '4.3.1'; 3783 var DATA_KEY$8 = 'bs.scrollspy'; 3784 var EVENT_KEY$8 = "." + DATA_KEY$8; 3785 var DATA_API_KEY$6 = '.data-api'; 3786 var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8]; 3787 var Default$6 = { 3788 offset: 10, 3789 method: 'auto', 3790 target: '' 3791 }; 3792 var DefaultType$6 = { 3793 offset: 'number', 3794 method: 'string', 3795 target: '(string|element)' 3796 }; 3797 var Event$8 = { 3798 ACTIVATE: "activate" + EVENT_KEY$8, 3799 SCROLL: "scroll" + EVENT_KEY$8, 3800 LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6 3801 }; 3802 var ClassName$8 = { 3803 DROPDOWN_ITEM: 'dropdown-item', 3804 DROPDOWN_MENU: 'dropdown-menu', 3805 ACTIVE: 'active' 3806 }; 3807 var Selector$8 = { 3808 DATA_SPY: '[data-spy="scroll"]', 3809 ACTIVE: '.active', 3810 NAV_LIST_GROUP: '.nav, .list-group', 3811 NAV_LINKS: '.nav-link', 3812 NAV_ITEMS: '.nav-item', 3813 LIST_ITEMS: '.list-group-item', 3814 DROPDOWN: '.dropdown', 3815 DROPDOWN_ITEMS: '.dropdown-item', 3816 DROPDOWN_TOGGLE: '.dropdown-toggle' 3817 }; 3818 var OffsetMethod = { 3819 OFFSET: 'offset', 3820 POSITION: 'position' 3821 /** 3822 * ------------------------------------------------------------------------ 3823 * Class Definition 3824 * ------------------------------------------------------------------------ 3825 */ 3826 3827 }; 3828 3829 var ScrollSpy = 3830 /*#__PURE__*/ 3831 function () { 3832 function ScrollSpy(element, config) { 3833 var _this = this; 3834 3835 this._element = element; 3836 this._scrollElement = element.tagName === 'BODY' ? window : element; 3837 this._config = this._getConfig(config); 3838 this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS); 3839 this._offsets = []; 3840 this._targets = []; 3841 this._activeTarget = null; 3842 this._scrollHeight = 0; 3843 $(this._scrollElement).on(Event$8.SCROLL, function (event) { 3844 return _this._process(event); 3845 }); 3846 this.refresh(); 3847 3848 this._process(); 3849 } // Getters 3850 3851 3852 var _proto = ScrollSpy.prototype; 3853 3854 // Public 3855 _proto.refresh = function refresh() { 3856 var _this2 = this; 3857 3858 var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION; 3859 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 3860 var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; 3861 this._offsets = []; 3862 this._targets = []; 3863 this._scrollHeight = this._getScrollHeight(); 3864 var targets = [].slice.call(document.querySelectorAll(this._selector)); 3865 targets.map(function (element) { 3866 var target; 3867 var targetSelector = Util.getSelectorFromElement(element); 3868 3869 if (targetSelector) { 3870 target = document.querySelector(targetSelector); 3871 } 3872 3873 if (target) { 3874 var targetBCR = target.getBoundingClientRect(); 3875 3876 if (targetBCR.width || targetBCR.height) { 3877 // TODO (fat): remove sketch reliance on jQuery position/offset 3878 return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; 3879 } 3880 } 3881 3882 return null; 3883 }).filter(function (item) { 3884 return item; 3885 }).sort(function (a, b) { 3886 return a[0] - b[0]; 3887 }).forEach(function (item) { 3888 _this2._offsets.push(item[0]); 3889 3890 _this2._targets.push(item[1]); 3891 }); 3892 }; 3893 3894 _proto.dispose = function dispose() { 3895 $.removeData(this._element, DATA_KEY$8); 3896 $(this._scrollElement).off(EVENT_KEY$8); 3897 this._element = null; 3898 this._scrollElement = null; 3899 this._config = null; 3900 this._selector = null; 3901 this._offsets = null; 3902 this._targets = null; 3903 this._activeTarget = null; 3904 this._scrollHeight = null; 3905 } // Private 3906 ; 3907 3908 _proto._getConfig = function _getConfig(config) { 3909 config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {}); 3910 3911 if (typeof config.target !== 'string') { 3912 var id = $(config.target).attr('id'); 3913 3914 if (!id) { 3915 id = Util.getUID(NAME$8); 3916 $(config.target).attr('id', id); 3917 } 3918 3919 config.target = "#" + id; 3920 } 3921 3922 Util.typeCheckConfig(NAME$8, config, DefaultType$6); 3923 return config; 3924 }; 3925 3926 _proto._getScrollTop = function _getScrollTop() { 3927 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 3928 }; 3929 3930 _proto._getScrollHeight = function _getScrollHeight() { 3931 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 3932 }; 3933 3934 _proto._getOffsetHeight = function _getOffsetHeight() { 3935 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 3936 }; 3937 3938 _proto._process = function _process() { 3939 var scrollTop = this._getScrollTop() + this._config.offset; 3940 3941 var scrollHeight = this._getScrollHeight(); 3942 3943 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 3944 3945 if (this._scrollHeight !== scrollHeight) { 3946 this.refresh(); 3947 } 3948 3949 if (scrollTop >= maxScroll) { 3950 var target = this._targets[this._targets.length - 1]; 3951 3952 if (this._activeTarget !== target) { 3953 this._activate(target); 3954 } 3955 3956 return; 3957 } 3958 3959 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 3960 this._activeTarget = null; 3961 3962 this._clear(); 3963 3964 return; 3965 } 3966 3967 var offsetLength = this._offsets.length; 3968 3969 for (var i = offsetLength; i--;) { 3970 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 3971 3972 if (isActiveTarget) { 3973 this._activate(this._targets[i]); 3974 } 3975 } 3976 }; 3977 3978 _proto._activate = function _activate(target) { 3979 this._activeTarget = target; 3980 3981 this._clear(); 3982 3983 var queries = this._selector.split(',').map(function (selector) { 3984 return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; 3985 }); 3986 3987 var $link = $([].slice.call(document.querySelectorAll(queries.join(',')))); 3988 3989 if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) { 3990 $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE); 3991 $link.addClass(ClassName$8.ACTIVE); 3992 } else { 3993 // Set triggered link as active 3994 $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active 3995 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 3996 3997 $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).addClass(ClassName$8.ACTIVE); // Handle special case when .nav-link is inside .nav-item 3998 3999 $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE); 4000 } 4001 4002 $(this._scrollElement).trigger(Event$8.ACTIVATE, { 4003 relatedTarget: target 4004 }); 4005 }; 4006 4007 _proto._clear = function _clear() { 4008 [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { 4009 return node.classList.contains(ClassName$8.ACTIVE); 4010 }).forEach(function (node) { 4011 return node.classList.remove(ClassName$8.ACTIVE); 4012 }); 4013 } // Static 4014 ; 4015 4016 ScrollSpy._jQueryInterface = function _jQueryInterface(config) { 4017 return this.each(function () { 4018 var data = $(this).data(DATA_KEY$8); 4019 4020 var _config = typeof config === 'object' && config; 4021 4022 if (!data) { 4023 data = new ScrollSpy(this, _config); 4024 $(this).data(DATA_KEY$8, data); 4025 } 4026 4027 if (typeof config === 'string') { 4028 if (typeof data[config] === 'undefined') { 4029 throw new TypeError("No method named \"" + config + "\""); 4030 } 4031 4032 data[config](); 4033 } 4034 }); 4035 }; 4036 4037 _createClass(ScrollSpy, null, [{ 4038 key: "VERSION", 4039 get: function get() { 4040 return VERSION$8; 4041 } 4042 }, { 4043 key: "Default", 4044 get: function get() { 4045 return Default$6; 4046 } 4047 }]); 4048 4049 return ScrollSpy; 4050 }(); 4051 /** 4052 * ------------------------------------------------------------------------ 4053 * Data Api implementation 4054 * ------------------------------------------------------------------------ 4055 */ 4056 4057 4058 $(window).on(Event$8.LOAD_DATA_API, function () { 4059 var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY)); 4060 var scrollSpysLength = scrollSpys.length; 4061 4062 for (var i = scrollSpysLength; i--;) { 4063 var $spy = $(scrollSpys[i]); 4064 4065 ScrollSpy._jQueryInterface.call($spy, $spy.data()); 4066 } 4067 }); 4068 /** 4069 * ------------------------------------------------------------------------ 4070 * jQuery 4071 * ------------------------------------------------------------------------ 4072 */ 4073 4074 $.fn[NAME$8] = ScrollSpy._jQueryInterface; 4075 $.fn[NAME$8].Constructor = ScrollSpy; 4076 4077 $.fn[NAME$8].noConflict = function () { 4078 $.fn[NAME$8] = JQUERY_NO_CONFLICT$8; 4079 return ScrollSpy._jQueryInterface; 4080 }; 4081 4082 /** 4083 * ------------------------------------------------------------------------ 4084 * Constants 4085 * ------------------------------------------------------------------------ 4086 */ 4087 4088 var NAME$9 = 'tab'; 4089 var VERSION$9 = '4.3.1'; 4090 var DATA_KEY$9 = 'bs.tab'; 4091 var EVENT_KEY$9 = "." + DATA_KEY$9; 4092 var DATA_API_KEY$7 = '.data-api'; 4093 var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9]; 4094 var Event$9 = { 4095 HIDE: "hide" + EVENT_KEY$9, 4096 HIDDEN: "hidden" + EVENT_KEY$9, 4097 SHOW: "show" + EVENT_KEY$9, 4098 SHOWN: "shown" + EVENT_KEY$9, 4099 CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7 4100 }; 4101 var ClassName$9 = { 4102 DROPDOWN_MENU: 'dropdown-menu', 4103 ACTIVE: 'active', 4104 DISABLED: 'disabled', 4105 FADE: 'fade', 4106 SHOW: 'show' 4107 }; 4108 var Selector$9 = { 4109 DROPDOWN: '.dropdown', 4110 NAV_LIST_GROUP: '.nav, .list-group', 4111 ACTIVE: '.active', 4112 ACTIVE_UL: '> li > .active', 4113 DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', 4114 DROPDOWN_TOGGLE: '.dropdown-toggle', 4115 DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active' 4116 /** 4117 * ------------------------------------------------------------------------ 4118 * Class Definition 4119 * ------------------------------------------------------------------------ 4120 */ 4121 4122 }; 4123 4124 var Tab = 4125 /*#__PURE__*/ 4126 function () { 4127 function Tab(element) { 4128 this._element = element; 4129 } // Getters 4130 4131 4132 var _proto = Tab.prototype; 4133 4134 // Public 4135 _proto.show = function show() { 4136 var _this = this; 4137 4138 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) { 4139 return; 4140 } 4141 4142 var target; 4143 var previous; 4144 var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0]; 4145 var selector = Util.getSelectorFromElement(this._element); 4146 4147 if (listElement) { 4148 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE; 4149 previous = $.makeArray($(listElement).find(itemSelector)); 4150 previous = previous[previous.length - 1]; 4151 } 4152 4153 var hideEvent = $.Event(Event$9.HIDE, { 4154 relatedTarget: this._element 4155 }); 4156 var showEvent = $.Event(Event$9.SHOW, { 4157 relatedTarget: previous 4158 }); 4159 4160 if (previous) { 4161 $(previous).trigger(hideEvent); 4162 } 4163 4164 $(this._element).trigger(showEvent); 4165 4166 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 4167 return; 4168 } 4169 4170 if (selector) { 4171 target = document.querySelector(selector); 4172 } 4173 4174 this._activate(this._element, listElement); 4175 4176 var complete = function complete() { 4177 var hiddenEvent = $.Event(Event$9.HIDDEN, { 4178 relatedTarget: _this._element 4179 }); 4180 var shownEvent = $.Event(Event$9.SHOWN, { 4181 relatedTarget: previous 4182 }); 4183 $(previous).trigger(hiddenEvent); 4184 $(_this._element).trigger(shownEvent); 4185 }; 4186 4187 if (target) { 4188 this._activate(target, target.parentNode, complete); 4189 } else { 4190 complete(); 4191 } 4192 }; 4193 4194 _proto.dispose = function dispose() { 4195 $.removeData(this._element, DATA_KEY$9); 4196 this._element = null; 4197 } // Private 4198 ; 4199 4200 _proto._activate = function _activate(element, container, callback) { 4201 var _this2 = this; 4202 4203 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE); 4204 var active = activeElements[0]; 4205 var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE); 4206 4207 var complete = function complete() { 4208 return _this2._transitionComplete(element, active, callback); 4209 }; 4210 4211 if (active && isTransitioning) { 4212 var transitionDuration = Util.getTransitionDurationFromElement(active); 4213 $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 4214 } else { 4215 complete(); 4216 } 4217 }; 4218 4219 _proto._transitionComplete = function _transitionComplete(element, active, callback) { 4220 if (active) { 4221 $(active).removeClass(ClassName$9.ACTIVE); 4222 var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0]; 4223 4224 if (dropdownChild) { 4225 $(dropdownChild).removeClass(ClassName$9.ACTIVE); 4226 } 4227 4228 if (active.getAttribute('role') === 'tab') { 4229 active.setAttribute('aria-selected', false); 4230 } 4231 } 4232 4233 $(element).addClass(ClassName$9.ACTIVE); 4234 4235 if (element.getAttribute('role') === 'tab') { 4236 element.setAttribute('aria-selected', true); 4237 } 4238 4239 Util.reflow(element); 4240 4241 if (element.classList.contains(ClassName$9.FADE)) { 4242 element.classList.add(ClassName$9.SHOW); 4243 } 4244 4245 if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) { 4246 var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0]; 4247 4248 if (dropdownElement) { 4249 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE)); 4250 $(dropdownToggleList).addClass(ClassName$9.ACTIVE); 4251 } 4252 4253 element.setAttribute('aria-expanded', true); 4254 } 4255 4256 if (callback) { 4257 callback(); 4258 } 4259 } // Static 4260 ; 4261 4262 Tab._jQueryInterface = function _jQueryInterface(config) { 4263 return this.each(function () { 4264 var $this = $(this); 4265 var data = $this.data(DATA_KEY$9); 4266 4267 if (!data) { 4268 data = new Tab(this); 4269 $this.data(DATA_KEY$9, data); 4270 } 4271 4272 if (typeof config === 'string') { 4273 if (typeof data[config] === 'undefined') { 4274 throw new TypeError("No method named \"" + config + "\""); 4275 } 4276 4277 data[config](); 4278 } 4279 }); 4280 }; 4281 4282 _createClass(Tab, null, [{ 4283 key: "VERSION", 4284 get: function get() { 4285 return VERSION$9; 4286 } 4287 }]); 4288 4289 return Tab; 4290 }(); 4291 /** 4292 * ------------------------------------------------------------------------ 4293 * Data Api implementation 4294 * ------------------------------------------------------------------------ 4295 */ 4296 4297 4298 $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) { 4299 event.preventDefault(); 4300 4301 Tab._jQueryInterface.call($(this), 'show'); 4302 }); 4303 /** 4304 * ------------------------------------------------------------------------ 4305 * jQuery 4306 * ------------------------------------------------------------------------ 4307 */ 4308 4309 $.fn[NAME$9] = Tab._jQueryInterface; 4310 $.fn[NAME$9].Constructor = Tab; 4311 4312 $.fn[NAME$9].noConflict = function () { 4313 $.fn[NAME$9] = JQUERY_NO_CONFLICT$9; 4314 return Tab._jQueryInterface; 4315 }; 4316 4317 /** 4318 * ------------------------------------------------------------------------ 4319 * Constants 4320 * ------------------------------------------------------------------------ 4321 */ 4322 4323 var NAME$a = 'toast'; 4324 var VERSION$a = '4.3.1'; 4325 var DATA_KEY$a = 'bs.toast'; 4326 var EVENT_KEY$a = "." + DATA_KEY$a; 4327 var JQUERY_NO_CONFLICT$a = $.fn[NAME$a]; 4328 var Event$a = { 4329 CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a, 4330 HIDE: "hide" + EVENT_KEY$a, 4331 HIDDEN: "hidden" + EVENT_KEY$a, 4332 SHOW: "show" + EVENT_KEY$a, 4333 SHOWN: "shown" + EVENT_KEY$a 4334 }; 4335 var ClassName$a = { 4336 FADE: 'fade', 4337 HIDE: 'hide', 4338 SHOW: 'show', 4339 SHOWING: 'showing' 4340 }; 4341 var DefaultType$7 = { 4342 animation: 'boolean', 4343 autohide: 'boolean', 4344 delay: 'number' 4345 }; 4346 var Default$7 = { 4347 animation: true, 4348 autohide: true, 4349 delay: 500 4350 }; 4351 var Selector$a = { 4352 DATA_DISMISS: '[data-dismiss="toast"]' 4353 /** 4354 * ------------------------------------------------------------------------ 4355 * Class Definition 4356 * ------------------------------------------------------------------------ 4357 */ 4358 4359 }; 4360 4361 var Toast = 4362 /*#__PURE__*/ 4363 function () { 4364 function Toast(element, config) { 4365 this._element = element; 4366 this._config = this._getConfig(config); 4367 this._timeout = null; 4368 4369 this._setListeners(); 4370 } // Getters 4371 4372 4373 var _proto = Toast.prototype; 4374 4375 // Public 4376 _proto.show = function show() { 4377 var _this = this; 4378 4379 $(this._element).trigger(Event$a.SHOW); 4380 4381 if (this._config.animation) { 4382 this._element.classList.add(ClassName$a.FADE); 4383 } 4384 4385 var complete = function complete() { 4386 _this._element.classList.remove(ClassName$a.SHOWING); 4387 4388 _this._element.classList.add(ClassName$a.SHOW); 4389 4390 $(_this._element).trigger(Event$a.SHOWN); 4391 4392 if (_this._config.autohide) { 4393 _this.hide(); 4394 } 4395 }; 4396 4397 this._element.classList.remove(ClassName$a.HIDE); 4398 4399 this._element.classList.add(ClassName$a.SHOWING); 4400 4401 if (this._config.animation) { 4402 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 4403 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 4404 } else { 4405 complete(); 4406 } 4407 }; 4408 4409 _proto.hide = function hide(withoutTimeout) { 4410 var _this2 = this; 4411 4412 if (!this._element.classList.contains(ClassName$a.SHOW)) { 4413 return; 4414 } 4415 4416 $(this._element).trigger(Event$a.HIDE); 4417 4418 if (withoutTimeout) { 4419 this._close(); 4420 } else { 4421 this._timeout = setTimeout(function () { 4422 _this2._close(); 4423 }, this._config.delay); 4424 } 4425 }; 4426 4427 _proto.dispose = function dispose() { 4428 clearTimeout(this._timeout); 4429 this._timeout = null; 4430 4431 if (this._element.classList.contains(ClassName$a.SHOW)) { 4432 this._element.classList.remove(ClassName$a.SHOW); 4433 } 4434 4435 $(this._element).off(Event$a.CLICK_DISMISS); 4436 $.removeData(this._element, DATA_KEY$a); 4437 this._element = null; 4438 this._config = null; 4439 } // Private 4440 ; 4441 4442 _proto._getConfig = function _getConfig(config) { 4443 config = _objectSpread({}, Default$7, $(this._element).data(), typeof config === 'object' && config ? config : {}); 4444 Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType); 4445 return config; 4446 }; 4447 4448 _proto._setListeners = function _setListeners() { 4449 var _this3 = this; 4450 4451 $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () { 4452 return _this3.hide(true); 4453 }); 4454 }; 4455 4456 _proto._close = function _close() { 4457 var _this4 = this; 4458 4459 var complete = function complete() { 4460 _this4._element.classList.add(ClassName$a.HIDE); 4461 4462 $(_this4._element).trigger(Event$a.HIDDEN); 4463 }; 4464 4465 this._element.classList.remove(ClassName$a.SHOW); 4466 4467 if (this._config.animation) { 4468 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 4469 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 4470 } else { 4471 complete(); 4472 } 4473 } // Static 4474 ; 4475 4476 Toast._jQueryInterface = function _jQueryInterface(config) { 4477 return this.each(function () { 4478 var $element = $(this); 4479 var data = $element.data(DATA_KEY$a); 4480 4481 var _config = typeof config === 'object' && config; 4482 4483 if (!data) { 4484 data = new Toast(this, _config); 4485 $element.data(DATA_KEY$a, data); 4486 } 4487 4488 if (typeof config === 'string') { 4489 if (typeof data[config] === 'undefined') { 4490 throw new TypeError("No method named \"" + config + "\""); 4491 } 4492 4493 data[config](this); 4494 } 4495 }); 4496 }; 4497 4498 _createClass(Toast, null, [{ 4499 key: "VERSION", 4500 get: function get() { 4501 return VERSION$a; 4502 } 4503 }, { 4504 key: "DefaultType", 4505 get: function get() { 4506 return DefaultType$7; 4507 } 4508 }, { 4509 key: "Default", 4510 get: function get() { 4511 return Default$7; 4512 } 4513 }]); 4514 4515 return Toast; 4516 }(); 4517 /** 4518 * ------------------------------------------------------------------------ 4519 * jQuery 4520 * ------------------------------------------------------------------------ 4521 */ 4522 4523 4524 $.fn[NAME$a] = Toast._jQueryInterface; 4525 $.fn[NAME$a].Constructor = Toast; 4526 4527 $.fn[NAME$a].noConflict = function () { 4528 $.fn[NAME$a] = JQUERY_NO_CONFLICT$a; 4529 return Toast._jQueryInterface; 4530 }; 4531 4532 /** 4533 * -------------------------------------------------------------------------- 4534 * Bootstrap (v4.3.1): index.js 4535 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 4536 * -------------------------------------------------------------------------- 4537 */ 4538 4539 (function () { 4540 if (typeof $ === 'undefined') { 4541 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); 4542 } 4543 4544 var version = $.fn.jquery.split(' ')[0].split('.'); 4545 var minMajor = 1; 4546 var ltMajor = 2; 4547 var minMinor = 9; 4548 var minPatch = 1; 4549 var maxMajor = 4; 4550 4551 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { 4552 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); 4553 } 4554 })(); 4555 4556 exports.Util = Util; 4557 exports.Alert = Alert; 4558 exports.Button = Button; 4559 exports.Carousel = Carousel; 4560 exports.Collapse = Collapse; 4561 exports.Dropdown = Dropdown; 4562 exports.Modal = Modal; 4563 exports.Popover = Popover; 4564 exports.Scrollspy = ScrollSpy; 4565 exports.Tab = Tab; 4566 exports.Toast = Toast; 4567 exports.Tooltip = Tooltip; 4568 4569 Object.defineProperty(exports, '__esModule', { value: true }); 4570 4571})); 4572 4573 4574 4575 /***/ 4576 }, 4577 4578
vendor: 3,263 bytes, lines 4578-4700
4578/***/ "../node_modules/ev-emitter/ev-emitter.js": 4579 /*!************************************************!*\ 4580 !*** ../node_modules/ev-emitter/ev-emitter.js ***! 4581 \************************************************/ 4582 /*! no static exports found */ 4583 /***/ function (module, exports, __webpack_require__) { 4584 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 4585 * EvEmitter v1.1.0 4586 * Lil' event emitter 4587 * MIT License 4588 */ 4589 4590/* jshint unused: true, undef: true, strict: true */ 4591 4592( function( global, factory ) { 4593 // universal module definition 4594 /* jshint strict: false */ /* globals define, module, window */ 4595 if ( true ) { 4596 // AMD - RequireJS 4597 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 4598 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 4599 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : 4600 __WEBPACK_AMD_DEFINE_FACTORY__), 4601 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 4602 } else {} 4603 4604}( typeof window != 'undefined' ? window : this, function() { 4605 4606"use strict"; 4607 4608function EvEmitter() {} 4609 4610var proto = EvEmitter.prototype; 4611 4612proto.on = function( eventName, listener ) { 4613 if ( !eventName || !listener ) { 4614 return; 4615 } 4616 // set events hash 4617 var events = this._events = this._events || {}; 4618 // set listeners array 4619 var listeners = events[ eventName ] = events[ eventName ] || []; 4620 // only add once 4621 if ( listeners.indexOf( listener ) == -1 ) { 4622 listeners.push( listener ); 4623 } 4624 4625 return this; 4626}; 4627 4628proto.once = function( eventName, listener ) { 4629 if ( !eventName || !listener ) { 4630 return; 4631 } 4632 // add event 4633 this.on( eventName, listener ); 4634 // set once flag 4635 // set onceEvents hash 4636 var onceEvents = this._onceEvents = this._onceEvents || {}; 4637 // set onceListeners object 4638 var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; 4639 // set flag 4640 onceListeners[ listener ] = true; 4641 4642 return this; 4643}; 4644 4645proto.off = function( eventName, listener ) { 4646 var listeners = this._events && this._events[ eventName ]; 4647 if ( !listeners || !listeners.length ) { 4648 return; 4649 } 4650 var index = listeners.indexOf( listener ); 4651 if ( index != -1 ) { 4652 listeners.splice( index, 1 ); 4653 } 4654 4655 return this; 4656}; 4657 4658proto.emitEvent = function( eventName, args ) { 4659 var listeners = this._events && this._events[ eventName ]; 4660 if ( !listeners || !listeners.length ) { 4661 return; 4662 } 4663 // copy over to avoid interference if .off() in listener 4664 listeners = listeners.slice(0); 4665 args = args || []; 4666 // once stuff 4667 var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; 4668 4669 for ( var i=0; i < listeners.length; i++ ) { 4670 var listener = listeners[i] 4671 var isOnce = onceListeners && onceListeners[ listener ]; 4672 if ( isOnce ) { 4673 // remove listener 4674 // remove before trigger to prevent recursion 4675 this.off( eventName, listener ); 4676 // unset once flag 4677 delete onceListeners[ listener ]; 4678 } 4679 // trigger listener 4680 listener.apply( this, args ); 4681 } 4682 4683 return this; 4684}; 4685 4686proto.allOff = function() { 4687 delete this._events; 4688 delete this._onceEvents; 4689}; 4690 4691return EvEmitter; 4692 4693})); 4694 4695 4696 4697 /***/ 4698 }, 4699 4700
vendor: 10,394 bytes, lines 4700-5078
4700/***/ "../node_modules/imagesloaded/imagesloaded.js": 4701 /*!****************************************************!*\ 4702 !*** ../node_modules/imagesloaded/imagesloaded.js ***! 4703 \****************************************************/ 4704 /*! no static exports found */ 4705 /***/ function (module, exports, __webpack_require__) { 4706 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 4707 * imagesLoaded v4.1.4 4708 * JavaScript is all like "You images are done yet or what?" 4709 * MIT License 4710 */ 4711 4712( function( window, factory ) { 'use strict'; 4713 // universal module definition 4714 4715 /*global define: false, module: false, require: false */ 4716 4717 if ( true ) { 4718 // AMD 4719 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 4720 __webpack_require__(/*! ev-emitter/ev-emitter */ "../node_modules/ev-emitter/ev-emitter.js") 4721 ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( EvEmitter ) { 4722 return factory( window, EvEmitter ); 4723 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 4724 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 4725 } else {} 4726 4727})( typeof window !== 'undefined' ? window : this, 4728 4729// -------------------------- factory -------------------------- // 4730 4731function factory( window, EvEmitter ) { 4732 4733'use strict'; 4734 4735var $ = window.jQuery; 4736var console = window.console; 4737 4738// -------------------------- helpers -------------------------- // 4739 4740// extend objects 4741function extend( a, b ) { 4742 for ( var prop in b ) { 4743 a[ prop ] = b[ prop ]; 4744 } 4745 return a; 4746} 4747 4748var arraySlice = Array.prototype.slice; 4749 4750// turn element or nodeList into an array 4751function makeArray( obj ) { 4752 if ( Array.isArray( obj ) ) { 4753 // use object if already an array 4754 return obj; 4755 } 4756 4757 var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; 4758 if ( isArrayLike ) { 4759 // convert nodeList to array 4760 return arraySlice.call( obj ); 4761 } 4762 4763 // array of single index 4764 return [ obj ]; 4765} 4766 4767// -------------------------- imagesLoaded -------------------------- // 4768 4769/** 4770 * @param {Array, Element, NodeList, String} elem 4771 * @param {Object or Function} options - if function, use as callback 4772 * @param {Function} onAlways - callback function 4773 */ 4774function ImagesLoaded( elem, options, onAlways ) { 4775 // coerce ImagesLoaded() without new, to be new ImagesLoaded() 4776 if ( !( this instanceof ImagesLoaded ) ) { 4777 return new ImagesLoaded( elem, options, onAlways ); 4778 } 4779 // use elem as selector string 4780 var queryElem = elem; 4781 if ( typeof elem == 'string' ) { 4782 queryElem = document.querySelectorAll( elem ); 4783 } 4784 // bail if bad element 4785 if ( !queryElem ) { 4786 console.error( 'Bad element for imagesLoaded ' + ( queryElem || elem ) ); 4787 return; 4788 } 4789 4790 this.elements = makeArray( queryElem ); 4791 this.options = extend( {}, this.options ); 4792 // shift arguments if no options set 4793 if ( typeof options == 'function' ) { 4794 onAlways = options; 4795 } else { 4796 extend( this.options, options ); 4797 } 4798 4799 if ( onAlways ) { 4800 this.on( 'always', onAlways ); 4801 } 4802 4803 this.getImages(); 4804 4805 if ( $ ) { 4806 // add jQuery Deferred object 4807 this.jqDeferred = new $.Deferred(); 4808 } 4809 4810 // HACK check async to allow time to bind listeners 4811 setTimeout( this.check.bind( this ) ); 4812} 4813 4814ImagesLoaded.prototype = Object.create( EvEmitter.prototype ); 4815 4816ImagesLoaded.prototype.options = {}; 4817 4818ImagesLoaded.prototype.getImages = function() { 4819 this.images = []; 4820 4821 // filter & find items if we have an item selector 4822 this.elements.forEach( this.addElementImages, this ); 4823}; 4824 4825/** 4826 * @param {Node} element 4827 */ 4828ImagesLoaded.prototype.addElementImages = function( elem ) { 4829 // filter siblings 4830 if ( elem.nodeName == 'IMG' ) { 4831 this.addImage( elem ); 4832 } 4833 // get background image on element 4834 if ( this.options.background === true ) { 4835 this.addElementBackgroundImages( elem ); 4836 } 4837 4838 // find children 4839 // no non-element nodes, #143 4840 var nodeType = elem.nodeType; 4841 if ( !nodeType || !elementNodeTypes[ nodeType ] ) { 4842 return; 4843 } 4844 var childImgs = elem.querySelectorAll('img'); 4845 // concat childElems to filterFound array 4846 for ( var i=0; i < childImgs.length; i++ ) { 4847 var img = childImgs[i]; 4848 this.addImage( img ); 4849 } 4850 4851 // get child background images 4852 if ( typeof this.options.background == 'string' ) { 4853 var children = elem.querySelectorAll( this.options.background ); 4854 for ( i=0; i < children.length; i++ ) { 4855 var child = children[i]; 4856 this.addElementBackgroundImages( child ); 4857 } 4858 } 4859}; 4860 4861var elementNodeTypes = { 4862 1: true, 4863 9: true, 4864 11: true 4865}; 4866 4867ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) { 4868 var style = getComputedStyle( elem ); 4869 if ( !style ) { 4870 // Firefox returns null if in a hidden iframe https://bugzil.la/548397 4871 return; 4872 } 4873 // get url inside url("...") 4874 var reURL = /url\((['"])?(.*?)\1\)/gi; 4875 var matches = reURL.exec( style.backgroundImage ); 4876 while ( matches !== null ) { 4877 var url = matches && matches[2]; 4878 if ( url ) { 4879 this.addBackground( url, elem ); 4880 } 4881 matches = reURL.exec( style.backgroundImage ); 4882 } 4883}; 4884 4885/** 4886 * @param {Image} img 4887 */ 4888ImagesLoaded.prototype.addImage = function( img ) { 4889 var loadingImage = new LoadingImage( img ); 4890 this.images.push( loadingImage ); 4891}; 4892 4893ImagesLoaded.prototype.addBackground = function( url, elem ) { 4894 var background = new Background( url, elem ); 4895 this.images.push( background ); 4896}; 4897 4898ImagesLoaded.prototype.check = function() { 4899 var _this = this; 4900 this.progressedCount = 0; 4901 this.hasAnyBroken = false; 4902 // complete if no images 4903 if ( !this.images.length ) { 4904 this.complete(); 4905 return; 4906 } 4907 4908 function onProgress( image, elem, message ) { 4909 // HACK - Chrome triggers event before object properties have changed. #83 4910 setTimeout( function() { 4911 _this.progress( image, elem, message ); 4912 }); 4913 } 4914 4915 this.images.forEach( function( loadingImage ) { 4916 loadingImage.once( 'progress', onProgress ); 4917 loadingImage.check(); 4918 }); 4919}; 4920 4921ImagesLoaded.prototype.progress = function( image, elem, message ) { 4922 this.progressedCount++; 4923 this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; 4924 // progress event 4925 this.emitEvent( 'progress', [ this, image, elem ] ); 4926 if ( this.jqDeferred && this.jqDeferred.notify ) { 4927 this.jqDeferred.notify( this, image ); 4928 } 4929 // check if completed 4930 if ( this.progressedCount == this.images.length ) { 4931 this.complete(); 4932 } 4933 4934 if ( this.options.debug && console ) { 4935 console.log( 'progress: ' + message, image, elem ); 4936 } 4937}; 4938 4939ImagesLoaded.prototype.complete = function() { 4940 var eventName = this.hasAnyBroken ? 'fail' : 'done'; 4941 this.isComplete = true; 4942 this.emitEvent( eventName, [ this ] ); 4943 this.emitEvent( 'always', [ this ] ); 4944 if ( this.jqDeferred ) { 4945 var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; 4946 this.jqDeferred[ jqMethod ]( this ); 4947 } 4948}; 4949 4950// -------------------------- -------------------------- // 4951 4952function LoadingImage( img ) { 4953 this.img = img; 4954} 4955 4956LoadingImage.prototype = Object.create( EvEmitter.prototype ); 4957 4958LoadingImage.prototype.check = function() { 4959 // If complete is true and browser supports natural sizes, 4960 // try to check for image status manually. 4961 var isComplete = this.getIsImageComplete(); 4962 if ( isComplete ) { 4963 // report based on naturalWidth 4964 this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); 4965 return; 4966 } 4967 4968 // If none of the checks above matched, simulate loading on detached element. 4969 this.proxyImage = new Image(); 4970 this.proxyImage.addEventListener( 'load', this ); 4971 this.proxyImage.addEventListener( 'error', this ); 4972 // bind to image as well for Firefox. #191 4973 this.img.addEventListener( 'load', this ); 4974 this.img.addEventListener( 'error', this ); 4975 this.proxyImage.src = this.img.src; 4976}; 4977 4978LoadingImage.prototype.getIsImageComplete = function() { 4979 // check for non-zero, non-undefined naturalWidth 4980 // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671 4981 return this.img.complete && this.img.naturalWidth; 4982}; 4983 4984LoadingImage.prototype.confirm = function( isLoaded, message ) { 4985 this.isLoaded = isLoaded; 4986 this.emitEvent( 'progress', [ this, this.img, message ] ); 4987}; 4988 4989// ----- events ----- // 4990 4991// trigger specified handler for event type 4992LoadingImage.prototype.handleEvent = function( event ) { 4993 var method = 'on' + event.type; 4994 if ( this[ method ] ) { 4995 this[ method ]( event ); 4996 } 4997}; 4998 4999LoadingImage.prototype.onload = function() { 5000 this.confirm( true, 'onload' ); 5001 this.unbindEvents(); 5002}; 5003 5004LoadingImage.prototype.onerror = function() { 5005 this.confirm( false, 'onerror' ); 5006 this.unbindEvents(); 5007}; 5008 5009LoadingImage.prototype.unbindEvents = function() { 5010 this.proxyImage.removeEventListener( 'load', this ); 5011 this.proxyImage.removeEventListener( 'error', this ); 5012 this.img.removeEventListener( 'load', this ); 5013 this.img.removeEventListener( 'error', this ); 5014}; 5015 5016// -------------------------- Background -------------------------- // 5017 5018function Background( url, element ) { 5019 this.url = url; 5020 this.element = element; 5021 this.img = new Image(); 5022} 5023 5024// inherit LoadingImage prototype 5025Background.prototype = Object.create( LoadingImage.prototype ); 5026 5027Background.prototype.check = function() { 5028 this.img.addEventListener( 'load', this ); 5029 this.img.addEventListener( 'error', this ); 5030 this.img.src = this.url; 5031 // check if image is already complete 5032 var isComplete = this.getIsImageComplete(); 5033 if ( isComplete ) { 5034 this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); 5035 this.unbindEvents(); 5036 } 5037}; 5038 5039Background.prototype.unbindEvents = function() { 5040 this.img.removeEventListener( 'load', this ); 5041 this.img.removeEventListener( 'error', this ); 5042}; 5043 5044Background.prototype.confirm = function( isLoaded, message ) { 5045 this.isLoaded = isLoaded; 5046 this.emitEvent( 'progress', [ this, this.element, message ] ); 5047}; 5048 5049// -------------------------- jQuery -------------------------- // 5050 5051ImagesLoaded.makeJQueryPlugin = function( jQuery ) { 5052 jQuery = jQuery || window.jQuery; 5053 if ( !jQuery ) { 5054 return; 5055 } 5056 // set local variable 5057 $ = jQuery; 5058 // $().imagesLoaded() 5059 $.fn.imagesLoaded = function( options, callback ) { 5060 var instance = new ImagesLoaded( this, options, callback ); 5061 return instance.jqDeferred.promise( $(this) ); 5062 }; 5063}; 5064// try making plugin 5065ImagesLoaded.makeJQueryPlugin(); 5066 5067// -------------------------- -------------------------- // 5068 5069return ImagesLoaded; 5070 5071}); 5072 5073 5074 5075 /***/ 5076 }, 5077 5078
vendor: 280,924 bytes, lines 5078-15689
5078/***/ "../node_modules/jquery/dist/jquery.js": 5079 /*!*********************************************!*\ 5080 !*** ../node_modules/jquery/dist/jquery.js ***! 5081 \*********************************************/ 5082 /*! no static exports found */ 5083 /***/ function (module, exports, __webpack_require__) { 5084 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 5085 * jQuery JavaScript Library v3.4.1 5086 * https://jquery.com/ 5087 * 5088 * Includes Sizzle.js 5089 * https://sizzlejs.com/ 5090 * 5091 * Copyright JS Foundation and other contributors 5092 * Released under the MIT license 5093 * https://jquery.org/license 5094 * 5095 * Date: 2019-05-01T21:04Z 5096 */ 5097( function( global, factory ) { 5098 5099 "use strict"; 5100 5101 if ( true && typeof module.exports === "object" ) { 5102 5103 // For CommonJS and CommonJS-like environments where a proper `window` 5104 // is present, execute the factory and get jQuery. 5105 // For environments that do not have a `window` with a `document` 5106 // (such as Node.js), expose a factory as module.exports. 5107 // This accentuates the need for the creation of a real `window`. 5108 // e.g. var jQuery = require("jquery")(window); 5109 // See ticket #14549 for more info. 5110 module.exports = global.document ? 5111 factory( global, true ) : 5112 function( w ) { 5113 if ( !w.document ) { 5114 throw new Error( "jQuery requires a window with a document" ); 5115 } 5116 return factory( w ); 5117 }; 5118 } else { 5119 factory( global ); 5120 } 5121 5122// Pass this if window is not defined yet 5123} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 5124 5125// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 5126// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 5127// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 5128// enough that all such attempts are guarded in a try block. 5129"use strict"; 5130 5131var arr = []; 5132 5133var document = window.document; 5134 5135var getProto = Object.getPrototypeOf; 5136 5137var slice = arr.slice; 5138 5139var concat = arr.concat; 5140 5141var push = arr.push; 5142 5143var indexOf = arr.indexOf; 5144 5145var class2type = {}; 5146 5147var toString = class2type.toString; 5148 5149var hasOwn = class2type.hasOwnProperty; 5150 5151var fnToString = hasOwn.toString; 5152 5153var ObjectFunctionString = fnToString.call( Object ); 5154 5155var support = {}; 5156 5157var isFunction = function isFunction( obj ) { 5158 5159 // Support: Chrome <=57, Firefox <=52 5160 // In some browsers, typeof returns "function" for HTML <object> elements 5161 // (i.e., `typeof document.createElement( "object" ) === "function"`). 5162 // We don't want to classify *any* DOM node as a function. 5163 return typeof obj === "function" && typeof obj.nodeType !== "number"; 5164 }; 5165 5166 5167var isWindow = function isWindow( obj ) { 5168 return obj != null && obj === obj.window; 5169 }; 5170 5171 5172 5173 5174 var preservedScriptAttributes = { 5175 type: true, 5176 src: true, 5177 nonce: true, 5178 noModule: true 5179 }; 5180 5181 function DOMEval( code, node, doc ) { 5182 doc = doc || document; 5183 5184 var i, val, 5185 script = doc.createElement( "script" ); 5186 5187 script.text = code; 5188 if ( node ) { 5189 for ( i in preservedScriptAttributes ) { 5190 5191 // Support: Firefox 64+, Edge 18+ 5192 // Some browsers don't support the "nonce" property on scripts. 5193 // On the other hand, just using `getAttribute` is not enough as 5194 // the `nonce` attribute is reset to an empty string whenever it 5195 // becomes browsing-context connected. 5196 // See https://github.com/whatwg/html/issues/2369 5197 // See https://html.spec.whatwg.org/#nonce-attributes 5198 // The `node.getAttribute` check was added for the sake of 5199 // `jQuery.globalEval` so that it can fake a nonce-containing node 5200 // via an object. 5201 val = node[ i ] || node.getAttribute && node.getAttribute( i ); 5202 if ( val ) { 5203 script.setAttribute( i, val ); 5204 } 5205 } 5206 } 5207 doc.head.appendChild( script ).parentNode.removeChild( script ); 5208 } 5209 5210 5211function toType( obj ) { 5212 if ( obj == null ) { 5213 return obj + ""; 5214 } 5215 5216 // Support: Android <=2.3 only (functionish RegExp) 5217 return typeof obj === "object" || typeof obj === "function" ? 5218 class2type[ toString.call( obj ) ] || "object" : 5219 typeof obj; 5220} 5221/* global Symbol */ 5222// Defining this global in .eslintrc.json would create a danger of using the global 5223// unguarded in another place, it seems safer to define global only for this module 5224 5225 5226 5227var 5228 version = "3.4.1", 5229 5230 // Define a local copy of jQuery 5231 jQuery = function( selector, context ) { 5232 5233 // The jQuery object is actually just the init constructor 'enhanced' 5234 // Need init if jQuery is called (just allow error to be thrown if not included) 5235 return new jQuery.fn.init( selector, context ); 5236 }, 5237 5238 // Support: Android <=4.0 only 5239 // Make sure we trim BOM and NBSP 5240 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; 5241 5242jQuery.fn = jQuery.prototype = { 5243 5244 // The current version of jQuery being used 5245 jquery: version, 5246 5247 constructor: jQuery, 5248 5249 // The default length of a jQuery object is 0 5250 length: 0, 5251 5252 toArray: function() { 5253 return slice.call( this ); 5254 }, 5255 5256 // Get the Nth element in the matched element set OR 5257 // Get the whole matched element set as a clean array 5258 get: function( num ) { 5259 5260 // Return all the elements in a clean array 5261 if ( num == null ) { 5262 return slice.call( this ); 5263 } 5264 5265 // Return just the one element from the set 5266 return num < 0 ? this[ num + this.length ] : this[ num ]; 5267 }, 5268 5269 // Take an array of elements and push it onto the stack 5270 // (returning the new matched element set) 5271 pushStack: function( elems ) { 5272 5273 // Build a new jQuery matched element set 5274 var ret = jQuery.merge( this.constructor(), elems ); 5275 5276 // Add the old object onto the stack (as a reference) 5277 ret.prevObject = this; 5278 5279 // Return the newly-formed element set 5280 return ret; 5281 }, 5282 5283 // Execute a callback for every element in the matched set. 5284 each: function( callback ) { 5285 return jQuery.each( this, callback ); 5286 }, 5287 5288 map: function( callback ) { 5289 return this.pushStack( jQuery.map( this, function( elem, i ) { 5290 return callback.call( elem, i, elem ); 5291 } ) ); 5292 }, 5293 5294 slice: function() { 5295 return this.pushStack( slice.apply( this, arguments ) ); 5296 }, 5297 5298 first: function() { 5299 return this.eq( 0 ); 5300 }, 5301 5302 last: function() { 5303 return this.eq( -1 ); 5304 }, 5305 5306 eq: function( i ) { 5307 var len = this.length, 5308 j = +i + ( i < 0 ? len : 0 ); 5309 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 5310 }, 5311 5312 end: function() { 5313 return this.prevObject || this.constructor(); 5314 }, 5315 5316 // For internal use only. 5317 // Behaves like an Array's method, not like a jQuery method. 5318 push: push, 5319 sort: arr.sort, 5320 splice: arr.splice 5321}; 5322 5323jQuery.extend = jQuery.fn.extend = function() { 5324 var options, name, src, copy, copyIsArray, clone, 5325 target = arguments[ 0 ] || {}, 5326 i = 1, 5327 length = arguments.length, 5328 deep = false; 5329 5330 // Handle a deep copy situation 5331 if ( typeof target === "boolean" ) { 5332 deep = target; 5333 5334 // Skip the boolean and the target 5335 target = arguments[ i ] || {}; 5336 i++; 5337 } 5338 5339 // Handle case when target is a string or something (possible in deep copy) 5340 if ( typeof target !== "object" && !isFunction( target ) ) { 5341 target = {}; 5342 } 5343 5344 // Extend jQuery itself if only one argument is passed 5345 if ( i === length ) { 5346 target = this; 5347 i--; 5348 } 5349 5350 for ( ; i < length; i++ ) { 5351 5352 // Only deal with non-null/undefined values 5353 if ( ( options = arguments[ i ] ) != null ) { 5354 5355 // Extend the base object 5356 for ( name in options ) { 5357 copy = options[ name ]; 5358 5359 // Prevent Object.prototype pollution 5360 // Prevent never-ending loop 5361 if ( name === "__proto__" || target === copy ) { 5362 continue; 5363 } 5364 5365 // Recurse if we're merging plain objects or arrays 5366 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 5367 ( copyIsArray = Array.isArray( copy ) ) ) ) { 5368 src = target[ name ]; 5369 5370 // Ensure proper type for the source value 5371 if ( copyIsArray && !Array.isArray( src ) ) { 5372 clone = []; 5373 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { 5374 clone = {}; 5375 } else { 5376 clone = src; 5377 } 5378 copyIsArray = false; 5379 5380 // Never move original objects, clone them 5381 target[ name ] = jQuery.extend( deep, clone, copy ); 5382 5383 // Don't bring in undefined values 5384 } else if ( copy !== undefined ) { 5385 target[ name ] = copy; 5386 } 5387 } 5388 } 5389 } 5390 5391 // Return the modified object 5392 return target; 5393}; 5394 5395jQuery.extend( { 5396 5397 // Unique for each copy of jQuery on the page 5398 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 5399 5400 // Assume jQuery is ready without the ready module 5401 isReady: true, 5402 5403 error: function( msg ) { 5404 throw new Error( msg ); 5405 }, 5406 5407 noop: function() {}, 5408 5409 isPlainObject: function( obj ) { 5410 var proto, Ctor; 5411 5412 // Detect obvious negatives 5413 // Use toString instead of jQuery.type to catch host objects 5414 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 5415 return false; 5416 } 5417 5418 proto = getProto( obj ); 5419 5420 // Objects with no prototype (e.g., `Object.create( null )`) are plain 5421 if ( !proto ) { 5422 return true; 5423 } 5424 5425 // Objects with prototype are plain iff they were constructed by a global Object function 5426 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 5427 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 5428 }, 5429 5430 isEmptyObject: function( obj ) { 5431 var name; 5432 5433 for ( name in obj ) { 5434 return false; 5435 } 5436 return true; 5437 }, 5438 5439 // Evaluates a script in a global context 5440 globalEval: function( code, options ) { 5441 DOMEval( code, { nonce: options && options.nonce } ); 5442 }, 5443 5444 each: function( obj, callback ) { 5445 var length, i = 0; 5446 5447 if ( isArrayLike( obj ) ) { 5448 length = obj.length; 5449 for ( ; i < length; i++ ) { 5450 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 5451 break; 5452 } 5453 } 5454 } else { 5455 for ( i in obj ) { 5456 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 5457 break; 5458 } 5459 } 5460 } 5461 5462 return obj; 5463 }, 5464 5465 // Support: Android <=4.0 only 5466 trim: function( text ) { 5467 return text == null ? 5468 "" : 5469 ( text + "" ).replace( rtrim, "" ); 5470 }, 5471 5472 // results is for internal usage only 5473 makeArray: function( arr, results ) { 5474 var ret = results || []; 5475 5476 if ( arr != null ) { 5477 if ( isArrayLike( Object( arr ) ) ) { 5478 jQuery.merge( ret, 5479 typeof arr === "string" ? 5480 [ arr ] : arr 5481 ); 5482 } else { 5483 push.call( ret, arr ); 5484 } 5485 } 5486 5487 return ret; 5488 }, 5489 5490 inArray: function( elem, arr, i ) { 5491 return arr == null ? -1 : indexOf.call( arr, elem, i ); 5492 }, 5493 5494 // Support: Android <=4.0 only, PhantomJS 1 only 5495 // push.apply(_, arraylike) throws on ancient WebKit 5496 merge: function( first, second ) { 5497 var len = +second.length, 5498 j = 0, 5499 i = first.length; 5500 5501 for ( ; j < len; j++ ) { 5502 first[ i++ ] = second[ j ]; 5503 } 5504 5505 first.length = i; 5506 5507 return first; 5508 }, 5509 5510 grep: function( elems, callback, invert ) { 5511 var callbackInverse, 5512 matches = [], 5513 i = 0, 5514 length = elems.length, 5515 callbackExpect = !invert; 5516 5517 // Go through the array, only saving the items 5518 // that pass the validator function 5519 for ( ; i < length; i++ ) { 5520 callbackInverse = !callback( elems[ i ], i ); 5521 if ( callbackInverse !== callbackExpect ) { 5522 matches.push( elems[ i ] ); 5523 } 5524 } 5525 5526 return matches; 5527 }, 5528 5529 // arg is for internal usage only 5530 map: function( elems, callback, arg ) { 5531 var length, value, 5532 i = 0, 5533 ret = []; 5534 5535 // Go through the array, translating each of the items to their new values 5536 if ( isArrayLike( elems ) ) { 5537 length = elems.length; 5538 for ( ; i < length; i++ ) { 5539 value = callback( elems[ i ], i, arg ); 5540 5541 if ( value != null ) { 5542 ret.push( value ); 5543 } 5544 } 5545 5546 // Go through every key on the object, 5547 } else { 5548 for ( i in elems ) { 5549 value = callback( elems[ i ], i, arg ); 5550 5551 if ( value != null ) { 5552 ret.push( value ); 5553 } 5554 } 5555 } 5556 5557 // Flatten any nested arrays 5558 return concat.apply( [], ret ); 5559 }, 5560 5561 // A global GUID counter for objects 5562 guid: 1, 5563 5564 // jQuery.support is not used in Core but other projects attach their 5565 // properties to it so it needs to exist. 5566 support: support 5567} ); 5568 5569if ( typeof Symbol === "function" ) { 5570 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 5571} 5572 5573// Populate the class2type map 5574jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 5575function( i, name ) { 5576 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 5577} ); 5578 5579function isArrayLike( obj ) { 5580 5581 // Support: real iOS 8.2 only (not reproducible in simulator) 5582 // `in` check used to prevent JIT error (gh-2145) 5583 // hasOwn isn't used here due to false negatives 5584 // regarding Nodelist length in IE 5585 var length = !!obj && "length" in obj && obj.length, 5586 type = toType( obj ); 5587 5588 if ( isFunction( obj ) || isWindow( obj ) ) { 5589 return false; 5590 } 5591 5592 return type === "array" || length === 0 || 5593 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 5594} 5595var Sizzle = 5596/*! 5597 * Sizzle CSS Selector Engine v2.3.4 5598 * https://sizzlejs.com/ 5599 * 5600 * Copyright JS Foundation and other contributors 5601 * Released under the MIT license 5602 * https://js.foundation/ 5603 * 5604 * Date: 2019-04-08 5605 */ 5606(function( window ) { 5607 5608var i, 5609 support, 5610 Expr, 5611 getText, 5612 isXML, 5613 tokenize, 5614 compile, 5615 select, 5616 outermostContext, 5617 sortInput, 5618 hasDuplicate, 5619 5620 // Local document vars 5621 setDocument, 5622 document, 5623 docElem, 5624 documentIsHTML, 5625 rbuggyQSA, 5626 rbuggyMatches, 5627 matches, 5628 contains, 5629 5630 // Instance-specific data 5631 expando = "sizzle" + 1 * new Date(), 5632 preferredDoc = window.document, 5633 dirruns = 0, 5634 done = 0, 5635 classCache = createCache(), 5636 tokenCache = createCache(), 5637 compilerCache = createCache(), 5638 nonnativeSelectorCache = createCache(), 5639 sortOrder = function( a, b ) { 5640 if ( a === b ) { 5641 hasDuplicate = true; 5642 } 5643 return 0; 5644 }, 5645 5646 // Instance methods 5647 hasOwn = ({}).hasOwnProperty, 5648 arr = [], 5649 pop = arr.pop, 5650 push_native = arr.push, 5651 push = arr.push, 5652 slice = arr.slice, 5653 // Use a stripped-down indexOf as it's faster than native 5654 // https://jsperf.com/thor-indexof-vs-for/5 5655 indexOf = function( list, elem ) { 5656 var i = 0, 5657 len = list.length; 5658 for ( ; i < len; i++ ) { 5659 if ( list[i] === elem ) { 5660 return i; 5661 } 5662 } 5663 return -1; 5664 }, 5665 5666 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", 5667 5668 // Regular expressions 5669 5670 // http://www.w3.org/TR/css3-selectors/#whitespace 5671 whitespace = "[\\x20\\t\\r\\n\\f]", 5672 5673 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier 5674 identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", 5675 5676 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 5677 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 5678 // Operator (capture 2) 5679 "*([*^$|!~]?=)" + whitespace + 5680 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 5681 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + 5682 "*\\]", 5683 5684 pseudos = ":(" + identifier + ")(?:\\((" + 5685 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 5686 // 1. quoted (capture 3; capture 4 or capture 5) 5687 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 5688 // 2. simple (capture 6) 5689 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 5690 // 3. anything else (capture 2) 5691 ".*" + 5692 ")\\)|)", 5693 5694 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 5695 rwhitespace = new RegExp( whitespace + "+", "g" ), 5696 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), 5697 5698 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 5699 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), 5700 rdescend = new RegExp( whitespace + "|>" ), 5701 5702 rpseudo = new RegExp( pseudos ), 5703 ridentifier = new RegExp( "^" + identifier + "$" ), 5704 5705 matchExpr = { 5706 "ID": new RegExp( "^#(" + identifier + ")" ), 5707 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), 5708 "TAG": new RegExp( "^(" + identifier + "|[*])" ), 5709 "ATTR": new RegExp( "^" + attributes ), 5710 "PSEUDO": new RegExp( "^" + pseudos ), 5711 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + 5712 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + 5713 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 5714 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 5715 // For use in libraries implementing .is() 5716 // We use this for POS matching in `select` 5717 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + 5718 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 5719 }, 5720 5721 rhtml = /HTML$/i, 5722 rinputs = /^(?:input|select|textarea|button)$/i, 5723 rheader = /^h\d$/i, 5724 5725 rnative = /^[^{]+\{\s*\[native \w/, 5726 5727 // Easily-parseable/retrievable ID or TAG or CLASS selectors 5728 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 5729 5730 rsibling = /[+~]/, 5731 5732 // CSS escapes 5733 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 5734 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), 5735 funescape = function( _, escaped, escapedWhitespace ) { 5736 var high = "0x" + escaped - 0x10000; 5737 // NaN means non-codepoint 5738 // Support: Firefox<24 5739 // Workaround erroneous numeric interpretation of +"0x" 5740 return high !== high || escapedWhitespace ? 5741 escaped : 5742 high < 0 ? 5743 // BMP codepoint 5744 String.fromCharCode( high + 0x10000 ) : 5745 // Supplemental Plane codepoint (surrogate pair) 5746 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 5747 }, 5748 5749 // CSS string/identifier serialization 5750 // https://drafts.csswg.org/cssom/#common-serializing-idioms 5751 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, 5752 fcssescape = function( ch, asCodePoint ) { 5753 if ( asCodePoint ) { 5754 5755 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 5756 if ( ch === "\0" ) { 5757 return "\uFFFD"; 5758 } 5759 5760 // Control characters and (dependent upon position) numbers get escaped as code points 5761 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 5762 } 5763 5764 // Other potentially-special ASCII characters get backslash-escaped 5765 return "\\" + ch; 5766 }, 5767 5768 // Used for iframes 5769 // See setDocument() 5770 // Removing the function wrapper causes a "Permission Denied" 5771 // error in IE 5772 unloadHandler = function() { 5773 setDocument(); 5774 }, 5775 5776 inDisabledFieldset = addCombinator( 5777 function( elem ) { 5778 return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; 5779 }, 5780 { dir: "parentNode", next: "legend" } 5781 ); 5782 5783// Optimize for push.apply( _, NodeList ) 5784try { 5785 push.apply( 5786 (arr = slice.call( preferredDoc.childNodes )), 5787 preferredDoc.childNodes 5788 ); 5789 // Support: Android<4.0 5790 // Detect silently failing push.apply 5791 arr[ preferredDoc.childNodes.length ].nodeType; 5792} catch ( e ) { 5793 push = { apply: arr.length ? 5794 5795 // Leverage slice if possible 5796 function( target, els ) { 5797 push_native.apply( target, slice.call(els) ); 5798 } : 5799 5800 // Support: IE<9 5801 // Otherwise append directly 5802 function( target, els ) { 5803 var j = target.length, 5804 i = 0; 5805 // Can't trust NodeList.length 5806 while ( (target[j++] = els[i++]) ) {} 5807 target.length = j - 1; 5808 } 5809 }; 5810} 5811 5812function Sizzle( selector, context, results, seed ) { 5813 var m, i, elem, nid, match, groups, newSelector, 5814 newContext = context && context.ownerDocument, 5815 5816 // nodeType defaults to 9, since context defaults to document 5817 nodeType = context ? context.nodeType : 9; 5818 5819 results = results || []; 5820 5821 // Return early from calls with invalid selector or context 5822 if ( typeof selector !== "string" || !selector || 5823 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 5824 5825 return results; 5826 } 5827 5828 // Try to shortcut find operations (as opposed to filters) in HTML documents 5829 if ( !seed ) { 5830 5831 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { 5832 setDocument( context ); 5833 } 5834 context = context || document; 5835 5836 if ( documentIsHTML ) { 5837 5838 // If the selector is sufficiently simple, try using a "get*By*" DOM method 5839 // (excepting DocumentFragment context, where the methods don't exist) 5840 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { 5841 5842 // ID selector 5843 if ( (m = match[1]) ) { 5844 5845 // Document context 5846 if ( nodeType === 9 ) { 5847 if ( (elem = context.getElementById( m )) ) { 5848 5849 // Support: IE, Opera, Webkit 5850 // TODO: identify versions 5851 // getElementById can match elements by name instead of ID 5852 if ( elem.id === m ) { 5853 results.push( elem ); 5854 return results; 5855 } 5856 } else { 5857 return results; 5858 } 5859 5860 // Element context 5861 } else { 5862 5863 // Support: IE, Opera, Webkit 5864 // TODO: identify versions 5865 // getElementById can match elements by name instead of ID 5866 if ( newContext && (elem = newContext.getElementById( m )) && 5867 contains( context, elem ) && 5868 elem.id === m ) { 5869 5870 results.push( elem ); 5871 return results; 5872 } 5873 } 5874 5875 // Type selector 5876 } else if ( match[2] ) { 5877 push.apply( results, context.getElementsByTagName( selector ) ); 5878 return results; 5879 5880 // Class selector 5881 } else if ( (m = match[3]) && support.getElementsByClassName && 5882 context.getElementsByClassName ) { 5883 5884 push.apply( results, context.getElementsByClassName( m ) ); 5885 return results; 5886 } 5887 } 5888 5889 // Take advantage of querySelectorAll 5890 if ( support.qsa && 5891 !nonnativeSelectorCache[ selector + " " ] && 5892 (!rbuggyQSA || !rbuggyQSA.test( selector )) && 5893 5894 // Support: IE 8 only 5895 // Exclude object elements 5896 (nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) { 5897 5898 newSelector = selector; 5899 newContext = context; 5900 5901 // qSA considers elements outside a scoping root when evaluating child or 5902 // descendant combinators, which is not what we want. 5903 // In such cases, we work around the behavior by prefixing every selector in the 5904 // list with an ID selector referencing the scope context. 5905 // Thanks to Andrew Dupont for this technique. 5906 if ( nodeType === 1 && rdescend.test( selector ) ) { 5907 5908 // Capture the context ID, setting it first if necessary 5909 if ( (nid = context.getAttribute( "id" )) ) { 5910 nid = nid.replace( rcssescape, fcssescape ); 5911 } else { 5912 context.setAttribute( "id", (nid = expando) ); 5913 } 5914 5915 // Prefix every selector in the list 5916 groups = tokenize( selector ); 5917 i = groups.length; 5918 while ( i-- ) { 5919 groups[i] = "#" + nid + " " + toSelector( groups[i] ); 5920 } 5921 newSelector = groups.join( "," ); 5922 5923 // Expand context for sibling selectors 5924 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 5925 context; 5926 } 5927 5928 try { 5929 push.apply( results, 5930 newContext.querySelectorAll( newSelector ) 5931 ); 5932 return results; 5933 } catch ( qsaError ) { 5934 nonnativeSelectorCache( selector, true ); 5935 } finally { 5936 if ( nid === expando ) { 5937 context.removeAttribute( "id" ); 5938 } 5939 } 5940 } 5941 } 5942 } 5943 5944 // All others 5945 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 5946} 5947 5948/** 5949 * Create key-value caches of limited size 5950 * @returns {function(string, object)} Returns the Object data after storing it on itself with 5951 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 5952 * deleting the oldest entry 5953 */ 5954function createCache() { 5955 var keys = []; 5956 5957 function cache( key, value ) { 5958 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 5959 if ( keys.push( key + " " ) > Expr.cacheLength ) { 5960 // Only keep the most recent entries 5961 delete cache[ keys.shift() ]; 5962 } 5963 return (cache[ key + " " ] = value); 5964 } 5965 return cache; 5966} 5967 5968/** 5969 * Mark a function for special use by Sizzle 5970 * @param {Function} fn The function to mark 5971 */ 5972function markFunction( fn ) { 5973 fn[ expando ] = true; 5974 return fn; 5975} 5976 5977/** 5978 * Support testing using an element 5979 * @param {Function} fn Passed the created element and returns a boolean result 5980 */ 5981function assert( fn ) { 5982 var el = document.createElement("fieldset"); 5983 5984 try { 5985 return !!fn( el ); 5986 } catch (e) { 5987 return false; 5988 } finally { 5989 // Remove from its parent by default 5990 if ( el.parentNode ) { 5991 el.parentNode.removeChild( el ); 5992 } 5993 // release memory in IE 5994 el = null; 5995 } 5996} 5997 5998/** 5999 * Adds the same handler for all of the specified attrs 6000 * @param {String} attrs Pipe-separated list of attributes 6001 * @param {Function} handler The method that will be applied 6002 */ 6003function addHandle( attrs, handler ) { 6004 var arr = attrs.split("|"), 6005 i = arr.length; 6006 6007 while ( i-- ) { 6008 Expr.attrHandle[ arr[i] ] = handler; 6009 } 6010} 6011 6012/** 6013 * Checks document order of two siblings 6014 * @param {Element} a 6015 * @param {Element} b 6016 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 6017 */ 6018function siblingCheck( a, b ) { 6019 var cur = b && a, 6020 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 6021 a.sourceIndex - b.sourceIndex; 6022 6023 // Use IE sourceIndex if available on both nodes 6024 if ( diff ) { 6025 return diff; 6026 } 6027 6028 // Check if b follows a 6029 if ( cur ) { 6030 while ( (cur = cur.nextSibling) ) { 6031 if ( cur === b ) { 6032 return -1; 6033 } 6034 } 6035 } 6036 6037 return a ? 1 : -1; 6038} 6039 6040/** 6041 * Returns a function to use in pseudos for input types 6042 * @param {String} type 6043 */ 6044function createInputPseudo( type ) { 6045 return function( elem ) { 6046 var name = elem.nodeName.toLowerCase(); 6047 return name === "input" && elem.type === type; 6048 }; 6049} 6050 6051/** 6052 * Returns a function to use in pseudos for buttons 6053 * @param {String} type 6054 */ 6055function createButtonPseudo( type ) { 6056 return function( elem ) { 6057 var name = elem.nodeName.toLowerCase(); 6058 return (name === "input" || name === "button") && elem.type === type; 6059 }; 6060} 6061 6062/** 6063 * Returns a function to use in pseudos for :enabled/:disabled 6064 * @param {Boolean} disabled true for :disabled; false for :enabled 6065 */ 6066function createDisabledPseudo( disabled ) { 6067 6068 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 6069 return function( elem ) { 6070 6071 // Only certain elements can match :enabled or :disabled 6072 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 6073 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 6074 if ( "form" in elem ) { 6075 6076 // Check for inherited disabledness on relevant non-disabled elements: 6077 // * listed form-associated elements in a disabled fieldset 6078 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 6079 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 6080 // * option elements in a disabled optgroup 6081 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 6082 // All such elements have a "form" property. 6083 if ( elem.parentNode && elem.disabled === false ) { 6084 6085 // Option elements defer to a parent optgroup if present 6086 if ( "label" in elem ) { 6087 if ( "label" in elem.parentNode ) { 6088 return elem.parentNode.disabled === disabled; 6089 } else { 6090 return elem.disabled === disabled; 6091 } 6092 } 6093 6094 // Support: IE 6 - 11 6095 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 6096 return elem.isDisabled === disabled || 6097 6098 // Where there is no isDisabled, check manually 6099 /* jshint -W018 */ 6100 elem.isDisabled !== !disabled && 6101 inDisabledFieldset( elem ) === disabled; 6102 } 6103 6104 return elem.disabled === disabled; 6105 6106 // Try to winnow out elements that can't be disabled before trusting the disabled property. 6107 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 6108 // even exist on them, let alone have a boolean value. 6109 } else if ( "label" in elem ) { 6110 return elem.disabled === disabled; 6111 } 6112 6113 // Remaining elements are neither :enabled nor :disabled 6114 return false; 6115 }; 6116} 6117 6118/** 6119 * Returns a function to use in pseudos for positionals 6120 * @param {Function} fn 6121 */ 6122function createPositionalPseudo( fn ) { 6123 return markFunction(function( argument ) { 6124 argument = +argument; 6125 return markFunction(function( seed, matches ) { 6126 var j, 6127 matchIndexes = fn( [], seed.length, argument ), 6128 i = matchIndexes.length; 6129 6130 // Match elements found at the specified indexes 6131 while ( i-- ) { 6132 if ( seed[ (j = matchIndexes[i]) ] ) { 6133 seed[j] = !(matches[j] = seed[j]); 6134 } 6135 } 6136 }); 6137 }); 6138} 6139 6140/** 6141 * Checks a node for validity as a Sizzle context 6142 * @param {Element|Object=} context 6143 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 6144 */ 6145function testContext( context ) { 6146 return context && typeof context.getElementsByTagName !== "undefined" && context; 6147} 6148 6149// Expose support vars for convenience 6150support = Sizzle.support = {}; 6151 6152/** 6153 * Detects XML nodes 6154 * @param {Element|Object} elem An element or a document 6155 * @returns {Boolean} True iff elem is a non-HTML XML node 6156 */ 6157isXML = Sizzle.isXML = function( elem ) { 6158 var namespace = elem.namespaceURI, 6159 docElem = (elem.ownerDocument || elem).documentElement; 6160 6161 // Support: IE <=8 6162 // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes 6163 // https://bugs.jquery.com/ticket/4833 6164 return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); 6165}; 6166 6167/** 6168 * Sets document-related variables once based on the current document 6169 * @param {Element|Object} [doc] An element or document object to use to set the document 6170 * @returns {Object} Returns the current document 6171 */ 6172setDocument = Sizzle.setDocument = function( node ) { 6173 var hasCompare, subWindow, 6174 doc = node ? node.ownerDocument || node : preferredDoc; 6175 6176 // Return early if doc is invalid or already selected 6177 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { 6178 return document; 6179 } 6180 6181 // Update global variables 6182 document = doc; 6183 docElem = document.documentElement; 6184 documentIsHTML = !isXML( document ); 6185 6186 // Support: IE 9-11, Edge 6187 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 6188 if ( preferredDoc !== document && 6189 (subWindow = document.defaultView) && subWindow.top !== subWindow ) { 6190 6191 // Support: IE 11, Edge 6192 if ( subWindow.addEventListener ) { 6193 subWindow.addEventListener( "unload", unloadHandler, false ); 6194 6195 // Support: IE 9 - 10 only 6196 } else if ( subWindow.attachEvent ) { 6197 subWindow.attachEvent( "onunload", unloadHandler ); 6198 } 6199 } 6200 6201 /* Attributes 6202 ---------------------------------------------------------------------- */ 6203 6204 // Support: IE<8 6205 // Verify that getAttribute really returns attributes and not properties 6206 // (excepting IE8 booleans) 6207 support.attributes = assert(function( el ) { 6208 el.className = "i"; 6209 return !el.getAttribute("className"); 6210 }); 6211 6212 /* getElement(s)By* 6213 ---------------------------------------------------------------------- */ 6214 6215 // Check if getElementsByTagName("*") returns only elements 6216 support.getElementsByTagName = assert(function( el ) { 6217 el.appendChild( document.createComment("") ); 6218 return !el.getElementsByTagName("*").length; 6219 }); 6220 6221 // Support: IE<9 6222 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); 6223 6224 // Support: IE<10 6225 // Check if getElementById returns elements by name 6226 // The broken getElementById methods don't pick up programmatically-set names, 6227 // so use a roundabout getElementsByName test 6228 support.getById = assert(function( el ) { 6229 docElem.appendChild( el ).id = expando; 6230 return !document.getElementsByName || !document.getElementsByName( expando ).length; 6231 }); 6232 6233 // ID filter and find 6234 if ( support.getById ) { 6235 Expr.filter["ID"] = function( id ) { 6236 var attrId = id.replace( runescape, funescape ); 6237 return function( elem ) { 6238 return elem.getAttribute("id") === attrId; 6239 }; 6240 }; 6241 Expr.find["ID"] = function( id, context ) { 6242 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 6243 var elem = context.getElementById( id ); 6244 return elem ? [ elem ] : []; 6245 } 6246 }; 6247 } else { 6248 Expr.filter["ID"] = function( id ) { 6249 var attrId = id.replace( runescape, funescape ); 6250 return function( elem ) { 6251 var node = typeof elem.getAttributeNode !== "undefined" && 6252 elem.getAttributeNode("id"); 6253 return node && node.value === attrId; 6254 }; 6255 }; 6256 6257 // Support: IE 6 - 7 only 6258 // getElementById is not reliable as a find shortcut 6259 Expr.find["ID"] = function( id, context ) { 6260 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 6261 var node, i, elems, 6262 elem = context.getElementById( id ); 6263 6264 if ( elem ) { 6265 6266 // Verify the id attribute 6267 node = elem.getAttributeNode("id"); 6268 if ( node && node.value === id ) { 6269 return [ elem ]; 6270 } 6271 6272 // Fall back on getElementsByName 6273 elems = context.getElementsByName( id ); 6274 i = 0; 6275 while ( (elem = elems[i++]) ) { 6276 node = elem.getAttributeNode("id"); 6277 if ( node && node.value === id ) { 6278 return [ elem ]; 6279 } 6280 } 6281 } 6282 6283 return []; 6284 } 6285 }; 6286 } 6287 6288 // Tag 6289 Expr.find["TAG"] = support.getElementsByTagName ? 6290 function( tag, context ) { 6291 if ( typeof context.getElementsByTagName !== "undefined" ) { 6292 return context.getElementsByTagName( tag ); 6293 6294 // DocumentFragment nodes don't have gEBTN 6295 } else if ( support.qsa ) { 6296 return context.querySelectorAll( tag ); 6297 } 6298 } : 6299 6300 function( tag, context ) { 6301 var elem, 6302 tmp = [], 6303 i = 0, 6304 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 6305 results = context.getElementsByTagName( tag ); 6306 6307 // Filter out possible comments 6308 if ( tag === "*" ) { 6309 while ( (elem = results[i++]) ) { 6310 if ( elem.nodeType === 1 ) { 6311 tmp.push( elem ); 6312 } 6313 } 6314 6315 return tmp; 6316 } 6317 return results; 6318 }; 6319 6320 // Class 6321 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { 6322 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 6323 return context.getElementsByClassName( className ); 6324 } 6325 }; 6326 6327 /* QSA/matchesSelector 6328 ---------------------------------------------------------------------- */ 6329 6330 // QSA and matchesSelector support 6331 6332 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 6333 rbuggyMatches = []; 6334 6335 // qSa(:focus) reports false when true (Chrome 21) 6336 // We allow this because of a bug in IE8/9 that throws an error 6337 // whenever `document.activeElement` is accessed on an iframe 6338 // So, we allow :focus to pass through QSA all the time to avoid the IE error 6339 // See https://bugs.jquery.com/ticket/13378 6340 rbuggyQSA = []; 6341 6342 if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { 6343 // Build QSA regex 6344 // Regex strategy adopted from Diego Perini 6345 assert(function( el ) { 6346 // Select is set to empty string on purpose 6347 // This is to test IE's treatment of not explicitly 6348 // setting a boolean content attribute, 6349 // since its presence should be enough 6350 // https://bugs.jquery.com/ticket/12359 6351 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + 6352 "<select id='" + expando + "-\r\\' msallowcapture=''>" + 6353 "<option selected=''></option></select>"; 6354 6355 // Support: IE8, Opera 11-12.16 6356 // Nothing should be selected when empty strings follow ^= or $= or *= 6357 // The test attribute must be unknown in Opera but "safe" for WinRT 6358 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 6359 if ( el.querySelectorAll("[msallowcapture^='']").length ) { 6360 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 6361 } 6362 6363 // Support: IE8 6364 // Boolean attributes and "value" are not treated correctly 6365 if ( !el.querySelectorAll("[selected]").length ) { 6366 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 6367 } 6368 6369 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 6370 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 6371 rbuggyQSA.push("~="); 6372 } 6373 6374 // Webkit/Opera - :checked should return selected option elements 6375 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 6376 // IE8 throws error here and will not see later tests 6377 if ( !el.querySelectorAll(":checked").length ) { 6378 rbuggyQSA.push(":checked"); 6379 } 6380 6381 // Support: Safari 8+, iOS 8+ 6382 // https://bugs.webkit.org/show_bug.cgi?id=136851 6383 // In-page `selector#id sibling-combinator selector` fails 6384 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 6385 rbuggyQSA.push(".#.+[+~]"); 6386 } 6387 }); 6388 6389 assert(function( el ) { 6390 el.innerHTML = "<a href='' disabled='disabled'></a>" + 6391 "<select disabled='disabled'><option/></select>"; 6392 6393 // Support: Windows 8 Native Apps 6394 // The type and name attributes are restricted during .innerHTML assignment 6395 var input = document.createElement("input"); 6396 input.setAttribute( "type", "hidden" ); 6397 el.appendChild( input ).setAttribute( "name", "D" ); 6398 6399 // Support: IE8 6400 // Enforce case-sensitivity of name attribute 6401 if ( el.querySelectorAll("[name=d]").length ) { 6402 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 6403 } 6404 6405 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 6406 // IE8 throws error here and will not see later tests 6407 if ( el.querySelectorAll(":enabled").length !== 2 ) { 6408 rbuggyQSA.push( ":enabled", ":disabled" ); 6409 } 6410 6411 // Support: IE9-11+ 6412 // IE's :disabled selector does not pick up the children of disabled fieldsets 6413 docElem.appendChild( el ).disabled = true; 6414 if ( el.querySelectorAll(":disabled").length !== 2 ) { 6415 rbuggyQSA.push( ":enabled", ":disabled" ); 6416 } 6417 6418 // Opera 10-11 does not throw on post-comma invalid pseudos 6419 el.querySelectorAll("*,:x"); 6420 rbuggyQSA.push(",.*:"); 6421 }); 6422 } 6423 6424 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || 6425 docElem.webkitMatchesSelector || 6426 docElem.mozMatchesSelector || 6427 docElem.oMatchesSelector || 6428 docElem.msMatchesSelector) )) ) { 6429 6430 assert(function( el ) { 6431 // Check to see if it's possible to do matchesSelector 6432 // on a disconnected node (IE 9) 6433 support.disconnectedMatch = matches.call( el, "*" ); 6434 6435 // This should fail with an exception 6436 // Gecko does not error, returns false instead 6437 matches.call( el, "[s!='']:x" ); 6438 rbuggyMatches.push( "!=", pseudos ); 6439 }); 6440 } 6441 6442 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); 6443 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); 6444 6445 /* Contains 6446 ---------------------------------------------------------------------- */ 6447 hasCompare = rnative.test( docElem.compareDocumentPosition ); 6448 6449 // Element contains another 6450 // Purposefully self-exclusive 6451 // As in, an element does not contain itself 6452 contains = hasCompare || rnative.test( docElem.contains ) ? 6453 function( a, b ) { 6454 var adown = a.nodeType === 9 ? a.documentElement : a, 6455 bup = b && b.parentNode; 6456 return a === bup || !!( bup && bup.nodeType === 1 && ( 6457 adown.contains ? 6458 adown.contains( bup ) : 6459 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 6460 )); 6461 } : 6462 function( a, b ) { 6463 if ( b ) { 6464 while ( (b = b.parentNode) ) { 6465 if ( b === a ) { 6466 return true; 6467 } 6468 } 6469 } 6470 return false; 6471 }; 6472 6473 /* Sorting 6474 ---------------------------------------------------------------------- */ 6475 6476 // Document order sorting 6477 sortOrder = hasCompare ? 6478 function( a, b ) { 6479 6480 // Flag for duplicate removal 6481 if ( a === b ) { 6482 hasDuplicate = true; 6483 return 0; 6484 } 6485 6486 // Sort on method existence if only one input has compareDocumentPosition 6487 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 6488 if ( compare ) { 6489 return compare; 6490 } 6491 6492 // Calculate position if both inputs belong to the same document 6493 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? 6494 a.compareDocumentPosition( b ) : 6495 6496 // Otherwise we know they are disconnected 6497 1; 6498 6499 // Disconnected nodes 6500 if ( compare & 1 || 6501 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { 6502 6503 // Choose the first element that is related to our preferred document 6504 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { 6505 return -1; 6506 } 6507 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { 6508 return 1; 6509 } 6510 6511 // Maintain original order 6512 return sortInput ? 6513 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 6514 0; 6515 } 6516 6517 return compare & 4 ? -1 : 1; 6518 } : 6519 function( a, b ) { 6520 // Exit early if the nodes are identical 6521 if ( a === b ) { 6522 hasDuplicate = true; 6523 return 0; 6524 } 6525 6526 var cur, 6527 i = 0, 6528 aup = a.parentNode, 6529 bup = b.parentNode, 6530 ap = [ a ], 6531 bp = [ b ]; 6532 6533 // Parentless nodes are either documents or disconnected 6534 if ( !aup || !bup ) { 6535 return a === document ? -1 : 6536 b === document ? 1 : 6537 aup ? -1 : 6538 bup ? 1 : 6539 sortInput ? 6540 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 6541 0; 6542 6543 // If the nodes are siblings, we can do a quick check 6544 } else if ( aup === bup ) { 6545 return siblingCheck( a, b ); 6546 } 6547 6548 // Otherwise we need full lists of their ancestors for comparison 6549 cur = a; 6550 while ( (cur = cur.parentNode) ) { 6551 ap.unshift( cur ); 6552 } 6553 cur = b; 6554 while ( (cur = cur.parentNode) ) { 6555 bp.unshift( cur ); 6556 } 6557 6558 // Walk down the tree looking for a discrepancy 6559 while ( ap[i] === bp[i] ) { 6560 i++; 6561 } 6562 6563 return i ? 6564 // Do a sibling check if the nodes have a common ancestor 6565 siblingCheck( ap[i], bp[i] ) : 6566 6567 // Otherwise nodes in our document sort first 6568 ap[i] === preferredDoc ? -1 : 6569 bp[i] === preferredDoc ? 1 : 6570 0; 6571 }; 6572 6573 return document; 6574}; 6575 6576Sizzle.matches = function( expr, elements ) { 6577 return Sizzle( expr, null, null, elements ); 6578}; 6579 6580Sizzle.matchesSelector = function( elem, expr ) { 6581 // Set document vars if needed 6582 if ( ( elem.ownerDocument || elem ) !== document ) { 6583 setDocument( elem ); 6584 } 6585 6586 if ( support.matchesSelector && documentIsHTML && 6587 !nonnativeSelectorCache[ expr + " " ] && 6588 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 6589 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 6590 6591 try { 6592 var ret = matches.call( elem, expr ); 6593 6594 // IE 9's matchesSelector returns false on disconnected nodes 6595 if ( ret || support.disconnectedMatch || 6596 // As well, disconnected nodes are said to be in a document 6597 // fragment in IE 9 6598 elem.document && elem.document.nodeType !== 11 ) { 6599 return ret; 6600 } 6601 } catch (e) { 6602 nonnativeSelectorCache( expr, true ); 6603 } 6604 } 6605 6606 return Sizzle( expr, document, null, [ elem ] ).length > 0; 6607}; 6608 6609Sizzle.contains = function( context, elem ) { 6610 // Set document vars if needed 6611 if ( ( context.ownerDocument || context ) !== document ) { 6612 setDocument( context ); 6613 } 6614 return contains( context, elem ); 6615}; 6616 6617Sizzle.attr = function( elem, name ) { 6618 // Set document vars if needed 6619 if ( ( elem.ownerDocument || elem ) !== document ) { 6620 setDocument( elem ); 6621 } 6622 6623 var fn = Expr.attrHandle[ name.toLowerCase() ], 6624 // Don't get fooled by Object.prototype properties (jQuery #13807) 6625 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 6626 fn( elem, name, !documentIsHTML ) : 6627 undefined; 6628 6629 return val !== undefined ? 6630 val : 6631 support.attributes || !documentIsHTML ? 6632 elem.getAttribute( name ) : 6633 (val = elem.getAttributeNode(name)) && val.specified ? 6634 val.value : 6635 null; 6636}; 6637 6638Sizzle.escape = function( sel ) { 6639 return (sel + "").replace( rcssescape, fcssescape ); 6640}; 6641 6642Sizzle.error = function( msg ) { 6643 throw new Error( "Syntax error, unrecognized expression: " + msg ); 6644}; 6645 6646/** 6647 * Document sorting and removing duplicates 6648 * @param {ArrayLike} results 6649 */ 6650Sizzle.uniqueSort = function( results ) { 6651 var elem, 6652 duplicates = [], 6653 j = 0, 6654 i = 0; 6655 6656 // Unless we *know* we can detect duplicates, assume their presence 6657 hasDuplicate = !support.detectDuplicates; 6658 sortInput = !support.sortStable && results.slice( 0 ); 6659 results.sort( sortOrder ); 6660 6661 if ( hasDuplicate ) { 6662 while ( (elem = results[i++]) ) { 6663 if ( elem === results[ i ] ) { 6664 j = duplicates.push( i ); 6665 } 6666 } 6667 while ( j-- ) { 6668 results.splice( duplicates[ j ], 1 ); 6669 } 6670 } 6671 6672 // Clear input after sorting to release objects 6673 // See https://github.com/jquery/sizzle/pull/225 6674 sortInput = null; 6675 6676 return results; 6677}; 6678 6679/** 6680 * Utility function for retrieving the text value of an array of DOM nodes 6681 * @param {Array|Element} elem 6682 */ 6683getText = Sizzle.getText = function( elem ) { 6684 var node, 6685 ret = "", 6686 i = 0, 6687 nodeType = elem.nodeType; 6688 6689 if ( !nodeType ) { 6690 // If no nodeType, this is expected to be an array 6691 while ( (node = elem[i++]) ) { 6692 // Do not traverse comment nodes 6693 ret += getText( node ); 6694 } 6695 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 6696 // Use textContent for elements 6697 // innerText usage removed for consistency of new lines (jQuery #11153) 6698 if ( typeof elem.textContent === "string" ) { 6699 return elem.textContent; 6700 } else { 6701 // Traverse its children 6702 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 6703 ret += getText( elem ); 6704 } 6705 } 6706 } else if ( nodeType === 3 || nodeType === 4 ) { 6707 return elem.nodeValue; 6708 } 6709 // Do not include comment or processing instruction nodes 6710 6711 return ret; 6712}; 6713 6714Expr = Sizzle.selectors = { 6715 6716 // Can be adjusted by the user 6717 cacheLength: 50, 6718 6719 createPseudo: markFunction, 6720 6721 match: matchExpr, 6722 6723 attrHandle: {}, 6724 6725 find: {}, 6726 6727 relative: { 6728 ">": { dir: "parentNode", first: true }, 6729 " ": { dir: "parentNode" }, 6730 "+": { dir: "previousSibling", first: true }, 6731 "~": { dir: "previousSibling" } 6732 }, 6733 6734 preFilter: { 6735 "ATTR": function( match ) { 6736 match[1] = match[1].replace( runescape, funescape ); 6737 6738 // Move the given value to match[3] whether quoted or unquoted 6739 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); 6740 6741 if ( match[2] === "~=" ) { 6742 match[3] = " " + match[3] + " "; 6743 } 6744 6745 return match.slice( 0, 4 ); 6746 }, 6747 6748 "CHILD": function( match ) { 6749 /* matches from matchExpr["CHILD"] 6750 1 type (only|nth|...) 6751 2 what (child|of-type) 6752 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 6753 4 xn-component of xn+y argument ([+-]?\d*n|) 6754 5 sign of xn-component 6755 6 x of xn-component 6756 7 sign of y-component 6757 8 y of y-component 6758 */ 6759 match[1] = match[1].toLowerCase(); 6760 6761 if ( match[1].slice( 0, 3 ) === "nth" ) { 6762 // nth-* requires argument 6763 if ( !match[3] ) { 6764 Sizzle.error( match[0] ); 6765 } 6766 6767 // numeric x and y parameters for Expr.filter.CHILD 6768 // remember that false/true cast respectively to 0/1 6769 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); 6770 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); 6771 6772 // other types prohibit arguments 6773 } else if ( match[3] ) { 6774 Sizzle.error( match[0] ); 6775 } 6776 6777 return match; 6778 }, 6779 6780 "PSEUDO": function( match ) { 6781 var excess, 6782 unquoted = !match[6] && match[2]; 6783 6784 if ( matchExpr["CHILD"].test( match[0] ) ) { 6785 return null; 6786 } 6787 6788 // Accept quoted arguments as-is 6789 if ( match[3] ) { 6790 match[2] = match[4] || match[5] || ""; 6791 6792 // Strip excess characters from unquoted arguments 6793 } else if ( unquoted && rpseudo.test( unquoted ) && 6794 // Get excess from tokenize (recursively) 6795 (excess = tokenize( unquoted, true )) && 6796 // advance to the next closing parenthesis 6797 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { 6798 6799 // excess is a negative index 6800 match[0] = match[0].slice( 0, excess ); 6801 match[2] = unquoted.slice( 0, excess ); 6802 } 6803 6804 // Return only captures needed by the pseudo filter method (type and argument) 6805 return match.slice( 0, 3 ); 6806 } 6807 }, 6808 6809 filter: { 6810 6811 "TAG": function( nodeNameSelector ) { 6812 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 6813 return nodeNameSelector === "*" ? 6814 function() { return true; } : 6815 function( elem ) { 6816 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 6817 }; 6818 }, 6819 6820 "CLASS": function( className ) { 6821 var pattern = classCache[ className + " " ]; 6822 6823 return pattern || 6824 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && 6825 classCache( className, function( elem ) { 6826 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); 6827 }); 6828 }, 6829 6830 "ATTR": function( name, operator, check ) { 6831 return function( elem ) { 6832 var result = Sizzle.attr( elem, name ); 6833 6834 if ( result == null ) { 6835 return operator === "!="; 6836 } 6837 if ( !operator ) { 6838 return true; 6839 } 6840 6841 result += ""; 6842 6843 return operator === "=" ? result === check : 6844 operator === "!=" ? result !== check : 6845 operator === "^=" ? check && result.indexOf( check ) === 0 : 6846 operator === "*=" ? check && result.indexOf( check ) > -1 : 6847 operator === "$=" ? check && result.slice( -check.length ) === check : 6848 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 6849 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 6850 false; 6851 }; 6852 }, 6853 6854 "CHILD": function( type, what, argument, first, last ) { 6855 var simple = type.slice( 0, 3 ) !== "nth", 6856 forward = type.slice( -4 ) !== "last", 6857 ofType = what === "of-type"; 6858 6859 return first === 1 && last === 0 ? 6860 6861 // Shortcut for :nth-*(n) 6862 function( elem ) { 6863 return !!elem.parentNode; 6864 } : 6865 6866 function( elem, context, xml ) { 6867 var cache, uniqueCache, outerCache, node, nodeIndex, start, 6868 dir = simple !== forward ? "nextSibling" : "previousSibling", 6869 parent = elem.parentNode, 6870 name = ofType && elem.nodeName.toLowerCase(), 6871 useCache = !xml && !ofType, 6872 diff = false; 6873 6874 if ( parent ) { 6875 6876 // :(first|last|only)-(child|of-type) 6877 if ( simple ) { 6878 while ( dir ) { 6879 node = elem; 6880 while ( (node = node[ dir ]) ) { 6881 if ( ofType ? 6882 node.nodeName.toLowerCase() === name : 6883 node.nodeType === 1 ) { 6884 6885 return false; 6886 } 6887 } 6888 // Reverse direction for :only-* (if we haven't yet done so) 6889 start = dir = type === "only" && !start && "nextSibling"; 6890 } 6891 return true; 6892 } 6893 6894 start = [ forward ? parent.firstChild : parent.lastChild ]; 6895 6896 // non-xml :nth-child(...) stores cache data on `parent` 6897 if ( forward && useCache ) { 6898 6899 // Seek `elem` from a previously-cached index 6900 6901 // ...in a gzip-friendly way 6902 node = parent; 6903 outerCache = node[ expando ] || (node[ expando ] = {}); 6904 6905 // Support: IE <9 only 6906 // Defend against cloned attroperties (jQuery gh-1709) 6907 uniqueCache = outerCache[ node.uniqueID ] || 6908 (outerCache[ node.uniqueID ] = {}); 6909 6910 cache = uniqueCache[ type ] || []; 6911 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 6912 diff = nodeIndex && cache[ 2 ]; 6913 node = nodeIndex && parent.childNodes[ nodeIndex ]; 6914 6915 while ( (node = ++nodeIndex && node && node[ dir ] || 6916 6917 // Fallback to seeking `elem` from the start 6918 (diff = nodeIndex = 0) || start.pop()) ) { 6919 6920 // When found, cache indexes on `parent` and break 6921 if ( node.nodeType === 1 && ++diff && node === elem ) { 6922 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; 6923 break; 6924 } 6925 } 6926 6927 } else { 6928 // Use previously-cached element index if available 6929 if ( useCache ) { 6930 // ...in a gzip-friendly way 6931 node = elem; 6932 outerCache = node[ expando ] || (node[ expando ] = {}); 6933 6934 // Support: IE <9 only 6935 // Defend against cloned attroperties (jQuery gh-1709) 6936 uniqueCache = outerCache[ node.uniqueID ] || 6937 (outerCache[ node.uniqueID ] = {}); 6938 6939 cache = uniqueCache[ type ] || []; 6940 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 6941 diff = nodeIndex; 6942 } 6943 6944 // xml :nth-child(...) 6945 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 6946 if ( diff === false ) { 6947 // Use the same loop as above to seek `elem` from the start 6948 while ( (node = ++nodeIndex && node && node[ dir ] || 6949 (diff = nodeIndex = 0) || start.pop()) ) { 6950 6951 if ( ( ofType ? 6952 node.nodeName.toLowerCase() === name : 6953 node.nodeType === 1 ) && 6954 ++diff ) { 6955 6956 // Cache the index of each encountered element 6957 if ( useCache ) { 6958 outerCache = node[ expando ] || (node[ expando ] = {}); 6959 6960 // Support: IE <9 only 6961 // Defend against cloned attroperties (jQuery gh-1709) 6962 uniqueCache = outerCache[ node.uniqueID ] || 6963 (outerCache[ node.uniqueID ] = {}); 6964 6965 uniqueCache[ type ] = [ dirruns, diff ]; 6966 } 6967 6968 if ( node === elem ) { 6969 break; 6970 } 6971 } 6972 } 6973 } 6974 } 6975 6976 // Incorporate the offset, then check against cycle size 6977 diff -= last; 6978 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 6979 } 6980 }; 6981 }, 6982 6983 "PSEUDO": function( pseudo, argument ) { 6984 // pseudo-class names are case-insensitive 6985 // http://www.w3.org/TR/selectors/#pseudo-classes 6986 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 6987 // Remember that setFilters inherits from pseudos 6988 var args, 6989 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 6990 Sizzle.error( "unsupported pseudo: " + pseudo ); 6991 6992 // The user may use createPseudo to indicate that 6993 // arguments are needed to create the filter function 6994 // just as Sizzle does 6995 if ( fn[ expando ] ) { 6996 return fn( argument ); 6997 } 6998 6999 // But maintain support for old signatures 7000 if ( fn.length > 1 ) { 7001 args = [ pseudo, pseudo, "", argument ]; 7002 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 7003 markFunction(function( seed, matches ) { 7004 var idx, 7005 matched = fn( seed, argument ), 7006 i = matched.length; 7007 while ( i-- ) { 7008 idx = indexOf( seed, matched[i] ); 7009 seed[ idx ] = !( matches[ idx ] = matched[i] ); 7010 } 7011 }) : 7012 function( elem ) { 7013 return fn( elem, 0, args ); 7014 }; 7015 } 7016 7017 return fn; 7018 } 7019 }, 7020 7021 pseudos: { 7022 // Potentially complex pseudos 7023 "not": markFunction(function( selector ) { 7024 // Trim the selector passed to compile 7025 // to avoid treating leading and trailing 7026 // spaces as combinators 7027 var input = [], 7028 results = [], 7029 matcher = compile( selector.replace( rtrim, "$1" ) ); 7030 7031 return matcher[ expando ] ? 7032 markFunction(function( seed, matches, context, xml ) { 7033 var elem, 7034 unmatched = matcher( seed, null, xml, [] ), 7035 i = seed.length; 7036 7037 // Match elements unmatched by `matcher` 7038 while ( i-- ) { 7039 if ( (elem = unmatched[i]) ) { 7040 seed[i] = !(matches[i] = elem); 7041 } 7042 } 7043 }) : 7044 function( elem, context, xml ) { 7045 input[0] = elem; 7046 matcher( input, null, xml, results ); 7047 // Don't keep the element (issue #299) 7048 input[0] = null; 7049 return !results.pop(); 7050 }; 7051 }), 7052 7053 "has": markFunction(function( selector ) { 7054 return function( elem ) { 7055 return Sizzle( selector, elem ).length > 0; 7056 }; 7057 }), 7058 7059 "contains": markFunction(function( text ) { 7060 text = text.replace( runescape, funescape ); 7061 return function( elem ) { 7062 return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; 7063 }; 7064 }), 7065 7066 // "Whether an element is represented by a :lang() selector 7067 // is based solely on the element's language value 7068 // being equal to the identifier C, 7069 // or beginning with the identifier C immediately followed by "-". 7070 // The matching of C against the element's language value is performed case-insensitively. 7071 // The identifier C does not have to be a valid language name." 7072 // http://www.w3.org/TR/selectors/#lang-pseudo 7073 "lang": markFunction( function( lang ) { 7074 // lang value must be a valid identifier 7075 if ( !ridentifier.test(lang || "") ) { 7076 Sizzle.error( "unsupported lang: " + lang ); 7077 } 7078 lang = lang.replace( runescape, funescape ).toLowerCase(); 7079 return function( elem ) { 7080 var elemLang; 7081 do { 7082 if ( (elemLang = documentIsHTML ? 7083 elem.lang : 7084 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { 7085 7086 elemLang = elemLang.toLowerCase(); 7087 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 7088 } 7089 } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); 7090 return false; 7091 }; 7092 }), 7093 7094 // Miscellaneous 7095 "target": function( elem ) { 7096 var hash = window.location && window.location.hash; 7097 return hash && hash.slice( 1 ) === elem.id; 7098 }, 7099 7100 "root": function( elem ) { 7101 return elem === docElem; 7102 }, 7103 7104 "focus": function( elem ) { 7105 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); 7106 }, 7107 7108 // Boolean properties 7109 "enabled": createDisabledPseudo( false ), 7110 "disabled": createDisabledPseudo( true ), 7111 7112 "checked": function( elem ) { 7113 // In CSS3, :checked should return both checked and selected elements 7114 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 7115 var nodeName = elem.nodeName.toLowerCase(); 7116 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); 7117 }, 7118 7119 "selected": function( elem ) { 7120 // Accessing this property makes selected-by-default 7121 // options in Safari work properly 7122 if ( elem.parentNode ) { 7123 elem.parentNode.selectedIndex; 7124 } 7125 7126 return elem.selected === true; 7127 }, 7128 7129 // Contents 7130 "empty": function( elem ) { 7131 // http://www.w3.org/TR/selectors/#empty-pseudo 7132 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 7133 // but not by others (comment: 8; processing instruction: 7; etc.) 7134 // nodeType < 6 works because attributes (2) do not appear as children 7135 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 7136 if ( elem.nodeType < 6 ) { 7137 return false; 7138 } 7139 } 7140 return true; 7141 }, 7142 7143 "parent": function( elem ) { 7144 return !Expr.pseudos["empty"]( elem ); 7145 }, 7146 7147 // Element/input types 7148 "header": function( elem ) { 7149 return rheader.test( elem.nodeName ); 7150 }, 7151 7152 "input": function( elem ) { 7153 return rinputs.test( elem.nodeName ); 7154 }, 7155 7156 "button": function( elem ) { 7157 var name = elem.nodeName.toLowerCase(); 7158 return name === "input" && elem.type === "button" || name === "button"; 7159 }, 7160 7161 "text": function( elem ) { 7162 var attr; 7163 return elem.nodeName.toLowerCase() === "input" && 7164 elem.type === "text" && 7165 7166 // Support: IE<8 7167 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 7168 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); 7169 }, 7170 7171 // Position-in-collection 7172 "first": createPositionalPseudo(function() { 7173 return [ 0 ]; 7174 }), 7175 7176 "last": createPositionalPseudo(function( matchIndexes, length ) { 7177 return [ length - 1 ]; 7178 }), 7179 7180 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { 7181 return [ argument < 0 ? argument + length : argument ]; 7182 }), 7183 7184 "even": createPositionalPseudo(function( matchIndexes, length ) { 7185 var i = 0; 7186 for ( ; i < length; i += 2 ) { 7187 matchIndexes.push( i ); 7188 } 7189 return matchIndexes; 7190 }), 7191 7192 "odd": createPositionalPseudo(function( matchIndexes, length ) { 7193 var i = 1; 7194 for ( ; i < length; i += 2 ) { 7195 matchIndexes.push( i ); 7196 } 7197 return matchIndexes; 7198 }), 7199 7200 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { 7201 var i = argument < 0 ? 7202 argument + length : 7203 argument > length ? 7204 length : 7205 argument; 7206 for ( ; --i >= 0; ) { 7207 matchIndexes.push( i ); 7208 } 7209 return matchIndexes; 7210 }), 7211 7212 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { 7213 var i = argument < 0 ? argument + length : argument; 7214 for ( ; ++i < length; ) { 7215 matchIndexes.push( i ); 7216 } 7217 return matchIndexes; 7218 }) 7219 } 7220}; 7221 7222Expr.pseudos["nth"] = Expr.pseudos["eq"]; 7223 7224// Add button/input type pseudos 7225for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 7226 Expr.pseudos[ i ] = createInputPseudo( i ); 7227} 7228for ( i in { submit: true, reset: true } ) { 7229 Expr.pseudos[ i ] = createButtonPseudo( i ); 7230} 7231 7232// Easy API for creating new setFilters 7233function setFilters() {} 7234setFilters.prototype = Expr.filters = Expr.pseudos; 7235Expr.setFilters = new setFilters(); 7236 7237tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 7238 var matched, match, tokens, type, 7239 soFar, groups, preFilters, 7240 cached = tokenCache[ selector + " " ]; 7241 7242 if ( cached ) { 7243 return parseOnly ? 0 : cached.slice( 0 ); 7244 } 7245 7246 soFar = selector; 7247 groups = []; 7248 preFilters = Expr.preFilter; 7249 7250 while ( soFar ) { 7251 7252 // Comma and first run 7253 if ( !matched || (match = rcomma.exec( soFar )) ) { 7254 if ( match ) { 7255 // Don't consume trailing commas as valid 7256 soFar = soFar.slice( match[0].length ) || soFar; 7257 } 7258 groups.push( (tokens = []) ); 7259 } 7260 7261 matched = false; 7262 7263 // Combinators 7264 if ( (match = rcombinators.exec( soFar )) ) { 7265 matched = match.shift(); 7266 tokens.push({ 7267 value: matched, 7268 // Cast descendant combinators to space 7269 type: match[0].replace( rtrim, " " ) 7270 }); 7271 soFar = soFar.slice( matched.length ); 7272 } 7273 7274 // Filters 7275 for ( type in Expr.filter ) { 7276 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || 7277 (match = preFilters[ type ]( match ))) ) { 7278 matched = match.shift(); 7279 tokens.push({ 7280 value: matched, 7281 type: type, 7282 matches: match 7283 }); 7284 soFar = soFar.slice( matched.length ); 7285 } 7286 } 7287 7288 if ( !matched ) { 7289 break; 7290 } 7291 } 7292 7293 // Return the length of the invalid excess 7294 // if we're just parsing 7295 // Otherwise, throw an error or return tokens 7296 return parseOnly ? 7297 soFar.length : 7298 soFar ? 7299 Sizzle.error( selector ) : 7300 // Cache the tokens 7301 tokenCache( selector, groups ).slice( 0 ); 7302}; 7303 7304function toSelector( tokens ) { 7305 var i = 0, 7306 len = tokens.length, 7307 selector = ""; 7308 for ( ; i < len; i++ ) { 7309 selector += tokens[i].value; 7310 } 7311 return selector; 7312} 7313 7314function addCombinator( matcher, combinator, base ) { 7315 var dir = combinator.dir, 7316 skip = combinator.next, 7317 key = skip || dir, 7318 checkNonElements = base && key === "parentNode", 7319 doneName = done++; 7320 7321 return combinator.first ? 7322 // Check against closest ancestor/preceding element 7323 function( elem, context, xml ) { 7324 while ( (elem = elem[ dir ]) ) { 7325 if ( elem.nodeType === 1 || checkNonElements ) { 7326 return matcher( elem, context, xml ); 7327 } 7328 } 7329 return false; 7330 } : 7331 7332 // Check against all ancestor/preceding elements 7333 function( elem, context, xml ) { 7334 var oldCache, uniqueCache, outerCache, 7335 newCache = [ dirruns, doneName ]; 7336 7337 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 7338 if ( xml ) { 7339 while ( (elem = elem[ dir ]) ) { 7340 if ( elem.nodeType === 1 || checkNonElements ) { 7341 if ( matcher( elem, context, xml ) ) { 7342 return true; 7343 } 7344 } 7345 } 7346 } else { 7347 while ( (elem = elem[ dir ]) ) { 7348 if ( elem.nodeType === 1 || checkNonElements ) { 7349 outerCache = elem[ expando ] || (elem[ expando ] = {}); 7350 7351 // Support: IE <9 only 7352 // Defend against cloned attroperties (jQuery gh-1709) 7353 uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); 7354 7355 if ( skip && skip === elem.nodeName.toLowerCase() ) { 7356 elem = elem[ dir ] || elem; 7357 } else if ( (oldCache = uniqueCache[ key ]) && 7358 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 7359 7360 // Assign to newCache so results back-propagate to previous elements 7361 return (newCache[ 2 ] = oldCache[ 2 ]); 7362 } else { 7363 // Reuse newcache so results back-propagate to previous elements 7364 uniqueCache[ key ] = newCache; 7365 7366 // A match means we're done; a fail means we have to keep checking 7367 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { 7368 return true; 7369 } 7370 } 7371 } 7372 } 7373 } 7374 return false; 7375 }; 7376} 7377 7378function elementMatcher( matchers ) { 7379 return matchers.length > 1 ? 7380 function( elem, context, xml ) { 7381 var i = matchers.length; 7382 while ( i-- ) { 7383 if ( !matchers[i]( elem, context, xml ) ) { 7384 return false; 7385 } 7386 } 7387 return true; 7388 } : 7389 matchers[0]; 7390} 7391 7392function multipleContexts( selector, contexts, results ) { 7393 var i = 0, 7394 len = contexts.length; 7395 for ( ; i < len; i++ ) { 7396 Sizzle( selector, contexts[i], results ); 7397 } 7398 return results; 7399} 7400 7401function condense( unmatched, map, filter, context, xml ) { 7402 var elem, 7403 newUnmatched = [], 7404 i = 0, 7405 len = unmatched.length, 7406 mapped = map != null; 7407 7408 for ( ; i < len; i++ ) { 7409 if ( (elem = unmatched[i]) ) { 7410 if ( !filter || filter( elem, context, xml ) ) { 7411 newUnmatched.push( elem ); 7412 if ( mapped ) { 7413 map.push( i ); 7414 } 7415 } 7416 } 7417 } 7418 7419 return newUnmatched; 7420} 7421 7422function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 7423 if ( postFilter && !postFilter[ expando ] ) { 7424 postFilter = setMatcher( postFilter ); 7425 } 7426 if ( postFinder && !postFinder[ expando ] ) { 7427 postFinder = setMatcher( postFinder, postSelector ); 7428 } 7429 return markFunction(function( seed, results, context, xml ) { 7430 var temp, i, elem, 7431 preMap = [], 7432 postMap = [], 7433 preexisting = results.length, 7434 7435 // Get initial elements from seed or context 7436 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), 7437 7438 // Prefilter to get matcher input, preserving a map for seed-results synchronization 7439 matcherIn = preFilter && ( seed || !selector ) ? 7440 condense( elems, preMap, preFilter, context, xml ) : 7441 elems, 7442 7443 matcherOut = matcher ? 7444 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 7445 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 7446 7447 // ...intermediate processing is necessary 7448 [] : 7449 7450 // ...otherwise use results directly 7451 results : 7452 matcherIn; 7453 7454 // Find primary matches 7455 if ( matcher ) { 7456 matcher( matcherIn, matcherOut, context, xml ); 7457 } 7458 7459 // Apply postFilter 7460 if ( postFilter ) { 7461 temp = condense( matcherOut, postMap ); 7462 postFilter( temp, [], context, xml ); 7463 7464 // Un-match failing elements by moving them back to matcherIn 7465 i = temp.length; 7466 while ( i-- ) { 7467 if ( (elem = temp[i]) ) { 7468 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); 7469 } 7470 } 7471 } 7472 7473 if ( seed ) { 7474 if ( postFinder || preFilter ) { 7475 if ( postFinder ) { 7476 // Get the final matcherOut by condensing this intermediate into postFinder contexts 7477 temp = []; 7478 i = matcherOut.length; 7479 while ( i-- ) { 7480 if ( (elem = matcherOut[i]) ) { 7481 // Restore matcherIn since elem is not yet a final match 7482 temp.push( (matcherIn[i] = elem) ); 7483 } 7484 } 7485 postFinder( null, (matcherOut = []), temp, xml ); 7486 } 7487 7488 // Move matched elements from seed to results to keep them synchronized 7489 i = matcherOut.length; 7490 while ( i-- ) { 7491 if ( (elem = matcherOut[i]) && 7492 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { 7493 7494 seed[temp] = !(results[temp] = elem); 7495 } 7496 } 7497 } 7498 7499 // Add elements to results, through postFinder if defined 7500 } else { 7501 matcherOut = condense( 7502 matcherOut === results ? 7503 matcherOut.splice( preexisting, matcherOut.length ) : 7504 matcherOut 7505 ); 7506 if ( postFinder ) { 7507 postFinder( null, results, matcherOut, xml ); 7508 } else { 7509 push.apply( results, matcherOut ); 7510 } 7511 } 7512 }); 7513} 7514 7515function matcherFromTokens( tokens ) { 7516 var checkContext, matcher, j, 7517 len = tokens.length, 7518 leadingRelative = Expr.relative[ tokens[0].type ], 7519 implicitRelative = leadingRelative || Expr.relative[" "], 7520 i = leadingRelative ? 1 : 0, 7521 7522 // The foundational matcher ensures that elements are reachable from top-level context(s) 7523 matchContext = addCombinator( function( elem ) { 7524 return elem === checkContext; 7525 }, implicitRelative, true ), 7526 matchAnyContext = addCombinator( function( elem ) { 7527 return indexOf( checkContext, elem ) > -1; 7528 }, implicitRelative, true ), 7529 matchers = [ function( elem, context, xml ) { 7530 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 7531 (checkContext = context).nodeType ? 7532 matchContext( elem, context, xml ) : 7533 matchAnyContext( elem, context, xml ) ); 7534 // Avoid hanging onto element (issue #299) 7535 checkContext = null; 7536 return ret; 7537 } ]; 7538 7539 for ( ; i < len; i++ ) { 7540 if ( (matcher = Expr.relative[ tokens[i].type ]) ) { 7541 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; 7542 } else { 7543 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); 7544 7545 // Return special upon seeing a positional matcher 7546 if ( matcher[ expando ] ) { 7547 // Find the next relative operator (if any) for proper handling 7548 j = ++i; 7549 for ( ; j < len; j++ ) { 7550 if ( Expr.relative[ tokens[j].type ] ) { 7551 break; 7552 } 7553 } 7554 return setMatcher( 7555 i > 1 && elementMatcher( matchers ), 7556 i > 1 && toSelector( 7557 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 7558 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) 7559 ).replace( rtrim, "$1" ), 7560 matcher, 7561 i < j && matcherFromTokens( tokens.slice( i, j ) ), 7562 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), 7563 j < len && toSelector( tokens ) 7564 ); 7565 } 7566 matchers.push( matcher ); 7567 } 7568 } 7569 7570 return elementMatcher( matchers ); 7571} 7572 7573function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 7574 var bySet = setMatchers.length > 0, 7575 byElement = elementMatchers.length > 0, 7576 superMatcher = function( seed, context, xml, results, outermost ) { 7577 var elem, j, matcher, 7578 matchedCount = 0, 7579 i = "0", 7580 unmatched = seed && [], 7581 setMatched = [], 7582 contextBackup = outermostContext, 7583 // We must always have either seed elements or outermost context 7584 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), 7585 // Use integer dirruns iff this is the outermost matcher 7586 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), 7587 len = elems.length; 7588 7589 if ( outermost ) { 7590 outermostContext = context === document || context || outermost; 7591 } 7592 7593 // Add elements passing elementMatchers directly to results 7594 // Support: IE<9, Safari 7595 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 7596 for ( ; i !== len && (elem = elems[i]) != null; i++ ) { 7597 if ( byElement && elem ) { 7598 j = 0; 7599 if ( !context && elem.ownerDocument !== document ) { 7600 setDocument( elem ); 7601 xml = !documentIsHTML; 7602 } 7603 while ( (matcher = elementMatchers[j++]) ) { 7604 if ( matcher( elem, context || document, xml) ) { 7605 results.push( elem ); 7606 break; 7607 } 7608 } 7609 if ( outermost ) { 7610 dirruns = dirrunsUnique; 7611 } 7612 } 7613 7614 // Track unmatched elements for set filters 7615 if ( bySet ) { 7616 // They will have gone through all possible matchers 7617 if ( (elem = !matcher && elem) ) { 7618 matchedCount--; 7619 } 7620 7621 // Lengthen the array for every element, matched or not 7622 if ( seed ) { 7623 unmatched.push( elem ); 7624 } 7625 } 7626 } 7627 7628 // `i` is now the count of elements visited above, and adding it to `matchedCount` 7629 // makes the latter nonnegative. 7630 matchedCount += i; 7631 7632 // Apply set filters to unmatched elements 7633 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 7634 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 7635 // no element matchers and no seed. 7636 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 7637 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 7638 // numerically zero. 7639 if ( bySet && i !== matchedCount ) { 7640 j = 0; 7641 while ( (matcher = setMatchers[j++]) ) { 7642 matcher( unmatched, setMatched, context, xml ); 7643 } 7644 7645 if ( seed ) { 7646 // Reintegrate element matches to eliminate the need for sorting 7647 if ( matchedCount > 0 ) { 7648 while ( i-- ) { 7649 if ( !(unmatched[i] || setMatched[i]) ) { 7650 setMatched[i] = pop.call( results ); 7651 } 7652 } 7653 } 7654 7655 // Discard index placeholder values to get only actual matches 7656 setMatched = condense( setMatched ); 7657 } 7658 7659 // Add matches to results 7660 push.apply( results, setMatched ); 7661 7662 // Seedless set matches succeeding multiple successful matchers stipulate sorting 7663 if ( outermost && !seed && setMatched.length > 0 && 7664 ( matchedCount + setMatchers.length ) > 1 ) { 7665 7666 Sizzle.uniqueSort( results ); 7667 } 7668 } 7669 7670 // Override manipulation of globals by nested matchers 7671 if ( outermost ) { 7672 dirruns = dirrunsUnique; 7673 outermostContext = contextBackup; 7674 } 7675 7676 return unmatched; 7677 }; 7678 7679 return bySet ? 7680 markFunction( superMatcher ) : 7681 superMatcher; 7682} 7683 7684compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 7685 var i, 7686 setMatchers = [], 7687 elementMatchers = [], 7688 cached = compilerCache[ selector + " " ]; 7689 7690 if ( !cached ) { 7691 // Generate a function of recursive functions that can be used to check each element 7692 if ( !match ) { 7693 match = tokenize( selector ); 7694 } 7695 i = match.length; 7696 while ( i-- ) { 7697 cached = matcherFromTokens( match[i] ); 7698 if ( cached[ expando ] ) { 7699 setMatchers.push( cached ); 7700 } else { 7701 elementMatchers.push( cached ); 7702 } 7703 } 7704 7705 // Cache the compiled function 7706 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 7707 7708 // Save selector and tokenization 7709 cached.selector = selector; 7710 } 7711 return cached; 7712}; 7713 7714/** 7715 * A low-level selection function that works with Sizzle's compiled 7716 * selector functions 7717 * @param {String|Function} selector A selector or a pre-compiled 7718 * selector function built with Sizzle.compile 7719 * @param {Element} context 7720 * @param {Array} [results] 7721 * @param {Array} [seed] A set of elements to match against 7722 */ 7723select = Sizzle.select = function( selector, context, results, seed ) { 7724 var i, tokens, token, type, find, 7725 compiled = typeof selector === "function" && selector, 7726 match = !seed && tokenize( (selector = compiled.selector || selector) ); 7727 7728 results = results || []; 7729 7730 // Try to minimize operations if there is only one selector in the list and no seed 7731 // (the latter of which guarantees us context) 7732 if ( match.length === 1 ) { 7733 7734 // Reduce context if the leading compound selector is an ID 7735 tokens = match[0] = match[0].slice( 0 ); 7736 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && 7737 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { 7738 7739 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; 7740 if ( !context ) { 7741 return results; 7742 7743 // Precompiled matchers will still verify ancestry, so step up a level 7744 } else if ( compiled ) { 7745 context = context.parentNode; 7746 } 7747 7748 selector = selector.slice( tokens.shift().value.length ); 7749 } 7750 7751 // Fetch a seed set for right-to-left matching 7752 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; 7753 while ( i-- ) { 7754 token = tokens[i]; 7755 7756 // Abort if we hit a combinator 7757 if ( Expr.relative[ (type = token.type) ] ) { 7758 break; 7759 } 7760 if ( (find = Expr.find[ type ]) ) { 7761 // Search, expanding context for leading sibling combinators 7762 if ( (seed = find( 7763 token.matches[0].replace( runescape, funescape ), 7764 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context 7765 )) ) { 7766 7767 // If seed is empty or no tokens remain, we can return early 7768 tokens.splice( i, 1 ); 7769 selector = seed.length && toSelector( tokens ); 7770 if ( !selector ) { 7771 push.apply( results, seed ); 7772 return results; 7773 } 7774 7775 break; 7776 } 7777 } 7778 } 7779 } 7780 7781 // Compile and execute a filtering function if one is not provided 7782 // Provide `match` to avoid retokenization if we modified the selector above 7783 ( compiled || compile( selector, match ) )( 7784 seed, 7785 context, 7786 !documentIsHTML, 7787 results, 7788 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 7789 ); 7790 return results; 7791}; 7792 7793// One-time assignments 7794 7795// Sort stability 7796support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; 7797 7798// Support: Chrome 14-35+ 7799// Always assume duplicates if they aren't passed to the comparison function 7800support.detectDuplicates = !!hasDuplicate; 7801 7802// Initialize against the default document 7803setDocument(); 7804 7805// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 7806// Detached nodes confoundingly follow *each other* 7807support.sortDetached = assert(function( el ) { 7808 // Should return 1, but returns 4 (following) 7809 return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; 7810}); 7811 7812// Support: IE<8 7813// Prevent attribute/property "interpolation" 7814// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 7815if ( !assert(function( el ) { 7816 el.innerHTML = "<a href='#'></a>"; 7817 return el.firstChild.getAttribute("href") === "#" ; 7818}) ) { 7819 addHandle( "type|href|height|width", function( elem, name, isXML ) { 7820 if ( !isXML ) { 7821 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 7822 } 7823 }); 7824} 7825 7826// Support: IE<9 7827// Use defaultValue in place of getAttribute("value") 7828if ( !support.attributes || !assert(function( el ) { 7829 el.innerHTML = "<input/>"; 7830 el.firstChild.setAttribute( "value", "" ); 7831 return el.firstChild.getAttribute( "value" ) === ""; 7832}) ) { 7833 addHandle( "value", function( elem, name, isXML ) { 7834 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 7835 return elem.defaultValue; 7836 } 7837 }); 7838} 7839 7840// Support: IE<9 7841// Use getAttributeNode to fetch booleans when getAttribute lies 7842if ( !assert(function( el ) { 7843 return el.getAttribute("disabled") == null; 7844}) ) { 7845 addHandle( booleans, function( elem, name, isXML ) { 7846 var val; 7847 if ( !isXML ) { 7848 return elem[ name ] === true ? name.toLowerCase() : 7849 (val = elem.getAttributeNode( name )) && val.specified ? 7850 val.value : 7851 null; 7852 } 7853 }); 7854} 7855 7856return Sizzle; 7857 7858})( window ); 7859 7860 7861 7862jQuery.find = Sizzle; 7863jQuery.expr = Sizzle.selectors; 7864 7865// Deprecated 7866jQuery.expr[ ":" ] = jQuery.expr.pseudos; 7867jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 7868jQuery.text = Sizzle.getText; 7869jQuery.isXMLDoc = Sizzle.isXML; 7870jQuery.contains = Sizzle.contains; 7871jQuery.escapeSelector = Sizzle.escape; 7872 7873 7874 7875 7876var dir = function( elem, dir, until ) { 7877 var matched = [], 7878 truncate = until !== undefined; 7879 7880 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 7881 if ( elem.nodeType === 1 ) { 7882 if ( truncate && jQuery( elem ).is( until ) ) { 7883 break; 7884 } 7885 matched.push( elem ); 7886 } 7887 } 7888 return matched; 7889}; 7890 7891 7892var siblings = function( n, elem ) { 7893 var matched = []; 7894 7895 for ( ; n; n = n.nextSibling ) { 7896 if ( n.nodeType === 1 && n !== elem ) { 7897 matched.push( n ); 7898 } 7899 } 7900 7901 return matched; 7902}; 7903 7904 7905var rneedsContext = jQuery.expr.match.needsContext; 7906 7907 7908 7909function nodeName( elem, name ) { 7910 7911 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 7912 7913}; 7914var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 7915 7916 7917 7918// Implement the identical functionality for filter and not 7919function winnow( elements, qualifier, not ) { 7920 if ( isFunction( qualifier ) ) { 7921 return jQuery.grep( elements, function( elem, i ) { 7922 return !!qualifier.call( elem, i, elem ) !== not; 7923 } ); 7924 } 7925 7926 // Single element 7927 if ( qualifier.nodeType ) { 7928 return jQuery.grep( elements, function( elem ) { 7929 return ( elem === qualifier ) !== not; 7930 } ); 7931 } 7932 7933 // Arraylike of elements (jQuery, arguments, Array) 7934 if ( typeof qualifier !== "string" ) { 7935 return jQuery.grep( elements, function( elem ) { 7936 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 7937 } ); 7938 } 7939 7940 // Filtered directly for both simple and complex selectors 7941 return jQuery.filter( qualifier, elements, not ); 7942} 7943 7944jQuery.filter = function( expr, elems, not ) { 7945 var elem = elems[ 0 ]; 7946 7947 if ( not ) { 7948 expr = ":not(" + expr + ")"; 7949 } 7950 7951 if ( elems.length === 1 && elem.nodeType === 1 ) { 7952 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 7953 } 7954 7955 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 7956 return elem.nodeType === 1; 7957 } ) ); 7958}; 7959 7960jQuery.fn.extend( { 7961 find: function( selector ) { 7962 var i, ret, 7963 len = this.length, 7964 self = this; 7965 7966 if ( typeof selector !== "string" ) { 7967 return this.pushStack( jQuery( selector ).filter( function() { 7968 for ( i = 0; i < len; i++ ) { 7969 if ( jQuery.contains( self[ i ], this ) ) { 7970 return true; 7971 } 7972 } 7973 } ) ); 7974 } 7975 7976 ret = this.pushStack( [] ); 7977 7978 for ( i = 0; i < len; i++ ) { 7979 jQuery.find( selector, self[ i ], ret ); 7980 } 7981 7982 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 7983 }, 7984 filter: function( selector ) { 7985 return this.pushStack( winnow( this, selector || [], false ) ); 7986 }, 7987 not: function( selector ) { 7988 return this.pushStack( winnow( this, selector || [], true ) ); 7989 }, 7990 is: function( selector ) { 7991 return !!winnow( 7992 this, 7993 7994 // If this is a positional/relative selector, check membership in the returned set 7995 // so $("p:first").is("p:last") won't return true for a doc with two "p". 7996 typeof selector === "string" && rneedsContext.test( selector ) ? 7997 jQuery( selector ) : 7998 selector || [], 7999 false 8000 ).length; 8001 } 8002} ); 8003 8004 8005// Initialize a jQuery object 8006 8007 8008// A central reference to the root jQuery(document) 8009var rootjQuery, 8010 8011 // A simple way to check for HTML strings 8012 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 8013 // Strict HTML recognition (#11290: must start with <) 8014 // Shortcut simple #id case for speed 8015 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 8016 8017 init = jQuery.fn.init = function( selector, context, root ) { 8018 var match, elem; 8019 8020 // HANDLE: $(""), $(null), $(undefined), $(false) 8021 if ( !selector ) { 8022 return this; 8023 } 8024 8025 // Method init() accepts an alternate rootjQuery 8026 // so migrate can support jQuery.sub (gh-2101) 8027 root = root || rootjQuery; 8028 8029 // Handle HTML strings 8030 if ( typeof selector === "string" ) { 8031 if ( selector[ 0 ] === "<" && 8032 selector[ selector.length - 1 ] === ">" && 8033 selector.length >= 3 ) { 8034 8035 // Assume that strings that start and end with <> are HTML and skip the regex check 8036 match = [ null, selector, null ]; 8037 8038 } else { 8039 match = rquickExpr.exec( selector ); 8040 } 8041 8042 // Match html or make sure no context is specified for #id 8043 if ( match && ( match[ 1 ] || !context ) ) { 8044 8045 // HANDLE: $(html) -> $(array) 8046 if ( match[ 1 ] ) { 8047 context = context instanceof jQuery ? context[ 0 ] : context; 8048 8049 // Option to run scripts is true for back-compat 8050 // Intentionally let the error be thrown if parseHTML is not present 8051 jQuery.merge( this, jQuery.parseHTML( 8052 match[ 1 ], 8053 context && context.nodeType ? context.ownerDocument || context : document, 8054 true 8055 ) ); 8056 8057 // HANDLE: $(html, props) 8058 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 8059 for ( match in context ) { 8060 8061 // Properties of context are called as methods if possible 8062 if ( isFunction( this[ match ] ) ) { 8063 this[ match ]( context[ match ] ); 8064 8065 // ...and otherwise set as attributes 8066 } else { 8067 this.attr( match, context[ match ] ); 8068 } 8069 } 8070 } 8071 8072 return this; 8073 8074 // HANDLE: $(#id) 8075 } else { 8076 elem = document.getElementById( match[ 2 ] ); 8077 8078 if ( elem ) { 8079 8080 // Inject the element directly into the jQuery object 8081 this[ 0 ] = elem; 8082 this.length = 1; 8083 } 8084 return this; 8085 } 8086 8087 // HANDLE: $(expr, $(...)) 8088 } else if ( !context || context.jquery ) { 8089 return ( context || root ).find( selector ); 8090 8091 // HANDLE: $(expr, context) 8092 // (which is just equivalent to: $(context).find(expr) 8093 } else { 8094 return this.constructor( context ).find( selector ); 8095 } 8096 8097 // HANDLE: $(DOMElement) 8098 } else if ( selector.nodeType ) { 8099 this[ 0 ] = selector; 8100 this.length = 1; 8101 return this; 8102 8103 // HANDLE: $(function) 8104 // Shortcut for document ready 8105 } else if ( isFunction( selector ) ) { 8106 return root.ready !== undefined ? 8107 root.ready( selector ) : 8108 8109 // Execute immediately if ready is not present 8110 selector( jQuery ); 8111 } 8112 8113 return jQuery.makeArray( selector, this ); 8114 }; 8115 8116// Give the init function the jQuery prototype for later instantiation 8117init.prototype = jQuery.fn; 8118 8119// Initialize central reference 8120rootjQuery = jQuery( document ); 8121 8122 8123var rparentsprev = /^(?:parents|prev(?:Until|All))/, 8124 8125 // Methods guaranteed to produce a unique set when starting from a unique set 8126 guaranteedUnique = { 8127 children: true, 8128 contents: true, 8129 next: true, 8130 prev: true 8131 }; 8132 8133jQuery.fn.extend( { 8134 has: function( target ) { 8135 var targets = jQuery( target, this ), 8136 l = targets.length; 8137 8138 return this.filter( function() { 8139 var i = 0; 8140 for ( ; i < l; i++ ) { 8141 if ( jQuery.contains( this, targets[ i ] ) ) { 8142 return true; 8143 } 8144 } 8145 } ); 8146 }, 8147 8148 closest: function( selectors, context ) { 8149 var cur, 8150 i = 0, 8151 l = this.length, 8152 matched = [], 8153 targets = typeof selectors !== "string" && jQuery( selectors ); 8154 8155 // Positional selectors never match, since there's no _selection_ context 8156 if ( !rneedsContext.test( selectors ) ) { 8157 for ( ; i < l; i++ ) { 8158 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 8159 8160 // Always skip document fragments 8161 if ( cur.nodeType < 11 && ( targets ? 8162 targets.index( cur ) > -1 : 8163 8164 // Don't pass non-elements to Sizzle 8165 cur.nodeType === 1 && 8166 jQuery.find.matchesSelector( cur, selectors ) ) ) { 8167 8168 matched.push( cur ); 8169 break; 8170 } 8171 } 8172 } 8173 } 8174 8175 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 8176 }, 8177 8178 // Determine the position of an element within the set 8179 index: function( elem ) { 8180 8181 // No argument, return index in parent 8182 if ( !elem ) { 8183 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 8184 } 8185 8186 // Index in selector 8187 if ( typeof elem === "string" ) { 8188 return indexOf.call( jQuery( elem ), this[ 0 ] ); 8189 } 8190 8191 // Locate the position of the desired element 8192 return indexOf.call( this, 8193 8194 // If it receives a jQuery object, the first element is used 8195 elem.jquery ? elem[ 0 ] : elem 8196 ); 8197 }, 8198 8199 add: function( selector, context ) { 8200 return this.pushStack( 8201 jQuery.uniqueSort( 8202 jQuery.merge( this.get(), jQuery( selector, context ) ) 8203 ) 8204 ); 8205 }, 8206 8207 addBack: function( selector ) { 8208 return this.add( selector == null ? 8209 this.prevObject : this.prevObject.filter( selector ) 8210 ); 8211 } 8212} ); 8213 8214function sibling( cur, dir ) { 8215 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 8216 return cur; 8217} 8218 8219jQuery.each( { 8220 parent: function( elem ) { 8221 var parent = elem.parentNode; 8222 return parent && parent.nodeType !== 11 ? parent : null; 8223 }, 8224 parents: function( elem ) { 8225 return dir( elem, "parentNode" ); 8226 }, 8227 parentsUntil: function( elem, i, until ) { 8228 return dir( elem, "parentNode", until ); 8229 }, 8230 next: function( elem ) { 8231 return sibling( elem, "nextSibling" ); 8232 }, 8233 prev: function( elem ) { 8234 return sibling( elem, "previousSibling" ); 8235 }, 8236 nextAll: function( elem ) { 8237 return dir( elem, "nextSibling" ); 8238 }, 8239 prevAll: function( elem ) { 8240 return dir( elem, "previousSibling" ); 8241 }, 8242 nextUntil: function( elem, i, until ) { 8243 return dir( elem, "nextSibling", until ); 8244 }, 8245 prevUntil: function( elem, i, until ) { 8246 return dir( elem, "previousSibling", until ); 8247 }, 8248 siblings: function( elem ) { 8249 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 8250 }, 8251 children: function( elem ) { 8252 return siblings( elem.firstChild ); 8253 }, 8254 contents: function( elem ) { 8255 if ( typeof elem.contentDocument !== "undefined" ) { 8256 return elem.contentDocument; 8257 } 8258 8259 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 8260 // Treat the template element as a regular one in browsers that 8261 // don't support it. 8262 if ( nodeName( elem, "template" ) ) { 8263 elem = elem.content || elem; 8264 } 8265 8266 return jQuery.merge( [], elem.childNodes ); 8267 } 8268}, function( name, fn ) { 8269 jQuery.fn[ name ] = function( until, selector ) { 8270 var matched = jQuery.map( this, fn, until ); 8271 8272 if ( name.slice( -5 ) !== "Until" ) { 8273 selector = until; 8274 } 8275 8276 if ( selector && typeof selector === "string" ) { 8277 matched = jQuery.filter( selector, matched ); 8278 } 8279 8280 if ( this.length > 1 ) { 8281 8282 // Remove duplicates 8283 if ( !guaranteedUnique[ name ] ) { 8284 jQuery.uniqueSort( matched ); 8285 } 8286 8287 // Reverse order for parents* and prev-derivatives 8288 if ( rparentsprev.test( name ) ) { 8289 matched.reverse(); 8290 } 8291 } 8292 8293 return this.pushStack( matched ); 8294 }; 8295} ); 8296var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 8297 8298 8299 8300// Convert String-formatted options into Object-formatted ones 8301function createOptions( options ) { 8302 var object = {}; 8303 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 8304 object[ flag ] = true; 8305 } ); 8306 return object; 8307} 8308 8309/* 8310 * Create a callback list using the following parameters: 8311 * 8312 * options: an optional list of space-separated options that will change how 8313 * the callback list behaves or a more traditional option object 8314 * 8315 * By default a callback list will act like an event callback list and can be 8316 * "fired" multiple times. 8317 * 8318 * Possible options: 8319 * 8320 * once: will ensure the callback list can only be fired once (like a Deferred) 8321 * 8322 * memory: will keep track of previous values and will call any callback added 8323 * after the list has been fired right away with the latest "memorized" 8324 * values (like a Deferred) 8325 * 8326 * unique: will ensure a callback can only be added once (no duplicate in the list) 8327 * 8328 * stopOnFalse: interrupt callings when a callback returns false 8329 * 8330 */ 8331jQuery.Callbacks = function( options ) { 8332 8333 // Convert options from String-formatted to Object-formatted if needed 8334 // (we check in cache first) 8335 options = typeof options === "string" ? 8336 createOptions( options ) : 8337 jQuery.extend( {}, options ); 8338 8339 var // Flag to know if list is currently firing 8340 firing, 8341 8342 // Last fire value for non-forgettable lists 8343 memory, 8344 8345 // Flag to know if list was already fired 8346 fired, 8347 8348 // Flag to prevent firing 8349 locked, 8350 8351 // Actual callback list 8352 list = [], 8353 8354 // Queue of execution data for repeatable lists 8355 queue = [], 8356 8357 // Index of currently firing callback (modified by add/remove as needed) 8358 firingIndex = -1, 8359 8360 // Fire callbacks 8361 fire = function() { 8362 8363 // Enforce single-firing 8364 locked = locked || options.once; 8365 8366 // Execute callbacks for all pending executions, 8367 // respecting firingIndex overrides and runtime changes 8368 fired = firing = true; 8369 for ( ; queue.length; firingIndex = -1 ) { 8370 memory = queue.shift(); 8371 while ( ++firingIndex < list.length ) { 8372 8373 // Run callback and check for early termination 8374 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 8375 options.stopOnFalse ) { 8376 8377 // Jump to end and forget the data so .add doesn't re-fire 8378 firingIndex = list.length; 8379 memory = false; 8380 } 8381 } 8382 } 8383 8384 // Forget the data if we're done with it 8385 if ( !options.memory ) { 8386 memory = false; 8387 } 8388 8389 firing = false; 8390 8391 // Clean up if we're done firing for good 8392 if ( locked ) { 8393 8394 // Keep an empty list if we have data for future add calls 8395 if ( memory ) { 8396 list = []; 8397 8398 // Otherwise, this object is spent 8399 } else { 8400 list = ""; 8401 } 8402 } 8403 }, 8404 8405 // Actual Callbacks object 8406 self = { 8407 8408 // Add a callback or a collection of callbacks to the list 8409 add: function() { 8410 if ( list ) { 8411 8412 // If we have memory from a past run, we should fire after adding 8413 if ( memory && !firing ) { 8414 firingIndex = list.length - 1; 8415 queue.push( memory ); 8416 } 8417 8418 ( function add( args ) { 8419 jQuery.each( args, function( _, arg ) { 8420 if ( isFunction( arg ) ) { 8421 if ( !options.unique || !self.has( arg ) ) { 8422 list.push( arg ); 8423 } 8424 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 8425 8426 // Inspect recursively 8427 add( arg ); 8428 } 8429 } ); 8430 } )( arguments ); 8431 8432 if ( memory && !firing ) { 8433 fire(); 8434 } 8435 } 8436 return this; 8437 }, 8438 8439 // Remove a callback from the list 8440 remove: function() { 8441 jQuery.each( arguments, function( _, arg ) { 8442 var index; 8443 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 8444 list.splice( index, 1 ); 8445 8446 // Handle firing indexes 8447 if ( index <= firingIndex ) { 8448 firingIndex--; 8449 } 8450 } 8451 } ); 8452 return this; 8453 }, 8454 8455 // Check if a given callback is in the list. 8456 // If no argument is given, return whether or not list has callbacks attached. 8457 has: function( fn ) { 8458 return fn ? 8459 jQuery.inArray( fn, list ) > -1 : 8460 list.length > 0; 8461 }, 8462 8463 // Remove all callbacks from the list 8464 empty: function() { 8465 if ( list ) { 8466 list = []; 8467 } 8468 return this; 8469 }, 8470 8471 // Disable .fire and .add 8472 // Abort any current/pending executions 8473 // Clear all callbacks and values 8474 disable: function() { 8475 locked = queue = []; 8476 list = memory = ""; 8477 return this; 8478 }, 8479 disabled: function() { 8480 return !list; 8481 }, 8482 8483 // Disable .fire 8484 // Also disable .add unless we have memory (since it would have no effect) 8485 // Abort any pending executions 8486 lock: function() { 8487 locked = queue = []; 8488 if ( !memory && !firing ) { 8489 list = memory = ""; 8490 } 8491 return this; 8492 }, 8493 locked: function() { 8494 return !!locked; 8495 }, 8496 8497 // Call all callbacks with the given context and arguments 8498 fireWith: function( context, args ) { 8499 if ( !locked ) { 8500 args = args || []; 8501 args = [ context, args.slice ? args.slice() : args ]; 8502 queue.push( args ); 8503 if ( !firing ) { 8504 fire(); 8505 } 8506 } 8507 return this; 8508 }, 8509 8510 // Call all the callbacks with the given arguments 8511 fire: function() { 8512 self.fireWith( this, arguments ); 8513 return this; 8514 }, 8515 8516 // To know if the callbacks have already been called at least once 8517 fired: function() { 8518 return !!fired; 8519 } 8520 }; 8521 8522 return self; 8523}; 8524 8525 8526function Identity( v ) { 8527 return v; 8528} 8529function Thrower( ex ) { 8530 throw ex; 8531} 8532 8533function adoptValue( value, resolve, reject, noValue ) { 8534 var method; 8535 8536 try { 8537 8538 // Check for promise aspect first to privilege synchronous behavior 8539 if ( value && isFunction( ( method = value.promise ) ) ) { 8540 method.call( value ).done( resolve ).fail( reject ); 8541 8542 // Other thenables 8543 } else if ( value && isFunction( ( method = value.then ) ) ) { 8544 method.call( value, resolve, reject ); 8545 8546 // Other non-thenables 8547 } else { 8548 8549 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 8550 // * false: [ value ].slice( 0 ) => resolve( value ) 8551 // * true: [ value ].slice( 1 ) => resolve() 8552 resolve.apply( undefined, [ value ].slice( noValue ) ); 8553 } 8554 8555 // For Promises/A+, convert exceptions into rejections 8556 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 8557 // Deferred#then to conditionally suppress rejection. 8558 } catch ( value ) { 8559 8560 // Support: Android 4.0 only 8561 // Strict mode functions invoked without .call/.apply get global-object context 8562 reject.apply( undefined, [ value ] ); 8563 } 8564} 8565 8566jQuery.extend( { 8567 8568 Deferred: function( func ) { 8569 var tuples = [ 8570 8571 // action, add listener, callbacks, 8572 // ... .then handlers, argument index, [final state] 8573 [ "notify", "progress", jQuery.Callbacks( "memory" ), 8574 jQuery.Callbacks( "memory" ), 2 ], 8575 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 8576 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 8577 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 8578 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 8579 ], 8580 state = "pending", 8581 promise = { 8582 state: function() { 8583 return state; 8584 }, 8585 always: function() { 8586 deferred.done( arguments ).fail( arguments ); 8587 return this; 8588 }, 8589 "catch": function( fn ) { 8590 return promise.then( null, fn ); 8591 }, 8592 8593 // Keep pipe for back-compat 8594 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 8595 var fns = arguments; 8596 8597 return jQuery.Deferred( function( newDefer ) { 8598 jQuery.each( tuples, function( i, tuple ) { 8599 8600 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 8601 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 8602 8603 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 8604 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 8605 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 8606 deferred[ tuple[ 1 ] ]( function() { 8607 var returned = fn && fn.apply( this, arguments ); 8608 if ( returned && isFunction( returned.promise ) ) { 8609 returned.promise() 8610 .progress( newDefer.notify ) 8611 .done( newDefer.resolve ) 8612 .fail( newDefer.reject ); 8613 } else { 8614 newDefer[ tuple[ 0 ] + "With" ]( 8615 this, 8616 fn ? [ returned ] : arguments 8617 ); 8618 } 8619 } ); 8620 } ); 8621 fns = null; 8622 } ).promise(); 8623 }, 8624 then: function( onFulfilled, onRejected, onProgress ) { 8625 var maxDepth = 0; 8626 function resolve( depth, deferred, handler, special ) { 8627 return function() { 8628 var that = this, 8629 args = arguments, 8630 mightThrow = function() { 8631 var returned, then; 8632 8633 // Support: Promises/A+ section 2.3.3.3.3 8634 // https://promisesaplus.com/#point-59 8635 // Ignore double-resolution attempts 8636 if ( depth < maxDepth ) { 8637 return; 8638 } 8639 8640 returned = handler.apply( that, args ); 8641 8642 // Support: Promises/A+ section 2.3.1 8643 // https://promisesaplus.com/#point-48 8644 if ( returned === deferred.promise() ) { 8645 throw new TypeError( "Thenable self-resolution" ); 8646 } 8647 8648 // Support: Promises/A+ sections 2.3.3.1, 3.5 8649 // https://promisesaplus.com/#point-54 8650 // https://promisesaplus.com/#point-75 8651 // Retrieve `then` only once 8652 then = returned && 8653 8654 // Support: Promises/A+ section 2.3.4 8655 // https://promisesaplus.com/#point-64 8656 // Only check objects and functions for thenability 8657 ( typeof returned === "object" || 8658 typeof returned === "function" ) && 8659 returned.then; 8660 8661 // Handle a returned thenable 8662 if ( isFunction( then ) ) { 8663 8664 // Special processors (notify) just wait for resolution 8665 if ( special ) { 8666 then.call( 8667 returned, 8668 resolve( maxDepth, deferred, Identity, special ), 8669 resolve( maxDepth, deferred, Thrower, special ) 8670 ); 8671 8672 // Normal processors (resolve) also hook into progress 8673 } else { 8674 8675 // ...and disregard older resolution values 8676 maxDepth++; 8677 8678 then.call( 8679 returned, 8680 resolve( maxDepth, deferred, Identity, special ), 8681 resolve( maxDepth, deferred, Thrower, special ), 8682 resolve( maxDepth, deferred, Identity, 8683 deferred.notifyWith ) 8684 ); 8685 } 8686 8687 // Handle all other returned values 8688 } else { 8689 8690 // Only substitute handlers pass on context 8691 // and multiple values (non-spec behavior) 8692 if ( handler !== Identity ) { 8693 that = undefined; 8694 args = [ returned ]; 8695 } 8696 8697 // Process the value(s) 8698 // Default process is resolve 8699 ( special || deferred.resolveWith )( that, args ); 8700 } 8701 }, 8702 8703 // Only normal processors (resolve) catch and reject exceptions 8704 process = special ? 8705 mightThrow : 8706 function() { 8707 try { 8708 mightThrow(); 8709 } catch ( e ) { 8710 8711 if ( jQuery.Deferred.exceptionHook ) { 8712 jQuery.Deferred.exceptionHook( e, 8713 process.stackTrace ); 8714 } 8715 8716 // Support: Promises/A+ section 2.3.3.3.4.1 8717 // https://promisesaplus.com/#point-61 8718 // Ignore post-resolution exceptions 8719 if ( depth + 1 >= maxDepth ) { 8720 8721 // Only substitute handlers pass on context 8722 // and multiple values (non-spec behavior) 8723 if ( handler !== Thrower ) { 8724 that = undefined; 8725 args = [ e ]; 8726 } 8727 8728 deferred.rejectWith( that, args ); 8729 } 8730 } 8731 }; 8732 8733 // Support: Promises/A+ section 2.3.3.3.1 8734 // https://promisesaplus.com/#point-57 8735 // Re-resolve promises immediately to dodge false rejection from 8736 // subsequent errors 8737 if ( depth ) { 8738 process(); 8739 } else { 8740 8741 // Call an optional hook to record the stack, in case of exception 8742 // since it's otherwise lost when execution goes async 8743 if ( jQuery.Deferred.getStackHook ) { 8744 process.stackTrace = jQuery.Deferred.getStackHook(); 8745 } 8746 window.setTimeout( process ); 8747 } 8748 }; 8749 } 8750 8751 return jQuery.Deferred( function( newDefer ) { 8752 8753 // progress_handlers.add( ... ) 8754 tuples[ 0 ][ 3 ].add( 8755 resolve( 8756 0, 8757 newDefer, 8758 isFunction( onProgress ) ? 8759 onProgress : 8760 Identity, 8761 newDefer.notifyWith 8762 ) 8763 ); 8764 8765 // fulfilled_handlers.add( ... ) 8766 tuples[ 1 ][ 3 ].add( 8767 resolve( 8768 0, 8769 newDefer, 8770 isFunction( onFulfilled ) ? 8771 onFulfilled : 8772 Identity 8773 ) 8774 ); 8775 8776 // rejected_handlers.add( ... ) 8777 tuples[ 2 ][ 3 ].add( 8778 resolve( 8779 0, 8780 newDefer, 8781 isFunction( onRejected ) ? 8782 onRejected : 8783 Thrower 8784 ) 8785 ); 8786 } ).promise(); 8787 }, 8788 8789 // Get a promise for this deferred 8790 // If obj is provided, the promise aspect is added to the object 8791 promise: function( obj ) { 8792 return obj != null ? jQuery.extend( obj, promise ) : promise; 8793 } 8794 }, 8795 deferred = {}; 8796 8797 // Add list-specific methods 8798 jQuery.each( tuples, function( i, tuple ) { 8799 var list = tuple[ 2 ], 8800 stateString = tuple[ 5 ]; 8801 8802 // promise.progress = list.add 8803 // promise.done = list.add 8804 // promise.fail = list.add 8805 promise[ tuple[ 1 ] ] = list.add; 8806 8807 // Handle state 8808 if ( stateString ) { 8809 list.add( 8810 function() { 8811 8812 // state = "resolved" (i.e., fulfilled) 8813 // state = "rejected" 8814 state = stateString; 8815 }, 8816 8817 // rejected_callbacks.disable 8818 // fulfilled_callbacks.disable 8819 tuples[ 3 - i ][ 2 ].disable, 8820 8821 // rejected_handlers.disable 8822 // fulfilled_handlers.disable 8823 tuples[ 3 - i ][ 3 ].disable, 8824 8825 // progress_callbacks.lock 8826 tuples[ 0 ][ 2 ].lock, 8827 8828 // progress_handlers.lock 8829 tuples[ 0 ][ 3 ].lock 8830 ); 8831 } 8832 8833 // progress_handlers.fire 8834 // fulfilled_handlers.fire 8835 // rejected_handlers.fire 8836 list.add( tuple[ 3 ].fire ); 8837 8838 // deferred.notify = function() { deferred.notifyWith(...) } 8839 // deferred.resolve = function() { deferred.resolveWith(...) } 8840 // deferred.reject = function() { deferred.rejectWith(...) } 8841 deferred[ tuple[ 0 ] ] = function() { 8842 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 8843 return this; 8844 }; 8845 8846 // deferred.notifyWith = list.fireWith 8847 // deferred.resolveWith = list.fireWith 8848 // deferred.rejectWith = list.fireWith 8849 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 8850 } ); 8851 8852 // Make the deferred a promise 8853 promise.promise( deferred ); 8854 8855 // Call given func if any 8856 if ( func ) { 8857 func.call( deferred, deferred ); 8858 } 8859 8860 // All done! 8861 return deferred; 8862 }, 8863 8864 // Deferred helper 8865 when: function( singleValue ) { 8866 var 8867 8868 // count of uncompleted subordinates 8869 remaining = arguments.length, 8870 8871 // count of unprocessed arguments 8872 i = remaining, 8873 8874 // subordinate fulfillment data 8875 resolveContexts = Array( i ), 8876 resolveValues = slice.call( arguments ), 8877 8878 // the master Deferred 8879 master = jQuery.Deferred(), 8880 8881 // subordinate callback factory 8882 updateFunc = function( i ) { 8883 return function( value ) { 8884 resolveContexts[ i ] = this; 8885 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 8886 if ( !( --remaining ) ) { 8887 master.resolveWith( resolveContexts, resolveValues ); 8888 } 8889 }; 8890 }; 8891 8892 // Single- and empty arguments are adopted like Promise.resolve 8893 if ( remaining <= 1 ) { 8894 adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, 8895 !remaining ); 8896 8897 // Use .then() to unwrap secondary thenables (cf. gh-3000) 8898 if ( master.state() === "pending" || 8899 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 8900 8901 return master.then(); 8902 } 8903 } 8904 8905 // Multiple arguments are aggregated like Promise.all array elements 8906 while ( i-- ) { 8907 adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); 8908 } 8909 8910 return master.promise(); 8911 } 8912} ); 8913 8914 8915// These usually indicate a programmer mistake during development, 8916// warn about them ASAP rather than swallowing them by default. 8917var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 8918 8919jQuery.Deferred.exceptionHook = function( error, stack ) { 8920 8921 // Support: IE 8 - 9 only 8922 // Console exists when dev tools are open, which can happen at any time 8923 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 8924 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); 8925 } 8926}; 8927 8928 8929 8930 8931jQuery.readyException = function( error ) { 8932 window.setTimeout( function() { 8933 throw error; 8934 } ); 8935}; 8936 8937 8938 8939 8940// The deferred used on DOM ready 8941var readyList = jQuery.Deferred(); 8942 8943jQuery.fn.ready = function( fn ) { 8944 8945 readyList 8946 .then( fn ) 8947 8948 // Wrap jQuery.readyException in a function so that the lookup 8949 // happens at the time of error handling instead of callback 8950 // registration. 8951 .catch( function( error ) { 8952 jQuery.readyException( error ); 8953 } ); 8954 8955 return this; 8956}; 8957 8958jQuery.extend( { 8959 8960 // Is the DOM ready to be used? Set to true once it occurs. 8961 isReady: false, 8962 8963 // A counter to track how many items to wait for before 8964 // the ready event fires. See #6781 8965 readyWait: 1, 8966 8967 // Handle when the DOM is ready 8968 ready: function( wait ) { 8969 8970 // Abort if there are pending holds or we're already ready 8971 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 8972 return; 8973 } 8974 8975 // Remember that the DOM is ready 8976 jQuery.isReady = true; 8977 8978 // If a normal DOM Ready event fired, decrement, and wait if need be 8979 if ( wait !== true && --jQuery.readyWait > 0 ) { 8980 return; 8981 } 8982 8983 // If there are functions bound, to execute 8984 readyList.resolveWith( document, [ jQuery ] ); 8985 } 8986} ); 8987 8988jQuery.ready.then = readyList.then; 8989 8990// The ready event handler and self cleanup method 8991function completed() { 8992 document.removeEventListener( "DOMContentLoaded", completed ); 8993 window.removeEventListener( "load", completed ); 8994 jQuery.ready(); 8995} 8996 8997// Catch cases where $(document).ready() is called 8998// after the browser event has already occurred. 8999// Support: IE <=9 - 10 only 9000// Older IE sometimes signals "interactive" too soon 9001if ( document.readyState === "complete" || 9002 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 9003 9004 // Handle it asynchronously to allow scripts the opportunity to delay ready 9005 window.setTimeout( jQuery.ready ); 9006 9007} else { 9008 9009 // Use the handy event callback 9010 document.addEventListener( "DOMContentLoaded", completed ); 9011 9012 // A fallback to window.onload, that will always work 9013 window.addEventListener( "load", completed ); 9014} 9015 9016 9017 9018 9019// Multifunctional method to get and set values of a collection 9020// The value/s can optionally be executed if it's a function 9021var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 9022 var i = 0, 9023 len = elems.length, 9024 bulk = key == null; 9025 9026 // Sets many values 9027 if ( toType( key ) === "object" ) { 9028 chainable = true; 9029 for ( i in key ) { 9030 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 9031 } 9032 9033 // Sets one value 9034 } else if ( value !== undefined ) { 9035 chainable = true; 9036 9037 if ( !isFunction( value ) ) { 9038 raw = true; 9039 } 9040 9041 if ( bulk ) { 9042 9043 // Bulk operations run against the entire set 9044 if ( raw ) { 9045 fn.call( elems, value ); 9046 fn = null; 9047 9048 // ...except when executing function values 9049 } else { 9050 bulk = fn; 9051 fn = function( elem, key, value ) { 9052 return bulk.call( jQuery( elem ), value ); 9053 }; 9054 } 9055 } 9056 9057 if ( fn ) { 9058 for ( ; i < len; i++ ) { 9059 fn( 9060 elems[ i ], key, raw ? 9061 value : 9062 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 9063 ); 9064 } 9065 } 9066 } 9067 9068 if ( chainable ) { 9069 return elems; 9070 } 9071 9072 // Gets 9073 if ( bulk ) { 9074 return fn.call( elems ); 9075 } 9076 9077 return len ? fn( elems[ 0 ], key ) : emptyGet; 9078}; 9079 9080 9081// Matches dashed string for camelizing 9082var rmsPrefix = /^-ms-/, 9083 rdashAlpha = /-([a-z])/g; 9084 9085// Used by camelCase as callback to replace() 9086function fcamelCase( all, letter ) { 9087 return letter.toUpperCase(); 9088} 9089 9090// Convert dashed to camelCase; used by the css and data modules 9091// Support: IE <=9 - 11, Edge 12 - 15 9092// Microsoft forgot to hump their vendor prefix (#9572) 9093function camelCase( string ) { 9094 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 9095} 9096var acceptData = function( owner ) { 9097 9098 // Accepts only: 9099 // - Node 9100 // - Node.ELEMENT_NODE 9101 // - Node.DOCUMENT_NODE 9102 // - Object 9103 // - Any 9104 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 9105}; 9106 9107 9108 9109 9110function Data() { 9111 this.expando = jQuery.expando + Data.uid++; 9112} 9113 9114Data.uid = 1; 9115 9116Data.prototype = { 9117 9118 cache: function( owner ) { 9119 9120 // Check if the owner object already has a cache 9121 var value = owner[ this.expando ]; 9122 9123 // If not, create one 9124 if ( !value ) { 9125 value = {}; 9126 9127 // We can accept data for non-element nodes in modern browsers, 9128 // but we should not, see #8335. 9129 // Always return an empty object. 9130 if ( acceptData( owner ) ) { 9131 9132 // If it is a node unlikely to be stringify-ed or looped over 9133 // use plain assignment 9134 if ( owner.nodeType ) { 9135 owner[ this.expando ] = value; 9136 9137 // Otherwise secure it in a non-enumerable property 9138 // configurable must be true to allow the property to be 9139 // deleted when data is removed 9140 } else { 9141 Object.defineProperty( owner, this.expando, { 9142 value: value, 9143 configurable: true 9144 } ); 9145 } 9146 } 9147 } 9148 9149 return value; 9150 }, 9151 set: function( owner, data, value ) { 9152 var prop, 9153 cache = this.cache( owner ); 9154 9155 // Handle: [ owner, key, value ] args 9156 // Always use camelCase key (gh-2257) 9157 if ( typeof data === "string" ) { 9158 cache[ camelCase( data ) ] = value; 9159 9160 // Handle: [ owner, { properties } ] args 9161 } else { 9162 9163 // Copy the properties one-by-one to the cache object 9164 for ( prop in data ) { 9165 cache[ camelCase( prop ) ] = data[ prop ]; 9166 } 9167 } 9168 return cache; 9169 }, 9170 get: function( owner, key ) { 9171 return key === undefined ? 9172 this.cache( owner ) : 9173 9174 // Always use camelCase key (gh-2257) 9175 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 9176 }, 9177 access: function( owner, key, value ) { 9178 9179 // In cases where either: 9180 // 9181 // 1. No key was specified 9182 // 2. A string key was specified, but no value provided 9183 // 9184 // Take the "read" path and allow the get method to determine 9185 // which value to return, respectively either: 9186 // 9187 // 1. The entire cache object 9188 // 2. The data stored at the key 9189 // 9190 if ( key === undefined || 9191 ( ( key && typeof key === "string" ) && value === undefined ) ) { 9192 9193 return this.get( owner, key ); 9194 } 9195 9196 // When the key is not a string, or both a key and value 9197 // are specified, set or extend (existing objects) with either: 9198 // 9199 // 1. An object of properties 9200 // 2. A key and value 9201 // 9202 this.set( owner, key, value ); 9203 9204 // Since the "set" path can have two possible entry points 9205 // return the expected data based on which path was taken[*] 9206 return value !== undefined ? value : key; 9207 }, 9208 remove: function( owner, key ) { 9209 var i, 9210 cache = owner[ this.expando ]; 9211 9212 if ( cache === undefined ) { 9213 return; 9214 } 9215 9216 if ( key !== undefined ) { 9217 9218 // Support array or space separated string of keys 9219 if ( Array.isArray( key ) ) { 9220 9221 // If key is an array of keys... 9222 // We always set camelCase keys, so remove that. 9223 key = key.map( camelCase ); 9224 } else { 9225 key = camelCase( key ); 9226 9227 // If a key with the spaces exists, use it. 9228 // Otherwise, create an array by matching non-whitespace 9229 key = key in cache ? 9230 [ key ] : 9231 ( key.match( rnothtmlwhite ) || [] ); 9232 } 9233 9234 i = key.length; 9235 9236 while ( i-- ) { 9237 delete cache[ key[ i ] ]; 9238 } 9239 } 9240 9241 // Remove the expando if there's no more data 9242 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 9243 9244 // Support: Chrome <=35 - 45 9245 // Webkit & Blink performance suffers when deleting properties 9246 // from DOM nodes, so set to undefined instead 9247 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 9248 if ( owner.nodeType ) { 9249 owner[ this.expando ] = undefined; 9250 } else { 9251 delete owner[ this.expando ]; 9252 } 9253 } 9254 }, 9255 hasData: function( owner ) { 9256 var cache = owner[ this.expando ]; 9257 return cache !== undefined && !jQuery.isEmptyObject( cache ); 9258 } 9259}; 9260var dataPriv = new Data(); 9261 9262var dataUser = new Data(); 9263 9264 9265 9266// Implementation Summary 9267// 9268// 1. Enforce API surface and semantic compatibility with 1.9.x branch 9269// 2. Improve the module's maintainability by reducing the storage 9270// paths to a single mechanism. 9271// 3. Use the same single mechanism to support "private" and "user" data. 9272// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 9273// 5. Avoid exposing implementation details on user objects (eg. expando properties) 9274// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 9275 9276var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 9277 rmultiDash = /[A-Z]/g; 9278 9279function getData( data ) { 9280 if ( data === "true" ) { 9281 return true; 9282 } 9283 9284 if ( data === "false" ) { 9285 return false; 9286 } 9287 9288 if ( data === "null" ) { 9289 return null; 9290 } 9291 9292 // Only convert to a number if it doesn't change the string 9293 if ( data === +data + "" ) { 9294 return +data; 9295 } 9296 9297 if ( rbrace.test( data ) ) { 9298 return JSON.parse( data ); 9299 } 9300 9301 return data; 9302} 9303 9304function dataAttr( elem, key, data ) { 9305 var name; 9306 9307 // If nothing was found internally, try to fetch any 9308 // data from the HTML5 data-* attribute 9309 if ( data === undefined && elem.nodeType === 1 ) { 9310 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 9311 data = elem.getAttribute( name ); 9312 9313 if ( typeof data === "string" ) { 9314 try { 9315 data = getData( data ); 9316 } catch ( e ) {} 9317 9318 // Make sure we set the data so it isn't changed later 9319 dataUser.set( elem, key, data ); 9320 } else { 9321 data = undefined; 9322 } 9323 } 9324 return data; 9325} 9326 9327jQuery.extend( { 9328 hasData: function( elem ) { 9329 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 9330 }, 9331 9332 data: function( elem, name, data ) { 9333 return dataUser.access( elem, name, data ); 9334 }, 9335 9336 removeData: function( elem, name ) { 9337 dataUser.remove( elem, name ); 9338 }, 9339 9340 // TODO: Now that all calls to _data and _removeData have been replaced 9341 // with direct calls to dataPriv methods, these can be deprecated. 9342 _data: function( elem, name, data ) { 9343 return dataPriv.access( elem, name, data ); 9344 }, 9345 9346 _removeData: function( elem, name ) { 9347 dataPriv.remove( elem, name ); 9348 } 9349} ); 9350 9351jQuery.fn.extend( { 9352 data: function( key, value ) { 9353 var i, name, data, 9354 elem = this[ 0 ], 9355 attrs = elem && elem.attributes; 9356 9357 // Gets all values 9358 if ( key === undefined ) { 9359 if ( this.length ) { 9360 data = dataUser.get( elem ); 9361 9362 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 9363 i = attrs.length; 9364 while ( i-- ) { 9365 9366 // Support: IE 11 only 9367 // The attrs elements can be null (#14894) 9368 if ( attrs[ i ] ) { 9369 name = attrs[ i ].name; 9370 if ( name.indexOf( "data-" ) === 0 ) { 9371 name = camelCase( name.slice( 5 ) ); 9372 dataAttr( elem, name, data[ name ] ); 9373 } 9374 } 9375 } 9376 dataPriv.set( elem, "hasDataAttrs", true ); 9377 } 9378 } 9379 9380 return data; 9381 } 9382 9383 // Sets multiple values 9384 if ( typeof key === "object" ) { 9385 return this.each( function() { 9386 dataUser.set( this, key ); 9387 } ); 9388 } 9389 9390 return access( this, function( value ) { 9391 var data; 9392 9393 // The calling jQuery object (element matches) is not empty 9394 // (and therefore has an element appears at this[ 0 ]) and the 9395 // `value` parameter was not undefined. An empty jQuery object 9396 // will result in `undefined` for elem = this[ 0 ] which will 9397 // throw an exception if an attempt to read a data cache is made. 9398 if ( elem && value === undefined ) { 9399 9400 // Attempt to get data from the cache 9401 // The key will always be camelCased in Data 9402 data = dataUser.get( elem, key ); 9403 if ( data !== undefined ) { 9404 return data; 9405 } 9406 9407 // Attempt to "discover" the data in 9408 // HTML5 custom data-* attrs 9409 data = dataAttr( elem, key ); 9410 if ( data !== undefined ) { 9411 return data; 9412 } 9413 9414 // We tried really hard, but the data doesn't exist. 9415 return; 9416 } 9417 9418 // Set the data... 9419 this.each( function() { 9420 9421 // We always store the camelCased key 9422 dataUser.set( this, key, value ); 9423 } ); 9424 }, null, value, arguments.length > 1, null, true ); 9425 }, 9426 9427 removeData: function( key ) { 9428 return this.each( function() { 9429 dataUser.remove( this, key ); 9430 } ); 9431 } 9432} ); 9433 9434 9435jQuery.extend( { 9436 queue: function( elem, type, data ) { 9437 var queue; 9438 9439 if ( elem ) { 9440 type = ( type || "fx" ) + "queue"; 9441 queue = dataPriv.get( elem, type ); 9442 9443 // Speed up dequeue by getting out quickly if this is just a lookup 9444 if ( data ) { 9445 if ( !queue || Array.isArray( data ) ) { 9446 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 9447 } else { 9448 queue.push( data ); 9449 } 9450 } 9451 return queue || []; 9452 } 9453 }, 9454 9455 dequeue: function( elem, type ) { 9456 type = type || "fx"; 9457 9458 var queue = jQuery.queue( elem, type ), 9459 startLength = queue.length, 9460 fn = queue.shift(), 9461 hooks = jQuery._queueHooks( elem, type ), 9462 next = function() { 9463 jQuery.dequeue( elem, type ); 9464 }; 9465 9466 // If the fx queue is dequeued, always remove the progress sentinel 9467 if ( fn === "inprogress" ) { 9468 fn = queue.shift(); 9469 startLength--; 9470 } 9471 9472 if ( fn ) { 9473 9474 // Add a progress sentinel to prevent the fx queue from being 9475 // automatically dequeued 9476 if ( type === "fx" ) { 9477 queue.unshift( "inprogress" ); 9478 } 9479 9480 // Clear up the last queue stop function 9481 delete hooks.stop; 9482 fn.call( elem, next, hooks ); 9483 } 9484 9485 if ( !startLength && hooks ) { 9486 hooks.empty.fire(); 9487 } 9488 }, 9489 9490 // Not public - generate a queueHooks object, or return the current one 9491 _queueHooks: function( elem, type ) { 9492 var key = type + "queueHooks"; 9493 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 9494 empty: jQuery.Callbacks( "once memory" ).add( function() { 9495 dataPriv.remove( elem, [ type + "queue", key ] ); 9496 } ) 9497 } ); 9498 } 9499} ); 9500 9501jQuery.fn.extend( { 9502 queue: function( type, data ) { 9503 var setter = 2; 9504 9505 if ( typeof type !== "string" ) { 9506 data = type; 9507 type = "fx"; 9508 setter--; 9509 } 9510 9511 if ( arguments.length < setter ) { 9512 return jQuery.queue( this[ 0 ], type ); 9513 } 9514 9515 return data === undefined ? 9516 this : 9517 this.each( function() { 9518 var queue = jQuery.queue( this, type, data ); 9519 9520 // Ensure a hooks for this queue 9521 jQuery._queueHooks( this, type ); 9522 9523 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 9524 jQuery.dequeue( this, type ); 9525 } 9526 } ); 9527 }, 9528 dequeue: function( type ) { 9529 return this.each( function() { 9530 jQuery.dequeue( this, type ); 9531 } ); 9532 }, 9533 clearQueue: function( type ) { 9534 return this.queue( type || "fx", [] ); 9535 }, 9536 9537 // Get a promise resolved when queues of a certain type 9538 // are emptied (fx is the type by default) 9539 promise: function( type, obj ) { 9540 var tmp, 9541 count = 1, 9542 defer = jQuery.Deferred(), 9543 elements = this, 9544 i = this.length, 9545 resolve = function() { 9546 if ( !( --count ) ) { 9547 defer.resolveWith( elements, [ elements ] ); 9548 } 9549 }; 9550 9551 if ( typeof type !== "string" ) { 9552 obj = type; 9553 type = undefined; 9554 } 9555 type = type || "fx"; 9556 9557 while ( i-- ) { 9558 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 9559 if ( tmp && tmp.empty ) { 9560 count++; 9561 tmp.empty.add( resolve ); 9562 } 9563 } 9564 resolve(); 9565 return defer.promise( obj ); 9566 } 9567} ); 9568var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 9569 9570var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 9571 9572 9573var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 9574 9575var documentElement = document.documentElement; 9576 9577 9578 9579 var isAttached = function( elem ) { 9580 return jQuery.contains( elem.ownerDocument, elem ); 9581 }, 9582 composed = { composed: true }; 9583 9584 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 9585 // Check attachment across shadow DOM boundaries when possible (gh-3504) 9586 // Support: iOS 10.0-10.2 only 9587 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 9588 // leading to errors. We need to check for `getRootNode`. 9589 if ( documentElement.getRootNode ) { 9590 isAttached = function( elem ) { 9591 return jQuery.contains( elem.ownerDocument, elem ) || 9592 elem.getRootNode( composed ) === elem.ownerDocument; 9593 }; 9594 } 9595var isHiddenWithinTree = function( elem, el ) { 9596 9597 // isHiddenWithinTree might be called from jQuery#filter function; 9598 // in that case, element will be second argument 9599 elem = el || elem; 9600 9601 // Inline style trumps all 9602 return elem.style.display === "none" || 9603 elem.style.display === "" && 9604 9605 // Otherwise, check computed style 9606 // Support: Firefox <=43 - 45 9607 // Disconnected elements can have computed display: none, so first confirm that elem is 9608 // in the document. 9609 isAttached( elem ) && 9610 9611 jQuery.css( elem, "display" ) === "none"; 9612 }; 9613 9614var swap = function( elem, options, callback, args ) { 9615 var ret, name, 9616 old = {}; 9617 9618 // Remember the old values, and insert the new ones 9619 for ( name in options ) { 9620 old[ name ] = elem.style[ name ]; 9621 elem.style[ name ] = options[ name ]; 9622 } 9623 9624 ret = callback.apply( elem, args || [] ); 9625 9626 // Revert the old values 9627 for ( name in options ) { 9628 elem.style[ name ] = old[ name ]; 9629 } 9630 9631 return ret; 9632}; 9633 9634 9635 9636 9637function adjustCSS( elem, prop, valueParts, tween ) { 9638 var adjusted, scale, 9639 maxIterations = 20, 9640 currentValue = tween ? 9641 function() { 9642 return tween.cur(); 9643 } : 9644 function() { 9645 return jQuery.css( elem, prop, "" ); 9646 }, 9647 initial = currentValue(), 9648 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 9649 9650 // Starting value computation is required for potential unit mismatches 9651 initialInUnit = elem.nodeType && 9652 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 9653 rcssNum.exec( jQuery.css( elem, prop ) ); 9654 9655 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 9656 9657 // Support: Firefox <=54 9658 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 9659 initial = initial / 2; 9660 9661 // Trust units reported by jQuery.css 9662 unit = unit || initialInUnit[ 3 ]; 9663 9664 // Iteratively approximate from a nonzero starting point 9665 initialInUnit = +initial || 1; 9666 9667 while ( maxIterations-- ) { 9668 9669 // Evaluate and update our best guess (doubling guesses that zero out). 9670 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 9671 jQuery.style( elem, prop, initialInUnit + unit ); 9672 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 9673 maxIterations = 0; 9674 } 9675 initialInUnit = initialInUnit / scale; 9676 9677 } 9678 9679 initialInUnit = initialInUnit * 2; 9680 jQuery.style( elem, prop, initialInUnit + unit ); 9681 9682 // Make sure we update the tween properties later on 9683 valueParts = valueParts || []; 9684 } 9685 9686 if ( valueParts ) { 9687 initialInUnit = +initialInUnit || +initial || 0; 9688 9689 // Apply relative offset (+=/-=) if specified 9690 adjusted = valueParts[ 1 ] ? 9691 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 9692 +valueParts[ 2 ]; 9693 if ( tween ) { 9694 tween.unit = unit; 9695 tween.start = initialInUnit; 9696 tween.end = adjusted; 9697 } 9698 } 9699 return adjusted; 9700} 9701 9702 9703var defaultDisplayMap = {}; 9704 9705function getDefaultDisplay( elem ) { 9706 var temp, 9707 doc = elem.ownerDocument, 9708 nodeName = elem.nodeName, 9709 display = defaultDisplayMap[ nodeName ]; 9710 9711 if ( display ) { 9712 return display; 9713 } 9714 9715 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 9716 display = jQuery.css( temp, "display" ); 9717 9718 temp.parentNode.removeChild( temp ); 9719 9720 if ( display === "none" ) { 9721 display = "block"; 9722 } 9723 defaultDisplayMap[ nodeName ] = display; 9724 9725 return display; 9726} 9727 9728function showHide( elements, show ) { 9729 var display, elem, 9730 values = [], 9731 index = 0, 9732 length = elements.length; 9733 9734 // Determine new display value for elements that need to change 9735 for ( ; index < length; index++ ) { 9736 elem = elements[ index ]; 9737 if ( !elem.style ) { 9738 continue; 9739 } 9740 9741 display = elem.style.display; 9742 if ( show ) { 9743 9744 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 9745 // check is required in this first loop unless we have a nonempty display value (either 9746 // inline or about-to-be-restored) 9747 if ( display === "none" ) { 9748 values[ index ] = dataPriv.get( elem, "display" ) || null; 9749 if ( !values[ index ] ) { 9750 elem.style.display = ""; 9751 } 9752 } 9753 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 9754 values[ index ] = getDefaultDisplay( elem ); 9755 } 9756 } else { 9757 if ( display !== "none" ) { 9758 values[ index ] = "none"; 9759 9760 // Remember what we're overwriting 9761 dataPriv.set( elem, "display", display ); 9762 } 9763 } 9764 } 9765 9766 // Set the display of the elements in a second loop to avoid constant reflow 9767 for ( index = 0; index < length; index++ ) { 9768 if ( values[ index ] != null ) { 9769 elements[ index ].style.display = values[ index ]; 9770 } 9771 } 9772 9773 return elements; 9774} 9775 9776jQuery.fn.extend( { 9777 show: function() { 9778 return showHide( this, true ); 9779 }, 9780 hide: function() { 9781 return showHide( this ); 9782 }, 9783 toggle: function( state ) { 9784 if ( typeof state === "boolean" ) { 9785 return state ? this.show() : this.hide(); 9786 } 9787 9788 return this.each( function() { 9789 if ( isHiddenWithinTree( this ) ) { 9790 jQuery( this ).show(); 9791 } else { 9792 jQuery( this ).hide(); 9793 } 9794 } ); 9795 } 9796} ); 9797var rcheckableType = ( /^(?:checkbox|radio)$/i ); 9798 9799var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 9800 9801var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 9802 9803 9804 9805// We have to close these tags to support XHTML (#13200) 9806var wrapMap = { 9807 9808 // Support: IE <=9 only 9809 option: [ 1, "<select multiple='multiple'>", "</select>" ], 9810 9811 // XHTML parsers do not magically insert elements in the 9812 // same way that tag soup parsers do. So we cannot shorten 9813 // this by omitting <tbody> or other required elements. 9814 thead: [ 1, "<table>", "</table>" ], 9815 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 9816 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 9817 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 9818 9819 _default: [ 0, "", "" ] 9820}; 9821 9822// Support: IE <=9 only 9823wrapMap.optgroup = wrapMap.option; 9824 9825wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 9826wrapMap.th = wrapMap.td; 9827 9828 9829function getAll( context, tag ) { 9830 9831 // Support: IE <=9 - 11 only 9832 // Use typeof to avoid zero-argument method invocation on host objects (#15151) 9833 var ret; 9834 9835 if ( typeof context.getElementsByTagName !== "undefined" ) { 9836 ret = context.getElementsByTagName( tag || "*" ); 9837 9838 } else if ( typeof context.querySelectorAll !== "undefined" ) { 9839 ret = context.querySelectorAll( tag || "*" ); 9840 9841 } else { 9842 ret = []; 9843 } 9844 9845 if ( tag === undefined || tag && nodeName( context, tag ) ) { 9846 return jQuery.merge( [ context ], ret ); 9847 } 9848 9849 return ret; 9850} 9851 9852 9853// Mark scripts as having already been evaluated 9854function setGlobalEval( elems, refElements ) { 9855 var i = 0, 9856 l = elems.length; 9857 9858 for ( ; i < l; i++ ) { 9859 dataPriv.set( 9860 elems[ i ], 9861 "globalEval", 9862 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 9863 ); 9864 } 9865} 9866 9867 9868var rhtml = /<|&#?\w+;/; 9869 9870function buildFragment( elems, context, scripts, selection, ignored ) { 9871 var elem, tmp, tag, wrap, attached, j, 9872 fragment = context.createDocumentFragment(), 9873 nodes = [], 9874 i = 0, 9875 l = elems.length; 9876 9877 for ( ; i < l; i++ ) { 9878 elem = elems[ i ]; 9879 9880 if ( elem || elem === 0 ) { 9881 9882 // Add nodes directly 9883 if ( toType( elem ) === "object" ) { 9884 9885 // Support: Android <=4.0 only, PhantomJS 1 only 9886 // push.apply(_, arraylike) throws on ancient WebKit 9887 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 9888 9889 // Convert non-html into a text node 9890 } else if ( !rhtml.test( elem ) ) { 9891 nodes.push( context.createTextNode( elem ) ); 9892 9893 // Convert html into DOM nodes 9894 } else { 9895 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 9896 9897 // Deserialize a standard representation 9898 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 9899 wrap = wrapMap[ tag ] || wrapMap._default; 9900 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 9901 9902 // Descend through wrappers to the right content 9903 j = wrap[ 0 ]; 9904 while ( j-- ) { 9905 tmp = tmp.lastChild; 9906 } 9907 9908 // Support: Android <=4.0 only, PhantomJS 1 only 9909 // push.apply(_, arraylike) throws on ancient WebKit 9910 jQuery.merge( nodes, tmp.childNodes ); 9911 9912 // Remember the top-level container 9913 tmp = fragment.firstChild; 9914 9915 // Ensure the created nodes are orphaned (#12392) 9916 tmp.textContent = ""; 9917 } 9918 } 9919 } 9920 9921 // Remove wrapper from fragment 9922 fragment.textContent = ""; 9923 9924 i = 0; 9925 while ( ( elem = nodes[ i++ ] ) ) { 9926 9927 // Skip elements already in the context collection (trac-4087) 9928 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 9929 if ( ignored ) { 9930 ignored.push( elem ); 9931 } 9932 continue; 9933 } 9934 9935 attached = isAttached( elem ); 9936 9937 // Append to fragment 9938 tmp = getAll( fragment.appendChild( elem ), "script" ); 9939 9940 // Preserve script evaluation history 9941 if ( attached ) { 9942 setGlobalEval( tmp ); 9943 } 9944 9945 // Capture executables 9946 if ( scripts ) { 9947 j = 0; 9948 while ( ( elem = tmp[ j++ ] ) ) { 9949 if ( rscriptType.test( elem.type || "" ) ) { 9950 scripts.push( elem ); 9951 } 9952 } 9953 } 9954 } 9955 9956 return fragment; 9957} 9958 9959 9960( function() { 9961 var fragment = document.createDocumentFragment(), 9962 div = fragment.appendChild( document.createElement( "div" ) ), 9963 input = document.createElement( "input" ); 9964 9965 // Support: Android 4.0 - 4.3 only 9966 // Check state lost if the name is set (#11217) 9967 // Support: Windows Web Apps (WWA) 9968 // `name` and `type` must use .setAttribute for WWA (#14901) 9969 input.setAttribute( "type", "radio" ); 9970 input.setAttribute( "checked", "checked" ); 9971 input.setAttribute( "name", "t" ); 9972 9973 div.appendChild( input ); 9974 9975 // Support: Android <=4.1 only 9976 // Older WebKit doesn't clone checked state correctly in fragments 9977 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 9978 9979 // Support: IE <=11 only 9980 // Make sure textarea (and checkbox) defaultValue is properly cloned 9981 div.innerHTML = "<textarea>x</textarea>"; 9982 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 9983} )(); 9984 9985 9986var 9987 rkeyEvent = /^key/, 9988 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, 9989 rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 9990 9991function returnTrue() { 9992 return true; 9993} 9994 9995function returnFalse() { 9996 return false; 9997} 9998 9999// Support: IE <=9 - 11+ 10000// focus() and blur() are asynchronous, except when they are no-op. 10001// So expect focus to be synchronous when the element is already active, 10002// and blur to be synchronous when the element is not already active. 10003// (focus and blur are always synchronous in other supported browsers, 10004// this just defines when we can count on it). 10005function expectSync( elem, type ) { 10006 return ( elem === safeActiveElement() ) === ( type === "focus" ); 10007} 10008 10009// Support: IE <=9 only 10010// Accessing document.activeElement can throw unexpectedly 10011// https://bugs.jquery.com/ticket/13393 10012function safeActiveElement() { 10013 try { 10014 return document.activeElement; 10015 } catch ( err ) { } 10016} 10017 10018function on( elem, types, selector, data, fn, one ) { 10019 var origFn, type; 10020 10021 // Types can be a map of types/handlers 10022 if ( typeof types === "object" ) { 10023 10024 // ( types-Object, selector, data ) 10025 if ( typeof selector !== "string" ) { 10026 10027 // ( types-Object, data ) 10028 data = data || selector; 10029 selector = undefined; 10030 } 10031 for ( type in types ) { 10032 on( elem, type, selector, data, types[ type ], one ); 10033 } 10034 return elem; 10035 } 10036 10037 if ( data == null && fn == null ) { 10038 10039 // ( types, fn ) 10040 fn = selector; 10041 data = selector = undefined; 10042 } else if ( fn == null ) { 10043 if ( typeof selector === "string" ) { 10044 10045 // ( types, selector, fn ) 10046 fn = data; 10047 data = undefined; 10048 } else { 10049 10050 // ( types, data, fn ) 10051 fn = data; 10052 data = selector; 10053 selector = undefined; 10054 } 10055 } 10056 if ( fn === false ) { 10057 fn = returnFalse; 10058 } else if ( !fn ) { 10059 return elem; 10060 } 10061 10062 if ( one === 1 ) { 10063 origFn = fn; 10064 fn = function( event ) { 10065 10066 // Can use an empty set, since event contains the info 10067 jQuery().off( event ); 10068 return origFn.apply( this, arguments ); 10069 }; 10070 10071 // Use same guid so caller can remove using origFn 10072 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 10073 } 10074 return elem.each( function() { 10075 jQuery.event.add( this, types, fn, data, selector ); 10076 } ); 10077} 10078 10079/* 10080 * Helper functions for managing events -- not part of the public interface. 10081 * Props to Dean Edwards' addEvent library for many of the ideas. 10082 */ 10083jQuery.event = { 10084 10085 global: {}, 10086 10087 add: function( elem, types, handler, data, selector ) { 10088 10089 var handleObjIn, eventHandle, tmp, 10090 events, t, handleObj, 10091 special, handlers, type, namespaces, origType, 10092 elemData = dataPriv.get( elem ); 10093 10094 // Don't attach events to noData or text/comment nodes (but allow plain objects) 10095 if ( !elemData ) { 10096 return; 10097 } 10098 10099 // Caller can pass in an object of custom data in lieu of the handler 10100 if ( handler.handler ) { 10101 handleObjIn = handler; 10102 handler = handleObjIn.handler; 10103 selector = handleObjIn.selector; 10104 } 10105 10106 // Ensure that invalid selectors throw exceptions at attach time 10107 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 10108 if ( selector ) { 10109 jQuery.find.matchesSelector( documentElement, selector ); 10110 } 10111 10112 // Make sure that the handler has a unique ID, used to find/remove it later 10113 if ( !handler.guid ) { 10114 handler.guid = jQuery.guid++; 10115 } 10116 10117 // Init the element's event structure and main handler, if this is the first 10118 if ( !( events = elemData.events ) ) { 10119 events = elemData.events = {}; 10120 } 10121 if ( !( eventHandle = elemData.handle ) ) { 10122 eventHandle = elemData.handle = function( e ) { 10123 10124 // Discard the second event of a jQuery.event.trigger() and 10125 // when an event is called after a page has unloaded 10126 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 10127 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 10128 }; 10129 } 10130 10131 // Handle multiple events separated by a space 10132 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 10133 t = types.length; 10134 while ( t-- ) { 10135 tmp = rtypenamespace.exec( types[ t ] ) || []; 10136 type = origType = tmp[ 1 ]; 10137 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 10138 10139 // There *must* be a type, no attaching namespace-only handlers 10140 if ( !type ) { 10141 continue; 10142 } 10143 10144 // If event changes its type, use the special event handlers for the changed type 10145 special = jQuery.event.special[ type ] || {}; 10146 10147 // If selector defined, determine special event api type, otherwise given type 10148 type = ( selector ? special.delegateType : special.bindType ) || type; 10149 10150 // Update special based on newly reset type 10151 special = jQuery.event.special[ type ] || {}; 10152 10153 // handleObj is passed to all event handlers 10154 handleObj = jQuery.extend( { 10155 type: type, 10156 origType: origType, 10157 data: data, 10158 handler: handler, 10159 guid: handler.guid, 10160 selector: selector, 10161 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 10162 namespace: namespaces.join( "." ) 10163 }, handleObjIn ); 10164 10165 // Init the event handler queue if we're the first 10166 if ( !( handlers = events[ type ] ) ) { 10167 handlers = events[ type ] = []; 10168 handlers.delegateCount = 0; 10169 10170 // Only use addEventListener if the special events handler returns false 10171 if ( !special.setup || 10172 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 10173 10174 if ( elem.addEventListener ) { 10175 elem.addEventListener( type, eventHandle ); 10176 } 10177 } 10178 } 10179 10180 if ( special.add ) { 10181 special.add.call( elem, handleObj ); 10182 10183 if ( !handleObj.handler.guid ) { 10184 handleObj.handler.guid = handler.guid; 10185 } 10186 } 10187 10188 // Add to the element's handler list, delegates in front 10189 if ( selector ) { 10190 handlers.splice( handlers.delegateCount++, 0, handleObj ); 10191 } else { 10192 handlers.push( handleObj ); 10193 } 10194 10195 // Keep track of which events have ever been used, for event optimization 10196 jQuery.event.global[ type ] = true; 10197 } 10198 10199 }, 10200 10201 // Detach an event or set of events from an element 10202 remove: function( elem, types, handler, selector, mappedTypes ) { 10203 10204 var j, origCount, tmp, 10205 events, t, handleObj, 10206 special, handlers, type, namespaces, origType, 10207 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 10208 10209 if ( !elemData || !( events = elemData.events ) ) { 10210 return; 10211 } 10212 10213 // Once for each type.namespace in types; type may be omitted 10214 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 10215 t = types.length; 10216 while ( t-- ) { 10217 tmp = rtypenamespace.exec( types[ t ] ) || []; 10218 type = origType = tmp[ 1 ]; 10219 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 10220 10221 // Unbind all events (on this namespace, if provided) for the element 10222 if ( !type ) { 10223 for ( type in events ) { 10224 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 10225 } 10226 continue; 10227 } 10228 10229 special = jQuery.event.special[ type ] || {}; 10230 type = ( selector ? special.delegateType : special.bindType ) || type; 10231 handlers = events[ type ] || []; 10232 tmp = tmp[ 2 ] && 10233 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 10234 10235 // Remove matching events 10236 origCount = j = handlers.length; 10237 while ( j-- ) { 10238 handleObj = handlers[ j ]; 10239 10240 if ( ( mappedTypes || origType === handleObj.origType ) && 10241 ( !handler || handler.guid === handleObj.guid ) && 10242 ( !tmp || tmp.test( handleObj.namespace ) ) && 10243 ( !selector || selector === handleObj.selector || 10244 selector === "**" && handleObj.selector ) ) { 10245 handlers.splice( j, 1 ); 10246 10247 if ( handleObj.selector ) { 10248 handlers.delegateCount--; 10249 } 10250 if ( special.remove ) { 10251 special.remove.call( elem, handleObj ); 10252 } 10253 } 10254 } 10255 10256 // Remove generic event handler if we removed something and no more handlers exist 10257 // (avoids potential for endless recursion during removal of special event handlers) 10258 if ( origCount && !handlers.length ) { 10259 if ( !special.teardown || 10260 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 10261 10262 jQuery.removeEvent( elem, type, elemData.handle ); 10263 } 10264 10265 delete events[ type ]; 10266 } 10267 } 10268 10269 // Remove data and the expando if it's no longer used 10270 if ( jQuery.isEmptyObject( events ) ) { 10271 dataPriv.remove( elem, "handle events" ); 10272 } 10273 }, 10274 10275 dispatch: function( nativeEvent ) { 10276 10277 // Make a writable jQuery.Event from the native event object 10278 var event = jQuery.event.fix( nativeEvent ); 10279 10280 var i, j, ret, matched, handleObj, handlerQueue, 10281 args = new Array( arguments.length ), 10282 handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], 10283 special = jQuery.event.special[ event.type ] || {}; 10284 10285 // Use the fix-ed jQuery.Event rather than the (read-only) native event 10286 args[ 0 ] = event; 10287 10288 for ( i = 1; i < arguments.length; i++ ) { 10289 args[ i ] = arguments[ i ]; 10290 } 10291 10292 event.delegateTarget = this; 10293 10294 // Call the preDispatch hook for the mapped type, and let it bail if desired 10295 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 10296 return; 10297 } 10298 10299 // Determine handlers 10300 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 10301 10302 // Run delegates first; they may want to stop propagation beneath us 10303 i = 0; 10304 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 10305 event.currentTarget = matched.elem; 10306 10307 j = 0; 10308 while ( ( handleObj = matched.handlers[ j++ ] ) && 10309 !event.isImmediatePropagationStopped() ) { 10310 10311 // If the event is namespaced, then each handler is only invoked if it is 10312 // specially universal or its namespaces are a superset of the event's. 10313 if ( !event.rnamespace || handleObj.namespace === false || 10314 event.rnamespace.test( handleObj.namespace ) ) { 10315 10316 event.handleObj = handleObj; 10317 event.data = handleObj.data; 10318 10319 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 10320 handleObj.handler ).apply( matched.elem, args ); 10321 10322 if ( ret !== undefined ) { 10323 if ( ( event.result = ret ) === false ) { 10324 event.preventDefault(); 10325 event.stopPropagation(); 10326 } 10327 } 10328 } 10329 } 10330 } 10331 10332 // Call the postDispatch hook for the mapped type 10333 if ( special.postDispatch ) { 10334 special.postDispatch.call( this, event ); 10335 } 10336 10337 return event.result; 10338 }, 10339 10340 handlers: function( event, handlers ) { 10341 var i, handleObj, sel, matchedHandlers, matchedSelectors, 10342 handlerQueue = [], 10343 delegateCount = handlers.delegateCount, 10344 cur = event.target; 10345 10346 // Find delegate handlers 10347 if ( delegateCount && 10348 10349 // Support: IE <=9 10350 // Black-hole SVG <use> instance trees (trac-13180) 10351 cur.nodeType && 10352 10353 // Support: Firefox <=42 10354 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 10355 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 10356 // Support: IE 11 only 10357 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 10358 !( event.type === "click" && event.button >= 1 ) ) { 10359 10360 for ( ; cur !== this; cur = cur.parentNode || this ) { 10361 10362 // Don't check non-elements (#13208) 10363 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 10364 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 10365 matchedHandlers = []; 10366 matchedSelectors = {}; 10367 for ( i = 0; i < delegateCount; i++ ) { 10368 handleObj = handlers[ i ]; 10369 10370 // Don't conflict with Object.prototype properties (#13203) 10371 sel = handleObj.selector + " "; 10372 10373 if ( matchedSelectors[ sel ] === undefined ) { 10374 matchedSelectors[ sel ] = handleObj.needsContext ? 10375 jQuery( sel, this ).index( cur ) > -1 : 10376 jQuery.find( sel, this, null, [ cur ] ).length; 10377 } 10378 if ( matchedSelectors[ sel ] ) { 10379 matchedHandlers.push( handleObj ); 10380 } 10381 } 10382 if ( matchedHandlers.length ) { 10383 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 10384 } 10385 } 10386 } 10387 } 10388 10389 // Add the remaining (directly-bound) handlers 10390 cur = this; 10391 if ( delegateCount < handlers.length ) { 10392 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 10393 } 10394 10395 return handlerQueue; 10396 }, 10397 10398 addProp: function( name, hook ) { 10399 Object.defineProperty( jQuery.Event.prototype, name, { 10400 enumerable: true, 10401 configurable: true, 10402 10403 get: isFunction( hook ) ? 10404 function() { 10405 if ( this.originalEvent ) { 10406 return hook( this.originalEvent ); 10407 } 10408 } : 10409 function() { 10410 if ( this.originalEvent ) { 10411 return this.originalEvent[ name ]; 10412 } 10413 }, 10414 10415 set: function( value ) { 10416 Object.defineProperty( this, name, { 10417 enumerable: true, 10418 configurable: true, 10419 writable: true, 10420 value: value 10421 } ); 10422 } 10423 } ); 10424 }, 10425 10426 fix: function( originalEvent ) { 10427 return originalEvent[ jQuery.expando ] ? 10428 originalEvent : 10429 new jQuery.Event( originalEvent ); 10430 }, 10431 10432 special: { 10433 load: { 10434 10435 // Prevent triggered image.load events from bubbling to window.load 10436 noBubble: true 10437 }, 10438 click: { 10439 10440 // Utilize native event to ensure correct state for checkable inputs 10441 setup: function( data ) { 10442 10443 // For mutual compressibility with _default, replace `this` access with a local var. 10444 // `|| data` is dead code meant only to preserve the variable through minification. 10445 var el = this || data; 10446 10447 // Claim the first handler 10448 if ( rcheckableType.test( el.type ) && 10449 el.click && nodeName( el, "input" ) ) { 10450 10451 // dataPriv.set( el, "click", ... ) 10452 leverageNative( el, "click", returnTrue ); 10453 } 10454 10455 // Return false to allow normal processing in the caller 10456 return false; 10457 }, 10458 trigger: function( data ) { 10459 10460 // For mutual compressibility with _default, replace `this` access with a local var. 10461 // `|| data` is dead code meant only to preserve the variable through minification. 10462 var el = this || data; 10463 10464 // Force setup before triggering a click 10465 if ( rcheckableType.test( el.type ) && 10466 el.click && nodeName( el, "input" ) ) { 10467 10468 leverageNative( el, "click" ); 10469 } 10470 10471 // Return non-false to allow normal event-path propagation 10472 return true; 10473 }, 10474 10475 // For cross-browser consistency, suppress native .click() on links 10476 // Also prevent it if we're currently inside a leveraged native-event stack 10477 _default: function( event ) { 10478 var target = event.target; 10479 return rcheckableType.test( target.type ) && 10480 target.click && nodeName( target, "input" ) && 10481 dataPriv.get( target, "click" ) || 10482 nodeName( target, "a" ); 10483 } 10484 }, 10485 10486 beforeunload: { 10487 postDispatch: function( event ) { 10488 10489 // Support: Firefox 20+ 10490 // Firefox doesn't alert if the returnValue field is not set. 10491 if ( event.result !== undefined && event.originalEvent ) { 10492 event.originalEvent.returnValue = event.result; 10493 } 10494 } 10495 } 10496 } 10497}; 10498 10499// Ensure the presence of an event listener that handles manually-triggered 10500// synthetic events by interrupting progress until reinvoked in response to 10501// *native* events that it fires directly, ensuring that state changes have 10502// already occurred before other listeners are invoked. 10503function leverageNative( el, type, expectSync ) { 10504 10505 // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add 10506 if ( !expectSync ) { 10507 if ( dataPriv.get( el, type ) === undefined ) { 10508 jQuery.event.add( el, type, returnTrue ); 10509 } 10510 return; 10511 } 10512 10513 // Register the controller as a special universal handler for all event namespaces 10514 dataPriv.set( el, type, false ); 10515 jQuery.event.add( el, type, { 10516 namespace: false, 10517 handler: function( event ) { 10518 var notAsync, result, 10519 saved = dataPriv.get( this, type ); 10520 10521 if ( ( event.isTrigger & 1 ) && this[ type ] ) { 10522 10523 // Interrupt processing of the outer synthetic .trigger()ed event 10524 // Saved data should be false in such cases, but might be a leftover capture object 10525 // from an async native handler (gh-4350) 10526 if ( !saved.length ) { 10527 10528 // Store arguments for use when handling the inner native event 10529 // There will always be at least one argument (an event object), so this array 10530 // will not be confused with a leftover capture object. 10531 saved = slice.call( arguments ); 10532 dataPriv.set( this, type, saved ); 10533 10534 // Trigger the native event and capture its result 10535 // Support: IE <=9 - 11+ 10536 // focus() and blur() are asynchronous 10537 notAsync = expectSync( this, type ); 10538 this[ type ](); 10539 result = dataPriv.get( this, type ); 10540 if ( saved !== result || notAsync ) { 10541 dataPriv.set( this, type, false ); 10542 } else { 10543 result = {}; 10544 } 10545 if ( saved !== result ) { 10546 10547 // Cancel the outer synthetic event 10548 event.stopImmediatePropagation(); 10549 event.preventDefault(); 10550 return result.value; 10551 } 10552 10553 // If this is an inner synthetic event for an event with a bubbling surrogate 10554 // (focus or blur), assume that the surrogate already propagated from triggering the 10555 // native event and prevent that from happening again here. 10556 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 10557 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 10558 // less bad than duplication. 10559 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { 10560 event.stopPropagation(); 10561 } 10562 10563 // If this is a native event triggered above, everything is now in order 10564 // Fire an inner synthetic event with the original arguments 10565 } else if ( saved.length ) { 10566 10567 // ...and capture the result 10568 dataPriv.set( this, type, { 10569 value: jQuery.event.trigger( 10570 10571 // Support: IE <=9 - 11+ 10572 // Extend with the prototype to reset the above stopImmediatePropagation() 10573 jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), 10574 saved.slice( 1 ), 10575 this 10576 ) 10577 } ); 10578 10579 // Abort handling of the native event 10580 event.stopImmediatePropagation(); 10581 } 10582 } 10583 } ); 10584} 10585 10586jQuery.removeEvent = function( elem, type, handle ) { 10587 10588 // This "if" is needed for plain objects 10589 if ( elem.removeEventListener ) { 10590 elem.removeEventListener( type, handle ); 10591 } 10592}; 10593 10594jQuery.Event = function( src, props ) { 10595 10596 // Allow instantiation without the 'new' keyword 10597 if ( !( this instanceof jQuery.Event ) ) { 10598 return new jQuery.Event( src, props ); 10599 } 10600 10601 // Event object 10602 if ( src && src.type ) { 10603 this.originalEvent = src; 10604 this.type = src.type; 10605 10606 // Events bubbling up the document may have been marked as prevented 10607 // by a handler lower down the tree; reflect the correct value. 10608 this.isDefaultPrevented = src.defaultPrevented || 10609 src.defaultPrevented === undefined && 10610 10611 // Support: Android <=2.3 only 10612 src.returnValue === false ? 10613 returnTrue : 10614 returnFalse; 10615 10616 // Create target properties 10617 // Support: Safari <=6 - 7 only 10618 // Target should not be a text node (#504, #13143) 10619 this.target = ( src.target && src.target.nodeType === 3 ) ? 10620 src.target.parentNode : 10621 src.target; 10622 10623 this.currentTarget = src.currentTarget; 10624 this.relatedTarget = src.relatedTarget; 10625 10626 // Event type 10627 } else { 10628 this.type = src; 10629 } 10630 10631 // Put explicitly provided properties onto the event object 10632 if ( props ) { 10633 jQuery.extend( this, props ); 10634 } 10635 10636 // Create a timestamp if incoming event doesn't have one 10637 this.timeStamp = src && src.timeStamp || Date.now(); 10638 10639 // Mark it as fixed 10640 this[ jQuery.expando ] = true; 10641}; 10642 10643// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 10644// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 10645jQuery.Event.prototype = { 10646 constructor: jQuery.Event, 10647 isDefaultPrevented: returnFalse, 10648 isPropagationStopped: returnFalse, 10649 isImmediatePropagationStopped: returnFalse, 10650 isSimulated: false, 10651 10652 preventDefault: function() { 10653 var e = this.originalEvent; 10654 10655 this.isDefaultPrevented = returnTrue; 10656 10657 if ( e && !this.isSimulated ) { 10658 e.preventDefault(); 10659 } 10660 }, 10661 stopPropagation: function() { 10662 var e = this.originalEvent; 10663 10664 this.isPropagationStopped = returnTrue; 10665 10666 if ( e && !this.isSimulated ) { 10667 e.stopPropagation(); 10668 } 10669 }, 10670 stopImmediatePropagation: function() { 10671 var e = this.originalEvent; 10672 10673 this.isImmediatePropagationStopped = returnTrue; 10674 10675 if ( e && !this.isSimulated ) { 10676 e.stopImmediatePropagation(); 10677 } 10678 10679 this.stopPropagation(); 10680 } 10681}; 10682 10683// Includes all common event props including KeyEvent and MouseEvent specific props 10684jQuery.each( { 10685 altKey: true, 10686 bubbles: true, 10687 cancelable: true, 10688 changedTouches: true, 10689 ctrlKey: true, 10690 detail: true, 10691 eventPhase: true, 10692 metaKey: true, 10693 pageX: true, 10694 pageY: true, 10695 shiftKey: true, 10696 view: true, 10697 "char": true, 10698 code: true, 10699 charCode: true, 10700 key: true, 10701 keyCode: true, 10702 button: true, 10703 buttons: true, 10704 clientX: true, 10705 clientY: true, 10706 offsetX: true, 10707 offsetY: true, 10708 pointerId: true, 10709 pointerType: true, 10710 screenX: true, 10711 screenY: true, 10712 targetTouches: true, 10713 toElement: true, 10714 touches: true, 10715 10716 which: function( event ) { 10717 var button = event.button; 10718 10719 // Add which for key events 10720 if ( event.which == null && rkeyEvent.test( event.type ) ) { 10721 return event.charCode != null ? event.charCode : event.keyCode; 10722 } 10723 10724 // Add which for click: 1 === left; 2 === middle; 3 === right 10725 if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { 10726 if ( button & 1 ) { 10727 return 1; 10728 } 10729 10730 if ( button & 2 ) { 10731 return 3; 10732 } 10733 10734 if ( button & 4 ) { 10735 return 2; 10736 } 10737 10738 return 0; 10739 } 10740 10741 return event.which; 10742 } 10743}, jQuery.event.addProp ); 10744 10745jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { 10746 jQuery.event.special[ type ] = { 10747 10748 // Utilize native event if possible so blur/focus sequence is correct 10749 setup: function() { 10750 10751 // Claim the first handler 10752 // dataPriv.set( this, "focus", ... ) 10753 // dataPriv.set( this, "blur", ... ) 10754 leverageNative( this, type, expectSync ); 10755 10756 // Return false to allow normal processing in the caller 10757 return false; 10758 }, 10759 trigger: function() { 10760 10761 // Force setup before trigger 10762 leverageNative( this, type ); 10763 10764 // Return non-false to allow normal event-path propagation 10765 return true; 10766 }, 10767 10768 delegateType: delegateType 10769 }; 10770} ); 10771 10772// Create mouseenter/leave events using mouseover/out and event-time checks 10773// so that event delegation works in jQuery. 10774// Do the same for pointerenter/pointerleave and pointerover/pointerout 10775// 10776// Support: Safari 7 only 10777// Safari sends mouseenter too often; see: 10778// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 10779// for the description of the bug (it existed in older Chrome versions as well). 10780jQuery.each( { 10781 mouseenter: "mouseover", 10782 mouseleave: "mouseout", 10783 pointerenter: "pointerover", 10784 pointerleave: "pointerout" 10785}, function( orig, fix ) { 10786 jQuery.event.special[ orig ] = { 10787 delegateType: fix, 10788 bindType: fix, 10789 10790 handle: function( event ) { 10791 var ret, 10792 target = this, 10793 related = event.relatedTarget, 10794 handleObj = event.handleObj; 10795 10796 // For mouseenter/leave call the handler if related is outside the target. 10797 // NB: No relatedTarget if the mouse left/entered the browser window 10798 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 10799 event.type = handleObj.origType; 10800 ret = handleObj.handler.apply( this, arguments ); 10801 event.type = fix; 10802 } 10803 return ret; 10804 } 10805 }; 10806} ); 10807 10808jQuery.fn.extend( { 10809 10810 on: function( types, selector, data, fn ) { 10811 return on( this, types, selector, data, fn ); 10812 }, 10813 one: function( types, selector, data, fn ) { 10814 return on( this, types, selector, data, fn, 1 ); 10815 }, 10816 off: function( types, selector, fn ) { 10817 var handleObj, type; 10818 if ( types && types.preventDefault && types.handleObj ) { 10819 10820 // ( event ) dispatched jQuery.Event 10821 handleObj = types.handleObj; 10822 jQuery( types.delegateTarget ).off( 10823 handleObj.namespace ? 10824 handleObj.origType + "." + handleObj.namespace : 10825 handleObj.origType, 10826 handleObj.selector, 10827 handleObj.handler 10828 ); 10829 return this; 10830 } 10831 if ( typeof types === "object" ) { 10832 10833 // ( types-object [, selector] ) 10834 for ( type in types ) { 10835 this.off( type, selector, types[ type ] ); 10836 } 10837 return this; 10838 } 10839 if ( selector === false || typeof selector === "function" ) { 10840 10841 // ( types [, fn] ) 10842 fn = selector; 10843 selector = undefined; 10844 } 10845 if ( fn === false ) { 10846 fn = returnFalse; 10847 } 10848 return this.each( function() { 10849 jQuery.event.remove( this, types, fn, selector ); 10850 } ); 10851 } 10852} ); 10853 10854 10855var 10856 10857 /* eslint-disable max-len */ 10858 10859 // See https://github.com/eslint/eslint/issues/3229 10860 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, 10861 10862 /* eslint-enable */ 10863 10864 // Support: IE <=10 - 11, Edge 12 - 13 only 10865 // In IE/Edge using regex groups here causes severe slowdowns. 10866 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 10867 rnoInnerhtml = /<script|<style|<link/i, 10868 10869 // checked="checked" or checked 10870 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 10871 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; 10872 10873// Prefer a tbody over its parent table for containing new rows 10874function manipulationTarget( elem, content ) { 10875 if ( nodeName( elem, "table" ) && 10876 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 10877 10878 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 10879 } 10880 10881 return elem; 10882} 10883 10884// Replace/restore the type attribute of script elements for safe DOM manipulation 10885function disableScript( elem ) { 10886 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 10887 return elem; 10888} 10889function restoreScript( elem ) { 10890 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 10891 elem.type = elem.type.slice( 5 ); 10892 } else { 10893 elem.removeAttribute( "type" ); 10894 } 10895 10896 return elem; 10897} 10898 10899function cloneCopyEvent( src, dest ) { 10900 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; 10901 10902 if ( dest.nodeType !== 1 ) { 10903 return; 10904 } 10905 10906 // 1. Copy private data: events, handlers, etc. 10907 if ( dataPriv.hasData( src ) ) { 10908 pdataOld = dataPriv.access( src ); 10909 pdataCur = dataPriv.set( dest, pdataOld ); 10910 events = pdataOld.events; 10911 10912 if ( events ) { 10913 delete pdataCur.handle; 10914 pdataCur.events = {}; 10915 10916 for ( type in events ) { 10917 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 10918 jQuery.event.add( dest, type, events[ type ][ i ] ); 10919 } 10920 } 10921 } 10922 } 10923 10924 // 2. Copy user data 10925 if ( dataUser.hasData( src ) ) { 10926 udataOld = dataUser.access( src ); 10927 udataCur = jQuery.extend( {}, udataOld ); 10928 10929 dataUser.set( dest, udataCur ); 10930 } 10931} 10932 10933// Fix IE bugs, see support tests 10934function fixInput( src, dest ) { 10935 var nodeName = dest.nodeName.toLowerCase(); 10936 10937 // Fails to persist the checked state of a cloned checkbox or radio button. 10938 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 10939 dest.checked = src.checked; 10940 10941 // Fails to return the selected option to the default selected state when cloning options 10942 } else if ( nodeName === "input" || nodeName === "textarea" ) { 10943 dest.defaultValue = src.defaultValue; 10944 } 10945} 10946 10947function domManip( collection, args, callback, ignored ) { 10948 10949 // Flatten any nested arrays 10950 args = concat.apply( [], args ); 10951 10952 var fragment, first, scripts, hasScripts, node, doc, 10953 i = 0, 10954 l = collection.length, 10955 iNoClone = l - 1, 10956 value = args[ 0 ], 10957 valueIsFunction = isFunction( value ); 10958 10959 // We can't cloneNode fragments that contain checked, in WebKit 10960 if ( valueIsFunction || 10961 ( l > 1 && typeof value === "string" && 10962 !support.checkClone && rchecked.test( value ) ) ) { 10963 return collection.each( function( index ) { 10964 var self = collection.eq( index ); 10965 if ( valueIsFunction ) { 10966 args[ 0 ] = value.call( this, index, self.html() ); 10967 } 10968 domManip( self, args, callback, ignored ); 10969 } ); 10970 } 10971 10972 if ( l ) { 10973 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 10974 first = fragment.firstChild; 10975 10976 if ( fragment.childNodes.length === 1 ) { 10977 fragment = first; 10978 } 10979 10980 // Require either new content or an interest in ignored elements to invoke the callback 10981 if ( first || ignored ) { 10982 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 10983 hasScripts = scripts.length; 10984 10985 // Use the original fragment for the last item 10986 // instead of the first because it can end up 10987 // being emptied incorrectly in certain situations (#8070). 10988 for ( ; i < l; i++ ) { 10989 node = fragment; 10990 10991 if ( i !== iNoClone ) { 10992 node = jQuery.clone( node, true, true ); 10993 10994 // Keep references to cloned scripts for later restoration 10995 if ( hasScripts ) { 10996 10997 // Support: Android <=4.0 only, PhantomJS 1 only 10998 // push.apply(_, arraylike) throws on ancient WebKit 10999 jQuery.merge( scripts, getAll( node, "script" ) ); 11000 } 11001 } 11002 11003 callback.call( collection[ i ], node, i ); 11004 } 11005 11006 if ( hasScripts ) { 11007 doc = scripts[ scripts.length - 1 ].ownerDocument; 11008 11009 // Reenable scripts 11010 jQuery.map( scripts, restoreScript ); 11011 11012 // Evaluate executable scripts on first document insertion 11013 for ( i = 0; i < hasScripts; i++ ) { 11014 node = scripts[ i ]; 11015 if ( rscriptType.test( node.type || "" ) && 11016 !dataPriv.access( node, "globalEval" ) && 11017 jQuery.contains( doc, node ) ) { 11018 11019 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 11020 11021 // Optional AJAX dependency, but won't run scripts if not present 11022 if ( jQuery._evalUrl && !node.noModule ) { 11023 jQuery._evalUrl( node.src, { 11024 nonce: node.nonce || node.getAttribute( "nonce" ) 11025 } ); 11026 } 11027 } else { 11028 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); 11029 } 11030 } 11031 } 11032 } 11033 } 11034 } 11035 11036 return collection; 11037} 11038 11039function remove( elem, selector, keepData ) { 11040 var node, 11041 nodes = selector ? jQuery.filter( selector, elem ) : elem, 11042 i = 0; 11043 11044 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 11045 if ( !keepData && node.nodeType === 1 ) { 11046 jQuery.cleanData( getAll( node ) ); 11047 } 11048 11049 if ( node.parentNode ) { 11050 if ( keepData && isAttached( node ) ) { 11051 setGlobalEval( getAll( node, "script" ) ); 11052 } 11053 node.parentNode.removeChild( node ); 11054 } 11055 } 11056 11057 return elem; 11058} 11059 11060jQuery.extend( { 11061 htmlPrefilter: function( html ) { 11062 return html.replace( rxhtmlTag, "<$1></$2>" ); 11063 }, 11064 11065 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 11066 var i, l, srcElements, destElements, 11067 clone = elem.cloneNode( true ), 11068 inPage = isAttached( elem ); 11069 11070 // Fix IE cloning issues 11071 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 11072 !jQuery.isXMLDoc( elem ) ) { 11073 11074 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 11075 destElements = getAll( clone ); 11076 srcElements = getAll( elem ); 11077 11078 for ( i = 0, l = srcElements.length; i < l; i++ ) { 11079 fixInput( srcElements[ i ], destElements[ i ] ); 11080 } 11081 } 11082 11083 // Copy the events from the original to the clone 11084 if ( dataAndEvents ) { 11085 if ( deepDataAndEvents ) { 11086 srcElements = srcElements || getAll( elem ); 11087 destElements = destElements || getAll( clone ); 11088 11089 for ( i = 0, l = srcElements.length; i < l; i++ ) { 11090 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 11091 } 11092 } else { 11093 cloneCopyEvent( elem, clone ); 11094 } 11095 } 11096 11097 // Preserve script evaluation history 11098 destElements = getAll( clone, "script" ); 11099 if ( destElements.length > 0 ) { 11100 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 11101 } 11102 11103 // Return the cloned set 11104 return clone; 11105 }, 11106 11107 cleanData: function( elems ) { 11108 var data, elem, type, 11109 special = jQuery.event.special, 11110 i = 0; 11111 11112 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 11113 if ( acceptData( elem ) ) { 11114 if ( ( data = elem[ dataPriv.expando ] ) ) { 11115 if ( data.events ) { 11116 for ( type in data.events ) { 11117 if ( special[ type ] ) { 11118 jQuery.event.remove( elem, type ); 11119 11120 // This is a shortcut to avoid jQuery.event.remove's overhead 11121 } else { 11122 jQuery.removeEvent( elem, type, data.handle ); 11123 } 11124 } 11125 } 11126 11127 // Support: Chrome <=35 - 45+ 11128 // Assign undefined instead of using delete, see Data#remove 11129 elem[ dataPriv.expando ] = undefined; 11130 } 11131 if ( elem[ dataUser.expando ] ) { 11132 11133 // Support: Chrome <=35 - 45+ 11134 // Assign undefined instead of using delete, see Data#remove 11135 elem[ dataUser.expando ] = undefined; 11136 } 11137 } 11138 } 11139 } 11140} ); 11141 11142jQuery.fn.extend( { 11143 detach: function( selector ) { 11144 return remove( this, selector, true ); 11145 }, 11146 11147 remove: function( selector ) { 11148 return remove( this, selector ); 11149 }, 11150 11151 text: function( value ) { 11152 return access( this, function( value ) { 11153 return value === undefined ? 11154 jQuery.text( this ) : 11155 this.empty().each( function() { 11156 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 11157 this.textContent = value; 11158 } 11159 } ); 11160 }, null, value, arguments.length ); 11161 }, 11162 11163 append: function() { 11164 return domManip( this, arguments, function( elem ) { 11165 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 11166 var target = manipulationTarget( this, elem ); 11167 target.appendChild( elem ); 11168 } 11169 } ); 11170 }, 11171 11172 prepend: function() { 11173 return domManip( this, arguments, function( elem ) { 11174 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 11175 var target = manipulationTarget( this, elem ); 11176 target.insertBefore( elem, target.firstChild ); 11177 } 11178 } ); 11179 }, 11180 11181 before: function() { 11182 return domManip( this, arguments, function( elem ) { 11183 if ( this.parentNode ) { 11184 this.parentNode.insertBefore( elem, this ); 11185 } 11186 } ); 11187 }, 11188 11189 after: function() { 11190 return domManip( this, arguments, function( elem ) { 11191 if ( this.parentNode ) { 11192 this.parentNode.insertBefore( elem, this.nextSibling ); 11193 } 11194 } ); 11195 }, 11196 11197 empty: function() { 11198 var elem, 11199 i = 0; 11200 11201 for ( ; ( elem = this[ i ] ) != null; i++ ) { 11202 if ( elem.nodeType === 1 ) { 11203 11204 // Prevent memory leaks 11205 jQuery.cleanData( getAll( elem, false ) ); 11206 11207 // Remove any remaining nodes 11208 elem.textContent = ""; 11209 } 11210 } 11211 11212 return this; 11213 }, 11214 11215 clone: function( dataAndEvents, deepDataAndEvents ) { 11216 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 11217 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 11218 11219 return this.map( function() { 11220 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 11221 } ); 11222 }, 11223 11224 html: function( value ) { 11225 return access( this, function( value ) { 11226 var elem = this[ 0 ] || {}, 11227 i = 0, 11228 l = this.length; 11229 11230 if ( value === undefined && elem.nodeType === 1 ) { 11231 return elem.innerHTML; 11232 } 11233 11234 // See if we can take a shortcut and just use innerHTML 11235 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 11236 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 11237 11238 value = jQuery.htmlPrefilter( value ); 11239 11240 try { 11241 for ( ; i < l; i++ ) { 11242 elem = this[ i ] || {}; 11243 11244 // Remove element nodes and prevent memory leaks 11245 if ( elem.nodeType === 1 ) { 11246 jQuery.cleanData( getAll( elem, false ) ); 11247 elem.innerHTML = value; 11248 } 11249 } 11250 11251 elem = 0; 11252 11253 // If using innerHTML throws an exception, use the fallback method 11254 } catch ( e ) {} 11255 } 11256 11257 if ( elem ) { 11258 this.empty().append( value ); 11259 } 11260 }, null, value, arguments.length ); 11261 }, 11262 11263 replaceWith: function() { 11264 var ignored = []; 11265 11266 // Make the changes, replacing each non-ignored context element with the new content 11267 return domManip( this, arguments, function( elem ) { 11268 var parent = this.parentNode; 11269 11270 if ( jQuery.inArray( this, ignored ) < 0 ) { 11271 jQuery.cleanData( getAll( this ) ); 11272 if ( parent ) { 11273 parent.replaceChild( elem, this ); 11274 } 11275 } 11276 11277 // Force callback invocation 11278 }, ignored ); 11279 } 11280} ); 11281 11282jQuery.each( { 11283 appendTo: "append", 11284 prependTo: "prepend", 11285 insertBefore: "before", 11286 insertAfter: "after", 11287 replaceAll: "replaceWith" 11288}, function( name, original ) { 11289 jQuery.fn[ name ] = function( selector ) { 11290 var elems, 11291 ret = [], 11292 insert = jQuery( selector ), 11293 last = insert.length - 1, 11294 i = 0; 11295 11296 for ( ; i <= last; i++ ) { 11297 elems = i === last ? this : this.clone( true ); 11298 jQuery( insert[ i ] )[ original ]( elems ); 11299 11300 // Support: Android <=4.0 only, PhantomJS 1 only 11301 // .get() because push.apply(_, arraylike) throws on ancient WebKit 11302 push.apply( ret, elems.get() ); 11303 } 11304 11305 return this.pushStack( ret ); 11306 }; 11307} ); 11308var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 11309 11310var getStyles = function( elem ) { 11311 11312 // Support: IE <=11 only, Firefox <=30 (#15098, #14150) 11313 // IE throws on elements created in popups 11314 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 11315 var view = elem.ownerDocument.defaultView; 11316 11317 if ( !view || !view.opener ) { 11318 view = window; 11319 } 11320 11321 return view.getComputedStyle( elem ); 11322 }; 11323 11324var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 11325 11326 11327 11328( function() { 11329 11330 // Executing both pixelPosition & boxSizingReliable tests require only one layout 11331 // so they're executed at the same time to save the second computation. 11332 function computeStyleTests() { 11333 11334 // This is a singleton, we need to execute it only once 11335 if ( !div ) { 11336 return; 11337 } 11338 11339 container.style.cssText = "position:absolute;left:-11111px;width:60px;" + 11340 "margin-top:1px;padding:0;border:0"; 11341 div.style.cssText = 11342 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 11343 "margin:auto;border:1px;padding:1px;" + 11344 "width:60%;top:1%"; 11345 documentElement.appendChild( container ).appendChild( div ); 11346 11347 var divStyle = window.getComputedStyle( div ); 11348 pixelPositionVal = divStyle.top !== "1%"; 11349 11350 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 11351 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 11352 11353 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 11354 // Some styles come back with percentage values, even though they shouldn't 11355 div.style.right = "60%"; 11356 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 11357 11358 // Support: IE 9 - 11 only 11359 // Detect misreporting of content dimensions for box-sizing:border-box elements 11360 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 11361 11362 // Support: IE 9 only 11363 // Detect overflow:scroll screwiness (gh-3699) 11364 // Support: Chrome <=64 11365 // Don't get tricked when zoom affects offsetWidth (gh-4029) 11366 div.style.position = "absolute"; 11367 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; 11368 11369 documentElement.removeChild( container ); 11370 11371 // Nullify the div so it wouldn't be stored in the memory and 11372 // it will also be a sign that checks already performed 11373 div = null; 11374 } 11375 11376 function roundPixelMeasures( measure ) { 11377 return Math.round( parseFloat( measure ) ); 11378 } 11379 11380 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 11381 reliableMarginLeftVal, 11382 container = document.createElement( "div" ), 11383 div = document.createElement( "div" ); 11384 11385 // Finish early in limited (non-browser) environments 11386 if ( !div.style ) { 11387 return; 11388 } 11389 11390 // Support: IE <=9 - 11 only 11391 // Style of cloned element affects source element cloned (#8908) 11392 div.style.backgroundClip = "content-box"; 11393 div.cloneNode( true ).style.backgroundClip = ""; 11394 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 11395 11396 jQuery.extend( support, { 11397 boxSizingReliable: function() { 11398 computeStyleTests(); 11399 return boxSizingReliableVal; 11400 }, 11401 pixelBoxStyles: function() { 11402 computeStyleTests(); 11403 return pixelBoxStylesVal; 11404 }, 11405 pixelPosition: function() { 11406 computeStyleTests(); 11407 return pixelPositionVal; 11408 }, 11409 reliableMarginLeft: function() { 11410 computeStyleTests(); 11411 return reliableMarginLeftVal; 11412 }, 11413 scrollboxSize: function() { 11414 computeStyleTests(); 11415 return scrollboxSizeVal; 11416 } 11417 } ); 11418} )(); 11419 11420 11421function curCSS( elem, name, computed ) { 11422 var width, minWidth, maxWidth, ret, 11423 11424 // Support: Firefox 51+ 11425 // Retrieving style before computed somehow 11426 // fixes an issue with getting wrong values 11427 // on detached elements 11428 style = elem.style; 11429 11430 computed = computed || getStyles( elem ); 11431 11432 // getPropertyValue is needed for: 11433 // .css('filter') (IE 9 only, #12537) 11434 // .css('--customProperty) (#3144) 11435 if ( computed ) { 11436 ret = computed.getPropertyValue( name ) || computed[ name ]; 11437 11438 if ( ret === "" && !isAttached( elem ) ) { 11439 ret = jQuery.style( elem, name ); 11440 } 11441 11442 // A tribute to the "awesome hack by Dean Edwards" 11443 // Android Browser returns percentage for some values, 11444 // but width seems to be reliably pixels. 11445 // This is against the CSSOM draft spec: 11446 // https://drafts.csswg.org/cssom/#resolved-values 11447 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 11448 11449 // Remember the original values 11450 width = style.width; 11451 minWidth = style.minWidth; 11452 maxWidth = style.maxWidth; 11453 11454 // Put in the new values to get a computed value out 11455 style.minWidth = style.maxWidth = style.width = ret; 11456 ret = computed.width; 11457 11458 // Revert the changed values 11459 style.width = width; 11460 style.minWidth = minWidth; 11461 style.maxWidth = maxWidth; 11462 } 11463 } 11464 11465 return ret !== undefined ? 11466 11467 // Support: IE <=9 - 11 only 11468 // IE returns zIndex value as an integer. 11469 ret + "" : 11470 ret; 11471} 11472 11473 11474function addGetHookIf( conditionFn, hookFn ) { 11475 11476 // Define the hook, we'll check on the first run if it's really needed. 11477 return { 11478 get: function() { 11479 if ( conditionFn() ) { 11480 11481 // Hook not needed (or it's not possible to use it due 11482 // to missing dependency), remove it. 11483 delete this.get; 11484 return; 11485 } 11486 11487 // Hook needed; redefine it so that the support test is not executed again. 11488 return ( this.get = hookFn ).apply( this, arguments ); 11489 } 11490 }; 11491} 11492 11493 11494var cssPrefixes = [ "Webkit", "Moz", "ms" ], 11495 emptyStyle = document.createElement( "div" ).style, 11496 vendorProps = {}; 11497 11498// Return a vendor-prefixed property or undefined 11499function vendorPropName( name ) { 11500 11501 // Check for vendor prefixed names 11502 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 11503 i = cssPrefixes.length; 11504 11505 while ( i-- ) { 11506 name = cssPrefixes[ i ] + capName; 11507 if ( name in emptyStyle ) { 11508 return name; 11509 } 11510 } 11511} 11512 11513// Return a potentially-mapped jQuery.cssProps or vendor prefixed property 11514function finalPropName( name ) { 11515 var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 11516 11517 if ( final ) { 11518 return final; 11519 } 11520 if ( name in emptyStyle ) { 11521 return name; 11522 } 11523 return vendorProps[ name ] = vendorPropName( name ) || name; 11524} 11525 11526 11527var 11528 11529 // Swappable if display is none or starts with table 11530 // except "table", "table-cell", or "table-caption" 11531 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 11532 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 11533 rcustomProp = /^--/, 11534 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 11535 cssNormalTransform = { 11536 letterSpacing: "0", 11537 fontWeight: "400" 11538 }; 11539 11540function setPositiveNumber( elem, value, subtract ) { 11541 11542 // Any relative (+/-) values have already been 11543 // normalized at this point 11544 var matches = rcssNum.exec( value ); 11545 return matches ? 11546 11547 // Guard against undefined "subtract", e.g., when used as in cssHooks 11548 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 11549 value; 11550} 11551 11552function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 11553 var i = dimension === "width" ? 1 : 0, 11554 extra = 0, 11555 delta = 0; 11556 11557 // Adjustment may not be necessary 11558 if ( box === ( isBorderBox ? "border" : "content" ) ) { 11559 return 0; 11560 } 11561 11562 for ( ; i < 4; i += 2 ) { 11563 11564 // Both box models exclude margin 11565 if ( box === "margin" ) { 11566 delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 11567 } 11568 11569 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 11570 if ( !isBorderBox ) { 11571 11572 // Add padding 11573 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 11574 11575 // For "border" or "margin", add border 11576 if ( box !== "padding" ) { 11577 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 11578 11579 // But still keep track of it otherwise 11580 } else { 11581 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 11582 } 11583 11584 // If we get here with a border-box (content + padding + border), we're seeking "content" or 11585 // "padding" or "margin" 11586 } else { 11587 11588 // For "content", subtract padding 11589 if ( box === "content" ) { 11590 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 11591 } 11592 11593 // For "content" or "padding", subtract border 11594 if ( box !== "margin" ) { 11595 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 11596 } 11597 } 11598 } 11599 11600 // Account for positive content-box scroll gutter when requested by providing computedVal 11601 if ( !isBorderBox && computedVal >= 0 ) { 11602 11603 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 11604 // Assuming integer scroll gutter, subtract the rest and round down 11605 delta += Math.max( 0, Math.ceil( 11606 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 11607 computedVal - 11608 delta - 11609 extra - 11610 0.5 11611 11612 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 11613 // Use an explicit zero to avoid NaN (gh-3964) 11614 ) ) || 0; 11615 } 11616 11617 return delta; 11618} 11619 11620function getWidthOrHeight( elem, dimension, extra ) { 11621 11622 // Start with computed style 11623 var styles = getStyles( elem ), 11624 11625 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 11626 // Fake content-box until we know it's needed to know the true value. 11627 boxSizingNeeded = !support.boxSizingReliable() || extra, 11628 isBorderBox = boxSizingNeeded && 11629 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 11630 valueIsBorderBox = isBorderBox, 11631 11632 val = curCSS( elem, dimension, styles ), 11633 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); 11634 11635 // Support: Firefox <=54 11636 // Return a confounding non-pixel value or feign ignorance, as appropriate. 11637 if ( rnumnonpx.test( val ) ) { 11638 if ( !extra ) { 11639 return val; 11640 } 11641 val = "auto"; 11642 } 11643 11644 11645 // Fall back to offsetWidth/offsetHeight when value is "auto" 11646 // This happens for inline elements with no explicit setting (gh-3571) 11647 // Support: Android <=4.1 - 4.3 only 11648 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 11649 // Support: IE 9-11 only 11650 // Also use offsetWidth/offsetHeight for when box sizing is unreliable 11651 // We use getClientRects() to check for hidden/disconnected. 11652 // In those cases, the computed value can be trusted to be border-box 11653 if ( ( !support.boxSizingReliable() && isBorderBox || 11654 val === "auto" || 11655 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && 11656 elem.getClientRects().length ) { 11657 11658 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 11659 11660 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 11661 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 11662 // retrieved value as a content box dimension. 11663 valueIsBorderBox = offsetProp in elem; 11664 if ( valueIsBorderBox ) { 11665 val = elem[ offsetProp ]; 11666 } 11667 } 11668 11669 // Normalize "" and auto 11670 val = parseFloat( val ) || 0; 11671 11672 // Adjust for the element's box model 11673 return ( val + 11674 boxModelAdjustment( 11675 elem, 11676 dimension, 11677 extra || ( isBorderBox ? "border" : "content" ), 11678 valueIsBorderBox, 11679 styles, 11680 11681 // Provide the current computed size to request scroll gutter calculation (gh-3589) 11682 val 11683 ) 11684 ) + "px"; 11685} 11686 11687jQuery.extend( { 11688 11689 // Add in style property hooks for overriding the default 11690 // behavior of getting and setting a style property 11691 cssHooks: { 11692 opacity: { 11693 get: function( elem, computed ) { 11694 if ( computed ) { 11695 11696 // We should always get a number back from opacity 11697 var ret = curCSS( elem, "opacity" ); 11698 return ret === "" ? "1" : ret; 11699 } 11700 } 11701 } 11702 }, 11703 11704 // Don't automatically add "px" to these possibly-unitless properties 11705 cssNumber: { 11706 "animationIterationCount": true, 11707 "columnCount": true, 11708 "fillOpacity": true, 11709 "flexGrow": true, 11710 "flexShrink": true, 11711 "fontWeight": true, 11712 "gridArea": true, 11713 "gridColumn": true, 11714 "gridColumnEnd": true, 11715 "gridColumnStart": true, 11716 "gridRow": true, 11717 "gridRowEnd": true, 11718 "gridRowStart": true, 11719 "lineHeight": true, 11720 "opacity": true, 11721 "order": true, 11722 "orphans": true, 11723 "widows": true, 11724 "zIndex": true, 11725 "zoom": true 11726 }, 11727 11728 // Add in properties whose names you wish to fix before 11729 // setting or getting the value 11730 cssProps: {}, 11731 11732 // Get and set the style property on a DOM Node 11733 style: function( elem, name, value, extra ) { 11734 11735 // Don't set styles on text and comment nodes 11736 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 11737 return; 11738 } 11739 11740 // Make sure that we're working with the right name 11741 var ret, type, hooks, 11742 origName = camelCase( name ), 11743 isCustomProp = rcustomProp.test( name ), 11744 style = elem.style; 11745 11746 // Make sure that we're working with the right name. We don't 11747 // want to query the value if it is a CSS custom property 11748 // since they are user-defined. 11749 if ( !isCustomProp ) { 11750 name = finalPropName( origName ); 11751 } 11752 11753 // Gets hook for the prefixed version, then unprefixed version 11754 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 11755 11756 // Check if we're setting a value 11757 if ( value !== undefined ) { 11758 type = typeof value; 11759 11760 // Convert "+=" or "-=" to relative numbers (#7345) 11761 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 11762 value = adjustCSS( elem, name, ret ); 11763 11764 // Fixes bug #9237 11765 type = "number"; 11766 } 11767 11768 // Make sure that null and NaN values aren't set (#7116) 11769 if ( value == null || value !== value ) { 11770 return; 11771 } 11772 11773 // If a number was passed in, add the unit (except for certain CSS properties) 11774 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 11775 // "px" to a few hardcoded values. 11776 if ( type === "number" && !isCustomProp ) { 11777 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 11778 } 11779 11780 // background-* props affect original clone's values 11781 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 11782 style[ name ] = "inherit"; 11783 } 11784 11785 // If a hook was provided, use that value, otherwise just set the specified value 11786 if ( !hooks || !( "set" in hooks ) || 11787 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 11788 11789 if ( isCustomProp ) { 11790 style.setProperty( name, value ); 11791 } else { 11792 style[ name ] = value; 11793 } 11794 } 11795 11796 } else { 11797 11798 // If a hook was provided get the non-computed value from there 11799 if ( hooks && "get" in hooks && 11800 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 11801 11802 return ret; 11803 } 11804 11805 // Otherwise just get the value from the style object 11806 return style[ name ]; 11807 } 11808 }, 11809 11810 css: function( elem, name, extra, styles ) { 11811 var val, num, hooks, 11812 origName = camelCase( name ), 11813 isCustomProp = rcustomProp.test( name ); 11814 11815 // Make sure that we're working with the right name. We don't 11816 // want to modify the value if it is a CSS custom property 11817 // since they are user-defined. 11818 if ( !isCustomProp ) { 11819 name = finalPropName( origName ); 11820 } 11821 11822 // Try prefixed name followed by the unprefixed name 11823 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 11824 11825 // If a hook was provided get the computed value from there 11826 if ( hooks && "get" in hooks ) { 11827 val = hooks.get( elem, true, extra ); 11828 } 11829 11830 // Otherwise, if a way to get the computed value exists, use that 11831 if ( val === undefined ) { 11832 val = curCSS( elem, name, styles ); 11833 } 11834 11835 // Convert "normal" to computed value 11836 if ( val === "normal" && name in cssNormalTransform ) { 11837 val = cssNormalTransform[ name ]; 11838 } 11839 11840 // Make numeric if forced or a qualifier was provided and val looks numeric 11841 if ( extra === "" || extra ) { 11842 num = parseFloat( val ); 11843 return extra === true || isFinite( num ) ? num || 0 : val; 11844 } 11845 11846 return val; 11847 } 11848} ); 11849 11850jQuery.each( [ "height", "width" ], function( i, dimension ) { 11851 jQuery.cssHooks[ dimension ] = { 11852 get: function( elem, computed, extra ) { 11853 if ( computed ) { 11854 11855 // Certain elements can have dimension info if we invisibly show them 11856 // but it must have a current display style that would benefit 11857 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 11858 11859 // Support: Safari 8+ 11860 // Table columns in Safari have non-zero offsetWidth & zero 11861 // getBoundingClientRect().width unless display is changed. 11862 // Support: IE <=11 only 11863 // Running getBoundingClientRect on a disconnected node 11864 // in IE throws an error. 11865 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 11866 swap( elem, cssShow, function() { 11867 return getWidthOrHeight( elem, dimension, extra ); 11868 } ) : 11869 getWidthOrHeight( elem, dimension, extra ); 11870 } 11871 }, 11872 11873 set: function( elem, value, extra ) { 11874 var matches, 11875 styles = getStyles( elem ), 11876 11877 // Only read styles.position if the test has a chance to fail 11878 // to avoid forcing a reflow. 11879 scrollboxSizeBuggy = !support.scrollboxSize() && 11880 styles.position === "absolute", 11881 11882 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 11883 boxSizingNeeded = scrollboxSizeBuggy || extra, 11884 isBorderBox = boxSizingNeeded && 11885 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 11886 subtract = extra ? 11887 boxModelAdjustment( 11888 elem, 11889 dimension, 11890 extra, 11891 isBorderBox, 11892 styles 11893 ) : 11894 0; 11895 11896 // Account for unreliable border-box dimensions by comparing offset* to computed and 11897 // faking a content-box to get border and padding (gh-3699) 11898 if ( isBorderBox && scrollboxSizeBuggy ) { 11899 subtract -= Math.ceil( 11900 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 11901 parseFloat( styles[ dimension ] ) - 11902 boxModelAdjustment( elem, dimension, "border", false, styles ) - 11903 0.5 11904 ); 11905 } 11906 11907 // Convert to pixels if value adjustment is needed 11908 if ( subtract && ( matches = rcssNum.exec( value ) ) && 11909 ( matches[ 3 ] || "px" ) !== "px" ) { 11910 11911 elem.style[ dimension ] = value; 11912 value = jQuery.css( elem, dimension ); 11913 } 11914 11915 return setPositiveNumber( elem, value, subtract ); 11916 } 11917 }; 11918} ); 11919 11920jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 11921 function( elem, computed ) { 11922 if ( computed ) { 11923 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 11924 elem.getBoundingClientRect().left - 11925 swap( elem, { marginLeft: 0 }, function() { 11926 return elem.getBoundingClientRect().left; 11927 } ) 11928 ) + "px"; 11929 } 11930 } 11931); 11932 11933// These hooks are used by animate to expand properties 11934jQuery.each( { 11935 margin: "", 11936 padding: "", 11937 border: "Width" 11938}, function( prefix, suffix ) { 11939 jQuery.cssHooks[ prefix + suffix ] = { 11940 expand: function( value ) { 11941 var i = 0, 11942 expanded = {}, 11943 11944 // Assumes a single number if not a string 11945 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 11946 11947 for ( ; i < 4; i++ ) { 11948 expanded[ prefix + cssExpand[ i ] + suffix ] = 11949 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 11950 } 11951 11952 return expanded; 11953 } 11954 }; 11955 11956 if ( prefix !== "margin" ) { 11957 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 11958 } 11959} ); 11960 11961jQuery.fn.extend( { 11962 css: function( name, value ) { 11963 return access( this, function( elem, name, value ) { 11964 var styles, len, 11965 map = {}, 11966 i = 0; 11967 11968 if ( Array.isArray( name ) ) { 11969 styles = getStyles( elem ); 11970 len = name.length; 11971 11972 for ( ; i < len; i++ ) { 11973 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 11974 } 11975 11976 return map; 11977 } 11978 11979 return value !== undefined ? 11980 jQuery.style( elem, name, value ) : 11981 jQuery.css( elem, name ); 11982 }, name, value, arguments.length > 1 ); 11983 } 11984} ); 11985 11986 11987function Tween( elem, options, prop, end, easing ) { 11988 return new Tween.prototype.init( elem, options, prop, end, easing ); 11989} 11990jQuery.Tween = Tween; 11991 11992Tween.prototype = { 11993 constructor: Tween, 11994 init: function( elem, options, prop, end, easing, unit ) { 11995 this.elem = elem; 11996 this.prop = prop; 11997 this.easing = easing || jQuery.easing._default; 11998 this.options = options; 11999 this.start = this.now = this.cur(); 12000 this.end = end; 12001 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 12002 }, 12003 cur: function() { 12004 var hooks = Tween.propHooks[ this.prop ]; 12005 12006 return hooks && hooks.get ? 12007 hooks.get( this ) : 12008 Tween.propHooks._default.get( this ); 12009 }, 12010 run: function( percent ) { 12011 var eased, 12012 hooks = Tween.propHooks[ this.prop ]; 12013 12014 if ( this.options.duration ) { 12015 this.pos = eased = jQuery.easing[ this.easing ]( 12016 percent, this.options.duration * percent, 0, 1, this.options.duration 12017 ); 12018 } else { 12019 this.pos = eased = percent; 12020 } 12021 this.now = ( this.end - this.start ) * eased + this.start; 12022 12023 if ( this.options.step ) { 12024 this.options.step.call( this.elem, this.now, this ); 12025 } 12026 12027 if ( hooks && hooks.set ) { 12028 hooks.set( this ); 12029 } else { 12030 Tween.propHooks._default.set( this ); 12031 } 12032 return this; 12033 } 12034}; 12035 12036Tween.prototype.init.prototype = Tween.prototype; 12037 12038Tween.propHooks = { 12039 _default: { 12040 get: function( tween ) { 12041 var result; 12042 12043 // Use a property on the element directly when it is not a DOM element, 12044 // or when there is no matching style property that exists. 12045 if ( tween.elem.nodeType !== 1 || 12046 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 12047 return tween.elem[ tween.prop ]; 12048 } 12049 12050 // Passing an empty string as a 3rd parameter to .css will automatically 12051 // attempt a parseFloat and fallback to a string if the parse fails. 12052 // Simple values such as "10px" are parsed to Float; 12053 // complex values such as "rotate(1rad)" are returned as-is. 12054 result = jQuery.css( tween.elem, tween.prop, "" ); 12055 12056 // Empty strings, null, undefined and "auto" are converted to 0. 12057 return !result || result === "auto" ? 0 : result; 12058 }, 12059 set: function( tween ) { 12060 12061 // Use step hook for back compat. 12062 // Use cssHook if its there. 12063 // Use .style if available and use plain properties where available. 12064 if ( jQuery.fx.step[ tween.prop ] ) { 12065 jQuery.fx.step[ tween.prop ]( tween ); 12066 } else if ( tween.elem.nodeType === 1 && ( 12067 jQuery.cssHooks[ tween.prop ] || 12068 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { 12069 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 12070 } else { 12071 tween.elem[ tween.prop ] = tween.now; 12072 } 12073 } 12074 } 12075}; 12076 12077// Support: IE <=9 only 12078// Panic based approach to setting things on disconnected nodes 12079Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 12080 set: function( tween ) { 12081 if ( tween.elem.nodeType && tween.elem.parentNode ) { 12082 tween.elem[ tween.prop ] = tween.now; 12083 } 12084 } 12085}; 12086 12087jQuery.easing = { 12088 linear: function( p ) { 12089 return p; 12090 }, 12091 swing: function( p ) { 12092 return 0.5 - Math.cos( p * Math.PI ) / 2; 12093 }, 12094 _default: "swing" 12095}; 12096 12097jQuery.fx = Tween.prototype.init; 12098 12099// Back compat <1.8 extension point 12100jQuery.fx.step = {}; 12101 12102 12103 12104 12105var 12106 fxNow, inProgress, 12107 rfxtypes = /^(?:toggle|show|hide)$/, 12108 rrun = /queueHooks$/; 12109 12110function schedule() { 12111 if ( inProgress ) { 12112 if ( document.hidden === false && window.requestAnimationFrame ) { 12113 window.requestAnimationFrame( schedule ); 12114 } else { 12115 window.setTimeout( schedule, jQuery.fx.interval ); 12116 } 12117 12118 jQuery.fx.tick(); 12119 } 12120} 12121 12122// Animations created synchronously will run synchronously 12123function createFxNow() { 12124 window.setTimeout( function() { 12125 fxNow = undefined; 12126 } ); 12127 return ( fxNow = Date.now() ); 12128} 12129 12130// Generate parameters to create a standard animation 12131function genFx( type, includeWidth ) { 12132 var which, 12133 i = 0, 12134 attrs = { height: type }; 12135 12136 // If we include width, step value is 1 to do all cssExpand values, 12137 // otherwise step value is 2 to skip over Left and Right 12138 includeWidth = includeWidth ? 1 : 0; 12139 for ( ; i < 4; i += 2 - includeWidth ) { 12140 which = cssExpand[ i ]; 12141 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 12142 } 12143 12144 if ( includeWidth ) { 12145 attrs.opacity = attrs.width = type; 12146 } 12147 12148 return attrs; 12149} 12150 12151function createTween( value, prop, animation ) { 12152 var tween, 12153 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 12154 index = 0, 12155 length = collection.length; 12156 for ( ; index < length; index++ ) { 12157 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 12158 12159 // We're done with this property 12160 return tween; 12161 } 12162 } 12163} 12164 12165function defaultPrefilter( elem, props, opts ) { 12166 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 12167 isBox = "width" in props || "height" in props, 12168 anim = this, 12169 orig = {}, 12170 style = elem.style, 12171 hidden = elem.nodeType && isHiddenWithinTree( elem ), 12172 dataShow = dataPriv.get( elem, "fxshow" ); 12173 12174 // Queue-skipping animations hijack the fx hooks 12175 if ( !opts.queue ) { 12176 hooks = jQuery._queueHooks( elem, "fx" ); 12177 if ( hooks.unqueued == null ) { 12178 hooks.unqueued = 0; 12179 oldfire = hooks.empty.fire; 12180 hooks.empty.fire = function() { 12181 if ( !hooks.unqueued ) { 12182 oldfire(); 12183 } 12184 }; 12185 } 12186 hooks.unqueued++; 12187 12188 anim.always( function() { 12189 12190 // Ensure the complete handler is called before this completes 12191 anim.always( function() { 12192 hooks.unqueued--; 12193 if ( !jQuery.queue( elem, "fx" ).length ) { 12194 hooks.empty.fire(); 12195 } 12196 } ); 12197 } ); 12198 } 12199 12200 // Detect show/hide animations 12201 for ( prop in props ) { 12202 value = props[ prop ]; 12203 if ( rfxtypes.test( value ) ) { 12204 delete props[ prop ]; 12205 toggle = toggle || value === "toggle"; 12206 if ( value === ( hidden ? "hide" : "show" ) ) { 12207 12208 // Pretend to be hidden if this is a "show" and 12209 // there is still data from a stopped show/hide 12210 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 12211 hidden = true; 12212 12213 // Ignore all other no-op show/hide data 12214 } else { 12215 continue; 12216 } 12217 } 12218 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 12219 } 12220 } 12221 12222 // Bail out if this is a no-op like .hide().hide() 12223 propTween = !jQuery.isEmptyObject( props ); 12224 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 12225 return; 12226 } 12227 12228 // Restrict "overflow" and "display" styles during box animations 12229 if ( isBox && elem.nodeType === 1 ) { 12230 12231 // Support: IE <=9 - 11, Edge 12 - 15 12232 // Record all 3 overflow attributes because IE does not infer the shorthand 12233 // from identically-valued overflowX and overflowY and Edge just mirrors 12234 // the overflowX value there. 12235 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 12236 12237 // Identify a display type, preferring old show/hide data over the CSS cascade 12238 restoreDisplay = dataShow && dataShow.display; 12239 if ( restoreDisplay == null ) { 12240 restoreDisplay = dataPriv.get( elem, "display" ); 12241 } 12242 display = jQuery.css( elem, "display" ); 12243 if ( display === "none" ) { 12244 if ( restoreDisplay ) { 12245 display = restoreDisplay; 12246 } else { 12247 12248 // Get nonempty value(s) by temporarily forcing visibility 12249 showHide( [ elem ], true ); 12250 restoreDisplay = elem.style.display || restoreDisplay; 12251 display = jQuery.css( elem, "display" ); 12252 showHide( [ elem ] ); 12253 } 12254 } 12255 12256 // Animate inline elements as inline-block 12257 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 12258 if ( jQuery.css( elem, "float" ) === "none" ) { 12259 12260 // Restore the original display value at the end of pure show/hide animations 12261 if ( !propTween ) { 12262 anim.done( function() { 12263 style.display = restoreDisplay; 12264 } ); 12265 if ( restoreDisplay == null ) { 12266 display = style.display; 12267 restoreDisplay = display === "none" ? "" : display; 12268 } 12269 } 12270 style.display = "inline-block"; 12271 } 12272 } 12273 } 12274 12275 if ( opts.overflow ) { 12276 style.overflow = "hidden"; 12277 anim.always( function() { 12278 style.overflow = opts.overflow[ 0 ]; 12279 style.overflowX = opts.overflow[ 1 ]; 12280 style.overflowY = opts.overflow[ 2 ]; 12281 } ); 12282 } 12283 12284 // Implement show/hide animations 12285 propTween = false; 12286 for ( prop in orig ) { 12287 12288 // General show/hide setup for this element animation 12289 if ( !propTween ) { 12290 if ( dataShow ) { 12291 if ( "hidden" in dataShow ) { 12292 hidden = dataShow.hidden; 12293 } 12294 } else { 12295 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 12296 } 12297 12298 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 12299 if ( toggle ) { 12300 dataShow.hidden = !hidden; 12301 } 12302 12303 // Show elements before animating them 12304 if ( hidden ) { 12305 showHide( [ elem ], true ); 12306 } 12307 12308 /* eslint-disable no-loop-func */ 12309 12310 anim.done( function() { 12311 12312 /* eslint-enable no-loop-func */ 12313 12314 // The final step of a "hide" animation is actually hiding the element 12315 if ( !hidden ) { 12316 showHide( [ elem ] ); 12317 } 12318 dataPriv.remove( elem, "fxshow" ); 12319 for ( prop in orig ) { 12320 jQuery.style( elem, prop, orig[ prop ] ); 12321 } 12322 } ); 12323 } 12324 12325 // Per-property setup 12326 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 12327 if ( !( prop in dataShow ) ) { 12328 dataShow[ prop ] = propTween.start; 12329 if ( hidden ) { 12330 propTween.end = propTween.start; 12331 propTween.start = 0; 12332 } 12333 } 12334 } 12335} 12336 12337function propFilter( props, specialEasing ) { 12338 var index, name, easing, value, hooks; 12339 12340 // camelCase, specialEasing and expand cssHook pass 12341 for ( index in props ) { 12342 name = camelCase( index ); 12343 easing = specialEasing[ name ]; 12344 value = props[ index ]; 12345 if ( Array.isArray( value ) ) { 12346 easing = value[ 1 ]; 12347 value = props[ index ] = value[ 0 ]; 12348 } 12349 12350 if ( index !== name ) { 12351 props[ name ] = value; 12352 delete props[ index ]; 12353 } 12354 12355 hooks = jQuery.cssHooks[ name ]; 12356 if ( hooks && "expand" in hooks ) { 12357 value = hooks.expand( value ); 12358 delete props[ name ]; 12359 12360 // Not quite $.extend, this won't overwrite existing keys. 12361 // Reusing 'index' because we have the correct "name" 12362 for ( index in value ) { 12363 if ( !( index in props ) ) { 12364 props[ index ] = value[ index ]; 12365 specialEasing[ index ] = easing; 12366 } 12367 } 12368 } else { 12369 specialEasing[ name ] = easing; 12370 } 12371 } 12372} 12373 12374function Animation( elem, properties, options ) { 12375 var result, 12376 stopped, 12377 index = 0, 12378 length = Animation.prefilters.length, 12379 deferred = jQuery.Deferred().always( function() { 12380 12381 // Don't match elem in the :animated selector 12382 delete tick.elem; 12383 } ), 12384 tick = function() { 12385 if ( stopped ) { 12386 return false; 12387 } 12388 var currentTime = fxNow || createFxNow(), 12389 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 12390 12391 // Support: Android 2.3 only 12392 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 12393 temp = remaining / animation.duration || 0, 12394 percent = 1 - temp, 12395 index = 0, 12396 length = animation.tweens.length; 12397 12398 for ( ; index < length; index++ ) { 12399 animation.tweens[ index ].run( percent ); 12400 } 12401 12402 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 12403 12404 // If there's more to do, yield 12405 if ( percent < 1 && length ) { 12406 return remaining; 12407 } 12408 12409 // If this was an empty animation, synthesize a final progress notification 12410 if ( !length ) { 12411 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 12412 } 12413 12414 // Resolve the animation and report its conclusion 12415 deferred.resolveWith( elem, [ animation ] ); 12416 return false; 12417 }, 12418 animation = deferred.promise( { 12419 elem: elem, 12420 props: jQuery.extend( {}, properties ), 12421 opts: jQuery.extend( true, { 12422 specialEasing: {}, 12423 easing: jQuery.easing._default 12424 }, options ), 12425 originalProperties: properties, 12426 originalOptions: options, 12427 startTime: fxNow || createFxNow(), 12428 duration: options.duration, 12429 tweens: [], 12430 createTween: function( prop, end ) { 12431 var tween = jQuery.Tween( elem, animation.opts, prop, end, 12432 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 12433 animation.tweens.push( tween ); 12434 return tween; 12435 }, 12436 stop: function( gotoEnd ) { 12437 var index = 0, 12438 12439 // If we are going to the end, we want to run all the tweens 12440 // otherwise we skip this part 12441 length = gotoEnd ? animation.tweens.length : 0; 12442 if ( stopped ) { 12443 return this; 12444 } 12445 stopped = true; 12446 for ( ; index < length; index++ ) { 12447 animation.tweens[ index ].run( 1 ); 12448 } 12449 12450 // Resolve when we played the last frame; otherwise, reject 12451 if ( gotoEnd ) { 12452 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 12453 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 12454 } else { 12455 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 12456 } 12457 return this; 12458 } 12459 } ), 12460 props = animation.props; 12461 12462 propFilter( props, animation.opts.specialEasing ); 12463 12464 for ( ; index < length; index++ ) { 12465 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 12466 if ( result ) { 12467 if ( isFunction( result.stop ) ) { 12468 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 12469 result.stop.bind( result ); 12470 } 12471 return result; 12472 } 12473 } 12474 12475 jQuery.map( props, createTween, animation ); 12476 12477 if ( isFunction( animation.opts.start ) ) { 12478 animation.opts.start.call( elem, animation ); 12479 } 12480 12481 // Attach callbacks from options 12482 animation 12483 .progress( animation.opts.progress ) 12484 .done( animation.opts.done, animation.opts.complete ) 12485 .fail( animation.opts.fail ) 12486 .always( animation.opts.always ); 12487 12488 jQuery.fx.timer( 12489 jQuery.extend( tick, { 12490 elem: elem, 12491 anim: animation, 12492 queue: animation.opts.queue 12493 } ) 12494 ); 12495 12496 return animation; 12497} 12498 12499jQuery.Animation = jQuery.extend( Animation, { 12500 12501 tweeners: { 12502 "*": [ function( prop, value ) { 12503 var tween = this.createTween( prop, value ); 12504 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 12505 return tween; 12506 } ] 12507 }, 12508 12509 tweener: function( props, callback ) { 12510 if ( isFunction( props ) ) { 12511 callback = props; 12512 props = [ "*" ]; 12513 } else { 12514 props = props.match( rnothtmlwhite ); 12515 } 12516 12517 var prop, 12518 index = 0, 12519 length = props.length; 12520 12521 for ( ; index < length; index++ ) { 12522 prop = props[ index ]; 12523 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 12524 Animation.tweeners[ prop ].unshift( callback ); 12525 } 12526 }, 12527 12528 prefilters: [ defaultPrefilter ], 12529 12530 prefilter: function( callback, prepend ) { 12531 if ( prepend ) { 12532 Animation.prefilters.unshift( callback ); 12533 } else { 12534 Animation.prefilters.push( callback ); 12535 } 12536 } 12537} ); 12538 12539jQuery.speed = function( speed, easing, fn ) { 12540 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 12541 complete: fn || !fn && easing || 12542 isFunction( speed ) && speed, 12543 duration: speed, 12544 easing: fn && easing || easing && !isFunction( easing ) && easing 12545 }; 12546 12547 // Go to the end state if fx are off 12548 if ( jQuery.fx.off ) { 12549 opt.duration = 0; 12550 12551 } else { 12552 if ( typeof opt.duration !== "number" ) { 12553 if ( opt.duration in jQuery.fx.speeds ) { 12554 opt.duration = jQuery.fx.speeds[ opt.duration ]; 12555 12556 } else { 12557 opt.duration = jQuery.fx.speeds._default; 12558 } 12559 } 12560 } 12561 12562 // Normalize opt.queue - true/undefined/null -> "fx" 12563 if ( opt.queue == null || opt.queue === true ) { 12564 opt.queue = "fx"; 12565 } 12566 12567 // Queueing 12568 opt.old = opt.complete; 12569 12570 opt.complete = function() { 12571 if ( isFunction( opt.old ) ) { 12572 opt.old.call( this ); 12573 } 12574 12575 if ( opt.queue ) { 12576 jQuery.dequeue( this, opt.queue ); 12577 } 12578 }; 12579 12580 return opt; 12581}; 12582 12583jQuery.fn.extend( { 12584 fadeTo: function( speed, to, easing, callback ) { 12585 12586 // Show any hidden elements after setting opacity to 0 12587 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 12588 12589 // Animate to the value specified 12590 .end().animate( { opacity: to }, speed, easing, callback ); 12591 }, 12592 animate: function( prop, speed, easing, callback ) { 12593 var empty = jQuery.isEmptyObject( prop ), 12594 optall = jQuery.speed( speed, easing, callback ), 12595 doAnimation = function() { 12596 12597 // Operate on a copy of prop so per-property easing won't be lost 12598 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 12599 12600 // Empty animations, or finishing resolves immediately 12601 if ( empty || dataPriv.get( this, "finish" ) ) { 12602 anim.stop( true ); 12603 } 12604 }; 12605 doAnimation.finish = doAnimation; 12606 12607 return empty || optall.queue === false ? 12608 this.each( doAnimation ) : 12609 this.queue( optall.queue, doAnimation ); 12610 }, 12611 stop: function( type, clearQueue, gotoEnd ) { 12612 var stopQueue = function( hooks ) { 12613 var stop = hooks.stop; 12614 delete hooks.stop; 12615 stop( gotoEnd ); 12616 }; 12617 12618 if ( typeof type !== "string" ) { 12619 gotoEnd = clearQueue; 12620 clearQueue = type; 12621 type = undefined; 12622 } 12623 if ( clearQueue && type !== false ) { 12624 this.queue( type || "fx", [] ); 12625 } 12626 12627 return this.each( function() { 12628 var dequeue = true, 12629 index = type != null && type + "queueHooks", 12630 timers = jQuery.timers, 12631 data = dataPriv.get( this ); 12632 12633 if ( index ) { 12634 if ( data[ index ] && data[ index ].stop ) { 12635 stopQueue( data[ index ] ); 12636 } 12637 } else { 12638 for ( index in data ) { 12639 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 12640 stopQueue( data[ index ] ); 12641 } 12642 } 12643 } 12644 12645 for ( index = timers.length; index--; ) { 12646 if ( timers[ index ].elem === this && 12647 ( type == null || timers[ index ].queue === type ) ) { 12648 12649 timers[ index ].anim.stop( gotoEnd ); 12650 dequeue = false; 12651 timers.splice( index, 1 ); 12652 } 12653 } 12654 12655 // Start the next in the queue if the last step wasn't forced. 12656 // Timers currently will call their complete callbacks, which 12657 // will dequeue but only if they were gotoEnd. 12658 if ( dequeue || !gotoEnd ) { 12659 jQuery.dequeue( this, type ); 12660 } 12661 } ); 12662 }, 12663 finish: function( type ) { 12664 if ( type !== false ) { 12665 type = type || "fx"; 12666 } 12667 return this.each( function() { 12668 var index, 12669 data = dataPriv.get( this ), 12670 queue = data[ type + "queue" ], 12671 hooks = data[ type + "queueHooks" ], 12672 timers = jQuery.timers, 12673 length = queue ? queue.length : 0; 12674 12675 // Enable finishing flag on private data 12676 data.finish = true; 12677 12678 // Empty the queue first 12679 jQuery.queue( this, type, [] ); 12680 12681 if ( hooks && hooks.stop ) { 12682 hooks.stop.call( this, true ); 12683 } 12684 12685 // Look for any active animations, and finish them 12686 for ( index = timers.length; index--; ) { 12687 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 12688 timers[ index ].anim.stop( true ); 12689 timers.splice( index, 1 ); 12690 } 12691 } 12692 12693 // Look for any animations in the old queue and finish them 12694 for ( index = 0; index < length; index++ ) { 12695 if ( queue[ index ] && queue[ index ].finish ) { 12696 queue[ index ].finish.call( this ); 12697 } 12698 } 12699 12700 // Turn off finishing flag 12701 delete data.finish; 12702 } ); 12703 } 12704} ); 12705 12706jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { 12707 var cssFn = jQuery.fn[ name ]; 12708 jQuery.fn[ name ] = function( speed, easing, callback ) { 12709 return speed == null || typeof speed === "boolean" ? 12710 cssFn.apply( this, arguments ) : 12711 this.animate( genFx( name, true ), speed, easing, callback ); 12712 }; 12713} ); 12714 12715// Generate shortcuts for custom animations 12716jQuery.each( { 12717 slideDown: genFx( "show" ), 12718 slideUp: genFx( "hide" ), 12719 slideToggle: genFx( "toggle" ), 12720 fadeIn: { opacity: "show" }, 12721 fadeOut: { opacity: "hide" }, 12722 fadeToggle: { opacity: "toggle" } 12723}, function( name, props ) { 12724 jQuery.fn[ name ] = function( speed, easing, callback ) { 12725 return this.animate( props, speed, easing, callback ); 12726 }; 12727} ); 12728 12729jQuery.timers = []; 12730jQuery.fx.tick = function() { 12731 var timer, 12732 i = 0, 12733 timers = jQuery.timers; 12734 12735 fxNow = Date.now(); 12736 12737 for ( ; i < timers.length; i++ ) { 12738 timer = timers[ i ]; 12739 12740 // Run the timer and safely remove it when done (allowing for external removal) 12741 if ( !timer() && timers[ i ] === timer ) { 12742 timers.splice( i--, 1 ); 12743 } 12744 } 12745 12746 if ( !timers.length ) { 12747 jQuery.fx.stop(); 12748 } 12749 fxNow = undefined; 12750}; 12751 12752jQuery.fx.timer = function( timer ) { 12753 jQuery.timers.push( timer ); 12754 jQuery.fx.start(); 12755}; 12756 12757jQuery.fx.interval = 13; 12758jQuery.fx.start = function() { 12759 if ( inProgress ) { 12760 return; 12761 } 12762 12763 inProgress = true; 12764 schedule(); 12765}; 12766 12767jQuery.fx.stop = function() { 12768 inProgress = null; 12769}; 12770 12771jQuery.fx.speeds = { 12772 slow: 600, 12773 fast: 200, 12774 12775 // Default speed 12776 _default: 400 12777}; 12778 12779 12780// Based off of the plugin by Clint Helfers, with permission. 12781// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 12782jQuery.fn.delay = function( time, type ) { 12783 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 12784 type = type || "fx"; 12785 12786 return this.queue( type, function( next, hooks ) { 12787 var timeout = window.setTimeout( next, time ); 12788 hooks.stop = function() { 12789 window.clearTimeout( timeout ); 12790 }; 12791 } ); 12792}; 12793 12794 12795( function() { 12796 var input = document.createElement( "input" ), 12797 select = document.createElement( "select" ), 12798 opt = select.appendChild( document.createElement( "option" ) ); 12799 12800 input.type = "checkbox"; 12801 12802 // Support: Android <=4.3 only 12803 // Default value for a checkbox should be "on" 12804 support.checkOn = input.value !== ""; 12805 12806 // Support: IE <=11 only 12807 // Must access selectedIndex to make default options select 12808 support.optSelected = opt.selected; 12809 12810 // Support: IE <=11 only 12811 // An input loses its value after becoming a radio 12812 input = document.createElement( "input" ); 12813 input.value = "t"; 12814 input.type = "radio"; 12815 support.radioValue = input.value === "t"; 12816} )(); 12817 12818 12819var boolHook, 12820 attrHandle = jQuery.expr.attrHandle; 12821 12822jQuery.fn.extend( { 12823 attr: function( name, value ) { 12824 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 12825 }, 12826 12827 removeAttr: function( name ) { 12828 return this.each( function() { 12829 jQuery.removeAttr( this, name ); 12830 } ); 12831 } 12832} ); 12833 12834jQuery.extend( { 12835 attr: function( elem, name, value ) { 12836 var ret, hooks, 12837 nType = elem.nodeType; 12838 12839 // Don't get/set attributes on text, comment and attribute nodes 12840 if ( nType === 3 || nType === 8 || nType === 2 ) { 12841 return; 12842 } 12843 12844 // Fallback to prop when attributes are not supported 12845 if ( typeof elem.getAttribute === "undefined" ) { 12846 return jQuery.prop( elem, name, value ); 12847 } 12848 12849 // Attribute hooks are determined by the lowercase version 12850 // Grab necessary hook if one is defined 12851 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 12852 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 12853 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 12854 } 12855 12856 if ( value !== undefined ) { 12857 if ( value === null ) { 12858 jQuery.removeAttr( elem, name ); 12859 return; 12860 } 12861 12862 if ( hooks && "set" in hooks && 12863 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 12864 return ret; 12865 } 12866 12867 elem.setAttribute( name, value + "" ); 12868 return value; 12869 } 12870 12871 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 12872 return ret; 12873 } 12874 12875 ret = jQuery.find.attr( elem, name ); 12876 12877 // Non-existent attributes return null, we normalize to undefined 12878 return ret == null ? undefined : ret; 12879 }, 12880 12881 attrHooks: { 12882 type: { 12883 set: function( elem, value ) { 12884 if ( !support.radioValue && value === "radio" && 12885 nodeName( elem, "input" ) ) { 12886 var val = elem.value; 12887 elem.setAttribute( "type", value ); 12888 if ( val ) { 12889 elem.value = val; 12890 } 12891 return value; 12892 } 12893 } 12894 } 12895 }, 12896 12897 removeAttr: function( elem, value ) { 12898 var name, 12899 i = 0, 12900 12901 // Attribute names can contain non-HTML whitespace characters 12902 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 12903 attrNames = value && value.match( rnothtmlwhite ); 12904 12905 if ( attrNames && elem.nodeType === 1 ) { 12906 while ( ( name = attrNames[ i++ ] ) ) { 12907 elem.removeAttribute( name ); 12908 } 12909 } 12910 } 12911} ); 12912 12913// Hooks for boolean attributes 12914boolHook = { 12915 set: function( elem, value, name ) { 12916 if ( value === false ) { 12917 12918 // Remove boolean attributes when set to false 12919 jQuery.removeAttr( elem, name ); 12920 } else { 12921 elem.setAttribute( name, name ); 12922 } 12923 return name; 12924 } 12925}; 12926 12927jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { 12928 var getter = attrHandle[ name ] || jQuery.find.attr; 12929 12930 attrHandle[ name ] = function( elem, name, isXML ) { 12931 var ret, handle, 12932 lowercaseName = name.toLowerCase(); 12933 12934 if ( !isXML ) { 12935 12936 // Avoid an infinite loop by temporarily removing this function from the getter 12937 handle = attrHandle[ lowercaseName ]; 12938 attrHandle[ lowercaseName ] = ret; 12939 ret = getter( elem, name, isXML ) != null ? 12940 lowercaseName : 12941 null; 12942 attrHandle[ lowercaseName ] = handle; 12943 } 12944 return ret; 12945 }; 12946} ); 12947 12948 12949 12950 12951var rfocusable = /^(?:input|select|textarea|button)$/i, 12952 rclickable = /^(?:a|area)$/i; 12953 12954jQuery.fn.extend( { 12955 prop: function( name, value ) { 12956 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 12957 }, 12958 12959 removeProp: function( name ) { 12960 return this.each( function() { 12961 delete this[ jQuery.propFix[ name ] || name ]; 12962 } ); 12963 } 12964} ); 12965 12966jQuery.extend( { 12967 prop: function( elem, name, value ) { 12968 var ret, hooks, 12969 nType = elem.nodeType; 12970 12971 // Don't get/set properties on text, comment and attribute nodes 12972 if ( nType === 3 || nType === 8 || nType === 2 ) { 12973 return; 12974 } 12975 12976 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 12977 12978 // Fix name and attach hooks 12979 name = jQuery.propFix[ name ] || name; 12980 hooks = jQuery.propHooks[ name ]; 12981 } 12982 12983 if ( value !== undefined ) { 12984 if ( hooks && "set" in hooks && 12985 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 12986 return ret; 12987 } 12988 12989 return ( elem[ name ] = value ); 12990 } 12991 12992 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 12993 return ret; 12994 } 12995 12996 return elem[ name ]; 12997 }, 12998 12999 propHooks: { 13000 tabIndex: { 13001 get: function( elem ) { 13002 13003 // Support: IE <=9 - 11 only 13004 // elem.tabIndex doesn't always return the 13005 // correct value when it hasn't been explicitly set 13006 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 13007 // Use proper attribute retrieval(#12072) 13008 var tabindex = jQuery.find.attr( elem, "tabindex" ); 13009 13010 if ( tabindex ) { 13011 return parseInt( tabindex, 10 ); 13012 } 13013 13014 if ( 13015 rfocusable.test( elem.nodeName ) || 13016 rclickable.test( elem.nodeName ) && 13017 elem.href 13018 ) { 13019 return 0; 13020 } 13021 13022 return -1; 13023 } 13024 } 13025 }, 13026 13027 propFix: { 13028 "for": "htmlFor", 13029 "class": "className" 13030 } 13031} ); 13032 13033// Support: IE <=11 only 13034// Accessing the selectedIndex property 13035// forces the browser to respect setting selected 13036// on the option 13037// The getter ensures a default option is selected 13038// when in an optgroup 13039// eslint rule "no-unused-expressions" is disabled for this code 13040// since it considers such accessions noop 13041if ( !support.optSelected ) { 13042 jQuery.propHooks.selected = { 13043 get: function( elem ) { 13044 13045 /* eslint no-unused-expressions: "off" */ 13046 13047 var parent = elem.parentNode; 13048 if ( parent && parent.parentNode ) { 13049 parent.parentNode.selectedIndex; 13050 } 13051 return null; 13052 }, 13053 set: function( elem ) { 13054 13055 /* eslint no-unused-expressions: "off" */ 13056 13057 var parent = elem.parentNode; 13058 if ( parent ) { 13059 parent.selectedIndex; 13060 13061 if ( parent.parentNode ) { 13062 parent.parentNode.selectedIndex; 13063 } 13064 } 13065 } 13066 }; 13067} 13068 13069jQuery.each( [ 13070 "tabIndex", 13071 "readOnly", 13072 "maxLength", 13073 "cellSpacing", 13074 "cellPadding", 13075 "rowSpan", 13076 "colSpan", 13077 "useMap", 13078 "frameBorder", 13079 "contentEditable" 13080], function() { 13081 jQuery.propFix[ this.toLowerCase() ] = this; 13082} ); 13083 13084 13085 13086 13087 // Strip and collapse whitespace according to HTML spec 13088 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 13089 function stripAndCollapse( value ) { 13090 var tokens = value.match( rnothtmlwhite ) || []; 13091 return tokens.join( " " ); 13092 } 13093 13094 13095function getClass( elem ) { 13096 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 13097} 13098 13099function classesToArray( value ) { 13100 if ( Array.isArray( value ) ) { 13101 return value; 13102 } 13103 if ( typeof value === "string" ) { 13104 return value.match( rnothtmlwhite ) || []; 13105 } 13106 return []; 13107} 13108 13109jQuery.fn.extend( { 13110 addClass: function( value ) { 13111 var classes, elem, cur, curValue, clazz, j, finalValue, 13112 i = 0; 13113 13114 if ( isFunction( value ) ) { 13115 return this.each( function( j ) { 13116 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 13117 } ); 13118 } 13119 13120 classes = classesToArray( value ); 13121 13122 if ( classes.length ) { 13123 while ( ( elem = this[ i++ ] ) ) { 13124 curValue = getClass( elem ); 13125 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 13126 13127 if ( cur ) { 13128 j = 0; 13129 while ( ( clazz = classes[ j++ ] ) ) { 13130 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 13131 cur += clazz + " "; 13132 } 13133 } 13134 13135 // Only assign if different to avoid unneeded rendering. 13136 finalValue = stripAndCollapse( cur ); 13137 if ( curValue !== finalValue ) { 13138 elem.setAttribute( "class", finalValue ); 13139 } 13140 } 13141 } 13142 } 13143 13144 return this; 13145 }, 13146 13147 removeClass: function( value ) { 13148 var classes, elem, cur, curValue, clazz, j, finalValue, 13149 i = 0; 13150 13151 if ( isFunction( value ) ) { 13152 return this.each( function( j ) { 13153 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 13154 } ); 13155 } 13156 13157 if ( !arguments.length ) { 13158 return this.attr( "class", "" ); 13159 } 13160 13161 classes = classesToArray( value ); 13162 13163 if ( classes.length ) { 13164 while ( ( elem = this[ i++ ] ) ) { 13165 curValue = getClass( elem ); 13166 13167 // This expression is here for better compressibility (see addClass) 13168 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 13169 13170 if ( cur ) { 13171 j = 0; 13172 while ( ( clazz = classes[ j++ ] ) ) { 13173 13174 // Remove *all* instances 13175 while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 13176 cur = cur.replace( " " + clazz + " ", " " ); 13177 } 13178 } 13179 13180 // Only assign if different to avoid unneeded rendering. 13181 finalValue = stripAndCollapse( cur ); 13182 if ( curValue !== finalValue ) { 13183 elem.setAttribute( "class", finalValue ); 13184 } 13185 } 13186 } 13187 } 13188 13189 return this; 13190 }, 13191 13192 toggleClass: function( value, stateVal ) { 13193 var type = typeof value, 13194 isValidValue = type === "string" || Array.isArray( value ); 13195 13196 if ( typeof stateVal === "boolean" && isValidValue ) { 13197 return stateVal ? this.addClass( value ) : this.removeClass( value ); 13198 } 13199 13200 if ( isFunction( value ) ) { 13201 return this.each( function( i ) { 13202 jQuery( this ).toggleClass( 13203 value.call( this, i, getClass( this ), stateVal ), 13204 stateVal 13205 ); 13206 } ); 13207 } 13208 13209 return this.each( function() { 13210 var className, i, self, classNames; 13211 13212 if ( isValidValue ) { 13213 13214 // Toggle individual class names 13215 i = 0; 13216 self = jQuery( this ); 13217 classNames = classesToArray( value ); 13218 13219 while ( ( className = classNames[ i++ ] ) ) { 13220 13221 // Check each className given, space separated list 13222 if ( self.hasClass( className ) ) { 13223 self.removeClass( className ); 13224 } else { 13225 self.addClass( className ); 13226 } 13227 } 13228 13229 // Toggle whole class name 13230 } else if ( value === undefined || type === "boolean" ) { 13231 className = getClass( this ); 13232 if ( className ) { 13233 13234 // Store className if set 13235 dataPriv.set( this, "__className__", className ); 13236 } 13237 13238 // If the element has a class name or if we're passed `false`, 13239 // then remove the whole classname (if there was one, the above saved it). 13240 // Otherwise bring back whatever was previously saved (if anything), 13241 // falling back to the empty string if nothing was stored. 13242 if ( this.setAttribute ) { 13243 this.setAttribute( "class", 13244 className || value === false ? 13245 "" : 13246 dataPriv.get( this, "__className__" ) || "" 13247 ); 13248 } 13249 } 13250 } ); 13251 }, 13252 13253 hasClass: function( selector ) { 13254 var className, elem, 13255 i = 0; 13256 13257 className = " " + selector + " "; 13258 while ( ( elem = this[ i++ ] ) ) { 13259 if ( elem.nodeType === 1 && 13260 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 13261 return true; 13262 } 13263 } 13264 13265 return false; 13266 } 13267} ); 13268 13269 13270 13271 13272var rreturn = /\r/g; 13273 13274jQuery.fn.extend( { 13275 val: function( value ) { 13276 var hooks, ret, valueIsFunction, 13277 elem = this[ 0 ]; 13278 13279 if ( !arguments.length ) { 13280 if ( elem ) { 13281 hooks = jQuery.valHooks[ elem.type ] || 13282 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 13283 13284 if ( hooks && 13285 "get" in hooks && 13286 ( ret = hooks.get( elem, "value" ) ) !== undefined 13287 ) { 13288 return ret; 13289 } 13290 13291 ret = elem.value; 13292 13293 // Handle most common string cases 13294 if ( typeof ret === "string" ) { 13295 return ret.replace( rreturn, "" ); 13296 } 13297 13298 // Handle cases where value is null/undef or number 13299 return ret == null ? "" : ret; 13300 } 13301 13302 return; 13303 } 13304 13305 valueIsFunction = isFunction( value ); 13306 13307 return this.each( function( i ) { 13308 var val; 13309 13310 if ( this.nodeType !== 1 ) { 13311 return; 13312 } 13313 13314 if ( valueIsFunction ) { 13315 val = value.call( this, i, jQuery( this ).val() ); 13316 } else { 13317 val = value; 13318 } 13319 13320 // Treat null/undefined as ""; convert numbers to string 13321 if ( val == null ) { 13322 val = ""; 13323 13324 } else if ( typeof val === "number" ) { 13325 val += ""; 13326 13327 } else if ( Array.isArray( val ) ) { 13328 val = jQuery.map( val, function( value ) { 13329 return value == null ? "" : value + ""; 13330 } ); 13331 } 13332 13333 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 13334 13335 // If set returns undefined, fall back to normal setting 13336 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 13337 this.value = val; 13338 } 13339 } ); 13340 } 13341} ); 13342 13343jQuery.extend( { 13344 valHooks: { 13345 option: { 13346 get: function( elem ) { 13347 13348 var val = jQuery.find.attr( elem, "value" ); 13349 return val != null ? 13350 val : 13351 13352 // Support: IE <=10 - 11 only 13353 // option.text throws exceptions (#14686, #14858) 13354 // Strip and collapse whitespace 13355 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 13356 stripAndCollapse( jQuery.text( elem ) ); 13357 } 13358 }, 13359 select: { 13360 get: function( elem ) { 13361 var value, option, i, 13362 options = elem.options, 13363 index = elem.selectedIndex, 13364 one = elem.type === "select-one", 13365 values = one ? null : [], 13366 max = one ? index + 1 : options.length; 13367 13368 if ( index < 0 ) { 13369 i = max; 13370 13371 } else { 13372 i = one ? index : 0; 13373 } 13374 13375 // Loop through all the selected options 13376 for ( ; i < max; i++ ) { 13377 option = options[ i ]; 13378 13379 // Support: IE <=9 only 13380 // IE8-9 doesn't update selected after form reset (#2551) 13381 if ( ( option.selected || i === index ) && 13382 13383 // Don't return options that are disabled or in a disabled optgroup 13384 !option.disabled && 13385 ( !option.parentNode.disabled || 13386 !nodeName( option.parentNode, "optgroup" ) ) ) { 13387 13388 // Get the specific value for the option 13389 value = jQuery( option ).val(); 13390 13391 // We don't need an array for one selects 13392 if ( one ) { 13393 return value; 13394 } 13395 13396 // Multi-Selects return an array 13397 values.push( value ); 13398 } 13399 } 13400 13401 return values; 13402 }, 13403 13404 set: function( elem, value ) { 13405 var optionSet, option, 13406 options = elem.options, 13407 values = jQuery.makeArray( value ), 13408 i = options.length; 13409 13410 while ( i-- ) { 13411 option = options[ i ]; 13412 13413 /* eslint-disable no-cond-assign */ 13414 13415 if ( option.selected = 13416 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 13417 ) { 13418 optionSet = true; 13419 } 13420 13421 /* eslint-enable no-cond-assign */ 13422 } 13423 13424 // Force browsers to behave consistently when non-matching value is set 13425 if ( !optionSet ) { 13426 elem.selectedIndex = -1; 13427 } 13428 return values; 13429 } 13430 } 13431 } 13432} ); 13433 13434// Radios and checkboxes getter/setter 13435jQuery.each( [ "radio", "checkbox" ], function() { 13436 jQuery.valHooks[ this ] = { 13437 set: function( elem, value ) { 13438 if ( Array.isArray( value ) ) { 13439 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 13440 } 13441 } 13442 }; 13443 if ( !support.checkOn ) { 13444 jQuery.valHooks[ this ].get = function( elem ) { 13445 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 13446 }; 13447 } 13448} ); 13449 13450 13451 13452 13453// Return jQuery for attributes-only inclusion 13454 13455 13456support.focusin = "onfocusin" in window; 13457 13458 13459var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 13460 stopPropagationCallback = function( e ) { 13461 e.stopPropagation(); 13462 }; 13463 13464jQuery.extend( jQuery.event, { 13465 13466 trigger: function( event, data, elem, onlyHandlers ) { 13467 13468 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 13469 eventPath = [ elem || document ], 13470 type = hasOwn.call( event, "type" ) ? event.type : event, 13471 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 13472 13473 cur = lastElement = tmp = elem = elem || document; 13474 13475 // Don't do events on text and comment nodes 13476 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 13477 return; 13478 } 13479 13480 // focus/blur morphs to focusin/out; ensure we're not firing them right now 13481 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 13482 return; 13483 } 13484 13485 if ( type.indexOf( "." ) > -1 ) { 13486 13487 // Namespaced trigger; create a regexp to match event type in handle() 13488 namespaces = type.split( "." ); 13489 type = namespaces.shift(); 13490 namespaces.sort(); 13491 } 13492 ontype = type.indexOf( ":" ) < 0 && "on" + type; 13493 13494 // Caller can pass in a jQuery.Event object, Object, or just an event type string 13495 event = event[ jQuery.expando ] ? 13496 event : 13497 new jQuery.Event( type, typeof event === "object" && event ); 13498 13499 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 13500 event.isTrigger = onlyHandlers ? 2 : 3; 13501 event.namespace = namespaces.join( "." ); 13502 event.rnamespace = event.namespace ? 13503 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 13504 null; 13505 13506 // Clean up the event in case it is being reused 13507 event.result = undefined; 13508 if ( !event.target ) { 13509 event.target = elem; 13510 } 13511 13512 // Clone any incoming data and prepend the event, creating the handler arg list 13513 data = data == null ? 13514 [ event ] : 13515 jQuery.makeArray( data, [ event ] ); 13516 13517 // Allow special events to draw outside the lines 13518 special = jQuery.event.special[ type ] || {}; 13519 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 13520 return; 13521 } 13522 13523 // Determine event propagation path in advance, per W3C events spec (#9951) 13524 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 13525 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 13526 13527 bubbleType = special.delegateType || type; 13528 if ( !rfocusMorph.test( bubbleType + type ) ) { 13529 cur = cur.parentNode; 13530 } 13531 for ( ; cur; cur = cur.parentNode ) { 13532 eventPath.push( cur ); 13533 tmp = cur; 13534 } 13535 13536 // Only add window if we got to document (e.g., not plain obj or detached DOM) 13537 if ( tmp === ( elem.ownerDocument || document ) ) { 13538 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 13539 } 13540 } 13541 13542 // Fire handlers on the event path 13543 i = 0; 13544 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 13545 lastElement = cur; 13546 event.type = i > 1 ? 13547 bubbleType : 13548 special.bindType || type; 13549 13550 // jQuery handler 13551 handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && 13552 dataPriv.get( cur, "handle" ); 13553 if ( handle ) { 13554 handle.apply( cur, data ); 13555 } 13556 13557 // Native handler 13558 handle = ontype && cur[ ontype ]; 13559 if ( handle && handle.apply && acceptData( cur ) ) { 13560 event.result = handle.apply( cur, data ); 13561 if ( event.result === false ) { 13562 event.preventDefault(); 13563 } 13564 } 13565 } 13566 event.type = type; 13567 13568 // If nobody prevented the default action, do it now 13569 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 13570 13571 if ( ( !special._default || 13572 special._default.apply( eventPath.pop(), data ) === false ) && 13573 acceptData( elem ) ) { 13574 13575 // Call a native DOM method on the target with the same name as the event. 13576 // Don't do default actions on window, that's where global variables be (#6170) 13577 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 13578 13579 // Don't re-trigger an onFOO event when we call its FOO() method 13580 tmp = elem[ ontype ]; 13581 13582 if ( tmp ) { 13583 elem[ ontype ] = null; 13584 } 13585 13586 // Prevent re-triggering of the same event, since we already bubbled it above 13587 jQuery.event.triggered = type; 13588 13589 if ( event.isPropagationStopped() ) { 13590 lastElement.addEventListener( type, stopPropagationCallback ); 13591 } 13592 13593 elem[ type ](); 13594 13595 if ( event.isPropagationStopped() ) { 13596 lastElement.removeEventListener( type, stopPropagationCallback ); 13597 } 13598 13599 jQuery.event.triggered = undefined; 13600 13601 if ( tmp ) { 13602 elem[ ontype ] = tmp; 13603 } 13604 } 13605 } 13606 } 13607 13608 return event.result; 13609 }, 13610 13611 // Piggyback on a donor event to simulate a different one 13612 // Used only for `focus(in | out)` events 13613 simulate: function( type, elem, event ) { 13614 var e = jQuery.extend( 13615 new jQuery.Event(), 13616 event, 13617 { 13618 type: type, 13619 isSimulated: true 13620 } 13621 ); 13622 13623 jQuery.event.trigger( e, null, elem ); 13624 } 13625 13626} ); 13627 13628jQuery.fn.extend( { 13629 13630 trigger: function( type, data ) { 13631 return this.each( function() { 13632 jQuery.event.trigger( type, data, this ); 13633 } ); 13634 }, 13635 triggerHandler: function( type, data ) { 13636 var elem = this[ 0 ]; 13637 if ( elem ) { 13638 return jQuery.event.trigger( type, data, elem, true ); 13639 } 13640 } 13641} ); 13642 13643 13644// Support: Firefox <=44 13645// Firefox doesn't have focus(in | out) events 13646// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 13647// 13648// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 13649// focus(in | out) events fire after focus & blur events, 13650// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 13651// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 13652if ( !support.focusin ) { 13653 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 13654 13655 // Attach a single capturing handler on the document while someone wants focusin/focusout 13656 var handler = function( event ) { 13657 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 13658 }; 13659 13660 jQuery.event.special[ fix ] = { 13661 setup: function() { 13662 var doc = this.ownerDocument || this, 13663 attaches = dataPriv.access( doc, fix ); 13664 13665 if ( !attaches ) { 13666 doc.addEventListener( orig, handler, true ); 13667 } 13668 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); 13669 }, 13670 teardown: function() { 13671 var doc = this.ownerDocument || this, 13672 attaches = dataPriv.access( doc, fix ) - 1; 13673 13674 if ( !attaches ) { 13675 doc.removeEventListener( orig, handler, true ); 13676 dataPriv.remove( doc, fix ); 13677 13678 } else { 13679 dataPriv.access( doc, fix, attaches ); 13680 } 13681 } 13682 }; 13683 } ); 13684} 13685var location = window.location; 13686 13687var nonce = Date.now(); 13688 13689var rquery = ( /\?/ ); 13690 13691 13692 13693// Cross-browser xml parsing 13694jQuery.parseXML = function( data ) { 13695 var xml; 13696 if ( !data || typeof data !== "string" ) { 13697 return null; 13698 } 13699 13700 // Support: IE 9 - 11 only 13701 // IE throws on parseFromString with invalid input. 13702 try { 13703 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 13704 } catch ( e ) { 13705 xml = undefined; 13706 } 13707 13708 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 13709 jQuery.error( "Invalid XML: " + data ); 13710 } 13711 return xml; 13712}; 13713 13714 13715var 13716 rbracket = /\[\]$/, 13717 rCRLF = /\r?\n/g, 13718 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 13719 rsubmittable = /^(?:input|select|textarea|keygen)/i; 13720 13721function buildParams( prefix, obj, traditional, add ) { 13722 var name; 13723 13724 if ( Array.isArray( obj ) ) { 13725 13726 // Serialize array item. 13727 jQuery.each( obj, function( i, v ) { 13728 if ( traditional || rbracket.test( prefix ) ) { 13729 13730 // Treat each array item as a scalar. 13731 add( prefix, v ); 13732 13733 } else { 13734 13735 // Item is non-scalar (array or object), encode its numeric index. 13736 buildParams( 13737 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 13738 v, 13739 traditional, 13740 add 13741 ); 13742 } 13743 } ); 13744 13745 } else if ( !traditional && toType( obj ) === "object" ) { 13746 13747 // Serialize object item. 13748 for ( name in obj ) { 13749 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 13750 } 13751 13752 } else { 13753 13754 // Serialize scalar item. 13755 add( prefix, obj ); 13756 } 13757} 13758 13759// Serialize an array of form elements or a set of 13760// key/values into a query string 13761jQuery.param = function( a, traditional ) { 13762 var prefix, 13763 s = [], 13764 add = function( key, valueOrFunction ) { 13765 13766 // If value is a function, invoke it and use its return value 13767 var value = isFunction( valueOrFunction ) ? 13768 valueOrFunction() : 13769 valueOrFunction; 13770 13771 s[ s.length ] = encodeURIComponent( key ) + "=" + 13772 encodeURIComponent( value == null ? "" : value ); 13773 }; 13774 13775 if ( a == null ) { 13776 return ""; 13777 } 13778 13779 // If an array was passed in, assume that it is an array of form elements. 13780 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 13781 13782 // Serialize the form elements 13783 jQuery.each( a, function() { 13784 add( this.name, this.value ); 13785 } ); 13786 13787 } else { 13788 13789 // If traditional, encode the "old" way (the way 1.3.2 or older 13790 // did it), otherwise encode params recursively. 13791 for ( prefix in a ) { 13792 buildParams( prefix, a[ prefix ], traditional, add ); 13793 } 13794 } 13795 13796 // Return the resulting serialization 13797 return s.join( "&" ); 13798}; 13799 13800jQuery.fn.extend( { 13801 serialize: function() { 13802 return jQuery.param( this.serializeArray() ); 13803 }, 13804 serializeArray: function() { 13805 return this.map( function() { 13806 13807 // Can add propHook for "elements" to filter or add form elements 13808 var elements = jQuery.prop( this, "elements" ); 13809 return elements ? jQuery.makeArray( elements ) : this; 13810 } ) 13811 .filter( function() { 13812 var type = this.type; 13813 13814 // Use .is( ":disabled" ) so that fieldset[disabled] works 13815 return this.name && !jQuery( this ).is( ":disabled" ) && 13816 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 13817 ( this.checked || !rcheckableType.test( type ) ); 13818 } ) 13819 .map( function( i, elem ) { 13820 var val = jQuery( this ).val(); 13821 13822 if ( val == null ) { 13823 return null; 13824 } 13825 13826 if ( Array.isArray( val ) ) { 13827 return jQuery.map( val, function( val ) { 13828 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 13829 } ); 13830 } 13831 13832 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 13833 } ).get(); 13834 } 13835} ); 13836 13837 13838var 13839 r20 = /%20/g, 13840 rhash = /#.*$/, 13841 rantiCache = /([?&])_=[^&]*/, 13842 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 13843 13844 // #7653, #8125, #8152: local protocol detection 13845 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 13846 rnoContent = /^(?:GET|HEAD)$/, 13847 rprotocol = /^\/\//, 13848 13849 /* Prefilters 13850 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 13851 * 2) These are called: 13852 * - BEFORE asking for a transport 13853 * - AFTER param serialization (s.data is a string if s.processData is true) 13854 * 3) key is the dataType 13855 * 4) the catchall symbol "*" can be used 13856 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 13857 */ 13858 prefilters = {}, 13859 13860 /* Transports bindings 13861 * 1) key is the dataType 13862 * 2) the catchall symbol "*" can be used 13863 * 3) selection will start with transport dataType and THEN go to "*" if needed 13864 */ 13865 transports = {}, 13866 13867 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 13868 allTypes = "*/".concat( "*" ), 13869 13870 // Anchor tag for parsing the document origin 13871 originAnchor = document.createElement( "a" ); 13872 originAnchor.href = location.href; 13873 13874// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 13875function addToPrefiltersOrTransports( structure ) { 13876 13877 // dataTypeExpression is optional and defaults to "*" 13878 return function( dataTypeExpression, func ) { 13879 13880 if ( typeof dataTypeExpression !== "string" ) { 13881 func = dataTypeExpression; 13882 dataTypeExpression = "*"; 13883 } 13884 13885 var dataType, 13886 i = 0, 13887 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 13888 13889 if ( isFunction( func ) ) { 13890 13891 // For each dataType in the dataTypeExpression 13892 while ( ( dataType = dataTypes[ i++ ] ) ) { 13893 13894 // Prepend if requested 13895 if ( dataType[ 0 ] === "+" ) { 13896 dataType = dataType.slice( 1 ) || "*"; 13897 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 13898 13899 // Otherwise append 13900 } else { 13901 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 13902 } 13903 } 13904 } 13905 }; 13906} 13907 13908// Base inspection function for prefilters and transports 13909function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 13910 13911 var inspected = {}, 13912 seekingTransport = ( structure === transports ); 13913 13914 function inspect( dataType ) { 13915 var selected; 13916 inspected[ dataType ] = true; 13917 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 13918 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 13919 if ( typeof dataTypeOrTransport === "string" && 13920 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 13921 13922 options.dataTypes.unshift( dataTypeOrTransport ); 13923 inspect( dataTypeOrTransport ); 13924 return false; 13925 } else if ( seekingTransport ) { 13926 return !( selected = dataTypeOrTransport ); 13927 } 13928 } ); 13929 return selected; 13930 } 13931 13932 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 13933} 13934 13935// A special extend for ajax options 13936// that takes "flat" options (not to be deep extended) 13937// Fixes #9887 13938function ajaxExtend( target, src ) { 13939 var key, deep, 13940 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 13941 13942 for ( key in src ) { 13943 if ( src[ key ] !== undefined ) { 13944 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 13945 } 13946 } 13947 if ( deep ) { 13948 jQuery.extend( true, target, deep ); 13949 } 13950 13951 return target; 13952} 13953 13954/* Handles responses to an ajax request: 13955 * - finds the right dataType (mediates between content-type and expected dataType) 13956 * - returns the corresponding response 13957 */ 13958function ajaxHandleResponses( s, jqXHR, responses ) { 13959 13960 var ct, type, finalDataType, firstDataType, 13961 contents = s.contents, 13962 dataTypes = s.dataTypes; 13963 13964 // Remove auto dataType and get content-type in the process 13965 while ( dataTypes[ 0 ] === "*" ) { 13966 dataTypes.shift(); 13967 if ( ct === undefined ) { 13968 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 13969 } 13970 } 13971 13972 // Check if we're dealing with a known content-type 13973 if ( ct ) { 13974 for ( type in contents ) { 13975 if ( contents[ type ] && contents[ type ].test( ct ) ) { 13976 dataTypes.unshift( type ); 13977 break; 13978 } 13979 } 13980 } 13981 13982 // Check to see if we have a response for the expected dataType 13983 if ( dataTypes[ 0 ] in responses ) { 13984 finalDataType = dataTypes[ 0 ]; 13985 } else { 13986 13987 // Try convertible dataTypes 13988 for ( type in responses ) { 13989 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 13990 finalDataType = type; 13991 break; 13992 } 13993 if ( !firstDataType ) { 13994 firstDataType = type; 13995 } 13996 } 13997 13998 // Or just use first one 13999 finalDataType = finalDataType || firstDataType; 14000 } 14001 14002 // If we found a dataType 14003 // We add the dataType to the list if needed 14004 // and return the corresponding response 14005 if ( finalDataType ) { 14006 if ( finalDataType !== dataTypes[ 0 ] ) { 14007 dataTypes.unshift( finalDataType ); 14008 } 14009 return responses[ finalDataType ]; 14010 } 14011} 14012 14013/* Chain conversions given the request and the original response 14014 * Also sets the responseXXX fields on the jqXHR instance 14015 */ 14016function ajaxConvert( s, response, jqXHR, isSuccess ) { 14017 var conv2, current, conv, tmp, prev, 14018 converters = {}, 14019 14020 // Work with a copy of dataTypes in case we need to modify it for conversion 14021 dataTypes = s.dataTypes.slice(); 14022 14023 // Create converters map with lowercased keys 14024 if ( dataTypes[ 1 ] ) { 14025 for ( conv in s.converters ) { 14026 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 14027 } 14028 } 14029 14030 current = dataTypes.shift(); 14031 14032 // Convert to each sequential dataType 14033 while ( current ) { 14034 14035 if ( s.responseFields[ current ] ) { 14036 jqXHR[ s.responseFields[ current ] ] = response; 14037 } 14038 14039 // Apply the dataFilter if provided 14040 if ( !prev && isSuccess && s.dataFilter ) { 14041 response = s.dataFilter( response, s.dataType ); 14042 } 14043 14044 prev = current; 14045 current = dataTypes.shift(); 14046 14047 if ( current ) { 14048 14049 // There's only work to do if current dataType is non-auto 14050 if ( current === "*" ) { 14051 14052 current = prev; 14053 14054 // Convert response if prev dataType is non-auto and differs from current 14055 } else if ( prev !== "*" && prev !== current ) { 14056 14057 // Seek a direct converter 14058 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 14059 14060 // If none found, seek a pair 14061 if ( !conv ) { 14062 for ( conv2 in converters ) { 14063 14064 // If conv2 outputs current 14065 tmp = conv2.split( " " ); 14066 if ( tmp[ 1 ] === current ) { 14067 14068 // If prev can be converted to accepted input 14069 conv = converters[ prev + " " + tmp[ 0 ] ] || 14070 converters[ "* " + tmp[ 0 ] ]; 14071 if ( conv ) { 14072 14073 // Condense equivalence converters 14074 if ( conv === true ) { 14075 conv = converters[ conv2 ]; 14076 14077 // Otherwise, insert the intermediate dataType 14078 } else if ( converters[ conv2 ] !== true ) { 14079 current = tmp[ 0 ]; 14080 dataTypes.unshift( tmp[ 1 ] ); 14081 } 14082 break; 14083 } 14084 } 14085 } 14086 } 14087 14088 // Apply converter (if not an equivalence) 14089 if ( conv !== true ) { 14090 14091 // Unless errors are allowed to bubble, catch and return them 14092 if ( conv && s.throws ) { 14093 response = conv( response ); 14094 } else { 14095 try { 14096 response = conv( response ); 14097 } catch ( e ) { 14098 return { 14099 state: "parsererror", 14100 error: conv ? e : "No conversion from " + prev + " to " + current 14101 }; 14102 } 14103 } 14104 } 14105 } 14106 } 14107 } 14108 14109 return { state: "success", data: response }; 14110} 14111 14112jQuery.extend( { 14113 14114 // Counter for holding the number of active queries 14115 active: 0, 14116 14117 // Last-Modified header cache for next request 14118 lastModified: {}, 14119 etag: {}, 14120 14121 ajaxSettings: { 14122 url: location.href, 14123 type: "GET", 14124 isLocal: rlocalProtocol.test( location.protocol ), 14125 global: true, 14126 processData: true, 14127 async: true, 14128 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 14129 14130 /* 14131 timeout: 0, 14132 data: null, 14133 dataType: null, 14134 username: null, 14135 password: null, 14136 cache: null, 14137 throws: false, 14138 traditional: false, 14139 headers: {}, 14140 */ 14141 14142 accepts: { 14143 "*": allTypes, 14144 text: "text/plain", 14145 html: "text/html", 14146 xml: "application/xml, text/xml", 14147 json: "application/json, text/javascript" 14148 }, 14149 14150 contents: { 14151 xml: /\bxml\b/, 14152 html: /\bhtml/, 14153 json: /\bjson\b/ 14154 }, 14155 14156 responseFields: { 14157 xml: "responseXML", 14158 text: "responseText", 14159 json: "responseJSON" 14160 }, 14161 14162 // Data converters 14163 // Keys separate source (or catchall "*") and destination types with a single space 14164 converters: { 14165 14166 // Convert anything to text 14167 "* text": String, 14168 14169 // Text to html (true = no transformation) 14170 "text html": true, 14171 14172 // Evaluate text as a json expression 14173 "text json": JSON.parse, 14174 14175 // Parse text as xml 14176 "text xml": jQuery.parseXML 14177 }, 14178 14179 // For options that shouldn't be deep extended: 14180 // you can add your own custom options here if 14181 // and when you create one that shouldn't be 14182 // deep extended (see ajaxExtend) 14183 flatOptions: { 14184 url: true, 14185 context: true 14186 } 14187 }, 14188 14189 // Creates a full fledged settings object into target 14190 // with both ajaxSettings and settings fields. 14191 // If target is omitted, writes into ajaxSettings. 14192 ajaxSetup: function( target, settings ) { 14193 return settings ? 14194 14195 // Building a settings object 14196 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 14197 14198 // Extending ajaxSettings 14199 ajaxExtend( jQuery.ajaxSettings, target ); 14200 }, 14201 14202 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 14203 ajaxTransport: addToPrefiltersOrTransports( transports ), 14204 14205 // Main method 14206 ajax: function( url, options ) { 14207 14208 // If url is an object, simulate pre-1.5 signature 14209 if ( typeof url === "object" ) { 14210 options = url; 14211 url = undefined; 14212 } 14213 14214 // Force options to be an object 14215 options = options || {}; 14216 14217 var transport, 14218 14219 // URL without anti-cache param 14220 cacheURL, 14221 14222 // Response headers 14223 responseHeadersString, 14224 responseHeaders, 14225 14226 // timeout handle 14227 timeoutTimer, 14228 14229 // Url cleanup var 14230 urlAnchor, 14231 14232 // Request state (becomes false upon send and true upon completion) 14233 completed, 14234 14235 // To know if global events are to be dispatched 14236 fireGlobals, 14237 14238 // Loop variable 14239 i, 14240 14241 // uncached part of the url 14242 uncached, 14243 14244 // Create the final options object 14245 s = jQuery.ajaxSetup( {}, options ), 14246 14247 // Callbacks context 14248 callbackContext = s.context || s, 14249 14250 // Context for global events is callbackContext if it is a DOM node or jQuery collection 14251 globalEventContext = s.context && 14252 ( callbackContext.nodeType || callbackContext.jquery ) ? 14253 jQuery( callbackContext ) : 14254 jQuery.event, 14255 14256 // Deferreds 14257 deferred = jQuery.Deferred(), 14258 completeDeferred = jQuery.Callbacks( "once memory" ), 14259 14260 // Status-dependent callbacks 14261 statusCode = s.statusCode || {}, 14262 14263 // Headers (they are sent all at once) 14264 requestHeaders = {}, 14265 requestHeadersNames = {}, 14266 14267 // Default abort message 14268 strAbort = "canceled", 14269 14270 // Fake xhr 14271 jqXHR = { 14272 readyState: 0, 14273 14274 // Builds headers hashtable if needed 14275 getResponseHeader: function( key ) { 14276 var match; 14277 if ( completed ) { 14278 if ( !responseHeaders ) { 14279 responseHeaders = {}; 14280 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 14281 responseHeaders[ match[ 1 ].toLowerCase() + " " ] = 14282 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) 14283 .concat( match[ 2 ] ); 14284 } 14285 } 14286 match = responseHeaders[ key.toLowerCase() + " " ]; 14287 } 14288 return match == null ? null : match.join( ", " ); 14289 }, 14290 14291 // Raw string 14292 getAllResponseHeaders: function() { 14293 return completed ? responseHeadersString : null; 14294 }, 14295 14296 // Caches the header 14297 setRequestHeader: function( name, value ) { 14298 if ( completed == null ) { 14299 name = requestHeadersNames[ name.toLowerCase() ] = 14300 requestHeadersNames[ name.toLowerCase() ] || name; 14301 requestHeaders[ name ] = value; 14302 } 14303 return this; 14304 }, 14305 14306 // Overrides response content-type header 14307 overrideMimeType: function( type ) { 14308 if ( completed == null ) { 14309 s.mimeType = type; 14310 } 14311 return this; 14312 }, 14313 14314 // Status-dependent callbacks 14315 statusCode: function( map ) { 14316 var code; 14317 if ( map ) { 14318 if ( completed ) { 14319 14320 // Execute the appropriate callbacks 14321 jqXHR.always( map[ jqXHR.status ] ); 14322 } else { 14323 14324 // Lazy-add the new callbacks in a way that preserves old ones 14325 for ( code in map ) { 14326 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 14327 } 14328 } 14329 } 14330 return this; 14331 }, 14332 14333 // Cancel the request 14334 abort: function( statusText ) { 14335 var finalText = statusText || strAbort; 14336 if ( transport ) { 14337 transport.abort( finalText ); 14338 } 14339 done( 0, finalText ); 14340 return this; 14341 } 14342 }; 14343 14344 // Attach deferreds 14345 deferred.promise( jqXHR ); 14346 14347 // Add protocol if not provided (prefilters might expect it) 14348 // Handle falsy url in the settings object (#10093: consistency with old signature) 14349 // We also use the url parameter if available 14350 s.url = ( ( url || s.url || location.href ) + "" ) 14351 .replace( rprotocol, location.protocol + "//" ); 14352 14353 // Alias method option to type as per ticket #12004 14354 s.type = options.method || options.type || s.method || s.type; 14355 14356 // Extract dataTypes list 14357 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 14358 14359 // A cross-domain request is in order when the origin doesn't match the current origin. 14360 if ( s.crossDomain == null ) { 14361 urlAnchor = document.createElement( "a" ); 14362 14363 // Support: IE <=8 - 11, Edge 12 - 15 14364 // IE throws exception on accessing the href property if url is malformed, 14365 // e.g. http://example.com:80x/ 14366 try { 14367 urlAnchor.href = s.url; 14368 14369 // Support: IE <=8 - 11 only 14370 // Anchor's host property isn't correctly set when s.url is relative 14371 urlAnchor.href = urlAnchor.href; 14372 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 14373 urlAnchor.protocol + "//" + urlAnchor.host; 14374 } catch ( e ) { 14375 14376 // If there is an error parsing the URL, assume it is crossDomain, 14377 // it can be rejected by the transport if it is invalid 14378 s.crossDomain = true; 14379 } 14380 } 14381 14382 // Convert data if not already a string 14383 if ( s.data && s.processData && typeof s.data !== "string" ) { 14384 s.data = jQuery.param( s.data, s.traditional ); 14385 } 14386 14387 // Apply prefilters 14388 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 14389 14390 // If request was aborted inside a prefilter, stop there 14391 if ( completed ) { 14392 return jqXHR; 14393 } 14394 14395 // We can fire global events as of now if asked to 14396 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 14397 fireGlobals = jQuery.event && s.global; 14398 14399 // Watch for a new set of requests 14400 if ( fireGlobals && jQuery.active++ === 0 ) { 14401 jQuery.event.trigger( "ajaxStart" ); 14402 } 14403 14404 // Uppercase the type 14405 s.type = s.type.toUpperCase(); 14406 14407 // Determine if request has content 14408 s.hasContent = !rnoContent.test( s.type ); 14409 14410 // Save the URL in case we're toying with the If-Modified-Since 14411 // and/or If-None-Match header later on 14412 // Remove hash to simplify url manipulation 14413 cacheURL = s.url.replace( rhash, "" ); 14414 14415 // More options handling for requests with no content 14416 if ( !s.hasContent ) { 14417 14418 // Remember the hash so we can put it back 14419 uncached = s.url.slice( cacheURL.length ); 14420 14421 // If data is available and should be processed, append data to url 14422 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 14423 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 14424 14425 // #9682: remove data so that it's not used in an eventual retry 14426 delete s.data; 14427 } 14428 14429 // Add or update anti-cache param if needed 14430 if ( s.cache === false ) { 14431 cacheURL = cacheURL.replace( rantiCache, "$1" ); 14432 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; 14433 } 14434 14435 // Put hash and anti-cache on the URL that will be requested (gh-1732) 14436 s.url = cacheURL + uncached; 14437 14438 // Change '%20' to '+' if this is encoded form body content (gh-2658) 14439 } else if ( s.data && s.processData && 14440 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 14441 s.data = s.data.replace( r20, "+" ); 14442 } 14443 14444 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 14445 if ( s.ifModified ) { 14446 if ( jQuery.lastModified[ cacheURL ] ) { 14447 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 14448 } 14449 if ( jQuery.etag[ cacheURL ] ) { 14450 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 14451 } 14452 } 14453 14454 // Set the correct header, if data is being sent 14455 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 14456 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 14457 } 14458 14459 // Set the Accepts header for the server, depending on the dataType 14460 jqXHR.setRequestHeader( 14461 "Accept", 14462 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 14463 s.accepts[ s.dataTypes[ 0 ] ] + 14464 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 14465 s.accepts[ "*" ] 14466 ); 14467 14468 // Check for headers option 14469 for ( i in s.headers ) { 14470 jqXHR.setRequestHeader( i, s.headers[ i ] ); 14471 } 14472 14473 // Allow custom headers/mimetypes and early abort 14474 if ( s.beforeSend && 14475 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 14476 14477 // Abort if not done already and return 14478 return jqXHR.abort(); 14479 } 14480 14481 // Aborting is no longer a cancellation 14482 strAbort = "abort"; 14483 14484 // Install callbacks on deferreds 14485 completeDeferred.add( s.complete ); 14486 jqXHR.done( s.success ); 14487 jqXHR.fail( s.error ); 14488 14489 // Get transport 14490 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 14491 14492 // If no transport, we auto-abort 14493 if ( !transport ) { 14494 done( -1, "No Transport" ); 14495 } else { 14496 jqXHR.readyState = 1; 14497 14498 // Send global event 14499 if ( fireGlobals ) { 14500 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 14501 } 14502 14503 // If request was aborted inside ajaxSend, stop there 14504 if ( completed ) { 14505 return jqXHR; 14506 } 14507 14508 // Timeout 14509 if ( s.async && s.timeout > 0 ) { 14510 timeoutTimer = window.setTimeout( function() { 14511 jqXHR.abort( "timeout" ); 14512 }, s.timeout ); 14513 } 14514 14515 try { 14516 completed = false; 14517 transport.send( requestHeaders, done ); 14518 } catch ( e ) { 14519 14520 // Rethrow post-completion exceptions 14521 if ( completed ) { 14522 throw e; 14523 } 14524 14525 // Propagate others as results 14526 done( -1, e ); 14527 } 14528 } 14529 14530 // Callback for when everything is done 14531 function done( status, nativeStatusText, responses, headers ) { 14532 var isSuccess, success, error, response, modified, 14533 statusText = nativeStatusText; 14534 14535 // Ignore repeat invocations 14536 if ( completed ) { 14537 return; 14538 } 14539 14540 completed = true; 14541 14542 // Clear timeout if it exists 14543 if ( timeoutTimer ) { 14544 window.clearTimeout( timeoutTimer ); 14545 } 14546 14547 // Dereference transport for early garbage collection 14548 // (no matter how long the jqXHR object will be used) 14549 transport = undefined; 14550 14551 // Cache response headers 14552 responseHeadersString = headers || ""; 14553 14554 // Set readyState 14555 jqXHR.readyState = status > 0 ? 4 : 0; 14556 14557 // Determine if successful 14558 isSuccess = status >= 200 && status < 300 || status === 304; 14559 14560 // Get response data 14561 if ( responses ) { 14562 response = ajaxHandleResponses( s, jqXHR, responses ); 14563 } 14564 14565 // Convert no matter what (that way responseXXX fields are always set) 14566 response = ajaxConvert( s, response, jqXHR, isSuccess ); 14567 14568 // If successful, handle type chaining 14569 if ( isSuccess ) { 14570 14571 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 14572 if ( s.ifModified ) { 14573 modified = jqXHR.getResponseHeader( "Last-Modified" ); 14574 if ( modified ) { 14575 jQuery.lastModified[ cacheURL ] = modified; 14576 } 14577 modified = jqXHR.getResponseHeader( "etag" ); 14578 if ( modified ) { 14579 jQuery.etag[ cacheURL ] = modified; 14580 } 14581 } 14582 14583 // if no content 14584 if ( status === 204 || s.type === "HEAD" ) { 14585 statusText = "nocontent"; 14586 14587 // if not modified 14588 } else if ( status === 304 ) { 14589 statusText = "notmodified"; 14590 14591 // If we have data, let's convert it 14592 } else { 14593 statusText = response.state; 14594 success = response.data; 14595 error = response.error; 14596 isSuccess = !error; 14597 } 14598 } else { 14599 14600 // Extract error from statusText and normalize for non-aborts 14601 error = statusText; 14602 if ( status || !statusText ) { 14603 statusText = "error"; 14604 if ( status < 0 ) { 14605 status = 0; 14606 } 14607 } 14608 } 14609 14610 // Set data for the fake xhr object 14611 jqXHR.status = status; 14612 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 14613 14614 // Success/Error 14615 if ( isSuccess ) { 14616 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 14617 } else { 14618 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 14619 } 14620 14621 // Status-dependent callbacks 14622 jqXHR.statusCode( statusCode ); 14623 statusCode = undefined; 14624 14625 if ( fireGlobals ) { 14626 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 14627 [ jqXHR, s, isSuccess ? success : error ] ); 14628 } 14629 14630 // Complete 14631 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 14632 14633 if ( fireGlobals ) { 14634 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 14635 14636 // Handle the global AJAX counter 14637 if ( !( --jQuery.active ) ) { 14638 jQuery.event.trigger( "ajaxStop" ); 14639 } 14640 } 14641 } 14642 14643 return jqXHR; 14644 }, 14645 14646 getJSON: function( url, data, callback ) { 14647 return jQuery.get( url, data, callback, "json" ); 14648 }, 14649 14650 getScript: function( url, callback ) { 14651 return jQuery.get( url, undefined, callback, "script" ); 14652 } 14653} ); 14654 14655jQuery.each( [ "get", "post" ], function( i, method ) { 14656 jQuery[ method ] = function( url, data, callback, type ) { 14657 14658 // Shift arguments if data argument was omitted 14659 if ( isFunction( data ) ) { 14660 type = type || callback; 14661 callback = data; 14662 data = undefined; 14663 } 14664 14665 // The url can be an options object (which then must have .url) 14666 return jQuery.ajax( jQuery.extend( { 14667 url: url, 14668 type: method, 14669 dataType: type, 14670 data: data, 14671 success: callback 14672 }, jQuery.isPlainObject( url ) && url ) ); 14673 }; 14674} ); 14675 14676 14677jQuery._evalUrl = function( url, options ) { 14678 return jQuery.ajax( { 14679 url: url, 14680 14681 // Make this explicit, since user can override this through ajaxSetup (#11264) 14682 type: "GET", 14683 dataType: "script", 14684 cache: true, 14685 async: false, 14686 global: false, 14687 14688 // Only evaluate the response if it is successful (gh-4126) 14689 // dataFilter is not invoked for failure responses, so using it instead 14690 // of the default converter is kludgy but it works. 14691 converters: { 14692 "text script": function() {} 14693 }, 14694 dataFilter: function( response ) { 14695 jQuery.globalEval( response, options ); 14696 } 14697 } ); 14698}; 14699 14700 14701jQuery.fn.extend( { 14702 wrapAll: function( html ) { 14703 var wrap; 14704 14705 if ( this[ 0 ] ) { 14706 if ( isFunction( html ) ) { 14707 html = html.call( this[ 0 ] ); 14708 } 14709 14710 // The elements to wrap the target around 14711 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 14712 14713 if ( this[ 0 ].parentNode ) { 14714 wrap.insertBefore( this[ 0 ] ); 14715 } 14716 14717 wrap.map( function() { 14718 var elem = this; 14719 14720 while ( elem.firstElementChild ) { 14721 elem = elem.firstElementChild; 14722 } 14723 14724 return elem; 14725 } ).append( this ); 14726 } 14727 14728 return this; 14729 }, 14730 14731 wrapInner: function( html ) { 14732 if ( isFunction( html ) ) { 14733 return this.each( function( i ) { 14734 jQuery( this ).wrapInner( html.call( this, i ) ); 14735 } ); 14736 } 14737 14738 return this.each( function() { 14739 var self = jQuery( this ), 14740 contents = self.contents(); 14741 14742 if ( contents.length ) { 14743 contents.wrapAll( html ); 14744 14745 } else { 14746 self.append( html ); 14747 } 14748 } ); 14749 }, 14750 14751 wrap: function( html ) { 14752 var htmlIsFunction = isFunction( html ); 14753 14754 return this.each( function( i ) { 14755 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 14756 } ); 14757 }, 14758 14759 unwrap: function( selector ) { 14760 this.parent( selector ).not( "body" ).each( function() { 14761 jQuery( this ).replaceWith( this.childNodes ); 14762 } ); 14763 return this; 14764 } 14765} ); 14766 14767 14768jQuery.expr.pseudos.hidden = function( elem ) { 14769 return !jQuery.expr.pseudos.visible( elem ); 14770}; 14771jQuery.expr.pseudos.visible = function( elem ) { 14772 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 14773}; 14774 14775 14776 14777 14778jQuery.ajaxSettings.xhr = function() { 14779 try { 14780 return new window.XMLHttpRequest(); 14781 } catch ( e ) {} 14782}; 14783 14784var xhrSuccessStatus = { 14785 14786 // File protocol always yields status code 0, assume 200 14787 0: 200, 14788 14789 // Support: IE <=9 only 14790 // #1450: sometimes IE returns 1223 when it should be 204 14791 1223: 204 14792 }, 14793 xhrSupported = jQuery.ajaxSettings.xhr(); 14794 14795support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 14796support.ajax = xhrSupported = !!xhrSupported; 14797 14798jQuery.ajaxTransport( function( options ) { 14799 var callback, errorCallback; 14800 14801 // Cross domain only allowed if supported through XMLHttpRequest 14802 if ( support.cors || xhrSupported && !options.crossDomain ) { 14803 return { 14804 send: function( headers, complete ) { 14805 var i, 14806 xhr = options.xhr(); 14807 14808 xhr.open( 14809 options.type, 14810 options.url, 14811 options.async, 14812 options.username, 14813 options.password 14814 ); 14815 14816 // Apply custom fields if provided 14817 if ( options.xhrFields ) { 14818 for ( i in options.xhrFields ) { 14819 xhr[ i ] = options.xhrFields[ i ]; 14820 } 14821 } 14822 14823 // Override mime type if needed 14824 if ( options.mimeType && xhr.overrideMimeType ) { 14825 xhr.overrideMimeType( options.mimeType ); 14826 } 14827 14828 // X-Requested-With header 14829 // For cross-domain requests, seeing as conditions for a preflight are 14830 // akin to a jigsaw puzzle, we simply never set it to be sure. 14831 // (it can always be set on a per-request basis or even using ajaxSetup) 14832 // For same-domain requests, won't change header if already provided. 14833 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 14834 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 14835 } 14836 14837 // Set headers 14838 for ( i in headers ) { 14839 xhr.setRequestHeader( i, headers[ i ] ); 14840 } 14841 14842 // Callback 14843 callback = function( type ) { 14844 return function() { 14845 if ( callback ) { 14846 callback = errorCallback = xhr.onload = 14847 xhr.onerror = xhr.onabort = xhr.ontimeout = 14848 xhr.onreadystatechange = null; 14849 14850 if ( type === "abort" ) { 14851 xhr.abort(); 14852 } else if ( type === "error" ) { 14853 14854 // Support: IE <=9 only 14855 // On a manual native abort, IE9 throws 14856 // errors on any property access that is not readyState 14857 if ( typeof xhr.status !== "number" ) { 14858 complete( 0, "error" ); 14859 } else { 14860 complete( 14861 14862 // File: protocol always yields status 0; see #8605, #14207 14863 xhr.status, 14864 xhr.statusText 14865 ); 14866 } 14867 } else { 14868 complete( 14869 xhrSuccessStatus[ xhr.status ] || xhr.status, 14870 xhr.statusText, 14871 14872 // Support: IE <=9 only 14873 // IE9 has no XHR2 but throws on binary (trac-11426) 14874 // For XHR2 non-text, let the caller handle it (gh-2498) 14875 ( xhr.responseType || "text" ) !== "text" || 14876 typeof xhr.responseText !== "string" ? 14877 { binary: xhr.response } : 14878 { text: xhr.responseText }, 14879 xhr.getAllResponseHeaders() 14880 ); 14881 } 14882 } 14883 }; 14884 }; 14885 14886 // Listen to events 14887 xhr.onload = callback(); 14888 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 14889 14890 // Support: IE 9 only 14891 // Use onreadystatechange to replace onabort 14892 // to handle uncaught aborts 14893 if ( xhr.onabort !== undefined ) { 14894 xhr.onabort = errorCallback; 14895 } else { 14896 xhr.onreadystatechange = function() { 14897 14898 // Check readyState before timeout as it changes 14899 if ( xhr.readyState === 4 ) { 14900 14901 // Allow onerror to be called first, 14902 // but that will not handle a native abort 14903 // Also, save errorCallback to a variable 14904 // as xhr.onerror cannot be accessed 14905 window.setTimeout( function() { 14906 if ( callback ) { 14907 errorCallback(); 14908 } 14909 } ); 14910 } 14911 }; 14912 } 14913 14914 // Create the abort callback 14915 callback = callback( "abort" ); 14916 14917 try { 14918 14919 // Do send the request (this may raise an exception) 14920 xhr.send( options.hasContent && options.data || null ); 14921 } catch ( e ) { 14922 14923 // #14683: Only rethrow if this hasn't been notified as an error yet 14924 if ( callback ) { 14925 throw e; 14926 } 14927 } 14928 }, 14929 14930 abort: function() { 14931 if ( callback ) { 14932 callback(); 14933 } 14934 } 14935 }; 14936 } 14937} ); 14938 14939 14940 14941 14942// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 14943jQuery.ajaxPrefilter( function( s ) { 14944 if ( s.crossDomain ) { 14945 s.contents.script = false; 14946 } 14947} ); 14948 14949// Install script dataType 14950jQuery.ajaxSetup( { 14951 accepts: { 14952 script: "text/javascript, application/javascript, " + 14953 "application/ecmascript, application/x-ecmascript" 14954 }, 14955 contents: { 14956 script: /\b(?:java|ecma)script\b/ 14957 }, 14958 converters: { 14959 "text script": function( text ) { 14960 jQuery.globalEval( text ); 14961 return text; 14962 } 14963 } 14964} ); 14965 14966// Handle cache's special case and crossDomain 14967jQuery.ajaxPrefilter( "script", function( s ) { 14968 if ( s.cache === undefined ) { 14969 s.cache = false; 14970 } 14971 if ( s.crossDomain ) { 14972 s.type = "GET"; 14973 } 14974} ); 14975 14976// Bind script tag hack transport 14977jQuery.ajaxTransport( "script", function( s ) { 14978 14979 // This transport only deals with cross domain or forced-by-attrs requests 14980 if ( s.crossDomain || s.scriptAttrs ) { 14981 var script, callback; 14982 return { 14983 send: function( _, complete ) { 14984 script = jQuery( "<script>" ) 14985 .attr( s.scriptAttrs || {} ) 14986 .prop( { charset: s.scriptCharset, src: s.url } ) 14987 .on( "load error", callback = function( evt ) { 14988 script.remove(); 14989 callback = null; 14990 if ( evt ) { 14991 complete( evt.type === "error" ? 404 : 200, evt.type ); 14992 } 14993 } ); 14994 14995 // Use native DOM manipulation to avoid our domManip AJAX trickery 14996 document.head.appendChild( script[ 0 ] ); 14997 }, 14998 abort: function() { 14999 if ( callback ) { 15000 callback(); 15001 } 15002 } 15003 }; 15004 } 15005} ); 15006 15007 15008 15009 15010var oldCallbacks = [], 15011 rjsonp = /(=)\?(?=&|$)|\?\?/; 15012 15013// Default jsonp settings 15014jQuery.ajaxSetup( { 15015 jsonp: "callback", 15016 jsonpCallback: function() { 15017 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); 15018 this[ callback ] = true; 15019 return callback; 15020 } 15021} ); 15022 15023// Detect, normalize options and install callbacks for jsonp requests 15024jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 15025 15026 var callbackName, overwritten, responseContainer, 15027 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 15028 "url" : 15029 typeof s.data === "string" && 15030 ( s.contentType || "" ) 15031 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 15032 rjsonp.test( s.data ) && "data" 15033 ); 15034 15035 // Handle iff the expected data type is "jsonp" or we have a parameter to set 15036 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 15037 15038 // Get callback name, remembering preexisting value associated with it 15039 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 15040 s.jsonpCallback() : 15041 s.jsonpCallback; 15042 15043 // Insert callback into url or form data 15044 if ( jsonProp ) { 15045 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 15046 } else if ( s.jsonp !== false ) { 15047 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 15048 } 15049 15050 // Use data converter to retrieve json after script execution 15051 s.converters[ "script json" ] = function() { 15052 if ( !responseContainer ) { 15053 jQuery.error( callbackName + " was not called" ); 15054 } 15055 return responseContainer[ 0 ]; 15056 }; 15057 15058 // Force json dataType 15059 s.dataTypes[ 0 ] = "json"; 15060 15061 // Install callback 15062 overwritten = window[ callbackName ]; 15063 window[ callbackName ] = function() { 15064 responseContainer = arguments; 15065 }; 15066 15067 // Clean-up function (fires after converters) 15068 jqXHR.always( function() { 15069 15070 // If previous value didn't exist - remove it 15071 if ( overwritten === undefined ) { 15072 jQuery( window ).removeProp( callbackName ); 15073 15074 // Otherwise restore preexisting value 15075 } else { 15076 window[ callbackName ] = overwritten; 15077 } 15078 15079 // Save back as free 15080 if ( s[ callbackName ] ) { 15081 15082 // Make sure that re-using the options doesn't screw things around 15083 s.jsonpCallback = originalSettings.jsonpCallback; 15084 15085 // Save the callback name for future use 15086 oldCallbacks.push( callbackName ); 15087 } 15088 15089 // Call if it was a function and we have a response 15090 if ( responseContainer && isFunction( overwritten ) ) { 15091 overwritten( responseContainer[ 0 ] ); 15092 } 15093 15094 responseContainer = overwritten = undefined; 15095 } ); 15096 15097 // Delegate to script 15098 return "script"; 15099 } 15100} ); 15101 15102 15103 15104 15105// Support: Safari 8 only 15106// In Safari 8 documents created via document.implementation.createHTMLDocument 15107// collapse sibling forms: the second one becomes a child of the first one. 15108// Because of that, this security measure has to be disabled in Safari 8. 15109// https://bugs.webkit.org/show_bug.cgi?id=137337 15110support.createHTMLDocument = ( function() { 15111 var body = document.implementation.createHTMLDocument( "" ).body; 15112 body.innerHTML = "<form></form><form></form>"; 15113 return body.childNodes.length === 2; 15114} )(); 15115 15116 15117// Argument "data" should be string of html 15118// context (optional): If specified, the fragment will be created in this context, 15119// defaults to document 15120// keepScripts (optional): If true, will include scripts passed in the html string 15121jQuery.parseHTML = function( data, context, keepScripts ) { 15122 if ( typeof data !== "string" ) { 15123 return []; 15124 } 15125 if ( typeof context === "boolean" ) { 15126 keepScripts = context; 15127 context = false; 15128 } 15129 15130 var base, parsed, scripts; 15131 15132 if ( !context ) { 15133 15134 // Stop scripts or inline event handlers from being executed immediately 15135 // by using document.implementation 15136 if ( support.createHTMLDocument ) { 15137 context = document.implementation.createHTMLDocument( "" ); 15138 15139 // Set the base href for the created document 15140 // so any parsed elements with URLs 15141 // are based on the document's URL (gh-2965) 15142 base = context.createElement( "base" ); 15143 base.href = document.location.href; 15144 context.head.appendChild( base ); 15145 } else { 15146 context = document; 15147 } 15148 } 15149 15150 parsed = rsingleTag.exec( data ); 15151 scripts = !keepScripts && []; 15152 15153 // Single tag 15154 if ( parsed ) { 15155 return [ context.createElement( parsed[ 1 ] ) ]; 15156 } 15157 15158 parsed = buildFragment( [ data ], context, scripts ); 15159 15160 if ( scripts && scripts.length ) { 15161 jQuery( scripts ).remove(); 15162 } 15163 15164 return jQuery.merge( [], parsed.childNodes ); 15165}; 15166 15167 15168/** 15169 * Load a url into a page 15170 */ 15171jQuery.fn.load = function( url, params, callback ) { 15172 var selector, type, response, 15173 self = this, 15174 off = url.indexOf( " " ); 15175 15176 if ( off > -1 ) { 15177 selector = stripAndCollapse( url.slice( off ) ); 15178 url = url.slice( 0, off ); 15179 } 15180 15181 // If it's a function 15182 if ( isFunction( params ) ) { 15183 15184 // We assume that it's the callback 15185 callback = params; 15186 params = undefined; 15187 15188 // Otherwise, build a param string 15189 } else if ( params && typeof params === "object" ) { 15190 type = "POST"; 15191 } 15192 15193 // If we have elements to modify, make the request 15194 if ( self.length > 0 ) { 15195 jQuery.ajax( { 15196 url: url, 15197 15198 // If "type" variable is undefined, then "GET" method will be used. 15199 // Make value of this field explicit since 15200 // user can override it through ajaxSetup method 15201 type: type || "GET", 15202 dataType: "html", 15203 data: params 15204 } ).done( function( responseText ) { 15205 15206 // Save response for use in complete callback 15207 response = arguments; 15208 15209 self.html( selector ? 15210 15211 // If a selector was specified, locate the right elements in a dummy div 15212 // Exclude scripts to avoid IE 'Permission Denied' errors 15213 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 15214 15215 // Otherwise use the full result 15216 responseText ); 15217 15218 // If the request succeeds, this function gets "data", "status", "jqXHR" 15219 // but they are ignored because response was set above. 15220 // If it fails, this function gets "jqXHR", "status", "error" 15221 } ).always( callback && function( jqXHR, status ) { 15222 self.each( function() { 15223 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 15224 } ); 15225 } ); 15226 } 15227 15228 return this; 15229}; 15230 15231 15232 15233 15234// Attach a bunch of functions for handling common AJAX events 15235jQuery.each( [ 15236 "ajaxStart", 15237 "ajaxStop", 15238 "ajaxComplete", 15239 "ajaxError", 15240 "ajaxSuccess", 15241 "ajaxSend" 15242], function( i, type ) { 15243 jQuery.fn[ type ] = function( fn ) { 15244 return this.on( type, fn ); 15245 }; 15246} ); 15247 15248 15249 15250 15251jQuery.expr.pseudos.animated = function( elem ) { 15252 return jQuery.grep( jQuery.timers, function( fn ) { 15253 return elem === fn.elem; 15254 } ).length; 15255}; 15256 15257 15258 15259 15260jQuery.offset = { 15261 setOffset: function( elem, options, i ) { 15262 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 15263 position = jQuery.css( elem, "position" ), 15264 curElem = jQuery( elem ), 15265 props = {}; 15266 15267 // Set position first, in-case top/left are set even on static elem 15268 if ( position === "static" ) { 15269 elem.style.position = "relative"; 15270 } 15271 15272 curOffset = curElem.offset(); 15273 curCSSTop = jQuery.css( elem, "top" ); 15274 curCSSLeft = jQuery.css( elem, "left" ); 15275 calculatePosition = ( position === "absolute" || position === "fixed" ) && 15276 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 15277 15278 // Need to be able to calculate position if either 15279 // top or left is auto and position is either absolute or fixed 15280 if ( calculatePosition ) { 15281 curPosition = curElem.position(); 15282 curTop = curPosition.top; 15283 curLeft = curPosition.left; 15284 15285 } else { 15286 curTop = parseFloat( curCSSTop ) || 0; 15287 curLeft = parseFloat( curCSSLeft ) || 0; 15288 } 15289 15290 if ( isFunction( options ) ) { 15291 15292 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 15293 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 15294 } 15295 15296 if ( options.top != null ) { 15297 props.top = ( options.top - curOffset.top ) + curTop; 15298 } 15299 if ( options.left != null ) { 15300 props.left = ( options.left - curOffset.left ) + curLeft; 15301 } 15302 15303 if ( "using" in options ) { 15304 options.using.call( elem, props ); 15305 15306 } else { 15307 curElem.css( props ); 15308 } 15309 } 15310}; 15311 15312jQuery.fn.extend( { 15313 15314 // offset() relates an element's border box to the document origin 15315 offset: function( options ) { 15316 15317 // Preserve chaining for setter 15318 if ( arguments.length ) { 15319 return options === undefined ? 15320 this : 15321 this.each( function( i ) { 15322 jQuery.offset.setOffset( this, options, i ); 15323 } ); 15324 } 15325 15326 var rect, win, 15327 elem = this[ 0 ]; 15328 15329 if ( !elem ) { 15330 return; 15331 } 15332 15333 // Return zeros for disconnected and hidden (display: none) elements (gh-2310) 15334 // Support: IE <=11 only 15335 // Running getBoundingClientRect on a 15336 // disconnected node in IE throws an error 15337 if ( !elem.getClientRects().length ) { 15338 return { top: 0, left: 0 }; 15339 } 15340 15341 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 15342 rect = elem.getBoundingClientRect(); 15343 win = elem.ownerDocument.defaultView; 15344 return { 15345 top: rect.top + win.pageYOffset, 15346 left: rect.left + win.pageXOffset 15347 }; 15348 }, 15349 15350 // position() relates an element's margin box to its offset parent's padding box 15351 // This corresponds to the behavior of CSS absolute positioning 15352 position: function() { 15353 if ( !this[ 0 ] ) { 15354 return; 15355 } 15356 15357 var offsetParent, offset, doc, 15358 elem = this[ 0 ], 15359 parentOffset = { top: 0, left: 0 }; 15360 15361 // position:fixed elements are offset from the viewport, which itself always has zero offset 15362 if ( jQuery.css( elem, "position" ) === "fixed" ) { 15363 15364 // Assume position:fixed implies availability of getBoundingClientRect 15365 offset = elem.getBoundingClientRect(); 15366 15367 } else { 15368 offset = this.offset(); 15369 15370 // Account for the *real* offset parent, which can be the document or its root element 15371 // when a statically positioned element is identified 15372 doc = elem.ownerDocument; 15373 offsetParent = elem.offsetParent || doc.documentElement; 15374 while ( offsetParent && 15375 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 15376 jQuery.css( offsetParent, "position" ) === "static" ) { 15377 15378 offsetParent = offsetParent.parentNode; 15379 } 15380 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { 15381 15382 // Incorporate borders into its offset, since they are outside its content origin 15383 parentOffset = jQuery( offsetParent ).offset(); 15384 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 15385 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 15386 } 15387 } 15388 15389 // Subtract parent offsets and element margins 15390 return { 15391 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 15392 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 15393 }; 15394 }, 15395 15396 // This method will return documentElement in the following cases: 15397 // 1) For the element inside the iframe without offsetParent, this method will return 15398 // documentElement of the parent window 15399 // 2) For the hidden or detached element 15400 // 3) For body or html element, i.e. in case of the html node - it will return itself 15401 // 15402 // but those exceptions were never presented as a real life use-cases 15403 // and might be considered as more preferable results. 15404 // 15405 // This logic, however, is not guaranteed and can change at any point in the future 15406 offsetParent: function() { 15407 return this.map( function() { 15408 var offsetParent = this.offsetParent; 15409 15410 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 15411 offsetParent = offsetParent.offsetParent; 15412 } 15413 15414 return offsetParent || documentElement; 15415 } ); 15416 } 15417} ); 15418 15419// Create scrollLeft and scrollTop methods 15420jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 15421 var top = "pageYOffset" === prop; 15422 15423 jQuery.fn[ method ] = function( val ) { 15424 return access( this, function( elem, method, val ) { 15425 15426 // Coalesce documents and windows 15427 var win; 15428 if ( isWindow( elem ) ) { 15429 win = elem; 15430 } else if ( elem.nodeType === 9 ) { 15431 win = elem.defaultView; 15432 } 15433 15434 if ( val === undefined ) { 15435 return win ? win[ prop ] : elem[ method ]; 15436 } 15437 15438 if ( win ) { 15439 win.scrollTo( 15440 !top ? val : win.pageXOffset, 15441 top ? val : win.pageYOffset 15442 ); 15443 15444 } else { 15445 elem[ method ] = val; 15446 } 15447 }, method, val, arguments.length ); 15448 }; 15449} ); 15450 15451// Support: Safari <=7 - 9.1, Chrome <=37 - 49 15452// Add the top/left cssHooks using jQuery.fn.position 15453// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 15454// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 15455// getComputedStyle returns percent when specified for top/left/bottom/right; 15456// rather than make the css module depend on the offset module, just check for it here 15457jQuery.each( [ "top", "left" ], function( i, prop ) { 15458 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 15459 function( elem, computed ) { 15460 if ( computed ) { 15461 computed = curCSS( elem, prop ); 15462 15463 // If curCSS returns percentage, fallback to offset 15464 return rnumnonpx.test( computed ) ? 15465 jQuery( elem ).position()[ prop ] + "px" : 15466 computed; 15467 } 15468 } 15469 ); 15470} ); 15471 15472 15473// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 15474jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 15475 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, 15476 function( defaultExtra, funcName ) { 15477 15478 // Margin is only for outerHeight, outerWidth 15479 jQuery.fn[ funcName ] = function( margin, value ) { 15480 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 15481 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 15482 15483 return access( this, function( elem, type, value ) { 15484 var doc; 15485 15486 if ( isWindow( elem ) ) { 15487 15488 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 15489 return funcName.indexOf( "outer" ) === 0 ? 15490 elem[ "inner" + name ] : 15491 elem.document.documentElement[ "client" + name ]; 15492 } 15493 15494 // Get document width or height 15495 if ( elem.nodeType === 9 ) { 15496 doc = elem.documentElement; 15497 15498 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 15499 // whichever is greatest 15500 return Math.max( 15501 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 15502 elem.body[ "offset" + name ], doc[ "offset" + name ], 15503 doc[ "client" + name ] 15504 ); 15505 } 15506 15507 return value === undefined ? 15508 15509 // Get width or height on the element, requesting but not forcing parseFloat 15510 jQuery.css( elem, type, extra ) : 15511 15512 // Set width or height on the element 15513 jQuery.style( elem, type, value, extra ); 15514 }, type, chainable ? margin : undefined, chainable ); 15515 }; 15516 } ); 15517} ); 15518 15519 15520jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + 15521 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 15522 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 15523 function( i, name ) { 15524 15525 // Handle event binding 15526 jQuery.fn[ name ] = function( data, fn ) { 15527 return arguments.length > 0 ? 15528 this.on( name, null, data, fn ) : 15529 this.trigger( name ); 15530 }; 15531} ); 15532 15533jQuery.fn.extend( { 15534 hover: function( fnOver, fnOut ) { 15535 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 15536 } 15537} ); 15538 15539 15540 15541 15542jQuery.fn.extend( { 15543 15544 bind: function( types, data, fn ) { 15545 return this.on( types, null, data, fn ); 15546 }, 15547 unbind: function( types, fn ) { 15548 return this.off( types, null, fn ); 15549 }, 15550 15551 delegate: function( selector, types, data, fn ) { 15552 return this.on( types, selector, data, fn ); 15553 }, 15554 undelegate: function( selector, types, fn ) { 15555 15556 // ( namespace ) or ( selector, types [, fn] ) 15557 return arguments.length === 1 ? 15558 this.off( selector, "**" ) : 15559 this.off( types, selector || "**", fn ); 15560 } 15561} ); 15562 15563// Bind a function to a context, optionally partially applying any 15564// arguments. 15565// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 15566// However, it is not slated for removal any time soon 15567jQuery.proxy = function( fn, context ) { 15568 var tmp, args, proxy; 15569 15570 if ( typeof context === "string" ) { 15571 tmp = fn[ context ]; 15572 context = fn; 15573 fn = tmp; 15574 } 15575 15576 // Quick check to determine if target is callable, in the spec 15577 // this throws a TypeError, but we will just return undefined. 15578 if ( !isFunction( fn ) ) { 15579 return undefined; 15580 } 15581 15582 // Simulated bind 15583 args = slice.call( arguments, 2 ); 15584 proxy = function() { 15585 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 15586 }; 15587 15588 // Set the guid of unique handler to the same of original handler, so it can be removed 15589 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 15590 15591 return proxy; 15592}; 15593 15594jQuery.holdReady = function( hold ) { 15595 if ( hold ) { 15596 jQuery.readyWait++; 15597 } else { 15598 jQuery.ready( true ); 15599 } 15600}; 15601jQuery.isArray = Array.isArray; 15602jQuery.parseJSON = JSON.parse; 15603jQuery.nodeName = nodeName; 15604jQuery.isFunction = isFunction; 15605jQuery.isWindow = isWindow; 15606jQuery.camelCase = camelCase; 15607jQuery.type = toType; 15608 15609jQuery.now = Date.now; 15610 15611jQuery.isNumeric = function( obj ) { 15612 15613 // As of jQuery 3.0, isNumeric is limited to 15614 // strings and numbers (primitives or objects) 15615 // that can be coerced to finite numbers (gh-2662) 15616 var type = jQuery.type( obj ); 15617 return ( type === "number" || type === "string" ) && 15618 15619 // parseFloat NaNs numeric-cast false positives ("") 15620 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 15621 // subtraction forces infinities to NaN 15622 !isNaN( obj - parseFloat( obj ) ); 15623}; 15624 15625 15626 15627 15628// Register as a named AMD module, since jQuery can be concatenated with other 15629// files that may use define, but not via a proper concatenation script that 15630// understands anonymous AMD modules. A named AMD is safest and most robust 15631// way to register. Lowercase jquery is used because AMD module names are 15632// derived from file names, and jQuery is normally delivered in a lowercase 15633// file name. Do this after creating the global so that if an AMD module wants 15634// to call noConflict to hide this version of jQuery, it will work. 15635 15636// Note that for maximum portability, libraries that are not jQuery should 15637// declare themselves as anonymous modules, and avoid setting a global if an 15638// AMD loader is present. jQuery is a special case. For more information, see 15639// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 15640 15641if ( true ) { 15642 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() { 15643 return jQuery; 15644 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 15645 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 15646} 15647 15648 15649 15650 15651var 15652 15653 // Map over jQuery in case of overwrite 15654 _jQuery = window.jQuery, 15655 15656 // Map over the $ in case of overwrite 15657 _$ = window.$; 15658 15659jQuery.noConflict = function( deep ) { 15660 if ( window.$ === jQuery ) { 15661 window.$ = _$; 15662 } 15663 15664 if ( deep && window.jQuery === jQuery ) { 15665 window.jQuery = _jQuery; 15666 } 15667 15668 return jQuery; 15669}; 15670 15671// Expose jQuery and $ identifiers, even in AMD 15672// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 15673// and CommonJS for browser emulators (#13566) 15674if ( !noGlobal ) { 15675 window.jQuery = window.$ = jQuery; 15676} 15677 15678 15679 15680 15681return jQuery; 15682} ); 15683 15684 15685 15686 /***/ 15687 }, 15688 15689
vendor: 88,749 bytes, lines 15689-18307
15689/***/ "../node_modules/popper.js/dist/esm/popper.js": 15690 /*!****************************************************!*\ 15691 !*** ../node_modules/popper.js/dist/esm/popper.js ***! 15692 \****************************************************/ 15693 /*! exports provided: default */ 15694 /***/ function (module, __webpack_exports__, __webpack_require__) { 15695 "use strict"; 15696 __webpack_require__.r(__webpack_exports__); 15697/* WEBPACK VAR INJECTION */(function(global) {/**! 15698 * @fileOverview Kickass library to create and place poppers near their reference elements. 15699 * @version 1.15.0 15700 * @license 15701 * Copyright (c) 2016 Federico Zivolo and contributors 15702 * 15703 * Permission is hereby granted, free of charge, to any person obtaining a copy 15704 * of this software and associated documentation files (the "Software"), to deal 15705 * in the Software without restriction, including without limitation the rights 15706 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15707 * copies of the Software, and to permit persons to whom the Software is 15708 * furnished to do so, subject to the following conditions: 15709 * 15710 * The above copyright notice and this permission notice shall be included in all 15711 * copies or substantial portions of the Software. 15712 * 15713 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15714 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15715 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15716 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15717 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 15718 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 15719 * SOFTWARE. 15720 */ 15721var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'; 15722 15723var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 15724var timeoutDuration = 0; 15725for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 15726 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 15727 timeoutDuration = 1; 15728 break; 15729 } 15730} 15731 15732function microtaskDebounce(fn) { 15733 var called = false; 15734 return function () { 15735 if (called) { 15736 return; 15737 } 15738 called = true; 15739 window.Promise.resolve().then(function () { 15740 called = false; 15741 fn(); 15742 }); 15743 }; 15744} 15745 15746function taskDebounce(fn) { 15747 var scheduled = false; 15748 return function () { 15749 if (!scheduled) { 15750 scheduled = true; 15751 setTimeout(function () { 15752 scheduled = false; 15753 fn(); 15754 }, timeoutDuration); 15755 } 15756 }; 15757} 15758 15759var supportsMicroTasks = isBrowser && window.Promise; 15760 15761/** 15762* Create a debounced version of a method, that's asynchronously deferred 15763* but called in the minimum time possible. 15764* 15765* @method 15766* @memberof Popper.Utils 15767* @argument {Function} fn 15768* @returns {Function} 15769*/ 15770var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 15771 15772/** 15773 * Check if the given variable is a function 15774 * @method 15775 * @memberof Popper.Utils 15776 * @argument {Any} functionToCheck - variable to check 15777 * @returns {Boolean} answer to: is a function? 15778 */ 15779function isFunction(functionToCheck) { 15780 var getType = {}; 15781 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 15782} 15783 15784/** 15785 * Get CSS computed property of the given element 15786 * @method 15787 * @memberof Popper.Utils 15788 * @argument {Eement} element 15789 * @argument {String} property 15790 */ 15791function getStyleComputedProperty(element, property) { 15792 if (element.nodeType !== 1) { 15793 return []; 15794 } 15795 // NOTE: 1 DOM access here 15796 var window = element.ownerDocument.defaultView; 15797 var css = window.getComputedStyle(element, null); 15798 return property ? css[property] : css; 15799} 15800 15801/** 15802 * Returns the parentNode or the host of the element 15803 * @method 15804 * @memberof Popper.Utils 15805 * @argument {Element} element 15806 * @returns {Element} parent 15807 */ 15808function getParentNode(element) { 15809 if (element.nodeName === 'HTML') { 15810 return element; 15811 } 15812 return element.parentNode || element.host; 15813} 15814 15815/** 15816 * Returns the scrolling parent of the given element 15817 * @method 15818 * @memberof Popper.Utils 15819 * @argument {Element} element 15820 * @returns {Element} scroll parent 15821 */ 15822function getScrollParent(element) { 15823 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 15824 if (!element) { 15825 return document.body; 15826 } 15827 15828 switch (element.nodeName) { 15829 case 'HTML': 15830 case 'BODY': 15831 return element.ownerDocument.body; 15832 case '#document': 15833 return element.body; 15834 } 15835 15836 // Firefox want us to check `-x` and `-y` variations as well 15837 15838 var _getStyleComputedProp = getStyleComputedProperty(element), 15839 overflow = _getStyleComputedProp.overflow, 15840 overflowX = _getStyleComputedProp.overflowX, 15841 overflowY = _getStyleComputedProp.overflowY; 15842 15843 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 15844 return element; 15845 } 15846 15847 return getScrollParent(getParentNode(element)); 15848} 15849 15850var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 15851var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 15852 15853/** 15854 * Determines if the browser is Internet Explorer 15855 * @method 15856 * @memberof Popper.Utils 15857 * @param {Number} version to check 15858 * @returns {Boolean} isIE 15859 */ 15860function isIE(version) { 15861 if (version === 11) { 15862 return isIE11; 15863 } 15864 if (version === 10) { 15865 return isIE10; 15866 } 15867 return isIE11 || isIE10; 15868} 15869 15870/** 15871 * Returns the offset parent of the given element 15872 * @method 15873 * @memberof Popper.Utils 15874 * @argument {Element} element 15875 * @returns {Element} offset parent 15876 */ 15877function getOffsetParent(element) { 15878 if (!element) { 15879 return document.documentElement; 15880 } 15881 15882 var noOffsetParent = isIE(10) ? document.body : null; 15883 15884 // NOTE: 1 DOM access here 15885 var offsetParent = element.offsetParent || null; 15886 // Skip hidden elements which don't have an offsetParent 15887 while (offsetParent === noOffsetParent && element.nextElementSibling) { 15888 offsetParent = (element = element.nextElementSibling).offsetParent; 15889 } 15890 15891 var nodeName = offsetParent && offsetParent.nodeName; 15892 15893 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 15894 return element ? element.ownerDocument.documentElement : document.documentElement; 15895 } 15896 15897 // .offsetParent will return the closest TH, TD or TABLE in case 15898 // no offsetParent is present, I hate this job... 15899 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 15900 return getOffsetParent(offsetParent); 15901 } 15902 15903 return offsetParent; 15904} 15905 15906function isOffsetContainer(element) { 15907 var nodeName = element.nodeName; 15908 15909 if (nodeName === 'BODY') { 15910 return false; 15911 } 15912 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 15913} 15914 15915/** 15916 * Finds the root node (document, shadowDOM root) of the given element 15917 * @method 15918 * @memberof Popper.Utils 15919 * @argument {Element} node 15920 * @returns {Element} root node 15921 */ 15922function getRoot(node) { 15923 if (node.parentNode !== null) { 15924 return getRoot(node.parentNode); 15925 } 15926 15927 return node; 15928} 15929 15930/** 15931 * Finds the offset parent common to the two provided nodes 15932 * @method 15933 * @memberof Popper.Utils 15934 * @argument {Element} element1 15935 * @argument {Element} element2 15936 * @returns {Element} common offset parent 15937 */ 15938function findCommonOffsetParent(element1, element2) { 15939 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 15940 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 15941 return document.documentElement; 15942 } 15943 15944 // Here we make sure to give as "start" the element that comes first in the DOM 15945 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 15946 var start = order ? element1 : element2; 15947 var end = order ? element2 : element1; 15948 15949 // Get common ancestor container 15950 var range = document.createRange(); 15951 range.setStart(start, 0); 15952 range.setEnd(end, 0); 15953 var commonAncestorContainer = range.commonAncestorContainer; 15954 15955 // Both nodes are inside #document 15956 15957 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 15958 if (isOffsetContainer(commonAncestorContainer)) { 15959 return commonAncestorContainer; 15960 } 15961 15962 return getOffsetParent(commonAncestorContainer); 15963 } 15964 15965 // one of the nodes is inside shadowDOM, find which one 15966 var element1root = getRoot(element1); 15967 if (element1root.host) { 15968 return findCommonOffsetParent(element1root.host, element2); 15969 } else { 15970 return findCommonOffsetParent(element1, getRoot(element2).host); 15971 } 15972} 15973 15974/** 15975 * Gets the scroll value of the given element in the given side (top and left) 15976 * @method 15977 * @memberof Popper.Utils 15978 * @argument {Element} element 15979 * @argument {String} side `top` or `left` 15980 * @returns {number} amount of scrolled pixels 15981 */ 15982function getScroll(element) { 15983 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 15984 15985 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 15986 var nodeName = element.nodeName; 15987 15988 if (nodeName === 'BODY' || nodeName === 'HTML') { 15989 var html = element.ownerDocument.documentElement; 15990 var scrollingElement = element.ownerDocument.scrollingElement || html; 15991 return scrollingElement[upperSide]; 15992 } 15993 15994 return element[upperSide]; 15995} 15996 15997/* 15998 * Sum or subtract the element scroll values (left and top) from a given rect object 15999 * @method 16000 * @memberof Popper.Utils 16001 * @param {Object} rect - Rect object you want to change 16002 * @param {HTMLElement} element - The element from the function reads the scroll values 16003 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 16004 * @return {Object} rect - The modifier rect object 16005 */ 16006function includeScroll(rect, element) { 16007 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 16008 16009 var scrollTop = getScroll(element, 'top'); 16010 var scrollLeft = getScroll(element, 'left'); 16011 var modifier = subtract ? -1 : 1; 16012 rect.top += scrollTop * modifier; 16013 rect.bottom += scrollTop * modifier; 16014 rect.left += scrollLeft * modifier; 16015 rect.right += scrollLeft * modifier; 16016 return rect; 16017} 16018 16019/* 16020 * Helper to detect borders of a given element 16021 * @method 16022 * @memberof Popper.Utils 16023 * @param {CSSStyleDeclaration} styles 16024 * Result of `getStyleComputedProperty` on the given element 16025 * @param {String} axis - `x` or `y` 16026 * @return {number} borders - The borders size of the given axis 16027 */ 16028 16029function getBordersSize(styles, axis) { 16030 var sideA = axis === 'x' ? 'Left' : 'Top'; 16031 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 16032 16033 return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10); 16034} 16035 16036function getSize(axis, body, html, computedStyle) { 16037 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); 16038} 16039 16040function getWindowSizes(document) { 16041 var body = document.body; 16042 var html = document.documentElement; 16043 var computedStyle = isIE(10) && getComputedStyle(html); 16044 16045 return { 16046 height: getSize('Height', body, html, computedStyle), 16047 width: getSize('Width', body, html, computedStyle) 16048 }; 16049} 16050 16051var classCallCheck = function (instance, Constructor) { 16052 if (!(instance instanceof Constructor)) { 16053 throw new TypeError("Cannot call a class as a function"); 16054 } 16055}; 16056 16057var createClass = function () { 16058 function defineProperties(target, props) { 16059 for (var i = 0; i < props.length; i++) { 16060 var descriptor = props[i]; 16061 descriptor.enumerable = descriptor.enumerable || false; 16062 descriptor.configurable = true; 16063 if ("value" in descriptor) descriptor.writable = true; 16064 Object.defineProperty(target, descriptor.key, descriptor); 16065 } 16066 } 16067 16068 return function (Constructor, protoProps, staticProps) { 16069 if (protoProps) defineProperties(Constructor.prototype, protoProps); 16070 if (staticProps) defineProperties(Constructor, staticProps); 16071 return Constructor; 16072 }; 16073}(); 16074 16075 16076 16077 16078 16079var defineProperty = function (obj, key, value) { 16080 if (key in obj) { 16081 Object.defineProperty(obj, key, { 16082 value: value, 16083 enumerable: true, 16084 configurable: true, 16085 writable: true 16086 }); 16087 } else { 16088 obj[key] = value; 16089 } 16090 16091 return obj; 16092}; 16093 16094var _extends = Object.assign || function (target) { 16095 for (var i = 1; i < arguments.length; i++) { 16096 var source = arguments[i]; 16097 16098 for (var key in source) { 16099 if (Object.prototype.hasOwnProperty.call(source, key)) { 16100 target[key] = source[key]; 16101 } 16102 } 16103 } 16104 16105 return target; 16106}; 16107 16108/** 16109 * Given element offsets, generate an output similar to getBoundingClientRect 16110 * @method 16111 * @memberof Popper.Utils 16112 * @argument {Object} offsets 16113 * @returns {Object} ClientRect like output 16114 */ 16115function getClientRect(offsets) { 16116 return _extends({}, offsets, { 16117 right: offsets.left + offsets.width, 16118 bottom: offsets.top + offsets.height 16119 }); 16120} 16121 16122/** 16123 * Get bounding client rect of given element 16124 * @method 16125 * @memberof Popper.Utils 16126 * @param {HTMLElement} element 16127 * @return {Object} client rect 16128 */ 16129function getBoundingClientRect(element) { 16130 var rect = {}; 16131 16132 // IE10 10 FIX: Please, don't ask, the element isn't 16133 // considered in DOM in some circumstances... 16134 // This isn't reproducible in IE10 compatibility mode of IE11 16135 try { 16136 if (isIE(10)) { 16137 rect = element.getBoundingClientRect(); 16138 var scrollTop = getScroll(element, 'top'); 16139 var scrollLeft = getScroll(element, 'left'); 16140 rect.top += scrollTop; 16141 rect.left += scrollLeft; 16142 rect.bottom += scrollTop; 16143 rect.right += scrollLeft; 16144 } else { 16145 rect = element.getBoundingClientRect(); 16146 } 16147 } catch (e) {} 16148 16149 var result = { 16150 left: rect.left, 16151 top: rect.top, 16152 width: rect.right - rect.left, 16153 height: rect.bottom - rect.top 16154 }; 16155 16156 // subtract scrollbar size from sizes 16157 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 16158 var width = sizes.width || element.clientWidth || result.right - result.left; 16159 var height = sizes.height || element.clientHeight || result.bottom - result.top; 16160 16161 var horizScrollbar = element.offsetWidth - width; 16162 var vertScrollbar = element.offsetHeight - height; 16163 16164 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 16165 // we make this check conditional for performance reasons 16166 if (horizScrollbar || vertScrollbar) { 16167 var styles = getStyleComputedProperty(element); 16168 horizScrollbar -= getBordersSize(styles, 'x'); 16169 vertScrollbar -= getBordersSize(styles, 'y'); 16170 16171 result.width -= horizScrollbar; 16172 result.height -= vertScrollbar; 16173 } 16174 16175 return getClientRect(result); 16176} 16177 16178function getOffsetRectRelativeToArbitraryNode(children, parent) { 16179 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 16180 16181 var isIE10 = isIE(10); 16182 var isHTML = parent.nodeName === 'HTML'; 16183 var childrenRect = getBoundingClientRect(children); 16184 var parentRect = getBoundingClientRect(parent); 16185 var scrollParent = getScrollParent(children); 16186 16187 var styles = getStyleComputedProperty(parent); 16188 var borderTopWidth = parseFloat(styles.borderTopWidth, 10); 16189 var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); 16190 16191 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 16192 if (fixedPosition && isHTML) { 16193 parentRect.top = Math.max(parentRect.top, 0); 16194 parentRect.left = Math.max(parentRect.left, 0); 16195 } 16196 var offsets = getClientRect({ 16197 top: childrenRect.top - parentRect.top - borderTopWidth, 16198 left: childrenRect.left - parentRect.left - borderLeftWidth, 16199 width: childrenRect.width, 16200 height: childrenRect.height 16201 }); 16202 offsets.marginTop = 0; 16203 offsets.marginLeft = 0; 16204 16205 // Subtract margins of documentElement in case it's being used as parent 16206 // we do this only on HTML because it's the only element that behaves 16207 // differently when margins are applied to it. The margins are included in 16208 // the box of the documentElement, in the other cases not. 16209 if (!isIE10 && isHTML) { 16210 var marginTop = parseFloat(styles.marginTop, 10); 16211 var marginLeft = parseFloat(styles.marginLeft, 10); 16212 16213 offsets.top -= borderTopWidth - marginTop; 16214 offsets.bottom -= borderTopWidth - marginTop; 16215 offsets.left -= borderLeftWidth - marginLeft; 16216 offsets.right -= borderLeftWidth - marginLeft; 16217 16218 // Attach marginTop and marginLeft because in some circumstances we may need them 16219 offsets.marginTop = marginTop; 16220 offsets.marginLeft = marginLeft; 16221 } 16222 16223 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 16224 offsets = includeScroll(offsets, parent); 16225 } 16226 16227 return offsets; 16228} 16229 16230function getViewportOffsetRectRelativeToArtbitraryNode(element) { 16231 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 16232 16233 var html = element.ownerDocument.documentElement; 16234 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 16235 var width = Math.max(html.clientWidth, window.innerWidth || 0); 16236 var height = Math.max(html.clientHeight, window.innerHeight || 0); 16237 16238 var scrollTop = !excludeScroll ? getScroll(html) : 0; 16239 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 16240 16241 var offset = { 16242 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 16243 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 16244 width: width, 16245 height: height 16246 }; 16247 16248 return getClientRect(offset); 16249} 16250 16251/** 16252 * Check if the given element is fixed or is inside a fixed parent 16253 * @method 16254 * @memberof Popper.Utils 16255 * @argument {Element} element 16256 * @argument {Element} customContainer 16257 * @returns {Boolean} answer to "isFixed?" 16258 */ 16259function isFixed(element) { 16260 var nodeName = element.nodeName; 16261 if (nodeName === 'BODY' || nodeName === 'HTML') { 16262 return false; 16263 } 16264 if (getStyleComputedProperty(element, 'position') === 'fixed') { 16265 return true; 16266 } 16267 var parentNode = getParentNode(element); 16268 if (!parentNode) { 16269 return false; 16270 } 16271 return isFixed(parentNode); 16272} 16273 16274/** 16275 * Finds the first parent of an element that has a transformed property defined 16276 * @method 16277 * @memberof Popper.Utils 16278 * @argument {Element} element 16279 * @returns {Element} first transformed parent or documentElement 16280 */ 16281 16282function getFixedPositionOffsetParent(element) { 16283 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 16284 if (!element || !element.parentElement || isIE()) { 16285 return document.documentElement; 16286 } 16287 var el = element.parentElement; 16288 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 16289 el = el.parentElement; 16290 } 16291 return el || document.documentElement; 16292} 16293 16294/** 16295 * Computed the boundaries limits and return them 16296 * @method 16297 * @memberof Popper.Utils 16298 * @param {HTMLElement} popper 16299 * @param {HTMLElement} reference 16300 * @param {number} padding 16301 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 16302 * @param {Boolean} fixedPosition - Is in fixed position mode 16303 * @returns {Object} Coordinates of the boundaries 16304 */ 16305function getBoundaries(popper, reference, padding, boundariesElement) { 16306 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 16307 16308 // NOTE: 1 DOM access here 16309 16310 var boundaries = { top: 0, left: 0 }; 16311 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); 16312 16313 // Handle viewport case 16314 if (boundariesElement === 'viewport') { 16315 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 16316 } else { 16317 // Handle other cases based on DOM element used as boundaries 16318 var boundariesNode = void 0; 16319 if (boundariesElement === 'scrollParent') { 16320 boundariesNode = getScrollParent(getParentNode(reference)); 16321 if (boundariesNode.nodeName === 'BODY') { 16322 boundariesNode = popper.ownerDocument.documentElement; 16323 } 16324 } else if (boundariesElement === 'window') { 16325 boundariesNode = popper.ownerDocument.documentElement; 16326 } else { 16327 boundariesNode = boundariesElement; 16328 } 16329 16330 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 16331 16332 // In case of HTML, we need a different computation 16333 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 16334 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 16335 height = _getWindowSizes.height, 16336 width = _getWindowSizes.width; 16337 16338 boundaries.top += offsets.top - offsets.marginTop; 16339 boundaries.bottom = height + offsets.top; 16340 boundaries.left += offsets.left - offsets.marginLeft; 16341 boundaries.right = width + offsets.left; 16342 } else { 16343 // for all the other DOM elements, this one is good 16344 boundaries = offsets; 16345 } 16346 } 16347 16348 // Add paddings 16349 padding = padding || 0; 16350 var isPaddingNumber = typeof padding === 'number'; 16351 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 16352 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 16353 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 16354 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 16355 16356 return boundaries; 16357} 16358 16359function getArea(_ref) { 16360 var width = _ref.width, 16361 height = _ref.height; 16362 16363 return width * height; 16364} 16365 16366/** 16367 * Utility used to transform the `auto` placement to the placement with more 16368 * available space. 16369 * @method 16370 * @memberof Popper.Utils 16371 * @argument {Object} data - The data object generated by update method 16372 * @argument {Object} options - Modifiers configuration and options 16373 * @returns {Object} The data object, properly modified 16374 */ 16375function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 16376 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 16377 16378 if (placement.indexOf('auto') === -1) { 16379 return placement; 16380 } 16381 16382 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 16383 16384 var rects = { 16385 top: { 16386 width: boundaries.width, 16387 height: refRect.top - boundaries.top 16388 }, 16389 right: { 16390 width: boundaries.right - refRect.right, 16391 height: boundaries.height 16392 }, 16393 bottom: { 16394 width: boundaries.width, 16395 height: boundaries.bottom - refRect.bottom 16396 }, 16397 left: { 16398 width: refRect.left - boundaries.left, 16399 height: boundaries.height 16400 } 16401 }; 16402 16403 var sortedAreas = Object.keys(rects).map(function (key) { 16404 return _extends({ 16405 key: key 16406 }, rects[key], { 16407 area: getArea(rects[key]) 16408 }); 16409 }).sort(function (a, b) { 16410 return b.area - a.area; 16411 }); 16412 16413 var filteredAreas = sortedAreas.filter(function (_ref2) { 16414 var width = _ref2.width, 16415 height = _ref2.height; 16416 return width >= popper.clientWidth && height >= popper.clientHeight; 16417 }); 16418 16419 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 16420 16421 var variation = placement.split('-')[1]; 16422 16423 return computedPlacement + (variation ? '-' + variation : ''); 16424} 16425 16426/** 16427 * Get offsets to the reference element 16428 * @method 16429 * @memberof Popper.Utils 16430 * @param {Object} state 16431 * @param {Element} popper - the popper element 16432 * @param {Element} reference - the reference element (the popper will be relative to this) 16433 * @param {Element} fixedPosition - is in fixed position mode 16434 * @returns {Object} An object containing the offsets which will be applied to the popper 16435 */ 16436function getReferenceOffsets(state, popper, reference) { 16437 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 16438 16439 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); 16440 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 16441} 16442 16443/** 16444 * Get the outer sizes of the given element (offset size + margins) 16445 * @method 16446 * @memberof Popper.Utils 16447 * @argument {Element} element 16448 * @returns {Object} object containing width and height properties 16449 */ 16450function getOuterSizes(element) { 16451 var window = element.ownerDocument.defaultView; 16452 var styles = window.getComputedStyle(element); 16453 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 16454 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 16455 var result = { 16456 width: element.offsetWidth + y, 16457 height: element.offsetHeight + x 16458 }; 16459 return result; 16460} 16461 16462/** 16463 * Get the opposite placement of the given one 16464 * @method 16465 * @memberof Popper.Utils 16466 * @argument {String} placement 16467 * @returns {String} flipped placement 16468 */ 16469function getOppositePlacement(placement) { 16470 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 16471 return placement.replace(/left|right|bottom|top/g, function (matched) { 16472 return hash[matched]; 16473 }); 16474} 16475 16476/** 16477 * Get offsets to the popper 16478 * @method 16479 * @memberof Popper.Utils 16480 * @param {Object} position - CSS position the Popper will get applied 16481 * @param {HTMLElement} popper - the popper element 16482 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 16483 * @param {String} placement - one of the valid placement options 16484 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 16485 */ 16486function getPopperOffsets(popper, referenceOffsets, placement) { 16487 placement = placement.split('-')[0]; 16488 16489 // Get popper node sizes 16490 var popperRect = getOuterSizes(popper); 16491 16492 // Add position, width and height to our offsets object 16493 var popperOffsets = { 16494 width: popperRect.width, 16495 height: popperRect.height 16496 }; 16497 16498 // depending by the popper placement we have to compute its offsets slightly differently 16499 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 16500 var mainSide = isHoriz ? 'top' : 'left'; 16501 var secondarySide = isHoriz ? 'left' : 'top'; 16502 var measurement = isHoriz ? 'height' : 'width'; 16503 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 16504 16505 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 16506 if (placement === secondarySide) { 16507 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 16508 } else { 16509 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 16510 } 16511 16512 return popperOffsets; 16513} 16514 16515/** 16516 * Mimics the `find` method of Array 16517 * @method 16518 * @memberof Popper.Utils 16519 * @argument {Array} arr 16520 * @argument prop 16521 * @argument value 16522 * @returns index or -1 16523 */ 16524function find(arr, check) { 16525 // use native find if supported 16526 if (Array.prototype.find) { 16527 return arr.find(check); 16528 } 16529 16530 // use `filter` to obtain the same behavior of `find` 16531 return arr.filter(check)[0]; 16532} 16533 16534/** 16535 * Return the index of the matching object 16536 * @method 16537 * @memberof Popper.Utils 16538 * @argument {Array} arr 16539 * @argument prop 16540 * @argument value 16541 * @returns index or -1 16542 */ 16543function findIndex(arr, prop, value) { 16544 // use native findIndex if supported 16545 if (Array.prototype.findIndex) { 16546 return arr.findIndex(function (cur) { 16547 return cur[prop] === value; 16548 }); 16549 } 16550 16551 // use `find` + `indexOf` if `findIndex` isn't supported 16552 var match = find(arr, function (obj) { 16553 return obj[prop] === value; 16554 }); 16555 return arr.indexOf(match); 16556} 16557 16558/** 16559 * Loop trough the list of modifiers and run them in order, 16560 * each of them will then edit the data object. 16561 * @method 16562 * @memberof Popper.Utils 16563 * @param {dataObject} data 16564 * @param {Array} modifiers 16565 * @param {String} ends - Optional modifier name used as stopper 16566 * @returns {dataObject} 16567 */ 16568function runModifiers(modifiers, data, ends) { 16569 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 16570 16571 modifiersToRun.forEach(function (modifier) { 16572 if (modifier['function']) { 16573 // eslint-disable-line dot-notation 16574 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 16575 } 16576 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 16577 if (modifier.enabled && isFunction(fn)) { 16578 // Add properties to offsets to make them a complete clientRect object 16579 // we do this before each modifier to make sure the previous one doesn't 16580 // mess with these values 16581 data.offsets.popper = getClientRect(data.offsets.popper); 16582 data.offsets.reference = getClientRect(data.offsets.reference); 16583 16584 data = fn(data, modifier); 16585 } 16586 }); 16587 16588 return data; 16589} 16590 16591/** 16592 * Updates the position of the popper, computing the new offsets and applying 16593 * the new style.<br /> 16594 * Prefer `scheduleUpdate` over `update` because of performance reasons. 16595 * @method 16596 * @memberof Popper 16597 */ 16598function update() { 16599 // if popper is destroyed, don't perform any further update 16600 if (this.state.isDestroyed) { 16601 return; 16602 } 16603 16604 var data = { 16605 instance: this, 16606 styles: {}, 16607 arrowStyles: {}, 16608 attributes: {}, 16609 flipped: false, 16610 offsets: {} 16611 }; 16612 16613 // compute reference element offsets 16614 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 16615 16616 // compute auto placement, store placement inside the data object, 16617 // modifiers will be able to edit `placement` if needed 16618 // and refer to originalPlacement to know the original value 16619 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 16620 16621 // store the computed placement inside `originalPlacement` 16622 data.originalPlacement = data.placement; 16623 16624 data.positionFixed = this.options.positionFixed; 16625 16626 // compute the popper offsets 16627 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 16628 16629 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 16630 16631 // run the modifiers 16632 data = runModifiers(this.modifiers, data); 16633 16634 // the first `update` will call `onCreate` callback 16635 // the other ones will call `onUpdate` callback 16636 if (!this.state.isCreated) { 16637 this.state.isCreated = true; 16638 this.options.onCreate(data); 16639 } else { 16640 this.options.onUpdate(data); 16641 } 16642} 16643 16644/** 16645 * Helper used to know if the given modifier is enabled. 16646 * @method 16647 * @memberof Popper.Utils 16648 * @returns {Boolean} 16649 */ 16650function isModifierEnabled(modifiers, modifierName) { 16651 return modifiers.some(function (_ref) { 16652 var name = _ref.name, 16653 enabled = _ref.enabled; 16654 return enabled && name === modifierName; 16655 }); 16656} 16657 16658/** 16659 * Get the prefixed supported property name 16660 * @method 16661 * @memberof Popper.Utils 16662 * @argument {String} property (camelCase) 16663 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 16664 */ 16665function getSupportedPropertyName(property) { 16666 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 16667 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 16668 16669 for (var i = 0; i < prefixes.length; i++) { 16670 var prefix = prefixes[i]; 16671 var toCheck = prefix ? '' + prefix + upperProp : property; 16672 if (typeof document.body.style[toCheck] !== 'undefined') { 16673 return toCheck; 16674 } 16675 } 16676 return null; 16677} 16678 16679/** 16680 * Destroys the popper. 16681 * @method 16682 * @memberof Popper 16683 */ 16684function destroy() { 16685 this.state.isDestroyed = true; 16686 16687 // touch DOM only if `applyStyle` modifier is enabled 16688 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 16689 this.popper.removeAttribute('x-placement'); 16690 this.popper.style.position = ''; 16691 this.popper.style.top = ''; 16692 this.popper.style.left = ''; 16693 this.popper.style.right = ''; 16694 this.popper.style.bottom = ''; 16695 this.popper.style.willChange = ''; 16696 this.popper.style[getSupportedPropertyName('transform')] = ''; 16697 } 16698 16699 this.disableEventListeners(); 16700 16701 // remove the popper if user explicity asked for the deletion on destroy 16702 // do not use `remove` because IE11 doesn't support it 16703 if (this.options.removeOnDestroy) { 16704 this.popper.parentNode.removeChild(this.popper); 16705 } 16706 return this; 16707} 16708 16709/** 16710 * Get the window associated with the element 16711 * @argument {Element} element 16712 * @returns {Window} 16713 */ 16714function getWindow(element) { 16715 var ownerDocument = element.ownerDocument; 16716 return ownerDocument ? ownerDocument.defaultView : window; 16717} 16718 16719function attachToScrollParents(scrollParent, event, callback, scrollParents) { 16720 var isBody = scrollParent.nodeName === 'BODY'; 16721 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 16722 target.addEventListener(event, callback, { passive: true }); 16723 16724 if (!isBody) { 16725 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 16726 } 16727 scrollParents.push(target); 16728} 16729 16730/** 16731 * Setup needed event listeners used to update the popper position 16732 * @method 16733 * @memberof Popper.Utils 16734 * @private 16735 */ 16736function setupEventListeners(reference, options, state, updateBound) { 16737 // Resize event listener on window 16738 state.updateBound = updateBound; 16739 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 16740 16741 // Scroll event listener on scroll parents 16742 var scrollElement = getScrollParent(reference); 16743 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 16744 state.scrollElement = scrollElement; 16745 state.eventsEnabled = true; 16746 16747 return state; 16748} 16749 16750/** 16751 * It will add resize/scroll events and start recalculating 16752 * position of the popper element when they are triggered. 16753 * @method 16754 * @memberof Popper 16755 */ 16756function enableEventListeners() { 16757 if (!this.state.eventsEnabled) { 16758 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 16759 } 16760} 16761 16762/** 16763 * Remove event listeners used to update the popper position 16764 * @method 16765 * @memberof Popper.Utils 16766 * @private 16767 */ 16768function removeEventListeners(reference, state) { 16769 // Remove resize event listener on window 16770 getWindow(reference).removeEventListener('resize', state.updateBound); 16771 16772 // Remove scroll event listener on scroll parents 16773 state.scrollParents.forEach(function (target) { 16774 target.removeEventListener('scroll', state.updateBound); 16775 }); 16776 16777 // Reset state 16778 state.updateBound = null; 16779 state.scrollParents = []; 16780 state.scrollElement = null; 16781 state.eventsEnabled = false; 16782 return state; 16783} 16784 16785/** 16786 * It will remove resize/scroll events and won't recalculate popper position 16787 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 16788 * unless you call `update` method manually. 16789 * @method 16790 * @memberof Popper 16791 */ 16792function disableEventListeners() { 16793 if (this.state.eventsEnabled) { 16794 cancelAnimationFrame(this.scheduleUpdate); 16795 this.state = removeEventListeners(this.reference, this.state); 16796 } 16797} 16798 16799/** 16800 * Tells if a given input is a number 16801 * @method 16802 * @memberof Popper.Utils 16803 * @param {*} input to check 16804 * @return {Boolean} 16805 */ 16806function isNumeric(n) { 16807 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 16808} 16809 16810/** 16811 * Set the style to the given popper 16812 * @method 16813 * @memberof Popper.Utils 16814 * @argument {Element} element - Element to apply the style to 16815 * @argument {Object} styles 16816 * Object with a list of properties and values which will be applied to the element 16817 */ 16818function setStyles(element, styles) { 16819 Object.keys(styles).forEach(function (prop) { 16820 var unit = ''; 16821 // add unit if the value is numeric and is one of the following 16822 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 16823 unit = 'px'; 16824 } 16825 element.style[prop] = styles[prop] + unit; 16826 }); 16827} 16828 16829/** 16830 * Set the attributes to the given popper 16831 * @method 16832 * @memberof Popper.Utils 16833 * @argument {Element} element - Element to apply the attributes to 16834 * @argument {Object} styles 16835 * Object with a list of properties and values which will be applied to the element 16836 */ 16837function setAttributes(element, attributes) { 16838 Object.keys(attributes).forEach(function (prop) { 16839 var value = attributes[prop]; 16840 if (value !== false) { 16841 element.setAttribute(prop, attributes[prop]); 16842 } else { 16843 element.removeAttribute(prop); 16844 } 16845 }); 16846} 16847 16848/** 16849 * @function 16850 * @memberof Modifiers 16851 * @argument {Object} data - The data object generated by `update` method 16852 * @argument {Object} data.styles - List of style properties - values to apply to popper element 16853 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 16854 * @argument {Object} options - Modifiers configuration and options 16855 * @returns {Object} The same data object 16856 */ 16857function applyStyle(data) { 16858 // any property present in `data.styles` will be applied to the popper, 16859 // in this way we can make the 3rd party modifiers add custom styles to it 16860 // Be aware, modifiers could override the properties defined in the previous 16861 // lines of this modifier! 16862 setStyles(data.instance.popper, data.styles); 16863 16864 // any property present in `data.attributes` will be applied to the popper, 16865 // they will be set as HTML attributes of the element 16866 setAttributes(data.instance.popper, data.attributes); 16867 16868 // if arrowElement is defined and arrowStyles has some properties 16869 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 16870 setStyles(data.arrowElement, data.arrowStyles); 16871 } 16872 16873 return data; 16874} 16875 16876/** 16877 * Set the x-placement attribute before everything else because it could be used 16878 * to add margins to the popper margins needs to be calculated to get the 16879 * correct popper offsets. 16880 * @method 16881 * @memberof Popper.modifiers 16882 * @param {HTMLElement} reference - The reference element used to position the popper 16883 * @param {HTMLElement} popper - The HTML element used as popper 16884 * @param {Object} options - Popper.js options 16885 */ 16886function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 16887 // compute reference element offsets 16888 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 16889 16890 // compute auto placement, store placement inside the data object, 16891 // modifiers will be able to edit `placement` if needed 16892 // and refer to originalPlacement to know the original value 16893 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 16894 16895 popper.setAttribute('x-placement', placement); 16896 16897 // Apply `position` to popper before anything else because 16898 // without the position applied we can't guarantee correct computations 16899 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 16900 16901 return options; 16902} 16903 16904/** 16905 * @function 16906 * @memberof Popper.Utils 16907 * @argument {Object} data - The data object generated by `update` method 16908 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 16909 * @returns {Object} The popper's position offsets rounded 16910 * 16911 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 16912 * good as it can be within reason. 16913 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 16914 * 16915 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 16916 * as well on High DPI screens). 16917 * 16918 * Firefox prefers no rounding for positioning and does not have blurriness on 16919 * high DPI screens. 16920 * 16921 * Only horizontal placement and left/right values need to be considered. 16922 */ 16923function getRoundedOffsets(data, shouldRound) { 16924 var _data$offsets = data.offsets, 16925 popper = _data$offsets.popper, 16926 reference = _data$offsets.reference; 16927 var round = Math.round, 16928 floor = Math.floor; 16929 16930 var noRound = function noRound(v) { 16931 return v; 16932 }; 16933 16934 var referenceWidth = round(reference.width); 16935 var popperWidth = round(popper.width); 16936 16937 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 16938 var isVariation = data.placement.indexOf('-') !== -1; 16939 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 16940 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 16941 16942 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 16943 var verticalToInteger = !shouldRound ? noRound : round; 16944 16945 return { 16946 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 16947 top: verticalToInteger(popper.top), 16948 bottom: verticalToInteger(popper.bottom), 16949 right: horizontalToInteger(popper.right) 16950 }; 16951} 16952 16953var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 16954 16955/** 16956 * @function 16957 * @memberof Modifiers 16958 * @argument {Object} data - The data object generated by `update` method 16959 * @argument {Object} options - Modifiers configuration and options 16960 * @returns {Object} The data object, properly modified 16961 */ 16962function computeStyle(data, options) { 16963 var x = options.x, 16964 y = options.y; 16965 var popper = data.offsets.popper; 16966 16967 // Remove this legacy support in Popper.js v2 16968 16969 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 16970 return modifier.name === 'applyStyle'; 16971 }).gpuAcceleration; 16972 if (legacyGpuAccelerationOption !== undefined) { 16973 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 16974 } 16975 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 16976 16977 var offsetParent = getOffsetParent(data.instance.popper); 16978 var offsetParentRect = getBoundingClientRect(offsetParent); 16979 16980 // Styles 16981 var styles = { 16982 position: popper.position 16983 }; 16984 16985 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 16986 16987 var sideA = x === 'bottom' ? 'top' : 'bottom'; 16988 var sideB = y === 'right' ? 'left' : 'right'; 16989 16990 // if gpuAcceleration is set to `true` and transform is supported, 16991 // we use `translate3d` to apply the position to the popper we 16992 // automatically use the supported prefixed version if needed 16993 var prefixedProperty = getSupportedPropertyName('transform'); 16994 16995 // now, let's make a step back and look at this code closely (wtf?) 16996 // If the content of the popper grows once it's been positioned, it 16997 // may happen that the popper gets misplaced because of the new content 16998 // overflowing its reference element 16999 // To avoid this problem, we provide two options (x and y), which allow 17000 // the consumer to define the offset origin. 17001 // If we position a popper on top of a reference element, we can set 17002 // `x` to `top` to make the popper grow towards its top instead of 17003 // its bottom. 17004 var left = void 0, 17005 top = void 0; 17006 if (sideA === 'bottom') { 17007 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 17008 // and not the bottom of the html element 17009 if (offsetParent.nodeName === 'HTML') { 17010 top = -offsetParent.clientHeight + offsets.bottom; 17011 } else { 17012 top = -offsetParentRect.height + offsets.bottom; 17013 } 17014 } else { 17015 top = offsets.top; 17016 } 17017 if (sideB === 'right') { 17018 if (offsetParent.nodeName === 'HTML') { 17019 left = -offsetParent.clientWidth + offsets.right; 17020 } else { 17021 left = -offsetParentRect.width + offsets.right; 17022 } 17023 } else { 17024 left = offsets.left; 17025 } 17026 if (gpuAcceleration && prefixedProperty) { 17027 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 17028 styles[sideA] = 0; 17029 styles[sideB] = 0; 17030 styles.willChange = 'transform'; 17031 } else { 17032 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 17033 var invertTop = sideA === 'bottom' ? -1 : 1; 17034 var invertLeft = sideB === 'right' ? -1 : 1; 17035 styles[sideA] = top * invertTop; 17036 styles[sideB] = left * invertLeft; 17037 styles.willChange = sideA + ', ' + sideB; 17038 } 17039 17040 // Attributes 17041 var attributes = { 17042 'x-placement': data.placement 17043 }; 17044 17045 // Update `data` attributes, styles and arrowStyles 17046 data.attributes = _extends({}, attributes, data.attributes); 17047 data.styles = _extends({}, styles, data.styles); 17048 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 17049 17050 return data; 17051} 17052 17053/** 17054 * Helper used to know if the given modifier depends from another one.<br /> 17055 * It checks if the needed modifier is listed and enabled. 17056 * @method 17057 * @memberof Popper.Utils 17058 * @param {Array} modifiers - list of modifiers 17059 * @param {String} requestingName - name of requesting modifier 17060 * @param {String} requestedName - name of requested modifier 17061 * @returns {Boolean} 17062 */ 17063function isModifierRequired(modifiers, requestingName, requestedName) { 17064 var requesting = find(modifiers, function (_ref) { 17065 var name = _ref.name; 17066 return name === requestingName; 17067 }); 17068 17069 var isRequired = !!requesting && modifiers.some(function (modifier) { 17070 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 17071 }); 17072 17073 if (!isRequired) { 17074 var _requesting = '`' + requestingName + '`'; 17075 var requested = '`' + requestedName + '`'; 17076 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 17077 } 17078 return isRequired; 17079} 17080 17081/** 17082 * @function 17083 * @memberof Modifiers 17084 * @argument {Object} data - The data object generated by update method 17085 * @argument {Object} options - Modifiers configuration and options 17086 * @returns {Object} The data object, properly modified 17087 */ 17088function arrow(data, options) { 17089 var _data$offsets$arrow; 17090 17091 // arrow depends on keepTogether in order to work 17092 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 17093 return data; 17094 } 17095 17096 var arrowElement = options.element; 17097 17098 // if arrowElement is a string, suppose it's a CSS selector 17099 if (typeof arrowElement === 'string') { 17100 arrowElement = data.instance.popper.querySelector(arrowElement); 17101 17102 // if arrowElement is not found, don't run the modifier 17103 if (!arrowElement) { 17104 return data; 17105 } 17106 } else { 17107 // if the arrowElement isn't a query selector we must check that the 17108 // provided DOM node is child of its popper node 17109 if (!data.instance.popper.contains(arrowElement)) { 17110 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 17111 return data; 17112 } 17113 } 17114 17115 var placement = data.placement.split('-')[0]; 17116 var _data$offsets = data.offsets, 17117 popper = _data$offsets.popper, 17118 reference = _data$offsets.reference; 17119 17120 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 17121 17122 var len = isVertical ? 'height' : 'width'; 17123 var sideCapitalized = isVertical ? 'Top' : 'Left'; 17124 var side = sideCapitalized.toLowerCase(); 17125 var altSide = isVertical ? 'left' : 'top'; 17126 var opSide = isVertical ? 'bottom' : 'right'; 17127 var arrowElementSize = getOuterSizes(arrowElement)[len]; 17128 17129 // 17130 // extends keepTogether behavior making sure the popper and its 17131 // reference have enough pixels in conjunction 17132 // 17133 17134 // top/left side 17135 if (reference[opSide] - arrowElementSize < popper[side]) { 17136 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 17137 } 17138 // bottom/right side 17139 if (reference[side] + arrowElementSize > popper[opSide]) { 17140 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 17141 } 17142 data.offsets.popper = getClientRect(data.offsets.popper); 17143 17144 // compute center of the popper 17145 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 17146 17147 // Compute the sideValue using the updated popper offsets 17148 // take popper margin in account because we don't have this info available 17149 var css = getStyleComputedProperty(data.instance.popper); 17150 var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10); 17151 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10); 17152 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 17153 17154 // prevent arrowElement from being placed not contiguously to its popper 17155 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 17156 17157 data.arrowElement = arrowElement; 17158 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 17159 17160 return data; 17161} 17162 17163/** 17164 * Get the opposite placement variation of the given one 17165 * @method 17166 * @memberof Popper.Utils 17167 * @argument {String} placement variation 17168 * @returns {String} flipped placement variation 17169 */ 17170function getOppositeVariation(variation) { 17171 if (variation === 'end') { 17172 return 'start'; 17173 } else if (variation === 'start') { 17174 return 'end'; 17175 } 17176 return variation; 17177} 17178 17179/** 17180 * List of accepted placements to use as values of the `placement` option.<br /> 17181 * Valid placements are: 17182 * - `auto` 17183 * - `top` 17184 * - `right` 17185 * - `bottom` 17186 * - `left` 17187 * 17188 * Each placement can have a variation from this list: 17189 * - `-start` 17190 * - `-end` 17191 * 17192 * Variations are interpreted easily if you think of them as the left to right 17193 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 17194 * is right.<br /> 17195 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 17196 * 17197 * Some valid examples are: 17198 * - `top-end` (on top of reference, right aligned) 17199 * - `right-start` (on right of reference, top aligned) 17200 * - `bottom` (on bottom, centered) 17201 * - `auto-end` (on the side with more space available, alignment depends by placement) 17202 * 17203 * @static 17204 * @type {Array} 17205 * @enum {String} 17206 * @readonly 17207 * @method placements 17208 * @memberof Popper 17209 */ 17210var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; 17211 17212// Get rid of `auto` `auto-start` and `auto-end` 17213var validPlacements = placements.slice(3); 17214 17215/** 17216 * Given an initial placement, returns all the subsequent placements 17217 * clockwise (or counter-clockwise). 17218 * 17219 * @method 17220 * @memberof Popper.Utils 17221 * @argument {String} placement - A valid placement (it accepts variations) 17222 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 17223 * @returns {Array} placements including their variations 17224 */ 17225function clockwise(placement) { 17226 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 17227 17228 var index = validPlacements.indexOf(placement); 17229 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 17230 return counter ? arr.reverse() : arr; 17231} 17232 17233var BEHAVIORS = { 17234 FLIP: 'flip', 17235 CLOCKWISE: 'clockwise', 17236 COUNTERCLOCKWISE: 'counterclockwise' 17237}; 17238 17239/** 17240 * @function 17241 * @memberof Modifiers 17242 * @argument {Object} data - The data object generated by update method 17243 * @argument {Object} options - Modifiers configuration and options 17244 * @returns {Object} The data object, properly modified 17245 */ 17246function flip(data, options) { 17247 // if `inner` modifier is enabled, we can't use the `flip` modifier 17248 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 17249 return data; 17250 } 17251 17252 if (data.flipped && data.placement === data.originalPlacement) { 17253 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 17254 return data; 17255 } 17256 17257 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 17258 17259 var placement = data.placement.split('-')[0]; 17260 var placementOpposite = getOppositePlacement(placement); 17261 var variation = data.placement.split('-')[1] || ''; 17262 17263 var flipOrder = []; 17264 17265 switch (options.behavior) { 17266 case BEHAVIORS.FLIP: 17267 flipOrder = [placement, placementOpposite]; 17268 break; 17269 case BEHAVIORS.CLOCKWISE: 17270 flipOrder = clockwise(placement); 17271 break; 17272 case BEHAVIORS.COUNTERCLOCKWISE: 17273 flipOrder = clockwise(placement, true); 17274 break; 17275 default: 17276 flipOrder = options.behavior; 17277 } 17278 17279 flipOrder.forEach(function (step, index) { 17280 if (placement !== step || flipOrder.length === index + 1) { 17281 return data; 17282 } 17283 17284 placement = data.placement.split('-')[0]; 17285 placementOpposite = getOppositePlacement(placement); 17286 17287 var popperOffsets = data.offsets.popper; 17288 var refOffsets = data.offsets.reference; 17289 17290 // using floor because the reference offsets may contain decimals we are not going to consider here 17291 var floor = Math.floor; 17292 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); 17293 17294 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 17295 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 17296 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 17297 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 17298 17299 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 17300 17301 // flip the variation if required 17302 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 17303 17304 // flips variation if reference element overflows boundaries 17305 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 17306 17307 // flips variation if popper content overflows boundaries 17308 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 17309 17310 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 17311 17312 if (overlapsRef || overflowsBoundaries || flippedVariation) { 17313 // this boolean to detect any flip loop 17314 data.flipped = true; 17315 17316 if (overlapsRef || overflowsBoundaries) { 17317 placement = flipOrder[index + 1]; 17318 } 17319 17320 if (flippedVariation) { 17321 variation = getOppositeVariation(variation); 17322 } 17323 17324 data.placement = placement + (variation ? '-' + variation : ''); 17325 17326 // this object contains `position`, we want to preserve it along with 17327 // any additional property we may add in the future 17328 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 17329 17330 data = runModifiers(data.instance.modifiers, data, 'flip'); 17331 } 17332 }); 17333 return data; 17334} 17335 17336/** 17337 * @function 17338 * @memberof Modifiers 17339 * @argument {Object} data - The data object generated by update method 17340 * @argument {Object} options - Modifiers configuration and options 17341 * @returns {Object} The data object, properly modified 17342 */ 17343function keepTogether(data) { 17344 var _data$offsets = data.offsets, 17345 popper = _data$offsets.popper, 17346 reference = _data$offsets.reference; 17347 17348 var placement = data.placement.split('-')[0]; 17349 var floor = Math.floor; 17350 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 17351 var side = isVertical ? 'right' : 'bottom'; 17352 var opSide = isVertical ? 'left' : 'top'; 17353 var measurement = isVertical ? 'width' : 'height'; 17354 17355 if (popper[side] < floor(reference[opSide])) { 17356 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 17357 } 17358 if (popper[opSide] > floor(reference[side])) { 17359 data.offsets.popper[opSide] = floor(reference[side]); 17360 } 17361 17362 return data; 17363} 17364 17365/** 17366 * Converts a string containing value + unit into a px value number 17367 * @function 17368 * @memberof {modifiers~offset} 17369 * @private 17370 * @argument {String} str - Value + unit string 17371 * @argument {String} measurement - `height` or `width` 17372 * @argument {Object} popperOffsets 17373 * @argument {Object} referenceOffsets 17374 * @returns {Number|String} 17375 * Value in pixels, or original string if no values were extracted 17376 */ 17377function toValue(str, measurement, popperOffsets, referenceOffsets) { 17378 // separate value from unit 17379 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 17380 var value = +split[1]; 17381 var unit = split[2]; 17382 17383 // If it's not a number it's an operator, I guess 17384 if (!value) { 17385 return str; 17386 } 17387 17388 if (unit.indexOf('%') === 0) { 17389 var element = void 0; 17390 switch (unit) { 17391 case '%p': 17392 element = popperOffsets; 17393 break; 17394 case '%': 17395 case '%r': 17396 default: 17397 element = referenceOffsets; 17398 } 17399 17400 var rect = getClientRect(element); 17401 return rect[measurement] / 100 * value; 17402 } else if (unit === 'vh' || unit === 'vw') { 17403 // if is a vh or vw, we calculate the size based on the viewport 17404 var size = void 0; 17405 if (unit === 'vh') { 17406 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 17407 } else { 17408 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 17409 } 17410 return size / 100 * value; 17411 } else { 17412 // if is an explicit pixel unit, we get rid of the unit and keep the value 17413 // if is an implicit unit, it's px, and we return just the value 17414 return value; 17415 } 17416} 17417 17418/** 17419 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 17420 * @function 17421 * @memberof {modifiers~offset} 17422 * @private 17423 * @argument {String} offset 17424 * @argument {Object} popperOffsets 17425 * @argument {Object} referenceOffsets 17426 * @argument {String} basePlacement 17427 * @returns {Array} a two cells array with x and y offsets in numbers 17428 */ 17429function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 17430 var offsets = [0, 0]; 17431 17432 // Use height if placement is left or right and index is 0 otherwise use width 17433 // in this way the first offset will use an axis and the second one 17434 // will use the other one 17435 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 17436 17437 // Split the offset string to obtain a list of values and operands 17438 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 17439 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 17440 return frag.trim(); 17441 }); 17442 17443 // Detect if the offset string contains a pair of values or a single one 17444 // they could be separated by comma or space 17445 var divider = fragments.indexOf(find(fragments, function (frag) { 17446 return frag.search(/,|\s/) !== -1; 17447 })); 17448 17449 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 17450 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 17451 } 17452 17453 // If divider is found, we divide the list of values and operands to divide 17454 // them by ofset X and Y. 17455 var splitRegex = /\s*,\s*|\s+/; 17456 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; 17457 17458 // Convert the values with units to absolute pixels to allow our computations 17459 ops = ops.map(function (op, index) { 17460 // Most of the units rely on the orientation of the popper 17461 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 17462 var mergeWithPrevious = false; 17463 return op 17464 // This aggregates any `+` or `-` sign that aren't considered operators 17465 // e.g.: 10 + +5 => [10, +, +5] 17466 .reduce(function (a, b) { 17467 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 17468 a[a.length - 1] = b; 17469 mergeWithPrevious = true; 17470 return a; 17471 } else if (mergeWithPrevious) { 17472 a[a.length - 1] += b; 17473 mergeWithPrevious = false; 17474 return a; 17475 } else { 17476 return a.concat(b); 17477 } 17478 }, []) 17479 // Here we convert the string values into number values (in px) 17480 .map(function (str) { 17481 return toValue(str, measurement, popperOffsets, referenceOffsets); 17482 }); 17483 }); 17484 17485 // Loop trough the offsets arrays and execute the operations 17486 ops.forEach(function (op, index) { 17487 op.forEach(function (frag, index2) { 17488 if (isNumeric(frag)) { 17489 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 17490 } 17491 }); 17492 }); 17493 return offsets; 17494} 17495 17496/** 17497 * @function 17498 * @memberof Modifiers 17499 * @argument {Object} data - The data object generated by update method 17500 * @argument {Object} options - Modifiers configuration and options 17501 * @argument {Number|String} options.offset=0 17502 * The offset value as described in the modifier description 17503 * @returns {Object} The data object, properly modified 17504 */ 17505function offset(data, _ref) { 17506 var offset = _ref.offset; 17507 var placement = data.placement, 17508 _data$offsets = data.offsets, 17509 popper = _data$offsets.popper, 17510 reference = _data$offsets.reference; 17511 17512 var basePlacement = placement.split('-')[0]; 17513 17514 var offsets = void 0; 17515 if (isNumeric(+offset)) { 17516 offsets = [+offset, 0]; 17517 } else { 17518 offsets = parseOffset(offset, popper, reference, basePlacement); 17519 } 17520 17521 if (basePlacement === 'left') { 17522 popper.top += offsets[0]; 17523 popper.left -= offsets[1]; 17524 } else if (basePlacement === 'right') { 17525 popper.top += offsets[0]; 17526 popper.left += offsets[1]; 17527 } else if (basePlacement === 'top') { 17528 popper.left += offsets[0]; 17529 popper.top -= offsets[1]; 17530 } else if (basePlacement === 'bottom') { 17531 popper.left += offsets[0]; 17532 popper.top += offsets[1]; 17533 } 17534 17535 data.popper = popper; 17536 return data; 17537} 17538 17539/** 17540 * @function 17541 * @memberof Modifiers 17542 * @argument {Object} data - The data object generated by `update` method 17543 * @argument {Object} options - Modifiers configuration and options 17544 * @returns {Object} The data object, properly modified 17545 */ 17546function preventOverflow(data, options) { 17547 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 17548 17549 // If offsetParent is the reference element, we really want to 17550 // go one step up and use the next offsetParent as reference to 17551 // avoid to make this modifier completely useless and look like broken 17552 if (data.instance.reference === boundariesElement) { 17553 boundariesElement = getOffsetParent(boundariesElement); 17554 } 17555 17556 // NOTE: DOM access here 17557 // resets the popper's position so that the document size can be calculated excluding 17558 // the size of the popper element itself 17559 var transformProp = getSupportedPropertyName('transform'); 17560 var popperStyles = data.instance.popper.style; // assignment to help minification 17561 var top = popperStyles.top, 17562 left = popperStyles.left, 17563 transform = popperStyles[transformProp]; 17564 17565 popperStyles.top = ''; 17566 popperStyles.left = ''; 17567 popperStyles[transformProp] = ''; 17568 17569 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 17570 17571 // NOTE: DOM access here 17572 // restores the original style properties after the offsets have been computed 17573 popperStyles.top = top; 17574 popperStyles.left = left; 17575 popperStyles[transformProp] = transform; 17576 17577 options.boundaries = boundaries; 17578 17579 var order = options.priority; 17580 var popper = data.offsets.popper; 17581 17582 var check = { 17583 primary: function primary(placement) { 17584 var value = popper[placement]; 17585 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 17586 value = Math.max(popper[placement], boundaries[placement]); 17587 } 17588 return defineProperty({}, placement, value); 17589 }, 17590 secondary: function secondary(placement) { 17591 var mainSide = placement === 'right' ? 'left' : 'top'; 17592 var value = popper[mainSide]; 17593 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 17594 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 17595 } 17596 return defineProperty({}, mainSide, value); 17597 } 17598 }; 17599 17600 order.forEach(function (placement) { 17601 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 17602 popper = _extends({}, popper, check[side](placement)); 17603 }); 17604 17605 data.offsets.popper = popper; 17606 17607 return data; 17608} 17609 17610/** 17611 * @function 17612 * @memberof Modifiers 17613 * @argument {Object} data - The data object generated by `update` method 17614 * @argument {Object} options - Modifiers configuration and options 17615 * @returns {Object} The data object, properly modified 17616 */ 17617function shift(data) { 17618 var placement = data.placement; 17619 var basePlacement = placement.split('-')[0]; 17620 var shiftvariation = placement.split('-')[1]; 17621 17622 // if shift shiftvariation is specified, run the modifier 17623 if (shiftvariation) { 17624 var _data$offsets = data.offsets, 17625 reference = _data$offsets.reference, 17626 popper = _data$offsets.popper; 17627 17628 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 17629 var side = isVertical ? 'left' : 'top'; 17630 var measurement = isVertical ? 'width' : 'height'; 17631 17632 var shiftOffsets = { 17633 start: defineProperty({}, side, reference[side]), 17634 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 17635 }; 17636 17637 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 17638 } 17639 17640 return data; 17641} 17642 17643/** 17644 * @function 17645 * @memberof Modifiers 17646 * @argument {Object} data - The data object generated by update method 17647 * @argument {Object} options - Modifiers configuration and options 17648 * @returns {Object} The data object, properly modified 17649 */ 17650function hide(data) { 17651 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 17652 return data; 17653 } 17654 17655 var refRect = data.offsets.reference; 17656 var bound = find(data.instance.modifiers, function (modifier) { 17657 return modifier.name === 'preventOverflow'; 17658 }).boundaries; 17659 17660 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 17661 // Avoid unnecessary DOM access if visibility hasn't changed 17662 if (data.hide === true) { 17663 return data; 17664 } 17665 17666 data.hide = true; 17667 data.attributes['x-out-of-boundaries'] = ''; 17668 } else { 17669 // Avoid unnecessary DOM access if visibility hasn't changed 17670 if (data.hide === false) { 17671 return data; 17672 } 17673 17674 data.hide = false; 17675 data.attributes['x-out-of-boundaries'] = false; 17676 } 17677 17678 return data; 17679} 17680 17681/** 17682 * @function 17683 * @memberof Modifiers 17684 * @argument {Object} data - The data object generated by `update` method 17685 * @argument {Object} options - Modifiers configuration and options 17686 * @returns {Object} The data object, properly modified 17687 */ 17688function inner(data) { 17689 var placement = data.placement; 17690 var basePlacement = placement.split('-')[0]; 17691 var _data$offsets = data.offsets, 17692 popper = _data$offsets.popper, 17693 reference = _data$offsets.reference; 17694 17695 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 17696 17697 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 17698 17699 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 17700 17701 data.placement = getOppositePlacement(placement); 17702 data.offsets.popper = getClientRect(popper); 17703 17704 return data; 17705} 17706 17707/** 17708 * Modifier function, each modifier can have a function of this type assigned 17709 * to its `fn` property.<br /> 17710 * These functions will be called on each update, this means that you must 17711 * make sure they are performant enough to avoid performance bottlenecks. 17712 * 17713 * @function ModifierFn 17714 * @argument {dataObject} data - The data object generated by `update` method 17715 * @argument {Object} options - Modifiers configuration and options 17716 * @returns {dataObject} The data object, properly modified 17717 */ 17718 17719/** 17720 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 17721 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 17722 * needed by the library. 17723 * 17724 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 17725 * All the other properties are configurations that could be tweaked. 17726 * @namespace modifiers 17727 */ 17728var modifiers = { 17729 /** 17730 * Modifier used to shift the popper on the start or end of its reference 17731 * element.<br /> 17732 * It will read the variation of the `placement` property.<br /> 17733 * It can be one either `-end` or `-start`. 17734 * @memberof modifiers 17735 * @inner 17736 */ 17737 shift: { 17738 /** @prop {number} order=100 - Index used to define the order of execution */ 17739 order: 100, 17740 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17741 enabled: true, 17742 /** @prop {ModifierFn} */ 17743 fn: shift 17744 }, 17745 17746 /** 17747 * The `offset` modifier can shift your popper on both its axis. 17748 * 17749 * It accepts the following units: 17750 * - `px` or unit-less, interpreted as pixels 17751 * - `%` or `%r`, percentage relative to the length of the reference element 17752 * - `%p`, percentage relative to the length of the popper element 17753 * - `vw`, CSS viewport width unit 17754 * - `vh`, CSS viewport height unit 17755 * 17756 * For length is intended the main axis relative to the placement of the popper.<br /> 17757 * This means that if the placement is `top` or `bottom`, the length will be the 17758 * `width`. In case of `left` or `right`, it will be the `height`. 17759 * 17760 * You can provide a single value (as `Number` or `String`), or a pair of values 17761 * as `String` divided by a comma or one (or more) white spaces.<br /> 17762 * The latter is a deprecated method because it leads to confusion and will be 17763 * removed in v2.<br /> 17764 * Additionally, it accepts additions and subtractions between different units. 17765 * Note that multiplications and divisions aren't supported. 17766 * 17767 * Valid examples are: 17768 * ``` 17769 * 10 17770 * '10%' 17771 * '10, 10' 17772 * '10%, 10' 17773 * '10 + 10%' 17774 * '10 - 5vh + 3%' 17775 * '-10px + 5vh, 5px - 6%' 17776 * ``` 17777 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 17778 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 17779 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 17780 * 17781 * @memberof modifiers 17782 * @inner 17783 */ 17784 offset: { 17785 /** @prop {number} order=200 - Index used to define the order of execution */ 17786 order: 200, 17787 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17788 enabled: true, 17789 /** @prop {ModifierFn} */ 17790 fn: offset, 17791 /** @prop {Number|String} offset=0 17792 * The offset value as described in the modifier description 17793 */ 17794 offset: 0 17795 }, 17796 17797 /** 17798 * Modifier used to prevent the popper from being positioned outside the boundary. 17799 * 17800 * A scenario exists where the reference itself is not within the boundaries.<br /> 17801 * We can say it has "escaped the boundaries" ââ¬â or just "escaped".<br /> 17802 * In this case we need to decide whether the popper should either: 17803 * 17804 * - detach from the reference and remain "trapped" in the boundaries, or 17805 * - if it should ignore the boundary and "escape with its reference" 17806 * 17807 * When `escapeWithReference` is set to`true` and reference is completely 17808 * outside its boundaries, the popper will overflow (or completely leave) 17809 * the boundaries in order to remain attached to the edge of the reference. 17810 * 17811 * @memberof modifiers 17812 * @inner 17813 */ 17814 preventOverflow: { 17815 /** @prop {number} order=300 - Index used to define the order of execution */ 17816 order: 300, 17817 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17818 enabled: true, 17819 /** @prop {ModifierFn} */ 17820 fn: preventOverflow, 17821 /** 17822 * @prop {Array} [priority=['left','right','top','bottom']] 17823 * Popper will try to prevent overflow following these priorities by default, 17824 * then, it could overflow on the left and on top of the `boundariesElement` 17825 */ 17826 priority: ['left', 'right', 'top', 'bottom'], 17827 /** 17828 * @prop {number} padding=5 17829 * Amount of pixel used to define a minimum distance between the boundaries 17830 * and the popper. This makes sure the popper always has a little padding 17831 * between the edges of its container 17832 */ 17833 padding: 5, 17834 /** 17835 * @prop {String|HTMLElement} boundariesElement='scrollParent' 17836 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 17837 * `viewport` or any DOM element. 17838 */ 17839 boundariesElement: 'scrollParent' 17840 }, 17841 17842 /** 17843 * Modifier used to make sure the reference and its popper stay near each other 17844 * without leaving any gap between the two. Especially useful when the arrow is 17845 * enabled and you want to ensure that it points to its reference element. 17846 * It cares only about the first axis. You can still have poppers with margin 17847 * between the popper and its reference element. 17848 * @memberof modifiers 17849 * @inner 17850 */ 17851 keepTogether: { 17852 /** @prop {number} order=400 - Index used to define the order of execution */ 17853 order: 400, 17854 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17855 enabled: true, 17856 /** @prop {ModifierFn} */ 17857 fn: keepTogether 17858 }, 17859 17860 /** 17861 * This modifier is used to move the `arrowElement` of the popper to make 17862 * sure it is positioned between the reference element and its popper element. 17863 * It will read the outer size of the `arrowElement` node to detect how many 17864 * pixels of conjunction are needed. 17865 * 17866 * It has no effect if no `arrowElement` is provided. 17867 * @memberof modifiers 17868 * @inner 17869 */ 17870 arrow: { 17871 /** @prop {number} order=500 - Index used to define the order of execution */ 17872 order: 500, 17873 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17874 enabled: true, 17875 /** @prop {ModifierFn} */ 17876 fn: arrow, 17877 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 17878 element: '[x-arrow]' 17879 }, 17880 17881 /** 17882 * Modifier used to flip the popper's placement when it starts to overlap its 17883 * reference element. 17884 * 17885 * Requires the `preventOverflow` modifier before it in order to work. 17886 * 17887 * **NOTE:** this modifier will interrupt the current update cycle and will 17888 * restart it if it detects the need to flip the placement. 17889 * @memberof modifiers 17890 * @inner 17891 */ 17892 flip: { 17893 /** @prop {number} order=600 - Index used to define the order of execution */ 17894 order: 600, 17895 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17896 enabled: true, 17897 /** @prop {ModifierFn} */ 17898 fn: flip, 17899 /** 17900 * @prop {String|Array} behavior='flip' 17901 * The behavior used to change the popper's placement. It can be one of 17902 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 17903 * placements (with optional variations) 17904 */ 17905 behavior: 'flip', 17906 /** 17907 * @prop {number} padding=5 17908 * The popper will flip if it hits the edges of the `boundariesElement` 17909 */ 17910 padding: 5, 17911 /** 17912 * @prop {String|HTMLElement} boundariesElement='viewport' 17913 * The element which will define the boundaries of the popper position. 17914 * The popper will never be placed outside of the defined boundaries 17915 * (except if `keepTogether` is enabled) 17916 */ 17917 boundariesElement: 'viewport', 17918 /** 17919 * @prop {Boolean} flipVariations=false 17920 * The popper will switch placement variation between `-start` and `-end` when 17921 * the reference element overlaps its boundaries. 17922 * 17923 * The original placement should have a set variation. 17924 */ 17925 flipVariations: false, 17926 /** 17927 * @prop {Boolean} flipVariationsByContent=false 17928 * The popper will switch placement variation between `-start` and `-end` when 17929 * the popper element overlaps its reference boundaries. 17930 * 17931 * The original placement should have a set variation. 17932 */ 17933 flipVariationsByContent: false 17934 }, 17935 17936 /** 17937 * Modifier used to make the popper flow toward the inner of the reference element. 17938 * By default, when this modifier is disabled, the popper will be placed outside 17939 * the reference element. 17940 * @memberof modifiers 17941 * @inner 17942 */ 17943 inner: { 17944 /** @prop {number} order=700 - Index used to define the order of execution */ 17945 order: 700, 17946 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 17947 enabled: false, 17948 /** @prop {ModifierFn} */ 17949 fn: inner 17950 }, 17951 17952 /** 17953 * Modifier used to hide the popper when its reference element is outside of the 17954 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 17955 * be used to hide with a CSS selector the popper when its reference is 17956 * out of boundaries. 17957 * 17958 * Requires the `preventOverflow` modifier before it in order to work. 17959 * @memberof modifiers 17960 * @inner 17961 */ 17962 hide: { 17963 /** @prop {number} order=800 - Index used to define the order of execution */ 17964 order: 800, 17965 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17966 enabled: true, 17967 /** @prop {ModifierFn} */ 17968 fn: hide 17969 }, 17970 17971 /** 17972 * Computes the style that will be applied to the popper element to gets 17973 * properly positioned. 17974 * 17975 * Note that this modifier will not touch the DOM, it just prepares the styles 17976 * so that `applyStyle` modifier can apply it. This separation is useful 17977 * in case you need to replace `applyStyle` with a custom implementation. 17978 * 17979 * This modifier has `850` as `order` value to maintain backward compatibility 17980 * with previous versions of Popper.js. Expect the modifiers ordering method 17981 * to change in future major versions of the library. 17982 * 17983 * @memberof modifiers 17984 * @inner 17985 */ 17986 computeStyle: { 17987 /** @prop {number} order=850 - Index used to define the order of execution */ 17988 order: 850, 17989 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17990 enabled: true, 17991 /** @prop {ModifierFn} */ 17992 fn: computeStyle, 17993 /** 17994 * @prop {Boolean} gpuAcceleration=true 17995 * If true, it uses the CSS 3D transformation to position the popper. 17996 * Otherwise, it will use the `top` and `left` properties 17997 */ 17998 gpuAcceleration: true, 17999 /** 18000 * @prop {string} [x='bottom'] 18001 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 18002 * Change this if your popper should grow in a direction different from `bottom` 18003 */ 18004 x: 'bottom', 18005 /** 18006 * @prop {string} [x='left'] 18007 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 18008 * Change this if your popper should grow in a direction different from `right` 18009 */ 18010 y: 'right' 18011 }, 18012 18013 /** 18014 * Applies the computed styles to the popper element. 18015 * 18016 * All the DOM manipulations are limited to this modifier. This is useful in case 18017 * you want to integrate Popper.js inside a framework or view library and you 18018 * want to delegate all the DOM manipulations to it. 18019 * 18020 * Note that if you disable this modifier, you must make sure the popper element 18021 * has its position set to `absolute` before Popper.js can do its work! 18022 * 18023 * Just disable this modifier and define your own to achieve the desired effect. 18024 * 18025 * @memberof modifiers 18026 * @inner 18027 */ 18028 applyStyle: { 18029 /** @prop {number} order=900 - Index used to define the order of execution */ 18030 order: 900, 18031 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18032 enabled: true, 18033 /** @prop {ModifierFn} */ 18034 fn: applyStyle, 18035 /** @prop {Function} */ 18036 onLoad: applyStyleOnLoad, 18037 /** 18038 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 18039 * @prop {Boolean} gpuAcceleration=true 18040 * If true, it uses the CSS 3D transformation to position the popper. 18041 * Otherwise, it will use the `top` and `left` properties 18042 */ 18043 gpuAcceleration: undefined 18044 } 18045}; 18046 18047/** 18048 * The `dataObject` is an object containing all the information used by Popper.js. 18049 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 18050 * @name dataObject 18051 * @property {Object} data.instance The Popper.js instance 18052 * @property {String} data.placement Placement applied to popper 18053 * @property {String} data.originalPlacement Placement originally defined on init 18054 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 18055 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 18056 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 18057 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 18058 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 18059 * @property {Object} data.boundaries Offsets of the popper boundaries 18060 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 18061 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 18062 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 18063 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 18064 */ 18065 18066/** 18067 * Default options provided to Popper.js constructor.<br /> 18068 * These can be overridden using the `options` argument of Popper.js.<br /> 18069 * To override an option, simply pass an object with the same 18070 * structure of the `options` object, as the 3rd argument. For example: 18071 * ``` 18072 * new Popper(ref, pop, { 18073 * modifiers: { 18074 * preventOverflow: { enabled: false } 18075 * } 18076 * }) 18077 * ``` 18078 * @type {Object} 18079 * @static 18080 * @memberof Popper 18081 */ 18082var Defaults = { 18083 /** 18084 * Popper's placement. 18085 * @prop {Popper.placements} placement='bottom' 18086 */ 18087 placement: 'bottom', 18088 18089 /** 18090 * Set this to true if you want popper to position it self in 'fixed' mode 18091 * @prop {Boolean} positionFixed=false 18092 */ 18093 positionFixed: false, 18094 18095 /** 18096 * Whether events (resize, scroll) are initially enabled. 18097 * @prop {Boolean} eventsEnabled=true 18098 */ 18099 eventsEnabled: true, 18100 18101 /** 18102 * Set to true if you want to automatically remove the popper when 18103 * you call the `destroy` method. 18104 * @prop {Boolean} removeOnDestroy=false 18105 */ 18106 removeOnDestroy: false, 18107 18108 /** 18109 * Callback called when the popper is created.<br /> 18110 * By default, it is set to no-op.<br /> 18111 * Access Popper.js instance with `data.instance`. 18112 * @prop {onCreate} 18113 */ 18114 onCreate: function onCreate() {}, 18115 18116 /** 18117 * Callback called when the popper is updated. This callback is not called 18118 * on the initialization/creation of the popper, but only on subsequent 18119 * updates.<br /> 18120 * By default, it is set to no-op.<br /> 18121 * Access Popper.js instance with `data.instance`. 18122 * @prop {onUpdate} 18123 */ 18124 onUpdate: function onUpdate() {}, 18125 18126 /** 18127 * List of modifiers used to modify the offsets before they are applied to the popper. 18128 * They provide most of the functionalities of Popper.js. 18129 * @prop {modifiers} 18130 */ 18131 modifiers: modifiers 18132}; 18133 18134/** 18135 * @callback onCreate 18136 * @param {dataObject} data 18137 */ 18138 18139/** 18140 * @callback onUpdate 18141 * @param {dataObject} data 18142 */ 18143 18144// Utils 18145// Methods 18146var Popper = function () { 18147 /** 18148 * Creates a new Popper.js instance. 18149 * @class Popper 18150 * @param {Element|referenceObject} reference - The reference element used to position the popper 18151 * @param {Element} popper - The HTML / XML element used as the popper 18152 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 18153 * @return {Object} instance - The generated Popper.js instance 18154 */ 18155 function Popper(reference, popper) { 18156 var _this = this; 18157 18158 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 18159 classCallCheck(this, Popper); 18160 18161 this.scheduleUpdate = function () { 18162 return requestAnimationFrame(_this.update); 18163 }; 18164 18165 // make update() debounced, so that it only runs at most once-per-tick 18166 this.update = debounce(this.update.bind(this)); 18167 18168 // with {} we create a new object with the options inside it 18169 this.options = _extends({}, Popper.Defaults, options); 18170 18171 // init state 18172 this.state = { 18173 isDestroyed: false, 18174 isCreated: false, 18175 scrollParents: [] 18176 }; 18177 18178 // get reference and popper elements (allow jQuery wrappers) 18179 this.reference = reference && reference.jquery ? reference[0] : reference; 18180 this.popper = popper && popper.jquery ? popper[0] : popper; 18181 18182 // Deep merge modifiers options 18183 this.options.modifiers = {}; 18184 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 18185 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 18186 }); 18187 18188 // Refactoring modifiers' list (Object => Array) 18189 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 18190 return _extends({ 18191 name: name 18192 }, _this.options.modifiers[name]); 18193 }) 18194 // sort the modifiers by order 18195 .sort(function (a, b) { 18196 return a.order - b.order; 18197 }); 18198 18199 // modifiers have the ability to execute arbitrary code when Popper.js get inited 18200 // such code is executed in the same order of its modifier 18201 // they could add new properties to their options configuration 18202 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 18203 this.modifiers.forEach(function (modifierOptions) { 18204 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 18205 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 18206 } 18207 }); 18208 18209 // fire the first update to position the popper in the right place 18210 this.update(); 18211 18212 var eventsEnabled = this.options.eventsEnabled; 18213 if (eventsEnabled) { 18214 // setup event listeners, they will take care of update the position in specific situations 18215 this.enableEventListeners(); 18216 } 18217 18218 this.state.eventsEnabled = eventsEnabled; 18219 } 18220 18221 // We can't use class properties because they don't get listed in the 18222 // class prototype and break stuff like Sinon stubs 18223 18224 18225 createClass(Popper, [{ 18226 key: 'update', 18227 value: function update$$1() { 18228 return update.call(this); 18229 } 18230 }, { 18231 key: 'destroy', 18232 value: function destroy$$1() { 18233 return destroy.call(this); 18234 } 18235 }, { 18236 key: 'enableEventListeners', 18237 value: function enableEventListeners$$1() { 18238 return enableEventListeners.call(this); 18239 } 18240 }, { 18241 key: 'disableEventListeners', 18242 value: function disableEventListeners$$1() { 18243 return disableEventListeners.call(this); 18244 } 18245 18246 /** 18247 * Schedules an update. It will run on the next UI update available. 18248 * @method scheduleUpdate 18249 * @memberof Popper 18250 */ 18251 18252 18253 /** 18254 * Collection of utilities useful when writing custom modifiers. 18255 * Starting from version 1.7, this method is available only if you 18256 * include `popper-utils.js` before `popper.js`. 18257 * 18258 * **DEPRECATION**: This way to access PopperUtils is deprecated 18259 * and will be removed in v2! Use the PopperUtils module directly instead. 18260 * Due to the high instability of the methods contained in Utils, we can't 18261 * guarantee them to follow semver. Use them at your own risk! 18262 * @static 18263 * @private 18264 * @type {Object} 18265 * @deprecated since version 1.8 18266 * @member Utils 18267 * @memberof Popper 18268 */ 18269 18270 }]); 18271 return Popper; 18272}(); 18273 18274/** 18275 * The `referenceObject` is an object that provides an interface compatible with Popper.js 18276 * and lets you use it as replacement of a real DOM node.<br /> 18277 * You can use this method to position a popper relatively to a set of coordinates 18278 * in case you don't have a DOM node to use as reference. 18279 * 18280 * ``` 18281 * new Popper(referenceObject, popperNode); 18282 * ``` 18283 * 18284 * NB: This feature isn't supported in Internet Explorer 10. 18285 * @name referenceObject 18286 * @property {Function} data.getBoundingClientRect 18287 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 18288 * @property {number} data.clientWidth 18289 * An ES6 getter that will return the width of the virtual reference element. 18290 * @property {number} data.clientHeight 18291 * An ES6 getter that will return the height of the virtual reference element. 18292 */ 18293 18294 18295Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; 18296Popper.placements = placements; 18297Popper.Defaults = Defaults; 18298 18299/* harmony default export */ __webpack_exports__["default"] = (Popper); 18300 18301/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js"))) 18302 18303 18304 /***/ 18305 }, 18306 18307
vendor: 417 bytes, lines 18307-18319
18307/***/ "../node_modules/slick-carousel/slick/slick.css": 18308 /*!******************************************************!*\ 18309 !*** ../node_modules/slick-carousel/slick/slick.css ***! 18310 \******************************************************/ 18311 /*! no static exports found */ 18312 /***/ function (module, exports) { 18313 // removed by extract-text-webpack-plugin 18314 18315 18316 /***/ 18317 }, 18318 18319
vendor: 89,711 bytes, lines 18319-21341
18319/***/ "../node_modules/slick-carousel/slick/slick.js": 18320 /*!*****************************************************!*\ 18321 !*** ../node_modules/slick-carousel/slick/slick.js ***! 18322 \*****************************************************/ 18323 /*! no static exports found */ 18324 /***/ function (module, exports, __webpack_require__) { 18325 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* 18326 _ _ _ _ 18327 ___| (_) ___| | __ (_)___ 18328/ __| | |/ __| |/ / | / __| 18329\__ \ | | (__| < _ | \__ \ 18330|___/_|_|\___|_|\_(_)/ |___/ 18331 |__/ 18332 18333 Version: 1.8.1 18334 Author: Ken Wheeler 18335 Website: http://kenwheeler.github.io 18336 Docs: http://kenwheeler.github.io/slick 18337 Repo: http://github.com/kenwheeler/slick 18338 Issues: http://github.com/kenwheeler/slick/issues 18339 18340 */ 18341/* global window, document, define, jQuery, setInterval, clearInterval */ 18342;(function(factory) { 18343 'use strict'; 18344 if (true) { 18345 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "../node_modules/jquery/dist/jquery.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 18346 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 18347 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 18348 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 18349 } else {} 18350 18351}(function($) { 18352 'use strict'; 18353 var Slick = window.Slick || {}; 18354 18355 Slick = (function() { 18356 18357 var instanceUid = 0; 18358 18359 function Slick(element, settings) { 18360 18361 var _ = this, dataSettings; 18362 18363 _.defaults = { 18364 accessibility: true, 18365 adaptiveHeight: false, 18366 appendArrows: $(element), 18367 appendDots: $(element), 18368 arrows: true, 18369 asNavFor: null, 18370 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>', 18371 nextArrow: '<button class="slick-next" aria-label="Next" type="button">Next</button>', 18372 autoplay: false, 18373 autoplaySpeed: 3000, 18374 centerMode: false, 18375 centerPadding: '50px', 18376 cssEase: 'ease', 18377 customPaging: function(slider, i) { 18378 return $('<button type="button" />').text(i + 1); 18379 }, 18380 dots: false, 18381 dotsClass: 'slick-dots', 18382 draggable: true, 18383 easing: 'linear', 18384 edgeFriction: 0.35, 18385 fade: false, 18386 focusOnSelect: false, 18387 focusOnChange: false, 18388 infinite: true, 18389 initialSlide: 0, 18390 lazyLoad: 'ondemand', 18391 mobileFirst: false, 18392 pauseOnHover: true, 18393 pauseOnFocus: true, 18394 pauseOnDotsHover: false, 18395 respondTo: 'window', 18396 responsive: null, 18397 rows: 1, 18398 rtl: false, 18399 slide: '', 18400 slidesPerRow: 1, 18401 slidesToShow: 1, 18402 slidesToScroll: 1, 18403 speed: 500, 18404 swipe: true, 18405 swipeToSlide: false, 18406 touchMove: true, 18407 touchThreshold: 5, 18408 useCSS: true, 18409 useTransform: true, 18410 variableWidth: false, 18411 vertical: false, 18412 verticalSwiping: false, 18413 waitForAnimate: true, 18414 zIndex: 1000 18415 }; 18416 18417 _.initials = { 18418 animating: false, 18419 dragging: false, 18420 autoPlayTimer: null, 18421 currentDirection: 0, 18422 currentLeft: null, 18423 currentSlide: 0, 18424 direction: 1, 18425 $dots: null, 18426 listWidth: null, 18427 listHeight: null, 18428 loadIndex: 0, 18429 $nextArrow: null, 18430 $prevArrow: null, 18431 scrolling: false, 18432 slideCount: null, 18433 slideWidth: null, 18434 $slideTrack: null, 18435 $slides: null, 18436 sliding: false, 18437 slideOffset: 0, 18438 swipeLeft: null, 18439 swiping: false, 18440 $list: null, 18441 touchObject: {}, 18442 transformsEnabled: false, 18443 unslicked: false 18444 }; 18445 18446 $.extend(_, _.initials); 18447 18448 _.activeBreakpoint = null; 18449 _.animType = null; 18450 _.animProp = null; 18451 _.breakpoints = []; 18452 _.breakpointSettings = []; 18453 _.cssTransitions = false; 18454 _.focussed = false; 18455 _.interrupted = false; 18456 _.hidden = 'hidden'; 18457 _.paused = true; 18458 _.positionProp = null; 18459 _.respondTo = null; 18460 _.rowCount = 1; 18461 _.shouldClick = true; 18462 _.$slider = $(element); 18463 _.$slidesCache = null; 18464 _.transformType = null; 18465 _.transitionType = null; 18466 _.visibilityChange = 'visibilitychange'; 18467 _.windowWidth = 0; 18468 _.windowTimer = null; 18469 18470 dataSettings = $(element).data('slick') || {}; 18471 18472 _.options = $.extend({}, _.defaults, settings, dataSettings); 18473 18474 _.currentSlide = _.options.initialSlide; 18475 18476 _.originalSettings = _.options; 18477 18478 if (typeof document.mozHidden !== 'undefined') { 18479 _.hidden = 'mozHidden'; 18480 _.visibilityChange = 'mozvisibilitychange'; 18481 } else if (typeof document.webkitHidden !== 'undefined') { 18482 _.hidden = 'webkitHidden'; 18483 _.visibilityChange = 'webkitvisibilitychange'; 18484 } 18485 18486 _.autoPlay = $.proxy(_.autoPlay, _); 18487 _.autoPlayClear = $.proxy(_.autoPlayClear, _); 18488 _.autoPlayIterator = $.proxy(_.autoPlayIterator, _); 18489 _.changeSlide = $.proxy(_.changeSlide, _); 18490 _.clickHandler = $.proxy(_.clickHandler, _); 18491 _.selectHandler = $.proxy(_.selectHandler, _); 18492 _.setPosition = $.proxy(_.setPosition, _); 18493 _.swipeHandler = $.proxy(_.swipeHandler, _); 18494 _.dragHandler = $.proxy(_.dragHandler, _); 18495 _.keyHandler = $.proxy(_.keyHandler, _); 18496 18497 _.instanceUid = instanceUid++; 18498 18499 // A simple way to check for HTML strings 18500 // Strict HTML recognition (must start with <) 18501 // Extracted from jQuery v1.11 source 18502 _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/; 18503 18504 18505 _.registerBreakpoints(); 18506 _.init(true); 18507 18508 } 18509 18510 return Slick; 18511 18512 }()); 18513 18514 Slick.prototype.activateADA = function() { 18515 var _ = this; 18516 18517 _.$slideTrack.find('.slick-active').attr({ 18518 'aria-hidden': 'false' 18519 }).find('a, input, button, select').attr({ 18520 'tabindex': '0' 18521 }); 18522 18523 }; 18524 18525 Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) { 18526 18527 var _ = this; 18528 18529 if (typeof(index) === 'boolean') { 18530 addBefore = index; 18531 index = null; 18532 } else if (index < 0 || (index >= _.slideCount)) { 18533 return false; 18534 } 18535 18536 _.unload(); 18537 18538 if (typeof(index) === 'number') { 18539 if (index === 0 && _.$slides.length === 0) { 18540 $(markup).appendTo(_.$slideTrack); 18541 } else if (addBefore) { 18542 $(markup).insertBefore(_.$slides.eq(index)); 18543 } else { 18544 $(markup).insertAfter(_.$slides.eq(index)); 18545 } 18546 } else { 18547 if (addBefore === true) { 18548 $(markup).prependTo(_.$slideTrack); 18549 } else { 18550 $(markup).appendTo(_.$slideTrack); 18551 } 18552 } 18553 18554 _.$slides = _.$slideTrack.children(this.options.slide); 18555 18556 _.$slideTrack.children(this.options.slide).detach(); 18557 18558 _.$slideTrack.append(_.$slides); 18559 18560 _.$slides.each(function(index, element) { 18561 $(element).attr('data-slick-index', index); 18562 }); 18563 18564 _.$slidesCache = _.$slides; 18565 18566 _.reinit(); 18567 18568 }; 18569 18570 Slick.prototype.animateHeight = function() { 18571 var _ = this; 18572 if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { 18573 var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); 18574 _.$list.animate({ 18575 height: targetHeight 18576 }, _.options.speed); 18577 } 18578 }; 18579 18580 Slick.prototype.animateSlide = function(targetLeft, callback) { 18581 18582 var animProps = {}, 18583 _ = this; 18584 18585 _.animateHeight(); 18586 18587 if (_.options.rtl === true && _.options.vertical === false) { 18588 targetLeft = -targetLeft; 18589 } 18590 if (_.transformsEnabled === false) { 18591 if (_.options.vertical === false) { 18592 _.$slideTrack.animate({ 18593 left: targetLeft 18594 }, _.options.speed, _.options.easing, callback); 18595 } else { 18596 _.$slideTrack.animate({ 18597 top: targetLeft 18598 }, _.options.speed, _.options.easing, callback); 18599 } 18600 18601 } else { 18602 18603 if (_.cssTransitions === false) { 18604 if (_.options.rtl === true) { 18605 _.currentLeft = -(_.currentLeft); 18606 } 18607 $({ 18608 animStart: _.currentLeft 18609 }).animate({ 18610 animStart: targetLeft 18611 }, { 18612 duration: _.options.speed, 18613 easing: _.options.easing, 18614 step: function(now) { 18615 now = Math.ceil(now); 18616 if (_.options.vertical === false) { 18617 animProps[_.animType] = 'translate(' + 18618 now + 'px, 0px)'; 18619 _.$slideTrack.css(animProps); 18620 } else { 18621 animProps[_.animType] = 'translate(0px,' + 18622 now + 'px)'; 18623 _.$slideTrack.css(animProps); 18624 } 18625 }, 18626 complete: function() { 18627 if (callback) { 18628 callback.call(); 18629 } 18630 } 18631 }); 18632 18633 } else { 18634 18635 _.applyTransition(); 18636 targetLeft = Math.ceil(targetLeft); 18637 18638 if (_.options.vertical === false) { 18639 animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)'; 18640 } else { 18641 animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)'; 18642 } 18643 _.$slideTrack.css(animProps); 18644 18645 if (callback) { 18646 setTimeout(function() { 18647 18648 _.disableTransition(); 18649 18650 callback.call(); 18651 }, _.options.speed); 18652 } 18653 18654 } 18655 18656 } 18657 18658 }; 18659 18660 Slick.prototype.getNavTarget = function() { 18661 18662 var _ = this, 18663 asNavFor = _.options.asNavFor; 18664 18665 if ( asNavFor && asNavFor !== null ) { 18666 asNavFor = $(asNavFor).not(_.$slider); 18667 } 18668 18669 return asNavFor; 18670 18671 }; 18672 18673 Slick.prototype.asNavFor = function(index) { 18674 18675 var _ = this, 18676 asNavFor = _.getNavTarget(); 18677 18678 if ( asNavFor !== null && typeof asNavFor === 'object' ) { 18679 asNavFor.each(function() { 18680 var target = $(this).slick('getSlick'); 18681 if(!target.unslicked) { 18682 target.slideHandler(index, true); 18683 } 18684 }); 18685 } 18686 18687 }; 18688 18689 Slick.prototype.applyTransition = function(slide) { 18690 18691 var _ = this, 18692 transition = {}; 18693 18694 if (_.options.fade === false) { 18695 transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase; 18696 } else { 18697 transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase; 18698 } 18699 18700 if (_.options.fade === false) { 18701 _.$slideTrack.css(transition); 18702 } else { 18703 _.$slides.eq(slide).css(transition); 18704 } 18705 18706 }; 18707 18708 Slick.prototype.autoPlay = function() { 18709 18710 var _ = this; 18711 18712 _.autoPlayClear(); 18713 18714 if ( _.slideCount > _.options.slidesToShow ) { 18715 _.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed ); 18716 } 18717 18718 }; 18719 18720 Slick.prototype.autoPlayClear = function() { 18721 18722 var _ = this; 18723 18724 if (_.autoPlayTimer) { 18725 clearInterval(_.autoPlayTimer); 18726 } 18727 18728 }; 18729 18730 Slick.prototype.autoPlayIterator = function() { 18731 18732 var _ = this, 18733 slideTo = _.currentSlide + _.options.slidesToScroll; 18734 18735 if ( !_.paused && !_.interrupted && !_.focussed ) { 18736 18737 if ( _.options.infinite === false ) { 18738 18739 if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) { 18740 _.direction = 0; 18741 } 18742 18743 else if ( _.direction === 0 ) { 18744 18745 slideTo = _.currentSlide - _.options.slidesToScroll; 18746 18747 if ( _.currentSlide - 1 === 0 ) { 18748 _.direction = 1; 18749 } 18750 18751 } 18752 18753 } 18754 18755 _.slideHandler( slideTo ); 18756 18757 } 18758 18759 }; 18760 18761 Slick.prototype.buildArrows = function() { 18762 18763 var _ = this; 18764 18765 if (_.options.arrows === true ) { 18766 18767 _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow'); 18768 _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow'); 18769 18770 if( _.slideCount > _.options.slidesToShow ) { 18771 18772 _.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); 18773 _.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); 18774 18775 if (_.htmlExpr.test(_.options.prevArrow)) { 18776 _.$prevArrow.prependTo(_.options.appendArrows); 18777 } 18778 18779 if (_.htmlExpr.test(_.options.nextArrow)) { 18780 _.$nextArrow.appendTo(_.options.appendArrows); 18781 } 18782 18783 if (_.options.infinite !== true) { 18784 _.$prevArrow 18785 .addClass('slick-disabled') 18786 .attr('aria-disabled', 'true'); 18787 } 18788 18789 } else { 18790 18791 _.$prevArrow.add( _.$nextArrow ) 18792 18793 .addClass('slick-hidden') 18794 .attr({ 18795 'aria-disabled': 'true', 18796 'tabindex': '-1' 18797 }); 18798 18799 } 18800 18801 } 18802 18803 }; 18804 18805 Slick.prototype.buildDots = function() { 18806 18807 var _ = this, 18808 i, dot; 18809 18810 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 18811 18812 _.$slider.addClass('slick-dotted'); 18813 18814 dot = $('<ul />').addClass(_.options.dotsClass); 18815 18816 for (i = 0; i <= _.getDotCount(); i += 1) { 18817 dot.append($('<li />').append(_.options.customPaging.call(this, _, i))); 18818 } 18819 18820 _.$dots = dot.appendTo(_.options.appendDots); 18821 18822 _.$dots.find('li').first().addClass('slick-active'); 18823 18824 } 18825 18826 }; 18827 18828 Slick.prototype.buildOut = function() { 18829 18830 var _ = this; 18831 18832 _.$slides = 18833 _.$slider 18834 .children( _.options.slide + ':not(.slick-cloned)') 18835 .addClass('slick-slide'); 18836 18837 _.slideCount = _.$slides.length; 18838 18839 _.$slides.each(function(index, element) { 18840 $(element) 18841 .attr('data-slick-index', index) 18842 .data('originalStyling', $(element).attr('style') || ''); 18843 }); 18844 18845 _.$slider.addClass('slick-slider'); 18846 18847 _.$slideTrack = (_.slideCount === 0) ? 18848 $('<div class="slick-track"/>').appendTo(_.$slider) : 18849 _.$slides.wrapAll('<div class="slick-track"/>').parent(); 18850 18851 _.$list = _.$slideTrack.wrap( 18852 '<div class="slick-list"/>').parent(); 18853 _.$slideTrack.css('opacity', 0); 18854 18855 if (_.options.centerMode === true || _.options.swipeToSlide === true) { 18856 _.options.slidesToScroll = 1; 18857 } 18858 18859 $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading'); 18860 18861 _.setupInfinite(); 18862 18863 _.buildArrows(); 18864 18865 _.buildDots(); 18866 18867 _.updateDots(); 18868 18869 18870 _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); 18871 18872 if (_.options.draggable === true) { 18873 _.$list.addClass('draggable'); 18874 } 18875 18876 }; 18877 18878 Slick.prototype.buildRows = function() { 18879 18880 var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection; 18881 18882 newSlides = document.createDocumentFragment(); 18883 originalSlides = _.$slider.children(); 18884 18885 if(_.options.rows > 0) { 18886 18887 slidesPerSection = _.options.slidesPerRow * _.options.rows; 18888 numOfSlides = Math.ceil( 18889 originalSlides.length / slidesPerSection 18890 ); 18891 18892 for(a = 0; a < numOfSlides; a++){ 18893 var slide = document.createElement('div'); 18894 for(b = 0; b < _.options.rows; b++) { 18895 var row = document.createElement('div'); 18896 for(c = 0; c < _.options.slidesPerRow; c++) { 18897 var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c)); 18898 if (originalSlides.get(target)) { 18899 row.appendChild(originalSlides.get(target)); 18900 } 18901 } 18902 slide.appendChild(row); 18903 } 18904 newSlides.appendChild(slide); 18905 } 18906 18907 _.$slider.empty().append(newSlides); 18908 _.$slider.children().children().children() 18909 .css({ 18910 'width':(100 / _.options.slidesPerRow) + '%', 18911 'display': 'inline-block' 18912 }); 18913 18914 } 18915 18916 }; 18917 18918 Slick.prototype.checkResponsive = function(initial, forceUpdate) { 18919 18920 var _ = this, 18921 breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false; 18922 var sliderWidth = _.$slider.width(); 18923 var windowWidth = window.innerWidth || $(window).width(); 18924 18925 if (_.respondTo === 'window') { 18926 respondToWidth = windowWidth; 18927 } else if (_.respondTo === 'slider') { 18928 respondToWidth = sliderWidth; 18929 } else if (_.respondTo === 'min') { 18930 respondToWidth = Math.min(windowWidth, sliderWidth); 18931 } 18932 18933 if ( _.options.responsive && 18934 _.options.responsive.length && 18935 _.options.responsive !== null) { 18936 18937 targetBreakpoint = null; 18938 18939 for (breakpoint in _.breakpoints) { 18940 if (_.breakpoints.hasOwnProperty(breakpoint)) { 18941 if (_.originalSettings.mobileFirst === false) { 18942 if (respondToWidth < _.breakpoints[breakpoint]) { 18943 targetBreakpoint = _.breakpoints[breakpoint]; 18944 } 18945 } else { 18946 if (respondToWidth > _.breakpoints[breakpoint]) { 18947 targetBreakpoint = _.breakpoints[breakpoint]; 18948 } 18949 } 18950 } 18951 } 18952 18953 if (targetBreakpoint !== null) { 18954 if (_.activeBreakpoint !== null) { 18955 if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) { 18956 _.activeBreakpoint = 18957 targetBreakpoint; 18958 if (_.breakpointSettings[targetBreakpoint] === 'unslick') { 18959 _.unslick(targetBreakpoint); 18960 } else { 18961 _.options = $.extend({}, _.originalSettings, 18962 _.breakpointSettings[ 18963 targetBreakpoint]); 18964 if (initial === true) { 18965 _.currentSlide = _.options.initialSlide; 18966 } 18967 _.refresh(initial); 18968 } 18969 triggerBreakpoint = targetBreakpoint; 18970 } 18971 } else { 18972 _.activeBreakpoint = targetBreakpoint; 18973 if (_.breakpointSettings[targetBreakpoint] === 'unslick') { 18974 _.unslick(targetBreakpoint); 18975 } else { 18976 _.options = $.extend({}, _.originalSettings, 18977 _.breakpointSettings[ 18978 targetBreakpoint]); 18979 if (initial === true) { 18980 _.currentSlide = _.options.initialSlide; 18981 } 18982 _.refresh(initial); 18983 } 18984 triggerBreakpoint = targetBreakpoint; 18985 } 18986 } else { 18987 if (_.activeBreakpoint !== null) { 18988 _.activeBreakpoint = null; 18989 _.options = _.originalSettings; 18990 if (initial === true) { 18991 _.currentSlide = _.options.initialSlide; 18992 } 18993 _.refresh(initial); 18994 triggerBreakpoint = targetBreakpoint; 18995 } 18996 } 18997 18998 // only trigger breakpoints during an actual break. not on initialize. 18999 if( !initial && triggerBreakpoint !== false ) { 19000 _.$slider.trigger('breakpoint', [_, triggerBreakpoint]); 19001 } 19002 } 19003 19004 }; 19005 19006 Slick.prototype.changeSlide = function(event, dontAnimate) { 19007 19008 var _ = this, 19009 $target = $(event.currentTarget), 19010 indexOffset, slideOffset, unevenOffset; 19011 19012 // If target is a link, prevent default action. 19013 if($target.is('a')) { 19014 event.preventDefault(); 19015 } 19016 19017 // If target is not the <li> element (ie: a child), find the <li>. 19018 if(!$target.is('li')) { 19019 $target = $target.closest('li'); 19020 } 19021 19022 unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0); 19023 indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll; 19024 19025 switch (event.data.message) { 19026 19027 case 'previous': 19028 slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset; 19029 if (_.slideCount > _.options.slidesToShow) { 19030 _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate); 19031 } 19032 break; 19033 19034 case 'next': 19035 slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset; 19036 if (_.slideCount > _.options.slidesToShow) { 19037 _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate); 19038 } 19039 break; 19040 19041 case 'index': 19042 var index = event.data.index === 0 ? 0 : 19043 event.data.index || $target.index() * _.options.slidesToScroll; 19044 19045 _.slideHandler(_.checkNavigable(index), false, dontAnimate); 19046 $target.children().trigger('focus'); 19047 break; 19048 19049 default: 19050 return; 19051 } 19052 19053 }; 19054 19055 Slick.prototype.checkNavigable = function(index) { 19056 19057 var _ = this, 19058 navigables, prevNavigable; 19059 19060 navigables = _.getNavigableIndexes(); 19061 prevNavigable = 0; 19062 if (index > navigables[navigables.length - 1]) { 19063 index = navigables[navigables.length - 1]; 19064 } else { 19065 for (var n in navigables) { 19066 if (index < navigables[n]) { 19067 index = prevNavigable; 19068 break; 19069 } 19070 prevNavigable = navigables[n]; 19071 } 19072 } 19073 19074 return index; 19075 }; 19076 19077 Slick.prototype.cleanUpEvents = function() { 19078 19079 var _ = this; 19080 19081 if (_.options.dots && _.$dots !== null) { 19082 19083 $('li', _.$dots) 19084 .off('click.slick', _.changeSlide) 19085 .off('mouseenter.slick', $.proxy(_.interrupt, _, true)) 19086 .off('mouseleave.slick', $.proxy(_.interrupt, _, false)); 19087 19088 if (_.options.accessibility === true) { 19089 _.$dots.off('keydown.slick', _.keyHandler); 19090 } 19091 } 19092 19093 _.$slider.off('focus.slick blur.slick'); 19094 19095 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 19096 _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide); 19097 _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide); 19098 19099 if (_.options.accessibility === true) { 19100 _.$prevArrow && _.$prevArrow.off('keydown.slick', _.keyHandler); 19101 _.$nextArrow && _.$nextArrow.off('keydown.slick', _.keyHandler); 19102 } 19103 } 19104 19105 _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler); 19106 _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler); 19107 _.$list.off('touchend.slick mouseup.slick', _.swipeHandler); 19108 _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler); 19109 19110 _.$list.off('click.slick', _.clickHandler); 19111 19112 $(document).off(_.visibilityChange, _.visibility); 19113 19114 _.cleanUpSlideEvents(); 19115 19116 if (_.options.accessibility === true) { 19117 _.$list.off('keydown.slick', _.keyHandler); 19118 } 19119 19120 if (_.options.focusOnSelect === true) { 19121 $(_.$slideTrack).children().off('click.slick', _.selectHandler); 19122 } 19123 19124 $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange); 19125 19126 $(window).off('resize.slick.slick-' + _.instanceUid, _.resize); 19127 19128 $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault); 19129 19130 $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition); 19131 19132 }; 19133 19134 Slick.prototype.cleanUpSlideEvents = function() { 19135 19136 var _ = this; 19137 19138 _.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true)); 19139 _.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false)); 19140 19141 }; 19142 19143 Slick.prototype.cleanUpRows = function() { 19144 19145 var _ = this, originalSlides; 19146 19147 if(_.options.rows > 0) { 19148 originalSlides = _.$slides.children().children(); 19149 originalSlides.removeAttr('style'); 19150 _.$slider.empty().append(originalSlides); 19151 } 19152 19153 }; 19154 19155 Slick.prototype.clickHandler = function(event) { 19156 19157 var _ = this; 19158 19159 if (_.shouldClick === false) { 19160 event.stopImmediatePropagation(); 19161 event.stopPropagation(); 19162 event.preventDefault(); 19163 } 19164 19165 }; 19166 19167 Slick.prototype.destroy = function(refresh) { 19168 19169 var _ = this; 19170 19171 _.autoPlayClear(); 19172 19173 _.touchObject = {}; 19174 19175 _.cleanUpEvents(); 19176 19177 $('.slick-cloned', _.$slider).detach(); 19178 19179 if (_.$dots) { 19180 _.$dots.remove(); 19181 } 19182 19183 if ( _.$prevArrow && _.$prevArrow.length ) { 19184 19185 _.$prevArrow 19186 .removeClass('slick-disabled slick-arrow slick-hidden') 19187 .removeAttr('aria-hidden aria-disabled tabindex') 19188 .css('display',''); 19189 19190 if ( _.htmlExpr.test( _.options.prevArrow )) { 19191 _.$prevArrow.remove(); 19192 } 19193 } 19194 19195 if ( _.$nextArrow && _.$nextArrow.length ) { 19196 19197 _.$nextArrow 19198 .removeClass('slick-disabled slick-arrow slick-hidden') 19199 .removeAttr('aria-hidden aria-disabled tabindex') 19200 .css('display',''); 19201 19202 if ( _.htmlExpr.test( _.options.nextArrow )) { 19203 _.$nextArrow.remove(); 19204 } 19205 } 19206 19207 19208 if (_.$slides) { 19209 19210 _.$slides 19211 .removeClass('slick-slide slick-active slick-center slick-visible slick-current') 19212 .removeAttr('aria-hidden') 19213 .removeAttr('data-slick-index') 19214 .each(function(){ 19215 $(this).attr('style', $(this).data('originalStyling')); 19216 }); 19217 19218 _.$slideTrack.children(this.options.slide).detach(); 19219 19220 _.$slideTrack.detach(); 19221 19222 _.$list.detach(); 19223 19224 _.$slider.append(_.$slides); 19225 } 19226 19227 _.cleanUpRows(); 19228 19229 _.$slider.removeClass('slick-slider'); 19230 _.$slider.removeClass('slick-initialized'); 19231 _.$slider.removeClass('slick-dotted'); 19232 19233 _.unslicked = true; 19234 19235 if(!refresh) { 19236 _.$slider.trigger('destroy', [_]); 19237 } 19238 19239 }; 19240 19241 Slick.prototype.disableTransition = function(slide) { 19242 19243 var _ = this, 19244 transition = {}; 19245 19246 transition[_.transitionType] = ''; 19247 19248 if (_.options.fade === false) { 19249 _.$slideTrack.css(transition); 19250 } else { 19251 _.$slides.eq(slide).css(transition); 19252 } 19253 19254 }; 19255 19256 Slick.prototype.fadeSlide = function(slideIndex, callback) { 19257 19258 var _ = this; 19259 19260 if (_.cssTransitions === false) { 19261 19262 _.$slides.eq(slideIndex).css({ 19263 zIndex: _.options.zIndex 19264 }); 19265 19266 _.$slides.eq(slideIndex).animate({ 19267 opacity: 1 19268 }, _.options.speed, _.options.easing, callback); 19269 19270 } else { 19271 19272 _.applyTransition(slideIndex); 19273 19274 _.$slides.eq(slideIndex).css({ 19275 opacity: 1, 19276 zIndex: _.options.zIndex 19277 }); 19278 19279 if (callback) { 19280 setTimeout(function() { 19281 19282 _.disableTransition(slideIndex); 19283 19284 callback.call(); 19285 }, _.options.speed); 19286 } 19287 19288 } 19289 19290 }; 19291 19292 Slick.prototype.fadeSlideOut = function(slideIndex) { 19293 19294 var _ = this; 19295 19296 if (_.cssTransitions === false) { 19297 19298 _.$slides.eq(slideIndex).animate({ 19299 opacity: 0, 19300 zIndex: _.options.zIndex - 2 19301 }, _.options.speed, _.options.easing); 19302 19303 } else { 19304 19305 _.applyTransition(slideIndex); 19306 19307 _.$slides.eq(slideIndex).css({ 19308 opacity: 0, 19309 zIndex: _.options.zIndex - 2 19310 }); 19311 19312 } 19313 19314 }; 19315 19316 Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) { 19317 19318 var _ = this; 19319 19320 if (filter !== null) { 19321 19322 _.$slidesCache = _.$slides; 19323 19324 _.unload(); 19325 19326 _.$slideTrack.children(this.options.slide).detach(); 19327 19328 _.$slidesCache.filter(filter).appendTo(_.$slideTrack); 19329 19330 _.reinit(); 19331 19332 } 19333 19334 }; 19335 19336 Slick.prototype.focusHandler = function() { 19337 19338 var _ = this; 19339 19340 _.$slider 19341 .off('focus.slick blur.slick') 19342 .on('focus.slick blur.slick', '*', function(event) { 19343 19344 event.stopImmediatePropagation(); 19345 var $sf = $(this); 19346 19347 setTimeout(function() { 19348 19349 if( _.options.pauseOnFocus ) { 19350 _.focussed = $sf.is(':focus'); 19351 _.autoPlay(); 19352 } 19353 19354 }, 0); 19355 19356 }); 19357 }; 19358 19359 Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() { 19360 19361 var _ = this; 19362 return _.currentSlide; 19363 19364 }; 19365 19366 Slick.prototype.getDotCount = function() { 19367 19368 var _ = this; 19369 19370 var breakPoint = 0; 19371 var counter = 0; 19372 var pagerQty = 0; 19373 19374 if (_.options.infinite === true) { 19375 if (_.slideCount <= _.options.slidesToShow) { 19376 ++pagerQty; 19377 } else { 19378 while (breakPoint < _.slideCount) { 19379 ++pagerQty; 19380 breakPoint = counter + _.options.slidesToScroll; 19381 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 19382 } 19383 } 19384 } else if (_.options.centerMode === true) { 19385 pagerQty = _.slideCount; 19386 } else if(!_.options.asNavFor) { 19387 pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll); 19388 }else { 19389 while (breakPoint < _.slideCount) { 19390 ++pagerQty; 19391 breakPoint = counter + _.options.slidesToScroll; 19392 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 19393 } 19394 } 19395 19396 return pagerQty - 1; 19397 19398 }; 19399 19400 Slick.prototype.getLeft = function(slideIndex) { 19401 19402 var _ = this, 19403 targetLeft, 19404 verticalHeight, 19405 verticalOffset = 0, 19406 targetSlide, 19407 coef; 19408 19409 _.slideOffset = 0; 19410 verticalHeight = _.$slides.first().outerHeight(true); 19411 19412 if (_.options.infinite === true) { 19413 if (_.slideCount > _.options.slidesToShow) { 19414 _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1; 19415 coef = -1 19416 19417 if (_.options.vertical === true && _.options.centerMode === true) { 19418 if (_.options.slidesToShow === 2) { 19419 coef = -1.5; 19420 } else if (_.options.slidesToShow === 1) { 19421 coef = -2 19422 } 19423 } 19424 verticalOffset = (verticalHeight * _.options.slidesToShow) * coef; 19425 } 19426 if (_.slideCount % _.options.slidesToScroll !== 0) { 19427 if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) { 19428 if (slideIndex > _.slideCount) { 19429 _.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1; 19430 verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1; 19431 } else { 19432 _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1; 19433 verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1; 19434 } 19435 } 19436 } 19437 } else { 19438 if (slideIndex + _.options.slidesToShow > _.slideCount) { 19439 _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth; 19440 verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight; 19441 } 19442 } 19443 19444 if (_.slideCount <= _.options.slidesToShow) { 19445 _.slideOffset = 0; 19446 verticalOffset = 0; 19447 } 19448 19449 if (_.options.centerMode === true && _.slideCount <= _.options.slidesToShow) { 19450 _.slideOffset = ((_.slideWidth * Math.floor(_.options.slidesToShow)) / 2) - ((_.slideWidth * _.slideCount) / 2); 19451 } else if (_.options.centerMode === true && _.options.infinite === true) { 19452 _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth; 19453 } else if (_.options.centerMode === true) { 19454 _.slideOffset = 0; 19455 _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2); 19456 } 19457 19458 if (_.options.vertical === false) { 19459 targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset; 19460 } else { 19461 targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset; 19462 } 19463 19464 if (_.options.variableWidth === true) { 19465 19466 if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { 19467 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); 19468 } else { 19469 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow); 19470 } 19471 19472 if (_.options.rtl === true) { 19473 if (targetSlide[0]) { 19474 targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; 19475 } else { 19476 targetLeft = 0; 19477 } 19478 } else { 19479 targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; 19480 } 19481 19482 if (_.options.centerMode === true) { 19483 if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { 19484 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); 19485 } else { 19486 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1); 19487 } 19488 19489 if (_.options.rtl === true) { 19490 if (targetSlide[0]) { 19491 targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; 19492 } else { 19493 targetLeft = 0; 19494 } 19495 } else { 19496 targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; 19497 } 19498 19499 targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2; 19500 } 19501 } 19502 19503 return targetLeft; 19504 19505 }; 19506 19507 Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) { 19508 19509 var _ = this; 19510 19511 return _.options[option]; 19512 19513 }; 19514 19515 Slick.prototype.getNavigableIndexes = function() { 19516 19517 var _ = this, 19518 breakPoint = 0, 19519 counter = 0, 19520 indexes = [], 19521 max; 19522 19523 if (_.options.infinite === false) { 19524 max = _.slideCount; 19525 } else { 19526 breakPoint = _.options.slidesToScroll * -1; 19527 counter = _.options.slidesToScroll * -1; 19528 max = _.slideCount * 2; 19529 } 19530 19531 while (breakPoint < max) { 19532 indexes.push(breakPoint); 19533 breakPoint = counter + _.options.slidesToScroll; 19534 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 19535 } 19536 19537 return indexes; 19538 19539 }; 19540 19541 Slick.prototype.getSlick = function() { 19542 19543 return this; 19544 19545 }; 19546 19547 Slick.prototype.getSlideCount = function() { 19548 19549 var _ = this, 19550 slidesTraversed, swipedSlide, centerOffset; 19551 19552 centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0; 19553 19554 if (_.options.swipeToSlide === true) { 19555 _.$slideTrack.find('.slick-slide').each(function(index, slide) { 19556 if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) { 19557 swipedSlide = slide; 19558 return false; 19559 } 19560 }); 19561 19562 slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1; 19563 19564 return slidesTraversed; 19565 19566 } else { 19567 return _.options.slidesToScroll; 19568 } 19569 19570 }; 19571 19572 Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) { 19573 19574 var _ = this; 19575 19576 _.changeSlide({ 19577 data: { 19578 message: 'index', 19579 index: parseInt(slide) 19580 } 19581 }, dontAnimate); 19582 19583 }; 19584 19585 Slick.prototype.init = function(creation) { 19586 19587 var _ = this; 19588 19589 if (!$(_.$slider).hasClass('slick-initialized')) { 19590 19591 $(_.$slider).addClass('slick-initialized'); 19592 19593 _.buildRows(); 19594 _.buildOut(); 19595 _.setProps(); 19596 _.startLoad(); 19597 _.loadSlider(); 19598 _.initializeEvents(); 19599 _.updateArrows(); 19600 _.updateDots(); 19601 _.checkResponsive(true); 19602 _.focusHandler(); 19603 19604 } 19605 19606 if (creation) { 19607 _.$slider.trigger('init', [_]); 19608 } 19609 19610 if (_.options.accessibility === true) { 19611 _.initADA(); 19612 } 19613 19614 if ( _.options.autoplay ) { 19615 19616 _.paused = false; 19617 _.autoPlay(); 19618 19619 } 19620 19621 }; 19622 19623 Slick.prototype.initADA = function() { 19624 var _ = this, 19625 numDotGroups = Math.ceil(_.slideCount / _.options.slidesToShow), 19626 tabControlIndexes = _.getNavigableIndexes().filter(function(val) { 19627 return (val >= 0) && (val < _.slideCount); 19628 }); 19629 19630 _.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({ 19631 'aria-hidden': 'true', 19632 'tabindex': '-1' 19633 }).find('a, input, button, select').attr({ 19634 'tabindex': '-1' 19635 }); 19636 19637 if (_.$dots !== null) { 19638 _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) { 19639 var slideControlIndex = tabControlIndexes.indexOf(i); 19640 19641 $(this).attr({ 19642 'role': 'tabpanel', 19643 'id': 'slick-slide' + _.instanceUid + i, 19644 'tabindex': -1 19645 }); 19646 19647 if (slideControlIndex !== -1) { 19648 var ariaButtonControl = 'slick-slide-control' + _.instanceUid + slideControlIndex 19649 if ($('#' + ariaButtonControl).length) { 19650 $(this).attr({ 19651 'aria-describedby': ariaButtonControl 19652 }); 19653 } 19654 } 19655 }); 19656 19657 _.$dots.attr('role', 'tablist').find('li').each(function(i) { 19658 var mappedSlideIndex = tabControlIndexes[i]; 19659 19660 $(this).attr({ 19661 'role': 'presentation' 19662 }); 19663 19664 $(this).find('button').first().attr({ 19665 'role': 'tab', 19666 'id': 'slick-slide-control' + _.instanceUid + i, 19667 'aria-controls': 'slick-slide' + _.instanceUid + mappedSlideIndex, 19668 'aria-label': (i + 1) + ' of ' + numDotGroups, 19669 'aria-selected': null, 19670 'tabindex': '-1' 19671 }); 19672 19673 }).eq(_.currentSlide).find('button').attr({ 19674 'aria-selected': 'true', 19675 'tabindex': '0' 19676 }).end(); 19677 } 19678 19679 for (var i=_.currentSlide, max=i+_.options.slidesToShow; i < max; i++) { 19680 if (_.options.focusOnChange) { 19681 _.$slides.eq(i).attr({'tabindex': '0'}); 19682 } else { 19683 _.$slides.eq(i).removeAttr('tabindex'); 19684 } 19685 } 19686 19687 _.activateADA(); 19688 19689 }; 19690 19691 Slick.prototype.initArrowEvents = function() { 19692 19693 var _ = this; 19694 19695 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 19696 _.$prevArrow 19697 .off('click.slick') 19698 .on('click.slick', { 19699 message: 'previous' 19700 }, _.changeSlide); 19701 _.$nextArrow 19702 .off('click.slick') 19703 .on('click.slick', { 19704 message: 'next' 19705 }, _.changeSlide); 19706 19707 if (_.options.accessibility === true) { 19708 _.$prevArrow.on('keydown.slick', _.keyHandler); 19709 _.$nextArrow.on('keydown.slick', _.keyHandler); 19710 } 19711 } 19712 19713 }; 19714 19715 Slick.prototype.initDotEvents = function() { 19716 19717 var _ = this; 19718 19719 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 19720 $('li', _.$dots).on('click.slick', { 19721 message: 'index' 19722 }, _.changeSlide); 19723 19724 if (_.options.accessibility === true) { 19725 _.$dots.on('keydown.slick', _.keyHandler); 19726 } 19727 } 19728 19729 if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.slideCount > _.options.slidesToShow) { 19730 19731 $('li', _.$dots) 19732 .on('mouseenter.slick', $.proxy(_.interrupt, _, true)) 19733 .on('mouseleave.slick', $.proxy(_.interrupt, _, false)); 19734 19735 } 19736 19737 }; 19738 19739 Slick.prototype.initSlideEvents = function() { 19740 19741 var _ = this; 19742 19743 if ( _.options.pauseOnHover ) { 19744 19745 _.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true)); 19746 _.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false)); 19747 19748 } 19749 19750 }; 19751 19752 Slick.prototype.initializeEvents = function() { 19753 19754 var _ = this; 19755 19756 _.initArrowEvents(); 19757 19758 _.initDotEvents(); 19759 _.initSlideEvents(); 19760 19761 _.$list.on('touchstart.slick mousedown.slick', { 19762 action: 'start' 19763 }, _.swipeHandler); 19764 _.$list.on('touchmove.slick mousemove.slick', { 19765 action: 'move' 19766 }, _.swipeHandler); 19767 _.$list.on('touchend.slick mouseup.slick', { 19768 action: 'end' 19769 }, _.swipeHandler); 19770 _.$list.on('touchcancel.slick mouseleave.slick', { 19771 action: 'end' 19772 }, _.swipeHandler); 19773 19774 _.$list.on('click.slick', _.clickHandler); 19775 19776 $(document).on(_.visibilityChange, $.proxy(_.visibility, _)); 19777 19778 if (_.options.accessibility === true) { 19779 _.$list.on('keydown.slick', _.keyHandler); 19780 } 19781 19782 if (_.options.focusOnSelect === true) { 19783 $(_.$slideTrack).children().on('click.slick', _.selectHandler); 19784 } 19785 19786 $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _)); 19787 19788 $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _)); 19789 19790 $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault); 19791 19792 $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition); 19793 $(_.setPosition); 19794 19795 }; 19796 19797 Slick.prototype.initUI = function() { 19798 19799 var _ = this; 19800 19801 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 19802 19803 _.$prevArrow.show(); 19804 _.$nextArrow.show(); 19805 19806 } 19807 19808 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 19809 19810 _.$dots.show(); 19811 19812 } 19813 19814 }; 19815 19816 Slick.prototype.keyHandler = function(event) { 19817 19818 var _ = this; 19819 //Dont slide if the cursor is inside the form fields and arrow keys are pressed 19820 if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) { 19821 if (event.keyCode === 37 && _.options.accessibility === true) { 19822 _.changeSlide({ 19823 data: { 19824 message: _.options.rtl === true ? 'next' : 'previous' 19825 } 19826 }); 19827 } else if (event.keyCode === 39 && _.options.accessibility === true) { 19828 _.changeSlide({ 19829 data: { 19830 message: _.options.rtl === true ? 'previous' : 'next' 19831 } 19832 }); 19833 } 19834 } 19835 19836 }; 19837 19838 Slick.prototype.lazyLoad = function() { 19839 19840 var _ = this, 19841 loadRange, cloneRange, rangeStart, rangeEnd; 19842 19843 function loadImages(imagesScope) { 19844 19845 $('img[data-lazy]', imagesScope).each(function() { 19846 19847 var image = $(this), 19848 imageSource = $(this).attr('data-lazy'), 19849 imageSrcSet = $(this).attr('data-srcset'), 19850 imageSizes = $(this).attr('data-sizes') || _.$slider.attr('data-sizes'), 19851 imageToLoad = document.createElement('img'); 19852 19853 imageToLoad.onload = function() { 19854 19855 image 19856 .animate({ opacity: 0 }, 100, function() { 19857 19858 if (imageSrcSet) { 19859 image 19860 .attr('srcset', imageSrcSet ); 19861 19862 if (imageSizes) { 19863 image 19864 .attr('sizes', imageSizes ); 19865 } 19866 } 19867 19868 image 19869 .attr('src', imageSource) 19870 .animate({ opacity: 1 }, 200, function() { 19871 image 19872 .removeAttr('data-lazy data-srcset data-sizes') 19873 .removeClass('slick-loading'); 19874 }); 19875 _.$slider.trigger('lazyLoaded', [_, image, imageSource]); 19876 }); 19877 19878 }; 19879 19880 imageToLoad.onerror = function() { 19881 19882 image 19883 .removeAttr( 'data-lazy' ) 19884 .removeClass( 'slick-loading' ) 19885 .addClass( 'slick-lazyload-error' ); 19886 19887 _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]); 19888 19889 }; 19890 19891 imageToLoad.src = imageSource; 19892 19893 }); 19894 19895 } 19896 19897 if (_.options.centerMode === true) { 19898 if (_.options.infinite === true) { 19899 rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1); 19900 rangeEnd = rangeStart + _.options.slidesToShow + 2; 19901 } else { 19902 rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1)); 19903 rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide; 19904 } 19905 } else { 19906 rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide; 19907 rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow); 19908 if (_.options.fade === true) { 19909 if (rangeStart > 0) rangeStart--; 19910 if (rangeEnd <= _.slideCount) rangeEnd++; 19911 } 19912 } 19913 19914 loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd); 19915 19916 if (_.options.lazyLoad === 'anticipated') { 19917 var prevSlide = rangeStart - 1, 19918 nextSlide = rangeEnd, 19919 $slides = _.$slider.find('.slick-slide'); 19920 19921 for (var i = 0; i < _.options.slidesToScroll; i++) { 19922 if (prevSlide < 0) prevSlide = _.slideCount - 1; 19923 loadRange = loadRange.add($slides.eq(prevSlide)); 19924 loadRange = loadRange.add($slides.eq(nextSlide)); 19925 prevSlide--; 19926 nextSlide++; 19927 } 19928 } 19929 19930 loadImages(loadRange); 19931 19932 if (_.slideCount <= _.options.slidesToShow) { 19933 cloneRange = _.$slider.find('.slick-slide'); 19934 loadImages(cloneRange); 19935 } else 19936 if (_.currentSlide >= _.slideCount - _.options.slidesToShow) { 19937 cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow); 19938 loadImages(cloneRange); 19939 } else if (_.currentSlide === 0) { 19940 cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1); 19941 loadImages(cloneRange); 19942 } 19943 19944 }; 19945 19946 Slick.prototype.loadSlider = function() { 19947 19948 var _ = this; 19949 19950 _.setPosition(); 19951 19952 _.$slideTrack.css({ 19953 opacity: 1 19954 }); 19955 19956 _.$slider.removeClass('slick-loading'); 19957 19958 _.initUI(); 19959 19960 if (_.options.lazyLoad === 'progressive') { 19961 _.progressiveLazyLoad(); 19962 } 19963 19964 }; 19965 19966 Slick.prototype.next = Slick.prototype.slickNext = function() { 19967 19968 var _ = this; 19969 19970 _.changeSlide({ 19971 data: { 19972 message: 'next' 19973 } 19974 }); 19975 19976 }; 19977 19978 Slick.prototype.orientationChange = function() { 19979 19980 var _ = this; 19981 19982 _.checkResponsive(); 19983 _.setPosition(); 19984 19985 }; 19986 19987 Slick.prototype.pause = Slick.prototype.slickPause = function() { 19988 19989 var _ = this; 19990 19991 _.autoPlayClear(); 19992 _.paused = true; 19993 19994 }; 19995 19996 Slick.prototype.play = Slick.prototype.slickPlay = function() { 19997 19998 var _ = this; 19999 20000 _.autoPlay(); 20001 _.options.autoplay = true; 20002 _.paused = false; 20003 _.focussed = false; 20004 _.interrupted = false; 20005 20006 }; 20007 20008 Slick.prototype.postSlide = function(index) { 20009 20010 var _ = this; 20011 20012 if( !_.unslicked ) { 20013 20014 _.$slider.trigger('afterChange', [_, index]); 20015 20016 _.animating = false; 20017 20018 if (_.slideCount > _.options.slidesToShow) { 20019 _.setPosition(); 20020 } 20021 20022 _.swipeLeft = null; 20023 20024 if ( _.options.autoplay ) { 20025 _.autoPlay(); 20026 } 20027 20028 if (_.options.accessibility === true) { 20029 _.initADA(); 20030 20031 if (_.options.focusOnChange) { 20032 var $currentSlide = $(_.$slides.get(_.currentSlide)); 20033 $currentSlide.attr('tabindex', 0).focus(); 20034 } 20035 } 20036 20037 } 20038 20039 }; 20040 20041 Slick.prototype.prev = Slick.prototype.slickPrev = function() { 20042 20043 var _ = this; 20044 20045 _.changeSlide({ 20046 data: { 20047 message: 'previous' 20048 } 20049 }); 20050 20051 }; 20052 20053 Slick.prototype.preventDefault = function(event) { 20054 20055 event.preventDefault(); 20056 20057 }; 20058 20059 Slick.prototype.progressiveLazyLoad = function( tryCount ) { 20060 20061 tryCount = tryCount || 1; 20062 20063 var _ = this, 20064 $imgsToLoad = $( 'img[data-lazy]', _.$slider ), 20065 image, 20066 imageSource, 20067 imageSrcSet, 20068 imageSizes, 20069 imageToLoad; 20070 20071 if ( $imgsToLoad.length ) { 20072 20073 image = $imgsToLoad.first(); 20074 imageSource = image.attr('data-lazy'); 20075 imageSrcSet = image.attr('data-srcset'); 20076 imageSizes = image.attr('data-sizes') || _.$slider.attr('data-sizes'); 20077 imageToLoad = document.createElement('img'); 20078 20079 imageToLoad.onload = function() { 20080 20081 if (imageSrcSet) { 20082 image 20083 .attr('srcset', imageSrcSet ); 20084 20085 if (imageSizes) { 20086 image 20087 .attr('sizes', imageSizes ); 20088 } 20089 } 20090 20091 image 20092 .attr( 'src', imageSource ) 20093 .removeAttr('data-lazy data-srcset data-sizes') 20094 .removeClass('slick-loading'); 20095 20096 if ( _.options.adaptiveHeight === true ) { 20097 _.setPosition(); 20098 } 20099 20100 _.$slider.trigger('lazyLoaded', [ _, image, imageSource ]); 20101 _.progressiveLazyLoad(); 20102 20103 }; 20104 20105 imageToLoad.onerror = function() { 20106 20107 if ( tryCount < 3 ) { 20108 20109 /** 20110 * try to load the image 3 times, 20111 * leave a slight delay so we don't get 20112 * servers blocking the request. 20113 */ 20114 setTimeout( function() { 20115 _.progressiveLazyLoad( tryCount + 1 ); 20116 }, 500 ); 20117 20118 } else { 20119 20120 image 20121 .removeAttr( 'data-lazy' ) 20122 .removeClass( 'slick-loading' ) 20123 .addClass( 'slick-lazyload-error' ); 20124 20125 _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]); 20126 20127 _.progressiveLazyLoad(); 20128 20129 } 20130 20131 }; 20132 20133 imageToLoad.src = imageSource; 20134 20135 } else { 20136 20137 _.$slider.trigger('allImagesLoaded', [ _ ]); 20138 20139 } 20140 20141 }; 20142 20143 Slick.prototype.refresh = function( initializing ) { 20144 20145 var _ = this, currentSlide, lastVisibleIndex; 20146 20147 lastVisibleIndex = _.slideCount - _.options.slidesToShow; 20148 20149 // in non-infinite sliders, we don't want to go past the 20150 // last visible index. 20151 if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) { 20152 _.currentSlide = lastVisibleIndex; 20153 } 20154 20155 // if less slides than to show, go to start. 20156 if ( _.slideCount <= _.options.slidesToShow ) { 20157 _.currentSlide = 0; 20158 20159 } 20160 20161 currentSlide = _.currentSlide; 20162 20163 _.destroy(true); 20164 20165 $.extend(_, _.initials, { currentSlide: currentSlide }); 20166 20167 _.init(); 20168 20169 if( !initializing ) { 20170 20171 _.changeSlide({ 20172 data: { 20173 message: 'index', 20174 index: currentSlide 20175 } 20176 }, false); 20177 20178 } 20179 20180 }; 20181 20182 Slick.prototype.registerBreakpoints = function() { 20183 20184 var _ = this, breakpoint, currentBreakpoint, l, 20185 responsiveSettings = _.options.responsive || null; 20186 20187 if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) { 20188 20189 _.respondTo = _.options.respondTo || 'window'; 20190 20191 for ( breakpoint in responsiveSettings ) { 20192 20193 l = _.breakpoints.length-1; 20194 20195 if (responsiveSettings.hasOwnProperty(breakpoint)) { 20196 currentBreakpoint = responsiveSettings[breakpoint].breakpoint; 20197 20198 // loop through the breakpoints and cut out any existing 20199 // ones with the same breakpoint number, we don't want dupes. 20200 while( l >= 0 ) { 20201 if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) { 20202 _.breakpoints.splice(l,1); 20203 } 20204 l--; 20205 } 20206 20207 _.breakpoints.push(currentBreakpoint); 20208 _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings; 20209 20210 } 20211 20212 } 20213 20214 _.breakpoints.sort(function(a, b) { 20215 return ( _.options.mobileFirst ) ? a-b : b-a; 20216 }); 20217 20218 } 20219 20220 }; 20221 20222 Slick.prototype.reinit = function() { 20223 20224 var _ = this; 20225 20226 _.$slides = 20227 _.$slideTrack 20228 .children(_.options.slide) 20229 .addClass('slick-slide'); 20230 20231 _.slideCount = _.$slides.length; 20232 20233 if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) { 20234 _.currentSlide = _.currentSlide - _.options.slidesToScroll; 20235 } 20236 20237 if (_.slideCount <= _.options.slidesToShow) { 20238 _.currentSlide = 0; 20239 } 20240 20241 _.registerBreakpoints(); 20242 20243 _.setProps(); 20244 _.setupInfinite(); 20245 _.buildArrows(); 20246 _.updateArrows(); 20247 _.initArrowEvents(); 20248 _.buildDots(); 20249 _.updateDots(); 20250 _.initDotEvents(); 20251 _.cleanUpSlideEvents(); 20252 _.initSlideEvents(); 20253 20254 _.checkResponsive(false, true); 20255 20256 if (_.options.focusOnSelect === true) { 20257 $(_.$slideTrack).children().on('click.slick', _.selectHandler); 20258 } 20259 20260 _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); 20261 20262 _.setPosition(); 20263 _.focusHandler(); 20264 20265 _.paused = !_.options.autoplay; 20266 _.autoPlay(); 20267 20268 _.$slider.trigger('reInit', [_]); 20269 20270 }; 20271 20272 Slick.prototype.resize = function() { 20273 20274 var _ = this; 20275 20276 if ($(window).width() !== _.windowWidth) { 20277 clearTimeout(_.windowDelay); 20278 _.windowDelay = window.setTimeout(function() { 20279 _.windowWidth = $(window).width(); 20280 _.checkResponsive(); 20281 if( !_.unslicked ) { _.setPosition(); } 20282 }, 50); 20283 } 20284 }; 20285 20286 Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) { 20287 20288 var _ = this; 20289 20290 if (typeof(index) === 'boolean') { 20291 removeBefore = index; 20292 index = removeBefore === true ? 0 : _.slideCount - 1; 20293 } else { 20294 index = removeBefore === true ? --index : index; 20295 } 20296 20297 if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) { 20298 return false; 20299 } 20300 20301 _.unload(); 20302 20303 if (removeAll === true) { 20304 _.$slideTrack.children().remove(); 20305 } else { 20306 _.$slideTrack.children(this.options.slide).eq(index).remove(); 20307 } 20308 20309 _.$slides = _.$slideTrack.children(this.options.slide); 20310 20311 _.$slideTrack.children(this.options.slide).detach(); 20312 20313 _.$slideTrack.append(_.$slides); 20314 20315 _.$slidesCache = _.$slides; 20316 20317 _.reinit(); 20318 20319 }; 20320 20321 Slick.prototype.setCSS = function(position) { 20322 20323 var _ = this, 20324 positionProps = {}, 20325 x, y; 20326 20327 if (_.options.rtl === true) { 20328 position = -position; 20329 } 20330 x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px'; 20331 y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px'; 20332 20333 positionProps[_.positionProp] = position; 20334 20335 if (_.transformsEnabled === false) { 20336 _.$slideTrack.css(positionProps); 20337 } else { 20338 positionProps = {}; 20339 if (_.cssTransitions === false) { 20340 positionProps[_.animType] = 'translate(' + x + ', ' + y + ')'; 20341 _.$slideTrack.css(positionProps); 20342 } else { 20343 positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)'; 20344 _.$slideTrack.css(positionProps); 20345 } 20346 } 20347 20348 }; 20349 20350 Slick.prototype.setDimensions = function() { 20351 20352 var _ = this; 20353 20354 if (_.options.vertical === false) { 20355 if (_.options.centerMode === true) { 20356 _.$list.css({ 20357 padding: ('0px ' + _.options.centerPadding) 20358 }); 20359 } 20360 } else { 20361 _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow); 20362 if (_.options.centerMode === true) { 20363 _.$list.css({ 20364 padding: (_.options.centerPadding + ' 0px') 20365 }); 20366 } 20367 } 20368 20369 _.listWidth = _.$list.width(); 20370 _.listHeight = _.$list.height(); 20371 20372 20373 if (_.options.vertical === false && _.options.variableWidth === false) { 20374 _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow); 20375 _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length))); 20376 20377 } else if (_.options.variableWidth === true) { 20378 _.$slideTrack.width(5000 * _.slideCount); 20379 } else { 20380 _.slideWidth = Math.ceil(_.listWidth); 20381 _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length))); 20382 } 20383 20384 var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width(); 20385 if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset); 20386 20387 }; 20388 20389 Slick.prototype.setFade = function() { 20390 20391 var _ = this, 20392 targetLeft; 20393 20394 _.$slides.each(function(index, element) { 20395 targetLeft = (_.slideWidth * index) * -1; 20396 if (_.options.rtl === true) { 20397 $(element).css({ 20398 position: 'relative', 20399 right: targetLeft, 20400 top: 0, 20401 zIndex: _.options.zIndex - 2, 20402 opacity: 0 20403 }); 20404 } else { 20405 $(element).css({ 20406 position: 'relative', 20407 left: targetLeft, 20408 top: 0, 20409 zIndex: _.options.zIndex - 2, 20410 opacity: 0 20411 }); 20412 } 20413 }); 20414 20415 _.$slides.eq(_.currentSlide).css({ 20416 zIndex: _.options.zIndex - 1, 20417 opacity: 1 20418 }); 20419 20420 }; 20421 20422 Slick.prototype.setHeight = function() { 20423 20424 var _ = this; 20425 20426 if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { 20427 var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); 20428 _.$list.css('height', targetHeight); 20429 } 20430 20431 }; 20432 20433 Slick.prototype.setOption = 20434 Slick.prototype.slickSetOption = function() { 20435 20436 /** 20437 * accepts arguments in format of: 20438 * 20439 * - for changing a single option's value: 20440 * .slick("setOption", option, value, refresh ) 20441 * 20442 * - for changing a set of responsive options: 20443 * .slick("setOption", 'responsive', [{}, ...], refresh ) 20444 * 20445 * - for updating multiple values at once (not responsive) 20446 * .slick("setOption", { 'option': value, ... }, refresh ) 20447 */ 20448 20449 var _ = this, l, item, option, value, refresh = false, type; 20450 20451 if( $.type( arguments[0] ) === 'object' ) { 20452 20453 option = arguments[0]; 20454 refresh = arguments[1]; 20455 type = 'multiple'; 20456 20457 } else if ( $.type( arguments[0] ) === 'string' ) { 20458 20459 option = arguments[0]; 20460 value = arguments[1]; 20461 refresh = arguments[2]; 20462 20463 if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) { 20464 20465 type = 'responsive'; 20466 20467 } else if ( typeof arguments[1] !== 'undefined' ) { 20468 20469 type = 'single'; 20470 20471 } 20472 20473 } 20474 20475 if ( type === 'single' ) { 20476 20477 _.options[option] = value; 20478 20479 20480 } else if ( type === 'multiple' ) { 20481 20482 $.each( option , function( opt, val ) { 20483 20484 _.options[opt] = val; 20485 20486 }); 20487 20488 20489 } else if ( type === 'responsive' ) { 20490 20491 for ( item in value ) { 20492 20493 if( $.type( _.options.responsive ) !== 'array' ) { 20494 20495 _.options.responsive = [ value[item] ]; 20496 20497 } else { 20498 20499 l = _.options.responsive.length-1; 20500 20501 // loop through the responsive object and splice out duplicates. 20502 while( l >= 0 ) { 20503 20504 if( _.options.responsive[l].breakpoint === value[item].breakpoint ) { 20505 20506 _.options.responsive.splice(l,1); 20507 20508 } 20509 20510 l--; 20511 20512 } 20513 20514 _.options.responsive.push( value[item] ); 20515 20516 } 20517 20518 } 20519 20520 } 20521 20522 if ( refresh ) { 20523 20524 _.unload(); 20525 _.reinit(); 20526 20527 } 20528 20529 }; 20530 20531 Slick.prototype.setPosition = function() { 20532 20533 var _ = this; 20534 20535 _.setDimensions(); 20536 20537 _.setHeight(); 20538 20539 if (_.options.fade === false) { 20540 _.setCSS(_.getLeft(_.currentSlide)); 20541 } else { 20542 _.setFade(); 20543 } 20544 20545 _.$slider.trigger('setPosition', [_]); 20546 20547 }; 20548 20549 Slick.prototype.setProps = function() { 20550 20551 var _ = this, 20552 bodyStyle = document.body.style; 20553 20554 _.positionProp = _.options.vertical === true ? 'top' : 'left'; 20555 20556 if (_.positionProp === 'top') { 20557 _.$slider.addClass('slick-vertical'); 20558 } else { 20559 _.$slider.removeClass('slick-vertical'); 20560 } 20561 20562 if (bodyStyle.WebkitTransition !== undefined || 20563 bodyStyle.MozTransition !== undefined || 20564 bodyStyle.msTransition !== undefined) { 20565 if (_.options.useCSS === true) { 20566 _.cssTransitions = true; 20567 } 20568 } 20569 20570 if ( _.options.fade ) { 20571 if ( typeof _.options.zIndex === 'number' ) { 20572 if( _.options.zIndex < 3 ) { 20573 _.options.zIndex = 3; 20574 } 20575 } else { 20576 _.options.zIndex = _.defaults.zIndex; 20577 } 20578 } 20579 20580 if (bodyStyle.OTransform !== undefined) { 20581 _.animType = 'OTransform'; 20582 _.transformType = '-o-transform'; 20583 _.transitionType = 'OTransition'; 20584 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; 20585 } 20586 if (bodyStyle.MozTransform !== undefined) { 20587 _.animType = 'MozTransform'; 20588 _.transformType = '-moz-transform'; 20589 _.transitionType = 'MozTransition'; 20590 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false; 20591 } 20592 if (bodyStyle.webkitTransform !== undefined) { 20593 _.animType = 'webkitTransform'; 20594 _.transformType = '-webkit-transform'; 20595 _.transitionType = 'webkitTransition'; 20596 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; 20597 } 20598 if (bodyStyle.msTransform !== undefined) { 20599 _.animType = 'msTransform'; 20600 _.transformType = '-ms-transform'; 20601 _.transitionType = 'msTransition'; 20602 if (bodyStyle.msTransform === undefined) _.animType = false; 20603 } 20604 if (bodyStyle.transform !== undefined && _.animType !== false) { 20605 _.animType = 'transform'; 20606 _.transformType = 'transform'; 20607 _.transitionType = 'transition'; 20608 } 20609 _.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false); 20610 }; 20611 20612 20613 Slick.prototype.setSlideClasses = function(index) { 20614 20615 var _ = this, 20616 centerOffset, allSlides, indexOffset, remainder; 20617 20618 allSlides = _.$slider 20619 .find('.slick-slide') 20620 .removeClass('slick-active slick-center slick-current') 20621 .attr('aria-hidden', 'true'); 20622 20623 _.$slides 20624 .eq(index) 20625 .addClass('slick-current'); 20626 20627 if (_.options.centerMode === true) { 20628 20629 var evenCoef = _.options.slidesToShow % 2 === 0 ? 1 : 0; 20630 20631 centerOffset = Math.floor(_.options.slidesToShow / 2); 20632 20633 if (_.options.infinite === true) { 20634 20635 if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) { 20636 _.$slides 20637 .slice(index - centerOffset + evenCoef, index + centerOffset + 1) 20638 .addClass('slick-active') 20639 .attr('aria-hidden', 'false'); 20640 20641 } else { 20642 20643 indexOffset = _.options.slidesToShow + index; 20644 allSlides 20645 .slice(indexOffset - centerOffset + 1 + evenCoef, indexOffset + centerOffset + 2) 20646 .addClass('slick-active') 20647 .attr('aria-hidden', 'false'); 20648 20649 } 20650 20651 if (index === 0) { 20652 20653 allSlides 20654 .eq(allSlides.length - 1 - _.options.slidesToShow) 20655 .addClass('slick-center'); 20656 20657 } else if (index === _.slideCount - 1) { 20658 20659 allSlides 20660 .eq(_.options.slidesToShow) 20661 .addClass('slick-center'); 20662 20663 } 20664 20665 } 20666 20667 _.$slides 20668 .eq(index) 20669 .addClass('slick-center'); 20670 20671 } else { 20672 20673 if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) { 20674 20675 _.$slides 20676 .slice(index, index + _.options.slidesToShow) 20677 .addClass('slick-active') 20678 .attr('aria-hidden', 'false'); 20679 20680 } else if (allSlides.length <= _.options.slidesToShow) { 20681 20682 allSlides 20683 .addClass('slick-active') 20684 .attr('aria-hidden', 'false'); 20685 20686 } else { 20687 20688 remainder = _.slideCount % _.options.slidesToShow; 20689 indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index; 20690 20691 if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) { 20692 20693 allSlides 20694 .slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder) 20695 .addClass('slick-active') 20696 .attr('aria-hidden', 'false'); 20697 20698 } else { 20699 20700 allSlides 20701 .slice(indexOffset, indexOffset + _.options.slidesToShow) 20702 .addClass('slick-active') 20703 .attr('aria-hidden', 'false'); 20704 20705 } 20706 20707 } 20708 20709 } 20710 20711 if (_.options.lazyLoad === 'ondemand' || _.options.lazyLoad === 'anticipated') { 20712 _.lazyLoad(); 20713 } 20714 }; 20715 20716 Slick.prototype.setupInfinite = function() { 20717 20718 var _ = this, 20719 i, slideIndex, infiniteCount; 20720 20721 if (_.options.fade === true) { 20722 _.options.centerMode = false; 20723 } 20724 20725 if (_.options.infinite === true && _.options.fade === false) { 20726 20727 slideIndex = null; 20728 20729 if (_.slideCount > _.options.slidesToShow) { 20730 20731 if (_.options.centerMode === true) { 20732 infiniteCount = _.options.slidesToShow + 1; 20733 } else { 20734 infiniteCount = _.options.slidesToShow; 20735 } 20736 20737 for (i = _.slideCount; i > (_.slideCount - 20738 infiniteCount); i -= 1) { 20739 slideIndex = i - 1; 20740 $(_.$slides[slideIndex]).clone(true).attr('id', '') 20741 .attr('data-slick-index', slideIndex - _.slideCount) 20742 .prependTo(_.$slideTrack).addClass('slick-cloned'); 20743 } 20744 for (i = 0; i < infiniteCount + _.slideCount; i += 1) { 20745 slideIndex = i; 20746 $(_.$slides[slideIndex]).clone(true).attr('id', '') 20747 .attr('data-slick-index', slideIndex + _.slideCount) 20748 .appendTo(_.$slideTrack).addClass('slick-cloned'); 20749 } 20750 _.$slideTrack.find('.slick-cloned').find('[id]').each(function() { 20751 $(this).attr('id', ''); 20752 }); 20753 20754 } 20755 20756 } 20757 20758 }; 20759 20760 Slick.prototype.interrupt = function( toggle ) { 20761 20762 var _ = this; 20763 20764 if( !toggle ) { 20765 _.autoPlay(); 20766 } 20767 _.interrupted = toggle; 20768 20769 }; 20770 20771 Slick.prototype.selectHandler = function(event) { 20772 20773 var _ = this; 20774 20775 var targetElement = 20776 $(event.target).is('.slick-slide') ? 20777 $(event.target) : 20778 $(event.target).parents('.slick-slide'); 20779 20780 var index = parseInt(targetElement.attr('data-slick-index')); 20781 20782 if (!index) index = 0; 20783 20784 if (_.slideCount <= _.options.slidesToShow) { 20785 20786 _.slideHandler(index, false, true); 20787 return; 20788 20789 } 20790 20791 _.slideHandler(index); 20792 20793 }; 20794 20795 Slick.prototype.slideHandler = function(index, sync, dontAnimate) { 20796 20797 var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null, 20798 _ = this, navTarget; 20799 20800 sync = sync || false; 20801 20802 if (_.animating === true && _.options.waitForAnimate === true) { 20803 return; 20804 } 20805 20806 if (_.options.fade === true && _.currentSlide === index) { 20807 return; 20808 } 20809 20810 if (sync === false) { 20811 _.asNavFor(index); 20812 } 20813 20814 targetSlide = index; 20815 targetLeft = _.getLeft(targetSlide); 20816 slideLeft = _.getLeft(_.currentSlide); 20817 20818 _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft; 20819 20820 if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) { 20821 if (_.options.fade === false) { 20822 targetSlide = _.currentSlide; 20823 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 20824 _.animateSlide(slideLeft, function() { 20825 _.postSlide(targetSlide); 20826 }); 20827 } else { 20828 _.postSlide(targetSlide); 20829 } 20830 } 20831 return; 20832 } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) { 20833 if (_.options.fade === false) { 20834 targetSlide = _.currentSlide; 20835 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 20836 _.animateSlide(slideLeft, function() { 20837 _.postSlide(targetSlide); 20838 }); 20839 } else { 20840 _.postSlide(targetSlide); 20841 } 20842 } 20843 return; 20844 } 20845 20846 if ( _.options.autoplay ) { 20847 clearInterval(_.autoPlayTimer); 20848 } 20849 20850 if (targetSlide < 0) { 20851 if (_.slideCount % _.options.slidesToScroll !== 0) { 20852 animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll); 20853 } else { 20854 animSlide = _.slideCount + targetSlide; 20855 } 20856 } else if (targetSlide >= _.slideCount) { 20857 if (_.slideCount % _.options.slidesToScroll !== 0) { 20858 animSlide = 0; 20859 } else { 20860 animSlide = targetSlide - _.slideCount; 20861 } 20862 } else { 20863 animSlide = targetSlide; 20864 } 20865 20866 _.animating = true; 20867 20868 _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]); 20869 20870 oldSlide = _.currentSlide; 20871 _.currentSlide = animSlide; 20872 20873 _.setSlideClasses(_.currentSlide); 20874 20875 if ( _.options.asNavFor ) { 20876 20877 navTarget = _.getNavTarget(); 20878 navTarget = navTarget.slick('getSlick'); 20879 20880 if ( navTarget.slideCount <= navTarget.options.slidesToShow ) { 20881 navTarget.setSlideClasses(_.currentSlide); 20882 } 20883 20884 } 20885 20886 _.updateDots(); 20887 _.updateArrows(); 20888 20889 if (_.options.fade === true) { 20890 if (dontAnimate !== true) { 20891 20892 _.fadeSlideOut(oldSlide); 20893 20894 _.fadeSlide(animSlide, function() { 20895 _.postSlide(animSlide); 20896 }); 20897 20898 } else { 20899 _.postSlide(animSlide); 20900 } 20901 _.animateHeight(); 20902 return; 20903 } 20904 20905 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 20906 _.animateSlide(targetLeft, function() { 20907 _.postSlide(animSlide); 20908 }); 20909 } else { 20910 _.postSlide(animSlide); 20911 } 20912 20913 }; 20914 20915 Slick.prototype.startLoad = function() { 20916 20917 var _ = this; 20918 20919 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 20920 20921 _.$prevArrow.hide(); 20922 _.$nextArrow.hide(); 20923 20924 } 20925 20926 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 20927 20928 _.$dots.hide(); 20929 20930 } 20931 20932 _.$slider.addClass('slick-loading'); 20933 20934 }; 20935 20936 Slick.prototype.swipeDirection = function() { 20937 20938 var xDist, yDist, r, swipeAngle, _ = this; 20939 20940 xDist = _.touchObject.startX - _.touchObject.curX; 20941 yDist = _.touchObject.startY - _.touchObject.curY; 20942 r = Math.atan2(yDist, xDist); 20943 20944 swipeAngle = Math.round(r * 180 / Math.PI); 20945 if (swipeAngle < 0) { 20946 swipeAngle = 360 - Math.abs(swipeAngle); 20947 } 20948 20949 if ((swipeAngle <= 45) && (swipeAngle >= 0)) { 20950 return (_.options.rtl === false ? 'left' : 'right'); 20951 } 20952 if ((swipeAngle <= 360) && (swipeAngle >= 315)) { 20953 return (_.options.rtl === false ? 'left' : 'right'); 20954 } 20955 if ((swipeAngle >= 135) && (swipeAngle <= 225)) { 20956 return (_.options.rtl === false ? 'right' : 'left'); 20957 } 20958 if (_.options.verticalSwiping === true) { 20959 if ((swipeAngle >= 35) && (swipeAngle <= 135)) { 20960 return 'down'; 20961 } else { 20962 return 'up'; 20963 } 20964 } 20965 20966 return 'vertical'; 20967 20968 }; 20969 20970 Slick.prototype.swipeEnd = function(event) { 20971 20972 var _ = this, 20973 slideCount, 20974 direction; 20975 20976 _.dragging = false; 20977 _.swiping = false; 20978 20979 if (_.scrolling) { 20980 _.scrolling = false; 20981 return false; 20982 } 20983 20984 _.interrupted = false; 20985 _.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true; 20986 20987 if ( _.touchObject.curX === undefined ) { 20988 return false; 20989 } 20990 20991 if ( _.touchObject.edgeHit === true ) { 20992 _.$slider.trigger('edge', [_, _.swipeDirection() ]); 20993 } 20994 20995 if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) { 20996 20997 direction = _.swipeDirection(); 20998 20999 switch ( direction ) { 21000 21001 case 'left': 21002 case 'down': 21003 21004 slideCount = 21005 _.options.swipeToSlide ? 21006 _.checkNavigable( _.currentSlide + _.getSlideCount() ) : 21007 _.currentSlide + _.getSlideCount(); 21008 21009 _.currentDirection = 0; 21010 21011 break; 21012 21013 case 'right': 21014 case 'up': 21015 21016 slideCount = 21017 _.options.swipeToSlide ? 21018 _.checkNavigable( _.currentSlide - _.getSlideCount() ) : 21019 _.currentSlide - _.getSlideCount(); 21020 21021 _.currentDirection = 1; 21022 21023 break; 21024 21025 default: 21026 21027 21028 } 21029 21030 if( direction != 'vertical' ) { 21031 21032 _.slideHandler( slideCount ); 21033 _.touchObject = {}; 21034 _.$slider.trigger('swipe', [_, direction ]); 21035 21036 } 21037 21038 } else { 21039 21040 if ( _.touchObject.startX !== _.touchObject.curX ) { 21041 21042 _.slideHandler( _.currentSlide ); 21043 _.touchObject = {}; 21044 21045 } 21046 21047 } 21048 21049 }; 21050 21051 Slick.prototype.swipeHandler = function(event) { 21052 21053 var _ = this; 21054 21055 if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) { 21056 return; 21057 } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) { 21058 return; 21059 } 21060 21061 _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ? 21062 event.originalEvent.touches.length : 1; 21063 21064 _.touchObject.minSwipe = _.listWidth / _.options 21065 .touchThreshold; 21066 21067 if (_.options.verticalSwiping === true) { 21068 _.touchObject.minSwipe = _.listHeight / _.options 21069 .touchThreshold; 21070 } 21071 21072 switch (event.data.action) { 21073 21074 case 'start': 21075 _.swipeStart(event); 21076 break; 21077 21078 case 'move': 21079 _.swipeMove(event); 21080 break; 21081 21082 case 'end': 21083 _.swipeEnd(event); 21084 break; 21085 21086 } 21087 21088 }; 21089 21090 Slick.prototype.swipeMove = function(event) { 21091 21092 var _ = this, 21093 edgeWasHit = false, 21094 curLeft, swipeDirection, swipeLength, positionOffset, touches, verticalSwipeLength; 21095 21096 touches = event.originalEvent !== undefined ? event.originalEvent.touches : null; 21097 21098 if (!_.dragging || _.scrolling || touches && touches.length !== 1) { 21099 return false; 21100 } 21101 21102 curLeft = _.getLeft(_.currentSlide); 21103 21104 _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX; 21105 _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY; 21106 21107 _.touchObject.swipeLength = Math.round(Math.sqrt( 21108 Math.pow(_.touchObject.curX - _.touchObject.startX, 2))); 21109 21110 verticalSwipeLength = Math.round(Math.sqrt( 21111 Math.pow(_.touchObject.curY - _.touchObject.startY, 2))); 21112 21113 if (!_.options.verticalSwiping && !_.swiping && verticalSwipeLength > 4) { 21114 _.scrolling = true; 21115 return false; 21116 } 21117 21118 if (_.options.verticalSwiping === true) { 21119 _.touchObject.swipeLength = verticalSwipeLength; 21120 } 21121 21122 swipeDirection = _.swipeDirection(); 21123 21124 if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) { 21125 _.swiping = true; 21126 event.preventDefault(); 21127 } 21128 21129 positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1); 21130 if (_.options.verticalSwiping === true) { 21131 positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1; 21132 } 21133 21134 21135 swipeLength = _.touchObject.swipeLength; 21136 21137 _.touchObject.edgeHit = false; 21138 21139 if (_.options.infinite === false) { 21140 if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) { 21141 swipeLength = _.touchObject.swipeLength * _.options.edgeFriction; 21142 _.touchObject.edgeHit = true; 21143 } 21144 } 21145 21146 if (_.options.vertical === false) { 21147 _.swipeLeft = curLeft + swipeLength * positionOffset; 21148 } else { 21149 _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset; 21150 } 21151 if (_.options.verticalSwiping === true) { 21152 _.swipeLeft = curLeft + swipeLength * positionOffset; 21153 } 21154 21155 if (_.options.fade === true || _.options.touchMove === false) { 21156 return false; 21157 } 21158 21159 if (_.animating === true) { 21160 _.swipeLeft = null; 21161 return false; 21162 } 21163 21164 _.setCSS(_.swipeLeft); 21165 21166 }; 21167 21168 Slick.prototype.swipeStart = function(event) { 21169 21170 var _ = this, 21171 touches; 21172 21173 _.interrupted = true; 21174 21175 if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) { 21176 _.touchObject = {}; 21177 return false; 21178 } 21179 21180 if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) { 21181 touches = event.originalEvent.touches[0]; 21182 } 21183 21184 _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX; 21185 _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY; 21186 21187 _.dragging = true; 21188 21189 }; 21190 21191 Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() { 21192 21193 var _ = this; 21194 21195 if (_.$slidesCache !== null) { 21196 21197 _.unload(); 21198 21199 _.$slideTrack.children(this.options.slide).detach(); 21200 21201 _.$slidesCache.appendTo(_.$slideTrack); 21202 21203 _.reinit(); 21204 21205 } 21206 21207 }; 21208 21209 Slick.prototype.unload = function() { 21210 21211 var _ = this; 21212 21213 $('.slick-cloned', _.$slider).remove(); 21214 21215 if (_.$dots) { 21216 _.$dots.remove(); 21217 } 21218 21219 if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) { 21220 _.$prevArrow.remove(); 21221 } 21222 21223 if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) { 21224 _.$nextArrow.remove(); 21225 } 21226 21227 _.$slides 21228 .removeClass('slick-slide slick-active slick-visible slick-current') 21229 .attr('aria-hidden', 'true') 21230 .css('width', ''); 21231 21232 }; 21233 21234 Slick.prototype.unslick = function(fromBreakpoint) { 21235 21236 var _ = this; 21237 _.$slider.trigger('unslick', [_, fromBreakpoint]); 21238 _.destroy(); 21239 21240 }; 21241 21242 Slick.prototype.updateArrows = function() { 21243 21244 var _ = this, 21245 centerOffset; 21246 21247 centerOffset = Math.floor(_.options.slidesToShow / 2); 21248 21249 if ( _.options.arrows === true && 21250 _.slideCount > _.options.slidesToShow && 21251 !_.options.infinite ) { 21252 21253 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 21254 _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 21255 21256 if (_.currentSlide === 0) { 21257 21258 _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 21259 _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 21260 21261 } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) { 21262 21263 _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 21264 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 21265 21266 } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) { 21267 21268 _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 21269 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 21270 21271 } 21272 21273 } 21274 21275 }; 21276 21277 Slick.prototype.updateDots = function() { 21278 21279 var _ = this; 21280 21281 if (_.$dots !== null) { 21282 21283 _.$dots 21284 .find('li') 21285 .removeClass('slick-active') 21286 .end(); 21287 21288 _.$dots 21289 .find('li') 21290 .eq(Math.floor(_.currentSlide / _.options.slidesToScroll)) 21291 .addClass('slick-active'); 21292 21293 } 21294 21295 }; 21296 21297 Slick.prototype.visibility = function() { 21298 21299 var _ = this; 21300 21301 if ( _.options.autoplay ) { 21302 21303 if ( document[_.hidden] ) { 21304 21305 _.interrupted = true; 21306 21307 } else { 21308 21309 _.interrupted = false; 21310 21311 } 21312 21313 } 21314 21315 }; 21316 21317 $.fn.slick = function() { 21318 var _ = this, 21319 opt = arguments[0], 21320 args = Array.prototype.slice.call(arguments, 1), 21321 l = _.length, 21322 i, 21323 ret; 21324 for (i = 0; i < l; i++) { 21325 if (typeof opt == 'object' || typeof opt == 'undefined') 21326 _[i].slick = new Slick(_[i], opt); 21327 else 21328 ret = _[i].slick[opt].apply(_[i].slick, args); 21329 if (typeof ret != 'undefined') return ret; 21330 } 21331 return _; 21332 }; 21333 21334})); 21335 21336 21337 21338 /***/ 21339 }, 21340 21341
vendor: 828 bytes, lines 21341-21373
21341/***/ "../node_modules/webpack/buildin/global.js": 21342 /*!*************************************************!*\ 21343 !*** ../node_modules/webpack/buildin/global.js ***! 21344 \*************************************************/ 21345 /*! no static exports found */ 21346 /***/ function (module, exports) { 21347 var g; 21348 21349// This works in non-strict mode 21350g = (function() { 21351 return this; 21352})(); 21353 21354try { 21355 // This works if eval is allowed (see CSP) 21356 g = g || new Function("return this")(); 21357} catch (e) { 21358 // This works if the window reference is available 21359 if (typeof window === "object") g = window; 21360} 21361 21362// g can still be undefined, but nothing to do about it... 21363// We return undefined, instead of nothing here, so it's 21364// easier to handle this case. if(!global) { ...} 21365 21366module.exports = g; 21367 21368 21369 21370 /***/ 21371 }, 21372 21373
21373/***/ "./js/App.js": 21374 /*!*******************!*\ 21375 !*** ./js/App.js ***! 21376 \*******************/ 21377 /*! no exports provided */ 21378 /***/ function (module, __webpack_exports__, __webpack_require__) { 21379 "use strict"; 21380 __webpack_require__.r(__webpack_exports__); 21381/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "../node_modules/jquery/dist/jquery.js"); 21382/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 21383/* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bootstrap */ "../node_modules/bootstrap/dist/js/bootstrap.js"); 21384/* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(bootstrap__WEBPACK_IMPORTED_MODULE_1__); 21385/* harmony import */ var slick_carousel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! slick-carousel */ "../node_modules/slick-carousel/slick/slick.js"); 21386/* harmony import */ var slick_carousel__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(slick_carousel__WEBPACK_IMPORTED_MODULE_2__); 21387/* harmony import */ var slick_carousel_slick_slick_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! slick-carousel/slick/slick.css */ "../node_modules/slick-carousel/slick/slick.css"); 21388/* harmony import */ var slick_carousel_slick_slick_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(slick_carousel_slick_slick_css__WEBPACK_IMPORTED_MODULE_3__); 21389/* harmony import */ var imagesloaded__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! imagesloaded */ "../node_modules/imagesloaded/imagesloaded.js"); 21390/* harmony import */ var imagesloaded__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(imagesloaded__WEBPACK_IMPORTED_MODULE_4__); 21391/* harmony import */ var animation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! animation */ "./js/animation.js"); 21392/* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! cookie */ "./js/cookie.js"); 21393/* harmony import */ var smooth_scroll__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! smooth-scroll */ "./js/smooth-scroll.js"); 21394/* harmony import */ var ajax_listing__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ajax-listing */ "./js/ajax-listing.js"); 21395/* harmony import */ var dropdown_menu__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! dropdown-menu */ "./js/dropdown-menu/index.js"); 21396/* harmony import */ var timeline__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! timeline */ "./js/timeline.js"); 21397/* harmony import */ var letters__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! letters */ "./js/letters.js"); 21398 21399window.$ = jquery__WEBPACK_IMPORTED_MODULE_0___default.a; 21400window.jQuery = jquery__WEBPACK_IMPORTED_MODULE_0___default.a; 21401 21402 21403 21404 21405 21406 21407 21408 21409window.Listing = ajax_listing__WEBPACK_IMPORTED_MODULE_8__["default"]; 21410 21411 21412 21413 21414var App = function ($) { 21415 function handleCookieConsent() { 21416 if (!cookie__WEBPACK_IMPORTED_MODULE_6__["Cookie"].read("cookie:consent")) { 21417 $("#cookie-consent").addClass("active"); 21418 } 21419 21420 $("#cookie-consent button").click(function () { 21421 cookie__WEBPACK_IMPORTED_MODULE_6__["Cookie"].write("cookie
21421:consent", "true"); 21422 $("#cookie-consent").removeClass("active"); 21423 }); 21424 } 21425 21426 function handleSliders() { 21427 $('.slider').each(function () { 21428 var options = { 21429 arrows: false, 21430 dots: false, 21431 slidesToShow: 1, 21432 autoplay: true, 21433 autoplaySpeed: 5000 21434 }; 21435 var $this = $(this); 21436 if ($this.data('slider-height') == "adaptive") $.extend(options, { 21437 adaptiveHeight: true 21438 }); 21439 if ($this.hasClass('slider--dots')) $.extend(options, { 21440 dots: true 21441 }); 21442 if ($this.hasClass('slider--arrows')) $.extend(options, { 21443 arrows: true 21444 }); 21445 if ($this.data('slider-items')) $.extend(options, { 21446 slidesToShow: $this.data('slider-items') 21447 }); 21448 if ($this.data('slider-fade')) $.extend(options, { 21449 fade: true 21450 }); 21451 if ($this.data('slider-asnavfor')) $.extend(options, { 21452 asNavFor: $this.data('slider-asnavfor') 21453 }); 21454 21455 if ($this.data('slider-autoplay') == false) { 21456 $.extend(options, { 21457 autoplay: false 21458 }); 21459 } else { 21460 $.extend(options, { 21461 autoplay: true, 21462 autoplaySpeed: $this.data('slider-autoplay') 21463 }); 21464 } 21465 21466 if ($this.hasClass("slider--service-nav")) { 21467 $.extend(options, { 21468 responsive: [{ 21469 breakpoint: 1789, 21470 settings: { 21471 slidesToShow: 2 21472 } 21473 }, { 21474 breakpoint: 1199, 21475 settings: { 21476 slidesToShow: 3 21477 } 21478 }, { 21479 breakpoint: 998, 21480 settings: { 21481 slidesToShow: 2 21482 } 21483 }, { 21484 breakpoint: 767, 21485 settings: { 21486 slidesToShow: 1 21487 } 21488 }] 21489 }); 21490 } 21491 21492 $this.slick(options); 21493 }); 21494 } 21495 21496 function handleSelect() { 21497 $('.select > select').each(function () { 21498 if ($(this).find(':selected').get(0).hasAttribute('default')) { 21499 $(this).parent().addClass('default-selected'); 21500 } 21501 }); 21502 $('.select > select').on("change", function () { 21503 if ($(this).find(':selected').get(0).hasAttribute('default')) { 21504 $(this).parent().addClass('default-selected'); 21505 } else { 21506 $(this).parent().removeClass('default-selected'); 21507 } 21508 }); 21509 } 21510 21511 function handleFileInput() { 21512 $('.file-input input[type="file"]').on("change", function () { 21513 if (this.value) { 21514 $(this).removeClass("placeholder-shown"); 21515 $(this).siblings('.file-name').html(this.value.replace(/^.*\\/, "")); 21516 } else { 21517 $(this).addClass("placeholder-shown"); 21518 $(this).siblings('.file-name').html("Browse..."); 21519 } 21520 }); 21521 } 21522 21523 function handleSearchDropdown() { 21524 $("#toggle-search").click(function (e) { 21525 e.stopPropagation(); 21526 $(this).toggleClass('search-open'); 21527 $("#header .search-bar").toggleClass('active'); 21528 21529 if ($("#header .search-bar").hasClass('active')) { 21530 $("#header .search-bar input").focus(); 21531 } 21532 }); 21533 $(document).click(function (event) { 21534 if (!$(event.target).closest('#header .search-bar').length) { 21535 if ($(".search-bar").hasClass('active')) { 21536 $(".search-bar").removeClass('active'); 21537 $("#toggle-search").removeClass('search-open'); 21538 } 21539 } 21540 }); 21541 } 21542 21543 function handleSlidebars() { 21544 // Initialize Slidebars 21545 var controller = new slidebars(); 21546 controller.init(); // Toggle Slidebars 21547 21548 $('.open-mobile-nav').on('click', function (event) { 21549 // Stop default action and bubbling 21550 event.stopPropagation(); 21551 event.preventDefault(); // Toggle the Slidebar with id 'id-1' 21552 21553 controller.toggle('id-1'); 21554 }); // Add close class to canvas container when Slidebar is opened 21555 21556 $(controller.events).on('opening', function (event) { 21557 $('[canvas]').addClass('js-close-any'); 21558 $('.js-close-any').on('click', function (event) { 21559 event.stopPropagation(); 21560 controller.close(); 21561 }); 21562 $('.flyout-nav a, .flyout-nav input, .flyout-nav button').first().focus(); 21563 }); // Add close class to canvas container when Slidebar is opened 21564 21565 $(controller.events).on('closing', function (event) { 21566 $('[canvas]').removeClass('js-close-any'); 21567 }); // Slidebars Submenus 21568 21569 $('.toggle-submenu').off('click').on('click', function () { 21570 var $submenu = $(this).parent().children('.sb-submenu'); 21571 $submenu.toggleClass('sb-submenu-active'); // Toggle active class. 21572 21573 if ($submenu.hasClass('sb-submenu-active')) { 21574 $submenu.slideDown(200); 21575 $submenu.parent().siblings().children('.sb-submenu-active.sb-submenu').slideUp(200); 21576 $submenu.parent().siblings().children('.sb-submenu-active.sb-submenu').toggleClass('sb-submenu-active'); 21577 } else { 21578 $submenu.slideUp(200); 21579 } 21580 }); 21581 $(".flyout-nav .sb-submenu a.active").parent().parent().siblings(".toggle-submenu").click(); 21582 } 21583 21584 return { 21585 main: function main() { 21586 handleCookieConsent(); 21587 handleSliders(); 21588 handleSelect(); 21589 handleFileInput(); 21590 handleSearchDropdown(); 21591 handleSlidebars(); 21592 Object(timeline__WEBPACK_IMPORTED_MODULE_10__["default"])(); 21593 $("#header nav > ul").dropdown(); 21594 $('a[href^="#"]').not('[href="#"]').not('[data-toggle]').not('[href="#0"]').not('.no-scroll').SmoothScroll(); 21595 animation__WEBPACK_IMPORTED_MODULE_5__["Animator"].animate('.animate'); 21596 $(".banner--home h1 .text-regular, .banner--home h1 .text-outlined").letters(); 21597 }, 21598 onImagesLoaded: function onImagesLoaded() {} 21599 }; 21600}(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 21601 21602$(document).ready(function () { 21603 App.main(); 21604}); 21605imagesloaded__WEBPACK_IMPORTED_MODULE_4___default()('html', function (instance) { 21606 App.onImagesLoaded(); 21607}); 21608/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ "../node_modules/jquery/dist/jquery.js"))) 21609 21610 21611 /***/ 21612 }, 21613 21614
21614/***/ "./js/ajax-listing.js": 21615 /*!****************************!*\ 21616 !*** ./js/ajax-listing.js ***! 21617 \****************************/ 21618 /*! exports provided: default */ 21619 /***/ function (module, __webpack_exports__, __webpack_require__) { 21620 "use strict"; 21621 __webpack_require__.r(__webpack_exports__); 21622/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "../node_modules/jquery/dist/jquery.js"); 21623/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 21624 21625 21626var Listing = function ($) { 21627 return { 21628 Filter: function Filter(form, postUrl) { 21629 window.history.replaceState('', '', '?' + $(form).serialize()); 21630 21631 if ($.ajax) { 21632 var $listArticles = $("#listing"); 21633 21634 if ($listArticles.length) { 21635 $.ajax({ 21636 type: "GET", 21637 url: postUrl, 21638 data: $(form).serialize(), 21639 datatype: "html", 21640 beforeSend: function beforeSend() { 21641 $listArticles.addClass('opaque'); 21642 }, 21643 success: function success(data) { 21644 $listArticles.html(data).removeClass('opaque'); //for ADA 21645 21646 setTimeout(function () { 21647 $("#Aria-Announcements").html('<div aria-live="polite" role="alert"> Main content has been updated. Tab to discover.</div>'); 21648 }, 3000); 21649 setTimeout(function () { 21650 $("#Aria-Announcements").html(''); 21651 }, 10000); 21652 }, 21653 error: function error(XMLHttpRequest, textStatus, errorThrown) {} 21654 }); 21655 } 21656 21657 return false; 21658 } 21659 21660 return true; 21661 }, 21662 Paginate: function Paginate(pagenumber, postUrl, event) { 21663 if ($.ajax) { 21664 var $listArticles = $("#list-articles"); 21665 21666 if ($listArticles.length) { 21667 event.preventDefault(); 21668 $.ajax({ 21669 type: "GET", 21670 url: postUrl, 21671 data: { 21672 'currentpage': pagenumber 21673 }, 21674 datatype: "html", 21675 beforeSend: function beforeSend() { 21676 document.body.scrollTop = document.documentElement.scrollTop = 0; 21677 $listArticles.addClass('opaque'); 21678 }, 21679 success: function success(data) { 21680 $listArticles.html(data).removeClass('opaque'); 21681 }, 21682 error: function error(XMLHttpRequest, textStatus, errorThrown) {} 21683 }); 21684 } 21685 } 21686 }, 21687 LoadMore: function LoadMore(pagenumber, postUrl, event, ele) { 21688 if ($.ajax) { 21689 var $listArticles = $("#listing"); 21690 21691 if ($listArticles.length) { 21692 event.preventDefault(); 21693 var loader = ["Loading. ", "Loading.. ", "Loading...", "Loading ..", "Loading .", "Loading "]; 21694 var len = loader.length - 1; 21695 var i = 0; 21696 var timeout; 21697 var $button = $("#load-more-button a"); 21698 var $span = $("#load-more-button span"); 21699 21700 if (!$button.attr("disabled")) { 21701 $.ajax({ 21702 type: "GET", 21703 url: postUrl, 21704 data: { 21705 'CurrentPage': pagenumber 21706 }, 21707 datatype: "html", 21708 beforeSend: function beforeSend(jqXHR, settings) { 21709 $button.attr("disabled", "disabled"); 21710 $button.width($("#load-more-button a").width()); 21711 $span.get(0).innerHTML = loader[i]; 21712 timeout = setInterval(function () { 21713 $span.get(0).innerHTML = loader[i]; 21714 i = i < len ? i + 1 : 0; 21715 }, 200); 21716 }, 21717 success: function success(data) { 21718 clearInterval(timeout); 21719 $("#load-more-button").remove(); 21720 $listArticles.append('<div id="page-' + pagenumber + '" tab-index="0" class="sr-only"> page ' + pagenumber + ' contents displayed below.</div>' + data); //for ada 21721 21722 setTimeout(function () { 21723 $("#Aria-Announcements").html('<div aria-live="polite" role="alert"> Page ' + pagenumber + ' content has been updated. Tab to discover.</div>'); 21724 }, 3000); 21725 $("#page-" + pagenumber).focus(); 21726 setTimeout(function () { 21727 $("#Aria-Announcements").html(''); 21728 }, 10000); 21729 $(window).trigger('resize'); 21730 }, 21731 error: function error(XMLHttpRequest, textStatus, errorThrown) {} 21732 }); 21733 } 21734 } 21735 } 21736 } 21737 }; 21738}(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 21739 21740/* harmony default export */ __webpack_exports__["default"] = (Listing); 21741 21742 21743 /***/ 21744 }, 21745 21746
21746/***/ "./js/animation.js": 21747 /*!*************************!*\ 21748 !*** ./js/animation.js ***! 21749 \*************************/ 21750 /*! exports provided: Animator, requestAnimFrame */ 21751 /***/ function (module, __webpack_exports__, __webpack_require__) { 21752 "use strict"; 21753 __webpack_require__.r(__webpack_exports__); 21754/* WEBPACK VAR INJECTION */(function($) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Animator", function() { return Animator; }); 21755/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "requestAnimFrame", function() { return requestAnimFrame; }); 21756/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "../node_modules/jquery/dist/jquery.js"); 21757/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 21758 21759 21760var requestAnimFrame = function () { 21761 return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function ( 21762 /* function */ 21763 callback) { 21764 window.setTimeout(callback, 1000 / 60); 21765 }; 21766}(); 21767 21768function getDisplacementTop(el) { 21769 return el.offset().top - $(window).scrollTop(); 21770} 21771 21772var Animator = function () { 21773 return { 21774 animate: function animate(selector) { 21775 var animateList = []; 21776 $(selector).each(function () { 21777 animateList.push({ 21778 ele: $(this), 21779 "class": $(this).data("animation"), 21780 displacement: $(this).attr('data-anim-displacement') != null ? $(this).attr('data-anim-displacement') : 0 21781 }); 21782 $(this).addClass('animated'); 21783 }); 21784 var animateLen = animateList.length, 21785 height = window.innerHeight, 21786 first; 21787 21788 var initAnimaton = function initAnimaton() { 21789 var dfd = new $.Deferred(); 21790 animateList.sort(function (a, b) { 21791 return getDisplacementTop(a.ele) - getDisplacementTop(b.ele); 21792 }); 21793 21794 for (first = 0; first < animateLen; first++) { 21795 var _ = $(animateList[first].ele); 21796 21797 if (getDisplacementTop(_) < height - animateList[first].displacement) { 21798 _.addClass('active'); 21799 21800 _.trigger('animate:in'); 21801 } else { 21802 break; 21803 } 21804 } 21805 21806 dfd.resolve(); 21807 return dfd.promise(); 21808 }; 21809 21810 var animateFunc = function animateFunc() { 21811 for (var i = first; i < first + 1; ++i) { 21812 if (i < 0) { 21813 ++first; 21814 } else if (i >= animateLen) { 21815 --first; 21816 } else { 21817 var _ = $(animateList[i].ele); 21818 21819 if (getDisplacementTop(_) < height - animateList[i].displacement) { 21820 if (!_.hasClass('active')) { 21821 _.addClass('active'); 21822 21823 _.trigger('animate:in'); 21824 21825 _.addClass(animateList[i]["class"]); 21826 } 21827 21828 ++first; 21829 } else { 21830 if (_.hasClass('active')) { 21831 _.removeClass('active'); 21832 21833 _.trigger('animate:out'); 21834 21835 _.removeClass(animateList[i]["class"]); 21836 } 21837 21838 --first; 21839 } 21840 } 21841 } 21842 21843 requestAnimFrame(animateFunc); 21844 }; 21845 21846 return $.when(initAnimaton()).then(function () { 21847 animateFunc(); 21848 }).promise(); 21849 } 21850 }; 21851}(); 21852 21853 21854/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ "../node_modules/jquery/dist/jquery.js"))) 21855 21856 21857 /***/ 21858 }, 21859 21860
21860/***/ "./js/cookie.js": 21861 /*!**********************!*\ 21862 !*** ./js/cookie.js ***! 21863 \**********************/ 21864 /*! exports provided: Cookie */ 21865 /***/ function (module, __webpack_exports__, __webpack_require__) { 21866 "use strict"; 21867 __webpack_require__.r(__webpack_exports__); 21868/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Cookie", function() { return Cookie; }); 21869var Cookie = function () { 21870 return { 21871 write: function write(name, value, hours) { 21872 var expires = ""; 21873 21874 if (hours) { 21875 var date = new Date(); 21876 date.setTime(date.getTime() + hours * 60 * 60 * 1000); 21877 expires = "; expires=" + date.toUTCString(); 21878 } 21879 21880 document.cookie = name + "=" + value + expires + "; path=/"; 21881 }, 21882 read: function read(name) { 21883 var nameEQ = name + "="; 21884 var ca = document.cookie.split(";"); 21885 21886 for (var i = 0; i < ca.length; i++) { 21887 var c = ca[i]; 21888 21889 while (c.charAt(0) == " ") { 21890 c = c.substring(1, c.length); 21891 } 21892 21893 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); 21894 } 21895 21896 return null; 21897 } 21898 }; 21899}(); 21900 21901 21902 /***/ 21903 }, 21904 21905
21905/***/ "./js/dropdown-menu/_dropdown-menu.scss": 21906 /*!**********************************************!*\ 21907 !*** ./js/dropdown-menu/_dropdown-menu.scss ***! 21908 \**********************************************/ 21909 /*! no static exports found */ 21910 /***/ function (module, exports) { 21911 // removed by extract-text-webpack-plugin 21912 21913 21914 /***/ 21915 }, 21916 21917
21917/***/ "./js/dropdown-menu/index.js": 21918 /*!*************************************!*\ 21919 !*** ./js/dropdown-menu/index.js ***! 21920 \*************************************/ 21921 /*! exports provided: default */ 21922 /***/ function (module, __webpack_exports__, __webpack_require__) { 21923 "use strict"; 21924 __webpack_require__.r(__webpack_exports__); 21925 var jq = __webpack_require__(/*! jquery */ "../node_modules/jquery/dist/jquery.js"); 21926 var $ = jq && jq.__esModule ? jq["default"] : jq; 21927 if (typeof $ !== "undefined" && $ && $.fn && !$.fn.dropdown) { 21928 $.fn.dropdown = function () { return this; }; 21929 } 21930 __webpack_exports__["default"] = (typeof $ !== "undefined" && $ && $.fn && $.fn.dropdown ? $.fn.dropdown : function () {}); 21931 21932 /***/ 21933 }, 21934 21935
21935/***/ "./js/letters.js": 21936 /*!***********************!*\ 21937 !*** ./js/letters.js ***! 21938 \***********************/ 21939 /*! exports provided: default */ 21940 /***/ function (module, __webpack_exports__, __webpack_require__) { 21941 "use strict"; 21942 __webpack_require__.r(__webpack_exports__); 21943/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "../node_modules/jquery/dist/jquery.js"); 21944/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 21945/* harmony import */ var animation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! animation */ "./js/animation.js"); 21946 21947 21948 21949function factory($) { 21950 function Letters($ele) { 21951 $ele.each(function () { 21952 var text = $(this).text(); 21953 var words = text.split(" "); 21954 words = words.map(function (w) { 21955 return w.replace(/([^\x00-\x80]|\w)/g, '<span class="letter">$&</span>'); 21956 }); 21957 words = words.map(function (w) { 21958 return "<span style=\"white-space: nowrap\">".concat(w, "</span>"); 21959 }); 21960 $(this).html(words.join(' ')); 21961 }); 21962 var $letters = $ele.find(".letter"); 21963 $ele.addClass("letters-init"); 21964 $letters.each(function (i) { 21965 $(this).css("transition-delay", 18 * i + "ms"); 21966 }); 21967 setTimeout(function () { 21968 Object(animation__WEBPACK_IMPORTED_MODULE_1__["requestAnimFrame"])(function () { 21969 $letters.addClass("active"); 21970 }); 21971 }, 150); 21972 } 21973 21974 Letters.makeJQueryPlugin = function () { 21975 if (!$) return; 21976 21977 $.fn.letters = function (options, callback) { 21978 return new Letters($(this)); 21979 }; 21980 }; // try making plugin 21981 21982 21983 Letters.makeJQueryPlugin(); 21984 return Letters; 21985} 21986 21987; 21988/* harmony default export */ __webpack_exports__["default"] = (factory(jquery__WEBPACK_IMPORTED_MODULE_0___default.a)); 21989 21990 21991 /***/ 21992 }, 21993 21994
21994/***/ "./js/smooth-scroll.js": 21995 /*!*****************************!*\ 21996 !*** ./js/smooth-scroll.js ***! 21997 \*****************************/ 21998 /*! exports provided: default */ 21999 /***/ function (module, __webpack_exports__, __webpack_require__) { 22000 "use strict"; 22001 __webpack_require__.r(__webpack_exports__); 22002/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "../node_modules/jquery/dist/jquery.js"); 22003/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 22004 22005 22006function factory($) { 22007 function SmoothScroll($a) { 22008 $a.click(function (event) { 22009 // Figure out element to scroll to 22010 var target = $(this.hash); 22011 console.log(target); // Does a scroll target exist? 22012 22013 if (target.length) { 22014 // Only prevent default if animation is actually gonna happen 22015 event.preventDefault(); 22016 $('html, body').animate({ 22017 scrollTop: target.offset().top 22018 }, 1000, function () { 22019 // Callback after animation 22020 // Must change focus! 22021 var $target = $(target); 22022 $target.focus(); 22023 22024 if ($target.is(":focus")) { 22025 // Checking if the target was focused 22026 return false; 22027 } else { 22028 $target.attr('tabindex', '-1'); // Adding tabindex for elements not focusable 22029 22030 $target.focus(); // Set focus again 22031 } 22032 22033 ; 22034 }); 22035 } 22036 }); 22037 } 22038 22039 SmoothScroll.makeJQueryPlugin = function () { 22040 if (!$) return; 22041 $('html, body').on("scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove", function () { 22042 $('html, body').stop(); 22043 }); 22044 22045 $.fn.SmoothScroll = function (options, callback) { 22046 return new SmoothScroll($(this)); 22047 }; 22048 }; // try making plugin 22049 22050 22051 SmoothScroll.makeJQueryPlugin(); 22052 return SmoothScroll; 22053} 22054 22055/* harmony default export */ __webpack_exports__["default"] = (factory(jquery__WEBPACK_IMPORTED_MODULE_0___default.a)); 22056 22057 22058 /***/ 22059 }, 22060 22061
22061/***/ "./js/timeline.js": 22062 /*!************************!*\ 22063 !*** ./js/timeline.js ***! 22064 \************************/ 22065 /*! exports provided: default */ 22066 /***/ function (module, __webpack_exports__, __webpack_require__) { 22067 "use strict"; 22068 __webpack_require__.r(__webpack_exports__); 22069var Timeline = function () { 22070 function Timeline() { 22071 var timeline = document.getElementById("timeline"); 22072 var dates = document.querySelectorAll('#timeline .row'); 22073 22074 var resize = function resize() { 22075 // Figure out how many pixels we need per year so that the content will fit 22076 var maxHeightPerYear = 0; 22077 22078 for (var i = 0, len = dates.length - 2; i < len; ++i) { 22079 var range = Math.pow(dates[i + 2].dataset.date - dates[i].dataset.date, .6); 22080 var heightPerYear = dates[i].clientHeight / range; 22081 maxHeightPerYear = heightPerYear > maxHeightPerYear ? heightPerYear : maxHeightPerYear; 22082 } // Using the value we found, space out the dates such that they are proportional 22083 22084 22085 for (var i = 0, len = dates.length - 1; i < len; ++i) { 22086 var range = Math.pow(dates[i + 1].dataset.date - dates[i].dataset.date, .6); 22087 dates[i].style.marginBottom = range * maxHeightPerYear - dates[i].clientHeight + "px"; 22088 } 22089 }; 22090 22091 window.addEventListener("resize", resize); 22092 resize(); 22093 var date; 22094 } 22095 22096 return Timeline; 22097}(); 22098 22099/* harmony default export */ __webpack_exports__["default"] = (Timeline); 22100 22101 22102 /***/ 22103 }
22103, 22104 22105 /******/ 22106 }, 22107);
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.