/*!
 * Bootstrap v4.0.0 (https://getbootstrap.com)
 * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
(function (global, factory) {
  typeof exports === "object" && typeof module !== "undefined"
    ? factory(exports, require("jquery"), require("popper.js"))
    : typeof define === "function" && define.amd
    ? define(["exports", "jquery", "popper.js"], factory)
    : factory((global.bootstrap = {}), global.jQuery, global.Popper);
})(this, function (exports, $, Popper) {
  "use strict";

  $ = $ && $.hasOwnProperty("default") ? $["default"] : $;
  Popper =
    Popper && Popper.hasOwnProperty("default") ? Popper["default"] : Popper;

  function _defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }

  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties(Constructor, staticProps);
    return Constructor;
  }

  function _extends() {
    _extends =
      Object.assign ||
      function (target) {
        for (var i = 1; i < arguments.length; i++) {
          var source = arguments[i];

          for (var key in source) {
            if (Object.prototype.hasOwnProperty.call(source, key)) {
              target[key] = source[key];
            }
          }
        }

        return target;
      };

    return _extends.apply(this, arguments);
  }

  function _inheritsLoose(subClass, superClass) {
    subClass.prototype = Object.create(superClass.prototype);
    subClass.prototype.constructor = subClass;
    subClass.__proto__ = superClass;
  }

  var Util = (function ($$$1) {
    /**
     * ------------------------------------------------------------------------
     * Private TransitionEnd Helpers
     * ------------------------------------------------------------------------
     */
    var transition = false;
    var MAX_UID = 1000000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)

    function toType(obj) {
      return {}.toString
        .call(obj)
        .match(/\s([a-zA-Z]+)/)[1]
        .toLowerCase();
    }

    function getSpecialTransitionEndEvent() {
      return {
        bindType: transition.end,
        delegateType: transition.end,
        handle: function handle(event) {
          if ($$$1(event.target).is(this)) {
            return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
          }

          return undefined; // eslint-disable-line no-undefined
        },
      };
    }

    function transitionEndTest() {
      if (typeof window !== "undefined" && window.QUnit) {
        return false;
      }

      return {
        end: "transitionend",
      };
    }

    function transitionEndEmulator(duration) {
      var _this = this;

      var called = false;
      $$$1(this).one(Util.TRANSITION_END, function () {
        called = true;
      });
      setTimeout(function () {
        if (!called) {
          Util.triggerTransitionEnd(_this);
        }
      }, duration);
      return this;
    }

    function setTransitionEndSupport() {
      transition = transitionEndTest();
      $$$1.fn.emulateTransitionEnd = transitionEndEmulator;

      if (Util.supportsTransitionEnd()) {
        $$$1.event.special[Util.TRANSITION_END] =
          getSpecialTransitionEndEvent();
      }
    }

    function escapeId(selector) {
      // We escape IDs in case of special selectors (selector = '#myId:something')
      // $.escapeSelector does not exist in jQuery < 3
      selector =
        typeof $$$1.escapeSelector === "function"
          ? $$$1.escapeSelector(selector).substr(1)
          : selector.replace(/(:|\.|\[|\]|,|=|@)/g, "\\$1");
      return selector;
    }
    /**
     * --------------------------------------------------------------------------
     * Public Util Api
     * --------------------------------------------------------------------------
     */

    var Util = {
      TRANSITION_END: "bsTransitionEnd",
      getUID: function getUID(prefix) {
        do {
          // eslint-disable-next-line no-bitwise
          prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
        } while (document.getElementById(prefix));

        return prefix;
      },
      getSelectorFromElement: function getSelectorFromElement(element) {
        var selector = element.getAttribute("data-target");

        if (!selector || selector === "#") {
          selector = element.getAttribute("href") || "";
        } // If it's an ID

        if (selector.charAt(0) === "#") {
          selector = escapeId(selector);
        }

        try {
          var $selector = $$$1(document).find(selector);
          return $selector.length > 0 ? selector : null;
        } catch (err) {
          return null;
        }
      },
      reflow: function reflow(element) {
        return element.offsetHeight;
      },
      triggerTransitionEnd: function triggerTransitionEnd(element) {
        $$$1(element).trigger(transition.end);
      },
      supportsTransitionEnd: function supportsTransitionEnd() {
        return Boolean(transition);
      },
      isElement: function isElement(obj) {
        return (obj[0] || obj).nodeType;
      },
      typeCheckConfig: function typeCheckConfig(
        componentName,
        config,
        configTypes
      ) {
        for (var property in configTypes) {
          if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
            var expectedTypes = configTypes[property];
            var value = config[property];
            var valueType =
              value && Util.isElement(value) ? "element" : toType(value);

            if (!new RegExp(expectedTypes).test(valueType)) {
              throw new Error(
                componentName.toUpperCase() +
                  ": " +
                  ('Option "' +
                    property +
                    '" provided type "' +
                    valueType +
                    '" ') +
                  ('but expected type "' + expectedTypes + '".')
              );
            }
          }
        }
      },
    };
    setTransitionEndSupport();
    return Util;
  })($);

  var Tab = (function ($$$1) {
    /**
     * ------------------------------------------------------------------------
     * Constants
     * ------------------------------------------------------------------------
     */
    var NAME = "tab";
    var VERSION = "4.0.0";
    var DATA_KEY = "bs.tab";
    var EVENT_KEY = "." + DATA_KEY;
    var DATA_API_KEY = ".data-api";
    var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
    var TRANSITION_DURATION = 150;
    var Event = {
      HIDE: "hide" + EVENT_KEY,
      HIDDEN: "hidden" + EVENT_KEY,
      SHOW: "show" + EVENT_KEY,
      SHOWN: "shown" + EVENT_KEY,
      CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
    };
    var ClassName = {
      DROPDOWN_MENU: "dropdown-menu",
      ACTIVE: "active",
      DISABLED: "disabled",
      FADE: "fade",
      SHOW: "show",
    };
    var Selector = {
      DROPDOWN: ".dropdown",
      NAV_LIST_GROUP: ".nav, .list-group",
      ACTIVE: ".active",
      ACTIVE_UL: "> li > .active",
      DATA_TOGGLE:
        '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
      DROPDOWN_TOGGLE: ".dropdown-toggle",
      DROPDOWN_ACTIVE_CHILD: "> .dropdown-menu .active",
      /**
       * ------------------------------------------------------------------------
       * Class Definition
       * ------------------------------------------------------------------------
       */
    };

    var Tab =
      /*#__PURE__*/
      (function () {
        function Tab(element) {
          this._element = element;
        } // Getters

        var _proto = Tab.prototype;

        // Public
        _proto.show = function show() {
          var _this = this;

          if (
            (this._element.parentNode &&
              this._element.parentNode.nodeType === Node.ELEMENT_NODE &&
              $$$1(this._element).hasClass(ClassName.ACTIVE)) ||
            $$$1(this._element).hasClass(ClassName.DISABLED)
          ) {
            return;
          }

          var target;
          var previous;
          var listElement = $$$1(this._element).closest(
            Selector.NAV_LIST_GROUP
          )[0];
          var selector = Util.getSelectorFromElement(this._element);

          if (listElement) {
            var itemSelector =
              listElement.nodeName === "UL"
                ? Selector.ACTIVE_UL
                : Selector.ACTIVE;
            previous = $$$1.makeArray($$$1(listElement).find(itemSelector));
            previous = previous[previous.length - 1];
          }

          var hideEvent = $$$1.Event(Event.HIDE, {
            relatedTarget: this._element,
          });
          var showEvent = $$$1.Event(Event.SHOW, {
            relatedTarget: previous,
          });

          if (previous) {
            $$$1(previous).trigger(hideEvent);
          }

          $$$1(this._element).trigger(showEvent);

          if (
            showEvent.isDefaultPrevented() ||
            hideEvent.isDefaultPrevented()
          ) {
            return;
          }

          if (selector) {
            target = $$$1(selector)[0];
          }

          this._activate(this._element, listElement);

          var complete = function complete() {
            var hiddenEvent = $$$1.Event(Event.HIDDEN, {
              relatedTarget: _this._element,
            });
            var shownEvent = $$$1.Event(Event.SHOWN, {
              relatedTarget: previous,
            });
            $$$1(previous).trigger(hiddenEvent);
            $$$1(_this._element).trigger(shownEvent);
          };

          if (target) {
            this._activate(target, target.parentNode, complete);
          } else {
            complete();
          }
        };

        _proto.dispose = function dispose() {
          $$$1.removeData(this._element, DATA_KEY);
          this._element = null;
        }; // Private

        _proto._activate = function _activate(element, container, callback) {
          var _this2 = this;

          var activeElements;

          if (container.nodeName === "UL") {
            activeElements = $$$1(container).find(Selector.ACTIVE_UL);
          } else {
            activeElements = $$$1(container).children(Selector.ACTIVE);
          }

          var active = activeElements[0];
          var isTransitioning =
            callback &&
            Util.supportsTransitionEnd() &&
            active &&
            $$$1(active).hasClass(ClassName.FADE);

          var complete = function complete() {
            return _this2._transitionComplete(element, active, callback);
          };

          if (active && isTransitioning) {
            $$$1(active)
              .one(Util.TRANSITION_END, complete)
              .emulateTransitionEnd(TRANSITION_DURATION);
          } else {
            complete();
          }
        };

        _proto._transitionComplete = function _transitionComplete(
          element,
          active,
          callback
        ) {
          if (active) {
            $$$1(active).removeClass(ClassName.SHOW + " " + ClassName.ACTIVE);
            var dropdownChild = $$$1(active.parentNode).find(
              Selector.DROPDOWN_ACTIVE_CHILD
            )[0];

            if (dropdownChild) {
              $$$1(dropdownChild).removeClass(ClassName.ACTIVE);
            }

            if (active.getAttribute("role") === "tab") {
              active.setAttribute("aria-selected", false);
            }
          }

          $$$1(element).addClass(ClassName.ACTIVE);

          if (element.getAttribute("role") === "tab") {
            element.setAttribute("aria-selected", true);
          }

          Util.reflow(element);
          $$$1(element).addClass(ClassName.SHOW);

          if (
            element.parentNode &&
            $$$1(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)
          ) {
            var dropdownElement = $$$1(element).closest(Selector.DROPDOWN)[0];

            if (dropdownElement) {
              $$$1(dropdownElement)
                .find(Selector.DROPDOWN_TOGGLE)
                .addClass(ClassName.ACTIVE);
            }

            element.setAttribute("aria-expanded", true);
          }

          if (callback) {
            callback();
          }
        }; // Static

        Tab._jQueryInterface = function _jQueryInterface(config) {
          return this.each(function () {
            var $this = $$$1(this);
            var data = $this.data(DATA_KEY);

            if (!data) {
              data = new Tab(this);
              $this.data(DATA_KEY, data);
            }

            if (typeof config === "string") {
              if (typeof data[config] === "undefined") {
                throw new TypeError('No method named "' + config + '"');
              }

              data[config]();
            }
          });
        };

        _createClass(Tab, null, [
          {
            key: "VERSION",
            get: function get() {
              return VERSION;
            },
          },
        ]);
        return Tab;
      })();
    /**
     * ------------------------------------------------------------------------
     * Data Api implementation
     * ------------------------------------------------------------------------
     */

    $$$1(document).on(
      Event.CLICK_DATA_API,
      Selector.DATA_TOGGLE,
      function (event) {
        event.preventDefault();

        Tab._jQueryInterface.call($$$1(this), "show");
      }
    );
    /**
     * ------------------------------------------------------------------------
     * jQuery
     * ------------------------------------------------------------------------
     */

    $$$1.fn[NAME] = Tab._jQueryInterface;
    $$$1.fn[NAME].Constructor = Tab;

    $$$1.fn[NAME].noConflict = function () {
      $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
      return Tab._jQueryInterface;
    };

    return Tab;
  })($);

  (function ($$$1) {
    if (typeof $$$1 === "undefined") {
      throw new TypeError(
        "Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript."
      );
    }

    var version = $$$1.fn.jquery.split(" ")[0].split(".");
    var minMajor = 1;
    var ltMajor = 2;
    var minMinor = 9;
    var minPatch = 1;
    var maxMajor = 4;

    if (
      (version[0] < ltMajor && version[1] < minMinor) ||
      (version[0] === minMajor &&
        version[1] === minMinor &&
        version[2] < minPatch) ||
      version[0] >= maxMajor
    ) {
      throw new Error(
        "Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0"
      );
    }
  })($);

  exports.Tab = Tab;

  Object.defineProperty(exports, "__esModule", { value: true });
});
