1/*! 2 * Bootstrap v4.3.1 (https://getbootstrap.com/) 3 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 */ 6(function (global, factory) { 7 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) : 8 typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) : 9 (global = global || self, factory(global.bootstrap = {}, global.jQuery)); 10}(this, function (exports, $) { 'use strict'; 11 12 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 13 14 function _defineProperties(target, props) { 15 for (var i = 0; i < props.length; i++) { 16 var descriptor = props[i]; 17 descriptor.enumerable = descriptor.enumerable || false; 18 descriptor.configurable = true; 19 if ("value" in descriptor) descriptor.writable = true; 20 Object.defineProperty(target, descriptor.key, descriptor); 21 } 22 } 23 24 function _createClass(Constructor, protoProps, staticProps) { 25 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 26 if (staticProps) _defineProperties(Constructor, staticProps); 27 return Constructor; 28 } 29 30 function _defineProperty(obj, key, value) { 31 if (key in obj) { 32 Object.defineProperty(obj, key, { 33 value: value, 34 enumerable: true, 35 configurable: true, 36 writable: true 37 }); 38 } else { 39 obj[key] = value; 40 } 41 42 return obj; 43 } 44 45 function _objectSpread(target) { 46 for (var i = 1; i < arguments.length; i++) { 47 var source = arguments[i] != null ? arguments[i] : {}; 48 var ownKeys = Object.keys(source); 49 50 if (typeof Object.getOwnPropertySymbols === 'function') { 51 ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { 52 return Object.getOwnPropertyDescriptor(source, sym).enumerable; 53 })); 54 } 55 56 ownKeys.forEach(function (key) { 57 _defineProperty(target, key, source[key]); 58 }); 59 } 60 61 return target; 62 } 63 64 function _inheritsLoose(subClass, superClass) { 65 subClass.prototype = Object.create(superClass.prototype); 66 subClass.prototype.constructor = subClass; 67 subClass.__proto__ = superClass; 68 } 69 70 /** 71 * -------------------------------------------------------------------------- 72 * Bootstrap (v4.3.1): util.js 73 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 74 * -------------------------------------------------------------------------- 75 */ 76 /** 77 * ------------------------------------------------------------------------ 78 * Private TransitionEnd Helpers 79 * ------------------------------------------------------------------------ 80 */ 81 82 var TRANSITION_END = 'transitionend'; 83 var MAX_UID = 1000000; 84 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 85 86 function toType(obj) { 87 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 88 } 89 90 function getSpecialTransitionEndEvent() { 91 return { 92 bindType: TRANSITION_END, 93 delegateType: TRANSITION_END, 94 handle: function handle(event) { 95 if ($(event.target).is(this)) { 96 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 97 } 98 99 return undefined; // eslint-disable-line no-undefined 100 } 101 }; 102 } 103 104 function transitionEndEmulator(duration) { 105 var _this = this; 106 107 var called = false; 108 $(this).one(Util.TRANSITION_END, function () { 109 called = true; 110 }); 111 setTimeout(function () { 112 if (!called) { 113 Util.triggerTransitionEnd(_this); 114 } 115 }, duration); 116 return this; 117 } 118 119 function setTransitionEndSupport() { 120 $.fn.emulateTransitionEnd = transitionEndEmulator; 121 $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 122 } 123 /** 124 * -------------------------------------------------------------------------- 125 * Public Util Api 126 * -------------------------------------------------------------------------- 127 */ 128 129 130 var Util = { 131 TRANSITION_END: 'bsTransitionEnd', 132 getUID: function getUID(prefix) { 133 do { 134 // eslint-disable-next-line no-bitwise 135 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 136 } while (document.getElementById(prefix)); 137 138 return prefix; 139 }, 140 getSelectorFromElement: function getSelectorFromElement(element) { 141 var selector = element.getAttribute('data-target'); 142 143 if (!selector || selector === '#') { 144 var hrefAttr = element.getAttribute('href'); 145 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 146 } 147
vendor: 4,399 bytes, lines 148-292
148 try { 149 return document.querySelector(selector) ? selector : null; 150 } catch (err) { 151 return null; 152 } 153 }, 154 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 155 if (!element) { 156 return 0; 157 } // Get transition-duration of the element 158 159 160 var transitionDuration = $(element).css('transition-duration'); 161 var transitionDelay = $(element).css('transition-delay'); 162 var floatTransitionDuration = parseFloat(transitionDuration); 163 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 164 165 if (!floatTransitionDuration && !floatTransitionDelay) { 166 return 0; 167 } // If multiple durations are defined, take the first 168 169 170 transitionDuration = transitionDuration.split(',')[0]; 171 transitionDelay = transitionDelay.split(',')[0]; 172 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 173 }, 174 reflow: function reflow(element) { 175 return element.offsetHeight; 176 }, 177 triggerTransitionEnd: function triggerTransitionEnd(element) { 178 $(element).trigger(TRANSITION_END); 179 }, 180 // TODO: Remove in v5 181 supportsTransitionEnd: function supportsTransitionEnd() { 182 return Boolean(TRANSITION_END); 183 }, 184 isElement: function isElement(obj) { 185 return (obj[0] || obj).nodeType; 186 }, 187 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 188 for (var property in configTypes) { 189 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 190 var expectedTypes = configTypes[property]; 191 var value = config[property]; 192 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 193 194 if (!new RegExp(expectedTypes).test(valueType)) { 195 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); 196 } 197 } 198 } 199 }, 200 findShadowRoot: function findShadowRoot(element) { 201 if (!document.documentElement.attachShadow) { 202 return null; 203 } // Can find the shadow root otherwise it'll return the document 204 205 206 if (typeof element.getRootNode === 'function') { 207 var root = element.getRootNode(); 208 return root instanceof ShadowRoot ? root : null; 209 } 210 211 if (element instanceof ShadowRoot) { 212 return element; 213 } // when we don't find a shadow root 214 215 216 if (!element.parentNode) { 217 return null; 218 } 219 220 return Util.findShadowRoot(element.parentNode); 221 } 222 }; 223 setTransitionEndSupport(); 224 225 /** 226 * ------------------------------------------------------------------------ 227 * Constants 228 * ------------------------------------------------------------------------ 229 */ 230 231 var NAME = 'alert'; 232 var VERSION = '4.3.1'; 233 var DATA_KEY = 'bs.alert'; 234 var EVENT_KEY = "." + DATA_KEY; 235 var DATA_API_KEY = '.data-api'; 236 var JQUERY_NO_CONFLICT = $.fn[NAME]; 237 var Selector = { 238 DISMISS: '[data-dismiss="alert"]' 239 }; 240 var Event = { 241 CLOSE: "close" + EVENT_KEY, 242 CLOSED: "closed" + EVENT_KEY, 243 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY 244 }; 245 var ClassName = { 246 ALERT: 'alert', 247 FADE: 'fade', 248 SHOW: 'show' 249 /** 250 * ------------------------------------------------------------------------ 251 * Class Definition 252 * ------------------------------------------------------------------------ 253 */ 254 255 }; 256 257 var Alert = 258 /*#__PURE__*/ 259 function () { 260 function Alert(element) { 261 this._element = element; 262 } // Getters 263 264 265 var _proto = Alert.prototype; 266 267 // Public 268 _proto.close = function close(element) { 269 var rootElement = this._element; 270 271 if (element) { 272 rootElement = this._getRootElement(element); 273 } 274 275 var customEvent = this._triggerCloseEvent(rootElement); 276 277 if (customEvent.isDefaultPrevented()) { 278 return; 279 } 280 281 this._removeElement(rootElement); 282 }; 283 284 _proto.dispose = function dispose() { 285 $.removeData(this._element, DATA_KEY); 286 this._element = null; 287 } // Private 288 ; 289 290 _proto._getRootElement = function _getRootElement(element) { 291 var selector = Util.getSelectorFromElement(element); 292 var parent = false;
293 294 if (selector) { 295 parent = document.querySelector(selector); 296 } 297 298 if (!parent) { 299 parent = $(element).closest("." + ClassName.ALERT)[0]; 300 } 301 302 return parent; 303 }; 304 305 _proto._triggerCloseEvent = function _triggerCloseEvent(element) { 306 var closeEvent = $.Event(Event.CLOSE); 307 $(element).trigger(closeEvent); 308 return closeEvent; 309 }; 310 311 _proto._removeElement = function _removeElement(element) { 312 var _this = this; 313 314 $(element).removeClass(ClassName.SHOW); 315 316 if (!$(element).hasClass(ClassName.FADE)) { 317 this._destroyElement(element); 318 319 return; 320 } 321 322 var transitionDuration = Util.getTransitionDurationFromElement(element); 323 $(element).one(Util.TRANSITION_END, function (event) { 324 return _this._destroyElement(element, event); 325 }).emulateTransitionEnd(transitionDuration); 326 }; 327 328 _proto._destroyElement = function _destroyElement(element) { 329 $(element).detach().trigger(Event.CLOSED).remove(); 330 } // Static 331 ; 332 333 Alert._jQueryInterface = function _jQueryInterface(config) { 334 return this.each(function () { 335 var $element = $(this); 336 var data = $element.data(DATA_KEY); 337 338 if (!data) { 339 data = new Alert(this); 340 $element.data(DATA_KEY, data); 341 } 342 343 if (config === 'close') { 344 data[config](this); 345 } 346 }); 347 }; 348 349 Alert._handleDismiss = function _handleDismiss(alertInstance) { 350 return function (event) { 351 if (event) { 352 event.preventDefault(); 353 } 354 355 alertInstance.close(this); 356 }; 357 }; 358 359 _createClass(Alert, null, [{ 360 key: "VERSION", 361 get: function get() { 362 return VERSION; 363 } 364 }]); 365 366 return Alert; 367 }(); 368 /** 369 * ------------------------------------------------------------------------ 370 * Data Api implementation 371 * ------------------------------------------------------------------------ 372 */ 373 374 375 $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); 376 /** 377 * ------------------------------------------------------------------------ 378 * jQuery 379 * ------------------------------------------------------------------------ 380 */ 381 382 $.fn[NAME] = Alert._jQueryInterface; 383 $.fn[NAME].Constructor = Alert; 384 385 $.fn[NAME].noConflict = function () { 386 $.fn[NAME] = JQUERY_NO_CONFLICT; 387 return Alert._jQueryInterface; 388 }; 389 390 /** 391 * ------------------------------------------------------------------------ 392 * Constants 393 * ------------------------------------------------------------------------ 394 */ 395 396 var NAME$1 = 'button'; 397 var VERSION$1 = '4.3.1'; 398 var DATA_KEY$1 = 'bs.button'; 399 var EVENT_KEY$1 = "." + DATA_KEY$1; 400 var DATA_API_KEY$1 = '.data-api'; 401 var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1]; 402 var ClassName$1 = { 403 ACTIVE: 'active', 404 BUTTON: 'btn', 405 FOCUS: 'focus' 406 }; 407 var Selector$1 = { 408 DATA_TOGGLE_CARROT: '[data-toggle^="button"]', 409 DATA_TOGGLE: '[data-toggle="buttons"]', 410 INPUT: 'input:not([type="hidden"])', 411 ACTIVE: '.active', 412 BUTTON: '.btn' 413 }; 414 var Event$1 = { 415 CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1, 416 FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1) 417 /** 418 * ------------------------------------------------------------------------ 419 * Class Definition 420 * ------------------------------------------------------------------------ 421 */ 422 423 }; 424 425 var Button = 426 /*#__PURE__*/ 427 function () { 428 function Button(element) { 429 this._element = element; 430 } // Getters 431 432 433 var _proto = Button.prototype; 434 435 // Public 436 _proto.toggle = function toggle() { 437 var triggerChangeEvent = true; 438 var addAriaPressed = true; 439 var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0]; 440 441 if (rootElement) { 442 var input = this._element.querySelector(Selector$1.INPUT); 443 444 if (input) { 445 if (input.type === 'radio') { 446 if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) { 447 triggerChangeEvent = false;
vendor: 4,952 bytes, lines 448-617
448 } else { 449 var activeElement = rootElement.querySelector(Selector$1.ACTIVE); 450 451 if (activeElement) { 452 $(activeElement).removeClass(ClassName$1.ACTIVE); 453 } 454 } 455 } 456 457 if (triggerChangeEvent) { 458 if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) { 459 return; 460 } 461 462 input.checked = !this._element.classList.contains(ClassName$1.ACTIVE); 463 $(input).trigger('change'); 464 } 465 466 input.focus(); 467 addAriaPressed = false; 468 } 469 } 470 471 if (addAriaPressed) { 472 this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE)); 473 } 474 475 if (triggerChangeEvent) { 476 $(this._element).toggleClass(ClassName$1.ACTIVE); 477 } 478 }; 479 480 _proto.dispose = function dispose() { 481 $.removeData(this._element, DATA_KEY$1); 482 this._element = null; 483 } // Static 484 ; 485 486 Button._jQueryInterface = function _jQueryInterface(config) { 487 return this.each(function () { 488 var data = $(this).data(DATA_KEY$1); 489 490 if (!data) { 491 data = new Button(this); 492 $(this).data(DATA_KEY$1, data); 493 } 494 495 if (config === 'toggle') { 496 data[config](); 497 } 498 }); 499 }; 500 501 _createClass(Button, null, [{ 502 key: "VERSION", 503 get: function get() { 504 return VERSION$1; 505 } 506 }]); 507 508 return Button; 509 }(); 510 /** 511 * ------------------------------------------------------------------------ 512 * Data Api implementation 513 * ------------------------------------------------------------------------ 514 */ 515 516 517 $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) { 518 event.preventDefault(); 519 var button = event.target; 520 521 if (!$(button).hasClass(ClassName$1.BUTTON)) { 522 button = $(button).closest(Selector$1.BUTTON); 523 } 524 525 Button._jQueryInterface.call($(button), 'toggle'); 526 }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) { 527 var button = $(event.target).closest(Selector$1.BUTTON)[0]; 528 $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type)); 529 }); 530 /** 531 * ------------------------------------------------------------------------ 532 * jQuery 533 * ------------------------------------------------------------------------ 534 */ 535 536 $.fn[NAME$1] = Button._jQueryInterface; 537 $.fn[NAME$1].Constructor = Button; 538 539 $.fn[NAME$1].noConflict = function () { 540 $.fn[NAME$1] = JQUERY_NO_CONFLICT$1; 541 return Button._jQueryInterface; 542 }; 543 544 /** 545 * ------------------------------------------------------------------------ 546 * Constants 547 * ------------------------------------------------------------------------ 548 */ 549 550 var NAME$2 = 'carousel'; 551 var VERSION$2 = '4.3.1'; 552 var DATA_KEY$2 = 'bs.carousel'; 553 var EVENT_KEY$2 = "." + DATA_KEY$2; 554 var DATA_API_KEY$2 = '.data-api'; 555 var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2]; 556 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 557 558 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 559 560 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 561 562 var SWIPE_THRESHOLD = 40; 563 var Default = { 564 interval: 5000, 565 keyboard: true, 566 slide: false, 567 pause: 'hover', 568 wrap: true, 569 touch: true 570 }; 571 var DefaultType = { 572 interval: '(number|boolean)', 573 keyboard: 'boolean', 574 slide: '(boolean|string)', 575 pause: '(string|boolean)', 576 wrap: 'boolean', 577 touch: 'boolean' 578 }; 579 var Direction = { 580 NEXT: 'next', 581 PREV: 'prev', 582 LEFT: 'left', 583 RIGHT: 'right' 584 }; 585 var Event$2 = { 586 SLIDE: "slide" + EVENT_KEY$2, 587 SLID: "slid" + EVENT_KEY$2, 588 KEYDOWN: "keydown" + EVENT_KEY$2, 589 MOUSEENTER: "mouseenter" + EVENT_KEY$2, 590 MOUSELEAVE: "mouseleave" + EVENT_KEY$2, 591 TOUCHSTART: "touchstart" + EVENT_KEY$2, 592 TOUCHMOVE: "touchmove" + EVENT_KEY$2, 593 TOUCHEND: "touchend" + EVENT_KEY$2, 594 POINTERDOWN: "pointerdown" + EVENT_KEY$2, 595 POINTERUP: "pointerup" + EVENT_KEY$2, 596 DRAG_START: "dragstart" + EVENT_KEY$2, 597 LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2, 598 CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2 599 }; 600 var ClassName$2 = { 601 CAROUSEL: 'carousel', 602 ACTIVE: 'active', 603 SLIDE: 'slide', 604 RIGHT: 'carousel-item-right', 605 LEFT: 'carousel-item-left', 606 NEXT: 'carousel-item-next', 607 PREV: 'carousel-item-prev', 608 ITEM: 'carousel-item', 609 POINTER_EVENT: 'pointer-event' 610 }; 611 var Selector$2 = { 612 ACTIVE: '.active', 613 ACTIVE_ITEM: '.active.carousel-item', 614 ITEM: '.carousel-item', 615 ITEM_IMG: '.carousel-item img', 616 NEXT_PREV: '.carousel-item-next, .carousel-item-prev', 617 INDICATORS: '.carousel-indicators',
vendor: 5,833 bytes, lines 618-827
618 DATA_SLIDE: '[data-slide], [data-slide-to]', 619 DATA_RIDE: '[data-ride="carousel"]' 620 }; 621 var PointerType = { 622 TOUCH: 'touch', 623 PEN: 'pen' 624 /** 625 * ------------------------------------------------------------------------ 626 * Class Definition 627 * ------------------------------------------------------------------------ 628 */ 629 630 }; 631 632 var Carousel = 633 /*#__PURE__*/ 634 function () { 635 function Carousel(element, config) { 636 this._items = null; 637 this._interval = null; 638 this._activeElement = null; 639 this._isPaused = false; 640 this._isSliding = false; 641 this.touchTimeout = null; 642 this.touchStartX = 0; 643 this.touchDeltaX = 0; 644 this._config = this._getConfig(config); 645 this._element = element; 646 this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS); 647 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 648 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 649 650 this._addEventListeners(); 651 } // Getters 652 653 654 var _proto = Carousel.prototype; 655 656 // Public 657 _proto.next = function next() { 658 if (!this._isSliding) { 659 this._slide(Direction.NEXT); 660 } 661 }; 662 663 _proto.nextWhenVisible = function nextWhenVisible() { 664 // Don't call next when the page isn't visible 665 // or the carousel or its parent isn't visible 666 if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') { 667 this.next(); 668 } 669 }; 670 671 _proto.prev = function prev() { 672 if (!this._isSliding) { 673 this._slide(Direction.PREV); 674 } 675 }; 676 677 _proto.pause = function pause(event) { 678 if (!event) { 679 this._isPaused = true; 680 } 681 682 if (this._element.querySelector(Selector$2.NEXT_PREV)) { 683 Util.triggerTransitionEnd(this._element); 684 this.cycle(true); 685 } 686 687 clearInterval(this._interval); 688 this._interval = null; 689 }; 690 691 _proto.cycle = function cycle(event) { 692 if (!event) { 693 this._isPaused = false; 694 } 695 696 if (this._interval) { 697 clearInterval(this._interval); 698 this._interval = null; 699 } 700 701 if (this._config.interval && !this._isPaused) { 702 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 703 } 704 }; 705 706 _proto.to = function to(index) { 707 var _this = this; 708 709 this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM); 710 711 var activeIndex = this._getItemIndex(this._activeElement); 712 713 if (index > this._items.length - 1 || index < 0) { 714 return; 715 } 716 717 if (this._isSliding) { 718 $(this._element).one(Event$2.SLID, function () { 719 return _this.to(index); 720 }); 721 return; 722 } 723 724 if (activeIndex === index) { 725 this.pause(); 726 this.cycle(); 727 return; 728 } 729 730 var direction = index > activeIndex ? Direction.NEXT : Direction.PREV; 731 732 this._slide(direction, this._items[index]); 733 }; 734 735 _proto.dispose = function dispose() { 736 $(this._element).off(EVENT_KEY$2); 737 $.removeData(this._element, DATA_KEY$2); 738 this._items = null; 739 this._config = null; 740 this._element = null; 741 this._interval = null; 742 this._isPaused = null; 743 this._isSliding = null; 744 this._activeElement = null; 745 this._indicatorsElement = null; 746 } // Private 747 ; 748 749 _proto._getConfig = function _getConfig(config) { 750 config = _objectSpread({}, Default, config); 751 Util.typeCheckConfig(NAME$2, config, DefaultType); 752 return config; 753 }; 754 755 _proto._handleSwipe = function _handleSwipe() { 756 var absDeltax = Math.abs(this.touchDeltaX); 757 758 if (absDeltax <= SWIPE_THRESHOLD) { 759 return; 760 } 761 762 var direction = absDeltax / this.touchDeltaX; // swipe left 763 764 if (direction > 0) { 765 this.prev(); 766 } // swipe right 767 768 769 if (direction < 0) { 770 this.next(); 771 } 772 }; 773 774 _proto._addEventListeners = function _addEventListeners() { 775 var _this2 = this; 776 777 if (this._config.keyboard) { 778 $(this._element).on(Event$2.KEYDOWN, function (event) { 779 return _this2._keydown(event); 780 }); 781 } 782 783 if (this._config.pause === 'hover') { 784 $(this._element).on(Event$2.MOUSEENTER, function (event) { 785 return _this2.pause(event); 786 }).on(Event$2.MOUSELEAVE, function (event) { 787 return _this2.cycle(event); 788 }); 789 } 790 791 if (this._config.touch) { 792 this._addTouchEventListeners(); 793 } 794 }; 795 796 _proto._addTouchEventListeners = function _addTouchEventListeners() { 797 var _this3 = this; 798 799 if (!this._touchSupported) { 800 return; 801 } 802 803 var start = function start(event) { 804 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 805 _this3.touchStartX = event.originalEvent.clientX; 806 } else if (!_this3._pointerEvent) { 807 _this3.touchStartX = event.originalEvent.touches[0].clientX; 808 } 809 }; 810 811 var move = function move(event) { 812 // ensure swiping with one touch and not pinching 813 if (event.originalEvent.touches && event.originalEvent.touches.length > 1) { 814 _this3.touchDeltaX = 0; 815 } else { 816 _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX; 817 } 818 }; 819 820 var end = function end(event) { 821 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 822 _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; 823 } 824 825 _this3._handleSwipe(); 826 827 if (_this3._config.pause === 'hover') {
828 // If it's a touch-enabled device, mouseenter/leave are fired as 829 // part of the mouse compatibility events on first tap - the carousel 830 // would stop cycling until user tapped out of it; 831 // here, we listen for touchend, explicitly pause the carousel 832 // (as if it's the second time we tap on it, mouseenter compat event 833 // is NOT fired) and after a timeout (to allow for mouse compatibility 834 // events to fire) we explicitly restart cycling 835 _this3.pause(); 836 837 if (_this3.touchTimeout) { 838 clearTimeout(_this3.touchTimeout); 839 } 840 841 _this3.touchTimeout = setTimeout(function (event) { 842 return _this3.cycle(event); 843 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 844 } 845 }; 846 847 $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) { 848 return e.preventDefault(); 849 }); 850 851 if (this._pointerEvent) { 852 $(this._element).on(Event$2.POINTERDOWN, function (event) { 853 return start(event); 854 }); 855 $(this._element).on(Event$2.POINTERUP, function (event) { 856 return end(event); 857 }); 858 859 this._element.classList.add(ClassName$2.POINTER_EVENT); 860 } else { 861 $(this._element).on(Event$2.TOUCHSTART, function (event) { 862 return start(event); 863 }); 864 $(this._element).on(Event$2.TOUCHMOVE, function (event) { 865 return move(event); 866 }); 867 $(this._element).on(Event$2.TOUCHEND, function (event) { 868 return end(event); 869 }); 870 } 871 }; 872 873 _proto._keydown = function _keydown(event) { 874 if (/input|textarea/i.test(event.target.tagName)) { 875 return; 876 } 877 878 switch (event.which) { 879 case ARROW_LEFT_KEYCODE: 880 event.preventDefault(); 881 this.prev(); 882 break; 883 884 case ARROW_RIGHT_KEYCODE: 885 event.preventDefault(); 886 this.next(); 887 break; 888 889 default: 890 } 891 }; 892 893 _proto._getItemIndex = function _getItemIndex(element) { 894 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : []; 895 return this._items.indexOf(element); 896 }; 897 898 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { 899 var isNextDirection = direction === Direction.NEXT; 900 var isPrevDirection = direction === Direction.PREV; 901 902 var activeIndex = this._getItemIndex(activeElement); 903 904 var lastItemIndex = this._items.length - 1; 905 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 906 907 if (isGoingToWrap && !this._config.wrap) { 908 return activeElement; 909 } 910 911 var delta = direction === Direction.PREV ? -1 : 1; 912 var itemIndex = (activeIndex + delta) % this._items.length; 913 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 914 }; 915 916 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { 917 var targetIndex = this._getItemIndex(relatedTarget); 918 919 var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM)); 920 921 var slideEvent = $.Event(Event$2.SLIDE, { 922 relatedTarget: relatedTarget, 923 direction: eventDirectionName, 924 from: fromIndex, 925 to: targetIndex 926 }); 927 $(this._element).trigger(slideEvent); 928 return slideEvent; 929 }; 930 931 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { 932 if (this._indicatorsElement) { 933 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE)); 934 $(indicators).removeClass(ClassName$2.ACTIVE); 935 936 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 937 938 if (nextIndicator) { 939 $(nextIndicator).addClass(ClassName$2.ACTIVE); 940 } 941 } 942 }; 943 944 _proto._slide = function _slide(direction, element) { 945 var _this4 = this; 946 947 var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM); 948 949 var activeElementIndex = this._getItemIndex(activeElement); 950 951 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 952 953 var nextElementIndex = this._getItemIndex(nextElement); 954 955 var isCycling = Boolean(this._interval); 956 var directionalClassName; 957 var orderClassName; 958 var eventDirectionName; 959 960 if (direction === Direction.NEXT) { 961 directionalClassName = ClassName$2.LEFT; 962 orderClassName = ClassName$2.NEXT; 963 eventDirectionName = Direction.LEFT; 964 } else { 965 directionalClassName = ClassName$2.RIGHT; 966 orderClassName = ClassName$2.PREV; 967 eventDirectionName = Direction.RIGHT; 968 } 969 970 if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) { 971 this._isSliding = false;
972 return; 973 } 974 975 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 976 977 if (slideEvent.isDefaultPrevented()) { 978 return; 979 } 980 981 if (!activeElement || !nextElement) { 982 // Some weirdness is happening, so we bail 983 return; 984 } 985 986 this._isSliding = true; 987 988 if (isCycling) { 989 this.pause(); 990 } 991 992 this._setActiveIndicatorElement(nextElement); 993 994 var slidEvent = $.Event(Event$2.SLID, { 995 relatedTarget: nextElement, 996 direction: eventDirectionName, 997 from: activeElementIndex, 998 to: nextElementIndex 999 }); 1000 1001 if ($(this._element).hasClass(ClassName$2.SLIDE)) { 1002 $(nextElement).addClass(orderClassName); 1003 Util.reflow(nextElement); 1004 $(activeElement).addClass(directionalClassName); 1005 $(nextElement).addClass(directionalClassName); 1006 var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10); 1007 1008 if (nextElementInterval) { 1009 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 1010 this._config.interval = nextElementInterval; 1011 } else { 1012 this._config.interval = this._config.defaultInterval || this._config.interval; 1013 } 1014 1015 var transitionDuration = Util.getTransitionDurationFromElement(activeElement); 1016 $(activeElement).one(Util.TRANSITION_END, function () { 1017 $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE); 1018 $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName); 1019 _this4._isSliding = false; 1020 setTimeout(function () { 1021 return $(_this4._element).trigger(slidEvent); 1022 }, 0); 1023 }).emulateTransitionEnd(transitionDuration); 1024 } else { 1025 $(activeElement).removeClass(ClassName$2.ACTIVE); 1026 $(nextElement).addClass(ClassName$2.ACTIVE); 1027 this._isSliding = false; 1028 $(this._element).trigger(slidEvent); 1029 } 1030 1031 if (isCycling) { 1032 this.cycle(); 1033 } 1034 } // Static 1035 ; 1036 1037 Carousel._jQueryInterface = function _jQueryInterface(config) { 1038 return this.each(function () { 1039 var data = $(this).data(DATA_KEY$2); 1040 1041 var _config = _objectSpread({}, Default, $(this).data()); 1042 1043 if (typeof config === 'object') { 1044 _config = _objectSpread({}, _config, config); 1045 } 1046 1047 var action = typeof config === 'string' ? config : _config.slide; 1048 1049 if (!data) { 1050 data = new Carousel(this, _config); 1051 $(this).data(DATA_KEY$2, data); 1052 } 1053 1054 if (typeof config === 'number') { 1055 data.to(config); 1056 } else if (typeof action === 'string') { 1057 if (typeof data[action] === 'undefined') { 1058 throw new TypeError("No method named \"" + action + "\""); 1059 } 1060 1061 data[action](); 1062 } else if (_config.interval && _config.ride) { 1063 data.pause(); 1064 data.cycle(); 1065 } 1066 }); 1067 }; 1068 1069 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { 1070 var selector = Util.getSelectorFromElement(this); 1071 1072 if (!selector) { 1073 return; 1074 } 1075 1076 var target = $(selector)[0]; 1077 1078 if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) { 1079 return; 1080 } 1081 1082 var config = _objectSpread({}, $(target).data(), $(this).data()); 1083 1084 var slideIndex = this.getAttribute('data-slide-to'); 1085 1086 if (slideIndex) { 1087 config.interval = false; 1088 } 1089 1090 Carousel._jQueryInterface.call($(target), config); 1091 1092 if (slideIndex) { 1093 $(target).data(DATA_KEY$2).to(slideIndex); 1094 } 1095 1096 event.preventDefault(); 1097 }; 1098 1099 _createClass(Carousel, null, [{ 1100 key: "VERSION", 1101 get: function get() { 1102 return VERSION$2; 1103 } 1104 }, { 1105 key: "Default", 1106 get: function get() { 1107 return Default; 1108 } 1109 }]); 1110 1111 return Carousel; 1112 }(); 1113 /** 1114 * ------------------------------------------------------------------------ 1115 * Data Api implementation 1116 * ------------------------------------------------------------------------ 1117 */ 1118 1119 1120 $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler); 1121 $(window).on(Event$2.LOAD_DATA_API, function () { 1122 var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE)); 1123 1124 for (var i = 0, len = carousels.length; i < len; i++) {
1125 var $carousel = $(carousels[i]); 1126 1127 Carousel._jQueryInterface.call($carousel, $carousel.data()); 1128 } 1129 }); 1130 /** 1131 * ------------------------------------------------------------------------ 1132 * jQuery 1133 * ------------------------------------------------------------------------ 1134 */ 1135 1136 $.fn[NAME$2] = Carousel._jQueryInterface; 1137 $.fn[NAME$2].Constructor = Carousel; 1138 1139 $.fn[NAME$2].noConflict = function () { 1140 $.fn[NAME$2] = JQUERY_NO_CONFLICT$2; 1141 return Carousel._jQueryInterface; 1142 }; 1143 1144 /** 1145 * ------------------------------------------------------------------------ 1146 * Constants 1147 * ------------------------------------------------------------------------ 1148 */ 1149 1150 var NAME$3 = 'collapse'; 1151 var VERSION$3 = '4.3.1'; 1152 var DATA_KEY$3 = 'bs.collapse'; 1153 var EVENT_KEY$3 = "." + DATA_KEY$3; 1154 var DATA_API_KEY$3 = '.data-api'; 1155 var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3]; 1156 var Default$1 = { 1157 toggle: true, 1158 parent: '' 1159 }; 1160 var DefaultType$1 = { 1161 toggle: 'boolean', 1162 parent: '(string|element)' 1163 }; 1164 var Event$3 = { 1165 SHOW: "show" + EVENT_KEY$3, 1166 SHOWN: "shown" + EVENT_KEY$3, 1167 HIDE: "hide" + EVENT_KEY$3, 1168 HIDDEN: "hidden" + EVENT_KEY$3, 1169 CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3 1170 }; 1171 var ClassName$3 = { 1172 SHOW: 'show', 1173 COLLAPSE: 'collapse', 1174 COLLAPSING: 'collapsing', 1175 COLLAPSED: 'collapsed' 1176 }; 1177 var Dimension = { 1178 WIDTH: 'width', 1179 HEIGHT: 'height' 1180 }; 1181 var Selector$3 = { 1182 ACTIVES: '.show, .collapsing', 1183 DATA_TOGGLE: '[data-toggle="collapse"]' 1184 /** 1185 * ------------------------------------------------------------------------ 1186 * Class Definition 1187 * ------------------------------------------------------------------------ 1188 */ 1189 1190 }; 1191 1192 var Collapse = 1193 /*#__PURE__*/ 1194 function () { 1195 function Collapse(element, config) { 1196 this._isTransitioning = false; 1197 this._element = element; 1198 this._config = this._getConfig(config); 1199 this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); 1200 var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE)); 1201 1202 for (var i = 0, len = toggleList.length; i < len; i++) { 1203 var elem = toggleList[i]; 1204 var selector = Util.getSelectorFromElement(elem); 1205 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { 1206 return foundElem === element; 1207 }); 1208 1209 if (selector !== null && filterElement.length > 0) { 1210 this._selector = selector; 1211 1212 this._triggerArray.push(elem); 1213 } 1214 } 1215 1216 this._parent = this._config.parent ? this._getParent() : null; 1217 1218 if (!this._config.parent) { 1219 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 1220 } 1221 1222 if (this._config.toggle) { 1223 this.toggle(); 1224 } 1225 } // Getters 1226 1227 1228 var _proto = Collapse.prototype; 1229 1230 // Public 1231 _proto.toggle = function toggle() { 1232 if ($(this._element).hasClass(ClassName$3.SHOW)) { 1233 this.hide(); 1234 } else { 1235 this.show(); 1236 } 1237 }; 1238 1239 _proto.show = function show() { 1240 var _this = this; 1241 1242 if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) { 1243 return; 1244 } 1245 1246 var actives; 1247 var activesData; 1248 1249 if (this._parent) { 1250 actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) { 1251 if (typeof _this._config.parent === 'string') { 1252 return elem.getAttribute('data-parent') === _this._config.parent; 1253 } 1254 1255 return elem.classList.contains(ClassName$3.COLLAPSE); 1256 }); 1257 1258 if (actives.length === 0) { 1259 actives = null; 1260 } 1261 } 1262 1263 if (actives) { 1264 activesData = $(actives).not(this._selector).data(DATA_KEY$3); 1265 1266 if (activesData && activesData._isTransitioning) { 1267 return; 1268 } 1269 } 1270 1271 var startEvent = $.Event(Event$3.SHOW); 1272 $(this._element).trigger(startEvent); 1273 1274 if (startEvent.isDefaultPrevented()) { 1275 return; 1276 } 1277 1278 if (actives) { 1279 Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide'); 1280 1281 if (!activesData) { 1282 $(actives).data(DATA_KEY$3, null); 1283 } 1284 } 1285 1286 var dimension = this._getDimension(); 1287 1288 $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING); 1289 this._element.style[dimension] = 0; 1290 1291 if (this._triggerArray.length) { 1292 $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true); 1293 } 1294 1295 this.setTransitioning(true); 1296 1297 var complete = function complete() { 1298 $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW); 1299 _this._element.style[dimension] = ''; 1300 1301 _this.setTransitioning(false); 1302 1303 $(_this._element).trigger(Event$3.SHOWN); 1304 }; 1305 1306 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 1307 var scrollSize = "scroll" + capitalizedDimension; 1308 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 1309 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 1310 this._element.style[dimension] = this._element[scrollSize] + "px"; 1311 }; 1312 1313 _proto.hide = function hide() { 1314 var _this2 = this; 1315 1316 if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) { 1317 return; 1318 } 1319 1320 var startEvent = $.Event(Event$3.HIDE); 1321 $(this._element).trigger(startEvent); 1322 1323 if (startEvent.isDefaultPrevented()) { 1324 return; 1325 } 1326 1327 var dimension = this._getDimension(); 1328 1329 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; 1330 Util.reflow(this._element); 1331 $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW); 1332 var triggerArrayLength = this._triggerArray.length; 1333 1334 if (triggerArrayLength > 0) { 1335 for (var i = 0; i < triggerArrayLength; i++) { 1336 var trigger = this._triggerArray[i]; 1337 var selector = Util.getSelectorFromElement(trigger); 1338 1339 if (selector !== null) { 1340 var $elem = $([].slice.call(document.querySelectorAll(selector))); 1341 1342 if (!$elem.hasClass(ClassName$3.SHOW)) { 1343 $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false); 1344 } 1345 } 1346 } 1347 } 1348 1349 this.setTransitioning(true); 1350 1351 var complete = function complete() { 1352 _this2.setTransitioning(false); 1353 1354 $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN); 1355 }; 1356 1357 this._element.style[dimension] = ''; 1358 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 1359 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 1360 }; 1361 1362 _proto.setTransitioning = function setTransitioning(isTransitioning) { 1363 this._isTransitioning = isTransitioning; 1364 }; 1365 1366 _proto.dispose = function dispose() { 1367 $.removeData(this._element, DATA_KEY$3); 1368 this._config = null; 1369 this._parent = null; 1370 this._element = null; 1371 this._triggerArray = null; 1372 this._isTransitioning = null; 1373 } // Private 1374 ; 1375 1376 _proto._getConfig = function _getConfig(config) { 1377 config = _objectSpread({}, Default$1, config); 1378 config.toggle = Boolean(config.toggle); // Coerce string values 1379 1380 Util.typeCheckConfig(NAME$3, config, DefaultType$1); 1381 return config; 1382 }; 1383 1384 _proto._getDimension = function _getDimension() { 1385 var hasWidth = $(this._element).hasClass(Dimension.WIDTH); 1386 return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; 1387 }; 1388 1389 _proto._getParent = function _getParent() { 1390 var _this3 = this; 1391 1392 var parent; 1393 1394 if (Util.isElement(this._config.parent)) { 1395 parent = this._config.parent; // It's a jQuery object 1396 1397 if (typeof this._config.parent.jquery !== 'undefined') { 1398 parent = this._config.parent[0]; 1399 } 1400 } else { 1401 parent = document.querySelector(this._config.parent); 1402 } 1403 1404 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; 1405 var children = [].slice.call(parent.querySelectorAll(selector)); 1406 $(children).each(function (i, element) { 1407 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); 1408 }); 1409 return parent; 1410 }; 1411 1412 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { 1413 var isOpen = $(element).hasClass(ClassName$3.SHOW); 1414 1415 if (triggerArray.length) { 1416 $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); 1417 } 1418 } // Static 1419 ; 1420 1421 Collapse._getTargetFromElement = function _getTargetFromElement(element) { 1422 var selector = Util.getSelectorFromElement(element); 1423 return selector ? document.querySelector(selector) : null; 1424 }; 1425 1426 Collapse._jQueryInterface = function _jQueryInterface(config) { 1427 return this.each(function () { 1428 var $this = $(this); 1429 var data = $this.data(DATA_KEY$3); 1430 1431 var _config = _objectSpread({}, Default$1, $this.data(), typeof config === 'object' && config ? config : {}); 1432 1433 if (!data && _config.toggle && /show|hide/.test(config)) { 1434 _config.toggle = false;
vendor: 7,693 bytes, lines 1435-1697
1435 } 1436 1437 if (!data) { 1438 data = new Collapse(this, _config); 1439 $this.data(DATA_KEY$3, data); 1440 } 1441 1442 if (typeof config === 'string') { 1443 if (typeof data[config] === 'undefined') { 1444 throw new TypeError("No method named \"" + config + "\""); 1445 } 1446 1447 data[config](); 1448 } 1449 }); 1450 }; 1451 1452 _createClass(Collapse, null, [{ 1453 key: "VERSION", 1454 get: function get() { 1455 return VERSION$3; 1456 } 1457 }, { 1458 key: "Default", 1459 get: function get() { 1460 return Default$1; 1461 } 1462 }]); 1463 1464 return Collapse; 1465 }(); 1466 /** 1467 * ------------------------------------------------------------------------ 1468 * Data Api implementation 1469 * ------------------------------------------------------------------------ 1470 */ 1471 1472 1473 $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) { 1474 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 1475 if (event.currentTarget.tagName === 'A') { 1476 event.preventDefault(); 1477 } 1478 1479 var $trigger = $(this); 1480 var selector = Util.getSelectorFromElement(this); 1481 var selectors = [].slice.call(document.querySelectorAll(selector)); 1482 $(selectors).each(function () { 1483 var $target = $(this); 1484 var data = $target.data(DATA_KEY$3); 1485 var config = data ? 'toggle' : $trigger.data(); 1486 1487 Collapse._jQueryInterface.call($target, config); 1488 }); 1489 }); 1490 /** 1491 * ------------------------------------------------------------------------ 1492 * jQuery 1493 * ------------------------------------------------------------------------ 1494 */ 1495 1496 $.fn[NAME$3] = Collapse._jQueryInterface; 1497 $.fn[NAME$3].Constructor = Collapse; 1498 1499 $.fn[NAME$3].noConflict = function () { 1500 $.fn[NAME$3] = JQUERY_NO_CONFLICT$3; 1501 return Collapse._jQueryInterface; 1502 }; 1503 1504 /**! 1505 * @fileOverview Kickass library to create and place poppers near their reference elements. 1506 * @version 1.14.6 1507 * @license 1508 * Copyright (c) 2016 Federico Zivolo and contributors 1509 * 1510 * Permission is hereby granted, free of charge, to any person obtaining a copy 1511 * of this software and associated documentation files (the "Software"), to deal 1512 * in the Software without restriction, including without limitation the rights 1513 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 1514 * copies of the Software, and to permit persons to whom the Software is 1515 * furnished to do so, subject to the following conditions: 1516 * 1517 * The above copyright notice and this permission notice shall be included in all 1518 * copies or substantial portions of the Software. 1519 * 1520 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1521 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1522 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1523 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1524 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 1525 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 1526 * SOFTWARE. 1527 */ 1528 var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'; 1529 1530 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 1531 var timeoutDuration = 0; 1532 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 1533 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 1534 timeoutDuration = 1; 1535 break; 1536 } 1537 } 1538 1539 function microtaskDebounce(fn) { 1540 var called = false; 1541 return function () { 1542 if (called) { 1543 return; 1544 } 1545 called = true; 1546 window.Promise.resolve().then(function () { 1547 called = false; 1548 fn(); 1549 }); 1550 }; 1551 } 1552 1553 function taskDebounce(fn) { 1554 var scheduled = false; 1555 return function () { 1556 if (!scheduled) { 1557 scheduled = true; 1558 setTimeout(function () { 1559 scheduled = false; 1560 fn(); 1561 }, timeoutDuration); 1562 } 1563 }; 1564 } 1565 1566 var supportsMicroTasks = isBrowser && window.Promise; 1567 1568 /** 1569 * Create a debounced version of a method, that's asynchronously deferred 1570 * but called in the minimum time possible. 1571 * 1572 * @method 1573 * @memberof Popper.Utils 1574 * @argument {Function} fn 1575 * @returns {Function} 1576 */ 1577 var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 1578 1579 /** 1580 * Check if the given variable is a function 1581 * @method 1582 * @memberof Popper.Utils 1583 * @argument {Any} functionToCheck - variable to check 1584 * @returns {Boolean} answer to: is a function? 1585 */ 1586 function isFunction(functionToCheck) { 1587 var getType = {}; 1588 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 1589 } 1590 1591 /** 1592 * Get CSS computed property of the given element 1593 * @method 1594 * @memberof Popper.Utils 1595 * @argument {Eement} element 1596 * @argument {String} property 1597 */ 1598 function getStyleComputedProperty(element, property) { 1599 if (element.nodeType !== 1) { 1600 return []; 1601 } 1602 // NOTE: 1 DOM access here 1603 var window = element.ownerDocument.defaultView; 1604 var css = window.getComputedStyle(element, null); 1605 return property ? css[property] : css; 1606 } 1607 1608 /** 1609 * Returns the parentNode or the host of the element 1610 * @method 1611 * @memberof Popper.Utils 1612 * @argument {Element} element 1613 * @returns {Element} parent 1614 */ 1615 function getParentNode(element) { 1616 if (element.nodeName === 'HTML') { 1617 return element; 1618 } 1619 return element.parentNode || element.host; 1620 } 1621 1622 /** 1623 * Returns the scrolling parent of the given element 1624 * @method 1625 * @memberof Popper.Utils 1626 * @argument {Element} element 1627 * @returns {Element} scroll parent 1628 */ 1629 function getScrollParent(element) { 1630 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 1631 if (!element) { 1632 return document.body; 1633 } 1634 1635 switch (element.nodeName) { 1636 case 'HTML': 1637 case 'BODY': 1638 return element.ownerDocument.body; 1639 case '#document': 1640 return element.body; 1641 } 1642 1643 // Firefox want us to check `-x` and `-y` variations as well 1644 1645 var _getStyleComputedProp = getStyleComputedProperty(element), 1646 overflow = _getStyleComputedProp.overflow, 1647 overflowX = _getStyleComputedProp.overflowX, 1648 overflowY = _getStyleComputedProp.overflowY; 1649 1650 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 1651 return element; 1652 } 1653 1654 return getScrollParent(getParentNode(element)); 1655 } 1656 1657 var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 1658 var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 1659 1660 /** 1661 * Determines if the browser is Internet Explorer 1662 * @method 1663 * @memberof Popper.Utils 1664 * @param {Number} version to check 1665 * @returns {Boolean} isIE 1666 */ 1667 function isIE(version) { 1668 if (version === 11) { 1669 return isIE11; 1670 } 1671 if (version === 10) { 1672 return isIE10; 1673 } 1674 return isIE11 || isIE10; 1675 } 1676 1677 /** 1678 * Returns the offset parent of the given element 1679 * @method 1680 * @memberof Popper.Utils 1681 * @argument {Element} element 1682 * @returns {Element} offset parent 1683 */ 1684 function getOffsetParent(element) { 1685 if (!element) { 1686 return document.documentElement; 1687 } 1688 1689 var noOffsetParent = isIE(10) ? document.body : null; 1690 1691 // NOTE: 1 DOM access here 1692 var offsetParent = element.offsetParent || null; 1693 // Skip hidden elements which don't have an offsetParent 1694 while (offsetParent === noOffsetParent && element.nextElementSibling) { 1695 offsetParent = (element = element.nextElementSibling).offsetParent; 1696 } 1697
vendor: 11,872 bytes, lines 1698-2043
1698 var nodeName = offsetParent && offsetParent.nodeName; 1699 1700 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 1701 return element ? element.ownerDocument.documentElement : document.documentElement; 1702 } 1703 1704 // .offsetParent will return the closest TH, TD or TABLE in case 1705 // no offsetParent is present, I hate this job... 1706 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 1707 return getOffsetParent(offsetParent); 1708 } 1709 1710 return offsetParent; 1711 } 1712 1713 function isOffsetContainer(element) { 1714 var nodeName = element.nodeName; 1715 1716 if (nodeName === 'BODY') { 1717 return false; 1718 } 1719 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 1720 } 1721 1722 /** 1723 * Finds the root node (document, shadowDOM root) of the given element 1724 * @method 1725 * @memberof Popper.Utils 1726 * @argument {Element} node 1727 * @returns {Element} root node 1728 */ 1729 function getRoot(node) { 1730 if (node.parentNode !== null) { 1731 return getRoot(node.parentNode); 1732 } 1733 1734 return node; 1735 } 1736 1737 /** 1738 * Finds the offset parent common to the two provided nodes 1739 * @method 1740 * @memberof Popper.Utils 1741 * @argument {Element} element1 1742 * @argument {Element} element2 1743 * @returns {Element} common offset parent 1744 */ 1745 function findCommonOffsetParent(element1, element2) { 1746 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 1747 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 1748 return document.documentElement; 1749 } 1750 1751 // Here we make sure to give as "start" the element that comes first in the DOM 1752 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 1753 var start = order ? element1 : element2; 1754 var end = order ? element2 : element1; 1755 1756 // Get common ancestor container 1757 var range = document.createRange(); 1758 range.setStart(start, 0); 1759 range.setEnd(end, 0); 1760 var commonAncestorContainer = range.commonAncestorContainer; 1761 1762 // Both nodes are inside #document 1763 1764 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 1765 if (isOffsetContainer(commonAncestorContainer)) { 1766 return commonAncestorContainer; 1767 } 1768 1769 return getOffsetParent(commonAncestorContainer); 1770 } 1771 1772 // one of the nodes is inside shadowDOM, find which one 1773 var element1root = getRoot(element1); 1774 if (element1root.host) { 1775 return findCommonOffsetParent(element1root.host, element2); 1776 } else { 1777 return findCommonOffsetParent(element1, getRoot(element2).host); 1778 } 1779 } 1780 1781 /** 1782 * Gets the scroll value of the given element in the given side (top and left) 1783 * @method 1784 * @memberof Popper.Utils 1785 * @argument {Element} element 1786 * @argument {String} side `top` or `left` 1787 * @returns {number} amount of scrolled pixels 1788 */ 1789 function getScroll(element) { 1790 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 1791 1792 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 1793 var nodeName = element.nodeName; 1794 1795 if (nodeName === 'BODY' || nodeName === 'HTML') { 1796 var html = element.ownerDocument.documentElement; 1797 var scrollingElement = element.ownerDocument.scrollingElement || html; 1798 return scrollingElement[upperSide]; 1799 } 1800 1801 return element[upperSide]; 1802 } 1803 1804 /* 1805 * Sum or subtract the element scroll values (left and top) from a given rect object 1806 * @method 1807 * @memberof Popper.Utils 1808 * @param {Object} rect - Rect object you want to change 1809 * @param {HTMLElement} element - The element from the function reads the scroll values 1810 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 1811 * @return {Object} rect - The modifier rect object 1812 */ 1813 function includeScroll(rect, element) { 1814 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 1815 1816 var scrollTop = getScroll(element, 'top'); 1817 var scrollLeft = getScroll(element, 'left'); 1818 var modifier = subtract ? -1 : 1; 1819 rect.top += scrollTop * modifier; 1820 rect.bottom += scrollTop * modifier; 1821 rect.left += scrollLeft * modifier; 1822 rect.right += scrollLeft * modifier; 1823 return rect; 1824 } 1825 1826 /* 1827 * Helper to detect borders of a given element 1828 * @method 1829 * @memberof Popper.Utils 1830 * @param {CSSStyleDeclaration} styles 1831 * Result of `getStyleComputedProperty` on the given element 1832 * @param {String} axis - `x` or `y` 1833 * @return {number} borders - The borders size of the given axis 1834 */ 1835 1836 function getBordersSize(styles, axis) { 1837 var sideA = axis === 'x' ? 'Left' : 'Top'; 1838 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 1839 1840 return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10); 1841 } 1842 1843 function getSize(axis, body, html, computedStyle) { 1844 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); 1845 } 1846 1847 function getWindowSizes(document) { 1848 var body = document.body; 1849 var html = document.documentElement; 1850 var computedStyle = isIE(10) && getComputedStyle(html); 1851 1852 return { 1853 height: getSize('Height', body, html, computedStyle), 1854 width: getSize('Width', body, html, computedStyle) 1855 }; 1856 } 1857 1858 var classCallCheck = function (instance, Constructor) { 1859 if (!(instance instanceof Constructor)) { 1860 throw new TypeError("Cannot call a class as a function"); 1861 } 1862 }; 1863 1864 var createClass = function () { 1865 function defineProperties(target, props) { 1866 for (var i = 0; i < props.length; i++) { 1867 var descriptor = props[i]; 1868 descriptor.enumerable = descriptor.enumerable || false; 1869 descriptor.configurable = true; 1870 if ("value" in descriptor) descriptor.writable = true; 1871 Object.defineProperty(target, descriptor.key, descriptor); 1872 } 1873 } 1874 1875 return function (Constructor, protoProps, staticProps) { 1876 if (protoProps) defineProperties(Constructor.prototype, protoProps); 1877 if (staticProps) defineProperties(Constructor, staticProps); 1878 return Constructor; 1879 }; 1880 }(); 1881 1882 1883 1884 1885 1886 var defineProperty = function (obj, key, value) { 1887 if (key in obj) { 1888 Object.defineProperty(obj, key, { 1889 value: value, 1890 enumerable: true, 1891 configurable: true, 1892 writable: true 1893 }); 1894 } else { 1895 obj[key] = value; 1896 } 1897 1898 return obj; 1899 }; 1900 1901 var _extends = Object.assign || function (target) { 1902 for (var i = 1; i < arguments.length; i++) { 1903 var source = arguments[i]; 1904 1905 for (var key in source) { 1906 if (Object.prototype.hasOwnProperty.call(source, key)) { 1907 target[key] = source[key]; 1908 } 1909 } 1910 } 1911 1912 return target; 1913 }; 1914 1915 /** 1916 * Given element offsets, generate an output similar to getBoundingClientRect 1917 * @method 1918 * @memberof Popper.Utils 1919 * @argument {Object} offsets 1920 * @returns {Object} ClientRect like output 1921 */ 1922 function getClientRect(offsets) { 1923 return _extends({}, offsets, { 1924 right: offsets.left + offsets.width, 1925 bottom: offsets.top + offsets.height 1926 }); 1927 } 1928 1929 /** 1930 * Get bounding client rect of given element 1931 * @method 1932 * @memberof Popper.Utils 1933 * @param {HTMLElement} element 1934 * @return {Object} client rect 1935 */ 1936 function getBoundingClientRect(element) { 1937 var rect = {}; 1938 1939 // IE10 10 FIX: Please, don't ask, the element isn't 1940 // considered in DOM in some circumstances... 1941 // This isn't reproducible in IE10 compatibility mode of IE11 1942 try { 1943 if (isIE(10)) { 1944 rect = element.getBoundingClientRect(); 1945 var scrollTop = getScroll(element, 'top'); 1946 var scrollLeft = getScroll(element, 'left'); 1947 rect.top += scrollTop; 1948 rect.left += scrollLeft; 1949 rect.bottom += scrollTop; 1950 rect.right += scrollLeft; 1951 } else { 1952 rect = element.getBoundingClientRect(); 1953 } 1954 } catch (e) {} 1955 1956 var result = { 1957 left: rect.left, 1958 top: rect.top, 1959 width: rect.right - rect.left, 1960 height: rect.bottom - rect.top 1961 }; 1962 1963 // subtract scrollbar size from sizes 1964 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 1965 var width = sizes.width || element.clientWidth || result.right - result.left; 1966 var height = sizes.height || element.clientHeight || result.bottom - result.top; 1967 1968 var horizScrollbar = element.offsetWidth - width; 1969 var vertScrollbar = element.offsetHeight - height; 1970 1971 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 1972 // we make this check conditional for performance reasons 1973 if (horizScrollbar || vertScrollbar) { 1974 var styles = getStyleComputedProperty(element); 1975 horizScrollbar -= getBordersSize(styles, 'x'); 1976 vertScrollbar -= getBordersSize(styles, 'y'); 1977 1978 result.width -= horizScrollbar; 1979 result.height -= vertScrollbar; 1980 } 1981 1982 return getClientRect(result); 1983 } 1984 1985 function getOffsetRectRelativeToArbitraryNode(children, parent) { 1986 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 1987 1988 var isIE10 = isIE(10); 1989 var isHTML = parent.nodeName === 'HTML'; 1990 var childrenRect = getBoundingClientRect(children); 1991 var parentRect = getBoundingClientRect(parent); 1992 var scrollParent = getScrollParent(children); 1993 1994 var styles = getStyleComputedProperty(parent); 1995 var borderTopWidth = parseFloat(styles.borderTopWidth, 10); 1996 var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); 1997 1998 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 1999 if (fixedPosition && isHTML) { 2000 parentRect.top = Math.max(parentRect.top, 0); 2001 parentRect.left = Math.max(parentRect.left, 0); 2002 } 2003 var offsets = getClientRect({ 2004 top: childrenRect.top - parentRect.top - borderTopWidth, 2005 left: childrenRect.left - parentRect.left - borderLeftWidth, 2006 width: childrenRect.width, 2007 height: childrenRect.height 2008 }); 2009 offsets.marginTop = 0; 2010 offsets.marginLeft = 0; 2011 2012 // Subtract margins of documentElement in case it's being used as parent 2013 // we do this only on HTML because it's the only element that behaves 2014 // differently when margins are applied to it. The margins are included in 2015 // the box of the documentElement, in the other cases not. 2016 if (!isIE10 && isHTML) { 2017 var marginTop = parseFloat(styles.marginTop, 10); 2018 var marginLeft = parseFloat(styles.marginLeft, 10); 2019 2020 offsets.top -= borderTopWidth - marginTop; 2021 offsets.bottom -= borderTopWidth - marginTop; 2022 offsets.left -= borderLeftWidth - marginLeft; 2023 offsets.right -= borderLeftWidth - marginLeft; 2024 2025 // Attach marginTop and marginLeft because in some circumstances we may need them 2026 offsets.marginTop = marginTop; 2027 offsets.marginLeft = marginLeft; 2028 } 2029 2030 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 2031 offsets = includeScroll(offsets, parent); 2032 } 2033 2034 return offsets; 2035 } 2036 2037 function getViewportOffsetRectRelativeToArtbitraryNode(element) { 2038 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 2039 2040 var html = element.ownerDocument.documentElement; 2041 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 2042 var width = Math.max(html.clientWidth, window.innerWidth || 0); 2043 var height = Math.max(html.clientHeight, window.innerHeight || 0
vendor: 6,497 bytes, lines 2043-2237
2043); 2044 2045 var scrollTop = !excludeScroll ? getScroll(html) : 0; 2046 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 2047 2048 var offset = { 2049 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 2050 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 2051 width: width, 2052 height: height 2053 }; 2054 2055 return getClientRect(offset); 2056 } 2057 2058 /** 2059 * Check if the given element is fixed or is inside a fixed parent 2060 * @method 2061 * @memberof Popper.Utils 2062 * @argument {Element} element 2063 * @argument {Element} customContainer 2064 * @returns {Boolean} answer to "isFixed?" 2065 */ 2066 function isFixed(element) { 2067 var nodeName = element.nodeName; 2068 if (nodeName === 'BODY' || nodeName === 'HTML') { 2069 return false; 2070 } 2071 if (getStyleComputedProperty(element, 'position') === 'fixed') { 2072 return true; 2073 } 2074 return isFixed(getParentNode(element)); 2075 } 2076 2077 /** 2078 * Finds the first parent of an element that has a transformed property defined 2079 * @method 2080 * @memberof Popper.Utils 2081 * @argument {Element} element 2082 * @returns {Element} first transformed parent or documentElement 2083 */ 2084 2085 function getFixedPositionOffsetParent(element) { 2086 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 2087 if (!element || !element.parentElement || isIE()) { 2088 return document.documentElement; 2089 } 2090 var el = element.parentElement; 2091 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 2092 el = el.parentElement; 2093 } 2094 return el || document.documentElement; 2095 } 2096 2097 /** 2098 * Computed the boundaries limits and return them 2099 * @method 2100 * @memberof Popper.Utils 2101 * @param {HTMLElement} popper 2102 * @param {HTMLElement} reference 2103 * @param {number} padding 2104 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 2105 * @param {Boolean} fixedPosition - Is in fixed position mode 2106 * @returns {Object} Coordinates of the boundaries 2107 */ 2108 function getBoundaries(popper, reference, padding, boundariesElement) { 2109 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 2110 2111 // NOTE: 1 DOM access here 2112 2113 var boundaries = { top: 0, left: 0 }; 2114 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); 2115 2116 // Handle viewport case 2117 if (boundariesElement === 'viewport') { 2118 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 2119 } else { 2120 // Handle other cases based on DOM element used as boundaries 2121 var boundariesNode = void 0; 2122 if (boundariesElement === 'scrollParent') { 2123 boundariesNode = getScrollParent(getParentNode(reference)); 2124 if (boundariesNode.nodeName === 'BODY') { 2125 boundariesNode = popper.ownerDocument.documentElement; 2126 } 2127 } else if (boundariesElement === 'window') { 2128 boundariesNode = popper.ownerDocument.documentElement; 2129 } else { 2130 boundariesNode = boundariesElement; 2131 } 2132 2133 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 2134 2135 // In case of HTML, we need a different computation 2136 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 2137 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 2138 height = _getWindowSizes.height, 2139 width = _getWindowSizes.width; 2140 2141 boundaries.top += offsets.top - offsets.marginTop; 2142 boundaries.bottom = height + offsets.top; 2143 boundaries.left += offsets.left - offsets.marginLeft; 2144 boundaries.right = width + offsets.left; 2145 } else { 2146 // for all the other DOM elements, this one is good 2147 boundaries = offsets; 2148 } 2149 } 2150 2151 // Add paddings 2152 padding = padding || 0; 2153 var isPaddingNumber = typeof padding === 'number'; 2154 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 2155 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 2156 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 2157 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 2158 2159 return boundaries; 2160 } 2161 2162 function getArea(_ref) { 2163 var width = _ref.width, 2164 height = _ref.height; 2165 2166 return width * height; 2167 } 2168 2169 /** 2170 * Utility used to transform the `auto` placement to the placement with more 2171 * available space. 2172 * @method 2173 * @memberof Popper.Utils 2174 * @argument {Object} data - The data object generated by update method 2175 * @argument {Object} options - Modifiers configuration and options 2176 * @returns {Object} The data object, properly modified 2177 */ 2178 function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 2179 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 2180 2181 if (placement.indexOf('auto') === -1) { 2182 return placement; 2183 } 2184 2185 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 2186 2187 var rects = { 2188 top: { 2189 width: boundaries.width, 2190 height: refRect.top - boundaries.top 2191 }, 2192 right: { 2193 width: boundaries.right - refRect.right, 2194 height: boundaries.height 2195 }, 2196 bottom: { 2197 width: boundaries.width, 2198 height: boundaries.bottom - refRect.bottom 2199 }, 2200 left: { 2201 width: refRect.left - boundaries.left, 2202 height: boundaries.height 2203 } 2204 }; 2205 2206 var sortedAreas = Object.keys(rects).map(function (key) { 2207 return _extends({ 2208 key: key 2209 }, rects[key], { 2210 area: getArea(rects[key]) 2211 }); 2212 }).sort(function (a, b) { 2213 return b.area - a.area; 2214 }); 2215 2216 var filteredAreas = sortedAreas.filter(function (_ref2) { 2217 var width = _ref2.width, 2218 height = _ref2.height; 2219 return width >= popper.clientWidth && height >= popper.clientHeight; 2220 }); 2221 2222 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 2223 2224 var variation = placement.split('-')[1]; 2225 2226 return computedPlacement + (variation ? '-' + variation : ''); 2227 } 2228 2229 /** 2230 * Get offsets to the reference element 2231 * @method 2232 * @memberof Popper.Utils 2233 * @param {Object} state 2234 * @param {Element} popper - the popper element 2235 * @param {Element} reference - the reference element (the popper will be relative to this) 2236 * @param {Element} fixedPosition - is in fixed position mode 2237 * @returns {Object}
2237 An object containing the offsets which will be applied to the popper 2238 */ 2239 function getReferenceOffsets(state, popper, reference) { 2240 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 2241 2242 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference
vendor: 16,592 bytes, lines 2242-2729
2242); 2243 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 2244 } 2245 2246 /** 2247 * Get the outer sizes of the given element (offset size + margins) 2248 * @method 2249 * @memberof Popper.Utils 2250 * @argument {Element} element 2251 * @returns {Object} object containing width and height properties 2252 */ 2253 function getOuterSizes(element) { 2254 var window = element.ownerDocument.defaultView; 2255 var styles = window.getComputedStyle(element); 2256 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 2257 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 2258 var result = { 2259 width: element.offsetWidth + y, 2260 height: element.offsetHeight + x 2261 }; 2262 return result; 2263 } 2264 2265 /** 2266 * Get the opposite placement of the given one 2267 * @method 2268 * @memberof Popper.Utils 2269 * @argument {String} placement 2270 * @returns {String} flipped placement 2271 */ 2272 function getOppositePlacement(placement) { 2273 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 2274 return placement.replace(/left|right|bottom|top/g, function (matched) { 2275 return hash[matched]; 2276 }); 2277 } 2278 2279 /** 2280 * Get offsets to the popper 2281 * @method 2282 * @memberof Popper.Utils 2283 * @param {Object} position - CSS position the Popper will get applied 2284 * @param {HTMLElement} popper - the popper element 2285 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 2286 * @param {String} placement - one of the valid placement options 2287 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 2288 */ 2289 function getPopperOffsets(popper, referenceOffsets, placement) { 2290 placement = placement.split('-')[0]; 2291 2292 // Get popper node sizes 2293 var popperRect = getOuterSizes(popper); 2294 2295 // Add position, width and height to our offsets object 2296 var popperOffsets = { 2297 width: popperRect.width, 2298 height: popperRect.height 2299 }; 2300 2301 // depending by the popper placement we have to compute its offsets slightly differently 2302 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 2303 var mainSide = isHoriz ? 'top' : 'left'; 2304 var secondarySide = isHoriz ? 'left' : 'top'; 2305 var measurement = isHoriz ? 'height' : 'width'; 2306 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 2307 2308 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 2309 if (placement === secondarySide) { 2310 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 2311 } else { 2312 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 2313 } 2314 2315 return popperOffsets; 2316 } 2317 2318 /** 2319 * Mimics the `find` method of Array 2320 * @method 2321 * @memberof Popper.Utils 2322 * @argument {Array} arr 2323 * @argument prop 2324 * @argument value 2325 * @returns index or -1 2326 */ 2327 function find(arr, check) { 2328 // use native find if supported 2329 if (Array.prototype.find) { 2330 return arr.find(check); 2331 } 2332 2333 // use `filter` to obtain the same behavior of `find` 2334 return arr.filter(check)[0]; 2335 } 2336 2337 /** 2338 * Return the index of the matching object 2339 * @method 2340 * @memberof Popper.Utils 2341 * @argument {Array} arr 2342 * @argument prop 2343 * @argument value 2344 * @returns index or -1 2345 */ 2346 function findIndex(arr, prop, value) { 2347 // use native findIndex if supported 2348 if (Array.prototype.findIndex) { 2349 return arr.findIndex(function (cur) { 2350 return cur[prop] === value; 2351 }); 2352 } 2353 2354 // use `find` + `indexOf` if `findIndex` isn't supported 2355 var match = find(arr, function (obj) { 2356 return obj[prop] === value; 2357 }); 2358 return arr.indexOf(match); 2359 } 2360 2361 /** 2362 * Loop trough the list of modifiers and run them in order, 2363 * each of them will then edit the data object. 2364 * @method 2365 * @memberof Popper.Utils 2366 * @param {dataObject} data 2367 * @param {Array} modifiers 2368 * @param {String} ends - Optional modifier name used as stopper 2369 * @returns {dataObject} 2370 */ 2371 function runModifiers(modifiers, data, ends) { 2372 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 2373 2374 modifiersToRun.forEach(function (modifier) { 2375 if (modifier['function']) { 2376 // eslint-disable-line dot-notation 2377 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 2378 } 2379 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 2380 if (modifier.enabled && isFunction(fn)) { 2381 // Add properties to offsets to make them a complete clientRect object 2382 // we do this before each modifier to make sure the previous one doesn't 2383 // mess with these values 2384 data.offsets.popper = getClientRect(data.offsets.popper); 2385 data.offsets.reference = getClientRect(data.offsets.reference); 2386 2387 data = fn(data, modifier); 2388 } 2389 }); 2390 2391 return data; 2392 } 2393 2394 /** 2395 * Updates the position of the popper, computing the new offsets and applying 2396 * the new style.<br /> 2397 * Prefer `scheduleUpdate` over `update` because of performance reasons. 2398 * @method 2399 * @memberof Popper 2400 */ 2401 function update() { 2402 // if popper is destroyed, don't perform any further update 2403 if (this.state.isDestroyed) { 2404 return; 2405 } 2406 2407 var data = { 2408 instance: this, 2409 styles: {}, 2410 arrowStyles: {}, 2411 attributes: {}, 2412 flipped: false, 2413 offsets: {} 2414 }; 2415 2416 // compute reference element offsets 2417 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 2418 2419 // compute auto placement, store placement inside the data object, 2420 // modifiers will be able to edit `placement` if needed 2421 // and refer to originalPlacement to know the original value 2422 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 2423 2424 // store the computed placement inside `originalPlacement` 2425 data.originalPlacement = data.placement; 2426 2427 data.positionFixed = this.options.positionFixed; 2428 2429 // compute the popper offsets 2430 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 2431 2432 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 2433 2434 // run the modifiers 2435 data = runModifiers(this.modifiers, data); 2436 2437 // the first `update` will call `onCreate` callback 2438 // the other ones will call `onUpdate` callback 2439 if (!this.state.isCreated) { 2440 this.state.isCreated = true; 2441 this.options.onCreate(data); 2442 } else { 2443 this.options.onUpdate(data); 2444 } 2445 } 2446 2447 /** 2448 * Helper used to know if the given modifier is enabled. 2449 * @method 2450 * @memberof Popper.Utils 2451 * @returns {Boolean} 2452 */ 2453 function isModifierEnabled(modifiers, modifierName) { 2454 return modifiers.some(function (_ref) { 2455 var name = _ref.name, 2456 enabled = _ref.enabled; 2457 return enabled && name === modifierName; 2458 }); 2459 } 2460 2461 /** 2462 * Get the prefixed supported property name 2463 * @method 2464 * @memberof Popper.Utils 2465 * @argument {String} property (camelCase) 2466 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 2467 */ 2468 function getSupportedPropertyName(property) { 2469 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 2470 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 2471 2472 for (var i = 0; i < prefixes.length; i++) { 2473 var prefix = prefixes[i]; 2474 var toCheck = prefix ? '' + prefix + upperProp : property; 2475 if (typeof document.body.style[toCheck] !== 'undefined') { 2476 return toCheck; 2477 } 2478 } 2479 return null; 2480 } 2481 2482 /** 2483 * Destroys the popper. 2484 * @method 2485 * @memberof Popper 2486 */ 2487 function destroy() { 2488 this.state.isDestroyed = true; 2489 2490 // touch DOM only if `applyStyle` modifier is enabled 2491 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 2492 this.popper.removeAttribute('x-placement'); 2493 this.popper.style.position = ''; 2494 this.popper.style.top = ''; 2495 this.popper.style.left = ''; 2496 this.popper.style.right = ''; 2497 this.popper.style.bottom = ''; 2498 this.popper.style.willChange = ''; 2499 this.popper.style[getSupportedPropertyName('transform')] = ''; 2500 } 2501 2502 this.disableEventListeners(); 2503 2504 // remove the popper if user explicity asked for the deletion on destroy 2505 // do not use `remove` because IE11 doesn't support it 2506 if (this.options.removeOnDestroy) { 2507 this.popper.parentNode.removeChild(this.popper); 2508 } 2509 return this; 2510 } 2511 2512 /** 2513 * Get the window associated with the element 2514 * @argument {Element} element 2515 * @returns {Window} 2516 */ 2517 function getWindow(element) { 2518 var ownerDocument = element.ownerDocument; 2519 return ownerDocument ? ownerDocument.defaultView : window; 2520 } 2521 2522 function attachToScrollParents(scrollParent, event, callback, scrollParents) { 2523 var isBody = scrollParent.nodeName === 'BODY'; 2524 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 2525 target.addEventListener(event, callback, { passive: true }); 2526 2527 if (!isBody) { 2528 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 2529 } 2530 scrollParents.push(target); 2531 } 2532 2533 /** 2534 * Setup needed event listeners used to update the popper position 2535 * @method 2536 * @memberof Popper.Utils 2537 * @private 2538 */ 2539 function setupEventListeners(reference, options, state, updateBound) { 2540 // Resize event listener on window 2541 state.updateBound = updateBound; 2542 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 2543 2544 // Scroll event listener on scroll parents 2545 var scrollElement = getScrollParent(reference); 2546 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 2547 state.scrollElement = scrollElement; 2548 state.eventsEnabled = true; 2549 2550 return state; 2551 } 2552 2553 /** 2554 * It will add resize/scroll events and start recalculating 2555 * position of the popper element when they are triggered. 2556 * @method 2557 * @memberof Popper 2558 */ 2559 function enableEventListeners() { 2560 if (!this.state.eventsEnabled) { 2561 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 2562 } 2563 } 2564 2565 /** 2566 * Remove event listeners used to update the popper position 2567 * @method 2568 * @memberof Popper.Utils 2569 * @private 2570 */ 2571 function removeEventListeners(reference, state) { 2572 // Remove resize event listener on window 2573 getWindow(reference).removeEventListener('resize', state.updateBound); 2574 2575 // Remove scroll event listener on scroll parents 2576 state.scrollParents.forEach(function (target) { 2577 target.removeEventListener('scroll', state.updateBound); 2578 }); 2579 2580 // Reset state 2581 state.updateBound = null; 2582 state.scrollParents = []; 2583 state.scrollElement = null; 2584 state.eventsEnabled = false; 2585 return state; 2586 } 2587 2588 /** 2589 * It will remove resize/scroll events and won't recalculate popper position 2590 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 2591 * unless you call `update` method manually. 2592 * @method 2593 * @memberof Popper 2594 */ 2595 function disableEventListeners() { 2596 if (this.state.eventsEnabled) { 2597 cancelAnimationFrame(this.scheduleUpdate); 2598 this.state = removeEventListeners(this.reference, this.state); 2599 } 2600 } 2601 2602 /** 2603 * Tells if a given input is a number 2604 * @method 2605 * @memberof Popper.Utils 2606 * @param {*} input to check 2607 * @return {Boolean} 2608 */ 2609 function isNumeric(n) { 2610 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 2611 } 2612 2613 /** 2614 * Set the style to the given popper 2615 * @method 2616 * @memberof Popper.Utils 2617 * @argument {Element} element - Element to apply the style to 2618 * @argument {Object} styles 2619 * Object with a list of properties and values which will be applied to the element 2620 */ 2621 function setStyles(element, styles) { 2622 Object.keys(styles).forEach(function (prop) { 2623 var unit = ''; 2624 // add unit if the value is numeric and is one of the following 2625 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 2626 unit = 'px'; 2627 } 2628 element.style[prop] = styles[prop] + unit; 2629 }); 2630 } 2631 2632 /** 2633 * Set the attributes to the given popper 2634 * @method 2635 * @memberof Popper.Utils 2636 * @argument {Element} element - Element to apply the attributes to 2637 * @argument {Object} styles 2638 * Object with a list of properties and values which will be applied to the element 2639 */ 2640 function setAttributes(element, attributes) { 2641 Object.keys(attributes).forEach(function (prop) { 2642 var value = attributes[prop]; 2643 if (value !== false) { 2644 element.setAttribute(prop, attributes[prop]); 2645 } else { 2646 element.removeAttribute(prop); 2647 } 2648 }); 2649 } 2650 2651 /** 2652 * @function 2653 * @memberof Modifiers 2654 * @argument {Object} data - The data object generated by `update` method 2655 * @argument {Object} data.styles - List of style properties - values to apply to popper element 2656 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 2657 * @argument {Object} options - Modifiers configuration and options 2658 * @returns {Object} The same data object 2659 */ 2660 function applyStyle(data) { 2661 // any property present in `data.styles` will be applied to the popper, 2662 // in this way we can make the 3rd party modifiers add custom styles to it 2663 // Be aware, modifiers could override the properties defined in the previous 2664 // lines of this modifier! 2665 setStyles(data.instance.popper, data.styles); 2666 2667 // any property present in `data.attributes` will be applied to the popper, 2668 // they will be set as HTML attributes of the element 2669 setAttributes(data.instance.popper, data.attributes); 2670 2671 // if arrowElement is defined and arrowStyles has some properties 2672 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 2673 setStyles(data.arrowElement, data.arrowStyles); 2674 } 2675 2676 return data; 2677 } 2678 2679 /** 2680 * Set the x-placement attribute before everything else because it could be used 2681 * to add margins to the popper margins needs to be calculated to get the 2682 * correct popper offsets. 2683 * @method 2684 * @memberof Popper.modifiers 2685 * @param {HTMLElement} reference - The reference element used to position the popper 2686 * @param {HTMLElement} popper - The HTML element used as popper 2687 * @param {Object} options - Popper.js options 2688 */ 2689 function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 2690 // compute reference element offsets 2691 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 2692 2693 // compute auto placement, store placement inside the data object, 2694 // modifiers will be able to edit `placement` if needed 2695 // and refer to originalPlacement to know the original value 2696 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 2697 2698 popper.setAttribute('x-placement', placement); 2699 2700 // Apply `position` to popper before anything else because 2701 // without the position applied we can't guarantee correct computations 2702 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 2703 2704 return options; 2705 } 2706 2707 /** 2708 * @function 2709 * @memberof Popper.Utils 2710 * @argument {Object} data - The data object generated by `update` method 2711 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 2712 * @returns {Object} The popper's position offsets rounded 2713 * 2714 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 2715 * good as it can be within reason. 2716 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 2717 * 2718 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 2719 * as well on High DPI screens). 2720 * 2721 * Firefox prefers no rounding for positioning and does not have blurriness on 2722 * high DPI screens. 2723 * 2724 * Only horizontal placement and left/right values need to be considered. 2725 */ 2726 function getRoundedOffsets(data, shouldRound) { 2727 var _data$offsets = data.offsets, 2728 popper = _data$offsets.popper, 2729 reference = _data$offsets.reference;
2730 2731 2732 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 2733 var isVariation = data.placement.indexOf('-') !== -1; 2734 var sameWidthOddness = reference.width % 2 === popper.width % 2; 2735 var bothOddWidth = reference.width % 2 === 1 && popper.width % 2 === 1; 2736 var noRound = function noRound(v) { 2737 return v; 2738 }; 2739 2740 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthOddness ? Math.round : Math.floor; 2741 var verticalToInteger = !shouldRound ? noRound : Math.
vendor: 7,864 bytes, lines 2741-2948
2741round; 2742 2743 return { 2744 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 2745 top: verticalToInteger(popper.top), 2746 bottom: verticalToInteger(popper.bottom), 2747 right: horizontalToInteger(popper.right) 2748 }; 2749 } 2750 2751 var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 2752 2753 /** 2754 * @function 2755 * @memberof Modifiers 2756 * @argument {Object} data - The data object generated by `update` method 2757 * @argument {Object} options - Modifiers configuration and options 2758 * @returns {Object} The data object, properly modified 2759 */ 2760 function computeStyle(data, options) { 2761 var x = options.x, 2762 y = options.y; 2763 var popper = data.offsets.popper; 2764 2765 // Remove this legacy support in Popper.js v2 2766 2767 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 2768 return modifier.name === 'applyStyle'; 2769 }).gpuAcceleration; 2770 if (legacyGpuAccelerationOption !== undefined) { 2771 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 2772 } 2773 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 2774 2775 var offsetParent = getOffsetParent(data.instance.popper); 2776 var offsetParentRect = getBoundingClientRect(offsetParent); 2777 2778 // Styles 2779 var styles = { 2780 position: popper.position 2781 }; 2782 2783 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 2784 2785 var sideA = x === 'bottom' ? 'top' : 'bottom'; 2786 var sideB = y === 'right' ? 'left' : 'right'; 2787 2788 // if gpuAcceleration is set to `true` and transform is supported, 2789 // we use `translate3d` to apply the position to the popper we 2790 // automatically use the supported prefixed version if needed 2791 var prefixedProperty = getSupportedPropertyName('transform'); 2792 2793 // now, let's make a step back and look at this code closely (wtf?) 2794 // If the content of the popper grows once it's been positioned, it 2795 // may happen that the popper gets misplaced because of the new content 2796 // overflowing its reference element 2797 // To avoid this problem, we provide two options (x and y), which allow 2798 // the consumer to define the offset origin. 2799 // If we position a popper on top of a reference element, we can set 2800 // `x` to `top` to make the popper grow towards its top instead of 2801 // its bottom. 2802 var left = void 0, 2803 top = void 0; 2804 if (sideA === 'bottom') { 2805 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 2806 // and not the bottom of the html element 2807 if (offsetParent.nodeName === 'HTML') { 2808 top = -offsetParent.clientHeight + offsets.bottom; 2809 } else { 2810 top = -offsetParentRect.height + offsets.bottom; 2811 } 2812 } else { 2813 top = offsets.top; 2814 } 2815 if (sideB === 'right') { 2816 if (offsetParent.nodeName === 'HTML') { 2817 left = -offsetParent.clientWidth + offsets.right; 2818 } else { 2819 left = -offsetParentRect.width + offsets.right; 2820 } 2821 } else { 2822 left = offsets.left; 2823 } 2824 if (gpuAcceleration && prefixedProperty) { 2825 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 2826 styles[sideA] = 0; 2827 styles[sideB] = 0; 2828 styles.willChange = 'transform'; 2829 } else { 2830 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 2831 var invertTop = sideA === 'bottom' ? -1 : 1; 2832 var invertLeft = sideB === 'right' ? -1 : 1; 2833 styles[sideA] = top * invertTop; 2834 styles[sideB] = left * invertLeft; 2835 styles.willChange = sideA + ', ' + sideB; 2836 } 2837 2838 // Attributes 2839 var attributes = { 2840 'x-placement': data.placement 2841 }; 2842 2843 // Update `data` attributes, styles and arrowStyles 2844 data.attributes = _extends({}, attributes, data.attributes); 2845 data.styles = _extends({}, styles, data.styles); 2846 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 2847 2848 return data; 2849 } 2850 2851 /** 2852 * Helper used to know if the given modifier depends from another one.<br /> 2853 * It checks if the needed modifier is listed and enabled. 2854 * @method 2855 * @memberof Popper.Utils 2856 * @param {Array} modifiers - list of modifiers 2857 * @param {String} requestingName - name of requesting modifier 2858 * @param {String} requestedName - name of requested modifier 2859 * @returns {Boolean} 2860 */ 2861 function isModifierRequired(modifiers, requestingName, requestedName) { 2862 var requesting = find(modifiers, function (_ref) { 2863 var name = _ref.name; 2864 return name === requestingName; 2865 }); 2866 2867 var isRequired = !!requesting && modifiers.some(function (modifier) { 2868 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 2869 }); 2870 2871 if (!isRequired) { 2872 var _requesting = '`' + requestingName + '`'; 2873 var requested = '`' + requestedName + '`'; 2874 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 2875 } 2876 return isRequired; 2877 } 2878 2879 /** 2880 * @function 2881 * @memberof Modifiers 2882 * @argument {Object} data - The data object generated by update method 2883 * @argument {Object} options - Modifiers configuration and options 2884 * @returns {Object} The data object, properly modified 2885 */ 2886 function arrow(data, options) { 2887 var _data$offsets$arrow; 2888 2889 // arrow depends on keepTogether in order to work 2890 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 2891 return data; 2892 } 2893 2894 var arrowElement = options.element; 2895 2896 // if arrowElement is a string, suppose it's a CSS selector 2897 if (typeof arrowElement === 'string') { 2898 arrowElement = data.instance.popper.querySelector(arrowElement); 2899 2900 // if arrowElement is not found, don't run the modifier 2901 if (!arrowElement) { 2902 return data; 2903 } 2904 } else { 2905 // if the arrowElement isn't a query selector we must check that the 2906 // provided DOM node is child of its popper node 2907 if (!data.instance.popper.contains(arrowElement)) { 2908 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 2909 return data; 2910 } 2911 } 2912 2913 var placement = data.placement.split('-')[0]; 2914 var _data$offsets = data.offsets, 2915 popper = _data$offsets.popper, 2916 reference = _data$offsets.reference; 2917 2918 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 2919 2920 var len = isVertical ? 'height' : 'width'; 2921 var sideCapitalized = isVertical ? 'Top' : 'Left'; 2922 var side = sideCapitalized.toLowerCase(); 2923 var altSide = isVertical ? 'left' : 'top'; 2924 var opSide = isVertical ? 'bottom' : 'right'; 2925 var arrowElementSize = getOuterSizes(arrowElement)[len]; 2926 2927 // 2928 // extends keepTogether behavior making sure the popper and its 2929 // reference have enough pixels in conjunction 2930 // 2931 2932 // top/left side 2933 if (reference[opSide] - arrowElementSize < popper[side]) { 2934 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 2935 } 2936 // bottom/right side 2937 if (reference[side] + arrowElementSize > popper[opSide]) { 2938 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 2939 } 2940 data.offsets.popper = getClientRect(data.offsets.popper); 2941 2942 // compute center of the popper 2943 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 2944 2945 // Compute the sideValue using the updated popper offsets 2946 // take popper margin in account because we don't have this info available 2947 var css = getStyleComputedProperty(data.instance.popper); 2948 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]
vendor: 4,879 bytes, lines 2948-3088
2948, 10); 2949 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10); 2950 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 2951 2952 // prevent arrowElement from being placed not contiguously to its popper 2953 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 2954 2955 data.arrowElement = arrowElement; 2956 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 2957 2958 return data; 2959 } 2960 2961 /** 2962 * Get the opposite placement variation of the given one 2963 * @method 2964 * @memberof Popper.Utils 2965 * @argument {String} placement variation 2966 * @returns {String} flipped placement variation 2967 */ 2968 function getOppositeVariation(variation) { 2969 if (variation === 'end') { 2970 return 'start'; 2971 } else if (variation === 'start') { 2972 return 'end'; 2973 } 2974 return variation; 2975 } 2976 2977 /** 2978 * List of accepted placements to use as values of the `placement` option.<br /> 2979 * Valid placements are: 2980 * - `auto` 2981 * - `top` 2982 * - `right` 2983 * - `bottom` 2984 * - `left` 2985 * 2986 * Each placement can have a variation from this list: 2987 * - `-start` 2988 * - `-end` 2989 * 2990 * Variations are interpreted easily if you think of them as the left to right 2991 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 2992 * is right.<br /> 2993 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 2994 * 2995 * Some valid examples are: 2996 * - `top-end` (on top of reference, right aligned) 2997 * - `right-start` (on right of reference, top aligned) 2998 * - `bottom` (on bottom, centered) 2999 * - `auto-end` (on the side with more space available, alignment depends by placement) 3000 * 3001 * @static 3002 * @type {Array} 3003 * @enum {String} 3004 * @readonly 3005 * @method placements 3006 * @memberof Popper 3007 */ 3008 var 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']; 3009 3010 // Get rid of `auto` `auto-start` and `auto-end` 3011 var validPlacements = placements.slice(3); 3012 3013 /** 3014 * Given an initial placement, returns all the subsequent placements 3015 * clockwise (or counter-clockwise). 3016 * 3017 * @method 3018 * @memberof Popper.Utils 3019 * @argument {String} placement - A valid placement (it accepts variations) 3020 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 3021 * @returns {Array} placements including their variations 3022 */ 3023 function clockwise(placement) { 3024 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 3025 3026 var index = validPlacements.indexOf(placement); 3027 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 3028 return counter ? arr.reverse() : arr; 3029 } 3030 3031 var BEHAVIORS = { 3032 FLIP: 'flip', 3033 CLOCKWISE: 'clockwise', 3034 COUNTERCLOCKWISE: 'counterclockwise' 3035 }; 3036 3037 /** 3038 * @function 3039 * @memberof Modifiers 3040 * @argument {Object} data - The data object generated by update method 3041 * @argument {Object} options - Modifiers configuration and options 3042 * @returns {Object} The data object, properly modified 3043 */ 3044 function flip(data, options) { 3045 // if `inner` modifier is enabled, we can't use the `flip` modifier 3046 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 3047 return data; 3048 } 3049 3050 if (data.flipped && data.placement === data.originalPlacement) { 3051 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 3052 return data; 3053 } 3054 3055 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 3056 3057 var placement = data.placement.split('-')[0]; 3058 var placementOpposite = getOppositePlacement(placement); 3059 var variation = data.placement.split('-')[1] || ''; 3060 3061 var flipOrder = []; 3062 3063 switch (options.behavior) { 3064 case BEHAVIORS.FLIP: 3065 flipOrder = [placement, placementOpposite]; 3066 break; 3067 case BEHAVIORS.CLOCKWISE: 3068 flipOrder = clockwise(placement); 3069 break; 3070 case BEHAVIORS.COUNTERCLOCKWISE: 3071 flipOrder = clockwise(placement, true); 3072 break; 3073 default: 3074 flipOrder = options.behavior; 3075 } 3076 3077 flipOrder.forEach(function (step, index) { 3078 if (placement !== step || flipOrder.length === index + 1) { 3079 return data; 3080 } 3081 3082 placement = data.placement.split('-')[0]; 3083 placementOpposite = getOppositePlacement(placement); 3084 3085 var popperOffsets = data.offsets.popper; 3086 var refOffsets = data.offsets.reference; 3087 3088 // using floor because the reference offsets may contain decimals we are not going to consider here
vendor: 1,276 bytes, lines 3089-3101
3089 var floor = Math.floor; 3090 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); 3091 3092 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 3093 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 3094 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 3095 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 3096 3097 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 3098 3099 // flip the variation if required 3100 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 3101 var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom)
vendor: 22,169 bytes, lines 3101-3708
3101; 3102 3103 if (overlapsRef || overflowsBoundaries || flippedVariation) { 3104 // this boolean to detect any flip loop 3105 data.flipped = true; 3106 3107 if (overlapsRef || overflowsBoundaries) { 3108 placement = flipOrder[index + 1]; 3109 } 3110 3111 if (flippedVariation) { 3112 variation = getOppositeVariation(variation); 3113 } 3114 3115 data.placement = placement + (variation ? '-' + variation : ''); 3116 3117 // this object contains `position`, we want to preserve it along with 3118 // any additional property we may add in the future 3119 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 3120 3121 data = runModifiers(data.instance.modifiers, data, 'flip'); 3122 } 3123 }); 3124 return data; 3125 } 3126 3127 /** 3128 * @function 3129 * @memberof Modifiers 3130 * @argument {Object} data - The data object generated by update method 3131 * @argument {Object} options - Modifiers configuration and options 3132 * @returns {Object} The data object, properly modified 3133 */ 3134 function keepTogether(data) { 3135 var _data$offsets = data.offsets, 3136 popper = _data$offsets.popper, 3137 reference = _data$offsets.reference; 3138 3139 var placement = data.placement.split('-')[0]; 3140 var floor = Math.floor; 3141 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 3142 var side = isVertical ? 'right' : 'bottom'; 3143 var opSide = isVertical ? 'left' : 'top'; 3144 var measurement = isVertical ? 'width' : 'height'; 3145 3146 if (popper[side] < floor(reference[opSide])) { 3147 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 3148 } 3149 if (popper[opSide] > floor(reference[side])) { 3150 data.offsets.popper[opSide] = floor(reference[side]); 3151 } 3152 3153 return data; 3154 } 3155 3156 /** 3157 * Converts a string containing value + unit into a px value number 3158 * @function 3159 * @memberof {modifiers~offset} 3160 * @private 3161 * @argument {String} str - Value + unit string 3162 * @argument {String} measurement - `height` or `width` 3163 * @argument {Object} popperOffsets 3164 * @argument {Object} referenceOffsets 3165 * @returns {Number|String} 3166 * Value in pixels, or original string if no values were extracted 3167 */ 3168 function toValue(str, measurement, popperOffsets, referenceOffsets) { 3169 // separate value from unit 3170 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 3171 var value = +split[1]; 3172 var unit = split[2]; 3173 3174 // If it's not a number it's an operator, I guess 3175 if (!value) { 3176 return str; 3177 } 3178 3179 if (unit.indexOf('%') === 0) { 3180 var element = void 0; 3181 switch (unit) { 3182 case '%p': 3183 element = popperOffsets; 3184 break; 3185 case '%': 3186 case '%r': 3187 default: 3188 element = referenceOffsets; 3189 } 3190 3191 var rect = getClientRect(element); 3192 return rect[measurement] / 100 * value; 3193 } else if (unit === 'vh' || unit === 'vw') { 3194 // if is a vh or vw, we calculate the size based on the viewport 3195 var size = void 0; 3196 if (unit === 'vh') { 3197 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 3198 } else { 3199 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 3200 } 3201 return size / 100 * value; 3202 } else { 3203 // if is an explicit pixel unit, we get rid of the unit and keep the value 3204 // if is an implicit unit, it's px, and we return just the value 3205 return value; 3206 } 3207 } 3208 3209 /** 3210 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 3211 * @function 3212 * @memberof {modifiers~offset} 3213 * @private 3214 * @argument {String} offset 3215 * @argument {Object} popperOffsets 3216 * @argument {Object} referenceOffsets 3217 * @argument {String} basePlacement 3218 * @returns {Array} a two cells array with x and y offsets in numbers 3219 */ 3220 function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 3221 var offsets = [0, 0]; 3222 3223 // Use height if placement is left or right and index is 0 otherwise use width 3224 // in this way the first offset will use an axis and the second one 3225 // will use the other one 3226 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 3227 3228 // Split the offset string to obtain a list of values and operands 3229 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 3230 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 3231 return frag.trim(); 3232 }); 3233 3234 // Detect if the offset string contains a pair of values or a single one 3235 // they could be separated by comma or space 3236 var divider = fragments.indexOf(find(fragments, function (frag) { 3237 return frag.search(/,|\s/) !== -1; 3238 })); 3239 3240 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 3241 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 3242 } 3243 3244 // If divider is found, we divide the list of values and operands to divide 3245 // them by ofset X and Y. 3246 var splitRegex = /\s*,\s*|\s+/; 3247 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]; 3248 3249 // Convert the values with units to absolute pixels to allow our computations 3250 ops = ops.map(function (op, index) { 3251 // Most of the units rely on the orientation of the popper 3252 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 3253 var mergeWithPrevious = false; 3254 return op 3255 // This aggregates any `+` or `-` sign that aren't considered operators 3256 // e.g.: 10 + +5 => [10, +, +5] 3257 .reduce(function (a, b) { 3258 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 3259 a[a.length - 1] = b; 3260 mergeWithPrevious = true; 3261 return a; 3262 } else if (mergeWithPrevious) { 3263 a[a.length - 1] += b; 3264 mergeWithPrevious = false; 3265 return a; 3266 } else { 3267 return a.concat(b); 3268 } 3269 }, []) 3270 // Here we convert the string values into number values (in px) 3271 .map(function (str) { 3272 return toValue(str, measurement, popperOffsets, referenceOffsets); 3273 }); 3274 }); 3275 3276 // Loop trough the offsets arrays and execute the operations 3277 ops.forEach(function (op, index) { 3278 op.forEach(function (frag, index2) { 3279 if (isNumeric(frag)) { 3280 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 3281 } 3282 }); 3283 }); 3284 return offsets; 3285 } 3286 3287 /** 3288 * @function 3289 * @memberof Modifiers 3290 * @argument {Object} data - The data object generated by update method 3291 * @argument {Object} options - Modifiers configuration and options 3292 * @argument {Number|String} options.offset=0 3293 * The offset value as described in the modifier description 3294 * @returns {Object} The data object, properly modified 3295 */ 3296 function offset(data, _ref) { 3297 var offset = _ref.offset; 3298 var placement = data.placement, 3299 _data$offsets = data.offsets, 3300 popper = _data$offsets.popper, 3301 reference = _data$offsets.reference; 3302 3303 var basePlacement = placement.split('-')[0]; 3304 3305 var offsets = void 0; 3306 if (isNumeric(+offset)) { 3307 offsets = [+offset, 0]; 3308 } else { 3309 offsets = parseOffset(offset, popper, reference, basePlacement); 3310 } 3311 3312 if (basePlacement === 'left') { 3313 popper.top += offsets[0]; 3314 popper.left -= offsets[1]; 3315 } else if (basePlacement === 'right') { 3316 popper.top += offsets[0]; 3317 popper.left += offsets[1]; 3318 } else if (basePlacement === 'top') { 3319 popper.left += offsets[0]; 3320 popper.top -= offsets[1]; 3321 } else if (basePlacement === 'bottom') { 3322 popper.left += offsets[0]; 3323 popper.top += offsets[1]; 3324 } 3325 3326 data.popper = popper; 3327 return data; 3328 } 3329 3330 /** 3331 * @function 3332 * @memberof Modifiers 3333 * @argument {Object} data - The data object generated by `update` method 3334 * @argument {Object} options - Modifiers configuration and options 3335 * @returns {Object} The data object, properly modified 3336 */ 3337 function preventOverflow(data, options) { 3338 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 3339 3340 // If offsetParent is the reference element, we really want to 3341 // go one step up and use the next offsetParent as reference to 3342 // avoid to make this modifier completely useless and look like broken 3343 if (data.instance.reference === boundariesElement) { 3344 boundariesElement = getOffsetParent(boundariesElement); 3345 } 3346 3347 // NOTE: DOM access here 3348 // resets the popper's position so that the document size can be calculated excluding 3349 // the size of the popper element itself 3350 var transformProp = getSupportedPropertyName('transform'); 3351 var popperStyles = data.instance.popper.style; // assignment to help minification 3352 var top = popperStyles.top, 3353 left = popperStyles.left, 3354 transform = popperStyles[transformProp]; 3355 3356 popperStyles.top = ''; 3357 popperStyles.left = ''; 3358 popperStyles[transformProp] = ''; 3359 3360 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 3361 3362 // NOTE: DOM access here 3363 // restores the original style properties after the offsets have been computed 3364 popperStyles.top = top; 3365 popperStyles.left = left; 3366 popperStyles[transformProp] = transform; 3367 3368 options.boundaries = boundaries; 3369 3370 var order = options.priority; 3371 var popper = data.offsets.popper; 3372 3373 var check = { 3374 primary: function primary(placement) { 3375 var value = popper[placement]; 3376 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 3377 value = Math.max(popper[placement], boundaries[placement]); 3378 } 3379 return defineProperty({}, placement, value); 3380 }, 3381 secondary: function secondary(placement) { 3382 var mainSide = placement === 'right' ? 'left' : 'top'; 3383 var value = popper[mainSide]; 3384 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 3385 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 3386 } 3387 return defineProperty({}, mainSide, value); 3388 } 3389 }; 3390 3391 order.forEach(function (placement) { 3392 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 3393 popper = _extends({}, popper, check[side](placement)); 3394 }); 3395 3396 data.offsets.popper = popper; 3397 3398 return data; 3399 } 3400 3401 /** 3402 * @function 3403 * @memberof Modifiers 3404 * @argument {Object} data - The data object generated by `update` method 3405 * @argument {Object} options - Modifiers configuration and options 3406 * @returns {Object} The data object, properly modified 3407 */ 3408 function shift(data) { 3409 var placement = data.placement; 3410 var basePlacement = placement.split('-')[0]; 3411 var shiftvariation = placement.split('-')[1]; 3412 3413 // if shift shiftvariation is specified, run the modifier 3414 if (shiftvariation) { 3415 var _data$offsets = data.offsets, 3416 reference = _data$offsets.reference, 3417 popper = _data$offsets.popper; 3418 3419 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 3420 var side = isVertical ? 'left' : 'top'; 3421 var measurement = isVertical ? 'width' : 'height'; 3422 3423 var shiftOffsets = { 3424 start: defineProperty({}, side, reference[side]), 3425 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 3426 }; 3427 3428 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 3429 } 3430 3431 return data; 3432 } 3433 3434 /** 3435 * @function 3436 * @memberof Modifiers 3437 * @argument {Object} data - The data object generated by update method 3438 * @argument {Object} options - Modifiers configuration and options 3439 * @returns {Object} The data object, properly modified 3440 */ 3441 function hide(data) { 3442 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 3443 return data; 3444 } 3445 3446 var refRect = data.offsets.reference; 3447 var bound = find(data.instance.modifiers, function (modifier) { 3448 return modifier.name === 'preventOverflow'; 3449 }).boundaries; 3450 3451 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 3452 // Avoid unnecessary DOM access if visibility hasn't changed 3453 if (data.hide === true) { 3454 return data; 3455 } 3456 3457 data.hide = true; 3458 data.attributes['x-out-of-boundaries'] = ''; 3459 } else { 3460 // Avoid unnecessary DOM access if visibility hasn't changed 3461 if (data.hide === false) { 3462 return data; 3463 } 3464 3465 data.hide = false; 3466 data.attributes['x-out-of-boundaries'] = false; 3467 } 3468 3469 return data; 3470 } 3471 3472 /** 3473 * @function 3474 * @memberof Modifiers 3475 * @argument {Object} data - The data object generated by `update` method 3476 * @argument {Object} options - Modifiers configuration and options 3477 * @returns {Object} The data object, properly modified 3478 */ 3479 function inner(data) { 3480 var placement = data.placement; 3481 var basePlacement = placement.split('-')[0]; 3482 var _data$offsets = data.offsets, 3483 popper = _data$offsets.popper, 3484 reference = _data$offsets.reference; 3485 3486 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 3487 3488 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 3489 3490 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 3491 3492 data.placement = getOppositePlacement(placement); 3493 data.offsets.popper = getClientRect(popper); 3494 3495 return data; 3496 } 3497 3498 /** 3499 * Modifier function, each modifier can have a function of this type assigned 3500 * to its `fn` property.<br /> 3501 * These functions will be called on each update, this means that you must 3502 * make sure they are performant enough to avoid performance bottlenecks. 3503 * 3504 * @function ModifierFn 3505 * @argument {dataObject} data - The data object generated by `update` method 3506 * @argument {Object} options - Modifiers configuration and options 3507 * @returns {dataObject} The data object, properly modified 3508 */ 3509 3510 /** 3511 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 3512 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 3513 * needed by the library. 3514 * 3515 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 3516 * All the other properties are configurations that could be tweaked. 3517 * @namespace modifiers 3518 */ 3519 var modifiers = { 3520 /** 3521 * Modifier used to shift the popper on the start or end of its reference 3522 * element.<br /> 3523 * It will read the variation of the `placement` property.<br /> 3524 * It can be one either `-end` or `-start`. 3525 * @memberof modifiers 3526 * @inner 3527 */ 3528 shift: { 3529 /** @prop {number} order=100 - Index used to define the order of execution */ 3530 order: 100, 3531 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3532 enabled: true, 3533 /** @prop {ModifierFn} */ 3534 fn: shift 3535 }, 3536 3537 /** 3538 * The `offset` modifier can shift your popper on both its axis. 3539 * 3540 * It accepts the following units: 3541 * - `px` or unit-less, interpreted as pixels 3542 * - `%` or `%r`, percentage relative to the length of the reference element 3543 * - `%p`, percentage relative to the length of the popper element 3544 * - `vw`, CSS viewport width unit 3545 * - `vh`, CSS viewport height unit 3546 * 3547 * For length is intended the main axis relative to the placement of the popper.<br /> 3548 * This means that if the placement is `top` or `bottom`, the length will be the 3549 * `width`. In case of `left` or `right`, it will be the `height`. 3550 * 3551 * You can provide a single value (as `Number` or `String`), or a pair of values 3552 * as `String` divided by a comma or one (or more) white spaces.<br /> 3553 * The latter is a deprecated method because it leads to confusion and will be 3554 * removed in v2.<br /> 3555 * Additionally, it accepts additions and subtractions between different units. 3556 * Note that multiplications and divisions aren't supported. 3557 * 3558 * Valid examples are: 3559 * ``` 3560 * 10 3561 * '10%' 3562 * '10, 10' 3563 * '10%, 10' 3564 * '10 + 10%' 3565 * '10 - 5vh + 3%' 3566 * '-10px + 5vh, 5px - 6%' 3567 * ``` 3568 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 3569 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 3570 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 3571 * 3572 * @memberof modifiers 3573 * @inner 3574 */ 3575 offset: { 3576 /** @prop {number} order=200 - Index used to define the order of execution */ 3577 order: 200, 3578 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3579 enabled: true, 3580 /** @prop {ModifierFn} */ 3581 fn: offset, 3582 /** @prop {Number|String} offset=0 3583 * The offset value as described in the modifier description 3584 */ 3585 offset: 0 3586 }, 3587 3588 /** 3589 * Modifier used to prevent the popper from being positioned outside the boundary. 3590 * 3591 * A scenario exists where the reference itself is not within the boundaries.<br /> 3592 * We can say it has "escaped the boundaries" — or just "escaped".<br /> 3593 * In this case we need to decide whether the popper should either: 3594 * 3595 * - detach from the reference and remain "trapped" in the boundaries, or 3596 * - if it should ignore the boundary and "escape with its reference" 3597 * 3598 * When `escapeWithReference` is set to`true` and reference is completely 3599 * outside its boundaries, the popper will overflow (or completely leave) 3600 * the boundaries in order to remain attached to the edge of the reference. 3601 * 3602 * @memberof modifiers 3603 * @inner 3604 */ 3605 preventOverflow: { 3606 /** @prop {number} order=300 - Index used to define the order of execution */ 3607 order: 300, 3608 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3609 enabled: true, 3610 /** @prop {ModifierFn} */ 3611 fn: preventOverflow, 3612 /** 3613 * @prop {Array} [priority=['left','right','top','bottom']] 3614 * Popper will try to prevent overflow following these priorities by default, 3615 * then, it could overflow on the left and on top of the `boundariesElement` 3616 */ 3617 priority: ['left', 'right', 'top', 'bottom'], 3618 /** 3619 * @prop {number} padding=5 3620 * Amount of pixel used to define a minimum distance between the boundaries 3621 * and the popper. This makes sure the popper always has a little padding 3622 * between the edges of its container 3623 */ 3624 padding: 5, 3625 /** 3626 * @prop {String|HTMLElement} boundariesElement='scrollParent' 3627 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 3628 * `viewport` or any DOM element. 3629 */ 3630 boundariesElement: 'scrollParent' 3631 }, 3632 3633 /** 3634 * Modifier used to make sure the reference and its popper stay near each other 3635 * without leaving any gap between the two. Especially useful when the arrow is 3636 * enabled and you want to ensure that it points to its reference element. 3637 * It cares only about the first axis. You can still have poppers with margin 3638 * between the popper and its reference element. 3639 * @memberof modifiers 3640 * @inner 3641 */ 3642 keepTogether: { 3643 /** @prop {number} order=400 - Index used to define the order of execution */ 3644 order: 400, 3645 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3646 enabled: true, 3647 /** @prop {ModifierFn} */ 3648 fn: keepTogether 3649 }, 3650 3651 /** 3652 * This modifier is used to move the `arrowElement` of the popper to make 3653 * sure it is positioned between the reference element and its popper element. 3654 * It will read the outer size of the `arrowElement` node to detect how many 3655 * pixels of conjunction are needed. 3656 * 3657 * It has no effect if no `arrowElement` is provided. 3658 * @memberof modifiers 3659 * @inner 3660 */ 3661 arrow: { 3662 /** @prop {number} order=500 - Index used to define the order of execution */ 3663 order: 500, 3664 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3665 enabled: true, 3666 /** @prop {ModifierFn} */ 3667 fn: arrow, 3668 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 3669 element: '[x-arrow]' 3670 }, 3671 3672 /** 3673 * Modifier used to flip the popper's placement when it starts to overlap its 3674 * reference element. 3675 * 3676 * Requires the `preventOverflow` modifier before it in order to work. 3677 * 3678 * **NOTE:** this modifier will interrupt the current update cycle and will 3679 * restart it if it detects the need to flip the placement. 3680 * @memberof modifiers 3681 * @inner 3682 */ 3683 flip: { 3684 /** @prop {number} order=600 - Index used to define the order of execution */ 3685 order: 600, 3686 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3687 enabled: true, 3688 /** @prop {ModifierFn} */ 3689 fn: flip, 3690 /** 3691 * @prop {String|Array} behavior='flip' 3692 * The behavior used to change the popper's placement. It can be one of 3693 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 3694 * placements (with optional variations) 3695 */ 3696 behavior: 'flip', 3697 /** 3698 * @prop {number} padding=5 3699 * The popper will flip if it hits the edges of the `boundariesElement` 3700 */ 3701 padding: 5, 3702 /** 3703 * @prop {String|HTMLElement} boundariesElement='viewport' 3704 * The element which will define the boundaries of the popper position. 3705 * The popper will never be placed outside of the defined boundaries 3706 * (except if `keepTogether` is enabled) 3707 */ 3708 boundariesElement: 'viewport'
3708 3709 }, 3710 3711 /** 3712 * Modifier used to make the popper flow toward the inner of the reference element. 3713 * By default, when this modifier is disabled, the popper will be placed outside 3714 * the reference element. 3715 * @memberof modifiers 3716 * @inner 3717 */ 3718 inner: { 3719 /** @prop {number} order=700 - Index used to define the order of execution */ 3720 order: 700, 3721 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 3722 enabled: false, 3723 /** @prop {ModifierFn} */ 3724 fn: inner 3725 }, 3726 3727 /** 3728 * Modifier used to hide the popper when its reference element is outside of the 3729 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 3730 * be used to hide with a CSS selector the popper when its reference is 3731 * out of boundaries. 3732 * 3733 * Requires the `preventOverflow` modifier before it in order to work. 3734 * @memberof modifiers 3735 * @inner 3736 */ 3737 hide: { 3738 /** @prop {number} order=800 - Index used to define the order of execution */ 3739 order: 800, 3740 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3741 enabled: true, 3742 /** @prop {ModifierFn} */ 3743 fn: hide 3744 }, 3745 3746 /** 3747 * Computes the style that will be applied to the popper element to gets 3748 * properly positioned. 3749 * 3750 * Note that this modifier will not touch the DOM, it just prepares the styles 3751 * so that `applyStyle` modifier can apply it. This separation is useful 3752 * in case you need to replace `applyStyle` with a custom implementation. 3753 * 3754 * This modifier has `850` as `order` value to maintain backward compatibility 3755 * with previous versions of Popper.js. Expect the modifiers ordering method 3756 * to change in future major versions of the library. 3757 * 3758 * @memberof modifiers 3759 * @inner 3760 */ 3761 computeStyle: { 3762 /** @prop {number} order=850 - Index used to define the order of execution */ 3763 order: 850, 3764 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3765 enabled: true, 3766 /** @prop {ModifierFn} */ 3767 fn: computeStyle, 3768 /** 3769 * @prop {Boolean} gpuAcceleration=true 3770 * If true, it uses the CSS 3D transformation to position the popper. 3771 * Otherwise, it will use the `top` and `left` properties 3772 */ 3773 gpuAcceleration: true, 3774 /** 3775 * @prop {string} [x='bottom'] 3776 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 3777 * Change this if your popper should grow in a direction different from `bottom` 3778 */ 3779 x: 'bottom', 3780 /** 3781 * @prop {string} [x='left'] 3782 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 3783 * Change this if your popper should grow in a direction different from `right` 3784 */ 3785 y: 'right' 3786 }, 3787 3788 /** 3789 * Applies the computed styles to the popper element. 3790 * 3791 * All the DOM manipulations are limited to this modifier. This is useful in case 3792 * you want to integrate Popper.js inside a framework or view library and you 3793 * want to delegate all the DOM manipulations to it. 3794 * 3795 * Note that if you disable this modifier, you must make sure the popper element 3796 * has its position set to `absolute` before Popper.js can do its work! 3797 * 3798 * Just disable this modifier and define your own to achieve the desired effect. 3799 * 3800 * @memberof modifiers 3801 * @inner 3802 */ 3803 applyStyle: { 3804 /** @prop {number} order=900 - Index used to define the order of execution */ 3805 order: 900, 3806 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3807 enabled: true, 3808 /** @prop {ModifierFn} */
vendor: 5,076 bytes, lines 3809-3947
3809 fn: applyStyle, 3810 /** @prop {Function} */ 3811 onLoad: applyStyleOnLoad, 3812 /** 3813 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 3814 * @prop {Boolean} gpuAcceleration=true 3815 * If true, it uses the CSS 3D transformation to position the popper. 3816 * Otherwise, it will use the `top` and `left` properties 3817 */ 3818 gpuAcceleration: undefined 3819 } 3820 }; 3821 3822 /** 3823 * The `dataObject` is an object containing all the information used by Popper.js. 3824 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 3825 * @name dataObject 3826 * @property {Object} data.instance The Popper.js instance 3827 * @property {String} data.placement Placement applied to popper 3828 * @property {String} data.originalPlacement Placement originally defined on init 3829 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 3830 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 3831 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 3832 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 3833 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 3834 * @property {Object} data.boundaries Offsets of the popper boundaries 3835 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 3836 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 3837 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 3838 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 3839 */ 3840 3841 /** 3842 * Default options provided to Popper.js constructor.<br /> 3843 * These can be overridden using the `options` argument of Popper.js.<br /> 3844 * To override an option, simply pass an object with the same 3845 * structure of the `options` object, as the 3rd argument. For example: 3846 * ``` 3847 * new Popper(ref, pop, { 3848 * modifiers: { 3849 * preventOverflow: { enabled: false } 3850 * } 3851 * }) 3852 * ``` 3853 * @type {Object} 3854 * @static 3855 * @memberof Popper 3856 */ 3857 var Defaults = { 3858 /** 3859 * Popper's placement. 3860 * @prop {Popper.placements} placement='bottom' 3861 */ 3862 placement: 'bottom', 3863 3864 /** 3865 * Set this to true if you want popper to position it self in 'fixed' mode 3866 * @prop {Boolean} positionFixed=false 3867 */ 3868 positionFixed: false, 3869 3870 /** 3871 * Whether events (resize, scroll) are initially enabled. 3872 * @prop {Boolean} eventsEnabled=true 3873 */ 3874 eventsEnabled: true, 3875 3876 /** 3877 * Set to true if you want to automatically remove the popper when 3878 * you call the `destroy` method. 3879 * @prop {Boolean} removeOnDestroy=false 3880 */ 3881 removeOnDestroy: false, 3882 3883 /** 3884 * Callback called when the popper is created.<br /> 3885 * By default, it is set to no-op.<br /> 3886 * Access Popper.js instance with `data.instance`. 3887 * @prop {onCreate} 3888 */ 3889 onCreate: function onCreate() {}, 3890 3891 /** 3892 * Callback called when the popper is updated. This callback is not called 3893 * on the initialization/creation of the popper, but only on subsequent 3894 * updates.<br /> 3895 * By default, it is set to no-op.<br /> 3896 * Access Popper.js instance with `data.instance`. 3897 * @prop {onUpdate} 3898 */ 3899 onUpdate: function onUpdate() {}, 3900 3901 /** 3902 * List of modifiers used to modify the offsets before they are applied to the popper. 3903 * They provide most of the functionalities of Popper.js. 3904 * @prop {modifiers} 3905 */ 3906 modifiers: modifiers 3907 }; 3908 3909 /** 3910 * @callback onCreate 3911 * @param {dataObject} data 3912 */ 3913 3914 /** 3915 * @callback onUpdate 3916 * @param {dataObject} data 3917 */ 3918 3919 // Utils 3920 // Methods 3921 var Popper = function () { 3922 /** 3923 * Creates a new Popper.js instance. 3924 * @class Popper 3925 * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper 3926 * @param {HTMLElement} popper - The HTML element used as the popper 3927 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 3928 * @return {Object} instance - The generated Popper.js instance 3929 */ 3930 function Popper(reference, popper) { 3931 var _this = this; 3932 3933 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 3934 classCallCheck(this, Popper); 3935 3936 this.scheduleUpdate = function () { 3937 return requestAnimationFrame(_this.update); 3938 }; 3939 3940 // make update() debounced, so that it only runs at most once-per-tick 3941 this.update = debounce(this.update.bind(this)); 3942 3943 // with {} we create a new object with the options inside it 3944 this.options = _extends({}, Popper.Defaults, options); 3945 3946 // init state 3947 this.state = {
vendor: 7,507 bytes, lines 3948-4173
3948 isDestroyed: false, 3949 isCreated: false, 3950 scrollParents: [] 3951 }; 3952 3953 // get reference and popper elements (allow jQuery wrappers) 3954 this.reference = reference && reference.jquery ? reference[0] : reference; 3955 this.popper = popper && popper.jquery ? popper[0] : popper; 3956 3957 // Deep merge modifiers options 3958 this.options.modifiers = {}; 3959 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 3960 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 3961 }); 3962 3963 // Refactoring modifiers' list (Object => Array) 3964 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 3965 return _extends({ 3966 name: name 3967 }, _this.options.modifiers[name]); 3968 }) 3969 // sort the modifiers by order 3970 .sort(function (a, b) { 3971 return a.order - b.order; 3972 }); 3973 3974 // modifiers have the ability to execute arbitrary code when Popper.js get inited 3975 // such code is executed in the same order of its modifier 3976 // they could add new properties to their options configuration 3977 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 3978 this.modifiers.forEach(function (modifierOptions) { 3979 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 3980 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 3981 } 3982 }); 3983 3984 // fire the first update to position the popper in the right place 3985 this.update(); 3986 3987 var eventsEnabled = this.options.eventsEnabled; 3988 if (eventsEnabled) { 3989 // setup event listeners, they will take care of update the position in specific situations 3990 this.enableEventListeners(); 3991 } 3992 3993 this.state.eventsEnabled = eventsEnabled; 3994 } 3995 3996 // We can't use class properties because they don't get listed in the 3997 // class prototype and break stuff like Sinon stubs 3998 3999 4000 createClass(Popper, [{ 4001 key: 'update', 4002 value: function update$$1() { 4003 return update.call(this); 4004 } 4005 }, { 4006 key: 'destroy', 4007 value: function destroy$$1() { 4008 return destroy.call(this); 4009 } 4010 }, { 4011 key: 'enableEventListeners', 4012 value: function enableEventListeners$$1() { 4013 return enableEventListeners.call(this); 4014 } 4015 }, { 4016 key: 'disableEventListeners', 4017 value: function disableEventListeners$$1() { 4018 return disableEventListeners.call(this); 4019 } 4020 4021 /** 4022 * Schedules an update. It will run on the next UI update available. 4023 * @method scheduleUpdate 4024 * @memberof Popper 4025 */ 4026 4027 4028 /** 4029 * Collection of utilities useful when writing custom modifiers. 4030 * Starting from version 1.7, this method is available only if you 4031 * include `popper-utils.js` before `popper.js`. 4032 * 4033 * **DEPRECATION**: This way to access PopperUtils is deprecated 4034 * and will be removed in v2! Use the PopperUtils module directly instead. 4035 * Due to the high instability of the methods contained in Utils, we can't 4036 * guarantee them to follow semver. Use them at your own risk! 4037 * @static 4038 * @private 4039 * @type {Object} 4040 * @deprecated since version 1.8 4041 * @member Utils 4042 * @memberof Popper 4043 */ 4044 4045 }]); 4046 return Popper; 4047 }(); 4048 4049 /** 4050 * The `referenceObject` is an object that provides an interface compatible with Popper.js 4051 * and lets you use it as replacement of a real DOM node.<br /> 4052 * You can use this method to position a popper relatively to a set of coordinates 4053 * in case you don't have a DOM node to use as reference. 4054 * 4055 * ``` 4056 * new Popper(referenceObject, popperNode); 4057 * ``` 4058 * 4059 * NB: This feature isn't supported in Internet Explorer 10. 4060 * @name referenceObject 4061 * @property {Function} data.getBoundingClientRect 4062 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 4063 * @property {number} data.clientWidth 4064 * An ES6 getter that will return the width of the virtual reference element. 4065 * @property {number} data.clientHeight 4066 * An ES6 getter that will return the height of the virtual reference element. 4067 */ 4068 4069 4070 Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; 4071 Popper.placements = placements; 4072 Popper.Defaults = Defaults; 4073 4074 /** 4075 * ------------------------------------------------------------------------ 4076 * Constants 4077 * ------------------------------------------------------------------------ 4078 */ 4079 4080 var NAME$4 = 'dropdown'; 4081 var VERSION$4 = '4.3.1'; 4082 var DATA_KEY$4 = 'bs.dropdown'; 4083 var EVENT_KEY$4 = "." + DATA_KEY$4; 4084 var DATA_API_KEY$4 = '.data-api'; 4085 var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4]; 4086 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 4087 4088 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key 4089 4090 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key 4091 4092 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key 4093 4094 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key 4095 4096 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) 4097 4098 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE); 4099 var Event$4 = { 4100 HIDE: "hide" + EVENT_KEY$4, 4101 HIDDEN: "hidden" + EVENT_KEY$4, 4102 SHOW: "show" + EVENT_KEY$4, 4103 SHOWN: "shown" + EVENT_KEY$4, 4104 CLICK: "click" + EVENT_KEY$4, 4105 CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4, 4106 KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4, 4107 KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4 4108 }; 4109 var ClassName$4 = { 4110 DISABLED: 'disabled', 4111 SHOW: 'show', 4112 DROPUP: 'dropup', 4113 DROPRIGHT: 'dropright', 4114 DROPLEFT: 'dropleft', 4115 MENURIGHT: 'dropdown-menu-right', 4116 MENULEFT: 'dropdown-menu-left', 4117 POSITION_STATIC: 'position-static' 4118 }; 4119 var Selector$4 = { 4120 DATA_TOGGLE: '[data-toggle="dropdown"]', 4121 FORM_CHILD: '.dropdown form', 4122 MENU: '.dropdown-menu', 4123 NAVBAR_NAV: '.navbar-nav', 4124 VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)' 4125 }; 4126 var AttachmentMap = { 4127 TOP: 'top-start', 4128 TOPEND: 'top-end', 4129 BOTTOM: 'bottom-start', 4130 BOTTOMEND: 'bottom-end', 4131 RIGHT: 'right-start', 4132 RIGHTEND: 'right-end', 4133 LEFT: 'left-start', 4134 LEFTEND: 'left-end' 4135 }; 4136 var Default$2 = { 4137 offset: 0, 4138 flip: true, 4139 boundary: 'scrollParent', 4140 reference: 'toggle', 4141 display: 'dynamic' 4142 }; 4143 var DefaultType$2 = { 4144 offset: '(number|string|function)', 4145 flip: 'boolean', 4146 boundary: '(string|element)', 4147 reference: '(string|element)', 4148 display: 'string' 4149 /** 4150 * ------------------------------------------------------------------------ 4151 * Class Definition 4152 * ------------------------------------------------------------------------ 4153 */ 4154 4155 }; 4156 4157 var Dropdown = 4158 /*#__PURE__*/ 4159 function () { 4160 function Dropdown(element, config) { 4161 this._element = element; 4162 this._popper = null; 4163 this._config = this._getConfig(config); 4164 this._menu = this._getMenuElement(); 4165 this._inNavbar = this._detectNavbar(); 4166 4167 this._addEventListeners(); 4168 } // Getters 4169 4170 4171 var _proto = Dropdown.prototype; 4172 4173 // Public
4174 _proto.toggle = function toggle() { 4175 if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) { 4176 return; 4177 } 4178 4179 var parent = Dropdown._getParentFromElement(this._element); 4180 4181 var isActive = $(this._menu).hasClass(ClassName$4.SHOW); 4182 4183 Dropdown._clearMenus(); 4184 4185 if (isActive) { 4186 return; 4187 } 4188 4189 var relatedTarget = { 4190 relatedTarget: this._element 4191 }; 4192 var showEvent = $.Event(Event$4.SHOW, relatedTarget); 4193 $(parent).trigger(showEvent); 4194 4195 if (showEvent.isDefaultPrevented()) { 4196 return; 4197 } // Disable totally Popper.js for Dropdown in Navbar 4198 4199 4200 if (!this._inNavbar) { 4201 /** 4202 * Check for Popper dependency 4203 * Popper - https://popper.js.org 4204 */ 4205 if (typeof Popper === 'undefined') { 4206 throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)'); 4207 } 4208 4209 var referenceElement = this._element; 4210 4211 if (this._config.reference === 'parent') { 4212 referenceElement = parent; 4213 } else if (Util.isElement(this._config.reference)) { 4214 referenceElement = this._config.reference; // Check if it's jQuery element 4215 4216 if (typeof this._config.reference.jquery !== 'undefined') { 4217 referenceElement = this._config.reference[0]; 4218 } 4219 } // If boundary is not `scrollParent`, then set position to `static` 4220 // to allow the menu to "escape" the scroll parent's boundaries 4221 // https://github.com/twbs/bootstrap/issues/24251 4222 4223 4224 if (this._config.boundary !== 'scrollParent') { 4225 $(parent).addClass(ClassName$4.POSITION_STATIC); 4226 } 4227 4228 this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig()); 4229 } // If this is a touch-enabled device we add extra 4230 // empty mouseover listeners to the body's immediate children; 4231 // only needed because of broken event delegation on iOS 4232 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 4233 4234 4235 if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) { 4236 $(document.body).children().on('mouseover', null, $.noop); 4237 } 4238 4239 this._element.focus(); 4240 4241 this._element.setAttribute('aria-expanded', true); 4242 4243 $(this._menu).toggleClass(ClassName$4.SHOW); 4244 $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget)); 4245 }; 4246 4247 _proto.show = function show() { 4248 if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) { 4249 return; 4250 } 4251 4252 var relatedTarget = { 4253 relatedTarget: this._element 4254 }; 4255 var showEvent = $.Event(Event$4.SHOW, relatedTarget); 4256 4257 var parent = Dropdown._getParentFromElement(this._element); 4258 4259 $(parent).trigger(showEvent); 4260 4261 if (showEvent.isDefaultPrevented()) { 4262 return; 4263 } 4264 4265 $(this._menu).toggleClass(ClassName$4.SHOW); 4266 $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget)); 4267 }; 4268 4269 _proto.hide = function hide() { 4270 if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) { 4271 return; 4272 } 4273 4274 var relatedTarget = { 4275 relatedTarget: this._element 4276 }; 4277 var hideEvent = $.Event(Event$4.HIDE, relatedTarget); 4278 4279 var parent = Dropdown._getParentFromElement(this._element); 4280 4281 $(parent).trigger(hideEvent); 4282 4283 if (hideEvent.isDefaultPrevented()) { 4284 return; 4285 } 4286 4287 $(this._menu).toggleClass(ClassName$4.SHOW); 4288 $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget)); 4289 }; 4290 4291 _proto.dispose = function dispose() { 4292 $.removeData(this._element, DATA_KEY$4); 4293 $(this._element).off(EVENT_KEY$4); 4294 this._element = null; 4295 this._menu = null; 4296 4297 if (this._popper !== null) { 4298 this._popper.destroy(); 4299 4300 this._popper = null; 4301 } 4302 }; 4303
4304 _proto.update = function update() { 4305 this._inNavbar = this._detectNavbar(); 4306 4307 if (this._popper !== null) { 4308 this._popper.scheduleUpdate(); 4309 } 4310 } // Private 4311 ; 4312 4313 _proto._addEventListeners = function _addEventListeners() { 4314 var _this = this; 4315 4316 $(this._element).on(Event$4.CLICK, function (event) { 4317 event.preventDefault(); 4318 event.stopPropagation(); 4319 4320 _this.toggle(); 4321 }); 4322 }; 4323 4324 _proto._getConfig = function _getConfig(config) { 4325 config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config); 4326 Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType); 4327 return config; 4328 }; 4329 4330 _proto._getMenuElement = function _getMenuElement() { 4331 if (!this._menu) { 4332 var parent = Dropdown._getParentFromElement(this._element); 4333 4334 if (parent) { 4335 this._menu = parent.querySelector(Selector$4.MENU); 4336 } 4337 } 4338 4339 return this._menu; 4340 }; 4341 4342 _proto._getPlacement = function _getPlacement() { 4343 var $parentDropdown = $(this._element.parentNode); 4344 var placement = AttachmentMap.BOTTOM; // Handle dropup 4345 4346 if ($parentDropdown.hasClass(ClassName$4.DROPUP)) { 4347 placement = AttachmentMap.TOP; 4348 4349 if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) { 4350 placement = AttachmentMap.TOPEND; 4351 } 4352 } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) { 4353 placement = AttachmentMap.RIGHT; 4354 } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) { 4355 placement = AttachmentMap.LEFT; 4356 } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) { 4357 placement = AttachmentMap.BOTTOMEND; 4358 } 4359 4360 return placement; 4361 }; 4362 4363 _proto._detectNavbar = function _detectNavbar() { 4364 return $(this._element).closest('.navbar').length > 0; 4365 }; 4366 4367 _proto._getOffset = function _getOffset() { 4368 var _this2 = this; 4369 4370 var offset = {}; 4371 4372 if (typeof this._config.offset === 'function') { 4373 offset.fn = function (data) { 4374 data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {}); 4375 return data; 4376 }; 4377 } else { 4378 offset.offset = this._config.offset; 4379 } 4380 4381 return offset; 4382 }; 4383 4384 _proto._getPopperConfig = function _getPopperConfig() { 4385 var popperConfig = { 4386 placement: this._getPlacement(), 4387 modifiers: { 4388 offset: this._getOffset(), 4389 flip: { 4390 enabled: this._config.flip 4391 }, 4392 preventOverflow: { 4393 boundariesElement: this._config.boundary 4394 } 4395 } // Disable Popper.js if we have a static display 4396 4397 }; 4398 4399 if (this._config.display === 'static') { 4400 popperConfig.modifiers.applyStyle = { 4401 enabled: false 4402 }; 4403 } 4404 4405 return popperConfig; 4406 } // Static 4407 ; 4408 4409 Dropdown._jQueryInterface = function _jQueryInterface(config) { 4410 return this.each(function () { 4411 var data = $(this).data(DATA_KEY$4); 4412 4413 var _config = typeof config === 'object' ? config : null; 4414 4415 if (!data) { 4416 data = new Dropdown(this, _config); 4417 $(this).data(DATA_KEY$4, data); 4418 } 4419 4420 if (typeof config === 'string') { 4421 if (typeof data[config] === 'undefined') { 4422 throw new TypeError("No method named \"" + config + "\""); 4423 } 4424 4425 data[config](); 4426 } 4427 }); 4428 }; 4429 4430 Dropdown._clearMenus = function _clearMenus(event) { 4431 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { 4432 return; 4433 } 4434 4435 var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE)); 4436 4437 for (var i = 0, len = toggles.length; i < len; i++) { 4438 var parent = Dropdown._getParentFromElement(toggles[i]); 4439 4440 var context = $(toggles[i]).data(DATA_KEY$4); 4441 var relatedTarget = { 4442 relatedTarget: toggles[i] 4443 }; 4444 4445 if (event && event.type === 'click') { 4446 relatedTarget.clickEvent = event; 4447 } 4448 4449 if (!context) { 4450 continue; 4451 } 4452 4453 var dropdownMenu = context._menu; 4454 4455 if (!$(parent).hasClass(ClassName$4.SHOW)) { 4456 continue; 4457 } 4458 4459 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) { 4460 continue; 4461 } 4462 4463 var hideEvent = $.Event(Event$4.HIDE, relatedTarget); 4464 $(parent).trigger(hideEvent); 4465 4466 if (hideEvent.isDefaultPrevented()) { 4467 continue; 4468 } // If this is a touch-enabled device we remove the extra 4469 // empty mouseover listeners we added for iOS support 4470 4471 4472 if ('ontouchstart' in document.documentElement) { 4473 $(document.body).children().off('mouseover', null, $.noop); 4474 } 4475 4476 toggles[i].setAttribute('aria-expanded', 'false'); 4477 $(dropdownMenu).removeClass(ClassName$4.SHOW); 4478 $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget)); 4479 } 4480 }; 4481 4482 Dropdown._getParentFromElement = function _getParentFromElement(element) { 4483 var parent; 4484 var selector = Util.getSelectorFromElement(element); 4485 4486 if (selector) { 4487 parent = document.querySelector(selector); 4488 } 4489 4490 return parent || element.parentNode; 4491 } // eslint-disable-next-line complexity 4492 ; 4493 4494 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { 4495 // If not input/textarea: 4496 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 4497 // If input/textarea: 4498 // - If space key => not a dropdown command 4499 // - If key is other than escape 4500 // - If key is not up or down => not a dropdown command 4501 // - If trigger inside the menu =>
4501 not a dropdown command 4502 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector$4.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { 4503 return; 4504 } 4505 4506 event.preventDefault(); 4507 event.stopPropagation(); 4508 4509 if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) { 4510 return; 4511 } 4512 4513 var parent = Dropdown._getParentFromElement(this); 4514 4515 var isActive = $(parent).hasClass(ClassName$4.SHOW); 4516 4517 if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { 4518 if (event.which === ESCAPE_KEYCODE) { 4519 var toggle = parent.querySelector(Selector$4.DATA_TOGGLE); 4520 $(toggle).trigger('focus'); 4521 } 4522 4523 $(this).trigger('click'); 4524 return; 4525 } 4526 4527 var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS)); 4528 4529 if (items.length === 0) { 4530 return; 4531 } 4532 4533 var index = items.indexOf(event.target); 4534 4535 if (event.which === ARROW_UP_KEYCODE && index > 0) { 4536 // Up 4537 index--; 4538 } 4539 4540 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { 4541 // Down 4542 index++; 4543 } 4544 4545 if (index < 0) { 4546 index = 0; 4547 } 4548 4549 items[index].focus(); 4550 }; 4551 4552 _createClass(Dropdown, null, [{ 4553 key: "VERSION", 4554 get: function get() { 4555 return VERSION$4; 4556 } 4557 }, { 4558 key: "Default", 4559 get: function get() { 4560 return Default$2; 4561 } 4562 }, { 4563 key: "DefaultType", 4564 get: function get() { 4565 return DefaultType$2; 4566 } 4567 }]); 4568 4569 return Dropdown; 4570 }(); 4571 /** 4572 * ------------------------------------------------------------------------ 4573 * Data Api implementation 4574 * ------------------------------------------------------------------------ 4575 */ 4576 4577 4578 $(document).on(Event$4.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event$4.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler).on(Event$4.CLICK_DATA_API + " " + Event$4.KEYUP_DATA_API, Dropdown._clearMenus).on(Event$4.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) { 4579 event.preventDefault(); 4580 event.stopPropagation(); 4581 4582 Dropdown._jQueryInterface.call($(this), 'toggle'); 4583 }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) { 4584 e.stopPropagation(); 4585 }); 4586 /** 4587 * ------------------------------------------------------------------------ 4588 * jQuery 4589 * ------------------------------------------------------------------------ 4590 */ 4591 4592 $.fn[NAME$4] = Dropdown._jQueryInterface; 4593 $.fn[NAME$4].Constructor = Dropdown; 4594 4595 $.fn[NAME$4].noConflict = function () { 4596 $.fn[NAME$4] = JQUERY_NO_CONFLICT$4; 4597 return Dropdown._jQueryInterface; 4598 }; 4599 4600 /** 4601 * ------------------------------------------------------------------------ 4602 * Constants 4603 * ------------------------------------------------------------------------ 4604 */ 4605 4606 var NAME$5 = 'modal'; 4607 var VERSION$5 = '4.3.1'; 4608 var DATA_KEY$5 = 'bs.modal'; 4609 var EVENT_KEY$5 = "." + DATA_KEY$5; 4610 var DATA_API_KEY$5 = '.data-api'; 4611 var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5]; 4612 var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key 4613 4614 var Default$3 = { 4615 backdrop: true, 4616 keyboard: true, 4617 focus: true, 4618 show: true 4619 }; 4620 var DefaultType$3 = { 4621 backdrop: '(boolean|string)', 4622 keyboard: 'boolean', 4623 focus: 'boolean', 4624 show: 'boolean' 4625 }; 4626 var Event$5 = { 4627 HIDE: "hide" + EVENT_KEY$5, 4628 HIDDEN: "hidden" + EVENT_KEY$5, 4629 SHOW: "show" + EVENT_KEY$5, 4630 SHOWN: "shown" + EVENT_KEY$5, 4631 FOCUSIN: "focusin" + EVENT_KEY$5, 4632 RESIZE: "resize" + EVENT_KEY$5, 4633 CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5, 4634 KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5, 4635 MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5, 4636 MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5, 4637 CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5 4638 }; 4639 var ClassName$5 = {
4640 SCROLLABLE: 'modal-dialog-scrollable', 4641 SCROLLBAR_MEASURER: 'modal-scrollbar-measure', 4642 BACKDROP: 'modal-backdrop', 4643 OPEN: 'modal-open', 4644 FADE: 'fade', 4645 SHOW: 'show' 4646 }; 4647 var Selector$5 = { 4648 DIALOG: '.modal-dialog', 4649 MODAL_BODY: '.modal-body', 4650 DATA_TOGGLE: '[data-toggle="modal"]', 4651 DATA_DISMISS: '[data-dismiss="modal"]', 4652 FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', 4653 STICKY_CONTENT: '.sticky-top' 4654 /** 4655 * ------------------------------------------------------------------------ 4656 * Class Definition 4657 * ------------------------------------------------------------------------ 4658 */ 4659 4660 }; 4661 4662 var Modal = 4663 /*#__PURE__*/ 4664 function () { 4665 function Modal(element, config) { 4666 this._config = this._getConfig(config); 4667 this._element = element; 4668 this._dialog = element.querySelector(Selector$5.DIALOG); 4669 this._backdrop = null; 4670 this._isShown = false; 4671 this._isBodyOverflowing = false; 4672 this._ignoreBackdropClick = false; 4673 this._isTransitioning = false; 4674 this._scrollbarWidth = 0; 4675 } // Getters 4676 4677 4678 var _proto = Modal.prototype; 4679 4680 // Public 4681 _proto.toggle = function toggle(relatedTarget) { 4682 return this._isShown ? this.hide() : this.show(relatedTarget); 4683 }; 4684 4685 _proto.show = function show(relatedTarget) { 4686 var _this = this; 4687 4688 if (this._isShown || this._isTransitioning) { 4689 return; 4690 } 4691 4692 if ($(this._element).hasClass(ClassName$5.FADE)) { 4693 this._isTransitioning = true; 4694 } 4695 4696 var showEvent = $.Event(Event$5.SHOW, { 4697 relatedTarget: relatedTarget 4698 }); 4699 $(this._element).trigger(showEvent); 4700 4701 if (this._isShown || showEvent.isDefaultPrevented()) { 4702 return; 4703 } 4704 4705 this._isShown = true; 4706 4707 this._checkScrollbar(); 4708 4709 this._setScrollbar(); 4710 4711 this._adjustDialog(); 4712 4713 this._setEscapeEvent(); 4714 4715 this._setResizeEvent(); 4716 4717 $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) { 4718 return _this.hide(event); 4719 }); 4720 $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () { 4721 $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) { 4722 if ($(event.target).is(_this._element)) { 4723 _this._ignoreBackdropClick = true; 4724 } 4725 }); 4726 }); 4727 4728 this._showBackdrop(function () { 4729 return _this._showElement(relatedTarget); 4730 }); 4731 }; 4732 4733 _proto.hide = function hide(event) { 4734 var _this2 = this; 4735 4736 if (event) { 4737 event.preventDefault(); 4738 } 4739 4740 if (!this._isShown || this._isTransitioning) { 4741 return; 4742 } 4743 4744 var hideEvent = $.Event(Event$5.HIDE); 4745 $(this._element).trigger(hideEvent); 4746 4747 if (!this._isShown || hideEvent.isDefaultPrevented()) { 4748 return; 4749 } 4750 4751 this._isShown = false; 4752 var transition = $(this._element).hasClass(ClassName$5.FADE); 4753 4754 if (transition) { 4755 this._isTransitioning = true; 4756 } 4757 4758 this._setEscapeEvent(); 4759 4760 this._setResizeEvent(); 4761 4762 $(document).off(Event$5.FOCUSIN); 4763 $(this._element).removeClass(ClassName$5.SHOW); 4764 $(this._element).off(Event$5.CLICK_DISMISS); 4765 $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS); 4766 4767 if (transition) { 4768 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 4769 $(this._element).one(Util.TRANSITION_END, function (event) { 4770 return _this2._hideModal(event); 4771 }).emulateTransitionEnd(transitionDuration); 4772 } else { 4773 this._hideModal(); 4774 } 4775 }; 4776 4777 _proto.dispose = function dispose() { 4778 [window, this._element, this._dialog].forEach(function (htmlElement) { 4779 return $(htmlElement).off(EVENT_KEY$5); 4780 }); 4781 /** 4782 * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API` 4783 * Do not move `document` in `htmlElements` array 4784 * It will remove `Event.CLICK_DATA_API` event that should remain 4785 */ 4786 4787 $(document).off(Event$5.FOCUSIN); 4788 $.removeData(this._element, DATA_KEY$5); 4789 this._config = null; 4790 this._element = null; 4791 this._dialog = null; 4792 this._backdrop = null; 4793 this._isShown = null; 4794 this._isBodyOverflowing = null; 4795 this._ignoreBackdropClick = null; 4796 this._isTransitioning = null; 4797 this._scrollbarWidth = null; 4798 }; 4799 4800 _proto.handleUpdate = function handleUpdate() { 4801 this._adjustDialog(); 4802 } // Private 4803 ; 4804 4805 _proto._getConfig = function _getConfig(config) { 4806 config = _objectSpread({}, Default$3, config); 4807 Util.typeCheckConfig(NAME$5, config, DefaultType$3); 4808 return config; 4809 }; 4810 4811 _proto._showElement = function _showElement(relatedTarget) { 4812 var _this3 = this; 4813 4814 var transition = $(this._element).hasClass(ClassName$5.FADE); 4815 4816 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 4817 // Don't move modal's DOM position 4818 document.body.appendChild(this._element); 4819 } 4820 4821 this._element.style.display = 'block'; 4822 4823 this._element.removeAttribute('aria-hidden'); 4824 4825 this._element.setAttribute('aria-modal', true); 4826 4827 if ($(this._dialog).hasClass(ClassName$5.SCROLLABLE)) { 4828 this._dialog.querySelector(Selector$5.MODAL_BODY).scrollTop = 0; 4829 } else { 4830 this._element.scrollTop = 0; 4831 } 4832 4833 if (transition) { 4834 Util.reflow(this._element); 4835 } 4836 4837 $(this._element).addClass(ClassName$5.SHOW); 4838 4839 if (this._config.focus) { 4840 this._enforceFocus(); 4841 } 4842 4843 var shownEvent = $.Event(Event$5.SHOWN, { 4844 relatedTarget: relatedTarget 4845 }); 4846 4847 var transitionComplete = function transitionComplete() { 4848 if (_this3._config.focus) { 4849 _this3._element.focus(); 4850 } 4851 4852 _this3._isTransitioning = false;
4853 $(_this3._element).trigger(shownEvent); 4854 }; 4855 4856 if (transition) { 4857 var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); 4858 $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); 4859 } else { 4860 transitionComplete(); 4861 } 4862 }; 4863 4864 _proto._enforceFocus = function _enforceFocus() { 4865 var _this4 = this; 4866 4867 $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop 4868 .on(Event$5.FOCUSIN, function (event) { 4869 if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) { 4870 _this4._element.focus(); 4871 } 4872 }); 4873 }; 4874 4875 _proto._setEscapeEvent = function _setEscapeEvent() { 4876 var _this5 = this; 4877 4878 if (this._isShown && this._config.keyboard) { 4879 $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) { 4880 if (event.which === ESCAPE_KEYCODE$1) { 4881 event.preventDefault(); 4882 4883 _this5.hide(); 4884 } 4885 }); 4886 } else if (!this._isShown) { 4887 $(this._element).off(Event$5.KEYDOWN_DISMISS); 4888 } 4889 }; 4890 4891 _proto._setResizeEvent = function _setResizeEvent() { 4892 var _this6 = this; 4893 4894 if (this._isShown) { 4895 $(window).on(Event$5.RESIZE, function (event) { 4896 return _this6.handleUpdate(event); 4897 }); 4898 } else { 4899 $(window).off(Event$5.RESIZE); 4900 } 4901 }; 4902 4903 _proto._hideModal = function _hideModal() { 4904 var _this7 = this; 4905 4906 this._element.style.display = 'none'; 4907 4908 this._element.setAttribute('aria-hidden', true); 4909 4910 this._element.removeAttribute('aria-modal'); 4911 4912 this._isTransitioning = false; 4913 4914 this._showBackdrop(function () { 4915 $(document.body).removeClass(ClassName$5.OPEN); 4916 4917 _this7._resetAdjustments(); 4918 4919 _this7._resetScrollbar(); 4920 4921 $(_this7._element).trigger(Event$5.HIDDEN); 4922 }); 4923 }; 4924 4925 _proto._removeBackdrop = function _removeBackdrop() { 4926 if (this._backdrop) { 4927 $(this._backdrop).remove(); 4928 this._backdrop = null; 4929 } 4930 }; 4931 4932 _proto._showBackdrop = function _showBackdrop(callback) { 4933 var _this8 = this; 4934 4935 var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : ''; 4936 4937 if (this._isShown && this._config.backdrop) { 4938 this._backdrop = document.createElement('div'); 4939 this._backdrop.className = ClassName$5.BACKDROP; 4940 4941 if (animate) { 4942 this._backdrop.classList.add(animate); 4943 } 4944 4945 $(this._backdrop).appendTo(document.body); 4946 $(this._element).on(Event$5.CLICK_DISMISS, function (event) { 4947 if (_this8._ignoreBackdropClick) { 4948 _this8._ignoreBackdropClick = false; 4949 return; 4950 } 4951 4952 if (event.target !== event.currentTarget) { 4953 return; 4954 } 4955 4956 if (_this8._config.backdrop === 'static') { 4957 _this8._element.focus(); 4958 } else { 4959 _this8.hide(); 4960 } 4961 }); 4962 4963 if (animate) { 4964 Util.reflow(this._backdrop); 4965 } 4966 4967 $(this._backdrop).addClass(ClassName$5.SHOW); 4968 4969 if (!callback) { 4970 return; 4971 } 4972 4973 if (!animate) { 4974 callback(); 4975 return; 4976 } 4977 4978 var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 4979 $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); 4980 } else if (!this._isShown && this._backdrop) { 4981 $(this._backdrop).removeClass(ClassName$5.SHOW); 4982 4983 var callbackRemove = function callbackRemove() { 4984 _this8._removeBackdrop(); 4985 4986 if (callback) { 4987 callback(); 4988 } 4989 }; 4990 4991 if ($(this._element).hasClass(ClassName$5.FADE)) { 4992 var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 4993 4994 $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); 4995 } else { 4996 callbackRemove(); 4997 } 4998 } else if (callback) { 4999 callback(); 5000 } 5001 } // ---------------------------------------------------------------------- 5002 // the following methods are used to handle overflowing modals 5003 // todo (fat): these should probably be refactored out of modal.js 5004 // ---------------------------------------------------------------------- 5005 ; 5006
5007 _proto._adjustDialog = function _adjustDialog() { 5008 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 5009 5010 if (!this._isBodyOverflowing && isModalOverflowing) { 5011 this._element.style.paddingLeft = this._scrollbarWidth + "px"; 5012 } 5013 5014 if (this._isBodyOverflowing && !isModalOverflowing) { 5015 this._element.style.paddingRight = this._scrollbarWidth + "px"; 5016 } 5017 }; 5018 5019 _proto._resetAdjustments = function _resetAdjustments() { 5020 this._element.style.paddingLeft = ''; 5021 this._element.style.paddingRight = ''; 5022 }; 5023 5024 _proto._checkScrollbar = function _checkScrollbar() { 5025 var rect = document.body.getBoundingClientRect(); 5026 this._isBodyOverflowing = rect.left + rect.right < window.innerWidth; 5027 this._scrollbarWidth = this._getScrollbarWidth(); 5028 }; 5029 5030 _proto._setScrollbar = function _setScrollbar() { 5031 var _this9 = this; 5032 5033 if (this._isBodyOverflowing) { 5034 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 5035 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 5036 var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT)); 5037 var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding 5038 5039 $(fixedContent).each(function (index, element) { 5040 var actualPadding = element.style.paddingRight; 5041 var calculatedPadding = $(element).css('padding-right'); 5042 $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px"); 5043 }); // Adjust sticky content margin 5044 5045 $(stickyContent).each(function (index, element) { 5046 var actualMargin = element.style.marginRight; 5047 var calculatedMargin = $(element).css('margin-right'); 5048 $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px"); 5049 }); // Adjust body padding 5050 5051 var actualPadding = document.body.style.paddingRight; 5052 var calculatedPadding = $(document.body).css('padding-right'); 5053 $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); 5054 } 5055 5056 $(document.body).addClass(ClassName$5.OPEN); 5057 }; 5058 5059 _proto._resetScrollbar = function _resetScrollbar() { 5060 // Restore fixed content padding 5061 var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT)); 5062 $(fixedContent).each(function (index, element) { 5063 var padding = $(element).data('padding-right'); 5064 $(element).removeData('padding-right'); 5065 element.style.paddingRight = padding ? padding : ''; 5066 }); // Restore sticky content 5067 5068 var elements = [].slice.call(document.querySelectorAll("" + Selector$5.STICKY_CONTENT)); 5069 $(elements).each(function (index, element) { 5070 var margin = $(element).data('margin-right'); 5071 5072 if (typeof margin !== 'undefined') { 5073 $(element).css('margin-right', margin).removeData('margin-right'); 5074 } 5075 }); // Restore body padding 5076 5077 var padding = $(document.body).data('padding-right'); 5078 $(document.body).removeData('padding-right'); 5079 document.body.style.paddingRight = padding ? padding : ''; 5080 }; 5081 5082 _proto._getScrollbarWidth = function _getScrollbarWidth() { 5083 // thx d.walsh 5084 var scrollDiv = document.createElement('div'); 5085 scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER; 5086 document.body.appendChild(scrollDiv); 5087 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 5088 document.body.removeChild(scrollDiv); 5089 return scrollbarWidth; 5090 } // Static 5091 ; 5092 5093 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { 5094 return this.each(function () { 5095 var data = $(this).data(DATA_KEY$5); 5096 5097 var _config = _objectSpread({}, Default$3, $(this).data(), typeof config === 'object' && config ? config : {}); 5098 5099 if (!data) { 5100 data = new Modal(this, _config); 5101 $(this).data(DATA_KEY$5, data); 5102 } 5103 5104 if (typeof config === 'string') { 5105 if (typeof data[config] === 'undefined') {
5106 throw new TypeError("No method named \"" + config + "\""); 5107 } 5108 5109 data[config](relatedTarget); 5110 } else if (_config.show) { 5111 data.show(relatedTarget); 5112 } 5113 }); 5114 }; 5115 5116 _createClass(Modal, null, [{ 5117 key: "VERSION", 5118 get: function get() { 5119 return VERSION$5; 5120 } 5121 }, { 5122 key: "Default", 5123 get: function get() { 5124 return Default$3; 5125 } 5126 }]); 5127 5128 return Modal; 5129 }(); 5130 /** 5131 * ------------------------------------------------------------------------ 5132 * Data Api implementation 5133 * ------------------------------------------------------------------------ 5134 */ 5135 5136 5137 $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) { 5138 var _this10 = this; 5139 5140 var target; 5141 var selector = Util.getSelectorFromElement(this); 5142 5143 if (selector) { 5144 target = document.querySelector(selector); 5145 } 5146 5147 var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data()); 5148 5149 if (this.tagName === 'A' || this.tagName === 'AREA') { 5150 event.preventDefault(); 5151 } 5152 5153 var $target = $(target).one(Event$5.SHOW, function (showEvent) { 5154 if (showEvent.isDefaultPrevented()) { 5155 // Only register focus restorer if modal will actually get shown 5156 return; 5157 } 5158 5159 $target.one(Event$5.HIDDEN, function () { 5160 if ($(_this10).is(':visible')) { 5161 _this10.focus(); 5162 } 5163 }); 5164 }); 5165 5166 Modal._jQueryInterface.call($(target), config, this); 5167 }); 5168 /** 5169 * ------------------------------------------------------------------------ 5170 * jQuery 5171 * ------------------------------------------------------------------------ 5172 */ 5173 5174 $.fn[NAME$5] = Modal._jQueryInterface; 5175 $.fn[NAME$5].Constructor = Modal; 5176 5177 $.fn[NAME$5].noConflict = function () { 5178 $.fn[NAME$5] = JQUERY_NO_CONFLICT$5; 5179 return Modal._jQueryInterface; 5180 }; 5181 5182 /** 5183 * -------------------------------------------------------------------------- 5184 * Bootstrap (v4.3.1): tools/sanitizer.js 5185 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5186 * -------------------------------------------------------------------------- 5187 */ 5188 var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; 5189 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 5190 var DefaultWhitelist = { 5191 // Global attributes allowed on any supplied element below. 5192 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 5193 a: ['target', 'href', 'title', 'rel'], 5194 area: [], 5195 b: [], 5196 br: [], 5197 col: [], 5198 code: [], 5199 div: [], 5200 em: [], 5201 hr: [], 5202 h1: [], 5203 h2: [], 5204 h3: [], 5205 h4: [], 5206 h5: [], 5207 h6: [], 5208 i: [], 5209 img: ['src', 'alt', 'title', 'width', 'height'], 5210 li: [], 5211 ol: [], 5212 p: [], 5213 pre: [], 5214 s: [], 5215 small: [], 5216 span: [], 5217 sub: [], 5218 sup: [], 5219 strong: [], 5220 u: [], 5221 ul: [] 5222 /** 5223 * A pattern that recognizes a commonly useful subset of URLs that are safe. 5224 * 5225 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 5226 */ 5227 5228 }; 5229 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi; 5230 /** 5231 * A pattern that matches safe data URLs. Only matches image, video and audio types. 5232 * 5233 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 5234 */ 5235 5236 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i; 5237 5238 function allowedAttribute(attr, allowedAttributeList) { 5239 var attrName = attr.nodeName.toLowerCase(); 5240 5241 if (allowedAttributeList.indexOf(attrName) !== -1) { 5242 if (uriAttrs.indexOf(attrName) !== -1) { 5243 return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN)); 5244 } 5245 5246 return true; 5247 } 5248 5249 var regExp = allowedAttributeList.filter(function (attrRegex) {
vendor: 4,926 bytes, lines 5250-5431
5250 return attrRegex instanceof RegExp; 5251 }); // Check if a regular expression validates the attribute. 5252 5253 for (var i = 0, l = regExp.length; i < l; i++) { 5254 if (attrName.match(regExp[i])) { 5255 return true; 5256 } 5257 } 5258 5259 return false; 5260 } 5261 5262 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 5263 if (unsafeHtml.length === 0) { 5264 return unsafeHtml; 5265 } 5266 5267 if (sanitizeFn && typeof sanitizeFn === 'function') { 5268 return sanitizeFn(unsafeHtml); 5269 } 5270 5271 var domParser = new window.DOMParser(); 5272 var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 5273 var whitelistKeys = Object.keys(whiteList); 5274 var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); 5275 5276 var _loop = function _loop(i, len) { 5277 var el = elements[i]; 5278 var elName = el.nodeName.toLowerCase(); 5279 5280 if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { 5281 el.parentNode.removeChild(el); 5282 return "continue"; 5283 } 5284 5285 var attributeList = [].slice.call(el.attributes); 5286 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); 5287 attributeList.forEach(function (attr) { 5288 if (!allowedAttribute(attr, whitelistedAttributes)) { 5289 el.removeAttribute(attr.nodeName); 5290 } 5291 }); 5292 }; 5293 5294 for (var i = 0, len = elements.length; i < len; i++) { 5295 var _ret = _loop(i, len); 5296 5297 if (_ret === "continue") continue; 5298 } 5299 5300 return createdDocument.body.innerHTML; 5301 } 5302 5303 /** 5304 * ------------------------------------------------------------------------ 5305 * Constants 5306 * ------------------------------------------------------------------------ 5307 */ 5308 5309 var NAME$6 = 'tooltip'; 5310 var VERSION$6 = '4.3.1'; 5311 var DATA_KEY$6 = 'bs.tooltip'; 5312 var EVENT_KEY$6 = "." + DATA_KEY$6; 5313 var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6]; 5314 var CLASS_PREFIX = 'bs-tooltip'; 5315 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 5316 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; 5317 var DefaultType$4 = { 5318 animation: 'boolean', 5319 template: 'string', 5320 title: '(string|element|function)', 5321 trigger: 'string', 5322 delay: '(number|object)', 5323 html: 'boolean', 5324 selector: '(string|boolean)', 5325 placement: '(string|function)', 5326 offset: '(number|string|function)', 5327 container: '(string|element|boolean)', 5328 fallbackPlacement: '(string|array)', 5329 boundary: '(string|element)', 5330 sanitize: 'boolean', 5331 sanitizeFn: '(null|function)', 5332 whiteList: 'object' 5333 }; 5334 var AttachmentMap$1 = { 5335 AUTO: 'auto', 5336 TOP: 'top', 5337 RIGHT: 'right', 5338 BOTTOM: 'bottom', 5339 LEFT: 'left' 5340 }; 5341 var Default$4 = { 5342 animation: true, 5343 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', 5344 trigger: 'hover focus', 5345 title: '', 5346 delay: 0, 5347 html: false, 5348 selector: false, 5349 placement: 'top', 5350 offset: 0, 5351 container: false, 5352 fallbackPlacement: 'flip', 5353 boundary: 'scrollParent', 5354 sanitize: true, 5355 sanitizeFn: null, 5356 whiteList: DefaultWhitelist 5357 }; 5358 var HoverState = { 5359 SHOW: 'show', 5360 OUT: 'out' 5361 }; 5362 var Event$6 = { 5363 HIDE: "hide" + EVENT_KEY$6, 5364 HIDDEN: "hidden" + EVENT_KEY$6, 5365 SHOW: "show" + EVENT_KEY$6, 5366 SHOWN: "shown" + EVENT_KEY$6, 5367 INSERTED: "inserted" + EVENT_KEY$6, 5368 CLICK: "click" + EVENT_KEY$6, 5369 FOCUSIN: "focusin" + EVENT_KEY$6, 5370 FOCUSOUT: "focusout" + EVENT_KEY$6, 5371 MOUSEENTER: "mouseenter" + EVENT_KEY$6, 5372 MOUSELEAVE: "mouseleave" + EVENT_KEY$6 5373 }; 5374 var ClassName$6 = { 5375 FADE: 'fade', 5376 SHOW: 'show' 5377 }; 5378 var Selector$6 = { 5379 TOOLTIP: '.tooltip', 5380 TOOLTIP_INNER: '.tooltip-inner', 5381 ARROW: '.arrow' 5382 }; 5383 var Trigger = { 5384 HOVER: 'hover', 5385 FOCUS: 'focus', 5386 CLICK: 'click', 5387 MANUAL: 'manual' 5388 /** 5389 * ------------------------------------------------------------------------ 5390 * Class Definition 5391 * ------------------------------------------------------------------------ 5392 */ 5393 5394 }; 5395 5396 var Tooltip = 5397 /*#__PURE__*/ 5398 function () { 5399 function Tooltip(element, config) { 5400 /** 5401 * Check for Popper dependency 5402 * Popper - https://popper.js.org 5403 */ 5404 if (typeof Popper === 'undefined') { 5405 throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)'); 5406 } // private 5407 5408 5409 this._isEnabled = true; 5410 this._timeout = 0; 5411 this._hoverState = ''; 5412 this._activeTrigger = {}; 5413 this._popper = null; // Protected 5414 5415 this.element = element; 5416 this.config = this._getConfig(config); 5417 this.tip = null; 5418 5419 this._setListeners(); 5420 } // Getters 5421 5422 5423 var _proto = Tooltip.prototype; 5424 5425 // Public 5426 _proto.enable = function enable() { 5427 this._isEnabled = true; 5428 }; 5429 5430 _proto.disable = function disable() { 5431 this._isEnabled = false;
5432 }; 5433 5434 _proto.toggleEnabled = function toggleEnabled() { 5435 this._isEnabled = !this._isEnabled; 5436 }; 5437 5438 _proto.toggle = function toggle(event) { 5439 if (!this._isEnabled) { 5440 return; 5441 } 5442 5443 if (event) { 5444 var dataKey = this.constructor.DATA_KEY; 5445 var context = $(event.currentTarget).data(dataKey); 5446 5447 if (!context) { 5448 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 5449 $(event.currentTarget).data(dataKey, context); 5450 } 5451 5452 context._activeTrigger.click = !context._activeTrigger.click; 5453 5454 if (context._isWithActiveTrigger()) { 5455 context._enter(null, context); 5456 } else { 5457 context._leave(null, context); 5458 } 5459 } else { 5460 if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) { 5461 this._leave(null, this); 5462 5463 return; 5464 } 5465 5466 this._enter(null, this); 5467 } 5468 }; 5469 5470 _proto.dispose = function dispose() { 5471 clearTimeout(this._timeout); 5472 $.removeData(this.element, this.constructor.DATA_KEY); 5473 $(this.element).off(this.constructor.EVENT_KEY); 5474 $(this.element).closest('.modal').off('hide.bs.modal'); 5475 5476 if (this.tip) { 5477 $(this.tip).remove(); 5478 } 5479 5480 this._isEnabled = null; 5481 this._timeout = null; 5482 this._hoverState = null; 5483 this._activeTrigger = null; 5484 5485 if (this._popper !== null) { 5486 this._popper.destroy(); 5487 } 5488 5489 this._popper = null; 5490 this.element = null; 5491 this.config = null; 5492 this.tip = null; 5493 }; 5494 5495 _proto.show = function show() { 5496 var _this = this; 5497 5498 if ($(this.element).css('display') === 'none') { 5499 throw new Error('Please use show on visible elements'); 5500 } 5501 5502 var showEvent = $.Event(this.constructor.Event.SHOW); 5503 5504 if (this.isWithContent() && this._isEnabled) { 5505 $(this.element).trigger(showEvent); 5506 var shadowRoot = Util.findShadowRoot(this.element); 5507 var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); 5508 5509 if (showEvent.isDefaultPrevented() || !isInTheDom) { 5510 return; 5511 } 5512 5513 var tip = this.getTipElement(); 5514 var tipId = Util.getUID(this.constructor.NAME);
5515 tip.setAttribute('id', tipId); 5516 this.element.setAttribute('aria-describedby', tipId); 5517 this.setContent(); 5518 5519 if (this.config.animation) { 5520 $(tip).addClass(ClassName$6.FADE); 5521 } 5522 5523 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; 5524 5525 var attachment = this._getAttachment(placement); 5526 5527 this.addAttachmentClass(attachment); 5528 5529 var container = this._getContainer(); 5530 5531 $(tip).data(this.constructor.DATA_KEY, this); 5532 5533 if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) { 5534 $(tip).appendTo(container); 5535 } 5536 5537 $(this.element).trigger(this.constructor.Event.INSERTED); 5538 this._popper = new Popper(this.element, tip, { 5539 placement: attachment, 5540 modifiers: { 5541 offset: this._getOffset(), 5542 flip: { 5543 behavior: this.config.fallbackPlacement 5544 }, 5545 arrow: { 5546 element: Selector$6.ARROW 5547 }, 5548 preventOverflow: { 5549 boundariesElement: this.config.boundary 5550 } 5551 }, 5552 onCreate: function onCreate(data) { 5553 if (data.originalPlacement !== data.placement) { 5554 _this._handlePopperPlacementChange(data); 5555 } 5556 }, 5557 onUpdate: function onUpdate(data) { 5558 return _this._handlePopperPlacementChange(data); 5559 } 5560 }); 5561 $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra 5562 // empty mouseover listeners to the body's immediate children; 5563 // only needed because of broken event delegation on iOS 5564 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 5565 5566 if ('ontouchstart' in document.documentElement) { 5567 $(document.body).children().on('mouseover', null, $.noop); 5568 } 5569 5570 var complete = function complete() { 5571 if (_this.config.animation) { 5572 _this._fixTransition(); 5573 } 5574 5575 var prevHoverState = _this._hoverState; 5576 _this._hoverState = null; 5577 $(_this.element).trigger(_this.constructor.Event.SHOWN); 5578 5579 if (prevHoverState === HoverState.OUT) { 5580 _this._leave(null, _this); 5581 } 5582 }; 5583 5584 if ($(this.tip).hasClass(ClassName$6.FADE)) { 5585 var transitionDuration = Util.getTransitionDurationFromElement(this.tip); 5586 $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 5587 } else { 5588 complete(); 5589 } 5590 } 5591 }; 5592 5593 _proto.hide = function hide(callback) { 5594 var _this2 = this; 5595 5596 var tip = this.getTipElement(); 5597 var hideEvent = $.Event(this.constructor.Event.HIDE); 5598 5599 var complete = function complete() { 5600 if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) { 5601 tip.parentNode.removeChild(tip); 5602 } 5603 5604 _this2._cleanTipClass(); 5605 5606 _this2.element.removeAttribute('aria-describedby'); 5607 5608 $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); 5609 5610 if (_this2._popper !== null) { 5611 _this2._popper.destroy(); 5612 } 5613 5614 if (callback) { 5615 callback(); 5616 } 5617 }; 5618 5619 $(this.element).trigger(hideEvent); 5620 5621 if (hideEvent.isDefaultPrevented()) { 5622 return; 5623 } 5624 5625 $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra 5626 // empty mouseover listeners we added for iOS support 5627 5628 if ('ontouchstart' in document.documentElement) { 5629 $(document.body).children().off('mouseover', null, $.noop); 5630 } 5631 5632 this._activeTrigger[Trigger.CLICK] = false; 5633 this._activeTrigger[Trigger.FOCUS] = false; 5634 this._activeTrigger[Trigger.HOVER] = false; 5635 5636 if ($(this.tip).hasClass(ClassName$6.FADE)) { 5637 var transitionDuration = Util.getTransitionDurationFromElement(tip); 5638 $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 5639 } else { 5640 complete(); 5641 } 5642 5643 this._hoverState = ''; 5644 }; 5645
5646 _proto.update = function update() { 5647 if (this._popper !== null) { 5648 this._popper.scheduleUpdate(); 5649 } 5650 } // Protected 5651 ; 5652 5653 _proto.isWithContent = function isWithContent() { 5654 return Boolean(this.getTitle()); 5655 }; 5656 5657 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 5658 $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); 5659 }; 5660 5661 _proto.getTipElement = function getTipElement() { 5662 this.tip = this.tip || $(this.config.template)[0]; 5663 return this.tip; 5664 }; 5665 5666 _proto.setContent = function setContent() { 5667 var tip = this.getTipElement(); 5668 this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle()); 5669 $(tip).removeClass(ClassName$6.FADE + " " + ClassName$6.SHOW); 5670 }; 5671 5672 _proto.setElementContent = function setElementContent($element, content) { 5673 if (typeof content === 'object' && (content.nodeType || content.jquery)) { 5674 // Content is a DOM node or a jQuery 5675 if (this.config.html) { 5676 if (!$(content).parent().is($element)) { 5677 $element.empty().append(content); 5678 } 5679 } else { 5680 $element.text($(content).text()); 5681 } 5682 5683 return; 5684 } 5685 5686 if (this.config.html) { 5687 if (this.config.sanitize) { 5688 content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); 5689 } 5690 5691 $element.html(content); 5692 } else { 5693 $element.text(content); 5694 } 5695 }; 5696 5697 _proto.getTitle = function getTitle() { 5698 var title = this.element.getAttribute('data-original-title'); 5699 5700 if (!title) { 5701 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; 5702 } 5703 5704 return title; 5705 } // Private 5706 ; 5707 5708 _proto._getOffset = function _getOffset() { 5709 var _this3 = this; 5710 5711 var offset = {}; 5712 5713 if (typeof this.config.offset === 'function') { 5714 offset.fn = function (data) { 5715 data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {}); 5716 return data; 5717 }; 5718 } else { 5719 offset.offset = this.config.offset; 5720 } 5721 5722 return offset; 5723 }; 5724 5725 _proto._getContainer = function _getContainer() { 5726 if (this.config.container === false) { 5727 return document.body; 5728 } 5729 5730 if (Util.isElement(this.config.container)) { 5731 return $(this.config.container); 5732 } 5733 5734 return $(document).find(this.config.container); 5735 }; 5736 5737 _proto._getAttachment = function _getAttachment(placement) { 5738 return AttachmentMap$1[placement.toUpperCase()]; 5739 }; 5740 5741 _proto._setListeners = function _setListeners() { 5742 var _this4 = this; 5743 5744 var triggers = this.config.trigger.split(' '); 5745 triggers.forEach(function (trigger) { 5746 if (trigger === 'click') { 5747 $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) { 5748 return _this4.toggle(event); 5749 }); 5750 } else if (trigger !== Trigger.MANUAL) { 5751 var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN; 5752 var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT; 5753 $(_this4.element).on(eventIn, _this4.config.selector, function (event) { 5754 return _this4._enter(event); 5755 }).on(eventOut, _this4.config.selector, function (event) { 5756 return _this4._leave(event); 5757 }); 5758 } 5759 }); 5760 $(this.element).closest('.modal').on('hide.bs.modal', function () { 5761 if (_this4.element) { 5762 _this4.hide(); 5763 } 5764 }); 5765 5766 if (this.config.selector) { 5767 this.config = _objectSpread({}, this.config, { 5768 trigger: 'manual', 5769 selector: '' 5770 }); 5771 } else { 5772 this._fixTitle(); 5773 } 5774 }; 5775 5776 _proto._fixTitle = function _fixTitle() { 5777 var titleType = typeof this.element.getAttribute('data-original-title'); 5778 5779 if (this.element.getAttribute('title') || titleType !== 'string') { 5780 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); 5781 this.element.setAttribute('title', ''); 5782 } 5783 }; 5784 5785 _proto._enter = function _enter(event, context) { 5786 var dataKey = this.constructor.DATA_KEY; 5787 context = context || $(event.currentTarget).data(dataKey); 5788 5789 if (!context) { 5790 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 5791 $(event.currentTarget).data(dataKey, context); 5792 } 5793 5794 if (event) { 5795 context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true; 5796 } 5797 5798 if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) { 5799 context._hoverState = HoverState.SHOW; 5800 return; 5801 } 5802 5803 clearTimeout(context._timeout); 5804 context._hoverState = HoverState.SHOW; 5805 5806 if (!context.config.delay || !context.config.delay.show) { 5807 context.show(); 5808 return; 5809 } 5810 5811 context._timeout = setTimeout(function () { 5812 if (context._hoverState === HoverState.SHOW) { 5813 context.show(); 5814 } 5815 }, context.config.delay.show); 5816 }; 5817 5818 _proto._leave = function _leave(event, context) { 5819 var dataKey = this.constructor.DATA_KEY; 5820 context = context || $(event.currentTarget).data(dataKey); 5821 5822 if (!context) { 5823 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 5824 $(event.currentTarget).data(dataKey, context); 5825 } 5826 5827 if (event) { 5828 context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
vendor: 8,518 bytes, lines 5829-6143
5829 } 5830 5831 if (context._isWithActiveTrigger()) { 5832 return; 5833 } 5834 5835 clearTimeout(context._timeout); 5836 context._hoverState = HoverState.OUT; 5837 5838 if (!context.config.delay || !context.config.delay.hide) { 5839 context.hide(); 5840 return; 5841 } 5842 5843 context._timeout = setTimeout(function () { 5844 if (context._hoverState === HoverState.OUT) { 5845 context.hide(); 5846 } 5847 }, context.config.delay.hide); 5848 }; 5849 5850 _proto._isWithActiveTrigger = function _isWithActiveTrigger() { 5851 for (var trigger in this._activeTrigger) { 5852 if (this._activeTrigger[trigger]) { 5853 return true; 5854 } 5855 } 5856 5857 return false; 5858 }; 5859 5860 _proto._getConfig = function _getConfig(config) { 5861 var dataAttributes = $(this.element).data(); 5862 Object.keys(dataAttributes).forEach(function (dataAttr) { 5863 if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { 5864 delete dataAttributes[dataAttr]; 5865 } 5866 }); 5867 config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); 5868 5869 if (typeof config.delay === 'number') { 5870 config.delay = { 5871 show: config.delay, 5872 hide: config.delay 5873 }; 5874 } 5875 5876 if (typeof config.title === 'number') { 5877 config.title = config.title.toString(); 5878 } 5879 5880 if (typeof config.content === 'number') { 5881 config.content = config.content.toString(); 5882 } 5883 5884 Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType); 5885 5886 if (config.sanitize) { 5887 config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); 5888 } 5889 5890 return config; 5891 }; 5892 5893 _proto._getDelegateConfig = function _getDelegateConfig() { 5894 var config = {}; 5895 5896 if (this.config) { 5897 for (var key in this.config) { 5898 if (this.constructor.Default[key] !== this.config[key]) { 5899 config[key] = this.config[key]; 5900 } 5901 } 5902 } 5903 5904 return config; 5905 }; 5906 5907 _proto._cleanTipClass = function _cleanTipClass() { 5908 var $tip = $(this.getTipElement()); 5909 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); 5910 5911 if (tabClass !== null && tabClass.length) { 5912 $tip.removeClass(tabClass.join('')); 5913 } 5914 }; 5915 5916 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { 5917 var popperInstance = popperData.instance; 5918 this.tip = popperInstance.popper; 5919 5920 this._cleanTipClass(); 5921 5922 this.addAttachmentClass(this._getAttachment(popperData.placement)); 5923 }; 5924 5925 _proto._fixTransition = function _fixTransition() { 5926 var tip = this.getTipElement(); 5927 var initConfigAnimation = this.config.animation; 5928 5929 if (tip.getAttribute('x-placement') !== null) { 5930 return; 5931 } 5932 5933 $(tip).removeClass(ClassName$6.FADE); 5934 this.config.animation = false; 5935 this.hide(); 5936 this.show(); 5937 this.config.animation = initConfigAnimation; 5938 } // Static 5939 ; 5940 5941 Tooltip._jQueryInterface = function _jQueryInterface(config) { 5942 return this.each(function () { 5943 var data = $(this).data(DATA_KEY$6); 5944 5945 var _config = typeof config === 'object' && config; 5946 5947 if (!data && /dispose|hide/.test(config)) { 5948 return; 5949 } 5950 5951 if (!data) { 5952 data = new Tooltip(this, _config); 5953 $(this).data(DATA_KEY$6, data); 5954 } 5955 5956 if (typeof config === 'string') { 5957 if (typeof data[config] === 'undefined') { 5958 throw new TypeError("No method named \"" + config + "\""); 5959 } 5960 5961 data[config](); 5962 } 5963 }); 5964 }; 5965 5966 _createClass(Tooltip, null, [{ 5967 key: "VERSION", 5968 get: function get() { 5969 return VERSION$6; 5970 } 5971 }, { 5972 key: "Default", 5973 get: function get() { 5974 return Default$4; 5975 } 5976 }, { 5977 key: "NAME", 5978 get: function get() { 5979 return NAME$6; 5980 } 5981 }, { 5982 key: "DATA_KEY", 5983 get: function get() { 5984 return DATA_KEY$6; 5985 } 5986 }, { 5987 key: "Event", 5988 get: function get() { 5989 return Event$6; 5990 } 5991 }, { 5992 key: "EVENT_KEY", 5993 get: function get() { 5994 return EVENT_KEY$6; 5995 } 5996 }, { 5997 key: "DefaultType", 5998 get: function get() { 5999 return DefaultType$4; 6000 } 6001 }]); 6002 6003 return Tooltip; 6004 }(); 6005 /** 6006 * ------------------------------------------------------------------------ 6007 * jQuery 6008 * ------------------------------------------------------------------------ 6009 */ 6010 6011 6012 $.fn[NAME$6] = Tooltip._jQueryInterface; 6013 $.fn[NAME$6].Constructor = Tooltip; 6014 6015 $.fn[NAME$6].noConflict = function () { 6016 $.fn[NAME$6] = JQUERY_NO_CONFLICT$6; 6017 return Tooltip._jQueryInterface; 6018 }; 6019 6020 /** 6021 * ------------------------------------------------------------------------ 6022 * Constants 6023 * ------------------------------------------------------------------------ 6024 */ 6025 6026 var NAME$7 = 'popover'; 6027 var VERSION$7 = '4.3.1'; 6028 var DATA_KEY$7 = 'bs.popover'; 6029 var EVENT_KEY$7 = "." + DATA_KEY$7; 6030 var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7]; 6031 var CLASS_PREFIX$1 = 'bs-popover'; 6032 var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); 6033 6034 var Default$5 = _objectSpread({}, Tooltip.Default, { 6035 placement: 'right', 6036 trigger: 'click', 6037 content: '', 6038 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' 6039 }); 6040 6041 var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, { 6042 content: '(string|element|function)' 6043 }); 6044 6045 var ClassName$7 = { 6046 FADE: 'fade', 6047 SHOW: 'show' 6048 }; 6049 var Selector$7 = { 6050 TITLE: '.popover-header', 6051 CONTENT: '.popover-body' 6052 }; 6053 var Event$7 = { 6054 HIDE: "hide" + EVENT_KEY$7, 6055 HIDDEN: "hidden" + EVENT_KEY$7, 6056 SHOW: "show" + EVENT_KEY$7, 6057 SHOWN: "shown" + EVENT_KEY$7, 6058 INSERTED: "inserted" + EVENT_KEY$7, 6059 CLICK: "click" + EVENT_KEY$7, 6060 FOCUSIN: "focusin" + EVENT_KEY$7, 6061 FOCUSOUT: "focusout" + EVENT_KEY$7, 6062 MOUSEENTER: "mouseenter" + EVENT_KEY$7, 6063 MOUSELEAVE: "mouseleave" + EVENT_KEY$7 6064 /** 6065 * ------------------------------------------------------------------------ 6066 * Class Definition 6067 * ------------------------------------------------------------------------ 6068 */ 6069 6070 }; 6071 6072 var Popover = 6073 /*#__PURE__*/ 6074 function (_Tooltip) { 6075 _inheritsLoose(Popover, _Tooltip); 6076 6077 function Popover() { 6078 return _Tooltip.apply(this, arguments) || this; 6079 } 6080 6081 var _proto = Popover.prototype; 6082 6083 // Overrides 6084 _proto.isWithContent = function isWithContent() { 6085 return this.getTitle() || this._getContent(); 6086 }; 6087 6088 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 6089 $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment); 6090 }; 6091 6092 _proto.getTipElement = function getTipElement() { 6093 this.tip = this.tip || $(this.config.template)[0]; 6094 return this.tip; 6095 }; 6096 6097 _proto.setContent = function setContent() { 6098 var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events 6099 6100 this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle()); 6101 6102 var content = this._getContent(); 6103 6104 if (typeof content === 'function') { 6105 content = content.call(this.element); 6106 } 6107 6108 this.setElementContent($tip.find(Selector$7.CONTENT), content); 6109 $tip.removeClass(ClassName$7.FADE + " " + ClassName$7.SHOW); 6110 } // Private 6111 ; 6112 6113 _proto._getContent = function _getContent() { 6114 return this.element.getAttribute('data-content') || this.config.content; 6115 }; 6116 6117 _proto._cleanTipClass = function _cleanTipClass() { 6118 var $tip = $(this.getTipElement()); 6119 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1); 6120 6121 if (tabClass !== null && tabClass.length > 0) { 6122 $tip.removeClass(tabClass.join('')); 6123 } 6124 } // Static 6125 ; 6126 6127 Popover._jQueryInterface = function _jQueryInterface(config) { 6128 return this.each(function () { 6129 var data = $(this).data(DATA_KEY$7); 6130 6131 var _config = typeof config === 'object' ? config : null; 6132 6133 if (!data && /dispose|hide/.test(config)) { 6134 return; 6135 } 6136 6137 if (!data) { 6138 data = new Popover(this, _config); 6139 $(this).data(DATA_KEY$7, data); 6140 } 6141 6142 if (typeof config === 'string') { 6143 if (typeof data[config] === 'undefined') {
6144 throw new TypeError("No method named \"" + config + "\""); 6145 } 6146 6147 data[config](); 6148 } 6149 }); 6150 }; 6151 6152 _createClass(Popover, null, [{ 6153 key: "VERSION", 6154 // Getters 6155 get: function get() { 6156 return VERSION$7; 6157 } 6158 }, { 6159 key: "Default", 6160 get: function get() { 6161 return Default$5; 6162 } 6163 }, { 6164 key: "NAME", 6165 get: function get() { 6166 return NAME$7; 6167 } 6168 }, { 6169 key: "DATA_KEY", 6170 get: function get() { 6171 return DATA_KEY$7; 6172 } 6173 }, { 6174 key: "Event", 6175 get: function get() { 6176 return Event$7; 6177 } 6178 }, { 6179 key: "EVENT_KEY", 6180 get: function get() { 6181 return EVENT_KEY$7; 6182 } 6183 }, { 6184 key: "DefaultType", 6185 get: function get() { 6186 return DefaultType$5; 6187 } 6188 }]); 6189 6190 return Popover; 6191 }(Tooltip); 6192 /** 6193 * ------------------------------------------------------------------------ 6194 * jQuery 6195 * ------------------------------------------------------------------------ 6196 */ 6197 6198 6199 $.fn[NAME$7] = Popover._jQueryInterface; 6200 $.fn[NAME$7].Constructor = Popover; 6201 6202 $.fn[NAME$7].noConflict = function () { 6203 $.fn[NAME$7] = JQUERY_NO_CONFLICT$7; 6204 return Popover._jQueryInterface; 6205 }; 6206 6207 /** 6208 * ------------------------------------------------------------------------ 6209 * Constants 6210 * ------------------------------------------------------------------------ 6211 */ 6212 6213 var NAME$8 = 'scrollspy'; 6214 var VERSION$8 = '4.3.1'; 6215 var DATA_KEY$8 = 'bs.scrollspy'; 6216 var EVENT_KEY$8 = "." + DATA_KEY$8; 6217 var DATA_API_KEY$6 = '.data-api'; 6218 var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8]; 6219 var Default$6 = { 6220 offset: 10, 6221 method: 'auto', 6222 target: '' 6223 }; 6224 var DefaultType$6 = { 6225 offset: 'number', 6226 method: 'string', 6227 target: '(string|element)' 6228 }; 6229 var Event$8 = { 6230 ACTIVATE: "activate" + EVENT_KEY$8, 6231 SCROLL: "scroll" + EVENT_KEY$8, 6232 LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6 6233 }; 6234 var ClassName$8 = { 6235 DROPDOWN_ITEM: 'dropdown-item', 6236 DROPDOWN_MENU: 'dropdown-menu', 6237 ACTIVE: 'active' 6238 }; 6239 var Selector$8 = { 6240 DATA_SPY: '[data-spy="scroll"]', 6241 ACTIVE: '.active', 6242 NAV_LIST_GROUP: '.nav, .list-group', 6243 NAV_LINKS: '.nav-link', 6244 NAV_ITEMS: '.nav-item', 6245 LIST_ITEMS: '.list-group-item', 6246 DROPDOWN: '.dropdown', 6247 DROPDOWN_ITEMS: '.dropdown-item', 6248 DROPDOWN_TOGGLE: '.dropdown-toggle' 6249 }; 6250 var OffsetMethod = { 6251 OFFSET: 'offset', 6252 POSITION: 'position' 6253 /** 6254 * ------------------------------------------------------------------------ 6255 * Class Definition 6256 * ------------------------------------------------------------------------ 6257 */ 6258 6259 }; 6260 6261 var ScrollSpy = 6262 /*#__PURE__*/ 6263 function () { 6264 function ScrollSpy(element, config) { 6265 var _this = this; 6266 6267 this._element = element; 6268 this._scrollElement = element.tagName === 'BODY' ? window : element; 6269 this._config = this._getConfig(config); 6270 this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS); 6271 this._offsets = []; 6272 this._targets = []; 6273 this._activeTarget = null; 6274 this._scrollHeight = 0; 6275 $(this._scrollElement).on(Event$8.SCROLL, function (event) { 6276 return _this._process(event); 6277 }); 6278 this.refresh(); 6279 6280 this._process(); 6281 } // Getters 6282 6283 6284 var _proto = ScrollSpy.prototype; 6285 6286 // Public 6287 _proto.refresh = function refresh() { 6288 var _this2 = this; 6289 6290 var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION; 6291 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 6292 var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; 6293 this._offsets = []; 6294 this._targets = []; 6295 this._scrollHeight = this._getScrollHeight(); 6296 var targets = [].slice.call(document.querySelectorAll(this._selector)); 6297 targets.map(function (element) { 6298 var target; 6299 var targetSelector = Util.getSelectorFromElement(element); 6300
vendor: 4,133 bytes, lines 6301-6429
6301 if (targetSelector) { 6302 target = document.querySelector(targetSelector); 6303 } 6304 6305 if (target) { 6306 var targetBCR = target.getBoundingClientRect(); 6307 6308 if (targetBCR.width || targetBCR.height) { 6309 // TODO (fat): remove sketch reliance on jQuery position/offset 6310 return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; 6311 } 6312 } 6313 6314 return null; 6315 }).filter(function (item) { 6316 return item; 6317 }).sort(function (a, b) { 6318 return a[0] - b[0]; 6319 }).forEach(function (item) { 6320 _this2._offsets.push(item[0]); 6321 6322 _this2._targets.push(item[1]); 6323 }); 6324 }; 6325 6326 _proto.dispose = function dispose() { 6327 $.removeData(this._element, DATA_KEY$8); 6328 $(this._scrollElement).off(EVENT_KEY$8); 6329 this._element = null; 6330 this._scrollElement = null; 6331 this._config = null; 6332 this._selector = null; 6333 this._offsets = null; 6334 this._targets = null; 6335 this._activeTarget = null; 6336 this._scrollHeight = null; 6337 } // Private 6338 ; 6339 6340 _proto._getConfig = function _getConfig(config) { 6341 config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {}); 6342 6343 if (typeof config.target !== 'string') { 6344 var id = $(config.target).attr('id'); 6345 6346 if (!id) { 6347 id = Util.getUID(NAME$8); 6348 $(config.target).attr('id', id); 6349 } 6350 6351 config.target = "#" + id; 6352 } 6353 6354 Util.typeCheckConfig(NAME$8, config, DefaultType$6); 6355 return config; 6356 }; 6357 6358 _proto._getScrollTop = function _getScrollTop() { 6359 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 6360 }; 6361 6362 _proto._getScrollHeight = function _getScrollHeight() { 6363 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 6364 }; 6365 6366 _proto._getOffsetHeight = function _getOffsetHeight() { 6367 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 6368 }; 6369 6370 _proto._process = function _process() { 6371 var scrollTop = this._getScrollTop() + this._config.offset; 6372 6373 var scrollHeight = this._getScrollHeight(); 6374 6375 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 6376 6377 if (this._scrollHeight !== scrollHeight) { 6378 this.refresh(); 6379 } 6380 6381 if (scrollTop >= maxScroll) { 6382 var target = this._targets[this._targets.length - 1]; 6383 6384 if (this._activeTarget !== target) { 6385 this._activate(target); 6386 } 6387 6388 return; 6389 } 6390 6391 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 6392 this._activeTarget = null; 6393 6394 this._clear(); 6395 6396 return; 6397 } 6398 6399 var offsetLength = this._offsets.length; 6400 6401 for (var i = offsetLength; i--;) { 6402 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 6403 6404 if (isActiveTarget) { 6405 this._activate(this._targets[i]); 6406 } 6407 } 6408 }; 6409 6410 _proto._activate = function _activate(target) { 6411 this._activeTarget = target; 6412 6413 this._clear(); 6414 6415 var queries = this._selector.split(',').map(function (selector) { 6416 return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; 6417 }); 6418 6419 var $link = $([].slice.call(document.querySelectorAll(queries.join(',')))); 6420 6421 if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) { 6422 $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE); 6423 $link.addClass(ClassName$8.ACTIVE); 6424 } else { 6425 // Set triggered link as active 6426 $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active 6427 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 6428 6429 $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_LINKS + ", " + Selector$8.
6429LIST_ITEMS).addClass(ClassName$8.ACTIVE); // Handle special case when .nav-link is inside .nav-item 6430 6431 $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE); 6432 } 6433 6434 $(this._scrollElement).trigger(Event$8.ACTIVATE, { 6435 relatedTarget: target 6436 }); 6437 }; 6438 6439 _proto._clear = function _clear() { 6440 [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { 6441 return node.classList.contains(ClassName$8.ACTIVE); 6442 }).forEach(function (node) { 6443 return node.classList.remove(ClassName$8.ACTIVE); 6444 }); 6445 } // Static 6446 ; 6447 6448 ScrollSpy._jQueryInterface = function _jQueryInterface(config) { 6449 return this.each(function () { 6450 var data = $(this).data(DATA_KEY$8); 6451 6452 var _config = typeof config === 'object' && config; 6453 6454 if (!data) { 6455 data = new ScrollSpy(this, _config); 6456 $(this).data(DATA_KEY$8, data); 6457 } 6458 6459 if (typeof config === 'string') { 6460 if (typeof data[config] === 'undefined') { 6461 throw new TypeError("No method named \"" + config + "\""); 6462 } 6463 6464 data[config](); 6465 } 6466 }); 6467 }; 6468 6469 _createClass(ScrollSpy, null, [{ 6470 key: "VERSION", 6471 get: function get() { 6472 return VERSION$8; 6473 } 6474 }, { 6475 key: "Default", 6476 get: function get() { 6477 return Default$6; 6478 } 6479 }]); 6480 6481 return ScrollSpy; 6482 }(); 6483 /** 6484 * ------------------------------------------------------------------------ 6485 * Data Api implementation 6486 * ------------------------------------------------------------------------ 6487 */ 6488 6489 6490 $(window).on(Event$8.LOAD_DATA_API, function () { 6491 var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY)); 6492 var scrollSpysLength = scrollSpys.length; 6493 6494 for (var i = scrollSpysLength; i--;) { 6495 var $spy = $(scrollSpys[i]); 6496 6497 ScrollSpy._jQueryInterface.call($spy, $spy.data()); 6498 } 6499 }); 6500 /** 6501 * ------------------------------------------------------------------------ 6502 * jQuery 6503 * ------------------------------------------------------------------------ 6504 */ 6505 6506 $.fn[NAME$8] = ScrollSpy._jQueryInterface; 6507 $.fn[NAME$8].Constructor = ScrollSpy; 6508 6509 $.fn[NAME$8].noConflict = function () { 6510 $.fn[NAME$8] = JQUERY_NO_CONFLICT$8; 6511 return ScrollSpy._jQueryInterface; 6512 }; 6513 6514 /** 6515 * ------------------------------------------------------------------------ 6516 * Constants 6517 * ------------------------------------------------------------------------ 6518 */ 6519 6520 var NAME$9 = 'tab'; 6521 var VERSION$9 = '4.3.1'; 6522 var DATA_KEY$9 = 'bs.tab'; 6523 var EVENT_KEY$9 = "." + DATA_KEY$9; 6524 var DATA_API_KEY$7 = '.data-api'; 6525 var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9]; 6526 var Event$9 = { 6527 HIDE: "hide" + EVENT_KEY$9, 6528 HIDDEN: "hidden" + EVENT_KEY$9, 6529 SHOW: "show" + EVENT_KEY$9, 6530 SHOWN: "shown" + EVENT_KEY$9, 6531 CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7 6532 }; 6533 var ClassName$9 = { 6534 DROPDOWN_MENU: 'dropdown-menu', 6535 ACTIVE: 'active', 6536 DISABLED: 'disabled', 6537 FADE: 'fade', 6538 SHOW: 'show' 6539 }; 6540 var Selector$9 = { 6541 DROPDOWN: '.dropdown', 6542 NAV_LIST_GROUP: '.nav, .list-group', 6543 ACTIVE: '.active', 6544 ACTIVE_UL: '> li > .active', 6545 DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', 6546 DROPDOWN_TOGGLE: '.dropdown-toggle', 6547 DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active' 6548 /** 6549 * ------------------------------------------------------------------------ 6550 * Class Definition 6551 * ------------------------------------------------------------------------ 6552 */ 6553 6554 }; 6555 6556 var Tab = 6557 /*#__PURE__*/ 6558 function () { 6559 function Tab(element) { 6560 this._element = element; 6561 } // Getters 6562 6563 6564 var _proto = Tab.prototype; 6565 6566 // Public 6567 _proto.show = function show() { 6568 var _this = this; 6569 6570 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) { 6571 return; 6572 } 6573 6574 var target; 6575 var previous; 6576 var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0]; 6577 var selector = Util.getSelectorFromElement(this._element); 6578 6579 if (listElement) { 6580 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE; 6581 previous = $.makeArray($(listElement).find(itemSelector)); 6582 previous = previous[previous.length - 1]; 6583 } 6584 6585 var hideEvent = $.Event(Event$9.HIDE, { 6586 relatedTarget: this._element 6587 }); 6588 var showEvent = $.Event(Event$9.SHOW, { 6589 relatedTarget: previous 6590 }); 6591 6592 if (previous) { 6593 $(previous).trigger(hideEvent); 6594 } 6595 6596 $(this._element).trigger(showEvent); 6597 6598 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 6599 return; 6600 } 6601 6602 if (selector) { 6603 target = document.querySelector(selector); 6604 } 6605 6606 this._activate(this._element, listElement); 6607 6608 var complete = function complete() { 6609 var hiddenEvent = $.Event(Event$9.HIDDEN, { 6610 relatedTarget: _this._element 6611 }); 6612 var shownEvent = $.Event(Event$9.SHOWN, { 6613 relatedTarget: previous 6614 }); 6615 $(previous).trigger(hiddenEvent); 6616 $(_this._element).trigger(shownEvent); 6617 }; 6618 6619 if (target) { 6620 this._activate(target, target.parentNode, complete); 6621 } else { 6622 complete(); 6623 } 6624 }; 6625 6626 _proto.dispose = function dispose() { 6627 $.removeData(this._element, DATA_KEY$9); 6628 this._element = null; 6629 } // Private 6630 ; 6631 6632 _proto._activate = function _activate(element, container, callback) { 6633 var _this2 = this; 6634 6635 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE); 6636 var active = activeElements[0]; 6637 var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE); 6638 6639 var complete = function complete() { 6640 return _this2._transitionComplete(element, active, callback); 6641 }; 6642 6643 if (active && isTransitioning) { 6644 var transitionDuration = Util.getTransitionDurationFromElement(active); 6645 $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 6646 } else { 6647 complete(); 6648 } 6649 }; 6650 6651 _proto._transitionComplete = function _transitionComplete(element, active, callback) { 6652 if (active) { 6653 $(active).removeClass(ClassName$9.ACTIVE);
6654 var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0]; 6655 6656 if (dropdownChild) { 6657 $(dropdownChild).removeClass(ClassName$9.ACTIVE); 6658 } 6659 6660 if (active.getAttribute('role') === 'tab') { 6661 active.setAttribute('aria-selected', false); 6662 } 6663 } 6664 6665 $(element).addClass(ClassName$9.ACTIVE); 6666 6667 if (element.getAttribute('role') === 'tab') { 6668 element.setAttribute('aria-selected', true); 6669 } 6670 6671 Util.reflow(element); 6672 6673 if (element.classList.contains(ClassName$9.FADE)) { 6674 element.classList.add(ClassName$9.SHOW); 6675 } 6676 6677 if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) { 6678 var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0]; 6679 6680 if (dropdownElement) { 6681 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE)); 6682 $(dropdownToggleList).addClass(ClassName$9.ACTIVE); 6683 } 6684 6685 element.setAttribute('aria-expanded', true); 6686 } 6687 6688 if (callback) { 6689 callback(); 6690 } 6691 } // Static 6692 ; 6693 6694 Tab._jQueryInterface = function _jQueryInterface(config) { 6695 return this.each(function () { 6696 var $this = $(this); 6697 var data = $this.data(DATA_KEY$9); 6698 6699 if (!data) { 6700 data = new Tab(this); 6701 $this.data(DATA_KEY$9, data); 6702 } 6703 6704 if (typeof config === 'string') { 6705 if (typeof data[config] === 'undefined') { 6706 throw new TypeError("No method named \"" + config + "\""); 6707 } 6708 6709 data[config](); 6710 } 6711 }); 6712 }; 6713 6714 _createClass(Tab, null, [{ 6715 key: "VERSION", 6716 get: function get() { 6717 return VERSION$9; 6718 } 6719 }]); 6720 6721 return Tab; 6722 }(); 6723 /** 6724 * ------------------------------------------------------------------------ 6725 * Data Api implementation 6726 * ------------------------------------------------------------------------ 6727 */ 6728 6729 6730 $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) { 6731 event.preventDefault(); 6732 6733 Tab._jQueryInterface.call($(this), 'show'); 6734 }); 6735 /** 6736 * ------------------------------------------------------------------------ 6737 * jQuery 6738 * ------------------------------------------------------------------------ 6739 */ 6740 6741 $.fn[NAME$9] = Tab._jQueryInterface; 6742 $.fn[NAME$9].Constructor = Tab; 6743 6744 $.fn[NAME$9].noConflict = function () { 6745 $.fn[NAME$9] = JQUERY_NO_CONFLICT$9; 6746 return Tab._jQueryInterface; 6747 }; 6748 6749 /** 6750 * ------------------------------------------------------------------------ 6751 * Constants 6752 * ------------------------------------------------------------------------ 6753 */ 6754 6755 var NAME$a = 'toast'; 6756 var VERSION$a = '4.3.1'; 6757 var DATA_KEY$a = 'bs.toast'; 6758 var EVENT_KEY$a = "." + DATA_KEY$a; 6759 var JQUERY_NO_CONFLICT$a = $.fn[NAME$a]; 6760 var Event$a = { 6761 CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a, 6762 HIDE: "hide" + EVENT_KEY$a, 6763 HIDDEN: "hidden" + EVENT_KEY$a, 6764 SHOW: "show" + EVENT_KEY$a, 6765 SHOWN: "shown" + EVENT_KEY$a 6766 }; 6767 var ClassName$a = { 6768 FADE: 'fade', 6769 HIDE: 'hide', 6770 SHOW: 'show', 6771 SHOWING: 'showing' 6772 }; 6773 var DefaultType$7 = { 6774 animation: 'boolean', 6775 autohide: 'boolean', 6776 delay: 'number' 6777 }; 6778 var Default$7 = { 6779 animation: true, 6780 autohide: true, 6781 delay: 500 6782 }; 6783 var Selector$a = { 6784 DATA_DISMISS: '[data-dismiss="toast"]' 6785 /** 6786 * ------------------------------------------------------------------------ 6787 * Class Definition 6788 * ------------------------------------------------------------------------ 6789 */ 6790 6791 }; 6792 6793 var Toast = 6794 /*#__PURE__*/ 6795 function () { 6796 function Toast(element, config) { 6797 this._element = element; 6798 this._config = this._getConfig(config); 6799 this._timeout = null; 6800 6801 this._setListeners(); 6802 } // Getters 6803 6804 6805 var _proto = Toast.prototype; 6806 6807 // Public 6808 _proto.show = function show() { 6809 var _this = this; 6810 6811 $(this._element).trigger(Event$a.SHOW); 6812 6813 if (this._config.animation) { 6814 this._element.classList.add(ClassName$a.FADE); 6815 } 6816 6817 var complete = function complete() { 6818 _this._element.classList.remove(ClassName$a.SHOWING); 6819 6820 _this._element.classList.add(ClassName$a.SHOW); 6821 6822 $(_this._element).trigger(Event$a.SHOWN); 6823 6824 if (_this._config.autohide) { 6825 _this.hide(); 6826 } 6827 }; 6828 6829 this._element.classList.remove(ClassName$a.HIDE); 6830 6831 this._element.classList.add(ClassName$a.SHOWING); 6832 6833 if (this._config.animation) { 6834 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 6835 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 6836 } else { 6837 complete(); 6838 } 6839 }; 6840 6841 _proto.hide = function hide(withoutTimeout) { 6842 var _this2 = this; 6843 6844 if (!this._element.classList.contains(ClassName$a.SHOW)) { 6845 return; 6846 } 6847 6848 $(this._element).trigger(Event$a.HIDE); 6849 6850 if (withoutTimeout) { 6851 this._close(); 6852 } else { 6853 this._timeout = setTimeout(function () { 6854 _this2._close(); 6855 }, this._config.delay); 6856 } 6857 }; 6858 6859 _proto.dispose = function dispose() { 6860 clearTimeout(this._timeout); 6861 this._timeout = null; 6862 6863 if (this._element.classList.contains(ClassName$a.SHOW)) { 6864 this._element.classList.remove(ClassName$a.SHOW); 6865 } 6866 6867 $(this._element).off(Event$a.CLICK_DISMISS); 6868 $.removeData(this._element, DATA_KEY$a); 6869 this._element = null; 6870 this._config = null; 6871 } // Private 6872 ; 6873 6874 _proto._getConfig = function _getConfig(config) { 6875 config = _objectSpread({}, Default$7, $(this._element).data(), typeof config === 'object' && config ? config : {}); 6876 Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType); 6877 return config; 6878 }; 6879 6880 _proto._setListeners = function _setListeners() { 6881 var _this3 = this; 6882 6883 $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () { 6884 return _this3.hide(true); 6885 }); 6886 }; 6887 6888 _proto._close = function _close() { 6889 var _this4 = this; 6890 6891 var complete = function complete() { 6892 _this4._element.classList.add(ClassName$a.HIDE); 6893 6894 $(_this4._element).trigger(Event$a.HIDDEN); 6895 }; 6896 6897 this._element.classList.remove(ClassName$a.SHOW); 6898 6899 if (this._config.animation) { 6900 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 6901 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 6902 } else { 6903 complete(); 6904 } 6905 } // Static 6906 ; 6907 6908 Toast._jQueryInterface = function _jQueryInterface(config) { 6909 return this.each(function () { 6910 var $element = $(this); 6911 var data = $element.data(DATA_KEY$a); 6912 6913 var _config = typeof config === 'object' && config; 6914 6915 if (!data) { 6916 data = new Toast(this, _config); 6917 $element.data(DATA_KEY$a, data); 6918 } 6919 6920 if (typeof config === 'string') { 6921 if (typeof data[config] === 'undefined') {
6922 throw new TypeError("No method named \"" + config + "\""); 6923 } 6924 6925 data[config](this); 6926 } 6927 }); 6928 }; 6929 6930 _createClass(Toast, null, [{ 6931 key: "VERSION", 6932 get: function get() { 6933 return VERSION$a; 6934 } 6935 }, { 6936 key: "DefaultType", 6937 get: function get() { 6938 return DefaultType$7; 6939 } 6940 }, { 6941 key: "Default", 6942 get: function get() { 6943 return Default$7; 6944 } 6945 }]); 6946 6947 return Toast; 6948 }(); 6949 /** 6950 * ------------------------------------------------------------------------ 6951 * jQuery 6952 * ------------------------------------------------------------------------ 6953 */ 6954 6955 6956 $.fn[NAME$a] = Toast._jQueryInterface; 6957 $.fn[NAME$a].Constructor = Toast; 6958 6959 $.fn[NAME$a].noConflict = function () { 6960 $.fn[NAME$a] = JQUERY_NO_CONFLICT$a; 6961 return Toast._jQueryInterface; 6962 }; 6963 6964 /** 6965 * -------------------------------------------------------------------------- 6966 * Bootstrap (v4.3.1): index.js 6967 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6968 * -------------------------------------------------------------------------- 6969 */ 6970 6971 (function () { 6972 if (typeof $ === 'undefined') { 6973 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); 6974 } 6975 6976 var version = $.fn.jquery.split(' ')[0].split('.'); 6977 var minMajor = 1; 6978 var ltMajor = 2; 6979 var minMinor = 9; 6980 var minPatch = 1; 6981 var maxMajor = 4; 6982 6983 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { 6984 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); 6985 } 6986 })(); 6987 6988 exports.Util = Util; 6989 exports.Alert = Alert; 6990 exports.Button = Button; 6991 exports.Carousel = Carousel; 6992 exports.Collapse = Collapse; 6993 exports.Dropdown = Dropdown; 6994 exports.Modal = Modal; 6995 exports.Popover = Popover; 6996 exports.Scrollspy = ScrollSpy; 6997 exports.Tab = Tab; 6998 exports.Toast = Toast; 6999 exports.Tooltip = Tooltip; 7000 7001 Object.defineProperty(exports, '__esModule', { value: true }); 7002 7003})); 7004//# sourceMappingURL=bootstrap.bundle.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.