{"version":3,"file":"app.js","sources":["../../../node_modules/@govflanders/vl-ui-core/dist/js/core.js","../../../node_modules/svg4everybody/dist/svg4everybody.js","../../../node_modules/@govflanders/vl-ui-accordion/dist/js/accordion.js","../../../node_modules/@govflanders/vl-ui-equal-height/dist/js/equal-height.js","../../../node_modules/@govflanders/vl-ui-slider/dist/js/slider.js","../../../src/assets/js/wa/components/functionalHeader.js","../../../src/assets/js/wa/components/topHeader.js","../../../src/assets/js/wa/components/personasNavigation.js","../../../src/assets/js/wa/components/inputClear.js","../../../src/assets/js/wa/components/helpDropdown.js","../../../src/assets/js/wa/components/cookieAccept.js","../../../src/assets/js/wa/components/fileUploadFocus.js","../../../src/assets/js/wa/components/uploadButtonsToggle.js","../../../src/assets/js/wa/helpers/components-loader.js","../../../src/assets/js/wa/app.js"],"sourcesContent":["(function (factory) {\n typeof define === 'function' && define.amd ? define(factory) :\n factory();\n}(function () { 'use strict';\n\n function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n window.vl = window.vl || {\n ns: 'vl-'\n }; // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds. If `immediate` is passed, trigger the function on the\n // leading edge, instead of the trailing.\n\n var debounce = function debounce(func, wait) {\n var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var timeout;\n return function () {\n var context = this,\n args = arguments,\n later,\n callNow;\n\n later = function later() {\n timeout = null;\n\n if (!immediate) {\n func.apply(context, args);\n }\n };\n\n callNow = immediate && !timeout;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(later, wait);\n\n if (callNow) {\n func.apply(context, args);\n }\n };\n };\n\n var throttle = function throttle(func) {\n var threshhold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 250;\n var scope = arguments.length > 2 ? arguments[2] : undefined;\n var last, deferTimer;\n return function () {\n var context = scope || this,\n now = Number(new Date()),\n args = arguments;\n\n if (last && now < last + threshhold) {\n // hold on to it\n window.clearTimeout(deferTimer);\n deferTimer = window.setTimeout(function () {\n last = now;\n func.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n func.apply(context, args);\n }\n };\n };\n\n var addClass = function addClass(el, classes) {\n el.classList.add(classes);\n };\n\n var removeClass = function removeClass(el, classes) {\n el.classList.remove(classes);\n };\n\n var hasClass = function hasClass(el, classes) {\n return el.classList.contains(classes);\n };\n\n var toggleClass = function toggleClass(el, classes) {\n el.classList.toggle(classes);\n };\n\n var addClassFor = function addClassFor(el, classes, duration) {\n addClass(el, classes);\n window.setTimeout(function () {\n removeClass(el, classes);\n }, duration);\n }; // Helper function that takes an HTML string & an object to use for\n // \"binding\" its properties to the HTML template above.\n\n\n var parseTemplate = function parseTemplate(str, data) {\n return str.replace(/\\$\\{(\\w+)\\}/gi, function (match, parensMatch) {\n if (typeof data[parensMatch] !== 'undefined') {\n return data[parensMatch];\n }\n\n return match;\n });\n }; // trigger a custom event on an object\n\n\n var triggerEvent = function triggerEvent(obj, evt) {\n var fireOnThis = obj,\n evtObj;\n\n if (document.createEvent) {\n evtObj = document.createEvent('MouseEvents');\n evtObj.initEvent(evt, true, false);\n fireOnThis.dispatchEvent(evtObj);\n } else if (document.createEventObject) {\n evtObj = document.createEventObject();\n fireOnThis.fireEvent(\"on\".concat(evt), evtObj);\n }\n };\n\n var unique = function unique(array) {\n return array.filter(function (elem, pos, arr) {\n return arr.indexOf(elem) === pos;\n });\n };\n\n var closest = function closest(value, to) {\n return Math.round(value / to) * to;\n }; // Current position of an element relative to the document.\n\n\n var offset = function offset(el) {\n var rect = el.getBoundingClientRect(),\n doc = el.ownerDocument,\n win = doc.defaultView || doc.parentWindow,\n docElem = doc.documentElement,\n xOff = win.pageXOffset; // getBoundingClientRect contains left scroll in Chrome on Android.\n // I haven't found a feature detection that proves this. Worst case\n // scenario on mis-match: the 'tap' feature on horizontal sliders breaks.\n\n if (/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)) {\n xOff = 0;\n }\n\n return {\n top: rect.top + win.pageYOffset - docElem.clientTop,\n left: rect.left + xOff - docElem.clientLeft\n };\n }; // Insert after\n\n\n var insertAfter = function insertAfter(newElement, targetElement) {\n var parent = targetElement.parentNode; // If targetElement is the parents last-child\n\n if (parent.lastchild === targetElement) {\n // Add the newElement after the target element\n parent.appendChild(newElement);\n } else {\n // Target has siblings, insert the new element between the target and its next sibling\n parent.insertBefore(newElement, targetElement.nextSibling);\n }\n };\n\n var removeElement = function removeElement(targetElement) {\n var parent = targetElement.parentNode;\n parent.removeChild(targetElement);\n };\n\n var isNumeric = function isNumeric(number) {\n return !isNaN(parseFloat(number)) && isFinite(number);\n };\n\n var wrap = function wrap(el, wrapper) {\n // Cache the current parent and sibling\n var parent = el.parentNode,\n sibling = el.nextSibling;\n wrapper.appendChild(el);\n /**\n * If the element had a sibling, insert the wrapper before\n * the sibling to maintain the HTML structure; otherwise, just\n * append it to the parent.\n */\n\n if (sibling) {\n parent.insertBefore(wrapper, sibling);\n } else {\n parent.appendChild(wrapper);\n }\n }; // Strip tags from element\n\n\n var stripTags = function stripTags(html) {\n var tmp = document.createElement('div');\n tmp.innerHTML = html;\n return tmp.textContent || tmp.innerText;\n }; // Create a unique ID\n\n\n var uniqueId = function uniqueId() {\n // Desired length of Id\n // Always start with a letter -- base 36 makes for a nice shortcut\n var idStrLen = 32,\n idStr = \"\".concat((Math.floor(Math.random() * 25) + 10).toString(36), \"_\"); // Add a timestamp in milliseconds (base 36 again) as the base\n\n idStr += \"\".concat(new Date().getTime().toString(36), \"_\"); // Similar to above, complete the Id using random, alphanumeric characters\n\n do {\n idStr += Math.floor(Math.random() * 35).toString(36);\n } while (idStr.length < idStrLen);\n\n return idStr;\n }; // Create a unique name\n\n\n var uniqueName = function uniqueName() {\n return Math.random().toString(36).substring(2, 5);\n }; // Rounds a number to 7 supported decimals\n\n\n var accurateNumber = function accurateNumber(number) {\n var p = Math.pow(10, 7);\n return Number((Math.round(number * p) / p).toFixed(7));\n }; // Limits a value to 0 - 100\n\n\n var limit = function limit(a) {\n return Math.max(Math.min(a, 100), 0);\n }; // Wraps a variable as an array, if it isn't one yet.\n\n\n var asArray = function asArray(a) {\n return Array.isArray(a) ? a : [a];\n }; // Count decimals\n\n\n var countDecimals = function countDecimals(numStr) {\n var pieces = numStr.split('.');\n return pieces.length > 0 ? pieces[1].length : 0;\n }; // Scroll element to specific position\n // TODO: use element.scrollIntoView instead, maybe with fallback if you want old browser to have a smooth scroll\n\n\n var scrollTo = function scrollTo(el, to, duration) {\n var callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {};\n var scrollTop = el.scrollTop,\n difference = to - scrollTop,\n perTick;\n\n if (duration < 0) {\n return;\n }\n\n perTick = difference / duration * 10;\n window.setTimeout(function () {\n if (scrollTop === to || duration <= 0) {\n callback();\n } else {\n el.scrollTop = scrollTop + perTick;\n scrollTo(el, to, duration - 10, callback);\n }\n }, 10);\n }; // Gets a random number between min and max\n\n\n var randomIntFromInterval = function randomIntFromInterval(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }; // Much faster each loop than a forEach loop\n\n\n var each = function each(arr, fn) {\n var l = arr.length,\n i = 0;\n\n for (; i < l; i++) {\n fn(arr[i], i);\n }\n };\n /**\n * Determines if a certain value exists, is not null, and not empty\n * @method exists\n * @param {type} value value to check\n * @param {Boolean} [nullAllowed = false] optional parameter to allow null\n * @param {Boolean} [emptyAllowed = false] optional paramet to allow empty values\n * @return {Boolean}\n */\n\n\n var exists = function exists(value) {\n var nullAllowed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var emptyAllowed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof value !== 'undefined') {\n if (nullAllowed || value !== null) {\n if (emptyAllowed || value !== '') {\n return true;\n }\n }\n }\n\n return false;\n };\n\n var bytesToSize = function bytesToSize(bytes) {\n var addUnits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var base = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1024;\n var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'],\n value = null,\n i;\n\n if (bytes === 0) {\n value = addUnits ? '0 bytes' : 0;\n } else {\n i = parseInt(Math.floor(Math.log(bytes) / Math.log(base)), 10);\n\n if (!addUnits) {\n value = Math.round(bytes / Math.pow(base, i), 2);\n }\n\n value = addUnits ? Math.round(bytes / Math.pow(base, i), 2) + ' ' + sizes[i] : Math.round(bytes / Math.pow(base, i), 2);\n }\n\n return value;\n };\n\n var getJson = function getJson(url, callback) {\n var xhr = new XMLHttpRequest();\n xhr.open('get', url, true);\n xhr.responseType = 'json';\n\n xhr.onload = function () {\n var status = xhr.status;\n\n if (status === 200) {\n callback(null, xhr.response);\n } else {\n callback(status);\n }\n };\n\n xhr.send();\n };\n /**\n * Get all DOM element up the tree that contain a class, ID, or data attribute\n * @param {Node} elem The base element\n * @param {String} selector The class, id, data attribute, or tag to look for\n * @return {Array} Null if no match\n */\n\n\n var getParents = function getParents(elem, selector) {\n var parents = [],\n firstChar;\n\n if (selector) {\n firstChar = selector.charAt(0);\n } // Get matches\n\n\n for (; elem && elem !== document; elem = elem.parentNode) {\n if (selector) {\n // If selector is a class\n if (firstChar === '.') {\n if (elem.classList.contains(selector.substr(1))) {\n parents.push(elem);\n }\n } // If selector is an ID\n\n\n if (firstChar === '#') {\n if (elem.id === selector.substr(1)) {\n parents.push(elem);\n }\n } // If selector is a data attribute\n\n\n if (firstChar === '[') {\n if (elem.hasAttribute(selector.substr(1, selector.length - 1))) {\n parents.push(elem);\n }\n } // If selector is a tag\n\n\n if (elem.tagName.toLowerCase() === selector) {\n parents.push(elem);\n }\n } else {\n parents.push(elem);\n }\n } // Return parents if any exist\n\n\n if (parents.length === 0) {\n return null;\n }\n\n return parents;\n };\n\n var getParentsUntil = function getParentsUntil(elem, parent, selector) {\n var parents = [],\n parentType,\n selectorType;\n\n if (parent) {\n parentType = parent.charAt(0);\n }\n\n if (selector) {\n selectorType = selector.charAt(0);\n } // Get matches\n\n\n for (; elem && elem !== document; elem = elem.parentNode) {\n // Check if parent has been reached\n if (parent) {\n // If parent is a class\n if (parentType === '.') {\n if (elem.classList.contains(parent.substr(1))) {\n break;\n }\n } // If parent is an ID\n\n\n if (parentType === '#') {\n if (elem.id === parent.substr(1)) {\n break;\n }\n } // If parent is a data attribute\n\n\n if (parentType === '[') {\n if (elem.hasAttribute(parent.substr(1, parent.length - 1))) {\n break;\n }\n } // If parent is a tag\n\n\n if (elem.tagName.toLowerCase() === parent) {\n break;\n }\n }\n\n if (selector) {\n // If selector is a class\n if (selectorType === '.') {\n if (elem.classList.contains(selector.substr(1))) {\n parents.push(elem);\n }\n } // If selector is an ID\n\n\n if (selectorType === '#') {\n if (elem.id === selector.substr(1)) {\n parents.push(elem);\n }\n } // If selector is a data attribute\n\n\n if (selectorType === '[') {\n if (elem.hasAttribute(selector.substr(1, selector.length - 1))) {\n parents.push(elem);\n }\n } // If selector is a tag\n\n\n if (elem.tagName.toLowerCase() === selector) {\n parents.push(elem);\n }\n } else {\n parents.push(elem);\n }\n } // Return parents if any exist\n\n\n if (parents.length === 0) {\n return null;\n }\n\n return parents;\n };\n\n var Util = function Util() {\n _classCallCheck(this, Util);\n\n this.addClass = addClass;\n this.removeClass = removeClass;\n this.hasClass = hasClass;\n this.toggleClass = toggleClass;\n this.addClassFor = addClassFor;\n this.parseTemplate = parseTemplate;\n this.triggerEvent = triggerEvent;\n this.unique = unique;\n this.closest = closest;\n this.offset = offset;\n this.insertAfter = insertAfter;\n this.removeElement = removeElement;\n this.isNumeric = isNumeric;\n this.wrap = wrap;\n this.stripTags = stripTags;\n this.uniqueId = uniqueId;\n this.uniqueName = uniqueName;\n this.accurateNumber = accurateNumber;\n this.limit = limit;\n this.asArray = asArray;\n this.countDecimals = countDecimals;\n this.scrollTo = scrollTo;\n this.randomIntFromInterval = randomIntFromInterval;\n this.debounce = debounce;\n this.throttle = throttle;\n this.each = each;\n this.exists = exists;\n this.bytesToSize = bytesToSize;\n this.getJson = getJson;\n this.getParents = getParents;\n this.getParentsUntil = getParentsUntil;\n };\n\n vl.util = new Util(); // Export single utils\n\n var noJsClass = 'no-js',\n jSclass = 'js'; // Remove no-js class, add js class\n\n var _jsDetection = function _jsDetection() {\n if (vl.util.hasClass(document.documentElement, noJsClass)) {\n vl.util.removeClass(document.documentElement, noJsClass);\n }\n\n vl.util.addClass(document.documentElement, jSclass);\n };\n\n _jsDetection();\n\n // Store setTimeout reference so promise-polyfill will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var setTimeoutFunc = setTimeout;\n\n function noop() {} // Polyfill for Function.prototype.bind\n\n\n function bind(fn, thisArg) {\n return function () {\n fn.apply(thisArg, arguments);\n };\n }\n\n function handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n\n if (self._state === 0) {\n self._deferreds.push(deferred);\n\n return;\n }\n\n self._handled = true;\n\n Promise$1._immediateFn(function () {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n\n var ret;\n\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n\n resolve(deferred.promise, ret);\n });\n }\n\n function resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');\n\n if (newValue && (_typeof(newValue) === 'object' || typeof newValue === 'function')) {\n var then = newValue.then;\n\n if (newValue instanceof Promise$1) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n }\n\n function reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n }\n\n function finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise$1._immediateFn(function () {\n if (!self._handled) {\n Promise$1._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n\n self._deferreds = null;\n }\n\n function Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n }\n /**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\n\n\n function doResolve(fn, self) {\n var done = false;\n\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }\n\n function Promise$1(fn) {\n if (!(this instanceof Promise$1)) throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n this._state = 0;\n this._handled = false;\n this._value = undefined;\n this._deferreds = [];\n doResolve(fn, this);\n }\n\n var _proto = Promise$1.prototype;\n\n _proto.catch = function (onRejected) {\n return this.then(null, onRejected);\n };\n\n _proto.then = function (onFulfilled, onRejected) {\n var prom = new this.constructor(noop);\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n };\n\n Promise$1.all = function (arr) {\n return new Promise$1(function (resolve, reject) {\n if (!arr || typeof arr.length === 'undefined') throw new TypeError('Promise.all accepts an array');\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (_typeof(val) === 'object' || typeof val === 'function')) {\n var then = val.then;\n\n if (typeof then === 'function') {\n then.call(val, function (val) {\n res(i, val);\n }, reject);\n return;\n }\n }\n\n args[i] = val;\n\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n };\n\n Promise$1.resolve = function (value) {\n if (value && _typeof(value) === 'object' && value.constructor === Promise$1) {\n return value;\n }\n\n return new Promise$1(function (resolve) {\n resolve(value);\n });\n };\n\n Promise$1.reject = function (value) {\n return new Promise$1(function (resolve, reject) {\n reject(value);\n });\n };\n\n Promise$1.race = function (values) {\n return new Promise$1(function (resolve, reject) {\n for (var i = 0, len = values.length; i < len; i++) {\n values[i].then(resolve, reject);\n }\n });\n }; // Use polyfill for setImmediate for performance gains\n\n\n Promise$1._immediateFn = typeof setImmediate === 'function' && function (fn) {\n setImmediate(fn);\n } || function (fn) {\n setTimeoutFunc(fn, 0);\n };\n\n Promise$1._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n };\n\n /**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE.\n *\n * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\n *\n */\n (function (window, document) {\n // features are natively supported.\n\n if ('IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'intersectionRatio' in window.IntersectionObserverEntry.prototype) {\n // Minimal polyfill for Edge 15's lack of `isIntersecting`\n // See: https://github.com/w3c/IntersectionObserver/issues/211\n if (!('isIntersecting' in window.IntersectionObserverEntry.prototype)) {\n Object.defineProperty(window.IntersectionObserverEntry.prototype, 'isIntersecting', {\n get: function get() {\n return this.intersectionRatio > 0;\n }\n });\n }\n\n return;\n }\n /**\n * Creates the global IntersectionObserverEntry constructor.\n * https://w3c.github.io/IntersectionObserver/#intersection-observer-entry\n * @param {Object} entry A dictionary of instance properties.\n * @constructor\n */\n\n function IntersectionObserverEntry(entry) {\n this.time = entry.time;\n this.target = entry.target;\n this.rootBounds = entry.rootBounds;\n this.boundingClientRect = entry.boundingClientRect;\n this.intersectionRect = entry.intersectionRect || getEmptyRect();\n this.isIntersecting = !!entry.intersectionRect; // Calculates the intersection ratio.\n\n var targetRect = this.boundingClientRect;\n var targetArea = targetRect.width * targetRect.height;\n var intersectionRect = this.intersectionRect;\n var intersectionArea = intersectionRect.width * intersectionRect.height; // Sets intersection ratio.\n\n if (targetArea) {\n // Round the intersection ratio to avoid floating point math issues:\n // https://github.com/w3c/IntersectionObserver/issues/324\n this.intersectionRatio = Number((intersectionArea / targetArea).toFixed(4));\n } else {\n // If area is zero and is intersecting, sets to 1, otherwise to 0\n this.intersectionRatio = this.isIntersecting ? 1 : 0;\n }\n }\n /**\n * Creates the global IntersectionObserver constructor.\n * https://w3c.github.io/IntersectionObserver/#intersection-observer-interface\n * @param {Function} callback The function to be invoked after intersection\n * changes have queued. The function is not invoked if the queue has\n * been emptied by calling the `takeRecords` method.\n * @param {Object=} opt_options Optional configuration options.\n * @constructor\n */\n\n\n function IntersectionObserver(callback, opt_options) {\n var options = opt_options || {};\n\n if (typeof callback != 'function') {\n throw new Error('callback must be a function');\n }\n\n if (options.root && options.root.nodeType != 1) {\n throw new Error('root must be an Element');\n } // Binds and throttles `this._checkForIntersections`.\n\n\n this._checkForIntersections = throttle(this._checkForIntersections.bind(this), this.THROTTLE_TIMEOUT); // Private properties.\n\n this._callback = callback;\n this._observationTargets = [];\n this._queuedEntries = [];\n this._rootMarginValues = this._parseRootMargin(options.rootMargin); // Public properties.\n\n this.thresholds = this._initThresholds(options.threshold);\n this.root = options.root || null;\n this.rootMargin = this._rootMarginValues.map(function (margin) {\n return margin.value + margin.unit;\n }).join(' ');\n }\n /**\n * The minimum interval within which the document will be checked for\n * intersection changes.\n */\n\n\n IntersectionObserver.prototype.THROTTLE_TIMEOUT = 100;\n /**\n * The frequency in which the polyfill polls for intersection changes.\n * this can be updated on a per instance basis and must be set prior to\n * calling `observe` on the first target.\n */\n\n IntersectionObserver.prototype.POLL_INTERVAL = null;\n /**\n * Use a mutation observer on the root element\n * to detect intersection changes.\n */\n\n IntersectionObserver.prototype.USE_MUTATION_OBSERVER = true;\n /**\n * Starts observing a target element for intersection changes based on\n * the thresholds values.\n * @param {Element} target The DOM element to observe.\n */\n\n IntersectionObserver.prototype.observe = function (target) {\n var isTargetAlreadyObserved = this._observationTargets.some(function (item) {\n return item.element == target;\n });\n\n if (isTargetAlreadyObserved) {\n return;\n }\n\n if (!(target && target.nodeType == 1)) {\n throw new Error('target must be an Element');\n }\n\n this._registerInstance();\n\n this._observationTargets.push({\n element: target,\n entry: null\n });\n\n this._monitorIntersections();\n\n this._checkForIntersections();\n };\n /**\n * Stops observing a target element for intersection changes.\n * @param {Element} target The DOM element to observe.\n */\n\n\n IntersectionObserver.prototype.unobserve = function (target) {\n this._observationTargets = this._observationTargets.filter(function (item) {\n return item.element != target;\n });\n\n if (!this._observationTargets.length) {\n this._unmonitorIntersections();\n\n this._unregisterInstance();\n }\n };\n /**\n * Stops observing all target elements for intersection changes.\n */\n\n\n IntersectionObserver.prototype.disconnect = function () {\n this._observationTargets = [];\n\n this._unmonitorIntersections();\n\n this._unregisterInstance();\n };\n /**\n * Returns any queue entries that have not yet been reported to the\n * callback and clears the queue. This can be used in conjunction with the\n * callback to obtain the absolute most up-to-date intersection information.\n * @return {Array} The currently queued entries.\n */\n\n\n IntersectionObserver.prototype.takeRecords = function () {\n var records = this._queuedEntries.slice();\n\n this._queuedEntries = [];\n return records;\n };\n /**\n * Accepts the threshold value from the user configuration object and\n * returns a sorted array of unique threshold values. If a value is not\n * between 0 and 1 and error is thrown.\n * @private\n * @param {Array|number=} opt_threshold An optional threshold value or\n * a list of threshold values, defaulting to [0].\n * @return {Array} A sorted list of unique and valid threshold values.\n */\n\n\n IntersectionObserver.prototype._initThresholds = function (opt_threshold) {\n var threshold = opt_threshold || [0];\n if (!Array.isArray(threshold)) threshold = [threshold];\n return threshold.sort().filter(function (t, i, a) {\n if (typeof t != 'number' || isNaN(t) || t < 0 || t > 1) {\n throw new Error('threshold must be a number between 0 and 1 inclusively');\n }\n\n return t !== a[i - 1];\n });\n };\n /**\n * Accepts the rootMargin value from the user configuration object\n * and returns an array of the four margin values as an object containing\n * the value and unit properties. If any of the values are not properly\n * formatted or use a unit other than px or %, and error is thrown.\n * @private\n * @param {string=} opt_rootMargin An optional rootMargin value,\n * defaulting to '0px'.\n * @return {Array} An array of margin objects with the keys\n * value and unit.\n */\n\n\n IntersectionObserver.prototype._parseRootMargin = function (opt_rootMargin) {\n var marginString = opt_rootMargin || '0px';\n var margins = marginString.split(/\\s+/).map(function (margin) {\n var parts = /^(-?\\d*\\.?\\d+)(px|%)$/.exec(margin);\n\n if (!parts) {\n throw new Error('rootMargin must be specified in pixels or percent');\n }\n\n return {\n value: parseFloat(parts[1]),\n unit: parts[2]\n };\n }); // Handles shorthand.\n\n margins[1] = margins[1] || margins[0];\n margins[2] = margins[2] || margins[0];\n margins[3] = margins[3] || margins[1];\n return margins;\n };\n /**\n * Starts polling for intersection changes if the polling is not already\n * happening, and if the page's visibility state is visible.\n * @private\n */\n\n\n IntersectionObserver.prototype._monitorIntersections = function () {\n if (!this._monitoringIntersections) {\n this._monitoringIntersections = true; // If a poll interval is set, use polling instead of listening to\n // resize and scroll events or DOM mutations.\n\n if (this.POLL_INTERVAL) {\n this._monitoringInterval = setInterval(this._checkForIntersections, this.POLL_INTERVAL);\n } else {\n addEvent(window, 'resize', this._checkForIntersections, true);\n addEvent(document, 'scroll', this._checkForIntersections, true);\n\n if (this.USE_MUTATION_OBSERVER && 'MutationObserver' in window) {\n this._domObserver = new MutationObserver(this._checkForIntersections);\n\n this._domObserver.observe(document, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true\n });\n }\n }\n }\n };\n /**\n * Stops polling for intersection changes.\n * @private\n */\n\n\n IntersectionObserver.prototype._unmonitorIntersections = function () {\n if (this._monitoringIntersections) {\n this._monitoringIntersections = false;\n clearInterval(this._monitoringInterval);\n this._monitoringInterval = null;\n removeEvent(window, 'resize', this._checkForIntersections, true);\n removeEvent(document, 'scroll', this._checkForIntersections, true);\n\n if (this._domObserver) {\n this._domObserver.disconnect();\n\n this._domObserver = null;\n }\n }\n };\n /**\n * Scans each observation target for intersection changes and adds them\n * to the internal entries queue. If new entries are found, it\n * schedules the callback to be invoked.\n * @private\n */\n\n\n IntersectionObserver.prototype._checkForIntersections = function () {\n var rootIsInDom = this._rootIsInDom();\n\n var rootRect = rootIsInDom ? this._getRootRect() : getEmptyRect();\n\n this._observationTargets.forEach(function (item) {\n var target = item.element;\n var targetRect = getBoundingClientRect(target);\n\n var rootContainsTarget = this._rootContainsTarget(target);\n\n var oldEntry = item.entry;\n\n var intersectionRect = rootIsInDom && rootContainsTarget && this._computeTargetAndRootIntersection(target, rootRect);\n\n var newEntry = item.entry = new IntersectionObserverEntry({\n time: now(),\n target: target,\n boundingClientRect: targetRect,\n rootBounds: rootRect,\n intersectionRect: intersectionRect\n });\n\n if (!oldEntry) {\n this._queuedEntries.push(newEntry);\n } else if (rootIsInDom && rootContainsTarget) {\n // If the new entry intersection ratio has crossed any of the\n // thresholds, add a new entry.\n if (this._hasCrossedThreshold(oldEntry, newEntry)) {\n this._queuedEntries.push(newEntry);\n }\n } else {\n // If the root is not in the DOM or target is not contained within\n // root but the previous entry for this target had an intersection,\n // add a new record indicating removal.\n if (oldEntry && oldEntry.isIntersecting) {\n this._queuedEntries.push(newEntry);\n }\n }\n }, this);\n\n if (this._queuedEntries.length) {\n this._callback(this.takeRecords(), this);\n }\n };\n /**\n * Accepts a target and root rect computes the intersection between then\n * following the algorithm in the spec.\n * TODO(philipwalton): at this time clip-path is not considered.\n * https://w3c.github.io/IntersectionObserver/#calculate-intersection-rect-algo\n * @param {Element} target The target DOM element\n * @param {Object} rootRect The bounding rect of the root after being\n * expanded by the rootMargin value.\n * @return {?Object} The final intersection rect object or undefined if no\n * intersection is found.\n * @private\n */\n\n\n IntersectionObserver.prototype._computeTargetAndRootIntersection = function (target, rootRect) {\n // If the element isn't displayed, an intersection can't happen.\n if (window.getComputedStyle(target).display == 'none') return;\n var targetRect = getBoundingClientRect(target);\n var intersectionRect = targetRect;\n var parent = getParentNode(target);\n var atRoot = false;\n\n while (!atRoot) {\n var parentRect = null;\n var parentComputedStyle = parent.nodeType == 1 ? window.getComputedStyle(parent) : {}; // If the parent isn't displayed, an intersection can't happen.\n\n if (parentComputedStyle.display == 'none') return;\n\n if (parent == this.root || parent == document) {\n atRoot = true;\n parentRect = rootRect;\n } else {\n // If the element has a non-visible overflow, and it's not the \n // or element, update the intersection rect.\n // Note: and cannot be clipped to a rect that's not also\n // the document rect, so no need to compute a new intersection.\n if (parent != document.body && parent != document.documentElement && parentComputedStyle.overflow != 'visible') {\n parentRect = getBoundingClientRect(parent);\n }\n } // If either of the above conditionals set a new parentRect,\n // calculate new intersection data.\n\n\n if (parentRect) {\n intersectionRect = computeRectIntersection(parentRect, intersectionRect);\n if (!intersectionRect) break;\n }\n\n parent = getParentNode(parent);\n }\n\n return intersectionRect;\n };\n /**\n * Returns the root rect after being expanded by the rootMargin value.\n * @return {Object} The expanded root rect.\n * @private\n */\n\n\n IntersectionObserver.prototype._getRootRect = function () {\n var rootRect;\n\n if (this.root) {\n rootRect = getBoundingClientRect(this.root);\n } else {\n // Use / instead of window since scroll bars affect size.\n var html = document.documentElement;\n var body = document.body;\n rootRect = {\n top: 0,\n left: 0,\n right: html.clientWidth || body.clientWidth,\n width: html.clientWidth || body.clientWidth,\n bottom: html.clientHeight || body.clientHeight,\n height: html.clientHeight || body.clientHeight\n };\n }\n\n return this._expandRectByRootMargin(rootRect);\n };\n /**\n * Accepts a rect and expands it by the rootMargin value.\n * @param {Object} rect The rect object to expand.\n * @return {Object} The expanded rect.\n * @private\n */\n\n\n IntersectionObserver.prototype._expandRectByRootMargin = function (rect) {\n var margins = this._rootMarginValues.map(function (margin, i) {\n return margin.unit == 'px' ? margin.value : margin.value * (i % 2 ? rect.width : rect.height) / 100;\n });\n\n var newRect = {\n top: rect.top - margins[0],\n right: rect.right + margins[1],\n bottom: rect.bottom + margins[2],\n left: rect.left - margins[3]\n };\n newRect.width = newRect.right - newRect.left;\n newRect.height = newRect.bottom - newRect.top;\n return newRect;\n };\n /**\n * Accepts an old and new entry and returns true if at least one of the\n * threshold values has been crossed.\n * @param {?IntersectionObserverEntry} oldEntry The previous entry for a\n * particular target element or null if no previous entry exists.\n * @param {IntersectionObserverEntry} newEntry The current entry for a\n * particular target element.\n * @return {boolean} Returns true if a any threshold has been crossed.\n * @private\n */\n\n\n IntersectionObserver.prototype._hasCrossedThreshold = function (oldEntry, newEntry) {\n // To make comparing easier, an entry that has a ratio of 0\n // but does not actually intersect is given a value of -1\n var oldRatio = oldEntry && oldEntry.isIntersecting ? oldEntry.intersectionRatio || 0 : -1;\n var newRatio = newEntry.isIntersecting ? newEntry.intersectionRatio || 0 : -1; // Ignore unchanged ratios\n\n if (oldRatio === newRatio) return;\n\n for (var i = 0; i < this.thresholds.length; i++) {\n var threshold = this.thresholds[i]; // Return true if an entry matches a threshold or if the new ratio\n // and the old ratio are on the opposite sides of a threshold.\n\n if (threshold == oldRatio || threshold == newRatio || threshold < oldRatio !== threshold < newRatio) {\n return true;\n }\n }\n };\n /**\n * Returns whether or not the root element is an element and is in the DOM.\n * @return {boolean} True if the root element is an element and is in the DOM.\n * @private\n */\n\n\n IntersectionObserver.prototype._rootIsInDom = function () {\n return !this.root || containsDeep(document, this.root);\n };\n /**\n * Returns whether or not the target element is a child of root.\n * @param {Element} target The target element to check.\n * @return {boolean} True if the target element is a child of root.\n * @private\n */\n\n\n IntersectionObserver.prototype._rootContainsTarget = function (target) {\n return containsDeep(this.root || document, target);\n };\n /**\n * Adds the instance to the global IntersectionObserver registry if it isn't\n * already present.\n * @private\n */\n\n\n IntersectionObserver.prototype._registerInstance = function () {\n };\n /**\n * Removes the instance from the global IntersectionObserver registry.\n * @private\n */\n\n\n IntersectionObserver.prototype._unregisterInstance = function () {\n };\n /**\n * Returns the result of the performance.now() method or null in browsers\n * that don't support the API.\n * @return {number} The elapsed time since the page was requested.\n */\n\n\n function now() {\n return window.performance && performance.now && performance.now();\n }\n /**\n * Throttles a function and delays its execution, so it's only called at most\n * once within a given time period.\n * @param {Function} fn The function to throttle.\n * @param {number} timeout The amount of time that must pass before the\n * function can be called again.\n * @return {Function} The throttled function.\n */\n\n\n function throttle(fn, timeout) {\n var timer = null;\n return function () {\n if (!timer) {\n timer = setTimeout(function () {\n fn();\n timer = null;\n }, timeout);\n }\n };\n }\n /**\n * Adds an event handler to a DOM node ensuring cross-browser compatibility.\n * @param {Node} node The DOM node to add the event handler to.\n * @param {string} event The event name.\n * @param {Function} fn The event handler to add.\n * @param {boolean} opt_useCapture Optionally adds the even to the capture\n * phase. Note: this only works in modern browsers.\n */\n\n\n function addEvent(node, event, fn, opt_useCapture) {\n if (typeof node.addEventListener == 'function') {\n node.addEventListener(event, fn, opt_useCapture || false);\n } else if (typeof node.attachEvent == 'function') {\n node.attachEvent('on' + event, fn);\n }\n }\n /**\n * Removes a previously added event handler from a DOM node.\n * @param {Node} node The DOM node to remove the event handler from.\n * @param {string} event The event name.\n * @param {Function} fn The event handler to remove.\n * @param {boolean} opt_useCapture If the event handler was added with this\n * flag set to true, it should be set to true here in order to remove it.\n */\n\n\n function removeEvent(node, event, fn, opt_useCapture) {\n if (typeof node.removeEventListener == 'function') {\n node.removeEventListener(event, fn, opt_useCapture || false);\n } else if (typeof node.detatchEvent == 'function') {\n node.detatchEvent('on' + event, fn);\n }\n }\n /**\n * Returns the intersection between two rect objects.\n * @param {Object} rect1 The first rect.\n * @param {Object} rect2 The second rect.\n * @return {?Object} The intersection rect or undefined if no intersection\n * is found.\n */\n\n\n function computeRectIntersection(rect1, rect2) {\n var top = Math.max(rect1.top, rect2.top);\n var bottom = Math.min(rect1.bottom, rect2.bottom);\n var left = Math.max(rect1.left, rect2.left);\n var right = Math.min(rect1.right, rect2.right);\n var width = right - left;\n var height = bottom - top;\n return width >= 0 && height >= 0 && {\n top: top,\n bottom: bottom,\n left: left,\n right: right,\n width: width,\n height: height\n };\n }\n /**\n * Shims the native getBoundingClientRect for compatibility with older IE.\n * @param {Element} el The element whose bounding rect to get.\n * @return {Object} The (possibly shimmed) rect of the element.\n */\n\n\n function getBoundingClientRect(el) {\n var rect;\n\n try {\n rect = el.getBoundingClientRect();\n } catch (err) {// Ignore Windows 7 IE11 \"Unspecified error\"\n // https://github.com/w3c/IntersectionObserver/pull/205\n }\n\n if (!rect) return getEmptyRect(); // Older IE\n\n if (!(rect.width && rect.height)) {\n rect = {\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n }\n\n return rect;\n }\n /**\n * Returns an empty rect object. An empty rect is returned when an element\n * is not in the DOM.\n * @return {Object} The empty rect.\n */\n\n\n function getEmptyRect() {\n return {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n width: 0,\n height: 0\n };\n }\n /**\n * Checks to see if a parent element contains a child element (including inside\n * shadow DOM).\n * @param {Node} parent The parent element.\n * @param {Node} child The child element.\n * @return {boolean} True if the parent node contains the child node.\n */\n\n\n function containsDeep(parent, child) {\n var node = child;\n\n while (node) {\n if (node == parent) return true;\n node = getParentNode(node);\n }\n\n return false;\n }\n /**\n * Gets the parent node of an element or its host element if the parent node\n * is a shadow root.\n * @param {Node} node The node whose parent to get.\n * @return {Node|null} The parent node or null if no parent exists.\n */\n\n\n function getParentNode(node) {\n var parent = node.parentNode;\n\n if (parent && parent.nodeType == 11 && parent.host) {\n // If the parent is a shadow root, return the host element.\n return parent.host;\n }\n\n return parent;\n } // Exposes the constructors globally.\n\n\n window.IntersectionObserver = IntersectionObserver;\n window.IntersectionObserverEntry = IntersectionObserverEntry;\n })(window, document);\n\n /*!\n * css-vars-ponyfill\n * v1.17.2\n * https://github.com/jhildenbiddle/css-vars-ponyfill\n * (c) 2018-2019 John Hildenbiddle \n * MIT license\n */\n function _extends$1() {\n _extends$1 = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends$1.apply(this, arguments);\n }\n\n function _toConsumableArray$1(arr) {\n return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _nonIterableSpread$1();\n }\n\n function _arrayWithoutHoles$1(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n }\n\n function _iterableToArray$1(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n }\n\n function _nonIterableSpread$1() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n }\n /*!\n * get-css-data\n * v1.6.3\n * https://github.com/jhildenbiddle/get-css-data\n * (c) 2018-2019 John Hildenbiddle \n * MIT license\n */\n\n\n function getUrls(urls) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var settings = {\n mimeType: options.mimeType || null,\n onBeforeSend: options.onBeforeSend || Function.prototype,\n onSuccess: options.onSuccess || Function.prototype,\n onError: options.onError || Function.prototype,\n onComplete: options.onComplete || Function.prototype\n };\n var urlArray = Array.isArray(urls) ? urls : [urls];\n var urlQueue = Array.apply(null, Array(urlArray.length)).map(function (x) {\n return null;\n });\n\n function isValidCss() {\n var cssText = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"\";\n var isHTML = cssText.trim().charAt(0) === \"<\";\n return !isHTML;\n }\n\n function onError(xhr, urlIndex) {\n settings.onError(xhr, urlArray[urlIndex], urlIndex);\n }\n\n function onSuccess(responseText, urlIndex) {\n var returnVal = settings.onSuccess(responseText, urlArray[urlIndex], urlIndex);\n responseText = returnVal === false ? \"\" : returnVal || responseText;\n urlQueue[urlIndex] = responseText;\n\n if (urlQueue.indexOf(null) === -1) {\n settings.onComplete(urlQueue);\n }\n }\n\n var parser = document.createElement(\"a\");\n urlArray.forEach(function (url, i) {\n parser.setAttribute(\"href\", url);\n parser.href = String(parser.href);\n var isIElte9 = Boolean(document.all && !window.atob);\n var isIElte9CORS = isIElte9 && parser.host.split(\":\")[0] !== location.host.split(\":\")[0];\n\n if (isIElte9CORS) {\n var isSameProtocol = parser.protocol === location.protocol;\n\n if (isSameProtocol) {\n var xdr = new XDomainRequest();\n xdr.open(\"GET\", url);\n xdr.timeout = 0;\n xdr.onprogress = Function.prototype;\n xdr.ontimeout = Function.prototype;\n\n xdr.onload = function () {\n if (isValidCss(xdr.responseText)) {\n onSuccess(xdr.responseText, i);\n } else {\n onError(xdr, i);\n }\n };\n\n xdr.onerror = function (err) {\n onError(xdr, i);\n };\n\n setTimeout(function () {\n xdr.send();\n }, 0);\n } else {\n console.warn(\"Internet Explorer 9 Cross-Origin (CORS) requests must use the same protocol (\".concat(url, \")\"));\n onError(null, i);\n }\n } else {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url);\n\n if (settings.mimeType && xhr.overrideMimeType) {\n xhr.overrideMimeType(settings.mimeType);\n }\n\n settings.onBeforeSend(xhr, url, i);\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status === 200 && isValidCss(xhr.responseText)) {\n onSuccess(xhr.responseText, i);\n } else {\n onError(xhr, i);\n }\n }\n };\n\n xhr.send();\n }\n });\n }\n /**\n * Gets CSS data from