{"version":3,"sources":["webpack:///./node_modules/lodash.debounce/index.js","webpack:///./src/js/modules/accordion.js"],"names":["reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","freeGlobal","global","Object","freeSelf","self","root","Function","objectToString","prototype","toString","nativeMax","Math","max","nativeMin","min","now","Date","isObject","value","type","toNumber","isObjectLike","call","isSymbol","other","valueOf","replace","isBinary","test","slice","module","exports","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","undefined","apply","leadingEdge","setTimeout","timerExpired","shouldInvoke","timeSinceLastCall","trailingEdge","remainingWait","debounced","isInvoking","arguments","this","cancel","clearTimeout","flush","Module","Component","setupDefaults","dom","$triggers","el","_$$","$panels","resetFocusability","checkIfOpen","addListeners","_on","handleClick","bind","handleKeyDown","handleKeyUp","handleExpandAll","handleCollapseAll","window","_debounce","updateMinHeights","initialized","e","handlePanelDisplay","currentTarget","keyCode","KEYS","END","preventDefault","focusTrigger","length","HOME","don","UP","DOWN","handleArrowPress","$el","getAttribute","collapse","expand","event","CustomEvent","dispatchEvent","KEYS_DIRECTION","dataset","index","target","forEach","panelId","$panel","parentNode","_$","setAttribute","style","maxHeight","scrollHeight","visibility","removeAttribute","focus","filter","$exapnded","$collapsed","push","panel","param","URLSearchParams","location","search","get","$trigger","scrollIntoView"],"mappings":"+EAAA,YAUA,IASIA,EAAS,aAGTC,EAAa,qBAGbC,EAAa,aAGbC,EAAY,cAGZC,EAAeC,SAGfC,EAA8B,iBAAVC,GAAsBA,GAAUA,EAAOC,SAAWA,QAAUD,EAGhFE,EAA0B,iBAARC,MAAoBA,MAAQA,KAAKF,SAAWA,QAAUE,KAGxEC,EAAOL,GAAcG,GAAYG,SAAS,cAATA,GAUjCC,EAPcL,OAAOM,UAOQC,SAG7BC,EAAYC,KAAKC,IACjBC,EAAYF,KAAKG,IAkBjBC,EAAM,WACR,OAAOV,EAAKW,KAAKD,OA4Mn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KAAKO,IAAII,QAAQwC,QAAQ1C,IACnBA,EAAGgC,aAAa,eAClBwB,EAAWC,KAAKzD,GAEhBuD,EAAUE,KAAKzD,KAInBuD,EAAUb,QAAQgB,IAChBA,EAAMzD,IAAI,KAAKyC,QAAQ1C,GAAMA,EAAGoD,gBAAgB,eAElDI,EAAWd,QAAQgB,IACjBA,EAAMzD,IAAI,KAAKyC,QAAQ1C,GAAMA,EAAG+C,aAAa,WAAY,SAI7D3C,cACE,MACMuD,EADS,IAAIC,gBAAgB/C,OAAOgD,SAASC,QAC9BC,IAAI,iBACrBJ,GACFpE,KAAKO,IAAIC,UAAU2C,QAAQsB,IACrBA,EAAShC,aAAa,QAAU2B,GAClCpE,KAAK2C,OAAO8B,GACZlF,WAAW,KACTkF,EAASC,kBACR,MAEH1E,KAAK0C,SAAS+B,MAOTrE","file":"50.5a69e3.js","sourcesContent":["/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","import { Component } from '@verndale/core';\nimport { KEYS, KEYS_DIRECTION } from '../constants';\nimport _debounce from 'lodash.debounce'\n\nclass Module extends Component {\n setupDefaults() {\n this.dom = {\n $triggers: this.el._$$('[aria-expanded]'),\n $panels: this.el._$$('.accordion-item__panel')\n };\n\n this.resetFocusability();\n this.checkIfOpen();\n }\n\n addListeners() {\n this.dom.$triggers._on('click', this.handleClick.bind(this));\n this.dom.$triggers._on('keydown', this.handleKeyDown.bind(this));\n this.dom.$triggers._on('keyup', this.handleKeyUp.bind(this));\n this.el._on('expandAll', this.handleExpandAll.bind(this));\n this.el._on('collapseAll', this.handleCollapseAll.bind(this));\n window._on('resize', _debounce(this.updateMinHeights.bind(this), 200));\n\n this.initialized = true;\n }\n\n handleClick(e) {\n this.handlePanelDisplay(e.currentTarget);\n }\n\n handleKeyDown(e) {\n switch (e.keyCode) {\n case KEYS.END:\n e.preventDefault();\n this.focusTrigger(this.dom.$triggers[this.dom.$triggers.length - 1]);\n break;\n case KEYS.HOME:\n e.preventDefault();\n this.focusTrigger(this.don.$triggers[0]);\n break;\n case KEYS.UP:\n case KEYS.DOWN:\n e.preventDefault();\n break\n }\n }\n\n handleKeyUp(e) {\n switch (e.keyCode) {\n case KEYS.UP:\n case KEYS.DOWN:\n this.handleArrowPress(e);\n break;\n }\n }\n\n handlePanelDisplay($el) {\n const isExpanded = $el.getAttribute('aria-expanded') === 'true';\n\n if (isExpanded) {\n this.collapse($el);\n } else {\n this.expand($el);\n }\n\n this.resetFocusability();\n const event = new CustomEvent('change');\n this.el.dispatchEvent(event);\n }\n\n handleArrowPress(e) {\n const $el = e.currentTarget;\n\n if (!KEYS_DIRECTION[e.keyCode]) return;\n if (typeof $el.dataset.index === 'undefined') return;\n const index = parseInt($el.dataset.index, 10);\n\n if (this.dom.$triggers[index + KEYS_DIRECTION[e.keyCode]]) {\n this.focusTrigger(this.dom.$triggers[index + KEYS_DIRECTION[e.keyCode]]);\n return;\n }\n\n if (e.keyCode === KEYS.UP) {\n this.focusTrigger(this.dom.$triggers[this.dom.$triggers.length - 1]);\n } else if (e.keyCode === KEYS.DOWN) {\n this.focusTrigger(this.dom.$triggers[0]);\n }\n }\n\n handleExpandAll(e) {\n e.target._$$('[aria-expanded]').forEach(this.expand.bind(this));\n this.resetFocusability();\n const event = new CustomEvent('change');\n this.el.dispatchEvent(event);\n }\n\n handleCollapseAll(e) {\n e.target._$$('[aria-expanded]').forEach(this.collapse.bind(this));\n this.resetFocusability();\n const event = new CustomEvent('change');\n this.el.dispatchEvent(event);\n }\n\n expand($el) {\n const panelId = $el.getAttribute('aria-controls');\n const $panel = this.el.parentNode._$(`#${panelId}`);\n\n $el.setAttribute('aria-expanded', 'true');\n $panel.style.maxHeight = `${$panel.scrollHeight}px`;\n $panel.style.visibility = 'visible';\n $panel.removeAttribute('aria-hidden');\n }\n\n collapse($el) {\n const panelId = $el.getAttribute('aria-controls');\n const $panel = this.el.parentNode._$(`#${panelId}`);\n\n $el.setAttribute('aria-expanded', 'false');\n $panel.style.maxHeight = '0';\n $panel.style.visibility = 'hidden';\n $panel.setAttribute('aria-hidden', 'true');\n }\n\n focusTrigger($el) {\n $el.focus();\n }\n\n updateMinHeights() {\n const $exapnded = this.dom.$panels.filter(el => !el.getAttribute('aria-hidden'));\n $exapnded.forEach(el => {\n el.style.maxHeight = `${el.scrollHeight}px`;\n })\n }\n\n resetFocusability() {\n const $exapnded = [];\n const $collapsed = [];\n\n this.dom.$panels.forEach(el => {\n if (el.getAttribute('aria-hidden')) {\n $collapsed.push(el);\n } else {\n $exapnded.push(el);\n }\n });\n\n $exapnded.forEach(panel => {\n panel._$$('a').forEach(el => el.removeAttribute('tabindex'))\n });\n $collapsed.forEach(panel => {\n panel._$$('a').forEach(el => el.setAttribute('tabindex', '-1'));\n })\n }\n\n checkIfOpen() {\n const params = new URLSearchParams(window.location.search);\n const param = params.get('openAccordion');\n if (param) {\n this.dom.$triggers.forEach($trigger => {\n if ($trigger.getAttribute('id') === param) {\n this.expand($trigger);\n setTimeout(() => {\n $trigger.scrollIntoView();\n }, 1000);\n } else {\n this.collapse($trigger);\n }\n });\n }\n }\n}\n\nexport default Module;\n"],"sourceRoot":""}