/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./src/js/app.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./node_modules/popper.js/dist/esm/popper.js": /*!***************************************************!*\ !*** ./node_modules/popper.js/dist/esm/popper.js ***! \***************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* WEBPACK VAR INJECTION */(function(global) {/**! * @fileOverview Kickass library to create and place poppers near their reference elements. * @version 1.16.1 * @license * Copyright (c) 2016 Federico Zivolo and contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; var timeoutDuration = function () { var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { return 1; } } return 0; }(); function microtaskDebounce(fn) { var called = false; return function () { if (called) { return; } called = true; window.Promise.resolve().then(function () { called = false; fn(); }); }; } function taskDebounce(fn) { var scheduled = false; return function () { if (!scheduled) { scheduled = true; setTimeout(function () { scheduled = false; fn(); }, timeoutDuration); } }; } var supportsMicroTasks = isBrowser && window.Promise; /** * Create a debounced version of a method, that's asynchronously deferred * but called in the minimum time possible. * * @method * @memberof Popper.Utils * @argument {Function} fn * @returns {Function} */ var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; /** * Check if the given variable is a function * @method * @memberof Popper.Utils * @argument {Any} functionToCheck - variable to check * @returns {Boolean} answer to: is a function? */ function isFunction(functionToCheck) { var getType = {}; return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; } /** * Get CSS computed property of the given element * @method * @memberof Popper.Utils * @argument {Eement} element * @argument {String} property */ function getStyleComputedProperty(element, property) { if (element.nodeType !== 1) { return []; } // NOTE: 1 DOM access here var window = element.ownerDocument.defaultView; var css = window.getComputedStyle(element, null); return property ? css[property] : css; } /** * Returns the parentNode or the host of the element * @method * @memberof Popper.Utils * @argument {Element} element * @returns {Element} parent */ function getParentNode(element) { if (element.nodeName === 'HTML') { return element; } return element.parentNode || element.host; } /** * Returns the scrolling parent of the given element * @method * @memberof Popper.Utils * @argument {Element} element * @returns {Element} scroll parent */ function getScrollParent(element) { // Return body, `getScroll` will take care to get the correct `scrollTop` from it if (!element) { return document.body; } switch (element.nodeName) { case 'HTML': case 'BODY': return element.ownerDocument.body; case '#document': return element.body; } // Firefox want us to check `-x` and `-y` variations as well var _getStyleComputedProp = getStyleComputedProperty(element), overflow = _getStyleComputedProp.overflow, overflowX = _getStyleComputedProp.overflowX, overflowY = _getStyleComputedProp.overflowY; if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { return element; } return getScrollParent(getParentNode(element)); } /** * Returns the reference node of the reference object, or the reference object itself. * @method * @memberof Popper.Utils * @param {Element|Object} reference - the reference element (the popper will be relative to this) * @returns {Element} parent */ function getReferenceNode(reference) { return reference && reference.referenceNode ? reference.referenceNode : reference; } var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); /** * Determines if the browser is Internet Explorer * @method * @memberof Popper.Utils * @param {Number} version to check * @returns {Boolean} isIE */ function isIE(version) { if (version === 11) { return isIE11; } if (version === 10) { return isIE10; } return isIE11 || isIE10; } /** * Returns the offset parent of the given element * @method * @memberof Popper.Utils * @argument {Element} element * @returns {Element} offset parent */ function getOffsetParent(element) { if (!element) { return document.documentElement; } var noOffsetParent = isIE(10) ? document.body : null; // NOTE: 1 DOM access here var offsetParent = element.offsetParent || null; // Skip hidden elements which don't have an offsetParent while (offsetParent === noOffsetParent && element.nextElementSibling) { offsetParent = (element = element.nextElementSibling).offsetParent; } var nodeName = offsetParent && offsetParent.nodeName; if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { return element ? element.ownerDocument.documentElement : document.documentElement; } // .offsetParent will return the closest TH, TD or TABLE in case // no offsetParent is present, I hate this job... if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { return getOffsetParent(offsetParent); } return offsetParent; } function isOffsetContainer(element) { var nodeName = element.nodeName; if (nodeName === 'BODY') { return false; } return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; } /** * Finds the root node (document, shadowDOM root) of the given element * @method * @memberof Popper.Utils * @argument {Element} node * @returns {Element} root node */ function getRoot(node) { if (node.parentNode !== null) { return getRoot(node.parentNode); } return node; } /** * Finds the offset parent common to the two provided nodes * @method * @memberof Popper.Utils * @argument {Element} element1 * @argument {Element} element2 * @returns {Element} common offset parent */ function findCommonOffsetParent(element1, element2) { // This check is needed to avoid errors in case one of the elements isn't defined for any reason if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { return document.documentElement; } // Here we make sure to give as "start" the element that comes first in the DOM var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; var start = order ? element1 : element2; var end = order ? element2 : element1; // Get common ancestor container var range = document.createRange(); range.setStart(start, 0); range.setEnd(end, 0); var commonAncestorContainer = range.commonAncestorContainer; // Both nodes are inside #document if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { if (isOffsetContainer(commonAncestorContainer)) { return commonAncestorContainer; } return getOffsetParent(commonAncestorContainer); } // one of the nodes is inside shadowDOM, find which one var element1root = getRoot(element1); if (element1root.host) { return findCommonOffsetParent(element1root.host, element2); } else { return findCommonOffsetParent(element1, getRoot(element2).host); } } /** * Gets the scroll value of the given element in the given side (top and left) * @method * @memberof Popper.Utils * @argument {Element} element * @argument {String} side `top` or `left` * @returns {number} amount of scrolled pixels */ function getScroll(element) { var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; var nodeName = element.nodeName; if (nodeName === 'BODY' || nodeName === 'HTML') { var html = element.ownerDocument.documentElement; var scrollingElement = element.ownerDocument.scrollingElement || html; return scrollingElement[upperSide]; } return element[upperSide]; } /* * Sum or subtract the element scroll values (left and top) from a given rect object * @method * @memberof Popper.Utils * @param {Object} rect - Rect object you want to change * @param {HTMLElement} element - The element from the function reads the scroll values * @param {Boolean} subtract - set to true if you want to subtract the scroll values * @return {Object} rect - The modifier rect object */ function includeScroll(rect, element) { var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var scrollTop = getScroll(element, 'top'); var scrollLeft = getScroll(element, 'left'); var modifier = subtract ? -1 : 1; rect.top += scrollTop * modifier; rect.bottom += scrollTop * modifier; rect.left += scrollLeft * modifier; rect.right += scrollLeft * modifier; return rect; } /* * Helper to detect borders of a given element * @method * @memberof Popper.Utils * @param {CSSStyleDeclaration} styles * Result of `getStyleComputedProperty` on the given element * @param {String} axis - `x` or `y` * @return {number} borders - The borders size of the given axis */ function getBordersSize(styles, axis) { var sideA = axis === 'x' ? 'Left' : 'Top'; var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); } function getSize(axis, body, html, computedStyle) { return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); } function getWindowSizes(document) { var body = document.body; var html = document.documentElement; var computedStyle = isIE(10) && getComputedStyle(html); return { height: getSize('Height', body, html, computedStyle), width: getSize('Width', body, html, computedStyle) }; } var classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var defineProperty = function (obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }; var _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; }; /** * Given element offsets, generate an output similar to getBoundingClientRect * @method * @memberof Popper.Utils * @argument {Object} offsets * @returns {Object} ClientRect like output */ function getClientRect(offsets) { return _extends({}, offsets, { right: offsets.left + offsets.width, bottom: offsets.top + offsets.height }); } /** * Get bounding client rect of given element * @method * @memberof Popper.Utils * @param {HTMLElement} element * @return {Object} client rect */ function getBoundingClientRect(element) { var rect = {}; // IE10 10 FIX: Please, don't ask, the element isn't // considered in DOM in some circumstances... // This isn't reproducible in IE10 compatibility mode of IE11 try { if (isIE(10)) { rect = element.getBoundingClientRect(); var scrollTop = getScroll(element, 'top'); var scrollLeft = getScroll(element, 'left'); rect.top += scrollTop; rect.left += scrollLeft; rect.bottom += scrollTop; rect.right += scrollLeft; } else { rect = element.getBoundingClientRect(); } } catch (e) {} var result = { left: rect.left, top: rect.top, width: rect.right - rect.left, height: rect.bottom - rect.top }; // subtract scrollbar size from sizes var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; var width = sizes.width || element.clientWidth || result.width; var height = sizes.height || element.clientHeight || result.height; var horizScrollbar = element.offsetWidth - width; var vertScrollbar = element.offsetHeight - height; // if an hypothetical scrollbar is detected, we must be sure it's not a `border` // we make this check conditional for performance reasons if (horizScrollbar || vertScrollbar) { var styles = getStyleComputedProperty(element); horizScrollbar -= getBordersSize(styles, 'x'); vertScrollbar -= getBordersSize(styles, 'y'); result.width -= horizScrollbar; result.height -= vertScrollbar; } return getClientRect(result); } function getOffsetRectRelativeToArbitraryNode(children, parent) { var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var isIE10 = isIE(10); var isHTML = parent.nodeName === 'HTML'; var childrenRect = getBoundingClientRect(children); var parentRect = getBoundingClientRect(parent); var scrollParent = getScrollParent(children); var styles = getStyleComputedProperty(parent); var borderTopWidth = parseFloat(styles.borderTopWidth); var borderLeftWidth = parseFloat(styles.borderLeftWidth); // In cases where the parent is fixed, we must ignore negative scroll in offset calc if (fixedPosition && isHTML) { parentRect.top = Math.max(parentRect.top, 0); parentRect.left = Math.max(parentRect.left, 0); } var offsets = getClientRect({ top: childrenRect.top - parentRect.top - borderTopWidth, left: childrenRect.left - parentRect.left - borderLeftWidth, width: childrenRect.width, height: childrenRect.height }); offsets.marginTop = 0; offsets.marginLeft = 0; // Subtract margins of documentElement in case it's being used as parent // we do this only on HTML because it's the only element that behaves // differently when margins are applied to it. The margins are included in // the box of the documentElement, in the other cases not. if (!isIE10 && isHTML) { var marginTop = parseFloat(styles.marginTop); var marginLeft = parseFloat(styles.marginLeft); offsets.top -= borderTopWidth - marginTop; offsets.bottom -= borderTopWidth - marginTop; offsets.left -= borderLeftWidth - marginLeft; offsets.right -= borderLeftWidth - marginLeft; // Attach marginTop and marginLeft because in some circumstances we may need them offsets.marginTop = marginTop; offsets.marginLeft = marginLeft; } if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { offsets = includeScroll(offsets, parent); } return offsets; } function getViewportOffsetRectRelativeToArtbitraryNode(element) { var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var html = element.ownerDocument.documentElement; var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); var width = Math.max(html.clientWidth, window.innerWidth || 0); var height = Math.max(html.clientHeight, window.innerHeight || 0); var scrollTop = !excludeScroll ? getScroll(html) : 0; var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; var offset = { top: scrollTop - relativeOffset.top + relativeOffset.marginTop, left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, width: width, height: height }; return getClientRect(offset); } /** * Check if the given element is fixed or is inside a fixed parent * @method * @memberof Popper.Utils * @argument {Element} element * @argument {Element} customContainer * @returns {Boolean} answer to "isFixed?" */ function isFixed(element) { var nodeName = element.nodeName; if (nodeName === 'BODY' || nodeName === 'HTML') { return false; } if (getStyleComputedProperty(element, 'position') === 'fixed') { return true; } var parentNode = getParentNode(element); if (!parentNode) { return false; } return isFixed(parentNode); } /** * Finds the first parent of an element that has a transformed property defined * @method * @memberof Popper.Utils * @argument {Element} element * @returns {Element} first transformed parent or documentElement */ function getFixedPositionOffsetParent(element) { // This check is needed to avoid errors in case one of the elements isn't defined for any reason if (!element || !element.parentElement || isIE()) { return document.documentElement; } var el = element.parentElement; while (el && getStyleComputedProperty(el, 'transform') === 'none') { el = el.parentElement; } return el || document.documentElement; } /** * Computed the boundaries limits and return them * @method * @memberof Popper.Utils * @param {HTMLElement} popper * @param {HTMLElement} reference * @param {number} padding * @param {HTMLElement} boundariesElement - Element used to define the boundaries * @param {Boolean} fixedPosition - Is in fixed position mode * @returns {Object} Coordinates of the boundaries */ function getBoundaries(popper, reference, padding, boundariesElement) { var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; // NOTE: 1 DOM access here var boundaries = { top: 0, left: 0 }; var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); // Handle viewport case if (boundariesElement === 'viewport') { boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); } else { // Handle other cases based on DOM element used as boundaries var boundariesNode = void 0; if (boundariesElement === 'scrollParent') { boundariesNode = getScrollParent(getParentNode(reference)); if (boundariesNode.nodeName === 'BODY') { boundariesNode = popper.ownerDocument.documentElement; } } else if (boundariesElement === 'window') { boundariesNode = popper.ownerDocument.documentElement; } else { boundariesNode = boundariesElement; } var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); // In case of HTML, we need a different computation if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { var _getWindowSizes = getWindowSizes(popper.ownerDocument), height = _getWindowSizes.height, width = _getWindowSizes.width; boundaries.top += offsets.top - offsets.marginTop; boundaries.bottom = height + offsets.top; boundaries.left += offsets.left - offsets.marginLeft; boundaries.right = width + offsets.left; } else { // for all the other DOM elements, this one is good boundaries = offsets; } } // Add paddings padding = padding || 0; var isPaddingNumber = typeof padding === 'number'; boundaries.left += isPaddingNumber ? padding : padding.left || 0; boundaries.top += isPaddingNumber ? padding : padding.top || 0; boundaries.right -= isPaddingNumber ? padding : padding.right || 0; boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; return boundaries; } function getArea(_ref) { var width = _ref.width, height = _ref.height; return width * height; } /** * Utility used to transform the `auto` placement to the placement with more * available space. * @method * @memberof Popper.Utils * @argument {Object} data - The data object generated by update method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; if (placement.indexOf('auto') === -1) { return placement; } var boundaries = getBoundaries(popper, reference, padding, boundariesElement); var rects = { top: { width: boundaries.width, height: refRect.top - boundaries.top }, right: { width: boundaries.right - refRect.right, height: boundaries.height }, bottom: { width: boundaries.width, height: boundaries.bottom - refRect.bottom }, left: { width: refRect.left - boundaries.left, height: boundaries.height } }; var sortedAreas = Object.keys(rects).map(function (key) { return _extends({ key: key }, rects[key], { area: getArea(rects[key]) }); }).sort(function (a, b) { return b.area - a.area; }); var filteredAreas = sortedAreas.filter(function (_ref2) { var width = _ref2.width, height = _ref2.height; return width >= popper.clientWidth && height >= popper.clientHeight; }); var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; var variation = placement.split('-')[1]; return computedPlacement + (variation ? '-' + variation : ''); } /** * Get offsets to the reference element * @method * @memberof Popper.Utils * @param {Object} state * @param {Element} popper - the popper element * @param {Element} reference - the reference element (the popper will be relative to this) * @param {Element} fixedPosition - is in fixed position mode * @returns {Object} An object containing the offsets which will be applied to the popper */ function getReferenceOffsets(state, popper, reference) { var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); } /** * Get the outer sizes of the given element (offset size + margins) * @method * @memberof Popper.Utils * @argument {Element} element * @returns {Object} object containing width and height properties */ function getOuterSizes(element) { var window = element.ownerDocument.defaultView; var styles = window.getComputedStyle(element); var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); var result = { width: element.offsetWidth + y, height: element.offsetHeight + x }; return result; } /** * Get the opposite placement of the given one * @method * @memberof Popper.Utils * @argument {String} placement * @returns {String} flipped placement */ function getOppositePlacement(placement) { var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; return placement.replace(/left|right|bottom|top/g, function (matched) { return hash[matched]; }); } /** * Get offsets to the popper * @method * @memberof Popper.Utils * @param {Object} position - CSS position the Popper will get applied * @param {HTMLElement} popper - the popper element * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) * @param {String} placement - one of the valid placement options * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper */ function getPopperOffsets(popper, referenceOffsets, placement) { placement = placement.split('-')[0]; // Get popper node sizes var popperRect = getOuterSizes(popper); // Add position, width and height to our offsets object var popperOffsets = { width: popperRect.width, height: popperRect.height }; // depending by the popper placement we have to compute its offsets slightly differently var isHoriz = ['right', 'left'].indexOf(placement) !== -1; var mainSide = isHoriz ? 'top' : 'left'; var secondarySide = isHoriz ? 'left' : 'top'; var measurement = isHoriz ? 'height' : 'width'; var secondaryMeasurement = !isHoriz ? 'height' : 'width'; popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; if (placement === secondarySide) { popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; } else { popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; } return popperOffsets; } /** * Mimics the `find` method of Array * @method * @memberof Popper.Utils * @argument {Array} arr * @argument prop * @argument value * @returns index or -1 */ function find(arr, check) { // use native find if supported if (Array.prototype.find) { return arr.find(check); } // use `filter` to obtain the same behavior of `find` return arr.filter(check)[0]; } /** * Return the index of the matching object * @method * @memberof Popper.Utils * @argument {Array} arr * @argument prop * @argument value * @returns index or -1 */ function findIndex(arr, prop, value) { // use native findIndex if supported if (Array.prototype.findIndex) { return arr.findIndex(function (cur) { return cur[prop] === value; }); } // use `find` + `indexOf` if `findIndex` isn't supported var match = find(arr, function (obj) { return obj[prop] === value; }); return arr.indexOf(match); } /** * Loop trough the list of modifiers and run them in order, * each of them will then edit the data object. * @method * @memberof Popper.Utils * @param {dataObject} data * @param {Array} modifiers * @param {String} ends - Optional modifier name used as stopper * @returns {dataObject} */ function runModifiers(modifiers, data, ends) { var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); modifiersToRun.forEach(function (modifier) { if (modifier['function']) { // eslint-disable-line dot-notation console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); } var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation if (modifier.enabled && isFunction(fn)) { // Add properties to offsets to make them a complete clientRect object // we do this before each modifier to make sure the previous one doesn't // mess with these values data.offsets.popper = getClientRect(data.offsets.popper); data.offsets.reference = getClientRect(data.offsets.reference); data = fn(data, modifier); } }); return data; } /** * Updates the position of the popper, computing the new offsets and applying * the new style.
* Prefer `scheduleUpdate` over `update` because of performance reasons. * @method * @memberof Popper */ function update() { // if popper is destroyed, don't perform any further update if (this.state.isDestroyed) { return; } var data = { instance: this, styles: {}, arrowStyles: {}, attributes: {}, flipped: false, offsets: {} }; // compute reference element offsets data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); // compute auto placement, store placement inside the data object, // modifiers will be able to edit `placement` if needed // and refer to originalPlacement to know the original value data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); // store the computed placement inside `originalPlacement` data.originalPlacement = data.placement; data.positionFixed = this.options.positionFixed; // compute the popper offsets data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; // run the modifiers data = runModifiers(this.modifiers, data); // the first `update` will call `onCreate` callback // the other ones will call `onUpdate` callback if (!this.state.isCreated) { this.state.isCreated = true; this.options.onCreate(data); } else { this.options.onUpdate(data); } } /** * Helper used to know if the given modifier is enabled. * @method * @memberof Popper.Utils * @returns {Boolean} */ function isModifierEnabled(modifiers, modifierName) { return modifiers.some(function (_ref) { var name = _ref.name, enabled = _ref.enabled; return enabled && name === modifierName; }); } /** * Get the prefixed supported property name * @method * @memberof Popper.Utils * @argument {String} property (camelCase) * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) */ function getSupportedPropertyName(property) { var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; var upperProp = property.charAt(0).toUpperCase() + property.slice(1); for (var i = 0; i < prefixes.length; i++) { var prefix = prefixes[i]; var toCheck = prefix ? '' + prefix + upperProp : property; if (typeof document.body.style[toCheck] !== 'undefined') { return toCheck; } } return null; } /** * Destroys the popper. * @method * @memberof Popper */ function destroy() { this.state.isDestroyed = true; // touch DOM only if `applyStyle` modifier is enabled if (isModifierEnabled(this.modifiers, 'applyStyle')) { this.popper.removeAttribute('x-placement'); this.popper.style.position = ''; this.popper.style.top = ''; this.popper.style.left = ''; this.popper.style.right = ''; this.popper.style.bottom = ''; this.popper.style.willChange = ''; this.popper.style[getSupportedPropertyName('transform')] = ''; } this.disableEventListeners(); // remove the popper if user explicitly asked for the deletion on destroy // do not use `remove` because IE11 doesn't support it if (this.options.removeOnDestroy) { this.popper.parentNode.removeChild(this.popper); } return this; } /** * Get the window associated with the element * @argument {Element} element * @returns {Window} */ function getWindow(element) { var ownerDocument = element.ownerDocument; return ownerDocument ? ownerDocument.defaultView : window; } function attachToScrollParents(scrollParent, event, callback, scrollParents) { var isBody = scrollParent.nodeName === 'BODY'; var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; target.addEventListener(event, callback, { passive: true }); if (!isBody) { attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); } scrollParents.push(target); } /** * Setup needed event listeners used to update the popper position * @method * @memberof Popper.Utils * @private */ function setupEventListeners(reference, options, state, updateBound) { // Resize event listener on window state.updateBound = updateBound; getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); // Scroll event listener on scroll parents var scrollElement = getScrollParent(reference); attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); state.scrollElement = scrollElement; state.eventsEnabled = true; return state; } /** * It will add resize/scroll events and start recalculating * position of the popper element when they are triggered. * @method * @memberof Popper */ function enableEventListeners() { if (!this.state.eventsEnabled) { this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); } } /** * Remove event listeners used to update the popper position * @method * @memberof Popper.Utils * @private */ function removeEventListeners(reference, state) { // Remove resize event listener on window getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents state.scrollParents.forEach(function (target) { target.removeEventListener('scroll', state.updateBound); }); // Reset state state.updateBound = null; state.scrollParents = []; state.scrollElement = null; state.eventsEnabled = false; return state; } /** * It will remove resize/scroll events and won't recalculate popper position * when they are triggered. It also won't trigger `onUpdate` callback anymore, * unless you call `update` method manually. * @method * @memberof Popper */ function disableEventListeners() { if (this.state.eventsEnabled) { cancelAnimationFrame(this.scheduleUpdate); this.state = removeEventListeners(this.reference, this.state); } } /** * Tells if a given input is a number * @method * @memberof Popper.Utils * @param {*} input to check * @return {Boolean} */ function isNumeric(n) { return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); } /** * Set the style to the given popper * @method * @memberof Popper.Utils * @argument {Element} element - Element to apply the style to * @argument {Object} styles * Object with a list of properties and values which will be applied to the element */ function setStyles(element, styles) { Object.keys(styles).forEach(function (prop) { var unit = ''; // add unit if the value is numeric and is one of the following if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { unit = 'px'; } element.style[prop] = styles[prop] + unit; }); } /** * Set the attributes to the given popper * @method * @memberof Popper.Utils * @argument {Element} element - Element to apply the attributes to * @argument {Object} styles * Object with a list of properties and values which will be applied to the element */ function setAttributes(element, attributes) { Object.keys(attributes).forEach(function (prop) { var value = attributes[prop]; if (value !== false) { element.setAttribute(prop, attributes[prop]); } else { element.removeAttribute(prop); } }); } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by `update` method * @argument {Object} data.styles - List of style properties - values to apply to popper element * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element * @argument {Object} options - Modifiers configuration and options * @returns {Object} The same data object */ function applyStyle(data) { // any property present in `data.styles` will be applied to the popper, // in this way we can make the 3rd party modifiers add custom styles to it // Be aware, modifiers could override the properties defined in the previous // lines of this modifier! setStyles(data.instance.popper, data.styles); // any property present in `data.attributes` will be applied to the popper, // they will be set as HTML attributes of the element setAttributes(data.instance.popper, data.attributes); // if arrowElement is defined and arrowStyles has some properties if (data.arrowElement && Object.keys(data.arrowStyles).length) { setStyles(data.arrowElement, data.arrowStyles); } return data; } /** * Set the x-placement attribute before everything else because it could be used * to add margins to the popper margins needs to be calculated to get the * correct popper offsets. * @method * @memberof Popper.modifiers * @param {HTMLElement} reference - The reference element used to position the popper * @param {HTMLElement} popper - The HTML element used as popper * @param {Object} options - Popper.js options */ function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { // compute reference element offsets var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); // compute auto placement, store placement inside the data object, // modifiers will be able to edit `placement` if needed // and refer to originalPlacement to know the original value var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); popper.setAttribute('x-placement', placement); // Apply `position` to popper before anything else because // without the position applied we can't guarantee correct computations setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); return options; } /** * @function * @memberof Popper.Utils * @argument {Object} data - The data object generated by `update` method * @argument {Boolean} shouldRound - If the offsets should be rounded at all * @returns {Object} The popper's position offsets rounded * * The tale of pixel-perfect positioning. It's still not 100% perfect, but as * good as it can be within reason. * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 * * Low DPI screens cause a popper to be blurry if not using full pixels (Safari * as well on High DPI screens). * * Firefox prefers no rounding for positioning and does not have blurriness on * high DPI screens. * * Only horizontal placement and left/right values need to be considered. */ function getRoundedOffsets(data, shouldRound) { var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var round = Math.round, floor = Math.floor; var noRound = function noRound(v) { return v; }; var referenceWidth = round(reference.width); var popperWidth = round(popper.width); var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; var isVariation = data.placement.indexOf('-') !== -1; var sameWidthParity = referenceWidth % 2 === popperWidth % 2; var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; var verticalToInteger = !shouldRound ? noRound : round; return { left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), top: verticalToInteger(popper.top), bottom: verticalToInteger(popper.bottom), right: horizontalToInteger(popper.right) }; } var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by `update` method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function computeStyle(data, options) { var x = options.x, y = options.y; var popper = data.offsets.popper; // Remove this legacy support in Popper.js v2 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { return modifier.name === 'applyStyle'; }).gpuAcceleration; if (legacyGpuAccelerationOption !== undefined) { console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); } var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; var offsetParent = getOffsetParent(data.instance.popper); var offsetParentRect = getBoundingClientRect(offsetParent); // Styles var styles = { position: popper.position }; var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); var sideA = x === 'bottom' ? 'top' : 'bottom'; var sideB = y === 'right' ? 'left' : 'right'; // if gpuAcceleration is set to `true` and transform is supported, // we use `translate3d` to apply the position to the popper we // automatically use the supported prefixed version if needed var prefixedProperty = getSupportedPropertyName('transform'); // now, let's make a step back and look at this code closely (wtf?) // If the content of the popper grows once it's been positioned, it // may happen that the popper gets misplaced because of the new content // overflowing its reference element // To avoid this problem, we provide two options (x and y), which allow // the consumer to define the offset origin. // If we position a popper on top of a reference element, we can set // `x` to `top` to make the popper grow towards its top instead of // its bottom. var left = void 0, top = void 0; if (sideA === 'bottom') { // when offsetParent is the positioning is relative to the bottom of the screen (excluding the scrollbar) // and not the bottom of the html element if (offsetParent.nodeName === 'HTML') { top = -offsetParent.clientHeight + offsets.bottom; } else { top = -offsetParentRect.height + offsets.bottom; } } else { top = offsets.top; } if (sideB === 'right') { if (offsetParent.nodeName === 'HTML') { left = -offsetParent.clientWidth + offsets.right; } else { left = -offsetParentRect.width + offsets.right; } } else { left = offsets.left; } if (gpuAcceleration && prefixedProperty) { styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; styles[sideA] = 0; styles[sideB] = 0; styles.willChange = 'transform'; } else { // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties var invertTop = sideA === 'bottom' ? -1 : 1; var invertLeft = sideB === 'right' ? -1 : 1; styles[sideA] = top * invertTop; styles[sideB] = left * invertLeft; styles.willChange = sideA + ', ' + sideB; } // Attributes var attributes = { 'x-placement': data.placement }; // Update `data` attributes, styles and arrowStyles data.attributes = _extends({}, attributes, data.attributes); data.styles = _extends({}, styles, data.styles); data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); return data; } /** * Helper used to know if the given modifier depends from another one.
* It checks if the needed modifier is listed and enabled. * @method * @memberof Popper.Utils * @param {Array} modifiers - list of modifiers * @param {String} requestingName - name of requesting modifier * @param {String} requestedName - name of requested modifier * @returns {Boolean} */ function isModifierRequired(modifiers, requestingName, requestedName) { var requesting = find(modifiers, function (_ref) { var name = _ref.name; return name === requestingName; }); var isRequired = !!requesting && modifiers.some(function (modifier) { return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; }); if (!isRequired) { var _requesting = '`' + requestingName + '`'; var requested = '`' + requestedName + '`'; console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); } return isRequired; } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by update method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function arrow(data, options) { var _data$offsets$arrow; // arrow depends on keepTogether in order to work if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { return data; } var arrowElement = options.element; // if arrowElement is a string, suppose it's a CSS selector if (typeof arrowElement === 'string') { arrowElement = data.instance.popper.querySelector(arrowElement); // if arrowElement is not found, don't run the modifier if (!arrowElement) { return data; } } else { // if the arrowElement isn't a query selector we must check that the // provided DOM node is child of its popper node if (!data.instance.popper.contains(arrowElement)) { console.warn('WARNING: `arrow.element` must be child of its popper element!'); return data; } } var placement = data.placement.split('-')[0]; var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var isVertical = ['left', 'right'].indexOf(placement) !== -1; var len = isVertical ? 'height' : 'width'; var sideCapitalized = isVertical ? 'Top' : 'Left'; var side = sideCapitalized.toLowerCase(); var altSide = isVertical ? 'left' : 'top'; var opSide = isVertical ? 'bottom' : 'right'; var arrowElementSize = getOuterSizes(arrowElement)[len]; // // extends keepTogether behavior making sure the popper and its // reference have enough pixels in conjunction // // top/left side if (reference[opSide] - arrowElementSize < popper[side]) { data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); } // bottom/right side if (reference[side] + arrowElementSize > popper[opSide]) { data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; } data.offsets.popper = getClientRect(data.offsets.popper); // compute center of the popper var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; // Compute the sideValue using the updated popper offsets // take popper margin in account because we don't have this info available var css = getStyleComputedProperty(data.instance.popper); var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; // prevent arrowElement from being placed not contiguously to its popper sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); data.arrowElement = arrowElement; data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); return data; } /** * Get the opposite placement variation of the given one * @method * @memberof Popper.Utils * @argument {String} placement variation * @returns {String} flipped placement variation */ function getOppositeVariation(variation) { if (variation === 'end') { return 'start'; } else if (variation === 'start') { return 'end'; } return variation; } /** * List of accepted placements to use as values of the `placement` option.
* Valid placements are: * - `auto` * - `top` * - `right` * - `bottom` * - `left` * * Each placement can have a variation from this list: * - `-start` * - `-end` * * Variations are interpreted easily if you think of them as the left to right * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` * is right.
* Vertically (`left` and `right`), `start` is top and `end` is bottom. * * Some valid examples are: * - `top-end` (on top of reference, right aligned) * - `right-start` (on right of reference, top aligned) * - `bottom` (on bottom, centered) * - `auto-end` (on the side with more space available, alignment depends by placement) * * @static * @type {Array} * @enum {String} * @readonly * @method placements * @memberof Popper */ 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']; // Get rid of `auto` `auto-start` and `auto-end` var validPlacements = placements.slice(3); /** * Given an initial placement, returns all the subsequent placements * clockwise (or counter-clockwise). * * @method * @memberof Popper.Utils * @argument {String} placement - A valid placement (it accepts variations) * @argument {Boolean} counter - Set to true to walk the placements counterclockwise * @returns {Array} placements including their variations */ function clockwise(placement) { var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var index = validPlacements.indexOf(placement); var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); return counter ? arr.reverse() : arr; } var BEHAVIORS = { FLIP: 'flip', CLOCKWISE: 'clockwise', COUNTERCLOCKWISE: 'counterclockwise' }; /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by update method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function flip(data, options) { // if `inner` modifier is enabled, we can't use the `flip` modifier if (isModifierEnabled(data.instance.modifiers, 'inner')) { return data; } if (data.flipped && data.placement === data.originalPlacement) { // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides return data; } var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); var placement = data.placement.split('-')[0]; var placementOpposite = getOppositePlacement(placement); var variation = data.placement.split('-')[1] || ''; var flipOrder = []; switch (options.behavior) { case BEHAVIORS.FLIP: flipOrder = [placement, placementOpposite]; break; case BEHAVIORS.CLOCKWISE: flipOrder = clockwise(placement); break; case BEHAVIORS.COUNTERCLOCKWISE: flipOrder = clockwise(placement, true); break; default: flipOrder = options.behavior; } flipOrder.forEach(function (step, index) { if (placement !== step || flipOrder.length === index + 1) { return data; } placement = data.placement.split('-')[0]; placementOpposite = getOppositePlacement(placement); var popperOffsets = data.offsets.popper; var refOffsets = data.offsets.reference; // using floor because the reference offsets may contain decimals we are not going to consider here var floor = Math.floor; 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); var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; // flip the variation if required var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; // flips variation if reference element overflows boundaries var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); // flips variation if popper content overflows boundaries var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); var flippedVariation = flippedVariationByRef || flippedVariationByContent; if (overlapsRef || overflowsBoundaries || flippedVariation) { // this boolean to detect any flip loop data.flipped = true; if (overlapsRef || overflowsBoundaries) { placement = flipOrder[index + 1]; } if (flippedVariation) { variation = getOppositeVariation(variation); } data.placement = placement + (variation ? '-' + variation : ''); // this object contains `position`, we want to preserve it along with // any additional property we may add in the future data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); data = runModifiers(data.instance.modifiers, data, 'flip'); } }); return data; } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by update method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function keepTogether(data) { var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var placement = data.placement.split('-')[0]; var floor = Math.floor; var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; var side = isVertical ? 'right' : 'bottom'; var opSide = isVertical ? 'left' : 'top'; var measurement = isVertical ? 'width' : 'height'; if (popper[side] < floor(reference[opSide])) { data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; } if (popper[opSide] > floor(reference[side])) { data.offsets.popper[opSide] = floor(reference[side]); } return data; } /** * Converts a string containing value + unit into a px value number * @function * @memberof {modifiers~offset} * @private * @argument {String} str - Value + unit string * @argument {String} measurement - `height` or `width` * @argument {Object} popperOffsets * @argument {Object} referenceOffsets * @returns {Number|String} * Value in pixels, or original string if no values were extracted */ function toValue(str, measurement, popperOffsets, referenceOffsets) { // separate value from unit var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); var value = +split[1]; var unit = split[2]; // If it's not a number it's an operator, I guess if (!value) { return str; } if (unit.indexOf('%') === 0) { var element = void 0; switch (unit) { case '%p': element = popperOffsets; break; case '%': case '%r': default: element = referenceOffsets; } var rect = getClientRect(element); return rect[measurement] / 100 * value; } else if (unit === 'vh' || unit === 'vw') { // if is a vh or vw, we calculate the size based on the viewport var size = void 0; if (unit === 'vh') { size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); } else { size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); } return size / 100 * value; } else { // if is an explicit pixel unit, we get rid of the unit and keep the value // if is an implicit unit, it's px, and we return just the value return value; } } /** * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. * @function * @memberof {modifiers~offset} * @private * @argument {String} offset * @argument {Object} popperOffsets * @argument {Object} referenceOffsets * @argument {String} basePlacement * @returns {Array} a two cells array with x and y offsets in numbers */ function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { var offsets = [0, 0]; // Use height if placement is left or right and index is 0 otherwise use width // in this way the first offset will use an axis and the second one // will use the other one var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; // Split the offset string to obtain a list of values and operands // The regex addresses values with the plus or minus sign in front (+10, -20, etc) var fragments = offset.split(/(\+|\-)/).map(function (frag) { return frag.trim(); }); // Detect if the offset string contains a pair of values or a single one // they could be separated by comma or space var divider = fragments.indexOf(find(fragments, function (frag) { return frag.search(/,|\s/) !== -1; })); if (fragments[divider] && fragments[divider].indexOf(',') === -1) { console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); } // If divider is found, we divide the list of values and operands to divide // them by ofset X and Y. var splitRegex = /\s*,\s*|\s+/; 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]; // Convert the values with units to absolute pixels to allow our computations ops = ops.map(function (op, index) { // Most of the units rely on the orientation of the popper var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; var mergeWithPrevious = false; return op // This aggregates any `+` or `-` sign that aren't considered operators // e.g.: 10 + +5 => [10, +, +5] .reduce(function (a, b) { if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { a[a.length - 1] = b; mergeWithPrevious = true; return a; } else if (mergeWithPrevious) { a[a.length - 1] += b; mergeWithPrevious = false; return a; } else { return a.concat(b); } }, []) // Here we convert the string values into number values (in px) .map(function (str) { return toValue(str, measurement, popperOffsets, referenceOffsets); }); }); // Loop trough the offsets arrays and execute the operations ops.forEach(function (op, index) { op.forEach(function (frag, index2) { if (isNumeric(frag)) { offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); } }); }); return offsets; } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by update method * @argument {Object} options - Modifiers configuration and options * @argument {Number|String} options.offset=0 * The offset value as described in the modifier description * @returns {Object} The data object, properly modified */ function offset(data, _ref) { var offset = _ref.offset; var placement = data.placement, _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var basePlacement = placement.split('-')[0]; var offsets = void 0; if (isNumeric(+offset)) { offsets = [+offset, 0]; } else { offsets = parseOffset(offset, popper, reference, basePlacement); } if (basePlacement === 'left') { popper.top += offsets[0]; popper.left -= offsets[1]; } else if (basePlacement === 'right') { popper.top += offsets[0]; popper.left += offsets[1]; } else if (basePlacement === 'top') { popper.left += offsets[0]; popper.top -= offsets[1]; } else if (basePlacement === 'bottom') { popper.left += offsets[0]; popper.top += offsets[1]; } data.popper = popper; return data; } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by `update` method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function preventOverflow(data, options) { var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); // If offsetParent is the reference element, we really want to // go one step up and use the next offsetParent as reference to // avoid to make this modifier completely useless and look like broken if (data.instance.reference === boundariesElement) { boundariesElement = getOffsetParent(boundariesElement); } // NOTE: DOM access here // resets the popper's position so that the document size can be calculated excluding // the size of the popper element itself var transformProp = getSupportedPropertyName('transform'); var popperStyles = data.instance.popper.style; // assignment to help minification var top = popperStyles.top, left = popperStyles.left, transform = popperStyles[transformProp]; popperStyles.top = ''; popperStyles.left = ''; popperStyles[transformProp] = ''; var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); // NOTE: DOM access here // restores the original style properties after the offsets have been computed popperStyles.top = top; popperStyles.left = left; popperStyles[transformProp] = transform; options.boundaries = boundaries; var order = options.priority; var popper = data.offsets.popper; var check = { primary: function primary(placement) { var value = popper[placement]; if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { value = Math.max(popper[placement], boundaries[placement]); } return defineProperty({}, placement, value); }, secondary: function secondary(placement) { var mainSide = placement === 'right' ? 'left' : 'top'; var value = popper[mainSide]; if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); } return defineProperty({}, mainSide, value); } }; order.forEach(function (placement) { var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; popper = _extends({}, popper, check[side](placement)); }); data.offsets.popper = popper; return data; } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by `update` method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function shift(data) { var placement = data.placement; var basePlacement = placement.split('-')[0]; var shiftvariation = placement.split('-')[1]; // if shift shiftvariation is specified, run the modifier if (shiftvariation) { var _data$offsets = data.offsets, reference = _data$offsets.reference, popper = _data$offsets.popper; var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; var side = isVertical ? 'left' : 'top'; var measurement = isVertical ? 'width' : 'height'; var shiftOffsets = { start: defineProperty({}, side, reference[side]), end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) }; data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); } return data; } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by update method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function hide(data) { if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { return data; } var refRect = data.offsets.reference; var bound = find(data.instance.modifiers, function (modifier) { return modifier.name === 'preventOverflow'; }).boundaries; if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { // Avoid unnecessary DOM access if visibility hasn't changed if (data.hide === true) { return data; } data.hide = true; data.attributes['x-out-of-boundaries'] = ''; } else { // Avoid unnecessary DOM access if visibility hasn't changed if (data.hide === false) { return data; } data.hide = false; data.attributes['x-out-of-boundaries'] = false; } return data; } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by `update` method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function inner(data) { var placement = data.placement; var basePlacement = placement.split('-')[0]; var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); data.placement = getOppositePlacement(placement); data.offsets.popper = getClientRect(popper); return data; } /** * Modifier function, each modifier can have a function of this type assigned * to its `fn` property.
* These functions will be called on each update, this means that you must * make sure they are performant enough to avoid performance bottlenecks. * * @function ModifierFn * @argument {dataObject} data - The data object generated by `update` method * @argument {Object} options - Modifiers configuration and options * @returns {dataObject} The data object, properly modified */ /** * Modifiers are plugins used to alter the behavior of your poppers.
* Popper.js uses a set of 9 modifiers to provide all the basic functionalities * needed by the library. * * Usually you don't want to override the `order`, `fn` and `onLoad` props. * All the other properties are configurations that could be tweaked. * @namespace modifiers */ var modifiers = { /** * Modifier used to shift the popper on the start or end of its reference * element.
* It will read the variation of the `placement` property.
* It can be one either `-end` or `-start`. * @memberof modifiers * @inner */ shift: { /** @prop {number} order=100 - Index used to define the order of execution */ order: 100, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: shift }, /** * The `offset` modifier can shift your popper on both its axis. * * It accepts the following units: * - `px` or unit-less, interpreted as pixels * - `%` or `%r`, percentage relative to the length of the reference element * - `%p`, percentage relative to the length of the popper element * - `vw`, CSS viewport width unit * - `vh`, CSS viewport height unit * * For length is intended the main axis relative to the placement of the popper.
* This means that if the placement is `top` or `bottom`, the length will be the * `width`. In case of `left` or `right`, it will be the `height`. * * You can provide a single value (as `Number` or `String`), or a pair of values * as `String` divided by a comma or one (or more) white spaces.
* The latter is a deprecated method because it leads to confusion and will be * removed in v2.
* Additionally, it accepts additions and subtractions between different units. * Note that multiplications and divisions aren't supported. * * Valid examples are: * ``` * 10 * '10%' * '10, 10' * '10%, 10' * '10 + 10%' * '10 - 5vh + 3%' * '-10px + 5vh, 5px - 6%' * ``` * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap * > with their reference element, unfortunately, you will have to disable the `flip` modifier. * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). * * @memberof modifiers * @inner */ offset: { /** @prop {number} order=200 - Index used to define the order of execution */ order: 200, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: offset, /** @prop {Number|String} offset=0 * The offset value as described in the modifier description */ offset: 0 }, /** * Modifier used to prevent the popper from being positioned outside the boundary. * * A scenario exists where the reference itself is not within the boundaries.
* We can say it has "escaped the boundaries" — or just "escaped".
* In this case we need to decide whether the popper should either: * * - detach from the reference and remain "trapped" in the boundaries, or * - if it should ignore the boundary and "escape with its reference" * * When `escapeWithReference` is set to`true` and reference is completely * outside its boundaries, the popper will overflow (or completely leave) * the boundaries in order to remain attached to the edge of the reference. * * @memberof modifiers * @inner */ preventOverflow: { /** @prop {number} order=300 - Index used to define the order of execution */ order: 300, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: preventOverflow, /** * @prop {Array} [priority=['left','right','top','bottom']] * Popper will try to prevent overflow following these priorities by default, * then, it could overflow on the left and on top of the `boundariesElement` */ priority: ['left', 'right', 'top', 'bottom'], /** * @prop {number} padding=5 * Amount of pixel used to define a minimum distance between the boundaries * and the popper. This makes sure the popper always has a little padding * between the edges of its container */ padding: 5, /** * @prop {String|HTMLElement} boundariesElement='scrollParent' * Boundaries used by the modifier. Can be `scrollParent`, `window`, * `viewport` or any DOM element. */ boundariesElement: 'scrollParent' }, /** * Modifier used to make sure the reference and its popper stay near each other * without leaving any gap between the two. Especially useful when the arrow is * enabled and you want to ensure that it points to its reference element. * It cares only about the first axis. You can still have poppers with margin * between the popper and its reference element. * @memberof modifiers * @inner */ keepTogether: { /** @prop {number} order=400 - Index used to define the order of execution */ order: 400, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: keepTogether }, /** * This modifier is used to move the `arrowElement` of the popper to make * sure it is positioned between the reference element and its popper element. * It will read the outer size of the `arrowElement` node to detect how many * pixels of conjunction are needed. * * It has no effect if no `arrowElement` is provided. * @memberof modifiers * @inner */ arrow: { /** @prop {number} order=500 - Index used to define the order of execution */ order: 500, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: arrow, /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ element: '[x-arrow]' }, /** * Modifier used to flip the popper's placement when it starts to overlap its * reference element. * * Requires the `preventOverflow` modifier before it in order to work. * * **NOTE:** this modifier will interrupt the current update cycle and will * restart it if it detects the need to flip the placement. * @memberof modifiers * @inner */ flip: { /** @prop {number} order=600 - Index used to define the order of execution */ order: 600, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: flip, /** * @prop {String|Array} behavior='flip' * The behavior used to change the popper's placement. It can be one of * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid * placements (with optional variations) */ behavior: 'flip', /** * @prop {number} padding=5 * The popper will flip if it hits the edges of the `boundariesElement` */ padding: 5, /** * @prop {String|HTMLElement} boundariesElement='viewport' * The element which will define the boundaries of the popper position. * The popper will never be placed outside of the defined boundaries * (except if `keepTogether` is enabled) */ boundariesElement: 'viewport', /** * @prop {Boolean} flipVariations=false * The popper will switch placement variation between `-start` and `-end` when * the reference element overlaps its boundaries. * * The original placement should have a set variation. */ flipVariations: false, /** * @prop {Boolean} flipVariationsByContent=false * The popper will switch placement variation between `-start` and `-end` when * the popper element overlaps its reference boundaries. * * The original placement should have a set variation. */ flipVariationsByContent: false }, /** * Modifier used to make the popper flow toward the inner of the reference element. * By default, when this modifier is disabled, the popper will be placed outside * the reference element. * @memberof modifiers * @inner */ inner: { /** @prop {number} order=700 - Index used to define the order of execution */ order: 700, /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ enabled: false, /** @prop {ModifierFn} */ fn: inner }, /** * Modifier used to hide the popper when its reference element is outside of the * popper boundaries. It will set a `x-out-of-boundaries` attribute which can * be used to hide with a CSS selector the popper when its reference is * out of boundaries. * * Requires the `preventOverflow` modifier before it in order to work. * @memberof modifiers * @inner */ hide: { /** @prop {number} order=800 - Index used to define the order of execution */ order: 800, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: hide }, /** * Computes the style that will be applied to the popper element to gets * properly positioned. * * Note that this modifier will not touch the DOM, it just prepares the styles * so that `applyStyle` modifier can apply it. This separation is useful * in case you need to replace `applyStyle` with a custom implementation. * * This modifier has `850` as `order` value to maintain backward compatibility * with previous versions of Popper.js. Expect the modifiers ordering method * to change in future major versions of the library. * * @memberof modifiers * @inner */ computeStyle: { /** @prop {number} order=850 - Index used to define the order of execution */ order: 850, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: computeStyle, /** * @prop {Boolean} gpuAcceleration=true * If true, it uses the CSS 3D transformation to position the popper. * Otherwise, it will use the `top` and `left` properties */ gpuAcceleration: true, /** * @prop {string} [x='bottom'] * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. * Change this if your popper should grow in a direction different from `bottom` */ x: 'bottom', /** * @prop {string} [x='left'] * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. * Change this if your popper should grow in a direction different from `right` */ y: 'right' }, /** * Applies the computed styles to the popper element. * * All the DOM manipulations are limited to this modifier. This is useful in case * you want to integrate Popper.js inside a framework or view library and you * want to delegate all the DOM manipulations to it. * * Note that if you disable this modifier, you must make sure the popper element * has its position set to `absolute` before Popper.js can do its work! * * Just disable this modifier and define your own to achieve the desired effect. * * @memberof modifiers * @inner */ applyStyle: { /** @prop {number} order=900 - Index used to define the order of execution */ order: 900, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: applyStyle, /** @prop {Function} */ onLoad: applyStyleOnLoad, /** * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier * @prop {Boolean} gpuAcceleration=true * If true, it uses the CSS 3D transformation to position the popper. * Otherwise, it will use the `top` and `left` properties */ gpuAcceleration: undefined } }; /** * The `dataObject` is an object containing all the information used by Popper.js. * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. * @name dataObject * @property {Object} data.instance The Popper.js instance * @property {String} data.placement Placement applied to popper * @property {String} data.originalPlacement Placement originally defined on init * @property {Boolean} data.flipped True if popper has been flipped by flip modifier * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) * @property {Object} data.boundaries Offsets of the popper boundaries * @property {Object} data.offsets The measurements of popper, reference and arrow elements * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 */ /** * Default options provided to Popper.js constructor.
* These can be overridden using the `options` argument of Popper.js.
* To override an option, simply pass an object with the same * structure of the `options` object, as the 3rd argument. For example: * ``` * new Popper(ref, pop, { * modifiers: { * preventOverflow: { enabled: false } * } * }) * ``` * @type {Object} * @static * @memberof Popper */ var Defaults = { /** * Popper's placement. * @prop {Popper.placements} placement='bottom' */ placement: 'bottom', /** * Set this to true if you want popper to position it self in 'fixed' mode * @prop {Boolean} positionFixed=false */ positionFixed: false, /** * Whether events (resize, scroll) are initially enabled. * @prop {Boolean} eventsEnabled=true */ eventsEnabled: true, /** * Set to true if you want to automatically remove the popper when * you call the `destroy` method. * @prop {Boolean} removeOnDestroy=false */ removeOnDestroy: false, /** * Callback called when the popper is created.
* By default, it is set to no-op.
* Access Popper.js instance with `data.instance`. * @prop {onCreate} */ onCreate: function onCreate() {}, /** * Callback called when the popper is updated. This callback is not called * on the initialization/creation of the popper, but only on subsequent * updates.
* By default, it is set to no-op.
* Access Popper.js instance with `data.instance`. * @prop {onUpdate} */ onUpdate: function onUpdate() {}, /** * List of modifiers used to modify the offsets before they are applied to the popper. * They provide most of the functionalities of Popper.js. * @prop {modifiers} */ modifiers: modifiers }; /** * @callback onCreate * @param {dataObject} data */ /** * @callback onUpdate * @param {dataObject} data */ // Utils // Methods var Popper = function () { /** * Creates a new Popper.js instance. * @class Popper * @param {Element|referenceObject} reference - The reference element used to position the popper * @param {Element} popper - The HTML / XML element used as the popper * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) * @return {Object} instance - The generated Popper.js instance */ function Popper(reference, popper) { var _this = this; var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; classCallCheck(this, Popper); this.scheduleUpdate = function () { return requestAnimationFrame(_this.update); }; // make update() debounced, so that it only runs at most once-per-tick this.update = debounce(this.update.bind(this)); // with {} we create a new object with the options inside it this.options = _extends({}, Popper.Defaults, options); // init state this.state = { isDestroyed: false, isCreated: false, scrollParents: [] }; // get reference and popper elements (allow jQuery wrappers) this.reference = reference && reference.jquery ? reference[0] : reference; this.popper = popper && popper.jquery ? popper[0] : popper; // Deep merge modifiers options this.options.modifiers = {}; Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); }); // Refactoring modifiers' list (Object => Array) this.modifiers = Object.keys(this.options.modifiers).map(function (name) { return _extends({ name: name }, _this.options.modifiers[name]); }) // sort the modifiers by order .sort(function (a, b) { return a.order - b.order; }); // modifiers have the ability to execute arbitrary code when Popper.js get inited // such code is executed in the same order of its modifier // they could add new properties to their options configuration // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! this.modifiers.forEach(function (modifierOptions) { if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); } }); // fire the first update to position the popper in the right place this.update(); var eventsEnabled = this.options.eventsEnabled; if (eventsEnabled) { // setup event listeners, they will take care of update the position in specific situations this.enableEventListeners(); } this.state.eventsEnabled = eventsEnabled; } // We can't use class properties because they don't get listed in the // class prototype and break stuff like Sinon stubs createClass(Popper, [{ key: 'update', value: function update$$1() { return update.call(this); } }, { key: 'destroy', value: function destroy$$1() { return destroy.call(this); } }, { key: 'enableEventListeners', value: function enableEventListeners$$1() { return enableEventListeners.call(this); } }, { key: 'disableEventListeners', value: function disableEventListeners$$1() { return disableEventListeners.call(this); } /** * Schedules an update. It will run on the next UI update available. * @method scheduleUpdate * @memberof Popper */ /** * Collection of utilities useful when writing custom modifiers. * Starting from version 1.7, this method is available only if you * include `popper-utils.js` before `popper.js`. * * **DEPRECATION**: This way to access PopperUtils is deprecated * and will be removed in v2! Use the PopperUtils module directly instead. * Due to the high instability of the methods contained in Utils, we can't * guarantee them to follow semver. Use them at your own risk! * @static * @private * @type {Object} * @deprecated since version 1.8 * @member Utils * @memberof Popper */ }]); return Popper; }(); /** * The `referenceObject` is an object that provides an interface compatible with Popper.js * and lets you use it as replacement of a real DOM node.
* You can use this method to position a popper relatively to a set of coordinates * in case you don't have a DOM node to use as reference. * * ``` * new Popper(referenceObject, popperNode); * ``` * * NB: This feature isn't supported in Internet Explorer 10. * @name referenceObject * @property {Function} data.getBoundingClientRect * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. * @property {number} data.clientWidth * An ES6 getter that will return the width of the virtual reference element. * @property {number} data.clientHeight * An ES6 getter that will return the height of the virtual reference element. */ Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; Popper.placements = placements; Popper.Defaults = Defaults; /* harmony default export */ __webpack_exports__["default"] = (Popper); //# sourceMappingURL=popper.js.map /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) /***/ }), /***/ "./node_modules/webpack/buildin/global.js": /*!***********************************!*\ !*** (webpack)/buildin/global.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports) { var g; // This works in non-strict mode g = (function() { return this; })(); try { // This works if eval is allowed (see CSP) g = g || new Function("return this")(); } catch (e) { // This works if the window reference is available if (typeof window === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /***/ "./sass/style.scss": /*!*************************!*\ !*** ./sass/style.scss ***! \*************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "./src/js/app.js": /*!***********************!*\ !*** ./src/js/app.js ***! \***********************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(jQuery) { var _jquery = __webpack_require__(/*! jquery */ "jquery"); var _jquery2 = _interopRequireDefault(_jquery); __webpack_require__(/*! ./components/bootstrap.min.js */ "./src/js/components/bootstrap.min.js"); __webpack_require__(/*! ./components/polyfill.js */ "./src/js/components/polyfill.js"); __webpack_require__(/*! ./components/cookie-alert.js */ "./src/js/components/cookie-alert.js"); __webpack_require__(/*! ./components/navbar-scroll.js */ "./src/js/components/navbar-scroll.js"); __webpack_require__(/*! ./components/newsletter.js */ "./src/js/components/newsletter.js"); __webpack_require__(/*! ./components/zapier-widget.js */ "./src/js/components/zapier-widget.js"); __webpack_require__(/*! ../../sass/style.scss */ "./sass/style.scss"); __webpack_require__(/*! ./components/toc.js */ "./src/js/components/toc.js"); __webpack_require__(/*! ./lib/jquery.twentytwenty.js */ "./src/js/lib/jquery.twentytwenty.js"); __webpack_require__(/*! ./lib/jquery.event.move.js */ "./src/js/lib/jquery.event.move.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } window.jQuery = _jquery2.default; window.$ = _jquery2.default; (0, _jquery2.default)(document).ready(function () { // const exitIntentTrigger = e => { // const shouldShowExitIntent = // !e.toElement && // !e.relatedTarget && // e.clientY < 10; // if (shouldShowExitIntent) { // document.removeEventListener('mouseout', exitIntentTrigger); // console.log('exit intent triggered'); // document.querySelector('.blog-exit-cta').classList.add('active'); // } // }; // document.addEventListener('mouseout', exitIntentTrigger); // Show the popup and overlay when the user tries to leave the page // Add event listeners to post titles // const postTitles = document.querySelectorAll('.post-title'); document.addEventListener('mouseleave', function (e) { // get postid from data-postid attribute from body tag var postId = document.querySelector('body').getAttribute('data-postid'); if (!hasPopupBeenShown(postId)) { // Show the popup for this post if (e.clientY < 0) { document.querySelector('.blog-exit-cta').classList.add('active'); // Mark the popup as shown for this post in localStorage markPopupAsShown(postId); } } // we check if the extCtaShown insessionStorage is false we show the popup }); function hasPopupBeenShown(postId) { var extCtaShown = JSON.parse(sessionStorage.getItem('extCtaShown')) || {}; return extCtaShown[postId] === true; } function markPopupAsShown(postId) { var extCtaShown = JSON.parse(sessionStorage.getItem('extCtaShown')) || {}; extCtaShown[postId] = true; sessionStorage.setItem('extCtaShown', JSON.stringify(extCtaShown)); } (0, _jquery2.default)('.blog-exit-cta, .blog-exit-cta__close').on('click', function () { (0, _jquery2.default)('.blog-exit-cta').removeClass('active'); }); (0, _jquery2.default)('.blog-exit-cta__wrapper').on('click', function (e) { e.stopPropagation(); }); if ((0, _jquery2.default)(".testimonial-slider-2-col__slider").length > 0) { var index = 0; var containers = (0, _jquery2.default)(".testimonial-slider-2-col__slider .testimonial-slider-2-col__item-container"); setInterval(function () { var next = (index + 1) % containers.length; (0, _jquery2.default)(containers[index]).fadeOut(1000, function () { (0, _jquery2.default)(containers[next]).fadeIn(1000); }); index = next; }, 5000); var normalize = function normalize() { // Reset, otherwise we would be able to shrink containers.css("min-height", ""); var tallest = Array.prototype.reduce.call(containers, function (tallest, e) { var height = (0, _jquery2.default)(e).height(); return height > tallest ? height : tallest; }, 0); containers.css("min-height", tallest + "px"); }; normalize(); (0, _jquery2.default)(window).on("resize orientationchange", normalize); } // Defer loading fontawesome.css var faLink = document.createElement("link"); faLink.rel = "stylesheet"; faLink.href = "https://zenkit.com/wp-content/themes/zenkit-com/css/font-awesome.min.css"; faLink.type = "text/css"; (0, _jquery2.default)("head").append(faLink); var navbar = (0, _jquery2.default)(".zenkit-navbar"); var body = (0, _jquery2.default)("body"); if (navbar.length > 0) { var toggle = (0, _jquery2.default)(".zenkit-navbar .zenkit-navbar-toggle"); toggle.on("click", function () { var isOpen = toggle.attr("aria-expanded"); var isInProgress = toggle.data("inProgress"); if (isInProgress) { return; } toggle.data("inProgress", true); return isOpen === "true" ? closeNavbar() : openNavbar(); }); // Outside Click (0, _jquery2.default)("body").on("click", function (e) { var isOpen = toggle.attr("aria-expanded"); if (isOpen !== "true") { return; } var isNavbarChild = (0, _jquery2.default)(e.target).is(".zenkit-navbar, .zenkit-navbar *"); if (isNavbarChild) { return; } return closeNavbar(); }); } }); (0, _jquery2.default)(function () { jQuery("#container1").twentytwenty(); jQuery(".twentytwenty-container").twentytwenty(); jQuery(".sliding-comparison-container").show(); setTimeout(function () { window.dispatchEvent(new Event("resize")); }, 1000); }); // lp-accordion (0, _jquery2.default)(document).ready(function () { // when show method is triggered (0, _jquery2.default)(".lp-accordion .collapse").on("show.bs.collapse", function () { // remove active from all cards (0, _jquery2.default)(".lp-accordion .card").removeClass("active"); // add active to current card (0, _jquery2.default)(this).parent().addClass("active"); }); // when hide method is triggered //hide.bs.collapse (0, _jquery2.default)(".lp-accordion .collapse").on("hide.bs.collapse", function () { // remove active from parent (0, _jquery2.default)(this).parent().removeClass("active"); }); }); console.log("test"); jQuery(function ($) { var heroSlider = $('.hero__slider'); var heroSliderNav = $('.hero__slider-nav'); var heroSliderNavMobile = $('.hero__slider-nav--mobile'); heroSlider.carousel({ interval: 5000 // pause: false }); // on mouseenter change cursor to grabbing heroSlider.on('mouseenter', function () { $(this).css('cursor', 'grabbing'); }); // Remove active class using JavaScript // heroSliderNav.removeClass('active'); // heroSliderNavMobile.removeClass('active'); // // Apply active class on the first navigation item via JavaScript // heroSliderNav.eq(0).addClass('active'); // heroSliderNavMobile.eq(0).addClass('active'); heroSlider.on('slide.bs.carousel', function () { var activeIndex = heroSlider.find('.carousel-item.active').index() + 1; // get total number of slides var totalSlides = heroSlider.find('.carousel-item').length; console.log(totalSlides); console.log(activeIndex); // Remove active class from all navigation items heroSliderNav.removeClass('active'); heroSliderNavMobile.removeClass('active'); // Add active class to the navigation item corresponding to the active slide // Use setTimeout to delay applying the active class // setTimeout(function() { // Add active class to the navigation item corresponding to the active slide if (activeIndex === totalSlides) { activeIndex = 0; } heroSliderNav.eq(activeIndex).addClass('active'); heroSliderNavMobile.eq(activeIndex).addClass('active'); // }, 0); }); // heroSlider.on('slid.bs.carousel', function() { // let activeIndex = heroSlider.find('.carousel-item.active').index(); // // Remove active class from all navigation items // heroSliderNav.removeClass('active'); // heroSliderNavMobile.removeClass('active'); // // Add active class to the navigation item corresponding to the active slide // heroSliderNav.eq(activeIndex).addClass('active'); // heroSliderNavMobile.eq(activeIndex).addClass('active'); // }); // Navigation click actions heroSliderNav.on('click', function (e) { var index = $(this).data('slide-to'); heroSlider.carousel(index); // remove active class from all navigation items heroSliderNav.removeClass('active'); heroSliderNavMobile.removeClass('active'); // add active class to the clicked navigation item $(this).addClass('active'); heroSliderNavMobile.eq(index).addClass('active'); }); heroSliderNavMobile.on('click', function (e) { var index = $(this).data('slide-to'); heroSlider.carousel(index); // remove active class from all navigation items heroSliderNav.removeClass('active'); heroSliderNavMobile.removeClass('active'); // add active class to the clicked navigation item $(this).addClass('active'); heroSliderNav.eq(index).addClass('active'); }); }); // window.addEventListener('load', function() { // // JavaScript function to navigate to a specific slide // let sliderBtns = document.querySelectorAll(".hero__slider-navigation .hero__slider-nav"); // sliderBtns.forEach((btn, index) => { // btn.addEventListener("click", (e) => { // e.preventDefault(); // let slideIndex = btn.getAttribute("data-slide-index"); // console.log(slideIndex); // // get the closest carousel instance // let slider = btn.closest(".carousel"); // $('#carouselExampleFade').carousel(slideIndex); // }); // }); // }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ "jquery"))) /***/ }), /***/ "./src/js/components/bootstrap.min.js": /*!********************************************!*\ !*** ./src/js/components/bootstrap.min.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /*! * Bootstrap v4.1.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 (t, e) { "object" == ( false ? undefined : _typeof(exports)) && "undefined" != typeof module ? e(exports, __webpack_require__(/*! jquery */ "jquery"), __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")) : true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! jquery */ "jquery"), __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (e), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : undefined; }(undefined, function (t, e, c) { "use strict"; function i(t, e) { for (var n = 0; n < e.length; n++) { var i = e[n];i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i); } }function o(t, e, n) { return e && i(t.prototype, e), n && i(t, n), t; }function h(r) { for (var t = 1; t < arguments.length; t++) { var s = null != arguments[t] ? arguments[t] : {}, e = Object.keys(s);"function" == typeof Object.getOwnPropertySymbols && (e = e.concat(Object.getOwnPropertySymbols(s).filter(function (t) { return Object.getOwnPropertyDescriptor(s, t).enumerable; }))), e.forEach(function (t) { var e, n, i;e = r, i = s[n = t], n in e ? Object.defineProperty(e, n, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = i; }); }return r; }e = e && e.hasOwnProperty("default") ? e.default : e, c = c && c.hasOwnProperty("default") ? c.default : c;var r, n, s, a, l, u, f, d, _, g, m, p, v, E, y, T, C, I, A, D, b, S, w, N, O, k, P, L, j, R, H, W, M, x, U, K, F, V, Q, B, Y, G, q, z, X, J, Z, $, tt, et, nt, it, rt, st, ot, at, lt, ht, ct, ut, ft, dt, _t, gt, mt, pt, vt, Et, yt, Tt, Ct, It, At, Dt, bt, St, wt, Nt, Ot, kt, Pt, Lt, jt, Rt, Ht, Wt, Mt, xt, Ut, Kt, Ft, Vt, Qt, Bt, Yt, Gt, qt, zt, Xt, Jt, Zt, $t, te, ee, ne, ie, re, se, oe, ae, le, he, ce, ue, fe, de, _e, ge, me, pe, ve, Ee, ye, Te, Ce, Ie, Ae, De, be, Se, we, Ne, Oe, ke, Pe, Le, je, Re, He, We, Me, xe, Ue, Ke, Fe, Ve, Qe, Be, Ye, Ge, qe, ze, Xe, Je, Ze, $e, tn, en, nn, rn, sn, on, an, ln, hn, cn, un, fn, dn, _n, gn, mn, pn, vn, En, yn, Tn, Cn = function (i) { var e = "transitionend";function t(t) { var e = this, n = !1;return i(this).one(l.TRANSITION_END, function () { n = !0; }), setTimeout(function () { n || l.triggerTransitionEnd(e); }, t), this; }var l = { TRANSITION_END: "bsTransitionEnd", getUID: function getUID(t) { for (; t += ~~(1e6 * Math.random()), document.getElementById(t);) {}return t; }, getSelectorFromElement: function getSelectorFromElement(t) { var e = t.getAttribute("data-target");e && "#" !== e || (e = t.getAttribute("href") || "");try { return 0 < i(document).find(e).length ? e : null; } catch (t) { return null; } }, getTransitionDurationFromElement: function getTransitionDurationFromElement(t) { if (!t) return 0;var e = i(t).css("transition-duration");return parseFloat(e) ? (e = e.split(",")[0], 1e3 * parseFloat(e)) : 0; }, reflow: function reflow(t) { return t.offsetHeight; }, triggerTransitionEnd: function triggerTransitionEnd(t) { i(t).trigger(e); }, supportsTransitionEnd: function supportsTransitionEnd() { return Boolean(e); }, isElement: function isElement(t) { return (t[0] || t).nodeType; }, typeCheckConfig: function typeCheckConfig(t, e, n) { for (var i in n) { if (Object.prototype.hasOwnProperty.call(n, i)) { var r = n[i], s = e[i], o = s && l.isElement(s) ? "element" : (a = s, {}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase());if (!new RegExp(r).test(o)) throw new Error(t.toUpperCase() + ': Option "' + i + '" provided type "' + o + '" but expected type "' + r + '".'); } }var a; } };return i.fn.emulateTransitionEnd = t, i.event.special[l.TRANSITION_END] = { bindType: e, delegateType: e, handle: function handle(t) { if (i(t.target).is(this)) return t.handleObj.handler.apply(this, arguments); } }, l; }(e), In = (n = "alert", a = "." + (s = "bs.alert"), l = (r = e).fn[n], u = { CLOSE: "close" + a, CLOSED: "closed" + a, CLICK_DATA_API: "click" + a + ".data-api" }, f = "alert", d = "fade", _ = "show", g = function () { function i(t) { this._element = t; }var t = i.prototype;return t.close = function (t) { t = t || this._element;var e = this._getRootElement(t);this._triggerCloseEvent(e).isDefaultPrevented() || this._removeElement(e); }, t.dispose = function () { r.removeData(this._element, s), this._element = null; }, t._getRootElement = function (t) { var e = Cn.getSelectorFromElement(t), n = !1;return e && (n = r(e)[0]), n || (n = r(t).closest("." + f)[0]), n; }, t._triggerCloseEvent = function (t) { var e = r.Event(u.CLOSE);return r(t).trigger(e), e; }, t._removeElement = function (e) { var n = this;if (r(e).removeClass(_), r(e).hasClass(d)) { var t = Cn.getTransitionDurationFromElement(e);r(e).one(Cn.TRANSITION_END, function (t) { return n._destroyElement(e, t); }).emulateTransitionEnd(t); } else this._destroyElement(e); }, t._destroyElement = function (t) { r(t).detach().trigger(u.CLOSED).remove(); }, i._jQueryInterface = function (n) { return this.each(function () { var t = r(this), e = t.data(s);e || (e = new i(this), t.data(s, e)), "close" === n && e[n](this); }); }, i._handleDismiss = function (e) { return function (t) { t && t.preventDefault(), e.close(this); }; }, o(i, null, [{ key: "VERSION", get: function get() { return "4.1.0"; } }]), i; }(), r(document).on(u.CLICK_DATA_API, '[data-dismiss="alert"]', g._handleDismiss(new g())), r.fn[n] = g._jQueryInterface, r.fn[n].Constructor = g, r.fn[n].noConflict = function () { return r.fn[n] = l, g._jQueryInterface; }, g), An = (p = "button", E = "." + (v = "bs.button"), y = ".data-api", T = (m = e).fn[p], C = "active", I = "btn", D = '[data-toggle^="button"]', b = '[data-toggle="buttons"]', S = "input", w = ".active", N = ".btn", O = { CLICK_DATA_API: "click" + E + y, FOCUS_BLUR_DATA_API: (A = "focus") + E + y + " blur" + E + y }, k = function () { function n(t) { this._element = t; }var t = n.prototype;return t.toggle = function () { var t = !0, e = !0, n = m(this._element).closest(b)[0];if (n) { var i = m(this._element).find(S)[0];if (i) { if ("radio" === i.type) if (i.checked && m(this._element).hasClass(C)) t = !1;else { var r = m(n).find(w)[0];r && m(r).removeClass(C); }if (t) { if (i.hasAttribute("disabled") || n.hasAttribute("disabled") || i.classList.contains("disabled") || n.classList.contains("disabled")) return;i.checked = !m(this._element).hasClass(C), m(i).trigger("change"); }i.focus(), e = !1; } }e && this._element.setAttribute("aria-pressed", !m(this._element).hasClass(C)), t && m(this._element).toggleClass(C); }, t.dispose = function () { m.removeData(this._element, v), this._element = null; }, n._jQueryInterface = function (e) { return this.each(function () { var t = m(this).data(v);t || (t = new n(this), m(this).data(v, t)), "toggle" === e && t[e](); }); }, o(n, null, [{ key: "VERSION", get: function get() { return "4.1.0"; } }]), n; }(), m(document).on(O.CLICK_DATA_API, D, function (t) { t.preventDefault();var e = t.target;m(e).hasClass(I) || (e = m(e).closest(N)), k._jQueryInterface.call(m(e), "toggle"); }).on(O.FOCUS_BLUR_DATA_API, D, function (t) { var e = m(t.target).closest(N)[0];m(e).toggleClass(A, /^focus(in)?$/.test(t.type)); }), m.fn[p] = k._jQueryInterface, m.fn[p].Constructor = k, m.fn[p].noConflict = function () { return m.fn[p] = T, k._jQueryInterface; }, k), Dn = (L = "carousel", R = "." + (j = "bs.carousel"), H = ".data-api", W = (P = e).fn[L], M = { interval: 5e3, keyboard: !0, slide: !1, pause: "hover", wrap: !0 }, x = { interval: "(number|boolean)", keyboard: "boolean", slide: "(boolean|string)", pause: "(string|boolean)", wrap: "boolean" }, U = "next", K = "prev", F = "left", V = "right", Q = { SLIDE: "slide" + R, SLID: "slid" + R, KEYDOWN: "keydown" + R, MOUSEENTER: "mouseenter" + R, MOUSELEAVE: "mouseleave" + R, TOUCHEND: "touchend" + R, LOAD_DATA_API: "load" + R + H, CLICK_DATA_API: "click" + R + H }, B = "carousel", Y = "active", G = "slide", q = "carousel-item-right", z = "carousel-item-left", X = "carousel-item-next", J = "carousel-item-prev", Z = { ACTIVE: ".active", ACTIVE_ITEM: ".active.carousel-item", ITEM: ".carousel-item", NEXT_PREV: ".carousel-item-next, .carousel-item-prev", INDICATORS: ".carousel-indicators", DATA_SLIDE: "[data-slide], [data-slide-to]", DATA_RIDE: '[data-ride="carousel"]' }, $ = function () { function s(t, e) { this._items = null, this._interval = null, this._activeElement = null, this._isPaused = !1, this._isSliding = !1, this.touchTimeout = null, this._config = this._getConfig(e), this._element = P(t)[0], this._indicatorsElement = P(this._element).find(Z.INDICATORS)[0], this._addEventListeners(); }var t = s.prototype;return t.next = function () { this._isSliding || this._slide(U); }, t.nextWhenVisible = function () { !document.hidden && P(this._element).is(":visible") && "hidden" !== P(this._element).css("visibility") && this.next(); }, t.prev = function () { this._isSliding || this._slide(K); }, t.pause = function (t) { t || (this._isPaused = !0), P(this._element).find(Z.NEXT_PREV)[0] && (Cn.triggerTransitionEnd(this._element), this.cycle(!0)), clearInterval(this._interval), this._interval = null; }, t.cycle = function (t) { t || (this._isPaused = !1), this._interval && (clearInterval(this._interval), this._interval = null), this._config.interval && !this._isPaused && (this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval)); }, t.to = function (t) { var e = this;this._activeElement = P(this._element).find(Z.ACTIVE_ITEM)[0];var n = this._getItemIndex(this._activeElement);if (!(t > this._items.length - 1 || t < 0)) if (this._isSliding) P(this._element).one(Q.SLID, function () { return e.to(t); });else { if (n === t) return this.pause(), void this.cycle();var i = n < t ? U : K;this._slide(i, this._items[t]); } }, t.dispose = function () { P(this._element).off(R), P.removeData(this._element, j), this._items = null, this._config = null, this._element = null, this._interval = null, this._isPaused = null, this._isSliding = null, this._activeElement = null, this._indicatorsElement = null; }, t._getConfig = function (t) { return t = h({}, M, t), Cn.typeCheckConfig(L, t, x), t; }, t._addEventListeners = function () { var e = this;this._config.keyboard && P(this._element).on(Q.KEYDOWN, function (t) { return e._keydown(t); }), "hover" === this._config.pause && (P(this._element).on(Q.MOUSEENTER, function (t) { return e.pause(t); }).on(Q.MOUSELEAVE, function (t) { return e.cycle(t); }), "ontouchstart" in document.documentElement && P(this._element).on(Q.TOUCHEND, function () { e.pause(), e.touchTimeout && clearTimeout(e.touchTimeout), e.touchTimeout = setTimeout(function (t) { return e.cycle(t); }, 500 + e._config.interval); })); }, t._keydown = function (t) { if (!/input|textarea/i.test(t.target.tagName)) switch (t.which) {case 37: t.preventDefault(), this.prev();break;case 39: t.preventDefault(), this.next();} }, t._getItemIndex = function (t) { return this._items = P.makeArray(P(t).parent().find(Z.ITEM)), this._items.indexOf(t); }, t._getItemByDirection = function (t, e) { var n = t === U, i = t === K, r = this._getItemIndex(e), s = this._items.length - 1;if ((i && 0 === r || n && r === s) && !this._config.wrap) return e;var o = (r + (t === K ? -1 : 1)) % this._items.length;return -1 === o ? this._items[this._items.length - 1] : this._items[o]; }, t._triggerSlideEvent = function (t, e) { var n = this._getItemIndex(t), i = this._getItemIndex(P(this._element).find(Z.ACTIVE_ITEM)[0]), r = P.Event(Q.SLIDE, { relatedTarget: t, direction: e, from: i, to: n });return P(this._element).trigger(r), r; }, t._setActiveIndicatorElement = function (t) { if (this._indicatorsElement) { P(this._indicatorsElement).find(Z.ACTIVE).removeClass(Y);var e = this._indicatorsElement.children[this._getItemIndex(t)];e && P(e).addClass(Y); } }, t._slide = function (t, e) { var n, i, r, s = this, o = P(this._element).find(Z.ACTIVE_ITEM)[0], a = this._getItemIndex(o), l = e || o && this._getItemByDirection(t, o), h = this._getItemIndex(l), c = Boolean(this._interval);if (t === U ? (n = z, i = X, r = F) : (n = q, i = J, r = V), l && P(l).hasClass(Y)) this._isSliding = !1;else if (!this._triggerSlideEvent(l, r).isDefaultPrevented() && o && l) { this._isSliding = !0, c && this.pause(), this._setActiveIndicatorElement(l);var u = P.Event(Q.SLID, { relatedTarget: l, direction: r, from: a, to: h });if (P(this._element).hasClass(G)) { P(l).addClass(i), Cn.reflow(l), P(o).addClass(n), P(l).addClass(n);var f = Cn.getTransitionDurationFromElement(o);P(o).one(Cn.TRANSITION_END, function () { P(l).removeClass(n + " " + i).addClass(Y), P(o).removeClass(Y + " " + i + " " + n), s._isSliding = !1, setTimeout(function () { return P(s._element).trigger(u); }, 0); }).emulateTransitionEnd(f); } else P(o).removeClass(Y), P(l).addClass(Y), this._isSliding = !1, P(this._element).trigger(u);c && this.cycle(); } }, s._jQueryInterface = function (i) { return this.each(function () { var t = P(this).data(j), e = h({}, M, P(this).data());"object" == (typeof i === "undefined" ? "undefined" : _typeof(i)) && (e = h({}, e, i));var n = "string" == typeof i ? i : e.slide;if (t || (t = new s(this, e), P(this).data(j, t)), "number" == typeof i) t.to(i);else if ("string" == typeof n) { if ("undefined" == typeof t[n]) throw new TypeError('No method named "' + n + '"');t[n](); } else e.interval && (t.pause(), t.cycle()); }); }, s._dataApiClickHandler = function (t) { var e = Cn.getSelectorFromElement(this);if (e) { var n = P(e)[0];if (n && P(n).hasClass(B)) { var i = h({}, P(n).data(), P(this).data()), r = this.getAttribute("data-slide-to");r && (i.interval = !1), s._jQueryInterface.call(P(n), i), r && P(n).data(j).to(r), t.preventDefault(); } } }, o(s, null, [{ key: "VERSION", get: function get() { return "4.1.0"; } }, { key: "Default", get: function get() { return M; } }]), s; }(), P(document).on(Q.CLICK_DATA_API, Z.DATA_SLIDE, $._dataApiClickHandler), P(window).on(Q.LOAD_DATA_API, function () { P(Z.DATA_RIDE).each(function () { var t = P(this);$._jQueryInterface.call(t, t.data()); }); }), P.fn[L] = $._jQueryInterface, P.fn[L].Constructor = $, P.fn[L].noConflict = function () { return P.fn[L] = W, $._jQueryInterface; }, $), bn = (et = "collapse", it = "." + (nt = "bs.collapse"), rt = (tt = e).fn[et], st = { toggle: !0, parent: "" }, ot = { toggle: "boolean", parent: "(string|element)" }, at = { SHOW: "show" + it, SHOWN: "shown" + it, HIDE: "hide" + it, HIDDEN: "hidden" + it, CLICK_DATA_API: "click" + it + ".data-api" }, lt = "show", ht = "collapse", ct = "collapsing", ut = "collapsed", ft = "width", dt = "height", _t = { ACTIVES: ".show, .collapsing", DATA_TOGGLE: '[data-toggle="collapse"]' }, gt = function () { function a(t, e) { this._isTransitioning = !1, this._element = t, this._config = this._getConfig(e), this._triggerArray = tt.makeArray(tt('[data-toggle="collapse"][href="#' + t.id + '"],[data-toggle="collapse"][data-target="#' + t.id + '"]'));for (var n = tt(_t.DATA_TOGGLE), i = 0; i < n.length; i++) { var r = n[i], s = Cn.getSelectorFromElement(r);null !== s && 0 < tt(s).filter(t).length && (this._selector = s, this._triggerArray.push(r)); }this._parent = this._config.parent ? this._getParent() : null, this._config.parent || this._addAriaAndCollapsedClass(this._element, this._triggerArray), this._config.toggle && this.toggle(); }var t = a.prototype;return t.toggle = function () { tt(this._element).hasClass(lt) ? this.hide() : this.show(); }, t.show = function () { var t, e, n = this;if (!this._isTransitioning && !tt(this._element).hasClass(lt) && (this._parent && 0 === (t = tt.makeArray(tt(this._parent).find(_t.ACTIVES).filter('[data-parent="' + this._config.parent + '"]'))).length && (t = null), !(t && (e = tt(t).not(this._selector).data(nt)) && e._isTransitioning))) { var i = tt.Event(at.SHOW);if (tt(this._element).trigger(i), !i.isDefaultPrevented()) { t && (a._jQueryInterface.call(tt(t).not(this._selector), "hide"), e || tt(t).data(nt, null));var r = this._getDimension();tt(this._element).removeClass(ht).addClass(ct), (this._element.style[r] = 0) < this._triggerArray.length && tt(this._triggerArray).removeClass(ut).attr("aria-expanded", !0), this.setTransitioning(!0);var s = "scroll" + (r[0].toUpperCase() + r.slice(1)), o = Cn.getTransitionDurationFromElement(this._element);tt(this._element).one(Cn.TRANSITION_END, function () { tt(n._element).removeClass(ct).addClass(ht).addClass(lt), n._element.style[r] = "", n.setTransitioning(!1), tt(n._element).trigger(at.SHOWN); }).emulateTransitionEnd(o), this._element.style[r] = this._element[s] + "px"; } } }, t.hide = function () { var t = this;if (!this._isTransitioning && tt(this._element).hasClass(lt)) { var e = tt.Event(at.HIDE);if (tt(this._element).trigger(e), !e.isDefaultPrevented()) { var n = this._getDimension();if (this._element.style[n] = this._element.getBoundingClientRect()[n] + "px", Cn.reflow(this._element), tt(this._element).addClass(ct).removeClass(ht).removeClass(lt), 0 < this._triggerArray.length) for (var i = 0; i < this._triggerArray.length; i++) { var r = this._triggerArray[i], s = Cn.getSelectorFromElement(r);if (null !== s) tt(s).hasClass(lt) || tt(r).addClass(ut).attr("aria-expanded", !1); }this.setTransitioning(!0);this._element.style[n] = "";var o = Cn.getTransitionDurationFromElement(this._element);tt(this._element).one(Cn.TRANSITION_END, function () { t.setTransitioning(!1), tt(t._element).removeClass(ct).addClass(ht).trigger(at.HIDDEN); }).emulateTransitionEnd(o); } } }, t.setTransitioning = function (t) { this._isTransitioning = t; }, t.dispose = function () { tt.removeData(this._element, nt), this._config = null, this._parent = null, this._element = null, this._triggerArray = null, this._isTransitioning = null; }, t._getConfig = function (t) { return (t = h({}, st, t)).toggle = Boolean(t.toggle), Cn.typeCheckConfig(et, t, ot), t; }, t._getDimension = function () { return tt(this._element).hasClass(ft) ? ft : dt; }, t._getParent = function () { var n = this, t = null;Cn.isElement(this._config.parent) ? (t = this._config.parent, "undefined" != typeof this._config.parent.jquery && (t = this._config.parent[0])) : t = tt(this._config.parent)[0];var e = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]';return tt(t).find(e).each(function (t, e) { n._addAriaAndCollapsedClass(a._getTargetFromElement(e), [e]); }), t; }, t._addAriaAndCollapsedClass = function (t, e) { if (t) { var n = tt(t).hasClass(lt);0 < e.length && tt(e).toggleClass(ut, !n).attr("aria-expanded", n); } }, a._getTargetFromElement = function (t) { var e = Cn.getSelectorFromElement(t);return e ? tt(e)[0] : null; }, a._jQueryInterface = function (i) { return this.each(function () { var t = tt(this), e = t.data(nt), n = h({}, st, t.data(), "object" == (typeof i === "undefined" ? "undefined" : _typeof(i)) && i);if (!e && n.toggle && /show|hide/.test(i) && (n.toggle = !1), e || (e = new a(this, n), t.data(nt, e)), "string" == typeof i) { if ("undefined" == typeof e[i]) throw new TypeError('No method named "' + i + '"');e[i](); } }); }, o(a, null, [{ key: "VERSION", get: function get() { return "4.1.0"; } }, { key: "Default", get: function get() { return st; } }]), a; }(), tt(document).on(at.CLICK_DATA_API, _t.DATA_TOGGLE, function (t) { "A" === t.currentTarget.tagName && t.preventDefault();var n = tt(this), e = Cn.getSelectorFromElement(this);tt(e).each(function () { var t = tt(this), e = t.data(nt) ? "toggle" : n.data();gt._jQueryInterface.call(t, e); }); }), tt.fn[et] = gt._jQueryInterface, tt.fn[et].Constructor = gt, tt.fn[et].noConflict = function () { return tt.fn[et] = rt, gt._jQueryInterface; }, gt), Sn = (pt = "dropdown", Et = "." + (vt = "bs.dropdown"), yt = ".data-api", Tt = (mt = e).fn[pt], Ct = new RegExp("38|40|27"), It = { HIDE: "hide" + Et, HIDDEN: "hidden" + Et, SHOW: "show" + Et, SHOWN: "shown" + Et, CLICK: "click" + Et, CLICK_DATA_API: "click" + Et + yt, KEYDOWN_DATA_API: "keydown" + Et + yt, KEYUP_DATA_API: "keyup" + Et + yt }, At = "disabled", Dt = "show", bt = "dropup", St = "dropright", wt = "dropleft", Nt = "dropdown-menu-right", Ot = "position-static", kt = '[data-toggle="dropdown"]', Pt = ".dropdown form", Lt = ".dropdown-menu", jt = ".navbar-nav", Rt = ".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)", Ht = "top-start", Wt = "top-end", Mt = "bottom-start", xt = "bottom-end", Ut = "right-start", Kt = "left-start", Ft = { offset: 0, flip: !0, boundary: "scrollParent", reference: "toggle", display: "dynamic" }, Vt = { offset: "(number|string|function)", flip: "boolean", boundary: "(string|element)", reference: "(string|element)", display: "string" }, Qt = function () { function l(t, e) { this._element = t, this._popper = null, this._config = this._getConfig(e), this._menu = this._getMenuElement(), this._inNavbar = this._detectNavbar(), this._addEventListeners(); }var t = l.prototype;return t.toggle = function () { if (!this._element.disabled && !mt(this._element).hasClass(At)) { var t = l._getParentFromElement(this._element), e = mt(this._menu).hasClass(Dt);if (l._clearMenus(), !e) { var n = { relatedTarget: this._element }, i = mt.Event(It.SHOW, n);if (mt(t).trigger(i), !i.isDefaultPrevented()) { if (!this._inNavbar) { if ("undefined" == typeof c) throw new TypeError("Bootstrap dropdown require Popper.js (https://popper.js.org)");var r = this._element;"parent" === this._config.reference ? r = t : Cn.isElement(this._config.reference) && (r = this._config.reference, "undefined" != typeof this._config.reference.jquery && (r = this._config.reference[0])), "scrollParent" !== this._config.boundary && mt(t).addClass(Ot), this._popper = new c(r, this._menu, this._getPopperConfig()); }"ontouchstart" in document.documentElement && 0 === mt(t).closest(jt).length && mt(document.body).children().on("mouseover", null, mt.noop), this._element.focus(), this._element.setAttribute("aria-expanded", !0), mt(this._menu).toggleClass(Dt), mt(t).toggleClass(Dt).trigger(mt.Event(It.SHOWN, n)); } } } }, t.dispose = function () { mt.removeData(this._element, vt), mt(this._element).off(Et), this._element = null, (this._menu = null) !== this._popper && (this._popper.destroy(), this._popper = null); }, t.update = function () { this._inNavbar = this._detectNavbar(), null !== this._popper && this._popper.scheduleUpdate(); }, t._addEventListeners = function () { var e = this;mt(this._element).on(It.CLICK, function (t) { t.preventDefault(), t.stopPropagation(), e.toggle(); }); }, t._getConfig = function (t) { return t = h({}, this.constructor.Default, mt(this._element).data(), t), Cn.typeCheckConfig(pt, t, this.constructor.DefaultType), t; }, t._getMenuElement = function () { if (!this._menu) { var t = l._getParentFromElement(this._element);this._menu = mt(t).find(Lt)[0]; }return this._menu; }, t._getPlacement = function () { var t = mt(this._element).parent(), e = Mt;return t.hasClass(bt) ? (e = Ht, mt(this._menu).hasClass(Nt) && (e = Wt)) : t.hasClass(St) ? e = Ut : t.hasClass(wt) ? e = Kt : mt(this._menu).hasClass(Nt) && (e = xt), e; }, t._detectNavbar = function () { return 0 < mt(this._element).closest(".navbar").length; }, t._getPopperConfig = function () { var e = this, t = {};"function" == typeof this._config.offset ? t.fn = function (t) { return t.offsets = h({}, t.offsets, e._config.offset(t.offsets) || {}), t; } : t.offset = this._config.offset;var n = { placement: this._getPlacement(), modifiers: { offset: t, flip: { enabled: this._config.flip }, preventOverflow: { boundariesElement: this._config.boundary } } };return "static" === this._config.display && (n.modifiers.applyStyle = { enabled: !1 }), n; }, l._jQueryInterface = function (e) { return this.each(function () { var t = mt(this).data(vt);if (t || (t = new l(this, "object" == (typeof e === "undefined" ? "undefined" : _typeof(e)) ? e : null), mt(this).data(vt, t)), "string" == typeof e) { if ("undefined" == typeof t[e]) throw new TypeError('No method named "' + e + '"');t[e](); } }); }, l._clearMenus = function (t) { if (!t || 3 !== t.which && ("keyup" !== t.type || 9 === t.which)) for (var e = mt.makeArray(mt(kt)), n = 0; n < e.length; n++) { var i = l._getParentFromElement(e[n]), r = mt(e[n]).data(vt), s = { relatedTarget: e[n] };if (r) { var o = r._menu;if (mt(i).hasClass(Dt) && !(t && ("click" === t.type && /input|textarea/i.test(t.target.tagName) || "keyup" === t.type && 9 === t.which) && mt.contains(i, t.target))) { var a = mt.Event(It.HIDE, s);mt(i).trigger(a), a.isDefaultPrevented() || ("ontouchstart" in document.documentElement && mt(document.body).children().off("mouseover", null, mt.noop), e[n].setAttribute("aria-expanded", "false"), mt(o).removeClass(Dt), mt(i).removeClass(Dt).trigger(mt.Event(It.HIDDEN, s))); } } } }, l._getParentFromElement = function (t) { var e, n = Cn.getSelectorFromElement(t);return n && (e = mt(n)[0]), e || t.parentNode; }, l._dataApiKeydownHandler = function (t) { if ((/input|textarea/i.test(t.target.tagName) ? !(32 === t.which || 27 !== t.which && (40 !== t.which && 38 !== t.which || mt(t.target).closest(Lt).length)) : Ct.test(t.which)) && (t.preventDefault(), t.stopPropagation(), !this.disabled && !mt(this).hasClass(At))) { var e = l._getParentFromElement(this), n = mt(e).hasClass(Dt);if ((n || 27 === t.which && 32 === t.which) && (!n || 27 !== t.which && 32 !== t.which)) { var i = mt(e).find(Rt).get();if (0 !== i.length) { var r = i.indexOf(t.target);38 === t.which && 0 < r && r--, 40 === t.which && r < i.length - 1 && r++, r < 0 && (r = 0), i[r].focus(); } } else { if (27 === t.which) { var s = mt(e).find(kt)[0];mt(s).trigger("focus"); }mt(this).trigger("click"); } } }, o(l, null, [{ key: "VERSION", get: function get() { return "4.1.0"; } }, { key: "Default", get: function get() { return Ft; } }, { key: "DefaultType", get: function get() { return Vt; } }]), l; }(), mt(document).on(It.KEYDOWN_DATA_API, kt, Qt._dataApiKeydownHandler).on(It.KEYDOWN_DATA_API, Lt, Qt._dataApiKeydownHandler).on(It.CLICK_DATA_API + " " + It.KEYUP_DATA_API, Qt._clearMenus).on(It.CLICK_DATA_API, kt, function (t) { t.preventDefault(), t.stopPropagation(), Qt._jQueryInterface.call(mt(this), "toggle"); }).on(It.CLICK_DATA_API, Pt, function (t) { t.stopPropagation(); }), mt.fn[pt] = Qt._jQueryInterface, mt.fn[pt].Constructor = Qt, mt.fn[pt].noConflict = function () { return mt.fn[pt] = Tt, Qt._jQueryInterface; }, Qt), wn = (Yt = "modal", qt = "." + (Gt = "bs.modal"), zt = (Bt = e).fn[Yt], Xt = { backdrop: !0, keyboard: !0, focus: !0, show: !0 }, Jt = { backdrop: "(boolean|string)", keyboard: "boolean", focus: "boolean", show: "boolean" }, Zt = { HIDE: "hide" + qt, HIDDEN: "hidden" + qt, SHOW: "show" + qt, SHOWN: "shown" + qt, FOCUSIN: "focusin" + qt, RESIZE: "resize" + qt, CLICK_DISMISS: "click.dismiss" + qt, KEYDOWN_DISMISS: "keydown.dismiss" + qt, MOUSEUP_DISMISS: "mouseup.dismiss" + qt, MOUSEDOWN_DISMISS: "mousedown.dismiss" + qt, CLICK_DATA_API: "click" + qt + ".data-api" }, $t = "modal-scrollbar-measure", te = "modal-backdrop", ee = "modal-open", ne = "fade", ie = "show", re = { DIALOG: ".modal-dialog", DATA_TOGGLE: '[data-toggle="modal"]', DATA_DISMISS: '[data-dismiss="modal"]', FIXED_CONTENT: ".fixed-top, .fixed-bottom, .is-fixed, .sticky-top", STICKY_CONTENT: ".sticky-top", NAVBAR_TOGGLER: ".navbar-toggler" }, se = function () { function r(t, e) { this._config = this._getConfig(e), this._element = t, this._dialog = Bt(t).find(re.DIALOG)[0], this._backdrop = null, this._isShown = !1, this._isBodyOverflowing = !1, this._ignoreBackdropClick = !1, this._scrollbarWidth = 0; }var t = r.prototype;return t.toggle = function (t) { return this._isShown ? this.hide() : this.show(t); }, t.show = function (t) { var e = this;if (!this._isTransitioning && !this._isShown) { Bt(this._element).hasClass(ne) && (this._isTransitioning = !0);var n = Bt.Event(Zt.SHOW, { relatedTarget: t });Bt(this._element).trigger(n), this._isShown || n.isDefaultPrevented() || (this._isShown = !0, this._checkScrollbar(), this._setScrollbar(), this._adjustDialog(), Bt(document.body).addClass(ee), this._setEscapeEvent(), this._setResizeEvent(), Bt(this._element).on(Zt.CLICK_DISMISS, re.DATA_DISMISS, function (t) { return e.hide(t); }), Bt(this._dialog).on(Zt.MOUSEDOWN_DISMISS, function () { Bt(e._element).one(Zt.MOUSEUP_DISMISS, function (t) { Bt(t.target).is(e._element) && (e._ignoreBackdropClick = !0); }); }), this._showBackdrop(function () { return e._showElement(t); })); } }, t.hide = function (t) { var e = this;if (t && t.preventDefault(), !this._isTransitioning && this._isShown) { var n = Bt.Event(Zt.HIDE);if (Bt(this._element).trigger(n), this._isShown && !n.isDefaultPrevented()) { this._isShown = !1;var i = Bt(this._element).hasClass(ne);if (i && (this._isTransitioning = !0), this._setEscapeEvent(), this._setResizeEvent(), Bt(document).off(Zt.FOCUSIN), Bt(this._element).removeClass(ie), Bt(this._element).off(Zt.CLICK_DISMISS), Bt(this._dialog).off(Zt.MOUSEDOWN_DISMISS), i) { var r = Cn.getTransitionDurationFromElement(this._element);Bt(this._element).one(Cn.TRANSITION_END, function (t) { return e._hideModal(t); }).emulateTransitionEnd(r); } else this._hideModal(); } } }, t.dispose = function () { Bt.removeData(this._element, Gt), Bt(window, document, this._element, this._backdrop).off(qt), this._config = null, this._element = null, this._dialog = null, this._backdrop = null, this._isShown = null, this._isBodyOverflowing = null, this._ignoreBackdropClick = null, this._scrollbarWidth = null; }, t.handleUpdate = function () { this._adjustDialog(); }, t._getConfig = function (t) { return t = h({}, Xt, t), Cn.typeCheckConfig(Yt, t, Jt), t; }, t._showElement = function (t) { var e = this, n = Bt(this._element).hasClass(ne);this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE || document.body.appendChild(this._element), this._element.style.display = "block", this._element.removeAttribute("aria-hidden"), this._element.scrollTop = 0, n && Cn.reflow(this._element), Bt(this._element).addClass(ie), this._config.focus && this._enforceFocus();var i = Bt.Event(Zt.SHOWN, { relatedTarget: t }), r = function r() { e._config.focus && e._element.focus(), e._isTransitioning = !1, Bt(e._element).trigger(i); };if (n) { var s = Cn.getTransitionDurationFromElement(this._element);Bt(this._dialog).one(Cn.TRANSITION_END, r).emulateTransitionEnd(s); } else r(); }, t._enforceFocus = function () { var e = this;Bt(document).off(Zt.FOCUSIN).on(Zt.FOCUSIN, function (t) { document !== t.target && e._element !== t.target && 0 === Bt(e._element).has(t.target).length && e._element.focus(); }); }, t._setEscapeEvent = function () { var e = this;this._isShown && this._config.keyboard ? Bt(this._element).on(Zt.KEYDOWN_DISMISS, function (t) { 27 === t.which && (t.preventDefault(), e.hide()); }) : this._isShown || Bt(this._element).off(Zt.KEYDOWN_DISMISS); }, t._setResizeEvent = function () { var e = this;this._isShown ? Bt(window).on(Zt.RESIZE, function (t) { return e.handleUpdate(t); }) : Bt(window).off(Zt.RESIZE); }, t._hideModal = function () { var t = this;this._element.style.display = "none", this._element.setAttribute("aria-hidden", !0), this._isTransitioning = !1, this._showBackdrop(function () { Bt(document.body).removeClass(ee), t._resetAdjustments(), t._resetScrollbar(), Bt(t._element).trigger(Zt.HIDDEN); }); }, t._removeBackdrop = function () { this._backdrop && (Bt(this._backdrop).remove(), this._backdrop = null); }, t._showBackdrop = function (t) { var e = this, n = Bt(this._element).hasClass(ne) ? ne : "";if (this._isShown && this._config.backdrop) { if (this._backdrop = document.createElement("div"), this._backdrop.className = te, n && Bt(this._backdrop).addClass(n), Bt(this._backdrop).appendTo(document.body), Bt(this._element).on(Zt.CLICK_DISMISS, function (t) { e._ignoreBackdropClick ? e._ignoreBackdropClick = !1 : t.target === t.currentTarget && ("static" === e._config.backdrop ? e._element.focus() : e.hide()); }), n && Cn.reflow(this._backdrop), Bt(this._backdrop).addClass(ie), !t) return;if (!n) return void t();var i = Cn.getTransitionDurationFromElement(this._backdrop);Bt(this._backdrop).one(Cn.TRANSITION_END, t).emulateTransitionEnd(i); } else if (!this._isShown && this._backdrop) { Bt(this._backdrop).removeClass(ie);var r = function r() { e._removeBackdrop(), t && t(); };if (Bt(this._element).hasClass(ne)) { var s = Cn.getTransitionDurationFromElement(this._backdrop);Bt(this._backdrop).one(Cn.TRANSITION_END, r).emulateTransitionEnd(s); } else r(); } else t && t(); }, t._adjustDialog = function () { var t = this._element.scrollHeight > document.documentElement.clientHeight;!this._isBodyOverflowing && t && (this._element.style.paddingLeft = this._scrollbarWidth + "px"), this._isBodyOverflowing && !t && (this._element.style.paddingRight = this._scrollbarWidth + "px"); }, t._resetAdjustments = function () { this._element.style.paddingLeft = "", this._element.style.paddingRight = ""; }, t._checkScrollbar = function () { var t = document.body.getBoundingClientRect();this._isBodyOverflowing = t.left + t.right < window.innerWidth, this._scrollbarWidth = this._getScrollbarWidth(); }, t._setScrollbar = function () { var r = this;if (this._isBodyOverflowing) { Bt(re.FIXED_CONTENT).each(function (t, e) { var n = Bt(e)[0].style.paddingRight, i = Bt(e).css("padding-right");Bt(e).data("padding-right", n).css("padding-right", parseFloat(i) + r._scrollbarWidth + "px"); }), Bt(re.STICKY_CONTENT).each(function (t, e) { var n = Bt(e)[0].style.marginRight, i = Bt(e).css("margin-right");Bt(e).data("margin-right", n).css("margin-right", parseFloat(i) - r._scrollbarWidth + "px"); }), Bt(re.NAVBAR_TOGGLER).each(function (t, e) { var n = Bt(e)[0].style.marginRight, i = Bt(e).css("margin-right");Bt(e).data("margin-right", n).css("margin-right", parseFloat(i) + r._scrollbarWidth + "px"); });var t = document.body.style.paddingRight, e = Bt(document.body).css("padding-right");Bt(document.body).data("padding-right", t).css("padding-right", parseFloat(e) + this._scrollbarWidth + "px"); } }, t._resetScrollbar = function () { Bt(re.FIXED_CONTENT).each(function (t, e) { var n = Bt(e).data("padding-right");"undefined" != typeof n && Bt(e).css("padding-right", n).removeData("padding-right"); }), Bt(re.STICKY_CONTENT + ", " + re.NAVBAR_TOGGLER).each(function (t, e) { var n = Bt(e).data("margin-right");"undefined" != typeof n && Bt(e).css("margin-right", n).removeData("margin-right"); });var t = Bt(document.body).data("padding-right");"undefined" != typeof t && Bt(document.body).css("padding-right", t).removeData("padding-right"); }, t._getScrollbarWidth = function () { var t = document.createElement("div");t.className = $t, document.body.appendChild(t);var e = t.getBoundingClientRect().width - t.clientWidth;return document.body.removeChild(t), e; }, r._jQueryInterface = function (n, i) { return this.each(function () { var t = Bt(this).data(Gt), e = h({}, r.Default, Bt(this).data(), "object" == (typeof n === "undefined" ? "undefined" : _typeof(n)) && n);if (t || (t = new r(this, e), Bt(this).data(Gt, t)), "string" == typeof n) { if ("undefined" == typeof t[n]) throw new TypeError('No method named "' + n + '"');t[n](i); } else e.show && t.show(i); }); }, o(r, null, [{ key: "VERSION", get: function get() { return "4.1.0"; } }, { key: "Default", get: function get() { return Xt; } }]), r; }(), Bt(document).on(Zt.CLICK_DATA_API, re.DATA_TOGGLE, function (t) { var e, n = this, i = Cn.getSelectorFromElement(this);i && (e = Bt(i)[0]);var r = Bt(e).data(Gt) ? "toggle" : h({}, Bt(e).data(), Bt(this).data());"A" !== this.tagName && "AREA" !== this.tagName || t.preventDefault();var s = Bt(e).one(Zt.SHOW, function (t) { t.isDefaultPrevented() || s.one(Zt.HIDDEN, function () { Bt(n).is(":visible") && n.focus(); }); });se._jQueryInterface.call(Bt(e), r, this); }), Bt.fn[Yt] = se._jQueryInterface, Bt.fn[Yt].Constructor = se, Bt.fn[Yt].noConflict = function () { return Bt.fn[Yt] = zt, se._jQueryInterface; }, se), Nn = (ae = "tooltip", he = "." + (le = "bs.tooltip"), ce = (oe = e).fn[ae], ue = "bs-tooltip", fe = new RegExp("(^|\\s)" + ue + "\\S+", "g"), ge = { animation: !0, template: '', trigger: "hover focus", title: "", delay: 0, html: !(_e = { AUTO: "auto", TOP: "top", RIGHT: "right", BOTTOM: "bottom", LEFT: "left" }), selector: !(de = { animation: "boolean", template: "string", title: "(string|element|function)", trigger: "string", delay: "(number|object)", html: "boolean", selector: "(string|boolean)", placement: "(string|function)", offset: "(number|string)", container: "(string|element|boolean)", fallbackPlacement: "(string|array)", boundary: "(string|element)" }), placement: "top", offset: 0, container: !1, fallbackPlacement: "flip", boundary: "scrollParent" }, pe = "out", ve = { HIDE: "hide" + he, HIDDEN: "hidden" + he, SHOW: (me = "show") + he, SHOWN: "shown" + he, INSERTED: "inserted" + he, CLICK: "click" + he, FOCUSIN: "focusin" + he, FOCUSOUT: "focusout" + he, MOUSEENTER: "mouseenter" + he, MOUSELEAVE: "mouseleave" + he }, Ee = "fade", ye = "show", Te = ".tooltip-inner", Ce = ".arrow", Ie = "hover", Ae = "focus", De = "click", be = "manual", Se = function () { function i(t, e) { if ("undefined" == typeof c) throw new TypeError("Bootstrap tooltips require Popper.js (https://popper.js.org)");this._isEnabled = !0, this._timeout = 0, this._hoverState = "", this._activeTrigger = {}, this._popper = null, this.element = t, this.config = this._getConfig(e), this.tip = null, this._setListeners(); }var t = i.prototype;return t.enable = function () { this._isEnabled = !0; }, t.disable = function () { this._isEnabled = !1; }, t.toggleEnabled = function () { this._isEnabled = !this._isEnabled; }, t.toggle = function (t) { if (this._isEnabled) if (t) { var e = this.constructor.DATA_KEY, n = oe(t.currentTarget).data(e);n || (n = new this.constructor(t.currentTarget, this._getDelegateConfig()), oe(t.currentTarget).data(e, n)), n._activeTrigger.click = !n._activeTrigger.click, n._isWithActiveTrigger() ? n._enter(null, n) : n._leave(null, n); } else { if (oe(this.getTipElement()).hasClass(ye)) return void this._leave(null, this);this._enter(null, this); } }, t.dispose = function () { clearTimeout(this._timeout), oe.removeData(this.element, this.constructor.DATA_KEY), oe(this.element).off(this.constructor.EVENT_KEY), oe(this.element).closest(".modal").off("hide.bs.modal"), this.tip && oe(this.tip).remove(), this._isEnabled = null, this._timeout = null, this._hoverState = null, (this._activeTrigger = null) !== this._popper && this._popper.destroy(), this._popper = null, this.element = null, this.config = null, this.tip = null; }, t.show = function () { var e = this;if ("none" === oe(this.element).css("display")) throw new Error("Please use show on visible elements");var t = oe.Event(this.constructor.Event.SHOW);if (this.isWithContent() && this._isEnabled) { oe(this.element).trigger(t);var n = oe.contains(this.element.ownerDocument.documentElement, this.element);if (t.isDefaultPrevented() || !n) return;var i = this.getTipElement(), r = Cn.getUID(this.constructor.NAME);i.setAttribute("id", r), this.element.setAttribute("aria-describedby", r), this.setContent(), this.config.animation && oe(i).addClass(Ee);var s = "function" == typeof this.config.placement ? this.config.placement.call(this, i, this.element) : this.config.placement, o = this._getAttachment(s);this.addAttachmentClass(o);var a = !1 === this.config.container ? document.body : oe(this.config.container);oe(i).data(this.constructor.DATA_KEY, this), oe.contains(this.element.ownerDocument.documentElement, this.tip) || oe(i).appendTo(a), oe(this.element).trigger(this.constructor.Event.INSERTED), this._popper = new c(this.element, i, { placement: o, modifiers: { offset: { offset: this.config.offset }, flip: { behavior: this.config.fallbackPlacement }, arrow: { element: Ce }, preventOverflow: { boundariesElement: this.config.boundary } }, onCreate: function onCreate(t) { t.originalPlacement !== t.placement && e._handlePopperPlacementChange(t); }, onUpdate: function onUpdate(t) { e._handlePopperPlacementChange(t); } }), oe(i).addClass(ye), "ontouchstart" in document.documentElement && oe(document.body).children().on("mouseover", null, oe.noop);var l = function l() { e.config.animation && e._fixTransition();var t = e._hoverState;e._hoverState = null, oe(e.element).trigger(e.constructor.Event.SHOWN), t === pe && e._leave(null, e); };if (oe(this.tip).hasClass(Ee)) { var h = Cn.getTransitionDurationFromElement(this.tip);oe(this.tip).one(Cn.TRANSITION_END, l).emulateTransitionEnd(h); } else l(); } }, t.hide = function (t) { var e = this, n = this.getTipElement(), i = oe.Event(this.constructor.Event.HIDE), r = function r() { e._hoverState !== me && n.parentNode && n.parentNode.removeChild(n), e._cleanTipClass(), e.element.removeAttribute("aria-describedby"), oe(e.element).trigger(e.constructor.Event.HIDDEN), null !== e._popper && e._popper.destroy(), t && t(); };if (oe(this.element).trigger(i), !i.isDefaultPrevented()) { if (oe(n).removeClass(ye), "ontouchstart" in document.documentElement && oe(document.body).children().off("mouseover", null, oe.noop), this._activeTrigger[De] = !1, this._activeTrigger[Ae] = !1, this._activeTrigger[Ie] = !1, oe(this.tip).hasClass(Ee)) { var s = Cn.getTransitionDurationFromElement(n);oe(n).one(Cn.TRANSITION_END, r).emulateTransitionEnd(s); } else r();this._hoverState = ""; } }, t.update = function () { null !== this._popper && this._popper.scheduleUpdate(); }, t.isWithContent = function () { return Boolean(this.getTitle()); }, t.addAttachmentClass = function (t) { oe(this.getTipElement()).addClass(ue + "-" + t); }, t.getTipElement = function () { return this.tip = this.tip || oe(this.config.template)[0], this.tip; }, t.setContent = function () { var t = oe(this.getTipElement());this.setElementContent(t.find(Te), this.getTitle()), t.removeClass(Ee + " " + ye); }, t.setElementContent = function (t, e) { var n = this.config.html;"object" == (typeof e === "undefined" ? "undefined" : _typeof(e)) && (e.nodeType || e.jquery) ? n ? oe(e).parent().is(t) || t.empty().append(e) : t.text(oe(e).text()) : t[n ? "html" : "text"](e); }, t.getTitle = function () { var t = this.element.getAttribute("data-original-title");return t || (t = "function" == typeof this.config.title ? this.config.title.call(this.element) : this.config.title), t; }, t._getAttachment = function (t) { return _e[t.toUpperCase()]; }, t._setListeners = function () { var i = this;this.config.trigger.split(" ").forEach(function (t) { if ("click" === t) oe(i.element).on(i.constructor.Event.CLICK, i.config.selector, function (t) { return i.toggle(t); });else if (t !== be) { var e = t === Ie ? i.constructor.Event.MOUSEENTER : i.constructor.Event.FOCUSIN, n = t === Ie ? i.constructor.Event.MOUSELEAVE : i.constructor.Event.FOCUSOUT;oe(i.element).on(e, i.config.selector, function (t) { return i._enter(t); }).on(n, i.config.selector, function (t) { return i._leave(t); }); }oe(i.element).closest(".modal").on("hide.bs.modal", function () { return i.hide(); }); }), this.config.selector ? this.config = h({}, this.config, { trigger: "manual", selector: "" }) : this._fixTitle(); }, t._fixTitle = function () { var t = _typeof(this.element.getAttribute("data-original-title"));(this.element.getAttribute("title") || "string" !== t) && (this.element.setAttribute("data-original-title", this.element.getAttribute("title") || ""), this.element.setAttribute("title", "")); }, t._enter = function (t, e) { var n = this.constructor.DATA_KEY;(e = e || oe(t.currentTarget).data(n)) || (e = new this.constructor(t.currentTarget, this._getDelegateConfig()), oe(t.currentTarget).data(n, e)), t && (e._activeTrigger["focusin" === t.type ? Ae : Ie] = !0), oe(e.getTipElement()).hasClass(ye) || e._hoverState === me ? e._hoverState = me : (clearTimeout(e._timeout), e._hoverState = me, e.config.delay && e.config.delay.show ? e._timeout = setTimeout(function () { e._hoverState === me && e.show(); }, e.config.delay.show) : e.show()); }, t._leave = function (t, e) { var n = this.constructor.DATA_KEY;(e = e || oe(t.currentTarget).data(n)) || (e = new this.constructor(t.currentTarget, this._getDelegateConfig()), oe(t.currentTarget).data(n, e)), t && (e._activeTrigger["focusout" === t.type ? Ae : Ie] = !1), e._isWithActiveTrigger() || (clearTimeout(e._timeout), e._hoverState = pe, e.config.delay && e.config.delay.hide ? e._timeout = setTimeout(function () { e._hoverState === pe && e.hide(); }, e.config.delay.hide) : e.hide()); }, t._isWithActiveTrigger = function () { for (var t in this._activeTrigger) { if (this._activeTrigger[t]) return !0; }return !1; }, t._getConfig = function (t) { return "number" == typeof (t = h({}, this.constructor.Default, oe(this.element).data(), t)).delay && (t.delay = { show: t.delay, hide: t.delay }), "number" == typeof t.title && (t.title = t.title.toString()), "number" == typeof t.content && (t.content = t.content.toString()), Cn.typeCheckConfig(ae, t, this.constructor.DefaultType), t; }, t._getDelegateConfig = function () { var t = {};if (this.config) for (var e in this.config) { this.constructor.Default[e] !== this.config[e] && (t[e] = this.config[e]); }return t; }, t._cleanTipClass = function () { var t = oe(this.getTipElement()), e = t.attr("class").match(fe);null !== e && 0 < e.length && t.removeClass(e.join("")); }, t._handlePopperPlacementChange = function (t) { this._cleanTipClass(), this.addAttachmentClass(this._getAttachment(t.placement)); }, t._fixTransition = function () { var t = this.getTipElement(), e = this.config.animation;null === t.getAttribute("x-placement") && (oe(t).removeClass(Ee), this.config.animation = !1, this.hide(), this.show(), this.config.animation = e); }, i._jQueryInterface = function (n) { return this.each(function () { var t = oe(this).data(le), e = "object" == (typeof n === "undefined" ? "undefined" : _typeof(n)) && n;if ((t || !/dispose|hide/.test(n)) && (t || (t = new i(this, e), oe(this).data(le, t)), "string" == typeof n)) { if ("undefined" == typeof t[n]) throw new TypeError('No method named "' + n + '"');t[n](); } }); }, o(i, null, [{ key: "VERSION", get: function get() { return "4.1.0"; } }, { key: "Default", get: function get() { return ge; } }, { key: "NAME", get: function get() { return ae; } }, { key: "DATA_KEY", get: function get() { return le; } }, { key: "Event", get: function get() { return ve; } }, { key: "EVENT_KEY", get: function get() { return he; } }, { key: "DefaultType", get: function get() { return de; } }]), i; }(), oe.fn[ae] = Se._jQueryInterface, oe.fn[ae].Constructor = Se, oe.fn[ae].noConflict = function () { return oe.fn[ae] = ce, Se._jQueryInterface; }, Se), On = (Ne = "popover", ke = "." + (Oe = "bs.popover"), Pe = (we = e).fn[Ne], Le = "bs-popover", je = new RegExp("(^|\\s)" + Le + "\\S+", "g"), Re = h({}, Nn.Default, { placement: "right", trigger: "click", content: "", template: '' }), He = h({}, Nn.DefaultType, { content: "(string|element|function)" }), We = "fade", xe = ".popover-header", Ue = ".popover-body", Ke = { HIDE: "hide" + ke, HIDDEN: "hidden" + ke, SHOW: (Me = "show") + ke, SHOWN: "shown" + ke, INSERTED: "inserted" + ke, CLICK: "click" + ke, FOCUSIN: "focusin" + ke, FOCUSOUT: "focusout" + ke, MOUSEENTER: "mouseenter" + ke, MOUSELEAVE: "mouseleave" + ke }, Fe = function (t) { var e, n;function i() { return t.apply(this, arguments) || this; }n = t, (e = i).prototype = Object.create(n.prototype), (e.prototype.constructor = e).__proto__ = n;var r = i.prototype;return r.isWithContent = function () { return this.getTitle() || this._getContent(); }, r.addAttachmentClass = function (t) { we(this.getTipElement()).addClass(Le + "-" + t); }, r.getTipElement = function () { return this.tip = this.tip || we(this.config.template)[0], this.tip; }, r.setContent = function () { var t = we(this.getTipElement());this.setElementContent(t.find(xe), this.getTitle());var e = this._getContent();"function" == typeof e && (e = e.call(this.element)), this.setElementContent(t.find(Ue), e), t.removeClass(We + " " + Me); }, r._getContent = function () { return this.element.getAttribute("data-content") || this.config.content; }, r._cleanTipClass = function () { var t = we(this.getTipElement()), e = t.attr("class").match(je);null !== e && 0 < e.length && t.removeClass(e.join("")); }, i._jQueryInterface = function (n) { return this.each(function () { var t = we(this).data(Oe), e = "object" == (typeof n === "undefined" ? "undefined" : _typeof(n)) ? n : null;if ((t || !/destroy|hide/.test(n)) && (t || (t = new i(this, e), we(this).data(Oe, t)), "string" == typeof n)) { if ("undefined" == typeof t[n]) throw new TypeError('No method named "' + n + '"');t[n](); } }); }, o(i, null, [{ key: "VERSION", get: function get() { return "4.1.0"; } }, { key: "Default", get: function get() { return Re; } }, { key: "NAME", get: function get() { return Ne; } }, { key: "DATA_KEY", get: function get() { return Oe; } }, { key: "Event", get: function get() { return Ke; } }, { key: "EVENT_KEY", get: function get() { return ke; } }, { key: "DefaultType", get: function get() { return He; } }]), i; }(Nn), we.fn[Ne] = Fe._jQueryInterface, we.fn[Ne].Constructor = Fe, we.fn[Ne].noConflict = function () { return we.fn[Ne] = Pe, Fe._jQueryInterface; }, Fe), kn = (Qe = "scrollspy", Ye = "." + (Be = "bs.scrollspy"), Ge = (Ve = e).fn[Qe], qe = { offset: 10, method: "auto", target: "" }, ze = { offset: "number", method: "string", target: "(string|element)" }, Xe = { ACTIVATE: "activate" + Ye, SCROLL: "scroll" + Ye, LOAD_DATA_API: "load" + Ye + ".data-api" }, Je = "dropdown-item", Ze = "active", $e = { DATA_SPY: '[data-spy="scroll"]', ACTIVE: ".active", NAV_LIST_GROUP: ".nav, .list-group", NAV_LINKS: ".nav-link", NAV_ITEMS: ".nav-item", LIST_ITEMS: ".list-group-item", DROPDOWN: ".dropdown", DROPDOWN_ITEMS: ".dropdown-item", DROPDOWN_TOGGLE: ".dropdown-toggle" }, tn = "offset", en = "position", nn = function () { function n(t, e) { var n = this;this._element = t, this._scrollElement = "BODY" === t.tagName ? window : t, this._config = this._getConfig(e), this._selector = this._config.target + " " + $e.NAV_LINKS + "," + this._config.target + " " + $e.LIST_ITEMS + "," + this._config.target + " " + $e.DROPDOWN_ITEMS, this._offsets = [], this._targets = [], this._activeTarget = null, this._scrollHeight = 0, Ve(this._scrollElement).on(Xe.SCROLL, function (t) { return n._process(t); }), this.refresh(), this._process(); }var t = n.prototype;return t.refresh = function () { var e = this, t = this._scrollElement === this._scrollElement.window ? tn : en, r = "auto" === this._config.method ? t : this._config.method, s = r === en ? this._getScrollTop() : 0;this._offsets = [], this._targets = [], this._scrollHeight = this._getScrollHeight(), Ve.makeArray(Ve(this._selector)).map(function (t) { var e, n = Cn.getSelectorFromElement(t);if (n && (e = Ve(n)[0]), e) { var i = e.getBoundingClientRect();if (i.width || i.height) return [Ve(e)[r]().top + s, n]; }return null; }).filter(function (t) { return t; }).sort(function (t, e) { return t[0] - e[0]; }).forEach(function (t) { e._offsets.push(t[0]), e._targets.push(t[1]); }); }, t.dispose = function () { Ve.removeData(this._element, Be), Ve(this._scrollElement).off(Ye), this._element = null, this._scrollElement = null, this._config = null, this._selector = null, this._offsets = null, this._targets = null, this._activeTarget = null, this._scrollHeight = null; }, t._getConfig = function (t) { if ("string" != typeof (t = h({}, qe, t)).target) { var e = Ve(t.target).attr("id");e || (e = Cn.getUID(Qe), Ve(t.target).attr("id", e)), t.target = "#" + e; }return Cn.typeCheckConfig(Qe, t, ze), t; }, t._getScrollTop = function () { return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; }, t._getScrollHeight = function () { return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); }, t._getOffsetHeight = function () { return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; }, t._process = function () { var t = this._getScrollTop() + this._config.offset, e = this._getScrollHeight(), n = this._config.offset + e - this._getOffsetHeight();if (this._scrollHeight !== e && this.refresh(), n <= t) { var i = this._targets[this._targets.length - 1];this._activeTarget !== i && this._activate(i); } else { if (this._activeTarget && t < this._offsets[0] && 0 < this._offsets[0]) return this._activeTarget = null, void this._clear();for (var r = this._offsets.length; r--;) { this._activeTarget !== this._targets[r] && t >= this._offsets[r] && ("undefined" == typeof this._offsets[r + 1] || t < this._offsets[r + 1]) && this._activate(this._targets[r]); } } }, t._activate = function (e) { this._activeTarget = e, this._clear();var t = this._selector.split(",");t = t.map(function (t) { return t + '[data-target="' + e + '"],' + t + '[href="' + e + '"]'; });var n = Ve(t.join(","));n.hasClass(Je) ? (n.closest($e.DROPDOWN).find($e.DROPDOWN_TOGGLE).addClass(Ze), n.addClass(Ze)) : (n.addClass(Ze), n.parents($e.NAV_LIST_GROUP).prev($e.NAV_LINKS + ", " + $e.LIST_ITEMS).addClass(Ze), n.parents($e.NAV_LIST_GROUP).prev($e.NAV_ITEMS).children($e.NAV_LINKS).addClass(Ze)), Ve(this._scrollElement).trigger(Xe.ACTIVATE, { relatedTarget: e }); }, t._clear = function () { Ve(this._selector).filter($e.ACTIVE).removeClass(Ze); }, n._jQueryInterface = function (e) { return this.each(function () { var t = Ve(this).data(Be);if (t || (t = new n(this, "object" == (typeof e === "undefined" ? "undefined" : _typeof(e)) && e), Ve(this).data(Be, t)), "string" == typeof e) { if ("undefined" == typeof t[e]) throw new TypeError('No method named "' + e + '"');t[e](); } }); }, o(n, null, [{ key: "VERSION", get: function get() { return "4.1.0"; } }, { key: "Default", get: function get() { return qe; } }]), n; }(), Ve(window).on(Xe.LOAD_DATA_API, function () { for (var t = Ve.makeArray(Ve($e.DATA_SPY)), e = t.length; e--;) { var n = Ve(t[e]);nn._jQueryInterface.call(n, n.data()); } }), Ve.fn[Qe] = nn._jQueryInterface, Ve.fn[Qe].Constructor = nn, Ve.fn[Qe].noConflict = function () { return Ve.fn[Qe] = Ge, nn._jQueryInterface; }, nn), Pn = (on = "." + (sn = "bs.tab"), an = (rn = e).fn.tab, ln = { HIDE: "hide" + on, HIDDEN: "hidden" + on, SHOW: "show" + on, SHOWN: "shown" + on, CLICK_DATA_API: "click" + on + ".data-api" }, hn = "dropdown-menu", cn = "active", un = "disabled", fn = "fade", dn = "show", _n = ".dropdown", gn = ".nav, .list-group", mn = ".active", pn = "> li > .active", vn = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', En = ".dropdown-toggle", yn = "> .dropdown-menu .active", Tn = function () { function i(t) { this._element = t; }var t = i.prototype;return t.show = function () { var n = this;if (!(this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && rn(this._element).hasClass(cn) || rn(this._element).hasClass(un))) { var t, i, e = rn(this._element).closest(gn)[0], r = Cn.getSelectorFromElement(this._element);if (e) { var s = "UL" === e.nodeName ? pn : mn;i = (i = rn.makeArray(rn(e).find(s)))[i.length - 1]; }var o = rn.Event(ln.HIDE, { relatedTarget: this._element }), a = rn.Event(ln.SHOW, { relatedTarget: i });if (i && rn(i).trigger(o), rn(this._element).trigger(a), !a.isDefaultPrevented() && !o.isDefaultPrevented()) { r && (t = rn(r)[0]), this._activate(this._element, e);var l = function l() { var t = rn.Event(ln.HIDDEN, { relatedTarget: n._element }), e = rn.Event(ln.SHOWN, { relatedTarget: i });rn(i).trigger(t), rn(n._element).trigger(e); };t ? this._activate(t, t.parentNode, l) : l(); } } }, t.dispose = function () { rn.removeData(this._element, sn), this._element = null; }, t._activate = function (t, e, n) { var i = this, r = ("UL" === e.nodeName ? rn(e).find(pn) : rn(e).children(mn))[0], s = n && r && rn(r).hasClass(fn), o = function o() { return i._transitionComplete(t, r, n); };if (r && s) { var a = Cn.getTransitionDurationFromElement(r);rn(r).one(Cn.TRANSITION_END, o).emulateTransitionEnd(a); } else o(); }, t._transitionComplete = function (t, e, n) { if (e) { rn(e).removeClass(dn + " " + cn);var i = rn(e.parentNode).find(yn)[0];i && rn(i).removeClass(cn), "tab" === e.getAttribute("role") && e.setAttribute("aria-selected", !1); }if (rn(t).addClass(cn), "tab" === t.getAttribute("role") && t.setAttribute("aria-selected", !0), Cn.reflow(t), rn(t).addClass(dn), t.parentNode && rn(t.parentNode).hasClass(hn)) { var r = rn(t).closest(_n)[0];r && rn(r).find(En).addClass(cn), t.setAttribute("aria-expanded", !0); }n && n(); }, i._jQueryInterface = function (n) { return this.each(function () { var t = rn(this), e = t.data(sn);if (e || (e = new i(this), t.data(sn, e)), "string" == typeof n) { if ("undefined" == typeof e[n]) throw new TypeError('No method named "' + n + '"');e[n](); } }); }, o(i, null, [{ key: "VERSION", get: function get() { return "4.1.0"; } }]), i; }(), rn(document).on(ln.CLICK_DATA_API, vn, function (t) { t.preventDefault(), Tn._jQueryInterface.call(rn(this), "show"); }), rn.fn.tab = Tn._jQueryInterface, rn.fn.tab.Constructor = Tn, rn.fn.tab.noConflict = function () { return rn.fn.tab = an, Tn._jQueryInterface; }, Tn);!function (t) { if ("undefined" == typeof t) throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var e = t.fn.jquery.split(" ")[0].split(".");if (e[0] < 2 && e[1] < 9 || 1 === e[0] && 9 === e[1] && e[2] < 1 || 4 <= e[0]) throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0"); }(e), t.Util = Cn, t.Alert = In, t.Button = An, t.Carousel = Dn, t.Collapse = bn, t.Dropdown = Sn, t.Modal = wn, t.Popover = On, t.Scrollspy = kn, t.Tab = Pn, t.Tooltip = Nn, Object.defineProperty(t, "__esModule", { value: !0 }); }); //# sourceMappingURL=bootstrap.min.js.map /***/ }), /***/ "./src/js/components/cookie-alert.js": /*!*******************************************!*\ !*** ./src/js/components/cookie-alert.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(jQuery) { // Cookie Hinweis jQuery(document).ready(function ($) { var cookieAlert = $('.cookie-alert'); if (document.cookie.indexOf("cookie-hide=1") != -1) { cookieAlert.hide(); } else { cookieAlert.prependTo("body").slideToggle(); } }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ "jquery"))) /***/ }), /***/ "./src/js/components/jquery.validate.js": /*!**********************************************!*\ !*** ./src/js/components/jquery.validate.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /*! * jQuery Validation Plugin v1.19.1 * * https://jqueryvalidation.org/ * * Copyright (c) 2019 Jörn Zaefferer * Released under the MIT license */ (function (factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "jquery")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} })(function ($) { $.extend($.fn, { // https://jqueryvalidation.org/validate/ validate: function validate(options) { // If nothing is selected, return nothing; can't chain anyway if (!this.length) { if (options && options.debug && window.console) { console.warn("Nothing selected, can't validate, returning nothing."); } return; } // Check if a validator for this form was already created var validator = $.data(this[0], "validator"); if (validator) { return validator; } // Add novalidate tag if HTML5. this.attr("novalidate", "novalidate"); validator = new $.validator(options, this[0]); $.data(this[0], "validator", validator); if (validator.settings.onsubmit) { this.on("click.validate", ":submit", function (event) { // Track the used submit button to properly handle scripted // submits later. validator.submitButton = event.currentTarget; // Allow suppressing validation by adding a cancel class to the submit button if ($(this).hasClass("cancel")) { validator.cancelSubmit = true; } // Allow suppressing validation by adding the html5 formnovalidate attribute to the submit button if ($(this).attr("formnovalidate") !== undefined) { validator.cancelSubmit = true; } }); // Validate the form on submit this.on("submit.validate", function (event) { if (validator.settings.debug) { // Prevent form submit to be able to see console output event.preventDefault(); } function handle() { var hidden, result; // Insert a hidden input as a replacement for the missing submit button // The hidden input is inserted in two cases: // - A user defined a `submitHandler` // - There was a pending request due to `remote` method and `stopRequest()` // was called to submit the form in case it's valid if (validator.submitButton && (validator.settings.submitHandler || validator.formSubmitted)) { hidden = $("").attr("name", validator.submitButton.name).val($(validator.submitButton).val()).appendTo(validator.currentForm); } if (validator.settings.submitHandler && !validator.settings.debug) { result = validator.settings.submitHandler.call(validator, validator.currentForm, event); if (hidden) { // And clean up afterwards; thanks to no-block-scope, hidden can be referenced hidden.remove(); } if (result !== undefined) { return result; } return false; } return true; } // Prevent submit for invalid forms or custom submit handlers if (validator.cancelSubmit) { validator.cancelSubmit = false; return handle(); } if (validator.form()) { if (validator.pendingRequest) { validator.formSubmitted = true; return false; } return handle(); } else { validator.focusInvalid(); return false; } }); } return validator; }, // https://jqueryvalidation.org/valid/ valid: function valid() { var valid, validator, errorList; if ($(this[0]).is("form")) { valid = this.validate().form(); } else { errorList = []; valid = true; validator = $(this[0].form).validate(); this.each(function () { valid = validator.element(this) && valid; if (!valid) { errorList = errorList.concat(validator.errorList); } }); validator.errorList = errorList; } return valid; }, // https://jqueryvalidation.org/rules/ rules: function rules(command, argument) { var element = this[0], isContentEditable = typeof this.attr("contenteditable") !== "undefined" && this.attr("contenteditable") !== "false", settings, staticRules, existingRules, data, param, filtered; // If nothing is selected, return empty object; can't chain anyway if (element == null) { return; } if (!element.form && isContentEditable) { element.form = this.closest("form")[0]; element.name = this.attr("name"); } if (element.form == null) { return; } if (command) { settings = $.data(element.form, "validator").settings; staticRules = settings.rules; existingRules = $.validator.staticRules(element); switch (command) { case "add": $.extend(existingRules, $.validator.normalizeRule(argument)); // Remove messages from rules, but allow them to be set separately delete existingRules.messages; staticRules[element.name] = existingRules; if (argument.messages) { settings.messages[element.name] = $.extend(settings.messages[element.name], argument.messages); } break; case "remove": if (!argument) { delete staticRules[element.name]; return existingRules; } filtered = {}; $.each(argument.split(/\s/), function (index, method) { filtered[method] = existingRules[method]; delete existingRules[method]; }); return filtered; } } data = $.validator.normalizeRules($.extend({}, $.validator.classRules(element), $.validator.attributeRules(element), $.validator.dataRules(element), $.validator.staticRules(element)), element); // Make sure required is at front if (data.required) { param = data.required; delete data.required; data = $.extend({ required: param }, data); } // Make sure remote is at back if (data.remote) { param = data.remote; delete data.remote; data = $.extend(data, { remote: param }); } return data; } }); // Custom selectors $.extend($.expr.pseudos || $.expr[":"], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support // https://jqueryvalidation.org/blank-selector/ blank: function blank(a) { return !$.trim("" + $(a).val()); }, // https://jqueryvalidation.org/filled-selector/ filled: function filled(a) { var val = $(a).val(); return val !== null && !!$.trim("" + val); }, // https://jqueryvalidation.org/unchecked-selector/ unchecked: function unchecked(a) { return !$(a).prop("checked"); } }); // Constructor for validator $.validator = function (options, form) { this.settings = $.extend(true, {}, $.validator.defaults, options); this.currentForm = form; this.init(); }; // https://jqueryvalidation.org/jQuery.validator.format/ $.validator.format = function (source, params) { if (arguments.length === 1) { return function () { var args = $.makeArray(arguments); args.unshift(source); return $.validator.format.apply(this, args); }; } if (params === undefined) { return source; } if (arguments.length > 2 && params.constructor !== Array) { params = $.makeArray(arguments).slice(1); } if (params.constructor !== Array) { params = [params]; } $.each(params, function (i, n) { source = source.replace(new RegExp("\\{" + i + "\\}", "g"), function () { return n; }); }); return source; }; $.extend($.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error", pendingClass: "pending", validClass: "valid", errorElement: "label", focusCleanup: false, focusInvalid: true, errorContainer: $([]), errorLabelContainer: $([]), onsubmit: true, ignore: ":hidden", ignoreTitle: false, onfocusin: function onfocusin(element) { this.lastActive = element; // Hide error label and remove error class on focus if enabled if (this.settings.focusCleanup) { if (this.settings.unhighlight) { this.settings.unhighlight.call(this, element, this.settings.errorClass, this.settings.validClass); } this.hideThese(this.errorsFor(element)); } }, onfocusout: function onfocusout(element) { if (!this.checkable(element) && (element.name in this.submitted || !this.optional(element))) { this.element(element); } }, onkeyup: function onkeyup(element, event) { // Avoid revalidate the field when pressing one of the following keys // Shift => 16 // Ctrl => 17 // Alt => 18 // Caps lock => 20 // End => 35 // Home => 36 // Left arrow => 37 // Up arrow => 38 // Right arrow => 39 // Down arrow => 40 // Insert => 45 // Num lock => 144 // AltGr key => 225 var excludedKeys = [16, 17, 18, 20, 35, 36, 37, 38, 39, 40, 45, 144, 225]; if (event.which === 9 && this.elementValue(element) === "" || $.inArray(event.keyCode, excludedKeys) !== -1) { return; } else if (element.name in this.submitted || element.name in this.invalid) { this.element(element); } }, onclick: function onclick(element) { // Click on selects, radiobuttons and checkboxes if (element.name in this.submitted) { this.element(element); // Or option elements, check parent select in that case } else if (element.parentNode.name in this.submitted) { this.element(element.parentNode); } }, highlight: function highlight(element, errorClass, validClass) { if (element.type === "radio") { this.findByName(element.name).addClass(errorClass).removeClass(validClass); } else { $(element).addClass(errorClass).removeClass(validClass); } }, unhighlight: function unhighlight(element, errorClass, validClass) { if (element.type === "radio") { this.findByName(element.name).removeClass(errorClass).addClass(validClass); } else { $(element).removeClass(errorClass).addClass(validClass); } } }, // https://jqueryvalidation.org/jQuery.validator.setDefaults/ setDefaults: function setDefaults(settings) { $.extend($.validator.defaults, settings); }, messages: { required: "This field is required.", remote: "Please fix this field.", email: "Please enter a valid email address.", url: "Please enter a valid URL.", date: "Please enter a valid date.", dateISO: "Please enter a valid date (ISO).", number: "Please enter a valid number.", digits: "Please enter only digits.", equalTo: "Please enter the same value again.", maxlength: $.validator.format("Please enter no more than {0} characters."), minlength: $.validator.format("Please enter at least {0} characters."), rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."), range: $.validator.format("Please enter a value between {0} and {1}."), max: $.validator.format("Please enter a value less than or equal to {0}."), min: $.validator.format("Please enter a value greater than or equal to {0}."), step: $.validator.format("Please enter a multiple of {0}.") }, autoCreateRanges: false, prototype: { init: function init() { this.labelContainer = $(this.settings.errorLabelContainer); this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm); this.containers = $(this.settings.errorContainer).add(this.settings.errorLabelContainer); this.submitted = {}; this.valueCache = {}; this.pendingRequest = 0; this.pending = {}; this.invalid = {}; this.reset(); var currentForm = this.currentForm, groups = this.groups = {}, rules; $.each(this.settings.groups, function (key, value) { if (typeof value === "string") { value = value.split(/\s/); } $.each(value, function (index, name) { groups[name] = key; }); }); rules = this.settings.rules; $.each(rules, function (key, value) { rules[key] = $.validator.normalizeRule(value); }); function delegate(event) { var isContentEditable = typeof $(this).attr("contenteditable") !== "undefined" && $(this).attr("contenteditable") !== "false"; // Set form expando on contenteditable if (!this.form && isContentEditable) { this.form = $(this).closest("form")[0]; this.name = $(this).attr("name"); } // Ignore the element if it belongs to another form. This will happen mainly // when setting the `form` attribute of an input to the id of another form. if (currentForm !== this.form) { return; } var validator = $.data(this.form, "validator"), eventType = "on" + event.type.replace(/^validate/, ""), settings = validator.settings; if (settings[eventType] && !$(this).is(settings.ignore)) { settings[eventType].call(validator, this, event); } } $(this.currentForm).on("focusin.validate focusout.validate keyup.validate", ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " + "[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " + "[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " + "[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate) // Support: Chrome, oldIE // "select" is provided as event.target when clicking a option .on("click.validate", "select, option, [type='radio'], [type='checkbox']", delegate); if (this.settings.invalidHandler) { $(this.currentForm).on("invalid-form.validate", this.settings.invalidHandler); } }, // https://jqueryvalidation.org/Validator.form/ form: function form() { this.checkForm(); $.extend(this.submitted, this.errorMap); this.invalid = $.extend({}, this.errorMap); if (!this.valid()) { $(this.currentForm).triggerHandler("invalid-form", [this]); } this.showErrors(); return this.valid(); }, checkForm: function checkForm() { this.prepareForm(); for (var i = 0, elements = this.currentElements = this.elements(); elements[i]; i++) { this.check(elements[i]); } return this.valid(); }, // https://jqueryvalidation.org/Validator.element/ element: function element(_element) { var cleanElement = this.clean(_element), checkElement = this.validationTargetFor(cleanElement), v = this, result = true, rs, group; if (checkElement === undefined) { delete this.invalid[cleanElement.name]; } else { this.prepareElement(checkElement); this.currentElements = $(checkElement); // If this element is grouped, then validate all group elements already // containing a value group = this.groups[checkElement.name]; if (group) { $.each(this.groups, function (name, testgroup) { if (testgroup === group && name !== checkElement.name) { cleanElement = v.validationTargetFor(v.clean(v.findByName(name))); if (cleanElement && cleanElement.name in v.invalid) { v.currentElements.push(cleanElement); result = v.check(cleanElement) && result; } } }); } rs = this.check(checkElement) !== false; result = result && rs; if (rs) { this.invalid[checkElement.name] = false; } else { this.invalid[checkElement.name] = true; } if (!this.numberOfInvalids()) { // Hide error containers on last error this.toHide = this.toHide.add(this.containers); } this.showErrors(); // Add aria-invalid status for screen readers $(_element).attr("aria-invalid", !rs); } return result; }, // https://jqueryvalidation.org/Validator.showErrors/ showErrors: function showErrors(errors) { if (errors) { var validator = this; // Add items to error list and map $.extend(this.errorMap, errors); this.errorList = $.map(this.errorMap, function (message, name) { return { message: message, element: validator.findByName(name)[0] }; }); // Remove items from success list this.successList = $.grep(this.successList, function (element) { return !(element.name in errors); }); } if (this.settings.showErrors) { this.settings.showErrors.call(this, this.errorMap, this.errorList); } else { this.defaultShowErrors(); } }, // https://jqueryvalidation.org/Validator.resetForm/ resetForm: function resetForm() { if ($.fn.resetForm) { $(this.currentForm).resetForm(); } this.invalid = {}; this.submitted = {}; this.prepareForm(); this.hideErrors(); var elements = this.elements().removeData("previousValue").removeAttr("aria-invalid"); this.resetElements(elements); }, resetElements: function resetElements(elements) { var i; if (this.settings.unhighlight) { for (i = 0; elements[i]; i++) { this.settings.unhighlight.call(this, elements[i], this.settings.errorClass, ""); this.findByName(elements[i].name).removeClass(this.settings.validClass); } } else { elements.removeClass(this.settings.errorClass).removeClass(this.settings.validClass); } }, numberOfInvalids: function numberOfInvalids() { return this.objectLength(this.invalid); }, objectLength: function objectLength(obj) { /* jshint unused: false */ var count = 0, i; for (i in obj) { // This check allows counting elements with empty error // message as invalid elements if (obj[i] !== undefined && obj[i] !== null && obj[i] !== false) { count++; } } return count; }, hideErrors: function hideErrors() { this.hideThese(this.toHide); }, hideThese: function hideThese(errors) { errors.not(this.containers).text(""); this.addWrapper(errors).hide(); }, valid: function valid() { return this.size() === 0; }, size: function size() { return this.errorList.length; }, focusInvalid: function focusInvalid() { if (this.settings.focusInvalid) { try { $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").trigger("focus") // Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find .trigger("focusin"); } catch (e) { // Ignore IE throwing errors when focusing hidden elements } } }, findLastActive: function findLastActive() { var lastActive = this.lastActive; return lastActive && $.grep(this.errorList, function (n) { return n.element.name === lastActive.name; }).length === 1 && lastActive; }, elements: function elements() { var validator = this, rulesCache = {}; // Select all valid inputs inside the form (no submit or reset buttons) return $(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function () { var name = this.name || $(this).attr("name"); // For contenteditable var isContentEditable = typeof $(this).attr("contenteditable") !== "undefined" && $(this).attr("contenteditable") !== "false"; if (!name && validator.settings.debug && window.console) { console.error("%o has no name assigned", this); } // Set form expando on contenteditable if (isContentEditable) { this.form = $(this).closest("form")[0]; this.name = name; } // Ignore elements that belong to other/nested forms if (this.form !== validator.currentForm) { return false; } // Select only the first element for each name, and only those with rules specified if (name in rulesCache || !validator.objectLength($(this).rules())) { return false; } rulesCache[name] = true; return true; }); }, clean: function clean(selector) { return $(selector)[0]; }, errors: function errors() { var errorClass = this.settings.errorClass.split(" ").join("."); return $(this.settings.errorElement + "." + errorClass, this.errorContext); }, resetInternals: function resetInternals() { this.successList = []; this.errorList = []; this.errorMap = {}; this.toShow = $([]); this.toHide = $([]); }, reset: function reset() { this.resetInternals(); this.currentElements = $([]); }, prepareForm: function prepareForm() { this.reset(); this.toHide = this.errors().add(this.containers); }, prepareElement: function prepareElement(element) { this.reset(); this.toHide = this.errorsFor(element); }, elementValue: function elementValue(element) { var $element = $(element), type = element.type, isContentEditable = typeof $element.attr("contenteditable") !== "undefined" && $element.attr("contenteditable") !== "false", val, idx; if (type === "radio" || type === "checkbox") { return this.findByName(element.name).filter(":checked").val(); } else if (type === "number" && typeof element.validity !== "undefined") { return element.validity.badInput ? "NaN" : $element.val(); } if (isContentEditable) { val = $element.text(); } else { val = $element.val(); } if (type === "file") { // Modern browser (chrome & safari) if (val.substr(0, 12) === "C:\\fakepath\\") { return val.substr(12); } // Legacy browsers // Unix-based path idx = val.lastIndexOf("/"); if (idx >= 0) { return val.substr(idx + 1); } // Windows-based path idx = val.lastIndexOf("\\"); if (idx >= 0) { return val.substr(idx + 1); } // Just the file name return val; } if (typeof val === "string") { return val.replace(/\r/g, ""); } return val; }, check: function check(element) { element = this.validationTargetFor(this.clean(element)); var rules = $(element).rules(), rulesCount = $.map(rules, function (n, i) { return i; }).length, dependencyMismatch = false, val = this.elementValue(element), result, method, rule, normalizer; // Prioritize the local normalizer defined for this element over the global one // if the former exists, otherwise user the global one in case it exists. if (typeof rules.normalizer === "function") { normalizer = rules.normalizer; } else if (typeof this.settings.normalizer === "function") { normalizer = this.settings.normalizer; } // If normalizer is defined, then call it to retreive the changed value instead // of using the real one. // Note that `this` in the normalizer is `element`. if (normalizer) { val = normalizer.call(element, val); // Delete the normalizer from rules to avoid treating it as a pre-defined method. delete rules.normalizer; } for (method in rules) { rule = { method: method, parameters: rules[method] }; try { result = $.validator.methods[method].call(this, val, element, rule.parameters); // If a method indicates that the field is optional and therefore valid, // don't mark it as valid when there are no other rules if (result === "dependency-mismatch" && rulesCount === 1) { dependencyMismatch = true; continue; } dependencyMismatch = false; if (result === "pending") { this.toHide = this.toHide.not(this.errorsFor(element)); return; } if (!result) { this.formatAndAdd(element, rule); return false; } } catch (e) { if (this.settings.debug && window.console) { console.log("Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e); } if (e instanceof TypeError) { e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method."; } throw e; } } if (dependencyMismatch) { return; } if (this.objectLength(rules)) { this.successList.push(element); } return true; }, // Return the custom message for the given element and validation method // specified in the element's HTML5 data attribute // return the generic message if present and no method specific message is present customDataMessage: function customDataMessage(element, method) { return $(element).data("msg" + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase()) || $(element).data("msg"); }, // Return the custom message for the given element name and validation method customMessage: function customMessage(name, method) { var m = this.settings.messages[name]; return m && (m.constructor === String ? m : m[method]); }, // Return the first defined argument, allowing empty strings findDefined: function findDefined() { for (var i = 0; i < arguments.length; i++) { if (arguments[i] !== undefined) { return arguments[i]; } } return undefined; }, // The second parameter 'rule' used to be a string, and extended to an object literal // of the following form: // rule = { // method: "method name", // parameters: "the given method parameters" // } // // The old behavior still supported, kept to maintain backward compatibility with // old code, and will be removed in the next major release. defaultMessage: function defaultMessage(element, rule) { if (typeof rule === "string") { rule = { method: rule }; } var message = this.findDefined(this.customMessage(element.name, rule.method), this.customDataMessage(element, rule.method), // 'title' is never undefined, so handle empty string as undefined !this.settings.ignoreTitle && element.title || undefined, $.validator.messages[rule.method], "Warning: No message defined for " + element.name + ""), theregex = /\$?\{(\d+)\}/g; if (typeof message === "function") { message = message.call(this, rule.parameters, element); } else if (theregex.test(message)) { message = $.validator.format(message.replace(theregex, "{$1}"), rule.parameters); } return message; }, formatAndAdd: function formatAndAdd(element, rule) { var message = this.defaultMessage(element, rule); this.errorList.push({ message: message, element: element, method: rule.method }); this.errorMap[element.name] = message; this.submitted[element.name] = message; }, addWrapper: function addWrapper(toToggle) { if (this.settings.wrapper) { toToggle = toToggle.add(toToggle.parent(this.settings.wrapper)); } return toToggle; }, defaultShowErrors: function defaultShowErrors() { var i, elements, error; for (i = 0; this.errorList[i]; i++) { error = this.errorList[i]; if (this.settings.highlight) { this.settings.highlight.call(this, error.element, this.settings.errorClass, this.settings.validClass); } this.showLabel(error.element, error.message); } if (this.errorList.length) { this.toShow = this.toShow.add(this.containers); } if (this.settings.success) { for (i = 0; this.successList[i]; i++) { this.showLabel(this.successList[i]); } } if (this.settings.unhighlight) { for (i = 0, elements = this.validElements(); elements[i]; i++) { this.settings.unhighlight.call(this, elements[i], this.settings.errorClass, this.settings.validClass); } } this.toHide = this.toHide.not(this.toShow); this.hideErrors(); this.addWrapper(this.toShow).show(); }, validElements: function validElements() { return this.currentElements.not(this.invalidElements()); }, invalidElements: function invalidElements() { return $(this.errorList).map(function () { return this.element; }); }, showLabel: function showLabel(element, message) { var place, group, errorID, v, error = this.errorsFor(element), elementID = this.idOrName(element), describedBy = $(element).attr("aria-describedby"); if (error.length) { // Refresh error/success class error.removeClass(this.settings.validClass).addClass(this.settings.errorClass); // Replace message on existing label error.html(message); } else { // Create error element error = $("<" + this.settings.errorElement + ">").attr("id", elementID + "-error").addClass(this.settings.errorClass).html(message || ""); // Maintain reference to the element to be placed into the DOM place = error; if (this.settings.wrapper) { // Make sure the element is visible, even in IE // actually showing the wrapped element is handled elsewhere place = error.hide().show().wrap("<" + this.settings.wrapper + "/>").parent(); } if (this.labelContainer.length) { this.labelContainer.append(place); } else if (this.settings.errorPlacement) { this.settings.errorPlacement.call(this, place, $(element)); } else { place.insertAfter(element); } // Link error back to the element if (error.is("label")) { // If the error is a label, then associate using 'for' error.attr("for", elementID); // If the element is not a child of an associated label, then it's necessary // to explicitly apply aria-describedby } else if (error.parents("label[for='" + this.escapeCssMeta(elementID) + "']").length === 0) { errorID = error.attr("id"); // Respect existing non-error aria-describedby if (!describedBy) { describedBy = errorID; } else if (!describedBy.match(new RegExp("\\b" + this.escapeCssMeta(errorID) + "\\b"))) { // Add to end of list if not already present describedBy += " " + errorID; } $(element).attr("aria-describedby", describedBy); // If this element is grouped, then assign to all elements in the same group group = this.groups[element.name]; if (group) { v = this; $.each(v.groups, function (name, testgroup) { if (testgroup === group) { $("[name='" + v.escapeCssMeta(name) + "']", v.currentForm).attr("aria-describedby", error.attr("id")); } }); } } } if (!message && this.settings.success) { error.text(""); if (typeof this.settings.success === "string") { error.addClass(this.settings.success); } else { this.settings.success(error, element); } } this.toShow = this.toShow.add(error); }, errorsFor: function errorsFor(element) { var name = this.escapeCssMeta(this.idOrName(element)), describer = $(element).attr("aria-describedby"), selector = "label[for='" + name + "'], label[for='" + name + "'] *"; // 'aria-describedby' should directly reference the error element if (describer) { selector = selector + ", #" + this.escapeCssMeta(describer).replace(/\s+/g, ", #"); } return this.errors().filter(selector); }, // See https://api.jquery.com/category/selectors/, for CSS // meta-characters that should be escaped in order to be used with JQuery // as a literal part of a name/id or any selector. escapeCssMeta: function escapeCssMeta(string) { return string.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1"); }, idOrName: function idOrName(element) { return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name); }, validationTargetFor: function validationTargetFor(element) { // If radio/checkbox, validate first element in group instead if (this.checkable(element)) { element = this.findByName(element.name); } // Always apply ignore filter return $(element).not(this.settings.ignore)[0]; }, checkable: function checkable(element) { return (/radio|checkbox/i.test(element.type) ); }, findByName: function findByName(name) { return $(this.currentForm).find("[name='" + this.escapeCssMeta(name) + "']"); }, getLength: function getLength(value, element) { switch (element.nodeName.toLowerCase()) { case "select": return $("option:selected", element).length; case "input": if (this.checkable(element)) { return this.findByName(element.name).filter(":checked").length; } } return value.length; }, depend: function depend(param, element) { return this.dependTypes[typeof param === "undefined" ? "undefined" : _typeof(param)] ? this.dependTypes[typeof param === "undefined" ? "undefined" : _typeof(param)](param, element) : true; }, dependTypes: { "boolean": function boolean(param) { return param; }, "string": function string(param, element) { return !!$(param, element.form).length; }, "function": function _function(param, element) { return param(element); } }, optional: function optional(element) { var val = this.elementValue(element); return !$.validator.methods.required.call(this, val, element) && "dependency-mismatch"; }, startRequest: function startRequest(element) { if (!this.pending[element.name]) { this.pendingRequest++; $(element).addClass(this.settings.pendingClass); this.pending[element.name] = true; } }, stopRequest: function stopRequest(element, valid) { this.pendingRequest--; // Sometimes synchronization fails, make sure pendingRequest is never < 0 if (this.pendingRequest < 0) { this.pendingRequest = 0; } delete this.pending[element.name]; $(element).removeClass(this.settings.pendingClass); if (valid && this.pendingRequest === 0 && this.formSubmitted && this.form()) { $(this.currentForm).submit(); // Remove the hidden input that was used as a replacement for the // missing submit button. The hidden input is added by `handle()` // to ensure that the value of the used submit button is passed on // for scripted submits triggered by this method if (this.submitButton) { $("input:hidden[name='" + this.submitButton.name + "']", this.currentForm).remove(); } this.formSubmitted = false; } else if (!valid && this.pendingRequest === 0 && this.formSubmitted) { $(this.currentForm).triggerHandler("invalid-form", [this]); this.formSubmitted = false; } }, previousValue: function previousValue(element, method) { method = typeof method === "string" && method || "remote"; return $.data(element, "previousValue") || $.data(element, "previousValue", { old: null, valid: true, message: this.defaultMessage(element, { method: method }) }); }, // Cleans up all forms and elements, removes validator-specific events destroy: function destroy() { this.resetForm(); $(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur").find(".validate-lessThan-blur").off(".validate-lessThan").removeClass("validate-lessThan-blur").find(".validate-lessThanEqual-blur").off(".validate-lessThanEqual").removeClass("validate-lessThanEqual-blur").find(".validate-greaterThanEqual-blur").off(".validate-greaterThanEqual").removeClass("validate-greaterThanEqual-blur").find(".validate-greaterThan-blur").off(".validate-greaterThan").removeClass("validate-greaterThan-blur"); } }, classRuleSettings: { required: { required: true }, email: { email: true }, url: { url: true }, date: { date: true }, dateISO: { dateISO: true }, number: { number: true }, digits: { digits: true }, creditcard: { creditcard: true } }, addClassRules: function addClassRules(className, rules) { if (className.constructor === String) { this.classRuleSettings[className] = rules; } else { $.extend(this.classRuleSettings, className); } }, classRules: function classRules(element) { var rules = {}, classes = $(element).attr("class"); if (classes) { $.each(classes.split(" "), function () { if (this in $.validator.classRuleSettings) { $.extend(rules, $.validator.classRuleSettings[this]); } }); } return rules; }, normalizeAttributeRule: function normalizeAttributeRule(rules, type, method, value) { // Convert the value to a number for number inputs, and for text for backwards compability // allows type="date" and others to be compared as strings if (/min|max|step/.test(method) && (type === null || /number|range|text/.test(type))) { value = Number(value); // Support Opera Mini, which returns NaN for undefined minlength if (isNaN(value)) { value = undefined; } } if (value || value === 0) { rules[method] = value; } else if (type === method && type !== "range") { // Exception: the jquery validate 'range' method // does not test for the html5 'range' type rules[method] = true; } }, attributeRules: function attributeRules(element) { var rules = {}, $element = $(element), type = element.getAttribute("type"), method, value; for (method in $.validator.methods) { // Support for in both html5 and older browsers if (method === "required") { value = element.getAttribute(method); // Some browsers return an empty string for the required attribute // and non-HTML5 browsers might have required="" markup if (value === "") { value = true; } // Force non-HTML5 browsers to return bool value = !!value; } else { value = $element.attr(method); } this.normalizeAttributeRule(rules, type, method, value); } // 'maxlength' may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs if (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) { delete rules.maxlength; } return rules; }, dataRules: function dataRules(element) { var rules = {}, $element = $(element), type = element.getAttribute("type"), method, value; for (method in $.validator.methods) { value = $element.data("rule" + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase()); // Cast empty attributes like `data-rule-required` to `true` if (value === "") { value = true; } this.normalizeAttributeRule(rules, type, method, value); } return rules; }, staticRules: function staticRules(element) { var rules = {}, validator = $.data(element.form, "validator"); if (validator.settings.rules) { rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {}; } return rules; }, normalizeRules: function normalizeRules(rules, element) { // Handle dependency check $.each(rules, function (prop, val) { // Ignore rule when param is explicitly false, eg. required:false if (val === false) { delete rules[prop]; return; } if (val.param || val.depends) { var keepRule = true; switch (_typeof(val.depends)) { case "string": keepRule = !!$(val.depends, element.form).length; break; case "function": keepRule = val.depends.call(element, element); break; } if (keepRule) { rules[prop] = val.param !== undefined ? val.param : true; } else { $.data(element.form, "validator").resetElements($(element)); delete rules[prop]; } } }); // Evaluate parameters $.each(rules, function (rule, parameter) { rules[rule] = $.isFunction(parameter) && rule !== "normalizer" ? parameter(element) : parameter; }); // Clean number parameters $.each(["minlength", "maxlength"], function () { if (rules[this]) { rules[this] = Number(rules[this]); } }); $.each(["rangelength", "range"], function () { var parts; if (rules[this]) { if ($.isArray(rules[this])) { rules[this] = [Number(rules[this][0]), Number(rules[this][1])]; } else if (typeof rules[this] === "string") { parts = rules[this].replace(/[\[\]]/g, "").split(/[\s,]+/); rules[this] = [Number(parts[0]), Number(parts[1])]; } } }); if ($.validator.autoCreateRanges) { // Auto-create ranges if (rules.min != null && rules.max != null) { rules.range = [rules.min, rules.max]; delete rules.min; delete rules.max; } if (rules.minlength != null && rules.maxlength != null) { rules.rangelength = [rules.minlength, rules.maxlength]; delete rules.minlength; delete rules.maxlength; } } return rules; }, // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} normalizeRule: function normalizeRule(data) { if (typeof data === "string") { var transformed = {}; $.each(data.split(/\s/), function () { transformed[this] = true; }); data = transformed; } return data; }, // https://jqueryvalidation.org/jQuery.validator.addMethod/ addMethod: function addMethod(name, method, message) { $.validator.methods[name] = method; $.validator.messages[name] = message !== undefined ? message : $.validator.messages[name]; if (method.length < 3) { $.validator.addClassRules(name, $.validator.normalizeRule(name)); } }, // https://jqueryvalidation.org/jQuery.validator.methods/ methods: { // https://jqueryvalidation.org/required-method/ required: function required(value, element, param) { // Check if dependency is met if (!this.depend(param, element)) { return "dependency-mismatch"; } if (element.nodeName.toLowerCase() === "select") { // Could be an array for select-multiple or a string, both are fine this way var val = $(element).val(); return val && val.length > 0; } if (this.checkable(element)) { return this.getLength(value, element) > 0; } return value !== undefined && value !== null && value.length > 0; }, // https://jqueryvalidation.org/email-method/ email: function email(value, element) { // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address // Retrieved 2014-01-14 // If you have a problem with this implementation, report a bug against the above spec // Or use custom methods to implement your own email validation return this.optional(element) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value); }, // https://jqueryvalidation.org/url-method/ url: function url(value, element) { // Copyright (c) 2010-2013 Diego Perini, MIT licensed // https://gist.github.com/dperini/729294 // see also https://mathiasbynens.be/demo/url-regex // modified to allow protocol-relative URLs return this.optional(element) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value); }, // https://jqueryvalidation.org/date-method/ date: function () { var called = false; return function (value, element) { if (!called) { called = true; if (this.settings.debug && window.console) { console.warn("The `date` method is deprecated and will be removed in version '2.0.0'.\n" + "Please don't use it, since it relies on the Date constructor, which\n" + "behaves very differently across browsers and locales. Use `dateISO`\n" + "instead or one of the locale specific methods in `localizations/`\n" + "and `additional-methods.js`."); } } return this.optional(element) || !/Invalid|NaN/.test(new Date(value).toString()); }; }(), // https://jqueryvalidation.org/dateISO-method/ dateISO: function dateISO(value, element) { return this.optional(element) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value); }, // https://jqueryvalidation.org/number-method/ number: function number(value, element) { return this.optional(element) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value); }, // https://jqueryvalidation.org/digits-method/ digits: function digits(value, element) { return this.optional(element) || /^\d+$/.test(value); }, // https://jqueryvalidation.org/minlength-method/ minlength: function minlength(value, element, param) { var length = $.isArray(value) ? value.length : this.getLength(value, element); return this.optional(element) || length >= param; }, // https://jqueryvalidation.org/maxlength-method/ maxlength: function maxlength(value, element, param) { var length = $.isArray(value) ? value.length : this.getLength(value, element); return this.optional(element) || length <= param; }, // https://jqueryvalidation.org/rangelength-method/ rangelength: function rangelength(value, element, param) { var length = $.isArray(value) ? value.length : this.getLength(value, element); return this.optional(element) || length >= param[0] && length <= param[1]; }, // https://jqueryvalidation.org/min-method/ min: function min(value, element, param) { return this.optional(element) || value >= param; }, // https://jqueryvalidation.org/max-method/ max: function max(value, element, param) { return this.optional(element) || value <= param; }, // https://jqueryvalidation.org/range-method/ range: function range(value, element, param) { return this.optional(element) || value >= param[0] && value <= param[1]; }, // https://jqueryvalidation.org/step-method/ step: function step(value, element, param) { var type = $(element).attr("type"), errorMessage = "Step attribute on input type " + type + " is not supported.", supportedTypes = ["text", "number", "range"], re = new RegExp("\\b" + type + "\\b"), notSupported = type && !re.test(supportedTypes.join()), decimalPlaces = function decimalPlaces(num) { var match = ("" + num).match(/(?:\.(\d+))?$/); if (!match) { return 0; } // Number of digits right of decimal point. return match[1] ? match[1].length : 0; }, toInt = function toInt(num) { return Math.round(num * Math.pow(10, decimals)); }, valid = true, decimals; // Works only for text, number and range input types // TODO find a way to support input types date, datetime, datetime-local, month, time and week if (notSupported) { throw new Error(errorMessage); } decimals = decimalPlaces(param); // Value can't have too many decimals if (decimalPlaces(value) > decimals || toInt(value) % toInt(param) !== 0) { valid = false; } return this.optional(element) || valid; }, // https://jqueryvalidation.org/equalTo-method/ equalTo: function equalTo(value, element, param) { // Bind to the blur event of the target in order to revalidate whenever the target field is updated var target = $(param); if (this.settings.onfocusout && target.not(".validate-equalTo-blur").length) { target.addClass("validate-equalTo-blur").on("blur.validate-equalTo", function () { $(element).valid(); }); } return value === target.val(); }, // https://jqueryvalidation.org/remote-method/ remote: function remote(value, element, param, method) { if (this.optional(element)) { return "dependency-mismatch"; } method = typeof method === "string" && method || "remote"; var previous = this.previousValue(element, method), validator, data, optionDataString; if (!this.settings.messages[element.name]) { this.settings.messages[element.name] = {}; } previous.originalMessage = previous.originalMessage || this.settings.messages[element.name][method]; this.settings.messages[element.name][method] = previous.message; param = typeof param === "string" && { url: param } || param; optionDataString = $.param($.extend({ data: value }, param.data)); if (previous.old === optionDataString) { return previous.valid; } previous.old = optionDataString; validator = this; this.startRequest(element); data = {}; data[element.name] = value; $.ajax($.extend(true, { mode: "abort", port: "validate" + element.name, dataType: "json", data: data, context: validator.currentForm, success: function success(response) { var valid = response === true || response === "true", errors, message, submitted; validator.settings.messages[element.name][method] = previous.originalMessage; if (valid) { submitted = validator.formSubmitted; validator.resetInternals(); validator.toHide = validator.errorsFor(element); validator.formSubmitted = submitted; validator.successList.push(element); validator.invalid[element.name] = false; validator.showErrors(); } else { errors = {}; message = response || validator.defaultMessage(element, { method: method, parameters: value }); errors[element.name] = previous.message = message; validator.invalid[element.name] = true; validator.showErrors(errors); } previous.valid = valid; validator.stopRequest(element, valid); } }, param)); return "pending"; } } }); // Ajax mode: abort // usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); // if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() var pendingRequests = {}, ajax; // Use a prefilter if available (1.5+) if ($.ajaxPrefilter) { $.ajaxPrefilter(function (settings, _, xhr) { var port = settings.port; if (settings.mode === "abort") { if (pendingRequests[port]) { pendingRequests[port].abort(); } pendingRequests[port] = xhr; } }); } else { // Proxy ajax ajax = $.ajax; $.ajax = function (settings) { var mode = ("mode" in settings ? settings : $.ajaxSettings).mode, port = ("port" in settings ? settings : $.ajaxSettings).port; if (mode === "abort") { if (pendingRequests[port]) { pendingRequests[port].abort(); } pendingRequests[port] = ajax.apply(this, arguments); return pendingRequests[port]; } return ajax.apply(this, arguments); }; } return $; }); /***/ }), /***/ "./src/js/components/navbar-scroll.js": /*!********************************************!*\ !*** ./src/js/components/navbar-scroll.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(jQuery) { jQuery(document).ready(function ($) { var fixedNavGeneral = $(".zenkit-navbar"); var fixedNavBlog = $(".navbar-scrolling"); var lastScrollTop = 0; var scrollTop; var handleScroll = function handleScroll() { if (fixedNavBlog) { var currentScrollTop = $(window).scrollTop(); var navbarScrollDesktop = $(".navbar-scrolling .navbar-scroll-desktop"); if (lastScrollTop > currentScrollTop && window.innerWidth > 768 && !navbarScrollDesktop.hasClass("active-scroll")) { navbarScrollDesktop.addClass("active-scroll"); navbarScrollDesktop.stop().slideDown(300, function () { navbarScrollDesktop.removeClass("active-scroll"); }); } else if (lastScrollTop < currentScrollTop && window.innerWidth > 768 && !navbarScrollDesktop.hasClass("active-scroll")) { navbarScrollDesktop.addClass("active-scroll"); navbarScrollDesktop.stop().slideUp(300, function () { navbarScrollDesktop.removeClass("active-scroll"); }); } if (currentScrollTop > 180) { fixedNavBlog.addClass("scrolled-fixed-top"); } else { fixedNavBlog.removeClass("scrolled-fixed-top"); } lastScrollTop = currentScrollTop; } if (fixedNavGeneral) { scrollTop = $(window).scrollTop(); if (scrollTop > 30) { fixedNavGeneral.addClass("navbar-scrolled"); } else { fixedNavGeneral.removeClass("navbar-scrolled"); } } }; handleScroll(); $(window).scroll(handleScroll); }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ "jquery"))) /***/ }), /***/ "./src/js/components/newsletter.js": /*!*****************************************!*\ !*** ./src/js/components/newsletter.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function($) { __webpack_require__(/*! ./jquery.validate.js */ "./src/js/components/jquery.validate.js"); /* From: http://stackoverflow.com/questions/18754020/bootstrap-3-with-jquery-validation-plugin Override default functions of the validation plugin to use bootstrap classes for error highlighting */ $.validator.setDefaults({ highlight: function highlight(element) { $(element).closest('.form-group').addClass('has-error'); }, unhighlight: function unhighlight(element) { $(element).closest('.form-group').removeClass('has-error'); }, errorElement: 'span', errorClass: 'help-block', errorPlacement: function errorPlacement(error, element) { if (element.parent('.input-group').length) { error.insertAfter(element.parent()); } else { error.insertAfter(element); } } }); function noop() { return; } function validateNewsletterForm($form, handlers) { var hide = handlers.hide || noop; var pending = handlers.pending || noop; var error = handlers.error || noop; var warning = handlers.warning || noop; var _success = handlers.success || noop; $form.validate({ submitHandler: function submitHandler(form) { hide(); pending(); var $firstnameInput = $(form[0]); var $lastnameInput = $(form[1]); var $emailInput = $(form[2]); var $captchaResponse = $(form[3]); var captchaToken = $captchaResponse.val(); if (captchaToken == null || captchaToken === '') { hide(); return error(); } $.post({ url: window.location.protocol + '//' + window.location.host + '/api/internal/newsletter/subscribe', data: { firstname: $firstnameInput.val(), lastname: $lastnameInput.val(), email: $emailInput.val(), recaptchaToken: $captchaResponse.val() }, success: function success() { hide(); _success(); }, error: function error(xhr) { hide(); var error = xhr.responseJSON; if (error && error.error) { warning(error.error.description); } else { error(); } } }); } }); }; $(function () { var $newsletterForm = $('#newsletterSubscriptionForm'); var $newsletterFormBlog = $('#newsletterSubscriptionFormBlog'); if ($newsletterForm.length > 0 || $newsletterFormBlog.length > 0) { if (window.grecaptcha) { var grecaptcha = window.grecaptcha; grecaptcha.ready(function () { grecaptcha.execute('6LfggY4UAAAAAAAJ4reWOqxyuYvcibDQ25TK9r5z', { action: 'newsletterform' }).then(function (token) { document.getElementById('recaptchaResponse').value = token; }); }); } } if ($newsletterForm.length > 0) { var $alert = $('.newsletter-alert'); validateNewsletterForm($newsletterForm, { hide: function hide() { $alert.hide(); }, success: function success() { $alert.filter('.newsletter-success').show(); }, warning: function warning(message) { var alert = $alert.filter('.alert-warning'); if (message) { alert.text(message); } alert.show(); }, error: function error(message) { var alert = $alert.filter('.alert-danger'); if (message) { alert.text(message); } alert.show(); }, pending: function pending() { $alert.filter('.newsletter-pending').show(); } }); } if ($newsletterFormBlog.length) { var $alert = $('.newsletter-alert'); validateNewsletterForm($newsletterFormBlog, { hide: function hide() { $alert.hide(); $newsletterFormBlog.show(); }, success: function success() { $newsletterFormBlog.hide(); $alert.filter('.alert-success').show(); }, warning: function warning() { $newsletterFormBlog.hide(); $alert.filter('.alert-danger').show(); }, error: function error() { $newsletterFormBlog.hide(); $alert.filter('.alert-danger').show(); } }); } }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ "jquery"))) /***/ }), /***/ "./src/js/components/polyfill.js": /*!***************************************!*\ !*** ./src/js/components/polyfill.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; if ("NodeList" in window && !NodeList.prototype.forEach) { console.info("polyfill for IE11"); NodeList.prototype.forEach = function (callback, thisArg) { thisArg = thisArg || window; for (var i = 0; i < this.length; i++) { callback.call(thisArg, this[i], i, this); } }; } /***/ }), /***/ "./src/js/components/toc.js": /*!**********************************!*\ !*** ./src/js/components/toc.js ***! \**********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function($) { document.addEventListener("DOMContentLoaded", function () { //htmlTableOfContents(); //altTableOfContents(); generate_toc(); $(".toc-mobile-trigger").click(function (e) { e.stopPropagation(); $("body").addClass("toc-mobile-open"); }); $(".toc-column").on("click", function (e) { e.stopPropagation(); }); $("body").on("click", function () { $("body").removeClass("toc-mobile-open"); }); $(".toc-mobile-close").on("click", function () { $("body").removeClass("toc-mobile-open"); }); $(".has-child .toc-child-caret").on("click", function () { $(this).parent().toggleClass("expand"); // $(this).parent().children("ul").slideToggle(); }); }); function generate_toc() { // const tocObj = ; var $toc = $("
", { id: "toc-v2" }); var level2$toc_item = { 0: $toc }; var used_anchors = {}; var tocColumn = $(".toc-column"); var headingsScope = tocColumn.data("heading-scope"); var showCarets = tocColumn.data("show-carets"); var expandAll = tocColumn.data("expand-all"); if (expandAll) { tocColumn.addClass("expand-all"); } // console.log(`headingsScope: ${headingsScope}`); // console.log(showCarets); // console.log(expandAll); $(".type-post").find(headingsScope).each(function (i, index) { // find out the level of heading var heading = $(this); var level = parseInt($(this).prop("tagName").replace(/[^0-9]/gi, "")); //console.log(level); //console.log(level); var ref = "toc" + i; if (heading[0].hasAttribute("id")) ref = heading[0].getAttribute("id");else heading[0].setAttribute("id", ref); var heading_text = $(this).text(); // define the unique anchor id //console.log(`heading text ${heading_text}`); // let heading_anchor = heading_text.replace(/[^a-z0-9]/gi, "_"); //console.log(`heading anchor ${heading_anchor}`); // while (heading_anchor in used_anchors) { // heading_anchor += "_"; // } // used_anchors[heading_anchor] = true; // todo: clean up //add target point into main content // $(this).prepend($("", { name: heading_anchor })); // find the parent level for TOC item var parent_level = level - 1; for (; !(parent_level in level2$toc_item); parent_level--) {} // remove all jumped over levels for (var l in level2$toc_item) { if (parseInt(l) > parent_level) { delete level2$toc_item[l]; } } var $parent = level2$toc_item[parent_level]; // create new TOC item inside parent's