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