/
www
/
wwwroot
/
alo88.autos
/
wp-content
/
plugins
/
wp-content-crawler
/
app
/
public
/
node_modules
/
tether
/
dist
/
js
/
Upload File
HOME
{"version":3,"file":"tether.js","sources":["../../src/js/utils/type-check.js","../../src/js/utils/classes.js","../../src/js/utils/deferred.js","../../src/js/utils/general.js","../../src/js/utils/bounds.js","../../src/js/abutment.js","../../src/js/constraint.js","../../src/js/shift.js","../../src/js/evented.js","../../src/js/utils/offset.js","../../src/js/utils/parents.js","../../src/js/tether.js"],"sourcesContent":["/**\n * Checks if `value` is classified as a `Function` object.\n * @param {*} value The param to check if it is a function\n */\nexport function isFunction(value) {\n return typeof value === 'function';\n}\n\n/**\n * Checks if `value` is classified as a `Number` object.\n * @param {*} value The param to check if it is a number\n */\nexport function isNumber(value) {\n return typeof value === 'number';\n}\n\n/**\n * Checks if `value` is classified as an `Object`.\n * @param {*} value The param to check if it is an object\n */\nexport function isObject(value) {\n return typeof value === 'object';\n}\n\n/**\n * Checks if `value` is classified as a `String` object.\n * @param {*} value The param to check if it is a string\n */\nexport function isString(value) {\n return typeof value === 'string';\n}\n\n/**\n * Checks if `value` is undefined.\n * @param {*} value The param to check if it is undefined\n */\nexport function isUndefined(value) {\n return value === undefined;\n}\n","import { isUndefined } from './type-check';\n\nexport function addClass(el, name) {\n name.split(' ').forEach((cls) => {\n if (cls.trim()) {\n el.classList.add(cls);\n }\n });\n}\n\n/**\n * Get class string based on previously determined classes\n * @param {String} [key=''] - default value for the classes object\n * @param {Object} classes\n * @param {String} classPrefix\n */\nexport function getClass(key = '', classes, classPrefix) {\n if (!isUndefined(classes) && !isUndefined(classes[key])) {\n if (classes[key] === false) {\n return '';\n }\n return classes[key];\n } else if (classPrefix) {\n return `${classPrefix}-${key}`;\n } else {\n return key;\n }\n}\n\nexport function removeClass(el, name) {\n name.split(' ').forEach((cls) => {\n if (cls.trim()) {\n el.classList.remove(cls);\n }\n });\n}\n\nexport function updateClasses(el, add, all) {\n // Of the set of 'all' classes, we need the 'add' classes, and only the\n // 'add' classes to be set.\n all.forEach((cls) => {\n if (add.indexOf(cls) === -1 && el.classList.contains(cls)) {\n removeClass(el, cls);\n }\n });\n\n add.forEach((cls) => {\n if (!el.classList.contains(cls)) {\n addClass(el, cls);\n }\n });\n}\n","const deferred = [];\n\nexport function defer(fn) {\n deferred.push(fn);\n}\n\nexport function flush() {\n let fn;\n // eslint-disable-next-line\n while (fn = deferred.pop()) {\n fn();\n }\n}\n","let _scrollBarSize = null;\n\nexport function extend(out = {}) {\n const args = [];\n\n Array.prototype.push.apply(args, arguments);\n\n args.slice(1).forEach((obj) => {\n if (obj) {\n for (let key in obj) {\n if ({}.hasOwnProperty.call(obj, key)) {\n out[key] = obj[key];\n }\n }\n }\n });\n\n return out;\n}\n\nexport function getScrollBarSize() {\n if (_scrollBarSize) {\n return _scrollBarSize;\n }\n const inner = document.createElement('div');\n inner.style.width = '100%';\n inner.style.height = '200px';\n\n const outer = document.createElement('div');\n extend(outer.style, {\n position: 'absolute',\n top: 0,\n left: 0,\n pointerEvents: 'none',\n visibility: 'hidden',\n width: '200px',\n height: '150px',\n overflow: 'hidden'\n });\n\n outer.appendChild(inner);\n\n document.body.appendChild(outer);\n\n const widthContained = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n let widthScroll = inner.offsetWidth;\n\n if (widthContained === widthScroll) {\n widthScroll = outer.clientWidth;\n }\n\n document.body.removeChild(outer);\n\n const width = widthContained - widthScroll;\n\n _scrollBarSize = { width, height: width };\n return _scrollBarSize;\n}\n\nexport const uniqueId = (() => {\n let id = 0;\n return () => ++id;\n})();\n","import { defer } from './deferred';\nimport { extend, uniqueId } from './general';\nimport { isUndefined } from './type-check';\n\nconst zeroPosCache = {};\nlet zeroElement = null;\n\nexport function getBounds(body, el) {\n let doc;\n if (el === document) {\n doc = document;\n el = document.documentElement;\n } else {\n doc = el.ownerDocument;\n }\n\n const docEl = doc.documentElement;\n\n const box = _getActualBoundingClientRect(el);\n\n const origin = _getOrigin(body);\n\n box.top -= origin.top;\n box.left -= origin.left;\n\n if (isUndefined(box.width)) {\n box.width = document.body.scrollWidth - box.left - box.right;\n }\n if (isUndefined(box.height)) {\n box.height = document.body.scrollHeight - box.top - box.bottom;\n }\n\n box.top = box.top - docEl.clientTop;\n box.left = box.left - docEl.clientLeft;\n box.right = doc.body.clientWidth - box.width - box.left;\n box.bottom = doc.body.clientHeight - box.height - box.top;\n\n return box;\n}\n\n/**\n * Gets bounds for when target modifiier is 'scroll-handle'\n * @param target\n * @return {{left: number, width: number, height: number}}\n */\nexport function getScrollHandleBounds(body, target) {\n let bounds;\n // We have to do the check for the scrollTop and if target === document.body here and set to variables\n // because we may reset target below.\n const targetScrollTop = target.scrollTop;\n const targetIsBody = target === document.body;\n\n if (targetIsBody) {\n target = document.documentElement;\n\n bounds = {\n left: pageXOffset,\n top: pageYOffset,\n height: innerHeight,\n width: innerWidth\n };\n } else {\n bounds = getBounds(body, target);\n }\n\n const style = getComputedStyle(target);\n\n const hasBottomScroll = (\n target.scrollWidth > target.clientWidth ||\n [style.overflow, style.overflowX].indexOf('scroll') >= 0 ||\n !targetIsBody\n );\n\n let scrollBottom = 0;\n if (hasBottomScroll) {\n scrollBottom = 15;\n }\n\n const height = bounds.height - parseFloat(style.borderTopWidth) - parseFloat(style.borderBottomWidth) - scrollBottom;\n\n const out = {\n width: 15,\n height: height * 0.975 * (height / target.scrollHeight),\n left: bounds.left + bounds.width - parseFloat(style.borderLeftWidth) - 15\n };\n\n let fitAdj = 0;\n if (height < 408 && targetIsBody) {\n fitAdj = -0.00011 * Math.pow(height, 2) - 0.00727 * height + 22.58;\n }\n\n if (!targetIsBody) {\n out.height = Math.max(out.height, 24);\n }\n\n const scrollPercentage = targetScrollTop / (target.scrollHeight - height);\n out.top = scrollPercentage * (height - out.height - fitAdj) + bounds.top + parseFloat(style.borderTopWidth);\n\n if (targetIsBody) {\n out.height = Math.max(out.height, 24);\n }\n\n return out;\n}\n\n/**\n * Gets bounds for when target modifiier is 'visible\n * @param target\n * @return {{top: *, left: *, width: *, height: *}}\n */\nexport function getVisibleBounds(body, target) {\n if (target === document.body) {\n return { top: pageYOffset, left: pageXOffset, height: innerHeight, width: innerWidth };\n } else {\n const bounds = getBounds(body, target);\n\n const out = {\n height: bounds.height,\n width: bounds.width,\n top: bounds.top,\n left: bounds.left\n };\n\n out.height = Math.min(out.height, bounds.height - (pageYOffset - bounds.top));\n out.height = Math.min(out.height, bounds.height - ((bounds.top + bounds.height) - (pageYOffset + innerHeight)));\n out.height = Math.min(innerHeight, out.height);\n out.height -= 2;\n\n out.width = Math.min(out.width, bounds.width - (pageXOffset - bounds.left));\n out.width = Math.min(out.width, bounds.width - ((bounds.left + bounds.width) - (pageXOffset + innerWidth)));\n out.width = Math.min(innerWidth, out.width);\n out.width -= 2;\n\n if (out.top < pageYOffset) {\n out.top = pageYOffset;\n }\n if (out.left < pageXOffset) {\n out.left = pageXOffset;\n }\n\n return out;\n }\n}\n\nexport function removeUtilElements(body) {\n if (zeroElement) {\n body.removeChild(zeroElement);\n }\n zeroElement = null;\n}\n\n/**\n * Same as native getBoundingClientRect, except it takes into account parent <frame> offsets\n * if the element lies within a nested document (<frame> or <iframe>-like).\n * @param node\n */\nfunction _getActualBoundingClientRect(node) {\n let boundingRect = node.getBoundingClientRect();\n\n // The original object returned by getBoundingClientRect is immutable, so we clone it\n // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n let rect = {};\n for (let k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n try {\n if (node.ownerDocument !== document) {\n let { frameElement } = node.ownerDocument.defaultView;\n if (frameElement) {\n let frameRect = _getActualBoundingClientRect(frameElement);\n rect.top += frameRect.top;\n rect.bottom += frameRect.top;\n rect.left += frameRect.left;\n rect.right += frameRect.left;\n }\n }\n } catch(err) {\n // Ignore \"Access is denied\" in IE11/Edge\n }\n\n return rect;\n}\n\nfunction _getOrigin(body) {\n // getBoundingClientRect is unfortunately too accurate. It introduces a pixel or two of\n // jitter as the user scrolls that messes with our ability to detect if two positions\n // are equivilant or not. We place an element at the top left of the page that will\n // get the same jitter, so we can cancel the two out.\n let node = zeroElement;\n if (!node || !body.contains(node)) {\n node = document.createElement('div');\n node.setAttribute('data-tether-id', uniqueId());\n extend(node.style, {\n top: 0,\n left: 0,\n position: 'absolute'\n });\n\n body.appendChild(node);\n\n zeroElement = node;\n }\n\n const id = node.getAttribute('data-tether-id');\n if (isUndefined(zeroPosCache[id])) {\n zeroPosCache[id] = _getActualBoundingClientRect(node);\n\n // Clear the cache when this position call is done\n defer(() => {\n delete zeroPosCache[id];\n });\n }\n\n return zeroPosCache[id];\n}\n","import { getClass, updateClasses } from './utils/classes';\nimport { defer } from './utils/deferred';\nimport { getBounds } from './utils/bounds';\n\nexport default {\n position({ top, left }) {\n const { height, width } = this.cache('element-bounds', () => {\n return getBounds(this.element);\n });\n\n const targetPos = this.getTargetBounds();\n\n const bottom = top + height;\n const right = left + width;\n\n const abutted = [];\n if (top <= targetPos.bottom && bottom >= targetPos.top) {\n ['left', 'right'].forEach((side) => {\n const targetPosSide = targetPos[side];\n if (targetPosSide === left || targetPosSide === right) {\n abutted.push(side);\n }\n });\n }\n\n if (left <= targetPos.right && right >= targetPos.left) {\n ['top', 'bottom'].forEach((side) => {\n const targetPosSide = targetPos[side];\n if (targetPosSide === top || targetPosSide === bottom) {\n abutted.push(side);\n }\n });\n }\n\n const sides = ['left', 'top', 'right', 'bottom'];\n const { classes, classPrefix } = this.options;\n this.all.push(getClass('abutted', classes, classPrefix));\n sides.forEach((side) => {\n this.all.push(`${getClass('abutted', classes, classPrefix)}-${side}`);\n });\n\n if (abutted.length) {\n this.add.push(getClass('abutted', classes, classPrefix));\n }\n\n abutted.forEach((side) => {\n this.add.push(`${getClass('abutted', classes, classPrefix)}-${side}`);\n });\n\n defer(() => {\n if (!(this.options.addTargetClasses === false)) {\n updateClasses(this.target, this.add, this.all);\n }\n updateClasses(this.element, this.add, this.all);\n });\n\n return true;\n }\n};\n","import { getClass, updateClasses } from './utils/classes';\nimport { defer } from './utils/deferred';\nimport { extend } from './utils/general';\nimport { getBounds } from './utils/bounds';\nimport { isString, isUndefined } from './utils/type-check';\n\nconst BOUNDS_FORMAT = ['left', 'top', 'right', 'bottom'];\n\n/**\n * Returns an array of bounds of the format [left, top, right, bottom]\n * @param tether\n * @param to\n * @return {*[]|HTMLElement|ActiveX.IXMLDOMElement}\n */\nfunction getBoundingRect(body, tether, to) {\n // arg to is required\n if (!to) {\n return null;\n }\n if (to === 'scrollParent') {\n to = tether.scrollParents[0];\n } else if (to === 'window') {\n to = [pageXOffset, pageYOffset, innerWidth + pageXOffset, innerHeight + pageYOffset];\n }\n\n if (to === document) {\n to = to.documentElement;\n }\n\n if (!isUndefined(to.nodeType)) {\n const node = to;\n const size = getBounds(body, to);\n const pos = size;\n const style = getComputedStyle(to);\n\n to = [pos.left, pos.top, size.width + pos.left, size.height + pos.top];\n\n // Account any parent Frames scroll offset\n if (node.ownerDocument !== document) {\n let win = node.ownerDocument.defaultView;\n to[0] += win.pageXOffset;\n to[1] += win.pageYOffset;\n to[2] += win.pageXOffset;\n to[3] += win.pageYOffset;\n }\n\n BOUNDS_FORMAT.forEach((side, i) => {\n side = side[0].toUpperCase() + side.substr(1);\n if (side === 'Top' || side === 'Left') {\n to[i] += parseFloat(style[`border${side}Width`]);\n } else {\n to[i] -= parseFloat(style[`border${side}Width`]);\n }\n });\n }\n\n return to;\n}\n\n/**\n * Add out of bounds classes to the list of classes we add to tether\n * @param {string[]} oob An array of directions that are out of bounds\n * @param {string[]} addClasses The array of classes to add to Tether\n * @param {string[]} classes The array of class types for Tether\n * @param {string} classPrefix The prefix to add to the front of the class\n * @param {string} outOfBoundsClass The class to apply when out of bounds\n * @private\n */\nfunction _addOutOfBoundsClass(oob, addClasses, classes, classPrefix, outOfBoundsClass) {\n if (oob.length) {\n let oobClass;\n if (!isUndefined(outOfBoundsClass)) {\n oobClass = outOfBoundsClass;\n } else {\n oobClass = getClass('out-of-bounds', classes, classPrefix);\n }\n\n addClasses.push(oobClass);\n oob.forEach((side) => {\n addClasses.push(`${oobClass}-${side}`);\n });\n }\n}\n\n/**\n * Calculates if out of bounds or pinned in the X direction.\n *\n * @param {number} left\n * @param {number[]} bounds Array of bounds of the format [left, top, right, bottom]\n * @param {number} width\n * @param pin\n * @param pinned\n * @param {string[]} oob\n * @return {number}\n * @private\n */\nfunction _calculateOOBAndPinnedLeft(left, bounds, width, pin, pinned, oob) {\n if (left < bounds[0]) {\n if (pin.indexOf('left') >= 0) {\n left = bounds[0];\n pinned.push('left');\n } else {\n oob.push('left');\n }\n }\n\n if (left + width > bounds[2]) {\n if (pin.indexOf('right') >= 0) {\n left = bounds[2] - width;\n pinned.push('right');\n } else {\n oob.push('right');\n }\n }\n\n return left;\n}\n\n/**\n * Calculates if out of bounds or pinned in the Y direction.\n *\n * @param {number} top\n * @param {number[]} bounds Array of bounds of the format [left, top, right, bottom]\n * @param {number} height\n * @param pin\n * @param {string[]} pinned\n * @param {string[]} oob\n * @return {number}\n * @private\n */\nfunction _calculateOOBAndPinnedTop(top, bounds, height, pin, pinned, oob) {\n if (top < bounds[1]) {\n if (pin.indexOf('top') >= 0) {\n top = bounds[1];\n pinned.push('top');\n } else {\n oob.push('top');\n }\n }\n\n if (top + height > bounds[3]) {\n if (pin.indexOf('bottom') >= 0) {\n top = bounds[3] - height;\n pinned.push('bottom');\n } else {\n oob.push('bottom');\n }\n }\n\n return top;\n}\n\n/**\n * Flip X \"together\"\n * @param {object} tAttachment The target attachment\n * @param {object} eAttachment The element attachment\n * @param {number[]} bounds Array of bounds of the format [left, top, right, bottom]\n * @param {number} width\n * @param targetWidth\n * @param {number} left\n * @private\n */\nfunction _flipXTogether(tAttachment, eAttachment, bounds, width, targetWidth, left) {\n if (left < bounds[0] && tAttachment.left === 'left') {\n if (eAttachment.left === 'right') {\n left += targetWidth;\n tAttachment.left = 'right';\n\n left += width;\n eAttachment.left = 'left';\n\n } else if (eAttachment.left === 'left') {\n left += targetWidth;\n tAttachment.left = 'right';\n\n left -= width;\n eAttachment.left = 'right';\n }\n\n } else if (left + width > bounds[2] && tAttachment.left === 'right') {\n if (eAttachment.left === 'left') {\n left -= targetWidth;\n tAttachment.left = 'left';\n\n left -= width;\n eAttachment.left = 'right';\n\n } else if (eAttachment.left === 'right') {\n left -= targetWidth;\n tAttachment.left = 'left';\n\n left += width;\n eAttachment.left = 'left';\n }\n\n } else if (tAttachment.left === 'center') {\n if (left + width > bounds[2] && eAttachment.left === 'left') {\n left -= width;\n eAttachment.left = 'right';\n\n } else if (left < bounds[0] && eAttachment.left === 'right') {\n left += width;\n eAttachment.left = 'left';\n }\n }\n\n return left;\n}\n\n/**\n * Flip Y \"together\"\n * @param {object} tAttachment The target attachment\n * @param {object} eAttachment The element attachment\n * @param {number[]} bounds Array of bounds of the format [left, top, right, bottom]\n * @param {number} height\n * @param targetHeight\n * @param {number} top\n * @private\n */\nfunction _flipYTogether(tAttachment, eAttachment, bounds, height, targetHeight, top) {\n if (tAttachment.top === 'top') {\n if (eAttachment.top === 'bottom' && top < bounds[1]) {\n top += targetHeight;\n tAttachment.top = 'bottom';\n\n top += height;\n eAttachment.top = 'top';\n\n } else if (eAttachment.top === 'top' && top + height > bounds[3] && top - (height - targetHeight) >= bounds[1]) {\n top -= height - targetHeight;\n tAttachment.top = 'bottom';\n\n eAttachment.top = 'bottom';\n }\n }\n\n if (tAttachment.top === 'bottom') {\n if (eAttachment.top === 'top' && top + height > bounds[3]) {\n top -= targetHeight;\n tAttachment.top = 'top';\n\n top -= height;\n eAttachment.top = 'bottom';\n\n } else if (eAttachment.top === 'bottom' && top < bounds[1] && top + (height * 2 - targetHeight) <= bounds[3]) {\n top += height - targetHeight;\n tAttachment.top = 'top';\n\n eAttachment.top = 'top';\n\n }\n }\n\n if (tAttachment.top === 'middle') {\n if (top + height > bounds[3] && eAttachment.top === 'top') {\n top -= height;\n eAttachment.top = 'bottom';\n\n } else if (top < bounds[1] && eAttachment.top === 'bottom') {\n top += height;\n eAttachment.top = 'top';\n }\n }\n\n return top;\n}\n\n/**\n * Get all the initial classes\n * @param classes\n * @param {string} classPrefix\n * @param constraints\n * @return {[*, *]}\n * @private\n */\nfunction _getAllClasses(classes, classPrefix, constraints) {\n const allClasses = [getClass('pinned', classes, classPrefix), getClass('out-of-bounds', classes, classPrefix)];\n\n constraints.forEach((constraint) => {\n const { outOfBoundsClass, pinnedClass } = constraint;\n if (outOfBoundsClass) {\n allClasses.push(outOfBoundsClass);\n }\n if (pinnedClass) {\n allClasses.push(pinnedClass);\n }\n });\n\n allClasses.forEach((cls) => {\n ['left', 'top', 'right', 'bottom'].forEach((side) => {\n allClasses.push(`${cls}-${side}`);\n });\n });\n\n return allClasses;\n}\n\nexport default {\n position({ top, left, targetAttachment }) {\n if (!this.options.constraints) {\n return true;\n }\n\n let { height, width } = this.cache('element-bounds', () => {\n return getBounds(this.bodyElement, this.element);\n });\n\n if (width === 0 && height === 0 && !isUndefined(this.lastSize)) {\n // Handle the item getting hidden as a result of our positioning without glitching\n // the classes in and out\n ({ width, height } = this.lastSize);\n }\n\n const targetSize = this.cache('target-bounds', () => {\n return this.getTargetBounds();\n });\n\n const { height: targetHeight, width: targetWidth } = targetSize;\n const { classes, classPrefix } = this.options;\n\n const allClasses = _getAllClasses(classes, classPrefix, this.options.constraints);\n const addClasses = [];\n\n const tAttachment = extend({}, targetAttachment);\n const eAttachment = extend({}, this.attachment);\n\n this.options.constraints.forEach((constraint) => {\n let { to, attachment, pin } = constraint;\n\n if (isUndefined(attachment)) {\n attachment = '';\n }\n\n let changeAttachX, changeAttachY;\n if (attachment.indexOf(' ') >= 0) {\n [changeAttachY, changeAttachX] = attachment.split(' ');\n } else {\n changeAttachX = changeAttachY = attachment;\n }\n\n const bounds = getBoundingRect(this.bodyElement, this, to);\n\n if (changeAttachY === 'target' || changeAttachY === 'both') {\n if (top < bounds[1] && tAttachment.top === 'top') {\n top += targetHeight;\n tAttachment.top = 'bottom';\n }\n\n if (top + height > bounds[3] && tAttachment.top === 'bottom') {\n top -= targetHeight;\n tAttachment.top = 'top';\n }\n }\n\n if (changeAttachY === 'together') {\n top = _flipYTogether(tAttachment, eAttachment, bounds, height, targetHeight, top);\n }\n\n if (changeAttachX === 'target' || changeAttachX === 'both') {\n if (left < bounds[0] && tAttachment.left === 'left') {\n left += targetWidth;\n tAttachment.left = 'right';\n }\n\n if (left + width > bounds[2] && tAttachment.left === 'right') {\n left -= targetWidth;\n tAttachment.left = 'left';\n }\n }\n\n if (changeAttachX === 'together') {\n left = _flipXTogether(tAttachment, eAttachment, bounds, width, targetWidth, left);\n }\n\n if (changeAttachY === 'element' || changeAttachY === 'both') {\n if (top < bounds[1] && eAttachment.top === 'bottom') {\n top += height;\n eAttachment.top = 'top';\n }\n\n if (top + height > bounds[3] && eAttachment.top === 'top') {\n top -= height;\n eAttachment.top = 'bottom';\n }\n }\n\n if (changeAttachX === 'element' || changeAttachX === 'both') {\n if (left < bounds[0]) {\n if (eAttachment.left === 'right') {\n left += width;\n eAttachment.left = 'left';\n } else if (eAttachment.left === 'center') {\n left += (width / 2);\n eAttachment.left = 'left';\n }\n }\n\n if (left + width > bounds[2]) {\n if (eAttachment.left === 'left') {\n left -= width;\n eAttachment.left = 'right';\n } else if (eAttachment.left === 'center') {\n left -= (width / 2);\n eAttachment.left = 'right';\n }\n }\n }\n\n if (isString(pin)) {\n pin = pin.split(',').map((p) => p.trim());\n } else if (pin === true) {\n pin = ['top', 'left', 'right', 'bottom'];\n }\n\n pin = pin || [];\n\n const pinned = [];\n const oob = [];\n\n left = _calculateOOBAndPinnedLeft(left, bounds, width, pin, pinned, oob);\n top = _calculateOOBAndPinnedTop(top, bounds, height, pin, pinned, oob);\n\n if (pinned.length) {\n let pinnedClass;\n if (!isUndefined(this.options.pinnedClass)) {\n pinnedClass = this.options.pinnedClass;\n } else {\n pinnedClass = getClass('pinned', classes, classPrefix);\n }\n\n addClasses.push(pinnedClass);\n pinned.forEach((side) => {\n addClasses.push(`${pinnedClass}-${side}`);\n });\n }\n\n _addOutOfBoundsClass(oob, addClasses, classes, classPrefix, this.options.outOfBoundsClass);\n\n if (pinned.indexOf('left') >= 0 || pinned.indexOf('right') >= 0) {\n eAttachment.left = tAttachment.left = false;\n }\n if (pinned.indexOf('top') >= 0 || pinned.indexOf('bottom') >= 0) {\n eAttachment.top = tAttachment.top = false;\n }\n\n if (tAttachment.top !== targetAttachment.top ||\n tAttachment.left !== targetAttachment.left ||\n eAttachment.top !== this.attachment.top ||\n eAttachment.left !== this.attachment.left) {\n this.updateAttachClasses(eAttachment, tAttachment);\n this.trigger('update', {\n attachment: eAttachment,\n targetAttachment: tAttachment\n });\n }\n });\n\n defer(() => {\n if (!(this.options.addTargetClasses === false)) {\n updateClasses(this.target, addClasses, allClasses);\n }\n updateClasses(this.element, addClasses, allClasses);\n });\n\n return { top, left };\n }\n};\n","import { isFunction, isString } from './utils/type-check';\n\nexport default {\n position({ top, left }) {\n if (!this.options.shift) {\n return;\n }\n\n let { shift } = this.options;\n if (isFunction(shift)) {\n shift = shift.call(this, { top, left });\n }\n\n let shiftTop, shiftLeft;\n if (isString(shift)) {\n shift = shift.split(' ');\n shift[1] = shift[1] || shift[0];\n\n ([shiftTop, shiftLeft] = shift);\n\n shiftTop = parseFloat(shiftTop, 10);\n shiftLeft = parseFloat(shiftLeft, 10);\n } else {\n ([shiftTop, shiftLeft] = [shift.top, shift.left]);\n }\n\n top += shiftTop;\n left += shiftLeft;\n\n return { top, left };\n }\n};\n","import { isUndefined } from './utils/type-check';\n\nexport class Evented {\n on(event, handler, ctx, once = false) {\n if (isUndefined(this.bindings)) {\n this.bindings = {};\n }\n if (isUndefined(this.bindings[event])) {\n this.bindings[event] = [];\n }\n this.bindings[event].push({ handler, ctx, once });\n\n return this;\n }\n\n once(event, handler, ctx) {\n return this.on(event, handler, ctx, true);\n }\n\n off(event, handler) {\n if (isUndefined(this.bindings) ||\n isUndefined(this.bindings[event])) {\n return this;\n }\n\n if (isUndefined(handler)) {\n delete this.bindings[event];\n } else {\n this.bindings[event].forEach((binding, index) => {\n if (binding.handler === handler) {\n this.bindings[event].splice(index, 1);\n }\n });\n }\n\n return this;\n }\n\n trigger(event, ...args) {\n if (!isUndefined(this.bindings) && this.bindings[event]) {\n this.bindings[event].forEach((binding, index) => {\n const { ctx, handler, once } = binding;\n\n const context = ctx || this;\n\n handler.apply(context, args);\n\n if (once) {\n this.bindings[event].splice(index, 1);\n }\n });\n }\n\n return this;\n }\n}\n","import { isString, isUndefined } from './type-check';\n\nconst MIRROR_LR = {\n center: 'center',\n left: 'right',\n right: 'left'\n};\n\nconst MIRROR_TB = {\n middle: 'middle',\n top: 'bottom',\n bottom: 'top'\n};\n\nconst OFFSET_MAP = {\n top: 0,\n left: 0,\n middle: '50%',\n center: '50%',\n bottom: '100%',\n right: '100%'\n};\n\nexport function addOffset(...offsets) {\n const out = { top: 0, left: 0 };\n\n offsets.forEach(({ top, left }) => {\n if (isString(top)) {\n top = parseFloat(top);\n }\n if (isString(left)) {\n left = parseFloat(left);\n }\n\n out.top += top;\n out.left += left;\n });\n\n return out;\n}\n\nexport function attachmentToOffset(attachment) {\n let { left, top } = attachment;\n\n if (!isUndefined(OFFSET_MAP[attachment.left])) {\n left = OFFSET_MAP[attachment.left];\n }\n\n if (!isUndefined(OFFSET_MAP[attachment.top])) {\n top = OFFSET_MAP[attachment.top];\n }\n\n return { left, top };\n}\n\nexport function autoToFixedAttachment(attachment, relativeToAttachment) {\n let { left, top } = attachment;\n\n if (left === 'auto') {\n left = MIRROR_LR[relativeToAttachment.left];\n }\n\n if (top === 'auto') {\n top = MIRROR_TB[relativeToAttachment.top];\n }\n\n return { left, top };\n}\n\nexport function offsetToPx(offset, size) {\n if (isString(offset.left) && offset.left.indexOf('%') !== -1) {\n offset.left = parseFloat(offset.left) / 100 * size.width;\n }\n if (isString(offset.top) && offset.top.indexOf('%') !== -1) {\n offset.top = parseFloat(offset.top) / 100 * size.height;\n }\n\n return offset;\n}\n\nexport function parseTopLeft(value) {\n const [top, left] = value.split(' ');\n return { top, left };\n}\n","import { isUndefined } from './type-check';\n\nexport function getScrollParents(el) {\n // In firefox if the el is inside an iframe with display: none; window.getComputedStyle() will return null;\n // https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n const computedStyle = getComputedStyle(el) || {};\n const { position } = computedStyle;\n let parents = [];\n\n if (position === 'fixed') {\n return [el];\n }\n\n let parent = el;\n while ((parent = parent.parentNode) && parent && parent.nodeType === 1) {\n let style;\n try {\n style = getComputedStyle(parent);\n } catch(err) {\n // Intentionally blank\n }\n\n if (isUndefined(style) || style === null) {\n parents.push(parent);\n return parents;\n }\n\n const { overflow, overflowX, overflowY } = style;\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n if (position !== 'absolute' || ['relative', 'absolute', 'fixed'].indexOf(style.position) >= 0) {\n parents.push(parent);\n }\n }\n }\n\n parents.push(el.ownerDocument.body);\n\n // If the node is within a frame, account for the parent window scroll\n if (el.ownerDocument !== document) {\n parents.push(el.ownerDocument.defaultView);\n }\n\n return parents;\n}\n\nexport function getOffsetParent(el) {\n return el.offsetParent || document.documentElement;\n}\n","import '../css/tether.scss';\nimport '../css/tether-theme-arrows.scss';\nimport '../css/tether-theme-arrows-dark.scss';\nimport '../css/tether-theme-basic.scss';\nimport Abutment from './abutment';\nimport Constraint from './constraint';\nimport Shift from './shift';\nimport { Evented } from './evented';\nimport { addClass, getClass, removeClass, updateClasses } from './utils/classes';\nimport { defer, flush } from './utils/deferred';\nimport { extend, getScrollBarSize } from './utils/general';\nimport { addOffset, attachmentToOffset, autoToFixedAttachment, offsetToPx, parseTopLeft } from './utils/offset';\nimport { getBounds, getScrollHandleBounds, getVisibleBounds, removeUtilElements } from './utils/bounds';\nimport { getOffsetParent, getScrollParents } from './utils/parents';\nimport { isNumber, isObject, isString, isUndefined } from './utils/type-check';\n\nconst TetherBase = { modules: [Constraint, Abutment, Shift] };\n\nfunction isFullscreenElement(e) {\n let d = e.ownerDocument;\n let fe = d.fullscreenElement || d.webkitFullscreenElement || d.mozFullScreenElement || d.msFullscreenElement;\n return fe === e;\n}\n\nfunction within(a, b, diff = 1) {\n return (a + diff >= b && b >= a - diff);\n}\n\nconst transformKey = (() => {\n if (isUndefined(document)) {\n return '';\n }\n const el = document.createElement('div');\n\n const transforms = ['transform', 'WebkitTransform', 'OTransform', 'MozTransform', 'msTransform'];\n for (let i = 0; i < transforms.length; ++i) {\n const key = transforms[i];\n if (el.style[key] !== undefined) {\n return key;\n }\n }\n})();\n\nconst tethers = [];\n\nconst position = () => {\n tethers.forEach((tether) => {\n tether.position(false);\n });\n flush();\n};\n\nfunction now() {\n return performance.now();\n}\n\n(() => {\n let lastCall = null;\n let lastDuration = null;\n let pendingTimeout = null;\n\n const tick = () => {\n if (!isUndefined(lastDuration) && lastDuration > 16) {\n // We voluntarily throttle ourselves if we can't manage 60fps\n lastDuration = Math.min(lastDuration - 16, 250);\n\n // Just in case this is the last event, remember to position just once more\n pendingTimeout = setTimeout(tick, 250);\n return;\n }\n\n if (!isUndefined(lastCall) && (now() - lastCall) < 10) {\n // Some browsers call events a little too frequently, refuse to run more than is reasonable\n return;\n }\n\n if (pendingTimeout != null) {\n clearTimeout(pendingTimeout);\n pendingTimeout = null;\n }\n\n lastCall = now();\n position();\n lastDuration = now() - lastCall;\n };\n\n if (!isUndefined(window) && !isUndefined(window.addEventListener)) {\n ['resize', 'scroll', 'touchmove'].forEach((event) => {\n window.addEventListener(event, tick);\n });\n }\n})();\n\nclass TetherClass extends Evented {\n constructor(options) {\n super();\n this.position = this.position.bind(this);\n\n tethers.push(this);\n\n this.history = [];\n\n this.setOptions(options, false);\n\n TetherBase.modules.forEach((module) => {\n if (!isUndefined(module.initialize)) {\n module.initialize.call(this);\n }\n });\n\n this.position();\n }\n\n setOptions(options, pos = true) {\n const defaults = {\n offset: '0 0',\n targetOffset: '0 0',\n targetAttachment: 'auto auto',\n classPrefix: 'tether',\n bodyElement: document.body\n };\n\n this.options = extend(defaults, options);\n\n let { element, target, targetModifier, bodyElement } = this.options;\n this.element = element;\n this.target = target;\n this.targetModifier = targetModifier;\n\n if (typeof bodyElement === 'string') {\n bodyElement = document.querySelector(bodyElement);\n }\n this.bodyElement = bodyElement;\n\n if (this.target === 'viewport') {\n this.target = document.body;\n this.targetModifier = 'visible';\n } else if (this.target === 'scroll-handle') {\n this.target = document.body;\n this.targetModifier = 'scroll-handle';\n }\n\n ['element', 'target'].forEach((key) => {\n if (isUndefined(this[key])) {\n throw new Error('Tether Error: Both element and target must be defined');\n }\n\n if (!isUndefined(this[key].jquery)) {\n this[key] = this[key][0];\n } else if (isString(this[key])) {\n this[key] = document.querySelector(this[key]);\n }\n });\n\n this._addClasses();\n\n if (!this.options.attachment) {\n throw new Error('Tether Error: You must provide an attachment');\n }\n\n this.targetAttachment = parseTopLeft(this.options.targetAttachment);\n this.attachment = parseTopLeft(this.options.attachment);\n this.offset = parseTopLeft(this.options.offset);\n this.targetOffset = parseTopLeft(this.options.targetOffset);\n\n if (!isUndefined(this.scrollParents)) {\n this.disable();\n }\n\n if (this.targetModifier === 'scroll-handle') {\n this.scrollParents = [this.target];\n } else {\n this.scrollParents = getScrollParents(this.target);\n }\n\n if (!(this.options.enabled === false)) {\n this.enable(pos);\n }\n }\n\n getTargetBounds() {\n if (!isUndefined(this.targetModifier)) {\n if (this.targetModifier === 'visible') {\n return getVisibleBounds(this.bodyElement, this.target);\n } else if (this.targetModifier === 'scroll-handle') {\n return getScrollHandleBounds(this.bodyElement, this.target);\n }\n } else {\n return getBounds(this.bodyElement, this.target);\n }\n }\n\n clearCache() {\n this._cache = {};\n }\n\n cache(k, getter) {\n // More than one module will often need the same DOM info, so\n // we keep a cache which is cleared on each position call\n if (isUndefined(this._cache)) {\n this._cache = {};\n }\n\n if (isUndefined(this._cache[k])) {\n this._cache[k] = getter.call(this);\n }\n\n return this._cache[k];\n }\n\n enable(pos = true) {\n const { classes, classPrefix } = this.options;\n if (!(this.options.addTargetClasses === false)) {\n addClass(this.target, getClass('enabled', classes, classPrefix));\n }\n addClass(this.element, getClass('enabled', classes, classPrefix));\n this.enabled = true;\n\n this.scrollParents.forEach((parent) => {\n if (parent !== this.target.ownerDocument) {\n parent.addEventListener('scroll', this.position);\n }\n });\n\n if (pos) {\n this.position();\n }\n }\n\n disable() {\n const { classes, classPrefix } = this.options;\n removeClass(this.target, getClass('enabled', classes, classPrefix));\n removeClass(this.element, getClass('enabled', classes, classPrefix));\n this.enabled = false;\n\n if (!isUndefined(this.scrollParents)) {\n this.scrollParents.forEach((parent) => {\n parent.removeEventListener('scroll', this.position);\n });\n }\n }\n\n destroy() {\n this.disable();\n\n this._removeClasses();\n\n tethers.forEach((tether, i) => {\n if (tether === this) {\n tethers.splice(i, 1);\n }\n });\n\n // Remove any elements we were using for convenience from the DOM\n if (tethers.length === 0) {\n removeUtilElements(this.bodyElement);\n }\n }\n\n updateAttachClasses(elementAttach, targetAttach) {\n elementAttach = elementAttach || this.attachment;\n targetAttach = targetAttach || this.targetAttachment;\n const sides = ['left', 'top', 'bottom', 'right', 'middle', 'center'];\n const { classes, classPrefix } = this.options;\n\n if (!isUndefined(this._addAttachClasses) && this._addAttachClasses.length) {\n // updateAttachClasses can be called more than once in a position call, so\n // we need to clean up after ourselves such that when the last defer gets\n // ran it doesn't add any extra classes from previous calls.\n this._addAttachClasses.splice(0, this._addAttachClasses.length);\n }\n\n if (isUndefined(this._addAttachClasses)) {\n this._addAttachClasses = [];\n }\n this.add = this._addAttachClasses;\n\n if (elementAttach.top) {\n this.add.push(`${getClass('element-attached', classes, classPrefix)}-${elementAttach.top}`);\n }\n if (elementAttach.left) {\n this.add.push(`${getClass('element-attached', classes, classPrefix)}-${elementAttach.left}`);\n }\n if (targetAttach.top) {\n this.add.push(`${getClass('target-attached', classes, classPrefix)}-${targetAttach.top}`);\n }\n if (targetAttach.left) {\n this.add.push(`${getClass('target-attached', classes, classPrefix)}-${targetAttach.left}`);\n }\n\n this.all = [];\n sides.forEach((side) => {\n this.all.push(`${getClass('element-attached', classes, classPrefix)}-${side}`);\n this.all.push(`${getClass('target-attached', classes, classPrefix)}-${side}`);\n });\n\n defer(() => {\n if (isUndefined(this._addAttachClasses)) {\n return;\n }\n\n updateClasses(this.element, this._addAttachClasses, this.all);\n if (!(this.options.addTargetClasses === false)) {\n updateClasses(this.target, this._addAttachClasses, this.all);\n }\n\n delete this._addAttachClasses;\n });\n }\n\n position(flushChanges = true) {\n // flushChanges commits the changes immediately, leave true unless you are positioning multiple\n // tethers (in which case call Tether.Utils.flush yourself when you're done)\n\n if (!this.enabled) {\n return;\n }\n\n this.clearCache();\n\n // Turn 'auto' attachments into the appropriate corner or edge\n const targetAttachment = autoToFixedAttachment(this.targetAttachment, this.attachment);\n\n this.updateAttachClasses(this.attachment, targetAttachment);\n\n const elementPos = this.cache('element-bounds', () => {\n return getBounds(this.bodyElement, this.element);\n });\n\n let { width, height } = elementPos;\n\n if (width === 0 && height === 0 && !isUndefined(this.lastSize)) {\n // We cache the height and width to make it possible to position elements that are\n // getting hidden.\n ({ width, height } = this.lastSize);\n } else {\n this.lastSize = { width, height };\n }\n\n const targetPos = this.cache('target-bounds', () => {\n return this.getTargetBounds();\n });\n const targetSize = targetPos;\n\n // Get an actual px offset from the attachment\n let offset = offsetToPx(attachmentToOffset(this.attachment), { width, height });\n let targetOffset = offsetToPx(attachmentToOffset(targetAttachment), targetSize);\n\n const manualOffset = offsetToPx(this.offset, { width, height });\n const manualTargetOffset = offsetToPx(this.targetOffset, targetSize);\n\n // Add the manually provided offset\n offset = addOffset(offset, manualOffset);\n targetOffset = addOffset(targetOffset, manualTargetOffset);\n\n // It's now our goal to make (element position + offset) == (target position + target offset)\n let left = targetPos.left + targetOffset.left - offset.left;\n let top = targetPos.top + targetOffset.top - offset.top;\n\n for (let i = 0; i < TetherBase.modules.length; ++i) {\n const module = TetherBase.modules[i];\n const ret = module.position.call(this, {\n left,\n top,\n targetAttachment,\n targetPos,\n elementPos,\n offset,\n targetOffset,\n manualOffset,\n manualTargetOffset,\n scrollbarSize,\n attachment: this.attachment\n });\n\n if (ret === false) {\n return false;\n } else if (isUndefined(ret) || !isObject(ret)) {\n continue;\n } else {\n ({ top, left } = ret);\n }\n }\n\n // We describe the position three different ways to give the optimizer\n // a chance to decide the best possible way to position the element\n // with the fewest repaints.\n const next = {\n // It's position relative to the page (absolute positioning when\n // the element is a child of the body)\n page: {\n top,\n left\n },\n\n // It's position relative to the viewport (fixed positioning)\n viewport: {\n top: top - pageYOffset,\n bottom: pageYOffset - top - height + innerHeight,\n left: left - pageXOffset,\n right: pageXOffset - left - width + innerWidth\n }\n };\n\n let doc = this.target.ownerDocument;\n let win = doc.defaultView;\n\n let scrollbarSize;\n if (win.innerHeight > doc.documentElement.clientHeight) {\n scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);\n next.viewport.bottom -= scrollbarSize.height;\n }\n\n if (win.innerWidth > doc.documentElement.clientWidth) {\n scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);\n next.viewport.right -= scrollbarSize.width;\n }\n\n if (['', 'static'].indexOf(doc.body.style.position) === -1 ||\n ['', 'static'].indexOf(doc.body.parentElement.style.position) === -1) {\n // Absolute positioning in the body will be relative to the page, not the 'initial containing block'\n next.page.bottom = doc.body.scrollHeight - top - height;\n next.page.right = doc.body.scrollWidth - left - width;\n }\n\n if (!isUndefined(this.options.optimizations) &&\n this.options.optimizations.moveElement !== false &&\n isUndefined(this.targetModifier)) {\n const offsetParent = this.cache('target-offsetparent', () => getOffsetParent(this.target));\n const offsetPosition = this.cache('target-offsetparent-bounds', () => getBounds(this.bodyElement, offsetParent));\n const offsetParentStyle = getComputedStyle(offsetParent);\n const offsetParentSize = offsetPosition;\n\n const offsetBorder = {};\n ['Top', 'Left', 'Bottom', 'Right'].forEach((side) => {\n offsetBorder[side.toLowerCase()] = parseFloat(offsetParentStyle[`border${side}Width`]);\n });\n\n offsetPosition.right = doc.body.scrollWidth - offsetPosition.left - offsetParentSize.width + offsetBorder.right;\n offsetPosition.bottom = doc.body.scrollHeight - offsetPosition.top - offsetParentSize.height + offsetBorder.bottom;\n\n if (next.page.top >= (offsetPosition.top + offsetBorder.top) && next.page.bottom >= offsetPosition.bottom) {\n if (next.page.left >= (offsetPosition.left + offsetBorder.left) && next.page.right >= offsetPosition.right) {\n // We're within the visible part of the target's scroll parent\n const { scrollLeft, scrollTop } = offsetParent;\n\n // It's position relative to the target's offset parent (absolute positioning when\n // the element is moved to be a child of the target's offset parent).\n next.offset = {\n top: next.page.top - offsetPosition.top + scrollTop - offsetBorder.top,\n left: next.page.left - offsetPosition.left + scrollLeft - offsetBorder.left\n };\n }\n }\n }\n\n // We could also travel up the DOM and try each containing context, rather than only\n // looking at the body, but we're gonna get diminishing returns.\n\n this.move(next);\n\n this.history.unshift(next);\n\n if (this.history.length > 3) {\n this.history.pop();\n }\n\n if (flushChanges) {\n flush();\n }\n\n return true;\n }\n\n // THE ISSUE\n move(pos) {\n if (isUndefined(this.element.parentNode)) {\n return;\n }\n\n const same = {};\n\n for (let type in pos) {\n same[type] = {};\n\n for (let key in pos[type]) {\n let found = false;\n\n for (let i = 0; i < this.history.length; ++i) {\n const point = this.history[i];\n if (!isUndefined(point[type]) &&\n !within(point[type][key], pos[type][key])) {\n found = true;\n break;\n }\n\n }\n\n if (!found) {\n same[type][key] = true;\n }\n }\n }\n\n let css = { top: '', left: '', right: '', bottom: '' };\n\n const transcribe = (_same, _pos) => {\n const hasOptimizations = !isUndefined(this.options.optimizations);\n const gpu = hasOptimizations ? this.options.optimizations.gpu : null;\n if (gpu !== false) {\n let yPos, xPos;\n if (_same.top) {\n css.top = 0;\n yPos = _pos.top;\n } else {\n css.bottom = 0;\n yPos = -_pos.bottom;\n }\n\n if (_same.left) {\n css.left = 0;\n xPos = _pos.left;\n } else {\n css.right = 0;\n xPos = -_pos.right;\n }\n\n if (isNumber(window.devicePixelRatio) && devicePixelRatio % 1 === 0) {\n xPos = Math.round(xPos * devicePixelRatio) / devicePixelRatio;\n yPos = Math.round(yPos * devicePixelRatio) / devicePixelRatio;\n }\n\n css[transformKey] = `translateX(${xPos}px) translateY(${yPos}px)`;\n\n if (transformKey !== 'msTransform') {\n // The Z transform will keep this in the GPU (faster, and prevents artifacts),\n // but IE9 doesn't support 3d transforms and will choke.\n css[transformKey] += ' translateZ(0)';\n }\n\n } else {\n if (_same.top) {\n css.top = `${_pos.top}px`;\n } else {\n css.bottom = `${_pos.bottom}px`;\n }\n\n if (_same.left) {\n css.left = `${_pos.left}px`;\n } else {\n css.right = `${_pos.right}px`;\n }\n }\n };\n\n const hasOptimizations = !isUndefined(this.options.optimizations);\n let allowPositionFixed = true;\n\n if (hasOptimizations && this.options.optimizations.allowPositionFixed === false) {\n allowPositionFixed = false;\n }\n\n let moved = false;\n if ((same.page.top || same.page.bottom) && (same.page.left || same.page.right)) {\n css.position = 'absolute';\n transcribe(same.page, pos.page);\n\n } else if (allowPositionFixed && (same.viewport.top || same.viewport.bottom) && (same.viewport.left || same.viewport.right)) {\n css.position = 'fixed';\n transcribe(same.viewport, pos.viewport);\n } else if (!isUndefined(same.offset) && same.offset.top && same.offset.left) {\n css.position = 'absolute';\n const offsetParent = this.cache('target-offsetparent', () => getOffsetParent(this.target));\n\n if (getOffsetParent(this.element) !== offsetParent) {\n defer(() => {\n this.element.parentNode.removeChild(this.element);\n offsetParent.appendChild(this.element);\n });\n }\n\n transcribe(same.offset, pos.offset);\n moved = true;\n\n } else {\n css.position = 'absolute';\n transcribe({ top: true, left: true }, pos.page);\n }\n\n if (!moved) {\n if (this.options.bodyElement) {\n if (this.element.parentNode !== this.options.bodyElement) {\n this.options.bodyElement.appendChild(this.element);\n }\n } else {\n let offsetParentIsBody = true;\n\n let currentNode = this.element.parentNode;\n while (currentNode && currentNode.nodeType === 1 && currentNode.tagName !== 'BODY' && !isFullscreenElement(currentNode)) {\n if (getComputedStyle(currentNode).position !== 'static') {\n offsetParentIsBody = false;\n break;\n }\n\n currentNode = currentNode.parentNode;\n }\n\n if (!offsetParentIsBody) {\n this.element.parentNode.removeChild(this.element);\n this.element.ownerDocument.body.appendChild(this.element);\n }\n }\n }\n\n // Any css change will trigger a repaint, so let's avoid one if nothing changed\n const writeCSS = {};\n let write = false;\n for (let key in css) {\n let val = css[key];\n let elVal = this.element.style[key];\n\n if (elVal !== val) {\n write = true;\n writeCSS[key] = val;\n }\n }\n\n if (write) {\n defer(() => {\n extend(this.element.style, writeCSS);\n this.trigger('repositioned');\n });\n }\n }\n\n _addClasses() {\n const { classes, classPrefix } = this.options;\n addClass(this.element, getClass('element', classes, classPrefix));\n if (!(this.options.addTargetClasses === false)) {\n addClass(this.target, getClass('target', classes, classPrefix));\n }\n }\n\n _removeClasses() {\n const { classes, classPrefix } = this.options;\n removeClass(this.element, getClass('element', classes, classPrefix));\n if (!(this.options.addTargetClasses === false)) {\n removeClass(this.target, getClass('target', classes, classPrefix));\n }\n\n this.all.forEach((className) => {\n this.element.classList.remove(className);\n this.target.classList.remove(className);\n });\n }\n}\n\nTetherClass.modules = [];\n\nTetherBase.position = position;\n\nlet Tether = extend(TetherClass, TetherBase);\n\nTether.modules.push({\n initialize() {\n const { classes, classPrefix } = this.options;\n this.markers = {};\n\n ['target', 'element'].forEach((type) => {\n const el = document.createElement('div');\n el.className = getClass(`${type}-marker`, classes, classPrefix);\n\n const dot = document.createElement('div');\n dot.className = getClass('marker-dot', classes, classPrefix);\n el.appendChild(dot);\n\n this[type].appendChild(el);\n\n this.markers[type] = { dot, el };\n });\n },\n\n position({ manualOffset, manualTargetOffset }) {\n const offsets = {\n element: manualOffset,\n target: manualTargetOffset\n };\n\n for (let type in offsets) {\n const offset = offsets[type];\n for (let side in offset) {\n let val = offset[side];\n if (!isString(val) ||\n val.indexOf('%') === -1 &&\n val.indexOf('px') === -1) {\n val += 'px';\n }\n\n if (this.markers[type].dot.style[side] !== val) {\n this.markers[type].dot.style[side] = val;\n }\n }\n }\n\n return true;\n }\n});\n\nexport default Tether;\n"],"names":["isFunction","value","isNumber","isObject","isString","isUndefined","undefined","addClass","el","name","split","forEach","cls","trim","classList","add","getClass","key","classes","classPrefix","removeClass","remove","updateClasses","all","indexOf","contains","deferred","defer","fn","push","flush","pop","_scrollBarSize","extend","out","args","Array","prototype","apply","arguments","slice","obj","hasOwnProperty","call","getScrollBarSize","inner","document","createElement","style","width","height","outer","position","top","left","pointerEvents","visibility","overflow","appendChild","body","widthContained","offsetWidth","widthScroll","clientWidth","removeChild","uniqueId","id","zeroPosCache","zeroElement","getBounds","doc","documentElement","ownerDocument","docEl","box","_getActualBoundingClientRect","origin","_getOrigin","scrollWidth","right","scrollHeight","bottom","clientTop","clientLeft","clientHeight","getScrollHandleBounds","target","bounds","targetScrollTop","scrollTop","targetIsBody","pageXOffset","pageYOffset","innerHeight","innerWidth","getComputedStyle","hasBottomScroll","overflowX","scrollBottom","parseFloat","borderTopWidth","borderBottomWidth","borderLeftWidth","fitAdj","Math","pow","max","scrollPercentage","getVisibleBounds","min","removeUtilElements","node","boundingRect","getBoundingClientRect","rect","k","frameElement","defaultView","frameRect","err","setAttribute","getAttribute","cache","element","targetPos","getTargetBounds","abutted","side","targetPosSide","sides","options","length","addTargetClasses","BOUNDS_FORMAT","getBoundingRect","tether","to","scrollParents","nodeType","size","pos","win","i","toUpperCase","substr","_addOutOfBoundsClass","oob","addClasses","outOfBoundsClass","oobClass","_calculateOOBAndPinnedLeft","pin","pinned","_calculateOOBAndPinnedTop","_flipXTogether","tAttachment","eAttachment","targetWidth","_flipYTogether","targetHeight","_getAllClasses","constraints","allClasses","constraint","pinnedClass","targetAttachment","bodyElement","lastSize","targetSize","attachment","changeAttachX","changeAttachY","map","p","updateAttachClasses","trigger","shift","shiftTop","shiftLeft","Evented","on","event","handler","ctx","once","bindings","off","binding","index","splice","context","MIRROR_LR","center","MIRROR_TB","middle","OFFSET_MAP","addOffset","offsets","attachmentToOffset","autoToFixedAttachment","relativeToAttachment","offsetToPx","offset","parseTopLeft","getScrollParents","computedStyle","parents","parent","parentNode","overflowY","test","getOffsetParent","offsetParent","TetherBase","modules","Constraint","Abutment","Shift","isFullscreenElement","e","d","fe","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","within","a","b","diff","transformKey","transforms","tethers","now","performance","lastCall","lastDuration","pendingTimeout","tick","setTimeout","clearTimeout","window","addEventListener","TetherClass","bind","history","setOptions","module","initialize","defaults","targetOffset","targetModifier","querySelector","Error","jquery","_addClasses","disable","enabled","enable","clearCache","_cache","getter","removeEventListener","destroy","_removeClasses","elementAttach","targetAttach","_addAttachClasses","flushChanges","elementPos","manualOffset","manualTargetOffset","ret","scrollbarSize","next","page","viewport","parentElement","optimizations","moveElement","offsetPosition","offsetParentStyle","offsetParentSize","offsetBorder","toLowerCase","scrollLeft","move","unshift","same","type","found","point","css","transcribe","_same","_pos","hasOptimizations","gpu","yPos","xPos","devicePixelRatio","round","allowPositionFixed","moved","offsetParentIsBody","currentNode","tagName","writeCSS","write","val","elVal","className","Tether","markers","dot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAAA;;;;AAIA,EAAO,SAASA,UAAT,CAAoBC,KAApB,EAA2B;EAChC,SAAO,OAAOA,KAAP,KAAiB,UAAxB;EACD;EAED;;;;;AAIA,EAAO,SAASC,QAAT,CAAkBD,KAAlB,EAAyB;EAC9B,SAAO,OAAOA,KAAP,KAAiB,QAAxB;EACD;EAED;;;;;AAIA,EAAO,SAASE,QAAT,CAAkBF,KAAlB,EAAyB;EAC9B,SAAO,OAAOA,KAAP,KAAiB,QAAxB;EACD;EAED;;;;;AAIA,EAAO,SAASG,QAAT,CAAkBH,KAAlB,EAAyB;EAC9B,SAAO,OAAOA,KAAP,KAAiB,QAAxB;EACD;EAED;;;;;AAIA,EAAO,SAASI,WAAT,CAAqBJ,KAArB,EAA4B;EACjC,SAAOA,KAAK,KAAKK,SAAjB;EACD;;ECpCM,SAASC,QAAT,CAAkBC,EAAlB,EAAsBC,IAAtB,EAA4B;EACjCA,EAAAA,IAAI,CAACC,KAAL,CAAW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