{"version":3,"sources":["webpack:///./node_modules/lodash/isObjectLike.js","webpack:///./node_modules/lodash/isSymbol.js","webpack:///./node_modules/lodash/debounce.js","webpack:///./node_modules/lodash/now.js","webpack:///./node_modules/lodash/toNumber.js","webpack:///./src/js/utils/transitions.js","webpack:///./src/js/components/tabs.js"],"names":["module","exports","value","baseGetTag","isObjectLike","isObject","now","toNumber","nativeMax","Math","max","nativeMin","min","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","timeWaiting","remainingWait","debounced","isInvoking","arguments","this","clearTimeout","cancel","flush","root","Date","isSymbol","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","other","valueOf","replace","isBinary","test","slice","switchItemsAnimation","$moduleToShow","$moduleGroup","hideAnimationClass","length","forEach","$module","classList","add","transitionComplete","hidden","remove","Tabs","_Component","_classCallCheck","_callSuper","_inherits","key","dom","$tabsContainer","el","_$","$filterTabs","_$$","$dropdown","$dropdownListBox","$tabsContent","levelQueryParam","dataset","init","checkOverflow","_this$dom","_on","selectFilterFromTab","bind","selectFilterFromDropdown","window","addEventListener","_debounce","handleResize","level","getQueryStringValue","getQueryParameters","selectDefaultDropdownOption","element","scrollWidth","clientWidth","style","display","removeProperty","e","target","triggerDropdownChange","selectFilterFromTabs","$selectedTab","find","$tab","highlightSelectedTab","activeTab","getAttribute","setQueryParameters","detail","triggerCustomEvent","setAttribute","setQueryStringValue","triggerClickEvent","concat","activeId","id","Component"],"mappings":"4EA4BAA,EAAOC,QAJP,SAAsBC,GACpB,OAAgB,MAATA,GAAiC,iBAATA,I,oBCzBjC,IAAIC,EAAa,EAAQ,KACrBC,EAAe,EAAQ,KA2B3BJ,EAAOC,QALP,SAAkBC,GAChB,MAAuB,iBAATA,GACXE,EAAaF,IArBF,mBAqBYC,EAAWD,K,oB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KA,EAAKO,aAAa,gBAAiB,YAE7DT,GACFA,EAAaS,aAAa,gBAAiB,UAE9C,CAAA9C,IAAA,qBAAA9E,MAED,SAAmBqG,GACjB3D,KAAKsD,yBAAyB,CAAE0B,OAAQ,CAAE1H,MAAOqG,KACjD3D,KAAKuE,sBAAsBZ,KAC5B,CAAAvB,IAAA,qBAAA9E,MAED,SAAmBqG,GACjBwB,YAAoBnF,KAAKuC,GAAGO,gBAAiBa,KAC9C,CAAAvB,IAAA,wBAAA9E,MAED,SAAsBA,GACpB,IAAQsF,EAAqB5C,KAAKqC,IAA1BO,iBACHA,GAELwC,YACExC,EAAiBJ,GAAG,iCAAD6C,OAAkC/H,EAAK,UAE7D,CAAA8E,IAAA,YAAA9E,MAED,SAAUgI,GACR,IAAQzC,EAAiB7C,KAAKqC,IAAtBQ,aAER,OAAO1B,YACL0B,EAAa6B,MAAK,SAACC,GAAI,OAAKA,EAAKY,KAAOD,KACxCzC,KAEH,CAAAT,IAAA,8BAAA9E,MAED,WACE,IACMmH,EADkBzE,KAAKqC,IAArBI,YACyBiC,MAC/B,SAACC,GAAI,MAA4C,SAAvCA,EAAKG,aAAa,oBAEzBL,GAELzE,KAAKuE,sBAAsBE,EAAa1B,QAAQzF,Y,0FA7I1C,CAASkI,aAiJJzD","file":"13.fadbda.js","sourcesContent":["/**\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 != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\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) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\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 * 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 timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\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 clearTimeout(timerId);\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\nmodule.exports = debounce;\n","var root = require('./_root');\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\nmodule.exports = now;\n","var isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\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/**\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 = toNumber;\n","import { transitionComplete } from './timedEvents';\r\n\r\nexport const switchItemsAnimation = (\r\n $moduleToShow,\r\n $moduleGroup,\r\n hideAnimationClass = 'hidden'\r\n) => {\r\n $moduleGroup.forEach(($module) => $module.classList.add(hideAnimationClass));\r\n transitionComplete(() => {\r\n $moduleGroup.forEach(\r\n ($module) => ($module.hidden = $module !== $moduleToShow)\r\n );\r\n $moduleToShow.classList.remove(hideAnimationClass);\r\n });\r\n};\r\n","import { Component } from '@verndale/core';\r\nimport _debounce from 'lodash/debounce';\r\n\r\nimport { setQueryStringValue, getQueryStringValue } from '../utils/url';\r\nimport { switchItemsAnimation } from '../utils/transitions';\r\nimport { triggerClickEvent, triggerCustomEvent } from '../utils/events';\r\n\r\nclass Tabs extends Component {\r\n setupDefaults() {\r\n this.dom = {\r\n $tabsContainer: this.el._$('.tabs'),\r\n $filterTabs: this.el._$$('.tabs__tab'),\r\n $dropdown: this.el._$('.dropdown'),\r\n $dropdownListBox: this.el._$('.dropdown__listbox'),\r\n $tabsContent: this.el._$$('.tab-content')\r\n };\r\n\r\n this.el.levelQueryParam = this.el.dataset.levelQueryParam;\r\n this.init();\r\n this.checkOverflow();\r\n }\r\n\r\n addListeners() {\r\n const { $dropdownListBox, $filterTabs } = this.dom;\r\n\r\n $filterTabs._on('click', ::this.selectFilterFromTab);\r\n $dropdownListBox?._on('valueChange', ::this.selectFilterFromDropdown);\r\n window.addEventListener(\r\n 'resize',\r\n _debounce(this.handleResize.bind(this), 50)\r\n );\r\n }\r\n\r\n init() {\r\n const level = getQueryStringValue(this.el.levelQueryParam);\r\n if (level) return this.getQueryParameters(level);\r\n\r\n this.selectDefaultDropdownOption();\r\n }\r\n\r\n checkOverflow() {\r\n if (this.dom.$dropdown) {\r\n const element = this.dom.$tabsContainer;\r\n\r\n if (\r\n element.scrollWidth > element.clientWidth ||\r\n element.clientWidth === 0\r\n ) {\r\n element.classList.add('tabs--overflow');\r\n this.dom.$dropdown.style.display = 'block';\r\n } else {\r\n element.classList.remove('tabs--overflow');\r\n this.dom.$dropdown.style.removeProperty('display');\r\n }\r\n }\r\n }\r\n\r\n handleResize() {\r\n this.checkOverflow();\r\n }\r\n\r\n selectFilterFromTab(e) {\r\n const { $dropdownListBox } = this.dom;\r\n const value = e.target.dataset.value;\r\n\r\n if ($dropdownListBox) {\r\n this.triggerDropdownChange(value);\r\n } else {\r\n this.selectFilterFromTabs(e);\r\n }\r\n }\r\n\r\n selectFilterFromTabs(e) {\r\n const { $filterTabs } = this.dom;\r\n const { value } = e.target.dataset;\r\n const $selectedTab = $filterTabs.find(\r\n ($tab) => $tab.dataset.value === value\r\n );\r\n\r\n this.highlightSelectedTab($selectedTab);\r\n this.activeTab(e.target.getAttribute('aria-controls'));\r\n if (this.el.levelQueryParam) {\r\n this.setQueryParameters(value);\r\n }\r\n }\r\n\r\n selectFilterFromDropdown(e) {\r\n const { $filterTabs } = this.dom;\r\n const value = e?.detail.value;\r\n const $selectedTab = $filterTabs.find(\r\n ($tab) => $tab.dataset.value === value\r\n );\r\n\r\n if ($selectedTab) {\r\n this.highlightSelectedTab($selectedTab);\r\n this.activeTab($selectedTab.getAttribute('aria-controls'));\r\n triggerCustomEvent($selectedTab, 'tabSelected');\r\n }\r\n\r\n if (this.el.levelQueryParam) {\r\n this.setQueryParameters(value);\r\n }\r\n }\r\n\r\n highlightSelectedTab($selectedTab) {\r\n const { $filterTabs } = this.dom;\r\n\r\n $filterTabs.forEach(($tab) => $tab.setAttribute('aria-selected', 'false'));\r\n\r\n if ($selectedTab) {\r\n $selectedTab.setAttribute('aria-selected', 'true');\r\n }\r\n }\r\n\r\n getQueryParameters(level) {\r\n this.selectFilterFromDropdown({ detail: { value: level } });\r\n this.triggerDropdownChange(level);\r\n }\r\n\r\n setQueryParameters(level) {\r\n setQueryStringValue(this.el.levelQueryParam, level);\r\n }\r\n\r\n triggerDropdownChange(value) {\r\n const { $dropdownListBox } = this.dom;\r\n if (!$dropdownListBox) return;\r\n\r\n triggerClickEvent(\r\n $dropdownListBox._$(`.dropdown__option[data-value=\"${value}\"]`)\r\n );\r\n }\r\n\r\n activeTab(activeId) {\r\n const { $tabsContent } = this.dom;\r\n\r\n return switchItemsAnimation(\r\n $tabsContent.find(($tab) => $tab.id === activeId),\r\n $tabsContent\r\n );\r\n }\r\n\r\n selectDefaultDropdownOption() {\r\n const { $filterTabs } = this.dom;\r\n const $selectedTab = $filterTabs.find(\r\n ($tab) => $tab.getAttribute('aria-selected') === 'true'\r\n );\r\n if (!$selectedTab) return;\r\n\r\n this.triggerDropdownChange($selectedTab.dataset.value);\r\n }\r\n}\r\n\r\nexport default Tabs;\r\n"],"sourceRoot":""}