vendor: 91 bytes, lines 1-4
1/******/ (() => { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3 4/***/ "./src/
4js/scripts/gsap.js": 5/*!********************************!*\ 6 !*** ./src/js/scripts/gsap.js ***! 7 \********************************/ 8/***/ (() => { 9 10window.addEventListener("DOMContentLoaded", function (event) { 11 event.preventDefault(); 12 13 // Load gsap scroll trigger plugin 14 gsap.registerPlugin(ScrollTrigger); 15 16 // gsap navbar animation 17 var navBarAnimate = gsap.from('.header', { 18 yPercent: -100, 19 paused: true, 20 duration: 0.2 21 }).progress(1); 22 ScrollTrigger.create({ 23 start: "top -8%", 24 end: 99999, 25 onUpdate: function onUpdate(self) { 26 self.direction === -1 ? navBarAnimate.play() : navBarAnimate.reverse(); 27 } 28 }); 29 30 // Load gsap homepage animations if on homepage 31 if (document.body.classList.contains('home')) { 32 var mm = gsap.matchMedia(); 33 34 // add a media query. When it matches, the associated function will run 35 mm.add("(max-width: 991px)", function () { 36 // this setup code only runs when viewport is at most 991px wide (i.e. mobile) 37 var tl = gsap.timeline({ 38 defaults: { 39 opacity: 0, 40 ease: "power1.out" 41 } 42 }); 43 tl.from("#primary-feature .diamond-collection", { 44 y: -150, 45 duration: 0.7, 46 delay: 0.5 47 }).from("#primary-feature .cta", { 48 y: 50, 49 duration: 0.5 50 }, ">-0.5"); 51 52 //Scroll Triggers 53 if (document.getElementById("secondary-feature") != null) { 54 gsap.from("#secondary-feature .diamond-collection", { 55 scrollTrigger: { 56 trigger: "#secondary-feature .diamond-collection", 57 start: "top 60%", 58 toggleActions: "play none none none" 59 }, 60 x: 300, 61 duration: 1.5, 62 opacity: 0, 63 ease: "power1.out" 64 }); 65 gsap.from("#secondary-feature .cta", { 66 scrollTrigger: { 67 trigger: "#secondary-feature .cta", 68 toggleActions: "play none none none" 69 }, 70 y: 50, 71 duration: 0.7, 72 opacity: 0, 73 ease: "power1.out" 74 }); 75 } 76 77 // load flexible content sections 78 var fadeIn = gsap.utils.toArray('.flexible-content'); 79 fadeIn.forEach(function (item) { 80 var tl_flex_content = gsap.timeline({ 81 scrollTrigger: { 82 trigger: item, 83 start: "top 90%" 84 } 85 }); 86 tl_flex_content.from(item, { 87 y: 50, 88 duration: 1, 89 opacity: 0, 90 ease: "power1.easeOut" 91 }); 92 }); 93 94 // load partner logos 95 var tl_logos = gsap.timeline({ 96 scrollTrigger: { 97 trigger: ".partners-container", 98 start: "top 80%" 99 } 100 }); 101 tl_logos.from(".key-partners", { 102 y: 50, 103 duration: 1, 104 opacity: 0, 105 ease: "power1.easeOut" 106 }); 107 }); 108 109 // add a media query. When it matches, the associated function will run 110 mm.add("(min-width: 992px)", function () { 111 // this setup code only runs when viewport is at least 992px wide (i.e. desktop) 112 var tl = gsap.timeline(); 113 tl.from("#primary-feature .diamond-collection", { 114 xPercent: 30, 115 opacity: 0, 116 duration: 1, 117 ease: "power1.easeOut" 118 }); 119 tl.from("#primary-feature .cta", { 120 yPercent: 50, 121 opacity: 0, 122 duration: 1, 123 ease: "power1.easeOut" 124 }, ">-0.3"); 125 if (document.getElementById("secondary-feature") != null) { 126 var tl1 = gsap.timeline({ 127 scrollTrigger: { 128 trigger: ".feature", 129 start: "top top", 130 end: "+=2000", 131 scrub: 0.5, 132 pin: true, 133 anticipatePin: 1 134 } 135 }); 136 } else { 137 var tl1 = gsap.timeline({ 138 scrollTrigger: { 139 trigger: ".feature", 140 start: "top top", 141 end: "+=400", 142 scrub: 0.5, 143 pin: true, 144 anticipatePin: 1 145 } 146 }); 147 } 148 tl1.to("#primary-feature .cta", { 149 y: -800, 150 duration: 1, 151 ease: "power1.easeOut" 152 }); 153 if (document.getElementById("secondary-feature") != null) { 154 tl1.from("#secondary-feature .cta", { 155 y: 500, 156 autoAlpha: 0, 157 duration: 1, 158 ease: "power1.easeOut" 159 }, ">-0.5"); 160 tl1.from("#secondary-feature .main-diamond", { 161 autoAlpha: 0, 162 duration: 1, 163 ease: "power1.easeOut" 164 }, ">-1"); 165 } 166 167 // load flexible content sections 168 var fadeIn = gsap.utils.toArray('.flexible-content'); 169 fadeIn.forEach(function (item) { 170 var tl_flex_content = gsap.timeline({ 171 scrollTrigger: { 172 trigger: item, 173 start: "top 90%" 174 } 175 }); 176 tl_flex_content.from(item, { 177 y: 50, 178 duration: 1, 179 opacity: 0, 180 ease: "power1.easeOut" 181 }); 182 }); 183 }); 184 185 // reset scroll to beginning upon page refresh 186 window.addEventListener("load", function () { 187 ScrollTrigger.clearScrollMemory(); 188 window.history.scrollRestoration = "manual"; 189 }); 190 191 // later, if we need to revert all the animations/ScrollTriggers... 192 // mm.revert(); 193 } 194}); 195 196/***/ }), 197
198/***/ "./src/js/scripts/initialise.js": 199/*!**************************************!*\ 200 !*** ./src/js/scripts/initialise.js ***! 201 \**************************************/ 202/***/ (() => { 203 204/* Initially hide all content to prevent FOUC */ 205document.querySelector('html').classList.add('hidden'); 206window.addEventListener("DOMContentLoaded", function (event) { 207 event.preventDefault(); 208 209 /* Once DOM loads, first hide any elements which need to be hidden from view */ 210 211 // hide searchbar 212 document.getElementById("menu-search").classList.add('hidden'); 213 document.getElementById("menu-search").classList.add('no-show'); 214 var dropdownMenus = document.querySelectorAll(".dropdown-menu"); 215 dropdownMenus.forEach(function (element) { 216 element.classList.add("base-opacity"); 217 }); 218 219 // If on the homepage, hide secondary feature elements on load (only applicable for desktop) 220 // these will reappear accordingly on scroll using GSAP ScrollTrigger 221 if (document.getElementById("secondary-feature") != null) { 222 if (document.body.classList.contains('home')) { 223 var mm = gsap.matchMedia(); 224 mm.add("(min-width: 992px)", function () { 225 document.getElementById("secondary-feature").querySelector(".main-diamond").classList.add('hidden'); 226 document.getElementById("secondary-feature").querySelector(".cta").classList.add('hidden'); 227 document.getElementById("secondary-feature").querySelectorAll(".diamonds").forEach(function (diamond) { 228 diamond.classList.add('hidden'); 229 }); 230 document.getElementById("secondary-feature").classList.add('absolute-positioning'); 231 }); 232 // remove any hidden classes on the secondary feature elements on mobile (i.e when screen resizing) 233 mm.add("(max-width: 991px)", function () { 234 if (document.getElementById("secondary-feature").querySelector(".main-diamond").classList.contains('hidden')) { 235 document.getElementById("secondary-feature").querySelector(".main-diamond").classList.remove('hidden'); 236 } 237 if (document.getElementById("secondary-feature").querySelector(".cta").classList.contains('hidden')) { 238 document.getElementById("secondary-feature").querySelector(".cta").classList.remove('hidden'); 239 } 240 document.getElementById("secondary-feature").querySelectorAll(".diamonds").forEach(function (diamond) { 241 if (diamond.classList.contains('hidden')) { 242 diamond.classList.remove('hidden'); 243 } 244 }); 245 if (document.getElementById("secondary-feature").classList.contains('absolute-positioning')) { 246 document.getElementById("secondary-feature").classList.remove('absolute-positioning'); 247 } 248 }); 249 } 250 } 251 252 // For mobile, correctly calculate and define true inner height in vh units, i.e. the viewport minus browser bar height 253 if (window.matchMedia("(max-width: 991px)").matches) { 254 var vh = window.innerHeight * 0.01; 255 document.documentElement.style.setProperty('--vh', "".concat(vh, "px")); 256 257 // On resize execute the same script as before 258 window.addEventListener('change', function () { 259 var vh = window.innerHeight * 0.01; 260 document.documentElement.style.setProperty('--vh', "".concat(vh, "px")); 261 }); 262 } 263 264 /* then reveal the page */ 265 document.querySelector('html').classList.remove('hidden'); 266}); 267 268/***/ }), 269
270/***/ "./src/js/scripts/nav.js": 271/*!*******************************!*\ 272 !*** ./src/js/scripts/nav.js ***! 273 \*******************************/ 274/***/ (() => { 275 276window.addEventListener("DOMContentLoaded", function (event) { 277 event.preventDefault(); 278 var dropdown = document.querySelectorAll('.dropdown-toggle'); 279 280 /* 281 * Mutation Observer for main nav menu 282 * Adds transitions to the Bootstrap nav when displaying the dropdown submenus 283 * This is determined by observing the 'show' class which Bootstrap adds/removes to its dropdown menus 284 */ 285 286 dropdown.forEach(function (item) { 287 var elemToObserve = item.nextElementSibling; //observe the submenu ul 288 var prevClassState = elemToObserve.classList.contains('show'); 289 var observer = new MutationObserver(function (mutations) { 290 mutations.forEach(function (mutation) { 291 if (mutation.attributeName == "class") { 292 var currentClassState = mutation.target.classList.contains('show'); 293 if (prevClassState !== currentClassState) { 294 prevClassState = currentClassState; 295 if (currentClassState) { 296 setTimeout(function () { 297 mutation.target.classList.add('appear'); 298 setTimeout(function () { 299 mutation.target.classList.add('block'); 300 }, 50); 301 }, 50); 302 item.classList.add('expanded'); 303 } else { 304 mutation.target.classList.remove('appear'); 305 setTimeout(function () { 306 mutation.target.classList.remove('block'); 307 }, 50); 308 item.classList.remove('expanded'); 309 } 310 } 311 } 312 }); 313 }); 314 observer.observe(elemToObserve, { 315 attributes: true 316 }); 317 }); 318 319 /* 320 * Search bar (desktop only) 321 */ 322 323 // Click event listener - search icon click 324 document.getElementById("search-toggle").addEventListener("click", toggleSearchBar); 325 326 // Click event listener - outside click 327 document.addEventListener("click", toggleHandler); 328 329 // Click event listener - nav items click 330 dropdown.forEach(function (item) { 331 item.addEventListener("click", toggleHandler); 332 }); 333 334 // Hide search bar when switching focus to elsewhere in the DOM 335 document.getElementById('menu-search').querySelector(".search-submit").addEventListener("focusout", function (e) { 336 if (document.getElementById('menu-search').querySelector(".search-field") !== e.relatedTarget) { 337 if (document.getElementById('search-toggle').classList.contains('clicked')) { 338 toggleSearchBar(); 339 } 340 } 341 }); 342 document.getElementById('menu-search').querySelector(".search-field").addEventListener("focusout", function (e) { 343 if (document.getElementById('menu-search').querySelector(".search-submit") !== e.relatedTarget) { 344 if (document.getElementById('search-toggle').classList.contains('clicked')) { 345 toggleSearchBar(); 346 } 347 } 348 }); 349 document.getElementById("search-toggle").addEventListener("focusout", function (e) { 350 if (document.getElementById('menu-search').querySelector(".search-field") !== e.relatedTarget) { 351 if (document.getElementById('search-toggle').classList.contains('clicked')) { 352 toggleSearchBar(); 353 } 354 } 355 }); 356 357 // Function to toggle the displaying of the search bar 358 function toggleSearchBar() { 359 var searchBar = document.getElementById("menu-search"); 360 if (searchBar.classList.contains('hidden')) { 361 document.getElementById("search-toggle").classList.add('clicked'); 362 searchBar.classList.remove('hidden'); 363 searchBar.classList.add('appeared'); 364 searchBar.classList.remove('no-show'); 365 } else { 366 document.getElementById("search-toggle").classList.remove('clicked'); 367 searchBar.classList.replace('appeared', 'disappeared'); 368 searchBar.classList.add('no-show'); 369 setTimeout(function () { 370 searchBar.classList.add('hidden'); 371 searchBar.classList.remove('disappeared'); 372 }, 500); 373 } 374 } 375 376 // Function to handle the click event listeners 377 function toggleHandler(event) { 378 event.preventDefault; 379 var searchIcon = document.getElementById("search-toggle"); 380 var searchBar = document.getElementById("menu-search"); 381 if (!searchIcon.contains(event.target)) { 382 if (!searchBar.contains(event.target)) { 383 if (searchIcon.classList.contains('clicked')) { 384 toggleSearchBar(); 385 } 386 } 387 } 388 } 389 390 /* 391 * Hamburger menu (mobile only) 392 */ 393 394 document.getElementById("navbar-toggler").addEventListener("click", function () { 395 if (this.classList.contains('expanded')) { 396 this.classList.remove('expanded'); 397 document.body.classList.remove('no-scroll'); 398 } else { 399 this.classList.add('expanded'); 400 document.body.classList.add('no-scroll'); 401 } 402 }); 403 404 // Make mobile menu scrollable 405 if (window.matchMedia("(max-width: 991px)").matches) { 406 document.getElementById('main-nav').classList.add('navbar-nav-scroll'); 407 } 408 if (window.matchMedia("(min-width: 992px)").matches) { 409 document.getElementById('main-nav').classList.remove('navbar-nav-scroll'); 410 } 411 window.matchMedia('(max-width: 991px)').addEventListener('change', function (query) { 412 if (query.matches) { 413 document.getElementById('main-nav').classList.add('navbar-nav-scroll'); 414 } else { 415 document.getElementById('main-nav').classList.remove('navbar-nav-scroll'); 416 } 417 }); 418 419 // Collapse menu on outside click 420 document.addEventListener("click", function (event) { 421 if (document.getElementById("main-content").contains(event.target)) { 422 if (document.getElementById("bs-example-navbar-collapse-1").classList.contains('show')) { 423 document.getElementById("navbar-toggler").click(); 424 } 425 } 426 }); 427 428 /* 429 * Handle 'escape' key press on either mobile or desktop 430 */ 431 432 // Define functions for 'escape' key press 433 434 function escapeKeyPressMobile() { 435 document.onkeydown = function (event) { 436 if (event.keyCode == 27) { 437 if (document.getElementById("navbar-toggler").classList.contains('expanded')) { 438 document.getElementById("navbar-toggler").click(); 439 document.getElementById("navbar-toggler").focus(); 440 } 441 } 442 }; 443 } 444 function escapeKeyPressDesktop() { 445 document.onkeydown = function (event) { 446 if (event.keyCode == 27) {
447 if (document.getElementById("search-toggle").classList.contains('clicked')) { 448 toggleSearchBar(); 449 } 450 } 451 }; 452 } 453 454 // Mobile - Collapse menu on 'Escape' button key press 455 if (window.matchMedia("(max-width: 991px)").matches) { 456 escapeKeyPressMobile(); 457 } 458 459 // Desktop - Hide search bar on 'Escape' button key press 460 if (window.matchMedia("(min-width: 992px)").matches) { 461 escapeKeyPressDesktop(); 462 } 463 464 // Listen for screen resize changes 465 window.matchMedia('(max-width: 991px)').addEventListener('change', function (query) { 466 if (query.matches) { 467 escapeKeyPressMobile(); 468 } else { 469 escapeKeyPressDesktop(); 470 } 471 }); 472}); 473 474/***/ }), 475
vendor: 137,860 bytes, lines 476-4840
476/***/ "./node_modules/bootstrap/dist/js/bootstrap.js": 477/*!*****************************************************!*\ 478 !*** ./node_modules/bootstrap/dist/js/bootstrap.js ***! 479 \*****************************************************/ 480/***/ (function(__unused_webpack_module, exports, __webpack_require__) { 481 482/*! 483 * Bootstrap v4.6.2 (https://getbootstrap.com/) 484 * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 485 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 486 */ 487(function (global, factory) { 488 true ? factory(exports, __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")) : 489 0; 490})(this, (function (exports, $, Popper) { 'use strict'; 491 492 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } 493 494 var $__default = /*#__PURE__*/_interopDefaultLegacy($); 495 var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper); 496 497 function _defineProperties(target, props) { 498 for (var i = 0; i < props.length; i++) { 499 var descriptor = props[i]; 500 descriptor.enumerable = descriptor.enumerable || false; 501 descriptor.configurable = true; 502 if ("value" in descriptor) descriptor.writable = true; 503 Object.defineProperty(target, descriptor.key, descriptor); 504 } 505 } 506 507 function _createClass(Constructor, protoProps, staticProps) { 508 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 509 if (staticProps) _defineProperties(Constructor, staticProps); 510 Object.defineProperty(Constructor, "prototype", { 511 writable: false 512 }); 513 return Constructor; 514 } 515 516 function _extends() { 517 _extends = Object.assign ? Object.assign.bind() : function (target) { 518 for (var i = 1; i < arguments.length; i++) { 519 var source = arguments[i]; 520 521 for (var key in source) { 522 if (Object.prototype.hasOwnProperty.call(source, key)) { 523 target[key] = source[key]; 524 } 525 } 526 } 527 528 return target; 529 }; 530 return _extends.apply(this, arguments); 531 } 532 533 function _inheritsLoose(subClass, superClass) { 534 subClass.prototype = Object.create(superClass.prototype); 535 subClass.prototype.constructor = subClass; 536 537 _setPrototypeOf(subClass, superClass); 538 } 539 540 function _setPrototypeOf(o, p) { 541 _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { 542 o.__proto__ = p; 543 return o; 544 }; 545 return _setPrototypeOf(o, p); 546 } 547 548 /** 549 * -------------------------------------------------------------------------- 550 * Bootstrap (v4.6.2): util.js 551 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 552 * -------------------------------------------------------------------------- 553 */ 554 /** 555 * Private TransitionEnd Helpers 556 */ 557 558 var TRANSITION_END = 'transitionend'; 559 var MAX_UID = 1000000; 560 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 561 562 function toType(obj) { 563 if (obj === null || typeof obj === 'undefined') { 564 return "" + obj; 565 } 566 567 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 568 } 569 570 function getSpecialTransitionEndEvent() { 571 return { 572 bindType: TRANSITION_END, 573 delegateType: TRANSITION_END, 574 handle: function handle(event) { 575 if ($__default["default"](event.target).is(this)) { 576 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 577 } 578 579 return undefined; 580 } 581 }; 582 } 583 584 function transitionEndEmulator(duration) { 585 var _this = this; 586 587 var called = false; 588 $__default["default"](this).one(Util.TRANSITION_END, function () { 589 called = true; 590 }); 591 setTimeout(function () { 592 if (!called) { 593 Util.triggerTransitionEnd(_this); 594 } 595 }, duration); 596 return this; 597 } 598 599 function setTransitionEndSupport() { 600 $__default["default"].fn.emulateTransitionEnd = transitionEndEmulator; 601 $__default["default"].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 602 } 603 /** 604 * Public Util API 605 */ 606 607 608 var Util = { 609 TRANSITION_END: 'bsTransitionEnd', 610 getUID: function getUID(prefix) { 611 do { 612 // eslint-disable-next-line no-bitwise 613 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 614 } while (document.getElementById(prefix)); 615 616 return prefix; 617 }, 618 getSelectorFromElement: function getSelectorFromElement(element) { 619 var selector = element.getAttribute('data-target'); 620 621 if (!selector || selector === '#') { 622 var hrefAttr = element.getAttribute('href'); 623 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 624 } 625 626 try { 627 return document.querySelector(selector) ? selector : null; 628 } catch (_) { 629 return null; 630 } 631 }, 632 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 633 if (!element) { 634 return 0; 635 } // Get transition-duration of the element 636 637 638 var transitionDuration = $__default["default"](element).css('transition-duration'); 639 var transitionDelay = $__default["default"](element).css('transition-delay'); 640 var floatTransitionDuration = parseFloat(transitionDuration); 641 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 642 643 if (!floatTransitionDuration && !floatTransitionDelay) { 644 return 0; 645 } // If multiple durations are defined, take the first 646 647 648 transitionDuration = transitionDuration.split(',')[0]; 649 transitionDelay = transitionDelay.split(',')[0]; 650 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 651 }, 652 reflow: function reflow(element) { 653 return element.offsetHeight; 654 }, 655 triggerTransitionEnd: function triggerTransitionEnd(element) { 656 $__default["default"](element).trigger(TRANSITION_END); 657 }, 658 supportsTransitionEnd: function supportsTransitionEnd() { 659 return Boolean(TRANSITION_END); 660 }, 661 isElement: function isElement(obj) { 662 return (obj[0] || obj).nodeType; 663 }, 664 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 665 for (var property in configTypes) { 666 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 667 var expectedTypes = configTypes[property]; 668 var value = config[property]; 669 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 670 671 if (!new RegExp(expectedTypes).test(valueType)) { 672 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); 673 } 674 } 675 } 676 }, 677 findShadowRoot: function findShadowRoot(element) { 678 if (!document.documentElement.attachShadow) { 679 return null; 680 } // Can find the shadow root otherwise it'll return the document 681 682 683 if (typeof element.getRootNode === 'function') { 684 var root = element.getRootNode(); 685 return root instanceof ShadowRoot ? root : null; 686 } 687 688 if (element instanceof ShadowRoot) { 689 return element; 690 } // when we don't find a shadow root 691 692 693 if (!element.parentNode) { 694 return null; 695 } 696 697 return Util.findShadowRoot(element.parentNode); 698 }, 699 jQueryDetection: function jQueryDetection() { 700 if (typeof $__default["default"] === 'undefined') { 701 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); 702 } 703 704 var version = $__default["default"].fn.jquery.split(' ')[0].split('.'); 705 var minMajor = 1; 706 var ltMajor = 2; 707 var minMinor = 9; 708 var minPatch = 1; 709 var maxMajor = 4; 710 711 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { 712 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); 713 } 714 } 715 }; 716 Util.jQueryDetection(); 717 setTransitionEndSupport(); 718 719 /** 720 * Constants 721 */ 722 723 var NAME$a = 'alert'; 724 var VERSION$a = '4.6.2'; 725 var DATA_KEY$a = 'bs.alert'; 726 var EVENT_KEY$a = "." + DATA_KEY$a; 727 var DATA_API_KEY$7 = '.data-api'; 728 var JQUERY_NO_CONFLICT$a = $__default["default"].fn[NAME$a]; 729 var CLASS_NAME_ALERT = 'alert'; 730 var CLASS_NAME_FADE$5 = 'fade'; 731 var CLASS_NAME_SHOW$7 = 'show'; 732 var EVENT_CLOSE = "close" + EVENT_KEY$a; 733 var EVENT_CLOSED = "closed" + EVENT_KEY$a; 734 var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$a + DATA_API_KEY$7; 735 var SELECTOR_DISMISS = '[data-dismiss="alert"]'; 736 /** 737 * Class definition 738 */ 739 740 var Alert = /*#__PURE__*/function () { 741 function Alert(element) { 742 this._element = element; 743 } // Getters 744 745 746 var _proto = Alert.prototype; 747 748 // Public 749 _proto.close = function close(element) { 750 var rootElement = this._element; 751 752 if (element) { 753 rootElement = this._getRootElement(element); 754 } 755 756 var customEvent = this._triggerCloseEvent(rootElement); 757 758 if (customEvent.isDefaultPrevented()) { 759 return; 760 } 761 762 this._removeElement(rootElement); 763 }; 764 765 _proto.dispose = function dispose() { 766 $__default["default"].removeData(this._element, DATA_KEY$a); 767 this._element = null; 768 } // Private 769 ; 770 771 _proto._getRootElement = function _getRootElement(element) { 772 var selector = Util.getSelectorFromElement(element); 773 var parent = false; 774 775 if (selector) { 776 parent = document.querySelector(selector); 777 } 778 779 if (!parent) { 780 parent = $__default["default"](element).closest("." + CLASS_NAME_ALERT)[0]; 781 } 782 783 return parent; 784 }; 785 786 _proto._triggerCloseEvent = function _triggerCloseEvent(element) { 787 var closeEvent = $__default["default"].Event(EVENT_CLOSE); 788 $__default["default"](element).trigger(closeEvent); 789 return closeEvent; 790 }; 791 792 _proto._removeElement = function _removeElement(element) { 793 var _this = this; 794 795 $__default["default"](element).removeClass(CLASS_NAME_SHOW$7); 796 797 if (!$__default["default"](element).hasClass(CLASS_NAME_FADE$5)) { 798 this._destroyElement(element); 799 800 return; 801 } 802 803 var transitionDuration = Util.getTransitionDurationFromElement(element); 804 $__default["default"](element).one(Util.TRANSITION_END, function (event) { 805 return _this._destroyElement(element, event); 806 }).emulateTransitionEnd(transitionDuration); 807 }; 808 809 _proto._destroyElement = function _destroyElement(element) { 810 $__default["default"](element).detach().trigger(EVENT_CLOSED).remove(); 811 } // Static 812 ; 813 814 Alert._jQueryInterface = function _jQueryInterface(config) { 815 return this.each(function () { 816 var $element = $__default["default"](this); 817 var data = $element.data(DATA_KEY$a); 818 819 if (!data) { 820 data = new Alert(this); 821 $element.data(DATA_KEY$a, data); 822 } 823 824 if (config === 'close') { 825 data[config](this); 826 } 827 }); 828 }; 829 830 Alert._handleDismiss = function _handleDismiss(alertInstance) { 831 return function (event) { 832 if (event) { 833 event.preventDefault(); 834 } 835 836 alertInstance.close(this); 837 }; 838 }; 839 840 _createClass(Alert, null, [{ 841 key: "VERSION", 842 get: function get() { 843 return VERSION$a; 844 } 845 }]); 846 847 return Alert; 848 }(); 849 /** 850 * Data API implementation 851 */ 852 853 854 $__default["default"](document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DISMISS, Alert._handleDismiss(new Alert())); 855 /** 856 * jQuery 857 */ 858 859 $__default["default"].fn[NAME$a] = Alert._jQueryInterface; 860 $__default["default"].fn[NAME$a].Constructor = Alert; 861 862 $__default["default"].fn[NAME$a].noConflict = function () { 863 $__default["default"].fn[NAME$a] = JQUERY_NO_CONFLICT$a; 864 return Alert._jQueryInterface; 865 }; 866 867 /** 868 * Constants 869 */ 870 871 var NAME$9 = 'button'; 872 var VERSION$9 = '4.6.2'; 873 var DATA_KEY$9 = 'bs.button'; 874 var EVENT_KEY$9 = "." + DATA_KEY$9; 875 var DATA_API_KEY$6 = '.data-api'; 876 var JQUERY_NO_CONFLICT$9 = $__default["default"].fn[NAME$9]; 877 var CLASS_NAME_ACTIVE$3 = 'active'; 878 var CLASS_NAME_BUTTON = 'btn'; 879 var CLASS_NAME_FOCUS = 'focus'; 880 var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$9 + DATA_API_KEY$6; 881 var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$9 + DATA_API_KEY$6 + " " + ("blur" + EVENT_KEY$9 + DATA_API_KEY$6); 882 var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$9 + DATA_API_KEY$6; 883 var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]'; 884 var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]'; 885 var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="button"]'; 886 var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn'; 887 var SELECTOR_INPUT = 'input:not([type="hidden"])'; 888 var SELECTOR_ACTIVE$2 = '.active'; 889 var SELECTOR_BUTTON = '.btn'; 890 /** 891 * Class definition 892 */ 893 894 var Button = /*#__PURE__*/function () { 895 function Button(element) { 896 this._element = element; 897 this.shouldAvoidTriggerChange = false; 898 } // Getters 899 900 901 var _proto = Button.prototype; 902 903 // Public 904 _proto.toggle = function toggle() { 905 var triggerChangeEvent = true; 906 var addAriaPressed = true; 907 var rootElement = $__default["default"](this._element).closest(SELECTOR_DATA_TOGGLES)[0]; 908 909 if (rootElement) { 910 var input = this._element.querySelector(SELECTOR_INPUT); 911 912 if (input) { 913 if (input.type === 'radio') { 914 if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE$3)) { 915 triggerChangeEvent = false; 916 } else { 917 var activeElement = rootElement.querySelector(SELECTOR_ACTIVE$2); 918 919 if (activeElement) { 920 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$3); 921 } 922 } 923 } 924 925 if (triggerChangeEvent) { 926 // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input 927 if (input.type === 'checkbox' || input.type === 'radio') { 928 input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE$3); 929 } 930 931 if (!this.shouldAvoidTriggerChange) { 932 $__default["default"](input).trigger('change'); 933 } 934 } 935 936 input.focus(); 937 addAriaPressed = false; 938 } 939 } 940 941 if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) { 942 if (addAriaPressed) { 943 this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE$3)); 944 } 945 946 if (triggerChangeEvent) { 947 $__default["default"](this._element).toggleClass(CLASS_NAME_ACTIVE$3); 948 } 949 } 950 }; 951 952 _proto.dispose = function dispose() { 953 $__default["default"].removeData(this._element, DATA_KEY$9); 954 this._element = null; 955 } // Static 956 ; 957 958 Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) { 959 return this.each(function () { 960 var $element = $__default["default"](this); 961 var data = $element.data(DATA_KEY$9); 962 963 if (!data) { 964 data = new Button(this); 965 $element.data(DATA_KEY$9, data); 966 } 967 968 data.shouldAvoidTriggerChange = avoidTriggerChange; 969 970 if (config === 'toggle') { 971 data[config](); 972 } 973 }); 974 }; 975 976 _createClass(Button, null, [{ 977 key: "VERSION", 978 get: function get() { 979 return VERSION$9; 980 } 981 }]); 982 983 return Button; 984 }(); 985 /** 986 * Data API implementation 987 */ 988 989 990 $__default["default"](document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 991 var button = event.target; 992 var initialButton = button; 993 994 if (!$__default["default"](button).hasClass(CLASS_NAME_BUTTON)) { 995 button = $__default["default"](button).closest(SELECTOR_BUTTON)[0]; 996 } 997 998 if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) { 999 event.preventDefault(); // work around Firefox bug #1540995 1000 } else { 1001 var inputBtn = button.querySelector(SELECTOR_INPUT); 1002 1003 if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) { 1004 event.preventDefault(); // work around Firefox bug #1540995 1005 1006 return; 1007 } 1008 1009 if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') { 1010 Button._jQueryInterface.call($__default["default"](button), 'toggle', initialButton.tagName === 'INPUT'); 1011 } 1012 } 1013 }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 1014 var button = $__default["default"](event.target).closest(SELECTOR_BUTTON)[0]; 1015 $__default["default"](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type)); 1016 }); 1017 $__default["default"](window).on(EVENT_LOAD_DATA_API$2, function () { 1018 // ensure correct active class is set to match the controls' actual values/states 1019 // find all checkboxes/readio buttons inside data-toggle groups 1020 var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS)); 1021 1022 for (var i = 0, len = buttons.length; i < len; i++) { 1023 var button = buttons[i]; 1024 var input = button.querySelector(SELECTOR_INPUT); 1025 1026 if (input.checked || input.hasAttribute('checked')) { 1027 button.classList.add(CLASS_NAME_ACTIVE$3); 1028 } else { 1029 button.classList.remove(CLASS_NAME_ACTIVE$3); 1030 } 1031 } // find all button toggles 1032 1033 1034 buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$4)); 1035 1036 for (var _i = 0, _len = buttons.length; _i < _len; _i++) { 1037 var _button = buttons[_i]; 1038 1039 if (_button.getAttribute('aria-pressed') === 'true') { 1040 _button.classList.add(CLASS_NAME_ACTIVE$3); 1041 } else { 1042 _button.classList.remove(CLASS_NAME_ACTIVE$3); 1043 } 1044 } 1045 }); 1046 /** 1047 * jQuery 1048 */ 1049 1050 $__default["default"].fn[NAME$9] = Button._jQueryInterface; 1051 $__default["default"].fn[NAME$9].Constructor = Button; 1052 1053 $__default["default"].fn[NAME$9].noConflict = function () { 1054 $__default["default"].fn[NAME$9] = JQUERY_NO_CONFLICT$9; 1055 return Button._jQueryInterface; 1056 }; 1057 1058 /** 1059 * Constants 1060 */ 1061 1062 var NAME$8 = 'carousel'; 1063 var VERSION$8 = '4.6.2'; 1064 var DATA_KEY$8 = 'bs.carousel'; 1065 var EVENT_KEY$8 = "." + DATA_KEY$8; 1066 var DATA_API_KEY$5 = '.data-api'; 1067 var JQUERY_NO_CONFLICT$8 = $__default["default"].fn[NAME$8]; 1068 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 1069 1070 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 1071 1072 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 1073 1074 var SWIPE_THRESHOLD = 40; 1075 var CLASS_NAME_CAROUSEL = 'carousel'; 1076 var CLASS_NAME_ACTIVE$2 = 'active'; 1077 var CLASS_NAME_SLIDE = 'slide'; 1078 var CLASS_NAME_RIGHT = 'carousel-item-right'; 1079 var CLASS_NAME_LEFT = 'carousel-item-left'; 1080 var CLASS_NAME_NEXT = 'carousel-item-next'; 1081 var CLASS_NAME_PREV = 'carousel-item-prev'; 1082 var CLASS_NAME_POINTER_EVENT = 'pointer-event'; 1083 var DIRECTION_NEXT = 'next'; 1084 var DIRECTION_PREV = 'prev'; 1085 var DIRECTION_LEFT = 'left'; 1086 var DIRECTION_RIGHT = 'right'; 1087 var EVENT_SLIDE = "slide" + EVENT_KEY$8; 1088 var EVENT_SLID = "slid" + EVENT_KEY$8; 1089 var EVENT_KEYDOWN = "keydown" + EVENT_KEY$8; 1090 var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$8; 1091 var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$8; 1092 var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$8; 1093 var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$8; 1094 var EVENT_TOUCHEND = "touchend" + EVENT_KEY$8; 1095 var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$8; 1096 var EVENT_POINTERUP = "pointerup" + EVENT_KEY$8; 1097 var EVENT_DRAG_START = "dragstart" + EVENT_KEY$8; 1098 var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$8 + DATA_API_KEY$5; 1099 var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$8 + DATA_API_KEY$5; 1100 var SELECTOR_ACTIVE$1 = '.active'; 1101 var SELECTOR_ACTIVE_ITEM = '.active.carousel-item'; 1102 var SELECTOR_ITEM = '.carousel-item'; 1103 var SELECTOR_ITEM_IMG = '.carousel-item img'; 1104 var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev'; 1105 var SELECTOR_INDICATORS = '.carousel-indicators'; 1106 var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]'; 1107 var SELECTOR_DATA_RIDE = '[data-ride="carousel"]'; 1108 var Default$7 = { 1109 interval: 5000, 1110 keyboard: true, 1111 slide: false, 1112 pause: 'hover', 1113 wrap: true, 1114 touch: true 1115 }; 1116 var DefaultType$7 = { 1117 interval: '(number|boolean)', 1118 keyboard: 'boolean', 1119 slide: '(boolean|string)', 1120 pause: '(string|boolean)', 1121 wrap: 'boolean', 1122 touch: 'boolean' 1123 }; 1124 var PointerType = { 1125 TOUCH: 'touch', 1126 PEN: 'pen' 1127 }; 1128 /** 1129 * Class definition 1130 */ 1131 1132 var Carousel = /*#__PURE__*/function () { 1133 function Carousel(element, config) { 1134 this._items = null; 1135 this._interval = null; 1136 this._activeElement = null; 1137 this._isPaused = false; 1138 this._isSliding = false; 1139 this.touchTimeout = null; 1140 this.touchStartX = 0; 1141 this.touchDeltaX = 0; 1142 this._config = this._getConfig(config); 1143 this._element = element; 1144 this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS); 1145 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 1146 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 1147 1148 this._addEventListeners(); 1149 } // Getters 1150 1151 1152 var _proto = Carousel.prototype; 1153 1154 // Public 1155 _proto.next = function next() { 1156 if (!this._isSliding) { 1157 this._slide(DIRECTION_NEXT); 1158 } 1159 }; 1160 1161 _proto.nextWhenVisible = function nextWhenVisible() { 1162 var $element = $__default["default"](this._element); // Don't call next when the page isn't visible 1163 // or the carousel or its parent isn't visible 1164 1165 if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') { 1166 this.next(); 1167 } 1168 }; 1169 1170 _proto.prev = function prev() { 1171 if (!this._isSliding) { 1172 this._slide(DIRECTION_PREV); 1173 } 1174 }; 1175 1176 _proto.pause = function pause(event) { 1177 if (!event) { 1178 this._isPaused = true; 1179 } 1180 1181 if (this._element.querySelector(SELECTOR_NEXT_PREV)) { 1182 Util.triggerTransitionEnd(this._element); 1183 this.cycle(true); 1184 } 1185 1186 clearInterval(this._interval); 1187 this._interval = null; 1188 }; 1189 1190 _proto.cycle = function cycle(event) { 1191 if (!event) { 1192 this._isPaused = false; 1193 } 1194 1195 if (this._interval) { 1196 clearInterval(this._interval); 1197 this._interval = null; 1198 } 1199 1200 if (this._config.interval && !this._isPaused) { 1201 this._updateInterval(); 1202 1203 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 1204 } 1205 }; 1206 1207 _proto.to = function to(index) { 1208 var _this = this; 1209 1210 this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 1211 1212 var activeIndex = this._getItemIndex(this._activeElement); 1213 1214 if (index > this._items.length - 1 || index < 0) { 1215 return; 1216 } 1217 1218 if (this._isSliding) { 1219 $__default["default"](this._element).one(EVENT_SLID, function () { 1220 return _this.to(index); 1221 }); 1222 return; 1223 } 1224 1225 if (activeIndex === index) { 1226 this.pause(); 1227 this.cycle(); 1228 return; 1229 } 1230 1231 var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV; 1232 1233 this._slide(direction, this._items[index]); 1234 }; 1235 1236 _proto.dispose = function dispose() { 1237 $__default["default"](this._element).off(EVENT_KEY$8); 1238 $__default["default"].removeData(this._element, DATA_KEY$8); 1239 this._items = null; 1240 this._config = null; 1241 this._element = null; 1242 this._interval = null; 1243 this._isPaused = null; 1244 this._isSliding = null; 1245 this._activeElement = null; 1246 this._indicatorsElement = null; 1247 } // Private 1248 ; 1249 1250 _proto._getConfig = function _getConfig(config) { 1251 config = _extends({}, Default$7, config); 1252 Util.typeCheckConfig(NAME$8, config, DefaultType$7); 1253 return config; 1254 }; 1255 1256 _proto._handleSwipe = function _handleSwipe() { 1257 var absDeltax = Math.abs(this.touchDeltaX); 1258 1259 if (absDeltax <= SWIPE_THRESHOLD) { 1260 return; 1261 } 1262 1263 var direction = absDeltax / this.touchDeltaX; 1264 this.touchDeltaX = 0; // swipe left 1265 1266 if (direction > 0) { 1267 this.prev(); 1268 } // swipe right 1269 1270 1271 if (direction < 0) { 1272 this.next(); 1273 } 1274 }; 1275 1276 _proto._addEventListeners = function _addEventListeners() { 1277 var _this2 = this; 1278 1279 if (this._config.keyboard) { 1280 $__default["default"](this._element).on(EVENT_KEYDOWN, function (event) { 1281 return _this2._keydown(event); 1282 }); 1283 } 1284 1285 if (this._config.pause === 'hover') { 1286 $__default["default"](this._element).on(EVENT_MOUSEENTER, function (event) { 1287 return _this2.pause(event); 1288 }).on(EVENT_MOUSELEAVE, function (event) { 1289 return _this2.cycle(event); 1290 }); 1291 } 1292 1293 if (this._config.touch) { 1294 this._addTouchEventListeners(); 1295 } 1296 }; 1297 1298 _proto._addTouchEventListeners = function _addTouchEventListeners() { 1299 var _this3 = this; 1300 1301 if (!this._touchSupported) { 1302 return; 1303 } 1304 1305 var start = function start(event) { 1306 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 1307 _this3.touchStartX = event.originalEvent.clientX; 1308 } else if (!_this3._pointerEvent) { 1309 _this3.touchStartX = event.originalEvent.touches[0].clientX; 1310 } 1311 }; 1312 1313 var move = function move(event) { 1314 // ensure swiping with one touch and not pinching 1315 _this3.touchDeltaX = event.originalEvent.touches && event.originalEvent.touches.length > 1 ? 0 : event.originalEvent.touches[0].clientX - _this3.touchStartX; 1316 }; 1317 1318 var end = function end(event) { 1319 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 1320 _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; 1321 } 1322 1323 _this3._handleSwipe(); 1324 1325 if (_this3._config.pause === 'hover') { 1326 // If it's a touch-enabled device, mouseenter/leave are fired as 1327 // part of the mouse compatibility events on first tap - the carousel 1328 // would stop cycling until user tapped out of it; 1329 // here, we listen for touchend, explicitly pause the carousel 1330 // (as if it's the second time we tap on it, mouseenter compat event 1331 // is NOT fired) and after a timeout (to allow for mouse compatibility 1332 // events to fire) we explicitly restart cycling 1333 _this3.pause(); 1334 1335 if (_this3.touchTimeout) { 1336 clearTimeout(_this3.touchTimeout); 1337 } 1338 1339 _this3.touchTimeout = setTimeout(function (event) { 1340 return _this3.cycle(event); 1341 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 1342 } 1343 }; 1344 1345 $__default["default"](this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) { 1346 return e.preventDefault(); 1347 }); 1348 1349 if (this._pointerEvent) { 1350 $__default["default"](this._element).on(EVENT_POINTERDOWN, function (event) { 1351 return start(event); 1352 }); 1353 $__default["default"](this._element).on(EVENT_POINTERUP, function (event) { 1354 return end(event); 1355 }); 1356 1357 this._element.classList.add(CLASS_NAME_POINTER_EVENT); 1358 } else { 1359 $__default["default"](this._element).on(EVENT_TOUCHSTART, function (event) { 1360 return start(event); 1361 }); 1362 $__default["default"](this._element).on(EVENT_TOUCHMOVE, function (event) { 1363 return move(event); 1364 }); 1365 $__default["default"](this._element).on(EVENT_TOUCHEND, function (event) { 1366 return end(event); 1367 }); 1368 } 1369 }; 1370 1371 _proto._keydown = function _keydown(event) { 1372 if (/input|textarea/i.test(event.target.tagName)) { 1373 return; 1374 } 1375 1376 switch (event.which) { 1377 case ARROW_LEFT_KEYCODE: 1378 event.preventDefault(); 1379 this.prev(); 1380 break; 1381 1382 case ARROW_RIGHT_KEYCODE: 1383 event.preventDefault(); 1384 this.next(); 1385 break; 1386 } 1387 }; 1388 1389 _proto._getItemIndex = function _getItemIndex(element) { 1390 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : []; 1391 return this._items.indexOf(element); 1392 }; 1393 1394 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { 1395 var isNextDirection = direction === DIRECTION_NEXT; 1396 var isPrevDirection = direction === DIRECTION_PREV; 1397 1398 var activeIndex = this._getItemIndex(activeElement); 1399 1400 var lastItemIndex = this._items.length - 1; 1401 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 1402 1403 if (isGoingToWrap && !this._config.wrap) { 1404 return activeElement; 1405 } 1406 1407 var delta = direction === DIRECTION_PREV ? -1 : 1; 1408 var itemIndex = (activeIndex + delta) % this._items.length; 1409 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 1410 }; 1411 1412 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { 1413 var targetIndex = this._getItemIndex(relatedTarget); 1414 1415 var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM)); 1416 1417 var slideEvent = $__default["default"].Event(EVENT_SLIDE, { 1418 relatedTarget: relatedTarget, 1419 direction: eventDirectionName, 1420 from: fromIndex, 1421 to: targetIndex 1422 }); 1423 $__default["default"](this._element).trigger(slideEvent); 1424 return slideEvent; 1425 }; 1426 1427 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { 1428 if (this._indicatorsElement) { 1429 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1)); 1430 $__default["default"](indicators).removeClass(CLASS_NAME_ACTIVE$2); 1431 1432 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 1433 1434 if (nextIndicator) { 1435 $__default["default"](nextIndicator).addClass(CLASS_NAME_ACTIVE$2); 1436 } 1437 } 1438 }; 1439 1440 _proto._updateInterval = function _updateInterval() { 1441 var element = this._activeElement || this._element.querySelector(SELECTOR_ACTIVE_ITEM); 1442 1443 if (!element) { 1444 return; 1445 } 1446 1447 var elementInterval = parseInt(element.getAttribute('data-interval'), 10); 1448 1449 if (elementInterval) { 1450 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 1451 this._config.interval = elementInterval; 1452 } else { 1453 this._config.interval = this._config.defaultInterval || this._config.interval; 1454 } 1455 }; 1456 1457 _proto._slide = function _slide(direction, element) { 1458 var _this4 = this; 1459 1460 var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 1461 1462 var activeElementIndex = this._getItemIndex(activeElement); 1463 1464 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 1465 1466 var nextElementIndex = this._getItemIndex(nextElement); 1467 1468 var isCycling = Boolean(this._interval); 1469 var directionalClassName; 1470 var orderClassName; 1471 var eventDirectionName; 1472 1473 if (direction === DIRECTION_NEXT) { 1474 directionalClassName = CLASS_NAME_LEFT; 1475 orderClassName = CLASS_NAME_NEXT; 1476 eventDirectionName = DIRECTION_LEFT; 1477 } else { 1478 directionalClassName = CLASS_NAME_RIGHT; 1479 orderClassName = CLASS_NAME_PREV; 1480 eventDirectionName = DIRECTION_RIGHT; 1481 } 1482 1483 if (nextElement && $__default["default"](nextElement).hasClass(CLASS_NAME_ACTIVE$2)) { 1484 this._isSliding = false; 1485 return; 1486 } 1487 1488 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 1489 1490 if (slideEvent.isDefaultPrevented()) { 1491 return; 1492 } 1493 1494 if (!activeElement || !nextElement) { 1495 // Some weirdness is happening, so we bail 1496 return; 1497 } 1498 1499 this._isSliding = true; 1500 1501 if (isCycling) { 1502 this.pause(); 1503 } 1504 1505 this._setActiveIndicatorElement(nextElement); 1506 1507 this._activeElement = nextElement; 1508 var slidEvent = $__default["default"].Event(EVENT_SLID, { 1509 relatedTarget: nextElement, 1510 direction: eventDirectionName, 1511 from: activeElementIndex, 1512 to: nextElementIndex 1513 }); 1514 1515 if ($__default["default"](this._element).hasClass(CLASS_NAME_SLIDE)) { 1516 $__default["default"](nextElement).addClass(orderClassName); 1517 Util.reflow(nextElement); 1518 $__default["default"](activeElement).addClass(directionalClassName); 1519 $__default["default"](nextElement).addClass(directionalClassName); 1520 var transitionDuration = Util.getTransitionDurationFromElement(activeElement); 1521 $__default["default"](activeElement).one(Util.TRANSITION_END, function () { 1522 $__default["default"](nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$2); 1523 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2 + " " + orderClassName + " " + directionalClassName); 1524 _this4._isSliding = false; 1525 setTimeout(function () { 1526 return $__default["default"](_this4._element).trigger(slidEvent); 1527 }, 0); 1528 }).emulateTransitionEnd(transitionDuration); 1529 } else { 1530 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2); 1531 $__default["default"](nextElement).addClass(CLASS_NAME_ACTIVE$2); 1532 this._isSliding = false; 1533 $__default["default"](this._element).trigger(slidEvent); 1534 } 1535 1536 if (isCycling) { 1537 this.cycle(); 1538 } 1539 } // Static 1540 ; 1541 1542 Carousel._jQueryInterface = function _jQueryInterface(config) { 1543 return this.each(function () { 1544 var data = $__default["default"](this).data(DATA_KEY$8); 1545 1546 var _config = _extends({}, Default$7, $__default["default"](this).data()); 1547 1548 if (typeof config === 'object') { 1549 _config = _extends({}, _config, config); 1550 } 1551 1552 var action = typeof config === 'string' ? config : _config.slide; 1553 1554 if (!data) { 1555 data = new Carousel(this, _config); 1556 $__default["default"](this).data(DATA_KEY$8, data); 1557 } 1558 1559 if (typeof config === 'number') { 1560 data.to(config); 1561 } else if (typeof action === 'string') { 1562 if (typeof data[action] === 'undefined') { 1563 throw new TypeError("No method named \"" + action + "\""); 1564 } 1565 1566 data[action](); 1567 } else if (_config.interval && _config.ride) { 1568 data.pause(); 1569 data.cycle(); 1570 } 1571 }); 1572 }; 1573 1574 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { 1575 var selector = Util.getSelectorFromElement(this); 1576 1577 if (!selector) { 1578 return; 1579 } 1580 1581 var target = $__default["default"](selector)[0]; 1582 1583 if (!target || !$__default["default"](target).hasClass(CLASS_NAME_CAROUSEL)) { 1584 return; 1585 } 1586 1587 var config = _extends({}, $__default["default"](target).data(), $__default["default"](this).data()); 1588 1589 var slideIndex = this.getAttribute('data-slide-to'); 1590 1591 if (slideIndex) { 1592 config.interval = false; 1593 } 1594 1595 Carousel._jQueryInterface.call($__default["default"](target), config); 1596 1597 if (slideIndex) { 1598 $__default["default"](target).data(DATA_KEY$8).to(slideIndex); 1599 } 1600 1601 event.preventDefault(); 1602 }; 1603 1604 _createClass(Carousel, null, [{ 1605 key: "VERSION", 1606 get: function get() { 1607 return VERSION$8; 1608 } 1609 }, { 1610 key: "Default", 1611 get: function get() { 1612 return Default$7; 1613 } 1614 }]); 1615 1616 return Carousel; 1617 }(); 1618 /** 1619 * Data API implementation 1620 */ 1621 1622 1623 $__default["default"](document).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler); 1624 $__default["default"](window).on(EVENT_LOAD_DATA_API$1, function () { 1625 var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE)); 1626 1627 for (var i = 0, len = carousels.length; i < len; i++) { 1628 var $carousel = $__default["default"](carousels[i]); 1629 1630 Carousel._jQueryInterface.call($carousel, $carousel.data()); 1631 } 1632 }); 1633 /** 1634 * jQuery 1635 */ 1636 1637 $__default["default"].fn[NAME$8] = Carousel._jQueryInterface; 1638 $__default["default"].fn[NAME$8].Constructor = Carousel; 1639 1640 $__default["default"].fn[NAME$8].noConflict = function () { 1641 $__default["default"].fn[NAME$8] = JQUERY_NO_CONFLICT$8; 1642 return Carousel._jQueryInterface; 1643 }; 1644 1645 /** 1646 * Constants 1647 */ 1648 1649 var NAME$7 = 'collapse'; 1650 var VERSION$7 = '4.6.2'; 1651 var DATA_KEY$7 = 'bs.collapse'; 1652 var EVENT_KEY$7 = "." + DATA_KEY$7; 1653 var DATA_API_KEY$4 = '.data-api'; 1654 var JQUERY_NO_CONFLICT$7 = $__default["default"].fn[NAME$7]; 1655 var CLASS_NAME_SHOW$6 = 'show'; 1656 var CLASS_NAME_COLLAPSE = 'collapse'; 1657 var CLASS_NAME_COLLAPSING = 'collapsing'; 1658 var CLASS_NAME_COLLAPSED = 'collapsed'; 1659 var DIMENSION_WIDTH = 'width'; 1660 var DIMENSION_HEIGHT = 'height'; 1661 var EVENT_SHOW$4 = "show" + EVENT_KEY$7; 1662 var EVENT_SHOWN$4 = "shown" + EVENT_KEY$7; 1663 var EVENT_HIDE$4 = "hide" + EVENT_KEY$7; 1664 var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$7; 1665 var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$7 + DATA_API_KEY$4; 1666 var SELECTOR_ACTIVES = '.show, .collapsing'; 1667 var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="collapse"]'; 1668 var Default$6 = { 1669 toggle: true, 1670 parent: '' 1671 }; 1672 var DefaultType$6 = { 1673 toggle: 'boolean', 1674 parent: '(string|element)' 1675 }; 1676 /** 1677 * Class definition 1678 */ 1679 1680 var Collapse = /*#__PURE__*/function () { 1681 function Collapse(element, config) { 1682 this._isTransitioning = false; 1683 this._element = element; 1684 this._config = this._getConfig(config); 1685 this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); 1686 var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$3)); 1687 1688 for (var i = 0, len = toggleList.length; i < len; i++) { 1689 var elem = toggleList[i]; 1690 var selector = Util.getSelectorFromElement(elem); 1691 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { 1692 return foundElem === element; 1693 }); 1694 1695 if (selector !== null && filterElement.length > 0) { 1696 this._selector = selector; 1697 1698 this._triggerArray.push(elem); 1699 } 1700 } 1701 1702 this._parent = this._config.parent ? this._getParent() : null; 1703 1704 if (!this._config.parent) { 1705 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 1706 } 1707 1708 if (this._config.toggle) { 1709 this.toggle(); 1710 } 1711 } // Getters 1712 1713 1714 var _proto = Collapse.prototype; 1715 1716 // Public 1717 _proto.toggle = function toggle() { 1718 if ($__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 1719 this.hide(); 1720 } else { 1721 this.show(); 1722 } 1723 }; 1724 1725 _proto.show = function show() { 1726 var _this = this; 1727 1728 if (this._isTransitioning || $__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 1729 return; 1730 } 1731 1732 var actives; 1733 var activesData; 1734 1735 if (this._parent) { 1736 actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) { 1737 if (typeof _this._config.parent === 'string') { 1738 return elem.getAttribute('data-parent') === _this._config.parent; 1739 } 1740 1741 return elem.classList.contains(CLASS_NAME_COLLAPSE); 1742 }); 1743 1744 if (actives.length === 0) { 1745 actives = null; 1746 } 1747 } 1748 1749 if (actives) { 1750 activesData = $__default["default"](actives).not(this._selector).data(DATA_KEY$7); 1751 1752 if (activesData && activesData._isTransitioning) { 1753 return; 1754 } 1755 } 1756 1757 var startEvent = $__default["default"].Event(EVENT_SHOW$4); 1758 $__default["default"](this._element).trigger(startEvent); 1759 1760 if (startEvent.isDefaultPrevented()) { 1761 return; 1762 } 1763 1764 if (actives) { 1765 Collapse._jQueryInterface.call($__default["default"](actives).not(this._selector), 'hide'); 1766 1767 if (!activesData) { 1768 $__default["default"](actives).data(DATA_KEY$7, null); 1769 } 1770 } 1771 1772 var dimension = this._getDimension(); 1773 1774 $__default["default"](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING); 1775 this._element.style[dimension] = 0; 1776 1777 if (this._triggerArray.length) { 1778 $__default["default"](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true); 1779 } 1780 1781 this.setTransitioning(true); 1782 1783 var complete = function complete() { 1784 $__default["default"](_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6); 1785 _this._element.style[dimension] = ''; 1786 1787 _this.setTransitioning(false); 1788 1789 $__default["default"](_this._element).trigger(EVENT_SHOWN$4); 1790 }; 1791 1792 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 1793 var scrollSize = "scroll" + capitalizedDimension; 1794 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 1795 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 1796 this._element.style[dimension] = this._element[scrollSize] + "px"; 1797 }; 1798 1799 _proto.hide = function hide() { 1800 var _this2 = this; 1801 1802 if (this._isTransitioning || !$__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 1803 return; 1804 } 1805 1806 var startEvent = $__default["default"].Event(EVENT_HIDE$4); 1807 $__default["default"](this._element).trigger(startEvent); 1808 1809 if (startEvent.isDefaultPrevented()) { 1810 return; 1811 } 1812 1813 var dimension = this._getDimension(); 1814 1815 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; 1816 Util.reflow(this._element); 1817 $__default["default"](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6); 1818 var triggerArrayLength = this._triggerArray.length; 1819 1820 if (triggerArrayLength > 0) { 1821 for (var i = 0; i < triggerArrayLength; i++) { 1822 var trigger = this._triggerArray[i]; 1823 var selector = Util.getSelectorFromElement(trigger); 1824 1825 if (selector !== null) { 1826 var $elem = $__default["default"]([].slice.call(document.querySelectorAll(selector))); 1827 1828 if (!$elem.hasClass(CLASS_NAME_SHOW$6)) { 1829 $__default["default"](trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false); 1830 } 1831 } 1832 } 1833 } 1834 1835 this.setTransitioning(true); 1836 1837 var complete = function complete() { 1838 _this2.setTransitioning(false); 1839 1840 $__default["default"](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN$4); 1841 }; 1842 1843 this._element.style[dimension] = ''; 1844 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 1845 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 1846 }; 1847 1848 _proto.setTransitioning = function setTransitioning(isTransitioning) { 1849 this._isTransitioning = isTransitioning; 1850 }; 1851 1852 _proto.dispose = function dispose() { 1853 $__default["default"].removeData(this._element, DATA_KEY$7); 1854 this._config = null; 1855 this._parent = null; 1856 this._element = null; 1857 this._triggerArray = null; 1858 this._isTransitioning = null; 1859 } // Private 1860 ; 1861 1862 _proto._getConfig = function _getConfig(config) { 1863 config = _extends({}, Default$6, config); 1864 config.toggle = Boolean(config.toggle); // Coerce string values 1865 1866 Util.typeCheckConfig(NAME$7, config, DefaultType$6); 1867 return config; 1868 }; 1869 1870 _proto._getDimension = function _getDimension() { 1871 var hasWidth = $__default["default"](this._element).hasClass(DIMENSION_WIDTH); 1872 return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT; 1873 }; 1874 1875 _proto._getParent = function _getParent() { 1876 var _this3 = this; 1877 1878 var parent; 1879 1880 if (Util.isElement(this._config.parent)) { 1881 parent = this._config.parent; // It's a jQuery object 1882 1883 if (typeof this._config.parent.jquery !== 'undefined') { 1884 parent = this._config.parent[0]; 1885 } 1886 } else { 1887 parent = document.querySelector(this._config.parent); 1888 } 1889 1890 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; 1891 var children = [].slice.call(parent.querySelectorAll(selector)); 1892 $__default["default"](children).each(function (i, element) { 1893 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); 1894 }); 1895 return parent; 1896 }; 1897 1898 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { 1899 var isOpen = $__default["default"](element).hasClass(CLASS_NAME_SHOW$6); 1900 1901 if (triggerArray.length) { 1902 $__default["default"](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen); 1903 } 1904 } // Static 1905 ; 1906 1907 Collapse._getTargetFromElement = function _getTargetFromElement(element) { 1908 var selector = Util.getSelectorFromElement(element); 1909 return selector ? document.querySelector(selector) : null; 1910 }; 1911 1912 Collapse._jQueryInterface = function _jQueryInterface(config) { 1913 return this.each(function () { 1914 var $element = $__default["default"](this); 1915 var data = $element.data(DATA_KEY$7); 1916 1917 var _config = _extends({}, Default$6, $element.data(), typeof config === 'object' && config ? config : {}); 1918 1919 if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) { 1920 _config.toggle = false; 1921 } 1922 1923 if (!data) { 1924 data = new Collapse(this, _config); 1925 $element.data(DATA_KEY$7, data); 1926 } 1927 1928 if (typeof config === 'string') { 1929 if (typeof data[config] === 'undefined') { 1930 throw new TypeError("No method named \"" + config + "\""); 1931 } 1932 1933 data[config](); 1934 } 1935 }); 1936 }; 1937 1938 _createClass(Collapse, null, [{ 1939 key: "VERSION", 1940 get: function get() { 1941 return VERSION$7; 1942 } 1943 }, { 1944 key: "Default", 1945 get: function get() { 1946 return Default$6; 1947 } 1948 }]); 1949 1950 return Collapse; 1951 }(); 1952 /** 1953 * Data API implementation 1954 */ 1955 1956 1957 $__default["default"](document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) { 1958 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 1959 if (event.currentTarget.tagName === 'A') { 1960 event.preventDefault(); 1961 } 1962 1963 var $trigger = $__default["default"](this); 1964 var selector = Util.getSelectorFromElement(this); 1965 var selectors = [].slice.call(document.querySelectorAll(selector)); 1966 $__default["default"](selectors).each(function () { 1967 var $target = $__default["default"](this); 1968 var data = $target.data(DATA_KEY$7); 1969 var config = data ? 'toggle' : $trigger.data(); 1970 1971 Collapse._jQueryInterface.call($target, config); 1972 }); 1973 }); 1974 /** 1975 * jQuery 1976 */ 1977 1978 $__default["default"].fn[NAME$7] = Collapse._jQueryInterface; 1979 $__default["default"].fn[NAME$7].Constructor = Collapse; 1980 1981 $__default["default"].fn[NAME$7].noConflict = function () { 1982 $__default["default"].fn[NAME$7] = JQUERY_NO_CONFLICT$7; 1983 return Collapse._jQueryInterface; 1984 }; 1985 1986 /** 1987 * Constants 1988 */ 1989 1990 var NAME$6 = 'dropdown'; 1991 var VERSION$6 = '4.6.2'; 1992 var DATA_KEY$6 = 'bs.dropdown'; 1993 var EVENT_KEY$6 = "." + DATA_KEY$6; 1994 var DATA_API_KEY$3 = '.data-api'; 1995 var JQUERY_NO_CONFLICT$6 = $__default["default"].fn[NAME$6]; 1996 var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key 1997 1998 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key 1999 2000 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key 2001 2002 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key 2003 2004 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key 2005 2006 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) 2007 2008 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE$1); 2009 var CLASS_NAME_DISABLED$1 = 'disabled'; 2010 var CLASS_NAME_SHOW$5 = 'show'; 2011 var CLASS_NAME_DROPUP = 'dropup'; 2012 var CLASS_NAME_DROPRIGHT = 'dropright'; 2013 var CLASS_NAME_DROPLEFT = 'dropleft'; 2014 var CLASS_NAME_MENURIGHT = 'dropdown-menu-right'; 2015 var CLASS_NAME_POSITION_STATIC = 'position-static'; 2016 var EVENT_HIDE$3 = "hide" + EVENT_KEY$6; 2017 var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$6; 2018 var EVENT_SHOW$3 = "show" + EVENT_KEY$6; 2019 var EVENT_SHOWN$3 = "shown" + EVENT_KEY$6; 2020 var EVENT_CLICK = "click" + EVENT_KEY$6; 2021 var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$6 + DATA_API_KEY$3; 2022 var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$6 + DATA_API_KEY$3; 2023 var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$6 + DATA_API_KEY$3; 2024 var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]'; 2025 var SELECTOR_FORM_CHILD = '.dropdown form'; 2026 var SELECTOR_MENU = '.dropdown-menu'; 2027 var SELECTOR_NAVBAR_NAV = '.navbar-nav'; 2028 var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; 2029 var PLACEMENT_TOP = 'top-start'; 2030 var PLACEMENT_TOPEND = 'top-end'; 2031 var PLACEMENT_BOTTOM = 'bottom-start'; 2032 var PLACEMENT_BOTTOMEND = 'bottom-end'; 2033 var PLACEMENT_RIGHT = 'right-start'; 2034 var PLACEMENT_LEFT = 'left-start'; 2035 var Default$5 = { 2036 offset: 0, 2037 flip: true, 2038 boundary: 'scrollParent', 2039 reference: 'toggle', 2040 display: 'dynamic', 2041 popperConfig: null 2042 }; 2043 var DefaultType$5 = { 2044 offset: '(number|string|function)', 2045 flip: 'boolean', 2046 boundary: '(string|element)', 2047 reference: '(string|element)', 2048 display: 'string', 2049 popperConfig: '(null|object)' 2050 }; 2051 /** 2052 * Class definition 2053 */ 2054 2055 var Dropdown = /*#__PURE__*/function () { 2056 function Dropdown(element, config) { 2057 this._element = element; 2058 this._popper = null; 2059 this._config = this._getConfig(config); 2060 this._menu = this._getMenuElement(); 2061 this._inNavbar = this._detectNavbar(); 2062 2063 this._addEventListeners(); 2064 } // Getters 2065 2066 2067 var _proto = Dropdown.prototype; 2068 2069 // Public 2070 _proto.toggle = function toggle() { 2071 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1)) { 2072 return; 2073 } 2074 2075 var isActive = $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5); 2076 2077 Dropdown._clearMenus(); 2078 2079 if (isActive) { 2080 return; 2081 } 2082 2083 this.show(true); 2084 }; 2085 2086 _proto.show = function show(usePopper) { 2087 if (usePopper === void 0) { 2088 usePopper = false; 2089 } 2090 2091 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) { 2092 return; 2093 } 2094 2095 var relatedTarget = { 2096 relatedTarget: this._element 2097 }; 2098 var showEvent = $__default["default"].Event(EVENT_SHOW$3, relatedTarget); 2099 2100 var parent = Dropdown._getParentFromElement(this._element); 2101 2102 $__default["default"](parent).trigger(showEvent); 2103 2104 if (showEvent.isDefaultPrevented()) { 2105 return; 2106 } // Totally disable Popper for Dropdowns in Navbar 2107 2108 2109 if (!this._inNavbar && usePopper) { 2110 // Check for Popper dependency 2111 if (typeof Popper__default["default"] === 'undefined') { 2112 throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); 2113 } 2114 2115 var referenceElement = this._element; 2116 2117 if (this._config.reference === 'parent') { 2118 referenceElement = parent; 2119 } else if (Util.isElement(this._config.reference)) { 2120 referenceElement = this._config.reference; // Check if it's jQuery element 2121 2122 if (typeof this._config.reference.jquery !== 'undefined') { 2123 referenceElement = this._config.reference[0]; 2124 } 2125 } // If boundary is not `scrollParent`, then set position to `static` 2126 // to allow the menu to "escape" the scroll parent's boundaries 2127 // https://github.com/twbs/bootstrap/issues/24251 2128 2129 2130 if (this._config.boundary !== 'scrollParent') { 2131 $__default["default"](parent).addClass(CLASS_NAME_POSITION_STATIC); 2132 } 2133 2134 this._popper = new Popper__default["default"](referenceElement, this._menu, this._getPopperConfig()); 2135 } // If this is a touch-enabled device we add extra 2136 // empty mouseover listeners to the body's immediate children; 2137 // only needed because of broken event delegation on iOS 2138 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 2139 2140 2141 if ('ontouchstart' in document.documentElement && $__default["default"](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) { 2142 $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop); 2143 } 2144 2145 this._element.focus(); 2146 2147 this._element.setAttribute('aria-expanded', true); 2148 2149 $__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5); 2150 $__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_SHOWN$3, relatedTarget)); 2151 }; 2152 2153 _proto.hide = function hide() { 2154 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || !$__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) { 2155 return; 2156 } 2157 2158 var relatedTarget = { 2159 relatedTarget: this._element 2160 }; 2161 var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget); 2162 2163 var parent = Dropdown._getParentFromElement(this._element); 2164 2165 $__default["default"](parent).trigger(hideEvent); 2166 2167 if (hideEvent.isDefaultPrevented()) { 2168 return; 2169 } 2170 2171 if (this._popper) { 2172 this._popper.destroy(); 2173 } 2174 2175 $__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5); 2176 $__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget)); 2177 }; 2178 2179 _proto.dispose = function dispose() { 2180 $__default["default"].removeData(this._element, DATA_KEY$6); 2181 $__default["default"](this._element).off(EVENT_KEY$6); 2182 this._element = null; 2183 this._menu = null; 2184 2185 if (this._popper !== null) { 2186 this._popper.destroy(); 2187 2188 this._popper = null; 2189 } 2190 }; 2191 2192 _proto.update = function update() { 2193 this._inNavbar = this._detectNavbar(); 2194 2195 if (this._popper !== null) { 2196 this._popper.scheduleUpdate(); 2197 } 2198 } // Private 2199 ; 2200 2201 _proto._addEventListeners = function _addEventListeners() { 2202 var _this = this; 2203 2204 $__default["default"](this._element).on(EVENT_CLICK, function (event) { 2205 event.preventDefault(); 2206 event.stopPropagation(); 2207 2208 _this.toggle(); 2209 }); 2210 }; 2211 2212 _proto._getConfig = function _getConfig(config) { 2213 config = _extends({}, this.constructor.Default, $__default["default"](this._element).data(), config); 2214 Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType); 2215 return config; 2216 }; 2217 2218 _proto._getMenuElement = function _getMenuElement() { 2219 if (!this._menu) { 2220 var parent = Dropdown._getParentFromElement(this._element); 2221 2222 if (parent) { 2223 this._menu = parent.querySelector(SELECTOR_MENU); 2224 } 2225 } 2226 2227 return this._menu; 2228 }; 2229 2230 _proto._getPlacement = function _getPlacement() { 2231 var $parentDropdown = $__default["default"](this._element.parentNode); 2232 var placement = PLACEMENT_BOTTOM; // Handle dropup 2233 2234 if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) { 2235 placement = $__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP; 2236 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) { 2237 placement = PLACEMENT_RIGHT; 2238 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) { 2239 placement = PLACEMENT_LEFT; 2240 } else if ($__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT)) { 2241 placement = PLACEMENT_BOTTOMEND; 2242 } 2243 2244 return placement; 2245 }; 2246 2247 _proto._detectNavbar = function _detectNavbar() { 2248 return $__default["default"](this._element).closest('.navbar').length > 0; 2249 }; 2250 2251 _proto._getOffset = function _getOffset() { 2252 var _this2 = this; 2253 2254 var offset = {}; 2255 2256 if (typeof this._config.offset === 'function') { 2257 offset.fn = function (data) { 2258 data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element)); 2259 return data; 2260 }; 2261 } else { 2262 offset.offset = this._config.offset; 2263 } 2264 2265 return offset; 2266 }; 2267 2268 _proto._getPopperConfig = function _getPopperConfig() { 2269 var popperConfig = { 2270 placement: this._getPlacement(), 2271 modifiers: { 2272 offset: this._getOffset(), 2273 flip: { 2274 enabled: this._config.flip 2275 }, 2276 preventOverflow: { 2277 boundariesElement: this._config.boundary 2278 } 2279 } 2280 }; // Disable Popper if we have a static display 2281 2282 if (this._config.display === 'static') { 2283 popperConfig.modifiers.applyStyle = { 2284 enabled: false 2285 }; 2286 } 2287 2288 return _extends({}, popperConfig, this._config.popperConfig); 2289 } // Static 2290 ; 2291 2292 Dropdown._jQueryInterface = function _jQueryInterface(config) { 2293 return this.each(function () { 2294 var data = $__default["default"](this).data(DATA_KEY$6); 2295 2296 var _config = typeof config === 'object' ? config : null; 2297 2298 if (!data) { 2299 data = new Dropdown(this, _config); 2300 $__default["default"](this).data(DATA_KEY$6, data); 2301 } 2302 2303 if (typeof config === 'string') { 2304 if (typeof data[config] === 'undefined') { 2305 throw new TypeError("No method named \"" + config + "\""); 2306 } 2307 2308 data[config](); 2309 } 2310 }); 2311 }; 2312 2313 Dropdown._clearMenus = function _clearMenus(event) { 2314 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { 2315 return; 2316 } 2317 2318 var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2)); 2319 2320 for (var i = 0, len = toggles.length; i < len; i++) { 2321 var parent = Dropdown._getParentFromElement(toggles[i]); 2322 2323 var context = $__default["default"](toggles[i]).data(DATA_KEY$6); 2324 var relatedTarget = { 2325 relatedTarget: toggles[i] 2326 }; 2327 2328 if (event && event.type === 'click') { 2329 relatedTarget.clickEvent = event; 2330 } 2331 2332 if (!context) { 2333 continue; 2334 } 2335 2336 var dropdownMenu = context._menu; 2337 2338 if (!$__default["default"](parent).hasClass(CLASS_NAME_SHOW$5)) { 2339 continue; 2340 } 2341 2342 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $__default["default"].contains(parent, event.target)) { 2343 continue; 2344 } 2345 2346 var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget); 2347 $__default["default"](parent).trigger(hideEvent); 2348 2349 if (hideEvent.isDefaultPrevented()) { 2350 continue; 2351 } // If this is a touch-enabled device we remove the extra 2352 // empty mouseover listeners we added for iOS support 2353 2354 2355 if ('ontouchstart' in document.documentElement) { 2356 $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop); 2357 } 2358 2359 toggles[i].setAttribute('aria-expanded', 'false'); 2360 2361 if (context._popper) { 2362 context._popper.destroy(); 2363 } 2364 2365 $__default["default"](dropdownMenu).removeClass(CLASS_NAME_SHOW$5); 2366 $__default["default"](parent).removeClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget)); 2367 } 2368 }; 2369 2370 Dropdown._getParentFromElement = function _getParentFromElement(element) { 2371 var parent; 2372 var selector = Util.getSelectorFromElement(element); 2373 2374 if (selector) { 2375 parent = document.querySelector(selector); 2376 } 2377 2378 return parent || element.parentNode; 2379 } // eslint-disable-next-line complexity 2380 ; 2381 2382 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { 2383 // If not input/textarea: 2384 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 2385 // If input/textarea: 2386 // - If space key => not a dropdown command 2387 // - If key is other than escape 2388 // - If key is not up or down => not a dropdown command 2389 // - If trigger inside the menu => not a dropdown command 2390 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE$1 && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $__default["default"](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { 2391 return; 2392 } 2393 2394 if (this.disabled || $__default["default"](this).hasClass(CLASS_NAME_DISABLED$1)) { 2395 return; 2396 } 2397 2398 var parent = Dropdown._getParentFromElement(this); 2399 2400 var isActive = $__default["default"](parent).hasClass(CLASS_NAME_SHOW$5); 2401 2402 if (!isActive && event.which === ESCAPE_KEYCODE$1) { 2403 return; 2404 } 2405 2406 event.preventDefault(); 2407 event.stopPropagation(); 2408 2409 if (!isActive || event.which === ESCAPE_KEYCODE$1 || event.which === SPACE_KEYCODE) { 2410 if (event.which === ESCAPE_KEYCODE$1) { 2411 $__default["default"](parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus'); 2412 } 2413 2414 $__default["default"](this).trigger('click'); 2415 return; 2416 } 2417 2418 var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) { 2419 return $__default["default"](item).is(':visible'); 2420 }); 2421 2422 if (items.length === 0) { 2423 return; 2424 } 2425 2426 var index = items.indexOf(event.target); 2427 2428 if (event.which === ARROW_UP_KEYCODE && index > 0) { 2429 // Up 2430 index--; 2431 } 2432 2433 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { 2434 // Down 2435 index++; 2436 } 2437 2438 if (index < 0) { 2439 index = 0; 2440 } 2441 2442 items[index].focus(); 2443 }; 2444 2445 _createClass(Dropdown, null, [{ 2446 key: "VERSION", 2447 get: function get() { 2448 return VERSION$6; 2449 } 2450 }, { 2451 key: "Default", 2452 get: function get() { 2453 return Default$5; 2454 } 2455 }, { 2456 key: "DefaultType", 2457 get: function get() { 2458 return DefaultType$5; 2459 } 2460 }]); 2461 2462 return Dropdown; 2463 }(); 2464 /** 2465 * Data API implementation 2466 */ 2467 2468 2469 $__default["default"](document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$2 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) { 2470 event.preventDefault(); 2471 event.stopPropagation(); 2472 2473 Dropdown._jQueryInterface.call($__default["default"](this), 'toggle'); 2474 }).on(EVENT_CLICK_DATA_API$2, SELECTOR_FORM_CHILD, function (e) { 2475 e.stopPropagation(); 2476 }); 2477 /** 2478 * jQuery 2479 */ 2480 2481 $__default["default"].fn[NAME$6] = Dropdown._jQueryInterface; 2482 $__default["default"].fn[NAME$6].Constructor = Dropdown; 2483 2484 $__default["default"].fn[NAME$6].noConflict = function () { 2485 $__default["default"].fn[NAME$6] = JQUERY_NO_CONFLICT$6; 2486 return Dropdown._jQueryInterface; 2487 }; 2488 2489 /** 2490 * Constants 2491 */ 2492 2493 var NAME$5 = 'modal'; 2494 var VERSION$5 = '4.6.2'; 2495 var DATA_KEY$5 = 'bs.modal'; 2496 var EVENT_KEY$5 = "." + DATA_KEY$5; 2497 var DATA_API_KEY$2 = '.data-api'; 2498 var JQUERY_NO_CONFLICT$5 = $__default["default"].fn[NAME$5]; 2499 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 2500 2501 var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable'; 2502 var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure'; 2503 var CLASS_NAME_BACKDROP = 'modal-backdrop'; 2504 var CLASS_NAME_OPEN = 'modal-open'; 2505 var CLASS_NAME_FADE$4 = 'fade'; 2506 var CLASS_NAME_SHOW$4 = 'show'; 2507 var CLASS_NAME_STATIC = 'modal-static'; 2508 var EVENT_HIDE$2 = "hide" + EVENT_KEY$5; 2509 var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5; 2510 var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5; 2511 var EVENT_SHOW$2 = "show" + EVENT_KEY$5; 2512 var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5; 2513 var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5; 2514 var EVENT_RESIZE = "resize" + EVENT_KEY$5; 2515 var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$5; 2516 var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5; 2517 var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5; 2518 var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5; 2519 var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$5 + DATA_API_KEY$2; 2520 var SELECTOR_DIALOG = '.modal-dialog'; 2521 var SELECTOR_MODAL_BODY = '.modal-body'; 2522 var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="modal"]'; 2523 var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="modal"]'; 2524 var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; 2525 var SELECTOR_STICKY_CONTENT = '.sticky-top'; 2526 var Default$4 = { 2527 backdrop: true, 2528 keyboard: true, 2529 focus: true, 2530 show: true 2531 }; 2532 var DefaultType$4 = { 2533 backdrop: '(boolean|string)', 2534 keyboard: 'boolean', 2535 focus: 'boolean', 2536 show: 'boolean' 2537 }; 2538 /** 2539 * Class definition 2540 */ 2541 2542 var Modal = /*#__PURE__*/function () { 2543 function Modal(element, config) { 2544 this._config = this._getConfig(config); 2545 this._element = element; 2546 this._dialog = element.querySelector(SELECTOR_DIALOG); 2547 this._backdrop = null; 2548 this._isShown = false; 2549 this._isBodyOverflowing = false; 2550 this._ignoreBackdropClick = false; 2551 this._isTransitioning = false; 2552 this._scrollbarWidth = 0; 2553 } // Getters 2554 2555 2556 var _proto = Modal.prototype; 2557 2558 // Public 2559 _proto.toggle = function toggle(relatedTarget) { 2560 return this._isShown ? this.hide() : this.show(relatedTarget); 2561 }; 2562 2563 _proto.show = function show(relatedTarget) { 2564 var _this = this; 2565 2566 if (this._isShown || this._isTransitioning) { 2567 return; 2568 } 2569 2570 var showEvent = $__default["default"].Event(EVENT_SHOW$2, { 2571 relatedTarget: relatedTarget 2572 }); 2573 $__default["default"](this._element).trigger(showEvent); 2574 2575 if (showEvent.isDefaultPrevented()) { 2576 return; 2577 } 2578 2579 this._isShown = true; 2580 2581 if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) { 2582 this._isTransitioning = true; 2583 } 2584 2585 this._checkScrollbar(); 2586 2587 this._setScrollbar(); 2588 2589 this._adjustDialog(); 2590 2591 this._setEscapeEvent(); 2592 2593 this._setResizeEvent(); 2594 2595 $__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function (event) { 2596 return _this.hide(event); 2597 }); 2598 $__default["default"](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () { 2599 $__default["default"](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) { 2600 if ($__default["default"](event.target).is(_this._element)) { 2601 _this._ignoreBackdropClick = true; 2602 } 2603 }); 2604 }); 2605 2606 this._showBackdrop(function () { 2607 return _this._showElement(relatedTarget); 2608 }); 2609 }; 2610 2611 _proto.hide = function hide(event) { 2612 var _this2 = this; 2613 2614 if (event) { 2615 event.preventDefault(); 2616 } 2617 2618 if (!this._isShown || this._isTransitioning) { 2619 return; 2620 } 2621 2622 var hideEvent = $__default["default"].Event(EVENT_HIDE$2); 2623 $__default["default"](this._element).trigger(hideEvent); 2624 2625 if (!this._isShown || hideEvent.isDefaultPrevented()) { 2626 return; 2627 } 2628 2629 this._isShown = false; 2630 var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4); 2631 2632 if (transition) { 2633 this._isTransitioning = true; 2634 } 2635 2636 this._setEscapeEvent(); 2637 2638 this._setResizeEvent(); 2639 2640 $__default["default"](document).off(EVENT_FOCUSIN); 2641 $__default["default"](this._element).removeClass(CLASS_NAME_SHOW$4); 2642 $__default["default"](this._element).off(EVENT_CLICK_DISMISS$1); 2643 $__default["default"](this._dialog).off(EVENT_MOUSEDOWN_DISMISS); 2644 2645 if (transition) { 2646 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 2647 $__default["default"](this._element).one(Util.TRANSITION_END, function (event) { 2648 return _this2._hideModal(event); 2649 }).emulateTransitionEnd(transitionDuration); 2650 } else { 2651 this._hideModal(); 2652 } 2653 }; 2654 2655 _proto.dispose = function dispose() { 2656 [window, this._element, this._dialog].forEach(function (htmlElement) { 2657 return $__default["default"](htmlElement).off(EVENT_KEY$5); 2658 }); 2659 /** 2660 * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API` 2661 * Do not move `document` in `htmlElements` array 2662 * It will remove `EVENT_CLICK_DATA_API` event that should remain 2663 */ 2664 2665 $__default["default"](document).off(EVENT_FOCUSIN); 2666 $__default["default"].removeData(this._element, DATA_KEY$5); 2667 this._config = null; 2668 this._element = null; 2669 this._dialog = null; 2670 this._backdrop = null; 2671 this._isShown = null; 2672 this._isBodyOverflowing = null; 2673 this._ignoreBackdropClick = null; 2674 this._isTransitioning = null; 2675 this._scrollbarWidth = null; 2676 }; 2677 2678 _proto.handleUpdate = function handleUpdate() { 2679 this._adjustDialog(); 2680 } // Private 2681 ; 2682 2683 _proto._getConfig = function _getConfig(config) { 2684 config = _extends({}, Default$4, config); 2685 Util.typeCheckConfig(NAME$5, config, DefaultType$4); 2686 return config; 2687 }; 2688 2689 _proto._triggerBackdropTransition = function _triggerBackdropTransition() { 2690 var _this3 = this; 2691 2692 var hideEventPrevented = $__default["default"].Event(EVENT_HIDE_PREVENTED); 2693 $__default["default"](this._element).trigger(hideEventPrevented); 2694 2695 if (hideEventPrevented.isDefaultPrevented()) { 2696 return; 2697 } 2698 2699 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 2700 2701 if (!isModalOverflowing) { 2702 this._element.style.overflowY = 'hidden'; 2703 } 2704 2705 this._element.classList.add(CLASS_NAME_STATIC); 2706 2707 var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog); 2708 $__default["default"](this._element).off(Util.TRANSITION_END); 2709 $__default["default"](this._element).one(Util.TRANSITION_END, function () { 2710 _this3._element.classList.remove(CLASS_NAME_STATIC); 2711 2712 if (!isModalOverflowing) { 2713 $__default["default"](_this3._element).one(Util.TRANSITION_END, function () { 2714 _this3._element.style.overflowY = ''; 2715 }).emulateTransitionEnd(_this3._element, modalTransitionDuration); 2716 } 2717 }).emulateTransitionEnd(modalTransitionDuration); 2718 2719 this._element.focus(); 2720 }; 2721 2722 _proto._showElement = function _showElement(relatedTarget) { 2723 var _this4 = this; 2724 2725 var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4); 2726 var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null; 2727 2728 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 2729 // Don't move modal's DOM position 2730 document.body.appendChild(this._element); 2731 } 2732 2733 this._element.style.display = 'block'; 2734 2735 this._element.removeAttribute('aria-hidden'); 2736 2737 this._element.setAttribute('aria-modal', true); 2738 2739 this._element.setAttribute('role', 'dialog'); 2740 2741 if ($__default["default"](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) { 2742 modalBody.scrollTop = 0; 2743 } else { 2744 this._element.scrollTop = 0; 2745 } 2746 2747 if (transition) { 2748 Util.reflow(this._element); 2749 } 2750 2751 $__default["default"](this._element).addClass(CLASS_NAME_SHOW$4); 2752 2753 if (this._config.focus) { 2754 this._enforceFocus(); 2755 } 2756 2757 var shownEvent = $__default["default"].Event(EVENT_SHOWN$2, { 2758 relatedTarget: relatedTarget 2759 }); 2760 2761 var transitionComplete = function transitionComplete() { 2762 if (_this4._config.focus) { 2763 _this4._element.focus(); 2764 } 2765 2766 _this4._isTransitioning = false; 2767 $__default["default"](_this4._element).trigger(shownEvent); 2768 }; 2769 2770 if (transition) { 2771 var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); 2772 $__default["default"](this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); 2773 } else { 2774 transitionComplete(); 2775 } 2776 }; 2777 2778 _proto._enforceFocus = function _enforceFocus() { 2779 var _this5 = this; 2780 2781 $__default["default"](document).off(EVENT_FOCUSIN) // Guard against infinite focus loop 2782 .on(EVENT_FOCUSIN, function (event) { 2783 if (document !== event.target && _this5._element !== event.target && $__default["default"](_this5._element).has(event.target).length === 0) { 2784 _this5._element.focus(); 2785 } 2786 }); 2787 }; 2788 2789 _proto._setEscapeEvent = function _setEscapeEvent() { 2790 var _this6 = this; 2791 2792 if (this._isShown) { 2793 $__default["default"](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) { 2794 if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE) { 2795 event.preventDefault(); 2796 2797 _this6.hide(); 2798 } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE) { 2799 _this6._triggerBackdropTransition(); 2800 } 2801 }); 2802 } else if (!this._isShown) { 2803 $__default["default"](this._element).off(EVENT_KEYDOWN_DISMISS); 2804 } 2805 }; 2806 2807 _proto._setResizeEvent = function _setResizeEvent() { 2808 var _this7 = this; 2809 2810 if (this._isShown) { 2811 $__default["default"](window).on(EVENT_RESIZE, function (event) { 2812 return _this7.handleUpdate(event); 2813 }); 2814 } else { 2815 $__default["default"](window).off(EVENT_RESIZE); 2816 } 2817 }; 2818 2819 _proto._hideModal = function _hideModal() { 2820 var _this8 = this; 2821 2822 this._element.style.display = 'none'; 2823 2824 this._element.setAttribute('aria-hidden', true); 2825 2826 this._element.removeAttribute('aria-modal'); 2827 2828 this._element.removeAttribute('role'); 2829 2830 this._isTransitioning = false; 2831 2832 this._showBackdrop(function () { 2833 $__default["default"](document.body).removeClass(CLASS_NAME_OPEN); 2834 2835 _this8._resetAdjustments(); 2836 2837 _this8._resetScrollbar(); 2838 2839 $__default["default"](_this8._element).trigger(EVENT_HIDDEN$2); 2840 }); 2841 }; 2842 2843 _proto._removeBackdrop = function _removeBackdrop() { 2844 if (this._backdrop) { 2845 $__default["default"](this._backdrop).remove(); 2846 this._backdrop = null; 2847 } 2848 }; 2849 2850 _proto._showBackdrop = function _showBackdrop(callback) { 2851 var _this9 = this; 2852 2853 var animate = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4) ? CLASS_NAME_FADE$4 : ''; 2854 2855 if (this._isShown && this._config.backdrop) { 2856 this._backdrop = document.createElement('div'); 2857 this._backdrop.className = CLASS_NAME_BACKDROP; 2858 2859 if (animate) { 2860 this._backdrop.classList.add(animate); 2861 } 2862 2863 $__default["default"](this._backdrop).appendTo(document.body); 2864 $__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, function (event) { 2865 if (_this9._ignoreBackdropClick) { 2866 _this9._ignoreBackdropClick = false; 2867 return; 2868 } 2869 2870 if (event.target !== event.currentTarget) { 2871 return; 2872 } 2873 2874 if (_this9._config.backdrop === 'static') { 2875 _this9._triggerBackdropTransition(); 2876 } else { 2877 _this9.hide(); 2878 } 2879 }); 2880 2881 if (animate) { 2882 Util.reflow(this._backdrop); 2883 } 2884 2885 $__default["default"](this._backdrop).addClass(CLASS_NAME_SHOW$4); 2886 2887 if (!callback) { 2888 return; 2889 } 2890 2891 if (!animate) { 2892 callback(); 2893 return; 2894 } 2895 2896 var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 2897 $__default["default"](this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); 2898 } else if (!this._isShown && this._backdrop) { 2899 $__default["default"](this._backdrop).removeClass(CLASS_NAME_SHOW$4); 2900 2901 var callbackRemove = function callbackRemove() { 2902 _this9._removeBackdrop(); 2903 2904 if (callback) { 2905 callback(); 2906 } 2907 }; 2908 2909 if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) { 2910 var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 2911 2912 $__default["default"](this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); 2913 } else { 2914 callbackRemove(); 2915 } 2916 } else if (callback) { 2917 callback(); 2918 } 2919 } // ---------------------------------------------------------------------- 2920 // the following methods are used to handle overflowing modals 2921 // todo (fat): these should probably be refactored out of modal.js 2922 // ---------------------------------------------------------------------- 2923 ; 2924 2925 _proto._adjustDialog = function _adjustDialog() { 2926 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 2927 2928 if (!this._isBodyOverflowing && isModalOverflowing) { 2929 this._element.style.paddingLeft = this._scrollbarWidth + "px"; 2930 } 2931 2932 if (this._isBodyOverflowing && !isModalOverflowing) { 2933 this._element.style.paddingRight = this._scrollbarWidth + "px"; 2934 } 2935 }; 2936 2937 _proto._resetAdjustments = function _resetAdjustments() { 2938 this._element.style.paddingLeft = ''; 2939 this._element.style.paddingRight = ''; 2940 }; 2941 2942 _proto._checkScrollbar = function _checkScrollbar() { 2943 var rect = document.body.getBoundingClientRect(); 2944 this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth; 2945 this._scrollbarWidth = this._getScrollbarWidth(); 2946 }; 2947 2948 _proto._setScrollbar = function _setScrollbar() { 2949 var _this10 = this; 2950 2951 if (this._isBodyOverflowing) { 2952 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 2953 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 2954 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 2955 var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding 2956 2957 $__default["default"](fixedContent).each(function (index, element) { 2958 var actualPadding = element.style.paddingRight; 2959 var calculatedPadding = $__default["default"](element).css('padding-right'); 2960 $__default["default"](element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px"); 2961 }); // Adjust sticky content margin 2962 2963 $__default["default"](stickyContent).each(function (index, element) { 2964 var actualMargin = element.style.marginRight; 2965 var calculatedMargin = $__default["default"](element).css('margin-right'); 2966 $__default["default"](element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px"); 2967 }); // Adjust body padding 2968 2969 var actualPadding = document.body.style.paddingRight; 2970 var calculatedPadding = $__default["default"](document.body).css('padding-right'); 2971 $__default["default"](document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); 2972 } 2973 2974 $__default["default"](document.body).addClass(CLASS_NAME_OPEN); 2975 }; 2976 2977 _proto._resetScrollbar = function _resetScrollbar() { 2978 // Restore fixed content padding 2979 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 2980 $__default["default"](fixedContent).each(function (index, element) { 2981 var padding = $__default["default"](element).data('padding-right'); 2982 $__default["default"](element).removeData('padding-right'); 2983 element.style.paddingRight = padding ? padding : ''; 2984 }); // Restore sticky content 2985 2986 var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT)); 2987 $__default["default"](elements).each(function (index, element) { 2988 var margin = $__default["default"](element).data('margin-right'); 2989 2990 if (typeof margin !== 'undefined') { 2991 $__default["default"](element).css('margin-right', margin).removeData('margin-right'); 2992 } 2993 }); // Restore body padding 2994 2995 var padding = $__default["default"](document.body).data('padding-right'); 2996 $__default["default"](document.body).removeData('padding-right'); 2997 document.body.style.paddingRight = padding ? padding : ''; 2998 }; 2999 3000 _proto._getScrollbarWidth = function _getScrollbarWidth() { 3001 // thx d.walsh 3002 var scrollDiv = document.createElement('div'); 3003 scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER; 3004 document.body.appendChild(scrollDiv); 3005 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 3006 document.body.removeChild(scrollDiv); 3007 return scrollbarWidth; 3008 } // Static 3009 ; 3010 3011 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { 3012 return this.each(function () { 3013 var data = $__default["default"](this).data(DATA_KEY$5); 3014 3015 var _config = _extends({}, Default$4, $__default["default"](this).data(), typeof config === 'object' && config ? config : {}); 3016 3017 if (!data) { 3018 data = new Modal(this, _config); 3019 $__default["default"](this).data(DATA_KEY$5, data); 3020 } 3021 3022 if (typeof config === 'string') { 3023 if (typeof data[config] === 'undefined') { 3024 throw new TypeError("No method named \"" + config + "\""); 3025 } 3026 3027 data[config](relatedTarget); 3028 } else if (_config.show) { 3029 data.show(relatedTarget); 3030 } 3031 }); 3032 }; 3033 3034 _createClass(Modal, null, [{ 3035 key: "VERSION", 3036 get: function get() { 3037 return VERSION$5; 3038 } 3039 }, { 3040 key: "Default", 3041 get: function get() { 3042 return Default$4; 3043 } 3044 }]); 3045 3046 return Modal; 3047 }(); 3048 /** 3049 * Data API implementation 3050 */ 3051 3052 3053 $__default["default"](document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { 3054 var _this11 = this; 3055 3056 var target; 3057 var selector = Util.getSelectorFromElement(this); 3058 3059 if (selector) { 3060 target = document.querySelector(selector); 3061 } 3062 3063 var config = $__default["default"](target).data(DATA_KEY$5) ? 'toggle' : _extends({}, $__default["default"](target).data(), $__default["default"](this).data()); 3064 3065 if (this.tagName === 'A' || this.tagName === 'AREA') { 3066 event.preventDefault(); 3067 } 3068 3069 var $target = $__default["default"](target).one(EVENT_SHOW$2, function (showEvent) { 3070 if (showEvent.isDefaultPrevented()) { 3071 // Only register focus restorer if modal will actually get shown 3072 return; 3073 } 3074 3075 $target.one(EVENT_HIDDEN$2, function () { 3076 if ($__default["default"](_this11).is(':visible')) { 3077 _this11.focus(); 3078 } 3079 }); 3080 }); 3081 3082 Modal._jQueryInterface.call($__default["default"](target), config, this); 3083 }); 3084 /** 3085 * jQuery 3086 */ 3087 3088 $__default["default"].fn[NAME$5] = Modal._jQueryInterface; 3089 $__default["default"].fn[NAME$5].Constructor = Modal; 3090 3091 $__default["default"].fn[NAME$5].noConflict = function () { 3092 $__default["default"].fn[NAME$5] = JQUERY_NO_CONFLICT$5; 3093 return Modal._jQueryInterface; 3094 }; 3095 3096 /** 3097 * -------------------------------------------------------------------------- 3098 * Bootstrap (v4.6.2): tools/sanitizer.js 3099 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 3100 * -------------------------------------------------------------------------- 3101 */ 3102 var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; 3103 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 3104 var DefaultWhitelist = { 3105 // Global attributes allowed on any supplied element below. 3106 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 3107 a: ['target', 'href', 'title', 'rel'], 3108 area: [], 3109 b: [], 3110 br: [], 3111 col: [], 3112 code: [], 3113 div: [], 3114 em: [], 3115 hr: [], 3116 h1: [], 3117 h2: [], 3118 h3: [], 3119 h4: [], 3120 h5: [], 3121 h6: [], 3122 i: [], 3123 img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], 3124 li: [], 3125 ol: [], 3126 p: [], 3127 pre: [], 3128 s: [], 3129 small: [], 3130 span: [], 3131 sub: [], 3132 sup: [], 3133 strong: [], 3134 u: [], 3135 ul: [] 3136 }; 3137 /** 3138 * A pattern that recognizes a commonly useful subset of URLs that are safe. 3139 * 3140 * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts 3141 */ 3142 3143 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i; 3144 /** 3145 * A pattern that matches safe data URLs. Only matches image, video and audio types. 3146 * 3147 * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts 3148 */ 3149 3150 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i; 3151 3152 function allowedAttribute(attr, allowedAttributeList) { 3153 var attrName = attr.nodeName.toLowerCase(); 3154 3155 if (allowedAttributeList.indexOf(attrName) !== -1) { 3156 if (uriAttrs.indexOf(attrName) !== -1) { 3157 return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue)); 3158 } 3159 3160 return true; 3161 } 3162 3163 var regExp = allowedAttributeList.filter(function (attrRegex) { 3164 return attrRegex instanceof RegExp; 3165 }); // Check if a regular expression validates the attribute. 3166 3167 for (var i = 0, len = regExp.length; i < len; i++) { 3168 if (regExp[i].test(attrName)) { 3169 return true; 3170 } 3171 } 3172 3173 return false; 3174 } 3175 3176 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 3177 if (unsafeHtml.length === 0) { 3178 return unsafeHtml; 3179 } 3180 3181 if (sanitizeFn && typeof sanitizeFn === 'function') { 3182 return sanitizeFn(unsafeHtml); 3183 } 3184 3185 var domParser = new window.DOMParser(); 3186 var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 3187 var whitelistKeys = Object.keys(whiteList); 3188 var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); 3189 3190 var _loop = function _loop(i, len) { 3191 var el = elements[i]; 3192 var elName = el.nodeName.toLowerCase(); 3193 3194 if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { 3195 el.parentNode.removeChild(el); 3196 return "continue"; 3197 } 3198 3199 var attributeList = [].slice.call(el.attributes); // eslint-disable-next-line unicorn/prefer-spread 3200 3201 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); 3202 attributeList.forEach(function (attr) { 3203 if (!allowedAttribute(attr, whitelistedAttributes)) { 3204 el.removeAttribute(attr.nodeName); 3205 } 3206 }); 3207 }; 3208 3209 for (var i = 0, len = elements.length; i < len; i++) { 3210 var _ret = _loop(i); 3211 3212 if (_ret === "continue") continue; 3213 } 3214 3215 return createdDocument.body.innerHTML; 3216 } 3217 3218 /** 3219 * Constants 3220 */ 3221 3222 var NAME$4 = 'tooltip'; 3223 var VERSION$4 = '4.6.2'; 3224 var DATA_KEY$4 = 'bs.tooltip'; 3225 var EVENT_KEY$4 = "." + DATA_KEY$4; 3226 var JQUERY_NO_CONFLICT$4 = $__default["default"].fn[NAME$4]; 3227 var CLASS_PREFIX$1 = 'bs-tooltip'; 3228 var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); 3229 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; 3230 var CLASS_NAME_FADE$3 = 'fade'; 3231 var CLASS_NAME_SHOW$3 = 'show'; 3232 var HOVER_STATE_SHOW = 'show'; 3233 var HOVER_STATE_OUT = 'out'; 3234 var SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; 3235 var SELECTOR_ARROW = '.arrow'; 3236 var TRIGGER_HOVER = 'hover'; 3237 var TRIGGER_FOCUS = 'focus'; 3238 var TRIGGER_CLICK = 'click'; 3239 var TRIGGER_MANUAL = 'manual'; 3240 var AttachmentMap = { 3241 AUTO: 'auto', 3242 TOP: 'top', 3243 RIGHT: 'right', 3244 BOTTOM: 'bottom', 3245 LEFT: 'left' 3246 }; 3247 var Default$3 = { 3248 animation: true, 3249 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', 3250 trigger: 'hover focus', 3251 title: '', 3252 delay: 0, 3253 html: false, 3254 selector: false, 3255 placement: 'top', 3256 offset: 0, 3257 container: false, 3258 fallbackPlacement: 'flip', 3259 boundary: 'scrollParent', 3260 customClass: '', 3261 sanitize: true, 3262 sanitizeFn: null, 3263 whiteList: DefaultWhitelist, 3264 popperConfig: null 3265 }; 3266 var DefaultType$3 = { 3267 animation: 'boolean', 3268 template: 'string', 3269 title: '(string|element|function)', 3270 trigger: 'string', 3271 delay: '(number|object)', 3272 html: 'boolean', 3273 selector: '(string|boolean)', 3274 placement: '(string|function)', 3275 offset: '(number|string|function)', 3276 container: '(string|element|boolean)', 3277 fallbackPlacement: '(string|array)', 3278 boundary: '(string|element)', 3279 customClass: '(string|function)', 3280 sanitize: 'boolean', 3281 sanitizeFn: '(null|function)', 3282 whiteList: 'object', 3283 popperConfig: '(null|object)' 3284 }; 3285 var Event$1 = { 3286 HIDE: "hide" + EVENT_KEY$4, 3287 HIDDEN: "hidden" + EVENT_KEY$4, 3288 SHOW: "show" + EVENT_KEY$4, 3289 SHOWN: "shown" + EVENT_KEY$4, 3290 INSERTED: "inserted" + EVENT_KEY$4, 3291 CLICK: "click" + EVENT_KEY$4, 3292 FOCUSIN: "focusin" + EVENT_KEY$4, 3293 FOCUSOUT: "focusout" + EVENT_KEY$4, 3294 MOUSEENTER: "mouseenter" + EVENT_KEY$4, 3295 MOUSELEAVE: "mouseleave" + EVENT_KEY$4 3296 }; 3297 /** 3298 * Class definition 3299 */ 3300 3301 var Tooltip = /*#__PURE__*/function () { 3302 function Tooltip(element, config) { 3303 if (typeof Popper__default["default"] === 'undefined') { 3304 throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); 3305 } // Private 3306 3307 3308 this._isEnabled = true; 3309 this._timeout = 0; 3310 this._hoverState = ''; 3311 this._activeTrigger = {}; 3312 this._popper = null; // Protected 3313 3314 this.element = element; 3315 this.config = this._getConfig(config); 3316 this.tip = null; 3317 3318 this._setListeners(); 3319 } // Getters 3320 3321 3322 var _proto = Tooltip.prototype; 3323 3324 // Public 3325 _proto.enable = function enable() { 3326 this._isEnabled = true; 3327 }; 3328 3329 _proto.disable = function disable() { 3330 this._isEnabled = false; 3331 }; 3332 3333 _proto.toggleEnabled = function toggleEnabled() { 3334 this._isEnabled = !this._isEnabled; 3335 }; 3336 3337 _proto.toggle = function toggle(event) { 3338 if (!this._isEnabled) { 3339 return; 3340 } 3341 3342 if (event) { 3343 var dataKey = this.constructor.DATA_KEY; 3344 var context = $__default["default"](event.currentTarget).data(dataKey); 3345 3346 if (!context) { 3347 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 3348 $__default["default"](event.currentTarget).data(dataKey, context); 3349 } 3350 3351 context._activeTrigger.click = !context._activeTrigger.click; 3352 3353 if (context._isWithActiveTrigger()) { 3354 context._enter(null, context); 3355 } else { 3356 context._leave(null, context); 3357 } 3358 } else { 3359 if ($__default["default"](this.getTipElement()).hasClass(CLASS_NAME_SHOW$3)) { 3360 this._leave(null, this); 3361 3362 return; 3363 } 3364 3365 this._enter(null, this); 3366 } 3367 }; 3368 3369 _proto.dispose = function dispose() { 3370 clearTimeout(this._timeout); 3371 $__default["default"].removeData(this.element, this.constructor.DATA_KEY); 3372 $__default["default"](this.element).off(this.constructor.EVENT_KEY); 3373 $__default["default"](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler); 3374 3375 if (this.tip) { 3376 $__default["default"](this.tip).remove(); 3377 } 3378 3379 this._isEnabled = null; 3380 this._timeout = null; 3381 this._hoverState = null; 3382 this._activeTrigger = null; 3383 3384 if (this._popper) { 3385 this._popper.destroy(); 3386 } 3387 3388 this._popper = null; 3389 this.element = null; 3390 this.config = null; 3391 this.tip = null; 3392 }; 3393 3394 _proto.show = function show() { 3395 var _this = this; 3396 3397 if ($__default["default"](this.element).css('display') === 'none') { 3398 throw new Error('Please use show on visible elements'); 3399 } 3400 3401 var showEvent = $__default["default"].Event(this.constructor.Event.SHOW); 3402 3403 if (this.isWithContent() && this._isEnabled) { 3404 $__default["default"](this.element).trigger(showEvent); 3405 var shadowRoot = Util.findShadowRoot(this.element); 3406 var isInTheDom = $__default["default"].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); 3407 3408 if (showEvent.isDefaultPrevented() || !isInTheDom) { 3409 return; 3410 } 3411 3412 var tip = this.getTipElement(); 3413 var tipId = Util.getUID(this.constructor.NAME); 3414 tip.setAttribute('id', tipId); 3415 this.element.setAttribute('aria-describedby', tipId); 3416 this.setContent(); 3417 3418 if (this.config.animation) { 3419 $__default["default"](tip).addClass(CLASS_NAME_FADE$3); 3420 } 3421 3422 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; 3423 3424 var attachment = this._getAttachment(placement); 3425 3426 this.addAttachmentClass(attachment); 3427 3428 var container = this._getContainer(); 3429 3430 $__default["default"](tip).data(this.constructor.DATA_KEY, this); 3431 3432 if (!$__default["default"].contains(this.element.ownerDocument.documentElement, this.tip)) { 3433 $__default["default"](tip).appendTo(container); 3434 } 3435 3436 $__default["default"](this.element).trigger(this.constructor.Event.INSERTED); 3437 this._popper = new Popper__default["default"](this.element, tip, this._getPopperConfig(attachment)); 3438 $__default["default"](tip).addClass(CLASS_NAME_SHOW$3); 3439 $__default["default"](tip).addClass(this.config.customClass); // If this is a touch-enabled device we add extra 3440 // empty mouseover listeners to the body's immediate children; 3441 // only needed because of broken event delegation on iOS 3442 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 3443 3444 if ('ontouchstart' in document.documentElement) { 3445 $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop); 3446 } 3447 3448 var complete = function complete() { 3449 if (_this.config.animation) { 3450 _this._fixTransition(); 3451 } 3452 3453 var prevHoverState = _this._hoverState; 3454 _this._hoverState = null; 3455 $__default["default"](_this.element).trigger(_this.constructor.Event.SHOWN); 3456 3457 if (prevHoverState === HOVER_STATE_OUT) { 3458 _this._leave(null, _this); 3459 } 3460 }; 3461 3462 if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) { 3463 var transitionDuration = Util.getTransitionDurationFromElement(this.tip); 3464 $__default["default"](this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 3465 } else { 3466 complete(); 3467 } 3468 } 3469 }; 3470 3471 _proto.hide = function hide(callback) { 3472 var _this2 = this; 3473 3474 var tip = this.getTipElement(); 3475 var hideEvent = $__default["default"].Event(this.constructor.Event.HIDE); 3476 3477 var complete = function complete() { 3478 if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) { 3479 tip.parentNode.removeChild(tip); 3480 } 3481 3482 _this2._cleanTipClass(); 3483 3484 _this2.element.removeAttribute('aria-describedby'); 3485 3486 $__default["default"](_this2.element).trigger(_this2.constructor.Event.HIDDEN); 3487 3488 if (_this2._popper !== null) { 3489 _this2._popper.destroy(); 3490 } 3491 3492 if (callback) { 3493 callback(); 3494 } 3495 }; 3496 3497 $__default["default"](this.element).trigger(hideEvent); 3498 3499 if (hideEvent.isDefaultPrevented()) { 3500 return; 3501 } 3502 3503 $__default["default"](tip).removeClass(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra 3504 // empty mouseover listeners we added for iOS support 3505 3506 if ('ontouchstart' in document.documentElement) { 3507 $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop); 3508 } 3509 3510 this._activeTrigger[TRIGGER_CLICK] = false; 3511 this._activeTrigger[TRIGGER_FOCUS] = false; 3512 this._activeTrigger[TRIGGER_HOVER] = false; 3513 3514 if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) { 3515 var transitionDuration = Util.getTransitionDurationFromElement(tip); 3516 $__default["default"](tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 3517 } else { 3518 complete(); 3519 } 3520 3521 this._hoverState = ''; 3522 }; 3523 3524 _proto.update = function update() { 3525 if (this._popper !== null) { 3526 this._popper.scheduleUpdate(); 3527 } 3528 } // Protected 3529 ; 3530 3531 _proto.isWithContent = function isWithContent() { 3532 return Boolean(this.getTitle()); 3533 }; 3534 3535 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 3536 $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment); 3537 }; 3538 3539 _proto.getTipElement = function getTipElement() { 3540 this.tip = this.tip || $__default["default"](this.config.template)[0]; 3541 return this.tip; 3542 }; 3543 3544 _proto.setContent = function setContent() { 3545 var tip = this.getTipElement(); 3546 this.setElementContent($__default["default"](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle()); 3547 $__default["default"](tip).removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$3); 3548 }; 3549 3550 _proto.setElementContent = function setElementContent($element, content) { 3551 if (typeof content === 'object' && (content.nodeType || content.jquery)) { 3552 // Content is a DOM node or a jQuery 3553 if (this.config.html) { 3554 if (!$__default["default"](content).parent().is($element)) { 3555 $element.empty().append(content); 3556 } 3557 } else { 3558 $element.text($__default["default"](content).text()); 3559 } 3560 3561 return; 3562 } 3563 3564 if (this.config.html) { 3565 if (this.config.sanitize) { 3566 content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); 3567 } 3568 3569 $element.html(content); 3570 } else { 3571 $element.text(content); 3572 } 3573 }; 3574 3575 _proto.getTitle = function getTitle() { 3576 var title = this.element.getAttribute('data-original-title'); 3577 3578 if (!title) { 3579 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; 3580 } 3581 3582 return title; 3583 } // Private 3584 ; 3585 3586 _proto._getPopperConfig = function _getPopperConfig(attachment) { 3587 var _this3 = this; 3588 3589 var defaultBsConfig = { 3590 placement: attachment, 3591 modifiers: { 3592 offset: this._getOffset(), 3593 flip: { 3594 behavior: this.config.fallbackPlacement 3595 }, 3596 arrow: { 3597 element: SELECTOR_ARROW 3598 }, 3599 preventOverflow: { 3600 boundariesElement: this.config.boundary 3601 } 3602 }, 3603 onCreate: function onCreate(data) { 3604 if (data.originalPlacement !== data.placement) { 3605 _this3._handlePopperPlacementChange(data); 3606 } 3607 }, 3608 onUpdate: function onUpdate(data) { 3609 return _this3._handlePopperPlacementChange(data); 3610 } 3611 }; 3612 return _extends({}, defaultBsConfig, this.config.popperConfig); 3613 }; 3614 3615 _proto._getOffset = function _getOffset() { 3616 var _this4 = this; 3617 3618 var offset = {}; 3619 3620 if (typeof this.config.offset === 'function') { 3621 offset.fn = function (data) { 3622 data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element)); 3623 return data; 3624 }; 3625 } else { 3626 offset.offset = this.config.offset; 3627 } 3628 3629 return offset; 3630 }; 3631 3632 _proto._getContainer = function _getContainer() { 3633 if (this.config.container === false) { 3634 return document.body; 3635 } 3636 3637 if (Util.isElement(this.config.container)) { 3638 return $__default["default"](this.config.container); 3639 } 3640 3641 return $__default["default"](document).find(this.config.container); 3642 }; 3643 3644 _proto._getAttachment = function _getAttachment(placement) { 3645 return AttachmentMap[placement.toUpperCase()]; 3646 }; 3647 3648 _proto._setListeners = function _setListeners() { 3649 var _this5 = this; 3650 3651 var triggers = this.config.trigger.split(' '); 3652 triggers.forEach(function (trigger) { 3653 if (trigger === 'click') { 3654 $__default["default"](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) { 3655 return _this5.toggle(event); 3656 }); 3657 } else if (trigger !== TRIGGER_MANUAL) { 3658 var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN; 3659 var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT; 3660 $__default["default"](_this5.element).on(eventIn, _this5.config.selector, function (event) { 3661 return _this5._enter(event); 3662 }).on(eventOut, _this5.config.selector, function (event) { 3663 return _this5._leave(event); 3664 }); 3665 } 3666 }); 3667 3668 this._hideModalHandler = function () { 3669 if (_this5.element) { 3670 _this5.hide(); 3671 } 3672 }; 3673 3674 $__default["default"](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler); 3675 3676 if (this.config.selector) { 3677 this.config = _extends({}, this.config, { 3678 trigger: 'manual', 3679 selector: '' 3680 }); 3681 } else { 3682 this._fixTitle(); 3683 } 3684 }; 3685 3686 _proto._fixTitle = function _fixTitle() { 3687 var titleType = typeof this.element.getAttribute('data-original-title'); 3688 3689 if (this.element.getAttribute('title') || titleType !== 'string') { 3690 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); 3691 this.element.setAttribute('title', ''); 3692 } 3693 }; 3694 3695 _proto._enter = function _enter(event, context) { 3696 var dataKey = this.constructor.DATA_KEY; 3697 context = context || $__default["default"](event.currentTarget).data(dataKey); 3698 3699 if (!context) { 3700 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 3701 $__default["default"](event.currentTarget).data(dataKey, context); 3702 } 3703 3704 if (event) { 3705 context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; 3706 } 3707 3708 if ($__default["default"](context.getTipElement()).hasClass(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) { 3709 context._hoverState = HOVER_STATE_SHOW; 3710 return; 3711 } 3712 3713 clearTimeout(context._timeout); 3714 context._hoverState = HOVER_STATE_SHOW; 3715 3716 if (!context.config.delay || !context.config.delay.show) { 3717 context.show(); 3718 return; 3719 } 3720 3721 context._timeout = setTimeout(function () { 3722 if (context._hoverState === HOVER_STATE_SHOW) { 3723 context.show(); 3724 } 3725 }, context.config.delay.show); 3726 }; 3727 3728 _proto._leave = function _leave(event, context) { 3729 var dataKey = this.constructor.DATA_KEY; 3730 context = context || $__default["default"](event.currentTarget).data(dataKey); 3731 3732 if (!context) { 3733 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 3734 $__default["default"](event.currentTarget).data(dataKey, context); 3735 } 3736 3737 if (event) { 3738 context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false; 3739 } 3740 3741 if (context._isWithActiveTrigger()) { 3742 return; 3743 } 3744 3745 clearTimeout(context._timeout); 3746 context._hoverState = HOVER_STATE_OUT; 3747 3748 if (!context.config.delay || !context.config.delay.hide) { 3749 context.hide(); 3750 return; 3751 } 3752 3753 context._timeout = setTimeout(function () { 3754 if (context._hoverState === HOVER_STATE_OUT) { 3755 context.hide(); 3756 } 3757 }, context.config.delay.hide); 3758 }; 3759 3760 _proto._isWithActiveTrigger = function _isWithActiveTrigger() { 3761 for (var trigger in this._activeTrigger) { 3762 if (this._activeTrigger[trigger]) { 3763 return true; 3764 } 3765 } 3766 3767 return false; 3768 }; 3769 3770 _proto._getConfig = function _getConfig(config) { 3771 var dataAttributes = $__default["default"](this.element).data(); 3772 Object.keys(dataAttributes).forEach(function (dataAttr) { 3773 if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { 3774 delete dataAttributes[dataAttr]; 3775 } 3776 }); 3777 config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); 3778 3779 if (typeof config.delay === 'number') { 3780 config.delay = { 3781 show: config.delay, 3782 hide: config.delay 3783 }; 3784 } 3785 3786 if (typeof config.title === 'number') { 3787 config.title = config.title.toString(); 3788 } 3789 3790 if (typeof config.content === 'number') { 3791 config.content = config.content.toString(); 3792 } 3793 3794 Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType); 3795 3796 if (config.sanitize) { 3797 config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); 3798 } 3799 3800 return config; 3801 }; 3802 3803 _proto._getDelegateConfig = function _getDelegateConfig() { 3804 var config = {}; 3805 3806 if (this.config) { 3807 for (var key in this.config) { 3808 if (this.constructor.Default[key] !== this.config[key]) { 3809 config[key] = this.config[key]; 3810 } 3811 } 3812 } 3813 3814 return config; 3815 }; 3816 3817 _proto._cleanTipClass = function _cleanTipClass() { 3818 var $tip = $__default["default"](this.getTipElement()); 3819 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1); 3820 3821 if (tabClass !== null && tabClass.length) { 3822 $tip.removeClass(tabClass.join('')); 3823 } 3824 }; 3825 3826 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { 3827 this.tip = popperData.instance.popper; 3828 3829 this._cleanTipClass(); 3830 3831 this.addAttachmentClass(this._getAttachment(popperData.placement)); 3832 }; 3833 3834 _proto._fixTransition = function _fixTransition() { 3835 var tip = this.getTipElement(); 3836 var initConfigAnimation = this.config.animation; 3837 3838 if (tip.getAttribute('x-placement') !== null) { 3839 return; 3840 } 3841 3842 $__default["default"](tip).removeClass(CLASS_NAME_FADE$3); 3843 this.config.animation = false; 3844 this.hide(); 3845 this.show(); 3846 this.config.animation = initConfigAnimation; 3847 } // Static 3848 ; 3849 3850 Tooltip._jQueryInterface = function _jQueryInterface(config) { 3851 return this.each(function () { 3852 var $element = $__default["default"](this); 3853 var data = $element.data(DATA_KEY$4); 3854 3855 var _config = typeof config === 'object' && config; 3856 3857 if (!data && /dispose|hide/.test(config)) { 3858 return; 3859 } 3860 3861 if (!data) { 3862 data = new Tooltip(this, _config); 3863 $element.data(DATA_KEY$4, data); 3864 } 3865 3866 if (typeof config === 'string') { 3867 if (typeof data[config] === 'undefined') { 3868 throw new TypeError("No method named \"" + config + "\""); 3869 } 3870 3871 data[config](); 3872 } 3873 }); 3874 }; 3875 3876 _createClass(Tooltip, null, [{ 3877 key: "VERSION", 3878 get: function get() { 3879 return VERSION$4; 3880 } 3881 }, { 3882 key: "Default", 3883 get: function get() { 3884 return Default$3; 3885 } 3886 }, { 3887 key: "NAME", 3888 get: function get() { 3889 return NAME$4; 3890 } 3891 }, { 3892 key: "DATA_KEY", 3893 get: function get() { 3894 return DATA_KEY$4; 3895 } 3896 }, { 3897 key: "Event", 3898 get: function get() { 3899 return Event$1; 3900 } 3901 }, { 3902 key: "EVENT_KEY", 3903 get: function get() { 3904 return EVENT_KEY$4; 3905 } 3906 }, { 3907 key: "DefaultType", 3908 get: function get() { 3909 return DefaultType$3; 3910 } 3911 }]); 3912 3913 return Tooltip; 3914 }(); 3915 /** 3916 * jQuery 3917 */ 3918 3919 3920 $__default["default"].fn[NAME$4] = Tooltip._jQueryInterface; 3921 $__default["default"].fn[NAME$4].Constructor = Tooltip; 3922 3923 $__default["default"].fn[NAME$4].noConflict = function () { 3924 $__default["default"].fn[NAME$4] = JQUERY_NO_CONFLICT$4; 3925 return Tooltip._jQueryInterface; 3926 }; 3927 3928 /** 3929 * Constants 3930 */ 3931 3932 var NAME$3 = 'popover'; 3933 var VERSION$3 = '4.6.2'; 3934 var DATA_KEY$3 = 'bs.popover'; 3935 var EVENT_KEY$3 = "." + DATA_KEY$3; 3936 var JQUERY_NO_CONFLICT$3 = $__default["default"].fn[NAME$3]; 3937 var CLASS_PREFIX = 'bs-popover'; 3938 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 3939 var CLASS_NAME_FADE$2 = 'fade'; 3940 var CLASS_NAME_SHOW$2 = 'show'; 3941 var SELECTOR_TITLE = '.popover-header'; 3942 var SELECTOR_CONTENT = '.popover-body'; 3943 3944 var Default$2 = _extends({}, Tooltip.Default, { 3945 placement: 'right', 3946 trigger: 'click', 3947 content: '', 3948 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' 3949 }); 3950 3951 var DefaultType$2 = _extends({}, Tooltip.DefaultType, { 3952 content: '(string|element|function)' 3953 }); 3954 3955 var Event = { 3956 HIDE: "hide" + EVENT_KEY$3, 3957 HIDDEN: "hidden" + EVENT_KEY$3, 3958 SHOW: "show" + EVENT_KEY$3, 3959 SHOWN: "shown" + EVENT_KEY$3, 3960 INSERTED: "inserted" + EVENT_KEY$3, 3961 CLICK: "click" + EVENT_KEY$3, 3962 FOCUSIN: "focusin" + EVENT_KEY$3, 3963 FOCUSOUT: "focusout" + EVENT_KEY$3, 3964 MOUSEENTER: "mouseenter" + EVENT_KEY$3, 3965 MOUSELEAVE: "mouseleave" + EVENT_KEY$3 3966 }; 3967 /** 3968 * Class definition 3969 */ 3970 3971 var Popover = /*#__PURE__*/function (_Tooltip) { 3972 _inheritsLoose(Popover, _Tooltip); 3973 3974 function Popover() { 3975 return _Tooltip.apply(this, arguments) || this; 3976 } 3977 3978 var _proto = Popover.prototype; 3979 3980 // Overrides 3981 _proto.isWithContent = function isWithContent() { 3982 return this.getTitle() || this._getContent(); 3983 }; 3984 3985 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 3986 $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); 3987 }; 3988 3989 _proto.getTipElement = function getTipElement() { 3990 this.tip = this.tip || $__default["default"](this.config.template)[0]; 3991 return this.tip; 3992 }; 3993 3994 _proto.setContent = function setContent() { 3995 var $tip = $__default["default"](this.getTipElement()); // We use append for html objects to maintain js events 3996 3997 this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle()); 3998 3999 var content = this._getContent(); 4000 4001 if (typeof content === 'function') { 4002 content = content.call(this.element); 4003 } 4004 4005 this.setElementContent($tip.find(SELECTOR_CONTENT), content); 4006 $tip.removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$2); 4007 } // Private 4008 ; 4009 4010 _proto._getContent = function _getContent() { 4011 return this.element.getAttribute('data-content') || this.config.content; 4012 }; 4013 4014 _proto._cleanTipClass = function _cleanTipClass() { 4015 var $tip = $__default["default"](this.getTipElement()); 4016 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); 4017 4018 if (tabClass !== null && tabClass.length > 0) { 4019 $tip.removeClass(tabClass.join('')); 4020 } 4021 } // Static 4022 ; 4023 4024 Popover._jQueryInterface = function _jQueryInterface(config) { 4025 return this.each(function () { 4026 var data = $__default["default"](this).data(DATA_KEY$3); 4027 4028 var _config = typeof config === 'object' ? config : null; 4029 4030 if (!data && /dispose|hide/.test(config)) { 4031 return; 4032 } 4033 4034 if (!data) { 4035 data = new Popover(this, _config); 4036 $__default["default"](this).data(DATA_KEY$3, data); 4037 } 4038 4039 if (typeof config === 'string') { 4040 if (typeof data[config] === 'undefined') { 4041 throw new TypeError("No method named \"" + config + "\""); 4042 } 4043 4044 data[config](); 4045 } 4046 }); 4047 }; 4048 4049 _createClass(Popover, null, [{ 4050 key: "VERSION", 4051 get: // Getters 4052 function get() { 4053 return VERSION$3; 4054 } 4055 }, { 4056 key: "Default", 4057 get: function get() { 4058 return Default$2; 4059 } 4060 }, { 4061 key: "NAME", 4062 get: function get() { 4063 return NAME$3; 4064 } 4065 }, { 4066 key: "DATA_KEY", 4067 get: function get() { 4068 return DATA_KEY$3; 4069 } 4070 }, { 4071 key: "Event", 4072 get: function get() { 4073 return Event; 4074 } 4075 }, { 4076 key: "EVENT_KEY", 4077 get: function get() { 4078 return EVENT_KEY$3; 4079 } 4080 }, { 4081 key: "DefaultType", 4082 get: function get() { 4083 return DefaultType$2; 4084 } 4085 }]); 4086 4087 return Popover; 4088 }(Tooltip); 4089 /** 4090 * jQuery 4091 */ 4092 4093 4094 $__default["default"].fn[NAME$3] = Popover._jQueryInterface; 4095 $__default["default"].fn[NAME$3].Constructor = Popover; 4096 4097 $__default["default"].fn[NAME$3].noConflict = function () { 4098 $__default["default"].fn[NAME$3] = JQUERY_NO_CONFLICT$3; 4099 return Popover._jQueryInterface; 4100 }; 4101 4102 /** 4103 * Constants 4104 */ 4105 4106 var NAME$2 = 'scrollspy'; 4107 var VERSION$2 = '4.6.2'; 4108 var DATA_KEY$2 = 'bs.scrollspy'; 4109 var EVENT_KEY$2 = "." + DATA_KEY$2; 4110 var DATA_API_KEY$1 = '.data-api'; 4111 var JQUERY_NO_CONFLICT$2 = $__default["default"].fn[NAME$2]; 4112 var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; 4113 var CLASS_NAME_ACTIVE$1 = 'active'; 4114 var EVENT_ACTIVATE = "activate" + EVENT_KEY$2; 4115 var EVENT_SCROLL = "scroll" + EVENT_KEY$2; 4116 var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$2 + DATA_API_KEY$1; 4117 var METHOD_OFFSET = 'offset'; 4118 var METHOD_POSITION = 'position'; 4119 var SELECTOR_DATA_SPY = '[data-spy="scroll"]'; 4120 var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group'; 4121 var SELECTOR_NAV_LINKS = '.nav-link'; 4122 var SELECTOR_NAV_ITEMS = '.nav-item'; 4123 var SELECTOR_LIST_ITEMS = '.list-group-item'; 4124 var SELECTOR_DROPDOWN$1 = '.dropdown'; 4125 var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item'; 4126 var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; 4127 var Default$1 = { 4128 offset: 10, 4129 method: 'auto', 4130 target: '' 4131 }; 4132 var DefaultType$1 = { 4133 offset: 'number', 4134 method: 'string', 4135 target: '(string|element)' 4136 }; 4137 /** 4138 * Class definition 4139 */ 4140 4141 var ScrollSpy = /*#__PURE__*/function () { 4142 function ScrollSpy(element, config) { 4143 var _this = this; 4144 4145 this._element = element; 4146 this._scrollElement = element.tagName === 'BODY' ? window : element; 4147 this._config = this._getConfig(config); 4148 this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS); 4149 this._offsets = []; 4150 this._targets = []; 4151 this._activeTarget = null; 4152 this._scrollHeight = 0; 4153 $__default["default"](this._scrollElement).on(EVENT_SCROLL, function (event) { 4154 return _this._process(event); 4155 }); 4156 this.refresh(); 4157 4158 this._process(); 4159 } // Getters 4160 4161 4162 var _proto = ScrollSpy.prototype; 4163 4164 // Public 4165 _proto.refresh = function refresh() { 4166 var _this2 = this; 4167 4168 var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION; 4169 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 4170 var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0; 4171 this._offsets = []; 4172 this._targets = []; 4173 this._scrollHeight = this._getScrollHeight(); 4174 var targets = [].slice.call(document.querySelectorAll(this._selector)); 4175 targets.map(function (element) { 4176 var target; 4177 var targetSelector = Util.getSelectorFromElement(element); 4178 4179 if (targetSelector) { 4180 target = document.querySelector(targetSelector); 4181 } 4182 4183 if (target) { 4184 var targetBCR = target.getBoundingClientRect(); 4185 4186 if (targetBCR.width || targetBCR.height) { 4187 // TODO (fat): remove sketch reliance on jQuery position/offset 4188 return [$__default["default"](target)[offsetMethod]().top + offsetBase, targetSelector]; 4189 } 4190 } 4191 4192 return null; 4193 }).filter(Boolean).sort(function (a, b) { 4194 return a[0] - b[0]; 4195 }).forEach(function (item) { 4196 _this2._offsets.push(item[0]); 4197 4198 _this2._targets.push(item[1]); 4199 }); 4200 }; 4201 4202 _proto.dispose = function dispose() { 4203 $__default["default"].removeData(this._element, DATA_KEY$2); 4204 $__default["default"](this._scrollElement).off(EVENT_KEY$2); 4205 this._element = null; 4206 this._scrollElement = null; 4207 this._config = null; 4208 this._selector = null; 4209 this._offsets = null; 4210 this._targets = null; 4211 this._activeTarget = null; 4212 this._scrollHeight = null; 4213 } // Private 4214 ; 4215 4216 _proto._getConfig = function _getConfig(config) { 4217 config = _extends({}, Default$1, typeof config === 'object' && config ? config : {}); 4218 4219 if (typeof config.target !== 'string' && Util.isElement(config.target)) { 4220 var id = $__default["default"](config.target).attr('id'); 4221 4222 if (!id) { 4223 id = Util.getUID(NAME$2); 4224 $__default["default"](config.target).attr('id', id); 4225 } 4226 4227 config.target = "#" + id; 4228 } 4229 4230 Util.typeCheckConfig(NAME$2, config, DefaultType$1); 4231 return config; 4232 }; 4233 4234 _proto._getScrollTop = function _getScrollTop() { 4235 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 4236 }; 4237 4238 _proto._getScrollHeight = function _getScrollHeight() { 4239 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 4240 }; 4241 4242 _proto._getOffsetHeight = function _getOffsetHeight() { 4243 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 4244 }; 4245 4246 _proto._process = function _process() { 4247 var scrollTop = this._getScrollTop() + this._config.offset; 4248 4249 var scrollHeight = this._getScrollHeight(); 4250 4251 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 4252 4253 if (this._scrollHeight !== scrollHeight) { 4254 this.refresh(); 4255 } 4256 4257 if (scrollTop >= maxScroll) { 4258 var target = this._targets[this._targets.length - 1]; 4259 4260 if (this._activeTarget !== target) { 4261 this._activate(target); 4262 } 4263 4264 return; 4265 } 4266 4267 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 4268 this._activeTarget = null; 4269 4270 this._clear(); 4271 4272 return; 4273 } 4274 4275 for (var i = this._offsets.length; i--;) { 4276 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 4277 4278 if (isActiveTarget) { 4279 this._activate(this._targets[i]); 4280 } 4281 } 4282 }; 4283 4284 _proto._activate = function _activate(target) { 4285 this._activeTarget = target; 4286 4287 this._clear(); 4288 4289 var queries = this._selector.split(',').map(function (selector) { 4290 return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; 4291 }); 4292 4293 var $link = $__default["default"]([].slice.call(document.querySelectorAll(queries.join(',')))); 4294 4295 if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) { 4296 $link.closest(SELECTOR_DROPDOWN$1).find(SELECTOR_DROPDOWN_TOGGLE$1).addClass(CLASS_NAME_ACTIVE$1); 4297 $link.addClass(CLASS_NAME_ACTIVE$1); 4298 } else { 4299 // Set triggered link as active 4300 $link.addClass(CLASS_NAME_ACTIVE$1); // Set triggered links parents as active 4301 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 4302 4303 $link.parents(SELECTOR_NAV_LIST_GROUP$1).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE$1); // Handle special case when .nav-link is inside .nav-item 4304 4305 $link.parents(SELECTOR_NAV_LIST_GROUP$1).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$1); 4306 } 4307 4308 $__default["default"](this._scrollElement).trigger(EVENT_ACTIVATE, { 4309 relatedTarget: target 4310 }); 4311 }; 4312 4313 _proto._clear = function _clear() { 4314 [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { 4315 return node.classList.contains(CLASS_NAME_ACTIVE$1); 4316 }).forEach(function (node) { 4317 return node.classList.remove(CLASS_NAME_ACTIVE$1); 4318 }); 4319 } // Static 4320 ; 4321 4322 ScrollSpy._jQueryInterface = function _jQueryInterface(config) { 4323 return this.each(function () { 4324 var data = $__default["default"](this).data(DATA_KEY$2); 4325 4326 var _config = typeof config === 'object' && config; 4327 4328 if (!data) { 4329 data = new ScrollSpy(this, _config); 4330 $__default["default"](this).data(DATA_KEY$2, data); 4331 } 4332 4333 if (typeof config === 'string') { 4334 if (typeof data[config] === 'undefined') { 4335 throw new TypeError("No method named \"" + config + "\""); 4336 } 4337 4338 data[config](); 4339 } 4340 }); 4341 }; 4342 4343 _createClass(ScrollSpy, null, [{ 4344 key: "VERSION", 4345 get: function get() { 4346 return VERSION$2; 4347 } 4348 }, { 4349 key: "Default", 4350 get: function get() { 4351 return Default$1; 4352 } 4353 }]); 4354 4355 return ScrollSpy; 4356 }(); 4357 /** 4358 * Data API implementation 4359 */ 4360 4361 4362 $__default["default"](window).on(EVENT_LOAD_DATA_API, function () { 4363 var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY)); 4364 var scrollSpysLength = scrollSpys.length; 4365 4366 for (var i = scrollSpysLength; i--;) { 4367 var $spy = $__default["default"](scrollSpys[i]); 4368 4369 ScrollSpy._jQueryInterface.call($spy, $spy.data()); 4370 } 4371 }); 4372 /** 4373 * jQuery 4374 */ 4375 4376 $__default["default"].fn[NAME$2] = ScrollSpy._jQueryInterface; 4377 $__default["default"].fn[NAME$2].Constructor = ScrollSpy; 4378 4379 $__default["default"].fn[NAME$2].noConflict = function () { 4380 $__default["default"].fn[NAME$2] = JQUERY_NO_CONFLICT$2; 4381 return ScrollSpy._jQueryInterface; 4382 }; 4383 4384 /** 4385 * Constants 4386 */ 4387 4388 var NAME$1 = 'tab'; 4389 var VERSION$1 = '4.6.2'; 4390 var DATA_KEY$1 = 'bs.tab'; 4391 var EVENT_KEY$1 = "." + DATA_KEY$1; 4392 var DATA_API_KEY = '.data-api'; 4393 var JQUERY_NO_CONFLICT$1 = $__default["default"].fn[NAME$1]; 4394 var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'; 4395 var CLASS_NAME_ACTIVE = 'active'; 4396 var CLASS_NAME_DISABLED = 'disabled'; 4397 var CLASS_NAME_FADE$1 = 'fade'; 4398 var CLASS_NAME_SHOW$1 = 'show'; 4399 var EVENT_HIDE$1 = "hide" + EVENT_KEY$1; 4400 var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$1; 4401 var EVENT_SHOW$1 = "show" + EVENT_KEY$1; 4402 var EVENT_SHOWN$1 = "shown" + EVENT_KEY$1; 4403 var EVENT_CLICK_DATA_API = "click" + EVENT_KEY$1 + DATA_API_KEY; 4404 var SELECTOR_DROPDOWN = '.dropdown'; 4405 var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; 4406 var SELECTOR_ACTIVE = '.active'; 4407 var SELECTOR_ACTIVE_UL = '> li > .active'; 4408 var SELECTOR_DATA_TOGGLE = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]'; 4409 var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; 4410 var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active'; 4411 /** 4412 * Class definition 4413 */ 4414 4415 var Tab = /*#__PURE__*/function () { 4416 function Tab(element) { 4417 this._element = element; 4418 } // Getters 4419 4420 4421 var _proto = Tab.prototype; 4422 4423 // Public 4424 _proto.show = function show() { 4425 var _this = this; 4426 4427 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $__default["default"](this._element).hasClass(CLASS_NAME_ACTIVE) || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED) || this._element.hasAttribute('disabled')) { 4428 return; 4429 } 4430 4431 var target; 4432 var previous; 4433 var listElement = $__default["default"](this._element).closest(SELECTOR_NAV_LIST_GROUP)[0]; 4434 var selector = Util.getSelectorFromElement(this._element); 4435 4436 if (listElement) { 4437 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE; 4438 previous = $__default["default"].makeArray($__default["default"](listElement).find(itemSelector)); 4439 previous = previous[previous.length - 1]; 4440 } 4441 4442 var hideEvent = $__default["default"].Event(EVENT_HIDE$1, { 4443 relatedTarget: this._element 4444 }); 4445 var showEvent = $__default["default"].Event(EVENT_SHOW$1, { 4446 relatedTarget: previous 4447 }); 4448 4449 if (previous) { 4450 $__default["default"](previous).trigger(hideEvent); 4451 } 4452 4453 $__default["default"](this._element).trigger(showEvent); 4454 4455 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 4456 return; 4457 } 4458 4459 if (selector) { 4460 target = document.querySelector(selector); 4461 } 4462 4463 this._activate(this._element, listElement); 4464 4465 var complete = function complete() { 4466 var hiddenEvent = $__default["default"].Event(EVENT_HIDDEN$1, { 4467 relatedTarget: _this._element 4468 }); 4469 var shownEvent = $__default["default"].Event(EVENT_SHOWN$1, { 4470 relatedTarget: previous 4471 }); 4472 $__default["default"](previous).trigger(hiddenEvent); 4473 $__default["default"](_this._element).trigger(shownEvent); 4474 }; 4475 4476 if (target) { 4477 this._activate(target, target.parentNode, complete); 4478 } else { 4479 complete(); 4480 } 4481 }; 4482 4483 _proto.dispose = function dispose() { 4484 $__default["default"].removeData(this._element, DATA_KEY$1); 4485 this._element = null; 4486 } // Private 4487 ; 4488 4489 _proto._activate = function _activate(element, container, callback) { 4490 var _this2 = this; 4491 4492 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $__default["default"](container).find(SELECTOR_ACTIVE_UL) : $__default["default"](container).children(SELECTOR_ACTIVE); 4493 var active = activeElements[0]; 4494 var isTransitioning = callback && active && $__default["default"](active).hasClass(CLASS_NAME_FADE$1); 4495 4496 var complete = function complete() { 4497 return _this2._transitionComplete(element, active, callback); 4498 }; 4499 4500 if (active && isTransitioning) { 4501 var transitionDuration = Util.getTransitionDurationFromElement(active); 4502 $__default["default"](active).removeClass(CLASS_NAME_SHOW$1).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 4503 } else { 4504 complete(); 4505 } 4506 }; 4507 4508 _proto._transitionComplete = function _transitionComplete(element, active, callback) { 4509 if (active) { 4510 $__default["default"](active).removeClass(CLASS_NAME_ACTIVE); 4511 var dropdownChild = $__default["default"](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0]; 4512 4513 if (dropdownChild) { 4514 $__default["default"](dropdownChild).removeClass(CLASS_NAME_ACTIVE); 4515 } 4516 4517 if (active.getAttribute('role') === 'tab') { 4518 active.setAttribute('aria-selected', false); 4519 } 4520 } 4521 4522 $__default["default"](element).addClass(CLASS_NAME_ACTIVE); 4523 4524 if (element.getAttribute('role') === 'tab') { 4525 element.setAttribute('aria-selected', true); 4526 } 4527 4528 Util.reflow(element); 4529 4530 if (element.classList.contains(CLASS_NAME_FADE$1)) { 4531 element.classList.add(CLASS_NAME_SHOW$1); 4532 } 4533 4534 var parent = element.parentNode; 4535 4536 if (parent && parent.nodeName === 'LI') { 4537 parent = parent.parentNode; 4538 } 4539 4540 if (parent && $__default["default"](parent).hasClass(CLASS_NAME_DROPDOWN_MENU)) { 4541 var dropdownElement = $__default["default"](element).closest(SELECTOR_DROPDOWN)[0]; 4542 4543 if (dropdownElement) { 4544 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE)); 4545 $__default["default"](dropdownToggleList).addClass(CLASS_NAME_ACTIVE); 4546 } 4547 4548 element.setAttribute('aria-expanded', true); 4549 } 4550 4551 if (callback) { 4552 callback(); 4553 } 4554 } // Static 4555 ; 4556 4557 Tab._jQueryInterface = function _jQueryInterface(config) { 4558 return this.each(function () { 4559 var $this = $__default["default"](this); 4560 var data = $this.data(DATA_KEY$1); 4561 4562 if (!data) { 4563 data = new Tab(this); 4564 $this.data(DATA_KEY$1, data); 4565 } 4566 4567 if (typeof config === 'string') { 4568 if (typeof data[config] === 'undefined') { 4569 throw new TypeError("No method named \"" + config + "\""); 4570 } 4571 4572 data[config](); 4573 } 4574 }); 4575 }; 4576 4577 _createClass(Tab, null, [{ 4578 key: "VERSION", 4579 get: function get() { 4580 return VERSION$1; 4581 } 4582 }]); 4583 4584 return Tab; 4585 }(); 4586 /** 4587 * Data API implementation 4588 */ 4589 4590 4591 $__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 4592 event.preventDefault(); 4593 4594 Tab._jQueryInterface.call($__default["default"](this), 'show'); 4595 }); 4596 /** 4597 * jQuery 4598 */ 4599 4600 $__default["default"].fn[NAME$1] = Tab._jQueryInterface; 4601 $__default["default"].fn[NAME$1].Constructor = Tab; 4602 4603 $__default["default"].fn[NAME$1].noConflict = function () { 4604 $__default["default"].fn[NAME$1] = JQUERY_NO_CONFLICT$1; 4605 return Tab._jQueryInterface; 4606 }; 4607 4608 /** 4609 * Constants 4610 */ 4611 4612 var NAME = 'toast'; 4613 var VERSION = '4.6.2'; 4614 var DATA_KEY = 'bs.toast'; 4615 var EVENT_KEY = "." + DATA_KEY; 4616 var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME]; 4617 var CLASS_NAME_FADE = 'fade'; 4618 var CLASS_NAME_HIDE = 'hide'; 4619 var CLASS_NAME_SHOW = 'show'; 4620 var CLASS_NAME_SHOWING = 'showing'; 4621 var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY; 4622 var EVENT_HIDE = "hide" + EVENT_KEY; 4623 var EVENT_HIDDEN = "hidden" + EVENT_KEY; 4624 var EVENT_SHOW = "show" + EVENT_KEY; 4625 var EVENT_SHOWN = "shown" + EVENT_KEY; 4626 var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]'; 4627 var Default = { 4628 animation: true, 4629 autohide: true, 4630 delay: 500 4631 }; 4632 var DefaultType = { 4633 animation: 'boolean', 4634 autohide: 'boolean', 4635 delay: 'number' 4636 }; 4637 /** 4638 * Class definition 4639 */ 4640 4641 var Toast = /*#__PURE__*/function () { 4642 function Toast(element, config) { 4643 this._element = element; 4644 this._config = this._getConfig(config); 4645 this._timeout = null; 4646 4647 this._setListeners(); 4648 } // Getters 4649 4650 4651 var _proto = Toast.prototype; 4652 4653 // Public 4654 _proto.show = function show() { 4655 var _this = this; 4656 4657 var showEvent = $__default["default"].Event(EVENT_SHOW); 4658 $__default["default"](this._element).trigger(showEvent); 4659 4660 if (showEvent.isDefaultPrevented()) { 4661 return; 4662 } 4663 4664 this._clearTimeout(); 4665 4666 if (this._config.animation) { 4667 this._element.classList.add(CLASS_NAME_FADE); 4668 } 4669 4670 var complete = function complete() { 4671 _this._element.classList.remove(CLASS_NAME_SHOWING); 4672 4673 _this._element.classList.add(CLASS_NAME_SHOW); 4674 4675 $__default["default"](_this._element).trigger(EVENT_SHOWN); 4676 4677 if (_this._config.autohide) { 4678 _this._timeout = setTimeout(function () { 4679 _this.hide(); 4680 }, _this._config.delay); 4681 } 4682 }; 4683 4684 this._element.classList.remove(CLASS_NAME_HIDE); 4685 4686 Util.reflow(this._element); 4687 4688 this._element.classList.add(CLASS_NAME_SHOWING); 4689 4690 if (this._config.animation) { 4691 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 4692 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 4693 } else { 4694 complete(); 4695 } 4696 }; 4697 4698 _proto.hide = function hide() { 4699 if (!this._element.classList.contains(CLASS_NAME_SHOW)) { 4700 return; 4701 } 4702 4703 var hideEvent = $__default["default"].Event(EVENT_HIDE); 4704 $__default["default"](this._element).trigger(hideEvent); 4705 4706 if (hideEvent.isDefaultPrevented()) { 4707 return; 4708 } 4709 4710 this._close(); 4711 }; 4712 4713 _proto.dispose = function dispose() { 4714 this._clearTimeout(); 4715 4716 if (this._element.classList.contains(CLASS_NAME_SHOW)) { 4717 this._element.classList.remove(CLASS_NAME_SHOW); 4718 } 4719 4720 $__default["default"](this._element).off(EVENT_CLICK_DISMISS); 4721 $__default["default"].removeData(this._element, DATA_KEY); 4722 this._element = null; 4723 this._config = null; 4724 } // Private 4725 ; 4726 4727 _proto._getConfig = function _getConfig(config) { 4728 config = _extends({}, Default, $__default["default"](this._element).data(), typeof config === 'object' && config ? config : {}); 4729 Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); 4730 return config; 4731 }; 4732 4733 _proto._setListeners = function _setListeners() { 4734 var _this2 = this; 4735 4736 $__default["default"](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () { 4737 return _this2.hide(); 4738 }); 4739 }; 4740 4741 _proto._close = function _close() { 4742 var _this3 = this; 4743 4744 var complete = function complete() { 4745 _this3._element.classList.add(CLASS_NAME_HIDE); 4746 4747 $__default["default"](_this3._element).trigger(EVENT_HIDDEN); 4748 }; 4749 4750 this._element.classList.remove(CLASS_NAME_SHOW); 4751 4752 if (this._config.animation) { 4753 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 4754 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 4755 } else { 4756 complete(); 4757 } 4758 }; 4759 4760 _proto._clearTimeout = function _clearTimeout() { 4761 clearTimeout(this._timeout); 4762 this._timeout = null; 4763 } // Static 4764 ; 4765 4766 Toast._jQueryInterface = function _jQueryInterface(config) { 4767 return this.each(function () { 4768 var $element = $__default["default"](this); 4769 var data = $element.data(DATA_KEY); 4770 4771 var _config = typeof config === 'object' && config; 4772 4773 if (!data) { 4774 data = new Toast(this, _config); 4775 $element.data(DATA_KEY, data); 4776 } 4777 4778 if (typeof config === 'string') { 4779 if (typeof data[config] === 'undefined') { 4780 throw new TypeError("No method named \"" + config + "\""); 4781 } 4782 4783 data[config](this); 4784 } 4785 }); 4786 }; 4787 4788 _createClass(Toast, null, [{ 4789 key: "VERSION", 4790 get: function get() { 4791 return VERSION; 4792 } 4793 }, { 4794 key: "DefaultType", 4795 get: function get() { 4796 return DefaultType; 4797 } 4798 }, { 4799 key: "Default", 4800 get: function get() { 4801 return Default; 4802 } 4803 }]); 4804 4805 return Toast; 4806 }(); 4807 /** 4808 * jQuery 4809 */ 4810 4811 4812 $__default["default"].fn[NAME] = Toast._jQueryInterface; 4813 $__default["default"].fn[NAME].Constructor = Toast; 4814 4815 $__default["default"].fn[NAME].noConflict = function () { 4816 $__default["default"].fn[NAME] = JQUERY_NO_CONFLICT; 4817 return Toast._jQueryInterface; 4818 }; 4819 4820 exports.Alert = Alert; 4821 exports.Button = Button; 4822 exports.Carousel = Carousel; 4823 exports.Collapse = Collapse; 4824 exports.Dropdown = Dropdown; 4825 exports.Modal = Modal; 4826 exports.Popover = Popover; 4827 exports.Scrollspy = ScrollSpy; 4828 exports.Tab = Tab; 4829 exports.Toast = Toast; 4830 exports.Tooltip = Tooltip; 4831 exports.Util = Util; 4832 4833 Object.defineProperty(exports, '__esModule', { value: true }); 4834 4835})); 4836//# sourceMappingURL=bootstrap.js.map 4837 4838 4839/***/ }), 4840
vendor: 285,437 bytes, lines 4841-15555
4841/***/ "./node_modules/jquery/dist/jquery.js": 4842/*!********************************************!*\ 4843 !*** ./node_modules/jquery/dist/jquery.js ***! 4844 \********************************************/ 4845/***/ (function(module, exports) { 4846 4847var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 4848 * jQuery JavaScript Library v3.7.0 4849 * https://jquery.com/ 4850 * 4851 * Copyright OpenJS Foundation and other contributors 4852 * Released under the MIT license 4853 * https://jquery.org/license 4854 * 4855 * Date: 2023-05-11T18:29Z 4856 */ 4857( function( global, factory ) { 4858 4859 "use strict"; 4860 4861 if ( true && typeof module.exports === "object" ) { 4862 4863 // For CommonJS and CommonJS-like environments where a proper `window` 4864 // is present, execute the factory and get jQuery. 4865 // For environments that do not have a `window` with a `document` 4866 // (such as Node.js), expose a factory as module.exports. 4867 // This accentuates the need for the creation of a real `window`. 4868 // e.g. var jQuery = require("jquery")(window); 4869 // See ticket trac-14549 for more info. 4870 module.exports = global.document ? 4871 factory( global, true ) : 4872 function( w ) { 4873 if ( !w.document ) { 4874 throw new Error( "jQuery requires a window with a document" ); 4875 } 4876 return factory( w ); 4877 }; 4878 } else { 4879 factory( global ); 4880 } 4881 4882// Pass this if window is not defined yet 4883} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 4884 4885// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 4886// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 4887// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 4888// enough that all such attempts are guarded in a try block. 4889"use strict"; 4890 4891var arr = []; 4892 4893var getProto = Object.getPrototypeOf; 4894 4895var slice = arr.slice; 4896 4897var flat = arr.flat ? function( array ) { 4898 return arr.flat.call( array ); 4899} : function( array ) { 4900 return arr.concat.apply( [], array ); 4901}; 4902 4903 4904var push = arr.push; 4905 4906var indexOf = arr.indexOf; 4907 4908var class2type = {}; 4909 4910var toString = class2type.toString; 4911 4912var hasOwn = class2type.hasOwnProperty; 4913 4914var fnToString = hasOwn.toString; 4915 4916var ObjectFunctionString = fnToString.call( Object ); 4917 4918var support = {}; 4919 4920var isFunction = function isFunction( obj ) { 4921 4922 // Support: Chrome <=57, Firefox <=52 4923 // In some browsers, typeof returns "function" for HTML <object> elements 4924 // (i.e., `typeof document.createElement( "object" ) === "function"`). 4925 // We don't want to classify *any* DOM node as a function. 4926 // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 4927 // Plus for old WebKit, typeof returns "function" for HTML collections 4928 // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) 4929 return typeof obj === "function" && typeof obj.nodeType !== "number" && 4930 typeof obj.item !== "function"; 4931 }; 4932 4933 4934var isWindow = function isWindow( obj ) { 4935 return obj != null && obj === obj.window; 4936 }; 4937 4938 4939var document = window.document; 4940 4941 4942 4943 var preservedScriptAttributes = { 4944 type: true, 4945 src: true, 4946 nonce: true, 4947 noModule: true 4948 }; 4949 4950 function DOMEval( code, node, doc ) { 4951 doc = doc || document; 4952 4953 var i, val, 4954 script = doc.createElement( "script" ); 4955 4956 script.text = code; 4957 if ( node ) { 4958 for ( i in preservedScriptAttributes ) { 4959 4960 // Support: Firefox 64+, Edge 18+ 4961 // Some browsers don't support the "nonce" property on scripts. 4962 // On the other hand, just using `getAttribute` is not enough as 4963 // the `nonce` attribute is reset to an empty string whenever it 4964 // becomes browsing-context connected. 4965 // See https://github.com/whatwg/html/issues/2369 4966 // See https://html.spec.whatwg.org/#nonce-attributes 4967 // The `node.getAttribute` check was added for the sake of 4968 // `jQuery.globalEval` so that it can fake a nonce-containing node 4969 // via an object. 4970 val = node[ i ] || node.getAttribute && node.getAttribute( i ); 4971 if ( val ) { 4972 script.setAttribute( i, val ); 4973 } 4974 } 4975 } 4976 doc.head.appendChild( script ).parentNode.removeChild( script ); 4977 } 4978 4979 4980function toType( obj ) { 4981 if ( obj == null ) { 4982 return obj + ""; 4983 } 4984 4985 // Support: Android <=2.3 only (functionish RegExp) 4986 return typeof obj === "object" || typeof obj === "function" ? 4987 class2type[ toString.call( obj ) ] || "object" : 4988 typeof obj; 4989} 4990/* global Symbol */ 4991// Defining this global in .eslintrc.json would create a danger of using the global 4992// unguarded in another place, it seems safer to define global only for this module 4993 4994 4995 4996var version = "3.7.0", 4997 4998 rhtmlSuffix = /HTML$/i, 4999 5000 // Define a local copy of jQuery 5001 jQuery = function( selector, context ) { 5002 5003 // The jQuery object is actually just the init constructor 'enhanced' 5004 // Need init if jQuery is called (just allow error to be thrown if not included) 5005 return new jQuery.fn.init( selector, context ); 5006 }; 5007 5008jQuery.fn = jQuery.prototype = { 5009 5010 // The current version of jQuery being used 5011 jquery: version, 5012 5013 constructor: jQuery, 5014 5015 // The default length of a jQuery object is 0 5016 length: 0, 5017 5018 toArray: function() { 5019 return slice.call( this ); 5020 }, 5021 5022 // Get the Nth element in the matched element set OR 5023 // Get the whole matched element set as a clean array 5024 get: function( num ) { 5025 5026 // Return all the elements in a clean array 5027 if ( num == null ) { 5028 return slice.call( this ); 5029 } 5030 5031 // Return just the one element from the set 5032 return num < 0 ? this[ num + this.length ] : this[ num ]; 5033 }, 5034 5035 // Take an array of elements and push it onto the stack 5036 // (returning the new matched element set) 5037 pushStack: function( elems ) { 5038 5039 // Build a new jQuery matched element set 5040 var ret = jQuery.merge( this.constructor(), elems ); 5041 5042 // Add the old object onto the stack (as a reference) 5043 ret.prevObject = this; 5044 5045 // Return the newly-formed element set 5046 return ret; 5047 }, 5048 5049 // Execute a callback for every element in the matched set. 5050 each: function( callback ) { 5051 return jQuery.each( this, callback ); 5052 }, 5053 5054 map: function( callback ) { 5055 return this.pushStack( jQuery.map( this, function( elem, i ) { 5056 return callback.call( elem, i, elem ); 5057 } ) ); 5058 }, 5059 5060 slice: function() { 5061 return this.pushStack( slice.apply( this, arguments ) ); 5062 }, 5063 5064 first: function() { 5065 return this.eq( 0 ); 5066 }, 5067 5068 last: function() { 5069 return this.eq( -1 ); 5070 }, 5071 5072 even: function() { 5073 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 5074 return ( i + 1 ) % 2; 5075 } ) ); 5076 }, 5077 5078 odd: function() { 5079 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 5080 return i % 2; 5081 } ) ); 5082 }, 5083 5084 eq: function( i ) { 5085 var len = this.length, 5086 j = +i + ( i < 0 ? len : 0 ); 5087 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 5088 }, 5089 5090 end: function() { 5091 return this.prevObject || this.constructor(); 5092 }, 5093 5094 // For internal use only. 5095 // Behaves like an Array's method, not like a jQuery method. 5096 push: push, 5097 sort: arr.sort, 5098 splice: arr.splice 5099}; 5100 5101jQuery.extend = jQuery.fn.extend = function() { 5102 var options, name, src, copy, copyIsArray, clone, 5103 target = arguments[ 0 ] || {}, 5104 i = 1, 5105 length = arguments.length, 5106 deep = false; 5107 5108 // Handle a deep copy situation 5109 if ( typeof target === "boolean" ) { 5110 deep = target; 5111 5112 // Skip the boolean and the target 5113 target = arguments[ i ] || {}; 5114 i++; 5115 } 5116 5117 // Handle case when target is a string or something (possible in deep copy) 5118 if ( typeof target !== "object" && !isFunction( target ) ) { 5119 target = {}; 5120 } 5121 5122 // Extend jQuery itself if only one argument is passed 5123 if ( i === length ) { 5124 target = this; 5125 i--; 5126 } 5127 5128 for ( ; i < length; i++ ) { 5129 5130 // Only deal with non-null/undefined values 5131 if ( ( options = arguments[ i ] ) != null ) { 5132 5133 // Extend the base object 5134 for ( name in options ) { 5135 copy = options[ name ]; 5136 5137 // Prevent Object.prototype pollution 5138 // Prevent never-ending loop 5139 if ( name === "__proto__" || target === copy ) { 5140 continue; 5141 } 5142 5143 // Recurse if we're merging plain objects or arrays 5144 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 5145 ( copyIsArray = Array.isArray( copy ) ) ) ) { 5146 src = target[ name ]; 5147 5148 // Ensure proper type for the source value 5149 if ( copyIsArray && !Array.isArray( src ) ) { 5150 clone = []; 5151 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { 5152 clone = {}; 5153 } else { 5154 clone = src; 5155 } 5156 copyIsArray = false; 5157 5158 // Never move original objects, clone them 5159 target[ name ] = jQuery.extend( deep, clone, copy ); 5160 5161 // Don't bring in undefined values 5162 } else if ( copy !== undefined ) { 5163 target[ name ] = copy; 5164 } 5165 } 5166 } 5167 } 5168 5169 // Return the modified object 5170 return target; 5171}; 5172 5173jQuery.extend( { 5174 5175 // Unique for each copy of jQuery on the page 5176 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 5177 5178 // Assume jQuery is ready without the ready module 5179 isReady: true, 5180 5181 error: function( msg ) { 5182 throw new Error( msg ); 5183 }, 5184 5185 noop: function() {}, 5186 5187 isPlainObject: function( obj ) { 5188 var proto, Ctor; 5189 5190 // Detect obvious negatives 5191 // Use toString instead of jQuery.type to catch host objects 5192 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 5193 return false; 5194 } 5195 5196 proto = getProto( obj ); 5197 5198 // Objects with no prototype (e.g., `Object.create( null )`) are plain 5199 if ( !proto ) { 5200 return true; 5201 } 5202 5203 // Objects with prototype are plain iff they were constructed by a global Object function 5204 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 5205 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 5206 }, 5207 5208 isEmptyObject: function( obj ) { 5209 var name; 5210 5211 for ( name in obj ) { 5212 return false; 5213 } 5214 return true; 5215 }, 5216 5217 // Evaluates a script in a provided context; falls back to the global one 5218 // if not specified. 5219 globalEval: function( code, options, doc ) { 5220 DOMEval( code, { nonce: options && options.nonce }, doc ); 5221 }, 5222 5223 each: function( obj, callback ) { 5224 var length, i = 0; 5225 5226 if ( isArrayLike( obj ) ) { 5227 length = obj.length; 5228 for ( ; i < length; i++ ) { 5229 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 5230 break; 5231 } 5232 } 5233 } else { 5234 for ( i in obj ) { 5235 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 5236 break; 5237 } 5238 } 5239 } 5240 5241 return obj; 5242 }, 5243 5244 5245 // Retrieve the text value of an array of DOM nodes 5246 text: function( elem ) { 5247 var node, 5248 ret = "", 5249 i = 0, 5250 nodeType = elem.nodeType; 5251 5252 if ( !nodeType ) { 5253 5254 // If no nodeType, this is expected to be an array 5255 while ( ( node = elem[ i++ ] ) ) { 5256 5257 // Do not traverse comment nodes 5258 ret += jQuery.text( node ); 5259 } 5260 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 5261 return elem.textContent; 5262 } else if ( nodeType === 3 || nodeType === 4 ) { 5263 return elem.nodeValue; 5264 } 5265 5266 // Do not include comment or processing instruction nodes 5267 5268 return ret; 5269 }, 5270 5271 // results is for internal usage only 5272 makeArray: function( arr, results ) { 5273 var ret = results || []; 5274 5275 if ( arr != null ) { 5276 if ( isArrayLike( Object( arr ) ) ) { 5277 jQuery.merge( ret, 5278 typeof arr === "string" ? 5279 [ arr ] : arr 5280 ); 5281 } else { 5282 push.call( ret, arr ); 5283 } 5284 } 5285 5286 return ret; 5287 }, 5288 5289 inArray: function( elem, arr, i ) { 5290 return arr == null ? -1 : indexOf.call( arr, elem, i ); 5291 }, 5292 5293 isXMLDoc: function( elem ) { 5294 var namespace = elem && elem.namespaceURI, 5295 docElem = elem && ( elem.ownerDocument || elem ).documentElement; 5296 5297 // Assume HTML when documentElement doesn't yet exist, such as inside 5298 // document fragments. 5299 return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" ); 5300 }, 5301 5302 // Support: Android <=4.0 only, PhantomJS 1 only 5303 // push.apply(_, arraylike) throws on ancient WebKit 5304 merge: function( first, second ) { 5305 var len = +second.length, 5306 j = 0, 5307 i = first.length; 5308 5309 for ( ; j < len; j++ ) { 5310 first[ i++ ] = second[ j ]; 5311 } 5312 5313 first.length = i; 5314 5315 return first; 5316 }, 5317 5318 grep: function( elems, callback, invert ) { 5319 var callbackInverse, 5320 matches = [], 5321 i = 0, 5322 length = elems.length, 5323 callbackExpect = !invert; 5324 5325 // Go through the array, only saving the items 5326 // that pass the validator function 5327 for ( ; i < length; i++ ) { 5328 callbackInverse = !callback( elems[ i ], i ); 5329 if ( callbackInverse !== callbackExpect ) { 5330 matches.push( elems[ i ] ); 5331 } 5332 } 5333 5334 return matches; 5335 }, 5336 5337 // arg is for internal usage only 5338 map: function( elems, callback, arg ) { 5339 var length, value, 5340 i = 0, 5341 ret = []; 5342 5343 // Go through the array, translating each of the items to their new values 5344 if ( isArrayLike( elems ) ) { 5345 length = elems.length; 5346 for ( ; i < length; i++ ) { 5347 value = callback( elems[ i ], i, arg ); 5348 5349 if ( value != null ) { 5350 ret.push( value ); 5351 } 5352 } 5353 5354 // Go through every key on the object, 5355 } else { 5356 for ( i in elems ) { 5357 value = callback( elems[ i ], i, arg ); 5358 5359 if ( value != null ) { 5360 ret.push( value ); 5361 } 5362 } 5363 } 5364 5365 // Flatten any nested arrays 5366 return flat( ret ); 5367 }, 5368 5369 // A global GUID counter for objects 5370 guid: 1, 5371 5372 // jQuery.support is not used in Core but other projects attach their 5373 // properties to it so it needs to exist. 5374 support: support 5375} ); 5376 5377if ( typeof Symbol === "function" ) { 5378 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 5379} 5380 5381// Populate the class2type map 5382jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 5383 function( _i, name ) { 5384 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 5385 } ); 5386 5387function isArrayLike( obj ) { 5388 5389 // Support: real iOS 8.2 only (not reproducible in simulator) 5390 // `in` check used to prevent JIT error (gh-2145) 5391 // hasOwn isn't used here due to false negatives 5392 // regarding Nodelist length in IE 5393 var length = !!obj && "length" in obj && obj.length, 5394 type = toType( obj ); 5395 5396 if ( isFunction( obj ) || isWindow( obj ) ) { 5397 return false; 5398 } 5399 5400 return type === "array" || length === 0 || 5401 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 5402} 5403 5404 5405function nodeName( elem, name ) { 5406 5407 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 5408 5409} 5410var pop = arr.pop; 5411 5412 5413var sort = arr.sort; 5414 5415 5416var splice = arr.splice; 5417 5418 5419var whitespace = "[\\x20\\t\\r\\n\\f]"; 5420 5421 5422var rtrimCSS = new RegExp( 5423 "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", 5424 "g" 5425); 5426 5427 5428 5429 5430// Note: an element does not contain itself 5431jQuery.contains = function( a, b ) { 5432 var bup = b && b.parentNode; 5433 5434 return a === bup || !!( bup && bup.nodeType === 1 && ( 5435 5436 // Support: IE 9 - 11+ 5437 // IE doesn't have `contains` on SVG. 5438 a.contains ? 5439 a.contains( bup ) : 5440 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 5441 ) ); 5442}; 5443 5444 5445 5446 5447// CSS string/identifier serialization 5448// https://drafts.csswg.org/cssom/#common-serializing-idioms 5449var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; 5450 5451function fcssescape( ch, asCodePoint ) { 5452 if ( asCodePoint ) { 5453 5454 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 5455 if ( ch === "\0" ) { 5456 return "\uFFFD"; 5457 } 5458 5459 // Control characters and (dependent upon position) numbers get escaped as code points 5460 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 5461 } 5462 5463 // Other potentially-special ASCII characters get backslash-escaped 5464 return "\\" + ch; 5465} 5466 5467jQuery.escapeSelector = function( sel ) { 5468 return ( sel + "" ).replace( rcssescape, fcssescape ); 5469}; 5470 5471 5472 5473 5474var preferredDoc = document, 5475 pushNative = push; 5476 5477( function() { 5478 5479var i, 5480 Expr, 5481 outermostContext, 5482 sortInput, 5483 hasDuplicate, 5484 push = pushNative, 5485 5486 // Local document vars 5487 document, 5488 documentElement, 5489 documentIsHTML, 5490 rbuggyQSA, 5491 matches, 5492 5493 // Instance-specific data 5494 expando = jQuery.expando, 5495 dirruns = 0, 5496 done = 0, 5497 classCache = createCache(), 5498 tokenCache = createCache(), 5499 compilerCache = createCache(), 5500 nonnativeSelectorCache = createCache(), 5501 sortOrder = function( a, b ) { 5502 if ( a === b ) { 5503 hasDuplicate = true; 5504 } 5505 return 0; 5506 }, 5507 5508 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" + 5509 "loop|multiple|open|readonly|required|scoped", 5510 5511 // Regular expressions 5512 5513 // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram 5514 identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + 5515 "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", 5516 5517 // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors 5518 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 5519 5520 // Operator (capture 2) 5521 "*([*^$|!~]?=)" + whitespace + 5522 5523 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 5524 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + 5525 whitespace + "*\\]", 5526 5527 pseudos = ":(" + identifier + ")(?:\\((" + 5528 5529 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 5530 // 1. quoted (capture 3; capture 4 or capture 5) 5531 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 5532 5533 // 2. simple (capture 6) 5534 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 5535 5536 // 3. anything else (capture 2) 5537 ".*" + 5538 ")\\)|)", 5539 5540 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 5541 rwhitespace = new RegExp( whitespace + "+", "g" ), 5542 5543 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 5544 rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + 5545 whitespace + "*" ), 5546 rdescend = new RegExp( whitespace + "|>" ), 5547 5548 rpseudo = new RegExp( pseudos ), 5549 ridentifier = new RegExp( "^" + identifier + "$" ), 5550 5551 matchExpr = { 5552 ID: new RegExp( "^#(" + identifier + ")" ), 5553 CLASS: new RegExp( "^\\.(" + identifier + ")" ), 5554 TAG: new RegExp( "^(" + identifier + "|[*])" ), 5555 ATTR: new RegExp( "^" + attributes ), 5556 PSEUDO: new RegExp( "^" + pseudos ), 5557 CHILD: new RegExp( 5558 "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + 5559 whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + 5560 whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 5561 bool: new RegExp( "^(?:" + booleans + ")$", "i" ), 5562 5563 // For use in libraries implementing .is() 5564 // We use this for POS matching in `select` 5565 needsContext: new RegExp( "^" + whitespace + 5566 "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + 5567 "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 5568 }, 5569 5570 rinputs = /^(?:input|select|textarea|button)$/i, 5571 rheader = /^h\d$/i, 5572 5573 // Easily-parseable/retrievable ID or TAG or CLASS selectors 5574 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 5575 5576 rsibling = /[+~]/, 5577 5578 // CSS escapes 5579 // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters 5580 runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + 5581 "?|\\\\([^\\r\\n\\f])", "g" ), 5582 funescape = function( escape, nonHex ) { 5583 var high = "0x" + escape.slice( 1 ) - 0x10000; 5584 5585 if ( nonHex ) { 5586 5587 // Strip the backslash prefix from a non-hex escape sequence 5588 return nonHex; 5589 } 5590 5591 // Replace a hexadecimal escape sequence with the encoded Unicode code point 5592 // Support: IE <=11+ 5593 // For values outside the Basic Multilingual Plane (BMP), manually construct a 5594 // surrogate pair 5595 return high < 0 ? 5596 String.fromCharCode( high + 0x10000 ) : 5597 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 5598 }, 5599 5600 // Used for iframes; see `setDocument`. 5601 // Support: IE 9 - 11+, Edge 12 - 18+ 5602 // Removing the function wrapper causes a "Permission Denied" 5603 // error in IE/Edge. 5604 unloadHandler = function() { 5605 setDocument(); 5606 }, 5607 5608 inDisabledFieldset = addCombinator( 5609 function( elem ) { 5610 return elem.disabled === true && nodeName( elem, "fieldset" ); 5611 }, 5612 { dir: "parentNode", next: "legend" } 5613 ); 5614 5615// Support: IE <=9 only 5616// Accessing document.activeElement can throw unexpectedly 5617// https://bugs.jquery.com/ticket/13393 5618function safeActiveElement() { 5619 try { 5620 return document.activeElement; 5621 } catch ( err ) { } 5622} 5623 5624// Optimize for push.apply( _, NodeList ) 5625try { 5626 push.apply( 5627 ( arr = slice.call( preferredDoc.childNodes ) ), 5628 preferredDoc.childNodes 5629 ); 5630 5631 // Support: Android <=4.0 5632 // Detect silently failing push.apply 5633 // eslint-disable-next-line no-unused-expressions 5634 arr[ preferredDoc.childNodes.length ].nodeType; 5635} catch ( e ) { 5636 push = { 5637 apply: function( target, els ) { 5638 pushNative.apply( target, slice.call( els ) ); 5639 }, 5640 call: function( target ) { 5641 pushNative.apply( target, slice.call( arguments, 1 ) ); 5642 } 5643 }; 5644} 5645 5646function find( selector, context, results, seed ) { 5647 var m, i, elem, nid, match, groups, newSelector, 5648 newContext = context && context.ownerDocument, 5649 5650 // nodeType defaults to 9, since context defaults to document 5651 nodeType = context ? context.nodeType : 9; 5652 5653 results = results || []; 5654 5655 // Return early from calls with invalid selector or context 5656 if ( typeof selector !== "string" || !selector || 5657 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 5658 5659 return results; 5660 } 5661 5662 // Try to shortcut find operations (as opposed to filters) in HTML documents 5663 if ( !seed ) { 5664 setDocument( context ); 5665 context = context || document; 5666 5667 if ( documentIsHTML ) { 5668 5669 // If the selector is sufficiently simple, try using a "get*By*" DOM method 5670 // (excepting DocumentFragment context, where the methods don't exist) 5671 if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { 5672 5673 // ID selector 5674 if ( ( m = match[ 1 ] ) ) { 5675 5676 // Document context 5677 if ( nodeType === 9 ) { 5678 if ( ( elem = context.getElementById( m ) ) ) { 5679 5680 // Support: IE 9 only 5681 // getElementById can match elements by name instead of ID 5682 if ( elem.id === m ) { 5683 push.call( results, elem ); 5684 return results; 5685 } 5686 } else { 5687 return results; 5688 } 5689 5690 // Element context 5691 } else { 5692 5693 // Support: IE 9 only 5694 // getElementById can match elements by name instead of ID 5695 if ( newContext && ( elem = newContext.getElementById( m ) ) && 5696 find.contains( context, elem ) && 5697 elem.id === m ) { 5698 5699 push.call( results, elem ); 5700 return results; 5701 } 5702 } 5703 5704 // Type selector 5705 } else if ( match[ 2 ] ) { 5706 push.apply( results, context.getElementsByTagName( selector ) ); 5707 return results; 5708 5709 // Class selector 5710 } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) { 5711 push.apply( results, context.getElementsByClassName( m ) ); 5712 return results; 5713 } 5714 } 5715 5716 // Take advantage of querySelectorAll 5717 if ( !nonnativeSelectorCache[ selector + " " ] && 5718 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) { 5719 5720 newSelector = selector; 5721 newContext = context; 5722 5723 // qSA considers elements outside a scoping root when evaluating child or 5724 // descendant combinators, which is not what we want. 5725 // In such cases, we work around the behavior by prefixing every selector in the 5726 // list with an ID selector referencing the scope context. 5727 // The technique has to be used as well when a leading combinator is used 5728 // as such selectors are not recognized by querySelectorAll. 5729 // Thanks to Andrew Dupont for this technique. 5730 if ( nodeType === 1 && 5731 ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) { 5732 5733 // Expand context for sibling selectors 5734 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 5735 context; 5736 5737 // We can use :scope instead of the ID hack if the browser 5738 // supports it & if we're not changing the context. 5739 // Support: IE 11+, Edge 17 - 18+ 5740 // IE/Edge sometimes throw a "Permission denied" error when 5741 // strict-comparing two documents; shallow comparisons work. 5742 // eslint-disable-next-line eqeqeq 5743 if ( newContext != context || !support.scope ) { 5744 5745 // Capture the context ID, setting it first if necessary 5746 if ( ( nid = context.getAttribute( "id" ) ) ) { 5747 nid = jQuery.escapeSelector( nid ); 5748 } else { 5749 context.setAttribute( "id", ( nid = expando ) ); 5750 } 5751 } 5752 5753 // Prefix every selector in the list 5754 groups = tokenize( selector ); 5755 i = groups.length; 5756 while ( i-- ) { 5757 groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + 5758 toSelector( groups[ i ] ); 5759 } 5760 newSelector = groups.join( "," ); 5761 } 5762 5763 try { 5764 push.apply( results, 5765 newContext.querySelectorAll( newSelector ) 5766 ); 5767 return results; 5768 } catch ( qsaError ) { 5769 nonnativeSelectorCache( selector, true ); 5770 } finally { 5771 if ( nid === expando ) { 5772 context.removeAttribute( "id" ); 5773 } 5774 } 5775 } 5776 } 5777 } 5778 5779 // All others 5780 return select( selector.replace( rtrimCSS, "$1" ), context, results, seed ); 5781} 5782 5783/** 5784 * Create key-value caches of limited size 5785 * @returns {function(string, object)} Returns the Object data after storing it on itself with 5786 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 5787 * deleting the oldest entry 5788 */ 5789function createCache() { 5790 var keys = []; 5791 5792 function cache( key, value ) { 5793 5794 // Use (key + " ") to avoid collision with native prototype properties 5795 // (see https://github.com/jquery/sizzle/issues/157) 5796 if ( keys.push( key + " " ) > Expr.cacheLength ) { 5797 5798 // Only keep the most recent entries 5799 delete cache[ keys.shift() ]; 5800 } 5801 return ( cache[ key + " " ] = value ); 5802 } 5803 return cache; 5804} 5805 5806/** 5807 * Mark a function for special use by jQuery selector module 5808 * @param {Function} fn The function to mark 5809 */ 5810function markFunction( fn ) { 5811 fn[ expando ] = true; 5812 return fn; 5813} 5814 5815/** 5816 * Support testing using an element 5817 * @param {Function} fn Passed the created element and returns a boolean result 5818 */ 5819function assert( fn ) { 5820 var el = document.createElement( "fieldset" ); 5821 5822 try { 5823 return !!fn( el ); 5824 } catch ( e ) { 5825 return false; 5826 } finally { 5827 5828 // Remove from its parent by default 5829 if ( el.parentNode ) { 5830 el.parentNode.removeChild( el ); 5831 } 5832 5833 // release memory in IE 5834 el = null; 5835 } 5836} 5837 5838/** 5839 * Returns a function to use in pseudos for input types 5840 * @param {String} type 5841 */ 5842function createInputPseudo( type ) { 5843 return function( elem ) { 5844 return nodeName( elem, "input" ) && elem.type === type; 5845 }; 5846} 5847 5848/** 5849 * Returns a function to use in pseudos for buttons 5850 * @param {String} type 5851 */ 5852function createButtonPseudo( type ) { 5853 return function( elem ) { 5854 return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) && 5855 elem.type === type; 5856 }; 5857} 5858 5859/** 5860 * Returns a function to use in pseudos for :enabled/:disabled 5861 * @param {Boolean} disabled true for :disabled; false for :enabled 5862 */ 5863function createDisabledPseudo( disabled ) { 5864 5865 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 5866 return function( elem ) { 5867 5868 // Only certain elements can match :enabled or :disabled 5869 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 5870 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 5871 if ( "form" in elem ) { 5872 5873 // Check for inherited disabledness on relevant non-disabled elements: 5874 // * listed form-associated elements in a disabled fieldset 5875 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 5876 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 5877 // * option elements in a disabled optgroup 5878 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 5879 // All such elements have a "form" property. 5880 if ( elem.parentNode && elem.disabled === false ) { 5881 5882 // Option elements defer to a parent optgroup if present 5883 if ( "label" in elem ) { 5884 if ( "label" in elem.parentNode ) { 5885 return elem.parentNode.disabled === disabled; 5886 } else { 5887 return elem.disabled === disabled; 5888 } 5889 } 5890 5891 // Support: IE 6 - 11+ 5892 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 5893 return elem.isDisabled === disabled || 5894 5895 // Where there is no isDisabled, check manually 5896 elem.isDisabled !== !disabled && 5897 inDisabledFieldset( elem ) === disabled; 5898 } 5899 5900 return elem.disabled === disabled; 5901 5902 // Try to winnow out elements that can't be disabled before trusting the disabled property. 5903 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 5904 // even exist on them, let alone have a boolean value. 5905 } else if ( "label" in elem ) { 5906 return elem.disabled === disabled; 5907 } 5908 5909 // Remaining elements are neither :enabled nor :disabled 5910 return false; 5911 }; 5912} 5913 5914/** 5915 * Returns a function to use in pseudos for positionals 5916 * @param {Function} fn 5917 */ 5918function createPositionalPseudo( fn ) { 5919 return markFunction( function( argument ) { 5920 argument = +argument; 5921 return markFunction( function( seed, matches ) { 5922 var j, 5923 matchIndexes = fn( [], seed.length, argument ), 5924 i = matchIndexes.length; 5925 5926 // Match elements found at the specified indexes 5927 while ( i-- ) { 5928 if ( seed[ ( j = matchIndexes[ i ] ) ] ) { 5929 seed[ j ] = !( matches[ j ] = seed[ j ] ); 5930 } 5931 } 5932 } ); 5933 } ); 5934} 5935 5936/** 5937 * Checks a node for validity as a jQuery selector context 5938 * @param {Element|Object=} context 5939 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 5940 */ 5941function testContext( context ) { 5942 return context && typeof context.getElementsByTagName !== "undefined" && context; 5943} 5944 5945/** 5946 * Sets document-related variables once based on the current document 5947 * @param {Element|Object} [node] An element or document object to use to set the document 5948 * @returns {Object} Returns the current document 5949 */ 5950function setDocument( node ) { 5951 var subWindow, 5952 doc = node ? node.ownerDocument || node : preferredDoc; 5953 5954 // Return early if doc is invalid or already selected 5955 // Support: IE 11+, Edge 17 - 18+ 5956 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5957 // two documents; shallow comparisons work. 5958 // eslint-disable-next-line eqeqeq 5959 if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { 5960 return document; 5961 } 5962 5963 // Update global variables 5964 document = doc; 5965 documentElement = document.documentElement; 5966 documentIsHTML = !jQuery.isXMLDoc( document ); 5967 5968 // Support: iOS 7 only, IE 9 - 11+ 5969 // Older browsers didn't support unprefixed `matches`. 5970 matches = documentElement.matches || 5971 documentElement.webkitMatchesSelector || 5972 documentElement.msMatchesSelector; 5973 5974 // Support: IE 9 - 11+, Edge 12 - 18+ 5975 // Accessing iframe documents after unload throws "permission denied" errors (see trac-13936) 5976 // Support: IE 11+, Edge 17 - 18+ 5977 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5978 // two documents; shallow comparisons work. 5979 // eslint-disable-next-line eqeqeq 5980 if ( preferredDoc != document && 5981 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { 5982 5983 // Support: IE 9 - 11+, Edge 12 - 18+ 5984 subWindow.addEventListener( "unload", unloadHandler ); 5985 } 5986 5987 // Support: IE <10 5988 // Check if getElementById returns elements by name 5989 // The broken getElementById methods don't pick up programmatically-set names, 5990 // so use a roundabout getElementsByName test 5991 support.getById = assert( function( el ) { 5992 documentElement.appendChild( el ).id = jQuery.expando; 5993 return !document.getElementsByName || 5994 !document.getElementsByName( jQuery.expando ).length; 5995 } ); 5996 5997 // Support: IE 9 only 5998 // Check to see if it's possible to do matchesSelector 5999 // on a disconnected node. 6000 support.disconnectedMatch = assert( function( el ) { 6001 return matches.call( el, "*" ); 6002 } ); 6003 6004 // Support: IE 9 - 11+, Edge 12 - 18+ 6005 // IE/Edge don't support the :scope pseudo-class. 6006 support.scope = assert( function() { 6007 return document.querySelectorAll( ":scope" ); 6008 } ); 6009 6010 // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only 6011 // Make sure the `:has()` argument is parsed unforgivingly. 6012 // We include `*` in the test to detect buggy implementations that are 6013 // _selectively_ forgiving (specifically when the list includes at least 6014 // one valid selector). 6015 // Note that we treat complete lack of support for `:has()` as if it were 6016 // spec-compliant support, which is fine because use of `:has()` in such 6017 // environments will fail in the qSA path and fall back to jQuery traversal 6018 // anyway. 6019 support.cssHas = assert( function() { 6020 try { 6021 document.querySelector( ":has(*,:jqfake)" ); 6022 return false; 6023 } catch ( e ) { 6024 return true; 6025 } 6026 } ); 6027 6028 // ID filter and find 6029 if ( support.getById ) { 6030 Expr.filter.ID = function( id ) { 6031 var attrId = id.replace( runescape, funescape ); 6032 return function( elem ) { 6033 return elem.getAttribute( "id" ) === attrId; 6034 }; 6035 }; 6036 Expr.find.ID = function( id, context ) { 6037 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 6038 var elem = context.getElementById( id ); 6039 return elem ? [ elem ] : []; 6040 } 6041 }; 6042 } else { 6043 Expr.filter.ID = function( id ) { 6044 var attrId = id.replace( runescape, funescape ); 6045 return function( elem ) { 6046 var node = typeof elem.getAttributeNode !== "undefined" && 6047 elem.getAttributeNode( "id" ); 6048 return node && node.value === attrId; 6049 }; 6050 }; 6051 6052 // Support: IE 6 - 7 only 6053 // getElementById is not reliable as a find shortcut 6054 Expr.find.ID = function( id, context ) { 6055 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 6056 var node, i, elems, 6057 elem = context.getElementById( id ); 6058 6059 if ( elem ) { 6060 6061 // Verify the id attribute 6062 node = elem.getAttributeNode( "id" ); 6063 if ( node && node.value === id ) { 6064 return [ elem ]; 6065 } 6066 6067 // Fall back on getElementsByName 6068 elems = context.getElementsByName( id ); 6069 i = 0; 6070 while ( ( elem = elems[ i++ ] ) ) { 6071 node = elem.getAttributeNode( "id" ); 6072 if ( node && node.value === id ) { 6073 return [ elem ]; 6074 } 6075 } 6076 } 6077 6078 return []; 6079 } 6080 }; 6081 } 6082 6083 // Tag 6084 Expr.find.TAG = function( tag, context ) { 6085 if ( typeof context.getElementsByTagName !== "undefined" ) { 6086 return context.getElementsByTagName( tag ); 6087 6088 // DocumentFragment nodes don't have gEBTN 6089 } else { 6090 return context.querySelectorAll( tag ); 6091 } 6092 }; 6093 6094 // Class 6095 Expr.find.CLASS = function( className, context ) { 6096 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 6097 return context.getElementsByClassName( className ); 6098 } 6099 }; 6100 6101 /* QSA/matchesSelector 6102 ---------------------------------------------------------------------- */ 6103 6104 // QSA and matchesSelector support 6105 6106 rbuggyQSA = []; 6107 6108 // Build QSA regex 6109 // Regex strategy adopted from Diego Perini 6110 assert( function( el ) { 6111 6112 var input; 6113 6114 documentElement.appendChild( el ).innerHTML = 6115 "<a id='" + expando + "' href='' disabled='disabled'></a>" + 6116 "<select id='" + expando + "-\r\\' disabled='disabled'>" + 6117 "<option selected=''></option></select>"; 6118 6119 // Support: iOS <=7 - 8 only 6120 // Boolean attributes and "value" are not treated correctly in some XML documents 6121 if ( !el.querySelectorAll( "[selected]" ).length ) { 6122 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 6123 } 6124 6125 // Support: iOS <=7 - 8 only 6126 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 6127 rbuggyQSA.push( "~=" ); 6128 } 6129 6130 // Support: iOS 8 only 6131 // https://bugs.webkit.org/show_bug.cgi?id=136851 6132 // In-page `selector#id sibling-combinator selector` fails 6133 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 6134 rbuggyQSA.push( ".#.+[+~]" ); 6135 } 6136 6137 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ 6138 // In some of the document kinds, these selectors wouldn't work natively. 6139 // This is probably OK but for backwards compatibility we want to maintain 6140 // handling them through jQuery traversal in jQuery 3.x. 6141 if ( !el.querySelectorAll( ":checked" ).length ) { 6142 rbuggyQSA.push( ":checked" ); 6143 } 6144 6145 // Support: Windows 8 Native Apps 6146 // The type and name attributes are restricted during .innerHTML assignment 6147 input = document.createElement( "input" ); 6148 input.setAttribute( "type", "hidden" ); 6149 el.appendChild( input ).setAttribute( "name", "D" ); 6150 6151 // Support: IE 9 - 11+ 6152 // IE's :disabled selector does not pick up the children of disabled fieldsets 6153 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ 6154 // In some of the document kinds, these selectors wouldn't work natively. 6155 // This is probably OK but for backwards compatibility we want to maintain 6156 // handling them through jQuery traversal in jQuery 3.x. 6157 documentElement.appendChild( el ).disabled = true; 6158 if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { 6159 rbuggyQSA.push( ":enabled", ":disabled" ); 6160 } 6161 6162 // Support: IE 11+, Edge 15 - 18+ 6163 // IE 11/Edge don't find elements on a `[name='']` query in some cases. 6164 // Adding a temporary attribute to the document before the selection works 6165 // around the issue. 6166 // Interestingly, IE 10 & older don't seem to have the issue. 6167 input = document.createElement( "input" ); 6168 input.setAttribute( "name", "" ); 6169 el.appendChild( input ); 6170 if ( !el.querySelectorAll( "[name='']" ).length ) { 6171 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + 6172 whitespace + "*(?:''|\"\")" ); 6173 } 6174 } ); 6175 6176 if ( !support.cssHas ) { 6177 6178 // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+ 6179 // Our regular `try-catch` mechanism fails to detect natively-unsupported 6180 // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`) 6181 // in browsers that parse the `:has()` argument as a forgiving selector list. 6182 // https://drafts.csswg.org/selectors/#relational now requires the argument 6183 // to be parsed unforgivingly, but browsers have not yet fully adjusted. 6184 rbuggyQSA.push( ":has" ); 6185 } 6186 6187 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); 6188 6189 /* Sorting 6190 ---------------------------------------------------------------------- */ 6191 6192 // Document order sorting 6193 sortOrder = function( a, b ) { 6194 6195 // Flag for duplicate removal 6196 if ( a === b ) { 6197 hasDuplicate = true; 6198 return 0; 6199 } 6200 6201 // Sort on method existence if only one input has compareDocumentPosition 6202 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 6203 if ( compare ) { 6204 return compare; 6205 } 6206 6207 // Calculate position if both inputs belong to the same document 6208 // Support: IE 11+, Edge 17 - 18+ 6209 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6210 // two documents; shallow comparisons work. 6211 // eslint-disable-next-line eqeqeq 6212 compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? 6213 a.compareDocumentPosition( b ) : 6214 6215 // Otherwise we know they are disconnected 6216 1; 6217 6218 // Disconnected nodes 6219 if ( compare & 1 || 6220 ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { 6221 6222 // Choose the first element that is related to our preferred document 6223 // Support: IE 11+, Edge 17 - 18+ 6224 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6225 // two documents; shallow comparisons work. 6226 // eslint-disable-next-line eqeqeq 6227 if ( a === document || a.ownerDocument == preferredDoc && 6228 find.contains( preferredDoc, a ) ) { 6229 return -1; 6230 } 6231 6232 // Support: IE 11+, Edge 17 - 18+ 6233 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6234 // two documents; shallow comparisons work. 6235 // eslint-disable-next-line eqeqeq 6236 if ( b === document || b.ownerDocument == preferredDoc && 6237 find.contains( preferredDoc, b ) ) { 6238 return 1; 6239 } 6240 6241 // Maintain original order 6242 return sortInput ? 6243 ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 6244 0; 6245 } 6246 6247 return compare & 4 ? -1 : 1; 6248 }; 6249 6250 return document; 6251} 6252 6253find.matches = function( expr, elements ) { 6254 return find( expr, null, null, elements ); 6255}; 6256 6257find.matchesSelector = function( elem, expr ) { 6258 setDocument( elem ); 6259 6260 if ( documentIsHTML && 6261 !nonnativeSelectorCache[ expr + " " ] && 6262 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 6263 6264 try { 6265 var ret = matches.call( elem, expr ); 6266 6267 // IE 9's matchesSelector returns false on disconnected nodes 6268 if ( ret || support.disconnectedMatch || 6269 6270 // As well, disconnected nodes are said to be in a document 6271 // fragment in IE 9 6272 elem.document && elem.document.nodeType !== 11 ) { 6273 return ret; 6274 } 6275 } catch ( e ) { 6276 nonnativeSelectorCache( expr, true ); 6277 } 6278 } 6279 6280 return find( expr, document, null, [ elem ] ).length > 0; 6281}; 6282 6283find.contains = function( context, elem ) { 6284 6285 // Set document vars if needed 6286 // Support: IE 11+, Edge 17 - 18+ 6287 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6288 // two documents; shallow comparisons work. 6289 // eslint-disable-next-line eqeqeq 6290 if ( ( context.ownerDocument || context ) != document ) { 6291 setDocument( context ); 6292 } 6293 return jQuery.contains( context, elem ); 6294}; 6295 6296 6297find.attr = function( elem, name ) { 6298 6299 // Set document vars if needed 6300 // Support: IE 11+, Edge 17 - 18+ 6301 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6302 // two documents; shallow comparisons work. 6303 // eslint-disable-next-line eqeqeq 6304 if ( ( elem.ownerDocument || elem ) != document ) { 6305 setDocument( elem ); 6306 } 6307 6308 var fn = Expr.attrHandle[ name.toLowerCase() ], 6309 6310 // Don't get fooled by Object.prototype properties (see trac-13807) 6311 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 6312 fn( elem, name, !documentIsHTML ) : 6313 undefined; 6314 6315 if ( val !== undefined ) { 6316 return val; 6317 } 6318 6319 return elem.getAttribute( name ); 6320}; 6321 6322find.error = function( msg ) { 6323 throw new Error( "Syntax error, unrecognized expression: " + msg ); 6324}; 6325 6326/** 6327 * Document sorting and removing duplicates 6328 * @param {ArrayLike} results 6329 */ 6330jQuery.uniqueSort = function( results ) { 6331 var elem, 6332 duplicates = [], 6333 j = 0, 6334 i = 0; 6335 6336 // Unless we *know* we can detect duplicates, assume their presence 6337 // 6338 // Support: Android <=4.0+ 6339 // Testing for detecting duplicates is unpredictable so instead assume we can't 6340 // depend on duplicate detection in all browsers without a stable sort. 6341 hasDuplicate = !support.sortStable; 6342 sortInput = !support.sortStable && slice.call( results, 0 ); 6343 sort.call( results, sortOrder ); 6344 6345 if ( hasDuplicate ) { 6346 while ( ( elem = results[ i++ ] ) ) { 6347 if ( elem === results[ i ] ) { 6348 j = duplicates.push( i ); 6349 } 6350 } 6351 while ( j-- ) { 6352 splice.call( results, duplicates[ j ], 1 ); 6353 } 6354 } 6355 6356 // Clear input after sorting to release objects 6357 // See https://github.com/jquery/sizzle/pull/225 6358 sortInput = null; 6359 6360 return results; 6361}; 6362 6363jQuery.fn.uniqueSort = function() { 6364 return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) ); 6365}; 6366 6367Expr = jQuery.expr = { 6368 6369 // Can be adjusted by the user 6370 cacheLength: 50, 6371 6372 createPseudo: markFunction, 6373 6374 match: matchExpr, 6375 6376 attrHandle: {}, 6377 6378 find: {}, 6379 6380 relative: { 6381 ">": { dir: "parentNode", first: true }, 6382 " ": { dir: "parentNode" }, 6383 "+": { dir: "previousSibling", first: true }, 6384 "~": { dir: "previousSibling" } 6385 }, 6386 6387 preFilter: { 6388 ATTR: function( match ) { 6389 match[ 1 ] = match[ 1 ].replace( runescape, funescape ); 6390 6391 // Move the given value to match[3] whether quoted or unquoted 6392 match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" ) 6393 .replace( runescape, funescape ); 6394 6395 if ( match[ 2 ] === "~=" ) { 6396 match[ 3 ] = " " + match[ 3 ] + " "; 6397 } 6398 6399 return match.slice( 0, 4 ); 6400 }, 6401 6402 CHILD: function( match ) { 6403 6404 /* matches from matchExpr["CHILD"] 6405 1 type (only|nth|...) 6406 2 what (child|of-type) 6407 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 6408 4 xn-component of xn+y argument ([+-]?\d*n|) 6409 5 sign of xn-component 6410 6 x of xn-component 6411 7 sign of y-component 6412 8 y of y-component 6413 */ 6414 match[ 1 ] = match[ 1 ].toLowerCase(); 6415 6416 if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { 6417 6418 // nth-* requires argument 6419 if ( !match[ 3 ] ) { 6420 find.error( match[ 0 ] ); 6421 } 6422 6423 // numeric x and y parameters for Expr.filter.CHILD 6424 // remember that false/true cast respectively to 0/1 6425 match[ 4 ] = +( match[ 4 ] ? 6426 match[ 5 ] + ( match[ 6 ] || 1 ) : 6427 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) 6428 ); 6429 match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); 6430 6431 // other types prohibit arguments 6432 } else if ( match[ 3 ] ) { 6433 find.error( match[ 0 ] ); 6434 } 6435 6436 return match; 6437 }, 6438 6439 PSEUDO: function( match ) { 6440 var excess, 6441 unquoted = !match[ 6 ] && match[ 2 ]; 6442 6443 if ( matchExpr.CHILD.test( match[ 0 ] ) ) { 6444 return null; 6445 } 6446 6447 // Accept quoted arguments as-is 6448 if ( match[ 3 ] ) { 6449 match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; 6450 6451 // Strip excess characters from unquoted arguments 6452 } else if ( unquoted && rpseudo.test( unquoted ) && 6453 6454 // Get excess from tokenize (recursively) 6455 ( excess = tokenize( unquoted, true ) ) && 6456 6457 // advance to the next closing parenthesis 6458 ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { 6459 6460 // excess is a negative index 6461 match[ 0 ] = match[ 0 ].slice( 0, excess ); 6462 match[ 2 ] = unquoted.slice( 0, excess ); 6463 } 6464 6465 // Return only captures needed by the pseudo filter method (type and argument) 6466 return match.slice( 0, 3 ); 6467 } 6468 }, 6469 6470 filter: { 6471 6472 TAG: function( nodeNameSelector ) { 6473 var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 6474 return nodeNameSelector === "*" ? 6475 function() { 6476 return true; 6477 } : 6478 function( elem ) { 6479 return nodeName( elem, expectedNodeName ); 6480 }; 6481 }, 6482 6483 CLASS: function( className ) { 6484 var pattern = classCache[ className + " " ]; 6485 6486 return pattern || 6487 ( pattern = new RegExp( "(^|" + whitespace + ")" + className + 6488 "(" + whitespace + "|$)" ) ) && 6489 classCache( className, function( elem ) { 6490 return pattern.test( 6491 typeof elem.className === "string" && elem.className || 6492 typeof elem.getAttribute !== "undefined" && 6493 elem.getAttribute( "class" ) || 6494 "" 6495 ); 6496 } ); 6497 }, 6498 6499 ATTR: function( name, operator, check ) { 6500 return function( elem ) { 6501 var result = find.attr( elem, name ); 6502 6503 if ( result == null ) { 6504 return operator === "!="; 6505 } 6506 if ( !operator ) { 6507 return true; 6508 } 6509 6510 result += ""; 6511 6512 if ( operator === "=" ) { 6513 return result === check; 6514 } 6515 if ( operator === "!=" ) { 6516 return result !== check; 6517 } 6518 if ( operator === "^=" ) { 6519 return check && result.indexOf( check ) === 0; 6520 } 6521 if ( operator === "*=" ) { 6522 return check && result.indexOf( check ) > -1; 6523 } 6524 if ( operator === "$=" ) { 6525 return check && result.slice( -check.length ) === check; 6526 } 6527 if ( operator === "~=" ) { 6528 return ( " " + result.replace( rwhitespace, " " ) + " " ) 6529 .indexOf( check ) > -1; 6530 } 6531 if ( operator === "|=" ) { 6532 return result === check || result.slice( 0, check.length + 1 ) === check + "-"; 6533 } 6534 6535 return false; 6536 }; 6537 }, 6538 6539 CHILD: function( type, what, _argument, first, last ) { 6540 var simple = type.slice( 0, 3 ) !== "nth", 6541 forward = type.slice( -4 ) !== "last", 6542 ofType = what === "of-type"; 6543 6544 return first === 1 && last === 0 ? 6545 6546 // Shortcut for :nth-*(n) 6547 function( elem ) { 6548 return !!elem.parentNode; 6549 } : 6550 6551 function( elem, _context, xml ) { 6552 var cache, outerCache, node, nodeIndex, start, 6553 dir = simple !== forward ? "nextSibling" : "previousSibling", 6554 parent = elem.parentNode, 6555 name = ofType && elem.nodeName.toLowerCase(), 6556 useCache = !xml && !ofType, 6557 diff = false; 6558 6559 if ( parent ) { 6560 6561 // :(first|last|only)-(child|of-type) 6562 if ( simple ) { 6563 while ( dir ) { 6564 node = elem; 6565 while ( ( node = node[ dir ] ) ) { 6566 if ( ofType ? 6567 nodeName( node, name ) : 6568 node.nodeType === 1 ) { 6569 6570 return false; 6571 } 6572 } 6573 6574 // Reverse direction for :only-* (if we haven't yet done so) 6575 start = dir = type === "only" && !start && "nextSibling"; 6576 } 6577 return true; 6578 } 6579 6580 start = [ forward ? parent.firstChild : parent.lastChild ]; 6581 6582 // non-xml :nth-child(...) stores cache data on `parent` 6583 if ( forward && useCache ) { 6584 6585 // Seek `elem` from a previously-cached index 6586 outerCache = parent[ expando ] || ( parent[ expando ] = {} ); 6587 cache = outerCache[ type ] || []; 6588 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 6589 diff = nodeIndex && cache[ 2 ]; 6590 node = nodeIndex && parent.childNodes[ nodeIndex ]; 6591 6592 while ( ( node = ++nodeIndex && node && node[ dir ] || 6593 6594 // Fallback to seeking `elem` from the start 6595 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 6596 6597 // When found, cache indexes on `parent` and break 6598 if ( node.nodeType === 1 && ++diff && node === elem ) { 6599 outerCache[ type ] = [ dirruns, nodeIndex, diff ]; 6600 break; 6601 } 6602 } 6603 6604 } else { 6605 6606 // Use previously-cached element index if available 6607 if ( useCache ) { 6608 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 6609 cache = outerCache[ type ] || []; 6610 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 6611 diff = nodeIndex; 6612 } 6613 6614 // xml :nth-child(...) 6615 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 6616 if ( diff === false ) { 6617 6618 // Use the same loop as above to seek `elem` from the start 6619 while ( ( node = ++nodeIndex && node && node[ dir ] || 6620 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 6621 6622 if ( ( ofType ? 6623 nodeName( node, name ) : 6624 node.nodeType === 1 ) && 6625 ++diff ) { 6626 6627 // Cache the index of each encountered element 6628 if ( useCache ) { 6629 outerCache = node[ expando ] || 6630 ( node[ expando ] = {} ); 6631 outerCache[ type ] = [ dirruns, diff ]; 6632 } 6633 6634 if ( node === elem ) { 6635 break; 6636 } 6637 } 6638 } 6639 } 6640 } 6641 6642 // Incorporate the offset, then check against cycle size 6643 diff -= last; 6644 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 6645 } 6646 }; 6647 }, 6648 6649 PSEUDO: function( pseudo, argument ) { 6650 6651 // pseudo-class names are case-insensitive 6652 // https://www.w3.org/TR/selectors/#pseudo-classes 6653 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 6654 // Remember that setFilters inherits from pseudos 6655 var args, 6656 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 6657 find.error( "unsupported pseudo: " + pseudo ); 6658 6659 // The user may use createPseudo to indicate that 6660 // arguments are needed to create the filter function 6661 // just as jQuery does 6662 if ( fn[ expando ] ) { 6663 return fn( argument ); 6664 } 6665 6666 // But maintain support for old signatures 6667 if ( fn.length > 1 ) { 6668 args = [ pseudo, pseudo, "", argument ]; 6669 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 6670 markFunction( function( seed, matches ) { 6671 var idx, 6672 matched = fn( seed, argument ), 6673 i = matched.length; 6674 while ( i-- ) { 6675 idx = indexOf.call( seed, matched[ i ] ); 6676 seed[ idx ] = !( matches[ idx ] = matched[ i ] ); 6677 } 6678 } ) : 6679 function( elem ) { 6680 return fn( elem, 0, args ); 6681 }; 6682 } 6683 6684 return fn; 6685 } 6686 }, 6687 6688 pseudos: { 6689 6690 // Potentially complex pseudos 6691 not: markFunction( function( selector ) { 6692 6693 // Trim the selector passed to compile 6694 // to avoid treating leading and trailing 6695 // spaces as combinators 6696 var input = [], 6697 results = [], 6698 matcher = compile( selector.replace( rtrimCSS, "$1" ) ); 6699 6700 return matcher[ expando ] ? 6701 markFunction( function( seed, matches, _context, xml ) { 6702 var elem, 6703 unmatched = matcher( seed, null, xml, [] ), 6704 i = seed.length; 6705 6706 // Match elements unmatched by `matcher` 6707 while ( i-- ) { 6708 if ( ( elem = unmatched[ i ] ) ) { 6709 seed[ i ] = !( matches[ i ] = elem ); 6710 } 6711 } 6712 } ) : 6713 function( elem, _context, xml ) { 6714 input[ 0 ] = elem; 6715 matcher( input, null, xml, results ); 6716 6717 // Don't keep the element 6718 // (see https://github.com/jquery/sizzle/issues/299) 6719 input[ 0 ] = null; 6720 return !results.pop(); 6721 }; 6722 } ), 6723 6724 has: markFunction( function( selector ) { 6725 return function( elem ) { 6726 return find( selector, elem ).length > 0; 6727 }; 6728 } ), 6729 6730 contains: markFunction( function( text ) { 6731 text = text.replace( runescape, funescape ); 6732 return function( elem ) { 6733 return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1; 6734 }; 6735 } ), 6736 6737 // "Whether an element is represented by a :lang() selector 6738 // is based solely on the element's language value 6739 // being equal to the identifier C, 6740 // or beginning with the identifier C immediately followed by "-". 6741 // The matching of C against the element's language value is performed case-insensitively. 6742 // The identifier C does not have to be a valid language name." 6743 // https://www.w3.org/TR/selectors/#lang-pseudo 6744 lang: markFunction( function( lang ) { 6745 6746 // lang value must be a valid identifier 6747 if ( !ridentifier.test( lang || "" ) ) { 6748 find.error( "unsupported lang: " + lang ); 6749 } 6750 lang = lang.replace( runescape, funescape ).toLowerCase(); 6751 return function( elem ) { 6752 var elemLang; 6753 do { 6754 if ( ( elemLang = documentIsHTML ? 6755 elem.lang : 6756 elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { 6757 6758 elemLang = elemLang.toLowerCase(); 6759 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 6760 } 6761 } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); 6762 return false; 6763 }; 6764 } ), 6765 6766 // Miscellaneous 6767 target: function( elem ) { 6768 var hash = window.location && window.location.hash; 6769 return hash && hash.slice( 1 ) === elem.id; 6770 }, 6771 6772 root: function( elem ) { 6773 return elem === documentElement; 6774 }, 6775 6776 focus: function( elem ) { 6777 return elem === safeActiveElement() && 6778 document.hasFocus() && 6779 !!( elem.type || elem.href || ~elem.tabIndex ); 6780 }, 6781 6782 // Boolean properties 6783 enabled: createDisabledPseudo( false ), 6784 disabled: createDisabledPseudo( true ), 6785 6786 checked: function( elem ) { 6787 6788 // In CSS3, :checked should return both checked and selected elements 6789 // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 6790 return ( nodeName( elem, "input" ) && !!elem.checked ) || 6791 ( nodeName( elem, "option" ) && !!elem.selected ); 6792 }, 6793 6794 selected: function( elem ) { 6795 6796 // Support: IE <=11+ 6797 // Accessing the selectedIndex property 6798 // forces the browser to treat the default option as 6799 // selected when in an optgroup. 6800 if ( elem.parentNode ) { 6801 // eslint-disable-next-line no-unused-expressions 6802 elem.parentNode.selectedIndex; 6803 } 6804 6805 return elem.selected === true; 6806 }, 6807 6808 // Contents 6809 empty: function( elem ) { 6810 6811 // https://www.w3.org/TR/selectors/#empty-pseudo 6812 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 6813 // but not by others (comment: 8; processing instruction: 7; etc.) 6814 // nodeType < 6 works because attributes (2) do not appear as children 6815 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 6816 if ( elem.nodeType < 6 ) { 6817 return false; 6818 } 6819 } 6820 return true; 6821 }, 6822 6823 parent: function( elem ) { 6824 return !Expr.pseudos.empty( elem ); 6825 }, 6826 6827 // Element/input types 6828 header: function( elem ) { 6829 return rheader.test( elem.nodeName ); 6830 }, 6831 6832 input: function( elem ) { 6833 return rinputs.test( elem.nodeName ); 6834 }, 6835 6836 button: function( elem ) { 6837 return nodeName( elem, "input" ) && elem.type === "button" || 6838 nodeName( elem, "button" ); 6839 }, 6840 6841 text: function( elem ) { 6842 var attr; 6843 return nodeName( elem, "input" ) && elem.type === "text" && 6844 6845 // Support: IE <10 only 6846 // New HTML5 attribute values (e.g., "search") appear 6847 // with elem.type === "text" 6848 ( ( attr = elem.getAttribute( "type" ) ) == null || 6849 attr.toLowerCase() === "text" ); 6850 }, 6851 6852 // Position-in-collection 6853 first: createPositionalPseudo( function() { 6854 return [ 0 ]; 6855 } ), 6856 6857 last: createPositionalPseudo( function( _matchIndexes, length ) { 6858 return [ length - 1 ]; 6859 } ), 6860 6861 eq: createPositionalPseudo( function( _matchIndexes, length, argument ) { 6862 return [ argument < 0 ? argument + length : argument ]; 6863 } ), 6864 6865 even: createPositionalPseudo( function( matchIndexes, length ) { 6866 var i = 0; 6867 for ( ; i < length; i += 2 ) { 6868 matchIndexes.push( i ); 6869 } 6870 return matchIndexes; 6871 } ), 6872 6873 odd: createPositionalPseudo( function( matchIndexes, length ) { 6874 var i = 1; 6875 for ( ; i < length; i += 2 ) { 6876 matchIndexes.push( i ); 6877 } 6878 return matchIndexes; 6879 } ), 6880 6881 lt: createPositionalPseudo( function( matchIndexes, length, argument ) { 6882 var i; 6883 6884 if ( argument < 0 ) { 6885 i = argument + length; 6886 } else if ( argument > length ) { 6887 i = length; 6888 } else { 6889 i = argument; 6890 } 6891 6892 for ( ; --i >= 0; ) { 6893 matchIndexes.push( i ); 6894 } 6895 return matchIndexes; 6896 } ), 6897 6898 gt: createPositionalPseudo( function( matchIndexes, length, argument ) { 6899 var i = argument < 0 ? argument + length : argument; 6900 for ( ; ++i < length; ) { 6901 matchIndexes.push( i ); 6902 } 6903 return matchIndexes; 6904 } ) 6905 } 6906}; 6907 6908Expr.pseudos.nth = Expr.pseudos.eq; 6909 6910// Add button/input type pseudos 6911for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 6912 Expr.pseudos[ i ] = createInputPseudo( i ); 6913} 6914for ( i in { submit: true, reset: true } ) { 6915 Expr.pseudos[ i ] = createButtonPseudo( i ); 6916} 6917 6918// Easy API for creating new setFilters 6919function setFilters() {} 6920setFilters.prototype = Expr.filters = Expr.pseudos; 6921Expr.setFilters = new setFilters(); 6922 6923function tokenize( selector, parseOnly ) { 6924 var matched, match, tokens, type, 6925 soFar, groups, preFilters, 6926 cached = tokenCache[ selector + " " ]; 6927 6928 if ( cached ) { 6929 return parseOnly ? 0 : cached.slice( 0 ); 6930 } 6931 6932 soFar = selector; 6933 groups = []; 6934 preFilters = Expr.preFilter; 6935 6936 while ( soFar ) { 6937 6938 // Comma and first run 6939 if ( !matched || ( match = rcomma.exec( soFar ) ) ) { 6940 if ( match ) { 6941 6942 // Don't consume trailing commas as valid 6943 soFar = soFar.slice( match[ 0 ].length ) || soFar; 6944 } 6945 groups.push( ( tokens = [] ) ); 6946 } 6947 6948 matched = false; 6949 6950 // Combinators 6951 if ( ( match = rleadingCombinator.exec( soFar ) ) ) { 6952 matched = match.shift(); 6953 tokens.push( { 6954 value: matched, 6955 6956 // Cast descendant combinators to space 6957 type: match[ 0 ].replace( rtrimCSS, " " ) 6958 } ); 6959 soFar = soFar.slice( matched.length ); 6960 } 6961 6962 // Filters 6963 for ( type in Expr.filter ) { 6964 if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || 6965 ( match = preFilters[ type ]( match ) ) ) ) { 6966 matched = match.shift(); 6967 tokens.push( { 6968 value: matched, 6969 type: type, 6970 matches: match 6971 } ); 6972 soFar = soFar.slice( matched.length ); 6973 } 6974 } 6975 6976 if ( !matched ) { 6977 break; 6978 } 6979 } 6980 6981 // Return the length of the invalid excess 6982 // if we're just parsing 6983 // Otherwise, throw an error or return tokens 6984 if ( parseOnly ) { 6985 return soFar.length; 6986 } 6987 6988 return soFar ? 6989 find.error( selector ) : 6990 6991 // Cache the tokens 6992 tokenCache( selector, groups ).slice( 0 ); 6993} 6994 6995function toSelector( tokens ) { 6996 var i = 0, 6997 len = tokens.length, 6998 selector = ""; 6999 for ( ; i < len; i++ ) { 7000 selector += tokens[ i ].value; 7001 } 7002 return selector; 7003} 7004 7005function addCombinator( matcher, combinator, base ) { 7006 var dir = combinator.dir, 7007 skip = combinator.next, 7008 key = skip || dir, 7009 checkNonElements = base && key === "parentNode", 7010 doneName = done++; 7011 7012 return combinator.first ? 7013 7014 // Check against closest ancestor/preceding element 7015 function( elem, context, xml ) { 7016 while ( ( elem = elem[ dir ] ) ) { 7017 if ( elem.nodeType === 1 || checkNonElements ) { 7018 return matcher( elem, context, xml ); 7019 } 7020 } 7021 return false; 7022 } : 7023 7024 // Check against all ancestor/preceding elements 7025 function( elem, context, xml ) { 7026 var oldCache, outerCache, 7027 newCache = [ dirruns, doneName ]; 7028 7029 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 7030 if ( xml ) { 7031 while ( ( elem = elem[ dir ] ) ) { 7032 if ( elem.nodeType === 1 || checkNonElements ) { 7033 if ( matcher( elem, context, xml ) ) { 7034 return true; 7035 } 7036 } 7037 } 7038 } else { 7039 while ( ( elem = elem[ dir ] ) ) { 7040 if ( elem.nodeType === 1 || checkNonElements ) { 7041 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 7042 7043 if ( skip && nodeName( elem, skip ) ) { 7044 elem = elem[ dir ] || elem; 7045 } else if ( ( oldCache = outerCache[ key ] ) && 7046 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 7047 7048 // Assign to newCache so results back-propagate to previous elements 7049 return ( newCache[ 2 ] = oldCache[ 2 ] ); 7050 } else { 7051 7052 // Reuse newcache so results back-propagate to previous elements 7053 outerCache[ key ] = newCache; 7054 7055 // A match means we're done; a fail means we have to keep checking 7056 if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { 7057 return true; 7058 } 7059 } 7060 } 7061 } 7062 } 7063 return false; 7064 }; 7065} 7066 7067function elementMatcher( matchers ) { 7068 return matchers.length > 1 ? 7069 function( elem, context, xml ) { 7070 var i = matchers.length; 7071 while ( i-- ) { 7072 if ( !matchers[ i ]( elem, context, xml ) ) { 7073 return false; 7074 } 7075 } 7076 return true; 7077 } : 7078 matchers[ 0 ]; 7079} 7080 7081function multipleContexts( selector, contexts, results ) { 7082 var i = 0, 7083 len = contexts.length; 7084 for ( ; i < len; i++ ) { 7085 find( selector, contexts[ i ], results ); 7086 } 7087 return results; 7088} 7089 7090function condense( unmatched, map, filter, context, xml ) { 7091 var elem, 7092 newUnmatched = [], 7093 i = 0, 7094 len = unmatched.length, 7095 mapped = map != null; 7096 7097 for ( ; i < len; i++ ) { 7098 if ( ( elem = unmatched[ i ] ) ) { 7099 if ( !filter || filter( elem, context, xml ) ) { 7100 newUnmatched.push( elem ); 7101 if ( mapped ) { 7102 map.push( i ); 7103 } 7104 } 7105 } 7106 } 7107 7108 return newUnmatched; 7109} 7110 7111function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 7112 if ( postFilter && !postFilter[ expando ] ) { 7113 postFilter = setMatcher( postFilter ); 7114 } 7115 if ( postFinder && !postFinder[ expando ] ) { 7116 postFinder = setMatcher( postFinder, postSelector ); 7117 } 7118 return markFunction( function( seed, results, context, xml ) { 7119 var temp, i, elem, matcherOut, 7120 preMap = [], 7121 postMap = [], 7122 preexisting = results.length, 7123 7124 // Get initial elements from seed or context 7125 elems = seed || 7126 multipleContexts( selector || "*", 7127 context.nodeType ? [ context ] : context, [] ), 7128 7129 // Prefilter to get matcher input, preserving a map for seed-results synchronization 7130 matcherIn = preFilter && ( seed || !selector ) ? 7131 condense( elems, preMap, preFilter, context, xml ) : 7132 elems; 7133 7134 if ( matcher ) { 7135 7136 // If we have a postFinder, or filtered seed, or non-seed postFilter 7137 // or preexisting results, 7138 matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 7139 7140 // ...intermediate processing is necessary 7141 [] : 7142 7143 // ...otherwise use results directly 7144 results; 7145 7146 // Find primary matches 7147 matcher( matcherIn, matcherOut, context, xml ); 7148 } else { 7149 matcherOut = matcherIn; 7150 } 7151 7152 // Apply postFilter 7153 if ( postFilter ) { 7154 temp = condense( matcherOut, postMap ); 7155 postFilter( temp, [], context, xml ); 7156 7157 // Un-match failing elements by moving them back to matcherIn 7158 i = temp.length; 7159 while ( i-- ) { 7160 if ( ( elem = temp[ i ] ) ) { 7161 matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); 7162 } 7163 } 7164 } 7165 7166 if ( seed ) { 7167 if ( postFinder || preFilter ) { 7168 if ( postFinder ) { 7169 7170 // Get the final matcherOut by condensing this intermediate into postFinder contexts 7171 temp = []; 7172 i = matcherOut.length; 7173 while ( i-- ) { 7174 if ( ( elem = matcherOut[ i ] ) ) { 7175 7176 // Restore matcherIn since elem is not yet a final match 7177 temp.push( ( matcherIn[ i ] = elem ) ); 7178 } 7179 } 7180 postFinder( null, ( matcherOut = [] ), temp, xml ); 7181 } 7182 7183 // Move matched elements from seed to results to keep them synchronized 7184 i = matcherOut.length; 7185 while ( i-- ) { 7186 if ( ( elem = matcherOut[ i ] ) && 7187 ( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) { 7188 7189 seed[ temp ] = !( results[ temp ] = elem ); 7190 } 7191 } 7192 } 7193 7194 // Add elements to results, through postFinder if defined 7195 } else { 7196 matcherOut = condense( 7197 matcherOut === results ? 7198 matcherOut.splice( preexisting, matcherOut.length ) : 7199 matcherOut 7200 ); 7201 if ( postFinder ) { 7202 postFinder( null, results, matcherOut, xml ); 7203 } else { 7204 push.apply( results, matcherOut ); 7205 } 7206 } 7207 } ); 7208} 7209 7210function matcherFromTokens( tokens ) { 7211 var checkContext, matcher, j, 7212 len = tokens.length, 7213 leadingRelative = Expr.relative[ tokens[ 0 ].type ], 7214 implicitRelative = leadingRelative || Expr.relative[ " " ], 7215 i = leadingRelative ? 1 : 0, 7216 7217 // The foundational matcher ensures that elements are reachable from top-level context(s) 7218 matchContext = addCombinator( function( elem ) { 7219 return elem === checkContext; 7220 }, implicitRelative, true ), 7221 matchAnyContext = addCombinator( function( elem ) { 7222 return indexOf.call( checkContext, elem ) > -1; 7223 }, implicitRelative, true ), 7224 matchers = [ function( elem, context, xml ) { 7225 7226 // Support: IE 11+, Edge 17 - 18+ 7227 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 7228 // two documents; shallow comparisons work. 7229 // eslint-disable-next-line eqeqeq 7230 var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || ( 7231 ( checkContext = context ).nodeType ? 7232 matchContext( elem, context, xml ) : 7233 matchAnyContext( elem, context, xml ) ); 7234 7235 // Avoid hanging onto element 7236 // (see https://github.com/jquery/sizzle/issues/299) 7237 checkContext = null; 7238 return ret; 7239 } ]; 7240 7241 for ( ; i < len; i++ ) { 7242 if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { 7243 matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; 7244 } else { 7245 matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); 7246 7247 // Return special upon seeing a positional matcher 7248 if ( matcher[ expando ] ) { 7249 7250 // Find the next relative operator (if any) for proper handling 7251 j = ++i; 7252 for ( ; j < len; j++ ) { 7253 if ( Expr.relative[ tokens[ j ].type ] ) { 7254 break; 7255 } 7256 } 7257 return setMatcher( 7258 i > 1 && elementMatcher( matchers ), 7259 i > 1 && toSelector( 7260 7261 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 7262 tokens.slice( 0, i - 1 ) 7263 .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) 7264 ).replace( rtrimCSS, "$1" ), 7265 matcher, 7266 i < j && matcherFromTokens( tokens.slice( i, j ) ), 7267 j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), 7268 j < len && toSelector( tokens ) 7269 ); 7270 } 7271 matchers.push( matcher ); 7272 } 7273 } 7274 7275 return elementMatcher( matchers ); 7276} 7277 7278function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 7279 var bySet = setMatchers.length > 0, 7280 byElement = elementMatchers.length > 0, 7281 superMatcher = function( seed, context, xml, results, outermost ) { 7282 var elem, j, matcher, 7283 matchedCount = 0, 7284 i = "0", 7285 unmatched = seed && [], 7286 setMatched = [], 7287 contextBackup = outermostContext, 7288 7289 // We must always have either seed elements or outermost context 7290 elems = seed || byElement && Expr.find.TAG( "*", outermost ), 7291 7292 // Use integer dirruns iff this is the outermost matcher 7293 dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), 7294 len = elems.length; 7295 7296 if ( outermost ) { 7297 7298 // Support: IE 11+, Edge 17 - 18+ 7299 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 7300 // two documents; shallow comparisons work. 7301 // eslint-disable-next-line eqeqeq 7302 outermostContext = context == document || context || outermost; 7303 } 7304 7305 // Add elements passing elementMatchers directly to results 7306 // Support: iOS <=7 - 9 only 7307 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching 7308 // elements by id. (see trac-14142) 7309 for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { 7310 if ( byElement && elem ) { 7311 j = 0; 7312 7313 // Support: IE 11+, Edge 17 - 18+ 7314 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 7315 // two documents; shallow comparisons work. 7316 // eslint-disable-next-line eqeqeq 7317 if ( !context && elem.ownerDocument != document ) { 7318 setDocument( elem ); 7319 xml = !documentIsHTML; 7320 } 7321 while ( ( matcher = elementMatchers[ j++ ] ) ) { 7322 if ( matcher( elem, context || document, xml ) ) { 7323 push.call( results, elem ); 7324 break; 7325 } 7326 } 7327 if ( outermost ) { 7328 dirruns = dirrunsUnique; 7329 } 7330 } 7331 7332 // Track unmatched elements for set filters 7333 if ( bySet ) { 7334 7335 // They will have gone through all possible matchers 7336 if ( ( elem = !matcher && elem ) ) { 7337 matchedCount--; 7338 } 7339 7340 // Lengthen the array for every element, matched or not 7341 if ( seed ) { 7342 unmatched.push( elem ); 7343 } 7344 } 7345 } 7346 7347 // `i` is now the count of elements visited above, and adding it to `matchedCount` 7348 // makes the latter nonnegative. 7349 matchedCount += i; 7350 7351 // Apply set filters to unmatched elements 7352 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 7353 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 7354 // no element matchers and no seed. 7355 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 7356 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 7357 // numerically zero. 7358 if ( bySet && i !== matchedCount ) { 7359 j = 0; 7360 while ( ( matcher = setMatchers[ j++ ] ) ) { 7361 matcher( unmatched, setMatched, context, xml ); 7362 } 7363 7364 if ( seed ) { 7365 7366 // Reintegrate element matches to eliminate the need for sorting 7367 if ( matchedCount > 0 ) { 7368 while ( i-- ) { 7369 if ( !( unmatched[ i ] || setMatched[ i ] ) ) { 7370 setMatched[ i ] = pop.call( results ); 7371 } 7372 } 7373 } 7374 7375 // Discard index placeholder values to get only actual matches 7376 setMatched = condense( setMatched ); 7377 } 7378 7379 // Add matches to results 7380 push.apply( results, setMatched ); 7381 7382 // Seedless set matches succeeding multiple successful matchers stipulate sorting 7383 if ( outermost && !seed && setMatched.length > 0 && 7384 ( matchedCount + setMatchers.length ) > 1 ) { 7385 7386 jQuery.uniqueSort( results ); 7387 } 7388 } 7389 7390 // Override manipulation of globals by nested matchers 7391 if ( outermost ) { 7392 dirruns = dirrunsUnique; 7393 outermostContext = contextBackup; 7394 } 7395 7396 return unmatched; 7397 }; 7398 7399 return bySet ? 7400 markFunction( superMatcher ) : 7401 superMatcher; 7402} 7403 7404function compile( selector, match /* Internal Use Only */ ) { 7405 var i, 7406 setMatchers = [], 7407 elementMatchers = [], 7408 cached = compilerCache[ selector + " " ]; 7409 7410 if ( !cached ) { 7411 7412 // Generate a function of recursive functions that can be used to check each element 7413 if ( !match ) { 7414 match = tokenize( selector ); 7415 } 7416 i = match.length; 7417 while ( i-- ) { 7418 cached = matcherFromTokens( match[ i ] ); 7419 if ( cached[ expando ] ) { 7420 setMatchers.push( cached ); 7421 } else { 7422 elementMatchers.push( cached ); 7423 } 7424 } 7425 7426 // Cache the compiled function 7427 cached = compilerCache( selector, 7428 matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 7429 7430 // Save selector and tokenization 7431 cached.selector = selector; 7432 } 7433 return cached; 7434} 7435 7436/** 7437 * A low-level selection function that works with jQuery's compiled 7438 * selector functions 7439 * @param {String|Function} selector A selector or a pre-compiled 7440 * selector function built with jQuery selector compile 7441 * @param {Element} context 7442 * @param {Array} [results] 7443 * @param {Array} [seed] A set of elements to match against 7444 */ 7445function select( selector, context, results, seed ) { 7446 var i, tokens, token, type, find, 7447 compiled = typeof selector === "function" && selector, 7448 match = !seed && tokenize( ( selector = compiled.selector || selector ) ); 7449 7450 results = results || []; 7451 7452 // Try to minimize operations if there is only one selector in the list and no seed 7453 // (the latter of which guarantees us context) 7454 if ( match.length === 1 ) { 7455 7456 // Reduce context if the leading compound selector is an ID 7457 tokens = match[ 0 ] = match[ 0 ].slice( 0 ); 7458 if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && 7459 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { 7460 7461 context = ( Expr.find.ID( 7462 token.matches[ 0 ].replace( runescape, funescape ), 7463 context 7464 ) || [] )[ 0 ]; 7465 if ( !context ) { 7466 return results; 7467 7468 // Precompiled matchers will still verify ancestry, so step up a level 7469 } else if ( compiled ) { 7470 context = context.parentNode; 7471 } 7472 7473 selector = selector.slice( tokens.shift().value.length ); 7474 } 7475 7476 // Fetch a seed set for right-to-left matching 7477 i = matchExpr.needsContext.test( selector ) ? 0 : tokens.length; 7478 while ( i-- ) { 7479 token = tokens[ i ]; 7480 7481 // Abort if we hit a combinator 7482 if ( Expr.relative[ ( type = token.type ) ] ) { 7483 break; 7484 } 7485 if ( ( find = Expr.find[ type ] ) ) { 7486 7487 // Search, expanding context for leading sibling combinators 7488 if ( ( seed = find( 7489 token.matches[ 0 ].replace( runescape, funescape ), 7490 rsibling.test( tokens[ 0 ].type ) && 7491 testContext( context.parentNode ) || context 7492 ) ) ) { 7493 7494 // If seed is empty or no tokens remain, we can return early 7495 tokens.splice( i, 1 ); 7496 selector = seed.length && toSelector( tokens ); 7497 if ( !selector ) { 7498 push.apply( results, seed ); 7499 return results; 7500 } 7501 7502 break; 7503 } 7504 } 7505 } 7506 } 7507 7508 // Compile and execute a filtering function if one is not provided 7509 // Provide `match` to avoid retokenization if we modified the selector above 7510 ( compiled || compile( selector, match ) )( 7511 seed, 7512 context, 7513 !documentIsHTML, 7514 results, 7515 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 7516 ); 7517 return results; 7518} 7519 7520// One-time assignments 7521 7522// Support: Android <=4.0 - 4.1+ 7523// Sort stability 7524support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; 7525 7526// Initialize against the default document 7527setDocument(); 7528 7529// Support: Android <=4.0 - 4.1+ 7530// Detached nodes confoundingly follow *each other* 7531support.sortDetached = assert( function( el ) { 7532 7533 // Should return 1, but returns 4 (following) 7534 return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; 7535} ); 7536 7537jQuery.find = find; 7538 7539// Deprecated 7540jQuery.expr[ ":" ] = jQuery.expr.pseudos; 7541jQuery.unique = jQuery.uniqueSort; 7542 7543// These have always been private, but they used to be documented 7544// as part of Sizzle so let's maintain them in the 3.x line 7545// for backwards compatibility purposes. 7546find.compile = compile; 7547find.select = select; 7548find.setDocument = setDocument; 7549 7550find.escape = jQuery.escapeSelector; 7551find.getText = jQuery.text; 7552find.isXML = jQuery.isXMLDoc; 7553find.selectors = jQuery.expr; 7554find.support = jQuery.support; 7555find.uniqueSort = jQuery.uniqueSort; 7556 7557 /* eslint-enable */ 7558 7559} )(); 7560 7561 7562var dir = function( elem, dir, until ) { 7563 var matched = [], 7564 truncate = until !== undefined; 7565 7566 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 7567 if ( elem.nodeType === 1 ) { 7568 if ( truncate && jQuery( elem ).is( until ) ) { 7569 break; 7570 } 7571 matched.push( elem ); 7572 } 7573 } 7574 return matched; 7575}; 7576 7577 7578var siblings = function( n, elem ) { 7579 var matched = []; 7580 7581 for ( ; n; n = n.nextSibling ) { 7582 if ( n.nodeType === 1 && n !== elem ) { 7583 matched.push( n ); 7584 } 7585 } 7586 7587 return matched; 7588}; 7589 7590 7591var rneedsContext = jQuery.expr.match.needsContext; 7592 7593var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 7594 7595 7596 7597// Implement the identical functionality for filter and not 7598function winnow( elements, qualifier, not ) { 7599 if ( isFunction( qualifier ) ) { 7600 return jQuery.grep( elements, function( elem, i ) { 7601 return !!qualifier.call( elem, i, elem ) !== not; 7602 } ); 7603 } 7604 7605 // Single element 7606 if ( qualifier.nodeType ) { 7607 return jQuery.grep( elements, function( elem ) { 7608 return ( elem === qualifier ) !== not; 7609 } ); 7610 } 7611 7612 // Arraylike of elements (jQuery, arguments, Array) 7613 if ( typeof qualifier !== "string" ) { 7614 return jQuery.grep( elements, function( elem ) { 7615 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 7616 } ); 7617 } 7618 7619 // Filtered directly for both simple and complex selectors 7620 return jQuery.filter( qualifier, elements, not ); 7621} 7622 7623jQuery.filter = function( expr, elems, not ) { 7624 var elem = elems[ 0 ]; 7625 7626 if ( not ) { 7627 expr = ":not(" + expr + ")"; 7628 } 7629 7630 if ( elems.length === 1 && elem.nodeType === 1 ) { 7631 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 7632 } 7633 7634 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 7635 return elem.nodeType === 1; 7636 } ) ); 7637}; 7638 7639jQuery.fn.extend( { 7640 find: function( selector ) { 7641 var i, ret, 7642 len = this.length, 7643 self = this; 7644 7645 if ( typeof selector !== "string" ) { 7646 return this.pushStack( jQuery( selector ).filter( function() { 7647 for ( i = 0; i < len; i++ ) { 7648 if ( jQuery.contains( self[ i ], this ) ) { 7649 return true; 7650 } 7651 } 7652 } ) ); 7653 } 7654 7655 ret = this.pushStack( [] ); 7656 7657 for ( i = 0; i < len; i++ ) { 7658 jQuery.find( selector, self[ i ], ret ); 7659 } 7660 7661 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 7662 }, 7663 filter: function( selector ) { 7664 return this.pushStack( winnow( this, selector || [], false ) ); 7665 }, 7666 not: function( selector ) { 7667 return this.pushStack( winnow( this, selector || [], true ) ); 7668 }, 7669 is: function( selector ) { 7670 return !!winnow( 7671 this, 7672 7673 // If this is a positional/relative selector, check membership in the returned set 7674 // so $("p:first").is("p:last") won't return true for a doc with two "p". 7675 typeof selector === "string" && rneedsContext.test( selector ) ? 7676 jQuery( selector ) : 7677 selector || [], 7678 false 7679 ).length; 7680 } 7681} ); 7682 7683 7684// Initialize a jQuery object 7685 7686 7687// A central reference to the root jQuery(document) 7688var rootjQuery, 7689 7690 // A simple way to check for HTML strings 7691 // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521) 7692 // Strict HTML recognition (trac-11290: must start with <) 7693 // Shortcut simple #id case for speed 7694 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 7695 7696 init = jQuery.fn.init = function( selector, context, root ) { 7697 var match, elem; 7698 7699 // HANDLE: $(""), $(null), $(undefined), $(false) 7700 if ( !selector ) { 7701 return this; 7702 } 7703 7704 // Method init() accepts an alternate rootjQuery 7705 // so migrate can support jQuery.sub (gh-2101) 7706 root = root || rootjQuery; 7707 7708 // Handle HTML strings 7709 if ( typeof selector === "string" ) { 7710 if ( selector[ 0 ] === "<" && 7711 selector[ selector.length - 1 ] === ">" && 7712 selector.length >= 3 ) { 7713 7714 // Assume that strings that start and end with <> are HTML and skip the regex check 7715 match = [ null, selector, null ]; 7716 7717 } else { 7718 match = rquickExpr.exec( selector ); 7719 } 7720 7721 // Match html or make sure no context is specified for #id 7722 if ( match && ( match[ 1 ] || !context ) ) { 7723 7724 // HANDLE: $(html) -> $(array) 7725 if ( match[ 1 ] ) { 7726 context = context instanceof jQuery ? context[ 0 ] : context; 7727 7728 // Option to run scripts is true for back-compat 7729 // Intentionally let the error be thrown if parseHTML is not present 7730 jQuery.merge( this, jQuery.parseHTML( 7731 match[ 1 ], 7732 context && context.nodeType ? context.ownerDocument || context : document, 7733 true 7734 ) ); 7735 7736 // HANDLE: $(html, props) 7737 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 7738 for ( match in context ) { 7739 7740 // Properties of context are called as methods if possible 7741 if ( isFunction( this[ match ] ) ) { 7742 this[ match ]( context[ match ] ); 7743 7744 // ...and otherwise set as attributes 7745 } else { 7746 this.attr( match, context[ match ] ); 7747 } 7748 } 7749 } 7750 7751 return this; 7752 7753 // HANDLE: $(#id) 7754 } else { 7755 elem = document.getElementById( match[ 2 ] ); 7756 7757 if ( elem ) { 7758 7759 // Inject the element directly into the jQuery object 7760 this[ 0 ] = elem; 7761 this.length = 1; 7762 } 7763 return this; 7764 } 7765 7766 // HANDLE: $(expr, $(...)) 7767 } else if ( !context || context.jquery ) { 7768 return ( context || root ).find( selector ); 7769 7770 // HANDLE: $(expr, context) 7771 // (which is just equivalent to: $(context).find(expr) 7772 } else { 7773 return this.constructor( context ).find( selector ); 7774 } 7775 7776 // HANDLE: $(DOMElement) 7777 } else if ( selector.nodeType ) { 7778 this[ 0 ] = selector; 7779 this.length = 1; 7780 return this; 7781 7782 // HANDLE: $(function) 7783 // Shortcut for document ready 7784 } else if ( isFunction( selector ) ) { 7785 return root.ready !== undefined ? 7786 root.ready( selector ) : 7787 7788 // Execute immediately if ready is not present 7789 selector( jQuery ); 7790 } 7791 7792 return jQuery.makeArray( selector, this ); 7793 }; 7794 7795// Give the init function the jQuery prototype for later instantiation 7796init.prototype = jQuery.fn; 7797 7798// Initialize central reference 7799rootjQuery = jQuery( document ); 7800 7801 7802var rparentsprev = /^(?:parents|prev(?:Until|All))/, 7803 7804 // Methods guaranteed to produce a unique set when starting from a unique set 7805 guaranteedUnique = { 7806 children: true, 7807 contents: true, 7808 next: true, 7809 prev: true 7810 }; 7811 7812jQuery.fn.extend( { 7813 has: function( target ) { 7814 var targets = jQuery( target, this ), 7815 l = targets.length; 7816 7817 return this.filter( function() { 7818 var i = 0; 7819 for ( ; i < l; i++ ) { 7820 if ( jQuery.contains( this, targets[ i ] ) ) { 7821 return true; 7822 } 7823 } 7824 } ); 7825 }, 7826 7827 closest: function( selectors, context ) { 7828 var cur, 7829 i = 0, 7830 l = this.length, 7831 matched = [], 7832 targets = typeof selectors !== "string" && jQuery( selectors ); 7833 7834 // Positional selectors never match, since there's no _selection_ context 7835 if ( !rneedsContext.test( selectors ) ) { 7836 for ( ; i < l; i++ ) { 7837 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 7838 7839 // Always skip document fragments 7840 if ( cur.nodeType < 11 && ( targets ? 7841 targets.index( cur ) > -1 : 7842 7843 // Don't pass non-elements to jQuery#find 7844 cur.nodeType === 1 && 7845 jQuery.find.matchesSelector( cur, selectors ) ) ) { 7846 7847 matched.push( cur ); 7848 break; 7849 } 7850 } 7851 } 7852 } 7853 7854 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 7855 }, 7856 7857 // Determine the position of an element within the set 7858 index: function( elem ) { 7859 7860 // No argument, return index in parent 7861 if ( !elem ) { 7862 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 7863 } 7864 7865 // Index in selector 7866 if ( typeof elem === "string" ) { 7867 return indexOf.call( jQuery( elem ), this[ 0 ] ); 7868 } 7869 7870 // Locate the position of the desired element 7871 return indexOf.call( this, 7872 7873 // If it receives a jQuery object, the first element is used 7874 elem.jquery ? elem[ 0 ] : elem 7875 ); 7876 }, 7877 7878 add: function( selector, context ) { 7879 return this.pushStack( 7880 jQuery.uniqueSort( 7881 jQuery.merge( this.get(), jQuery( selector, context ) ) 7882 ) 7883 ); 7884 }, 7885 7886 addBack: function( selector ) { 7887 return this.add( selector == null ? 7888 this.prevObject : this.prevObject.filter( selector ) 7889 ); 7890 } 7891} ); 7892 7893function sibling( cur, dir ) { 7894 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 7895 return cur; 7896} 7897 7898jQuery.each( { 7899 parent: function( elem ) { 7900 var parent = elem.parentNode; 7901 return parent && parent.nodeType !== 11 ? parent : null; 7902 }, 7903 parents: function( elem ) { 7904 return dir( elem, "parentNode" ); 7905 }, 7906 parentsUntil: function( elem, _i, until ) { 7907 return dir( elem, "parentNode", until ); 7908 }, 7909 next: function( elem ) { 7910 return sibling( elem, "nextSibling" ); 7911 }, 7912 prev: function( elem ) { 7913 return sibling( elem, "previousSibling" ); 7914 }, 7915 nextAll: function( elem ) { 7916 return dir( elem, "nextSibling" ); 7917 }, 7918 prevAll: function( elem ) { 7919 return dir( elem, "previousSibling" ); 7920 }, 7921 nextUntil: function( elem, _i, until ) { 7922 return dir( elem, "nextSibling", until ); 7923 }, 7924 prevUntil: function( elem, _i, until ) { 7925 return dir( elem, "previousSibling", until ); 7926 }, 7927 siblings: function( elem ) { 7928 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 7929 }, 7930 children: function( elem ) { 7931 return siblings( elem.firstChild ); 7932 }, 7933 contents: function( elem ) { 7934 if ( elem.contentDocument != null && 7935 7936 // Support: IE 11+ 7937 // <object> elements with no `data` attribute has an object 7938 // `contentDocument` with a `null` prototype. 7939 getProto( elem.contentDocument ) ) { 7940 7941 return elem.contentDocument; 7942 } 7943 7944 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 7945 // Treat the template element as a regular one in browsers that 7946 // don't support it. 7947 if ( nodeName( elem, "template" ) ) { 7948 elem = elem.content || elem; 7949 } 7950 7951 return jQuery.merge( [], elem.childNodes ); 7952 } 7953}, function( name, fn ) { 7954 jQuery.fn[ name ] = function( until, selector ) { 7955 var matched = jQuery.map( this, fn, until ); 7956 7957 if ( name.slice( -5 ) !== "Until" ) { 7958 selector = until; 7959 } 7960 7961 if ( selector && typeof selector === "string" ) { 7962 matched = jQuery.filter( selector, matched ); 7963 } 7964 7965 if ( this.length > 1 ) { 7966 7967 // Remove duplicates 7968 if ( !guaranteedUnique[ name ] ) { 7969 jQuery.uniqueSort( matched ); 7970 } 7971 7972 // Reverse order for parents* and prev-derivatives 7973 if ( rparentsprev.test( name ) ) { 7974 matched.reverse(); 7975 } 7976 } 7977 7978 return this.pushStack( matched ); 7979 }; 7980} ); 7981var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 7982 7983 7984 7985// Convert String-formatted options into Object-formatted ones 7986function createOptions( options ) { 7987 var object = {}; 7988 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 7989 object[ flag ] = true; 7990 } ); 7991 return object; 7992} 7993 7994/* 7995 * Create a callback list using the following parameters: 7996 * 7997 * options: an optional list of space-separated options that will change how 7998 * the callback list behaves or a more traditional option object 7999 * 8000 * By default a callback list will act like an event callback list and can be 8001 * "fired" multiple times. 8002 * 8003 * Possible options: 8004 * 8005 * once: will ensure the callback list can only be fired once (like a Deferred) 8006 * 8007 * memory: will keep track of previous values and will call any callback added 8008 * after the list has been fired right away with the latest "memorized" 8009 * values (like a Deferred) 8010 * 8011 * unique: will ensure a callback can only be added once (no duplicate in the list) 8012 * 8013 * stopOnFalse: interrupt callings when a callback returns false 8014 * 8015 */ 8016jQuery.Callbacks = function( options ) { 8017 8018 // Convert options from String-formatted to Object-formatted if needed 8019 // (we check in cache first) 8020 options = typeof options === "string" ? 8021 createOptions( options ) : 8022 jQuery.extend( {}, options ); 8023 8024 var // Flag to know if list is currently firing 8025 firing, 8026 8027 // Last fire value for non-forgettable lists 8028 memory, 8029 8030 // Flag to know if list was already fired 8031 fired, 8032 8033 // Flag to prevent firing 8034 locked, 8035 8036 // Actual callback list 8037 list = [], 8038 8039 // Queue of execution data for repeatable lists 8040 queue = [], 8041 8042 // Index of currently firing callback (modified by add/remove as needed) 8043 firingIndex = -1, 8044 8045 // Fire callbacks 8046 fire = function() { 8047 8048 // Enforce single-firing 8049 locked = locked || options.once; 8050 8051 // Execute callbacks for all pending executions, 8052 // respecting firingIndex overrides and runtime changes 8053 fired = firing = true; 8054 for ( ; queue.length; firingIndex = -1 ) { 8055 memory = queue.shift(); 8056 while ( ++firingIndex < list.length ) { 8057 8058 // Run callback and check for early termination 8059 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 8060 options.stopOnFalse ) { 8061 8062 // Jump to end and forget the data so .add doesn't re-fire 8063 firingIndex = list.length; 8064 memory = false; 8065 } 8066 } 8067 } 8068 8069 // Forget the data if we're done with it 8070 if ( !options.memory ) { 8071 memory = false; 8072 } 8073 8074 firing = false; 8075 8076 // Clean up if we're done firing for good 8077 if ( locked ) { 8078 8079 // Keep an empty list if we have data for future add calls 8080 if ( memory ) { 8081 list = []; 8082 8083 // Otherwise, this object is spent 8084 } else { 8085 list = ""; 8086 } 8087 } 8088 }, 8089 8090 // Actual Callbacks object 8091 self = { 8092 8093 // Add a callback or a collection of callbacks to the list 8094 add: function() { 8095 if ( list ) { 8096 8097 // If we have memory from a past run, we should fire after adding 8098 if ( memory && !firing ) { 8099 firingIndex = list.length - 1; 8100 queue.push( memory ); 8101 } 8102 8103 ( function add( args ) { 8104 jQuery.each( args, function( _, arg ) { 8105 if ( isFunction( arg ) ) { 8106 if ( !options.unique || !self.has( arg ) ) { 8107 list.push( arg ); 8108 } 8109 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 8110 8111 // Inspect recursively 8112 add( arg ); 8113 } 8114 } ); 8115 } )( arguments ); 8116 8117 if ( memory && !firing ) { 8118 fire(); 8119 } 8120 } 8121 return this; 8122 }, 8123 8124 // Remove a callback from the list 8125 remove: function() { 8126 jQuery.each( arguments, function( _, arg ) { 8127 var index; 8128 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 8129 list.splice( index, 1 ); 8130 8131 // Handle firing indexes 8132 if ( index <= firingIndex ) { 8133 firingIndex--; 8134 } 8135 } 8136 } ); 8137 return this; 8138 }, 8139 8140 // Check if a given callback is in the list. 8141 // If no argument is given, return whether or not list has callbacks attached. 8142 has: function( fn ) { 8143 return fn ? 8144 jQuery.inArray( fn, list ) > -1 : 8145 list.length > 0; 8146 }, 8147 8148 // Remove all callbacks from the list 8149 empty: function() { 8150 if ( list ) { 8151 list = []; 8152 } 8153 return this; 8154 }, 8155 8156 // Disable .fire and .add 8157 // Abort any current/pending executions 8158 // Clear all callbacks and values 8159 disable: function() { 8160 locked = queue = []; 8161 list = memory = ""; 8162 return this; 8163 }, 8164 disabled: function() { 8165 return !list; 8166 }, 8167 8168 // Disable .fire 8169 // Also disable .add unless we have memory (since it would have no effect) 8170 // Abort any pending executions 8171 lock: function() { 8172 locked = queue = []; 8173 if ( !memory && !firing ) { 8174 list = memory = ""; 8175 } 8176 return this; 8177 }, 8178 locked: function() { 8179 return !!locked; 8180 }, 8181 8182 // Call all callbacks with the given context and arguments 8183 fireWith: function( context, args ) { 8184 if ( !locked ) { 8185 args = args || []; 8186 args = [ context, args.slice ? args.slice() : args ]; 8187 queue.push( args ); 8188 if ( !firing ) { 8189 fire(); 8190 } 8191 } 8192 return this; 8193 }, 8194 8195 // Call all the callbacks with the given arguments 8196 fire: function() { 8197 self.fireWith( this, arguments ); 8198 return this; 8199 }, 8200 8201 // To know if the callbacks have already been called at least once 8202 fired: function() { 8203 return !!fired; 8204 } 8205 }; 8206 8207 return self; 8208}; 8209 8210 8211function Identity( v ) { 8212 return v; 8213} 8214function Thrower( ex ) { 8215 throw ex; 8216} 8217 8218function adoptValue( value, resolve, reject, noValue ) { 8219 var method; 8220 8221 try { 8222 8223 // Check for promise aspect first to privilege synchronous behavior 8224 if ( value && isFunction( ( method = value.promise ) ) ) { 8225 method.call( value ).done( resolve ).fail( reject ); 8226 8227 // Other thenables 8228 } else if ( value && isFunction( ( method = value.then ) ) ) { 8229 method.call( value, resolve, reject ); 8230 8231 // Other non-thenables 8232 } else { 8233 8234 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 8235 // * false: [ value ].slice( 0 ) => resolve( value ) 8236 // * true: [ value ].slice( 1 ) => resolve() 8237 resolve.apply( undefined, [ value ].slice( noValue ) ); 8238 } 8239 8240 // For Promises/A+, convert exceptions into rejections 8241 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 8242 // Deferred#then to conditionally suppress rejection. 8243 } catch ( value ) { 8244 8245 // Support: Android 4.0 only 8246 // Strict mode functions invoked without .call/.apply get global-object context 8247 reject.apply( undefined, [ value ] ); 8248 } 8249} 8250 8251jQuery.extend( { 8252 8253 Deferred: function( func ) { 8254 var tuples = [ 8255 8256 // action, add listener, callbacks, 8257 // ... .then handlers, argument index, [final state] 8258 [ "notify", "progress", jQuery.Callbacks( "memory" ), 8259 jQuery.Callbacks( "memory" ), 2 ], 8260 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 8261 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 8262 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 8263 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 8264 ], 8265 state = "pending", 8266 promise = { 8267 state: function() { 8268 return state; 8269 }, 8270 always: function() { 8271 deferred.done( arguments ).fail( arguments ); 8272 return this; 8273 }, 8274 "catch": function( fn ) { 8275 return promise.then( null, fn ); 8276 }, 8277 8278 // Keep pipe for back-compat 8279 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 8280 var fns = arguments; 8281 8282 return jQuery.Deferred( function( newDefer ) { 8283 jQuery.each( tuples, function( _i, tuple ) { 8284 8285 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 8286 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 8287 8288 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 8289 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 8290 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 8291 deferred[ tuple[ 1 ] ]( function() { 8292 var returned = fn && fn.apply( this, arguments ); 8293 if ( returned && isFunction( returned.promise ) ) { 8294 returned.promise() 8295 .progress( newDefer.notify ) 8296 .done( newDefer.resolve ) 8297 .fail( newDefer.reject ); 8298 } else { 8299 newDefer[ tuple[ 0 ] + "With" ]( 8300 this, 8301 fn ? [ returned ] : arguments 8302 ); 8303 } 8304 } ); 8305 } ); 8306 fns = null; 8307 } ).promise(); 8308 }, 8309 then: function( onFulfilled, onRejected, onProgress ) { 8310 var maxDepth = 0; 8311 function resolve( depth, deferred, handler, special ) { 8312 return function() { 8313 var that = this, 8314 args = arguments, 8315 mightThrow = function() { 8316 var returned, then; 8317 8318 // Support: Promises/A+ section 2.3.3.3.3 8319 // https://promisesaplus.com/#point-59 8320 // Ignore double-resolution attempts 8321 if ( depth < maxDepth ) { 8322 return; 8323 } 8324 8325 returned = handler.apply( that, args ); 8326 8327 // Support: Promises/A+ section 2.3.1 8328 // https://promisesaplus.com/#point-48 8329 if ( returned === deferred.promise() ) { 8330 throw new TypeError( "Thenable self-resolution" ); 8331 } 8332 8333 // Support: Promises/A+ sections 2.3.3.1, 3.5 8334 // https://promisesaplus.com/#point-54 8335 // https://promisesaplus.com/#point-75 8336 // Retrieve `then` only once 8337 then = returned && 8338 8339 // Support: Promises/A+ section 2.3.4 8340 // https://promisesaplus.com/#point-64 8341 // Only check objects and functions for thenability 8342 ( typeof returned === "object" || 8343 typeof returned === "function" ) && 8344 returned.then; 8345 8346 // Handle a returned thenable 8347 if ( isFunction( then ) ) { 8348 8349 // Special processors (notify) just wait for resolution 8350 if ( special ) { 8351 then.call( 8352 returned, 8353 resolve( maxDepth, deferred, Identity, special ), 8354 resolve( maxDepth, deferred, Thrower, special ) 8355 ); 8356 8357 // Normal processors (resolve) also hook into progress 8358 } else { 8359 8360 // ...and disregard older resolution values 8361 maxDepth++; 8362 8363 then.call( 8364 returned, 8365 resolve( maxDepth, deferred, Identity, special ), 8366 resolve( maxDepth, deferred, Thrower, special ), 8367 resolve( maxDepth, deferred, Identity, 8368 deferred.notifyWith ) 8369 ); 8370 } 8371 8372 // Handle all other returned values 8373 } else { 8374 8375 // Only substitute handlers pass on context 8376 // and multiple values (non-spec behavior) 8377 if ( handler !== Identity ) { 8378 that = undefined; 8379 args = [ returned ]; 8380 } 8381 8382 // Process the value(s) 8383 // Default process is resolve 8384 ( special || deferred.resolveWith )( that, args ); 8385 } 8386 }, 8387 8388 // Only normal processors (resolve) catch and reject exceptions 8389 process = special ? 8390 mightThrow : 8391 function() { 8392 try { 8393 mightThrow(); 8394 } catch ( e ) { 8395 8396 if ( jQuery.Deferred.exceptionHook ) { 8397 jQuery.Deferred.exceptionHook( e, 8398 process.error ); 8399 } 8400 8401 // Support: Promises/A+ section 2.3.3.3.4.1 8402 // https://promisesaplus.com/#point-61 8403 // Ignore post-resolution exceptions 8404 if ( depth + 1 >= maxDepth ) { 8405 8406 // Only substitute handlers pass on context 8407 // and multiple values (non-spec behavior) 8408 if ( handler !== Thrower ) { 8409 that = undefined; 8410 args = [ e ]; 8411 } 8412 8413 deferred.rejectWith( that, args ); 8414 } 8415 } 8416 }; 8417 8418 // Support: Promises/A+ section 2.3.3.3.1 8419 // https://promisesaplus.com/#point-57 8420 // Re-resolve promises immediately to dodge false rejection from 8421 // subsequent errors 8422 if ( depth ) { 8423 process(); 8424 } else { 8425 8426 // Call an optional hook to record the error, in case of exception 8427 // since it's otherwise lost when execution goes async 8428 if ( jQuery.Deferred.getErrorHook ) { 8429 process.error = jQuery.Deferred.getErrorHook(); 8430 8431 // The deprecated alias of the above. While the name suggests 8432 // returning the stack, not an error instance, jQuery just passes 8433 // it directly to `console.warn` so both will work; an instance 8434 // just better cooperates with source maps. 8435 } else if ( jQuery.Deferred.getStackHook ) { 8436 process.error = jQuery.Deferred.getStackHook(); 8437 } 8438 window.setTimeout( process ); 8439 } 8440 }; 8441 } 8442 8443 return jQuery.Deferred( function( newDefer ) { 8444 8445 // progress_handlers.add( ... ) 8446 tuples[ 0 ][ 3 ].add( 8447 resolve( 8448 0, 8449 newDefer, 8450 isFunction( onProgress ) ? 8451 onProgress : 8452 Identity, 8453 newDefer.notifyWith 8454 ) 8455 ); 8456 8457 // fulfilled_handlers.add( ... ) 8458 tuples[ 1 ][ 3 ].add( 8459 resolve( 8460 0, 8461 newDefer, 8462 isFunction( onFulfilled ) ? 8463 onFulfilled : 8464 Identity 8465 ) 8466 ); 8467 8468 // rejected_handlers.add( ... ) 8469 tuples[ 2 ][ 3 ].add( 8470 resolve( 8471 0, 8472 newDefer, 8473 isFunction( onRejected ) ? 8474 onRejected : 8475 Thrower 8476 ) 8477 ); 8478 } ).promise(); 8479 }, 8480 8481 // Get a promise for this deferred 8482 // If obj is provided, the promise aspect is added to the object 8483 promise: function( obj ) { 8484 return obj != null ? jQuery.extend( obj, promise ) : promise; 8485 } 8486 }, 8487 deferred = {}; 8488 8489 // Add list-specific methods 8490 jQuery.each( tuples, function( i, tuple ) { 8491 var list = tuple[ 2 ], 8492 stateString = tuple[ 5 ]; 8493 8494 // promise.progress = list.add 8495 // promise.done = list.add 8496 // promise.fail = list.add 8497 promise[ tuple[ 1 ] ] = list.add; 8498 8499 // Handle state 8500 if ( stateString ) { 8501 list.add( 8502 function() { 8503 8504 // state = "resolved" (i.e., fulfilled) 8505 // state = "rejected" 8506 state = stateString; 8507 }, 8508 8509 // rejected_callbacks.disable 8510 // fulfilled_callbacks.disable 8511 tuples[ 3 - i ][ 2 ].disable, 8512 8513 // rejected_handlers.disable 8514 // fulfilled_handlers.disable 8515 tuples[ 3 - i ][ 3 ].disable, 8516 8517 // progress_callbacks.lock 8518 tuples[ 0 ][ 2 ].lock, 8519 8520 // progress_handlers.lock 8521 tuples[ 0 ][ 3 ].lock 8522 ); 8523 } 8524 8525 // progress_handlers.fire 8526 // fulfilled_handlers.fire 8527 // rejected_handlers.fire 8528 list.add( tuple[ 3 ].fire ); 8529 8530 // deferred.notify = function() { deferred.notifyWith(...) } 8531 // deferred.resolve = function() { deferred.resolveWith(...) } 8532 // deferred.reject = function() { deferred.rejectWith(...) } 8533 deferred[ tuple[ 0 ] ] = function() { 8534 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 8535 return this; 8536 }; 8537 8538 // deferred.notifyWith = list.fireWith 8539 // deferred.resolveWith = list.fireWith 8540 // deferred.rejectWith = list.fireWith 8541 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 8542 } ); 8543 8544 // Make the deferred a promise 8545 promise.promise( deferred ); 8546 8547 // Call given func if any 8548 if ( func ) { 8549 func.call( deferred, deferred ); 8550 } 8551 8552 // All done! 8553 return deferred; 8554 }, 8555 8556 // Deferred helper 8557 when: function( singleValue ) { 8558 var 8559 8560 // count of uncompleted subordinates 8561 remaining = arguments.length, 8562 8563 // count of unprocessed arguments 8564 i = remaining, 8565 8566 // subordinate fulfillment data 8567 resolveContexts = Array( i ), 8568 resolveValues = slice.call( arguments ), 8569 8570 // the primary Deferred 8571 primary = jQuery.Deferred(), 8572 8573 // subordinate callback factory 8574 updateFunc = function( i ) { 8575 return function( value ) { 8576 resolveContexts[ i ] = this; 8577 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 8578 if ( !( --remaining ) ) { 8579 primary.resolveWith( resolveContexts, resolveValues ); 8580 } 8581 }; 8582 }; 8583 8584 // Single- and empty arguments are adopted like Promise.resolve 8585 if ( remaining <= 1 ) { 8586 adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, 8587 !remaining ); 8588 8589 // Use .then() to unwrap secondary thenables (cf. gh-3000) 8590 if ( primary.state() === "pending" || 8591 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 8592 8593 return primary.then(); 8594 } 8595 } 8596 8597 // Multiple arguments are aggregated like Promise.all array elements 8598 while ( i-- ) { 8599 adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); 8600 } 8601 8602 return primary.promise(); 8603 } 8604} ); 8605 8606 8607// These usually indicate a programmer mistake during development, 8608// warn about them ASAP rather than swallowing them by default. 8609var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 8610 8611// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error 8612// captured before the async barrier to get the original error cause 8613// which may otherwise be hidden. 8614jQuery.Deferred.exceptionHook = function( error, asyncError ) { 8615 8616 // Support: IE 8 - 9 only 8617 // Console exists when dev tools are open, which can happen at any time 8618 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 8619 window.console.warn( "jQuery.Deferred exception: " + error.message, 8620 error.stack, asyncError ); 8621 } 8622}; 8623 8624 8625 8626 8627jQuery.readyException = function( error ) { 8628 window.setTimeout( function() { 8629 throw error; 8630 } ); 8631}; 8632 8633 8634 8635 8636// The deferred used on DOM ready 8637var readyList = jQuery.Deferred(); 8638 8639jQuery.fn.ready = function( fn ) { 8640 8641 readyList 8642 .then( fn ) 8643 8644 // Wrap jQuery.readyException in a function so that the lookup 8645 // happens at the time of error handling instead of callback 8646 // registration. 8647 .catch( function( error ) { 8648 jQuery.readyException( error ); 8649 } ); 8650 8651 return this; 8652}; 8653 8654jQuery.extend( { 8655 8656 // Is the DOM ready to be used? Set to true once it occurs. 8657 isReady: false, 8658 8659 // A counter to track how many items to wait for before 8660 // the ready event fires. See trac-6781 8661 readyWait: 1, 8662 8663 // Handle when the DOM is ready 8664 ready: function( wait ) { 8665 8666 // Abort if there are pending holds or we're already ready 8667 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 8668 return; 8669 } 8670 8671 // Remember that the DOM is ready 8672 jQuery.isReady = true; 8673 8674 // If a normal DOM Ready event fired, decrement, and wait if need be 8675 if ( wait !== true && --jQuery.readyWait > 0 ) { 8676 return; 8677 } 8678 8679 // If there are functions bound, to execute 8680 readyList.resolveWith( document, [ jQuery ] ); 8681 } 8682} ); 8683 8684jQuery.ready.then = readyList.then; 8685 8686// The ready event handler and self cleanup method 8687function completed() { 8688 document.removeEventListener( "DOMContentLoaded", completed ); 8689 window.removeEventListener( "load", completed ); 8690 jQuery.ready(); 8691} 8692 8693// Catch cases where $(document).ready() is called 8694// after the browser event has already occurred. 8695// Support: IE <=9 - 10 only 8696// Older IE sometimes signals "interactive" too soon 8697if ( document.readyState === "complete" || 8698 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 8699 8700 // Handle it asynchronously to allow scripts the opportunity to delay ready 8701 window.setTimeout( jQuery.ready ); 8702 8703} else { 8704 8705 // Use the handy event callback 8706 document.addEventListener( "DOMContentLoaded", completed ); 8707 8708 // A fallback to window.onload, that will always work 8709 window.addEventListener( "load", completed ); 8710} 8711 8712 8713 8714 8715// Multifunctional method to get and set values of a collection 8716// The value/s can optionally be executed if it's a function 8717var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 8718 var i = 0, 8719 len = elems.length, 8720 bulk = key == null; 8721 8722 // Sets many values 8723 if ( toType( key ) === "object" ) { 8724 chainable = true; 8725 for ( i in key ) { 8726 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 8727 } 8728 8729 // Sets one value 8730 } else if ( value !== undefined ) { 8731 chainable = true; 8732 8733 if ( !isFunction( value ) ) { 8734 raw = true; 8735 } 8736 8737 if ( bulk ) { 8738 8739 // Bulk operations run against the entire set 8740 if ( raw ) { 8741 fn.call( elems, value ); 8742 fn = null; 8743 8744 // ...except when executing function values 8745 } else { 8746 bulk = fn; 8747 fn = function( elem, _key, value ) { 8748 return bulk.call( jQuery( elem ), value ); 8749 }; 8750 } 8751 } 8752 8753 if ( fn ) { 8754 for ( ; i < len; i++ ) { 8755 fn( 8756 elems[ i ], key, raw ? 8757 value : 8758 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 8759 ); 8760 } 8761 } 8762 } 8763 8764 if ( chainable ) { 8765 return elems; 8766 } 8767 8768 // Gets 8769 if ( bulk ) { 8770 return fn.call( elems ); 8771 } 8772 8773 return len ? fn( elems[ 0 ], key ) : emptyGet; 8774}; 8775 8776 8777// Matches dashed string for camelizing 8778var rmsPrefix = /^-ms-/, 8779 rdashAlpha = /-([a-z])/g; 8780 8781// Used by camelCase as callback to replace() 8782function fcamelCase( _all, letter ) { 8783 return letter.toUpperCase(); 8784} 8785 8786// Convert dashed to camelCase; used by the css and data modules 8787// Support: IE <=9 - 11, Edge 12 - 15 8788// Microsoft forgot to hump their vendor prefix (trac-9572) 8789function camelCase( string ) { 8790 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 8791} 8792var acceptData = function( owner ) { 8793 8794 // Accepts only: 8795 // - Node 8796 // - Node.ELEMENT_NODE 8797 // - Node.DOCUMENT_NODE 8798 // - Object 8799 // - Any 8800 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 8801}; 8802 8803 8804 8805 8806function Data() { 8807 this.expando = jQuery.expando + Data.uid++; 8808} 8809 8810Data.uid = 1; 8811 8812Data.prototype = { 8813 8814 cache: function( owner ) { 8815 8816 // Check if the owner object already has a cache 8817 var value = owner[ this.expando ]; 8818 8819 // If not, create one 8820 if ( !value ) { 8821 value = {}; 8822 8823 // We can accept data for non-element nodes in modern browsers, 8824 // but we should not, see trac-8335. 8825 // Always return an empty object. 8826 if ( acceptData( owner ) ) { 8827 8828 // If it is a node unlikely to be stringify-ed or looped over 8829 // use plain assignment 8830 if ( owner.nodeType ) { 8831 owner[ this.expando ] = value; 8832 8833 // Otherwise secure it in a non-enumerable property 8834 // configurable must be true to allow the property to be 8835 // deleted when data is removed 8836 } else { 8837 Object.defineProperty( owner, this.expando, { 8838 value: value, 8839 configurable: true 8840 } ); 8841 } 8842 } 8843 } 8844 8845 return value; 8846 }, 8847 set: function( owner, data, value ) { 8848 var prop, 8849 cache = this.cache( owner ); 8850 8851 // Handle: [ owner, key, value ] args 8852 // Always use camelCase key (gh-2257) 8853 if ( typeof data === "string" ) { 8854 cache[ camelCase( data ) ] = value; 8855 8856 // Handle: [ owner, { properties } ] args 8857 } else { 8858 8859 // Copy the properties one-by-one to the cache object 8860 for ( prop in data ) { 8861 cache[ camelCase( prop ) ] = data[ prop ]; 8862 } 8863 } 8864 return cache; 8865 }, 8866 get: function( owner, key ) { 8867 return key === undefined ? 8868 this.cache( owner ) : 8869 8870 // Always use camelCase key (gh-2257) 8871 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 8872 }, 8873 access: function( owner, key, value ) { 8874 8875 // In cases where either: 8876 // 8877 // 1. No key was specified 8878 // 2. A string key was specified, but no value provided 8879 // 8880 // Take the "read" path and allow the get method to determine 8881 // which value to return, respectively either: 8882 // 8883 // 1. The entire cache object 8884 // 2. The data stored at the key 8885 // 8886 if ( key === undefined || 8887 ( ( key && typeof key === "string" ) && value === undefined ) ) { 8888 8889 return this.get( owner, key ); 8890 } 8891 8892 // When the key is not a string, or both a key and value 8893 // are specified, set or extend (existing objects) with either: 8894 // 8895 // 1. An object of properties 8896 // 2. A key and value 8897 // 8898 this.set( owner, key, value ); 8899 8900 // Since the "set" path can have two possible entry points 8901 // return the expected data based on which path was taken[*] 8902 return value !== undefined ? value : key; 8903 }, 8904 remove: function( owner, key ) { 8905 var i, 8906 cache = owner[ this.expando ]; 8907 8908 if ( cache === undefined ) { 8909 return; 8910 } 8911 8912 if ( key !== undefined ) { 8913 8914 // Support array or space separated string of keys 8915 if ( Array.isArray( key ) ) { 8916 8917 // If key is an array of keys... 8918 // We always set camelCase keys, so remove that. 8919 key = key.map( camelCase ); 8920 } else { 8921 key = camelCase( key ); 8922 8923 // If a key with the spaces exists, use it. 8924 // Otherwise, create an array by matching non-whitespace 8925 key = key in cache ? 8926 [ key ] : 8927 ( key.match( rnothtmlwhite ) || [] ); 8928 } 8929 8930 i = key.length; 8931 8932 while ( i-- ) { 8933 delete cache[ key[ i ] ]; 8934 } 8935 } 8936 8937 // Remove the expando if there's no more data 8938 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 8939 8940 // Support: Chrome <=35 - 45 8941 // Webkit & Blink performance suffers when deleting properties 8942 // from DOM nodes, so set to undefined instead 8943 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 8944 if ( owner.nodeType ) { 8945 owner[ this.expando ] = undefined; 8946 } else { 8947 delete owner[ this.expando ]; 8948 } 8949 } 8950 }, 8951 hasData: function( owner ) { 8952 var cache = owner[ this.expando ]; 8953 return cache !== undefined && !jQuery.isEmptyObject( cache ); 8954 } 8955}; 8956var dataPriv = new Data(); 8957 8958var dataUser = new Data(); 8959 8960 8961 8962// Implementation Summary 8963// 8964// 1. Enforce API surface and semantic compatibility with 1.9.x branch 8965// 2. Improve the module's maintainability by reducing the storage 8966// paths to a single mechanism. 8967// 3. Use the same single mechanism to support "private" and "user" data. 8968// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 8969// 5. Avoid exposing implementation details on user objects (eg. expando properties) 8970// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 8971 8972var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 8973 rmultiDash = /[A-Z]/g; 8974 8975function getData( data ) { 8976 if ( data === "true" ) { 8977 return true; 8978 } 8979 8980 if ( data === "false" ) { 8981 return false; 8982 } 8983 8984 if ( data === "null" ) { 8985 return null; 8986 } 8987 8988 // Only convert to a number if it doesn't change the string 8989 if ( data === +data + "" ) { 8990 return +data; 8991 } 8992 8993 if ( rbrace.test( data ) ) { 8994 return JSON.parse( data ); 8995 } 8996 8997 return data; 8998} 8999 9000function dataAttr( elem, key, data ) { 9001 var name; 9002 9003 // If nothing was found internally, try to fetch any 9004 // data from the HTML5 data-* attribute 9005 if ( data === undefined && elem.nodeType === 1 ) { 9006 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 9007 data = elem.getAttribute( name ); 9008 9009 if ( typeof data === "string" ) { 9010 try { 9011 data = getData( data ); 9012 } catch ( e ) {} 9013 9014 // Make sure we set the data so it isn't changed later 9015 dataUser.set( elem, key, data ); 9016 } else { 9017 data = undefined; 9018 } 9019 } 9020 return data; 9021} 9022 9023jQuery.extend( { 9024 hasData: function( elem ) { 9025 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 9026 }, 9027 9028 data: function( elem, name, data ) { 9029 return dataUser.access( elem, name, data ); 9030 }, 9031 9032 removeData: function( elem, name ) { 9033 dataUser.remove( elem, name ); 9034 }, 9035 9036 // TODO: Now that all calls to _data and _removeData have been replaced 9037 // with direct calls to dataPriv methods, these can be deprecated. 9038 _data: function( elem, name, data ) { 9039 return dataPriv.access( elem, name, data ); 9040 }, 9041 9042 _removeData: function( elem, name ) { 9043 dataPriv.remove( elem, name ); 9044 } 9045} ); 9046 9047jQuery.fn.extend( { 9048 data: function( key, value ) { 9049 var i, name, data, 9050 elem = this[ 0 ], 9051 attrs = elem && elem.attributes; 9052 9053 // Gets all values 9054 if ( key === undefined ) { 9055 if ( this.length ) { 9056 data = dataUser.get( elem ); 9057 9058 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 9059 i = attrs.length; 9060 while ( i-- ) { 9061 9062 // Support: IE 11 only 9063 // The attrs elements can be null (trac-14894) 9064 if ( attrs[ i ] ) { 9065 name = attrs[ i ].name; 9066 if ( name.indexOf( "data-" ) === 0 ) { 9067 name = camelCase( name.slice( 5 ) ); 9068 dataAttr( elem, name, data[ name ] ); 9069 } 9070 } 9071 } 9072 dataPriv.set( elem, "hasDataAttrs", true ); 9073 } 9074 } 9075 9076 return data; 9077 } 9078 9079 // Sets multiple values 9080 if ( typeof key === "object" ) { 9081 return this.each( function() { 9082 dataUser.set( this, key ); 9083 } ); 9084 } 9085 9086 return access( this, function( value ) { 9087 var data; 9088 9089 // The calling jQuery object (element matches) is not empty 9090 // (and therefore has an element appears at this[ 0 ]) and the 9091 // `value` parameter was not undefined. An empty jQuery object 9092 // will result in `undefined` for elem = this[ 0 ] which will 9093 // throw an exception if an attempt to read a data cache is made. 9094 if ( elem && value === undefined ) { 9095 9096 // Attempt to get data from the cache 9097 // The key will always be camelCased in Data 9098 data = dataUser.get( elem, key ); 9099 if ( data !== undefined ) { 9100 return data; 9101 } 9102 9103 // Attempt to "discover" the data in 9104 // HTML5 custom data-* attrs 9105 data = dataAttr( elem, key ); 9106 if ( data !== undefined ) { 9107 return data; 9108 } 9109 9110 // We tried really hard, but the data doesn't exist. 9111 return; 9112 } 9113 9114 // Set the data... 9115 this.each( function() { 9116 9117 // We always store the camelCased key 9118 dataUser.set( this, key, value ); 9119 } ); 9120 }, null, value, arguments.length > 1, null, true ); 9121 }, 9122 9123 removeData: function( key ) { 9124 return this.each( function() { 9125 dataUser.remove( this, key ); 9126 } ); 9127 } 9128} ); 9129 9130 9131jQuery.extend( { 9132 queue: function( elem, type, data ) { 9133 var queue; 9134 9135 if ( elem ) { 9136 type = ( type || "fx" ) + "queue"; 9137 queue = dataPriv.get( elem, type ); 9138 9139 // Speed up dequeue by getting out quickly if this is just a lookup 9140 if ( data ) { 9141 if ( !queue || Array.isArray( data ) ) { 9142 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 9143 } else { 9144 queue.push( data ); 9145 } 9146 } 9147 return queue || []; 9148 } 9149 }, 9150 9151 dequeue: function( elem, type ) { 9152 type = type || "fx"; 9153 9154 var queue = jQuery.queue( elem, type ), 9155 startLength = queue.length, 9156 fn = queue.shift(), 9157 hooks = jQuery._queueHooks( elem, type ), 9158 next = function() { 9159 jQuery.dequeue( elem, type ); 9160 }; 9161 9162 // If the fx queue is dequeued, always remove the progress sentinel 9163 if ( fn === "inprogress" ) { 9164 fn = queue.shift(); 9165 startLength--; 9166 } 9167 9168 if ( fn ) { 9169 9170 // Add a progress sentinel to prevent the fx queue from being 9171 // automatically dequeued 9172 if ( type === "fx" ) { 9173 queue.unshift( "inprogress" ); 9174 } 9175 9176 // Clear up the last queue stop function 9177 delete hooks.stop; 9178 fn.call( elem, next, hooks ); 9179 } 9180 9181 if ( !startLength && hooks ) { 9182 hooks.empty.fire(); 9183 } 9184 }, 9185 9186 // Not public - generate a queueHooks object, or return the current one 9187 _queueHooks: function( elem, type ) { 9188 var key = type + "queueHooks"; 9189 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 9190 empty: jQuery.Callbacks( "once memory" ).add( function() { 9191 dataPriv.remove( elem, [ type + "queue", key ] ); 9192 } ) 9193 } ); 9194 } 9195} ); 9196 9197jQuery.fn.extend( { 9198 queue: function( type, data ) { 9199 var setter = 2; 9200 9201 if ( typeof type !== "string" ) { 9202 data = type; 9203 type = "fx"; 9204 setter--; 9205 } 9206 9207 if ( arguments.length < setter ) { 9208 return jQuery.queue( this[ 0 ], type ); 9209 } 9210 9211 return data === undefined ? 9212 this : 9213 this.each( function() { 9214 var queue = jQuery.queue( this, type, data ); 9215 9216 // Ensure a hooks for this queue 9217 jQuery._queueHooks( this, type ); 9218 9219 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 9220 jQuery.dequeue( this, type ); 9221 } 9222 } ); 9223 }, 9224 dequeue: function( type ) { 9225 return this.each( function() { 9226 jQuery.dequeue( this, type ); 9227 } ); 9228 }, 9229 clearQueue: function( type ) { 9230 return this.queue( type || "fx", [] ); 9231 }, 9232 9233 // Get a promise resolved when queues of a certain type 9234 // are emptied (fx is the type by default) 9235 promise: function( type, obj ) { 9236 var tmp, 9237 count = 1, 9238 defer = jQuery.Deferred(), 9239 elements = this, 9240 i = this.length, 9241 resolve = function() { 9242 if ( !( --count ) ) { 9243 defer.resolveWith( elements, [ elements ] ); 9244 } 9245 }; 9246 9247 if ( typeof type !== "string" ) { 9248 obj = type; 9249 type = undefined; 9250 } 9251 type = type || "fx"; 9252 9253 while ( i-- ) { 9254 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 9255 if ( tmp && tmp.empty ) { 9256 count++; 9257 tmp.empty.add( resolve ); 9258 } 9259 } 9260 resolve(); 9261 return defer.promise( obj ); 9262 } 9263} ); 9264var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 9265 9266var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 9267 9268 9269var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 9270 9271var documentElement = document.documentElement; 9272 9273 9274 9275 var isAttached = function( elem ) { 9276 return jQuery.contains( elem.ownerDocument, elem ); 9277 }, 9278 composed = { composed: true }; 9279 9280 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 9281 // Check attachment across shadow DOM boundaries when possible (gh-3504) 9282 // Support: iOS 10.0-10.2 only 9283 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 9284 // leading to errors. We need to check for `getRootNode`. 9285 if ( documentElement.getRootNode ) { 9286 isAttached = function( elem ) { 9287 return jQuery.contains( elem.ownerDocument, elem ) || 9288 elem.getRootNode( composed ) === elem.ownerDocument; 9289 }; 9290 } 9291var isHiddenWithinTree = function( elem, el ) { 9292 9293 // isHiddenWithinTree might be called from jQuery#filter function; 9294 // in that case, element will be second argument 9295 elem = el || elem; 9296 9297 // Inline style trumps all 9298 return elem.style.display === "none" || 9299 elem.style.display === "" && 9300 9301 // Otherwise, check computed style 9302 // Support: Firefox <=43 - 45 9303 // Disconnected elements can have computed display: none, so first confirm that elem is 9304 // in the document. 9305 isAttached( elem ) && 9306 9307 jQuery.css( elem, "display" ) === "none"; 9308 }; 9309 9310 9311 9312function adjustCSS( elem, prop, valueParts, tween ) { 9313 var adjusted, scale, 9314 maxIterations = 20, 9315 currentValue = tween ? 9316 function() { 9317 return tween.cur(); 9318 } : 9319 function() { 9320 return jQuery.css( elem, prop, "" ); 9321 }, 9322 initial = currentValue(), 9323 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 9324 9325 // Starting value computation is required for potential unit mismatches 9326 initialInUnit = elem.nodeType && 9327 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 9328 rcssNum.exec( jQuery.css( elem, prop ) ); 9329 9330 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 9331 9332 // Support: Firefox <=54 9333 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 9334 initial = initial / 2; 9335 9336 // Trust units reported by jQuery.css 9337 unit = unit || initialInUnit[ 3 ]; 9338 9339 // Iteratively approximate from a nonzero starting point 9340 initialInUnit = +initial || 1; 9341 9342 while ( maxIterations-- ) { 9343 9344 // Evaluate and update our best guess (doubling guesses that zero out). 9345 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 9346 jQuery.style( elem, prop, initialInUnit + unit ); 9347 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 9348 maxIterations = 0; 9349 } 9350 initialInUnit = initialInUnit / scale; 9351 9352 } 9353 9354 initialInUnit = initialInUnit * 2; 9355 jQuery.style( elem, prop, initialInUnit + unit ); 9356 9357 // Make sure we update the tween properties later on 9358 valueParts = valueParts || []; 9359 } 9360 9361 if ( valueParts ) { 9362 initialInUnit = +initialInUnit || +initial || 0; 9363 9364 // Apply relative offset (+=/-=) if specified 9365 adjusted = valueParts[ 1 ] ? 9366 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 9367 +valueParts[ 2 ]; 9368 if ( tween ) { 9369 tween.unit = unit; 9370 tween.start = initialInUnit; 9371 tween.end = adjusted; 9372 } 9373 } 9374 return adjusted; 9375} 9376 9377 9378var defaultDisplayMap = {}; 9379 9380function getDefaultDisplay( elem ) { 9381 var temp, 9382 doc = elem.ownerDocument, 9383 nodeName = elem.nodeName, 9384 display = defaultDisplayMap[ nodeName ]; 9385 9386 if ( display ) { 9387 return display; 9388 } 9389 9390 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 9391 display = jQuery.css( temp, "display" ); 9392 9393 temp.parentNode.removeChild( temp ); 9394 9395 if ( display === "none" ) { 9396 display = "block"; 9397 } 9398 defaultDisplayMap[ nodeName ] = display; 9399 9400 return display; 9401} 9402 9403function showHide( elements, show ) { 9404 var display, elem, 9405 values = [], 9406 index = 0, 9407 length = elements.length; 9408 9409 // Determine new display value for elements that need to change 9410 for ( ; index < length; index++ ) { 9411 elem = elements[ index ]; 9412 if ( !elem.style ) { 9413 continue; 9414 } 9415 9416 display = elem.style.display; 9417 if ( show ) { 9418 9419 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 9420 // check is required in this first loop unless we have a nonempty display value (either 9421 // inline or about-to-be-restored) 9422 if ( display === "none" ) { 9423 values[ index ] = dataPriv.get( elem, "display" ) || null; 9424 if ( !values[ index ] ) { 9425 elem.style.display = ""; 9426 } 9427 } 9428 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 9429 values[ index ] = getDefaultDisplay( elem ); 9430 } 9431 } else { 9432 if ( display !== "none" ) { 9433 values[ index ] = "none"; 9434 9435 // Remember what we're overwriting 9436 dataPriv.set( elem, "display", display ); 9437 } 9438 } 9439 } 9440 9441 // Set the display of the elements in a second loop to avoid constant reflow 9442 for ( index = 0; index < length; index++ ) { 9443 if ( values[ index ] != null ) { 9444 elements[ index ].style.display = values[ index ]; 9445 } 9446 } 9447 9448 return elements; 9449} 9450 9451jQuery.fn.extend( { 9452 show: function() { 9453 return showHide( this, true ); 9454 }, 9455 hide: function() { 9456 return showHide( this ); 9457 }, 9458 toggle: function( state ) { 9459 if ( typeof state === "boolean" ) { 9460 return state ? this.show() : this.hide(); 9461 } 9462 9463 return this.each( function() { 9464 if ( isHiddenWithinTree( this ) ) { 9465 jQuery( this ).show(); 9466 } else { 9467 jQuery( this ).hide(); 9468 } 9469 } ); 9470 } 9471} ); 9472var rcheckableType = ( /^(?:checkbox|radio)$/i ); 9473 9474var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 9475 9476var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 9477 9478 9479 9480( function() { 9481 var fragment = document.createDocumentFragment(), 9482 div = fragment.appendChild( document.createElement( "div" ) ), 9483 input = document.createElement( "input" ); 9484 9485 // Support: Android 4.0 - 4.3 only 9486 // Check state lost if the name is set (trac-11217) 9487 // Support: Windows Web Apps (WWA) 9488 // `name` and `type` must use .setAttribute for WWA (trac-14901) 9489 input.setAttribute( "type", "radio" ); 9490 input.setAttribute( "checked", "checked" ); 9491 input.setAttribute( "name", "t" ); 9492 9493 div.appendChild( input ); 9494 9495 // Support: Android <=4.1 only 9496 // Older WebKit doesn't clone checked state correctly in fragments 9497 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 9498 9499 // Support: IE <=11 only 9500 // Make sure textarea (and checkbox) defaultValue is properly cloned 9501 div.innerHTML = "<textarea>x</textarea>"; 9502 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 9503 9504 // Support: IE <=9 only 9505 // IE <=9 replaces <option> tags with their contents when inserted outside of 9506 // the select element. 9507 div.innerHTML = "<option></option>"; 9508 support.option = !!div.lastChild; 9509} )(); 9510 9511 9512// We have to close these tags to support XHTML (trac-13200) 9513var wrapMap = { 9514 9515 // XHTML parsers do not magically insert elements in the 9516 // same way that tag soup parsers do. So we cannot shorten 9517 // this by omitting <tbody> or other required elements. 9518 thead: [ 1, "<table>", "</table>" ], 9519 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 9520 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 9521 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 9522 9523 _default: [ 0, "", "" ] 9524}; 9525 9526wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 9527wrapMap.th = wrapMap.td; 9528 9529// Support: IE <=9 only 9530if ( !support.option ) { 9531 wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]; 9532} 9533 9534 9535function getAll( context, tag ) { 9536 9537 // Support: IE <=9 - 11 only 9538 // Use typeof to avoid zero-argument method invocation on host objects (trac-15151) 9539 var ret; 9540 9541 if ( typeof context.getElementsByTagName !== "undefined" ) { 9542 ret = context.getElementsByTagName( tag || "*" ); 9543 9544 } else if ( typeof context.querySelectorAll !== "undefined" ) { 9545 ret = context.querySelectorAll( tag || "*" ); 9546 9547 } else { 9548 ret = []; 9549 } 9550 9551 if ( tag === undefined || tag && nodeName( context, tag ) ) { 9552 return jQuery.merge( [ context ], ret ); 9553 } 9554 9555 return ret; 9556} 9557 9558 9559// Mark scripts as having already been evaluated 9560function setGlobalEval( elems, refElements ) { 9561 var i = 0, 9562 l = elems.length; 9563 9564 for ( ; i < l; i++ ) { 9565 dataPriv.set( 9566 elems[ i ], 9567 "globalEval", 9568 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 9569 ); 9570 } 9571} 9572 9573 9574var rhtml = /<|&#?\w+;/; 9575 9576function buildFragment( elems, context, scripts, selection, ignored ) { 9577 var elem, tmp, tag, wrap, attached, j, 9578 fragment = context.createDocumentFragment(), 9579 nodes = [], 9580 i = 0, 9581 l = elems.length; 9582 9583 for ( ; i < l; i++ ) { 9584 elem = elems[ i ]; 9585 9586 if ( elem || elem === 0 ) { 9587 9588 // Add nodes directly 9589 if ( toType( elem ) === "object" ) { 9590 9591 // Support: Android <=4.0 only, PhantomJS 1 only 9592 // push.apply(_, arraylike) throws on ancient WebKit 9593 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 9594 9595 // Convert non-html into a text node 9596 } else if ( !rhtml.test( elem ) ) { 9597 nodes.push( context.createTextNode( elem ) ); 9598 9599 // Convert html into DOM nodes 9600 } else { 9601 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 9602 9603 // Deserialize a standard representation 9604 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 9605 wrap = wrapMap[ tag ] || wrapMap._default; 9606 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 9607 9608 // Descend through wrappers to the right content 9609 j = wrap[ 0 ]; 9610 while ( j-- ) { 9611 tmp = tmp.lastChild; 9612 } 9613 9614 // Support: Android <=4.0 only, PhantomJS 1 only 9615 // push.apply(_, arraylike) throws on ancient WebKit 9616 jQuery.merge( nodes, tmp.childNodes ); 9617 9618 // Remember the top-level container 9619 tmp = fragment.firstChild; 9620 9621 // Ensure the created nodes are orphaned (trac-12392) 9622 tmp.textContent = ""; 9623 } 9624 } 9625 } 9626 9627 // Remove wrapper from fragment 9628 fragment.textContent = ""; 9629 9630 i = 0; 9631 while ( ( elem = nodes[ i++ ] ) ) { 9632 9633 // Skip elements already in the context collection (trac-4087) 9634 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 9635 if ( ignored ) { 9636 ignored.push( elem ); 9637 } 9638 continue; 9639 } 9640 9641 attached = isAttached( elem ); 9642 9643 // Append to fragment 9644 tmp = getAll( fragment.appendChild( elem ), "script" ); 9645 9646 // Preserve script evaluation history 9647 if ( attached ) { 9648 setGlobalEval( tmp ); 9649 } 9650 9651 // Capture executables 9652 if ( scripts ) { 9653 j = 0; 9654 while ( ( elem = tmp[ j++ ] ) ) { 9655 if ( rscriptType.test( elem.type || "" ) ) { 9656 scripts.push( elem ); 9657 } 9658 } 9659 } 9660 } 9661 9662 return fragment; 9663} 9664 9665 9666var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 9667 9668function returnTrue() { 9669 return true; 9670} 9671 9672function returnFalse() { 9673 return false; 9674} 9675 9676function on( elem, types, selector, data, fn, one ) { 9677 var origFn, type; 9678 9679 // Types can be a map of types/handlers 9680 if ( typeof types === "object" ) { 9681 9682 // ( types-Object, selector, data ) 9683 if ( typeof selector !== "string" ) { 9684 9685 // ( types-Object, data ) 9686 data = data || selector; 9687 selector = undefined; 9688 } 9689 for ( type in types ) { 9690 on( elem, type, selector, data, types[ type ], one ); 9691 } 9692 return elem; 9693 } 9694 9695 if ( data == null && fn == null ) { 9696 9697 // ( types, fn ) 9698 fn = selector; 9699 data = selector = undefined; 9700 } else if ( fn == null ) { 9701 if ( typeof selector === "string" ) { 9702 9703 // ( types, selector, fn ) 9704 fn = data; 9705 data = undefined; 9706 } else { 9707 9708 // ( types, data, fn ) 9709 fn = data; 9710 data = selector; 9711 selector = undefined; 9712 } 9713 } 9714 if ( fn === false ) { 9715 fn = returnFalse; 9716 } else if ( !fn ) { 9717 return elem; 9718 } 9719 9720 if ( one === 1 ) { 9721 origFn = fn; 9722 fn = function( event ) { 9723 9724 // Can use an empty set, since event contains the info 9725 jQuery().off( event ); 9726 return origFn.apply( this, arguments ); 9727 }; 9728 9729 // Use same guid so caller can remove using origFn 9730 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 9731 } 9732 return elem.each( function() { 9733 jQuery.event.add( this, types, fn, data, selector ); 9734 } ); 9735} 9736 9737/* 9738 * Helper functions for managing events -- not part of the public interface. 9739 * Props to Dean Edwards' addEvent library for many of the ideas. 9740 */ 9741jQuery.event = { 9742 9743 global: {}, 9744 9745 add: function( elem, types, handler, data, selector ) { 9746 9747 var handleObjIn, eventHandle, tmp, 9748 events, t, handleObj, 9749 special, handlers, type, namespaces, origType, 9750 elemData = dataPriv.get( elem ); 9751 9752 // Only attach events to objects that accept data 9753 if ( !acceptData( elem ) ) { 9754 return; 9755 } 9756 9757 // Caller can pass in an object of custom data in lieu of the handler 9758 if ( handler.handler ) { 9759 handleObjIn = handler; 9760 handler = handleObjIn.handler; 9761 selector = handleObjIn.selector; 9762 } 9763 9764 // Ensure that invalid selectors throw exceptions at attach time 9765 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 9766 if ( selector ) { 9767 jQuery.find.matchesSelector( documentElement, selector ); 9768 } 9769 9770 // Make sure that the handler has a unique ID, used to find/remove it later 9771 if ( !handler.guid ) { 9772 handler.guid = jQuery.guid++; 9773 } 9774 9775 // Init the element's event structure and main handler, if this is the first 9776 if ( !( events = elemData.events ) ) { 9777 events = elemData.events = Object.create( null ); 9778 } 9779 if ( !( eventHandle = elemData.handle ) ) { 9780 eventHandle = elemData.handle = function( e ) { 9781 9782 // Discard the second event of a jQuery.event.trigger() and 9783 // when an event is called after a page has unloaded 9784 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 9785 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 9786 }; 9787 } 9788 9789 // Handle multiple events separated by a space 9790 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 9791 t = types.length; 9792 while ( t-- ) { 9793 tmp = rtypenamespace.exec( types[ t ] ) || []; 9794 type = origType = tmp[ 1 ]; 9795 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 9796 9797 // There *must* be a type, no attaching namespace-only handlers 9798 if ( !type ) { 9799 continue; 9800 } 9801 9802 // If event changes its type, use the special event handlers for the changed type 9803 special = jQuery.event.special[ type ] || {}; 9804 9805 // If selector defined, determine special event api type, otherwise given type 9806 type = ( selector ? special.delegateType : special.bindType ) || type; 9807 9808 // Update special based on newly reset type 9809 special = jQuery.event.special[ type ] || {}; 9810 9811 // handleObj is passed to all event handlers 9812 handleObj = jQuery.extend( { 9813 type: type, 9814 origType: origType, 9815 data: data, 9816 handler: handler, 9817 guid: handler.guid, 9818 selector: selector, 9819 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 9820 namespace: namespaces.join( "." ) 9821 }, handleObjIn ); 9822 9823 // Init the event handler queue if we're the first 9824 if ( !( handlers = events[ type ] ) ) { 9825 handlers = events[ type ] = []; 9826 handlers.delegateCount = 0; 9827 9828 // Only use addEventListener if the special events handler returns false 9829 if ( !special.setup || 9830 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 9831 9832 if ( elem.addEventListener ) { 9833 elem.addEventListener( type, eventHandle ); 9834 } 9835 } 9836 } 9837 9838 if ( special.add ) { 9839 special.add.call( elem, handleObj ); 9840 9841 if ( !handleObj.handler.guid ) { 9842 handleObj.handler.guid = handler.guid; 9843 } 9844 } 9845 9846 // Add to the element's handler list, delegates in front 9847 if ( selector ) { 9848 handlers.splice( handlers.delegateCount++, 0, handleObj ); 9849 } else { 9850 handlers.push( handleObj ); 9851 } 9852 9853 // Keep track of which events have ever been used, for event optimization 9854 jQuery.event.global[ type ] = true; 9855 } 9856 9857 }, 9858 9859 // Detach an event or set of events from an element 9860 remove: function( elem, types, handler, selector, mappedTypes ) { 9861 9862 var j, origCount, tmp, 9863 events, t, handleObj, 9864 special, handlers, type, namespaces, origType, 9865 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 9866 9867 if ( !elemData || !( events = elemData.events ) ) { 9868 return; 9869 } 9870 9871 // Once for each type.namespace in types; type may be omitted 9872 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 9873 t = types.length; 9874 while ( t-- ) { 9875 tmp = rtypenamespace.exec( types[ t ] ) || []; 9876 type = origType = tmp[ 1 ]; 9877 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 9878 9879 // Unbind all events (on this namespace, if provided) for the element 9880 if ( !type ) { 9881 for ( type in events ) { 9882 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 9883 } 9884 continue; 9885 } 9886 9887 special = jQuery.event.special[ type ] || {}; 9888 type = ( selector ? special.delegateType : special.bindType ) || type; 9889 handlers = events[ type ] || []; 9890 tmp = tmp[ 2 ] && 9891 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 9892 9893 // Remove matching events 9894 origCount = j = handlers.length; 9895 while ( j-- ) { 9896 handleObj = handlers[ j ]; 9897 9898 if ( ( mappedTypes || origType === handleObj.origType ) && 9899 ( !handler || handler.guid === handleObj.guid ) && 9900 ( !tmp || tmp.test( handleObj.namespace ) ) && 9901 ( !selector || selector === handleObj.selector || 9902 selector === "**" && handleObj.selector ) ) { 9903 handlers.splice( j, 1 ); 9904 9905 if ( handleObj.selector ) { 9906 handlers.delegateCount--; 9907 } 9908 if ( special.remove ) { 9909 special.remove.call( elem, handleObj ); 9910 } 9911 } 9912 } 9913 9914 // Remove generic event handler if we removed something and no more handlers exist 9915 // (avoids potential for endless recursion during removal of special event handlers) 9916 if ( origCount && !handlers.length ) { 9917 if ( !special.teardown || 9918 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 9919 9920 jQuery.removeEvent( elem, type, elemData.handle ); 9921 } 9922 9923 delete events[ type ]; 9924 } 9925 } 9926 9927 // Remove data and the expando if it's no longer used 9928 if ( jQuery.isEmptyObject( events ) ) { 9929 dataPriv.remove( elem, "handle events" ); 9930 } 9931 }, 9932 9933 dispatch: function( nativeEvent ) { 9934 9935 var i, j, ret, matched, handleObj, handlerQueue, 9936 args = new Array( arguments.length ), 9937 9938 // Make a writable jQuery.Event from the native event object 9939 event = jQuery.event.fix( nativeEvent ), 9940 9941 handlers = ( 9942 dataPriv.get( this, "events" ) || Object.create( null ) 9943 )[ event.type ] || [], 9944 special = jQuery.event.special[ event.type ] || {}; 9945 9946 // Use the fix-ed jQuery.Event rather than the (read-only) native event 9947 args[ 0 ] = event; 9948 9949 for ( i = 1; i < arguments.length; i++ ) { 9950 args[ i ] = arguments[ i ]; 9951 } 9952 9953 event.delegateTarget = this; 9954 9955 // Call the preDispatch hook for the mapped type, and let it bail if desired 9956 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 9957 return; 9958 } 9959 9960 // Determine handlers 9961 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 9962 9963 // Run delegates first; they may want to stop propagation beneath us 9964 i = 0; 9965 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 9966 event.currentTarget = matched.elem; 9967 9968 j = 0; 9969 while ( ( handleObj = matched.handlers[ j++ ] ) && 9970 !event.isImmediatePropagationStopped() ) { 9971 9972 // If the event is namespaced, then each handler is only invoked if it is 9973 // specially universal or its namespaces are a superset of the event's. 9974 if ( !event.rnamespace || handleObj.namespace === false || 9975 event.rnamespace.test( handleObj.namespace ) ) { 9976 9977 event.handleObj = handleObj; 9978 event.data = handleObj.data; 9979 9980 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 9981 handleObj.handler ).apply( matched.elem, args ); 9982 9983 if ( ret !== undefined ) { 9984 if ( ( event.result = ret ) === false ) { 9985 event.preventDefault(); 9986 event.stopPropagation(); 9987 } 9988 } 9989 } 9990 } 9991 } 9992 9993 // Call the postDispatch hook for the mapped type 9994 if ( special.postDispatch ) { 9995 special.postDispatch.call( this, event ); 9996 } 9997 9998 return event.result; 9999 }, 10000 10001 handlers: function( event, handlers ) { 10002 var i, handleObj, sel, matchedHandlers, matchedSelectors, 10003 handlerQueue = [], 10004 delegateCount = handlers.delegateCount, 10005 cur = event.target; 10006 10007 // Find delegate handlers 10008 if ( delegateCount && 10009 10010 // Support: IE <=9 10011 // Black-hole SVG <use> instance trees (trac-13180) 10012 cur.nodeType && 10013 10014 // Support: Firefox <=42 10015 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 10016 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 10017 // Support: IE 11 only 10018 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 10019 !( event.type === "click" && event.button >= 1 ) ) { 10020 10021 for ( ; cur !== this; cur = cur.parentNode || this ) { 10022 10023 // Don't check non-elements (trac-13208) 10024 // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764) 10025 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 10026 matchedHandlers = []; 10027 matchedSelectors = {}; 10028 for ( i = 0; i < delegateCount; i++ ) { 10029 handleObj = handlers[ i ]; 10030 10031 // Don't conflict with Object.prototype properties (trac-13203) 10032 sel = handleObj.selector + " "; 10033 10034 if ( matchedSelectors[ sel ] === undefined ) { 10035 matchedSelectors[ sel ] = handleObj.needsContext ? 10036 jQuery( sel, this ).index( cur ) > -1 : 10037 jQuery.find( sel, this, null, [ cur ] ).length; 10038 } 10039 if ( matchedSelectors[ sel ] ) { 10040 matchedHandlers.push( handleObj ); 10041 } 10042 } 10043 if ( matchedHandlers.length ) { 10044 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 10045 } 10046 } 10047 } 10048 } 10049 10050 // Add the remaining (directly-bound) handlers 10051 cur = this; 10052 if ( delegateCount < handlers.length ) { 10053 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 10054 } 10055 10056 return handlerQueue; 10057 }, 10058 10059 addProp: function( name, hook ) { 10060 Object.defineProperty( jQuery.Event.prototype, name, { 10061 enumerable: true, 10062 configurable: true, 10063 10064 get: isFunction( hook ) ? 10065 function() { 10066 if ( this.originalEvent ) { 10067 return hook( this.originalEvent ); 10068 } 10069 } : 10070 function() { 10071 if ( this.originalEvent ) { 10072 return this.originalEvent[ name ]; 10073 } 10074 }, 10075 10076 set: function( value ) { 10077 Object.defineProperty( this, name, { 10078 enumerable: true, 10079 configurable: true, 10080 writable: true, 10081 value: value 10082 } ); 10083 } 10084 } ); 10085 }, 10086 10087 fix: function( originalEvent ) { 10088 return originalEvent[ jQuery.expando ] ? 10089 originalEvent : 10090 new jQuery.Event( originalEvent ); 10091 }, 10092 10093 special: { 10094 load: { 10095 10096 // Prevent triggered image.load events from bubbling to window.load 10097 noBubble: true 10098 }, 10099 click: { 10100 10101 // Utilize native event to ensure correct state for checkable inputs 10102 setup: function( data ) { 10103 10104 // For mutual compressibility with _default, replace `this` access with a local var. 10105 // `|| data` is dead code meant only to preserve the variable through minification. 10106 var el = this || data; 10107 10108 // Claim the first handler 10109 if ( rcheckableType.test( el.type ) && 10110 el.click && nodeName( el, "input" ) ) { 10111 10112 // dataPriv.set( el, "click", ... ) 10113 leverageNative( el, "click", true ); 10114 } 10115 10116 // Return false to allow normal processing in the caller 10117 return false; 10118 }, 10119 trigger: function( data ) { 10120 10121 // For mutual compressibility with _default, replace `this` access with a local var. 10122 // `|| data` is dead code meant only to preserve the variable through minification. 10123 var el = this || data; 10124 10125 // Force setup before triggering a click 10126 if ( rcheckableType.test( el.type ) && 10127 el.click && nodeName( el, "input" ) ) { 10128 10129 leverageNative( el, "click" ); 10130 } 10131 10132 // Return non-false to allow normal event-path propagation 10133 return true; 10134 }, 10135 10136 // For cross-browser consistency, suppress native .click() on links 10137 // Also prevent it if we're currently inside a leveraged native-event stack 10138 _default: function( event ) { 10139 var target = event.target; 10140 return rcheckableType.test( target.type ) && 10141 target.click && nodeName( target, "input" ) && 10142 dataPriv.get( target, "click" ) || 10143 nodeName( target, "a" ); 10144 } 10145 }, 10146 10147 beforeunload: { 10148 postDispatch: function( event ) { 10149 10150 // Support: Firefox 20+ 10151 // Firefox doesn't alert if the returnValue field is not set. 10152 if ( event.result !== undefined && event.originalEvent ) { 10153 event.originalEvent.returnValue = event.result; 10154 } 10155 } 10156 } 10157 } 10158}; 10159 10160// Ensure the presence of an event listener that handles manually-triggered 10161// synthetic events by interrupting progress until reinvoked in response to 10162// *native* events that it fires directly, ensuring that state changes have 10163// already occurred before other listeners are invoked. 10164function leverageNative( el, type, isSetup ) { 10165 10166 // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add 10167 if ( !isSetup ) { 10168 if ( dataPriv.get( el, type ) === undefined ) { 10169 jQuery.event.add( el, type, returnTrue ); 10170 } 10171 return; 10172 } 10173 10174 // Register the controller as a special universal handler for all event namespaces 10175 dataPriv.set( el, type, false ); 10176 jQuery.event.add( el, type, { 10177 namespace: false, 10178 handler: function( event ) { 10179 var result, 10180 saved = dataPriv.get( this, type ); 10181 10182 if ( ( event.isTrigger & 1 ) && this[ type ] ) { 10183 10184 // Interrupt processing of the outer synthetic .trigger()ed event 10185 if ( !saved ) { 10186 10187 // Store arguments for use when handling the inner native event 10188 // There will always be at least one argument (an event object), so this array 10189 // will not be confused with a leftover capture object. 10190 saved = slice.call( arguments ); 10191 dataPriv.set( this, type, saved ); 10192 10193 // Trigger the native event and capture its result 10194 this[ type ](); 10195 result = dataPriv.get( this, type ); 10196 dataPriv.set( this, type, false ); 10197 10198 if ( saved !== result ) { 10199 10200 // Cancel the outer synthetic event 10201 event.stopImmediatePropagation(); 10202 event.preventDefault(); 10203 10204 return result; 10205 } 10206 10207 // If this is an inner synthetic event for an event with a bubbling surrogate 10208 // (focus or blur), assume that the surrogate already propagated from triggering 10209 // the native event and prevent that from happening again here. 10210 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 10211 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 10212 // less bad than duplication. 10213 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { 10214 event.stopPropagation(); 10215 } 10216 10217 // If this is a native event triggered above, everything is now in order 10218 // Fire an inner synthetic event with the original arguments 10219 } else if ( saved ) { 10220 10221 // ...and capture the result 10222 dataPriv.set( this, type, jQuery.event.trigger( 10223 saved[ 0 ], 10224 saved.slice( 1 ), 10225 this 10226 ) ); 10227 10228 // Abort handling of the native event by all jQuery handlers while allowing 10229 // native handlers on the same element to run. On target, this is achieved 10230 // by stopping immediate propagation just on the jQuery event. However, 10231 // the native event is re-wrapped by a jQuery one on each level of the 10232 // propagation so the only way to stop it for jQuery is to stop it for 10233 // everyone via native `stopPropagation()`. This is not a problem for 10234 // focus/blur which don't bubble, but it does also stop click on checkboxes 10235 // and radios. We accept this limitation. 10236 event.stopPropagation(); 10237 event.isImmediatePropagationStopped = returnTrue; 10238 } 10239 } 10240 } ); 10241} 10242 10243jQuery.removeEvent = function( elem, type, handle ) { 10244 10245 // This "if" is needed for plain objects 10246 if ( elem.removeEventListener ) { 10247 elem.removeEventListener( type, handle ); 10248 } 10249}; 10250 10251jQuery.Event = function( src, props ) { 10252 10253 // Allow instantiation without the 'new' keyword 10254 if ( !( this instanceof jQuery.Event ) ) { 10255 return new jQuery.Event( src, props ); 10256 } 10257 10258 // Event object 10259 if ( src && src.type ) { 10260 this.originalEvent = src; 10261 this.type = src.type; 10262 10263 // Events bubbling up the document may have been marked as prevented 10264 // by a handler lower down the tree; reflect the correct value. 10265 this.isDefaultPrevented = src.defaultPrevented || 10266 src.defaultPrevented === undefined && 10267 10268 // Support: Android <=2.3 only 10269 src.returnValue === false ? 10270 returnTrue : 10271 returnFalse; 10272 10273 // Create target properties 10274 // Support: Safari <=6 - 7 only 10275 // Target should not be a text node (trac-504, trac-13143) 10276 this.target = ( src.target && src.target.nodeType === 3 ) ? 10277 src.target.parentNode : 10278 src.target; 10279 10280 this.currentTarget = src.currentTarget; 10281 this.relatedTarget = src.relatedTarget; 10282 10283 // Event type 10284 } else { 10285 this.type = src; 10286 } 10287 10288 // Put explicitly provided properties onto the event object 10289 if ( props ) { 10290 jQuery.extend( this, props ); 10291 } 10292 10293 // Create a timestamp if incoming event doesn't have one 10294 this.timeStamp = src && src.timeStamp || Date.now(); 10295 10296 // Mark it as fixed 10297 this[ jQuery.expando ] = true; 10298}; 10299 10300// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 10301// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 10302jQuery.Event.prototype = { 10303 constructor: jQuery.Event, 10304 isDefaultPrevented: returnFalse, 10305 isPropagationStopped: returnFalse, 10306 isImmediatePropagationStopped: returnFalse, 10307 isSimulated: false, 10308 10309 preventDefault: function() { 10310 var e = this.originalEvent; 10311 10312 this.isDefaultPrevented = returnTrue; 10313 10314 if ( e && !this.isSimulated ) { 10315 e.preventDefault(); 10316 } 10317 }, 10318 stopPropagation: function() { 10319 var e = this.originalEvent; 10320 10321 this.isPropagationStopped = returnTrue; 10322 10323 if ( e && !this.isSimulated ) { 10324 e.stopPropagation(); 10325 } 10326 }, 10327 stopImmediatePropagation: function() { 10328 var e = this.originalEvent; 10329 10330 this.isImmediatePropagationStopped = returnTrue; 10331 10332 if ( e && !this.isSimulated ) { 10333 e.stopImmediatePropagation(); 10334 } 10335 10336 this.stopPropagation(); 10337 } 10338}; 10339 10340// Includes all common event props including KeyEvent and MouseEvent specific props 10341jQuery.each( { 10342 altKey: true, 10343 bubbles: true, 10344 cancelable: true, 10345 changedTouches: true, 10346 ctrlKey: true, 10347 detail: true, 10348 eventPhase: true, 10349 metaKey: true, 10350 pageX: true, 10351 pageY: true, 10352 shiftKey: true, 10353 view: true, 10354 "char": true, 10355 code: true, 10356 charCode: true, 10357 key: true, 10358 keyCode: true, 10359 button: true, 10360 buttons: true, 10361 clientX: true, 10362 clientY: true, 10363 offsetX: true, 10364 offsetY: true, 10365 pointerId: true, 10366 pointerType: true, 10367 screenX: true, 10368 screenY: true, 10369 targetTouches: true, 10370 toElement: true, 10371 touches: true, 10372 which: true 10373}, jQuery.event.addProp ); 10374 10375jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { 10376 10377 function focusMappedHandler( nativeEvent ) { 10378 if ( document.documentMode ) { 10379 10380 // Support: IE 11+ 10381 // Attach a single focusin/focusout handler on the document while someone wants 10382 // focus/blur. This is because the former are synchronous in IE while the latter 10383 // are async. In other browsers, all those handlers are invoked synchronously. 10384 10385 // `handle` from private data would already wrap the event, but we need 10386 // to change the `type` here. 10387 var handle = dataPriv.get( this, "handle" ), 10388 event = jQuery.event.fix( nativeEvent ); 10389 event.type = nativeEvent.type === "focusin" ? "focus" : "blur"; 10390 event.isSimulated = true; 10391 10392 // First, handle focusin/focusout 10393 handle( nativeEvent ); 10394 10395 // ...then, handle focus/blur 10396 // 10397 // focus/blur don't bubble while focusin/focusout do; simulate the former by only 10398 // invoking the handler at the lower level. 10399 if ( event.target === event.currentTarget ) { 10400 10401 // The setup part calls `leverageNative`, which, in turn, calls 10402 // `jQuery.event.add`, so event handle will already have been set 10403 // by this point. 10404 handle( event ); 10405 } 10406 } else { 10407 10408 // For non-IE browsers, attach a single capturing handler on the document 10409 // while someone wants focusin/focusout. 10410 jQuery.event.simulate( delegateType, nativeEvent.target, 10411 jQuery.event.fix( nativeEvent ) ); 10412 } 10413 } 10414 10415 jQuery.event.special[ type ] = { 10416 10417 // Utilize native event if possible so blur/focus sequence is correct 10418 setup: function() { 10419 10420 var attaches; 10421 10422 // Claim the first handler 10423 // dataPriv.set( this, "focus", ... ) 10424 // dataPriv.set( this, "blur", ... ) 10425 leverageNative( this, type, true ); 10426 10427 if ( document.documentMode ) { 10428 10429 // Support: IE 9 - 11+ 10430 // We use the same native handler for focusin & focus (and focusout & blur) 10431 // so we need to coordinate setup & teardown parts between those events. 10432 // Use `delegateType` as the key as `type` is already used by `leverageNative`. 10433 attaches = dataPriv.get( this, delegateType ); 10434 if ( !attaches ) { 10435 this.addEventListener( delegateType, focusMappedHandler ); 10436 } 10437 dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 ); 10438 } else { 10439 10440 // Return false to allow normal processing in the caller 10441 return false; 10442 } 10443 }, 10444 trigger: function() { 10445 10446 // Force setup before trigger 10447 leverageNative( this, type ); 10448 10449 // Return non-false to allow normal event-path propagation 10450 return true; 10451 }, 10452 10453 teardown: function() { 10454 var attaches; 10455 10456 if ( document.documentMode ) { 10457 attaches = dataPriv.get( this, delegateType ) - 1; 10458 if ( !attaches ) { 10459 this.removeEventListener( delegateType, focusMappedHandler ); 10460 dataPriv.remove( this, delegateType ); 10461 } else { 10462 dataPriv.set( this, delegateType, attaches ); 10463 } 10464 } else { 10465 10466 // Return false to indicate standard teardown should be applied 10467 return false; 10468 } 10469 }, 10470 10471 // Suppress native focus or blur if we're currently inside 10472 // a leveraged native-event stack 10473 _default: function( event ) { 10474 return dataPriv.get( event.target, type ); 10475 }, 10476 10477 delegateType: delegateType 10478 }; 10479 10480 // Support: Firefox <=44 10481 // Firefox doesn't have focus(in | out) events 10482 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 10483 // 10484 // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 10485 // focus(in | out) events fire after focus & blur events, 10486 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 10487 // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 10488 // 10489 // Support: IE 9 - 11+ 10490 // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch, 10491 // attach a single handler for both events in IE. 10492 jQuery.event.special[ delegateType ] = { 10493 setup: function() { 10494 10495 // Handle: regular nodes (via `this.ownerDocument`), window 10496 // (via `this.document`) & document (via `this`). 10497 var doc = this.ownerDocument || this.document || this, 10498 dataHolder = document.documentMode ? this : doc, 10499 attaches = dataPriv.get( dataHolder, delegateType ); 10500 10501 // Support: IE 9 - 11+ 10502 // We use the same native handler for focusin & focus (and focusout & blur) 10503 // so we need to coordinate setup & teardown parts between those events. 10504 // Use `delegateType` as the key as `type` is already used by `leverageNative`. 10505 if ( !attaches ) { 10506 if ( document.documentMode ) { 10507 this.addEventListener( delegateType, focusMappedHandler ); 10508 } else { 10509 doc.addEventListener( type, focusMappedHandler, true ); 10510 } 10511 } 10512 dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 ); 10513 }, 10514 teardown: function() { 10515 var doc = this.ownerDocument || this.document || this, 10516 dataHolder = document.documentMode ? this : doc, 10517 attaches = dataPriv.get( dataHolder, delegateType ) - 1; 10518 10519 if ( !attaches ) { 10520 if ( document.documentMode ) { 10521 this.removeEventListener( delegateType, focusMappedHandler ); 10522 } else { 10523 doc.removeEventListener( type, focusMappedHandler, true ); 10524 } 10525 dataPriv.remove( dataHolder, delegateType ); 10526 } else { 10527 dataPriv.set( dataHolder, delegateType, attaches ); 10528 } 10529 } 10530 }; 10531} ); 10532 10533// Create mouseenter/leave events using mouseover/out and event-time checks 10534// so that event delegation works in jQuery. 10535// Do the same for pointerenter/pointerleave and pointerover/pointerout 10536// 10537// Support: Safari 7 only 10538// Safari sends mouseenter too often; see: 10539// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 10540// for the description of the bug (it existed in older Chrome versions as well). 10541jQuery.each( { 10542 mouseenter: "mouseover", 10543 mouseleave: "mouseout", 10544 pointerenter: "pointerover", 10545 pointerleave: "pointerout" 10546}, function( orig, fix ) { 10547 jQuery.event.special[ orig ] = { 10548 delegateType: fix, 10549 bindType: fix, 10550 10551 handle: function( event ) { 10552 var ret, 10553 target = this, 10554 related = event.relatedTarget, 10555 handleObj = event.handleObj; 10556 10557 // For mouseenter/leave call the handler if related is outside the target. 10558 // NB: No relatedTarget if the mouse left/entered the browser window 10559 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 10560 event.type = handleObj.origType; 10561 ret = handleObj.handler.apply( this, arguments ); 10562 event.type = fix; 10563 } 10564 return ret; 10565 } 10566 }; 10567} ); 10568 10569jQuery.fn.extend( { 10570 10571 on: function( types, selector, data, fn ) { 10572 return on( this, types, selector, data, fn ); 10573 }, 10574 one: function( types, selector, data, fn ) { 10575 return on( this, types, selector, data, fn, 1 ); 10576 }, 10577 off: function( types, selector, fn ) { 10578 var handleObj, type; 10579 if ( types && types.preventDefault && types.handleObj ) { 10580 10581 // ( event ) dispatched jQuery.Event 10582 handleObj = types.handleObj; 10583 jQuery( types.delegateTarget ).off( 10584 handleObj.namespace ? 10585 handleObj.origType + "." + handleObj.namespace : 10586 handleObj.origType, 10587 handleObj.selector, 10588 handleObj.handler 10589 ); 10590 return this; 10591 } 10592 if ( typeof types === "object" ) { 10593 10594 // ( types-object [, selector] ) 10595 for ( type in types ) { 10596 this.off( type, selector, types[ type ] ); 10597 } 10598 return this; 10599 } 10600 if ( selector === false || typeof selector === "function" ) { 10601 10602 // ( types [, fn] ) 10603 fn = selector; 10604 selector = undefined; 10605 } 10606 if ( fn === false ) { 10607 fn = returnFalse; 10608 } 10609 return this.each( function() { 10610 jQuery.event.remove( this, types, fn, selector ); 10611 } ); 10612 } 10613} ); 10614 10615 10616var 10617 10618 // Support: IE <=10 - 11, Edge 12 - 13 only 10619 // In IE/Edge using regex groups here causes severe slowdowns. 10620 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 10621 rnoInnerhtml = /<script|<style|<link/i, 10622 10623 // checked="checked" or checked 10624 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 10625 10626 rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g; 10627 10628// Prefer a tbody over its parent table for containing new rows 10629function manipulationTarget( elem, content ) { 10630 if ( nodeName( elem, "table" ) && 10631 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 10632 10633 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 10634 } 10635 10636 return elem; 10637} 10638 10639// Replace/restore the type attribute of script elements for safe DOM manipulation 10640function disableScript( elem ) { 10641 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 10642 return elem; 10643} 10644function restoreScript( elem ) { 10645 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 10646 elem.type = elem.type.slice( 5 ); 10647 } else { 10648 elem.removeAttribute( "type" ); 10649 } 10650 10651 return elem; 10652} 10653 10654function cloneCopyEvent( src, dest ) { 10655 var i, l, type, pdataOld, udataOld, udataCur, events; 10656 10657 if ( dest.nodeType !== 1 ) { 10658 return; 10659 } 10660 10661 // 1. Copy private data: events, handlers, etc. 10662 if ( dataPriv.hasData( src ) ) { 10663 pdataOld = dataPriv.get( src ); 10664 events = pdataOld.events; 10665 10666 if ( events ) { 10667 dataPriv.remove( dest, "handle events" ); 10668 10669 for ( type in events ) { 10670 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 10671 jQuery.event.add( dest, type, events[ type ][ i ] ); 10672 } 10673 } 10674 } 10675 } 10676 10677 // 2. Copy user data 10678 if ( dataUser.hasData( src ) ) { 10679 udataOld = dataUser.access( src ); 10680 udataCur = jQuery.extend( {}, udataOld ); 10681 10682 dataUser.set( dest, udataCur ); 10683 } 10684} 10685 10686// Fix IE bugs, see support tests 10687function fixInput( src, dest ) { 10688 var nodeName = dest.nodeName.toLowerCase(); 10689 10690 // Fails to persist the checked state of a cloned checkbox or radio button. 10691 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 10692 dest.checked = src.checked; 10693 10694 // Fails to return the selected option to the default selected state when cloning options 10695 } else if ( nodeName === "input" || nodeName === "textarea" ) { 10696 dest.defaultValue = src.defaultValue; 10697 } 10698} 10699 10700function domManip( collection, args, callback, ignored ) { 10701 10702 // Flatten any nested arrays 10703 args = flat( args ); 10704 10705 var fragment, first, scripts, hasScripts, node, doc, 10706 i = 0, 10707 l = collection.length, 10708 iNoClone = l - 1, 10709 value = args[ 0 ], 10710 valueIsFunction = isFunction( value ); 10711 10712 // We can't cloneNode fragments that contain checked, in WebKit 10713 if ( valueIsFunction || 10714 ( l > 1 && typeof value === "string" && 10715 !support.checkClone && rchecked.test( value ) ) ) { 10716 return collection.each( function( index ) { 10717 var self = collection.eq( index ); 10718 if ( valueIsFunction ) { 10719 args[ 0 ] = value.call( this, index, self.html() ); 10720 } 10721 domManip( self, args, callback, ignored ); 10722 } ); 10723 } 10724 10725 if ( l ) { 10726 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 10727 first = fragment.firstChild; 10728 10729 if ( fragment.childNodes.length === 1 ) { 10730 fragment = first; 10731 } 10732 10733 // Require either new content or an interest in ignored elements to invoke the callback 10734 if ( first || ignored ) { 10735 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 10736 hasScripts = scripts.length; 10737 10738 // Use the original fragment for the last item 10739 // instead of the first because it can end up 10740 // being emptied incorrectly in certain situations (trac-8070). 10741 for ( ; i < l; i++ ) { 10742 node = fragment; 10743 10744 if ( i !== iNoClone ) { 10745 node = jQuery.clone( node, true, true ); 10746 10747 // Keep references to cloned scripts for later restoration 10748 if ( hasScripts ) { 10749 10750 // Support: Android <=4.0 only, PhantomJS 1 only 10751 // push.apply(_, arraylike) throws on ancient WebKit 10752 jQuery.merge( scripts, getAll( node, "script" ) ); 10753 } 10754 } 10755 10756 callback.call( collection[ i ], node, i ); 10757 } 10758 10759 if ( hasScripts ) { 10760 doc = scripts[ scripts.length - 1 ].ownerDocument; 10761 10762 // Reenable scripts 10763 jQuery.map( scripts, restoreScript ); 10764 10765 // Evaluate executable scripts on first document insertion 10766 for ( i = 0; i < hasScripts; i++ ) { 10767 node = scripts[ i ]; 10768 if ( rscriptType.test( node.type || "" ) && 10769 !dataPriv.access( node, "globalEval" ) && 10770 jQuery.contains( doc, node ) ) { 10771 10772 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 10773 10774 // Optional AJAX dependency, but won't run scripts if not present 10775 if ( jQuery._evalUrl && !node.noModule ) { 10776 jQuery._evalUrl( node.src, { 10777 nonce: node.nonce || node.getAttribute( "nonce" ) 10778 }, doc ); 10779 } 10780 } else { 10781 10782 // Unwrap a CDATA section containing script contents. This shouldn't be 10783 // needed as in XML documents they're already not visible when 10784 // inspecting element contents and in HTML documents they have no 10785 // meaning but we're preserving that logic for backwards compatibility. 10786 // This will be removed completely in 4.0. See gh-4904. 10787 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); 10788 } 10789 } 10790 } 10791 } 10792 } 10793 } 10794 10795 return collection; 10796} 10797 10798function remove( elem, selector, keepData ) { 10799 var node, 10800 nodes = selector ? jQuery.filter( selector, elem ) : elem, 10801 i = 0; 10802 10803 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 10804 if ( !keepData && node.nodeType === 1 ) { 10805 jQuery.cleanData( getAll( node ) ); 10806 } 10807 10808 if ( node.parentNode ) { 10809 if ( keepData && isAttached( node ) ) { 10810 setGlobalEval( getAll( node, "script" ) ); 10811 } 10812 node.parentNode.removeChild( node ); 10813 } 10814 } 10815 10816 return elem; 10817} 10818 10819jQuery.extend( { 10820 htmlPrefilter: function( html ) { 10821 return html; 10822 }, 10823 10824 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 10825 var i, l, srcElements, destElements, 10826 clone = elem.cloneNode( true ), 10827 inPage = isAttached( elem ); 10828 10829 // Fix IE cloning issues 10830 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 10831 !jQuery.isXMLDoc( elem ) ) { 10832 10833 // We eschew jQuery#find here for performance reasons: 10834 // https://jsperf.com/getall-vs-sizzle/2 10835 destElements = getAll( clone ); 10836 srcElements = getAll( elem ); 10837 10838 for ( i = 0, l = srcElements.length; i < l; i++ ) { 10839 fixInput( srcElements[ i ], destElements[ i ] ); 10840 } 10841 } 10842 10843 // Copy the events from the original to the clone 10844 if ( dataAndEvents ) { 10845 if ( deepDataAndEvents ) { 10846 srcElements = srcElements || getAll( elem ); 10847 destElements = destElements || getAll( clone ); 10848 10849 for ( i = 0, l = srcElements.length; i < l; i++ ) { 10850 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 10851 } 10852 } else { 10853 cloneCopyEvent( elem, clone ); 10854 } 10855 } 10856 10857 // Preserve script evaluation history 10858 destElements = getAll( clone, "script" ); 10859 if ( destElements.length > 0 ) { 10860 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 10861 } 10862 10863 // Return the cloned set 10864 return clone; 10865 }, 10866 10867 cleanData: function( elems ) { 10868 var data, elem, type, 10869 special = jQuery.event.special, 10870 i = 0; 10871 10872 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 10873 if ( acceptData( elem ) ) { 10874 if ( ( data = elem[ dataPriv.expando ] ) ) { 10875 if ( data.events ) { 10876 for ( type in data.events ) { 10877 if ( special[ type ] ) { 10878 jQuery.event.remove( elem, type ); 10879 10880 // This is a shortcut to avoid jQuery.event.remove's overhead 10881 } else { 10882 jQuery.removeEvent( elem, type, data.handle ); 10883 } 10884 } 10885 } 10886 10887 // Support: Chrome <=35 - 45+ 10888 // Assign undefined instead of using delete, see Data#remove 10889 elem[ dataPriv.expando ] = undefined; 10890 } 10891 if ( elem[ dataUser.expando ] ) { 10892 10893 // Support: Chrome <=35 - 45+ 10894 // Assign undefined instead of using delete, see Data#remove 10895 elem[ dataUser.expando ] = undefined; 10896 } 10897 } 10898 } 10899 } 10900} ); 10901 10902jQuery.fn.extend( { 10903 detach: function( selector ) { 10904 return remove( this, selector, true ); 10905 }, 10906 10907 remove: function( selector ) { 10908 return remove( this, selector ); 10909 }, 10910 10911 text: function( value ) { 10912 return access( this, function( value ) { 10913 return value === undefined ? 10914 jQuery.text( this ) : 10915 this.empty().each( function() { 10916 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 10917 this.textContent = value; 10918 } 10919 } ); 10920 }, null, value, arguments.length ); 10921 }, 10922 10923 append: function() { 10924 return domManip( this, arguments, function( elem ) { 10925 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 10926 var target = manipulationTarget( this, elem ); 10927 target.appendChild( elem ); 10928 } 10929 } ); 10930 }, 10931 10932 prepend: function() { 10933 return domManip( this, arguments, function( elem ) { 10934 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 10935 var target = manipulationTarget( this, elem ); 10936 target.insertBefore( elem, target.firstChild ); 10937 } 10938 } ); 10939 }, 10940 10941 before: function() { 10942 return domManip( this, arguments, function( elem ) { 10943 if ( this.parentNode ) { 10944 this.parentNode.insertBefore( elem, this ); 10945 } 10946 } ); 10947 }, 10948 10949 after: function() { 10950 return domManip( this, arguments, function( elem ) { 10951 if ( this.parentNode ) { 10952 this.parentNode.insertBefore( elem, this.nextSibling ); 10953 } 10954 } ); 10955 }, 10956 10957 empty: function() { 10958 var elem, 10959 i = 0; 10960 10961 for ( ; ( elem = this[ i ] ) != null; i++ ) { 10962 if ( elem.nodeType === 1 ) { 10963 10964 // Prevent memory leaks 10965 jQuery.cleanData( getAll( elem, false ) ); 10966 10967 // Remove any remaining nodes 10968 elem.textContent = ""; 10969 } 10970 } 10971 10972 return this; 10973 }, 10974 10975 clone: function( dataAndEvents, deepDataAndEvents ) { 10976 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 10977 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 10978 10979 return this.map( function() { 10980 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 10981 } ); 10982 }, 10983 10984 html: function( value ) { 10985 return access( this, function( value ) { 10986 var elem = this[ 0 ] || {}, 10987 i = 0, 10988 l = this.length; 10989 10990 if ( value === undefined && elem.nodeType === 1 ) { 10991 return elem.innerHTML; 10992 } 10993 10994 // See if we can take a shortcut and just use innerHTML 10995 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 10996 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 10997 10998 value = jQuery.htmlPrefilter( value ); 10999 11000 try { 11001 for ( ; i < l; i++ ) { 11002 elem = this[ i ] || {}; 11003 11004 // Remove element nodes and prevent memory leaks 11005 if ( elem.nodeType === 1 ) { 11006 jQuery.cleanData( getAll( elem, false ) ); 11007 elem.innerHTML = value; 11008 } 11009 } 11010 11011 elem = 0; 11012 11013 // If using innerHTML throws an exception, use the fallback method 11014 } catch ( e ) {} 11015 } 11016 11017 if ( elem ) { 11018 this.empty().append( value ); 11019 } 11020 }, null, value, arguments.length ); 11021 }, 11022 11023 replaceWith: function() { 11024 var ignored = []; 11025 11026 // Make the changes, replacing each non-ignored context element with the new content 11027 return domManip( this, arguments, function( elem ) { 11028 var parent = this.parentNode; 11029 11030 if ( jQuery.inArray( this, ignored ) < 0 ) { 11031 jQuery.cleanData( getAll( this ) ); 11032 if ( parent ) { 11033 parent.replaceChild( elem, this ); 11034 } 11035 } 11036 11037 // Force callback invocation 11038 }, ignored ); 11039 } 11040} ); 11041 11042jQuery.each( { 11043 appendTo: "append", 11044 prependTo: "prepend", 11045 insertBefore: "before", 11046 insertAfter: "after", 11047 replaceAll: "replaceWith" 11048}, function( name, original ) { 11049 jQuery.fn[ name ] = function( selector ) { 11050 var elems, 11051 ret = [], 11052 insert = jQuery( selector ), 11053 last = insert.length - 1, 11054 i = 0; 11055 11056 for ( ; i <= last; i++ ) { 11057 elems = i === last ? this : this.clone( true ); 11058 jQuery( insert[ i ] )[ original ]( elems ); 11059 11060 // Support: Android <=4.0 only, PhantomJS 1 only 11061 // .get() because push.apply(_, arraylike) throws on ancient WebKit 11062 push.apply( ret, elems.get() ); 11063 } 11064 11065 return this.pushStack( ret ); 11066 }; 11067} ); 11068var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 11069 11070var rcustomProp = /^--/; 11071 11072 11073var getStyles = function( elem ) { 11074 11075 // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150) 11076 // IE throws on elements created in popups 11077 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 11078 var view = elem.ownerDocument.defaultView; 11079 11080 if ( !view || !view.opener ) { 11081 view = window; 11082 } 11083 11084 return view.getComputedStyle( elem ); 11085 }; 11086 11087var swap = function( elem, options, callback ) { 11088 var ret, name, 11089 old = {}; 11090 11091 // Remember the old values, and insert the new ones 11092 for ( name in options ) { 11093 old[ name ] = elem.style[ name ]; 11094 elem.style[ name ] = options[ name ]; 11095 } 11096 11097 ret = callback.call( elem ); 11098 11099 // Revert the old values 11100 for ( name in options ) { 11101 elem.style[ name ] = old[ name ]; 11102 } 11103 11104 return ret; 11105}; 11106 11107 11108var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 11109 11110 11111 11112( function() { 11113 11114 // Executing both pixelPosition & boxSizingReliable tests require only one layout 11115 // so they're executed at the same time to save the second computation. 11116 function computeStyleTests() { 11117 11118 // This is a singleton, we need to execute it only once 11119 if ( !div ) { 11120 return; 11121 } 11122 11123 container.style.cssText = "position:absolute;left:-11111px;width:60px;" + 11124 "margin-top:1px;padding:0;border:0"; 11125 div.style.cssText = 11126 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 11127 "margin:auto;border:1px;padding:1px;" + 11128 "width:60%;top:1%"; 11129 documentElement.appendChild( container ).appendChild( div ); 11130 11131 var divStyle = window.getComputedStyle( div ); 11132 pixelPositionVal = divStyle.top !== "1%"; 11133 11134 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 11135 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 11136 11137 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 11138 // Some styles come back with percentage values, even though they shouldn't 11139 div.style.right = "60%"; 11140 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 11141 11142 // Support: IE 9 - 11 only 11143 // Detect misreporting of content dimensions for box-sizing:border-box elements 11144 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 11145 11146 // Support: IE 9 only 11147 // Detect overflow:scroll screwiness (gh-3699) 11148 // Support: Chrome <=64 11149 // Don't get tricked when zoom affects offsetWidth (gh-4029) 11150 div.style.position = "absolute"; 11151 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; 11152 11153 documentElement.removeChild( container ); 11154 11155 // Nullify the div so it wouldn't be stored in the memory and 11156 // it will also be a sign that checks already performed 11157 div = null; 11158 } 11159 11160 function roundPixelMeasures( measure ) { 11161 return Math.round( parseFloat( measure ) ); 11162 } 11163 11164 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 11165 reliableTrDimensionsVal, reliableMarginLeftVal, 11166 container = document.createElement( "div" ), 11167 div = document.createElement( "div" ); 11168 11169 // Finish early in limited (non-browser) environments 11170 if ( !div.style ) { 11171 return; 11172 } 11173 11174 // Support: IE <=9 - 11 only 11175 // Style of cloned element affects source element cloned (trac-8908) 11176 div.style.backgroundClip = "content-box"; 11177 div.cloneNode( true ).style.backgroundClip = ""; 11178 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 11179 11180 jQuery.extend( support, { 11181 boxSizingReliable: function() { 11182 computeStyleTests(); 11183 return boxSizingReliableVal; 11184 }, 11185 pixelBoxStyles: function() { 11186 computeStyleTests(); 11187 return pixelBoxStylesVal; 11188 }, 11189 pixelPosition: function() { 11190 computeStyleTests(); 11191 return pixelPositionVal; 11192 }, 11193 reliableMarginLeft: function() { 11194 computeStyleTests(); 11195 return reliableMarginLeftVal; 11196 }, 11197 scrollboxSize: function() { 11198 computeStyleTests(); 11199 return scrollboxSizeVal; 11200 }, 11201 11202 // Support: IE 9 - 11+, Edge 15 - 18+ 11203 // IE/Edge misreport `getComputedStyle` of table rows with width/height 11204 // set in CSS while `offset*` properties report correct values. 11205 // Behavior in IE 9 is more subtle than in newer versions & it passes 11206 // some versions of this test; make sure not to make it pass there! 11207 // 11208 // Support: Firefox 70+ 11209 // Only Firefox includes border widths 11210 // in computed dimensions. (gh-4529) 11211 reliableTrDimensions: function() { 11212 var table, tr, trChild, trStyle; 11213 if ( reliableTrDimensionsVal == null ) { 11214 table = document.createElement( "table" ); 11215 tr = document.createElement( "tr" ); 11216 trChild = document.createElement( "div" ); 11217 11218 table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; 11219 tr.style.cssText = "border:1px solid"; 11220 11221 // Support: Chrome 86+ 11222 // Height set through cssText does not get applied. 11223 // Computed height then comes back as 0. 11224 tr.style.height = "1px"; 11225 trChild.style.height = "9px"; 11226 11227 // Support: Android 8 Chrome 86+ 11228 // In our bodyBackground.html iframe, 11229 // display for all div elements is set to "inline", 11230 // which causes a problem only in Android 8 Chrome 86. 11231 // Ensuring the div is display: block 11232 // gets around this issue. 11233 trChild.style.display = "block"; 11234 11235 documentElement 11236 .appendChild( table ) 11237 .appendChild( tr ) 11238 .appendChild( trChild ); 11239 11240 trStyle = window.getComputedStyle( tr ); 11241 reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + 11242 parseInt( trStyle.borderTopWidth, 10 ) + 11243 parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; 11244 11245 documentElement.removeChild( table ); 11246 } 11247 return reliableTrDimensionsVal; 11248 } 11249 } ); 11250} )(); 11251 11252 11253function curCSS( elem, name, computed ) { 11254 var width, minWidth, maxWidth, ret, 11255 isCustomProp = rcustomProp.test( name ), 11256 11257 // Support: Firefox 51+ 11258 // Retrieving style before computed somehow 11259 // fixes an issue with getting wrong values 11260 // on detached elements 11261 style = elem.style; 11262 11263 computed = computed || getStyles( elem ); 11264 11265 // getPropertyValue is needed for: 11266 // .css('filter') (IE 9 only, trac-12537) 11267 // .css('--customProperty) (gh-3144) 11268 if ( computed ) { 11269 11270 // Support: IE <=9 - 11+ 11271 // IE only supports `"float"` in `getPropertyValue`; in computed styles 11272 // it's only available as `"cssFloat"`. We no longer modify properties 11273 // sent to `.css()` apart from camelCasing, so we need to check both. 11274 // Normally, this would create difference in behavior: if 11275 // `getPropertyValue` returns an empty string, the value returned 11276 // by `.css()` would be `undefined`. This is usually the case for 11277 // disconnected elements. However, in IE even disconnected elements 11278 // with no styles return `"none"` for `getPropertyValue( "float" )` 11279 ret = computed.getPropertyValue( name ) || computed[ name ]; 11280 11281 if ( isCustomProp && ret ) { 11282 11283 // Support: Firefox 105+, Chrome <=105+ 11284 // Spec requires trimming whitespace for custom properties (gh-4926). 11285 // Firefox only trims leading whitespace. Chrome just collapses 11286 // both leading & trailing whitespace to a single space. 11287 // 11288 // Fall back to `undefined` if empty string returned. 11289 // This collapses a missing definition with property defined 11290 // and set to an empty string but there's no standard API 11291 // allowing us to differentiate them without a performance penalty 11292 // and returning `undefined` aligns with older jQuery. 11293 // 11294 // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED 11295 // as whitespace while CSS does not, but this is not a problem 11296 // because CSS preprocessing replaces them with U+000A LINE FEED 11297 // (which *is* CSS whitespace) 11298 // https://www.w3.org/TR/css-syntax-3/#input-preprocessing 11299 ret = ret.replace( rtrimCSS, "$1" ) || undefined; 11300 } 11301 11302 if ( ret === "" && !isAttached( elem ) ) { 11303 ret = jQuery.style( elem, name ); 11304 } 11305 11306 // A tribute to the "awesome hack by Dean Edwards" 11307 // Android Browser returns percentage for some values, 11308 // but width seems to be reliably pixels. 11309 // This is against the CSSOM draft spec: 11310 // https://drafts.csswg.org/cssom/#resolved-values 11311 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 11312 11313 // Remember the original values 11314 width = style.width; 11315 minWidth = style.minWidth; 11316 maxWidth = style.maxWidth; 11317 11318 // Put in the new values to get a computed value out 11319 style.minWidth = style.maxWidth = style.width = ret; 11320 ret = computed.width; 11321 11322 // Revert the changed values 11323 style.width = width; 11324 style.minWidth = minWidth; 11325 style.maxWidth = maxWidth; 11326 } 11327 } 11328 11329 return ret !== undefined ? 11330 11331 // Support: IE <=9 - 11 only 11332 // IE returns zIndex value as an integer. 11333 ret + "" : 11334 ret; 11335} 11336 11337 11338function addGetHookIf( conditionFn, hookFn ) { 11339 11340 // Define the hook, we'll check on the first run if it's really needed. 11341 return { 11342 get: function() { 11343 if ( conditionFn() ) { 11344 11345 // Hook not needed (or it's not possible to use it due 11346 // to missing dependency), remove it. 11347 delete this.get; 11348 return; 11349 } 11350 11351 // Hook needed; redefine it so that the support test is not executed again. 11352 return ( this.get = hookFn ).apply( this, arguments ); 11353 } 11354 }; 11355} 11356 11357 11358var cssPrefixes = [ "Webkit", "Moz", "ms" ], 11359 emptyStyle = document.createElement( "div" ).style, 11360 vendorProps = {}; 11361 11362// Return a vendor-prefixed property or undefined 11363function vendorPropName( name ) { 11364 11365 // Check for vendor prefixed names 11366 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 11367 i = cssPrefixes.length; 11368 11369 while ( i-- ) { 11370 name = cssPrefixes[ i ] + capName; 11371 if ( name in emptyStyle ) { 11372 return name; 11373 } 11374 } 11375} 11376 11377// Return a potentially-mapped jQuery.cssProps or vendor prefixed property 11378function finalPropName( name ) { 11379 var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 11380 11381 if ( final ) { 11382 return final; 11383 } 11384 if ( name in emptyStyle ) { 11385 return name; 11386 } 11387 return vendorProps[ name ] = vendorPropName( name ) || name; 11388} 11389 11390 11391var 11392 11393 // Swappable if display is none or starts with table 11394 // except "table", "table-cell", or "table-caption" 11395 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 11396 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 11397 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 11398 cssNormalTransform = { 11399 letterSpacing: "0", 11400 fontWeight: "400" 11401 }; 11402 11403function setPositiveNumber( _elem, value, subtract ) { 11404 11405 // Any relative (+/-) values have already been 11406 // normalized at this point 11407 var matches = rcssNum.exec( value ); 11408 return matches ? 11409 11410 // Guard against undefined "subtract", e.g., when used as in cssHooks 11411 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 11412 value; 11413} 11414 11415function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 11416 var i = dimension === "width" ? 1 : 0, 11417 extra = 0, 11418 delta = 0, 11419 marginDelta = 0; 11420 11421 // Adjustment may not be necessary 11422 if ( box === ( isBorderBox ? "border" : "content" ) ) { 11423 return 0; 11424 } 11425 11426 for ( ; i < 4; i += 2 ) { 11427 11428 // Both box models exclude margin 11429 // Count margin delta separately to only add it after scroll gutter adjustment. 11430 // This is needed to make negative margins work with `outerHeight( true )` (gh-3982). 11431 if ( box === "margin" ) { 11432 marginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 11433 } 11434 11435 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 11436 if ( !isBorderBox ) { 11437 11438 // Add padding 11439 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 11440 11441 // For "border" or "margin", add border 11442 if ( box !== "padding" ) { 11443 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 11444 11445 // But still keep track of it otherwise 11446 } else { 11447 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 11448 } 11449 11450 // If we get here with a border-box (content + padding + border), we're seeking "content" or 11451 // "padding" or "margin" 11452 } else { 11453 11454 // For "content", subtract padding 11455 if ( box === "content" ) { 11456 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 11457 } 11458 11459 // For "content" or "padding", subtract border 11460 if ( box !== "margin" ) { 11461 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 11462 } 11463 } 11464 } 11465 11466 // Account for positive content-box scroll gutter when requested by providing computedVal 11467 if ( !isBorderBox && computedVal >= 0 ) { 11468 11469 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 11470 // Assuming integer scroll gutter, subtract the rest and round down 11471 delta += Math.max( 0, Math.ceil( 11472 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 11473 computedVal - 11474 delta - 11475 extra - 11476 0.5 11477 11478 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 11479 // Use an explicit zero to avoid NaN (gh-3964) 11480 ) ) || 0; 11481 } 11482 11483 return delta + marginDelta; 11484} 11485 11486function getWidthOrHeight( elem, dimension, extra ) { 11487 11488 // Start with computed style 11489 var styles = getStyles( elem ), 11490 11491 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 11492 // Fake content-box until we know it's needed to know the true value. 11493 boxSizingNeeded = !support.boxSizingReliable() || extra, 11494 isBorderBox = boxSizingNeeded && 11495 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 11496 valueIsBorderBox = isBorderBox, 11497 11498 val = curCSS( elem, dimension, styles ), 11499 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); 11500 11501 // Support: Firefox <=54 11502 // Return a confounding non-pixel value or feign ignorance, as appropriate. 11503 if ( rnumnonpx.test( val ) ) { 11504 if ( !extra ) { 11505 return val; 11506 } 11507 val = "auto"; 11508 } 11509 11510 11511 // Support: IE 9 - 11 only 11512 // Use offsetWidth/offsetHeight for when box sizing is unreliable. 11513 // In those cases, the computed value can be trusted to be border-box. 11514 if ( ( !support.boxSizingReliable() && isBorderBox || 11515 11516 // Support: IE 10 - 11+, Edge 15 - 18+ 11517 // IE/Edge misreport `getComputedStyle` of table rows with width/height 11518 // set in CSS while `offset*` properties report correct values. 11519 // Interestingly, in some cases IE 9 doesn't suffer from this issue. 11520 !support.reliableTrDimensions() && nodeName( elem, "tr" ) || 11521 11522 // Fall back to offsetWidth/offsetHeight when value is "auto" 11523 // This happens for inline elements with no explicit setting (gh-3571) 11524 val === "auto" || 11525 11526 // Support: Android <=4.1 - 4.3 only 11527 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 11528 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && 11529 11530 // Make sure the element is visible & connected 11531 elem.getClientRects().length ) { 11532 11533 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 11534 11535 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 11536 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 11537 // retrieved value as a content box dimension. 11538 valueIsBorderBox = offsetProp in elem; 11539 if ( valueIsBorderBox ) { 11540 val = elem[ offsetProp ]; 11541 } 11542 } 11543 11544 // Normalize "" and auto 11545 val = parseFloat( val ) || 0; 11546 11547 // Adjust for the element's box model 11548 return ( val + 11549 boxModelAdjustment( 11550 elem, 11551 dimension, 11552 extra || ( isBorderBox ? "border" : "content" ), 11553 valueIsBorderBox, 11554 styles, 11555 11556 // Provide the current computed size to request scroll gutter calculation (gh-3589) 11557 val 11558 ) 11559 ) + "px"; 11560} 11561 11562jQuery.extend( { 11563 11564 // Add in style property hooks for overriding the default 11565 // behavior of getting and setting a style property 11566 cssHooks: { 11567 opacity: { 11568 get: function( elem, computed ) { 11569 if ( computed ) { 11570 11571 // We should always get a number back from opacity 11572 var ret = curCSS( elem, "opacity" ); 11573 return ret === "" ? "1" : ret; 11574 } 11575 } 11576 } 11577 }, 11578 11579 // Don't automatically add "px" to these possibly-unitless properties 11580 cssNumber: { 11581 animationIterationCount: true, 11582 aspectRatio: true, 11583 borderImageSlice: true, 11584 columnCount: true, 11585 flexGrow: true, 11586 flexShrink: true, 11587 fontWeight: true, 11588 gridArea: true, 11589 gridColumn: true, 11590 gridColumnEnd: true, 11591 gridColumnStart: true, 11592 gridRow: true, 11593 gridRowEnd: true, 11594 gridRowStart: true, 11595 lineHeight: true, 11596 opacity: true, 11597 order: true, 11598 orphans: true, 11599 scale: true, 11600 widows: true, 11601 zIndex: true, 11602 zoom: true, 11603 11604 // SVG-related 11605 fillOpacity: true, 11606 floodOpacity: true, 11607 stopOpacity: true, 11608 strokeMiterlimit: true, 11609 strokeOpacity: true 11610 }, 11611 11612 // Add in properties whose names you wish to fix before 11613 // setting or getting the value 11614 cssProps: {}, 11615 11616 // Get and set the style property on a DOM Node 11617 style: function( elem, name, value, extra ) { 11618 11619 // Don't set styles on text and comment nodes 11620 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 11621 return; 11622 } 11623 11624 // Make sure that we're working with the right name 11625 var ret, type, hooks, 11626 origName = camelCase( name ), 11627 isCustomProp = rcustomProp.test( name ), 11628 style = elem.style; 11629 11630 // Make sure that we're working with the right name. We don't 11631 // want to query the value if it is a CSS custom property 11632 // since they are user-defined. 11633 if ( !isCustomProp ) { 11634 name = finalPropName( origName ); 11635 } 11636 11637 // Gets hook for the prefixed version, then unprefixed version 11638 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 11639 11640 // Check if we're setting a value 11641 if ( value !== undefined ) { 11642 type = typeof value; 11643 11644 // Convert "+=" or "-=" to relative numbers (trac-7345) 11645 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 11646 value = adjustCSS( elem, name, ret ); 11647 11648 // Fixes bug trac-9237 11649 type = "number"; 11650 } 11651 11652 // Make sure that null and NaN values aren't set (trac-7116) 11653 if ( value == null || value !== value ) { 11654 return; 11655 } 11656 11657 // If a number was passed in, add the unit (except for certain CSS properties) 11658 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 11659 // "px" to a few hardcoded values. 11660 if ( type === "number" && !isCustomProp ) { 11661 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 11662 } 11663 11664 // background-* props affect original clone's values 11665 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 11666 style[ name ] = "inherit"; 11667 } 11668 11669 // If a hook was provided, use that value, otherwise just set the specified value 11670 if ( !hooks || !( "set" in hooks ) || 11671 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 11672 11673 if ( isCustomProp ) { 11674 style.setProperty( name, value ); 11675 } else { 11676 style[ name ] = value; 11677 } 11678 } 11679 11680 } else { 11681 11682 // If a hook was provided get the non-computed value from there 11683 if ( hooks && "get" in hooks && 11684 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 11685 11686 return ret; 11687 } 11688 11689 // Otherwise just get the value from the style object 11690 return style[ name ]; 11691 } 11692 }, 11693 11694 css: function( elem, name, extra, styles ) { 11695 var val, num, hooks, 11696 origName = camelCase( name ), 11697 isCustomProp = rcustomProp.test( name ); 11698 11699 // Make sure that we're working with the right name. We don't 11700 // want to modify the value if it is a CSS custom property 11701 // since they are user-defined. 11702 if ( !isCustomProp ) { 11703 name = finalPropName( origName ); 11704 } 11705 11706 // Try prefixed name followed by the unprefixed name 11707 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 11708 11709 // If a hook was provided get the computed value from there 11710 if ( hooks && "get" in hooks ) { 11711 val = hooks.get( elem, true, extra ); 11712 } 11713 11714 // Otherwise, if a way to get the computed value exists, use that 11715 if ( val === undefined ) { 11716 val = curCSS( elem, name, styles ); 11717 } 11718 11719 // Convert "normal" to computed value 11720 if ( val === "normal" && name in cssNormalTransform ) { 11721 val = cssNormalTransform[ name ]; 11722 } 11723 11724 // Make numeric if forced or a qualifier was provided and val looks numeric 11725 if ( extra === "" || extra ) { 11726 num = parseFloat( val ); 11727 return extra === true || isFinite( num ) ? num || 0 : val; 11728 } 11729 11730 return val; 11731 } 11732} ); 11733 11734jQuery.each( [ "height", "width" ], function( _i, dimension ) { 11735 jQuery.cssHooks[ dimension ] = { 11736 get: function( elem, computed, extra ) { 11737 if ( computed ) { 11738 11739 // Certain elements can have dimension info if we invisibly show them 11740 // but it must have a current display style that would benefit 11741 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 11742 11743 // Support: Safari 8+ 11744 // Table columns in Safari have non-zero offsetWidth & zero 11745 // getBoundingClientRect().width unless display is changed. 11746 // Support: IE <=11 only 11747 // Running getBoundingClientRect on a disconnected node 11748 // in IE throws an error. 11749 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 11750 swap( elem, cssShow, function() { 11751 return getWidthOrHeight( elem, dimension, extra ); 11752 } ) : 11753 getWidthOrHeight( elem, dimension, extra ); 11754 } 11755 }, 11756 11757 set: function( elem, value, extra ) { 11758 var matches, 11759 styles = getStyles( elem ), 11760 11761 // Only read styles.position if the test has a chance to fail 11762 // to avoid forcing a reflow. 11763 scrollboxSizeBuggy = !support.scrollboxSize() && 11764 styles.position === "absolute", 11765 11766 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 11767 boxSizingNeeded = scrollboxSizeBuggy || extra, 11768 isBorderBox = boxSizingNeeded && 11769 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 11770 subtract = extra ? 11771 boxModelAdjustment( 11772 elem, 11773 dimension, 11774 extra, 11775 isBorderBox, 11776 styles 11777 ) : 11778 0; 11779 11780 // Account for unreliable border-box dimensions by comparing offset* to computed and 11781 // faking a content-box to get border and padding (gh-3699) 11782 if ( isBorderBox && scrollboxSizeBuggy ) { 11783 subtract -= Math.ceil( 11784 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 11785 parseFloat( styles[ dimension ] ) - 11786 boxModelAdjustment( elem, dimension, "border", false, styles ) - 11787 0.5 11788 ); 11789 } 11790 11791 // Convert to pixels if value adjustment is needed 11792 if ( subtract && ( matches = rcssNum.exec( value ) ) && 11793 ( matches[ 3 ] || "px" ) !== "px" ) { 11794 11795 elem.style[ dimension ] = value; 11796 value = jQuery.css( elem, dimension ); 11797 } 11798 11799 return setPositiveNumber( elem, value, subtract ); 11800 } 11801 }; 11802} ); 11803 11804jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 11805 function( elem, computed ) { 11806 if ( computed ) { 11807 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 11808 elem.getBoundingClientRect().left - 11809 swap( elem, { marginLeft: 0 }, function() { 11810 return elem.getBoundingClientRect().left; 11811 } ) 11812 ) + "px"; 11813 } 11814 } 11815); 11816 11817// These hooks are used by animate to expand properties 11818jQuery.each( { 11819 margin: "", 11820 padding: "", 11821 border: "Width" 11822}, function( prefix, suffix ) { 11823 jQuery.cssHooks[ prefix + suffix ] = { 11824 expand: function( value ) { 11825 var i = 0, 11826 expanded = {}, 11827 11828 // Assumes a single number if not a string 11829 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 11830 11831 for ( ; i < 4; i++ ) { 11832 expanded[ prefix + cssExpand[ i ] + suffix ] = 11833 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 11834 } 11835 11836 return expanded; 11837 } 11838 }; 11839 11840 if ( prefix !== "margin" ) { 11841 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 11842 } 11843} ); 11844 11845jQuery.fn.extend( { 11846 css: function( name, value ) { 11847 return access( this, function( elem, name, value ) { 11848 var styles, len, 11849 map = {}, 11850 i = 0; 11851 11852 if ( Array.isArray( name ) ) { 11853 styles = getStyles( elem ); 11854 len = name.length; 11855 11856 for ( ; i < len; i++ ) { 11857 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 11858 } 11859 11860 return map; 11861 } 11862 11863 return value !== undefined ? 11864 jQuery.style( elem, name, value ) : 11865 jQuery.css( elem, name ); 11866 }, name, value, arguments.length > 1 ); 11867 } 11868} ); 11869 11870 11871function Tween( elem, options, prop, end, easing ) { 11872 return new Tween.prototype.init( elem, options, prop, end, easing ); 11873} 11874jQuery.Tween = Tween; 11875 11876Tween.prototype = { 11877 constructor: Tween, 11878 init: function( elem, options, prop, end, easing, unit ) { 11879 this.elem = elem; 11880 this.prop = prop; 11881 this.easing = easing || jQuery.easing._default; 11882 this.options = options; 11883 this.start = this.now = this.cur(); 11884 this.end = end; 11885 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 11886 }, 11887 cur: function() { 11888 var hooks = Tween.propHooks[ this.prop ]; 11889 11890 return hooks && hooks.get ? 11891 hooks.get( this ) : 11892 Tween.propHooks._default.get( this ); 11893 }, 11894 run: function( percent ) { 11895 var eased, 11896 hooks = Tween.propHooks[ this.prop ]; 11897 11898 if ( this.options.duration ) { 11899 this.pos = eased = jQuery.easing[ this.easing ]( 11900 percent, this.options.duration * percent, 0, 1, this.options.duration 11901 ); 11902 } else { 11903 this.pos = eased = percent; 11904 } 11905 this.now = ( this.end - this.start ) * eased + this.start; 11906 11907 if ( this.options.step ) { 11908 this.options.step.call( this.elem, this.now, this ); 11909 } 11910 11911 if ( hooks && hooks.set ) { 11912 hooks.set( this ); 11913 } else { 11914 Tween.propHooks._default.set( this ); 11915 } 11916 return this; 11917 } 11918}; 11919 11920Tween.prototype.init.prototype = Tween.prototype; 11921 11922Tween.propHooks = { 11923 _default: { 11924 get: function( tween ) { 11925 var result; 11926 11927 // Use a property on the element directly when it is not a DOM element, 11928 // or when there is no matching style property that exists. 11929 if ( tween.elem.nodeType !== 1 || 11930 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 11931 return tween.elem[ tween.prop ]; 11932 } 11933 11934 // Passing an empty string as a 3rd parameter to .css will automatically 11935 // attempt a parseFloat and fallback to a string if the parse fails. 11936 // Simple values such as "10px" are parsed to Float; 11937 // complex values such as "rotate(1rad)" are returned as-is. 11938 result = jQuery.css( tween.elem, tween.prop, "" ); 11939 11940 // Empty strings, null, undefined and "auto" are converted to 0. 11941 return !result || result === "auto" ? 0 : result; 11942 }, 11943 set: function( tween ) { 11944 11945 // Use step hook for back compat. 11946 // Use cssHook if its there. 11947 // Use .style if available and use plain properties where available. 11948 if ( jQuery.fx.step[ tween.prop ] ) { 11949 jQuery.fx.step[ tween.prop ]( tween ); 11950 } else if ( tween.elem.nodeType === 1 && ( 11951 jQuery.cssHooks[ tween.prop ] || 11952 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { 11953 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 11954 } else { 11955 tween.elem[ tween.prop ] = tween.now; 11956 } 11957 } 11958 } 11959}; 11960 11961// Support: IE <=9 only 11962// Panic based approach to setting things on disconnected nodes 11963Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 11964 set: function( tween ) { 11965 if ( tween.elem.nodeType && tween.elem.parentNode ) { 11966 tween.elem[ tween.prop ] = tween.now; 11967 } 11968 } 11969}; 11970 11971jQuery.easing = { 11972 linear: function( p ) { 11973 return p; 11974 }, 11975 swing: function( p ) { 11976 return 0.5 - Math.cos( p * Math.PI ) / 2; 11977 }, 11978 _default: "swing" 11979}; 11980 11981jQuery.fx = Tween.prototype.init; 11982 11983// Back compat <1.8 extension point 11984jQuery.fx.step = {}; 11985 11986 11987 11988 11989var 11990 fxNow, inProgress, 11991 rfxtypes = /^(?:toggle|show|hide)$/, 11992 rrun = /queueHooks$/; 11993 11994function schedule() { 11995 if ( inProgress ) { 11996 if ( document.hidden === false && window.requestAnimationFrame ) { 11997 window.requestAnimationFrame( schedule ); 11998 } else { 11999 window.setTimeout( schedule, jQuery.fx.interval ); 12000 } 12001 12002 jQuery.fx.tick(); 12003 } 12004} 12005 12006// Animations created synchronously will run synchronously 12007function createFxNow() { 12008 window.setTimeout( function() { 12009 fxNow = undefined; 12010 } ); 12011 return ( fxNow = Date.now() ); 12012} 12013 12014// Generate parameters to create a standard animation 12015function genFx( type, includeWidth ) { 12016 var which, 12017 i = 0, 12018 attrs = { height: type }; 12019 12020 // If we include width, step value is 1 to do all cssExpand values, 12021 // otherwise step value is 2 to skip over Left and Right 12022 includeWidth = includeWidth ? 1 : 0; 12023 for ( ; i < 4; i += 2 - includeWidth ) { 12024 which = cssExpand[ i ]; 12025 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 12026 } 12027 12028 if ( includeWidth ) { 12029 attrs.opacity = attrs.width = type; 12030 } 12031 12032 return attrs; 12033} 12034 12035function createTween( value, prop, animation ) { 12036 var tween, 12037 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 12038 index = 0, 12039 length = collection.length; 12040 for ( ; index < length; index++ ) { 12041 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 12042 12043 // We're done with this property 12044 return tween; 12045 } 12046 } 12047} 12048 12049function defaultPrefilter( elem, props, opts ) { 12050 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 12051 isBox = "width" in props || "height" in props, 12052 anim = this, 12053 orig = {}, 12054 style = elem.style, 12055 hidden = elem.nodeType && isHiddenWithinTree( elem ), 12056 dataShow = dataPriv.get( elem, "fxshow" ); 12057 12058 // Queue-skipping animations hijack the fx hooks 12059 if ( !opts.queue ) { 12060 hooks = jQuery._queueHooks( elem, "fx" ); 12061 if ( hooks.unqueued == null ) { 12062 hooks.unqueued = 0; 12063 oldfire = hooks.empty.fire; 12064 hooks.empty.fire = function() { 12065 if ( !hooks.unqueued ) { 12066 oldfire(); 12067 } 12068 }; 12069 } 12070 hooks.unqueued++; 12071 12072 anim.always( function() { 12073 12074 // Ensure the complete handler is called before this completes 12075 anim.always( function() { 12076 hooks.unqueued--; 12077 if ( !jQuery.queue( elem, "fx" ).length ) { 12078 hooks.empty.fire(); 12079 } 12080 } ); 12081 } ); 12082 } 12083 12084 // Detect show/hide animations 12085 for ( prop in props ) { 12086 value = props[ prop ]; 12087 if ( rfxtypes.test( value ) ) { 12088 delete props[ prop ]; 12089 toggle = toggle || value === "toggle"; 12090 if ( value === ( hidden ? "hide" : "show" ) ) { 12091 12092 // Pretend to be hidden if this is a "show" and 12093 // there is still data from a stopped show/hide 12094 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 12095 hidden = true; 12096 12097 // Ignore all other no-op show/hide data 12098 } else { 12099 continue; 12100 } 12101 } 12102 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 12103 } 12104 } 12105 12106 // Bail out if this is a no-op like .hide().hide() 12107 propTween = !jQuery.isEmptyObject( props ); 12108 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 12109 return; 12110 } 12111 12112 // Restrict "overflow" and "display" styles during box animations 12113 if ( isBox && elem.nodeType === 1 ) { 12114 12115 // Support: IE <=9 - 11, Edge 12 - 15 12116 // Record all 3 overflow attributes because IE does not infer the shorthand 12117 // from identically-valued overflowX and overflowY and Edge just mirrors 12118 // the overflowX value there. 12119 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 12120 12121 // Identify a display type, preferring old show/hide data over the CSS cascade 12122 restoreDisplay = dataShow && dataShow.display; 12123 if ( restoreDisplay == null ) { 12124 restoreDisplay = dataPriv.get( elem, "display" ); 12125 } 12126 display = jQuery.css( elem, "display" ); 12127 if ( display === "none" ) { 12128 if ( restoreDisplay ) { 12129 display = restoreDisplay; 12130 } else { 12131 12132 // Get nonempty value(s) by temporarily forcing visibility 12133 showHide( [ elem ], true ); 12134 restoreDisplay = elem.style.display || restoreDisplay; 12135 display = jQuery.css( elem, "display" ); 12136 showHide( [ elem ] ); 12137 } 12138 } 12139 12140 // Animate inline elements as inline-block 12141 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 12142 if ( jQuery.css( elem, "float" ) === "none" ) { 12143 12144 // Restore the original display value at the end of pure show/hide animations 12145 if ( !propTween ) { 12146 anim.done( function() { 12147 style.display = restoreDisplay; 12148 } ); 12149 if ( restoreDisplay == null ) { 12150 display = style.display; 12151 restoreDisplay = display === "none" ? "" : display; 12152 } 12153 } 12154 style.display = "inline-block"; 12155 } 12156 } 12157 } 12158 12159 if ( opts.overflow ) { 12160 style.overflow = "hidden"; 12161 anim.always( function() { 12162 style.overflow = opts.overflow[ 0 ]; 12163 style.overflowX = opts.overflow[ 1 ]; 12164 style.overflowY = opts.overflow[ 2 ]; 12165 } ); 12166 } 12167 12168 // Implement show/hide animations 12169 propTween = false; 12170 for ( prop in orig ) { 12171 12172 // General show/hide setup for this element animation 12173 if ( !propTween ) { 12174 if ( dataShow ) { 12175 if ( "hidden" in dataShow ) { 12176 hidden = dataShow.hidden; 12177 } 12178 } else { 12179 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 12180 } 12181 12182 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 12183 if ( toggle ) { 12184 dataShow.hidden = !hidden; 12185 } 12186 12187 // Show elements before animating them 12188 if ( hidden ) { 12189 showHide( [ elem ], true ); 12190 } 12191 12192 /* eslint-disable no-loop-func */ 12193 12194 anim.done( function() { 12195 12196 /* eslint-enable no-loop-func */ 12197 12198 // The final step of a "hide" animation is actually hiding the element 12199 if ( !hidden ) { 12200 showHide( [ elem ] ); 12201 } 12202 dataPriv.remove( elem, "fxshow" ); 12203 for ( prop in orig ) { 12204 jQuery.style( elem, prop, orig[ prop ] ); 12205 } 12206 } ); 12207 } 12208 12209 // Per-property setup 12210 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 12211 if ( !( prop in dataShow ) ) { 12212 dataShow[ prop ] = propTween.start; 12213 if ( hidden ) { 12214 propTween.end = propTween.start; 12215 propTween.start = 0; 12216 } 12217 } 12218 } 12219} 12220 12221function propFilter( props, specialEasing ) { 12222 var index, name, easing, value, hooks; 12223 12224 // camelCase, specialEasing and expand cssHook pass 12225 for ( index in props ) { 12226 name = camelCase( index ); 12227 easing = specialEasing[ name ]; 12228 value = props[ index ]; 12229 if ( Array.isArray( value ) ) { 12230 easing = value[ 1 ]; 12231 value = props[ index ] = value[ 0 ]; 12232 } 12233 12234 if ( index !== name ) { 12235 props[ name ] = value; 12236 delete props[ index ]; 12237 } 12238 12239 hooks = jQuery.cssHooks[ name ]; 12240 if ( hooks && "expand" in hooks ) { 12241 value = hooks.expand( value ); 12242 delete props[ name ]; 12243 12244 // Not quite $.extend, this won't overwrite existing keys. 12245 // Reusing 'index' because we have the correct "name" 12246 for ( index in value ) { 12247 if ( !( index in props ) ) { 12248 props[ index ] = value[ index ]; 12249 specialEasing[ index ] = easing; 12250 } 12251 } 12252 } else { 12253 specialEasing[ name ] = easing; 12254 } 12255 } 12256} 12257 12258function Animation( elem, properties, options ) { 12259 var result, 12260 stopped, 12261 index = 0, 12262 length = Animation.prefilters.length, 12263 deferred = jQuery.Deferred().always( function() { 12264 12265 // Don't match elem in the :animated selector 12266 delete tick.elem; 12267 } ), 12268 tick = function() { 12269 if ( stopped ) { 12270 return false; 12271 } 12272 var currentTime = fxNow || createFxNow(), 12273 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 12274 12275 // Support: Android 2.3 only 12276 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497) 12277 temp = remaining / animation.duration || 0, 12278 percent = 1 - temp, 12279 index = 0, 12280 length = animation.tweens.length; 12281 12282 for ( ; index < length; index++ ) { 12283 animation.tweens[ index ].run( percent ); 12284 } 12285 12286 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 12287 12288 // If there's more to do, yield 12289 if ( percent < 1 && length ) { 12290 return remaining; 12291 } 12292 12293 // If this was an empty animation, synthesize a final progress notification 12294 if ( !length ) { 12295 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 12296 } 12297 12298 // Resolve the animation and report its conclusion 12299 deferred.resolveWith( elem, [ animation ] ); 12300 return false; 12301 }, 12302 animation = deferred.promise( { 12303 elem: elem, 12304 props: jQuery.extend( {}, properties ), 12305 opts: jQuery.extend( true, { 12306 specialEasing: {}, 12307 easing: jQuery.easing._default 12308 }, options ), 12309 originalProperties: properties, 12310 originalOptions: options, 12311 startTime: fxNow || createFxNow(), 12312 duration: options.duration, 12313 tweens: [], 12314 createTween: function( prop, end ) { 12315 var tween = jQuery.Tween( elem, animation.opts, prop, end, 12316 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 12317 animation.tweens.push( tween ); 12318 return tween; 12319 }, 12320 stop: function( gotoEnd ) { 12321 var index = 0, 12322 12323 // If we are going to the end, we want to run all the tweens 12324 // otherwise we skip this part 12325 length = gotoEnd ? animation.tweens.length : 0; 12326 if ( stopped ) { 12327 return this; 12328 } 12329 stopped = true; 12330 for ( ; index < length; index++ ) { 12331 animation.tweens[ index ].run( 1 ); 12332 } 12333 12334 // Resolve when we played the last frame; otherwise, reject 12335 if ( gotoEnd ) { 12336 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 12337 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 12338 } else { 12339 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 12340 } 12341 return this; 12342 } 12343 } ), 12344 props = animation.props; 12345 12346 propFilter( props, animation.opts.specialEasing ); 12347 12348 for ( ; index < length; index++ ) { 12349 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 12350 if ( result ) { 12351 if ( isFunction( result.stop ) ) { 12352 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 12353 result.stop.bind( result ); 12354 } 12355 return result; 12356 } 12357 } 12358 12359 jQuery.map( props, createTween, animation ); 12360 12361 if ( isFunction( animation.opts.start ) ) { 12362 animation.opts.start.call( elem, animation ); 12363 } 12364 12365 // Attach callbacks from options 12366 animation 12367 .progress( animation.opts.progress ) 12368 .done( animation.opts.done, animation.opts.complete ) 12369 .fail( animation.opts.fail ) 12370 .always( animation.opts.always ); 12371 12372 jQuery.fx.timer( 12373 jQuery.extend( tick, { 12374 elem: elem, 12375 anim: animation, 12376 queue: animation.opts.queue 12377 } ) 12378 ); 12379 12380 return animation; 12381} 12382 12383jQuery.Animation = jQuery.extend( Animation, { 12384 12385 tweeners: { 12386 "*": [ function( prop, value ) { 12387 var tween = this.createTween( prop, value ); 12388 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 12389 return tween; 12390 } ] 12391 }, 12392 12393 tweener: function( props, callback ) { 12394 if ( isFunction( props ) ) { 12395 callback = props; 12396 props = [ "*" ]; 12397 } else { 12398 props = props.match( rnothtmlwhite ); 12399 } 12400 12401 var prop, 12402 index = 0, 12403 length = props.length; 12404 12405 for ( ; index < length; index++ ) { 12406 prop = props[ index ]; 12407 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 12408 Animation.tweeners[ prop ].unshift( callback ); 12409 } 12410 }, 12411 12412 prefilters: [ defaultPrefilter ], 12413 12414 prefilter: function( callback, prepend ) { 12415 if ( prepend ) { 12416 Animation.prefilters.unshift( callback ); 12417 } else { 12418 Animation.prefilters.push( callback ); 12419 } 12420 } 12421} ); 12422 12423jQuery.speed = function( speed, easing, fn ) { 12424 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 12425 complete: fn || !fn && easing || 12426 isFunction( speed ) && speed, 12427 duration: speed, 12428 easing: fn && easing || easing && !isFunction( easing ) && easing 12429 }; 12430 12431 // Go to the end state if fx are off 12432 if ( jQuery.fx.off ) { 12433 opt.duration = 0; 12434 12435 } else { 12436 if ( typeof opt.duration !== "number" ) { 12437 if ( opt.duration in jQuery.fx.speeds ) { 12438 opt.duration = jQuery.fx.speeds[ opt.duration ]; 12439 12440 } else { 12441 opt.duration = jQuery.fx.speeds._default; 12442 } 12443 } 12444 } 12445 12446 // Normalize opt.queue - true/undefined/null -> "fx" 12447 if ( opt.queue == null || opt.queue === true ) { 12448 opt.queue = "fx"; 12449 } 12450 12451 // Queueing 12452 opt.old = opt.complete; 12453 12454 opt.complete = function() { 12455 if ( isFunction( opt.old ) ) { 12456 opt.old.call( this ); 12457 } 12458 12459 if ( opt.queue ) { 12460 jQuery.dequeue( this, opt.queue ); 12461 } 12462 }; 12463 12464 return opt; 12465}; 12466 12467jQuery.fn.extend( { 12468 fadeTo: function( speed, to, easing, callback ) { 12469 12470 // Show any hidden elements after setting opacity to 0 12471 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 12472 12473 // Animate to the value specified 12474 .end().animate( { opacity: to }, speed, easing, callback ); 12475 }, 12476 animate: function( prop, speed, easing, callback ) { 12477 var empty = jQuery.isEmptyObject( prop ), 12478 optall = jQuery.speed( speed, easing, callback ), 12479 doAnimation = function() { 12480 12481 // Operate on a copy of prop so per-property easing won't be lost 12482 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 12483 12484 // Empty animations, or finishing resolves immediately 12485 if ( empty || dataPriv.get( this, "finish" ) ) { 12486 anim.stop( true ); 12487 } 12488 }; 12489 12490 doAnimation.finish = doAnimation; 12491 12492 return empty || optall.queue === false ? 12493 this.each( doAnimation ) : 12494 this.queue( optall.queue, doAnimation ); 12495 }, 12496 stop: function( type, clearQueue, gotoEnd ) { 12497 var stopQueue = function( hooks ) { 12498 var stop = hooks.stop; 12499 delete hooks.stop; 12500 stop( gotoEnd ); 12501 }; 12502 12503 if ( typeof type !== "string" ) { 12504 gotoEnd = clearQueue; 12505 clearQueue = type; 12506 type = undefined; 12507 } 12508 if ( clearQueue ) { 12509 this.queue( type || "fx", [] ); 12510 } 12511 12512 return this.each( function() { 12513 var dequeue = true, 12514 index = type != null && type + "queueHooks", 12515 timers = jQuery.timers, 12516 data = dataPriv.get( this ); 12517 12518 if ( index ) { 12519 if ( data[ index ] && data[ index ].stop ) { 12520 stopQueue( data[ index ] ); 12521 } 12522 } else { 12523 for ( index in data ) { 12524 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 12525 stopQueue( data[ index ] ); 12526 } 12527 } 12528 } 12529 12530 for ( index = timers.length; index--; ) { 12531 if ( timers[ index ].elem === this && 12532 ( type == null || timers[ index ].queue === type ) ) { 12533 12534 timers[ index ].anim.stop( gotoEnd ); 12535 dequeue = false; 12536 timers.splice( index, 1 ); 12537 } 12538 } 12539 12540 // Start the next in the queue if the last step wasn't forced. 12541 // Timers currently will call their complete callbacks, which 12542 // will dequeue but only if they were gotoEnd. 12543 if ( dequeue || !gotoEnd ) { 12544 jQuery.dequeue( this, type ); 12545 } 12546 } ); 12547 }, 12548 finish: function( type ) { 12549 if ( type !== false ) { 12550 type = type || "fx"; 12551 } 12552 return this.each( function() { 12553 var index, 12554 data = dataPriv.get( this ), 12555 queue = data[ type + "queue" ], 12556 hooks = data[ type + "queueHooks" ], 12557 timers = jQuery.timers, 12558 length = queue ? queue.length : 0; 12559 12560 // Enable finishing flag on private data 12561 data.finish = true; 12562 12563 // Empty the queue first 12564 jQuery.queue( this, type, [] ); 12565 12566 if ( hooks && hooks.stop ) { 12567 hooks.stop.call( this, true ); 12568 } 12569 12570 // Look for any active animations, and finish them 12571 for ( index = timers.length; index--; ) { 12572 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 12573 timers[ index ].anim.stop( true ); 12574 timers.splice( index, 1 ); 12575 } 12576 } 12577 12578 // Look for any animations in the old queue and finish them 12579 for ( index = 0; index < length; index++ ) { 12580 if ( queue[ index ] && queue[ index ].finish ) { 12581 queue[ index ].finish.call( this ); 12582 } 12583 } 12584 12585 // Turn off finishing flag 12586 delete data.finish; 12587 } ); 12588 } 12589} ); 12590 12591jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { 12592 var cssFn = jQuery.fn[ name ]; 12593 jQuery.fn[ name ] = function( speed, easing, callback ) { 12594 return speed == null || typeof speed === "boolean" ? 12595 cssFn.apply( this, arguments ) : 12596 this.animate( genFx( name, true ), speed, easing, callback ); 12597 }; 12598} ); 12599 12600// Generate shortcuts for custom animations 12601jQuery.each( { 12602 slideDown: genFx( "show" ), 12603 slideUp: genFx( "hide" ), 12604 slideToggle: genFx( "toggle" ), 12605 fadeIn: { opacity: "show" }, 12606 fadeOut: { opacity: "hide" }, 12607 fadeToggle: { opacity: "toggle" } 12608}, function( name, props ) { 12609 jQuery.fn[ name ] = function( speed, easing, callback ) { 12610 return this.animate( props, speed, easing, callback ); 12611 }; 12612} ); 12613 12614jQuery.timers = []; 12615jQuery.fx.tick = function() { 12616 var timer, 12617 i = 0, 12618 timers = jQuery.timers; 12619 12620 fxNow = Date.now(); 12621 12622 for ( ; i < timers.length; i++ ) { 12623 timer = timers[ i ]; 12624 12625 // Run the timer and safely remove it when done (allowing for external removal) 12626 if ( !timer() && timers[ i ] === timer ) { 12627 timers.splice( i--, 1 ); 12628 } 12629 } 12630 12631 if ( !timers.length ) { 12632 jQuery.fx.stop(); 12633 } 12634 fxNow = undefined; 12635}; 12636 12637jQuery.fx.timer = function( timer ) { 12638 jQuery.timers.push( timer ); 12639 jQuery.fx.start(); 12640}; 12641 12642jQuery.fx.interval = 13; 12643jQuery.fx.start = function() { 12644 if ( inProgress ) { 12645 return; 12646 } 12647 12648 inProgress = true; 12649 schedule(); 12650}; 12651 12652jQuery.fx.stop = function() { 12653 inProgress = null; 12654}; 12655 12656jQuery.fx.speeds = { 12657 slow: 600, 12658 fast: 200, 12659 12660 // Default speed 12661 _default: 400 12662}; 12663 12664 12665// Based off of the plugin by Clint Helfers, with permission. 12666jQuery.fn.delay = function( time, type ) { 12667 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 12668 type = type || "fx"; 12669 12670 return this.queue( type, function( next, hooks ) { 12671 var timeout = window.setTimeout( next, time ); 12672 hooks.stop = function() { 12673 window.clearTimeout( timeout ); 12674 }; 12675 } ); 12676}; 12677 12678 12679( function() { 12680 var input = document.createElement( "input" ), 12681 select = document.createElement( "select" ), 12682 opt = select.appendChild( document.createElement( "option" ) ); 12683 12684 input.type = "checkbox"; 12685 12686 // Support: Android <=4.3 only 12687 // Default value for a checkbox should be "on" 12688 support.checkOn = input.value !== ""; 12689 12690 // Support: IE <=11 only 12691 // Must access selectedIndex to make default options select 12692 support.optSelected = opt.selected; 12693 12694 // Support: IE <=11 only 12695 // An input loses its value after becoming a radio 12696 input = document.createElement( "input" ); 12697 input.value = "t"; 12698 input.type = "radio"; 12699 support.radioValue = input.value === "t"; 12700} )(); 12701 12702 12703var boolHook, 12704 attrHandle = jQuery.expr.attrHandle; 12705 12706jQuery.fn.extend( { 12707 attr: function( name, value ) { 12708 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 12709 }, 12710 12711 removeAttr: function( name ) { 12712 return this.each( function() { 12713 jQuery.removeAttr( this, name ); 12714 } ); 12715 } 12716} ); 12717 12718jQuery.extend( { 12719 attr: function( elem, name, value ) { 12720 var ret, hooks, 12721 nType = elem.nodeType; 12722 12723 // Don't get/set attributes on text, comment and attribute nodes 12724 if ( nType === 3 || nType === 8 || nType === 2 ) { 12725 return; 12726 } 12727 12728 // Fallback to prop when attributes are not supported 12729 if ( typeof elem.getAttribute === "undefined" ) { 12730 return jQuery.prop( elem, name, value ); 12731 } 12732 12733 // Attribute hooks are determined by the lowercase version 12734 // Grab necessary hook if one is defined 12735 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 12736 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 12737 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 12738 } 12739 12740 if ( value !== undefined ) { 12741 if ( value === null ) { 12742 jQuery.removeAttr( elem, name ); 12743 return; 12744 } 12745 12746 if ( hooks && "set" in hooks && 12747 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 12748 return ret; 12749 } 12750 12751 elem.setAttribute( name, value + "" ); 12752 return value; 12753 } 12754 12755 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 12756 return ret; 12757 } 12758 12759 ret = jQuery.find.attr( elem, name ); 12760 12761 // Non-existent attributes return null, we normalize to undefined 12762 return ret == null ? undefined : ret; 12763 }, 12764 12765 attrHooks: { 12766 type: { 12767 set: function( elem, value ) { 12768 if ( !support.radioValue && value === "radio" && 12769 nodeName( elem, "input" ) ) { 12770 var val = elem.value; 12771 elem.setAttribute( "type", value ); 12772 if ( val ) { 12773 elem.value = val; 12774 } 12775 return value; 12776 } 12777 } 12778 } 12779 }, 12780 12781 removeAttr: function( elem, value ) { 12782 var name, 12783 i = 0, 12784 12785 // Attribute names can contain non-HTML whitespace characters 12786 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 12787 attrNames = value && value.match( rnothtmlwhite ); 12788 12789 if ( attrNames && elem.nodeType === 1 ) { 12790 while ( ( name = attrNames[ i++ ] ) ) { 12791 elem.removeAttribute( name ); 12792 } 12793 } 12794 } 12795} ); 12796 12797// Hooks for boolean attributes 12798boolHook = { 12799 set: function( elem, value, name ) { 12800 if ( value === false ) { 12801 12802 // Remove boolean attributes when set to false 12803 jQuery.removeAttr( elem, name ); 12804 } else { 12805 elem.setAttribute( name, name ); 12806 } 12807 return name; 12808 } 12809}; 12810 12811jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { 12812 var getter = attrHandle[ name ] || jQuery.find.attr; 12813 12814 attrHandle[ name ] = function( elem, name, isXML ) { 12815 var ret, handle, 12816 lowercaseName = name.toLowerCase(); 12817 12818 if ( !isXML ) { 12819 12820 // Avoid an infinite loop by temporarily removing this function from the getter 12821 handle = attrHandle[ lowercaseName ]; 12822 attrHandle[ lowercaseName ] = ret; 12823 ret = getter( elem, name, isXML ) != null ? 12824 lowercaseName : 12825 null; 12826 attrHandle[ lowercaseName ] = handle; 12827 } 12828 return ret; 12829 }; 12830} ); 12831 12832 12833 12834 12835var rfocusable = /^(?:input|select|textarea|button)$/i, 12836 rclickable = /^(?:a|area)$/i; 12837 12838jQuery.fn.extend( { 12839 prop: function( name, value ) { 12840 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 12841 }, 12842 12843 removeProp: function( name ) { 12844 return this.each( function() { 12845 delete this[ jQuery.propFix[ name ] || name ]; 12846 } ); 12847 } 12848} ); 12849 12850jQuery.extend( { 12851 prop: function( elem, name, value ) { 12852 var ret, hooks, 12853 nType = elem.nodeType; 12854 12855 // Don't get/set properties on text, comment and attribute nodes 12856 if ( nType === 3 || nType === 8 || nType === 2 ) { 12857 return; 12858 } 12859 12860 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 12861 12862 // Fix name and attach hooks 12863 name = jQuery.propFix[ name ] || name; 12864 hooks = jQuery.propHooks[ name ]; 12865 } 12866 12867 if ( value !== undefined ) { 12868 if ( hooks && "set" in hooks && 12869 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 12870 return ret; 12871 } 12872 12873 return ( elem[ name ] = value ); 12874 } 12875 12876 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 12877 return ret; 12878 } 12879 12880 return elem[ name ]; 12881 }, 12882 12883 propHooks: { 12884 tabIndex: { 12885 get: function( elem ) { 12886 12887 // Support: IE <=9 - 11 only 12888 // elem.tabIndex doesn't always return the 12889 // correct value when it hasn't been explicitly set 12890 // Use proper attribute retrieval (trac-12072) 12891 var tabindex = jQuery.find.attr( elem, "tabindex" ); 12892 12893 if ( tabindex ) { 12894 return parseInt( tabindex, 10 ); 12895 } 12896 12897 if ( 12898 rfocusable.test( elem.nodeName ) || 12899 rclickable.test( elem.nodeName ) && 12900 elem.href 12901 ) { 12902 return 0; 12903 } 12904 12905 return -1; 12906 } 12907 } 12908 }, 12909 12910 propFix: { 12911 "for": "htmlFor", 12912 "class": "className" 12913 } 12914} ); 12915 12916// Support: IE <=11 only 12917// Accessing the selectedIndex property 12918// forces the browser to respect setting selected 12919// on the option 12920// The getter ensures a default option is selected 12921// when in an optgroup 12922// eslint rule "no-unused-expressions" is disabled for this code 12923// since it considers such accessions noop 12924if ( !support.optSelected ) { 12925 jQuery.propHooks.selected = { 12926 get: function( elem ) { 12927 12928 /* eslint no-unused-expressions: "off" */ 12929 12930 var parent = elem.parentNode; 12931 if ( parent && parent.parentNode ) { 12932 parent.parentNode.selectedIndex; 12933 } 12934 return null; 12935 }, 12936 set: function( elem ) { 12937 12938 /* eslint no-unused-expressions: "off" */ 12939 12940 var parent = elem.parentNode; 12941 if ( parent ) { 12942 parent.selectedIndex; 12943 12944 if ( parent.parentNode ) { 12945 parent.parentNode.selectedIndex; 12946 } 12947 } 12948 } 12949 }; 12950} 12951 12952jQuery.each( [ 12953 "tabIndex", 12954 "readOnly", 12955 "maxLength", 12956 "cellSpacing", 12957 "cellPadding", 12958 "rowSpan", 12959 "colSpan", 12960 "useMap", 12961 "frameBorder", 12962 "contentEditable" 12963], function() { 12964 jQuery.propFix[ this.toLowerCase() ] = this; 12965} ); 12966 12967 12968 12969 12970 // Strip and collapse whitespace according to HTML spec 12971 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 12972 function stripAndCollapse( value ) { 12973 var tokens = value.match( rnothtmlwhite ) || []; 12974 return tokens.join( " " ); 12975 } 12976 12977 12978function getClass( elem ) { 12979 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 12980} 12981 12982function classesToArray( value ) { 12983 if ( Array.isArray( value ) ) { 12984 return value; 12985 } 12986 if ( typeof value === "string" ) { 12987 return value.match( rnothtmlwhite ) || []; 12988 } 12989 return []; 12990} 12991 12992jQuery.fn.extend( { 12993 addClass: function( value ) { 12994 var classNames, cur, curValue, className, i, finalValue; 12995 12996 if ( isFunction( value ) ) { 12997 return this.each( function( j ) { 12998 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 12999 } ); 13000 } 13001 13002 classNames = classesToArray( value ); 13003 13004 if ( classNames.length ) { 13005 return this.each( function() { 13006 curValue = getClass( this ); 13007 cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 13008 13009 if ( cur ) { 13010 for ( i = 0; i < classNames.length; i++ ) { 13011 className = classNames[ i ]; 13012 if ( cur.indexOf( " " + className + " " ) < 0 ) { 13013 cur += className + " "; 13014 } 13015 } 13016 13017 // Only assign if different to avoid unneeded rendering. 13018 finalValue = stripAndCollapse( cur ); 13019 if ( curValue !== finalValue ) { 13020 this.setAttribute( "class", finalValue ); 13021 } 13022 } 13023 } ); 13024 } 13025 13026 return this; 13027 }, 13028 13029 removeClass: function( value ) { 13030 var classNames, cur, curValue, className, i, finalValue; 13031 13032 if ( isFunction( value ) ) { 13033 return this.each( function( j ) { 13034 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 13035 } ); 13036 } 13037 13038 if ( !arguments.length ) { 13039 return this.attr( "class", "" ); 13040 } 13041 13042 classNames = classesToArray( value ); 13043 13044 if ( classNames.length ) { 13045 return this.each( function() { 13046 curValue = getClass( this ); 13047 13048 // This expression is here for better compressibility (see addClass) 13049 cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 13050 13051 if ( cur ) { 13052 for ( i = 0; i < classNames.length; i++ ) { 13053 className = classNames[ i ]; 13054 13055 // Remove *all* instances 13056 while ( cur.indexOf( " " + className + " " ) > -1 ) { 13057 cur = cur.replace( " " + className + " ", " " ); 13058 } 13059 } 13060 13061 // Only assign if different to avoid unneeded rendering. 13062 finalValue = stripAndCollapse( cur ); 13063 if ( curValue !== finalValue ) { 13064 this.setAttribute( "class", finalValue ); 13065 } 13066 } 13067 } ); 13068 } 13069 13070 return this; 13071 }, 13072 13073 toggleClass: function( value, stateVal ) { 13074 var classNames, className, i, self, 13075 type = typeof value, 13076 isValidValue = type === "string" || Array.isArray( value ); 13077 13078 if ( isFunction( value ) ) { 13079 return this.each( function( i ) { 13080 jQuery( this ).toggleClass( 13081 value.call( this, i, getClass( this ), stateVal ), 13082 stateVal 13083 ); 13084 } ); 13085 } 13086 13087 if ( typeof stateVal === "boolean" && isValidValue ) { 13088 return stateVal ? this.addClass( value ) : this.removeClass( value ); 13089 } 13090 13091 classNames = classesToArray( value ); 13092 13093 return this.each( function() { 13094 if ( isValidValue ) { 13095 13096 // Toggle individual class names 13097 self = jQuery( this ); 13098 13099 for ( i = 0; i < classNames.length; i++ ) { 13100 className = classNames[ i ]; 13101 13102 // Check each className given, space separated list 13103 if ( self.hasClass( className ) ) { 13104 self.removeClass( className ); 13105 } else { 13106 self.addClass( className ); 13107 } 13108 } 13109 13110 // Toggle whole class name 13111 } else if ( value === undefined || type === "boolean" ) { 13112 className = getClass( this ); 13113 if ( className ) { 13114 13115 // Store className if set 13116 dataPriv.set( this, "__className__", className ); 13117 } 13118 13119 // If the element has a class name or if we're passed `false`, 13120 // then remove the whole classname (if there was one, the above saved it). 13121 // Otherwise bring back whatever was previously saved (if anything), 13122 // falling back to the empty string if nothing was stored. 13123 if ( this.setAttribute ) { 13124 this.setAttribute( "class", 13125 className || value === false ? 13126 "" : 13127 dataPriv.get( this, "__className__" ) || "" 13128 ); 13129 } 13130 } 13131 } ); 13132 }, 13133 13134 hasClass: function( selector ) { 13135 var className, elem, 13136 i = 0; 13137 13138 className = " " + selector + " "; 13139 while ( ( elem = this[ i++ ] ) ) { 13140 if ( elem.nodeType === 1 && 13141 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 13142 return true; 13143 } 13144 } 13145 13146 return false; 13147 } 13148} ); 13149 13150 13151 13152 13153var rreturn = /\r/g; 13154 13155jQuery.fn.extend( { 13156 val: function( value ) { 13157 var hooks, ret, valueIsFunction, 13158 elem = this[ 0 ]; 13159 13160 if ( !arguments.length ) { 13161 if ( elem ) { 13162 hooks = jQuery.valHooks[ elem.type ] || 13163 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 13164 13165 if ( hooks && 13166 "get" in hooks && 13167 ( ret = hooks.get( elem, "value" ) ) !== undefined 13168 ) { 13169 return ret; 13170 } 13171 13172 ret = elem.value; 13173 13174 // Handle most common string cases 13175 if ( typeof ret === "string" ) { 13176 return ret.replace( rreturn, "" ); 13177 } 13178 13179 // Handle cases where value is null/undef or number 13180 return ret == null ? "" : ret; 13181 } 13182 13183 return; 13184 } 13185 13186 valueIsFunction = isFunction( value ); 13187 13188 return this.each( function( i ) { 13189 var val; 13190 13191 if ( this.nodeType !== 1 ) { 13192 return; 13193 } 13194 13195 if ( valueIsFunction ) { 13196 val = value.call( this, i, jQuery( this ).val() ); 13197 } else { 13198 val = value; 13199 } 13200 13201 // Treat null/undefined as ""; convert numbers to string 13202 if ( val == null ) { 13203 val = ""; 13204 13205 } else if ( typeof val === "number" ) { 13206 val += ""; 13207 13208 } else if ( Array.isArray( val ) ) { 13209 val = jQuery.map( val, function( value ) { 13210 return value == null ? "" : value + ""; 13211 } ); 13212 } 13213 13214 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 13215 13216 // If set returns undefined, fall back to normal setting 13217 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 13218 this.value = val; 13219 } 13220 } ); 13221 } 13222} ); 13223 13224jQuery.extend( { 13225 valHooks: { 13226 option: { 13227 get: function( elem ) { 13228 13229 var val = jQuery.find.attr( elem, "value" ); 13230 return val != null ? 13231 val : 13232 13233 // Support: IE <=10 - 11 only 13234 // option.text throws exceptions (trac-14686, trac-14858) 13235 // Strip and collapse whitespace 13236 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 13237 stripAndCollapse( jQuery.text( elem ) ); 13238 } 13239 }, 13240 select: { 13241 get: function( elem ) { 13242 var value, option, i, 13243 options = elem.options, 13244 index = elem.selectedIndex, 13245 one = elem.type === "select-one", 13246 values = one ? null : [], 13247 max = one ? index + 1 : options.length; 13248 13249 if ( index < 0 ) { 13250 i = max; 13251 13252 } else { 13253 i = one ? index : 0; 13254 } 13255 13256 // Loop through all the selected options 13257 for ( ; i < max; i++ ) { 13258 option = options[ i ]; 13259 13260 // Support: IE <=9 only 13261 // IE8-9 doesn't update selected after form reset (trac-2551) 13262 if ( ( option.selected || i === index ) && 13263 13264 // Don't return options that are disabled or in a disabled optgroup 13265 !option.disabled && 13266 ( !option.parentNode.disabled || 13267 !nodeName( option.parentNode, "optgroup" ) ) ) { 13268 13269 // Get the specific value for the option 13270 value = jQuery( option ).val(); 13271 13272 // We don't need an array for one selects 13273 if ( one ) { 13274 return value; 13275 } 13276 13277 // Multi-Selects return an array 13278 values.push( value ); 13279 } 13280 } 13281 13282 return values; 13283 }, 13284 13285 set: function( elem, value ) { 13286 var optionSet, option, 13287 options = elem.options, 13288 values = jQuery.makeArray( value ), 13289 i = options.length; 13290 13291 while ( i-- ) { 13292 option = options[ i ]; 13293 13294 /* eslint-disable no-cond-assign */ 13295 13296 if ( option.selected = 13297 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 13298 ) { 13299 optionSet = true; 13300 } 13301 13302 /* eslint-enable no-cond-assign */ 13303 } 13304 13305 // Force browsers to behave consistently when non-matching value is set 13306 if ( !optionSet ) { 13307 elem.selectedIndex = -1; 13308 } 13309 return values; 13310 } 13311 } 13312 } 13313} ); 13314 13315// Radios and checkboxes getter/setter 13316jQuery.each( [ "radio", "checkbox" ], function() { 13317 jQuery.valHooks[ this ] = { 13318 set: function( elem, value ) { 13319 if ( Array.isArray( value ) ) { 13320 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 13321 } 13322 } 13323 }; 13324 if ( !support.checkOn ) { 13325 jQuery.valHooks[ this ].get = function( elem ) { 13326 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 13327 }; 13328 } 13329} ); 13330 13331 13332 13333 13334// Return jQuery for attributes-only inclusion 13335var location = window.location; 13336 13337var nonce = { guid: Date.now() }; 13338 13339var rquery = ( /\?/ ); 13340 13341 13342 13343// Cross-browser xml parsing 13344jQuery.parseXML = function( data ) { 13345 var xml, parserErrorElem; 13346 if ( !data || typeof data !== "string" ) { 13347 return null; 13348 } 13349 13350 // Support: IE 9 - 11 only 13351 // IE throws on parseFromString with invalid input. 13352 try { 13353 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 13354 } catch ( e ) {} 13355 13356 parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; 13357 if ( !xml || parserErrorElem ) { 13358 jQuery.error( "Invalid XML: " + ( 13359 parserErrorElem ? 13360 jQuery.map( parserErrorElem.childNodes, function( el ) { 13361 return el.textContent; 13362 } ).join( "\n" ) : 13363 data 13364 ) ); 13365 } 13366 return xml; 13367}; 13368 13369 13370var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 13371 stopPropagationCallback = function( e ) { 13372 e.stopPropagation(); 13373 }; 13374 13375jQuery.extend( jQuery.event, { 13376 13377 trigger: function( event, data, elem, onlyHandlers ) { 13378 13379 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 13380 eventPath = [ elem || document ], 13381 type = hasOwn.call( event, "type" ) ? event.type : event, 13382 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 13383 13384 cur = lastElement = tmp = elem = elem || document; 13385 13386 // Don't do events on text and comment nodes 13387 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 13388 return; 13389 } 13390 13391 // focus/blur morphs to focusin/out; ensure we're not firing them right now 13392 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 13393 return; 13394 } 13395 13396 if ( type.indexOf( "." ) > -1 ) { 13397 13398 // Namespaced trigger; create a regexp to match event type in handle() 13399 namespaces = type.split( "." ); 13400 type = namespaces.shift(); 13401 namespaces.sort(); 13402 } 13403 ontype = type.indexOf( ":" ) < 0 && "on" + type; 13404 13405 // Caller can pass in a jQuery.Event object, Object, or just an event type string 13406 event = event[ jQuery.expando ] ? 13407 event : 13408 new jQuery.Event( type, typeof event === "object" && event ); 13409 13410 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 13411 event.isTrigger = onlyHandlers ? 2 : 3; 13412 event.namespace = namespaces.join( "." ); 13413 event.rnamespace = event.namespace ? 13414 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 13415 null; 13416 13417 // Clean up the event in case it is being reused 13418 event.result = undefined; 13419 if ( !event.target ) { 13420 event.target = elem; 13421 } 13422 13423 // Clone any incoming data and prepend the event, creating the handler arg list 13424 data = data == null ? 13425 [ event ] : 13426 jQuery.makeArray( data, [ event ] ); 13427 13428 // Allow special events to draw outside the lines 13429 special = jQuery.event.special[ type ] || {}; 13430 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 13431 return; 13432 } 13433 13434 // Determine event propagation path in advance, per W3C events spec (trac-9951) 13435 // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724) 13436 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 13437 13438 bubbleType = special.delegateType || type; 13439 if ( !rfocusMorph.test( bubbleType + type ) ) { 13440 cur = cur.parentNode; 13441 } 13442 for ( ; cur; cur = cur.parentNode ) { 13443 eventPath.push( cur ); 13444 tmp = cur; 13445 } 13446 13447 // Only add window if we got to document (e.g., not plain obj or detached DOM) 13448 if ( tmp === ( elem.ownerDocument || document ) ) { 13449 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 13450 } 13451 } 13452 13453 // Fire handlers on the event path 13454 i = 0; 13455 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 13456 lastElement = cur; 13457 event.type = i > 1 ? 13458 bubbleType : 13459 special.bindType || type; 13460 13461 // jQuery handler 13462 handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && 13463 dataPriv.get( cur, "handle" ); 13464 if ( handle ) { 13465 handle.apply( cur, data ); 13466 } 13467 13468 // Native handler 13469 handle = ontype && cur[ ontype ]; 13470 if ( handle && handle.apply && acceptData( cur ) ) { 13471 event.result = handle.apply( cur, data ); 13472 if ( event.result === false ) { 13473 event.preventDefault(); 13474 } 13475 } 13476 } 13477 event.type = type; 13478 13479 // If nobody prevented the default action, do it now 13480 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 13481 13482 if ( ( !special._default || 13483 special._default.apply( eventPath.pop(), data ) === false ) && 13484 acceptData( elem ) ) { 13485 13486 // Call a native DOM method on the target with the same name as the event. 13487 // Don't do default actions on window, that's where global variables be (trac-6170) 13488 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 13489 13490 // Don't re-trigger an onFOO event when we call its FOO() method 13491 tmp = elem[ ontype ]; 13492 13493 if ( tmp ) { 13494 elem[ ontype ] = null; 13495 } 13496 13497 // Prevent re-triggering of the same event, since we already bubbled it above 13498 jQuery.event.triggered = type; 13499 13500 if ( event.isPropagationStopped() ) { 13501 lastElement.addEventListener( type, stopPropagationCallback ); 13502 } 13503 13504 elem[ type ](); 13505 13506 if ( event.isPropagationStopped() ) { 13507 lastElement.removeEventListener( type, stopPropagationCallback ); 13508 } 13509 13510 jQuery.event.triggered = undefined; 13511 13512 if ( tmp ) { 13513 elem[ ontype ] = tmp; 13514 } 13515 } 13516 } 13517 } 13518 13519 return event.result; 13520 }, 13521 13522 // Piggyback on a donor event to simulate a different one 13523 // Used only for `focus(in | out)` events 13524 simulate: function( type, elem, event ) { 13525 var e = jQuery.extend( 13526 new jQuery.Event(), 13527 event, 13528 { 13529 type: type, 13530 isSimulated: true 13531 } 13532 ); 13533 13534 jQuery.event.trigger( e, null, elem ); 13535 } 13536 13537} ); 13538 13539jQuery.fn.extend( { 13540 13541 trigger: function( type, data ) { 13542 return this.each( function() { 13543 jQuery.event.trigger( type, data, this ); 13544 } ); 13545 }, 13546 triggerHandler: function( type, data ) { 13547 var elem = this[ 0 ]; 13548 if ( elem ) { 13549 return jQuery.event.trigger( type, data, elem, true ); 13550 } 13551 } 13552} ); 13553 13554 13555var 13556 rbracket = /\[\]$/, 13557 rCRLF = /\r?\n/g, 13558 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 13559 rsubmittable = /^(?:input|select|textarea|keygen)/i; 13560 13561function buildParams( prefix, obj, traditional, add ) { 13562 var name; 13563 13564 if ( Array.isArray( obj ) ) { 13565 13566 // Serialize array item. 13567 jQuery.each( obj, function( i, v ) { 13568 if ( traditional || rbracket.test( prefix ) ) { 13569 13570 // Treat each array item as a scalar. 13571 add( prefix, v ); 13572 13573 } else { 13574 13575 // Item is non-scalar (array or object), encode its numeric index. 13576 buildParams( 13577 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 13578 v, 13579 traditional, 13580 add 13581 ); 13582 } 13583 } ); 13584 13585 } else if ( !traditional && toType( obj ) === "object" ) { 13586 13587 // Serialize object item. 13588 for ( name in obj ) { 13589 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 13590 } 13591 13592 } else { 13593 13594 // Serialize scalar item. 13595 add( prefix, obj ); 13596 } 13597} 13598 13599// Serialize an array of form elements or a set of 13600// key/values into a query string 13601jQuery.param = function( a, traditional ) { 13602 var prefix, 13603 s = [], 13604 add = function( key, valueOrFunction ) { 13605 13606 // If value is a function, invoke it and use its return value 13607 var value = isFunction( valueOrFunction ) ? 13608 valueOrFunction() : 13609 valueOrFunction; 13610 13611 s[ s.length ] = encodeURIComponent( key ) + "=" + 13612 encodeURIComponent( value == null ? "" : value ); 13613 }; 13614 13615 if ( a == null ) { 13616 return ""; 13617 } 13618 13619 // If an array was passed in, assume that it is an array of form elements. 13620 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 13621 13622 // Serialize the form elements 13623 jQuery.each( a, function() { 13624 add( this.name, this.value ); 13625 } ); 13626 13627 } else { 13628 13629 // If traditional, encode the "old" way (the way 1.3.2 or older 13630 // did it), otherwise encode params recursively. 13631 for ( prefix in a ) { 13632 buildParams( prefix, a[ prefix ], traditional, add ); 13633 } 13634 } 13635 13636 // Return the resulting serialization 13637 return s.join( "&" ); 13638}; 13639 13640jQuery.fn.extend( { 13641 serialize: function() { 13642 return jQuery.param( this.serializeArray() ); 13643 }, 13644 serializeArray: function() { 13645 return this.map( function() { 13646 13647 // Can add propHook for "elements" to filter or add form elements 13648 var elements = jQuery.prop( this, "elements" ); 13649 return elements ? jQuery.makeArray( elements ) : this; 13650 } ).filter( function() { 13651 var type = this.type; 13652 13653 // Use .is( ":disabled" ) so that fieldset[disabled] works 13654 return this.name && !jQuery( this ).is( ":disabled" ) && 13655 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 13656 ( this.checked || !rcheckableType.test( type ) ); 13657 } ).map( function( _i, elem ) { 13658 var val = jQuery( this ).val(); 13659 13660 if ( val == null ) { 13661 return null; 13662 } 13663 13664 if ( Array.isArray( val ) ) { 13665 return jQuery.map( val, function( val ) { 13666 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 13667 } ); 13668 } 13669 13670 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 13671 } ).get(); 13672 } 13673} ); 13674 13675 13676var 13677 r20 = /%20/g, 13678 rhash = /#.*$/, 13679 rantiCache = /([?&])_=[^&]*/, 13680 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 13681 13682 // trac-7653, trac-8125, trac-8152: local protocol detection 13683 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 13684 rnoContent = /^(?:GET|HEAD)$/, 13685 rprotocol = /^\/\//, 13686 13687 /* Prefilters 13688 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 13689 * 2) These are called: 13690 * - BEFORE asking for a transport 13691 * - AFTER param serialization (s.data is a string if s.processData is true) 13692 * 3) key is the dataType 13693 * 4) the catchall symbol "*" can be used 13694 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 13695 */ 13696 prefilters = {}, 13697 13698 /* Transports bindings 13699 * 1) key is the dataType 13700 * 2) the catchall symbol "*" can be used 13701 * 3) selection will start with transport dataType and THEN go to "*" if needed 13702 */ 13703 transports = {}, 13704 13705 // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression 13706 allTypes = "*/".concat( "*" ), 13707 13708 // Anchor tag for parsing the document origin 13709 originAnchor = document.createElement( "a" ); 13710 13711originAnchor.href = location.href; 13712 13713// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 13714function addToPrefiltersOrTransports( structure ) { 13715 13716 // dataTypeExpression is optional and defaults to "*" 13717 return function( dataTypeExpression, func ) { 13718 13719 if ( typeof dataTypeExpression !== "string" ) { 13720 func = dataTypeExpression; 13721 dataTypeExpression = "*"; 13722 } 13723 13724 var dataType, 13725 i = 0, 13726 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 13727 13728 if ( isFunction( func ) ) { 13729 13730 // For each dataType in the dataTypeExpression 13731 while ( ( dataType = dataTypes[ i++ ] ) ) { 13732 13733 // Prepend if requested 13734 if ( dataType[ 0 ] === "+" ) { 13735 dataType = dataType.slice( 1 ) || "*"; 13736 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 13737 13738 // Otherwise append 13739 } else { 13740 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 13741 } 13742 } 13743 } 13744 }; 13745} 13746 13747// Base inspection function for prefilters and transports 13748function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 13749 13750 var inspected = {}, 13751 seekingTransport = ( structure === transports ); 13752 13753 function inspect( dataType ) { 13754 var selected; 13755 inspected[ dataType ] = true; 13756 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 13757 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 13758 if ( typeof dataTypeOrTransport === "string" && 13759 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 13760 13761 options.dataTypes.unshift( dataTypeOrTransport ); 13762 inspect( dataTypeOrTransport ); 13763 return false; 13764 } else if ( seekingTransport ) { 13765 return !( selected = dataTypeOrTransport ); 13766 } 13767 } ); 13768 return selected; 13769 } 13770 13771 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 13772} 13773 13774// A special extend for ajax options 13775// that takes "flat" options (not to be deep extended) 13776// Fixes trac-9887 13777function ajaxExtend( target, src ) { 13778 var key, deep, 13779 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 13780 13781 for ( key in src ) { 13782 if ( src[ key ] !== undefined ) { 13783 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 13784 } 13785 } 13786 if ( deep ) { 13787 jQuery.extend( true, target, deep ); 13788 } 13789 13790 return target; 13791} 13792 13793/* Handles responses to an ajax request: 13794 * - finds the right dataType (mediates between content-type and expected dataType) 13795 * - returns the corresponding response 13796 */ 13797function ajaxHandleResponses( s, jqXHR, responses ) { 13798 13799 var ct, type, finalDataType, firstDataType, 13800 contents = s.contents, 13801 dataTypes = s.dataTypes; 13802 13803 // Remove auto dataType and get content-type in the process 13804 while ( dataTypes[ 0 ] === "*" ) { 13805 dataTypes.shift(); 13806 if ( ct === undefined ) { 13807 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 13808 } 13809 } 13810 13811 // Check if we're dealing with a known content-type 13812 if ( ct ) { 13813 for ( type in contents ) { 13814 if ( contents[ type ] && contents[ type ].test( ct ) ) { 13815 dataTypes.unshift( type ); 13816 break; 13817 } 13818 } 13819 } 13820 13821 // Check to see if we have a response for the expected dataType 13822 if ( dataTypes[ 0 ] in responses ) { 13823 finalDataType = dataTypes[ 0 ]; 13824 } else { 13825 13826 // Try convertible dataTypes 13827 for ( type in responses ) { 13828 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 13829 finalDataType = type; 13830 break; 13831 } 13832 if ( !firstDataType ) { 13833 firstDataType = type; 13834 } 13835 } 13836 13837 // Or just use first one 13838 finalDataType = finalDataType || firstDataType; 13839 } 13840 13841 // If we found a dataType 13842 // We add the dataType to the list if needed 13843 // and return the corresponding response 13844 if ( finalDataType ) { 13845 if ( finalDataType !== dataTypes[ 0 ] ) { 13846 dataTypes.unshift( finalDataType ); 13847 } 13848 return responses[ finalDataType ]; 13849 } 13850} 13851 13852/* Chain conversions given the request and the original response 13853 * Also sets the responseXXX fields on the jqXHR instance 13854 */ 13855function ajaxConvert( s, response, jqXHR, isSuccess ) { 13856 var conv2, current, conv, tmp, prev, 13857 converters = {}, 13858 13859 // Work with a copy of dataTypes in case we need to modify it for conversion 13860 dataTypes = s.dataTypes.slice(); 13861 13862 // Create converters map with lowercased keys 13863 if ( dataTypes[ 1 ] ) { 13864 for ( conv in s.converters ) { 13865 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 13866 } 13867 } 13868 13869 current = dataTypes.shift(); 13870 13871 // Convert to each sequential dataType 13872 while ( current ) { 13873 13874 if ( s.responseFields[ current ] ) { 13875 jqXHR[ s.responseFields[ current ] ] = response; 13876 } 13877 13878 // Apply the dataFilter if provided 13879 if ( !prev && isSuccess && s.dataFilter ) { 13880 response = s.dataFilter( response, s.dataType ); 13881 } 13882 13883 prev = current; 13884 current = dataTypes.shift(); 13885 13886 if ( current ) { 13887 13888 // There's only work to do if current dataType is non-auto 13889 if ( current === "*" ) { 13890 13891 current = prev; 13892 13893 // Convert response if prev dataType is non-auto and differs from current 13894 } else if ( prev !== "*" && prev !== current ) { 13895 13896 // Seek a direct converter 13897 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 13898 13899 // If none found, seek a pair 13900 if ( !conv ) { 13901 for ( conv2 in converters ) { 13902 13903 // If conv2 outputs current 13904 tmp = conv2.split( " " ); 13905 if ( tmp[ 1 ] === current ) { 13906 13907 // If prev can be converted to accepted input 13908 conv = converters[ prev + " " + tmp[ 0 ] ] || 13909 converters[ "* " + tmp[ 0 ] ]; 13910 if ( conv ) { 13911 13912 // Condense equivalence converters 13913 if ( conv === true ) { 13914 conv = converters[ conv2 ]; 13915 13916 // Otherwise, insert the intermediate dataType 13917 } else if ( converters[ conv2 ] !== true ) { 13918 current = tmp[ 0 ]; 13919 dataTypes.unshift( tmp[ 1 ] ); 13920 } 13921 break; 13922 } 13923 } 13924 } 13925 } 13926 13927 // Apply converter (if not an equivalence) 13928 if ( conv !== true ) { 13929 13930 // Unless errors are allowed to bubble, catch and return them 13931 if ( conv && s.throws ) { 13932 response = conv( response ); 13933 } else { 13934 try { 13935 response = conv( response ); 13936 } catch ( e ) { 13937 return { 13938 state: "parsererror", 13939 error: conv ? e : "No conversion from " + prev + " to " + current 13940 }; 13941 } 13942 } 13943 } 13944 } 13945 } 13946 } 13947 13948 return { state: "success", data: response }; 13949} 13950 13951jQuery.extend( { 13952 13953 // Counter for holding the number of active queries 13954 active: 0, 13955 13956 // Last-Modified header cache for next request 13957 lastModified: {}, 13958 etag: {}, 13959 13960 ajaxSettings: { 13961 url: location.href, 13962 type: "GET", 13963 isLocal: rlocalProtocol.test( location.protocol ), 13964 global: true, 13965 processData: true, 13966 async: true, 13967 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 13968 13969 /* 13970 timeout: 0, 13971 data: null, 13972 dataType: null, 13973 username: null, 13974 password: null, 13975 cache: null, 13976 throws: false, 13977 traditional: false, 13978 headers: {}, 13979 */ 13980 13981 accepts: { 13982 "*": allTypes, 13983 text: "text/plain", 13984 html: "text/html", 13985 xml: "application/xml, text/xml", 13986 json: "application/json, text/javascript" 13987 }, 13988 13989 contents: { 13990 xml: /\bxml\b/, 13991 html: /\bhtml/, 13992 json: /\bjson\b/ 13993 }, 13994 13995 responseFields: { 13996 xml: "responseXML", 13997 text: "responseText", 13998 json: "responseJSON" 13999 }, 14000 14001 // Data converters 14002 // Keys separate source (or catchall "*") and destination types with a single space 14003 converters: { 14004 14005 // Convert anything to text 14006 "* text": String, 14007 14008 // Text to html (true = no transformation) 14009 "text html": true, 14010 14011 // Evaluate text as a json expression 14012 "text json": JSON.parse, 14013 14014 // Parse text as xml 14015 "text xml": jQuery.parseXML 14016 }, 14017 14018 // For options that shouldn't be deep extended: 14019 // you can add your own custom options here if 14020 // and when you create one that shouldn't be 14021 // deep extended (see ajaxExtend) 14022 flatOptions: { 14023 url: true, 14024 context: true 14025 } 14026 }, 14027 14028 // Creates a full fledged settings object into target 14029 // with both ajaxSettings and settings fields. 14030 // If target is omitted, writes into ajaxSettings. 14031 ajaxSetup: function( target, settings ) { 14032 return settings ? 14033 14034 // Building a settings object 14035 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 14036 14037 // Extending ajaxSettings 14038 ajaxExtend( jQuery.ajaxSettings, target ); 14039 }, 14040 14041 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 14042 ajaxTransport: addToPrefiltersOrTransports( transports ), 14043 14044 // Main method 14045 ajax: function( url, options ) { 14046 14047 // If url is an object, simulate pre-1.5 signature 14048 if ( typeof url === "object" ) { 14049 options = url; 14050 url = undefined; 14051 } 14052 14053 // Force options to be an object 14054 options = options || {}; 14055 14056 var transport, 14057 14058 // URL without anti-cache param 14059 cacheURL, 14060 14061 // Response headers 14062 responseHeadersString, 14063 responseHeaders, 14064 14065 // timeout handle 14066 timeoutTimer, 14067 14068 // Url cleanup var 14069 urlAnchor, 14070 14071 // Request state (becomes false upon send and true upon completion) 14072 completed, 14073 14074 // To know if global events are to be dispatched 14075 fireGlobals, 14076 14077 // Loop variable 14078 i, 14079 14080 // uncached part of the url 14081 uncached, 14082 14083 // Create the final options object 14084 s = jQuery.ajaxSetup( {}, options ), 14085 14086 // Callbacks context 14087 callbackContext = s.context || s, 14088 14089 // Context for global events is callbackContext if it is a DOM node or jQuery collection 14090 globalEventContext = s.context && 14091 ( callbackContext.nodeType || callbackContext.jquery ) ? 14092 jQuery( callbackContext ) : 14093 jQuery.event, 14094 14095 // Deferreds 14096 deferred = jQuery.Deferred(), 14097 completeDeferred = jQuery.Callbacks( "once memory" ), 14098 14099 // Status-dependent callbacks 14100 statusCode = s.statusCode || {}, 14101 14102 // Headers (they are sent all at once) 14103 requestHeaders = {}, 14104 requestHeadersNames = {}, 14105 14106 // Default abort message 14107 strAbort = "canceled", 14108 14109 // Fake xhr 14110 jqXHR = { 14111 readyState: 0, 14112 14113 // Builds headers hashtable if needed 14114 getResponseHeader: function( key ) { 14115 var match; 14116 if ( completed ) { 14117 if ( !responseHeaders ) { 14118 responseHeaders = {}; 14119 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 14120 responseHeaders[ match[ 1 ].toLowerCase() + " " ] = 14121 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) 14122 .concat( match[ 2 ] ); 14123 } 14124 } 14125 match = responseHeaders[ key.toLowerCase() + " " ]; 14126 } 14127 return match == null ? null : match.join( ", " ); 14128 }, 14129 14130 // Raw string 14131 getAllResponseHeaders: function() { 14132 return completed ? responseHeadersString : null; 14133 }, 14134 14135 // Caches the header 14136 setRequestHeader: function( name, value ) { 14137 if ( completed == null ) { 14138 name = requestHeadersNames[ name.toLowerCase() ] = 14139 requestHeadersNames[ name.toLowerCase() ] || name; 14140 requestHeaders[ name ] = value; 14141 } 14142 return this; 14143 }, 14144 14145 // Overrides response content-type header 14146 overrideMimeType: function( type ) { 14147 if ( completed == null ) { 14148 s.mimeType = type; 14149 } 14150 return this; 14151 }, 14152 14153 // Status-dependent callbacks 14154 statusCode: function( map ) { 14155 var code; 14156 if ( map ) { 14157 if ( completed ) { 14158 14159 // Execute the appropriate callbacks 14160 jqXHR.always( map[ jqXHR.status ] ); 14161 } else { 14162 14163 // Lazy-add the new callbacks in a way that preserves old ones 14164 for ( code in map ) { 14165 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 14166 } 14167 } 14168 } 14169 return this; 14170 }, 14171 14172 // Cancel the request 14173 abort: function( statusText ) { 14174 var finalText = statusText || strAbort; 14175 if ( transport ) { 14176 transport.abort( finalText ); 14177 } 14178 done( 0, finalText ); 14179 return this; 14180 } 14181 }; 14182 14183 // Attach deferreds 14184 deferred.promise( jqXHR ); 14185 14186 // Add protocol if not provided (prefilters might expect it) 14187 // Handle falsy url in the settings object (trac-10093: consistency with old signature) 14188 // We also use the url parameter if available 14189 s.url = ( ( url || s.url || location.href ) + "" ) 14190 .replace( rprotocol, location.protocol + "//" ); 14191 14192 // Alias method option to type as per ticket trac-12004 14193 s.type = options.method || options.type || s.method || s.type; 14194 14195 // Extract dataTypes list 14196 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 14197 14198 // A cross-domain request is in order when the origin doesn't match the current origin. 14199 if ( s.crossDomain == null ) { 14200 urlAnchor = document.createElement( "a" ); 14201 14202 // Support: IE <=8 - 11, Edge 12 - 15 14203 // IE throws exception on accessing the href property if url is malformed, 14204 // e.g. http://example.com:80x/ 14205 try { 14206 urlAnchor.href = s.url; 14207 14208 // Support: IE <=8 - 11 only 14209 // Anchor's host property isn't correctly set when s.url is relative 14210 urlAnchor.href = urlAnchor.href; 14211 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 14212 urlAnchor.protocol + "//" + urlAnchor.host; 14213 } catch ( e ) { 14214 14215 // If there is an error parsing the URL, assume it is crossDomain, 14216 // it can be rejected by the transport if it is invalid 14217 s.crossDomain = true; 14218 } 14219 } 14220 14221 // Convert data if not already a string 14222 if ( s.data && s.processData && typeof s.data !== "string" ) { 14223 s.data = jQuery.param( s.data, s.traditional ); 14224 } 14225 14226 // Apply prefilters 14227 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 14228 14229 // If request was aborted inside a prefilter, stop there 14230 if ( completed ) { 14231 return jqXHR; 14232 } 14233 14234 // We can fire global events as of now if asked to 14235 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118) 14236 fireGlobals = jQuery.event && s.global; 14237 14238 // Watch for a new set of requests 14239 if ( fireGlobals && jQuery.active++ === 0 ) { 14240 jQuery.event.trigger( "ajaxStart" ); 14241 } 14242 14243 // Uppercase the type 14244 s.type = s.type.toUpperCase(); 14245 14246 // Determine if request has content 14247 s.hasContent = !rnoContent.test( s.type ); 14248 14249 // Save the URL in case we're toying with the If-Modified-Since 14250 // and/or If-None-Match header later on 14251 // Remove hash to simplify url manipulation 14252 cacheURL = s.url.replace( rhash, "" ); 14253 14254 // More options handling for requests with no content 14255 if ( !s.hasContent ) { 14256 14257 // Remember the hash so we can put it back 14258 uncached = s.url.slice( cacheURL.length ); 14259 14260 // If data is available and should be processed, append data to url 14261 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 14262 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 14263 14264 // trac-9682: remove data so that it's not used in an eventual retry 14265 delete s.data; 14266 } 14267 14268 // Add or update anti-cache param if needed 14269 if ( s.cache === false ) { 14270 cacheURL = cacheURL.replace( rantiCache, "$1" ); 14271 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + 14272 uncached; 14273 } 14274 14275 // Put hash and anti-cache on the URL that will be requested (gh-1732) 14276 s.url = cacheURL + uncached; 14277 14278 // Change '%20' to '+' if this is encoded form body content (gh-2658) 14279 } else if ( s.data && s.processData && 14280 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 14281 s.data = s.data.replace( r20, "+" ); 14282 } 14283 14284 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 14285 if ( s.ifModified ) { 14286 if ( jQuery.lastModified[ cacheURL ] ) { 14287 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 14288 } 14289 if ( jQuery.etag[ cacheURL ] ) { 14290 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 14291 } 14292 } 14293 14294 // Set the correct header, if data is being sent 14295 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 14296 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 14297 } 14298 14299 // Set the Accepts header for the server, depending on the dataType 14300 jqXHR.setRequestHeader( 14301 "Accept", 14302 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 14303 s.accepts[ s.dataTypes[ 0 ] ] + 14304 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 14305 s.accepts[ "*" ] 14306 ); 14307 14308 // Check for headers option 14309 for ( i in s.headers ) { 14310 jqXHR.setRequestHeader( i, s.headers[ i ] ); 14311 } 14312 14313 // Allow custom headers/mimetypes and early abort 14314 if ( s.beforeSend && 14315 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 14316 14317 // Abort if not done already and return 14318 return jqXHR.abort(); 14319 } 14320 14321 // Aborting is no longer a cancellation 14322 strAbort = "abort"; 14323 14324 // Install callbacks on deferreds 14325 completeDeferred.add( s.complete ); 14326 jqXHR.done( s.success ); 14327 jqXHR.fail( s.error ); 14328 14329 // Get transport 14330 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 14331 14332 // If no transport, we auto-abort 14333 if ( !transport ) { 14334 done( -1, "No Transport" ); 14335 } else { 14336 jqXHR.readyState = 1; 14337 14338 // Send global event 14339 if ( fireGlobals ) { 14340 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 14341 } 14342 14343 // If request was aborted inside ajaxSend, stop there 14344 if ( completed ) { 14345 return jqXHR; 14346 } 14347 14348 // Timeout 14349 if ( s.async && s.timeout > 0 ) { 14350 timeoutTimer = window.setTimeout( function() { 14351 jqXHR.abort( "timeout" ); 14352 }, s.timeout ); 14353 } 14354 14355 try { 14356 completed = false; 14357 transport.send( requestHeaders, done ); 14358 } catch ( e ) { 14359 14360 // Rethrow post-completion exceptions 14361 if ( completed ) { 14362 throw e; 14363 } 14364 14365 // Propagate others as results 14366 done( -1, e ); 14367 } 14368 } 14369 14370 // Callback for when everything is done 14371 function done( status, nativeStatusText, responses, headers ) { 14372 var isSuccess, success, error, response, modified, 14373 statusText = nativeStatusText; 14374 14375 // Ignore repeat invocations 14376 if ( completed ) { 14377 return; 14378 } 14379 14380 completed = true; 14381 14382 // Clear timeout if it exists 14383 if ( timeoutTimer ) { 14384 window.clearTimeout( timeoutTimer ); 14385 } 14386 14387 // Dereference transport for early garbage collection 14388 // (no matter how long the jqXHR object will be used) 14389 transport = undefined; 14390 14391 // Cache response headers 14392 responseHeadersString = headers || ""; 14393 14394 // Set readyState 14395 jqXHR.readyState = status > 0 ? 4 : 0; 14396 14397 // Determine if successful 14398 isSuccess = status >= 200 && status < 300 || status === 304; 14399 14400 // Get response data 14401 if ( responses ) { 14402 response = ajaxHandleResponses( s, jqXHR, responses ); 14403 } 14404 14405 // Use a noop converter for missing script but not if jsonp 14406 if ( !isSuccess && 14407 jQuery.inArray( "script", s.dataTypes ) > -1 && 14408 jQuery.inArray( "json", s.dataTypes ) < 0 ) { 14409 s.converters[ "text script" ] = function() {}; 14410 } 14411 14412 // Convert no matter what (that way responseXXX fields are always set) 14413 response = ajaxConvert( s, response, jqXHR, isSuccess ); 14414 14415 // If successful, handle type chaining 14416 if ( isSuccess ) { 14417 14418 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 14419 if ( s.ifModified ) { 14420 modified = jqXHR.getResponseHeader( "Last-Modified" ); 14421 if ( modified ) { 14422 jQuery.lastModified[ cacheURL ] = modified; 14423 } 14424 modified = jqXHR.getResponseHeader( "etag" ); 14425 if ( modified ) { 14426 jQuery.etag[ cacheURL ] = modified; 14427 } 14428 } 14429 14430 // if no content 14431 if ( status === 204 || s.type === "HEAD" ) { 14432 statusText = "nocontent"; 14433 14434 // if not modified 14435 } else if ( status === 304 ) { 14436 statusText = "notmodified"; 14437 14438 // If we have data, let's convert it 14439 } else { 14440 statusText = response.state; 14441 success = response.data; 14442 error = response.error; 14443 isSuccess = !error; 14444 } 14445 } else { 14446 14447 // Extract error from statusText and normalize for non-aborts 14448 error = statusText; 14449 if ( status || !statusText ) { 14450 statusText = "error"; 14451 if ( status < 0 ) { 14452 status = 0; 14453 } 14454 } 14455 } 14456 14457 // Set data for the fake xhr object 14458 jqXHR.status = status; 14459 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 14460 14461 // Success/Error 14462 if ( isSuccess ) { 14463 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 14464 } else { 14465 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 14466 } 14467 14468 // Status-dependent callbacks 14469 jqXHR.statusCode( statusCode ); 14470 statusCode = undefined; 14471 14472 if ( fireGlobals ) { 14473 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 14474 [ jqXHR, s, isSuccess ? success : error ] ); 14475 } 14476 14477 // Complete 14478 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 14479 14480 if ( fireGlobals ) { 14481 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 14482 14483 // Handle the global AJAX counter 14484 if ( !( --jQuery.active ) ) { 14485 jQuery.event.trigger( "ajaxStop" ); 14486 } 14487 } 14488 } 14489 14490 return jqXHR; 14491 }, 14492 14493 getJSON: function( url, data, callback ) { 14494 return jQuery.get( url, data, callback, "json" ); 14495 }, 14496 14497 getScript: function( url, callback ) { 14498 return jQuery.get( url, undefined, callback, "script" ); 14499 } 14500} ); 14501 14502jQuery.each( [ "get", "post" ], function( _i, method ) { 14503 jQuery[ method ] = function( url, data, callback, type ) { 14504 14505 // Shift arguments if data argument was omitted 14506 if ( isFunction( data ) ) { 14507 type = type || callback; 14508 callback = data; 14509 data = undefined; 14510 } 14511 14512 // The url can be an options object (which then must have .url) 14513 return jQuery.ajax( jQuery.extend( { 14514 url: url, 14515 type: method, 14516 dataType: type, 14517 data: data, 14518 success: callback 14519 }, jQuery.isPlainObject( url ) && url ) ); 14520 }; 14521} ); 14522 14523jQuery.ajaxPrefilter( function( s ) { 14524 var i; 14525 for ( i in s.headers ) { 14526 if ( i.toLowerCase() === "content-type" ) { 14527 s.contentType = s.headers[ i ] || ""; 14528 } 14529 } 14530} ); 14531 14532 14533jQuery._evalUrl = function( url, options, doc ) { 14534 return jQuery.ajax( { 14535 url: url, 14536 14537 // Make this explicit, since user can override this through ajaxSetup (trac-11264) 14538 type: "GET", 14539 dataType: "script", 14540 cache: true, 14541 async: false, 14542 global: false, 14543 14544 // Only evaluate the response if it is successful (gh-4126) 14545 // dataFilter is not invoked for failure responses, so using it instead 14546 // of the default converter is kludgy but it works. 14547 converters: { 14548 "text script": function() {} 14549 }, 14550 dataFilter: function( response ) { 14551 jQuery.globalEval( response, options, doc ); 14552 } 14553 } ); 14554}; 14555 14556 14557jQuery.fn.extend( { 14558 wrapAll: function( html ) { 14559 var wrap; 14560 14561 if ( this[ 0 ] ) { 14562 if ( isFunction( html ) ) { 14563 html = html.call( this[ 0 ] ); 14564 } 14565 14566 // The elements to wrap the target around 14567 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 14568 14569 if ( this[ 0 ].parentNode ) { 14570 wrap.insertBefore( this[ 0 ] ); 14571 } 14572 14573 wrap.map( function() { 14574 var elem = this; 14575 14576 while ( elem.firstElementChild ) { 14577 elem = elem.firstElementChild; 14578 } 14579 14580 return elem; 14581 } ).append( this ); 14582 } 14583 14584 return this; 14585 }, 14586 14587 wrapInner: function( html ) { 14588 if ( isFunction( html ) ) { 14589 return this.each( function( i ) { 14590 jQuery( this ).wrapInner( html.call( this, i ) ); 14591 } ); 14592 } 14593 14594 return this.each( function() { 14595 var self = jQuery( this ), 14596 contents = self.contents(); 14597 14598 if ( contents.length ) { 14599 contents.wrapAll( html ); 14600 14601 } else { 14602 self.append( html ); 14603 } 14604 } ); 14605 }, 14606 14607 wrap: function( html ) { 14608 var htmlIsFunction = isFunction( html ); 14609 14610 return this.each( function( i ) { 14611 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 14612 } ); 14613 }, 14614 14615 unwrap: function( selector ) { 14616 this.parent( selector ).not( "body" ).each( function() { 14617 jQuery( this ).replaceWith( this.childNodes ); 14618 } ); 14619 return this; 14620 } 14621} ); 14622 14623 14624jQuery.expr.pseudos.hidden = function( elem ) { 14625 return !jQuery.expr.pseudos.visible( elem ); 14626}; 14627jQuery.expr.pseudos.visible = function( elem ) { 14628 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 14629}; 14630 14631 14632 14633 14634jQuery.ajaxSettings.xhr = function() { 14635 try { 14636 return new window.XMLHttpRequest(); 14637 } catch ( e ) {} 14638}; 14639 14640var xhrSuccessStatus = { 14641 14642 // File protocol always yields status code 0, assume 200 14643 0: 200, 14644 14645 // Support: IE <=9 only 14646 // trac-1450: sometimes IE returns 1223 when it should be 204 14647 1223: 204 14648 }, 14649 xhrSupported = jQuery.ajaxSettings.xhr(); 14650 14651support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 14652support.ajax = xhrSupported = !!xhrSupported; 14653 14654jQuery.ajaxTransport( function( options ) { 14655 var callback, errorCallback; 14656 14657 // Cross domain only allowed if supported through XMLHttpRequest 14658 if ( support.cors || xhrSupported && !options.crossDomain ) { 14659 return { 14660 send: function( headers, complete ) { 14661 var i, 14662 xhr = options.xhr(); 14663 14664 xhr.open( 14665 options.type, 14666 options.url, 14667 options.async, 14668 options.username, 14669 options.password 14670 ); 14671 14672 // Apply custom fields if provided 14673 if ( options.xhrFields ) { 14674 for ( i in options.xhrFields ) { 14675 xhr[ i ] = options.xhrFields[ i ]; 14676 } 14677 } 14678 14679 // Override mime type if needed 14680 if ( options.mimeType && xhr.overrideMimeType ) { 14681 xhr.overrideMimeType( options.mimeType ); 14682 } 14683 14684 // X-Requested-With header 14685 // For cross-domain requests, seeing as conditions for a preflight are 14686 // akin to a jigsaw puzzle, we simply never set it to be sure. 14687 // (it can always be set on a per-request basis or even using ajaxSetup) 14688 // For same-domain requests, won't change header if already provided. 14689 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 14690 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 14691 } 14692 14693 // Set headers 14694 for ( i in headers ) { 14695 xhr.setRequestHeader( i, headers[ i ] ); 14696 } 14697 14698 // Callback 14699 callback = function( type ) { 14700 return function() { 14701 if ( callback ) { 14702 callback = errorCallback = xhr.onload = 14703 xhr.onerror = xhr.onabort = xhr.ontimeout = 14704 xhr.onreadystatechange = null; 14705 14706 if ( type === "abort" ) { 14707 xhr.abort(); 14708 } else if ( type === "error" ) { 14709 14710 // Support: IE <=9 only 14711 // On a manual native abort, IE9 throws 14712 // errors on any property access that is not readyState 14713 if ( typeof xhr.status !== "number" ) { 14714 complete( 0, "error" ); 14715 } else { 14716 complete( 14717 14718 // File: protocol always yields status 0; see trac-8605, trac-14207 14719 xhr.status, 14720 xhr.statusText 14721 ); 14722 } 14723 } else { 14724 complete( 14725 xhrSuccessStatus[ xhr.status ] || xhr.status, 14726 xhr.statusText, 14727 14728 // Support: IE <=9 only 14729 // IE9 has no XHR2 but throws on binary (trac-11426) 14730 // For XHR2 non-text, let the caller handle it (gh-2498) 14731 ( xhr.responseType || "text" ) !== "text" || 14732 typeof xhr.responseText !== "string" ? 14733 { binary: xhr.response } : 14734 { text: xhr.responseText }, 14735 xhr.getAllResponseHeaders() 14736 ); 14737 } 14738 } 14739 }; 14740 }; 14741 14742 // Listen to events 14743 xhr.onload = callback(); 14744 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 14745 14746 // Support: IE 9 only 14747 // Use onreadystatechange to replace onabort 14748 // to handle uncaught aborts 14749 if ( xhr.onabort !== undefined ) { 14750 xhr.onabort = errorCallback; 14751 } else { 14752 xhr.onreadystatechange = function() { 14753 14754 // Check readyState before timeout as it changes 14755 if ( xhr.readyState === 4 ) { 14756 14757 // Allow onerror to be called first, 14758 // but that will not handle a native abort 14759 // Also, save errorCallback to a variable 14760 // as xhr.onerror cannot be accessed 14761 window.setTimeout( function() { 14762 if ( callback ) { 14763 errorCallback(); 14764 } 14765 } ); 14766 } 14767 }; 14768 } 14769 14770 // Create the abort callback 14771 callback = callback( "abort" ); 14772 14773 try { 14774 14775 // Do send the request (this may raise an exception) 14776 xhr.send( options.hasContent && options.data || null ); 14777 } catch ( e ) { 14778 14779 // trac-14683: Only rethrow if this hasn't been notified as an error yet 14780 if ( callback ) { 14781 throw e; 14782 } 14783 } 14784 }, 14785 14786 abort: function() { 14787 if ( callback ) { 14788 callback(); 14789 } 14790 } 14791 }; 14792 } 14793} ); 14794 14795 14796 14797 14798// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 14799jQuery.ajaxPrefilter( function( s ) { 14800 if ( s.crossDomain ) { 14801 s.contents.script = false; 14802 } 14803} ); 14804 14805// Install script dataType 14806jQuery.ajaxSetup( { 14807 accepts: { 14808 script: "text/javascript, application/javascript, " + 14809 "application/ecmascript, application/x-ecmascript" 14810 }, 14811 contents: { 14812 script: /\b(?:java|ecma)script\b/ 14813 }, 14814 converters: { 14815 "text script": function( text ) { 14816 jQuery.globalEval( text ); 14817 return text; 14818 } 14819 } 14820} ); 14821 14822// Handle cache's special case and crossDomain 14823jQuery.ajaxPrefilter( "script", function( s ) { 14824 if ( s.cache === undefined ) { 14825 s.cache = false; 14826 } 14827 if ( s.crossDomain ) { 14828 s.type = "GET"; 14829 } 14830} ); 14831 14832// Bind script tag hack transport 14833jQuery.ajaxTransport( "script", function( s ) { 14834 14835 // This transport only deals with cross domain or forced-by-attrs requests 14836 if ( s.crossDomain || s.scriptAttrs ) { 14837 var script, callback; 14838 return { 14839 send: function( _, complete ) { 14840 script = jQuery( "<script>" ) 14841 .attr( s.scriptAttrs || {} ) 14842 .prop( { charset: s.scriptCharset, src: s.url } ) 14843 .on( "load error", callback = function( evt ) { 14844 script.remove(); 14845 callback = null; 14846 if ( evt ) { 14847 complete( evt.type === "error" ? 404 : 200, evt.type ); 14848 } 14849 } ); 14850 14851 // Use native DOM manipulation to avoid our domManip AJAX trickery 14852 document.head.appendChild( script[ 0 ] ); 14853 }, 14854 abort: function() { 14855 if ( callback ) { 14856 callback(); 14857 } 14858 } 14859 }; 14860 } 14861} ); 14862 14863 14864 14865 14866var oldCallbacks = [], 14867 rjsonp = /(=)\?(?=&|$)|\?\?/; 14868 14869// Default jsonp settings 14870jQuery.ajaxSetup( { 14871 jsonp: "callback", 14872 jsonpCallback: function() { 14873 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) ); 14874 this[ callback ] = true; 14875 return callback; 14876 } 14877} ); 14878 14879// Detect, normalize options and install callbacks for jsonp requests 14880jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 14881 14882 var callbackName, overwritten, responseContainer, 14883 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 14884 "url" : 14885 typeof s.data === "string" && 14886 ( s.contentType || "" ) 14887 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 14888 rjsonp.test( s.data ) && "data" 14889 ); 14890 14891 // Handle iff the expected data type is "jsonp" or we have a parameter to set 14892 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 14893 14894 // Get callback name, remembering preexisting value associated with it 14895 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 14896 s.jsonpCallback() : 14897 s.jsonpCallback; 14898 14899 // Insert callback into url or form data 14900 if ( jsonProp ) { 14901 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 14902 } else if ( s.jsonp !== false ) { 14903 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 14904 } 14905 14906 // Use data converter to retrieve json after script execution 14907 s.converters[ "script json" ] = function() { 14908 if ( !responseContainer ) { 14909 jQuery.error( callbackName + " was not called" ); 14910 } 14911 return responseContainer[ 0 ]; 14912 }; 14913 14914 // Force json dataType 14915 s.dataTypes[ 0 ] = "json"; 14916 14917 // Install callback 14918 overwritten = window[ callbackName ]; 14919 window[ callbackName ] = function() { 14920 responseContainer = arguments; 14921 }; 14922 14923 // Clean-up function (fires after converters) 14924 jqXHR.always( function() { 14925 14926 // If previous value didn't exist - remove it 14927 if ( overwritten === undefined ) { 14928 jQuery( window ).removeProp( callbackName ); 14929 14930 // Otherwise restore preexisting value 14931 } else { 14932 window[ callbackName ] = overwritten; 14933 } 14934 14935 // Save back as free 14936 if ( s[ callbackName ] ) { 14937 14938 // Make sure that re-using the options doesn't screw things around 14939 s.jsonpCallback = originalSettings.jsonpCallback; 14940 14941 // Save the callback name for future use 14942 oldCallbacks.push( callbackName ); 14943 } 14944 14945 // Call if it was a function and we have a response 14946 if ( responseContainer && isFunction( overwritten ) ) { 14947 overwritten( responseContainer[ 0 ] ); 14948 } 14949 14950 responseContainer = overwritten = undefined; 14951 } ); 14952 14953 // Delegate to script 14954 return "script"; 14955 } 14956} ); 14957 14958 14959 14960 14961// Support: Safari 8 only 14962// In Safari 8 documents created via document.implementation.createHTMLDocument 14963// collapse sibling forms: the second one becomes a child of the first one. 14964// Because of that, this security measure has to be disabled in Safari 8. 14965// https://bugs.webkit.org/show_bug.cgi?id=137337 14966support.createHTMLDocument = ( function() { 14967 var body = document.implementation.createHTMLDocument( "" ).body; 14968 body.innerHTML = "<form></form><form></form>"; 14969 return body.childNodes.length === 2; 14970} )(); 14971 14972 14973// Argument "data" should be string of html 14974// context (optional): If specified, the fragment will be created in this context, 14975// defaults to document 14976// keepScripts (optional): If true, will include scripts passed in the html string 14977jQuery.parseHTML = function( data, context, keepScripts ) { 14978 if ( typeof data !== "string" ) { 14979 return []; 14980 } 14981 if ( typeof context === "boolean" ) { 14982 keepScripts = context; 14983 context = false; 14984 } 14985 14986 var base, parsed, scripts; 14987 14988 if ( !context ) { 14989 14990 // Stop scripts or inline event handlers from being executed immediately 14991 // by using document.implementation 14992 if ( support.createHTMLDocument ) { 14993 context = document.implementation.createHTMLDocument( "" ); 14994 14995 // Set the base href for the created document 14996 // so any parsed elements with URLs 14997 // are based on the document's URL (gh-2965) 14998 base = context.createElement( "base" ); 14999 base.href = document.location.href; 15000 context.head.appendChild( base ); 15001 } else { 15002 context = document; 15003 } 15004 } 15005 15006 parsed = rsingleTag.exec( data ); 15007 scripts = !keepScripts && []; 15008 15009 // Single tag 15010 if ( parsed ) { 15011 return [ context.createElement( parsed[ 1 ] ) ]; 15012 } 15013 15014 parsed = buildFragment( [ data ], context, scripts ); 15015 15016 if ( scripts && scripts.length ) { 15017 jQuery( scripts ).remove(); 15018 } 15019 15020 return jQuery.merge( [], parsed.childNodes ); 15021}; 15022 15023 15024/** 15025 * Load a url into a page 15026 */ 15027jQuery.fn.load = function( url, params, callback ) { 15028 var selector, type, response, 15029 self = this, 15030 off = url.indexOf( " " ); 15031 15032 if ( off > -1 ) { 15033 selector = stripAndCollapse( url.slice( off ) ); 15034 url = url.slice( 0, off ); 15035 } 15036 15037 // If it's a function 15038 if ( isFunction( params ) ) { 15039 15040 // We assume that it's the callback 15041 callback = params; 15042 params = undefined; 15043 15044 // Otherwise, build a param string 15045 } else if ( params && typeof params === "object" ) { 15046 type = "POST"; 15047 } 15048 15049 // If we have elements to modify, make the request 15050 if ( self.length > 0 ) { 15051 jQuery.ajax( { 15052 url: url, 15053 15054 // If "type" variable is undefined, then "GET" method will be used. 15055 // Make value of this field explicit since 15056 // user can override it through ajaxSetup method 15057 type: type || "GET", 15058 dataType: "html", 15059 data: params 15060 } ).done( function( responseText ) { 15061 15062 // Save response for use in complete callback 15063 response = arguments; 15064 15065 self.html( selector ? 15066 15067 // If a selector was specified, locate the right elements in a dummy div 15068 // Exclude scripts to avoid IE 'Permission Denied' errors 15069 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 15070 15071 // Otherwise use the full result 15072 responseText ); 15073 15074 // If the request succeeds, this function gets "data", "status", "jqXHR" 15075 // but they are ignored because response was set above. 15076 // If it fails, this function gets "jqXHR", "status", "error" 15077 } ).always( callback && function( jqXHR, status ) { 15078 self.each( function() { 15079 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 15080 } ); 15081 } ); 15082 } 15083 15084 return this; 15085}; 15086 15087 15088 15089 15090jQuery.expr.pseudos.animated = function( elem ) { 15091 return jQuery.grep( jQuery.timers, function( fn ) { 15092 return elem === fn.elem; 15093 } ).length; 15094}; 15095 15096 15097 15098 15099jQuery.offset = { 15100 setOffset: function( elem, options, i ) { 15101 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 15102 position = jQuery.css( elem, "position" ), 15103 curElem = jQuery( elem ), 15104 props = {}; 15105 15106 // Set position first, in-case top/left are set even on static elem 15107 if ( position === "static" ) { 15108 elem.style.position = "relative"; 15109 } 15110 15111 curOffset = curElem.offset(); 15112 curCSSTop = jQuery.css( elem, "top" ); 15113 curCSSLeft = jQuery.css( elem, "left" ); 15114 calculatePosition = ( position === "absolute" || position === "fixed" ) && 15115 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 15116 15117 // Need to be able to calculate position if either 15118 // top or left is auto and position is either absolute or fixed 15119 if ( calculatePosition ) { 15120 curPosition = curElem.position(); 15121 curTop = curPosition.top; 15122 curLeft = curPosition.left; 15123 15124 } else { 15125 curTop = parseFloat( curCSSTop ) || 0; 15126 curLeft = parseFloat( curCSSLeft ) || 0; 15127 } 15128 15129 if ( isFunction( options ) ) { 15130 15131 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 15132 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 15133 } 15134 15135 if ( options.top != null ) { 15136 props.top = ( options.top - curOffset.top ) + curTop; 15137 } 15138 if ( options.left != null ) { 15139 props.left = ( options.left - curOffset.left ) + curLeft; 15140 } 15141 15142 if ( "using" in options ) { 15143 options.using.call( elem, props ); 15144 15145 } else { 15146 curElem.css( props ); 15147 } 15148 } 15149}; 15150 15151jQuery.fn.extend( { 15152 15153 // offset() relates an element's border box to the document origin 15154 offset: function( options ) { 15155 15156 // Preserve chaining for setter 15157 if ( arguments.length ) { 15158 return options === undefined ? 15159 this : 15160 this.each( function( i ) { 15161 jQuery.offset.setOffset( this, options, i ); 15162 } ); 15163 } 15164 15165 var rect, win, 15166 elem = this[ 0 ]; 15167 15168 if ( !elem ) { 15169 return; 15170 } 15171 15172 // Return zeros for disconnected and hidden (display: none) elements (gh-2310) 15173 // Support: IE <=11 only 15174 // Running getBoundingClientRect on a 15175 // disconnected node in IE throws an error 15176 if ( !elem.getClientRects().length ) { 15177 return { top: 0, left: 0 }; 15178 } 15179 15180 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 15181 rect = elem.getBoundingClientRect(); 15182 win = elem.ownerDocument.defaultView; 15183 return { 15184 top: rect.top + win.pageYOffset, 15185 left: rect.left + win.pageXOffset 15186 }; 15187 }, 15188 15189 // position() relates an element's margin box to its offset parent's padding box 15190 // This corresponds to the behavior of CSS absolute positioning 15191 position: function() { 15192 if ( !this[ 0 ] ) { 15193 return; 15194 } 15195 15196 var offsetParent, offset, doc, 15197 elem = this[ 0 ], 15198 parentOffset = { top: 0, left: 0 }; 15199 15200 // position:fixed elements are offset from the viewport, which itself always has zero offset 15201 if ( jQuery.css( elem, "position" ) === "fixed" ) { 15202 15203 // Assume position:fixed implies availability of getBoundingClientRect 15204 offset = elem.getBoundingClientRect(); 15205 15206 } else { 15207 offset = this.offset(); 15208 15209 // Account for the *real* offset parent, which can be the document or its root element 15210 // when a statically positioned element is identified 15211 doc = elem.ownerDocument; 15212 offsetParent = elem.offsetParent || doc.documentElement; 15213 while ( offsetParent && 15214 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 15215 jQuery.css( offsetParent, "position" ) === "static" ) { 15216 15217 offsetParent = offsetParent.parentNode; 15218 } 15219 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { 15220 15221 // Incorporate borders into its offset, since they are outside its content origin 15222 parentOffset = jQuery( offsetParent ).offset(); 15223 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 15224 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 15225 } 15226 } 15227 15228 // Subtract parent offsets and element margins 15229 return { 15230 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 15231 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 15232 }; 15233 }, 15234 15235 // This method will return documentElement in the following cases: 15236 // 1) For the element inside the iframe without offsetParent, this method will return 15237 // documentElement of the parent window 15238 // 2) For the hidden or detached element 15239 // 3) For body or html element, i.e. in case of the html node - it will return itself 15240 // 15241 // but those exceptions were never presented as a real life use-cases 15242 // and might be considered as more preferable results. 15243 // 15244 // This logic, however, is not guaranteed and can change at any point in the future 15245 offsetParent: function() { 15246 return this.map( function() { 15247 var offsetParent = this.offsetParent; 15248 15249 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 15250 offsetParent = offsetParent.offsetParent; 15251 } 15252 15253 return offsetParent || documentElement; 15254 } ); 15255 } 15256} ); 15257 15258// Create scrollLeft and scrollTop methods 15259jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 15260 var top = "pageYOffset" === prop; 15261 15262 jQuery.fn[ method ] = function( val ) { 15263 return access( this, function( elem, method, val ) { 15264 15265 // Coalesce documents and windows 15266 var win; 15267 if ( isWindow( elem ) ) { 15268 win = elem; 15269 } else if ( elem.nodeType === 9 ) { 15270 win = elem.defaultView; 15271 } 15272 15273 if ( val === undefined ) { 15274 return win ? win[ prop ] : elem[ method ]; 15275 } 15276 15277 if ( win ) { 15278 win.scrollTo( 15279 !top ? val : win.pageXOffset, 15280 top ? val : win.pageYOffset 15281 ); 15282 15283 } else { 15284 elem[ method ] = val; 15285 } 15286 }, method, val, arguments.length ); 15287 }; 15288} ); 15289 15290// Support: Safari <=7 - 9.1, Chrome <=37 - 49 15291// Add the top/left cssHooks using jQuery.fn.position 15292// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 15293// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 15294// getComputedStyle returns percent when specified for top/left/bottom/right; 15295// rather than make the css module depend on the offset module, just check for it here 15296jQuery.each( [ "top", "left" ], function( _i, prop ) { 15297 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 15298 function( elem, computed ) { 15299 if ( computed ) { 15300 computed = curCSS( elem, prop ); 15301 15302 // If curCSS returns percentage, fallback to offset 15303 return rnumnonpx.test( computed ) ? 15304 jQuery( elem ).position()[ prop ] + "px" : 15305 computed; 15306 } 15307 } 15308 ); 15309} ); 15310 15311 15312// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 15313jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 15314 jQuery.each( { 15315 padding: "inner" + name, 15316 content: type, 15317 "": "outer" + name 15318 }, function( defaultExtra, funcName ) { 15319 15320 // Margin is only for outerHeight, outerWidth 15321 jQuery.fn[ funcName ] = function( margin, value ) { 15322 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 15323 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 15324 15325 return access( this, function( elem, type, value ) { 15326 var doc; 15327 15328 if ( isWindow( elem ) ) { 15329 15330 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 15331 return funcName.indexOf( "outer" ) === 0 ? 15332 elem[ "inner" + name ] : 15333 elem.document.documentElement[ "client" + name ]; 15334 } 15335 15336 // Get document width or height 15337 if ( elem.nodeType === 9 ) { 15338 doc = elem.documentElement; 15339 15340 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 15341 // whichever is greatest 15342 return Math.max( 15343 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 15344 elem.body[ "offset" + name ], doc[ "offset" + name ], 15345 doc[ "client" + name ] 15346 ); 15347 } 15348 15349 return value === undefined ? 15350 15351 // Get width or height on the element, requesting but not forcing parseFloat 15352 jQuery.css( elem, type, extra ) : 15353 15354 // Set width or height on the element 15355 jQuery.style( elem, type, value, extra ); 15356 }, type, chainable ? margin : undefined, chainable ); 15357 }; 15358 } ); 15359} ); 15360 15361 15362jQuery.each( [ 15363 "ajaxStart", 15364 "ajaxStop", 15365 "ajaxComplete", 15366 "ajaxError", 15367 "ajaxSuccess", 15368 "ajaxSend" 15369], function( _i, type ) { 15370 jQuery.fn[ type ] = function( fn ) { 15371 return this.on( type, fn ); 15372 }; 15373} ); 15374 15375 15376 15377 15378jQuery.fn.extend( { 15379 15380 bind: function( types, data, fn ) { 15381 return this.on( types, null, data, fn ); 15382 }, 15383 unbind: function( types, fn ) { 15384 return this.off( types, null, fn ); 15385 }, 15386 15387 delegate: function( selector, types, data, fn ) { 15388 return this.on( types, selector, data, fn ); 15389 }, 15390 undelegate: function( selector, types, fn ) { 15391 15392 // ( namespace ) or ( selector, types [, fn] ) 15393 return arguments.length === 1 ? 15394 this.off( selector, "**" ) : 15395 this.off( types, selector || "**", fn ); 15396 }, 15397 15398 hover: function( fnOver, fnOut ) { 15399 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 15400 } 15401} ); 15402 15403jQuery.each( 15404 ( "blur focus focusin focusout resize scroll click dblclick " + 15405 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 15406 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 15407 function( _i, name ) { 15408 15409 // Handle event binding 15410 jQuery.fn[ name ] = function( data, fn ) { 15411 return arguments.length > 0 ? 15412 this.on( name, null, data, fn ) : 15413 this.trigger( name ); 15414 }; 15415 } 15416); 15417 15418 15419 15420 15421// Support: Android <=4.0 only 15422// Make sure we trim BOM and NBSP 15423// Require that the "whitespace run" starts from a non-whitespace 15424// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position. 15425var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g; 15426 15427// Bind a function to a context, optionally partially applying any 15428// arguments. 15429// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 15430// However, it is not slated for removal any time soon 15431jQuery.proxy = function( fn, context ) { 15432 var tmp, args, proxy; 15433 15434 if ( typeof context === "string" ) { 15435 tmp = fn[ context ]; 15436 context = fn; 15437 fn = tmp; 15438 } 15439 15440 // Quick check to determine if target is callable, in the spec 15441 // this throws a TypeError, but we will just return undefined. 15442 if ( !isFunction( fn ) ) { 15443 return undefined; 15444 } 15445 15446 // Simulated bind 15447 args = slice.call( arguments, 2 ); 15448 proxy = function() { 15449 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 15450 }; 15451 15452 // Set the guid of unique handler to the same of original handler, so it can be removed 15453 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 15454 15455 return proxy; 15456}; 15457 15458jQuery.holdReady = function( hold ) { 15459 if ( hold ) { 15460 jQuery.readyWait++; 15461 } else { 15462 jQuery.ready( true ); 15463 } 15464}; 15465jQuery.isArray = Array.isArray; 15466jQuery.parseJSON = JSON.parse; 15467jQuery.nodeName = nodeName; 15468jQuery.isFunction = isFunction; 15469jQuery.isWindow = isWindow; 15470jQuery.camelCase = camelCase; 15471jQuery.type = toType; 15472 15473jQuery.now = Date.now; 15474 15475jQuery.isNumeric = function( obj ) { 15476 15477 // As of jQuery 3.0, isNumeric is limited to 15478 // strings and numbers (primitives or objects) 15479 // that can be coerced to finite numbers (gh-2662) 15480 var type = jQuery.type( obj ); 15481 return ( type === "number" || type === "string" ) && 15482 15483 // parseFloat NaNs numeric-cast false positives ("") 15484 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 15485 // subtraction forces infinities to NaN 15486 !isNaN( obj - parseFloat( obj ) ); 15487}; 15488 15489jQuery.trim = function( text ) { 15490 return text == null ? 15491 "" : 15492 ( text + "" ).replace( rtrim, "$1" ); 15493}; 15494 15495 15496 15497// Register as a named AMD module, since jQuery can be concatenated with other 15498// files that may use define, but not via a proper concatenation script that 15499// understands anonymous AMD modules. A named AMD is safest and most robust 15500// way to register. Lowercase jquery is used because AMD module names are 15501// derived from file names, and jQuery is normally delivered in a lowercase 15502// file name. Do this after creating the global so that if an AMD module wants 15503// to call noConflict to hide this version of jQuery, it will work. 15504 15505// Note that for maximum portability, libraries that are not jQuery should 15506// declare themselves as anonymous modules, and avoid setting a global if an 15507// AMD loader is present. jQuery is a special case. For more information, see 15508// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 15509 15510if ( true ) { 15511 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() { 15512 return jQuery; 15513 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 15514 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 15515} 15516 15517 15518 15519 15520var 15521 15522 // Map over jQuery in case of overwrite 15523 _jQuery = window.jQuery, 15524 15525 // Map over the $ in case of overwrite 15526 _$ = window.$; 15527 15528jQuery.noConflict = function( deep ) { 15529 if ( window.$ === jQuery ) { 15530 window.$ = _$; 15531 } 15532 15533 if ( deep && window.jQuery === jQuery ) { 15534 window.jQuery = _jQuery; 15535 } 15536 15537 return jQuery; 15538}; 15539 15540// Expose jQuery and $ identifiers, even in AMD 15541// (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557) 15542// and CommonJS for browser emulators (trac-13566) 15543if ( typeof noGlobal === "undefined" ) { 15544 window.jQuery = window.$ = jQuery; 15545} 15546 15547 15548 15549 15550return jQuery; 15551} ); 15552 15553 15554/***/ }), 15555
vendor: 89,080 bytes, lines 15556-18185
15556/***/ "./node_modules/popper.js/dist/esm/popper.js": 15557/*!***************************************************!*\ 15558 !*** ./node_modules/popper.js/dist/esm/popper.js ***! 15559 \***************************************************/ 15560/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 15561 15562"use strict"; 15563__webpack_require__.r(__webpack_exports__); 15564/* harmony export */ __webpack_require__.d(__webpack_exports__, { 15565/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 15566/* harmony export */ }); 15567/**! 15568 * @fileOverview Kickass library to create and place poppers near their reference elements. 15569 * @version 1.16.1 15570 * @license 15571 * Copyright (c) 2016 Federico Zivolo and contributors 15572 * 15573 * Permission is hereby granted, free of charge, to any person obtaining a copy 15574 * of this software and associated documentation files (the "Software"), to deal 15575 * in the Software without restriction, including without limitation the rights 15576 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15577 * copies of the Software, and to permit persons to whom the Software is 15578 * furnished to do so, subject to the following conditions: 15579 * 15580 * The above copyright notice and this permission notice shall be included in all 15581 * copies or substantial portions of the Software. 15582 * 15583 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15584 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15585 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15586 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15587 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 15588 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 15589 * SOFTWARE. 15590 */ 15591var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; 15592 15593var timeoutDuration = function () { 15594 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 15595 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 15596 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 15597 return 1; 15598 } 15599 } 15600 return 0; 15601}(); 15602 15603function microtaskDebounce(fn) { 15604 var called = false; 15605 return function () { 15606 if (called) { 15607 return; 15608 } 15609 called = true; 15610 window.Promise.resolve().then(function () { 15611 called = false; 15612 fn(); 15613 }); 15614 }; 15615} 15616 15617function taskDebounce(fn) { 15618 var scheduled = false; 15619 return function () { 15620 if (!scheduled) { 15621 scheduled = true; 15622 setTimeout(function () { 15623 scheduled = false; 15624 fn(); 15625 }, timeoutDuration); 15626 } 15627 }; 15628} 15629 15630var supportsMicroTasks = isBrowser && window.Promise; 15631 15632/** 15633* Create a debounced version of a method, that's asynchronously deferred 15634* but called in the minimum time possible. 15635* 15636* @method 15637* @memberof Popper.Utils 15638* @argument {Function} fn 15639* @returns {Function} 15640*/ 15641var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 15642 15643/** 15644 * Check if the given variable is a function 15645 * @method 15646 * @memberof Popper.Utils 15647 * @argument {Any} functionToCheck - variable to check 15648 * @returns {Boolean} answer to: is a function? 15649 */ 15650function isFunction(functionToCheck) { 15651 var getType = {}; 15652 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 15653} 15654 15655/** 15656 * Get CSS computed property of the given element 15657 * @method 15658 * @memberof Popper.Utils 15659 * @argument {Eement} element 15660 * @argument {String} property 15661 */ 15662function getStyleComputedProperty(element, property) { 15663 if (element.nodeType !== 1) { 15664 return []; 15665 } 15666 // NOTE: 1 DOM access here 15667 var window = element.ownerDocument.defaultView; 15668 var css = window.getComputedStyle(element, null); 15669 return property ? css[property] : css; 15670} 15671 15672/** 15673 * Returns the parentNode or the host of the element 15674 * @method 15675 * @memberof Popper.Utils 15676 * @argument {Element} element 15677 * @returns {Element} parent 15678 */ 15679function getParentNode(element) { 15680 if (element.nodeName === 'HTML') { 15681 return element; 15682 } 15683 return element.parentNode || element.host; 15684} 15685 15686/** 15687 * Returns the scrolling parent of the given element 15688 * @method 15689 * @memberof Popper.Utils 15690 * @argument {Element} element 15691 * @returns {Element} scroll parent 15692 */ 15693function getScrollParent(element) { 15694 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 15695 if (!element) { 15696 return document.body; 15697 } 15698 15699 switch (element.nodeName) { 15700 case 'HTML': 15701 case 'BODY': 15702 return element.ownerDocument.body; 15703 case '#document': 15704 return element.body; 15705 } 15706 15707 // Firefox want us to check `-x` and `-y` variations as well 15708 15709 var _getStyleComputedProp = getStyleComputedProperty(element), 15710 overflow = _getStyleComputedProp.overflow, 15711 overflowX = _getStyleComputedProp.overflowX, 15712 overflowY = _getStyleComputedProp.overflowY; 15713 15714 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 15715 return element; 15716 } 15717 15718 return getScrollParent(getParentNode(element)); 15719} 15720 15721/** 15722 * Returns the reference node of the reference object, or the reference object itself. 15723 * @method 15724 * @memberof Popper.Utils 15725 * @param {Element|Object} reference - the reference element (the popper will be relative to this) 15726 * @returns {Element} parent 15727 */ 15728function getReferenceNode(reference) { 15729 return reference && reference.referenceNode ? reference.referenceNode : reference; 15730} 15731 15732var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 15733var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 15734 15735/** 15736 * Determines if the browser is Internet Explorer 15737 * @method 15738 * @memberof Popper.Utils 15739 * @param {Number} version to check 15740 * @returns {Boolean} isIE 15741 */ 15742function isIE(version) { 15743 if (version === 11) { 15744 return isIE11; 15745 } 15746 if (version === 10) { 15747 return isIE10; 15748 } 15749 return isIE11 || isIE10; 15750} 15751 15752/** 15753 * Returns the offset parent of the given element 15754 * @method 15755 * @memberof Popper.Utils 15756 * @argument {Element} element 15757 * @returns {Element} offset parent 15758 */ 15759function getOffsetParent(element) { 15760 if (!element) { 15761 return document.documentElement; 15762 } 15763 15764 var noOffsetParent = isIE(10) ? document.body : null; 15765 15766 // NOTE: 1 DOM access here 15767 var offsetParent = element.offsetParent || null; 15768 // Skip hidden elements which don't have an offsetParent 15769 while (offsetParent === noOffsetParent && element.nextElementSibling) { 15770 offsetParent = (element = element.nextElementSibling).offsetParent; 15771 } 15772 15773 var nodeName = offsetParent && offsetParent.nodeName; 15774 15775 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 15776 return element ? element.ownerDocument.documentElement : document.documentElement; 15777 } 15778 15779 // .offsetParent will return the closest TH, TD or TABLE in case 15780 // no offsetParent is present, I hate this job... 15781 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 15782 return getOffsetParent(offsetParent); 15783 } 15784 15785 return offsetParent; 15786} 15787 15788function isOffsetContainer(element) { 15789 var nodeName = element.nodeName; 15790 15791 if (nodeName === 'BODY') { 15792 return false; 15793 } 15794 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 15795} 15796 15797/** 15798 * Finds the root node (document, shadowDOM root) of the given element 15799 * @method 15800 * @memberof Popper.Utils 15801 * @argument {Element} node 15802 * @returns {Element} root node 15803 */ 15804function getRoot(node) { 15805 if (node.parentNode !== null) { 15806 return getRoot(node.parentNode); 15807 } 15808 15809 return node; 15810} 15811 15812/** 15813 * Finds the offset parent common to the two provided nodes 15814 * @method 15815 * @memberof Popper.Utils 15816 * @argument {Element} element1 15817 * @argument {Element} element2 15818 * @returns {Element} common offset parent 15819 */ 15820function findCommonOffsetParent(element1, element2) { 15821 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 15822 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 15823 return document.documentElement; 15824 } 15825 15826 // Here we make sure to give as "start" the element that comes first in the DOM 15827 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 15828 var start = order ? element1 : element2; 15829 var end = order ? element2 : element1; 15830 15831 // Get common ancestor container 15832 var range = document.createRange(); 15833 range.setStart(start, 0); 15834 range.setEnd(end, 0); 15835 var commonAncestorContainer = range.commonAncestorContainer; 15836 15837 // Both nodes are inside #document 15838 15839 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 15840 if (isOffsetContainer(commonAncestorContainer)) { 15841 return commonAncestorContainer; 15842 } 15843 15844 return getOffsetParent(commonAncestorContainer); 15845 } 15846 15847 // one of the nodes is inside shadowDOM, find which one 15848 var element1root = getRoot(element1); 15849 if (element1root.host) { 15850 return findCommonOffsetParent(element1root.host, element2); 15851 } else { 15852 return findCommonOffsetParent(element1, getRoot(element2).host); 15853 } 15854} 15855 15856/** 15857 * Gets the scroll value of the given element in the given side (top and left) 15858 * @method 15859 * @memberof Popper.Utils 15860 * @argument {Element} element 15861 * @argument {String} side `top` or `left` 15862 * @returns {number} amount of scrolled pixels 15863 */ 15864function getScroll(element) { 15865 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 15866 15867 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 15868 var nodeName = element.nodeName; 15869 15870 if (nodeName === 'BODY' || nodeName === 'HTML') { 15871 var html = element.ownerDocument.documentElement; 15872 var scrollingElement = element.ownerDocument.scrollingElement || html; 15873 return scrollingElement[upperSide]; 15874 } 15875 15876 return element[upperSide]; 15877} 15878 15879/* 15880 * Sum or subtract the element scroll values (left and top) from a given rect object 15881 * @method 15882 * @memberof Popper.Utils 15883 * @param {Object} rect - Rect object you want to change 15884 * @param {HTMLElement} element - The element from the function reads the scroll values 15885 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 15886 * @return {Object} rect - The modifier rect object 15887 */ 15888function includeScroll(rect, element) { 15889 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 15890 15891 var scrollTop = getScroll(element, 'top'); 15892 var scrollLeft = getScroll(element, 'left'); 15893 var modifier = subtract ? -1 : 1; 15894 rect.top += scrollTop * modifier; 15895 rect.bottom += scrollTop * modifier; 15896 rect.left += scrollLeft * modifier; 15897 rect.right += scrollLeft * modifier; 15898 return rect; 15899} 15900 15901/* 15902 * Helper to detect borders of a given element 15903 * @method 15904 * @memberof Popper.Utils 15905 * @param {CSSStyleDeclaration} styles 15906 * Result of `getStyleComputedProperty` on the given element 15907 * @param {String} axis - `x` or `y` 15908 * @return {number} borders - The borders size of the given axis 15909 */ 15910 15911function getBordersSize(styles, axis) { 15912 var sideA = axis === 'x' ? 'Left' : 'Top'; 15913 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 15914 15915 return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); 15916} 15917 15918function getSize(axis, body, html, computedStyle) { 15919 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); 15920} 15921 15922function getWindowSizes(document) { 15923 var body = document.body; 15924 var html = document.documentElement; 15925 var computedStyle = isIE(10) && getComputedStyle(html); 15926 15927 return { 15928 height: getSize('Height', body, html, computedStyle), 15929 width: getSize('Width', body, html, computedStyle) 15930 }; 15931} 15932 15933var classCallCheck = function (instance, Constructor) { 15934 if (!(instance instanceof Constructor)) { 15935 throw new TypeError("Cannot call a class as a function"); 15936 } 15937}; 15938 15939var createClass = function () { 15940 function defineProperties(target, props) { 15941 for (var i = 0; i < props.length; i++) { 15942 var descriptor = props[i]; 15943 descriptor.enumerable = descriptor.enumerable || false; 15944 descriptor.configurable = true; 15945 if ("value" in descriptor) descriptor.writable = true; 15946 Object.defineProperty(target, descriptor.key, descriptor); 15947 } 15948 } 15949 15950 return function (Constructor, protoProps, staticProps) { 15951 if (protoProps) defineProperties(Constructor.prototype, protoProps); 15952 if (staticProps) defineProperties(Constructor, staticProps); 15953 return Constructor; 15954 }; 15955}(); 15956 15957 15958 15959 15960 15961var defineProperty = function (obj, key, value) { 15962 if (key in obj) { 15963 Object.defineProperty(obj, key, { 15964 value: value, 15965 enumerable: true, 15966 configurable: true, 15967 writable: true 15968 }); 15969 } else { 15970 obj[key] = value; 15971 } 15972 15973 return obj; 15974}; 15975 15976var _extends = Object.assign || function (target) { 15977 for (var i = 1; i < arguments.length; i++) { 15978 var source = arguments[i]; 15979 15980 for (var key in source) { 15981 if (Object.prototype.hasOwnProperty.call(source, key)) { 15982 target[key] = source[key]; 15983 } 15984 } 15985 } 15986 15987 return target; 15988}; 15989 15990/** 15991 * Given element offsets, generate an output similar to getBoundingClientRect 15992 * @method 15993 * @memberof Popper.Utils 15994 * @argument {Object} offsets 15995 * @returns {Object} ClientRect like output 15996 */ 15997function getClientRect(offsets) { 15998 return _extends({}, offsets, { 15999 right: offsets.left + offsets.width, 16000 bottom: offsets.top + offsets.height 16001 }); 16002} 16003 16004/** 16005 * Get bounding client rect of given element 16006 * @method 16007 * @memberof Popper.Utils 16008 * @param {HTMLElement} element 16009 * @return {Object} client rect 16010 */ 16011function getBoundingClientRect(element) { 16012 var rect = {}; 16013 16014 // IE10 10 FIX: Please, don't ask, the element isn't 16015 // considered in DOM in some circumstances... 16016 // This isn't reproducible in IE10 compatibility mode of IE11 16017 try { 16018 if (isIE(10)) { 16019 rect = element.getBoundingClientRect(); 16020 var scrollTop = getScroll(element, 'top'); 16021 var scrollLeft = getScroll(element, 'left'); 16022 rect.top += scrollTop; 16023 rect.left += scrollLeft; 16024 rect.bottom += scrollTop; 16025 rect.right += scrollLeft; 16026 } else { 16027 rect = element.getBoundingClientRect(); 16028 } 16029 } catch (e) {} 16030 16031 var result = { 16032 left: rect.left, 16033 top: rect.top, 16034 width: rect.right - rect.left, 16035 height: rect.bottom - rect.top 16036 }; 16037 16038 // subtract scrollbar size from sizes 16039 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 16040 var width = sizes.width || element.clientWidth || result.width; 16041 var height = sizes.height || element.clientHeight || result.height; 16042 16043 var horizScrollbar = element.offsetWidth - width; 16044 var vertScrollbar = element.offsetHeight - height; 16045 16046 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 16047 // we make this check conditional for performance reasons 16048 if (horizScrollbar || vertScrollbar) { 16049 var styles = getStyleComputedProperty(element); 16050 horizScrollbar -= getBordersSize(styles, 'x'); 16051 vertScrollbar -= getBordersSize(styles, 'y'); 16052 16053 result.width -= horizScrollbar; 16054 result.height -= vertScrollbar; 16055 } 16056 16057 return getClientRect(result); 16058} 16059 16060function getOffsetRectRelativeToArbitraryNode(children, parent) { 16061 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 16062 16063 var isIE10 = isIE(10); 16064 var isHTML = parent.nodeName === 'HTML'; 16065 var childrenRect = getBoundingClientRect(children); 16066 var parentRect = getBoundingClientRect(parent); 16067 var scrollParent = getScrollParent(children); 16068 16069 var styles = getStyleComputedProperty(parent); 16070 var borderTopWidth = parseFloat(styles.borderTopWidth); 16071 var borderLeftWidth = parseFloat(styles.borderLeftWidth); 16072 16073 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 16074 if (fixedPosition && isHTML) { 16075 parentRect.top = Math.max(parentRect.top, 0); 16076 parentRect.left = Math.max(parentRect.left, 0); 16077 } 16078 var offsets = getClientRect({ 16079 top: childrenRect.top - parentRect.top - borderTopWidth, 16080 left: childrenRect.left - parentRect.left - borderLeftWidth, 16081 width: childrenRect.width, 16082 height: childrenRect.height 16083 }); 16084 offsets.marginTop = 0; 16085 offsets.marginLeft = 0; 16086 16087 // Subtract margins of documentElement in case it's being used as parent 16088 // we do this only on HTML because it's the only element that behaves 16089 // differently when margins are applied to it. The margins are included in 16090 // the box of the documentElement, in the other cases not. 16091 if (!isIE10 && isHTML) { 16092 var marginTop = parseFloat(styles.marginTop); 16093 var marginLeft = parseFloat(styles.marginLeft); 16094 16095 offsets.top -= borderTopWidth - marginTop; 16096 offsets.bottom -= borderTopWidth - marginTop; 16097 offsets.left -= borderLeftWidth - marginLeft; 16098 offsets.right -= borderLeftWidth - marginLeft; 16099 16100 // Attach marginTop and marginLeft because in some circumstances we may need them 16101 offsets.marginTop = marginTop; 16102 offsets.marginLeft = marginLeft; 16103 } 16104 16105 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 16106 offsets = includeScroll(offsets, parent); 16107 } 16108 16109 return offsets; 16110} 16111 16112function getViewportOffsetRectRelativeToArtbitraryNode(element) { 16113 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 16114 16115 var html = element.ownerDocument.documentElement; 16116 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 16117 var width = Math.max(html.clientWidth, window.innerWidth || 0); 16118 var height = Math.max(html.clientHeight, window.innerHeight || 0); 16119 16120 var scrollTop = !excludeScroll ? getScroll(html) : 0; 16121 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 16122 16123 var offset = { 16124 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 16125 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 16126 width: width, 16127 height: height 16128 }; 16129 16130 return getClientRect(offset); 16131} 16132 16133/** 16134 * Check if the given element is fixed or is inside a fixed parent 16135 * @method 16136 * @memberof Popper.Utils 16137 * @argument {Element} element 16138 * @argument {Element} customContainer 16139 * @returns {Boolean} answer to "isFixed?" 16140 */ 16141function isFixed(element) { 16142 var nodeName = element.nodeName; 16143 if (nodeName === 'BODY' || nodeName === 'HTML') { 16144 return false; 16145 } 16146 if (getStyleComputedProperty(element, 'position') === 'fixed') { 16147 return true; 16148 } 16149 var parentNode = getParentNode(element); 16150 if (!parentNode) { 16151 return false; 16152 } 16153 return isFixed(parentNode); 16154} 16155 16156/** 16157 * Finds the first parent of an element that has a transformed property defined 16158 * @method 16159 * @memberof Popper.Utils 16160 * @argument {Element} element 16161 * @returns {Element} first transformed parent or documentElement 16162 */ 16163 16164function getFixedPositionOffsetParent(element) { 16165 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 16166 if (!element || !element.parentElement || isIE()) { 16167 return document.documentElement; 16168 } 16169 var el = element.parentElement; 16170 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 16171 el = el.parentElement; 16172 } 16173 return el || document.documentElement; 16174} 16175 16176/** 16177 * Computed the boundaries limits and return them 16178 * @method 16179 * @memberof Popper.Utils 16180 * @param {HTMLElement} popper 16181 * @param {HTMLElement} reference 16182 * @param {number} padding 16183 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 16184 * @param {Boolean} fixedPosition - Is in fixed position mode 16185 * @returns {Object} Coordinates of the boundaries 16186 */ 16187function getBoundaries(popper, reference, padding, boundariesElement) { 16188 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 16189 16190 // NOTE: 1 DOM access here 16191 16192 var boundaries = { top: 0, left: 0 }; 16193 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 16194 16195 // Handle viewport case 16196 if (boundariesElement === 'viewport') { 16197 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 16198 } else { 16199 // Handle other cases based on DOM element used as boundaries 16200 var boundariesNode = void 0; 16201 if (boundariesElement === 'scrollParent') { 16202 boundariesNode = getScrollParent(getParentNode(reference)); 16203 if (boundariesNode.nodeName === 'BODY') { 16204 boundariesNode = popper.ownerDocument.documentElement; 16205 } 16206 } else if (boundariesElement === 'window') { 16207 boundariesNode = popper.ownerDocument.documentElement; 16208 } else { 16209 boundariesNode = boundariesElement; 16210 } 16211 16212 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 16213 16214 // In case of HTML, we need a different computation 16215 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 16216 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 16217 height = _getWindowSizes.height, 16218 width = _getWindowSizes.width; 16219 16220 boundaries.top += offsets.top - offsets.marginTop; 16221 boundaries.bottom = height + offsets.top; 16222 boundaries.left += offsets.left - offsets.marginLeft; 16223 boundaries.right = width + offsets.left; 16224 } else { 16225 // for all the other DOM elements, this one is good 16226 boundaries = offsets; 16227 } 16228 } 16229 16230 // Add paddings 16231 padding = padding || 0; 16232 var isPaddingNumber = typeof padding === 'number'; 16233 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 16234 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 16235 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 16236 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 16237 16238 return boundaries; 16239} 16240 16241function getArea(_ref) { 16242 var width = _ref.width, 16243 height = _ref.height; 16244 16245 return width * height; 16246} 16247 16248/** 16249 * Utility used to transform the `auto` placement to the placement with more 16250 * available space. 16251 * @method 16252 * @memberof Popper.Utils 16253 * @argument {Object} data - The data object generated by update method 16254 * @argument {Object} options - Modifiers configuration and options 16255 * @returns {Object} The data object, properly modified 16256 */ 16257function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 16258 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 16259 16260 if (placement.indexOf('auto') === -1) { 16261 return placement; 16262 } 16263 16264 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 16265 16266 var rects = { 16267 top: { 16268 width: boundaries.width, 16269 height: refRect.top - boundaries.top 16270 }, 16271 right: { 16272 width: boundaries.right - refRect.right, 16273 height: boundaries.height 16274 }, 16275 bottom: { 16276 width: boundaries.width, 16277 height: boundaries.bottom - refRect.bottom 16278 }, 16279 left: { 16280 width: refRect.left - boundaries.left, 16281 height: boundaries.height 16282 } 16283 }; 16284 16285 var sortedAreas = Object.keys(rects).map(function (key) { 16286 return _extends({ 16287 key: key 16288 }, rects[key], { 16289 area: getArea(rects[key]) 16290 }); 16291 }).sort(function (a, b) { 16292 return b.area - a.area; 16293 }); 16294 16295 var filteredAreas = sortedAreas.filter(function (_ref2) { 16296 var width = _ref2.width, 16297 height = _ref2.height; 16298 return width >= popper.clientWidth && height >= popper.clientHeight; 16299 }); 16300 16301 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 16302 16303 var variation = placement.split('-')[1]; 16304 16305 return computedPlacement + (variation ? '-' + variation : ''); 16306} 16307 16308/** 16309 * Get offsets to the reference element 16310 * @method 16311 * @memberof Popper.Utils 16312 * @param {Object} state 16313 * @param {Element} popper - the popper element 16314 * @param {Element} reference - the reference element (the popper will be relative to this) 16315 * @param {Element} fixedPosition - is in fixed position mode 16316 * @returns {Object} An object containing the offsets which will be applied to the popper 16317 */ 16318function getReferenceOffsets(state, popper, reference) { 16319 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 16320 16321 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 16322 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 16323} 16324 16325/** 16326 * Get the outer sizes of the given element (offset size + margins) 16327 * @method 16328 * @memberof Popper.Utils 16329 * @argument {Element} element 16330 * @returns {Object} object containing width and height properties 16331 */ 16332function getOuterSizes(element) { 16333 var window = element.ownerDocument.defaultView; 16334 var styles = window.getComputedStyle(element); 16335 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 16336 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 16337 var result = { 16338 width: element.offsetWidth + y, 16339 height: element.offsetHeight + x 16340 }; 16341 return result; 16342} 16343 16344/** 16345 * Get the opposite placement of the given one 16346 * @method 16347 * @memberof Popper.Utils 16348 * @argument {String} placement 16349 * @returns {String} flipped placement 16350 */ 16351function getOppositePlacement(placement) { 16352 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 16353 return placement.replace(/left|right|bottom|top/g, function (matched) { 16354 return hash[matched]; 16355 }); 16356} 16357 16358/** 16359 * Get offsets to the popper 16360 * @method 16361 * @memberof Popper.Utils 16362 * @param {Object} position - CSS position the Popper will get applied 16363 * @param {HTMLElement} popper - the popper element 16364 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 16365 * @param {String} placement - one of the valid placement options 16366 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 16367 */ 16368function getPopperOffsets(popper, referenceOffsets, placement) { 16369 placement = placement.split('-')[0]; 16370 16371 // Get popper node sizes 16372 var popperRect = getOuterSizes(popper); 16373 16374 // Add position, width and height to our offsets object 16375 var popperOffsets = { 16376 width: popperRect.width, 16377 height: popperRect.height 16378 }; 16379 16380 // depending by the popper placement we have to compute its offsets slightly differently 16381 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 16382 var mainSide = isHoriz ? 'top' : 'left'; 16383 var secondarySide = isHoriz ? 'left' : 'top'; 16384 var measurement = isHoriz ? 'height' : 'width'; 16385 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 16386 16387 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 16388 if (placement === secondarySide) { 16389 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 16390 } else { 16391 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 16392 } 16393 16394 return popperOffsets; 16395} 16396 16397/** 16398 * Mimics the `find` method of Array 16399 * @method 16400 * @memberof Popper.Utils 16401 * @argument {Array} arr 16402 * @argument prop 16403 * @argument value 16404 * @returns index or -1 16405 */ 16406function find(arr, check) { 16407 // use native find if supported 16408 if (Array.prototype.find) { 16409 return arr.find(check); 16410 } 16411 16412 // use `filter` to obtain the same behavior of `find` 16413 return arr.filter(check)[0]; 16414} 16415 16416/** 16417 * Return the index of the matching object 16418 * @method 16419 * @memberof Popper.Utils 16420 * @argument {Array} arr 16421 * @argument prop 16422 * @argument value 16423 * @returns index or -1 16424 */ 16425function findIndex(arr, prop, value) { 16426 // use native findIndex if supported 16427 if (Array.prototype.findIndex) { 16428 return arr.findIndex(function (cur) { 16429 return cur[prop] === value; 16430 }); 16431 } 16432 16433 // use `find` + `indexOf` if `findIndex` isn't supported 16434 var match = find(arr, function (obj) { 16435 return obj[prop] === value; 16436 }); 16437 return arr.indexOf(match); 16438} 16439 16440/** 16441 * Loop trough the list of modifiers and run them in order, 16442 * each of them will then edit the data object. 16443 * @method 16444 * @memberof Popper.Utils 16445 * @param {dataObject} data 16446 * @param {Array} modifiers 16447 * @param {String} ends - Optional modifier name used as stopper 16448 * @returns {dataObject} 16449 */ 16450function runModifiers(modifiers, data, ends) { 16451 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 16452 16453 modifiersToRun.forEach(function (modifier) { 16454 if (modifier['function']) { 16455 // eslint-disable-line dot-notation 16456 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 16457 } 16458 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 16459 if (modifier.enabled && isFunction(fn)) { 16460 // Add properties to offsets to make them a complete clientRect object 16461 // we do this before each modifier to make sure the previous one doesn't 16462 // mess with these values 16463 data.offsets.popper = getClientRect(data.offsets.popper); 16464 data.offsets.reference = getClientRect(data.offsets.reference); 16465 16466 data = fn(data, modifier); 16467 } 16468 }); 16469 16470 return data; 16471} 16472 16473/** 16474 * Updates the position of the popper, computing the new offsets and applying 16475 * the new style.<br /> 16476 * Prefer `scheduleUpdate` over `update` because of performance reasons. 16477 * @method 16478 * @memberof Popper 16479 */ 16480function update() { 16481 // if popper is destroyed, don't perform any further update 16482 if (this.state.isDestroyed) { 16483 return; 16484 } 16485 16486 var data = { 16487 instance: this, 16488 styles: {}, 16489 arrowStyles: {}, 16490 attributes: {}, 16491 flipped: false, 16492 offsets: {} 16493 }; 16494 16495 // compute reference element offsets 16496 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 16497 16498 // compute auto placement, store placement inside the data object, 16499 // modifiers will be able to edit `placement` if needed 16500 // and refer to originalPlacement to know the original value 16501 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 16502 16503 // store the computed placement inside `originalPlacement` 16504 data.originalPlacement = data.placement; 16505 16506 data.positionFixed = this.options.positionFixed; 16507 16508 // compute the popper offsets 16509 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 16510 16511 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 16512 16513 // run the modifiers 16514 data = runModifiers(this.modifiers, data); 16515 16516 // the first `update` will call `onCreate` callback 16517 // the other ones will call `onUpdate` callback 16518 if (!this.state.isCreated) { 16519 this.state.isCreated = true; 16520 this.options.onCreate(data); 16521 } else { 16522 this.options.onUpdate(data); 16523 } 16524} 16525 16526/** 16527 * Helper used to know if the given modifier is enabled. 16528 * @method 16529 * @memberof Popper.Utils 16530 * @returns {Boolean} 16531 */ 16532function isModifierEnabled(modifiers, modifierName) { 16533 return modifiers.some(function (_ref) { 16534 var name = _ref.name, 16535 enabled = _ref.enabled; 16536 return enabled && name === modifierName; 16537 }); 16538} 16539 16540/** 16541 * Get the prefixed supported property name 16542 * @method 16543 * @memberof Popper.Utils 16544 * @argument {String} property (camelCase) 16545 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 16546 */ 16547function getSupportedPropertyName(property) { 16548 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 16549 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 16550 16551 for (var i = 0; i < prefixes.length; i++) { 16552 var prefix = prefixes[i]; 16553 var toCheck = prefix ? '' + prefix + upperProp : property; 16554 if (typeof document.body.style[toCheck] !== 'undefined') { 16555 return toCheck; 16556 } 16557 } 16558 return null; 16559} 16560 16561/** 16562 * Destroys the popper. 16563 * @method 16564 * @memberof Popper 16565 */ 16566function destroy() { 16567 this.state.isDestroyed = true; 16568 16569 // touch DOM only if `applyStyle` modifier is enabled 16570 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 16571 this.popper.removeAttribute('x-placement'); 16572 this.popper.style.position = ''; 16573 this.popper.style.top = ''; 16574 this.popper.style.left = ''; 16575 this.popper.style.right = ''; 16576 this.popper.style.bottom = ''; 16577 this.popper.style.willChange = ''; 16578 this.popper.style[getSupportedPropertyName('transform')] = ''; 16579 } 16580 16581 this.disableEventListeners(); 16582 16583 // remove the popper if user explicitly asked for the deletion on destroy 16584 // do not use `remove` because IE11 doesn't support it 16585 if (this.options.removeOnDestroy) { 16586 this.popper.parentNode.removeChild(this.popper); 16587 } 16588 return this; 16589} 16590 16591/** 16592 * Get the window associated with the element 16593 * @argument {Element} element 16594 * @returns {Window} 16595 */ 16596function getWindow(element) { 16597 var ownerDocument = element.ownerDocument; 16598 return ownerDocument ? ownerDocument.defaultView : window; 16599} 16600 16601function attachToScrollParents(scrollParent, event, callback, scrollParents) { 16602 var isBody = scrollParent.nodeName === 'BODY'; 16603 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 16604 target.addEventListener(event, callback, { passive: true }); 16605 16606 if (!isBody) { 16607 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 16608 } 16609 scrollParents.push(target); 16610} 16611 16612/** 16613 * Setup needed event listeners used to update the popper position 16614 * @method 16615 * @memberof Popper.Utils 16616 * @private 16617 */ 16618function setupEventListeners(reference, options, state, updateBound) { 16619 // Resize event listener on window 16620 state.updateBound = updateBound; 16621 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 16622 16623 // Scroll event listener on scroll parents 16624 var scrollElement = getScrollParent(reference); 16625 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 16626 state.scrollElement = scrollElement; 16627 state.eventsEnabled = true; 16628 16629 return state; 16630} 16631 16632/** 16633 * It will add resize/scroll events and start recalculating 16634 * position of the popper element when they are triggered. 16635 * @method 16636 * @memberof Popper 16637 */ 16638function enableEventListeners() { 16639 if (!this.state.eventsEnabled) { 16640 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 16641 } 16642} 16643 16644/** 16645 * Remove event listeners used to update the popper position 16646 * @method 16647 * @memberof Popper.Utils 16648 * @private 16649 */ 16650function removeEventListeners(reference, state) { 16651 // Remove resize event listener on window 16652 getWindow(reference).removeEventListener('resize', state.updateBound); 16653 16654 // Remove scroll event listener on scroll parents 16655 state.scrollParents.forEach(function (target) { 16656 target.removeEventListener('scroll', state.updateBound); 16657 }); 16658 16659 // Reset state 16660 state.updateBound = null; 16661 state.scrollParents = []; 16662 state.scrollElement = null; 16663 state.eventsEnabled = false; 16664 return state; 16665} 16666 16667/** 16668 * It will remove resize/scroll events and won't recalculate popper position 16669 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 16670 * unless you call `update` method manually. 16671 * @method 16672 * @memberof Popper 16673 */ 16674function disableEventListeners() { 16675 if (this.state.eventsEnabled) { 16676 cancelAnimationFrame(this.scheduleUpdate); 16677 this.state = removeEventListeners(this.reference, this.state); 16678 } 16679} 16680 16681/** 16682 * Tells if a given input is a number 16683 * @method 16684 * @memberof Popper.Utils 16685 * @param {*} input to check 16686 * @return {Boolean} 16687 */ 16688function isNumeric(n) { 16689 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 16690} 16691 16692/** 16693 * Set the style to the given popper 16694 * @method 16695 * @memberof Popper.Utils 16696 * @argument {Element} element - Element to apply the style to 16697 * @argument {Object} styles 16698 * Object with a list of properties and values which will be applied to the element 16699 */ 16700function setStyles(element, styles) { 16701 Object.keys(styles).forEach(function (prop) { 16702 var unit = ''; 16703 // add unit if the value is numeric and is one of the following 16704 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 16705 unit = 'px'; 16706 } 16707 element.style[prop] = styles[prop] + unit; 16708 }); 16709} 16710 16711/** 16712 * Set the attributes to the given popper 16713 * @method 16714 * @memberof Popper.Utils 16715 * @argument {Element} element - Element to apply the attributes to 16716 * @argument {Object} styles 16717 * Object with a list of properties and values which will be applied to the element 16718 */ 16719function setAttributes(element, attributes) { 16720 Object.keys(attributes).forEach(function (prop) { 16721 var value = attributes[prop]; 16722 if (value !== false) { 16723 element.setAttribute(prop, attributes[prop]); 16724 } else { 16725 element.removeAttribute(prop); 16726 } 16727 }); 16728} 16729 16730/** 16731 * @function 16732 * @memberof Modifiers 16733 * @argument {Object} data - The data object generated by `update` method 16734 * @argument {Object} data.styles - List of style properties - values to apply to popper element 16735 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 16736 * @argument {Object} options - Modifiers configuration and options 16737 * @returns {Object} The same data object 16738 */ 16739function applyStyle(data) { 16740 // any property present in `data.styles` will be applied to the popper, 16741 // in this way we can make the 3rd party modifiers add custom styles to it 16742 // Be aware, modifiers could override the properties defined in the previous 16743 // lines of this modifier! 16744 setStyles(data.instance.popper, data.styles); 16745 16746 // any property present in `data.attributes` will be applied to the popper, 16747 // they will be set as HTML attributes of the element 16748 setAttributes(data.instance.popper, data.attributes); 16749 16750 // if arrowElement is defined and arrowStyles has some properties 16751 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 16752 setStyles(data.arrowElement, data.arrowStyles); 16753 } 16754 16755 return data; 16756} 16757 16758/** 16759 * Set the x-placement attribute before everything else because it could be used 16760 * to add margins to the popper margins needs to be calculated to get the 16761 * correct popper offsets. 16762 * @method 16763 * @memberof Popper.modifiers 16764 * @param {HTMLElement} reference - The reference element used to position the popper 16765 * @param {HTMLElement} popper - The HTML element used as popper 16766 * @param {Object} options - Popper.js options 16767 */ 16768function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 16769 // compute reference element offsets 16770 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 16771 16772 // compute auto placement, store placement inside the data object, 16773 // modifiers will be able to edit `placement` if needed 16774 // and refer to originalPlacement to know the original value 16775 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 16776 16777 popper.setAttribute('x-placement', placement); 16778 16779 // Apply `position` to popper before anything else because 16780 // without the position applied we can't guarantee correct computations 16781 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 16782 16783 return options; 16784} 16785 16786/** 16787 * @function 16788 * @memberof Popper.Utils 16789 * @argument {Object} data - The data object generated by `update` method 16790 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 16791 * @returns {Object} The popper's position offsets rounded 16792 * 16793 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 16794 * good as it can be within reason. 16795 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 16796 * 16797 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 16798 * as well on High DPI screens). 16799 * 16800 * Firefox prefers no rounding for positioning and does not have blurriness on 16801 * high DPI screens. 16802 * 16803 * Only horizontal placement and left/right values need to be considered. 16804 */ 16805function getRoundedOffsets(data, shouldRound) { 16806 var _data$offsets = data.offsets, 16807 popper = _data$offsets.popper, 16808 reference = _data$offsets.reference; 16809 var round = Math.round, 16810 floor = Math.floor; 16811 16812 var noRound = function noRound(v) { 16813 return v; 16814 }; 16815 16816 var referenceWidth = round(reference.width); 16817 var popperWidth = round(popper.width); 16818 16819 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 16820 var isVariation = data.placement.indexOf('-') !== -1; 16821 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 16822 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 16823 16824 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 16825 var verticalToInteger = !shouldRound ? noRound : round; 16826 16827 return { 16828 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 16829 top: verticalToInteger(popper.top), 16830 bottom: verticalToInteger(popper.bottom), 16831 right: horizontalToInteger(popper.right) 16832 }; 16833} 16834 16835var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 16836 16837/** 16838 * @function 16839 * @memberof Modifiers 16840 * @argument {Object} data - The data object generated by `update` method 16841 * @argument {Object} options - Modifiers configuration and options 16842 * @returns {Object} The data object, properly modified 16843 */ 16844function computeStyle(data, options) { 16845 var x = options.x, 16846 y = options.y; 16847 var popper = data.offsets.popper; 16848 16849 // Remove this legacy support in Popper.js v2 16850 16851 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 16852 return modifier.name === 'applyStyle'; 16853 }).gpuAcceleration; 16854 if (legacyGpuAccelerationOption !== undefined) { 16855 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 16856 } 16857 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 16858 16859 var offsetParent = getOffsetParent(data.instance.popper); 16860 var offsetParentRect = getBoundingClientRect(offsetParent); 16861 16862 // Styles 16863 var styles = { 16864 position: popper.position 16865 }; 16866 16867 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 16868 16869 var sideA = x === 'bottom' ? 'top' : 'bottom'; 16870 var sideB = y === 'right' ? 'left' : 'right'; 16871 16872 // if gpuAcceleration is set to `true` and transform is supported, 16873 // we use `translate3d` to apply the position to the popper we 16874 // automatically use the supported prefixed version if needed 16875 var prefixedProperty = getSupportedPropertyName('transform'); 16876 16877 // now, let's make a step back and look at this code closely (wtf?) 16878 // If the content of the popper grows once it's been positioned, it 16879 // may happen that the popper gets misplaced because of the new content 16880 // overflowing its reference element 16881 // To avoid this problem, we provide two options (x and y), which allow 16882 // the consumer to define the offset origin. 16883 // If we position a popper on top of a reference element, we can set 16884 // `x` to `top` to make the popper grow towards its top instead of 16885 // its bottom. 16886 var left = void 0, 16887 top = void 0; 16888 if (sideA === 'bottom') { 16889 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 16890 // and not the bottom of the html element 16891 if (offsetParent.nodeName === 'HTML') { 16892 top = -offsetParent.clientHeight + offsets.bottom; 16893 } else { 16894 top = -offsetParentRect.height + offsets.bottom; 16895 } 16896 } else { 16897 top = offsets.top; 16898 } 16899 if (sideB === 'right') { 16900 if (offsetParent.nodeName === 'HTML') { 16901 left = -offsetParent.clientWidth + offsets.right; 16902 } else { 16903 left = -offsetParentRect.width + offsets.right; 16904 } 16905 } else { 16906 left = offsets.left; 16907 } 16908 if (gpuAcceleration && prefixedProperty) { 16909 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 16910 styles[sideA] = 0; 16911 styles[sideB] = 0; 16912 styles.willChange = 'transform'; 16913 } else { 16914 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 16915 var invertTop = sideA === 'bottom' ? -1 : 1; 16916 var invertLeft = sideB === 'right' ? -1 : 1; 16917 styles[sideA] = top * invertTop; 16918 styles[sideB] = left * invertLeft; 16919 styles.willChange = sideA + ', ' + sideB; 16920 } 16921 16922 // Attributes 16923 var attributes = { 16924 'x-placement': data.placement 16925 }; 16926 16927 // Update `data` attributes, styles and arrowStyles 16928 data.attributes = _extends({}, attributes, data.attributes); 16929 data.styles = _extends({}, styles, data.styles); 16930 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 16931 16932 return data; 16933} 16934 16935/** 16936 * Helper used to know if the given modifier depends from another one.<br /> 16937 * It checks if the needed modifier is listed and enabled. 16938 * @method 16939 * @memberof Popper.Utils 16940 * @param {Array} modifiers - list of modifiers 16941 * @param {String} requestingName - name of requesting modifier 16942 * @param {String} requestedName - name of requested modifier 16943 * @returns {Boolean} 16944 */ 16945function isModifierRequired(modifiers, requestingName, requestedName) { 16946 var requesting = find(modifiers, function (_ref) { 16947 var name = _ref.name; 16948 return name === requestingName; 16949 }); 16950 16951 var isRequired = !!requesting && modifiers.some(function (modifier) { 16952 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 16953 }); 16954 16955 if (!isRequired) { 16956 var _requesting = '`' + requestingName + '`'; 16957 var requested = '`' + requestedName + '`'; 16958 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 16959 } 16960 return isRequired; 16961} 16962 16963/** 16964 * @function 16965 * @memberof Modifiers 16966 * @argument {Object} data - The data object generated by update method 16967 * @argument {Object} options - Modifiers configuration and options 16968 * @returns {Object} The data object, properly modified 16969 */ 16970function arrow(data, options) { 16971 var _data$offsets$arrow; 16972 16973 // arrow depends on keepTogether in order to work 16974 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 16975 return data; 16976 } 16977 16978 var arrowElement = options.element; 16979 16980 // if arrowElement is a string, suppose it's a CSS selector 16981 if (typeof arrowElement === 'string') { 16982 arrowElement = data.instance.popper.querySelector(arrowElement); 16983 16984 // if arrowElement is not found, don't run the modifier 16985 if (!arrowElement) { 16986 return data; 16987 } 16988 } else { 16989 // if the arrowElement isn't a query selector we must check that the 16990 // provided DOM node is child of its popper node 16991 if (!data.instance.popper.contains(arrowElement)) { 16992 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 16993 return data; 16994 } 16995 } 16996 16997 var placement = data.placement.split('-')[0]; 16998 var _data$offsets = data.offsets, 16999 popper = _data$offsets.popper, 17000 reference = _data$offsets.reference; 17001 17002 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 17003 17004 var len = isVertical ? 'height' : 'width'; 17005 var sideCapitalized = isVertical ? 'Top' : 'Left'; 17006 var side = sideCapitalized.toLowerCase(); 17007 var altSide = isVertical ? 'left' : 'top'; 17008 var opSide = isVertical ? 'bottom' : 'right'; 17009 var arrowElementSize = getOuterSizes(arrowElement)[len]; 17010 17011 // 17012 // extends keepTogether behavior making sure the popper and its 17013 // reference have enough pixels in conjunction 17014 // 17015 17016 // top/left side 17017 if (reference[opSide] - arrowElementSize < popper[side]) { 17018 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 17019 } 17020 // bottom/right side 17021 if (reference[side] + arrowElementSize > popper[opSide]) { 17022 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 17023 } 17024 data.offsets.popper = getClientRect(data.offsets.popper); 17025 17026 // compute center of the popper 17027 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 17028 17029 // Compute the sideValue using the updated popper offsets 17030 // take popper margin in account because we don't have this info available 17031 var css = getStyleComputedProperty(data.instance.popper); 17032 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); 17033 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); 17034 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 17035 17036 // prevent arrowElement from being placed not contiguously to its popper 17037 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 17038 17039 data.arrowElement = arrowElement; 17040 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 17041 17042 return data; 17043} 17044 17045/** 17046 * Get the opposite placement variation of the given one 17047 * @method 17048 * @memberof Popper.Utils 17049 * @argument {String} placement variation 17050 * @returns {String} flipped placement variation 17051 */ 17052function getOppositeVariation(variation) { 17053 if (variation === 'end') { 17054 return 'start'; 17055 } else if (variation === 'start') { 17056 return 'end'; 17057 } 17058 return variation; 17059} 17060 17061/** 17062 * List of accepted placements to use as values of the `placement` option.<br /> 17063 * Valid placements are: 17064 * - `auto` 17065 * - `top` 17066 * - `right` 17067 * - `bottom` 17068 * - `left` 17069 * 17070 * Each placement can have a variation from this list: 17071 * - `-start` 17072 * - `-end` 17073 * 17074 * Variations are interpreted easily if you think of them as the left to right 17075 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 17076 * is right.<br /> 17077 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 17078 * 17079 * Some valid examples are: 17080 * - `top-end` (on top of reference, right aligned) 17081 * - `right-start` (on right of reference, top aligned) 17082 * - `bottom` (on bottom, centered) 17083 * - `auto-end` (on the side with more space available, alignment depends by placement) 17084 * 17085 * @static 17086 * @type {Array} 17087 * @enum {String} 17088 * @readonly 17089 * @method placements 17090 * @memberof Popper 17091 */ 17092var 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']; 17093 17094// Get rid of `auto` `auto-start` and `auto-end` 17095var validPlacements = placements.slice(3); 17096 17097/** 17098 * Given an initial placement, returns all the subsequent placements 17099 * clockwise (or counter-clockwise). 17100 * 17101 * @method 17102 * @memberof Popper.Utils 17103 * @argument {String} placement - A valid placement (it accepts variations) 17104 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 17105 * @returns {Array} placements including their variations 17106 */ 17107function clockwise(placement) { 17108 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 17109 17110 var index = validPlacements.indexOf(placement); 17111 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 17112 return counter ? arr.reverse() : arr; 17113} 17114 17115var BEHAVIORS = { 17116 FLIP: 'flip', 17117 CLOCKWISE: 'clockwise', 17118 COUNTERCLOCKWISE: 'counterclockwise' 17119}; 17120 17121/** 17122 * @function 17123 * @memberof Modifiers 17124 * @argument {Object} data - The data object generated by update method 17125 * @argument {Object} options - Modifiers configuration and options 17126 * @returns {Object} The data object, properly modified 17127 */ 17128function flip(data, options) { 17129 // if `inner` modifier is enabled, we can't use the `flip` modifier 17130 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 17131 return data; 17132 } 17133 17134 if (data.flipped && data.placement === data.originalPlacement) { 17135 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 17136 return data; 17137 } 17138 17139 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 17140 17141 var placement = data.placement.split('-')[0]; 17142 var placementOpposite = getOppositePlacement(placement); 17143 var variation = data.placement.split('-')[1] || ''; 17144 17145 var flipOrder = []; 17146 17147 switch (options.behavior) { 17148 case BEHAVIORS.FLIP: 17149 flipOrder = [placement, placementOpposite]; 17150 break; 17151 case BEHAVIORS.CLOCKWISE: 17152 flipOrder = clockwise(placement); 17153 break; 17154 case BEHAVIORS.COUNTERCLOCKWISE: 17155 flipOrder = clockwise(placement, true); 17156 break; 17157 default: 17158 flipOrder = options.behavior; 17159 } 17160 17161 flipOrder.forEach(function (step, index) { 17162 if (placement !== step || flipOrder.length === index + 1) { 17163 return data; 17164 } 17165 17166 placement = data.placement.split('-')[0]; 17167 placementOpposite = getOppositePlacement(placement); 17168 17169 var popperOffsets = data.offsets.popper; 17170 var refOffsets = data.offsets.reference; 17171 17172 // using floor because the reference offsets may contain decimals we are not going to consider here 17173 var floor = Math.floor; 17174 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); 17175 17176 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 17177 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 17178 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 17179 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 17180 17181 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 17182 17183 // flip the variation if required 17184 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 17185 17186 // flips variation if reference element overflows boundaries 17187 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 17188 17189 // flips variation if popper content overflows boundaries 17190 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 17191 17192 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 17193 17194 if (overlapsRef || overflowsBoundaries || flippedVariation) { 17195 // this boolean to detect any flip loop 17196 data.flipped = true; 17197 17198 if (overlapsRef || overflowsBoundaries) { 17199 placement = flipOrder[index + 1]; 17200 } 17201 17202 if (flippedVariation) { 17203 variation = getOppositeVariation(variation); 17204 } 17205 17206 data.placement = placement + (variation ? '-' + variation : ''); 17207 17208 // this object contains `position`, we want to preserve it along with 17209 // any additional property we may add in the future 17210 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 17211 17212 data = runModifiers(data.instance.modifiers, data, 'flip'); 17213 } 17214 }); 17215 return data; 17216} 17217 17218/** 17219 * @function 17220 * @memberof Modifiers 17221 * @argument {Object} data - The data object generated by update method 17222 * @argument {Object} options - Modifiers configuration and options 17223 * @returns {Object} The data object, properly modified 17224 */ 17225function keepTogether(data) { 17226 var _data$offsets = data.offsets, 17227 popper = _data$offsets.popper, 17228 reference = _data$offsets.reference; 17229 17230 var placement = data.placement.split('-')[0]; 17231 var floor = Math.floor; 17232 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 17233 var side = isVertical ? 'right' : 'bottom'; 17234 var opSide = isVertical ? 'left' : 'top'; 17235 var measurement = isVertical ? 'width' : 'height'; 17236 17237 if (popper[side] < floor(reference[opSide])) { 17238 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 17239 } 17240 if (popper[opSide] > floor(reference[side])) { 17241 data.offsets.popper[opSide] = floor(reference[side]); 17242 } 17243 17244 return data; 17245} 17246 17247/** 17248 * Converts a string containing value + unit into a px value number 17249 * @function 17250 * @memberof {modifiers~offset} 17251 * @private 17252 * @argument {String} str - Value + unit string 17253 * @argument {String} measurement - `height` or `width` 17254 * @argument {Object} popperOffsets 17255 * @argument {Object} referenceOffsets 17256 * @returns {Number|String} 17257 * Value in pixels, or original string if no values were extracted 17258 */ 17259function toValue(str, measurement, popperOffsets, referenceOffsets) { 17260 // separate value from unit 17261 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 17262 var value = +split[1]; 17263 var unit = split[2]; 17264 17265 // If it's not a number it's an operator, I guess 17266 if (!value) { 17267 return str; 17268 } 17269 17270 if (unit.indexOf('%') === 0) { 17271 var element = void 0; 17272 switch (unit) { 17273 case '%p': 17274 element = popperOffsets; 17275 break; 17276 case '%': 17277 case '%r': 17278 default: 17279 element = referenceOffsets; 17280 } 17281 17282 var rect = getClientRect(element); 17283 return rect[measurement] / 100 * value; 17284 } else if (unit === 'vh' || unit === 'vw') { 17285 // if is a vh or vw, we calculate the size based on the viewport 17286 var size = void 0; 17287 if (unit === 'vh') { 17288 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 17289 } else { 17290 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 17291 } 17292 return size / 100 * value; 17293 } else { 17294 // if is an explicit pixel unit, we get rid of the unit and keep the value 17295 // if is an implicit unit, it's px, and we return just the value 17296 return value; 17297 } 17298} 17299 17300/** 17301 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 17302 * @function 17303 * @memberof {modifiers~offset} 17304 * @private 17305 * @argument {String} offset 17306 * @argument {Object} popperOffsets 17307 * @argument {Object} referenceOffsets 17308 * @argument {String} basePlacement 17309 * @returns {Array} a two cells array with x and y offsets in numbers 17310 */ 17311function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 17312 var offsets = [0, 0]; 17313 17314 // Use height if placement is left or right and index is 0 otherwise use width 17315 // in this way the first offset will use an axis and the second one 17316 // will use the other one 17317 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 17318 17319 // Split the offset string to obtain a list of values and operands 17320 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 17321 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 17322 return frag.trim(); 17323 }); 17324 17325 // Detect if the offset string contains a pair of values or a single one 17326 // they could be separated by comma or space 17327 var divider = fragments.indexOf(find(fragments, function (frag) { 17328 return frag.search(/,|\s/) !== -1; 17329 })); 17330 17331 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 17332 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 17333 } 17334 17335 // If divider is found, we divide the list of values and operands to divide 17336 // them by ofset X and Y. 17337 var splitRegex = /\s*,\s*|\s+/; 17338 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]; 17339 17340 // Convert the values with units to absolute pixels to allow our computations 17341 ops = ops.map(function (op, index) { 17342 // Most of the units rely on the orientation of the popper 17343 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 17344 var mergeWithPrevious = false; 17345 return op 17346 // This aggregates any `+` or `-` sign that aren't considered operators 17347 // e.g.: 10 + +5 => [10, +, +5] 17348 .reduce(function (a, b) { 17349 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 17350 a[a.length - 1] = b; 17351 mergeWithPrevious = true; 17352 return a; 17353 } else if (mergeWithPrevious) { 17354 a[a.length - 1] += b; 17355 mergeWithPrevious = false; 17356 return a; 17357 } else { 17358 return a.concat(b); 17359 } 17360 }, []) 17361 // Here we convert the string values into number values (in px) 17362 .map(function (str) { 17363 return toValue(str, measurement, popperOffsets, referenceOffsets); 17364 }); 17365 }); 17366 17367 // Loop trough the offsets arrays and execute the operations 17368 ops.forEach(function (op, index) { 17369 op.forEach(function (frag, index2) { 17370 if (isNumeric(frag)) { 17371 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 17372 } 17373 }); 17374 }); 17375 return offsets; 17376} 17377 17378/** 17379 * @function 17380 * @memberof Modifiers 17381 * @argument {Object} data - The data object generated by update method 17382 * @argument {Object} options - Modifiers configuration and options 17383 * @argument {Number|String} options.offset=0 17384 * The offset value as described in the modifier description 17385 * @returns {Object} The data object, properly modified 17386 */ 17387function offset(data, _ref) { 17388 var offset = _ref.offset; 17389 var placement = data.placement, 17390 _data$offsets = data.offsets, 17391 popper = _data$offsets.popper, 17392 reference = _data$offsets.reference; 17393 17394 var basePlacement = placement.split('-')[0]; 17395 17396 var offsets = void 0; 17397 if (isNumeric(+offset)) { 17398 offsets = [+offset, 0]; 17399 } else { 17400 offsets = parseOffset(offset, popper, reference, basePlacement); 17401 } 17402 17403 if (basePlacement === 'left') { 17404 popper.top += offsets[0]; 17405 popper.left -= offsets[1]; 17406 } else if (basePlacement === 'right') { 17407 popper.top += offsets[0]; 17408 popper.left += offsets[1]; 17409 } else if (basePlacement === 'top') { 17410 popper.left += offsets[0]; 17411 popper.top -= offsets[1]; 17412 } else if (basePlacement === 'bottom') { 17413 popper.left += offsets[0]; 17414 popper.top += offsets[1]; 17415 } 17416 17417 data.popper = popper; 17418 return data; 17419} 17420 17421/** 17422 * @function 17423 * @memberof Modifiers 17424 * @argument {Object} data - The data object generated by `update` method 17425 * @argument {Object} options - Modifiers configuration and options 17426 * @returns {Object} The data object, properly modified 17427 */ 17428function preventOverflow(data, options) { 17429 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 17430 17431 // If offsetParent is the reference element, we really want to 17432 // go one step up and use the next offsetParent as reference to 17433 // avoid to make this modifier completely useless and look like broken 17434 if (data.instance.reference === boundariesElement) { 17435 boundariesElement = getOffsetParent(boundariesElement); 17436 } 17437 17438 // NOTE: DOM access here 17439 // resets the popper's position so that the document size can be calculated excluding 17440 // the size of the popper element itself 17441 var transformProp = getSupportedPropertyName('transform'); 17442 var popperStyles = data.instance.popper.style; // assignment to help minification 17443 var top = popperStyles.top, 17444 left = popperStyles.left, 17445 transform = popperStyles[transformProp]; 17446 17447 popperStyles.top = ''; 17448 popperStyles.left = ''; 17449 popperStyles[transformProp] = ''; 17450 17451 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 17452 17453 // NOTE: DOM access here 17454 // restores the original style properties after the offsets have been computed 17455 popperStyles.top = top; 17456 popperStyles.left = left; 17457 popperStyles[transformProp] = transform; 17458 17459 options.boundaries = boundaries; 17460 17461 var order = options.priority; 17462 var popper = data.offsets.popper; 17463 17464 var check = { 17465 primary: function primary(placement) { 17466 var value = popper[placement]; 17467 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 17468 value = Math.max(popper[placement], boundaries[placement]); 17469 } 17470 return defineProperty({}, placement, value); 17471 }, 17472 secondary: function secondary(placement) { 17473 var mainSide = placement === 'right' ? 'left' : 'top'; 17474 var value = popper[mainSide]; 17475 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 17476 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 17477 } 17478 return defineProperty({}, mainSide, value); 17479 } 17480 }; 17481 17482 order.forEach(function (placement) { 17483 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 17484 popper = _extends({}, popper, check[side](placement)); 17485 }); 17486 17487 data.offsets.popper = popper; 17488 17489 return data; 17490} 17491 17492/** 17493 * @function 17494 * @memberof Modifiers 17495 * @argument {Object} data - The data object generated by `update` method 17496 * @argument {Object} options - Modifiers configuration and options 17497 * @returns {Object} The data object, properly modified 17498 */ 17499function shift(data) { 17500 var placement = data.placement; 17501 var basePlacement = placement.split('-')[0]; 17502 var shiftvariation = placement.split('-')[1]; 17503 17504 // if shift shiftvariation is specified, run the modifier 17505 if (shiftvariation) { 17506 var _data$offsets = data.offsets, 17507 reference = _data$offsets.reference, 17508 popper = _data$offsets.popper; 17509 17510 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 17511 var side = isVertical ? 'left' : 'top'; 17512 var measurement = isVertical ? 'width' : 'height'; 17513 17514 var shiftOffsets = { 17515 start: defineProperty({}, side, reference[side]), 17516 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 17517 }; 17518 17519 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 17520 } 17521 17522 return data; 17523} 17524 17525/** 17526 * @function 17527 * @memberof Modifiers 17528 * @argument {Object} data - The data object generated by update method 17529 * @argument {Object} options - Modifiers configuration and options 17530 * @returns {Object} The data object, properly modified 17531 */ 17532function hide(data) { 17533 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 17534 return data; 17535 } 17536 17537 var refRect = data.offsets.reference; 17538 var bound = find(data.instance.modifiers, function (modifier) { 17539 return modifier.name === 'preventOverflow'; 17540 }).boundaries; 17541 17542 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 17543 // Avoid unnecessary DOM access if visibility hasn't changed 17544 if (data.hide === true) { 17545 return data; 17546 } 17547 17548 data.hide = true; 17549 data.attributes['x-out-of-boundaries'] = ''; 17550 } else { 17551 // Avoid unnecessary DOM access if visibility hasn't changed 17552 if (data.hide === false) { 17553 return data; 17554 } 17555 17556 data.hide = false; 17557 data.attributes['x-out-of-boundaries'] = false; 17558 } 17559 17560 return data; 17561} 17562 17563/** 17564 * @function 17565 * @memberof Modifiers 17566 * @argument {Object} data - The data object generated by `update` method 17567 * @argument {Object} options - Modifiers configuration and options 17568 * @returns {Object} The data object, properly modified 17569 */ 17570function inner(data) { 17571 var placement = data.placement; 17572 var basePlacement = placement.split('-')[0]; 17573 var _data$offsets = data.offsets, 17574 popper = _data$offsets.popper, 17575 reference = _data$offsets.reference; 17576 17577 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 17578 17579 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 17580 17581 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 17582 17583 data.placement = getOppositePlacement(placement); 17584 data.offsets.popper = getClientRect(popper); 17585 17586 return data; 17587} 17588 17589/** 17590 * Modifier function, each modifier can have a function of this type assigned 17591 * to its `fn` property.<br /> 17592 * These functions will be called on each update, this means that you must 17593 * make sure they are performant enough to avoid performance bottlenecks. 17594 * 17595 * @function ModifierFn 17596 * @argument {dataObject} data - The data object generated by `update` method 17597 * @argument {Object} options - Modifiers configuration and options 17598 * @returns {dataObject} The data object, properly modified 17599 */ 17600 17601/** 17602 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 17603 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 17604 * needed by the library. 17605 * 17606 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 17607 * All the other properties are configurations that could be tweaked. 17608 * @namespace modifiers 17609 */ 17610var modifiers = { 17611 /** 17612 * Modifier used to shift the popper on the start or end of its reference 17613 * element.<br /> 17614 * It will read the variation of the `placement` property.<br /> 17615 * It can be one either `-end` or `-start`. 17616 * @memberof modifiers 17617 * @inner 17618 */ 17619 shift: { 17620 /** @prop {number} order=100 - Index used to define the order of execution */ 17621 order: 100, 17622 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17623 enabled: true, 17624 /** @prop {ModifierFn} */ 17625 fn: shift 17626 }, 17627 17628 /** 17629 * The `offset` modifier can shift your popper on both its axis. 17630 * 17631 * It accepts the following units: 17632 * - `px` or unit-less, interpreted as pixels 17633 * - `%` or `%r`, percentage relative to the length of the reference element 17634 * - `%p`, percentage relative to the length of the popper element 17635 * - `vw`, CSS viewport width unit 17636 * - `vh`, CSS viewport height unit 17637 * 17638 * For length is intended the main axis relative to the placement of the popper.<br /> 17639 * This means that if the placement is `top` or `bottom`, the length will be the 17640 * `width`. In case of `left` or `right`, it will be the `height`. 17641 * 17642 * You can provide a single value (as `Number` or `String`), or a pair of values 17643 * as `String` divided by a comma or one (or more) white spaces.<br /> 17644 * The latter is a deprecated method because it leads to confusion and will be 17645 * removed in v2.<br /> 17646 * Additionally, it accepts additions and subtractions between different units. 17647 * Note that multiplications and divisions aren't supported. 17648 * 17649 * Valid examples are: 17650 * ``` 17651 * 10 17652 * '10%' 17653 * '10, 10' 17654 * '10%, 10' 17655 * '10 + 10%' 17656 * '10 - 5vh + 3%' 17657 * '-10px + 5vh, 5px - 6%' 17658 * ``` 17659 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 17660 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 17661 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 17662 * 17663 * @memberof modifiers 17664 * @inner 17665 */ 17666 offset: { 17667 /** @prop {number} order=200 - Index used to define the order of execution */ 17668 order: 200, 17669 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17670 enabled: true, 17671 /** @prop {ModifierFn} */ 17672 fn: offset, 17673 /** @prop {Number|String} offset=0 17674 * The offset value as described in the modifier description 17675 */ 17676 offset: 0 17677 }, 17678 17679 /** 17680 * Modifier used to prevent the popper from being positioned outside the boundary. 17681 * 17682 * A scenario exists where the reference itself is not within the boundaries.<br /> 17683 * We can say it has "escaped the boundaries" — or just "escaped".<br /> 17684 * In this case we need to decide whether the popper should either: 17685 * 17686 * - detach from the reference and remain "trapped" in the boundaries, or 17687 * - if it should ignore the boundary and "escape with its reference" 17688 * 17689 * When `escapeWithReference` is set to`true` and reference is completely 17690 * outside its boundaries, the popper will overflow (or completely leave) 17691 * the boundaries in order to remain attached to the edge of the reference. 17692 * 17693 * @memberof modifiers 17694 * @inner 17695 */ 17696 preventOverflow: { 17697 /** @prop {number} order=300 - Index used to define the order of execution */ 17698 order: 300, 17699 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17700 enabled: true, 17701 /** @prop {ModifierFn} */ 17702 fn: preventOverflow, 17703 /** 17704 * @prop {Array} [priority=['left','right','top','bottom']] 17705 * Popper will try to prevent overflow following these priorities by default, 17706 * then, it could overflow on the left and on top of the `boundariesElement` 17707 */ 17708 priority: ['left', 'right', 'top', 'bottom'], 17709 /** 17710 * @prop {number} padding=5 17711 * Amount of pixel used to define a minimum distance between the boundaries 17712 * and the popper. This makes sure the popper always has a little padding 17713 * between the edges of its container 17714 */ 17715 padding: 5, 17716 /** 17717 * @prop {String|HTMLElement} boundariesElement='scrollParent' 17718 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 17719 * `viewport` or any DOM element. 17720 */ 17721 boundariesElement: 'scrollParent' 17722 }, 17723 17724 /** 17725 * Modifier used to make sure the reference and its popper stay near each other 17726 * without leaving any gap between the two. Especially useful when the arrow is 17727 * enabled and you want to ensure that it points to its reference element. 17728 * It cares only about the first axis. You can still have poppers with margin 17729 * between the popper and its reference element. 17730 * @memberof modifiers 17731 * @inner 17732 */ 17733 keepTogether: { 17734 /** @prop {number} order=400 - Index used to define the order of execution */ 17735 order: 400, 17736 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17737 enabled: true, 17738 /** @prop {ModifierFn} */ 17739 fn: keepTogether 17740 }, 17741 17742 /** 17743 * This modifier is used to move the `arrowElement` of the popper to make 17744 * sure it is positioned between the reference element and its popper element. 17745 * It will read the outer size of the `arrowElement` node to detect how many 17746 * pixels of conjunction are needed. 17747 * 17748 * It has no effect if no `arrowElement` is provided. 17749 * @memberof modifiers 17750 * @inner 17751 */ 17752 arrow: { 17753 /** @prop {number} order=500 - Index used to define the order of execution */ 17754 order: 500, 17755 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17756 enabled: true, 17757 /** @prop {ModifierFn} */ 17758 fn: arrow, 17759 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 17760 element: '[x-arrow]' 17761 }, 17762 17763 /** 17764 * Modifier used to flip the popper's placement when it starts to overlap its 17765 * reference element. 17766 * 17767 * Requires the `preventOverflow` modifier before it in order to work. 17768 * 17769 * **NOTE:** this modifier will interrupt the current update cycle and will 17770 * restart it if it detects the need to flip the placement. 17771 * @memberof modifiers 17772 * @inner 17773 */ 17774 flip: { 17775 /** @prop {number} order=600 - Index used to define the order of execution */ 17776 order: 600, 17777 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17778 enabled: true, 17779 /** @prop {ModifierFn} */ 17780 fn: flip, 17781 /** 17782 * @prop {String|Array} behavior='flip' 17783 * The behavior used to change the popper's placement. It can be one of 17784 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 17785 * placements (with optional variations) 17786 */ 17787 behavior: 'flip', 17788 /** 17789 * @prop {number} padding=5 17790 * The popper will flip if it hits the edges of the `boundariesElement` 17791 */ 17792 padding: 5, 17793 /** 17794 * @prop {String|HTMLElement} boundariesElement='viewport' 17795 * The element which will define the boundaries of the popper position. 17796 * The popper will never be placed outside of the defined boundaries 17797 * (except if `keepTogether` is enabled) 17798 */ 17799 boundariesElement: 'viewport', 17800 /** 17801 * @prop {Boolean} flipVariations=false 17802 * The popper will switch placement variation between `-start` and `-end` when 17803 * the reference element overlaps its boundaries. 17804 * 17805 * The original placement should have a set variation. 17806 */ 17807 flipVariations: false, 17808 /** 17809 * @prop {Boolean} flipVariationsByContent=false 17810 * The popper will switch placement variation between `-start` and `-end` when 17811 * the popper element overlaps its reference boundaries. 17812 * 17813 * The original placement should have a set variation. 17814 */ 17815 flipVariationsByContent: false 17816 }, 17817 17818 /** 17819 * Modifier used to make the popper flow toward the inner of the reference element. 17820 * By default, when this modifier is disabled, the popper will be placed outside 17821 * the reference element. 17822 * @memberof modifiers 17823 * @inner 17824 */ 17825 inner: { 17826 /** @prop {number} order=700 - Index used to define the order of execution */ 17827 order: 700, 17828 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 17829 enabled: false, 17830 /** @prop {ModifierFn} */ 17831 fn: inner 17832 }, 17833 17834 /** 17835 * Modifier used to hide the popper when its reference element is outside of the 17836 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 17837 * be used to hide with a CSS selector the popper when its reference is 17838 * out of boundaries. 17839 * 17840 * Requires the `preventOverflow` modifier before it in order to work. 17841 * @memberof modifiers 17842 * @inner 17843 */ 17844 hide: { 17845 /** @prop {number} order=800 - Index used to define the order of execution */ 17846 order: 800, 17847 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17848 enabled: true, 17849 /** @prop {ModifierFn} */ 17850 fn: hide 17851 }, 17852 17853 /** 17854 * Computes the style that will be applied to the popper element to gets 17855 * properly positioned. 17856 * 17857 * Note that this modifier will not touch the DOM, it just prepares the styles 17858 * so that `applyStyle` modifier can apply it. This separation is useful 17859 * in case you need to replace `applyStyle` with a custom implementation. 17860 * 17861 * This modifier has `850` as `order` value to maintain backward compatibility 17862 * with previous versions of Popper.js. Expect the modifiers ordering method 17863 * to change in future major versions of the library. 17864 * 17865 * @memberof modifiers 17866 * @inner 17867 */ 17868 computeStyle: { 17869 /** @prop {number} order=850 - Index used to define the order of execution */ 17870 order: 850, 17871 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17872 enabled: true, 17873 /** @prop {ModifierFn} */ 17874 fn: computeStyle, 17875 /** 17876 * @prop {Boolean} gpuAcceleration=true 17877 * If true, it uses the CSS 3D transformation to position the popper. 17878 * Otherwise, it will use the `top` and `left` properties 17879 */ 17880 gpuAcceleration: true, 17881 /** 17882 * @prop {string} [x='bottom'] 17883 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 17884 * Change this if your popper should grow in a direction different from `bottom` 17885 */ 17886 x: 'bottom', 17887 /** 17888 * @prop {string} [x='left'] 17889 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 17890 * Change this if your popper should grow in a direction different from `right` 17891 */ 17892 y: 'right' 17893 }, 17894 17895 /** 17896 * Applies the computed styles to the popper element. 17897 * 17898 * All the DOM manipulations are limited to this modifier. This is useful in case 17899 * you want to integrate Popper.js inside a framework or view library and you 17900 * want to delegate all the DOM manipulations to it. 17901 * 17902 * Note that if you disable this modifier, you must make sure the popper element 17903 * has its position set to `absolute` before Popper.js can do its work! 17904 * 17905 * Just disable this modifier and define your own to achieve the desired effect. 17906 * 17907 * @memberof modifiers 17908 * @inner 17909 */ 17910 applyStyle: { 17911 /** @prop {number} order=900 - Index used to define the order of execution */ 17912 order: 900, 17913 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17914 enabled: true, 17915 /** @prop {ModifierFn} */ 17916 fn: applyStyle, 17917 /** @prop {Function} */ 17918 onLoad: applyStyleOnLoad, 17919 /** 17920 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 17921 * @prop {Boolean} gpuAcceleration=true 17922 * If true, it uses the CSS 3D transformation to position the popper. 17923 * Otherwise, it will use the `top` and `left` properties 17924 */ 17925 gpuAcceleration: undefined 17926 } 17927}; 17928 17929/** 17930 * The `dataObject` is an object containing all the information used by Popper.js. 17931 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 17932 * @name dataObject 17933 * @property {Object} data.instance The Popper.js instance 17934 * @property {String} data.placement Placement applied to popper 17935 * @property {String} data.originalPlacement Placement originally defined on init 17936 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 17937 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 17938 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 17939 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 17940 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 17941 * @property {Object} data.boundaries Offsets of the popper boundaries 17942 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 17943 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 17944 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 17945 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 17946 */ 17947 17948/** 17949 * Default options provided to Popper.js constructor.<br /> 17950 * These can be overridden using the `options` argument of Popper.js.<br /> 17951 * To override an option, simply pass an object with the same 17952 * structure of the `options` object, as the 3rd argument. For example: 17953 * ``` 17954 * new Popper(ref, pop, { 17955 * modifiers: { 17956 * preventOverflow: { enabled: false } 17957 * } 17958 * }) 17959 * ``` 17960 * @type {Object} 17961 * @static 17962 * @memberof Popper 17963 */ 17964var Defaults = { 17965 /** 17966 * Popper's placement. 17967 * @prop {Popper.placements} placement='bottom' 17968 */ 17969 placement: 'bottom', 17970 17971 /** 17972 * Set this to true if you want popper to position it self in 'fixed' mode 17973 * @prop {Boolean} positionFixed=false 17974 */ 17975 positionFixed: false, 17976 17977 /** 17978 * Whether events (resize, scroll) are initially enabled. 17979 * @prop {Boolean} eventsEnabled=true 17980 */ 17981 eventsEnabled: true, 17982 17983 /** 17984 * Set to true if you want to automatically remove the popper when 17985 * you call the `destroy` method. 17986 * @prop {Boolean} removeOnDestroy=false 17987 */ 17988 removeOnDestroy: false, 17989 17990 /** 17991 * Callback called when the popper is created.<br /> 17992 * By default, it is set to no-op.<br /> 17993 * Access Popper.js instance with `data.instance`. 17994 * @prop {onCreate} 17995 */ 17996 onCreate: function onCreate() {}, 17997 17998 /** 17999 * Callback called when the popper is updated. This callback is not called 18000 * on the initialization/creation of the popper, but only on subsequent 18001 * updates.<br /> 18002 * By default, it is set to no-op.<br /> 18003 * Access Popper.js instance with `data.instance`. 18004 * @prop {onUpdate} 18005 */ 18006 onUpdate: function onUpdate() {}, 18007 18008 /** 18009 * List of modifiers used to modify the offsets before they are applied to the popper. 18010 * They provide most of the functionalities of Popper.js. 18011 * @prop {modifiers} 18012 */ 18013 modifiers: modifiers 18014}; 18015 18016/** 18017 * @callback onCreate 18018 * @param {dataObject} data 18019 */ 18020 18021/** 18022 * @callback onUpdate 18023 * @param {dataObject} data 18024 */ 18025 18026// Utils 18027// Methods 18028var Popper = function () { 18029 /** 18030 * Creates a new Popper.js instance. 18031 * @class Popper 18032 * @param {Element|referenceObject} reference - The reference element used to position the popper 18033 * @param {Element} popper - The HTML / XML element used as the popper 18034 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 18035 * @return {Object} instance - The generated Popper.js instance 18036 */ 18037 function Popper(reference, popper) { 18038 var _this = this; 18039 18040 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 18041 classCallCheck(this, Popper); 18042 18043 this.scheduleUpdate = function () { 18044 return requestAnimationFrame(_this.update); 18045 }; 18046 18047 // make update() debounced, so that it only runs at most once-per-tick 18048 this.update = debounce(this.update.bind(this)); 18049 18050 // with {} we create a new object with the options inside it 18051 this.options = _extends({}, Popper.Defaults, options); 18052 18053 // init state 18054 this.state = { 18055 isDestroyed: false, 18056 isCreated: false, 18057 scrollParents: [] 18058 }; 18059 18060 // get reference and popper elements (allow jQuery wrappers) 18061 this.reference = reference && reference.jquery ? reference[0] : reference; 18062 this.popper = popper && popper.jquery ? popper[0] : popper; 18063 18064 // Deep merge modifiers options 18065 this.options.modifiers = {}; 18066 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 18067 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 18068 }); 18069 18070 // Refactoring modifiers' list (Object => Array) 18071 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 18072 return _extends({ 18073 name: name 18074 }, _this.options.modifiers[name]); 18075 }) 18076 // sort the modifiers by order 18077 .sort(function (a, b) { 18078 return a.order - b.order; 18079 }); 18080 18081 // modifiers have the ability to execute arbitrary code when Popper.js get inited 18082 // such code is executed in the same order of its modifier 18083 // they could add new properties to their options configuration 18084 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 18085 this.modifiers.forEach(function (modifierOptions) { 18086 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 18087 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 18088 } 18089 }); 18090 18091 // fire the first update to position the popper in the right place 18092 this.update(); 18093 18094 var eventsEnabled = this.options.eventsEnabled; 18095 if (eventsEnabled) { 18096 // setup event listeners, they will take care of update the position in specific situations 18097 this.enableEventListeners(); 18098 } 18099 18100 this.state.eventsEnabled = eventsEnabled; 18101 } 18102 18103 // We can't use class properties because they don't get listed in the 18104 // class prototype and break stuff like Sinon stubs 18105 18106 18107 createClass(Popper, [{ 18108 key: 'update', 18109 value: function update$$1() { 18110 return update.call(this); 18111 } 18112 }, { 18113 key: 'destroy', 18114 value: function destroy$$1() { 18115 return destroy.call(this); 18116 } 18117 }, { 18118 key: 'enableEventListeners', 18119 value: function enableEventListeners$$1() { 18120 return enableEventListeners.call(this); 18121 } 18122 }, { 18123 key: 'disableEventListeners', 18124 value: function disableEventListeners$$1() { 18125 return disableEventListeners.call(this); 18126 } 18127 18128 /** 18129 * Schedules an update. It will run on the next UI update available. 18130 * @method scheduleUpdate 18131 * @memberof Popper 18132 */ 18133 18134 18135 /** 18136 * Collection of utilities useful when writing custom modifiers. 18137 * Starting from version 1.7, this method is available only if you 18138 * include `popper-utils.js` before `popper.js`. 18139 * 18140 * **DEPRECATION**: This way to access PopperUtils is deprecated 18141 * and will be removed in v2! Use the PopperUtils module directly instead. 18142 * Due to the high instability of the methods contained in Utils, we can't 18143 * guarantee them to follow semver. Use them at your own risk! 18144 * @static 18145 * @private 18146 * @type {Object} 18147 * @deprecated since version 1.8 18148 * @member Utils 18149 * @memberof Popper 18150 */ 18151 18152 }]); 18153 return Popper; 18154}(); 18155 18156/** 18157 * The `referenceObject` is an object that provides an interface compatible with Popper.js 18158 * and lets you use it as replacement of a real DOM node.<br /> 18159 * You can use this method to position a popper relatively to a set of coordinates 18160 * in case you don't have a DOM node to use as reference. 18161 * 18162 * ``` 18163 * new Popper(referenceObject, popperNode); 18164 * ``` 18165 * 18166 * NB: This feature isn't supported in Internet Explorer 10. 18167 * @name referenceObject 18168 * @property {Function} data.getBoundingClientRect 18169 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 18170 * @property {number} data.clientWidth 18171 * An ES6 getter that will return the width of the virtual reference element. 18172 * @property {number} data.clientHeight 18173 * An ES6 getter that will return the height of the virtual reference element. 18174 */ 18175 18176 18177Popper.Utils = (typeof window !== 'undefined' ? window : __webpack_require__.g).PopperUtils; 18178Popper.placements = placements; 18179Popper.Defaults = Defaults; 18180 18181/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Popper); 18182//# sourceMappingURL=popper.js.map 18183 18184 18185/***/ })
vendor: 5,157 bytes, lines 18185-18306
18185 18186 18187/******/ }); 18188/************************************************************************/ 18189/******/ // The module cache 18190/******/ var __webpack_module_cache__ = {}; 18191/******/ 18192/******/ // The require function 18193/******/ function __webpack_require__(moduleId) { 18194/******/ // Check if module is in cache 18195/******/ var cachedModule = __webpack_module_cache__[moduleId]; 18196/******/ if (cachedModule !== undefined) { 18197/******/ return cachedModule.exports; 18198/******/ } 18199/******/ // Create a new module (and put it into the cache) 18200/******/ var module = __webpack_module_cache__[moduleId] = { 18201/******/ // no module.id needed 18202/******/ // no module.loaded needed 18203/******/ exports: {} 18204/******/ }; 18205/******/ 18206/******/ // Execute the module function 18207/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 18208/******/ 18209/******/ // Return the exports of the module 18210/******/ return module.exports; 18211/******/ } 18212/******/ 18213/************************************************************************/ 18214/******/ /* webpack/runtime/compat get default export */ 18215/******/ (() => { 18216/******/ // getDefaultExport function for compatibility with non-harmony modules 18217/******/ __webpack_require__.n = (module) => { 18218/******/ var getter = module && module.__esModule ? 18219/******/ () => (module['default']) : 18220/******/ () => (module); 18221/******/ __webpack_require__.d(getter, { a: getter }); 18222/******/ return getter; 18223/******/ }; 18224/******/ })(); 18225/******/ 18226/******/ /* webpack/runtime/define property getters */ 18227/******/ (() => { 18228/******/ // define getter functions for harmony exports 18229/******/ __webpack_require__.d = (exports, definition) => { 18230/******/ for(var key in definition) { 18231/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 18232/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 18233/******/ } 18234/******/ } 18235/******/ }; 18236/******/ })(); 18237/******/ 18238/******/ /* webpack/runtime/global */ 18239/******/ (() => { 18240/******/ __webpack_require__.g = (function() { 18241/******/ if (typeof globalThis === 'object') return globalThis; 18242/******/ try { 18243/******/ return this || new Function('return this')(); 18244/******/ } catch (e) { 18245/******/ if (typeof window === 'object') return window; 18246/******/ } 18247/******/ })(); 18248/******/ })(); 18249/******/ 18250/******/ /* webpack/runtime/hasOwnProperty shorthand */ 18251/******/ (() => { 18252/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 18253/******/ })(); 18254/******/ 18255/******/ /* webpack/runtime/make namespace object */ 18256/******/ (() => { 18257/******/ // define __esModule on exports 18258/******/ __webpack_require__.r = (exports) => { 18259/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 18260/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 18261/******/ } 18262/******/ Object.defineProperty(exports, '__esModule', { value: true }); 18263/******/ }; 18264/******/ })(); 18265/******/ 18266/************************************************************************/ 18267var __webpack_exports__ = {}; 18268// This entry need to be wrapped in an IIFE because it need to be in strict mode. 18269(() => { 18270"use strict"; 18271var __webpack_exports__ = {}; 18272/*!************************!*\ 18273 !*** ./src/js/main.js ***! 18274 \************************/ 18275__webpack_require__.r(__webpack_exports__); 18276/* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap/dist/js/bootstrap.js"); 18277/* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(bootstrap__WEBPACK_IMPORTED_MODULE_0__); 18278/* harmony import */ var _scripts_initialise_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scripts/initialise.js */ "./src/js/scripts/initialise.js"); 18279/* harmony import */ var _scripts_initialise_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_scripts_initialise_js__WEBPACK_IMPORTED_MODULE_1__); 18280/* harmony import */ var _scripts_nav_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./scripts/nav.js */ "./src/js/scripts/nav.js"); 18281/* harmony import */ var _scripts_nav_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_scripts_nav_js__WEBPACK_IMPORTED_MODULE_2__); 18282/* harmony import */ var _scripts_gsap_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scripts/gsap.js */ "./src/js/scripts/gsap.js"); 18283/* harmony import */ var _scripts_gsap_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_scripts_gsap_js__WEBPACK_IMPORTED_MODULE_3__); 18284//load bootstrap scripts (from node modules folder) 18285 18286 18287//load custom scripts 18288 18289 18290 18291})(); 18292 18293// This entry need to be wrapped in an IIFE because it need to be in strict mode. 18294(() => { 18295"use strict"; 18296/*!****************************!*\ 18297 !*** ./src/scss/main.scss ***! 18298 \****************************/ 18299__webpack_require__.r(__webpack_exports__); 18300// extracted by mini-css-extract-plugin 18301 18302})(); 18303 18304/******/ })() 18305; 18306//# sourceMappingURL=main.min.04b95540c0e7e2d37591.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.