{"version":3,"file":"marathonpetroleum.min.js","sources":["../node_modules/smoothscroll-polyfill/dist/smoothscroll.js","../node_modules/stickyfilljs/dist/stickyfill.js","../node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js","../node_modules/@tanem/svg-injector/es/svg-injector.js","../node_modules/svgxuse/svgxuse.js","../node_modules/cash-dom/dist/cash.js","shared/jquery.js","marathonpetroleum/polyfills.js","marathonpetroleum/tabs.js","marathonpetroleum/smoothscroll.js","../node_modules/lodash.throttle/index.js","../node_modules/lodash.debounce/index.js","../node_modules/aos/dist/aos.esm.js","marathonpetroleum/animations.js","../node_modules/dialog-polyfill/dist/dialog-polyfill.esm.js","marathonpetroleum/modal.js","marathonpetroleum/import.js","marathonpetroleum/list.js","marathonpetroleum/carousel.js","shared/lazy-image.js","marathonpetroleum/StatesOfUS.js","marathonpetroleum.mjs"],"sourcesContent":["/* 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","/*!\r\n * Stickyfill – `position: sticky` polyfill\r\n * v. 2.1.0 | https://github.com/wilddeer/stickyfill\r\n * MIT License\r\n */\r\n\r\n;(function(window, document) {\r\n 'use strict';\r\n \r\n /*\r\n * 1. Check if the browser supports `position: sticky` natively or is too old to run the polyfill.\r\n * If either of these is the case set `seppuku` flag. It will be checked later to disable key features\r\n * of the polyfill, but the API will remain functional to avoid breaking things.\r\n */\r\n \r\n var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\r\n \r\n function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\r\n \r\n var seppuku = false;\r\n \r\n var isWindowDefined = typeof window !== 'undefined';\r\n \r\n // The polyfill can’t function properly without `window` or `window.getComputedStyle`.\r\n if (!isWindowDefined || !window.getComputedStyle) seppuku = true;\r\n // Dont’t get in a way if the browser supports `position: sticky` natively.\r\n else {\r\n (function () {\r\n var testNode = document.createElement('div');\r\n \r\n if (['', '-webkit-', '-moz-', '-ms-'].some(function (prefix) {\r\n try {\r\n testNode.style.position = prefix + 'sticky';\r\n } catch (e) {}\r\n \r\n return testNode.style.position != '';\r\n })) seppuku = true;\r\n })();\r\n }\r\n \r\n /*\r\n * 2. “Global” vars used across the polyfill\r\n */\r\n var isInitialized = false;\r\n \r\n // Check if Shadow Root constructor exists to make further checks simpler\r\n var shadowRootExists = typeof ShadowRoot !== 'undefined';\r\n \r\n // Last saved scroll position\r\n var scroll = {\r\n top: null,\r\n left: null\r\n };\r\n \r\n // Array of created Sticky instances\r\n var stickies = [];\r\n \r\n /*\r\n * 3. Utility functions\r\n */\r\n function extend(targetObj, sourceObject) {\r\n for (var key in sourceObject) {\r\n if (sourceObject.hasOwnProperty(key)) {\r\n targetObj[key] = sourceObject[key];\r\n }\r\n }\r\n }\r\n \r\n function parseNumeric(val) {\r\n return parseFloat(val) || 0;\r\n }\r\n \r\n function getDocOffsetTop(node) {\r\n var docOffsetTop = 0;\r\n \r\n while (node) {\r\n docOffsetTop += node.offsetTop;\r\n node = node.offsetParent;\r\n }\r\n \r\n return docOffsetTop;\r\n }\r\n \r\n /*\r\n * 4. Sticky class\r\n */\r\n \r\n var Sticky = function () {\r\n function Sticky(node) {\r\n _classCallCheck(this, Sticky);\r\n \r\n if (!(node instanceof HTMLElement)) throw new Error('First argument must be HTMLElement');\r\n if (stickies.some(function (sticky) {\r\n return sticky._node === node;\r\n })) throw new Error('Stickyfill is already applied to this node');\r\n \r\n this._node = node;\r\n this._stickyMode = null;\r\n this._active = false;\r\n \r\n stickies.push(this);\r\n \r\n this.refresh();\r\n }\r\n \r\n _createClass(Sticky, [{\r\n key: 'refresh',\r\n value: function refresh() {\r\n if (seppuku || this._removed) return;\r\n if (this._active) this._deactivate();\r\n \r\n var node = this._node;\r\n \r\n /*\r\n * 1. Save node computed props\r\n */\r\n var nodeComputedStyle = getComputedStyle(node);\r\n var nodeComputedProps = {\r\n position: nodeComputedStyle.position,\r\n top: nodeComputedStyle.top,\r\n display: nodeComputedStyle.display,\r\n marginTop: nodeComputedStyle.marginTop,\r\n marginBottom: nodeComputedStyle.marginBottom,\r\n marginLeft: nodeComputedStyle.marginLeft,\r\n marginRight: nodeComputedStyle.marginRight,\r\n cssFloat: nodeComputedStyle.cssFloat\r\n };\r\n \r\n /*\r\n * 2. Check if the node can be activated\r\n */\r\n if (isNaN(parseFloat(nodeComputedProps.top)) || nodeComputedProps.display == 'table-cell' || nodeComputedProps.display == 'none') return;\r\n \r\n this._active = true;\r\n \r\n /*\r\n * 3. Check if the current node position is `sticky`. If it is, it means that the browser supports sticky positioning,\r\n * but the polyfill was force-enabled. We set the node’s position to `static` before continuing, so that the node\r\n * is in it’s initial position when we gather its params.\r\n */\r\n var originalPosition = node.style.position;\r\n if (nodeComputedStyle.position == 'sticky' || nodeComputedStyle.position == '-webkit-sticky') node.style.position = 'static';\r\n \r\n /*\r\n * 4. Get necessary node parameters\r\n */\r\n var referenceNode = node.parentNode;\r\n var parentNode = shadowRootExists && referenceNode instanceof ShadowRoot ? referenceNode.host : referenceNode;\r\n var nodeWinOffset = node.getBoundingClientRect();\r\n var parentWinOffset = parentNode.getBoundingClientRect();\r\n var parentComputedStyle = getComputedStyle(parentNode);\r\n \r\n this._parent = {\r\n node: parentNode,\r\n styles: {\r\n position: parentNode.style.position\r\n },\r\n offsetHeight: parentNode.offsetHeight\r\n };\r\n this._offsetToWindow = {\r\n left: nodeWinOffset.left,\r\n right: document.documentElement.clientWidth - nodeWinOffset.right\r\n };\r\n this._offsetToParent = {\r\n top: nodeWinOffset.top - parentWinOffset.top - parseNumeric(parentComputedStyle.borderTopWidth),\r\n left: nodeWinOffset.left - parentWinOffset.left - parseNumeric(parentComputedStyle.borderLeftWidth),\r\n right: -nodeWinOffset.right + parentWinOffset.right - parseNumeric(parentComputedStyle.borderRightWidth)\r\n };\r\n this._styles = {\r\n position: originalPosition,\r\n top: node.style.top,\r\n bottom: node.style.bottom,\r\n left: node.style.left,\r\n right: node.style.right,\r\n width: node.style.width,\r\n marginTop: node.style.marginTop,\r\n marginLeft: node.style.marginLeft,\r\n marginRight: node.style.marginRight\r\n };\r\n \r\n var nodeTopValue = parseNumeric(nodeComputedProps.top);\r\n this._limits = {\r\n start: nodeWinOffset.top + window.pageYOffset - nodeTopValue,\r\n end: parentWinOffset.top + window.pageYOffset + parentNode.offsetHeight - parseNumeric(parentComputedStyle.borderBottomWidth) - node.offsetHeight - nodeTopValue - parseNumeric(nodeComputedProps.marginBottom)\r\n };\r\n \r\n /*\r\n * 5. Ensure that the node will be positioned relatively to the parent node\r\n */\r\n var parentPosition = parentComputedStyle.position;\r\n \r\n if (parentPosition != 'absolute' && parentPosition != 'relative') {\r\n parentNode.style.position = 'relative';\r\n }\r\n \r\n /*\r\n * 6. Recalc node position.\r\n * It’s important to do this before clone injection to avoid scrolling bug in Chrome.\r\n */\r\n this._recalcPosition();\r\n \r\n /*\r\n * 7. Create a clone\r\n */\r\n var clone = this._clone = {};\r\n clone.node = document.createElement('div');\r\n \r\n // Apply styles to the clone\r\n extend(clone.node.style, {\r\n width: nodeWinOffset.right - nodeWinOffset.left + 'px',\r\n height: nodeWinOffset.bottom - nodeWinOffset.top + 'px',\r\n marginTop: nodeComputedProps.marginTop,\r\n marginBottom: nodeComputedProps.marginBottom,\r\n marginLeft: nodeComputedProps.marginLeft,\r\n marginRight: nodeComputedProps.marginRight,\r\n cssFloat: nodeComputedProps.cssFloat,\r\n padding: 0,\r\n border: 0,\r\n borderSpacing: 0,\r\n fontSize: '1em',\r\n position: 'static'\r\n });\r\n \r\n referenceNode.insertBefore(clone.node, node);\r\n clone.docOffsetTop = getDocOffsetTop(clone.node);\r\n }\r\n }, {\r\n key: '_recalcPosition',\r\n value: function _recalcPosition() {\r\n if (!this._active || this._removed) return;\r\n \r\n var stickyMode = scroll.top <= this._limits.start ? 'start' : scroll.top >= this._limits.end ? 'end' : 'middle';\r\n \r\n if (this._stickyMode == stickyMode) return;\r\n \r\n switch (stickyMode) {\r\n case 'start':\r\n extend(this._node.style, {\r\n position: 'absolute',\r\n left: this._offsetToParent.left + 'px',\r\n right: this._offsetToParent.right + 'px',\r\n top: this._offsetToParent.top + 'px',\r\n bottom: 'auto',\r\n width: 'auto',\r\n marginLeft: 0,\r\n marginRight: 0,\r\n marginTop: 0\r\n });\r\n break;\r\n \r\n case 'middle':\r\n extend(this._node.style, {\r\n position: 'fixed',\r\n left: this._offsetToWindow.left + 'px',\r\n right: this._offsetToWindow.right + 'px',\r\n top: this._styles.top,\r\n bottom: 'auto',\r\n width: 'auto',\r\n marginLeft: 0,\r\n marginRight: 0,\r\n marginTop: 0\r\n });\r\n break;\r\n \r\n case 'end':\r\n extend(this._node.style, {\r\n position: 'absolute',\r\n left: this._offsetToParent.left + 'px',\r\n right: this._offsetToParent.right + 'px',\r\n top: 'auto',\r\n bottom: 0,\r\n width: 'auto',\r\n marginLeft: 0,\r\n marginRight: 0\r\n });\r\n break;\r\n }\r\n \r\n this._stickyMode = stickyMode;\r\n }\r\n }, {\r\n key: '_fastCheck',\r\n value: function _fastCheck() {\r\n if (!this._active || this._removed) return;\r\n \r\n if (Math.abs(getDocOffsetTop(this._clone.node) - this._clone.docOffsetTop) > 1 || Math.abs(this._parent.node.offsetHeight - this._parent.offsetHeight) > 1) this.refresh();\r\n }\r\n }, {\r\n key: '_deactivate',\r\n value: function _deactivate() {\r\n var _this = this;\r\n \r\n if (!this._active || this._removed) return;\r\n \r\n this._clone.node.parentNode.removeChild(this._clone.node);\r\n delete this._clone;\r\n \r\n extend(this._node.style, this._styles);\r\n delete this._styles;\r\n \r\n // Check whether element’s parent node is used by other stickies.\r\n // If not, restore parent node’s styles.\r\n if (!stickies.some(function (sticky) {\r\n return sticky !== _this && sticky._parent && sticky._parent.node === _this._parent.node;\r\n })) {\r\n extend(this._parent.node.style, this._parent.styles);\r\n }\r\n delete this._parent;\r\n \r\n this._stickyMode = null;\r\n this._active = false;\r\n \r\n delete this._offsetToWindow;\r\n delete this._offsetToParent;\r\n delete this._limits;\r\n }\r\n }, {\r\n key: 'remove',\r\n value: function remove() {\r\n var _this2 = this;\r\n \r\n this._deactivate();\r\n \r\n stickies.some(function (sticky, index) {\r\n if (sticky._node === _this2._node) {\r\n stickies.splice(index, 1);\r\n return true;\r\n }\r\n });\r\n \r\n this._removed = true;\r\n }\r\n }]);\r\n \r\n return Sticky;\r\n }();\r\n \r\n /*\r\n * 5. Stickyfill API\r\n */\r\n \r\n \r\n var Stickyfill = {\r\n stickies: stickies,\r\n Sticky: Sticky,\r\n \r\n forceSticky: function forceSticky() {\r\n seppuku = false;\r\n init();\r\n \r\n this.refreshAll();\r\n },\r\n addOne: function addOne(node) {\r\n // Check whether it’s a node\r\n if (!(node instanceof HTMLElement)) {\r\n // Maybe it’s a node list of some sort?\r\n // Take first node from the list then\r\n if (node.length && node[0]) node = node[0];else return;\r\n }\r\n \r\n // Check if Stickyfill is already applied to the node\r\n // and return existing sticky\r\n for (var i = 0; i < stickies.length; i++) {\r\n if (stickies[i]._node === node) return stickies[i];\r\n }\r\n \r\n // Create and return new sticky\r\n return new Sticky(node);\r\n },\r\n add: function add(nodeList) {\r\n // If it’s a node make an array of one node\r\n if (nodeList instanceof HTMLElement) nodeList = [nodeList];\r\n // Check if the argument is an iterable of some sort\r\n if (!nodeList.length) return;\r\n \r\n // Add every element as a sticky and return an array of created Sticky instances\r\n var addedStickies = [];\r\n \r\n var _loop = function _loop(i) {\r\n var node = nodeList[i];\r\n \r\n // If it’s not an HTMLElement – create an empty element to preserve 1-to-1\r\n // correlation with input list\r\n if (!(node instanceof HTMLElement)) {\r\n addedStickies.push(void 0);\r\n return 'continue';\r\n }\r\n \r\n // If Stickyfill is already applied to the node\r\n // add existing sticky\r\n if (stickies.some(function (sticky) {\r\n if (sticky._node === node) {\r\n addedStickies.push(sticky);\r\n return true;\r\n }\r\n })) return 'continue';\r\n \r\n // Create and add new sticky\r\n addedStickies.push(new Sticky(node));\r\n };\r\n \r\n for (var i = 0; i < nodeList.length; i++) {\r\n var _ret2 = _loop(i);\r\n \r\n if (_ret2 === 'continue') continue;\r\n }\r\n \r\n return addedStickies;\r\n },\r\n refreshAll: function refreshAll() {\r\n stickies.forEach(function (sticky) {\r\n return sticky.refresh();\r\n });\r\n },\r\n removeOne: function removeOne(node) {\r\n // Check whether it’s a node\r\n if (!(node instanceof HTMLElement)) {\r\n // Maybe it’s a node list of some sort?\r\n // Take first node from the list then\r\n if (node.length && node[0]) node = node[0];else return;\r\n }\r\n \r\n // Remove the stickies bound to the nodes in the list\r\n stickies.some(function (sticky) {\r\n if (sticky._node === node) {\r\n sticky.remove();\r\n return true;\r\n }\r\n });\r\n },\r\n remove: function remove(nodeList) {\r\n // If it’s a node make an array of one node\r\n if (nodeList instanceof HTMLElement) nodeList = [nodeList];\r\n // Check if the argument is an iterable of some sort\r\n if (!nodeList.length) return;\r\n \r\n // Remove the stickies bound to the nodes in the list\r\n \r\n var _loop2 = function _loop2(i) {\r\n var node = nodeList[i];\r\n \r\n stickies.some(function (sticky) {\r\n if (sticky._node === node) {\r\n sticky.remove();\r\n return true;\r\n }\r\n });\r\n };\r\n \r\n for (var i = 0; i < nodeList.length; i++) {\r\n _loop2(i);\r\n }\r\n },\r\n removeAll: function removeAll() {\r\n while (stickies.length) {\r\n stickies[0].remove();\r\n }\r\n }\r\n };\r\n \r\n /*\r\n * 6. Setup events (unless the polyfill was disabled)\r\n */\r\n function init() {\r\n if (isInitialized) {\r\n return;\r\n }\r\n \r\n isInitialized = true;\r\n \r\n // Watch for scroll position changes and trigger recalc/refresh if needed\r\n function checkScroll() {\r\n if (window.pageXOffset != scroll.left) {\r\n scroll.top = window.pageYOffset;\r\n scroll.left = window.pageXOffset;\r\n \r\n Stickyfill.refreshAll();\r\n } else if (window.pageYOffset != scroll.top) {\r\n scroll.top = window.pageYOffset;\r\n scroll.left = window.pageXOffset;\r\n \r\n // recalc position for all stickies\r\n stickies.forEach(function (sticky) {\r\n return sticky._recalcPosition();\r\n });\r\n }\r\n }\r\n \r\n checkScroll();\r\n window.addEventListener('scroll', checkScroll);\r\n \r\n // Watch for window resizes and device orientation changes and trigger refresh\r\n window.addEventListener('resize', Stickyfill.refreshAll);\r\n window.addEventListener('orientationchange', Stickyfill.refreshAll);\r\n \r\n //Fast dirty check for layout changes every 500ms\r\n var fastCheckTimer = void 0;\r\n \r\n function startFastCheckTimer() {\r\n fastCheckTimer = setInterval(function () {\r\n stickies.forEach(function (sticky) {\r\n return sticky._fastCheck();\r\n });\r\n }, 500);\r\n }\r\n \r\n function stopFastCheckTimer() {\r\n clearInterval(fastCheckTimer);\r\n }\r\n \r\n var docHiddenKey = void 0;\r\n var visibilityChangeEventName = void 0;\r\n \r\n if ('hidden' in document) {\r\n docHiddenKey = 'hidden';\r\n visibilityChangeEventName = 'visibilitychange';\r\n } else if ('webkitHidden' in document) {\r\n docHiddenKey = 'webkitHidden';\r\n visibilityChangeEventName = 'webkitvisibilitychange';\r\n }\r\n \r\n if (visibilityChangeEventName) {\r\n if (!document[docHiddenKey]) startFastCheckTimer();\r\n \r\n document.addEventListener(visibilityChangeEventName, function () {\r\n if (document[docHiddenKey]) {\r\n stopFastCheckTimer();\r\n } else {\r\n startFastCheckTimer();\r\n }\r\n });\r\n } else startFastCheckTimer();\r\n }\r\n \r\n if (!seppuku) init();\r\n \r\n /*\r\n * 7. Expose Stickyfill\r\n */\r\n if (typeof module != 'undefined' && module.exports) {\r\n module.exports = Stickyfill;\r\n } else if (isWindowDefined) {\r\n window.Stickyfill = Stickyfill;\r\n }\r\n \r\n})(window, document);","/**\r\n * A collection of shims that provide minimal functionality of the ES6 collections.\r\n *\r\n * These implementations are not meant to be used outside of the ResizeObserver\r\n * modules as they cover only a limited range of use cases.\r\n */\r\n/* eslint-disable require-jsdoc, valid-jsdoc */\r\nvar MapShim = (function () {\r\n if (typeof Map !== 'undefined') {\r\n return Map;\r\n }\r\n /**\r\n * Returns index in provided array that matches the specified key.\r\n *\r\n * @param {Array} arr\r\n * @param {*} key\r\n * @returns {number}\r\n */\r\n function getIndex(arr, key) {\r\n var result = -1;\r\n arr.some(function (entry, index) {\r\n if (entry[0] === key) {\r\n result = index;\r\n return true;\r\n }\r\n return false;\r\n });\r\n return result;\r\n }\r\n return /** @class */ (function () {\r\n function class_1() {\r\n this.__entries__ = [];\r\n }\r\n Object.defineProperty(class_1.prototype, \"size\", {\r\n /**\r\n * @returns {boolean}\r\n */\r\n get: function () {\r\n return this.__entries__.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @param {*} key\r\n * @returns {*}\r\n */\r\n class_1.prototype.get = function (key) {\r\n var index = getIndex(this.__entries__, key);\r\n var entry = this.__entries__[index];\r\n return entry && entry[1];\r\n };\r\n /**\r\n * @param {*} key\r\n * @param {*} value\r\n * @returns {void}\r\n */\r\n class_1.prototype.set = function (key, value) {\r\n var index = getIndex(this.__entries__, key);\r\n if (~index) {\r\n this.__entries__[index][1] = value;\r\n }\r\n else {\r\n this.__entries__.push([key, value]);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.delete = function (key) {\r\n var entries = this.__entries__;\r\n var index = getIndex(entries, key);\r\n if (~index) {\r\n entries.splice(index, 1);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.has = function (key) {\r\n return !!~getIndex(this.__entries__, key);\r\n };\r\n /**\r\n * @returns {void}\r\n */\r\n class_1.prototype.clear = function () {\r\n this.__entries__.splice(0);\r\n };\r\n /**\r\n * @param {Function} callback\r\n * @param {*} [ctx=null]\r\n * @returns {void}\r\n */\r\n class_1.prototype.forEach = function (callback, ctx) {\r\n if (ctx === void 0) { ctx = null; }\r\n for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {\r\n var entry = _a[_i];\r\n callback.call(ctx, entry[1], entry[0]);\r\n }\r\n };\r\n return class_1;\r\n }());\r\n})();\n\n/**\r\n * Detects whether window and document objects are available in current environment.\r\n */\r\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;\n\n// Returns global object of a current environment.\r\nvar global$1 = (function () {\r\n if (typeof global !== 'undefined' && global.Math === Math) {\r\n return global;\r\n }\r\n if (typeof self !== 'undefined' && self.Math === Math) {\r\n return self;\r\n }\r\n if (typeof window !== 'undefined' && window.Math === Math) {\r\n return window;\r\n }\r\n // eslint-disable-next-line no-new-func\r\n return Function('return this')();\r\n})();\n\n/**\r\n * A shim for the requestAnimationFrame which falls back to the setTimeout if\r\n * first one is not supported.\r\n *\r\n * @returns {number} Requests' identifier.\r\n */\r\nvar requestAnimationFrame$1 = (function () {\r\n if (typeof requestAnimationFrame === 'function') {\r\n // It's required to use a bounded function because IE sometimes throws\r\n // an \"Invalid calling object\" error if rAF is invoked without the global\r\n // object on the left hand side.\r\n return requestAnimationFrame.bind(global$1);\r\n }\r\n return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };\r\n})();\n\n// Defines minimum timeout before adding a trailing call.\r\nvar trailingTimeout = 2;\r\n/**\r\n * Creates a wrapper function which ensures that provided callback will be\r\n * invoked only once during the specified delay period.\r\n *\r\n * @param {Function} callback - Function to be invoked after the delay period.\r\n * @param {number} delay - Delay after which to invoke callback.\r\n * @returns {Function}\r\n */\r\nfunction throttle (callback, delay) {\r\n var leadingCall = false, trailingCall = false, lastCallTime = 0;\r\n /**\r\n * Invokes the original callback function and schedules new invocation if\r\n * the \"proxy\" was called during current request.\r\n *\r\n * @returns {void}\r\n */\r\n function resolvePending() {\r\n if (leadingCall) {\r\n leadingCall = false;\r\n callback();\r\n }\r\n if (trailingCall) {\r\n proxy();\r\n }\r\n }\r\n /**\r\n * Callback invoked after the specified delay. It will further postpone\r\n * invocation of the original function delegating it to the\r\n * requestAnimationFrame.\r\n *\r\n * @returns {void}\r\n */\r\n function timeoutCallback() {\r\n requestAnimationFrame$1(resolvePending);\r\n }\r\n /**\r\n * Schedules invocation of the original function.\r\n *\r\n * @returns {void}\r\n */\r\n function proxy() {\r\n var timeStamp = Date.now();\r\n if (leadingCall) {\r\n // Reject immediately following calls.\r\n if (timeStamp - lastCallTime < trailingTimeout) {\r\n return;\r\n }\r\n // Schedule new call to be in invoked when the pending one is resolved.\r\n // This is important for \"transitions\" which never actually start\r\n // immediately so there is a chance that we might miss one if change\r\n // happens amids the pending invocation.\r\n trailingCall = true;\r\n }\r\n else {\r\n leadingCall = true;\r\n trailingCall = false;\r\n setTimeout(timeoutCallback, delay);\r\n }\r\n lastCallTime = timeStamp;\r\n }\r\n return proxy;\r\n}\n\n// Minimum delay before invoking the update of observers.\r\nvar REFRESH_DELAY = 20;\r\n// A list of substrings of CSS properties used to find transition events that\r\n// might affect dimensions of observed elements.\r\nvar transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];\r\n// Check if MutationObserver is available.\r\nvar mutationObserverSupported = typeof MutationObserver !== 'undefined';\r\n/**\r\n * Singleton controller class which handles updates of ResizeObserver instances.\r\n */\r\nvar ResizeObserverController = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserverController.\r\n *\r\n * @private\r\n */\r\n function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }\r\n /**\r\n * Adds observer to observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be added.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.addObserver = function (observer) {\r\n if (!~this.observers_.indexOf(observer)) {\r\n this.observers_.push(observer);\r\n }\r\n // Add listeners if they haven't been added yet.\r\n if (!this.connected_) {\r\n this.connect_();\r\n }\r\n };\r\n /**\r\n * Removes observer from observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be removed.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.removeObserver = function (observer) {\r\n var observers = this.observers_;\r\n var index = observers.indexOf(observer);\r\n // Remove observer if it's present in registry.\r\n if (~index) {\r\n observers.splice(index, 1);\r\n }\r\n // Remove listeners if controller has no connected observers.\r\n if (!observers.length && this.connected_) {\r\n this.disconnect_();\r\n }\r\n };\r\n /**\r\n * Invokes the update of observers. It will continue running updates insofar\r\n * it detects changes.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.refresh = function () {\r\n var changesDetected = this.updateObservers_();\r\n // Continue running updates if changes have been detected as there might\r\n // be future ones caused by CSS transitions.\r\n if (changesDetected) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Updates every observer from observers list and notifies them of queued\r\n * entries.\r\n *\r\n * @private\r\n * @returns {boolean} Returns \"true\" if any observer has detected changes in\r\n * dimensions of it's elements.\r\n */\r\n ResizeObserverController.prototype.updateObservers_ = function () {\r\n // Collect observers that have active observations.\r\n var activeObservers = this.observers_.filter(function (observer) {\r\n return observer.gatherActive(), observer.hasActive();\r\n });\r\n // Deliver notifications in a separate cycle in order to avoid any\r\n // collisions between observers, e.g. when multiple instances of\r\n // ResizeObserver are tracking the same element and the callback of one\r\n // of them changes content dimensions of the observed target. Sometimes\r\n // this may result in notifications being blocked for the rest of observers.\r\n activeObservers.forEach(function (observer) { return observer.broadcastActive(); });\r\n return activeObservers.length > 0;\r\n };\r\n /**\r\n * Initializes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.connect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already added.\r\n if (!isBrowser || this.connected_) {\r\n return;\r\n }\r\n // Subscription to the \"Transitionend\" event is used as a workaround for\r\n // delayed transitions. This way it's possible to capture at least the\r\n // final state of an element.\r\n document.addEventListener('transitionend', this.onTransitionEnd_);\r\n window.addEventListener('resize', this.refresh);\r\n if (mutationObserverSupported) {\r\n this.mutationsObserver_ = new MutationObserver(this.refresh);\r\n this.mutationsObserver_.observe(document, {\r\n attributes: true,\r\n childList: true,\r\n characterData: true,\r\n subtree: true\r\n });\r\n }\r\n else {\r\n document.addEventListener('DOMSubtreeModified', this.refresh);\r\n this.mutationEventsAdded_ = true;\r\n }\r\n this.connected_ = true;\r\n };\r\n /**\r\n * Removes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.disconnect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already removed.\r\n if (!isBrowser || !this.connected_) {\r\n return;\r\n }\r\n document.removeEventListener('transitionend', this.onTransitionEnd_);\r\n window.removeEventListener('resize', this.refresh);\r\n if (this.mutationsObserver_) {\r\n this.mutationsObserver_.disconnect();\r\n }\r\n if (this.mutationEventsAdded_) {\r\n document.removeEventListener('DOMSubtreeModified', this.refresh);\r\n }\r\n this.mutationsObserver_ = null;\r\n this.mutationEventsAdded_ = false;\r\n this.connected_ = false;\r\n };\r\n /**\r\n * \"Transitionend\" event handler.\r\n *\r\n * @private\r\n * @param {TransitionEvent} event\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {\r\n var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;\r\n // Detect whether transition may affect dimensions of an element.\r\n var isReflowProperty = transitionKeys.some(function (key) {\r\n return !!~propertyName.indexOf(key);\r\n });\r\n if (isReflowProperty) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Returns instance of the ResizeObserverController.\r\n *\r\n * @returns {ResizeObserverController}\r\n */\r\n ResizeObserverController.getInstance = function () {\r\n if (!this.instance_) {\r\n this.instance_ = new ResizeObserverController();\r\n }\r\n return this.instance_;\r\n };\r\n /**\r\n * Holds reference to the controller's instance.\r\n *\r\n * @private {ResizeObserverController}\r\n */\r\n ResizeObserverController.instance_ = null;\r\n return ResizeObserverController;\r\n}());\n\n/**\r\n * Defines non-writable/enumerable properties of the provided target object.\r\n *\r\n * @param {Object} target - Object for which to define properties.\r\n * @param {Object} props - Properties to be defined.\r\n * @returns {Object} Target object.\r\n */\r\nvar defineConfigurable = (function (target, props) {\r\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n Object.defineProperty(target, key, {\r\n value: props[key],\r\n enumerable: false,\r\n writable: false,\r\n configurable: true\r\n });\r\n }\r\n return target;\r\n});\n\n/**\r\n * Returns the global object associated with provided element.\r\n *\r\n * @param {Object} target\r\n * @returns {Object}\r\n */\r\nvar getWindowOf = (function (target) {\r\n // Assume that the element is an instance of Node, which means that it\r\n // has the \"ownerDocument\" property from which we can retrieve a\r\n // corresponding global object.\r\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;\r\n // Return the local global object if it's not possible extract one from\r\n // provided element.\r\n return ownerGlobal || global$1;\r\n});\n\n// Placeholder of an empty content rectangle.\r\nvar emptyRect = createRectInit(0, 0, 0, 0);\r\n/**\r\n * Converts provided string to a number.\r\n *\r\n * @param {number|string} value\r\n * @returns {number}\r\n */\r\nfunction toFloat(value) {\r\n return parseFloat(value) || 0;\r\n}\r\n/**\r\n * Extracts borders size from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @param {...string} positions - Borders positions (top, right, ...)\r\n * @returns {number}\r\n */\r\nfunction getBordersSize(styles) {\r\n var positions = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n positions[_i - 1] = arguments[_i];\r\n }\r\n return positions.reduce(function (size, position) {\r\n var value = styles['border-' + position + '-width'];\r\n return size + toFloat(value);\r\n }, 0);\r\n}\r\n/**\r\n * Extracts paddings sizes from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @returns {Object} Paddings box.\r\n */\r\nfunction getPaddings(styles) {\r\n var positions = ['top', 'right', 'bottom', 'left'];\r\n var paddings = {};\r\n for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\r\n var position = positions_1[_i];\r\n var value = styles['padding-' + position];\r\n paddings[position] = toFloat(value);\r\n }\r\n return paddings;\r\n}\r\n/**\r\n * Calculates content rectangle of provided SVG element.\r\n *\r\n * @param {SVGGraphicsElement} target - Element content rectangle of which needs\r\n * to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getSVGContentRect(target) {\r\n var bbox = target.getBBox();\r\n return createRectInit(0, 0, bbox.width, bbox.height);\r\n}\r\n/**\r\n * Calculates content rectangle of provided HTMLElement.\r\n *\r\n * @param {HTMLElement} target - Element for which to calculate the content rectangle.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getHTMLElementContentRect(target) {\r\n // Client width & height properties can't be\r\n // used exclusively as they provide rounded values.\r\n var clientWidth = target.clientWidth, clientHeight = target.clientHeight;\r\n // By this condition we can catch all non-replaced inline, hidden and\r\n // detached elements. Though elements with width & height properties less\r\n // than 0.5 will be discarded as well.\r\n //\r\n // Without it we would need to implement separate methods for each of\r\n // those cases and it's not possible to perform a precise and performance\r\n // effective test for hidden elements. E.g. even jQuery's ':visible' filter\r\n // gives wrong results for elements with width & height less than 0.5.\r\n if (!clientWidth && !clientHeight) {\r\n return emptyRect;\r\n }\r\n var styles = getWindowOf(target).getComputedStyle(target);\r\n var paddings = getPaddings(styles);\r\n var horizPad = paddings.left + paddings.right;\r\n var vertPad = paddings.top + paddings.bottom;\r\n // Computed styles of width & height are being used because they are the\r\n // only dimensions available to JS that contain non-rounded values. It could\r\n // be possible to utilize the getBoundingClientRect if only it's data wasn't\r\n // affected by CSS transformations let alone paddings, borders and scroll bars.\r\n var width = toFloat(styles.width), height = toFloat(styles.height);\r\n // Width & height include paddings and borders when the 'border-box' box\r\n // model is applied (except for IE).\r\n if (styles.boxSizing === 'border-box') {\r\n // Following conditions are required to handle Internet Explorer which\r\n // doesn't include paddings and borders to computed CSS dimensions.\r\n //\r\n // We can say that if CSS dimensions + paddings are equal to the \"client\"\r\n // properties then it's either IE, and thus we don't need to subtract\r\n // anything, or an element merely doesn't have paddings/borders styles.\r\n if (Math.round(width + horizPad) !== clientWidth) {\r\n width -= getBordersSize(styles, 'left', 'right') + horizPad;\r\n }\r\n if (Math.round(height + vertPad) !== clientHeight) {\r\n height -= getBordersSize(styles, 'top', 'bottom') + vertPad;\r\n }\r\n }\r\n // Following steps can't be applied to the document's root element as its\r\n // client[Width/Height] properties represent viewport area of the window.\r\n // Besides, it's as well not necessary as the itself neither has\r\n // rendered scroll bars nor it can be clipped.\r\n if (!isDocumentElement(target)) {\r\n // In some browsers (only in Firefox, actually) CSS width & height\r\n // include scroll bars size which can be removed at this step as scroll\r\n // bars are the only difference between rounded dimensions + paddings\r\n // and \"client\" properties, though that is not always true in Chrome.\r\n var vertScrollbar = Math.round(width + horizPad) - clientWidth;\r\n var horizScrollbar = Math.round(height + vertPad) - clientHeight;\r\n // Chrome has a rather weird rounding of \"client\" properties.\r\n // E.g. for an element with content width of 314.2px it sometimes gives\r\n // the client width of 315px and for the width of 314.7px it may give\r\n // 314px. And it doesn't happen all the time. So just ignore this delta\r\n // as a non-relevant.\r\n if (Math.abs(vertScrollbar) !== 1) {\r\n width -= vertScrollbar;\r\n }\r\n if (Math.abs(horizScrollbar) !== 1) {\r\n height -= horizScrollbar;\r\n }\r\n }\r\n return createRectInit(paddings.left, paddings.top, width, height);\r\n}\r\n/**\r\n * Checks whether provided element is an instance of the SVGGraphicsElement.\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nvar isSVGGraphicsElement = (function () {\r\n // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement\r\n // interface.\r\n if (typeof SVGGraphicsElement !== 'undefined') {\r\n return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };\r\n }\r\n // If it's so, then check that element is at least an instance of the\r\n // SVGElement and that it has the \"getBBox\" method.\r\n // eslint-disable-next-line no-extra-parens\r\n return function (target) { return (target instanceof getWindowOf(target).SVGElement &&\r\n typeof target.getBBox === 'function'); };\r\n})();\r\n/**\r\n * Checks whether provided element is a document element ().\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nfunction isDocumentElement(target) {\r\n return target === getWindowOf(target).document.documentElement;\r\n}\r\n/**\r\n * Calculates an appropriate content rectangle for provided html or svg element.\r\n *\r\n * @param {Element} target - Element content rectangle of which needs to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getContentRect(target) {\r\n if (!isBrowser) {\r\n return emptyRect;\r\n }\r\n if (isSVGGraphicsElement(target)) {\r\n return getSVGContentRect(target);\r\n }\r\n return getHTMLElementContentRect(target);\r\n}\r\n/**\r\n * Creates rectangle with an interface of the DOMRectReadOnly.\r\n * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly\r\n *\r\n * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.\r\n * @returns {DOMRectReadOnly}\r\n */\r\nfunction createReadOnlyRect(_a) {\r\n var x = _a.x, y = _a.y, width = _a.width, height = _a.height;\r\n // If DOMRectReadOnly is available use it as a prototype for the rectangle.\r\n var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;\r\n var rect = Object.create(Constr.prototype);\r\n // Rectangle's properties are not writable and non-enumerable.\r\n defineConfigurable(rect, {\r\n x: x, y: y, width: width, height: height,\r\n top: y,\r\n right: x + width,\r\n bottom: height + y,\r\n left: x\r\n });\r\n return rect;\r\n}\r\n/**\r\n * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.\r\n * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit\r\n *\r\n * @param {number} x - X coordinate.\r\n * @param {number} y - Y coordinate.\r\n * @param {number} width - Rectangle's width.\r\n * @param {number} height - Rectangle's height.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction createRectInit(x, y, width, height) {\r\n return { x: x, y: y, width: width, height: height };\r\n}\n\n/**\r\n * Class that is responsible for computations of the content rectangle of\r\n * provided DOM element and for keeping track of it's changes.\r\n */\r\nvar ResizeObservation = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObservation.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n */\r\n function ResizeObservation(target) {\r\n /**\r\n * Broadcasted width of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastWidth = 0;\r\n /**\r\n * Broadcasted height of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastHeight = 0;\r\n /**\r\n * Reference to the last observed content rectangle.\r\n *\r\n * @private {DOMRectInit}\r\n */\r\n this.contentRect_ = createRectInit(0, 0, 0, 0);\r\n this.target = target;\r\n }\r\n /**\r\n * Updates content rectangle and tells whether it's width or height properties\r\n * have changed since the last broadcast.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObservation.prototype.isActive = function () {\r\n var rect = getContentRect(this.target);\r\n this.contentRect_ = rect;\r\n return (rect.width !== this.broadcastWidth ||\r\n rect.height !== this.broadcastHeight);\r\n };\r\n /**\r\n * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data\r\n * from the corresponding properties of the last observed content rectangle.\r\n *\r\n * @returns {DOMRectInit} Last observed content rectangle.\r\n */\r\n ResizeObservation.prototype.broadcastRect = function () {\r\n var rect = this.contentRect_;\r\n this.broadcastWidth = rect.width;\r\n this.broadcastHeight = rect.height;\r\n return rect;\r\n };\r\n return ResizeObservation;\r\n}());\n\nvar ResizeObserverEntry = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObserverEntry.\r\n *\r\n * @param {Element} target - Element that is being observed.\r\n * @param {DOMRectInit} rectInit - Data of the element's content rectangle.\r\n */\r\n function ResizeObserverEntry(target, rectInit) {\r\n var contentRect = createReadOnlyRect(rectInit);\r\n // According to the specification following properties are not writable\r\n // and are also not enumerable in the native implementation.\r\n //\r\n // Property accessors are not being used as they'd require to define a\r\n // private WeakMap storage which may cause memory leaks in browsers that\r\n // don't support this type of collections.\r\n defineConfigurable(this, { target: target, contentRect: contentRect });\r\n }\r\n return ResizeObserverEntry;\r\n}());\n\nvar ResizeObserverSPI = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback function that is invoked\r\n * when one of the observed elements changes it's content dimensions.\r\n * @param {ResizeObserverController} controller - Controller instance which\r\n * is responsible for the updates of observer.\r\n * @param {ResizeObserver} callbackCtx - Reference to the public\r\n * ResizeObserver instance which will be passed to callback function.\r\n */\r\n function ResizeObserverSPI(callback, controller, callbackCtx) {\r\n /**\r\n * Collection of resize observations that have detected changes in dimensions\r\n * of elements.\r\n *\r\n * @private {Array}\r\n */\r\n this.activeObservations_ = [];\r\n /**\r\n * Registry of the ResizeObservation instances.\r\n *\r\n * @private {Map}\r\n */\r\n this.observations_ = new MapShim();\r\n if (typeof callback !== 'function') {\r\n throw new TypeError('The callback provided as parameter 1 is not a function.');\r\n }\r\n this.callback_ = callback;\r\n this.controller_ = controller;\r\n this.callbackCtx_ = callbackCtx;\r\n }\r\n /**\r\n * Starts observing provided element.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.observe = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is already being observed.\r\n if (observations.has(target)) {\r\n return;\r\n }\r\n observations.set(target, new ResizeObservation(target));\r\n this.controller_.addObserver(this);\r\n // Force the update of observations.\r\n this.controller_.refresh();\r\n };\r\n /**\r\n * Stops observing provided element.\r\n *\r\n * @param {Element} target - Element to stop observing.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.unobserve = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is not being observed.\r\n if (!observations.has(target)) {\r\n return;\r\n }\r\n observations.delete(target);\r\n if (!observations.size) {\r\n this.controller_.removeObserver(this);\r\n }\r\n };\r\n /**\r\n * Stops observing all elements.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.disconnect = function () {\r\n this.clearActive();\r\n this.observations_.clear();\r\n this.controller_.removeObserver(this);\r\n };\r\n /**\r\n * Collects observation instances the associated element of which has changed\r\n * it's content rectangle.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.gatherActive = function () {\r\n var _this = this;\r\n this.clearActive();\r\n this.observations_.forEach(function (observation) {\r\n if (observation.isActive()) {\r\n _this.activeObservations_.push(observation);\r\n }\r\n });\r\n };\r\n /**\r\n * Invokes initial callback function with a list of ResizeObserverEntry\r\n * instances collected from active resize observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.broadcastActive = function () {\r\n // Do nothing if observer doesn't have active observations.\r\n if (!this.hasActive()) {\r\n return;\r\n }\r\n var ctx = this.callbackCtx_;\r\n // Create ResizeObserverEntry instance for every active observation.\r\n var entries = this.activeObservations_.map(function (observation) {\r\n return new ResizeObserverEntry(observation.target, observation.broadcastRect());\r\n });\r\n this.callback_.call(ctx, entries, ctx);\r\n this.clearActive();\r\n };\r\n /**\r\n * Clears the collection of active observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.clearActive = function () {\r\n this.activeObservations_.splice(0);\r\n };\r\n /**\r\n * Tells whether observer has active observations.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObserverSPI.prototype.hasActive = function () {\r\n return this.activeObservations_.length > 0;\r\n };\r\n return ResizeObserverSPI;\r\n}());\n\n// Registry of internal observers. If WeakMap is not available use current shim\r\n// for the Map collection as it has all required methods and because WeakMap\r\n// can't be fully polyfilled anyway.\r\nvar observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();\r\n/**\r\n * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation\r\n * exposing only those methods and properties that are defined in the spec.\r\n */\r\nvar ResizeObserver = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback that is invoked when\r\n * dimensions of the observed elements change.\r\n */\r\n function ResizeObserver(callback) {\r\n if (!(this instanceof ResizeObserver)) {\r\n throw new TypeError('Cannot call a class as a function.');\r\n }\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n var controller = ResizeObserverController.getInstance();\r\n var observer = new ResizeObserverSPI(callback, controller, this);\r\n observers.set(this, observer);\r\n }\r\n return ResizeObserver;\r\n}());\r\n// Expose public methods of ResizeObserver.\r\n[\r\n 'observe',\r\n 'unobserve',\r\n 'disconnect'\r\n].forEach(function (method) {\r\n ResizeObserver.prototype[method] = function () {\r\n var _a;\r\n return (_a = observers.get(this))[method].apply(_a, arguments);\r\n };\r\n});\n\nvar index = (function () {\r\n // Export existing implementation if available.\r\n if (typeof global$1.ResizeObserver !== 'undefined') {\r\n return global$1.ResizeObserver;\r\n }\r\n return ResizeObserver;\r\n})();\n\nexport default index;\n","var cloneSvg = function cloneSvg(sourceSvg) {\n return sourceSvg.cloneNode(true);\n};\n\nvar isLocal = function isLocal() {\n return window.location.protocol === 'file:';\n};\n\nvar svgCache = new Map();\n\nvar requestQueue = {};\nvar queueRequest = function queueRequest(url, callback) {\n requestQueue[url] = requestQueue[url] || [];\n requestQueue[url].push(callback);\n};\nvar processRequestQueue = function processRequestQueue(url) {\n var _loop = function _loop(i, len) {\n // Make these calls async so we avoid blocking the page/renderer.\n setTimeout(function () {\n /* istanbul ignore else */\n if (Array.isArray(requestQueue[url])) {\n var cacheValue = svgCache.get(url);\n var callback = requestQueue[url][i];\n /* istanbul ignore else */\n\n if (cacheValue instanceof SVGSVGElement || cacheValue instanceof HTMLElement) {\n callback(null, cloneSvg(cacheValue));\n }\n /* istanbul ignore else */\n\n\n if (cacheValue instanceof Error) {\n callback(cacheValue);\n }\n /* istanbul ignore else */\n\n\n if (i === requestQueue[url].length - 1) {\n delete requestQueue[url];\n }\n }\n }, 0);\n };\n\n for (var i = 0, len = requestQueue[url].length; i < len; i++) {\n _loop(i, len);\n }\n};\n\nvar loadSvg = function loadSvg(url, callback) {\n if (svgCache.has(url)) {\n var cacheValue = svgCache.get(url);\n\n if (cacheValue instanceof SVGSVGElement || cacheValue instanceof HTMLElement) {\n callback(null, cloneSvg(cacheValue));\n return;\n }\n\n if (cacheValue instanceof Error) {\n callback(cacheValue);\n return;\n }\n\n queueRequest(url, callback);\n return;\n } // Seed the cache to indicate we are loading this URL.\n\n\n svgCache.set(url, undefined);\n queueRequest(url, callback);\n var httpRequest = new XMLHttpRequest();\n\n httpRequest.onreadystatechange = function () {\n try {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 404 || httpRequest.responseXML === null) {\n throw new Error(isLocal() ? 'Note: SVG injection ajax calls do not work locally without adjusting security setting in your browser. Or consider using a local webserver.' : 'Unable to load SVG file: ' + url);\n }\n\n if (httpRequest.status === 200 || isLocal() && httpRequest.status === 0) {\n /* istanbul ignore else */\n if (httpRequest.responseXML instanceof Document) {\n /* istanbul ignore else */\n if (httpRequest.responseXML.documentElement) {\n svgCache.set(url, httpRequest.responseXML.documentElement);\n }\n }\n\n processRequestQueue(url);\n } else {\n throw new Error('There was a problem injecting the SVG: ' + httpRequest.status + ' ' + httpRequest.statusText);\n }\n }\n } catch (error) {\n svgCache.set(url, error);\n processRequestQueue(url);\n }\n };\n\n httpRequest.open('GET', url); // Treat and parse the response as XML, even if the server sends us a\n // different mimetype.\n\n /* istanbul ignore else */\n\n if (httpRequest.overrideMimeType) {\n httpRequest.overrideMimeType('text/xml');\n }\n\n httpRequest.send();\n};\n\nvar idCounter = 0;\n\nvar uniqueId = function uniqueId() {\n return ++idCounter;\n};\n\nvar injectedElements = [];\nvar ranScripts = {};\nvar svgNamespace = 'http://www.w3.org/2000/svg';\nvar xlinkNamespace = 'http://www.w3.org/1999/xlink';\n\nvar injectElement = function injectElement(el, callback, _ref) {\n var evalScripts = _ref.evalScripts,\n renumerateIRIElements = _ref.renumerateIRIElements;\n var imgUrl = el.getAttribute('data-src') || el.getAttribute('src');\n /* istanbul ignore else */\n\n if (!imgUrl || !/\\.svg/i.test(imgUrl)) {\n callback(new Error('Attempted to inject a file with a non-svg extension: ' + imgUrl));\n return;\n } // Make sure we aren't already in the process of injecting this element to\n // avoid a race condition if multiple injections for the same element are run.\n // :NOTE: Using indexOf() only _after_ we check for SVG support and bail, so\n // no need for IE8 indexOf() polyfill.\n\n /* istanbul ignore else */\n\n\n if (injectedElements.indexOf(el) !== -1) {\n // TODO: Extract.\n injectedElements.splice(injectedElements.indexOf(el), 1);\n el = null;\n return;\n } // Remember the request to inject this element, in case other injection calls\n // are also trying to replace this element before we finish.\n\n\n injectedElements.push(el); // Try to avoid loading the orginal image src if possible.\n\n el.setAttribute('src', '');\n loadSvg(imgUrl, function (error, svg) {\n /* istanbul ignore else */\n if (!svg) {\n // TODO: Extract.\n injectedElements.splice(injectedElements.indexOf(el), 1);\n el = null;\n callback(error);\n return;\n }\n\n var imgId = el.getAttribute('id');\n /* istanbul ignore else */\n\n if (imgId) {\n svg.setAttribute('id', imgId);\n }\n\n var imgTitle = el.getAttribute('title');\n /* istanbul ignore else */\n\n if (imgTitle) {\n svg.setAttribute('title', imgTitle);\n }\n\n var mergedClasses = Array.from(new Set([].concat((svg.getAttribute('class') || '').split(' '), ['injected-svg'], (el.getAttribute('class') || '').split(' ')))).join(' ').trim();\n svg.setAttribute('class', mergedClasses);\n var imgStyle = el.getAttribute('style');\n /* istanbul ignore else */\n\n if (imgStyle) {\n svg.setAttribute('style', imgStyle);\n }\n\n svg.setAttribute('data-src', imgUrl); // Copy all the data elements to the svg.\n\n var imgData = [].filter.call(el.attributes, function (at) {\n return /^data-\\w[\\w-]*$/.test(at.name);\n });\n Array.prototype.forEach.call(imgData, function (dataAttr) {\n /* istanbul ignore else */\n if (dataAttr.name && dataAttr.value) {\n svg.setAttribute(dataAttr.name, dataAttr.value);\n }\n });\n /* istanbul ignore else */\n\n if (renumerateIRIElements) {\n // Make sure any internally referenced clipPath ids and their clip-path\n // references are unique.\n //\n // This addresses the issue of having multiple instances of the same SVG\n // on a page and only the first clipPath id is referenced.\n //\n // Browsers often shortcut the SVG Spec and don't use clipPaths contained\n // in parent elements that are hidden, so if you hide the first SVG\n // instance on the page, then all other instances lose their clipping.\n // Reference: https://bugzilla.mozilla.org/show_bug.cgi?id=376027\n // Handle all defs elements that have iri capable attributes as defined by\n // w3c: http://www.w3.org/TR/SVG/linking.html#processingIRI. Mapping IRI\n var iriElementsAndProperties = {\n clipPath: ['clip-path'],\n 'color-profile': ['color-profile'],\n cursor: ['cursor'],\n filter: ['filter'],\n linearGradient: ['fill', 'stroke'],\n marker: ['marker', 'marker-start', 'marker-mid', 'marker-end'],\n mask: ['mask'],\n path: [],\n pattern: ['fill', 'stroke'],\n radialGradient: ['fill', 'stroke']\n };\n var element;\n var elements;\n var properties;\n var currentId;\n var newId;\n Object.keys(iriElementsAndProperties).forEach(function (key) {\n element = key;\n properties = iriElementsAndProperties[key];\n elements = svg.querySelectorAll(element + '[id]');\n\n var _loop = function _loop(a, elementsLen) {\n currentId = elements[a].id;\n newId = currentId + '-' + uniqueId(); // All of the properties that can reference this element type.\n\n var referencingElements = void 0;\n Array.prototype.forEach.call(properties, function (property) {\n // :NOTE: using a substring match attr selector here to deal with IE\n // \"adding extra quotes in url() attrs\".\n referencingElements = svg.querySelectorAll('[' + property + '*=\"' + currentId + '\"]');\n\n for (var b = 0, referencingElementLen = referencingElements.length; b < referencingElementLen; b++) {\n var attrValue = referencingElements[b].getAttribute(property);\n\n if (attrValue && !attrValue.match(new RegExp('url\\\\(#' + currentId + '\\\\)'))) {\n continue;\n }\n\n referencingElements[b].setAttribute(property, 'url(#' + newId + ')');\n }\n });\n var allLinks = svg.querySelectorAll('[*|href]');\n var links = [];\n\n for (var c = 0, allLinksLen = allLinks.length; c < allLinksLen; c++) {\n var href = allLinks[c].getAttributeNS(xlinkNamespace, 'href');\n /* istanbul ignore else */\n\n if (href && href.toString() === '#' + elements[a].id) {\n links.push(allLinks[c]);\n }\n }\n\n for (var d = 0, linksLen = links.length; d < linksLen; d++) {\n links[d].setAttributeNS(xlinkNamespace, 'href', '#' + newId);\n }\n\n elements[a].id = newId;\n };\n\n for (var a = 0, elementsLen = elements.length; a < elementsLen; a++) {\n _loop(a, elementsLen);\n }\n });\n } // Remove any unwanted/invalid namespaces that might have been added by SVG\n // editing tools.\n\n\n svg.removeAttribute('xmlns:a'); // Post page load injected SVGs don't automatically have their script\n // elements run, so we'll need to make that happen, if requested.\n // Find then prune the scripts.\n\n var scripts = svg.querySelectorAll('script');\n var scriptsToEval = [];\n var script;\n var scriptType;\n\n for (var i = 0, scriptsLen = scripts.length; i < scriptsLen; i++) {\n scriptType = scripts[i].getAttribute('type'); // Only process javascript types. SVG defaults to 'application/ecmascript'\n // for unset types.\n\n /* istanbul ignore else */\n\n if (!scriptType || scriptType === 'application/ecmascript' || scriptType === 'application/javascript' || scriptType === 'text/javascript') {\n // innerText for IE, textContent for other browsers.\n script = scripts[i].innerText || scripts[i].textContent; // Stash.\n\n /* istanbul ignore else */\n\n if (script) {\n scriptsToEval.push(script);\n } // Tidy up and remove the script element since we don't need it anymore.\n\n\n svg.removeChild(scripts[i]);\n }\n } // Run/Eval the scripts if needed.\n\n /* istanbul ignore else */\n\n\n if (scriptsToEval.length > 0 && (evalScripts === 'always' || evalScripts === 'once' && !ranScripts[imgUrl])) {\n for (var l = 0, scriptsToEvalLen = scriptsToEval.length; l < scriptsToEvalLen; l++) {\n // :NOTE: Yup, this is a form of eval, but it is being used to eval code\n // the caller has explictely asked to be loaded, and the code is in a\n // caller defined SVG file... not raw user input.\n //\n // Also, the code is evaluated in a closure and not in the global scope.\n // If you need to put something in global scope, use 'window'.\n // tslint:disable-next-line:function-constructor\n new Function(scriptsToEval[l])(window);\n } // Remember we already ran scripts for this svg.\n\n\n ranScripts[imgUrl] = true;\n } // :WORKAROUND: IE doesn't evaluate