diff --git a/dist/v-tooltip.esm.js b/dist/v-tooltip.esm.js index cbb6021f..072f2842 100644 --- a/dist/v-tooltip.esm.js +++ b/dist/v-tooltip.esm.js @@ -1,6 +1,6 @@ /**! * @fileOverview Kickass library to create and place poppers near their reference elements. - * @version 1.12.9 + * @version 1.14.3 * @license * Copyright (c) 2016 Federico Zivolo and contributors * @@ -23,6 +23,7 @@ * SOFTWARE. */ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'; + var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; var timeoutDuration = 0; for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { @@ -142,13 +143,33 @@ function getScrollParent(element) { overflowX = _getStyleComputedProp.overflowX, overflowY = _getStyleComputedProp.overflowY; - if (/(auto|scroll)/.test(overflow + overflowY + overflowX)) { + if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { return element; } return getScrollParent(getParentNode(element)); } +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 @@ -157,16 +178,23 @@ function getScrollParent(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 && element.offsetParent; + var offsetParent = element.offsetParent; + // 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') { - if (element) { - return element.ownerDocument.documentElement; - } - - return document.documentElement; + return element ? element.ownerDocument.documentElement : document.documentElement; } // .offsetParent will return the closest TD or TABLE in case @@ -308,29 +336,14 @@ function getBordersSize(styles, axis) { return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10); } -/** - * Tells if you are running Internet Explorer 10 - * @method - * @memberof Popper.Utils - * @returns {Boolean} isIE10 - */ -var isIE10 = undefined; - -var isIE10$1 = function () { - if (isIE10 === undefined) { - isIE10 = navigator.appVersion.indexOf('MSIE 10') !== -1; - } - return isIE10; -}; - function getSize(axis, body, html, computedStyle) { - return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE10$1() ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0); + return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0); } function getWindowSizes() { var body = document.body; var html = document.documentElement; - var computedStyle = isIE10$1() && getComputedStyle(html); + var computedStyle = isIE(10) && getComputedStyle(html); return { height: getSize('Height', body, html, computedStyle), @@ -422,8 +435,8 @@ function getBoundingClientRect(element) { // 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 - if (isIE10$1()) { - try { + try { + if (isIE(10)) { rect = element.getBoundingClientRect(); var scrollTop = getScroll(element, 'top'); var scrollLeft = getScroll(element, 'left'); @@ -431,10 +444,10 @@ function getBoundingClientRect(element) { rect.left += scrollLeft; rect.bottom += scrollTop; rect.right += scrollLeft; - } catch (err) {} - } else { - rect = element.getBoundingClientRect(); - } + } else { + rect = element.getBoundingClientRect(); + } + } catch (e) {} var result = { left: rect.left, @@ -466,7 +479,9 @@ function getBoundingClientRect(element) { } function getOffsetRectRelativeToArbitraryNode(children, parent) { - var isIE10 = isIE10$1(); + 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); @@ -476,6 +491,11 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) { var borderTopWidth = parseFloat(styles.borderTopWidth, 10); var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); + // In cases where the parent is fixed, we must ignore negative scroll in offset calc + if (fixedPosition && parent.nodeName === 'HTML') { + 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, @@ -503,7 +523,7 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) { offsets.marginLeft = marginLeft; } - if (isIE10 ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { + if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { offsets = includeScroll(offsets, parent); } @@ -511,13 +531,15 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) { } 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 = getScroll(html); - var scrollLeft = getScroll(html, 'left'); + var scrollTop = !excludeScroll ? getScroll(html) : 0; + var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; var offset = { top: scrollTop - relativeOffset.top + relativeOffset.marginTop, @@ -548,6 +570,26 @@ function isFixed(element) { return isFixed(getParentNode(element)); } +/** + * 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 @@ -556,16 +598,20 @@ function isFixed(element) { * @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 = findCommonOffsetParent(popper, reference); + var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); // Handle viewport case if (boundariesElement === 'viewport') { - boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent); + boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); } else { // Handle other cases based on DOM element used as boundaries var boundariesNode = void 0; @@ -580,7 +626,7 @@ function getBoundaries(popper, reference, padding, boundariesElement) { boundariesNode = boundariesElement; } - var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent); + var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); // In case of HTML, we need a different computation if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { @@ -681,11 +727,14 @@ function computeAutoPlacement(placement, refRect, popper, reference, boundariesE * @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 commonOffsetParent = findCommonOffsetParent(popper, reference); - return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent); + var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; + + var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); + return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); } /** @@ -858,7 +907,7 @@ function update() { }; // compute reference element offsets - data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference); + 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 @@ -868,9 +917,12 @@ function update() { // 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 = 'absolute'; + + data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; // run the modifiers data = runModifiers(this.modifiers, data); @@ -910,7 +962,7 @@ 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 - 1; i++) { + 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') { @@ -931,9 +983,12 @@ function destroy() { // touch DOM only if `applyStyle` modifier is enabled if (isModifierEnabled(this.modifiers, 'applyStyle')) { this.popper.removeAttribute('x-placement'); - this.popper.style.left = ''; 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')] = ''; } @@ -1121,12 +1176,12 @@ function applyStyle(data) { * @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 {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); + 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 @@ -1137,7 +1192,7 @@ function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { // Apply `position` to popper before anything else because // without the position applied we can't guarantee correct computations - setStyles(popper, { position: 'absolute' }); + setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); return options; } @@ -1172,11 +1227,13 @@ function computeStyle(data, options) { position: popper.position }; - // floor sides to avoid blurry text + // Avoid blurry text by using full pixel integers. + // For pixel-perfect positioning, top/bottom prefers rounded + // values, while left/right prefers floored values. var offsets = { left: Math.floor(popper.left), - top: Math.floor(popper.top), - bottom: Math.floor(popper.bottom), + top: Math.round(popper.top), + bottom: Math.round(popper.bottom), right: Math.floor(popper.right) }; @@ -1440,7 +1497,7 @@ function flip(data, options) { return data; } - var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement); + 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); @@ -1732,7 +1789,27 @@ function preventOverflow(data, options) { boundariesElement = getOffsetParent(boundariesElement); } - var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, 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; @@ -2229,6 +2306,12 @@ var Defaults = { */ 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 @@ -2433,6 +2516,11 @@ Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; Popper.placements = placements; Popper.Defaults = Defaults; +var SVGAnimatedString = function SVGAnimatedString() {}; +if (typeof window !== 'undefined') { + SVGAnimatedString = window.SVGAnimatedString; +} + function convertToArray(value) { if (typeof value === 'string') { value = value.split(' '); @@ -2451,7 +2539,7 @@ function addClasses(el, classes) { var newClasses = convertToArray(classes); var classList = void 0; if (el.className instanceof SVGAnimatedString) { - classList = Array.from(el.className); + classList = convertToArray(el.className.baseVal); } else { classList = convertToArray(el.className); } @@ -2478,7 +2566,7 @@ function removeClasses(el, classes) { var newClasses = convertToArray(classes); var classList = void 0; if (el.className instanceof SVGAnimatedString) { - classList = Array.from(el.className); + classList = convertToArray(el.className.baseVal); } else { classList = convertToArray(el.className); } @@ -2856,6 +2944,8 @@ var Tooltip = function () { addClasses(this._tooltipNode, this._classes); } + addClasses(reference, ['v-tooltip-open']); + return result; } }, { @@ -2984,6 +3074,8 @@ var Tooltip = function () { }, disposeTime); } + removeClasses(this.reference, ['v-tooltip-open']); + return this; } }, { @@ -3060,10 +3152,12 @@ var Tooltip = function () { case 'hover': directEvents.push('mouseenter'); oppositeEvents.push('mouseleave'); + if (_this6.options.hideOnTargetClick) oppositeEvents.push('click'); break; case 'focus': directEvents.push('focus'); oppositeEvents.push('blur'); + if (_this6.options.hideOnTargetClick) oppositeEvents.push('click'); break; case 'click': directEvents.push('click'); @@ -3180,10 +3274,10 @@ var _initialiseProps = function _initialiseProps() { this._events = []; this._setTooltipNodeEvent = function (evt, reference, delay, options) { - var relatedreference = evt.relatedreference || evt.toElement; + var relatedreference = evt.relatedreference || evt.toElement || evt.relatedTarget; var callback = function callback(evt2) { - var relatedreference2 = evt2.relatedreference || evt2.toElement; + var relatedreference2 = evt2.relatedreference || evt2.toElement || evt2.relatedTarget; // Remove event listener after call _this9._tooltipNode.removeEventListener(evt.type, callback); @@ -3211,8 +3305,9 @@ if (typeof document !== 'undefined') { openTooltips[i]._onDocumentTouch(event); } }, supportsPassive ? { - passive: true - } : false); + passive: true, + capture: true + } : true); } /** @@ -3244,6 +3339,8 @@ var defaultOptions = { defaultClass: 'vue-tooltip-theme', // Default CSS classes applied to the target element of the tooltip defaultTargetClass: 'has-tooltip', + // Is the content HTML by default? + defaultHtml: true, // Default HTML template of the tooltip element // It must include `tooltip-arrow` & `tooltip-inner` CSS classes (can be configured, see below) // Change if the classes conflict with other libraries (for example bootstrap) @@ -3268,6 +3365,8 @@ var defaultOptions = { defaultLoadingContent: '...', // Hide on mouseover tooltip autoHide: true, + // Close tooltip on click on tooltip target? + defaultHideOnTargetClick: true, // Auto destroy tooltip DOM nodes (ms) disposeTimeout: 5000, // Options for popover @@ -3300,6 +3399,7 @@ function getOptions(options) { var result = { placement: typeof options.placement !== 'undefined' ? options.placement : directive.options.defaultPlacement, delay: typeof options.delay !== 'undefined' ? options.delay : directive.options.defaultDelay, + html: typeof options.html !== 'undefined' ? options.html : directive.options.defaultHtml, template: typeof options.template !== 'undefined' ? options.template : directive.options.defaultTemplate, arrowSelector: typeof options.arrowSelector !== 'undefined' ? options.arrowSelector : directive.options.defaultArrowSelector, innerSelector: typeof options.innerSelector !== 'undefined' ? options.innerSelector : directive.options.defaultInnerSelector, @@ -3308,6 +3408,7 @@ function getOptions(options) { container: typeof options.container !== 'undefined' ? options.container : directive.options.defaultContainer, boundariesElement: typeof options.boundariesElement !== 'undefined' ? options.boundariesElement : directive.options.defaultBoundariesElement, autoHide: typeof options.autoHide !== 'undefined' ? options.autoHide : directive.options.autoHide, + hideOnTargetClick: typeof options.hideOnTargetClick !== 'undefined' ? options.hideOnTargetClick : directive.options.defaultHideOnTargetClick, loadingClass: typeof options.loadingClass !== 'undefined' ? options.loadingClass : directive.options.defaultLoadingClass, loadingContent: typeof options.loadingContent !== 'undefined' ? options.loadingContent : directive.options.defaultLoadingContent, popperOptions: _extends$1({}, typeof options.popperOptions !== 'undefined' ? options.popperOptions : directive.options.defaultPopperOptions) @@ -3361,8 +3462,7 @@ function createTooltip(el, value) { var content = getContent(value); var classes = typeof value.classes !== 'undefined' ? value.classes : directive.options.defaultClass; var opts = _extends$1({ - title: content, - html: true + title: content }, getOptions(_extends$1({}, value, { placement: getPlacement(value, modifiers) }))); @@ -3532,12 +3632,12 @@ function getInternetExplorerVersion() { return -1; } -var isIE = void 0; +var isIE$1 = void 0; function initCompat() { if (!initCompat.init) { initCompat.init = true; - isIE = getInternetExplorerVersion() !== -1; + isIE$1 = getInternetExplorerVersion() !== -1; } } @@ -3558,7 +3658,7 @@ var ResizeObserver = { render: function render() { }, removeResizeHandlers: function removeResizeHandlers() { if (this._resizeObject && this._resizeObject.onload) { - if (!isIE && this._resizeObject.contentDocument) { + if (!isIE$1 && this._resizeObject.contentDocument) { this._resizeObject.contentDocument.defaultView.removeEventListener('resize', this.notify); } delete this._resizeObject.onload; @@ -3578,13 +3678,14 @@ var ResizeObserver = { render: function render() { this._resizeObject = object; object.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;'); object.setAttribute('aria-hidden', 'true'); + object.setAttribute('tabindex', -1); object.onload = this.addResizeHandlers; object.type = 'text/html'; - if (isIE) { + if (isIE$1) { this.$el.appendChild(object); } object.data = 'about:blank'; - if (!isIE) { + if (!isIE$1) { this.$el.appendChild(object); } }, @@ -3605,7 +3706,7 @@ function install$1(Vue) { // Plugin var plugin$2 = { // eslint-disable-next-line no-undef - version: "0.4.3", + version: "0.4.4", install: install$1 }; @@ -3635,10 +3736,15 @@ if (typeof window !== 'undefined' && typeof navigator !== 'undefined') { var openPopovers = []; +var Element = function Element() {}; +if (typeof window !== 'undefined') { + Element = window.Element; +} + var Popover = { render: function render() { - var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "v-popover", class: _vm.cssClass }, [_c('span', { ref: "trigger", staticClass: "trigger", staticStyle: { "display": "inline-block" }, attrs: { "aria-describedby": _vm.popoverId } }, [_vm._t("default")], 2), _vm._v(" "), _c('div', { ref: "popover", class: [_vm.popoverBaseClass, _vm.popoverClass, _vm.cssClass], style: { - display: _vm.isOpen ? '' : 'none' - }, attrs: { "id": _vm.popoverId, "aria-hidden": _vm.isOpen ? 'false' : 'true' } }, [_c('div', { class: _vm.popoverWrapperClass }, [_c('div', { ref: "arrow", class: _vm.popoverArrowClass }), _vm._v(" "), _c('div', { ref: "inner", class: _vm.popoverInnerClass, staticStyle: { "position": "relative" } }, [_c('div', [_vm._t("popover")], 2), _vm._v(" "), _vm.handleResize ? _c('ResizeObserver', { on: { "notify": _vm.$_handleResize } }) : _vm._e()], 1)])])]); + var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "v-popover", class: _vm.cssClass }, [_c('span', { ref: "trigger", staticClass: "trigger", staticStyle: { "display": "inline-block" }, attrs: { "aria-describedby": _vm.popoverId, "tabindex": _vm.trigger.indexOf('focus') !== -1 ? 0 : -1 } }, [_vm._t("default")], 2), _vm._v(" "), _c('div', { ref: "popover", class: [_vm.popoverBaseClass, _vm.popoverClass, _vm.cssClass], style: { + visibility: _vm.isOpen ? 'visible' : 'hidden' + }, attrs: { "id": _vm.popoverId, "aria-hidden": _vm.isOpen ? 'false' : 'true' } }, [_c('div', { class: _vm.popoverWrapperClass }, [_c('div', { ref: "inner", class: _vm.popoverInnerClass, staticStyle: { "position": "relative" } }, [_c('div', [_vm._t("popover")], 2), _vm._v(" "), _vm.handleResize ? _c('ResizeObserver', { on: { "notify": _vm.$_handleResize } }) : _vm._e()], 1), _vm._v(" "), _c('div', { ref: "arrow", class: _vm.popoverArrowClass })])])]); }, staticRenderFns: [], name: 'VPopover', @@ -3793,36 +3899,23 @@ var Popover = { render: function render() { } container.appendChild(popoverNode); - this.popperInstance.update(); + this.popperInstance.scheduleUpdate(); } }, trigger: function trigger(val) { this.$_removeEventListeners(); this.$_addEventListeners(); }, - offset: function offset(val) { + placement: function placement(val) { var _this = this; this.$_updatePopper(function () { - if (val) { - var offset = _this.$_getOffset(); - - _this.popperInstance.options.modifiers.offset = { - offset: offset - }; - } else { - _this.popperInstance.options.modifiers.offset = undefined; - } + _this.popperInstance.options.placement = val; }); }, - placement: function placement(val) { - var _this2 = this; - this.$_updatePopper(function () { - _this2.popperInstance.options.placement = val; - }); - }, + offset: '$_restartPopper', boundariesElement: '$_restartPopper', @@ -3855,6 +3948,8 @@ var Popover = { render: function render() { methods: { show: function show() { + var _this2 = this; + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, event = _ref.event, _ref$skipDelay = _ref.skipDelay, @@ -3867,6 +3962,10 @@ var Popover = { render: function render() { this.$emit('show'); } this.$emit('update:open', true); + this.$_beingShowed = true; + requestAnimationFrame(function () { + _this2.$_beingShowed = false; + }); }, hide: function hide() { var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, @@ -3892,6 +3991,8 @@ var Popover = { render: function render() { } } this.$_mounted = false; + this.popperInstance = null; + this.isOpen = false; this.$emit('dispose'); }, @@ -3917,7 +4018,7 @@ var Popover = { render: function render() { if (this.popperInstance) { this.isOpen = true; this.popperInstance.enableEventListeners(); - this.popperInstance.update(); + this.popperInstance.scheduleUpdate(); } if (!this.$_mounted) { @@ -3960,7 +4061,7 @@ var Popover = { render: function render() { // Fix position requestAnimationFrame(function () { if (!_this3.$_isDisposed && _this3.popperInstance) { - _this3.popperInstance.update(); + _this3.popperInstance.scheduleUpdate(); // Show the tooltip requestAnimationFrame(function () { @@ -3989,6 +4090,8 @@ var Popover = { render: function render() { } openPopovers.push(this); + + this.$emit('apply-show'); }, $_hide: function $_hide() { var _this4 = this; @@ -4020,6 +4123,8 @@ var Popover = { render: function render() { } }, disposeTime); } + + this.$emit('apply-hide'); }, $_findContainer: function $_findContainer(container, reference) { // if container is a query, get the relative element @@ -4146,10 +4251,10 @@ var Popover = { render: function render() { var reference = this.$refs.trigger; var popoverNode = this.$refs.popover; - var relatedreference = event.relatedreference || event.toElement; + var relatedreference = event.relatedreference || event.toElement || event.relatedTarget; var callback = function callback(event2) { - var relatedreference2 = event2.relatedreference || event2.toElement; + var relatedreference2 = event2.relatedreference || event2.toElement || event2.relatedTarget; // Remove event listener after call popoverNode.removeEventListener(event.type, callback); @@ -4180,18 +4285,19 @@ var Popover = { render: function render() { this.$_events = []; }, $_updatePopper: function $_updatePopper(cb) { - if (this.isOpen && this.popperInstance) { + if (this.popperInstance) { cb(); - this.popperInstance.update(); + if (this.isOpen) this.popperInstance.scheduleUpdate(); } }, $_restartPopper: function $_restartPopper() { if (this.popperInstance) { var isOpen = this.isOpen; this.dispose(); + this.$_isDisposed = false; this.$_init(); if (isOpen) { - this.show(); + this.show({ skipDelay: true, force: true }); } } }, @@ -4200,6 +4306,8 @@ var Popover = { render: function render() { var touch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + if (this.$_beingShowed) return; + this.hide({ event: event }); if (event.closePopover) { @@ -4217,7 +4325,7 @@ var Popover = { render: function render() { }, $_handleResize: function $_handleResize() { if (this.isOpen && this.popperInstance) { - this.popperInstance.update(); + this.popperInstance.scheduleUpdate(); this.$emit('resize'); } } @@ -4227,10 +4335,11 @@ var Popover = { render: function render() { if (typeof document !== 'undefined' && typeof window !== 'undefined') { if (isIOS) { document.addEventListener('touchend', handleGlobalTouchend, supportsPassive ? { - passive: true - } : false); + passive: true, + capture: true + } : true); } else { - window.addEventListener('click', handleGlobalClick); + window.addEventListener('click', handleGlobalClick, true); } } @@ -4245,14 +4354,19 @@ function handleGlobalTouchend(event) { function handleGlobalClose(event) { var touch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var popover = void 0; - for (var i = 0; i < openPopovers.length; i++) { - popover = openPopovers[i]; - var contains = popover.$refs.popover.contains(event.target); - if (event.closeAllPopover || event.closePopover && contains || popover.autoHide && !contains) { - popover.$_handleGlobalClose(event, touch); + // Delay so that close directive has time to set values + requestAnimationFrame(function () { + var popover = void 0; + for (var i = 0; i < openPopovers.length; i++) { + popover = openPopovers[i]; + if (popover.$refs.popover) { + var contains = popover.$refs.popover.contains(event.target); + if (event.closeAllPopover || event.closePopover && contains || popover.autoHide && !contains) { + popover.$_handleGlobalClose(event, touch); + } + } } - } + }); } var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; @@ -4267,9 +4381,9 @@ function createCommonjsModule(fn, module) { var lodash_merge = createCommonjsModule(function (module, exports) { /** - * lodash (Custom Build) + * Lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors + * Copyright JS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors @@ -4281,12 +4395,17 @@ var LARGE_ARRAY_SIZE = 200; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', @@ -4294,12 +4413,13 @@ var argsTag = '[object Arguments]', genTag = '[object GeneratorFunction]', mapTag = '[object Map]', numberTag = '[object Number]', + nullTag = '[object Null]', objectTag = '[object Object]', - promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', - symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', @@ -4320,9 +4440,6 @@ var arrayBufferTag = '[object ArrayBuffer]', */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; - /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; @@ -4345,22 +4462,6 @@ typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = -cloneableTags[boolTag] = cloneableTags[dateTag] = -cloneableTags[float32Tag] = cloneableTags[float64Tag] = -cloneableTags[int8Tag] = cloneableTags[int16Tag] = -cloneableTags[int32Tag] = cloneableTags[mapTag] = -cloneableTags[numberTag] = cloneableTags[objectTag] = -cloneableTags[regexpTag] = cloneableTags[setTag] = -cloneableTags[stringTag] = cloneableTags[symbolTag] = -cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = -cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; - /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; @@ -4385,41 +4486,13 @@ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { - return freeProcess && freeProcess.binding('util'); + return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); /* Node.js helper references. */ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; -/** - * Adds the key-value `pair` to `map`. - * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ -function addMapEntry(map, pair) { - // Don't return `map.set` because it's not chainable in IE 11. - map.set(pair[0], pair[1]); - return map; -} - -/** - * Adds `value` to `set`. - * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ -function addSetEntry(set, value) { - // Don't return `set.add` because it's not chainable in IE 11. - set.add(value); - return set; -} - /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. @@ -4440,71 +4513,6 @@ function apply(func, thisArg, args) { return func.apply(thisArg, args); } -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array ? array.length : 0; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} - -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; -} - -/** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ -function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array ? array.length : 0; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; -} - /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. @@ -4549,42 +4557,6 @@ function getValue(object, key) { return object == null ? undefined : object[key]; } -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ -function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; -} - /** * Creates a unary function that invokes `func` with its argument transformed. * @@ -4600,20 +4572,17 @@ function overArg(func, transform) { } /** - * Converts `set` to an array of its values. + * Gets the value at `key`, unless `key` is "__proto__". * * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; +function safeGet(object, key) { + return key == '__proto__' + ? undefined + : object[key]; } /** Used for built-in method references. */ @@ -4624,27 +4593,27 @@ var arrayProto = Array.prototype, /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; -/** Used to infer the `Object` constructor. */ -var objectCtorString = funcToString.call(Object); +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ -var objectToString = objectProto.toString; +var nativeObjectToString = objectProto.toString; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + @@ -4656,35 +4625,53 @@ var reIsNative = RegExp('^' + var Buffer = moduleExports ? root.Buffer : undefined, Symbol = root.Symbol, Uint8Array = root.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice; + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); /* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols, - nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeKeys = overArg(Object.keys, Object), - nativeMax = Math.max; +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeMax = Math.max, + nativeNow = Date.now; /* Built-in method references that are verified to be native. */ -var DataView = getNative(root, 'DataView'), - Map = getNative(root, 'Map'), - Promise = getNative(root, 'Promise'), - Set = getNative(root, 'Set'), - WeakMap = getNative(root, 'WeakMap'), +var Map = getNative(root, 'Map'), nativeCreate = getNative(Object, 'create'); -/** Used to detect maps, sets, and weakmaps. */ -var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); /** * Creates a hash object. @@ -4695,7 +4682,7 @@ var symbolProto = Symbol ? Symbol.prototype : undefined, */ function Hash(entries) { var index = -1, - length = entries ? entries.length : 0; + length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { @@ -4713,6 +4700,7 @@ function Hash(entries) { */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; } /** @@ -4726,7 +4714,9 @@ function hashClear() { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; } /** @@ -4758,7 +4748,7 @@ function hashGet(key) { */ function hashHas(key) { var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } /** @@ -4773,6 +4763,7 @@ function hashHas(key) { */ function hashSet(key, value) { var data = this.__data__; + this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } @@ -4793,7 +4784,7 @@ Hash.prototype.set = hashSet; */ function ListCache(entries) { var index = -1, - length = entries ? entries.length : 0; + length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { @@ -4811,6 +4802,7 @@ function ListCache(entries) { */ function listCacheClear() { this.__data__ = []; + this.size = 0; } /** @@ -4835,6 +4827,7 @@ function listCacheDelete(key) { } else { splice.call(data, index, 1); } + --this.size; return true; } @@ -4882,6 +4875,7 @@ function listCacheSet(key, value) { index = assocIndexOf(data, key); if (index < 0) { + ++this.size; data.push([key, value]); } else { data[index][1] = value; @@ -4905,7 +4899,7 @@ ListCache.prototype.set = listCacheSet; */ function MapCache(entries) { var index = -1, - length = entries ? entries.length : 0; + length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { @@ -4922,6 +4916,7 @@ function MapCache(entries) { * @memberOf MapCache */ function mapCacheClear() { + this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), @@ -4939,7 +4934,9 @@ function mapCacheClear() { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; } /** @@ -4979,7 +4976,11 @@ function mapCacheHas(key) { * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; return this; } @@ -4998,7 +4999,8 @@ MapCache.prototype.set = mapCacheSet; * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { - this.__data__ = new ListCache(entries); + var data = this.__data__ = new ListCache(entries); + this.size = data.size; } /** @@ -5010,6 +5012,7 @@ function Stack(entries) { */ function stackClear() { this.__data__ = new ListCache; + this.size = 0; } /** @@ -5022,7 +5025,11 @@ function stackClear() { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { - return this.__data__['delete'](key); + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; } /** @@ -5062,16 +5069,18 @@ function stackHas(key) { * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { - var cache = this.__data__; - if (cache instanceof ListCache) { - var pairs = cache.__data__; + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); + this.size = ++data.size; return this; } - cache = this.__data__ = new MapCache(pairs); + data = this.__data__ = new MapCache(pairs); } - cache.set(key, value); + data.set(key, value); + this.size = data.size; return this; } @@ -5091,18 +5100,26 @@ Stack.prototype.set = stackSet; * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - // Safari 9 makes `arguments.length` enumerable in strict mode. - var result = (isArray(value) || isArguments(value)) - ? baseTimes(value.length, String) - : []; - - var length = result.length, - skipIndexes = !!length; + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { result.push(key); } } @@ -5120,8 +5137,8 @@ function arrayLikeKeys(value, inherited) { */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || - (typeof key == 'number' && value === undefined && !(key in object))) { - object[key] = value; + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); } } @@ -5139,7 +5156,7 @@ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { - object[key] = value; + baseAssignValue(object, key, value); } } @@ -5162,130 +5179,65 @@ function assocIndexOf(array, key) { } /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. * * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. */ -function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } } /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {boolean} [isFull] Specify a clone including symbols. - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, isDeep, isFull, customizer, key, object, stack) { - var result; - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - if (isHostObject(value)) { - return object ? value : {}; - } - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - return copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, baseClone, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - if (!isArr) { - var props = isFull ? getAllKeys(value) : keys(value); - } - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); - }); - return result; -} + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. + * The base implementation of `getTag` without fallbacks for buggy environments. * * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ -function baseCreate(proto) { - return isObject(proto) ? objectCreate(proto) : {}; -} - -/** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. */ -function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); } /** - * The base implementation of `getTag`. + * The base implementation of `_.isArguments`. * * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ -function baseGetTag(value) { - return objectToString.call(value); +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; } /** @@ -5300,7 +5252,7 @@ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } @@ -5313,27 +5265,7 @@ function baseIsNative(value) { */ function baseIsTypedArray(value) { return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; -} - -/** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } /** @@ -5373,21 +5305,14 @@ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } - if (!(isArray(source) || isTypedArray(source))) { - var props = baseKeysIn(source); - } - arrayEach(props || source, function(srcValue, key) { - if (props) { - key = srcValue; - srcValue = source[key]; - } + baseFor(source, function(srcValue, key) { if (isObject(srcValue)) { stack || (stack = new Stack); baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer - ? customizer(object[key], srcValue, (key + ''), object, source, stack) + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { @@ -5395,7 +5320,7 @@ function baseMerge(object, source, srcIndex, customizer, stack) { } assignMergeValue(object, key, newValue); } - }); + }, keysIn); } /** @@ -5414,8 +5339,8 @@ function baseMerge(object, source, srcIndex, customizer, stack) { * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = object[key], - srcValue = source[key], + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { @@ -5429,29 +5354,37 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta var isCommon = newValue === undefined; if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + newValue = srcValue; - if (isArray(srcValue) || isTypedArray(srcValue)) { + if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } - else { + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { isCommon = false; - newValue = baseClone(srcValue, true); + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { - isCommon = false; - newValue = baseClone(srcValue, true); - } - else { - newValue = objValue; + newValue = initCloneObject(srcValue); } } else { @@ -5476,26 +5409,26 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta * @returns {Function} Returns the new function. */ function baseRest(func, start) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; + return setToString(overRest(func, start, identity), func + ''); } +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + /** * Creates a clone of `buffer`. * @@ -5508,7 +5441,9 @@ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } - var result = new buffer.constructor(buffer.length); + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + buffer.copy(result); return result; } @@ -5526,71 +5461,6 @@ function cloneArrayBuffer(arrayBuffer) { return result; } -/** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ -function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); -} - -/** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned map. - */ -function cloneMap(map, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); - return arrayReduce(array, addMapEntry, new map.constructor); -} - -/** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ -function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; -} - -/** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned set. - */ -function cloneSet(set, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); - return arrayReduce(array, addSetEntry, new set.constructor); -} - -/** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ -function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; -} - /** * Creates a clone of `typedArray`. * @@ -5634,6 +5504,7 @@ function copyArray(source, array) { * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { + var isNew = !object; object || (object = {}); var index = -1, @@ -5646,23 +5517,18 @@ function copyObject(source, props, object, customizer) { ? customizer(object[key], source[key], key, object, source) : undefined; - assignValue(object, key, newValue === undefined ? source[key] : newValue); + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } } return object; } -/** - * Copies own symbol properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); -} - /** * Creates a function like `_.assign`. * @@ -5697,14 +5563,27 @@ function createAssigner(assigner) { } /** - * Creates an array of own enumerable property names and symbols of `object`. + * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. */ -function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; } /** @@ -5736,63 +5615,28 @@ function getNative(object, key) { } /** - * Creates an array of the own enumerable symbol properties of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; - -/** - * Gets the `toStringTag` of `value`. + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. + * @returns {string} Returns the raw `toStringTag`. */ -var getTag = baseGetTag; - -// Fallback for data views, maps, sets, and weak maps in IE 11, -// for data views in Edge < 14, and promises in Node.js. -if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : undefined; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; -} +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; -/** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ -function initCloneArray(array) { - var length = array.length, - result = array.constructor(length); + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } } return result; } @@ -5810,55 +5654,6 @@ function initCloneObject(object) { : {}; } -/** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneByTag(object, tag, cloneFunc, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return cloneMap(object, isDeep, cloneFunc); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return cloneSet(object, isDeep, cloneFunc); - - case symbolTag: - return cloneSymbol(object); - } -} - /** * Checks if `value` is a valid array-like index. * @@ -5868,10 +5663,13 @@ function initCloneByTag(object, tag, cloneFunc, isDeep) { * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { + var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); } /** @@ -5956,11 +5754,91 @@ function nativeKeysIn(object) { return result; } +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + /** * Converts `func` to its source code. * * @private - * @param {Function} func The function to process. + * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { @@ -6029,11 +5907,10 @@ function eq(value, other) { * _.isArguments([1, 2, 3]); * // => false */ -function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; /** * Checks if `value` is classified as an `Array` object. @@ -6155,10 +6032,13 @@ var isBuffer = nativeIsBuffer || stubFalse; * // => false */ function isFunction(value) { + if (!isObject(value)) { + return false; + } // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } /** @@ -6219,7 +6099,7 @@ function isLength(value) { */ function isObject(value) { var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + return value != null && (type == 'object' || type == 'function'); } /** @@ -6247,7 +6127,7 @@ function isObject(value) { * // => false */ function isObjectLike(value) { - return !!value && typeof value == 'object'; + return value != null && typeof value == 'object'; } /** @@ -6279,8 +6159,7 @@ function isObjectLike(value) { * // => true */ function isPlainObject(value) { - if (!isObjectLike(value) || - objectToString.call(value) != objectTag || isHostObject(value)) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); @@ -6288,8 +6167,8 @@ function isPlainObject(value) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return (typeof Ctor == 'function' && - Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; } /** @@ -6339,38 +6218,6 @@ function toPlainObject(value) { return copyObject(value, keysIn(value)); } -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} - /** * Creates an array of the own and inherited enumerable property names of `object`. * @@ -6434,25 +6281,48 @@ var merge = createAssigner(function(object, source, srcIndex) { }); /** - * This method returns a new empty array. + * Creates a function that returns `value`. * * @static * @memberOf _ - * @since 4.13.0 + * @since 2.4.0 * @category Util - * @returns {Array} Returns the new empty array. + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. * @example * - * var arrays = _.times(2, _.stubArray); + * var objects = _.times(2, _.constant({ 'a': 1 })); * - * console.log(arrays); - * // => [[], []] + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] * - * console.log(arrays[0] === arrays[1]); - * // => false + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true */ -function stubArray() { - return []; +function identity(value) { + return value; } /** diff --git a/dist/v-tooltip.min.js b/dist/v-tooltip.min.js index b8a9d5d9..2e232c6c 100644 --- a/dist/v-tooltip.min.js +++ b/dist/v-tooltip.min.js @@ -1 +1 @@ -var VTooltip=function(e){"use strict";for(var t="undefined"!=typeof window&&"undefined"!=typeof document,n=["Edge","Trident","Firefox"],o=0,r=0;r=0){o=1;break}var i=t&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},o))}};function s(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t){if(1!==e.nodeType)return[];var n=getComputedStyle(e,null);return t?n[t]:n}function p(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function u(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=a(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/(auto|scroll)/.test(n+r+o)?e:u(p(e))}function f(e){var t=e&&e.offsetParent,n=t&&t.nodeName;return n&&"BODY"!==n&&"HTML"!==n?-1!==["TD","TABLE"].indexOf(t.nodeName)&&"static"===a(t,"position")?f(t):t:e?e.ownerDocument.documentElement:document.documentElement}function l(e){return null!==e.parentNode?l(e.parentNode):e}function c(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,o=n?e:t,r=n?t:e,i=document.createRange();i.setStart(o,0),i.setEnd(r,0);var s,a,p=i.commonAncestorContainer;if(e!==p&&t!==p||o.contains(r))return"BODY"===(a=(s=p).nodeName)||"HTML"!==a&&f(s.firstElementChild)!==s?f(p):p;var u=l(e);return u.host?c(u.host,t):c(e,l(t).host)}function d(e){var t="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=e.nodeName;if("BODY"===n||"HTML"===n){var o=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||o)[t]}return e[t]}function h(e,t){var n="x"===t?"Left":"Top",o="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+o+"Width"],10)}var v=void 0,m=function(){return void 0===v&&(v=-1!==navigator.appVersion.indexOf("MSIE 10")),v};function g(e,t,n,o){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],m()?n["offset"+e]+o["margin"+("Height"===e?"Top":"Left")]+o["margin"+("Height"===e?"Bottom":"Right")]:0)}function y(){var e=document.body,t=document.documentElement,n=m()&&getComputedStyle(t);return{height:g("Height",e,t,n),width:g("Width",e,t,n)}}var b=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},_=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],o=d(t,"top"),r=d(t,"left"),i=n?-1:1;return e.top+=o*i,e.bottom+=o*i,e.left+=r*i,e.right+=r*i,e}(c,t)),c}function $(e,t,n,o){var r={top:0,left:0},i=c(e,t);if("viewport"===o)r=function(e){var t=e.ownerDocument.documentElement,n=T(e,t),o=Math.max(t.clientWidth,window.innerWidth||0),r=Math.max(t.clientHeight,window.innerHeight||0),i=d(t),s=d(t,"left");return E({top:i-n.top+n.marginTop,left:s-n.left+n.marginLeft,width:o,height:r})}(i);else{var s=void 0;"scrollParent"===o?"BODY"===(s=u(p(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===o?e.ownerDocument.documentElement:o;var f=T(s,i);if("HTML"!==s.nodeName||function e(t){var n=t.nodeName;return"BODY"!==n&&"HTML"!==n&&("fixed"===a(t,"position")||e(p(t)))}(i))r=f;else{var l=y(),h=l.height,v=l.width;r.top+=f.top-f.marginTop,r.bottom=h+f.top,r.left+=f.left-f.marginLeft,r.right=v+f.left}}return r.left+=n,r.top+=n,r.right-=n,r.bottom-=n,r}function L(e,t,n,o,r){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var s=$(n,o,i,r),a={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},p=Object.keys(a).map(function(e){return O({key:e},a[e],{area:(t=a[e],t.width*t.height)});var t}).sort(function(e,t){return t.area-e.area}),u=p.filter(function(e){var t=e.width,o=e.height;return t>=n.clientWidth&&o>=n.clientHeight}),f=u.length>0?u[0].key:p[0].key,l=e.split("-")[1];return f+(l?"-"+l:"")}function j(e,t,n){return T(n,c(t,n))}function N(e){var t=getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),o=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+o,height:e.offsetHeight+n}}function S(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function x(e,t,n){n=n.split("-")[0];var o=N(e),r={width:o.width,height:o.height},i=-1!==["right","left"].indexOf(n),s=i?"top":"left",a=i?"left":"top",p=i?"height":"width",u=i?"width":"height";return r[s]=t[s]+t[p]/2-o[p]/2,r[a]=n===a?t[a]-o[u]:t[S(a)],r}function A(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function k(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var o=A(e,function(e){return e[t]===n});return e.indexOf(o)}(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&s(n)&&(t.offsets.popper=E(t.offsets.popper),t.offsets.reference=E(t.offsets.reference),t=n(t,e))}),t}function I(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function P(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),o=0;o1&&void 0!==arguments[1]&&arguments[1],n=R.indexOf(e),o=R.slice(n+1).concat(R.slice(0,n));return t?o.reverse():o}var U={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function q(e,t,n,o){var r=[0,0],i=-1!==["right","left"].indexOf(o),s=e.split(/(\+|\-)/).map(function(e){return e.trim()}),a=s.indexOf(A(s,function(e){return-1!==e.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var p=/\s*,\s*|\s+/,u=-1!==a?[s.slice(0,a).concat([s[a].split(p)[0]]),[s[a].split(p)[1]].concat(s.slice(a+1))]:[s];return(u=u.map(function(e,o){var r=(1===o?!i:i)?"height":"width",s=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,s=!0,e):s?(e[e.length-1]+=t,s=!1,e):e.concat(t)},[]).map(function(e){return function(e,t,n,o){var r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+r[1],s=r[2];if(!i)return e;if(0===s.indexOf("%")){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=o}return E(a)[t]/100*i}if("vh"===s||"vw"===s)return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i;return i}(e,r,t,n)})})).forEach(function(e,t){e.forEach(function(n,o){B(n)&&(r[t]+=n*("-"===e[o-1]?-1:1))})}),r}var G={placement:"bottom",eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],o=t.split("-")[1];if(o){var r=e.offsets,i=r.reference,s=r.popper,a=-1!==["bottom","top"].indexOf(n),p=a?"left":"top",u=a?"width":"height",f={start:w({},p,i[p]),end:w({},p,i[p]+i[u]-s[u])};e.offsets.popper=O({},s,f[o])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,o=e.placement,r=e.offsets,i=r.popper,s=r.reference,a=o.split("-")[0],p=void 0;return p=B(+n)?[+n,0]:q(n,i,s,a),"left"===a?(i.top+=p[0],i.left-=p[1]):"right"===a?(i.top+=p[0],i.left+=p[1]):"top"===a?(i.left+=p[0],i.top-=p[1]):"bottom"===a&&(i.left+=p[0],i.top+=p[1]),e.popper=i,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||f(e.instance.popper);e.instance.reference===n&&(n=f(n));var o=$(e.instance.popper,e.instance.reference,t.padding,n);t.boundaries=o;var r=t.priority,i=e.offsets.popper,s={primary:function(e){var n=i[e];return i[e]o[e]&&!t.escapeWithReference&&(r=Math.min(i[n],o[e]-("right"===e?i.width:i.height))),w({},n,r)}};return r.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";i=O({},i,s[t](e))}),e.offsets.popper=i,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,o=t.reference,r=e.placement.split("-")[0],i=Math.floor,s=-1!==["top","bottom"].indexOf(r),a=s?"right":"bottom",p=s?"left":"top",u=s?"width":"height";return n[a]i(o[a])&&(e.offsets.popper[p]=i(o[a])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!W(e.instance.modifiers,"arrow","keepTogether"))return e;var o=t.element;if("string"==typeof o){if(!(o=e.instance.popper.querySelector(o)))return e}else if(!e.instance.popper.contains(o))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var r=e.placement.split("-")[0],i=e.offsets,s=i.popper,p=i.reference,u=-1!==["left","right"].indexOf(r),f=u?"height":"width",l=u?"Top":"Left",c=l.toLowerCase(),d=u?"left":"top",h=u?"bottom":"right",v=N(o)[f];p[h]-vs[h]&&(e.offsets.popper[c]+=p[c]+v-s[h]),e.offsets.popper=E(e.offsets.popper);var m=p[c]+p[f]/2-v/2,g=a(e.instance.popper),y=parseFloat(g["margin"+l],10),b=parseFloat(g["border"+l+"Width"],10),_=m-e.offsets.popper[c]-y-b;return _=Math.max(Math.min(s[f]-v,_),0),e.arrowElement=o,e.offsets.arrow=(w(n={},c,Math.round(_)),w(n,d,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(I(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=$(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),o=e.placement.split("-")[0],r=S(o),i=e.placement.split("-")[1]||"",s=[];switch(t.behavior){case U.FLIP:s=[o,r];break;case U.CLOCKWISE:s=V(o);break;case U.COUNTERCLOCKWISE:s=V(o,!0);break;default:s=t.behavior}return s.forEach(function(a,p){if(o!==a||s.length===p+1)return e;o=e.placement.split("-")[0],r=S(o);var u=e.offsets.popper,f=e.offsets.reference,l=Math.floor,c="left"===o&&l(u.right)>l(f.left)||"right"===o&&l(u.left)l(f.top)||"bottom"===o&&l(u.top)l(n.right),v=l(u.top)l(n.bottom),g="left"===o&&d||"right"===o&&h||"top"===o&&v||"bottom"===o&&m,y=-1!==["top","bottom"].indexOf(o),b=!!t.flipVariations&&(y&&"start"===i&&d||y&&"end"===i&&h||!y&&"start"===i&&v||!y&&"end"===i&&m);(c||g||b)&&(e.flipped=!0,(c||g)&&(o=s[p+1]),b&&(i=function(e){return"end"===e?"start":"start"===e?"end":e}(i)),e.placement=o+(i?"-"+i:""),e.offsets.popper=O({},e.offsets.popper,x(e.instance.popper,e.offsets.reference,e.placement)),e=k(e.instance.modifiers,e,"flip"))}),e},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],o=e.offsets,r=o.popper,i=o.reference,s=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return r[s?"left":"top"]=i[n]-(a?r[s?"width":"height"]:0),e.placement=S(t),e.offsets.popper=E(r),e}},hide:{order:800,enabled:!0,fn:function(e){if(!W(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=A(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};b(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(o.update)},this.update=i(this.update.bind(this)),this.options=O({},e.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(O({},e.Defaults.modifiers,r.modifiers)).forEach(function(t){o.options.modifiers[t]=O({},e.Defaults.modifiers[t]||{},r.modifiers?r.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return O({name:e},o.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&s(e.onLoad)&&e.onLoad(o.reference,o.popper,o.options,e,o.state)}),this.update();var a=this.options.eventsEnabled;a&&this.enableEventListeners(),this.state.eventsEnabled=a}return _(e,[{key:"update",value:function(){return function(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=j(this.state,this.popper,this.reference),e.placement=L(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.offsets.popper=x(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position="absolute",e=k(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}.call(this)}},{key:"destroy",value:function(){return function(){return this.state.isDestroyed=!0,I(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.left="",this.popper.style.position="",this.popper.style.top="",this.popper.style[P("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}.call(this)}},{key:"enableEventListeners",value:function(){return function(){this.state.eventsEnabled||(this.state=M(this.reference,this.options,this.state,this.scheduleUpdate))}.call(this)}},{key:"disableEventListeners",value:function(){return H.call(this)}}]),e}();function K(e){return"string"==typeof e&&(e=e.split(" ")),e}function X(e,t){var n=K(t),o=void 0;o=e.className instanceof SVGAnimatedString?Array.from(e.className):K(e.className),n.forEach(function(e){-1===o.indexOf(e)&&o.push(e)}),e instanceof SVGElement?e.setAttribute("class",o.join(" ")):e.className=o.join(" ")}function J(e,t){var n=K(t),o=void 0;o=e.className instanceof SVGAnimatedString?Array.from(e.className):K(e.className),n.forEach(function(e){var t=o.indexOf(e);-1!==t&&o.splice(t,1)}),e instanceof SVGElement?e.setAttribute("class",o.join(" ")):e.className=o.join(" ")}Y.Utils=("undefined"!=typeof window?window:global).PopperUtils,Y.placements=z,Y.Defaults=G;var Q=!1;if("undefined"!=typeof window){Q=!1;try{var Z=Object.defineProperty({},"passive",{get:function(){Q=!0}});window.addEventListener("test",null,Z)}catch(e){}}var ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ne=function(){function e(e,t){for(var n=0;n
',trigger:"hover focus",offset:0},ie=[],se=function(){function e(t,n){te(this,e),ae.call(this),n=oe({},re,n),t.jquery&&(t=t[0]),this.reference=t,this.options=n,this._isOpen=!1,this._init()}return ne(e,[{key:"setClasses",value:function(e){this._classes=e}},{key:"setContent",value:function(e){this.options.title=e,this._tooltipNode&&this._setContent(e,this.options)}},{key:"setOptions",value:function(e){var t=!1,n=e&&e.classes||ge.options.defaultClass;this._classes!==n&&(this.setClasses(n),t=!0),e=le(e);var o=!1,r=!1;for(var i in this.options.offset===e.offset&&this.options.placement===e.placement||(o=!0),(this.options.template!==e.template||this.options.trigger!==e.trigger||this.options.container!==e.container||t)&&(r=!0),e)this.options[i]=e[i];if(this._tooltipNode)if(r){var s=this._isOpen;this.dispose(),this._init(),s&&this.show()}else o&&this.popperInstance.update()}},{key:"_init",value:function(){var e="string"==typeof this.options.trigger?this.options.trigger.split(" ").filter(function(e){return-1!==["click","hover","focus"].indexOf(e)}):[];this._isDisposed=!1,this._enableDocumentTouch=-1===e.indexOf("manual"),this._setEventListeners(this.reference,e,this.options)}},{key:"_create",value:function(e,t){var n=window.document.createElement("div");n.innerHTML=t.trim();var o=n.childNodes[0];return o.id="tooltip_"+Math.random().toString(36).substr(2,10),o.setAttribute("aria-hidden","true"),this.options.autoHide&&-1!==this.options.trigger.indexOf("hover")&&(o.addEventListener("mouseenter",this.hide),o.addEventListener("click",this.hide)),o}},{key:"_setContent",value:function(e,t){var n=this;this.asyncContent=!1,this._applyContent(e,t).then(function(){n.popperInstance.update()})}},{key:"_applyContent",value:function(e,t){var n=this;return new Promise(function(o,r){var i=t.html,s=n._tooltipNode,a=s.querySelector(n.options.innerSelector);if(1===e.nodeType){if(i){for(;a.firstChild;)a.removeChild(a.firstChild);a.appendChild(e)}}else{if("function"==typeof e){var p=e();return void(p&&"function"==typeof p.then?(n.asyncContent=!0,t.loadingClass&&X(s,t.loadingClass),t.loadingContent&&n._applyContent(t.loadingContent,t),p.then(function(e){return t.loadingClass&&J(s,t.loadingClass),n._applyContent(e,t)}).then(o).catch(r)):n._applyContent(p,t).then(o).catch(r))}i?a.innerHTML=e:a.innerText=e}o()})}},{key:"_show",value:function(e,t){if(t&&"string"==typeof t.container&&!document.querySelector(t.container))return;clearTimeout(this._disposeTimer),delete(t=Object.assign({},t)).offset;var n=!0;this._tooltipNode&&(X(this._tooltipNode,this._classes),n=!1);var o=this._ensureShown(e,t);return n&&this._tooltipNode&&X(this._tooltipNode,this._classes),o}},{key:"_ensureShown",value:function(e,t){var n=this;if(this._isOpen)return this;if(this._isOpen=!0,ie.push(this),this._tooltipNode)return this._tooltipNode.style.display="",this._tooltipNode.setAttribute("aria-hidden","false"),this.popperInstance.enableEventListeners(),this.popperInstance.update(),this.asyncContent&&this._setContent(t.title,t),this;var o=e.getAttribute("title")||t.title;if(!o)return this;var r=this._create(e,t.template);this._tooltipNode=r,this._setContent(o,t),e.setAttribute("aria-describedby",r.id);var i=this._findContainer(t.container,e);this._append(r,i);var s=oe({},t.popperOptions,{placement:t.placement});return s.modifiers=oe({},s.modifiers,{arrow:{element:this.options.arrowSelector}}),t.boundariesElement&&(s.modifiers.preventOverflow={boundariesElement:t.boundariesElement}),this.popperInstance=new Y(e,r,s),requestAnimationFrame(function(){!n._isDisposed&&n.popperInstance?(n.popperInstance.update(),requestAnimationFrame(function(){n._isDisposed?n.dispose():n._isOpen&&r.setAttribute("aria-hidden","false")})):n.dispose()}),this}},{key:"_noLongerOpen",value:function(){var e=ie.indexOf(this);-1!==e&&ie.splice(e,1)}},{key:"_hide",value:function(){var e=this;if(!this._isOpen)return this;this._isOpen=!1,this._noLongerOpen(),this._tooltipNode.style.display="none",this._tooltipNode.setAttribute("aria-hidden","true"),this.popperInstance.disableEventListeners(),clearTimeout(this._disposeTimer);var t=ge.options.disposeTimeout;return null!==t&&(this._disposeTimer=setTimeout(function(){e._tooltipNode&&(e._tooltipNode.removeEventListener("mouseenter",e.hide),e._tooltipNode.removeEventListener("click",e.hide),e._tooltipNode.parentNode.removeChild(e._tooltipNode),e._tooltipNode=null)},t)),this}},{key:"_dispose",value:function(){var e=this;return this._isDisposed=!0,this._events.forEach(function(t){var n=t.func,o=t.event;e.reference.removeEventListener(o,n)}),this._events=[],this._tooltipNode?(this._hide(),this._tooltipNode.removeEventListener("mouseenter",this.hide),this._tooltipNode.removeEventListener("click",this.hide),this.popperInstance.destroy(),this.popperInstance.options.removeOnDestroy||(this._tooltipNode.parentNode.removeChild(this._tooltipNode),this._tooltipNode=null)):this._noLongerOpen(),this}},{key:"_findContainer",value:function(e,t){return"string"==typeof e?e=window.document.querySelector(e):!1===e&&(e=t.parentNode),e}},{key:"_append",value:function(e,t){t.appendChild(e)}},{key:"_setEventListeners",value:function(e,t,n){var o=this,r=[],i=[];t.forEach(function(e){switch(e){case"hover":r.push("mouseenter"),i.push("mouseleave");break;case"focus":r.push("focus"),i.push("blur");break;case"click":r.push("click"),i.push("click")}}),r.forEach(function(t){var r=function(t){!0!==o._isOpen&&(t.usedByTooltip=!0,o._scheduleShow(e,n.delay,n,t))};o._events.push({event:t,func:r}),e.addEventListener(t,r)}),i.forEach(function(t){var r=function(t){!0!==t.usedByTooltip&&o._scheduleHide(e,n.delay,n,t)};o._events.push({event:t,func:r}),e.addEventListener(t,r)})}},{key:"_onDocumentTouch",value:function(e){this._enableDocumentTouch&&this._scheduleHide(this.reference,this.options.delay,this.options,e)}},{key:"_scheduleShow",value:function(e,t,n){var o=this,r=t&&t.show||t||0;clearTimeout(this._scheduleTimer),this._scheduleTimer=window.setTimeout(function(){return o._show(e,n)},r)}},{key:"_scheduleHide",value:function(e,t,n,o){var r=this,i=t&&t.hide||t||0;clearTimeout(this._scheduleTimer),this._scheduleTimer=window.setTimeout(function(){if(!1!==r._isOpen&&document.body.contains(r._tooltipNode)){if("mouseleave"===o.type)if(r._setTooltipNodeEvent(o,e,t,n))return;r._hide(e,n)}},i)}}]),e}(),ae=function(){var e=this;this.show=function(){e._show(e.reference,e.options)},this.hide=function(){e._hide()},this.dispose=function(){e._dispose()},this.toggle=function(){return e._isOpen?e.hide():e.show()},this._events=[],this._setTooltipNodeEvent=function(t,n,o,r){var i=t.relatedreference||t.toElement;return!!e._tooltipNode.contains(i)&&(e._tooltipNode.addEventListener(t.type,function o(i){var s=i.relatedreference||i.toElement;e._tooltipNode.removeEventListener(t.type,o),n.contains(s)||e._scheduleHide(n,r.delay,r,i)}),!0)}};"undefined"!=typeof document&&document.addEventListener("touchstart",function(e){for(var t=0;t
',defaultArrowSelector:".tooltip-arrow, .tooltip__arrow",defaultInnerSelector:".tooltip-inner, .tooltip__inner",defaultDelay:0,defaultTrigger:"hover focus",defaultOffset:0,defaultContainer:"body",defaultBoundariesElement:void 0,defaultPopperOptions:{},defaultLoadingClass:"tooltip-loading",defaultLoadingContent:"...",autoHide:!0,disposeTimeout:5e3,popover:{defaultPlacement:"bottom",defaultClass:"vue-popover-theme",defaultBaseClass:"tooltip popover",defaultWrapperClass:"wrapper",defaultInnerClass:"tooltip-inner popover-inner",defaultArrowClass:"tooltip-arrow popover-arrow",defaultDelay:0,defaultTrigger:"click",defaultOffset:0,defaultContainer:"body",defaultBoundariesElement:void 0,defaultPopperOptions:{},defaultAutoHide:!0,defaultHandleResize:!0}};function le(e){var t={placement:void 0!==e.placement?e.placement:ge.options.defaultPlacement,delay:void 0!==e.delay?e.delay:ge.options.defaultDelay,template:void 0!==e.template?e.template:ge.options.defaultTemplate,arrowSelector:void 0!==e.arrowSelector?e.arrowSelector:ge.options.defaultArrowSelector,innerSelector:void 0!==e.innerSelector?e.innerSelector:ge.options.defaultInnerSelector,trigger:void 0!==e.trigger?e.trigger:ge.options.defaultTrigger,offset:void 0!==e.offset?e.offset:ge.options.defaultOffset,container:void 0!==e.container?e.container:ge.options.defaultContainer,boundariesElement:void 0!==e.boundariesElement?e.boundariesElement:ge.options.defaultBoundariesElement,autoHide:void 0!==e.autoHide?e.autoHide:ge.options.autoHide,loadingClass:void 0!==e.loadingClass?e.loadingClass:ge.options.defaultLoadingClass,loadingContent:void 0!==e.loadingContent?e.loadingContent:ge.options.defaultLoadingContent,popperOptions:oe({},void 0!==e.popperOptions?e.popperOptions:ge.options.defaultPopperOptions)};if(t.offset){var n=ee(t.offset),o=t.offset;("number"===n||"string"===n&&-1===o.indexOf(","))&&(o="0, "+o),t.popperOptions.modifiers||(t.popperOptions.modifiers={}),t.popperOptions.modifiers.offset={offset:o}}return t}function ce(e,t){for(var n=e.placement,o=0;o2&&void 0!==arguments[2]?arguments[2]:{},o=de(t),r=void 0!==t.classes?t.classes:ge.options.defaultClass,i=oe({title:o,html:!0},le(oe({},t,{placement:ce(t,n)}))),s=e._tooltip=new se(e,i);s.setClasses(r),s._vueEl=e;var a=void 0!==t.targetClasses?t.targetClasses:ge.options.defaultTargetClass;return e._tooltipTargetClasses=a,X(e,a),s}function ve(e){e._tooltip&&(e._tooltip.dispose(),delete e._tooltip,delete e._tooltipOldShow),e._tooltipTargetClasses&&(J(e,e._tooltipTargetClasses),delete e._tooltipTargetClasses)}function me(e,t){var n=t.value,o=(t.oldValue,t.modifiers),r=de(n);if(r&&pe.enabled){var i=void 0;e._tooltip?((i=e._tooltip).setContent(r),i.setOptions(oe({},n,{placement:ce(n,o)}))):i=he(e,n,o),void 0!==n.show&&n.show!==e._tooltipOldShow&&(e._tooltipOldShow=n.show,n.show?i.show():i.hide())}else ve(e)}var ge={options:fe,bind:me,update:me,unbind:function(e){ve(e)}};function ye(e){e.addEventListener("click",_e),e.addEventListener("touchstart",we,!!Q&&{passive:!0})}function be(e){e.removeEventListener("click",_e),e.removeEventListener("touchstart",we),e.removeEventListener("touchend",Oe),e.removeEventListener("touchcancel",Ee)}function _e(e){var t=e.currentTarget;e.closePopover=!t.$_vclosepopover_touch,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}function we(e){if(1===e.changedTouches.length){var t=e.currentTarget;t.$_vclosepopover_touch=!0;var n=e.changedTouches[0];t.$_vclosepopover_touchPoint=n,t.addEventListener("touchend",Oe),t.addEventListener("touchcancel",Ee)}}function Oe(e){var t=e.currentTarget;if(t.$_vclosepopover_touch=!1,1===e.changedTouches.length){var n=e.changedTouches[0],o=t.$_vclosepopover_touchPoint;e.closePopover=Math.abs(n.screenY-o.screenY)<20&&Math.abs(n.screenX-o.screenX)<20,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}}function Ee(e){e.currentTarget.$_vclosepopover_touch=!1}var Ce={bind:function(e,t){var n=t.value,o=t.modifiers;e.$_closePopoverModifiers=o,(void 0===n||n)&&ye(e)},update:function(e,t){var n=t.value,o=t.oldValue,r=t.modifiers;e.$_closePopoverModifiers=r,n!==o&&(void 0===n||n?ye(e):be(e))},unbind:function(e){be(e)}};var Te=void 0;function $e(){$e.init||($e.init=!0,Te=-1!==function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var o=e.indexOf("Edge/");return o>0?parseInt(e.substring(o+5,e.indexOf(".",o)),10):-1}())}var Le={render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"resize-observer",attrs:{tabindex:"-1"}})},staticRenderFns:[],_scopeId:"data-v-b329ee4c",name:"resize-observer",methods:{notify:function(){this.$emit("notify")},addResizeHandlers:function(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.notify),this._w===this.$el.offsetWidth&&this._h===this.$el.offsetHeight||this.notify()},removeResizeHandlers:function(){this._resizeObject&&this._resizeObject.onload&&(!Te&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.notify),delete this._resizeObject.onload)}},mounted:function(){var e=this;$e(),this.$nextTick(function(){e._w=e.$el.offsetWidth,e._h=e.$el.offsetHeight});var t=document.createElement("object");this._resizeObject=t,t.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),t.setAttribute("aria-hidden","true"),t.onload=this.addResizeHandlers,t.type="text/html",Te&&this.$el.appendChild(t),t.data="about:blank",Te||this.$el.appendChild(t)},beforeDestroy:function(){this.removeResizeHandlers()}};var je={version:"0.4.3",install:function(e){e.component("resize-observer",Le)}},Ne=null;function Se(e){var t=ge.options.popover[e];return void 0===t?ge.options[e]:t}"undefined"!=typeof window?Ne=window.Vue:"undefined"!=typeof global&&(Ne=global.Vue),Ne&&Ne.use(je);var xe=!1;"undefined"!=typeof window&&"undefined"!=typeof navigator&&(xe=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);var Ae=[],ke={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"v-popover",class:e.cssClass},[n("span",{ref:"trigger",staticClass:"trigger",staticStyle:{display:"inline-block"},attrs:{"aria-describedby":e.popoverId}},[e._t("default")],2),e._v(" "),n("div",{ref:"popover",class:[e.popoverBaseClass,e.popoverClass,e.cssClass],style:{display:e.isOpen?"":"none"},attrs:{id:e.popoverId,"aria-hidden":e.isOpen?"false":"true"}},[n("div",{class:e.popoverWrapperClass},[n("div",{ref:"arrow",class:e.popoverArrowClass}),e._v(" "),n("div",{ref:"inner",class:e.popoverInnerClass,staticStyle:{position:"relative"}},[n("div",[e._t("popover")],2),e._v(" "),e.handleResize?n("ResizeObserver",{on:{notify:e.$_handleResize}}):e._e()],1)])])])},staticRenderFns:[],name:"VPopover",components:{ResizeObserver:Le},props:{open:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placement:{type:String,default:function(){return Se("defaultPlacement")}},delay:{type:[String,Number,Object],default:function(){return Se("defaultDelay")}},offset:{type:[String,Number],default:function(){return Se("defaultOffset")}},trigger:{type:String,default:function(){return Se("defaultTrigger")}},container:{type:[String,Object,Element],default:function(){return Se("defaultContainer")}},boundariesElement:{type:Element,default:function(){return Se("defaultBoundariesElement")}},popperOptions:{type:Object,default:function(){return Se("defaultPopperOptions")}},popoverClass:{type:[String,Array],default:function(){return Se("defaultClass")}},popoverBaseClass:{type:[String,Array],default:function(){return ge.options.popover.defaultBaseClass}},popoverInnerClass:{type:[String,Array],default:function(){return ge.options.popover.defaultInnerClass}},popoverWrapperClass:{type:[String,Array],default:function(){return ge.options.popover.defaultWrapperClass}},popoverArrowClass:{type:[String,Array],default:function(){return ge.options.popover.defaultArrowClass}},autoHide:{type:Boolean,default:function(){return ge.options.popover.defaultAutoHide}},handleResize:{type:Boolean,default:function(){return ge.options.popover.defaultHandleResize}},openGroup:{type:String,default:null}},data:function(){return{isOpen:!1,id:Math.random().toString(36).substr(2,10)}},computed:{cssClass:function(){return{open:this.isOpen}},popoverId:function(){return"popover_"+this.id}},watch:{open:function(e){e?this.show():this.hide()},disabled:function(e,t){e!==t&&(e?this.hide():this.open&&this.show())},container:function(e){if(this.isOpen&&this.popperInstance){var t=this.$refs.popover,n=this.$refs.trigger,o=this.$_findContainer(this.container,n);if(!o)return void console.warn("No container for popover",this);o.appendChild(t),this.popperInstance.update()}},trigger:function(e){this.$_removeEventListeners(),this.$_addEventListeners()},offset:function(e){var t=this;this.$_updatePopper(function(){if(e){var n=t.$_getOffset();t.popperInstance.options.modifiers.offset={offset:n}}else t.popperInstance.options.modifiers.offset=void 0})},placement:function(e){var t=this;this.$_updatePopper(function(){t.popperInstance.options.placement=e})},boundariesElement:"$_restartPopper",popperOptions:{handler:"$_restartPopper",deep:!0}},created:function(){this.$_isDisposed=!1,this.$_mounted=!1,this.$_events=[],this.$_preventOpen=!1},mounted:function(){var e=this.$refs.popover;e.parentNode&&e.parentNode.removeChild(e),this.$_init(),this.open&&this.show()},beforeDestroy:function(){this.dispose()},methods:{show:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.event,n=(e.skipDelay,e.force);!(void 0!==n&&n)&&this.disabled||(this.$_scheduleShow(t),this.$emit("show")),this.$emit("update:open",!0)},hide:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.event;e.skipDelay;this.$_scheduleHide(t),this.$emit("hide"),this.$emit("update:open",!1)},dispose:function(){if(this.$_isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.popperInstance&&(this.popperInstance.destroy(),!this.popperInstance.options.removeOnDestroy)){var e=this.$refs.popover;e.parentNode&&e.parentNode.removeChild(e)}this.$_mounted=!1,this.$emit("dispose")},$_init:function(){-1===this.trigger.indexOf("manual")&&this.$_addEventListeners()},$_show:function(){var e=this,t=this.$refs.trigger,n=this.$refs.popover;if(clearTimeout(this.$_disposeTimer),!this.isOpen){if(this.popperInstance&&(this.isOpen=!0,this.popperInstance.enableEventListeners(),this.popperInstance.update()),!this.$_mounted){var o=this.$_findContainer(this.container,t);if(!o)return void console.warn("No container for popover",this);o.appendChild(n),this.$_mounted=!0}if(!this.popperInstance){var r=oe({},this.popperOptions,{placement:this.placement});if(r.modifiers=oe({},r.modifiers,{arrow:{element:this.$refs.arrow}}),this.offset){var i=this.$_getOffset();r.modifiers.offset={offset:i}}this.boundariesElement&&(r.modifiers.preventOverflow={boundariesElement:this.boundariesElement}),this.popperInstance=new Y(t,n,r),requestAnimationFrame(function(){!e.$_isDisposed&&e.popperInstance?(e.popperInstance.update(),requestAnimationFrame(function(){e.$_isDisposed?e.dispose():e.isOpen=!0})):e.dispose()})}var s=this.openGroup;if(s)for(var a=void 0,p=0;p1&&void 0!==arguments[1]&&arguments[1];if(clearTimeout(this.$_scheduleTimer),e)this.$_show();else{var t=parseInt(this.delay&&this.delay.show||this.delay||0);this.$_scheduleTimer=setTimeout(this.$_show.bind(this),t)}},$_scheduleHide:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(clearTimeout(this.$_scheduleTimer),n)this.$_hide();else{var o=parseInt(this.delay&&this.delay.hide||this.delay||0);this.$_scheduleTimer=setTimeout(function(){if(e.isOpen){if(t&&"mouseleave"===t.type)if(e.$_setTooltipNodeEvent(t))return;e.$_hide()}},o)}},$_setTooltipNodeEvent:function(e){var t=this,n=this.$refs.trigger,o=this.$refs.popover,r=e.relatedreference||e.toElement;return!!o.contains(r)&&(o.addEventListener(e.type,function r(i){var s=i.relatedreference||i.toElement;o.removeEventListener(e.type,r),n.contains(s)||t.hide({event:i})}),!0)},$_removeEventListeners:function(){var e=this.$refs.trigger;this.$_events.forEach(function(t){var n=t.func,o=t.event;e.removeEventListener(o,n)}),this.$_events=[]},$_updatePopper:function(e){this.isOpen&&this.popperInstance&&(e(),this.popperInstance.update())},$_restartPopper:function(){if(this.popperInstance){var e=this.isOpen;this.dispose(),this.$_init(),e&&this.show()}},$_handleGlobalClose:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.hide({event:e}),e.closePopover?this.$emit("close-directive"):this.$emit("auto-hide"),n&&(this.$_preventOpen=!0,setTimeout(function(){t.$_preventOpen=!1},300))},$_handleResize:function(){this.isOpen&&this.popperInstance&&(this.popperInstance.update(),this.$emit("resize"))}}};function Ie(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=void 0,o=0;o-1},ke.prototype.set=function(e,t){var n=this.__data__,o=Fe(n,e);return o<0?n.push([e,t]):n[o][1]=t,this},Ie.prototype.clear=function(){this.__data__={hash:new Ae,map:new(_e||ke),string:new Ae}},Ie.prototype.delete=function(e){return Ye(this,e).delete(e)},Ie.prototype.get=function(e){return Ye(this,e).get(e)},Ie.prototype.has=function(e){return Ye(this,e).has(e)},Ie.prototype.set=function(e,t){return Ye(this,e).set(e,t),this},De.prototype.clear=function(){this.__data__=new ke},De.prototype.delete=function(e){return this.__data__.delete(e)},De.prototype.get=function(e){return this.__data__.get(e)},De.prototype.has=function(e){return this.__data__.has(e)},De.prototype.set=function(e,t){var o=this.__data__;if(o instanceof ke){var r=o.__data__;if(!_e||r.length-1&&e%1==0&&e-1&&e%1==0&&e<=r}function ut(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ft(e){return!!e&&"object"==typeof e}var lt,ct=z?(lt=z,function(e){return lt(e)}):function(e){return ft(e)&&pt(e.length)&&!!A[se.call(e)]};function dt(e){return rt(e)?Me(e):function(e){if(!Ze(e))return ge(e);var t=[];for(var n in Object(e))re.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}var ht=function(e){return t=function(t,n){var o=-1,r=n.length,i=r>1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(r--,i):void 0,s&&function(e,t,n){if(!ut(n))return!1;var o=typeof t;return!!("number"==o?rt(n)&&Qe(t,n.length):"string"==o&&t in n)&&tt(n[t],e)}(n[0],n[1],s)&&(i=r<3?void 0:i,r=1),t=Object(t);++o1&&void 0!==arguments[1]?arguments[1]:{};if(!He.installed){He.installed=!0;var n={};Me(n,fe,t),ze.options=n,ge.options=n,e.directive("tooltip",ge),e.directive("close-popover",Ce),e.component("v-popover",ke)}}var Be=ge,Fe=Ce,We=ke,ze={install:He,get enabled(){return pe.enabled},set enabled(e){pe.enabled=e}},Re=null;return"undefined"!=typeof window?Re=window.Vue:"undefined"!=typeof global&&(Re=global.Vue),Re&&Re.use(ze),e.install=He,e.VTooltip=Be,e.VClosePopover=Fe,e.VPopover=We,e.default=ze,e.createTooltip=he,e.destroyTooltip=ve,e}({}); +var VTooltip=function(e){"use strict";for(var t="undefined"!=typeof window&&"undefined"!=typeof document,n=["Edge","Trident","Firefox"],o=0,i=0;i=0){o=1;break}var r=t&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},o))}};function s(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t){if(1!==e.nodeType)return[];var n=getComputedStyle(e,null);return t?n[t]:n}function p(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function l(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=a(e),n=t.overflow,o=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+o)?e:l(p(e))}var u=t&&!(!window.MSInputMethodContext||!document.documentMode),f=t&&/MSIE 10/.test(navigator.userAgent);function c(e){return 11===e?u:10===e?f:u||f}function d(e){if(!e)return document.documentElement;for(var t=c(10)?document.body:null,n=e.offsetParent;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var o=n&&n.nodeName;return o&&"BODY"!==o&&"HTML"!==o?-1!==["TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?d(n):n:e?e.ownerDocument.documentElement:document.documentElement}function h(e){return null!==e.parentNode?h(e.parentNode):e}function v(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,o=n?e:t,i=n?t:e,r=document.createRange();r.setStart(o,0),r.setEnd(i,0);var s,a,p=r.commonAncestorContainer;if(e!==p&&t!==p||o.contains(i))return"BODY"===(a=(s=p).nodeName)||"HTML"!==a&&d(s.firstElementChild)!==s?d(p):p;var l=h(e);return l.host?v(l.host,t):v(e,h(t).host)}function m(e){var t="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=e.nodeName;if("BODY"===n||"HTML"===n){var o=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||o)[t]}return e[t]}function g(e,t){var n="x"===t?"Left":"Top",o="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+o+"Width"],10)}function b(e,t,n,o){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],c(10)?n["offset"+e]+o["margin"+("Height"===e?"Top":"Left")]+o["margin"+("Height"===e?"Bottom":"Right")]:0)}function y(){var e=document.body,t=document.documentElement,n=c(10)&&getComputedStyle(t);return{height:b("Height",e,t,n),width:b("Width",e,t,n)}}var _=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},w=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],o=c(10),i="HTML"===t.nodeName,r=T(e),s=T(t),p=l(e),u=a(t),f=parseFloat(u.borderTopWidth,10),d=parseFloat(u.borderLeftWidth,10);n&&"HTML"===t.nodeName&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var h=C({top:r.top-s.top-f,left:r.left-s.left-d,width:r.width,height:r.height});if(h.marginTop=0,h.marginLeft=0,!o&&i){var v=parseFloat(u.marginTop,10),g=parseFloat(u.marginLeft,10);h.top-=f-v,h.bottom-=f-v,h.left-=d-g,h.right-=d-g,h.marginTop=v,h.marginLeft=g}return(o&&!n?t.contains(p):t===p&&"BODY"!==p.nodeName)&&(h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=m(t,"top"),i=m(t,"left"),r=n?-1:1;return e.top+=o*r,e.bottom+=o*r,e.left+=i*r,e.right+=i*r,e}(h,t)),h}function L(e){if(!e||!e.parentElement||c())return document.documentElement;for(var t=e.parentElement;t&&"none"===a(t,"transform");)t=t.parentElement;return t||document.documentElement}function x(e,t,n,o){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r={top:0,left:0},s=i?L(e):v(e,t);if("viewport"===o)r=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,o=$(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),r=Math.max(n.clientHeight,window.innerHeight||0),s=t?0:m(n),a=t?0:m(n,"left");return C({top:s-o.top+o.marginTop,left:a-o.left+o.marginLeft,width:i,height:r})}(s,i);else{var u=void 0;"scrollParent"===o?"BODY"===(u=l(p(t))).nodeName&&(u=e.ownerDocument.documentElement):u="window"===o?e.ownerDocument.documentElement:o;var f=$(u,s,i);if("HTML"!==u.nodeName||function e(t){var n=t.nodeName;return"BODY"!==n&&"HTML"!==n&&("fixed"===a(t,"position")||e(p(t)))}(s))r=f;else{var c=y(),d=c.height,h=c.width;r.top+=f.top-f.marginTop,r.bottom=d+f.top,r.left+=f.left-f.marginLeft,r.right=h+f.left}}return r.left+=n,r.top+=n,r.right-=n,r.bottom-=n,r}function N(e,t,n,o,i){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var s=x(n,o,r,i),a={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},p=Object.keys(a).map(function(e){return E({key:e},a[e],{area:(t=a[e],t.width*t.height)});var t}).sort(function(e,t){return t.area-e.area}),l=p.filter(function(e){var t=e.width,o=e.height;return t>=n.clientWidth&&o>=n.clientHeight}),u=l.length>0?l[0].key:p[0].key,f=e.split("-")[1];return u+(f?"-"+f:"")}function S(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return $(n,o?L(t):v(t,n),o)}function j(e){var t=getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),o=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+o,height:e.offsetHeight+n}}function k(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function A(e,t,n){n=n.split("-")[0];var o=j(e),i={width:o.width,height:o.height},r=-1!==["right","left"].indexOf(n),s=r?"top":"left",a=r?"left":"top",p=r?"height":"width",l=r?"width":"height";return i[s]=t[s]+t[p]/2-o[p]/2,i[a]=n===a?t[a]-o[l]:t[k(a)],i}function I(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function P(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var o=I(e,function(e){return e[t]===n});return e.indexOf(o)}(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&s(n)&&(t.offsets.popper=C(t.offsets.popper),t.offsets.reference=C(t.offsets.reference),t=n(t,e))}),t}function D(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function M(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),o=0;o1&&void 0!==arguments[1]&&arguments[1],n=V.indexOf(e),o=V.slice(n+1).concat(V.slice(0,n));return t?o.reverse():o}var G={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function Y(e,t,n,o){var i=[0,0],r=-1!==["right","left"].indexOf(o),s=e.split(/(\+|\-)/).map(function(e){return e.trim()}),a=s.indexOf(I(s,function(e){return-1!==e.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var p=/\s*,\s*|\s+/,l=-1!==a?[s.slice(0,a).concat([s[a].split(p)[0]]),[s[a].split(p)[1]].concat(s.slice(a+1))]:[s];return(l=l.map(function(e,o){var i=(1===o?!r:r)?"height":"width",s=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,s=!0,e):s?(e[e.length-1]+=t,s=!1,e):e.concat(t)},[]).map(function(e){return function(e,t,n,o){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+i[1],s=i[2];if(!r)return e;if(0===s.indexOf("%")){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=o}return C(a)[t]/100*r}if("vh"===s||"vw"===s)return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*r;return r}(e,i,t,n)})})).forEach(function(e,t){e.forEach(function(n,o){B(n)&&(i[t]+=n*("-"===e[o-1]?-1:1))})}),i}var K={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],o=t.split("-")[1];if(o){var i=e.offsets,r=i.reference,s=i.popper,a=-1!==["bottom","top"].indexOf(n),p=a?"left":"top",l=a?"width":"height",u={start:O({},p,r[p]),end:O({},p,r[p]+r[l]-s[l])};e.offsets.popper=E({},s,u[o])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,o=e.placement,i=e.offsets,r=i.popper,s=i.reference,a=o.split("-")[0],p=void 0;return p=B(+n)?[+n,0]:Y(n,r,s,a),"left"===a?(r.top+=p[0],r.left-=p[1]):"right"===a?(r.top+=p[0],r.left+=p[1]):"top"===a?(r.left+=p[0],r.top-=p[1]):"bottom"===a&&(r.left+=p[0],r.top+=p[1]),e.popper=r,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||d(e.instance.popper);e.instance.reference===n&&(n=d(n));var o=M("transform"),i=e.instance.popper.style,r=i.top,s=i.left,a=i[o];i.top="",i.left="",i[o]="";var p=x(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=r,i.left=s,i[o]=a,t.boundaries=p;var l=t.priority,u=e.offsets.popper,f={primary:function(e){var n=u[e];return u[e]p[e]&&!t.escapeWithReference&&(o=Math.min(u[n],p[e]-("right"===e?u.width:u.height))),O({},n,o)}};return l.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";u=E({},u,f[t](e))}),e.offsets.popper=u,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,o=t.reference,i=e.placement.split("-")[0],r=Math.floor,s=-1!==["top","bottom"].indexOf(i),a=s?"right":"bottom",p=s?"left":"top",l=s?"width":"height";return n[a]r(o[a])&&(e.offsets.popper[p]=r(o[a])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!R(e.instance.modifiers,"arrow","keepTogether"))return e;var o=t.element;if("string"==typeof o){if(!(o=e.instance.popper.querySelector(o)))return e}else if(!e.instance.popper.contains(o))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],r=e.offsets,s=r.popper,p=r.reference,l=-1!==["left","right"].indexOf(i),u=l?"height":"width",f=l?"Top":"Left",c=f.toLowerCase(),d=l?"left":"top",h=l?"bottom":"right",v=j(o)[u];p[h]-vs[h]&&(e.offsets.popper[c]+=p[c]+v-s[h]),e.offsets.popper=C(e.offsets.popper);var m=p[c]+p[u]/2-v/2,g=a(e.instance.popper),b=parseFloat(g["margin"+f],10),y=parseFloat(g["border"+f+"Width"],10),_=m-e.offsets.popper[c]-b-y;return _=Math.max(Math.min(s[u]-v,_),0),e.arrowElement=o,e.offsets.arrow=(O(n={},c,Math.round(_)),O(n,d,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(D(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=x(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),o=e.placement.split("-")[0],i=k(o),r=e.placement.split("-")[1]||"",s=[];switch(t.behavior){case G.FLIP:s=[o,i];break;case G.CLOCKWISE:s=q(o);break;case G.COUNTERCLOCKWISE:s=q(o,!0);break;default:s=t.behavior}return s.forEach(function(a,p){if(o!==a||s.length===p+1)return e;o=e.placement.split("-")[0],i=k(o);var l=e.offsets.popper,u=e.offsets.reference,f=Math.floor,c="left"===o&&f(l.right)>f(u.left)||"right"===o&&f(l.left)f(u.top)||"bottom"===o&&f(l.top)f(n.right),v=f(l.top)f(n.bottom),g="left"===o&&d||"right"===o&&h||"top"===o&&v||"bottom"===o&&m,b=-1!==["top","bottom"].indexOf(o),y=!!t.flipVariations&&(b&&"start"===r&&d||b&&"end"===r&&h||!b&&"start"===r&&v||!b&&"end"===r&&m);(c||g||y)&&(e.flipped=!0,(c||g)&&(o=s[p+1]),y&&(r=function(e){return"end"===e?"start":"start"===e?"end":e}(r)),e.placement=o+(r?"-"+r:""),e.offsets.popper=E({},e.offsets.popper,A(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,"flip"))}),e},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],o=e.offsets,i=o.popper,r=o.reference,s=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return i[s?"left":"top"]=r[n]-(a?i[s?"width":"height"]:0),e.placement=k(t),e.offsets.popper=C(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!R(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=I(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};_(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(o.update)},this.update=r(this.update.bind(this)),this.options=E({},e.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(E({},e.Defaults.modifiers,i.modifiers)).forEach(function(t){o.options.modifiers[t]=E({},e.Defaults.modifiers[t]||{},i.modifiers?i.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return E({name:e},o.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&s(e.onLoad)&&e.onLoad(o.reference,o.popper,o.options,e,o.state)}),this.update();var a=this.options.eventsEnabled;a&&this.enableEventListeners(),this.state.eventsEnabled=a}return w(e,[{key:"update",value:function(){return function(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=S(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=N(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=A(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=P(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}.call(this)}},{key:"destroy",value:function(){return function(){return this.state.isDestroyed=!0,D(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[M("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}.call(this)}},{key:"enableEventListeners",value:function(){return function(){this.state.eventsEnabled||(this.state=z(this.reference,this.options,this.state,this.scheduleUpdate))}.call(this)}},{key:"disableEventListeners",value:function(){return F.call(this)}}]),e}();X.Utils=("undefined"!=typeof window?window:global).PopperUtils,X.placements=U,X.Defaults=K;var J=function(){};function Q(e){return"string"==typeof e&&(e=e.split(" ")),e}function Z(e,t){var n=Q(t),o=void 0;o=e.className instanceof J?Q(e.className.baseVal):Q(e.className),n.forEach(function(e){-1===o.indexOf(e)&&o.push(e)}),e instanceof SVGElement?e.setAttribute("class",o.join(" ")):e.className=o.join(" ")}function ee(e,t){var n=Q(t),o=void 0;o=e.className instanceof J?Q(e.className.baseVal):Q(e.className),n.forEach(function(e){var t=o.indexOf(e);-1!==t&&o.splice(t,1)}),e instanceof SVGElement?e.setAttribute("class",o.join(" ")):e.className=o.join(" ")}"undefined"!=typeof window&&(J=window.SVGAnimatedString);var te=!1;if("undefined"!=typeof window){te=!1;try{var ne=Object.defineProperty({},"passive",{get:function(){te=!0}});window.addEventListener("test",null,ne)}catch(e){}}var oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ie=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},re=function(){function e(e,t){for(var n=0;n
',trigger:"hover focus",offset:0},pe=[],le=function(){function e(t,n){ie(this,e),ue.call(this),n=se({},ae,n),t.jquery&&(t=t[0]),this.reference=t,this.options=n,this._isOpen=!1,this._init()}return re(e,[{key:"setClasses",value:function(e){this._classes=e}},{key:"setContent",value:function(e){this.options.title=e,this._tooltipNode&&this._setContent(e,this.options)}},{key:"setOptions",value:function(e){var t=!1,n=e&&e.classes||_e.options.defaultClass;this._classes!==n&&(this.setClasses(n),t=!0),e=he(e);var o=!1,i=!1;for(var r in this.options.offset===e.offset&&this.options.placement===e.placement||(o=!0),(this.options.template!==e.template||this.options.trigger!==e.trigger||this.options.container!==e.container||t)&&(i=!0),e)this.options[r]=e[r];if(this._tooltipNode)if(i){var s=this._isOpen;this.dispose(),this._init(),s&&this.show()}else o&&this.popperInstance.update()}},{key:"_init",value:function(){var e="string"==typeof this.options.trigger?this.options.trigger.split(" ").filter(function(e){return-1!==["click","hover","focus"].indexOf(e)}):[];this._isDisposed=!1,this._enableDocumentTouch=-1===e.indexOf("manual"),this._setEventListeners(this.reference,e,this.options)}},{key:"_create",value:function(e,t){var n=window.document.createElement("div");n.innerHTML=t.trim();var o=n.childNodes[0];return o.id="tooltip_"+Math.random().toString(36).substr(2,10),o.setAttribute("aria-hidden","true"),this.options.autoHide&&-1!==this.options.trigger.indexOf("hover")&&(o.addEventListener("mouseenter",this.hide),o.addEventListener("click",this.hide)),o}},{key:"_setContent",value:function(e,t){var n=this;this.asyncContent=!1,this._applyContent(e,t).then(function(){n.popperInstance.update()})}},{key:"_applyContent",value:function(e,t){var n=this;return new Promise(function(o,i){var r=t.html,s=n._tooltipNode,a=s.querySelector(n.options.innerSelector);if(1===e.nodeType){if(r){for(;a.firstChild;)a.removeChild(a.firstChild);a.appendChild(e)}}else{if("function"==typeof e){var p=e();return void(p&&"function"==typeof p.then?(n.asyncContent=!0,t.loadingClass&&Z(s,t.loadingClass),t.loadingContent&&n._applyContent(t.loadingContent,t),p.then(function(e){return t.loadingClass&&ee(s,t.loadingClass),n._applyContent(e,t)}).then(o).catch(i)):n._applyContent(p,t).then(o).catch(i))}r?a.innerHTML=e:a.innerText=e}o()})}},{key:"_show",value:function(e,t){if(t&&"string"==typeof t.container&&!document.querySelector(t.container))return;clearTimeout(this._disposeTimer),delete(t=Object.assign({},t)).offset;var n=!0;this._tooltipNode&&(Z(this._tooltipNode,this._classes),n=!1);var o=this._ensureShown(e,t);return n&&this._tooltipNode&&Z(this._tooltipNode,this._classes),Z(e,["v-tooltip-open"]),o}},{key:"_ensureShown",value:function(e,t){var n=this;if(this._isOpen)return this;if(this._isOpen=!0,pe.push(this),this._tooltipNode)return this._tooltipNode.style.display="",this._tooltipNode.setAttribute("aria-hidden","false"),this.popperInstance.enableEventListeners(),this.popperInstance.update(),this.asyncContent&&this._setContent(t.title,t),this;var o=e.getAttribute("title")||t.title;if(!o)return this;var i=this._create(e,t.template);this._tooltipNode=i,this._setContent(o,t),e.setAttribute("aria-describedby",i.id);var r=this._findContainer(t.container,e);this._append(i,r);var s=se({},t.popperOptions,{placement:t.placement});return s.modifiers=se({},s.modifiers,{arrow:{element:this.options.arrowSelector}}),t.boundariesElement&&(s.modifiers.preventOverflow={boundariesElement:t.boundariesElement}),this.popperInstance=new X(e,i,s),requestAnimationFrame(function(){!n._isDisposed&&n.popperInstance?(n.popperInstance.update(),requestAnimationFrame(function(){n._isDisposed?n.dispose():n._isOpen&&i.setAttribute("aria-hidden","false")})):n.dispose()}),this}},{key:"_noLongerOpen",value:function(){var e=pe.indexOf(this);-1!==e&&pe.splice(e,1)}},{key:"_hide",value:function(){var e=this;if(!this._isOpen)return this;this._isOpen=!1,this._noLongerOpen(),this._tooltipNode.style.display="none",this._tooltipNode.setAttribute("aria-hidden","true"),this.popperInstance.disableEventListeners(),clearTimeout(this._disposeTimer);var t=_e.options.disposeTimeout;return null!==t&&(this._disposeTimer=setTimeout(function(){e._tooltipNode&&(e._tooltipNode.removeEventListener("mouseenter",e.hide),e._tooltipNode.removeEventListener("click",e.hide),e._tooltipNode.parentNode.removeChild(e._tooltipNode),e._tooltipNode=null)},t)),ee(this.reference,["v-tooltip-open"]),this}},{key:"_dispose",value:function(){var e=this;return this._isDisposed=!0,this._events.forEach(function(t){var n=t.func,o=t.event;e.reference.removeEventListener(o,n)}),this._events=[],this._tooltipNode?(this._hide(),this._tooltipNode.removeEventListener("mouseenter",this.hide),this._tooltipNode.removeEventListener("click",this.hide),this.popperInstance.destroy(),this.popperInstance.options.removeOnDestroy||(this._tooltipNode.parentNode.removeChild(this._tooltipNode),this._tooltipNode=null)):this._noLongerOpen(),this}},{key:"_findContainer",value:function(e,t){return"string"==typeof e?e=window.document.querySelector(e):!1===e&&(e=t.parentNode),e}},{key:"_append",value:function(e,t){t.appendChild(e)}},{key:"_setEventListeners",value:function(e,t,n){var o=this,i=[],r=[];t.forEach(function(e){switch(e){case"hover":i.push("mouseenter"),r.push("mouseleave"),o.options.hideOnTargetClick&&r.push("click");break;case"focus":i.push("focus"),r.push("blur"),o.options.hideOnTargetClick&&r.push("click");break;case"click":i.push("click"),r.push("click")}}),i.forEach(function(t){var i=function(t){!0!==o._isOpen&&(t.usedByTooltip=!0,o._scheduleShow(e,n.delay,n,t))};o._events.push({event:t,func:i}),e.addEventListener(t,i)}),r.forEach(function(t){var i=function(t){!0!==t.usedByTooltip&&o._scheduleHide(e,n.delay,n,t)};o._events.push({event:t,func:i}),e.addEventListener(t,i)})}},{key:"_onDocumentTouch",value:function(e){this._enableDocumentTouch&&this._scheduleHide(this.reference,this.options.delay,this.options,e)}},{key:"_scheduleShow",value:function(e,t,n){var o=this,i=t&&t.show||t||0;clearTimeout(this._scheduleTimer),this._scheduleTimer=window.setTimeout(function(){return o._show(e,n)},i)}},{key:"_scheduleHide",value:function(e,t,n,o){var i=this,r=t&&t.hide||t||0;clearTimeout(this._scheduleTimer),this._scheduleTimer=window.setTimeout(function(){if(!1!==i._isOpen&&document.body.contains(i._tooltipNode)){if("mouseleave"===o.type)if(i._setTooltipNodeEvent(o,e,t,n))return;i._hide(e,n)}},r)}}]),e}(),ue=function(){var e=this;this.show=function(){e._show(e.reference,e.options)},this.hide=function(){e._hide()},this.dispose=function(){e._dispose()},this.toggle=function(){return e._isOpen?e.hide():e.show()},this._events=[],this._setTooltipNodeEvent=function(t,n,o,i){var r=t.relatedreference||t.toElement||t.relatedTarget;return!!e._tooltipNode.contains(r)&&(e._tooltipNode.addEventListener(t.type,function o(r){var s=r.relatedreference||r.toElement||r.relatedTarget;e._tooltipNode.removeEventListener(t.type,o),n.contains(s)||e._scheduleHide(n,i.delay,i,r)}),!0)}};"undefined"!=typeof document&&document.addEventListener("touchstart",function(e){for(var t=0;t
',defaultArrowSelector:".tooltip-arrow, .tooltip__arrow",defaultInnerSelector:".tooltip-inner, .tooltip__inner",defaultDelay:0,defaultTrigger:"hover focus",defaultOffset:0,defaultContainer:"body",defaultBoundariesElement:void 0,defaultPopperOptions:{},defaultLoadingClass:"tooltip-loading",defaultLoadingContent:"...",autoHide:!0,defaultHideOnTargetClick:!0,disposeTimeout:5e3,popover:{defaultPlacement:"bottom",defaultClass:"vue-popover-theme",defaultBaseClass:"tooltip popover",defaultWrapperClass:"wrapper",defaultInnerClass:"tooltip-inner popover-inner",defaultArrowClass:"tooltip-arrow popover-arrow",defaultDelay:0,defaultTrigger:"click",defaultOffset:0,defaultContainer:"body",defaultBoundariesElement:void 0,defaultPopperOptions:{},defaultAutoHide:!0,defaultHandleResize:!0}};function he(e){var t={placement:void 0!==e.placement?e.placement:_e.options.defaultPlacement,delay:void 0!==e.delay?e.delay:_e.options.defaultDelay,html:void 0!==e.html?e.html:_e.options.defaultHtml,template:void 0!==e.template?e.template:_e.options.defaultTemplate,arrowSelector:void 0!==e.arrowSelector?e.arrowSelector:_e.options.defaultArrowSelector,innerSelector:void 0!==e.innerSelector?e.innerSelector:_e.options.defaultInnerSelector,trigger:void 0!==e.trigger?e.trigger:_e.options.defaultTrigger,offset:void 0!==e.offset?e.offset:_e.options.defaultOffset,container:void 0!==e.container?e.container:_e.options.defaultContainer,boundariesElement:void 0!==e.boundariesElement?e.boundariesElement:_e.options.defaultBoundariesElement,autoHide:void 0!==e.autoHide?e.autoHide:_e.options.autoHide,hideOnTargetClick:void 0!==e.hideOnTargetClick?e.hideOnTargetClick:_e.options.defaultHideOnTargetClick,loadingClass:void 0!==e.loadingClass?e.loadingClass:_e.options.defaultLoadingClass,loadingContent:void 0!==e.loadingContent?e.loadingContent:_e.options.defaultLoadingContent,popperOptions:se({},void 0!==e.popperOptions?e.popperOptions:_e.options.defaultPopperOptions)};if(t.offset){var n=oe(t.offset),o=t.offset;("number"===n||"string"===n&&-1===o.indexOf(","))&&(o="0, "+o),t.popperOptions.modifiers||(t.popperOptions.modifiers={}),t.popperOptions.modifiers.offset={offset:o}}return t}function ve(e,t){for(var n=e.placement,o=0;o2&&void 0!==arguments[2]?arguments[2]:{},o=me(t),i=void 0!==t.classes?t.classes:_e.options.defaultClass,r=se({title:o},he(se({},t,{placement:ve(t,n)}))),s=e._tooltip=new le(e,r);s.setClasses(i),s._vueEl=e;var a=void 0!==t.targetClasses?t.targetClasses:_e.options.defaultTargetClass;return e._tooltipTargetClasses=a,Z(e,a),s}function be(e){e._tooltip&&(e._tooltip.dispose(),delete e._tooltip,delete e._tooltipOldShow),e._tooltipTargetClasses&&(ee(e,e._tooltipTargetClasses),delete e._tooltipTargetClasses)}function ye(e,t){var n=t.value,o=(t.oldValue,t.modifiers),i=me(n);if(i&&fe.enabled){var r=void 0;e._tooltip?((r=e._tooltip).setContent(i),r.setOptions(se({},n,{placement:ve(n,o)}))):r=ge(e,n,o),void 0!==n.show&&n.show!==e._tooltipOldShow&&(e._tooltipOldShow=n.show,n.show?r.show():r.hide())}else be(e)}var _e={options:de,bind:ye,update:ye,unbind:function(e){be(e)}};function we(e){e.addEventListener("click",Ee),e.addEventListener("touchstart",Ce,!!te&&{passive:!0})}function Oe(e){e.removeEventListener("click",Ee),e.removeEventListener("touchstart",Ce),e.removeEventListener("touchend",Te),e.removeEventListener("touchcancel",$e)}function Ee(e){var t=e.currentTarget;e.closePopover=!t.$_vclosepopover_touch,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}function Ce(e){if(1===e.changedTouches.length){var t=e.currentTarget;t.$_vclosepopover_touch=!0;var n=e.changedTouches[0];t.$_vclosepopover_touchPoint=n,t.addEventListener("touchend",Te),t.addEventListener("touchcancel",$e)}}function Te(e){var t=e.currentTarget;if(t.$_vclosepopover_touch=!1,1===e.changedTouches.length){var n=e.changedTouches[0],o=t.$_vclosepopover_touchPoint;e.closePopover=Math.abs(n.screenY-o.screenY)<20&&Math.abs(n.screenX-o.screenX)<20,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}}function $e(e){e.currentTarget.$_vclosepopover_touch=!1}var Le={bind:function(e,t){var n=t.value,o=t.modifiers;e.$_closePopoverModifiers=o,(void 0===n||n)&&we(e)},update:function(e,t){var n=t.value,o=t.oldValue,i=t.modifiers;e.$_closePopoverModifiers=i,n!==o&&(void 0===n||n?we(e):Oe(e))},unbind:function(e){Oe(e)}};var xe=void 0;function Ne(){Ne.init||(Ne.init=!0,xe=-1!==function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var o=e.indexOf("Edge/");return o>0?parseInt(e.substring(o+5,e.indexOf(".",o)),10):-1}())}var Se={render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"resize-observer",attrs:{tabindex:"-1"}})},staticRenderFns:[],_scopeId:"data-v-b329ee4c",name:"resize-observer",methods:{notify:function(){this.$emit("notify")},addResizeHandlers:function(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.notify),this._w===this.$el.offsetWidth&&this._h===this.$el.offsetHeight||this.notify()},removeResizeHandlers:function(){this._resizeObject&&this._resizeObject.onload&&(!xe&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.notify),delete this._resizeObject.onload)}},mounted:function(){var e=this;Ne(),this.$nextTick(function(){e._w=e.$el.offsetWidth,e._h=e.$el.offsetHeight});var t=document.createElement("object");this._resizeObject=t,t.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",xe&&this.$el.appendChild(t),t.data="about:blank",xe||this.$el.appendChild(t)},beforeDestroy:function(){this.removeResizeHandlers()}};var je={version:"0.4.4",install:function(e){e.component("resize-observer",Se)}},ke=null;function Ae(e){var t=_e.options.popover[e];return void 0===t?_e.options[e]:t}"undefined"!=typeof window?ke=window.Vue:"undefined"!=typeof global&&(ke=global.Vue),ke&&ke.use(je);var Ie=!1;"undefined"!=typeof window&&"undefined"!=typeof navigator&&(Ie=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);var Pe=[],De=function(){};"undefined"!=typeof window&&(De=window.Element);var Me={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"v-popover",class:e.cssClass},[n("span",{ref:"trigger",staticClass:"trigger",staticStyle:{display:"inline-block"},attrs:{"aria-describedby":e.popoverId,tabindex:-1!==e.trigger.indexOf("focus")?0:-1}},[e._t("default")],2),e._v(" "),n("div",{ref:"popover",class:[e.popoverBaseClass,e.popoverClass,e.cssClass],style:{visibility:e.isOpen?"visible":"hidden"},attrs:{id:e.popoverId,"aria-hidden":e.isOpen?"false":"true"}},[n("div",{class:e.popoverWrapperClass},[n("div",{ref:"inner",class:e.popoverInnerClass,staticStyle:{position:"relative"}},[n("div",[e._t("popover")],2),e._v(" "),e.handleResize?n("ResizeObserver",{on:{notify:e.$_handleResize}}):e._e()],1),e._v(" "),n("div",{ref:"arrow",class:e.popoverArrowClass})])])])},staticRenderFns:[],name:"VPopover",components:{ResizeObserver:Se},props:{open:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placement:{type:String,default:function(){return Ae("defaultPlacement")}},delay:{type:[String,Number,Object],default:function(){return Ae("defaultDelay")}},offset:{type:[String,Number],default:function(){return Ae("defaultOffset")}},trigger:{type:String,default:function(){return Ae("defaultTrigger")}},container:{type:[String,Object,De],default:function(){return Ae("defaultContainer")}},boundariesElement:{type:De,default:function(){return Ae("defaultBoundariesElement")}},popperOptions:{type:Object,default:function(){return Ae("defaultPopperOptions")}},popoverClass:{type:[String,Array],default:function(){return Ae("defaultClass")}},popoverBaseClass:{type:[String,Array],default:function(){return _e.options.popover.defaultBaseClass}},popoverInnerClass:{type:[String,Array],default:function(){return _e.options.popover.defaultInnerClass}},popoverWrapperClass:{type:[String,Array],default:function(){return _e.options.popover.defaultWrapperClass}},popoverArrowClass:{type:[String,Array],default:function(){return _e.options.popover.defaultArrowClass}},autoHide:{type:Boolean,default:function(){return _e.options.popover.defaultAutoHide}},handleResize:{type:Boolean,default:function(){return _e.options.popover.defaultHandleResize}},openGroup:{type:String,default:null}},data:function(){return{isOpen:!1,id:Math.random().toString(36).substr(2,10)}},computed:{cssClass:function(){return{open:this.isOpen}},popoverId:function(){return"popover_"+this.id}},watch:{open:function(e){e?this.show():this.hide()},disabled:function(e,t){e!==t&&(e?this.hide():this.open&&this.show())},container:function(e){if(this.isOpen&&this.popperInstance){var t=this.$refs.popover,n=this.$refs.trigger,o=this.$_findContainer(this.container,n);if(!o)return void console.warn("No container for popover",this);o.appendChild(t),this.popperInstance.scheduleUpdate()}},trigger:function(e){this.$_removeEventListeners(),this.$_addEventListeners()},placement:function(e){var t=this;this.$_updatePopper(function(){t.popperInstance.options.placement=e})},offset:"$_restartPopper",boundariesElement:"$_restartPopper",popperOptions:{handler:"$_restartPopper",deep:!0}},created:function(){this.$_isDisposed=!1,this.$_mounted=!1,this.$_events=[],this.$_preventOpen=!1},mounted:function(){var e=this.$refs.popover;e.parentNode&&e.parentNode.removeChild(e),this.$_init(),this.open&&this.show()},beforeDestroy:function(){this.dispose()},methods:{show:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.event,o=(t.skipDelay,t.force);!(void 0!==o&&o)&&this.disabled||(this.$_scheduleShow(n),this.$emit("show")),this.$emit("update:open",!0),this.$_beingShowed=!0,requestAnimationFrame(function(){e.$_beingShowed=!1})},hide:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.event;e.skipDelay;this.$_scheduleHide(t),this.$emit("hide"),this.$emit("update:open",!1)},dispose:function(){if(this.$_isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.popperInstance&&(this.popperInstance.destroy(),!this.popperInstance.options.removeOnDestroy)){var e=this.$refs.popover;e.parentNode&&e.parentNode.removeChild(e)}this.$_mounted=!1,this.popperInstance=null,this.isOpen=!1,this.$emit("dispose")},$_init:function(){-1===this.trigger.indexOf("manual")&&this.$_addEventListeners()},$_show:function(){var e=this,t=this.$refs.trigger,n=this.$refs.popover;if(clearTimeout(this.$_disposeTimer),!this.isOpen){if(this.popperInstance&&(this.isOpen=!0,this.popperInstance.enableEventListeners(),this.popperInstance.scheduleUpdate()),!this.$_mounted){var o=this.$_findContainer(this.container,t);if(!o)return void console.warn("No container for popover",this);o.appendChild(n),this.$_mounted=!0}if(!this.popperInstance){var i=se({},this.popperOptions,{placement:this.placement});if(i.modifiers=se({},i.modifiers,{arrow:{element:this.$refs.arrow}}),this.offset){var r=this.$_getOffset();i.modifiers.offset={offset:r}}this.boundariesElement&&(i.modifiers.preventOverflow={boundariesElement:this.boundariesElement}),this.popperInstance=new X(t,n,i),requestAnimationFrame(function(){!e.$_isDisposed&&e.popperInstance?(e.popperInstance.scheduleUpdate(),requestAnimationFrame(function(){e.$_isDisposed?e.dispose():e.isOpen=!0})):e.dispose()})}var s=this.openGroup;if(s)for(var a=void 0,p=0;p1&&void 0!==arguments[1]&&arguments[1];if(clearTimeout(this.$_scheduleTimer),e)this.$_show();else{var t=parseInt(this.delay&&this.delay.show||this.delay||0);this.$_scheduleTimer=setTimeout(this.$_show.bind(this),t)}},$_scheduleHide:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(clearTimeout(this.$_scheduleTimer),n)this.$_hide();else{var o=parseInt(this.delay&&this.delay.hide||this.delay||0);this.$_scheduleTimer=setTimeout(function(){if(e.isOpen){if(t&&"mouseleave"===t.type)if(e.$_setTooltipNodeEvent(t))return;e.$_hide()}},o)}},$_setTooltipNodeEvent:function(e){var t=this,n=this.$refs.trigger,o=this.$refs.popover,i=e.relatedreference||e.toElement||e.relatedTarget;return!!o.contains(i)&&(o.addEventListener(e.type,function i(r){var s=r.relatedreference||r.toElement||r.relatedTarget;o.removeEventListener(e.type,i),n.contains(s)||t.hide({event:r})}),!0)},$_removeEventListeners:function(){var e=this.$refs.trigger;this.$_events.forEach(function(t){var n=t.func,o=t.event;e.removeEventListener(o,n)}),this.$_events=[]},$_updatePopper:function(e){this.popperInstance&&(e(),this.isOpen&&this.popperInstance.scheduleUpdate())},$_restartPopper:function(){if(this.popperInstance){var e=this.isOpen;this.dispose(),this.$_isDisposed=!1,this.$_init(),e&&this.show({skipDelay:!0,force:!0})}},$_handleGlobalClose:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.$_beingShowed||(this.hide({event:e}),e.closePopover?this.$emit("close-directive"):this.$emit("auto-hide"),n&&(this.$_preventOpen=!0,setTimeout(function(){t.$_preventOpen=!1},300)))},$_handleResize:function(){this.isOpen&&this.popperInstance&&(this.popperInstance.scheduleUpdate(),this.$emit("resize"))}}};function He(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];requestAnimationFrame(function(){for(var n=void 0,o=0;o-1},ie.prototype.set=function(e,t){var n=this.__data__,o=ue(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this},re.prototype.clear=function(){this.size=0,this.__data__={hash:new oe,map:new(ee||ie),string:new oe}},re.prototype.delete=function(e){var t=_e(this,e).delete(e);return this.size-=t?1:0,t},re.prototype.get=function(e){return _e(this,e).get(e)},re.prototype.has=function(e){return _e(this,e).has(e)},re.prototype.set=function(e,t){var n=_e(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this},se.prototype.clear=function(){this.__data__=new ie,this.size=0},se.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},se.prototype.get=function(e){return this.__data__.get(e)},se.prototype.has=function(e){return this.__data__.has(e)},se.prototype.set=function(e,t){var o=this.__data__;if(o instanceof ie){var i=o.__data__;if(!ee||i.length-1&&e%1==0&&e0){if(++t>=i)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(X?function(e,t){return X(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:He);function Te(e,t){return e===t||e!=e&&t!=t}var $e=ve(function(){return arguments}())?ve:function(e){return Ae(e)&&D.call(e,"callee")&&!G.call(e,"callee")},Le=Array.isArray;function xe(e){return null!=e&&je(e.length)&&!Se(e)}var Ne=J||function(){return!1};function Se(e){if(!ke(e))return!1;var t=he(e);return t==l||t==u||t==p||t==d}function je(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ae(e){return null!=e&&"object"==typeof e}var Ie=$?function(e){return function(t){return e(t)}}($):function(e){return Ae(e)&&je(e.length)&&!!g[he(e)]};function Pe(e){return xe(e)?ae(e,!0):ge(e)}var De,Me=(De=function(e,t,n){be(e,t,n)},ye(function(e,t){var n=-1,o=t.length,i=o>1?t[o-1]:void 0,r=o>2?t[2]:void 0;for(i=De.length>3&&"function"==typeof i?(o--,i):void 0,r&&function(e,t,n){if(!ke(n))return!1;var o=typeof t;return!!("number"==o?xe(n)&&Oe(t,n.length):"string"==o&&t in n)&&Te(n[t],e)}(t[0],t[1],r)&&(i=o<3?void 0:i,o=1),e=Object(e);++n1&&void 0!==arguments[1]?arguments[1]:{};if(!We.installed){We.installed=!0;var n={};Be(n,de,t),qe.options=n,_e.options=n,e.directive("tooltip",_e),e.directive("close-popover",Le),e.component("v-popover",Me)}}var Re=_e,Ue=Le,Ve=Me,qe={install:We,get enabled(){return fe.enabled},set enabled(e){fe.enabled=e}},Ge=null;return"undefined"!=typeof window?Ge=window.Vue:"undefined"!=typeof global&&(Ge=global.Vue),Ge&&Ge.use(qe),e.install=We,e.VTooltip=Re,e.VClosePopover=Ue,e.VPopover=Ve,e.default=qe,e.createTooltip=ge,e.destroyTooltip=be,e}({}); diff --git a/dist/v-tooltip.umd.js b/dist/v-tooltip.umd.js index 229568d9..6e7879b5 100644 --- a/dist/v-tooltip.umd.js +++ b/dist/v-tooltip.umd.js @@ -6,7 +6,7 @@ /**! * @fileOverview Kickass library to create and place poppers near their reference elements. - * @version 1.12.9 + * @version 1.14.3 * @license * Copyright (c) 2016 Federico Zivolo and contributors * @@ -29,6 +29,7 @@ * SOFTWARE. */ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'; + var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; var timeoutDuration = 0; for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { @@ -148,13 +149,33 @@ function getScrollParent(element) { overflowX = _getStyleComputedProp.overflowX, overflowY = _getStyleComputedProp.overflowY; - if (/(auto|scroll)/.test(overflow + overflowY + overflowX)) { + if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { return element; } return getScrollParent(getParentNode(element)); } +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 @@ -163,16 +184,23 @@ function getScrollParent(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 && element.offsetParent; + var offsetParent = element.offsetParent; + // 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') { - if (element) { - return element.ownerDocument.documentElement; - } - - return document.documentElement; + return element ? element.ownerDocument.documentElement : document.documentElement; } // .offsetParent will return the closest TD or TABLE in case @@ -314,29 +342,14 @@ function getBordersSize(styles, axis) { return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10); } -/** - * Tells if you are running Internet Explorer 10 - * @method - * @memberof Popper.Utils - * @returns {Boolean} isIE10 - */ -var isIE10 = undefined; - -var isIE10$1 = function () { - if (isIE10 === undefined) { - isIE10 = navigator.appVersion.indexOf('MSIE 10') !== -1; - } - return isIE10; -}; - function getSize(axis, body, html, computedStyle) { - return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE10$1() ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0); + return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0); } function getWindowSizes() { var body = document.body; var html = document.documentElement; - var computedStyle = isIE10$1() && getComputedStyle(html); + var computedStyle = isIE(10) && getComputedStyle(html); return { height: getSize('Height', body, html, computedStyle), @@ -428,8 +441,8 @@ function getBoundingClientRect(element) { // 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 - if (isIE10$1()) { - try { + try { + if (isIE(10)) { rect = element.getBoundingClientRect(); var scrollTop = getScroll(element, 'top'); var scrollLeft = getScroll(element, 'left'); @@ -437,10 +450,10 @@ function getBoundingClientRect(element) { rect.left += scrollLeft; rect.bottom += scrollTop; rect.right += scrollLeft; - } catch (err) {} - } else { - rect = element.getBoundingClientRect(); - } + } else { + rect = element.getBoundingClientRect(); + } + } catch (e) {} var result = { left: rect.left, @@ -472,7 +485,9 @@ function getBoundingClientRect(element) { } function getOffsetRectRelativeToArbitraryNode(children, parent) { - var isIE10 = isIE10$1(); + 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); @@ -482,6 +497,11 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) { var borderTopWidth = parseFloat(styles.borderTopWidth, 10); var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); + // In cases where the parent is fixed, we must ignore negative scroll in offset calc + if (fixedPosition && parent.nodeName === 'HTML') { + 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, @@ -509,7 +529,7 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) { offsets.marginLeft = marginLeft; } - if (isIE10 ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { + if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { offsets = includeScroll(offsets, parent); } @@ -517,13 +537,15 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) { } 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 = getScroll(html); - var scrollLeft = getScroll(html, 'left'); + var scrollTop = !excludeScroll ? getScroll(html) : 0; + var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; var offset = { top: scrollTop - relativeOffset.top + relativeOffset.marginTop, @@ -554,6 +576,26 @@ function isFixed(element) { return isFixed(getParentNode(element)); } +/** + * 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 @@ -562,16 +604,20 @@ function isFixed(element) { * @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 = findCommonOffsetParent(popper, reference); + var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); // Handle viewport case if (boundariesElement === 'viewport') { - boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent); + boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); } else { // Handle other cases based on DOM element used as boundaries var boundariesNode = void 0; @@ -586,7 +632,7 @@ function getBoundaries(popper, reference, padding, boundariesElement) { boundariesNode = boundariesElement; } - var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent); + var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); // In case of HTML, we need a different computation if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { @@ -687,11 +733,14 @@ function computeAutoPlacement(placement, refRect, popper, reference, boundariesE * @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 commonOffsetParent = findCommonOffsetParent(popper, reference); - return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent); + var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; + + var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); + return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); } /** @@ -864,7 +913,7 @@ function update() { }; // compute reference element offsets - data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference); + 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 @@ -874,9 +923,12 @@ function update() { // 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 = 'absolute'; + + data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; // run the modifiers data = runModifiers(this.modifiers, data); @@ -916,7 +968,7 @@ 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 - 1; i++) { + 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') { @@ -937,9 +989,12 @@ function destroy() { // touch DOM only if `applyStyle` modifier is enabled if (isModifierEnabled(this.modifiers, 'applyStyle')) { this.popper.removeAttribute('x-placement'); - this.popper.style.left = ''; 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')] = ''; } @@ -1127,12 +1182,12 @@ function applyStyle(data) { * @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 {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); + 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 @@ -1143,7 +1198,7 @@ function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { // Apply `position` to popper before anything else because // without the position applied we can't guarantee correct computations - setStyles(popper, { position: 'absolute' }); + setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); return options; } @@ -1178,11 +1233,13 @@ function computeStyle(data, options) { position: popper.position }; - // floor sides to avoid blurry text + // Avoid blurry text by using full pixel integers. + // For pixel-perfect positioning, top/bottom prefers rounded + // values, while left/right prefers floored values. var offsets = { left: Math.floor(popper.left), - top: Math.floor(popper.top), - bottom: Math.floor(popper.bottom), + top: Math.round(popper.top), + bottom: Math.round(popper.bottom), right: Math.floor(popper.right) }; @@ -1446,7 +1503,7 @@ function flip(data, options) { return data; } - var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement); + 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); @@ -1738,7 +1795,27 @@ function preventOverflow(data, options) { boundariesElement = getOffsetParent(boundariesElement); } - var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, 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; @@ -2235,6 +2312,12 @@ var Defaults = { */ 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 @@ -2439,6 +2522,11 @@ Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; Popper.placements = placements; Popper.Defaults = Defaults; +var SVGAnimatedString = function SVGAnimatedString() {}; +if (typeof window !== 'undefined') { + SVGAnimatedString = window.SVGAnimatedString; +} + function convertToArray(value) { if (typeof value === 'string') { value = value.split(' '); @@ -2457,7 +2545,7 @@ function addClasses(el, classes) { var newClasses = convertToArray(classes); var classList = void 0; if (el.className instanceof SVGAnimatedString) { - classList = Array.from(el.className); + classList = convertToArray(el.className.baseVal); } else { classList = convertToArray(el.className); } @@ -2484,7 +2572,7 @@ function removeClasses(el, classes) { var newClasses = convertToArray(classes); var classList = void 0; if (el.className instanceof SVGAnimatedString) { - classList = Array.from(el.className); + classList = convertToArray(el.className.baseVal); } else { classList = convertToArray(el.className); } @@ -2862,6 +2950,8 @@ var Tooltip = function () { addClasses(this._tooltipNode, this._classes); } + addClasses(reference, ['v-tooltip-open']); + return result; } }, { @@ -2990,6 +3080,8 @@ var Tooltip = function () { }, disposeTime); } + removeClasses(this.reference, ['v-tooltip-open']); + return this; } }, { @@ -3066,10 +3158,12 @@ var Tooltip = function () { case 'hover': directEvents.push('mouseenter'); oppositeEvents.push('mouseleave'); + if (_this6.options.hideOnTargetClick) oppositeEvents.push('click'); break; case 'focus': directEvents.push('focus'); oppositeEvents.push('blur'); + if (_this6.options.hideOnTargetClick) oppositeEvents.push('click'); break; case 'click': directEvents.push('click'); @@ -3186,10 +3280,10 @@ var _initialiseProps = function _initialiseProps() { this._events = []; this._setTooltipNodeEvent = function (evt, reference, delay, options) { - var relatedreference = evt.relatedreference || evt.toElement; + var relatedreference = evt.relatedreference || evt.toElement || evt.relatedTarget; var callback = function callback(evt2) { - var relatedreference2 = evt2.relatedreference || evt2.toElement; + var relatedreference2 = evt2.relatedreference || evt2.toElement || evt2.relatedTarget; // Remove event listener after call _this9._tooltipNode.removeEventListener(evt.type, callback); @@ -3217,8 +3311,9 @@ if (typeof document !== 'undefined') { openTooltips[i]._onDocumentTouch(event); } }, supportsPassive ? { - passive: true - } : false); + passive: true, + capture: true + } : true); } /** @@ -3250,6 +3345,8 @@ var defaultOptions = { defaultClass: 'vue-tooltip-theme', // Default CSS classes applied to the target element of the tooltip defaultTargetClass: 'has-tooltip', + // Is the content HTML by default? + defaultHtml: true, // Default HTML template of the tooltip element // It must include `tooltip-arrow` & `tooltip-inner` CSS classes (can be configured, see below) // Change if the classes conflict with other libraries (for example bootstrap) @@ -3274,6 +3371,8 @@ var defaultOptions = { defaultLoadingContent: '...', // Hide on mouseover tooltip autoHide: true, + // Close tooltip on click on tooltip target? + defaultHideOnTargetClick: true, // Auto destroy tooltip DOM nodes (ms) disposeTimeout: 5000, // Options for popover @@ -3306,6 +3405,7 @@ function getOptions(options) { var result = { placement: typeof options.placement !== 'undefined' ? options.placement : directive.options.defaultPlacement, delay: typeof options.delay !== 'undefined' ? options.delay : directive.options.defaultDelay, + html: typeof options.html !== 'undefined' ? options.html : directive.options.defaultHtml, template: typeof options.template !== 'undefined' ? options.template : directive.options.defaultTemplate, arrowSelector: typeof options.arrowSelector !== 'undefined' ? options.arrowSelector : directive.options.defaultArrowSelector, innerSelector: typeof options.innerSelector !== 'undefined' ? options.innerSelector : directive.options.defaultInnerSelector, @@ -3314,6 +3414,7 @@ function getOptions(options) { container: typeof options.container !== 'undefined' ? options.container : directive.options.defaultContainer, boundariesElement: typeof options.boundariesElement !== 'undefined' ? options.boundariesElement : directive.options.defaultBoundariesElement, autoHide: typeof options.autoHide !== 'undefined' ? options.autoHide : directive.options.autoHide, + hideOnTargetClick: typeof options.hideOnTargetClick !== 'undefined' ? options.hideOnTargetClick : directive.options.defaultHideOnTargetClick, loadingClass: typeof options.loadingClass !== 'undefined' ? options.loadingClass : directive.options.defaultLoadingClass, loadingContent: typeof options.loadingContent !== 'undefined' ? options.loadingContent : directive.options.defaultLoadingContent, popperOptions: _extends$1({}, typeof options.popperOptions !== 'undefined' ? options.popperOptions : directive.options.defaultPopperOptions) @@ -3367,8 +3468,7 @@ function createTooltip(el, value) { var content = getContent(value); var classes = typeof value.classes !== 'undefined' ? value.classes : directive.options.defaultClass; var opts = _extends$1({ - title: content, - html: true + title: content }, getOptions(_extends$1({}, value, { placement: getPlacement(value, modifiers) }))); @@ -3538,12 +3638,12 @@ function getInternetExplorerVersion() { return -1; } -var isIE = void 0; +var isIE$1 = void 0; function initCompat() { if (!initCompat.init) { initCompat.init = true; - isIE = getInternetExplorerVersion() !== -1; + isIE$1 = getInternetExplorerVersion() !== -1; } } @@ -3564,7 +3664,7 @@ var ResizeObserver = { render: function render() { }, removeResizeHandlers: function removeResizeHandlers() { if (this._resizeObject && this._resizeObject.onload) { - if (!isIE && this._resizeObject.contentDocument) { + if (!isIE$1 && this._resizeObject.contentDocument) { this._resizeObject.contentDocument.defaultView.removeEventListener('resize', this.notify); } delete this._resizeObject.onload; @@ -3584,13 +3684,14 @@ var ResizeObserver = { render: function render() { this._resizeObject = object; object.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;'); object.setAttribute('aria-hidden', 'true'); + object.setAttribute('tabindex', -1); object.onload = this.addResizeHandlers; object.type = 'text/html'; - if (isIE) { + if (isIE$1) { this.$el.appendChild(object); } object.data = 'about:blank'; - if (!isIE) { + if (!isIE$1) { this.$el.appendChild(object); } }, @@ -3611,7 +3712,7 @@ function install$1(Vue) { // Plugin var plugin$2 = { // eslint-disable-next-line no-undef - version: "0.4.3", + version: "0.4.4", install: install$1 }; @@ -3641,10 +3742,15 @@ if (typeof window !== 'undefined' && typeof navigator !== 'undefined') { var openPopovers = []; +var Element = function Element() {}; +if (typeof window !== 'undefined') { + Element = window.Element; +} + var Popover = { render: function render() { - var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "v-popover", class: _vm.cssClass }, [_c('span', { ref: "trigger", staticClass: "trigger", staticStyle: { "display": "inline-block" }, attrs: { "aria-describedby": _vm.popoverId } }, [_vm._t("default")], 2), _vm._v(" "), _c('div', { ref: "popover", class: [_vm.popoverBaseClass, _vm.popoverClass, _vm.cssClass], style: { - display: _vm.isOpen ? '' : 'none' - }, attrs: { "id": _vm.popoverId, "aria-hidden": _vm.isOpen ? 'false' : 'true' } }, [_c('div', { class: _vm.popoverWrapperClass }, [_c('div', { ref: "arrow", class: _vm.popoverArrowClass }), _vm._v(" "), _c('div', { ref: "inner", class: _vm.popoverInnerClass, staticStyle: { "position": "relative" } }, [_c('div', [_vm._t("popover")], 2), _vm._v(" "), _vm.handleResize ? _c('ResizeObserver', { on: { "notify": _vm.$_handleResize } }) : _vm._e()], 1)])])]); + var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "v-popover", class: _vm.cssClass }, [_c('span', { ref: "trigger", staticClass: "trigger", staticStyle: { "display": "inline-block" }, attrs: { "aria-describedby": _vm.popoverId, "tabindex": _vm.trigger.indexOf('focus') !== -1 ? 0 : -1 } }, [_vm._t("default")], 2), _vm._v(" "), _c('div', { ref: "popover", class: [_vm.popoverBaseClass, _vm.popoverClass, _vm.cssClass], style: { + visibility: _vm.isOpen ? 'visible' : 'hidden' + }, attrs: { "id": _vm.popoverId, "aria-hidden": _vm.isOpen ? 'false' : 'true' } }, [_c('div', { class: _vm.popoverWrapperClass }, [_c('div', { ref: "inner", class: _vm.popoverInnerClass, staticStyle: { "position": "relative" } }, [_c('div', [_vm._t("popover")], 2), _vm._v(" "), _vm.handleResize ? _c('ResizeObserver', { on: { "notify": _vm.$_handleResize } }) : _vm._e()], 1), _vm._v(" "), _c('div', { ref: "arrow", class: _vm.popoverArrowClass })])])]); }, staticRenderFns: [], name: 'VPopover', @@ -3799,36 +3905,23 @@ var Popover = { render: function render() { } container.appendChild(popoverNode); - this.popperInstance.update(); + this.popperInstance.scheduleUpdate(); } }, trigger: function trigger(val) { this.$_removeEventListeners(); this.$_addEventListeners(); }, - offset: function offset(val) { + placement: function placement(val) { var _this = this; this.$_updatePopper(function () { - if (val) { - var offset = _this.$_getOffset(); - - _this.popperInstance.options.modifiers.offset = { - offset: offset - }; - } else { - _this.popperInstance.options.modifiers.offset = undefined; - } + _this.popperInstance.options.placement = val; }); }, - placement: function placement(val) { - var _this2 = this; - this.$_updatePopper(function () { - _this2.popperInstance.options.placement = val; - }); - }, + offset: '$_restartPopper', boundariesElement: '$_restartPopper', @@ -3861,6 +3954,8 @@ var Popover = { render: function render() { methods: { show: function show() { + var _this2 = this; + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, event = _ref.event, _ref$skipDelay = _ref.skipDelay, @@ -3873,6 +3968,10 @@ var Popover = { render: function render() { this.$emit('show'); } this.$emit('update:open', true); + this.$_beingShowed = true; + requestAnimationFrame(function () { + _this2.$_beingShowed = false; + }); }, hide: function hide() { var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, @@ -3898,6 +3997,8 @@ var Popover = { render: function render() { } } this.$_mounted = false; + this.popperInstance = null; + this.isOpen = false; this.$emit('dispose'); }, @@ -3923,7 +4024,7 @@ var Popover = { render: function render() { if (this.popperInstance) { this.isOpen = true; this.popperInstance.enableEventListeners(); - this.popperInstance.update(); + this.popperInstance.scheduleUpdate(); } if (!this.$_mounted) { @@ -3966,7 +4067,7 @@ var Popover = { render: function render() { // Fix position requestAnimationFrame(function () { if (!_this3.$_isDisposed && _this3.popperInstance) { - _this3.popperInstance.update(); + _this3.popperInstance.scheduleUpdate(); // Show the tooltip requestAnimationFrame(function () { @@ -3995,6 +4096,8 @@ var Popover = { render: function render() { } openPopovers.push(this); + + this.$emit('apply-show'); }, $_hide: function $_hide() { var _this4 = this; @@ -4026,6 +4129,8 @@ var Popover = { render: function render() { } }, disposeTime); } + + this.$emit('apply-hide'); }, $_findContainer: function $_findContainer(container, reference) { // if container is a query, get the relative element @@ -4152,10 +4257,10 @@ var Popover = { render: function render() { var reference = this.$refs.trigger; var popoverNode = this.$refs.popover; - var relatedreference = event.relatedreference || event.toElement; + var relatedreference = event.relatedreference || event.toElement || event.relatedTarget; var callback = function callback(event2) { - var relatedreference2 = event2.relatedreference || event2.toElement; + var relatedreference2 = event2.relatedreference || event2.toElement || event2.relatedTarget; // Remove event listener after call popoverNode.removeEventListener(event.type, callback); @@ -4186,18 +4291,19 @@ var Popover = { render: function render() { this.$_events = []; }, $_updatePopper: function $_updatePopper(cb) { - if (this.isOpen && this.popperInstance) { + if (this.popperInstance) { cb(); - this.popperInstance.update(); + if (this.isOpen) this.popperInstance.scheduleUpdate(); } }, $_restartPopper: function $_restartPopper() { if (this.popperInstance) { var isOpen = this.isOpen; this.dispose(); + this.$_isDisposed = false; this.$_init(); if (isOpen) { - this.show(); + this.show({ skipDelay: true, force: true }); } } }, @@ -4206,6 +4312,8 @@ var Popover = { render: function render() { var touch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + if (this.$_beingShowed) return; + this.hide({ event: event }); if (event.closePopover) { @@ -4223,7 +4331,7 @@ var Popover = { render: function render() { }, $_handleResize: function $_handleResize() { if (this.isOpen && this.popperInstance) { - this.popperInstance.update(); + this.popperInstance.scheduleUpdate(); this.$emit('resize'); } } @@ -4233,10 +4341,11 @@ var Popover = { render: function render() { if (typeof document !== 'undefined' && typeof window !== 'undefined') { if (isIOS) { document.addEventListener('touchend', handleGlobalTouchend, supportsPassive ? { - passive: true - } : false); + passive: true, + capture: true + } : true); } else { - window.addEventListener('click', handleGlobalClick); + window.addEventListener('click', handleGlobalClick, true); } } @@ -4251,14 +4360,19 @@ function handleGlobalTouchend(event) { function handleGlobalClose(event) { var touch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var popover = void 0; - for (var i = 0; i < openPopovers.length; i++) { - popover = openPopovers[i]; - var contains = popover.$refs.popover.contains(event.target); - if (event.closeAllPopover || event.closePopover && contains || popover.autoHide && !contains) { - popover.$_handleGlobalClose(event, touch); + // Delay so that close directive has time to set values + requestAnimationFrame(function () { + var popover = void 0; + for (var i = 0; i < openPopovers.length; i++) { + popover = openPopovers[i]; + if (popover.$refs.popover) { + var contains = popover.$refs.popover.contains(event.target); + if (event.closeAllPopover || event.closePopover && contains || popover.autoHide && !contains) { + popover.$_handleGlobalClose(event, touch); + } + } } - } + }); } var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; @@ -4273,9 +4387,9 @@ function createCommonjsModule(fn, module) { var lodash_merge = createCommonjsModule(function (module, exports) { /** - * lodash (Custom Build) + * Lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors + * Copyright JS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors @@ -4287,12 +4401,17 @@ var LARGE_ARRAY_SIZE = 200; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', @@ -4300,12 +4419,13 @@ var argsTag = '[object Arguments]', genTag = '[object GeneratorFunction]', mapTag = '[object Map]', numberTag = '[object Number]', + nullTag = '[object Null]', objectTag = '[object Object]', - promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', - symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', @@ -4326,9 +4446,6 @@ var arrayBufferTag = '[object ArrayBuffer]', */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; - /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; @@ -4351,22 +4468,6 @@ typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = -cloneableTags[boolTag] = cloneableTags[dateTag] = -cloneableTags[float32Tag] = cloneableTags[float64Tag] = -cloneableTags[int8Tag] = cloneableTags[int16Tag] = -cloneableTags[int32Tag] = cloneableTags[mapTag] = -cloneableTags[numberTag] = cloneableTags[objectTag] = -cloneableTags[regexpTag] = cloneableTags[setTag] = -cloneableTags[stringTag] = cloneableTags[symbolTag] = -cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = -cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; - /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; @@ -4391,41 +4492,13 @@ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { - return freeProcess && freeProcess.binding('util'); + return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); /* Node.js helper references. */ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; -/** - * Adds the key-value `pair` to `map`. - * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ -function addMapEntry(map, pair) { - // Don't return `map.set` because it's not chainable in IE 11. - map.set(pair[0], pair[1]); - return map; -} - -/** - * Adds `value` to `set`. - * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ -function addSetEntry(set, value) { - // Don't return `set.add` because it's not chainable in IE 11. - set.add(value); - return set; -} - /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. @@ -4446,71 +4519,6 @@ function apply(func, thisArg, args) { return func.apply(thisArg, args); } -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array ? array.length : 0; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} - -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; -} - -/** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ -function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array ? array.length : 0; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; -} - /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. @@ -4555,42 +4563,6 @@ function getValue(object, key) { return object == null ? undefined : object[key]; } -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ -function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; -} - /** * Creates a unary function that invokes `func` with its argument transformed. * @@ -4606,20 +4578,17 @@ function overArg(func, transform) { } /** - * Converts `set` to an array of its values. + * Gets the value at `key`, unless `key` is "__proto__". * * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; +function safeGet(object, key) { + return key == '__proto__' + ? undefined + : object[key]; } /** Used for built-in method references. */ @@ -4630,27 +4599,27 @@ var arrayProto = Array.prototype, /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; -/** Used to infer the `Object` constructor. */ -var objectCtorString = funcToString.call(Object); +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ -var objectToString = objectProto.toString; +var nativeObjectToString = objectProto.toString; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + @@ -4662,35 +4631,53 @@ var reIsNative = RegExp('^' + var Buffer = moduleExports ? root.Buffer : undefined, Symbol = root.Symbol, Uint8Array = root.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice; + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); /* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols, - nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeKeys = overArg(Object.keys, Object), - nativeMax = Math.max; +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeMax = Math.max, + nativeNow = Date.now; /* Built-in method references that are verified to be native. */ -var DataView = getNative(root, 'DataView'), - Map = getNative(root, 'Map'), - Promise = getNative(root, 'Promise'), - Set = getNative(root, 'Set'), - WeakMap = getNative(root, 'WeakMap'), +var Map = getNative(root, 'Map'), nativeCreate = getNative(Object, 'create'); -/** Used to detect maps, sets, and weakmaps. */ -var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); /** * Creates a hash object. @@ -4701,7 +4688,7 @@ var symbolProto = Symbol ? Symbol.prototype : undefined, */ function Hash(entries) { var index = -1, - length = entries ? entries.length : 0; + length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { @@ -4719,6 +4706,7 @@ function Hash(entries) { */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; } /** @@ -4732,7 +4720,9 @@ function hashClear() { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; } /** @@ -4764,7 +4754,7 @@ function hashGet(key) { */ function hashHas(key) { var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } /** @@ -4779,6 +4769,7 @@ function hashHas(key) { */ function hashSet(key, value) { var data = this.__data__; + this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } @@ -4799,7 +4790,7 @@ Hash.prototype.set = hashSet; */ function ListCache(entries) { var index = -1, - length = entries ? entries.length : 0; + length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { @@ -4817,6 +4808,7 @@ function ListCache(entries) { */ function listCacheClear() { this.__data__ = []; + this.size = 0; } /** @@ -4841,6 +4833,7 @@ function listCacheDelete(key) { } else { splice.call(data, index, 1); } + --this.size; return true; } @@ -4888,6 +4881,7 @@ function listCacheSet(key, value) { index = assocIndexOf(data, key); if (index < 0) { + ++this.size; data.push([key, value]); } else { data[index][1] = value; @@ -4911,7 +4905,7 @@ ListCache.prototype.set = listCacheSet; */ function MapCache(entries) { var index = -1, - length = entries ? entries.length : 0; + length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { @@ -4928,6 +4922,7 @@ function MapCache(entries) { * @memberOf MapCache */ function mapCacheClear() { + this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), @@ -4945,7 +4940,9 @@ function mapCacheClear() { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; } /** @@ -4985,7 +4982,11 @@ function mapCacheHas(key) { * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; return this; } @@ -5004,7 +5005,8 @@ MapCache.prototype.set = mapCacheSet; * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { - this.__data__ = new ListCache(entries); + var data = this.__data__ = new ListCache(entries); + this.size = data.size; } /** @@ -5016,6 +5018,7 @@ function Stack(entries) { */ function stackClear() { this.__data__ = new ListCache; + this.size = 0; } /** @@ -5028,7 +5031,11 @@ function stackClear() { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { - return this.__data__['delete'](key); + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; } /** @@ -5068,16 +5075,18 @@ function stackHas(key) { * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { - var cache = this.__data__; - if (cache instanceof ListCache) { - var pairs = cache.__data__; + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); + this.size = ++data.size; return this; } - cache = this.__data__ = new MapCache(pairs); + data = this.__data__ = new MapCache(pairs); } - cache.set(key, value); + data.set(key, value); + this.size = data.size; return this; } @@ -5097,18 +5106,26 @@ Stack.prototype.set = stackSet; * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - // Safari 9 makes `arguments.length` enumerable in strict mode. - var result = (isArray(value) || isArguments(value)) - ? baseTimes(value.length, String) - : []; - - var length = result.length, - skipIndexes = !!length; + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { result.push(key); } } @@ -5126,8 +5143,8 @@ function arrayLikeKeys(value, inherited) { */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || - (typeof key == 'number' && value === undefined && !(key in object))) { - object[key] = value; + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); } } @@ -5145,7 +5162,7 @@ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { - object[key] = value; + baseAssignValue(object, key, value); } } @@ -5168,130 +5185,65 @@ function assocIndexOf(array, key) { } /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. * * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. */ -function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } } /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {boolean} [isFull] Specify a clone including symbols. - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, isDeep, isFull, customizer, key, object, stack) { - var result; - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - if (isHostObject(value)) { - return object ? value : {}; - } - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - return copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, baseClone, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - if (!isArr) { - var props = isFull ? getAllKeys(value) : keys(value); - } - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); - }); - return result; -} + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. + * The base implementation of `getTag` without fallbacks for buggy environments. * * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ -function baseCreate(proto) { - return isObject(proto) ? objectCreate(proto) : {}; -} - -/** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. */ -function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); } /** - * The base implementation of `getTag`. + * The base implementation of `_.isArguments`. * * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ -function baseGetTag(value) { - return objectToString.call(value); +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; } /** @@ -5306,7 +5258,7 @@ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } @@ -5319,27 +5271,7 @@ function baseIsNative(value) { */ function baseIsTypedArray(value) { return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; -} - -/** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } /** @@ -5379,21 +5311,14 @@ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } - if (!(isArray(source) || isTypedArray(source))) { - var props = baseKeysIn(source); - } - arrayEach(props || source, function(srcValue, key) { - if (props) { - key = srcValue; - srcValue = source[key]; - } + baseFor(source, function(srcValue, key) { if (isObject(srcValue)) { stack || (stack = new Stack); baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer - ? customizer(object[key], srcValue, (key + ''), object, source, stack) + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { @@ -5401,7 +5326,7 @@ function baseMerge(object, source, srcIndex, customizer, stack) { } assignMergeValue(object, key, newValue); } - }); + }, keysIn); } /** @@ -5420,8 +5345,8 @@ function baseMerge(object, source, srcIndex, customizer, stack) { * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = object[key], - srcValue = source[key], + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { @@ -5435,29 +5360,37 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta var isCommon = newValue === undefined; if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + newValue = srcValue; - if (isArray(srcValue) || isTypedArray(srcValue)) { + if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } - else { + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { isCommon = false; - newValue = baseClone(srcValue, true); + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { - isCommon = false; - newValue = baseClone(srcValue, true); - } - else { - newValue = objValue; + newValue = initCloneObject(srcValue); } } else { @@ -5482,26 +5415,26 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta * @returns {Function} Returns the new function. */ function baseRest(func, start) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; + return setToString(overRest(func, start, identity), func + ''); } +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + /** * Creates a clone of `buffer`. * @@ -5514,7 +5447,9 @@ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } - var result = new buffer.constructor(buffer.length); + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + buffer.copy(result); return result; } @@ -5532,71 +5467,6 @@ function cloneArrayBuffer(arrayBuffer) { return result; } -/** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ -function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); -} - -/** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned map. - */ -function cloneMap(map, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); - return arrayReduce(array, addMapEntry, new map.constructor); -} - -/** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ -function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; -} - -/** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned set. - */ -function cloneSet(set, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); - return arrayReduce(array, addSetEntry, new set.constructor); -} - -/** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ -function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; -} - /** * Creates a clone of `typedArray`. * @@ -5640,6 +5510,7 @@ function copyArray(source, array) { * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { + var isNew = !object; object || (object = {}); var index = -1, @@ -5652,23 +5523,18 @@ function copyObject(source, props, object, customizer) { ? customizer(object[key], source[key], key, object, source) : undefined; - assignValue(object, key, newValue === undefined ? source[key] : newValue); + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } } return object; } -/** - * Copies own symbol properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); -} - /** * Creates a function like `_.assign`. * @@ -5703,14 +5569,27 @@ function createAssigner(assigner) { } /** - * Creates an array of own enumerable property names and symbols of `object`. + * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. */ -function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; } /** @@ -5742,63 +5621,28 @@ function getNative(object, key) { } /** - * Creates an array of the own enumerable symbol properties of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; - -/** - * Gets the `toStringTag` of `value`. + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. + * @returns {string} Returns the raw `toStringTag`. */ -var getTag = baseGetTag; - -// Fallback for data views, maps, sets, and weak maps in IE 11, -// for data views in Edge < 14, and promises in Node.js. -if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : undefined; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; -} +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; -/** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ -function initCloneArray(array) { - var length = array.length, - result = array.constructor(length); + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } } return result; } @@ -5816,55 +5660,6 @@ function initCloneObject(object) { : {}; } -/** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneByTag(object, tag, cloneFunc, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return cloneMap(object, isDeep, cloneFunc); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return cloneSet(object, isDeep, cloneFunc); - - case symbolTag: - return cloneSymbol(object); - } -} - /** * Checks if `value` is a valid array-like index. * @@ -5874,10 +5669,13 @@ function initCloneByTag(object, tag, cloneFunc, isDeep) { * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { + var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); } /** @@ -5962,11 +5760,91 @@ function nativeKeysIn(object) { return result; } +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + /** * Converts `func` to its source code. * * @private - * @param {Function} func The function to process. + * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { @@ -6035,11 +5913,10 @@ function eq(value, other) { * _.isArguments([1, 2, 3]); * // => false */ -function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; /** * Checks if `value` is classified as an `Array` object. @@ -6161,10 +6038,13 @@ var isBuffer = nativeIsBuffer || stubFalse; * // => false */ function isFunction(value) { + if (!isObject(value)) { + return false; + } // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } /** @@ -6225,7 +6105,7 @@ function isLength(value) { */ function isObject(value) { var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + return value != null && (type == 'object' || type == 'function'); } /** @@ -6253,7 +6133,7 @@ function isObject(value) { * // => false */ function isObjectLike(value) { - return !!value && typeof value == 'object'; + return value != null && typeof value == 'object'; } /** @@ -6285,8 +6165,7 @@ function isObjectLike(value) { * // => true */ function isPlainObject(value) { - if (!isObjectLike(value) || - objectToString.call(value) != objectTag || isHostObject(value)) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); @@ -6294,8 +6173,8 @@ function isPlainObject(value) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return (typeof Ctor == 'function' && - Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; } /** @@ -6345,38 +6224,6 @@ function toPlainObject(value) { return copyObject(value, keysIn(value)); } -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} - /** * Creates an array of the own and inherited enumerable property names of `object`. * @@ -6440,25 +6287,48 @@ var merge = createAssigner(function(object, source, srcIndex) { }); /** - * This method returns a new empty array. + * Creates a function that returns `value`. * * @static * @memberOf _ - * @since 4.13.0 + * @since 2.4.0 * @category Util - * @returns {Array} Returns the new empty array. + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. * @example * - * var arrays = _.times(2, _.stubArray); + * var objects = _.times(2, _.constant({ 'a': 1 })); * - * console.log(arrays); - * // => [[], []] + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] * - * console.log(arrays[0] === arrays[1]); - * // => false + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true */ -function stubArray() { - return []; +function identity(value) { + return value; } /** diff --git a/package.json b/package.json index 3267d79e..b48f8d1c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "v-tooltip", - "version": "2.0.0-rc.31", + "version": "2.0.0-rc.32", "description": "Easy tooltips with Vue 2.x", "main": "dist/v-tooltip.umd.js", "module": "dist/v-tooltip.esm.js",