/
www
/
wwwroot
/
alo88.autos
/
wp-content
/
plugins
/
wp-content-crawler
/
app
/
public
/
node_modules
/
shepherd.js
/
dist
/
js
/
Upload File
HOME
{"version":3,"file":"shepherd.js","sources":["../../node_modules/tether/src/js/utils/type-check.js","../../node_modules/tether/src/js/evented.js","../../src/js/utils/auto-bind.js","../../src/js/utils/type-check.js","../../src/js/utils/bind.js","../../node_modules/tether/dist/js/tether.esm.js","../../src/js/utils/general.js","../../node_modules/svelte/internal/index.mjs","../../src/js/components/shepherd-button.svelte","../../src/js/components/shepherd-footer.svelte","../../src/js/components/shepherd-cancel-icon.svelte","../../src/js/components/shepherd-title.svelte","../../src/js/components/shepherd-header.svelte","../../src/js/components/shepherd-text.svelte","../../src/js/components/shepherd-content.svelte","../../src/js/components/shepherd-element.svelte","../../node_modules/smoothscroll-polyfill/dist/smoothscroll.js","../../src/js/step.js","../../src/js/utils/cleanup.js","../../src/js/components/shepherd-modal.svelte","../../src/js/tour.js","../../src/js/shepherd.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 './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","/**\n * Binds all the methods on a JS Class to the `this` context of the class.\n * Adapted from https://github.com/sindresorhus/auto-bind\n * @param {object} self The `this` context of the class\n * @return {object} The `this` context of the class\n */\nexport default function autoBind(self) {\n const keys = Object.getOwnPropertyNames(self.constructor.prototype);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const val = self[key];\n if (key !== 'constructor' && typeof val === 'function') {\n self[key] = val.bind(self);\n }\n }\n\n return self;\n}\n","/**\n * Checks if `value` is classified as an `HTMLElement`.\n * @param {*} value The param to check if it is an HTMLElement\n */\nexport function isElement(value) {\n return value instanceof HTMLElement;\n}\n\n/**\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 `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\n/**\n * Sets up the handler to determine if we should advance the tour\n * @param {string} selector\n * @param {Step} step The step instance\n * @return {Function}\n * @private\n */\nfunction _setupAdvanceOnHandler(selector, step) {\n return (event) => {\n if (step.isOpen()) {\n const targetIsEl = step.el && event.currentTarget === step.el;\n const targetIsSelector = !isUndefined(selector) && event.currentTarget.matches(selector);\n\n if (targetIsSelector || targetIsEl) {\n step.tour.next();\n }\n }\n };\n}\n\n/**\n * Bind the event handler for advanceOn\n * @param {Step} step The step instance\n */\nexport function bindAdvance(step) {\n // An empty selector matches the step element\n const { event, selector } = step.options.advanceOn || {};\n if (event) {\n const handler = _setupAdvanceOnHandler(selector, step);\n\n // TODO: this should also bind/unbind on show/hide\n let el;\n try {\n el = document.querySelector(selector);\n } catch(e) {\n // TODO\n }\n if (!isUndefined(selector) && !el) {\n return console.error(`No element was found for the selector supplied to advanceOn: ${selector}`);\n } else if (el) {\n el.addEventListener(event, handler);\n step.on('destroy', () => {\n return el.removeEventListener(event, handler);\n });\n } else {\n document.body.addEventListener(event, handler, true);\n step.on('destroy', () => {\n return document.body.removeEventListener(event, handler, true);\n });\n }\n } else {\n return console.error('advanceOn was defined, but no event name was passed.');\n }\n}\n","/*! tether 2.0.0-beta.4 */\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n * @param {*} value The param to check if it is a function\n */\nfunction isFunction(value) {\n return typeof value === 'function';\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 */\n\nfunction isNumber(value) {\n return typeof value === 'number';\n}\n/**\n * Checks if `value` is classified as an `Object`.\n * @param {*} value The param to check if it is an object\n */\n\nfunction isObject(value) {\n return typeof value === 'object';\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 */\n\nfunction isString(value) {\n return typeof value === 'string';\n}\n/**\n * Checks if `value` is undefined.\n * @param {*} value The param to check if it is undefined\n */\n\nfunction isUndefined(value) {\n return value === undefined;\n}\n\nfunction addClass(el, name) {\n name.split(' ').forEach(function (cls) {\n if (cls.trim()) {\n el.classList.add(cls);\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 */\n\nfunction getClass(key, classes, classPrefix) {\n if (key === void 0) {\n key = '';\n }\n\n if (!isUndefined(classes) && !isUndefined(classes[key])) {\n if (classes[key] === false) {\n return '';\n }\n\n return classes[key];\n } else if (classPrefix) {\n return classPrefix + \"-\" + key;\n } else {\n return key;\n }\n}\nfunction removeClass(el, name) {\n name.split(' ').forEach(function (cls) {\n if (cls.trim()) {\n el.classList.remove(cls);\n }\n });\n}\nfunction 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(function (cls) {\n if (add.indexOf(cls) === -1 && el.classList.contains(cls)) {\n removeClass(el, cls);\n }\n });\n add.forEach(function (cls) {\n if (!el.classList.contains(cls)) {\n addClass(el, cls);\n }\n });\n}\n\nvar deferred = [];\nfunction defer(fn) {\n deferred.push(fn);\n}\nfunction flush() {\n var fn; // eslint-disable-next-line\n\n while (fn = deferred.pop()) {\n fn();\n }\n}\n\nvar _scrollBarSize = null;\nfunction extend(out) {\n if (out === void 0) {\n out = {};\n }\n\n var args = [];\n Array.prototype.push.apply(args, arguments);\n args.slice(1).forEach(function (obj) {\n if (obj) {\n for (var key in obj) {\n if ({}.hasOwnProperty.call(obj, key)) {\n out[key] = obj[key];\n }\n }\n }\n });\n return out;\n}\nfunction getScrollBarSize() {\n if (_scrollBarSize) {\n return _scrollBarSize;\n }\n\n var inner = document.createElement('div');\n inner.style.width = '100%';\n inner.style.height = '200px';\n var 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 outer.appendChild(inner);\n document.body.appendChild(outer);\n var widthContained = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n var widthScroll = inner.offsetWidth;\n\n if (widthContained === widthScroll) {\n widthScroll = outer.clientWidth;\n }\n\n document.body.removeChild(outer);\n var width = widthContained - widthScroll;\n _scrollBarSize = {\n width: width,\n height: width\n };\n return _scrollBarSize;\n}\nvar uniqueId = function () {\n var id = 0;\n return function () {\n return ++id;\n };\n}();\n\nvar zeroPosCache = {};\nvar zeroElement = null;\nfunction getBounds(el) {\n var doc;\n\n if (el === document) {\n doc = document;\n el = document.documentElement;\n } else {\n doc = el.ownerDocument;\n }\n\n var docEl = doc.documentElement;\n\n var box = _getActualBoundingClientRect(el);\n\n var origin = _getOrigin();\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\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 return box;\n}\n/**\n * Gets bounds for when target modifiier is 'scroll-handle'\n * @param target\n * @return {{left: number, width: number, height: number}}\n */\n\nfunction getScrollHandleBounds(target) {\n var bounds; // 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\n var targetScrollTop = target.scrollTop;\n var targetIsBody = target === document.body;\n\n if (targetIsBody) {\n target = document.documentElement;\n bounds = {\n left: pageXOffset,\n top: pageYOffset,\n height: innerHeight,\n width: innerWidth\n };\n } else {\n bounds = getBounds(target);\n }\n\n var style = getComputedStyle(target);\n var hasBottomScroll = target.scrollWidth > target.clientWidth || [style.overflow, style.overflowX].indexOf('scroll') >= 0 || !targetIsBody;\n var scrollBottom = 0;\n\n if (hasBottomScroll) {\n scrollBottom = 15;\n }\n\n var height = bounds.height - parseFloat(style.borderTopWidth) - parseFloat(style.borderBottomWidth) - scrollBottom;\n var out = {\n width: 15,\n height: height * 0.975 * (height / target.scrollHeight),\n left: bounds.left + bounds.width - parseFloat(style.borderLeftWidth) - 15\n };\n var fitAdj = 0;\n\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 var 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 * Gets bounds for when target modifiier is 'visible\n * @param target\n * @return {{top: *, left: *, width: *, height: *}}\n */\n\nfunction getVisibleBounds(target) {\n if (target === document.body) {\n return {\n top: pageYOffset,\n left: pageXOffset,\n height: innerHeight,\n width: innerWidth\n };\n } else {\n var bounds = getBounds(target);\n var out = {\n height: bounds.height,\n width: bounds.width,\n top: bounds.top,\n left: bounds.left\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 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\n if (out.left < pageXOffset) {\n out.left = pageXOffset;\n }\n\n return out;\n }\n}\nfunction removeUtilElements() {\n if (zeroElement) {\n document.body.removeChild(zeroElement);\n }\n\n zeroElement = null;\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 */\n\nfunction _getActualBoundingClientRect(node) {\n var boundingRect = node.getBoundingClientRect(); // 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\n var rect = {};\n\n for (var k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n try {\n if (node.ownerDocument !== document) {\n var frameElement = node.ownerDocument.defaultView.frameElement;\n\n if (frameElement) {\n var frameRect = _getActualBoundingClientRect(frameElement);\n\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) {// Ignore \"Access is denied\" in IE11/Edge\n }\n\n return rect;\n}\n\nfunction _getOrigin() {\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 var node = zeroElement;\n\n if (!node || !document.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 document.body.appendChild(node);\n zeroElement = node;\n }\n\n var id = node.getAttribute('data-tether-id');\n\n if (isUndefined(zeroPosCache[id])) {\n zeroPosCache[id] = _getActualBoundingClientRect(node); // Clear the cache when this position call is done\n\n defer(function () {\n delete zeroPosCache[id];\n });\n }\n\n return zeroPosCache[id];\n}\n\nvar Abutment = {\n position: function position(_ref) {\n var _this = this;\n\n var top = _ref.top,\n left = _ref.left;\n\n var _this$cache = this.cache('element-bounds', function () {\n return getBounds(_this.element);\n }),\n height = _this$cache.height,\n width = _this$cache.width;\n\n var targetPos = this.getTargetBounds();\n var bottom = top + height;\n var right = left + width;\n var abutted = [];\n\n if (top <= targetPos.bottom && bottom >= targetPos.top) {\n ['left', 'right'].forEach(function (side) {\n var targetPosSide = targetPos[side];\n\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(function (side) {\n var targetPosSide = targetPos[side];\n\n if (targetPosSide === top || targetPosSide === bottom) {\n abutted.push(side);\n }\n });\n }\n\n var sides = ['left', 'top', 'right', 'bottom'];\n var _this$options = this.options,\n classes = _this$options.classes,\n classPrefix = _this$options.classPrefix;\n this.all.push(getClass('abutted', classes, classPrefix));\n sides.forEach(function (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(function (side) {\n _this.add.push(getClass('abutted', classes, classPrefix) + \"-\" + side);\n });\n defer(function () {\n if (!(_this.options.addTargetClasses === false)) {\n updateClasses(_this.target, _this.add, _this.all);\n }\n\n updateClasses(_this.element, _this.add, _this.all);\n });\n return true;\n }\n};\n\nvar BOUNDS_FORMAT = ['left', 'top', 'right', 'bottom'];\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 */\n\nfunction getBoundingRect(tether, to) {\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 var node = to;\n var size = getBounds(to);\n var pos = size;\n var style = getComputedStyle(to);\n to = [pos.left, pos.top, size.width + pos.left, size.height + pos.top]; // Account any parent Frames scroll offset\n\n if (node.ownerDocument !== document) {\n var 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(function (side, i) {\n side = side[0].toUpperCase() + side.substr(1);\n\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 * 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 */\n\n\nfunction _addOutOfBoundsClass(oob, addClasses, classes, classPrefix, outOfBoundsClass) {\n if (oob.length) {\n var oobClass;\n\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(function (side) {\n addClasses.push(oobClass + \"-\" + side);\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 */\n\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 * 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 */\n\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 * 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 */\n\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 left += width;\n eAttachment.left = 'left';\n } else if (eAttachment.left === 'left') {\n left += targetWidth;\n tAttachment.left = 'right';\n left -= width;\n eAttachment.left = 'right';\n }\n } else if (left + width > bounds[2] && tAttachment.left === 'right') {\n if (eAttachment.left === 'left') {\n left -= targetWidth;\n tAttachment.left = 'left';\n left -= width;\n eAttachment.left = 'right';\n } else if (eAttachment.left === 'right') {\n left -= targetWidth;\n tAttachment.left = 'left';\n left += width;\n eAttachment.left = 'left';\n }\n } else if (tAttachment.left === 'center') {\n if (left + width > bounds[2] && eAttachment.left === 'left') {\n left -= width;\n eAttachment.left = 'right';\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 * 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 */\n\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 top += height;\n eAttachment.top = 'top';\n } else if (eAttachment.top === 'top' && top + height > bounds[3] && top - (height - targetHeight) >= bounds[1]) {\n top -= height - targetHeight;\n tAttachment.top = 'bottom';\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 top -= height;\n eAttachment.top = 'bottom';\n } else if (eAttachment.top === 'bottom' && top < bounds[1] && top + (height * 2 - targetHeight) <= bounds[3]) {\n top += height - targetHeight;\n tAttachment.top = 'top';\n eAttachment.top = 'top';\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 } else if (top < bounds[1] && eAttachment.top === 'bottom') {\n top += height;\n eAttachment.top = 'top';\n }\n }\n\n return top;\n}\n/**\n * Get all the initial classes\n * @param classes\n * @param {string} classPrefix\n * @param constraints\n * @return {[*, *]}\n * @private\n */\n\n\nfunction _getAllClasses(classes, classPrefix, constraints) {\n var allClasses = [getClass('pinned', classes, classPrefix), getClass('out-of-bounds', classes, classPrefix)];\n constraints.forEach(function (constraint) {\n var outOfBoundsClass = constraint.outOfBoundsClass,\n pinnedClass = constraint.pinnedClass;\n\n if (outOfBoundsClass) {\n allClasses.push(outOfBoundsClass);\n }\n\n if (pinnedClass) {\n allClasses.push(pinnedClass);\n }\n });\n allClasses.forEach(function (cls) {\n ['left', 'top', 'right', 'bottom'].forEach(function (side) {\n allClasses.push(cls + \"-\" + side);\n });\n });\n return allClasses;\n}\n\nvar Constraint = {\n position: function position(_ref) {\n var _this = this;\n\n var top = _ref.top,\n left = _ref.left,\n targetAttachment = _ref.targetAttachment;\n\n if (!this.options.constraints) {\n return true;\n }\n\n var _this$cache = this.cache('element-bounds', function () {\n return getBounds(_this.element);\n }),\n height = _this$cache.height,\n width = _this$cache.width;\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 var _this$lastSize = this.lastSize;\n width = _this$lastSize.width;\n height = _this$lastSize.height;\n }\n\n var targetSize = this.cache('target-bounds', function () {\n return _this.getTargetBounds();\n });\n var targetHeight = targetSize.height,\n targetWidth = targetSize.width;\n var _this$options = this.options,\n classes = _this$options.classes,\n classPrefix = _this$options.classPrefix;\n\n var allClasses = _getAllClasses(classes, classPrefix, this.options.constraints);\n\n var addClasses = [];\n var tAttachment = extend({}, targetAttachment);\n var eAttachment = extend({}, this.attachment);\n this.options.constraints.forEach(function (constraint) {\n var to = constraint.to,\n attachment = constraint.attachment,\n pin = constraint.pin;\n\n if (isUndefined(attachment)) {\n attachment = '';\n }\n\n var changeAttachX, changeAttachY;\n\n if (attachment.indexOf(' ') >= 0) {\n var _attachment$split = attachment.split(' ');\n\n changeAttachY = _attachment$split[0];\n changeAttachX = _attachment$split[1];\n } else {\n changeAttachX = changeAttachY = attachment;\n }\n\n var bounds = getBoundingRect(_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(function (p) {\n return p.trim();\n });\n } else if (pin === true) {\n pin = ['top', 'left', 'right', 'bottom'];\n }\n\n pin = pin || [];\n var pinned = [];\n var oob = [];\n left = _calculateOOBAndPinnedLeft(left, bounds, width, pin, pinned, oob);\n top = _calculateOOBAndPinnedTop(top, bounds, height, pin, pinned, oob);\n\n if (pinned.length) {\n var pinnedClass;\n\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(function (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\n if (pinned.indexOf('top') >= 0 || pinned.indexOf('bottom') >= 0) {\n eAttachment.top = tAttachment.top = false;\n }\n\n if (tAttachment.top !== targetAttachment.top || tAttachment.left !== targetAttachment.left || eAttachment.top !== _this.attachment.top || eAttachment.left !== _this.attachment.left) {\n _this.updateAttachClasses(eAttachment, tAttachment);\n\n _this.trigger('update', {\n attachment: eAttachment,\n targetAttachment: tAttachment\n });\n }\n });\n defer(function () {\n if (!(_this.options.addTargetClasses === false)) {\n updateClasses(_this.target, addClasses, allClasses);\n }\n\n updateClasses(_this.element, addClasses, allClasses);\n });\n return {\n top: top,\n left: left\n };\n }\n};\n\nvar Shift = {\n position: function position(_ref) {\n var top = _ref.top,\n left = _ref.left;\n\n if (!this.options.shift) {\n return;\n }\n\n var shift = this.options.shift;\n\n if (isFunction(shift)) {\n shift = shift.call(this, {\n top: top,\n left: left\n });\n }\n\n var shiftTop, shiftLeft;\n\n if (isString(shift)) {\n shift = shift.split(' ');\n shift[1] = shift[1] || shift[0];\n var _shift = shift;\n shiftTop = _shift[0];\n shiftLeft = _shift[1];\n shiftTop = parseFloat(shiftTop, 10);\n shiftLeft = parseFloat(shiftLeft, 10);\n } else {\n var _ref2 = [shift.top, shift.left];\n shiftTop = _ref2[0];\n shiftLeft = _ref2[1];\n }\n\n top += shiftTop;\n left += shiftLeft;\n return {\n top: top,\n left: left\n };\n }\n};\n\nvar Evented =\n/*#__PURE__*/\nfunction () {\n function Evented() {}\n\n var _proto = Evented.prototype;\n\n _proto.on = function on(event, handler, ctx, once) {\n if (once === void 0) {\n once = false;\n }\n\n if (isUndefined(this.bindings)) {\n this.bindings = {};\n }\n\n if (isUndefined(this.bindings[event])) {\n this.bindings[event] = [];\n }\n\n this.bindings[event].push({\n handler: handler,\n ctx: ctx,\n once: once\n });\n return this;\n };\n\n _proto.once = function once(event, handler, ctx) {\n return this.on(event, handler, ctx, true);\n };\n\n _proto.off = function off(event, handler) {\n var _this = this;\n\n if (isUndefined(this.bindings) || 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(function (binding, index) {\n if (binding.handler === handler) {\n _this.bindings[event].splice(index, 1);\n }\n });\n }\n\n return this;\n };\n\n _proto.trigger = function trigger(event) {\n var _this2 = this;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (!isUndefined(this.bindings) && this.bindings[event]) {\n this.bindings[event].forEach(function (binding, index) {\n var ctx = binding.ctx,\n handler = binding.handler,\n once = binding.once;\n var context = ctx || _this2;\n handler.apply(context, args);\n\n if (once) {\n _this2.bindings[event].splice(index, 1);\n }\n });\n }\n\n return this;\n };\n\n return Evented;\n}();\n\nvar MIRROR_LR = {\n center: 'center',\n left: 'right',\n right: 'left'\n};\nvar MIRROR_TB = {\n middle: 'middle',\n top: 'bottom',\n bottom: 'top'\n};\nvar OFFSET_MAP = {\n top: 0,\n left: 0,\n middle: '50%',\n center: '50%',\n bottom: '100%',\n right: '100%'\n};\nfunction addOffset() {\n var out = {\n top: 0,\n left: 0\n };\n\n for (var _len = arguments.length, offsets = new Array(_len), _key = 0; _key < _len; _key++) {\n offsets[_key] = arguments[_key];\n }\n\n offsets.forEach(function (_ref) {\n var top = _ref.top,\n left = _ref.left;\n\n if (isString(top)) {\n top = parseFloat(top);\n }\n\n if (isString(left)) {\n left = parseFloat(left);\n }\n\n out.top += top;\n out.left += left;\n });\n return out;\n}\nfunction attachmentToOffset(attachment) {\n var left = attachment.left,\n top = attachment.top;\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 {\n left: left,\n top: top\n };\n}\nfunction autoToFixedAttachment(attachment, relativeToAttachment) {\n var left = attachment.left,\n top = attachment.top;\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 {\n left: left,\n top: top\n };\n}\nfunction offsetToPx(offset, size) {\n if (isString(offset.left) && offset.left.indexOf('%') !== -1) {\n offset.left = parseFloat(offset.left) / 100 * size.width;\n }\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}\nfunction parseTopLeft(value) {\n var _value$split = value.split(' '),\n top = _value$split[0],\n left = _value$split[1];\n\n return {\n top: top,\n left: left\n };\n}\n\nfunction 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 var computedStyle = getComputedStyle(el) || {};\n var position = computedStyle.position;\n var parents = [];\n\n if (position === 'fixed') {\n return [el];\n }\n\n var parent = el;\n\n while ((parent = parent.parentNode) && parent && parent.nodeType === 1) {\n var style = void 0;\n\n try {\n style = getComputedStyle(parent);\n } catch (err) {// Intentionally blank\n }\n\n if (isUndefined(style) || style === null) {\n parents.push(parent);\n return parents;\n }\n\n var _style = style,\n overflow = _style.overflow,\n overflowX = _style.overflowX,\n overflowY = _style.overflowY;\n\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); // If the node is within a frame, account for the parent window scroll\n\n if (el.ownerDocument !== document) {\n parents.push(el.ownerDocument.defaultView);\n }\n\n return parents;\n}\nfunction getOffsetParent(el) {\n return el.offsetParent || document.documentElement;\n}\n\nvar TetherBase = {\n modules: [Constraint, Abutment, Shift]\n};\n\nfunction isFullscreenElement(e) {\n var d = e.ownerDocument;\n var fe = d.fullscreenElement || d.webkitFullscreenElement || d.mozFullScreenElement || d.msFullscreenElement;\n return fe === e;\n}\n\nfunction within(a, b, diff) {\n if (diff === void 0) {\n diff = 1;\n }\n\n return a + diff >= b && b >= a - diff;\n}\n\nvar transformKey = function () {\n if (isUndefined(document)) {\n return '';\n }\n\n var el = document.createElement('div');\n var transforms = ['transform', 'WebkitTransform', 'OTransform', 'MozTransform', 'msTransform'];\n\n for (var i = 0; i < transforms.length; ++i) {\n var key = transforms[i];\n\n if (el.style[key] !== undefined) {\n return key;\n }\n }\n}();\n\nvar tethers = [];\n\nvar position = function position() {\n tethers.forEach(function (tether) {\n tether.position(false);\n });\n flush();\n};\n\nfunction now() {\n return performance.now();\n}\n\n(function () {\n var lastCall = null;\n var lastDuration = null;\n var pendingTimeout = null;\n\n var tick = function 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); // Just in case this is the last event, remember to position just once more\n\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(function (event) {\n window.addEventListener(event, tick);\n });\n }\n})();\n\nvar TetherClass =\n/*#__PURE__*/\nfunction (_Evented) {\n _inheritsLoose(TetherClass, _Evented);\n\n function TetherClass(options) {\n var _this;\n\n _this = _Evented.call(this) || this;\n _this.position = _this.position.bind(_assertThisInitialized(_this));\n tethers.push(_assertThisInitialized(_this));\n _this.history = [];\n\n _this.setOptions(options, false);\n\n TetherBase.modules.forEach(function (module) {\n if (!isUndefined(module.initialize)) {\n module.initialize.call(_assertThisInitialized(_this));\n }\n });\n\n _this.position();\n\n return _this;\n }\n\n var _proto = TetherClass.prototype;\n\n _proto.setOptions = function setOptions(options, pos) {\n var _this2 = this;\n\n if (pos === void 0) {\n pos = true;\n }\n\n var defaults = {\n offset: '0 0',\n targetOffset: '0 0',\n targetAttachment: 'auto auto',\n classPrefix: 'tether'\n };\n this.options = extend(defaults, options);\n var _this$options = this.options,\n element = _this$options.element,\n target = _this$options.target,\n targetModifier = _this$options.targetModifier;\n this.element = element;\n this.target = target;\n this.targetModifier = targetModifier;\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(function (key) {\n if (isUndefined(_this2[key])) {\n throw new Error('Tether Error: Both element and target must be defined');\n }\n\n if (!isUndefined(_this2[key].jquery)) {\n _this2[key] = _this2[key][0];\n } else if (isString(_this2[key])) {\n _this2[key] = document.querySelector(_this2[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 _proto.getTargetBounds = function getTargetBounds() {\n if (!isUndefined(this.targetModifier)) {\n if (this.targetModifier === 'visible') {\n return getVisibleBounds(this.target);\n } else if (this.targetModifier === 'scroll-handle') {\n return getScrollHandleBounds(this.target);\n }\n } else {\n return getBounds(this.target);\n }\n };\n\n _proto.clearCache = function clearCache() {\n this._cache = {};\n };\n\n _proto.cache = function 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 _proto.enable = function enable(pos) {\n var _this3 = this;\n\n if (pos === void 0) {\n pos = true;\n }\n\n var _this$options2 = this.options,\n classes = _this$options2.classes,\n classPrefix = _this$options2.classPrefix;\n\n if (!(this.options.addTargetClasses === false)) {\n addClass(this.target, getClass('enabled', classes, classPrefix));\n }\n\n addClass(this.element, getClass('enabled', classes, classPrefix));\n this.enabled = true;\n this.scrollParents.forEach(function (parent) {\n if (parent !== _this3.target.ownerDocument) {\n parent.addEventListener('scroll', _this3.position);\n }\n });\n\n if (pos) {\n this.position();\n }\n };\n\n _proto.disable = function disable() {\n var _this4 = this;\n\n var _this$options3 = this.options,\n classes = _this$options3.classes,\n classPrefix = _this$options3.classPrefix;\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(function (parent) {\n parent.removeEventListener('scroll', _this4.position);\n });\n }\n };\n\n _proto.destroy = function destroy() {\n var _this5 = this;\n\n this.disable();\n\n this._removeClasses();\n\n tethers.forEach(function (tether, i) {\n if (tether === _this5) {\n tethers.splice(i, 1);\n }\n }); // Remove any elements we were using for convenience from the DOM\n\n if (tethers.length === 0) {\n removeUtilElements();\n }\n };\n\n _proto.updateAttachClasses = function updateAttachClasses(elementAttach, targetAttach) {\n var _this6 = this;\n\n elementAttach = elementAttach || this.attachment;\n targetAttach = targetAttach || this.targetAttachment;\n var sides = ['left', 'top', 'bottom', 'right', 'middle', 'center'];\n var _this$options4 = this.options,\n classes = _this$options4.classes,\n classPrefix = _this$options4.classPrefix;\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\n this.add = this._addAttachClasses;\n\n if (elementAttach.top) {\n this.add.push(getClass('element-attached', classes, classPrefix) + \"-\" + elementAttach.top);\n }\n\n if (elementAttach.left) {\n this.add.push(getClass('element-attached', classes, classPrefix) + \"-\" + elementAttach.left);\n }\n\n if (targetAttach.top) {\n this.add.push(getClass('target-attached', classes, classPrefix) + \"-\" + targetAttach.top);\n }\n\n if (targetAttach.left) {\n this.add.push(getClass('target-attached', classes, classPrefix) + \"-\" + targetAttach.left);\n }\n\n this.all = [];\n sides.forEach(function (side) {\n _this6.all.push(getClass('element-attached', classes, classPrefix) + \"-\" + side);\n\n _this6.all.push(getClass('target-attached', classes, classPrefix) + \"-\" + side);\n });\n defer(function () {\n if (isUndefined(_this6._addAttachClasses)) {\n return;\n }\n\n updateClasses(_this6.element, _this6._addAttachClasses, _this6.all);\n\n if (!(_this6.options.addTargetClasses === false)) {\n updateClasses(_this6.target, _this6._addAttachClasses, _this6.all);\n }\n\n delete _this6._addAttachClasses;\n });\n };\n\n _proto.position = function position(flushChanges) {\n var _this7 = this;\n\n if (flushChanges === void 0) {\n flushChanges = true;\n }\n\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 if (!this.enabled) {\n return;\n }\n\n this.clearCache(); // Turn 'auto' attachments into the appropriate corner or edge\n\n var targetAttachment = autoToFixedAttachment(this.targetAttachment, this.attachment);\n this.updateAttachClasses(this.attachment, targetAttachment);\n var elementPos = this.cache('element-bounds', function () {\n return getBounds(_this7.element);\n });\n var width = elementPos.width,\n height = elementPos.height;\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 var _this$lastSize = this.lastSize;\n width = _this$lastSize.width;\n height = _this$lastSize.height;\n } else {\n this.lastSize = {\n width: width,\n height: height\n };\n }\n\n var targetPos = this.cache('target-bounds', function () {\n return _this7.getTargetBounds();\n });\n var targetSize = targetPos; // Get an actual px offset from the attachment\n\n var offset = offsetToPx(attachmentToOffset(this.attachment), {\n width: width,\n height: height\n });\n var targetOffset = offsetToPx(attachmentToOffset(targetAttachment), targetSize);\n var manualOffset = offsetToPx(this.offset, {\n width: width,\n height: height\n });\n var manualTargetOffset = offsetToPx(this.targetOffset, targetSize); // Add the manually provided offset\n\n offset = addOffset(offset, manualOffset);\n targetOffset = addOffset(targetOffset, manualTargetOffset); // It's now our goal to make (element position + offset) == (target position + target offset)\n\n var left = targetPos.left + targetOffset.left - offset.left;\n var top = targetPos.top + targetOffset.top - offset.top;\n\n for (var i = 0; i < TetherBase.modules.length; ++i) {\n var module = TetherBase.modules[i];\n var ret = module.position.call(this, {\n left: left,\n top: top,\n targetAttachment: targetAttachment,\n targetPos: targetPos,\n elementPos: elementPos,\n offset: offset,\n targetOffset: targetOffset,\n manualOffset: manualOffset,\n manualTargetOffset: manualTargetOffset,\n scrollbarSize: 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 = ret.top;\n left = ret.left;\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\n\n var 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: top,\n left: left\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 var doc = this.target.ownerDocument;\n var win = doc.defaultView;\n var scrollbarSize;\n\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 || ['', '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) && this.options.optimizations.moveElement !== false && isUndefined(this.targetModifier)) {\n var offsetParent = this.cache('target-offsetparent', function () {\n return getOffsetParent(_this7.target);\n });\n var offsetPosition = this.cache('target-offsetparent-bounds', function () {\n return getBounds(offsetParent);\n });\n var offsetParentStyle = getComputedStyle(offsetParent);\n var offsetParentSize = offsetPosition;\n var offsetBorder = {};\n ['Top', 'Left', 'Bottom', 'Right'].forEach(function (side) {\n offsetBorder[side.toLowerCase()] = parseFloat(offsetParentStyle[\"border\" + side + \"Width\"]);\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 var scrollLeft = offsetParent.scrollLeft,\n scrollTop = offsetParent.scrollTop; // 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\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 } // 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\n this.move(next);\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 } // THE ISSUE\n ;\n\n _proto.move = function move(pos) {\n var _this8 = this;\n\n if (isUndefined(this.element.parentNode)) {\n return;\n }\n\n var same = {};\n\n for (var type in pos) {\n same[type] = {};\n\n for (var key in pos[type]) {\n var found = false;\n\n for (var i = 0; i < this.history.length; ++i) {\n var point = this.history[i];\n\n if (!isUndefined(point[type]) && !within(point[type][key], pos[type][key])) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n same[type][key] = true;\n }\n }\n }\n\n var css = {\n top: '',\n left: '',\n right: '',\n bottom: ''\n };\n\n var transcribe = function transcribe(_same, _pos) {\n var hasOptimizations = !isUndefined(_this8.options.optimizations);\n var gpu = hasOptimizations ? _this8.options.optimizations.gpu : null;\n\n if (gpu !== false) {\n var yPos, xPos;\n\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 } 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 var hasOptimizations = !isUndefined(this.options.optimizations);\n var allowPositionFixed = true;\n\n if (hasOptimizations && this.options.optimizations.allowPositionFixed === false) {\n allowPositionFixed = false;\n }\n\n var moved = false;\n\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 } 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 var offsetParent = this.cache('target-offsetparent', function () {\n return getOffsetParent(_this8.target);\n });\n\n if (getOffsetParent(this.element) !== offsetParent) {\n defer(function () {\n _this8.element.parentNode.removeChild(_this8.element);\n\n offsetParent.appendChild(_this8.element);\n });\n }\n\n transcribe(same.offset, pos.offset);\n moved = true;\n } else {\n css.position = 'absolute';\n transcribe({\n top: true,\n left: true\n }, 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 var offsetParentIsBody = true;\n var currentNode = this.element.parentNode;\n\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 } // Any css change will trigger a repaint, so let's avoid one if nothing changed\n\n\n var writeCSS = {};\n var write = false;\n\n for (var _key in css) {\n var val = css[_key];\n var 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(function () {\n extend(_this8.element.style, writeCSS);\n\n _this8.trigger('repositioned');\n });\n }\n };\n\n _proto._addClasses = function _addClasses() {\n var _this$options5 = this.options,\n classes = _this$options5.classes,\n classPrefix = _this$options5.classPrefix;\n addClass(this.element, getClass('element', classes, classPrefix));\n\n if (!(this.options.addTargetClasses === false)) {\n addClass(this.target, getClass('target', classes, classPrefix));\n }\n };\n\n _proto._removeClasses = function _removeClasses() {\n var _this9 = this;\n\n var _this$options6 = this.options,\n classes = _this$options6.classes,\n classPrefix = _this$options6.classPrefix;\n removeClass(this.element, getClass('element', classes, classPrefix));\n\n if (!(this.options.addTargetClasses === false)) {\n removeClass(this.target, getClass('target', classes, classPrefix));\n }\n\n this.all.forEach(function (className) {\n _this9.element.classList.remove(className);\n\n _this9.target.classList.remove(className);\n });\n };\n\n return TetherClass;\n}(Evented);\n\nTetherClass.modules = [];\nTetherBase.position = position;\nvar Tether = extend(TetherClass, TetherBase);\nTether.modules.push({\n initialize: function initialize() {\n var _this10 = this;\n\n var _this$options7 = this.options,\n classes = _this$options7.classes,\n classPrefix = _this$options7.classPrefix;\n this.markers = {};\n ['target', 'element'].forEach(function (type) {\n var el = document.createElement('div');\n el.className = getClass(type + \"-marker\", classes, classPrefix);\n var dot = document.createElement('div');\n dot.className = getClass('marker-dot', classes, classPrefix);\n el.appendChild(dot);\n\n _this10[type].appendChild(el);\n\n _this10.markers[type] = {\n dot: dot,\n el: el\n };\n });\n },\n position: function position(_ref) {\n var manualOffset = _ref.manualOffset,\n manualTargetOffset = _ref.manualTargetOffset;\n var offsets = {\n element: manualOffset,\n target: manualTargetOffset\n };\n\n for (var type in offsets) {\n var offset = offsets[type];\n\n for (var side in offset) {\n var val = offset[side];\n\n if (!isString(val) || val.indexOf('%') === -1 && 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//# sourceMappingURL=tether.esm.js.map\n","import { isString } from './type-check';\nimport Tether from 'tether';\n\nconst ATTACHMENT = {\n 'bottom': 'top center',\n 'bottom center': 'top center',\n 'bottom left': 'top right',\n 'bottom right': 'top left',\n 'center': 'middle center',\n 'left': 'middle right',\n 'middle': 'middle center',\n 'middle center': 'middle center',\n 'middle left': 'middle right',\n 'middle right': 'middle left',\n 'right': 'middle left',\n 'top': 'bottom center',\n 'top center': 'bottom center',\n 'top left': 'bottom right',\n 'top right': 'bottom left'\n};\n\n/**\n * Ensure class prefix ends in `-`\n * @param {string} prefix The prefix to prepend to the class names generated by nano-css\n * @return {string} The prefix ending in `-`\n */\nexport function normalizePrefix(prefix) {\n if (!isString(prefix) || prefix === '') {\n return '';\n }\n\n return prefix.charAt(prefix.length - 1) !== '-' ? `${prefix}-` : prefix;\n}\n\n/**\n * Checks if options.attachTo.element is a string, and if so, tries to find the element\n * @param {Step} step The step instance\n * @returns {{element, on}}\n * `element` is a qualified HTML Element\n * `on` is a string position value\n */\nexport function parseAttachTo(step) {\n const options = step.options.attachTo || {};\n const returnOpts = Object.assign({}, options);\n\n if (isString(options.element)) {\n // Can't override the element in user opts reference because we can't\n // guarantee that the element will exist in the future.\n try {\n returnOpts.element = document.querySelector(options.element);\n } catch(e) {\n // TODO\n }\n if (!returnOpts.element) {\n console.error(`The element for this Shepherd step was not found ${options.element}`);\n }\n }\n\n return returnOpts;\n}\n\n/**\n * Determines options for the tooltip and initializes\n * `step.tooltip` as a Tether instance.\n * @param {Step} step The step instance\n */\nexport function setupTooltip(step) {\n if (step.tooltip) {\n step.tooltip.destroy();\n }\n\n const attachToOpts = parseAttachTo(step);\n const tetherOptions = getTetherOptions(attachToOpts, step);\n\n step.tooltip = new Tether(tetherOptions);\n step.target = attachToOpts.element;\n}\n\n/**\n * Create a unique id for steps, tours, modals, etc\n * @return {string}\n */\nexport function uuid() {\n let d = Date.now();\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);\n });\n}\n\n/**\n * Gets the `Tether` options from a set of base `attachTo` options\n * @param attachToOptions\n * @param {Step} step The step instance\n * @return {Object}\n * @private\n */\nexport function getTetherOptions(attachToOptions, step) {\n let tetherOptions = {\n classPrefix: 'shepherd',\n constraints: [\n {\n to: 'scrollParent',\n attachment: 'together',\n pin: ['left', 'right', 'top']\n },\n {\n to: 'window',\n attachment: 'together'\n }\n ]\n };\n let target = document.body;\n\n if (!attachToOptions.element || !attachToOptions.on) {\n tetherOptions.attachment = 'middle center';\n tetherOptions.targetModifier = 'visible';\n } else {\n tetherOptions.attachment = ATTACHMENT[attachToOptions.on] || ATTACHMENT.right;\n target = attachToOptions.element;\n }\n\n tetherOptions.element = step.el;\n tetherOptions.target = target;\n\n if (step.options.tetherOptions) {\n if (step.options.tetherOptions.constraints) {\n tetherOptions.constraints = step.options.tetherOptions.constraints;\n }\n\n tetherOptions.classes = {\n ...tetherOptions.classes,\n ...step.options.tetherOptions.classes\n };\n\n tetherOptions.optimizations = {\n ...tetherOptions.optimizations,\n ...step.options.tetherOptions.optimizations\n };\n\n tetherOptions = {\n ...tetherOptions,\n ...step.options.tetherOptions\n };\n }\n\n return tetherOptions;\n}\n","function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\nfunction is_promise(value) {\n return value && typeof value === 'object' && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction validate_store(store, name) {\n if (!store || typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, callback) {\n const unsub = store.subscribe(callback);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, fn) {\n return definition[1]\n ? assign({}, assign(ctx.$$scope.ctx, definition[1](fn ? fn(ctx) : {})))\n : ctx.$$scope.ctx;\n}\nfunction get_slot_changes(definition, ctx, changed, fn) {\n return definition[1]\n ? assign({}, assign(ctx.$$scope.changed || {}, definition[1](fn ? fn(changed) : {})))\n : ctx.$$scope.changed || {};\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value = ret) {\n store.set(value);\n return ret;\n}\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nlet running = false;\nfunction run_tasks() {\n tasks.forEach(task => {\n if (!task[0](now())) {\n tasks.delete(task);\n task[1]();\n }\n });\n running = tasks.size > 0;\n if (running)\n raf(run_tasks);\n}\nfunction clear_loops() {\n // for testing...\n tasks.forEach(task => tasks.delete(task));\n running = false;\n}\nfunction loop(fn) {\n let task;\n if (!running) {\n running = true;\n raf(run_tasks);\n }\n return {\n promise: new Promise(fulfil => {\n tasks.add(task = [fn, fulfil]);\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction detach(node) {\n node.parentNode.removeChild(node);\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n // eslint-disable-next-line @typescript-eslint/no-object-literal-type-assertion\n const target = {};\n for (const k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else\n node.setAttribute(attribute, value);\n}\nfunction set_attributes(node, attributes) {\n for (const key in attributes) {\n if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key in node) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group) {\n const value = [];\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.push(group[i].__value);\n }\n return value;\n}\nfunction to_number(value) {\n return value === '' ? undefined : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction claim_element(nodes, name, attributes, svg) {\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeName === name) {\n for (let j = 0; j < node.attributes.length; j += 1) {\n const attribute = node.attributes[j];\n if (!attributes[attribute.name])\n node.removeAttribute(attribute.name);\n }\n return nodes.splice(i, 1)[0]; // TODO strip unwanted attributes\n }\n }\n return svg ? svg_element(name) : element(name);\n}\nfunction claim_text(nodes, data) {\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 3) {\n node.data = '' + data;\n return nodes.splice(i, 1)[0];\n }\n }\n return text(data);\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.data !== data)\n text.data = data;\n}\nfunction set_input_value(input, value) {\n if (value != null || input.value) {\n input.value = value;\n }\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n node.style.setProperty(key, value, important ? 'important' : '');\n}\nfunction select_option(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked') || select.options[0];\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\nfunction add_resize_listener(element, fn) {\n if (getComputedStyle(element).position === 'static') {\n element.style.position = 'relative';\n }\n const object = document.createElement('object');\n object.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;');\n object.type = 'text/html';\n object.tabIndex = -1;\n let win;\n object.onload = () => {\n win = object.contentDocument.defaultView;\n win.addEventListener('resize', fn);\n };\n if (/Trident/.test(navigator.userAgent)) {\n element.appendChild(object);\n object.data = 'about:blank';\n }\n else {\n object.data = 'about:blank';\n element.appendChild(object);\n }\n return {\n cancel: () => {\n win && win.removeEventListener && win.removeEventListener('resize', fn);\n element.removeChild(object);\n }\n };\n}\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, false, false, detail);\n return e;\n}\nclass HtmlTag {\n constructor(html, anchor = null) {\n this.e = element('div');\n this.a = anchor;\n this.u(html);\n }\n m(target, anchor = null) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert(target, this.n[i], anchor);\n }\n this.t = target;\n }\n u(html) {\n this.e.innerHTML = html;\n this.n = Array.from(this.e.childNodes);\n }\n p(html) {\n this.d();\n this.u(html);\n this.m(this.t, this.a);\n }\n d() {\n this.n.forEach(detach);\n }\n}\n\nlet stylesheet;\nlet active = 0;\nlet current_rules = {};\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i--)\n hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n return hash >>> 0;\n}\nfunction create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n const step = 16.666 / duration;\n let keyframes = '{\\n';\n for (let p = 0; p <= 1; p += step) {\n const t = a + (b - a) * ease(p);\n keyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n }\n const rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n const name = `__svelte_${hash(rule)}_${uid}`;\n if (!current_rules[name]) {\n if (!stylesheet) {\n const style = element('style');\n document.head.appendChild(style);\n stylesheet = style.sheet;\n }\n current_rules[name] = true;\n stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n }\n const animation = node.style.animation || '';\n node.style.animation = `${animation ? `${animation}, ` : ``}${name} ${duration}ms linear ${delay}ms 1 both`;\n active += 1;\n return name;\n}\nfunction delete_rule(node, name) {\n node.style.animation = (node.style.animation || '')\n .split(', ')\n .filter(name\n ? anim => anim.indexOf(name) < 0 // remove specific animation\n : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n )\n .join(', ');\n if (name && !--active)\n clear_rules();\n}\nfunction clear_rules() {\n raf(() => {\n if (active)\n return;\n let i = stylesheet.cssRules.length;\n while (i--)\n stylesheet.deleteRule(i);\n current_rules = {};\n });\n}\n\nfunction create_animation(node, from, fn, params) {\n if (!from)\n return noop;\n const to = node.getBoundingClientRect();\n if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)\n return noop;\n const { delay = 0, duration = 300, easing = identity, \n // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?\n start: start_time = now() + delay, \n // @ts-ignore todo:\n end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);\n let running = true;\n let started = false;\n let name;\n function start() {\n if (css) {\n name = create_rule(node, 0, 1, duration, delay, easing, css);\n }\n if (!delay) {\n started = true;\n }\n }\n function stop() {\n if (css)\n delete_rule(node, name);\n running = false;\n }\n loop(now => {\n if (!started && now >= start_time) {\n started = true;\n }\n if (started && now >= end) {\n tick(1, 0);\n stop();\n }\n if (!running) {\n return false;\n }\n if (started) {\n const p = now - start_time;\n const t = 0 + 1 * easing(p / duration);\n tick(t, 1 - t);\n }\n return true;\n });\n start();\n tick(0, 1);\n return stop;\n}\nfunction fix_position(node) {\n const style = getComputedStyle(node);\n if (style.position !== 'absolute' && style.position !== 'fixed') {\n const { width, height } = style;\n const a = node.getBoundingClientRect();\n node.style.position = 'absolute';\n node.style.width = width;\n node.style.height = height;\n add_transform(node, a);\n }\n}\nfunction add_transform(node, a) {\n const b = node.getBoundingClientRect();\n if (a.left !== b.left || a.top !== b.top) {\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n }\n}\n\nlet current_component;\nfunction set_current_component(component) {\n current_component = component;\n}\nfunction get_current_component() {\n if (!current_component)\n throw new Error(`Function called outside component initialization`);\n return current_component;\n}\nfunction beforeUpdate(fn) {\n get_current_component().$$.before_update.push(fn);\n}\nfunction onMount(fn) {\n get_current_component().$$.on_mount.push(fn);\n}\nfunction afterUpdate(fn) {\n get_current_component().$$.after_update.push(fn);\n}\nfunction onDestroy(fn) {\n get_current_component().$$.on_destroy.push(fn);\n}\nfunction createEventDispatcher() {\n const component = current_component;\n return (type, detail) => {\n const callbacks = component.$$.callbacks[type];\n if (callbacks) {\n // TODO are there situations where events could be dispatched\n // in a server (non-DOM) environment?\n const event = custom_event(type, detail);\n callbacks.slice().forEach(fn => {\n fn.call(component, event);\n });\n }\n };\n}\nfunction setContext(key, context) {\n get_current_component().$$.context.set(key, context);\n}\nfunction getContext(key) {\n return get_current_component().$$.context.get(key);\n}\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\nfunction bubble(component, event) {\n const callbacks = component.$$.callbacks[event.type];\n if (callbacks) {\n callbacks.slice().forEach(fn => fn(event));\n }\n}\n\nconst dirty_components = [];\nconst intros = { enabled: false };\nconst binding_callbacks = [];\nconst render_callbacks = [];\nconst flush_callbacks = [];\nconst resolved_promise = Promise.resolve();\nlet update_scheduled = false;\nfunction schedule_update() {\n if (!update_scheduled) {\n update_scheduled = true;\n resolved_promise.then(flush);\n }\n}\nfunction tick() {\n schedule_update();\n return resolved_promise;\n}\nfunction add_render_callback(fn) {\n render_callbacks.push(fn);\n}\nfunction add_flush_callback(fn) {\n flush_callbacks.push(fn);\n}\nfunction flush() {\n const seen_callbacks = new Set();\n do {\n // first, call beforeUpdate functions\n // and update components\n while (dirty_components.length) {\n const component = dirty_components.shift();\n set_current_component(component);\n update(component.$$);\n }\n while (binding_callbacks.length)\n binding_callbacks.pop()();\n // then, once components are updated, call\n // afterUpdate functions. This may cause\n // subsequent updates...\n for (let i = 0; i < render_callbacks.length; i += 1) {\n const callback = render_callbacks[i];\n if (!seen_callbacks.has(callback)) {\n callback();\n // ...so guard against infinite loops\n seen_callbacks.add(callback);\n }\n }\n render_callbacks.length = 0;\n } while (dirty_components.length);\n while (flush_callbacks.length) {\n flush_callbacks.pop()();\n }\n update_scheduled = false;\n}\nfunction update($$) {\n if ($$.fragment) {\n $$.update($$.dirty);\n run_all($$.before_update);\n $$.fragment.p($$.dirty, $$.ctx);\n $$.dirty = null;\n $$.after_update.forEach(add_render_callback);\n }\n}\n\nlet promise;\nfunction wait() {\n if (!promise) {\n promise = Promise.resolve();\n promise.then(() => {\n promise = null;\n });\n }\n return promise;\n}\nfunction dispatch(node, direction, kind) {\n node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\nconst outroing = new Set();\nlet outros;\nfunction group_outros() {\n outros = {\n r: 0,\n c: [],\n p: outros // parent group\n };\n}\nfunction check_outros() {\n if (!outros.r) {\n run_all(outros.c);\n }\n outros = outros.p;\n}\nfunction transition_in(block, local) {\n if (block && block.i) {\n outroing.delete(block);\n block.i(local);\n }\n}\nfunction transition_out(block, local, detach, callback) {\n if (block && block.o) {\n if (outroing.has(block))\n return;\n outroing.add(block);\n outros.c.push(() => {\n outroing.delete(block);\n if (callback) {\n if (detach)\n block.d(1);\n callback();\n }\n });\n block.o(local);\n }\n}\nconst null_transition = { duration: 0 };\nfunction create_in_transition(node, fn, params) {\n let config = fn(node, params);\n let running = false;\n let animation_name;\n let task;\n let uid = 0;\n function cleanup() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n tick(0, 1);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n if (task)\n task.abort();\n running = true;\n add_render_callback(() => dispatch(node, true, 'start'));\n task = loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(1, 0);\n dispatch(node, true, 'end');\n cleanup();\n return running = false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(t, 1 - t);\n }\n }\n return running;\n });\n }\n let started = false;\n return {\n start() {\n if (started)\n return;\n delete_rule(node);\n if (is_function(config)) {\n config = config();\n wait().then(go);\n }\n else {\n go();\n }\n },\n invalidate() {\n started = false;\n },\n end() {\n if (running) {\n cleanup();\n running = false;\n }\n }\n };\n}\nfunction create_out_transition(node, fn, params) {\n let config = fn(node, params);\n let running = true;\n let animation_name;\n const group = outros;\n group.r += 1;\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n add_render_callback(() => dispatch(node, false, 'start'));\n loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(0, 1);\n dispatch(node, false, 'end');\n if (!--group.r) {\n // this will result in `end()` being called,\n // so we don't need to clean up here\n run_all(group.c);\n }\n return false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(1 - t, t);\n }\n }\n return running;\n });\n }\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go();\n });\n }\n else {\n go();\n }\n return {\n end(reset) {\n if (reset && config.tick) {\n config.tick(1, 0);\n }\n if (running) {\n if (animation_name)\n delete_rule(node, animation_name);\n running = false;\n }\n }\n };\n}\nfunction create_bidirectional_transition(node, fn, params, intro) {\n let config = fn(node, params);\n let t = intro ? 0 : 1;\n let running_program = null;\n let pending_program = null;\n let animation_name = null;\n function clear_animation() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function init(program, duration) {\n const d = program.b - t;\n duration *= Math.abs(d);\n return {\n a: t,\n b: program.b,\n d,\n duration,\n start: program.start,\n end: program.start + duration,\n group: program.group\n };\n }\n function go(b) {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n const program = {\n start: now() + delay,\n b\n };\n if (!b) {\n // @ts-ignore todo: improve typings\n program.group = outros;\n outros.r += 1;\n }\n if (running_program) {\n pending_program = program;\n }\n else {\n // if this is an intro, and there's a delay, we need to do\n // an initial tick and/or apply CSS animation immediately\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, b, duration, delay, easing, css);\n }\n if (b)\n tick(0, 1);\n running_program = init(program, duration);\n add_render_callback(() => dispatch(node, b, 'start'));\n loop(now => {\n if (pending_program && now > pending_program.start) {\n running_program = init(pending_program, duration);\n pending_program = null;\n dispatch(node, running_program.b, 'start');\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);\n }\n }\n if (running_program) {\n if (now >= running_program.end) {\n tick(t = running_program.b, 1 - t);\n dispatch(node, running_program.b, 'end');\n if (!pending_program) {\n // we're done\n if (running_program.b) {\n // intro — we can tidy up immediately\n clear_animation();\n }\n else {\n // outro — needs to be coordinated\n if (!--running_program.group.r)\n run_all(running_program.group.c);\n }\n }\n running_program = null;\n }\n else if (now >= running_program.start) {\n const p = now - running_program.start;\n t = running_program.a + running_program.d * easing(p / running_program.duration);\n tick(t, 1 - t);\n }\n }\n return !!(running_program || pending_program);\n });\n }\n }\n return {\n run(b) {\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go(b);\n });\n }\n else {\n go(b);\n }\n },\n end() {\n clear_animation();\n running_program = pending_program = null;\n }\n };\n}\n\nfunction handle_promise(promise, info) {\n const token = info.token = {};\n function update(type, index, key, value) {\n if (info.token !== token)\n return;\n info.resolved = key && { [key]: value };\n const child_ctx = assign(assign({}, info.ctx), info.resolved);\n const block = type && (info.current = type)(child_ctx);\n if (info.block) {\n if (info.blocks) {\n info.blocks.forEach((block, i) => {\n if (i !== index && block) {\n group_outros();\n transition_out(block, 1, 1, () => {\n info.blocks[i] = null;\n });\n check_outros();\n }\n });\n }\n else {\n info.block.d(1);\n }\n block.c();\n transition_in(block, 1);\n block.m(info.mount(), info.anchor);\n flush();\n }\n info.block = block;\n if (info.blocks)\n info.blocks[index] = block;\n }\n if (is_promise(promise)) {\n const current_component = get_current_component();\n promise.then(value => {\n set_current_component(current_component);\n update(info.then, 1, info.value, value);\n set_current_component(null);\n }, error => {\n set_current_component(current_component);\n update(info.catch, 2, info.error, error);\n set_current_component(null);\n });\n // if we previously had a then/catch block, destroy it\n if (info.current !== info.pending) {\n update(info.pending, 0);\n return true;\n }\n }\n else {\n if (info.current !== info.then) {\n update(info.then, 1, info.value, promise);\n return true;\n }\n info.resolved = { [info.value]: promise };\n }\n}\n\nconst globals = (typeof window !== 'undefined' ? window : global);\n\nfunction destroy_block(block, lookup) {\n block.d(1);\n lookup.delete(block.key);\n}\nfunction outro_and_destroy_block(block, lookup) {\n transition_out(block, 1, 1, () => {\n lookup.delete(block.key);\n });\n}\nfunction fix_and_destroy_block(block, lookup) {\n block.f();\n destroy_block(block, lookup);\n}\nfunction fix_and_outro_and_destroy_block(block, lookup) {\n block.f();\n outro_and_destroy_block(block, lookup);\n}\nfunction update_keyed_each(old_blocks, changed, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {\n let o = old_blocks.length;\n let n = list.length;\n let i = o;\n const old_indexes = {};\n while (i--)\n old_indexes[old_blocks[i].key] = i;\n const new_blocks = [];\n const new_lookup = new Map();\n const deltas = new Map();\n i = n;\n while (i--) {\n const child_ctx = get_context(ctx, list, i);\n const key = get_key(child_ctx);\n let block = lookup.get(key);\n if (!block) {\n block = create_each_block(key, child_ctx);\n block.c();\n }\n else if (dynamic) {\n block.p(changed, child_ctx);\n }\n new_lookup.set(key, new_blocks[i] = block);\n if (key in old_indexes)\n deltas.set(key, Math.abs(i - old_indexes[key]));\n }\n const will_move = new Set();\n const did_move = new Set();\n function insert(block) {\n transition_in(block, 1);\n block.m(node, next);\n lookup.set(block.key, block);\n next = block.first;\n n--;\n }\n while (o && n) {\n const new_block = new_blocks[n - 1];\n const old_block = old_blocks[o - 1];\n const new_key = new_block.key;\n const old_key = old_block.key;\n if (new_block === old_block) {\n // do nothing\n next = new_block.first;\n o--;\n n--;\n }\n else if (!new_lookup.has(old_key)) {\n // remove old block\n destroy(old_block, lookup);\n o--;\n }\n else if (!lookup.has(new_key) || will_move.has(new_key)) {\n insert(new_block);\n }\n else if (did_move.has(old_key)) {\n o--;\n }\n else if (deltas.get(new_key) > deltas.get(old_key)) {\n did_move.add(new_key);\n insert(new_block);\n }\n else {\n will_move.add(old_key);\n o--;\n }\n }\n while (o--) {\n const old_block = old_blocks[o];\n if (!new_lookup.has(old_block.key))\n destroy(old_block, lookup);\n }\n while (n)\n insert(new_blocks[n - 1]);\n return new_blocks;\n}\nfunction measure(blocks) {\n const rects = {};\n let i = blocks.length;\n while (i--)\n rects[blocks[i].key] = blocks[i].node.getBoundingClientRect();\n return rects;\n}\n\nfunction get_spread_update(levels, updates) {\n const update = {};\n const to_null_out = {};\n const accounted_for = { $$scope: 1 };\n let i = levels.length;\n while (i--) {\n const o = levels[i];\n const n = updates[i];\n if (n) {\n for (const key in o) {\n if (!(key in n))\n to_null_out[key] = 1;\n }\n for (const key in n) {\n if (!accounted_for[key]) {\n update[key] = n[key];\n accounted_for[key] = 1;\n }\n }\n levels[i] = n;\n }\n else {\n for (const key in o) {\n accounted_for[key] = 1;\n }\n }\n }\n for (const key in to_null_out) {\n if (!(key in update))\n update[key] = undefined;\n }\n return update;\n}\nfunction get_spread_object(spread_props) {\n return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};\n}\n\nconst invalid_attribute_name_character = /[\\s'\">/=\\u{FDD0}-\\u{FDEF}\\u{FFFE}\\u{FFFF}\\u{1FFFE}\\u{1FFFF}\\u{2FFFE}\\u{2FFFF}\\u{3FFFE}\\u{3FFFF}\\u{4FFFE}\\u{4FFFF}\\u{5FFFE}\\u{5FFFF}\\u{6FFFE}\\u{6FFFF}\\u{7FFFE}\\u{7FFFF}\\u{8FFFE}\\u{8FFFF}\\u{9FFFE}\\u{9FFFF}\\u{AFFFE}\\u{AFFFF}\\u{BFFFE}\\u{BFFFF}\\u{CFFFE}\\u{CFFFF}\\u{DFFFE}\\u{DFFFF}\\u{EFFFE}\\u{EFFFF}\\u{FFFFE}\\u{FFFFF}\\u{10FFFE}\\u{10FFFF}]/u;\n// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n// https://infra.spec.whatwg.org/#noncharacter\nfunction spread(args) {\n const attributes = Object.assign({}, ...args);\n let str = '';\n Object.keys(attributes).forEach(name => {\n if (invalid_attribute_name_character.test(name))\n return;\n const value = attributes[name];\n if (value === undefined)\n return;\n if (value === true)\n str += \" \" + name;\n const escaped = String(value)\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n str += \" \" + name + \"=\" + JSON.stringify(escaped);\n });\n return str;\n}\nconst escaped = {\n '\"': '"',\n \"'\": ''',\n '&': '&',\n '<': '<',\n '>': '>'\n};\nfunction escape(html) {\n return String(html).replace(/[\"'&<>]/g, match => escaped[match]);\n}\nfunction each(items, fn) {\n let str = '';\n for (let i = 0; i < items.length; i += 1) {\n str += fn(items[i], i);\n }\n return str;\n}\nconst missing_component = {\n $$render: () => ''\n};\nfunction validate_component(component, name) {\n if (!component || !component.$$render) {\n if (name === 'svelte:component')\n name += ' this={...}';\n throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);\n }\n return component;\n}\nfunction debug(file, line, column, values) {\n console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console\n console.log(values); // eslint-disable-line no-console\n return '';\n}\nlet on_destroy;\nfunction create_ssr_component(fn) {\n function $$render(result, props, bindings, slots) {\n const parent_component = current_component;\n const $$ = {\n on_destroy,\n context: new Map(parent_component ? parent_component.$$.context : []),\n // these will be immediately discarded\n on_mount: [],\n before_update: [],\n after_update: [],\n callbacks: blank_object()\n };\n set_current_component({ $$ });\n const html = fn(result, props, bindings, slots);\n set_current_component(parent_component);\n return html;\n }\n return {\n render: (props = {}, options = {}) => {\n on_destroy = [];\n const result = { head: '', css: new Set() };\n const html = $$render(result, props, {}, options);\n run_all(on_destroy);\n return {\n html,\n css: {\n code: Array.from(result.css).map(css => css.code).join('\\n'),\n map: null // TODO\n },\n head: result.head\n };\n },\n $$render\n };\n}\nfunction add_attribute(name, value, boolean) {\n if (value == null || (boolean && !value))\n return '';\n return ` ${name}${value === true ? '' : `=${typeof value === 'string' ? JSON.stringify(escape(value)) : `\"${value}\"`}`}`;\n}\nfunction add_classes(classes) {\n return classes ? ` class=\"${classes}\"` : ``;\n}\n\nfunction bind(component, name, callback) {\n if (component.$$.props.indexOf(name) === -1)\n return;\n component.$$.bound[name] = callback;\n callback(component.$$.ctx[name]);\n}\nfunction mount_component(component, target, anchor) {\n const { fragment, on_mount, on_destroy, after_update } = component.$$;\n fragment.m(target, anchor);\n // onMount happens before the initial afterUpdate\n add_render_callback(() => {\n const new_on_destroy = on_mount.map(run).filter(is_function);\n if (on_destroy) {\n on_destroy.push(...new_on_destroy);\n }\n else {\n // Edge case - component was destroyed immediately,\n // most likely as a result of a binding initialising\n run_all(new_on_destroy);\n }\n component.$$.on_mount = [];\n });\n after_update.forEach(add_render_callback);\n}\nfunction destroy_component(component, detaching) {\n if (component.$$.fragment) {\n run_all(component.$$.on_destroy);\n component.$$.fragment.d(detaching);\n // TODO null out other refs, including component.$$ (but need to\n // preserve final state?)\n component.$$.on_destroy = component.$$.fragment = null;\n component.$$.ctx = {};\n }\n}\nfunction make_dirty(component, key) {\n if (!component.$$.dirty) {\n dirty_components.push(component);\n schedule_update();\n component.$$.dirty = blank_object();\n }\n component.$$.dirty[key] = true;\n}\nfunction init(component, options, instance, create_fragment, not_equal, prop_names) {\n const parent_component = current_component;\n set_current_component(component);\n const props = options.props || {};\n const $$ = component.$$ = {\n fragment: null,\n ctx: null,\n // state\n props: prop_names,\n update: noop,\n not_equal,\n bound: blank_object(),\n // lifecycle\n on_mount: [],\n on_destroy: [],\n before_update: [],\n after_update: [],\n context: new Map(parent_component ? parent_component.$$.context : []),\n // everything else\n callbacks: blank_object(),\n dirty: null\n };\n let ready = false;\n $$.ctx = instance\n ? instance(component, props, (key, ret, value = ret) => {\n if ($$.ctx && not_equal($$.ctx[key], $$.ctx[key] = value)) {\n if ($$.bound[key])\n $$.bound[key](value);\n if (ready)\n make_dirty(component, key);\n }\n return ret;\n })\n : props;\n $$.update();\n ready = true;\n run_all($$.before_update);\n $$.fragment = create_fragment($$.ctx);\n if (options.target) {\n if (options.hydrate) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment.l(children(options.target));\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment.c();\n }\n if (options.intro)\n transition_in(component.$$.fragment);\n mount_component(component, options.target, options.anchor);\n flush();\n }\n set_current_component(parent_component);\n}\nlet SvelteElement;\nif (typeof HTMLElement !== 'undefined') {\n SvelteElement = class extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n connectedCallback() {\n // @ts-ignore todo: improve typings\n for (const key in this.$$.slotted) {\n // @ts-ignore todo: improve typings\n this.appendChild(this.$$.slotted[key]);\n }\n }\n attributeChangedCallback(attr, _oldValue, newValue) {\n this[attr] = newValue;\n }\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n // TODO should this delegate to addEventListener?\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set() {\n // overridden by instance, if it has props\n }\n };\n}\nclass SvelteComponent {\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set() {\n // overridden by instance, if it has props\n }\n}\n\nfunction dispatch_dev(type, detail) {\n document.dispatchEvent(custom_event(type, detail));\n}\nfunction append_dev(target, node) {\n dispatch_dev(\"SvelteDOMInsert\", { target, node });\n append(target, node);\n}\nfunction insert_dev(target, node, anchor) {\n dispatch_dev(\"SvelteDOMInsert\", { target, node, anchor });\n insert(target, node, anchor);\n}\nfunction detach_dev(node) {\n dispatch_dev(\"SvelteDOMRemove\", { node });\n detach(node);\n}\nfunction detach_between_dev(before, after) {\n while (before.nextSibling && before.nextSibling !== after) {\n detach_dev(before.nextSibling);\n }\n}\nfunction detach_before_dev(after) {\n while (after.previousSibling) {\n detach_dev(after.previousSibling);\n }\n}\nfunction detach_after_dev(before) {\n while (before.nextSibling) {\n detach_dev(before.nextSibling);\n }\n}\nfunction listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {\n const modifiers = options === true ? [\"capture\"] : options ? Array.from(Object.keys(options)) : [];\n if (has_prevent_default)\n modifiers.push('preventDefault');\n if (has_stop_propagation)\n modifiers.push('stopPropagation');\n dispatch_dev(\"SvelteDOMAddEventListener\", { node, event, handler, modifiers });\n const dispose = listen(node, event, handler, options);\n return () => {\n dispatch_dev(\"SvelteDOMRemoveEventListener\", { node, event, handler, modifiers });\n dispose();\n };\n}\nfunction attr_dev(node, attribute, value) {\n attr(node, attribute, value);\n if (value == null)\n dispatch_dev(\"SvelteDOMRemoveAttribute\", { node, attribute });\n else\n dispatch_dev(\"SvelteDOMSetAttribute\", { node, attribute, value });\n}\nfunction prop_dev(node, property, value) {\n node[property] = value;\n dispatch_dev(\"SvelteDOMSetProperty\", { node, property, value });\n}\nfunction dataset_dev(node, property, value) {\n node.dataset[property] = value;\n dispatch_dev(\"SvelteDOMSetDataset\", { node, property, value });\n}\nfunction set_data_dev(text, data) {\n data = '' + data;\n if (text.data === data)\n return;\n dispatch_dev(\"SvelteDOMSetData\", { node: text, data });\n text.data = data;\n}\nclass SvelteComponentDev extends SvelteComponent {\n constructor(options) {\n if (!options || (!options.target && !options.$$inline)) {\n throw new Error(`'target' is a required option`);\n }\n super();\n }\n $destroy() {\n super.$destroy();\n this.$destroy = () => {\n console.warn(`Component was already destroyed`); // eslint-disable-line no-console\n };\n }\n}\n\nexport { HtmlTag, SvelteComponent, SvelteComponentDev, SvelteElement, add_attribute, add_classes, add_flush_callback, add_location, add_render_callback, add_resize_listener, add_transform, afterUpdate, append, append_dev, assign, attr, attr_dev, beforeUpdate, bind, binding_callbacks, blank_object, bubble, check_outros, children, claim_element, claim_space, claim_text, clear_loops, component_subscribe, createEventDispatcher, create_animation, create_bidirectional_transition, create_in_transition, create_out_transition, create_slot, create_ssr_component, current_component, custom_event, dataset_dev, debug, destroy_block, destroy_component, destroy_each, detach, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dirty_components, dispatch_dev, each, element, element_is, empty, escape, escaped, exclude_internal_props, fix_and_destroy_block, fix_and_outro_and_destroy_block, fix_position, flush, getContext, get_binding_group_value, get_current_component, get_slot_changes, get_slot_context, get_spread_object, get_spread_update, get_store_value, globals, group_outros, handle_promise, identity, init, insert, insert_dev, intros, invalid_attribute_name_character, is_client, is_function, is_promise, listen, listen_dev, loop, measure, missing_component, mount_component, noop, not_equal, now, null_to_empty, object_without_properties, onDestroy, onMount, once, outro_and_destroy_block, prevent_default, prop_dev, raf, run, run_all, safe_not_equal, schedule_update, select_multiple_value, select_option, select_options, select_value, self, setContext, set_attributes, set_current_component, set_custom_element_data, set_data, set_data_dev, set_input_type, set_input_value, set_now, set_raf, set_store_value, set_style, set_svg_attributes, space, spread, stop_propagation, subscribe, svg_element, text, tick, time_ranges_to_array, to_number, toggle_class, transition_in, transition_out, update_keyed_each, validate_component, validate_store, xlink_attr };\n","<script>\n import { isFunction } from '../utils/type-check';\n\n export let config, step;\n let action, classes, secondary, text, label, disabled;\n\n $: {\n action = config.action ? config.action.bind(step.tour) : null;\n classes = config.classes;\n secondary = config.secondary;\n text = config.text;\n label = config.label;\n disabled = config.disabled ? getDisabled(config.disabled) : false;\n }\n\n function getDisabled(disabled) {\n if (isFunction(disabled)) {\n return disabled = disabled.call(step);\n }\n return disabled\n }\n\n</script>\n\n<style global>\n .shepherd-button {\n background: rgb(50, 136, 230);\n border: 0;\n border-radius: 3px;\n color: rgba(255, 255, 255, 0.75);\n cursor: pointer;\n margin-right: 0.5rem;\n padding: 0.5rem 1.5rem;\n transition: all 0.5s ease;\n }\n\n .shepherd-button:not(:disabled):hover {\n background: rgb(25, 111, 204);\n color: rgba(255, 255, 255, 0.75);\n }\n\n .shepherd-button.shepherd-button-secondary {\n background: rgb(241, 242, 243);\n color: rgba(0, 0, 0, 0.75);\n }\n\n .shepherd-button.shepherd-button-secondary:not(:disabled):hover {\n background: rgb(214, 217, 219);\n color: rgba(0, 0, 0, 0.75);\n }\n\n .shepherd-button:disabled {\n cursor: not-allowed;\n }\n</style>\n\n<button\n aria-label=\"{label ? label : null}\"\n class=\"{`${(classes || '')} shepherd-button ${(secondary ? 'shepherd-button-secondary' : '')}`}\"\n disabled={disabled}\n on:click={action}\n tabindex=\"0\"\n>\n {text}\n</button>\n","<script>\n import ShepherdButton from './shepherd-button.svelte';\n\n export let step;\n\n $: buttons = step.options.buttons;\n</script>\n\n<style global>\n .shepherd-footer {\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n display: flex;\n justify-content: flex-end;\n padding: 0 0.75rem 0.75rem;\n }\n\n .shepherd-footer .shepherd-button:last-child {\n margin-right: 0;\n }\n</style>\n\n<footer class=\"shepherd-footer\">\n {#if buttons}\n {#each buttons as config}\n <ShepherdButton\n {config}\n {step}\n />\n {/each}\n {/if}\n</footer>\n","<script>\n export let cancelIcon, step;\n\n /**\n * Add a click listener to the cancel link that cancels the tour\n */\n const handleCancelClick = (e) => {\n e.preventDefault();\n step.cancel();\n };\n</script>\n\n<style global>\n .shepherd-cancel-icon {\n background: transparent;\n border: none;\n color: rgba(128, 128, 128, 0.75);\n font-size: 2em;\n cursor: pointer;\n font-weight: normal;\n margin: 0;\n padding: 0;\n transition: color 0.5s ease;\n }\n\n .shepherd-cancel-icon:hover {\n color: rgba(0, 0, 0, 0.75);\n }\n\n .shepherd-has-title .shepherd-content .shepherd-cancel-icon {\n color: rgba(128, 128, 128, 0.75);\n }\n\n .shepherd-has-title .shepherd-content .shepherd-cancel-icon:hover {\n color: rgba(0, 0, 0, 0.75);\n }\n</style>\n\n<button\n aria-label=\"{cancelIcon.label ? cancelIcon.label : 'Close Tour'}\"\n class=\"shepherd-cancel-icon\"\n on:click={handleCancelClick}\n type=\"button\"\n>\n <span aria-hidden=\"true\">×</span>\n</button>\n","<script>\n import { afterUpdate } from 'svelte';\n import { isFunction } from '../utils/type-check';\n \n export let labelId, element, title;\n \n afterUpdate(() => {\n if (isFunction(title)) {\n title = title();\n }\n \n element.innerHTML = title;\n });\n</script>\n\n<style global>\n .shepherd-title {\n color: rgba(0, 0, 0, 0.75);\n display: flex;\n font-size: 1rem;\n font-weight: normal;\n flex: 1 0 auto;\n margin: 0;\n padding: 0;\n }\n</style>\n\n<h3\n bind:this={element}\n id=\"{labelId}\"\n class=\"shepherd-title\"\n>\n</h3>\n","<script>\n import ShepherdCancelIcon from './shepherd-cancel-icon.svelte';\n import ShepherdTitle from './shepherd-title.svelte';\n\n export let labelId, step;\n let title, cancelIcon;\n\n $: {\n title = step.options.title;\n cancelIcon = step.options.cancelIcon;\n }\n</script>\n\n<style global>\n .shepherd-header {\n align-items: center;\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n display: flex;\n justify-content: flex-end;\n line-height: 2em;\n padding: 0.75rem 0.75rem 0;\n }\n\n .shepherd-has-title .shepherd-content .shepherd-header {\n background: #e6e6e6;\n padding: 1em;\n }\n</style>\n\n<header class=\"shepherd-header\">\n {#if title}\n <ShepherdTitle\n {labelId}\n {title}\n />\n {/if}\n\n {#if cancelIcon && cancelIcon.enabled}\n <ShepherdCancelIcon\n {cancelIcon}\n {step}\n />\n {/if}\n</header>\n","<script>\n import { afterUpdate } from 'svelte';\n import { isElement, isFunction } from '../utils/type-check';\n\n export let descriptionId, element, step;\n\n afterUpdate(() => {\n let { text } = step.options;\n\n if (isFunction(text)) {\n text = text.call(step);\n }\n\n if (isElement(text)) {\n element.appendChild(text);\n } else {\n element.innerHTML = text;\n }\n });\n</script>\n\n<style global>\n .shepherd-text {\n color: rgba(0, 0, 0, 0.75);\n font-size: 1rem;\n line-height: 1.3em;\n padding: 0.75em;\n }\n\n .shepherd-text p {\n margin-top: 0;\n }\n\n .shepherd-text p:last-child {\n margin-bottom: 0;\n }\n</style>\n\n<div\n bind:this={element}\n class=\"shepherd-text\"\n id=\"{descriptionId}\"\n>\n</div>\n\n","<script>\n import ShepherdFooter from './shepherd-footer.svelte';\n import ShepherdHeader from './shepherd-header.svelte';\n import ShepherdText from './shepherd-text.svelte';\n import { isUndefined } from '../utils/type-check.js';\n\n export let descriptionId, labelId, step;\n</script>\n\n<style global>\n .shepherd-content {\n border-radius: 5px;\n outline: none;\n padding: 0;\n }\n</style>\n\n<div\n class=\"shepherd-content\"\n>\n <ShepherdHeader\n {labelId}\n {step}\n />\n\n {#if !isUndefined(step.options.text)}\n <ShepherdText\n {descriptionId}\n {step}\n />\n {/if}\n\n {#if Array.isArray(step.options.buttons) && step.options.buttons.length}\n <ShepherdFooter\n {step}\n />\n {/if}\n</div>\n\n","<script>\n import { onMount, afterUpdate } from 'svelte';\n import ShepherdContent from './shepherd-content.svelte';\n import { isUndefined, isString } from '../utils/type-check.js';\n\n const KEY_TAB = 9;\n const KEY_ESC = 27;\n const LEFT_ARROW = 37;\n const RIGHT_ARROW = 39;\n\n export let classPrefix, element, descriptionId, firstFocusableElement,\n focusableElements, labelId, lastFocusableElement, step, dataStepId;\n\n let hasCancelIcon, hasTitle, classes;\n\n $: {\n hasCancelIcon = step.options && step.options.cancelIcon && step.options.cancelIcon.enabled;\n hasTitle = step.options && step.options.title;\n }\n\n export const getElement = () => element;\n\n onMount(() => {\n // Get all elements that are focusable\n dataStepId = { [`data-${classPrefix}shepherd-step-id`]: step.id };\n focusableElements = element.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex=\"0\"]');\n firstFocusableElement = focusableElements[0];\n lastFocusableElement = focusableElements[focusableElements.length - 1];\n });\n\n afterUpdate(() => {\n if(classes !== step.options.classes) {\n updateDynamicClasses();\n }\n });\n\n function updateDynamicClasses() {\n removeClasses(classes);\n classes = step.options.classes;\n addClasses(classes);\n }\n\n function removeClasses(classes) {\n if (isString(classes)) {\n const oldClasses = getClassesArray(classes);\n if (oldClasses.length) {\n element.classList.remove(...oldClasses);\n }\n }\n }\n\n function addClasses(classes) {\n if(isString(classes)) {\n const newClasses = getClassesArray(classes);\n if (newClasses.length) {\n element.classList.add(...newClasses);\n }\n }\n }\n\n function getClassesArray(classes) {\n return classes.split(' ').filter(className => !!className.length);\n }\n\n /**\n * Setup keydown events to allow closing the modal with ESC\n *\n * Borrowed from this great post! https://bitsofco.de/accessible-modal-dialog/\n *\n * @private\n */\n const handleKeyDown = (e) => {\n const { tour } = step;\n switch (e.keyCode) {\n case KEY_TAB:\n if (focusableElements.length === 0) {\n e.preventDefault();\n break;\n }\n // Backward tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableElement) {\n e.preventDefault();\n lastFocusableElement.focus();\n }\n } else {\n if (document.activeElement === lastFocusableElement) {\n e.preventDefault();\n firstFocusableElement.focus();\n }\n }\n break;\n case KEY_ESC:\n if (tour.options.exitOnEsc) {\n step.cancel();\n }\n break;\n case LEFT_ARROW:\n if (tour.options.keyboardNavigation) {\n tour.back();\n }\n break;\n case RIGHT_ARROW:\n if (tour.options.keyboardNavigation) {\n tour.next();\n }\n break;\n default:\n break;\n }\n };\n</script>\n\n<style global>\n .shepherd-element {\n background: #fff;\n border-radius: 5px;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);\n max-width: 400px;\n opacity: 0;\n outline: none;\n transition: opacity 0.3s;\n z-index: 9999;\n }\n\n .shepherd-enabled.shepherd-element {\n opacity: 1;\n }\n\n .shepherd-element, .shepherd-element *, .shepherd-element *:after, .shepherd-element *:before {\n box-sizing: border-box;\n }\n\n .shepherd-element .shepherd-arrow {\n border: 16px solid transparent;\n content: '';\n display: block;\n height: 16px;\n pointer-events: none;\n position: absolute;\n width: 16px;\n z-index: 10000;\n }\n\n /**\n * Arrow on bottom of tooltip centered horizontally\n */\n .shepherd-element.shepherd-element-attached-bottom.shepherd-element-attached-center .shepherd-arrow {\n bottom: 0;\n border-top-color: #fff;\n left: 50%;\n transform: translate(-50%, 100%);\n }\n\n /**\n * Arrow on top of tooltip centered horizontally\n */\n .shepherd-element.shepherd-element-attached-top.shepherd-element-attached-center .shepherd-arrow {\n border-bottom-color: #fff;\n left: 50%;\n top: 0;\n transform: translate(-50%, -100%);\n }\n\n /**\n * Arrow on top of tooltip centered horizontally, with title color\n */\n .shepherd-element.shepherd-element-attached-top.shepherd-element-attached-center.shepherd-has-title .shepherd-arrow {\n border-bottom-color: #e6e6e6;\n }\n\n /**\n * Arrow on left of tooltip, centered vertically\n */\n .shepherd-element.shepherd-element-attached-middle.shepherd-element-attached-left .shepherd-arrow {\n border-right-color: #fff;\n left: 0;\n top: 50%;\n transform: translate(-100%, -50%);\n }\n\n /**\n * Arrow on right of tooltip, centered vertically\n */\n .shepherd-element.shepherd-element-attached-middle.shepherd-element-attached-right .shepherd-arrow {\n border-left-color: #fff;\n right: 0;\n top: 50%;\n transform: translate(100%, -50%);\n }\n\n .shepherd-target-click-disabled.shepherd-enabled.shepherd-target,\n .shepherd-target-click-disabled.shepherd-enabled.shepherd-target * {\n pointer-events: none;\n }\n</style>\n\n<div\n aria-describedby={!isUndefined(step.options.text) ? descriptionId : null}\n aria-labelledby={step.options.title ? labelId : null}\n bind:this={element}\n class:shepherd-has-cancel-icon=\"{hasCancelIcon}\"\n class:shepherd-has-title=\"{hasTitle}\"\n class:shepherd-element=\"{true}\"\n {...dataStepId}\n on:keydown={handleKeyDown}\n role=\"dialog\"\n tabindex=\"0\"\n>\n {#if step.options.arrow && step.options.attachTo && step.options.attachTo.element}\n <div class=\"shepherd-arrow\"></div>\n {/if}\n <ShepherdContent\n {descriptionId}\n {labelId}\n {step}\n />\n</div>\n","/* smoothscroll v0.4.4 - 2019 - Dustan Kasten, Jeremias Menichelli - MIT License */\n(function () {\n 'use strict';\n\n // polyfill\n function polyfill() {\n // aliases\n var w = window;\n var d = document;\n\n // return if scroll behavior is supported and polyfill is not forced\n if (\n 'scrollBehavior' in d.documentElement.style &&\n w.__forceSmoothScrollPolyfill__ !== true\n ) {\n return;\n }\n\n // globals\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 468;\n\n // object gathering original scroll methods\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elementScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n // define timing method\n var now =\n w.performance && w.performance.now\n ? w.performance.now.bind(w.performance)\n : Date.now;\n\n /**\n * indicates if a the current browser is made by Microsoft\n * @method isMicrosoftBrowser\n * @param {String} userAgent\n * @returns {Boolean}\n */\n function isMicrosoftBrowser(userAgent) {\n var userAgentPatterns = ['MSIE ', 'Trident/', 'Edge/'];\n\n return new RegExp(userAgentPatterns.join('|')).test(userAgent);\n }\n\n /*\n * IE has rounding bug rounding down clientHeight and clientWidth and\n * rounding up scrollHeight and scrollWidth causing false positives\n * on hasScrollableSpace\n */\n var ROUNDING_TOLERANCE = isMicrosoftBrowser(w.navigator.userAgent) ? 1 : 0;\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n * @returns {undefined}\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} firstArg\n * @returns {Boolean}\n */\n function shouldBailOut(firstArg) {\n if (\n firstArg === null ||\n typeof firstArg !== 'object' ||\n firstArg.behavior === undefined ||\n firstArg.behavior === 'auto' ||\n firstArg.behavior === 'instant'\n ) {\n // first argument is not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof firstArg === 'object' && firstArg.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError(\n 'behavior member of ScrollOptions ' +\n firstArg.behavior +\n ' is not a valid value for enumeration ScrollBehavior.'\n );\n }\n\n /**\n * indicates if an element has scrollable space in the provided axis\n * @method hasScrollableSpace\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function hasScrollableSpace(el, axis) {\n if (axis === 'Y') {\n return el.clientHeight + ROUNDING_TOLERANCE < el.scrollHeight;\n }\n\n if (axis === 'X') {\n return el.clientWidth + ROUNDING_TOLERANCE < el.scrollWidth;\n }\n }\n\n /**\n * indicates if an element has a scrollable overflow property in the axis\n * @method canOverflow\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function canOverflow(el, axis) {\n var overflowValue = w.getComputedStyle(el, null)['overflow' + axis];\n\n return overflowValue === 'auto' || overflowValue === 'scroll';\n }\n\n /**\n * indicates if an element can be scrolled in either axis\n * @method isScrollable\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function isScrollable(el) {\n var isScrollableY = hasScrollableSpace(el, 'Y') && canOverflow(el, 'Y');\n var isScrollableX = hasScrollableSpace(el, 'X') && canOverflow(el, 'X');\n\n return isScrollableY || isScrollableX;\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Node} el\n * @returns {Node} el\n */\n function findScrollableParent(el) {\n while (el !== d.body && isScrollable(el) === false) {\n el = el.parentNode || el.host;\n }\n\n return el;\n }\n\n /**\n * self invoked function that, given a context, steps through scrolling\n * @method step\n * @param {Object} context\n * @returns {undefined}\n */\n function step(context) {\n var time = now();\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - context.startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = context.startX + (context.x - context.startX) * value;\n currentY = context.startY + (context.y - context.startY) * value;\n\n context.method.call(context.scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (currentX !== context.x || currentY !== context.y) {\n w.requestAnimationFrame(step.bind(w, context));\n }\n }\n\n /**\n * scrolls window or element with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n * @returns {undefined}\n */\n function smoothScroll(el, x, y) {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = now();\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n step({\n scrollable: scrollable,\n method: method,\n startTime: startTime,\n startX: startX,\n startY: startY,\n x: x,\n y: y\n });\n }\n\n // ORIGINAL METHODS OVERRIDES\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.scroll.call(\n w,\n arguments[0].left !== undefined\n ? arguments[0].left\n : typeof arguments[0] !== 'object'\n ? arguments[0]\n : w.scrollX || w.pageXOffset,\n // use top prop, second argument if present or fallback to scrollY\n arguments[0].top !== undefined\n ? arguments[0].top\n : arguments[1] !== undefined\n ? arguments[1]\n : w.scrollY || w.pageYOffset\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n arguments[0].left !== undefined\n ? ~~arguments[0].left\n : w.scrollX || w.pageXOffset,\n arguments[0].top !== undefined\n ? ~~arguments[0].top\n : w.scrollY || w.pageYOffset\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left !== undefined\n ? arguments[0].left\n : typeof arguments[0] !== 'object' ? arguments[0] : 0,\n arguments[0].top !== undefined\n ? arguments[0].top\n : arguments[1] !== undefined ? arguments[1] : 0\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n // if one number is passed, throw error to match Firefox implementation\n if (typeof arguments[0] === 'number' && arguments[1] === undefined) {\n throw new SyntaxError('Value could not be converted');\n }\n\n original.elementScroll.call(\n this,\n // use left prop, first number argument or fallback to scrollLeft\n arguments[0].left !== undefined\n ? ~~arguments[0].left\n : typeof arguments[0] !== 'object' ? ~~arguments[0] : this.scrollLeft,\n // use top prop, second argument or fallback to scrollTop\n arguments[0].top !== undefined\n ? ~~arguments[0].top\n : arguments[1] !== undefined ? ~~arguments[1] : this.scrollTop\n );\n\n return;\n }\n\n var left = arguments[0].left;\n var top = arguments[0].top;\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n typeof left === 'undefined' ? this.scrollLeft : ~~left,\n typeof top === 'undefined' ? this.scrollTop : ~~top\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.elementScroll.call(\n this,\n arguments[0].left !== undefined\n ? ~~arguments[0].left + this.scrollLeft\n : ~~arguments[0] + this.scrollLeft,\n arguments[0].top !== undefined\n ? ~~arguments[0].top + this.scrollTop\n : ~~arguments[1] + this.scrollTop\n );\n\n return;\n }\n\n this.scroll({\n left: ~~arguments[0].left + this.scrollLeft,\n top: ~~arguments[0].top + this.scrollTop,\n behavior: arguments[0].behavior\n });\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.scrollIntoView.call(\n this,\n arguments[0] === undefined ? true : arguments[0]\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n var scrollableParent = findScrollableParent(this);\n var parentRects = scrollableParent.getBoundingClientRect();\n var clientRects = this.getBoundingClientRect();\n\n if (scrollableParent !== d.body) {\n // reveal element inside parent\n smoothScroll.call(\n this,\n scrollableParent,\n scrollableParent.scrollLeft + clientRects.left - parentRects.left,\n scrollableParent.scrollTop + clientRects.top - parentRects.top\n );\n\n // reveal parent in viewport unless is fixed\n if (w.getComputedStyle(scrollableParent).position !== 'fixed') {\n w.scrollBy({\n left: parentRects.left,\n top: parentRects.top,\n behavior: 'smooth'\n });\n }\n } else {\n // reveal element in viewport\n w.scrollBy({\n left: clientRects.left,\n top: clientRects.top,\n behavior: 'smooth'\n });\n }\n };\n }\n\n if (typeof exports === 'object' && typeof module !== 'undefined') {\n // commonjs\n module.exports = { polyfill: polyfill };\n } else {\n // global\n polyfill();\n }\n\n}());\n","import { Evented } from '../../node_modules/tether/src/js/evented.js';\nimport autoBind from './utils/auto-bind.js';\nimport { isElement, isFunction, isUndefined } from './utils/type-check.js';\nimport { bindAdvance } from './utils/bind.js';\nimport { setupTooltip, parseAttachTo, normalizePrefix, uuid } from './utils/general.js';\nimport ShepherdElement from './components/shepherd-element.svelte';\n\n// Polyfills\nimport smoothscroll from 'smoothscroll-polyfill';\n\nsmoothscroll.polyfill();\n\n/**\n * A class representing steps to be added to a tour.\n * @extends {Evented}\n */\nexport class Step extends Evented {\n /**\n * Create a step\n * @param {Tour} tour The tour for the step\n * @param {Object} options The options for the step\n * @param {Object} options.arrow Whether to display the arrow for the tooltip or not.\n * @param {Object} options.attachTo What element the step should be attached to on the page.\n * It should be an object with the properties `element` and `on`, where `element` is an element selector string\n * or a DOM element and `on` is the optional direction to place the Tippy tooltip.\n *\n * ```js\n * const new Step(tour, {\n * attachTo: { element: '.some .selector-path', on: 'left' },\n * ...moreOptions\n * })'\n * ```\n *\n * If you don’t specify an attachTo the element will appear in the middle of the screen.\n * If you omit the `on` portion of `attachTo`, the element will still be highlighted, but the tooltip will appear\n * in the middle of the screen, without an arrow pointing to the target.\n * @param {HTMLElement|string} options.attachTo.element\n * @param {string} options.attachTo.on\n * @param {Object} options.advanceOn An action on the page which should advance shepherd to the next step.\n * It should be an object with a string `selector` and an `event` name\n * ```js\n * const new Step(tour, {\n * advanceOn: { selector: '.some .selector-path', event: 'click' },\n * ...moreOptions\n * })'\n * ```\n * `event` doesn’t have to be an event inside the tour, it can be any event fired on any element on the page.\n * You can also always manually advance the Tour by calling `myTour.next()`.\n * @param {function} options.beforeShowPromise A function that returns a promise.\n * When the promise resolves, the rest of the `show` code for the step will execute.\n * @param {Object[]} options.buttons An array of buttons to add to the step. These will be rendered in a\n * footer below the main body text.\n * @param {function} options.buttons.button.action A function executed when the button is clicked on.\n * It is automatically bound to the `tour` the step is associated with, so things like `this.next` will\n * work inside the action.\n * You can use action to skip steps or navigate to specific steps, with something like:\n * ```js\n * action() {\n * return this.show('some_step_name');\n * }\n * ```\n * @param {string} options.buttons.button.classes Extra classes to apply to the `<a>`\n * @param {boolean} options.buttons.button.secondary If true, a shepherd-button-secondary class is applied to the button\n * @param {string} options.buttons.button.text The HTML text of the button\n * @param {boolean} options.buttons.button.disabled Should the button be disabled?\n * @param {string} options.buttons.button.label The aria-label text of the button\n * @param {boolean} options.canClickTarget A boolean, that when set to false, will set `pointer-events: none` on the target\n * @param {object} options.cancelIcon Options for the cancel icon\n * @param {boolean} options.cancelIcon.enabled Should a cancel “✕” be shown in the header of the step?\n * @param {string} options.cancelIcon.label The label to add for `aria-label`\n * @param {string} options.classes A string of extra classes to add to the step's content element.\n * @param {string} options.highlightClass An extra class to apply to the `attachTo` element when it is\n * highlighted (that is, when its step is active). You can then target that selector in your CSS.\n * @param {string} options.id The string to use as the `id` for the step.\n * @param {boolean|Object} options.scrollTo Should the element be scrolled to when this step is shown? If true, uses the default `scrollIntoView`,\n * if an object, passes that object as the params to `scrollIntoView` i.e. `{behavior: 'smooth', block: 'center'}`\n * @param {function} options.scrollToHandler A function that lets you override the default scrollTo behavior and\n * define a custom action to do the scrolling, and possibly other logic.\n * @param {function} options.showOn A function that, when it returns `true`, will show the step.\n * If it returns false, the step will be skipped.\n * @param {string} options.tetherOptions Extra options to pass to tether\n * @param {string} options.text The text in the body of the step. It can be one of three types:\n * ```\n * - HTML string\n * - `HTMLElement` object\n * - `Function` to be executed when the step is built. It must return one the two options above.\n * ```\n * @param {string} options.title The step's title. It becomes an `h3` at the top of the step. It can be one of two types:\n * ```\n * - HTML string\n * - `Function` to be executed when the step is built. It must return HTML string.\n * ```\n * @param {Object} options.when You can define `show`, `hide`, etc events inside `when`. For example:\n * ```js\n * when: {\n * show: function() {\n * window.scrollTo(0, 0);\n * }\n * }\n * ```\n * @param {Number} options.modalOverlayOpeningPadding An amount of padding to add around the modal overlay opening\n * @return {Step} The newly created Step instance\n */\n constructor(tour, options = {}) {\n super(tour, options);\n this.tour = tour;\n this.classPrefix = this.tour.options ? normalizePrefix(this.tour.options.classPrefix) : '';\n this.styles = tour.styles;\n\n autoBind(this);\n\n this._setOptions(options);\n\n return this;\n }\n\n /**\n * Cancel the tour\n * Triggers the `cancel` event\n */\n cancel() {\n this.tour.cancel();\n this.trigger('cancel');\n }\n\n /**\n * Complete the tour\n * Triggers the `complete` event\n */\n complete() {\n this.tour.complete();\n this.trigger('complete');\n }\n\n /**\n * Remove the step, delete the step's element, and destroy the tippy instance for the step\n * Triggers `destroy` event\n */\n destroy() {\n if (this.tooltip) {\n this.tooltip.destroy();\n this.tooltip = null;\n }\n\n if (isElement(this.el) && this.el.parentNode) {\n this.el.parentNode.removeChild(this.el);\n this.el = null;\n }\n\n if (this.target) {\n this._updateStepTargetOnHide();\n }\n\n this.trigger('destroy');\n }\n\n /**\n * Returns the tour for the step\n * @return {Tour} The tour instance\n */\n getTour() {\n return this.tour;\n }\n\n /**\n * Hide the step\n */\n hide() {\n this.tour.modal.hide();\n\n this.trigger('before-hide');\n\n if (this.el) {\n this.el.hidden = true;\n }\n\n if (this.target) {\n this._updateStepTargetOnHide();\n }\n\n this.trigger('hide');\n }\n\n /**\n * Check if the step is open and visible\n * @return {boolean} True if the step is open and visible\n */\n isOpen() {\n return Boolean(this.el && !this.el.hidden);\n }\n\n /**\n * Wraps `_show` and ensures `beforeShowPromise` resolves before calling show\n * @return {*|Promise}\n */\n show() {\n if (isFunction(this.options.beforeShowPromise)) {\n const beforeShowPromise = this.options.beforeShowPromise();\n if (!isUndefined(beforeShowPromise)) {\n return beforeShowPromise.then(() => this._show());\n }\n }\n this._show();\n }\n\n /**\n * Updates the options of the step.\n *\n * @param {Object} options The options for the step\n */\n updateStepOptions(options) {\n Object.assign(this.options, options);\n\n if (this.shepherdElementComponent) {\n this.shepherdElementComponent.$set({ step: this });\n }\n }\n\n /**\n * Creates Shepherd element for step based on options\n *\n * @return {Element} The DOM element for the step tooltip\n * @private\n */\n _createTooltipContent() {\n const descriptionId = `${this.id}-description`;\n const labelId = `${this.id}-label`;\n\n this.shepherdElementComponent = new ShepherdElement({\n target: document.body,\n props:\n {\n classPrefix: this.classPrefix,\n descriptionId,\n labelId,\n step: this,\n styles: this.styles\n }\n });\n\n return this.shepherdElementComponent.getElement();\n }\n\n /**\n * If a custom scrollToHandler is defined, call that, otherwise do the generic\n * scrollIntoView call.\n *\n * @param {boolean|Object} scrollToOptions If true, uses the default `scrollIntoView`,\n * if an object, passes that object as the params to `scrollIntoView` i.e. `{ behavior: 'smooth', block: 'center' }`\n * @private\n */\n _scrollTo(scrollToOptions) {\n const { element } = parseAttachTo(this);\n\n if (isFunction(this.options.scrollToHandler)) {\n this.options.scrollToHandler(element);\n } else if (isElement(element) && typeof element.scrollIntoView === 'function') {\n element.scrollIntoView(scrollToOptions);\n }\n }\n\n /**\n * _getClassOptions gets all possible classes for the step\n * @param {Object} stepOptions The step specific options\n * @returns {String} unique string from array of classes\n * @private\n */\n _getClassOptions(stepOptions) {\n const defaultStepOptions =\n this.tour && this.tour.options && this.tour.options.defaultStepOptions;\n const stepClasses = stepOptions.classes ? stepOptions.classes : '';\n const defaultStepOptionsClasses =\n defaultStepOptions && defaultStepOptions.classes\n ? defaultStepOptions.classes\n : '';\n const allClasses = [\n ...stepClasses.split(' '),\n ...defaultStepOptionsClasses.split(' ')\n ];\n const uniqClasses = new Set(allClasses);\n\n return Array.from(uniqClasses)\n .join(' ')\n .trim();\n }\n\n /**\n * Sets the options for the step, maps `when` to events, sets up buttons\n * @param {Object} options The options for the step\n * @private\n */\n _setOptions(options = {}) {\n const tourOptions =\n this.tour && this.tour.options && this.tour.options.defaultStepOptions;\n\n this.options = Object.assign(\n {\n arrow: true\n },\n tourOptions,\n options\n );\n\n const { when } = this.options;\n\n this.options.classes = this._getClassOptions(options);\n\n this.destroy();\n this.id = this.options.id || `step-${uuid()}`;\n\n if (when) {\n Object.keys(when).forEach((event) => {\n this.on(event, when[event], this);\n });\n }\n }\n\n /**\n * Create the element and set up the Tether instance\n * @private\n */\n _setupElements() {\n if (!isUndefined(this.el)) {\n this.destroy();\n }\n\n this.el = this._createTooltipContent();\n\n if (this.options.advanceOn) {\n bindAdvance(this);\n }\n\n setupTooltip(this);\n }\n\n /**\n * Triggers `before-show`, generates the tooltip DOM content,\n * sets up a Tether instance for the tooltip, then triggers `show`.\n * @private\n */\n _show() {\n this.trigger('before-show');\n\n this._setupElements();\n\n this.tour.modal.setupForStep(this);\n this._styleTargetElementForStep(this);\n\n this.el.hidden = false;\n\n this.tooltip.position();\n\n const target = this.target || document.body;\n target.classList.add(`${this.classPrefix}shepherd-enabled`, `${this.classPrefix}shepherd-target`);\n\n if (this.options.scrollTo) {\n setTimeout(() => {\n this._scrollTo(this.options.scrollTo);\n });\n }\n\n this.trigger('show');\n this.el.focus();\n }\n\n /**\n * Modulates the styles of the passed step's target element, based on the step's options and\n * the tour's `modal` option, to visually emphasize the element\n *\n * @param step The step object that attaches to the element\n * @private\n */\n _styleTargetElementForStep(step) {\n const targetElement = step.target;\n\n if (!targetElement) {\n return;\n }\n\n if (step.options.highlightClass) {\n targetElement.classList.add(step.options.highlightClass);\n }\n\n if (step.options.canClickTarget === false) {\n targetElement.classList.add('shepherd-target-click-disabled');\n }\n }\n\n /**\n * When a step is hidden, remove the highlightClass and 'shepherd-enabled'\n * and 'shepherd-target' classes\n * @private\n */\n _updateStepTargetOnHide() {\n if (this.options.highlightClass) {\n this.target.classList.remove(this.options.highlightClass);\n }\n\n this.target.classList.remove(`${this.classPrefix}shepherd-enabled`, `${this.classPrefix}shepherd-target`);\n }\n}\n","/**\n * Cleanup the steps and set pointerEvents back to 'auto'\n * @param tour The tour object\n */\nexport function cleanupSteps(tour) {\n if (tour) {\n const { steps } = tour;\n\n steps.forEach((step) => {\n if (step.options && step.options.canClickTarget === false && step.options.attachTo) {\n if (step.target instanceof HTMLElement) {\n step.target.classList.remove('shepherd-target-click-disabled');\n }\n }\n });\n }\n}\n","<script>\n import { uuid } from '../utils/general.js';\n\n export let element, openingProperties;\n const guid = uuid();\n let modalIsVisible = false;\n let rafId = undefined;\n\n closeModalOpening();\n\n export const getElement = () => element;\n\n export function closeModalOpening() {\n openingProperties = {\n height: 0,\n x: 0,\n y: 0,\n width: 0\n };\n }\n\n /**\n * Hide the modal overlay\n */\n export function hide() {\n modalIsVisible = false;\n\n // Ensure we cleanup all event listeners when we hide the modal\n _cleanupStepEventListeners();\n }\n\n /**\n * Uses the bounds of the element we want the opening overtop of to set the dimensions of the opening and position it\n * @param {HTMLElement} targetElement The element the opening will expose\n * @param {HTMLElement} scrollParent The scrollable parent of the target element\n * @param {Number} modalOverlayOpeningPadding An amount of padding to add around the modal overlay opening\n */\n export function positionModalOpening(targetElement, scrollParent, modalOverlayOpeningPadding = 0) {\n if (targetElement.getBoundingClientRect) {\n const { y, height } = _getVisibleHeight(targetElement, scrollParent);\n const { x, width, left } = targetElement.getBoundingClientRect();\n\n // getBoundingClientRect is not consistent. Some browsers use x and y, while others use left and top\n openingProperties = {\n x: (x || left) - modalOverlayOpeningPadding,\n y: y - modalOverlayOpeningPadding,\n width: (width + (modalOverlayOpeningPadding * 2)),\n height: (height + (modalOverlayOpeningPadding * 2))\n };\n }\n }\n\n /**\n * If modal is enabled, setup the svg mask opening and modal overlay for the step\n * @param {Step} step The step instance\n */\n export function setupForStep(step) {\n // Ensure we move listeners from the previous step, before we setup new ones\n _cleanupStepEventListeners();\n\n if (step.tour.options.useModalOverlay) {\n _styleForStep(step);\n show();\n } else {\n hide();\n }\n }\n\n /**\n * Show the modal overlay\n */\n export function show() {\n modalIsVisible = true;\n }\n\n const _preventModalBodyTouch = (e) => {\n e.preventDefault();\n };\n\n const _preventModalOverlayTouch = (e) => {\n e.stopPropagation();\n };\n\n /**\n * Add touchmove event listener\n * @private\n */\n function _addStepEventListeners() {\n // Prevents window from moving on touch.\n window.addEventListener('touchmove', _preventModalBodyTouch, {\n passive: false\n });\n }\n\n /**\n * Cancel the requestAnimationFrame loop and remove touchmove event listeners\n * @private\n */\n function _cleanupStepEventListeners() {\n if (rafId) {\n cancelAnimationFrame(rafId);\n rafId = undefined;\n }\n\n window.removeEventListener('touchmove', _preventModalBodyTouch, {\n passive: false\n });\n }\n\n /**\n * Style the modal for the step\n * @param {Step} step The step to style the opening for\n * @private\n */\n function _styleForStep(step) {\n const { modalOverlayOpeningPadding } = step.options;\n\n if (step.target) {\n const scrollParent = _getScrollParent(step.target);\n\n // Setup recursive function to call requestAnimationFrame to update the modal opening position\n const rafLoop = () => {\n rafId = undefined;\n positionModalOpening(step.target, scrollParent, modalOverlayOpeningPadding);\n rafId = requestAnimationFrame(rafLoop);\n };\n\n rafLoop();\n\n _addStepEventListeners();\n } else {\n closeModalOpening();\n }\n }\n\n /**\n * Find the closest scrollable parent element\n * @param {HTMLElement} element The target element\n * @returns {HTMLElement}\n * @private\n */\n function _getScrollParent(element) {\n if (!element) {\n return null;\n }\n\n const isHtmlElement = element instanceof HTMLElement;\n const overflowY = isHtmlElement && window.getComputedStyle(element).overflowY;\n const isScrollable = overflowY !== 'hidden' && overflowY !== 'visible';\n\n\n if (isScrollable && element.scrollHeight >= element.clientHeight) {\n return element;\n }\n\n return _getScrollParent(element.parentElement);\n }\n\n /**\n * Get the visible height of the target element relative to its scrollParent.\n * If there is no scroll parent, the height of the element is returned.\n *\n * @param {HTMLElement} element The target element\n * @param {HTMLElement} [scrollParent] The scrollable parent element\n * @returns {{y: number, height: number}}\n * @private\n */\n function _getVisibleHeight(element, scrollParent) {\n const elementRect = element.getBoundingClientRect();\n let top = elementRect.y || elementRect.top;\n let bottom = elementRect.bottom || top + elementRect.height;\n\n if (scrollParent) {\n const scrollRect = scrollParent.getBoundingClientRect();\n const scrollTop = scrollRect.y || scrollRect.top;\n const scrollBottom = scrollRect.bottom || scrollTop + scrollRect.height;\n\n top = Math.max(top, scrollTop);\n bottom = Math.min(bottom, scrollBottom);\n }\n\n const height = Math.max(bottom - top, 0); // Default to 0 if height is negative\n\n return {y: top, height};\n }\n</script>\n\n<style global>\n .shepherd-modal-overlay-container {\n -ms-filter: progid:dximagetransform.microsoft.gradient.alpha(Opacity=50);\n filter: alpha(opacity=50);\n fill-rule: evenodd;\n height: 0;\n left: 0;\n opacity: 0;\n overflow: hidden;\n pointer-events: none;\n position: fixed;\n top: 0;\n transition: all 0.3s ease-out, height 0ms 0.3s, opacity 0.3s 0ms;\n width: 100vw;\n z-index: 9997;\n }\n\n .shepherd-modal-overlay-container.shepherd-modal-is-visible {\n height: 100vh;\n opacity: 0.5;\n transition: all 0.3s ease-out, height 0s 0s, opacity 0.3s 0s;\n }\n\n .shepherd-modal-overlay-container.shepherd-modal-is-visible path {\n pointer-events: all;\n }\n</style>\n\n<svg\n bind:this={element}\n class=\"{`${(modalIsVisible ? 'shepherd-modal-is-visible' : '')} shepherd-modal-overlay-container`}\"\n on:touchmove={_preventModalOverlayTouch}\n>\n <path\n d=\"{`M ${openingProperties.x} ${openingProperties.y} H ${openingProperties.width + openingProperties.x} V ${openingProperties.height + openingProperties.y} H ${openingProperties.x} L ${openingProperties.x} 0 Z M 0 0 H ${window.innerWidth} V ${window.innerHeight} H 0 L 0 0 Z`}\">\n </path>\n</svg>\n","import { Evented } from '../../node_modules/tether/src/js/evented.js';\nimport { Step } from './step.js';\nimport autoBind from './utils/auto-bind.js';\nimport { isElement, isFunction, isString, isUndefined } from './utils/type-check.js';\nimport { cleanupSteps } from './utils/cleanup.js';\nimport { normalizePrefix, uuid } from './utils/general.js';\nimport ShepherdModal from './components/shepherd-modal.svelte';\n\nconst Shepherd = new Evented();\n\n/**\n * Class representing the site tour\n * @extends {Evented}\n */\nexport class Tour extends Evented {\n /**\n * @param {Object} options The options for the tour\n * @param {boolean} options.confirmCancel If true, will issue a `window.confirm` before cancelling\n * @param {string} options.confirmCancelMessage The message to display in the confirm dialog\n * @param {string} options.classPrefix The prefix to add to all the `shepherd-*` class names.\n * @param {Object} options.defaultStepOptions Default options for Steps ({@link Step#constructor}), created through `addStep`\n * @param {boolean} options.exitOnEsc Exiting the tour with the escape key will be enabled unless this is explicitly\n * set to false.\n * @param {boolean} options.keyboardNavigation Navigating the tour via left and right arrow keys will be enabled\n * unless this is explicitly set to false.\n * @param {HTMLElement} options.modalContainer An optional container element for the modal.\n * If not set, the modal will be appended to `document.body`.\n * @param {object[] | Step[]} options.steps An array of step options objects or Step instances to initialize the tour with\n * @param {string} options.tourName An optional \"name\" for the tour. This will be appended to the the tour's\n * dynamically generated `id` property -- which is also set on the `body` element as the `data-shepherd-active-tour` attribute\n * whenever the tour becomes active.\n * @param {boolean} options.useModalOverlay Whether or not steps should be placed above a darkened\n * modal overlay. If true, the overlay will create an opening around the target element so that it\n * can remain interactive\n * @returns {Tour}\n */\n constructor(options = {}) {\n super(options);\n\n autoBind(this);\n\n const defaultTourOptions = {\n exitOnEsc: true,\n keyboardNavigation: true\n };\n\n this.options = Object.assign({}, defaultTourOptions, options);\n this.classPrefix = normalizePrefix(this.options.classPrefix);\n this.steps = [];\n this.addSteps(this.options.steps);\n\n // Pass these events onto the global Shepherd object\n const events = ['active', 'cancel', 'complete', 'inactive', 'show', 'start'];\n events.map((event) => {\n ((e) => {\n this.on(e, (opts) => {\n opts = opts || {};\n opts.tour = this;\n Shepherd.trigger(e, opts);\n });\n })(event);\n });\n\n this.modal = new ShepherdModal({\n target: options.modalContainer || document.body,\n props:\n {\n classPrefix: this.classPrefix,\n styles: this.styles\n }\n });\n\n this._setTourID();\n\n return this;\n }\n\n /**\n * Adds a new step to the tour\n * @param {Object|Step} options An object containing step options or a Step instance\n * @param {number} index The optional index to insert the step at. If undefined, the step\n * is added to the end of the array.\n * @return {Step} The newly added step\n */\n addStep(options, index) {\n let step = options;\n\n if (!(step instanceof Step)) {\n step = new Step(this, step);\n } else {\n step.tour = this;\n }\n\n if (!isUndefined(index)) {\n this.steps.splice(index, 0, step);\n } else {\n this.steps.push(step);\n }\n\n return step;\n }\n\n /**\n * Add multiple steps to the tour\n * @param {Array<object> | Array<Step>} steps The steps to add to the tour\n */\n addSteps(steps) {\n if (Array.isArray(steps)) {\n steps.forEach((step) => {\n this.addStep(step);\n });\n }\n\n return this;\n }\n\n /**\n * Go to the previous step in the tour\n */\n back() {\n const index = this.steps.indexOf(this.currentStep);\n this.show(index - 1, false);\n }\n\n /**\n * Calls _done() triggering the 'cancel' event\n * If `confirmCancel` is true, will show a window.confirm before cancelling\n */\n cancel() {\n if (this.options.confirmCancel) {\n const cancelMessage = this.options.confirmCancelMessage || 'Are you sure you want to stop the tour?';\n const stopTour = window.confirm(cancelMessage);\n if (stopTour) {\n this._done('cancel');\n }\n } else {\n this._done('cancel');\n }\n }\n\n /**\n * Calls _done() triggering the `complete` event\n */\n complete() {\n this._done('complete');\n }\n\n /**\n * Gets the step from a given id\n * @param {Number|String} id The id of the step to retrieve\n * @return {Step} The step corresponding to the `id`\n */\n getById(id) {\n return this.steps.find((step) => {\n return step.id === id;\n });\n }\n\n /**\n * Gets the current step\n * @returns {Step|null}\n */\n getCurrentStep() {\n return this.currentStep;\n }\n\n /**\n * Hide the current step\n */\n hide() {\n const currentStep = this.getCurrentStep();\n\n if (currentStep) {\n return currentStep.hide();\n }\n }\n\n /**\n * Check if the tour is active\n * @return {boolean}\n */\n isActive() {\n return Shepherd.activeTour === this;\n }\n\n /**\n * Go to the next step in the tour\n * If we are at the end, call `complete`\n */\n next() {\n const index = this.steps.indexOf(this.currentStep);\n\n if (index === this.steps.length - 1) {\n this.complete();\n } else {\n this.show(index + 1, true);\n }\n }\n\n /**\n * Removes the step from the tour\n * @param {String} name The id for the step to remove\n */\n removeStep(name) {\n const current = this.getCurrentStep();\n\n // Find the step, destroy it and remove it from this.steps\n this.steps.some((step, i) => {\n if (step.id === name) {\n if (step.isOpen()) {\n step.hide();\n }\n\n step.destroy();\n this.steps.splice(i, 1);\n\n return true;\n }\n });\n\n if (current && current.id === name) {\n this.currentStep = undefined;\n\n // If we have steps left, show the first one, otherwise just cancel the tour\n this.steps.length ? this.show(0) : this.cancel();\n }\n }\n\n /**\n * Show a specific step in the tour\n * @param {Number|String} key The key to look up the step by\n * @param {Boolean} forward True if we are going forward, false if backward\n */\n show(key = 0, forward = true) {\n const step = isString(key) ? this.getById(key) : this.steps[key];\n\n if (step) {\n this._updateStateBeforeShow();\n\n const shouldSkipStep = isFunction(step.options.showOn) && !step.options.showOn();\n\n // If `showOn` returns false, we want to skip the step, otherwise, show the step like normal\n if (shouldSkipStep) {\n this._skipStep(step, forward);\n } else {\n this.trigger('show', {\n step,\n previous: this.currentStep\n });\n\n this.currentStep = step;\n step.show();\n }\n }\n }\n\n /**\n * Start the tour\n */\n start() {\n this.trigger('start');\n\n // Save the focused element before the tour opens\n this.focusedElBeforeOpen = document.activeElement;\n\n this.currentStep = null;\n this._setupActiveTour();\n this.next();\n }\n\n /**\n * Called whenever the tour is cancelled or completed, basically anytime we exit the tour\n * @param {String} event The event name to trigger\n * @private\n */\n _done(event) {\n const index = this.steps.indexOf(this.currentStep);\n if (Array.isArray(this.steps)) {\n this.steps.forEach((step) => step.destroy());\n }\n\n cleanupSteps(this);\n\n this.trigger(event, { index });\n\n Shepherd.activeTour = null;\n this.trigger('inactive', { tour: this });\n\n this.modal.hide();\n\n // Focus the element that was focused before the tour started\n if (isElement(this.focusedElBeforeOpen)) {\n this.focusedElBeforeOpen.focus();\n }\n }\n\n /**\n * Make this tour \"active\"\n * @private\n */\n _setupActiveTour() {\n this.trigger('active', { tour: this });\n\n Shepherd.activeTour = this;\n }\n\n /**\n * Called when `showOn` evaluates to false, to skip the step\n * @param {Step} step The step to skip\n * @param {Boolean} forward True if we are going forward, false if backward\n * @private\n */\n _skipStep(step, forward) {\n const index = this.steps.indexOf(step);\n const nextIndex = forward ? index + 1 : index - 1;\n this.show(nextIndex, forward);\n }\n\n /**\n * Before showing, hide the current step and if the tour is not\n * already active, call `this._setupActiveTour`.\n * @private\n */\n _updateStateBeforeShow() {\n if (this.currentStep) {\n this.currentStep.hide();\n }\n\n if (!this.isActive()) {\n this._setupActiveTour();\n }\n }\n\n /**\n * Sets this.id to `${tourName}--${uuid}`\n * @private\n */\n _setTourID() {\n const tourName = this.options.tourName || 'tour';\n\n this.id = `${tourName}--${uuid()}`;\n }\n}\n\nexport { Shepherd };\n","import { Step } from './step.js';\nimport { Shepherd, Tour } from './tour.js';\n\nObject.assign(Shepherd, { Tour, Step });\n\nexport default Shepherd;\n"],"names":["isUndefined","value","undefined","Evented","on","event","handler","ctx","once","bindings","push","off","forEach","binding","index","splice","trigger","args","context","apply","autoBind","self","keys","Object","getOwnPropertyNames","constructor","prototype","i","length","key","val","bind","isElement","HTMLElement","isFunction","isString","_setupAdvanceOnHandler","selector","step","isOpen","targetIsEl","el","currentTarget","targetIsSelector","matches","tour","next","bindAdvance","options","advanceOn","document","querySelector","e","console","error","addEventListener","removeEventListener","body","_inheritsLoose","subClass","superClass","create","__proto__","_assertThisInitialized","ReferenceError","isNumber","isObject","addClass","name","split","cls","trim","classList","add","getClass","classes","classPrefix","removeClass","remove","updateClasses","all","indexOf","contains","deferred","defer","fn","flush","pop","_scrollBarSize","extend","out","Array","arguments","slice","obj","hasOwnProperty","call","getScrollBarSize","inner","createElement","style","width","height","outer","position","top","left","pointerEvents","visibility","overflow","appendChild","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","Abutment","_ref","_this","_this$cache","cache","element","targetPos","getTargetBounds","abutted","side","targetPosSide","sides","_this$options","addTargetClasses","BOUNDS_FORMAT","getBoundingRect","tether","to","scrollParents","nodeType","size","pos","win","toUpperCase","substr","_addOutOfBoundsClass","oob","addClasses","outOfBoundsClass","oobClass","_calculateOOBAndPinnedLeft","pin","pinned","_calculateOOBAndPinnedTop","_flipXTogether","tAttachment","eAttachment","targetWidth","_flipYTogether","targetHeight","_getAllClasses","constraints","allClasses","constraint","pinnedClass","Constraint","targetAttachment","lastSize","_this$lastSize","targetSize","attachment","changeAttachX","changeAttachY","_attachment$split","map","p","updateAttachClasses","Shift","shift","shiftTop","shiftLeft","_shift","_ref2","_proto","_this2","_len","_key","MIRROR_LR","center","MIRROR_TB","middle","OFFSET_MAP","addOffset","offsets","attachmentToOffset","autoToFixedAttachment","relativeToAttachment","offsetToPx","offset","parseTopLeft","_value$split","getScrollParents","computedStyle","parents","parent","parentNode","_style","overflowY","test","getOffsetParent","offsetParent","TetherBase","modules","isFullscreenElement","d","fe","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","within","a","b","diff","transformKey","transforms","tethers","now","performance","lastCall","lastDuration","pendingTimeout","tick","setTimeout","clearTimeout","window","TetherClass","_Evented","history","setOptions","module","initialize","defaults","targetOffset","targetModifier","Error","jquery","_addClasses","disable","enabled","enable","clearCache","_cache","getter","_this3","_this$options2","_this4","_this$options3","destroy","_this5","_removeClasses","elementAttach","targetAttach","_this6","_this$options4","_addAttachClasses","flushChanges","_this7","elementPos","manualOffset","manualTargetOffset","ret","scrollbarSize","page","viewport","parentElement","optimizations","moveElement","offsetPosition","offsetParentStyle","offsetParentSize","offsetBorder","toLowerCase","scrollLeft","move","unshift","_this8","same","type","found","point","css","transcribe","_same","_pos","hasOptimizations","gpu","yPos","xPos","devicePixelRatio","round","allowPositionFixed","moved","bodyElement","offsetParentIsBody","currentNode","tagName","writeCSS","write","elVal","_this$options5","_this9","_this$options6","className","Tether","_this10","_this$options7","markers","dot","ATTACHMENT","normalizePrefix","prefix","charAt","parseAttachTo","attachTo","returnOpts","assign","setupTooltip","tooltip","attachToOpts","tetherOptions","getTetherOptions","uuid","Date","replace","c","r","random","floor","toString","attachToOptions","noop","tar","src","run","blank_object","run_all","fns","is_function","thing","safe_not_equal","append","insert","anchor","insertBefore","detach","destroy_each","iterations","detaching","svg_element","createElementNS","text","data","createTextNode","space","empty","listen","attr","attribute","removeAttribute","set_attributes","attributes","cssText","children","from","childNodes","set_data","toggle_class","toggle","current_component","set_current_component","component","get_current_component","onMount","$$","on_mount","afterUpdate","after_update","dirty_components","binding_callbacks","render_callbacks","flush_callbacks","resolved_promise","Promise","resolve","update_scheduled","schedule_update","then","add_render_callback","seen_callbacks","Set","update","callback","has","fragment","dirty","before_update","outroing","outros","group_outros","check_outros","transition_in","block","local","delete","transition_out","o","get_spread_update","levels","updates","to_null_out","accounted_for","$$scope","n","mount_component","on_destroy","m","new_on_destroy","filter","destroy_component","make_dirty","init","instance","create_fragment","not_equal","prop_names","parent_component","props","bound","Map","callbacks","ready","hydrate","l","intro","SvelteElement","attachShadow","mode","connectedCallback","slotted","attributeChangedCallback","_oldValue","newValue","$destroy","$on","$set","SvelteComponent","label","secondary","disabled","action","config","getDisabled","buttons","cancelIcon","handleCancelClick","preventDefault","cancel","labelId","title","innerHTML","descriptionId","isArray","arrow","dataStepId","hasCancelIcon","hasTitle","handleKeyDown","KEY_TAB","KEY_ESC","LEFT_ARROW","RIGHT_ARROW","getClassesArray","firstFocusableElement","focusableElements","lastFocusableElement","getElement","querySelectorAll","updateDynamicClasses","removeClasses","oldClasses","newClasses","keyCode","shiftKey","activeElement","focus","exitOnEsc","keyboardNavigation","back","polyfill","w","__forceSmoothScrollPolyfill__","Element","SCROLL_TIME","original","scroll","scrollTo","scrollBy","elementScroll","scrollElement","scrollIntoView","isMicrosoftBrowser","userAgent","userAgentPatterns","RegExp","join","ROUNDING_TOLERANCE","navigator","x","y","ease","cos","PI","shouldBailOut","firstArg","behavior","TypeError","hasScrollableSpace","axis","canOverflow","overflowValue","isScrollable","isScrollableY","isScrollableX","findScrollableParent","host","time","currentX","currentY","elapsed","startTime","startX","startY","method","scrollable","requestAnimationFrame","smoothScroll","scrollX","scrollY","SyntaxError","scrollableParent","parentRects","clientRects","smoothscroll","Step","styles","_setOptions","complete","_updateStepTargetOnHide","getTour","hide","modal","hidden","Boolean","show","beforeShowPromise","_show","updateStepOptions","shepherdElementComponent","_createTooltipContent","ShepherdElement","_scrollTo","scrollToOptions","scrollToHandler","_getClassOptions","stepOptions","defaultStepOptions","stepClasses","defaultStepOptionsClasses","uniqClasses","tourOptions","when","_setupElements","setupForStep","_styleTargetElementForStep","targetElement","highlightClass","canClickTarget","cleanupSteps","steps","openingProperties","modalIsVisible","_preventModalOverlayTouch","_getScrollParent","isHtmlElement","_getVisibleHeight","scrollParent","elementRect","scrollRect","guid","rafId","closeModalOpening","_cleanupStepEventListeners","positionModalOpening","modalOverlayOpeningPadding","useModalOverlay","_styleForStep","_preventModalBodyTouch","stopPropagation","_addStepEventListeners","passive","cancelAnimationFrame","rafLoop","Shepherd","Tour","defaultTourOptions","addSteps","events","opts","ShepherdModal","modalContainer","_setTourID","addStep","currentStep","confirmCancel","cancelMessage","confirmCancelMessage","stopTour","confirm","_done","getById","find","getCurrentStep","isActive","activeTour","removeStep","current","some","forward","_updateStateBeforeShow","shouldSkipStep","showOn","_skipStep","previous","start","focusedElBeforeOpen","_setupActiveTour","nextIndex","tourName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;AAIA,EA4BA;;;;;AAIA,EAAO,SAASA,WAAT,CAAqBC,KAArB,EAA4B;EACjC,SAAOA,KAAK,KAAKC,SAAjB;EACD;;MCpCYC,OAAb;EAAA;EAAA;EAAA;;EAAA;;EAAA,SACEC,EADF,GACE,YAAGC,KAAH,EAAUC,OAAV,EAAmBC,GAAnB,EAAwBC,IAAxB,EAAsC;EAAA,QAAdA,IAAc;EAAdA,MAAAA,IAAc,GAAP,KAAO;EAAA;;EACpC,QAAIR,WAAW,CAAC,KAAKS,QAAN,CAAf,EAAgC;EAC9B,WAAKA,QAAL,GAAgB,EAAhB;EACD;;EACD,QAAIT,WAAW,CAAC,KAAKS,QAAL,CAAcJ,KAAd,CAAD,CAAf,EAAuC;EACrC,WAAKI,QAAL,CAAcJ,KAAd,IAAuB,EAAvB;EACD;;EACD,SAAKI,QAAL,CAAcJ,KAAd,EAAqBK,IAArB,CAA0B;EAAEJ,MAAAA,OAAO,EAAPA,OAAF;EAAWC,MAAAA,GAAG,EAAHA,GAAX;EAAgBC,MAAAA,IAAI,EAAJA;EAAhB,KAA1B;EAEA,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