{"version":3,"sources":["webpack:///./node_modules/lodash.debounce/index.js","webpack:///./node_modules/prop-types/index.js","webpack:///./node_modules/prop-types/factoryWithThrowingShims.js","webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack:///./src/js/modules/header-search/hooks/useHeaderSearch.js","webpack:///./src/js/modules/header-search/HeaderSearchSuggestions.js","webpack:///./src/js/modules/header-search/HeaderSearch.js","webpack:///./src/js/modules/header-search/index.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","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","props","propName","componentName","location","propFullName","secret","err","Error","name","getShim","isRequired","ReactPropTypes","array","bool","number","object","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","$header","_$","fetchController","AbortController","useHeaderSearch","labels","useMemo","JSON","parse","focused","setFocused","useState","term","setTerm","fixedTerm","setFixedTerm","suggestions","setSuggestions","currentResultIndex","setCurrentResultIndex","current","$inMenuPrimaryNav","useRef","inMenuPrimaryNavFirstPanelId","id","showResults","length","updateCurrentResultIndexOnArrowPress","e","KEYS_DIRECTION","keyCode","newIndex","KEYS","UP","DOWN","reset","classList","remove","debouncedHandleTermChange","useCallback","debounce","async","abort","res","fetch","endpoint","searchUrlQuery","signal","json","Results","Keyword","useEffect","toggle","add","dispatchEvent","CustomEvent","_on","handleViewAll","window","href","searchUrl","handleSearchSubmit","preventDefault","Url","handleFormReset","handleClose","event","detail","onKeyDown","ESC","END","HOME","onKeyUp","onChange","target","onFocus","document","querySelector","_$$","forEach","el","updateDesignElement","onBlur","HeaderSearchSuggestions","className","aria-hidden","isVisible","searchResults","aria-labelledby","role","items","map","item","i","onMouseDown","key","Guid","focusedIndex","Title","ContentType","Institution","onViewAllClick","viewAll","propTypes","HeaderSearch","config","aria-expanded","aria-owns","aria-haspopup","action","onSubmit","onReset","noValidate","searchLabel","autoComplete","aria-autocomplete","aria-controls","aria-label","placeholder","required","clear","close","searchSubmit","viewBox","xlinkHref","defaultProps","Module"],"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,OA4MnB,SAASE,EAASC,GAChB,IAAIC,SAAcD,EAClB,QAASA,IAAkB,UAARC,GAA4B,YAARA,GA4EzC,SAASC,EAASF,GAChB,GAAoB,iBAATA,EACT,OAAOA,EAET,GAhCF,SAAkBA,GAChB,MAAuB,iBAATA,GAtBhB,SAAsBA,GACpB,QAASA,GAAyB,iBAATA,EAsBtBG,CAAaH,IAzTF,mBAyTYX,EAAee,KAAKJ,GA8B1CK,CAASL,GACX,OA3VM,IA6VR,GAAID,EAASC,GAAQ,CACnB,IAAIM,EAAgC,mBAAjBN,EAAMO,QAAwBP,EAAMO,UAAYP,EACnEA,EAAQD,EAASO,GAAUA,EAAQ,GAAMA,EAE3C,GAAoB,iBAATN,EACT,OAAiB,IAAVA,EAAcA,G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AAmBjC,GACzCmF,QAASnF,GAAK6E,EAAOzC,gBAAgBpC,GACrCoF,YAAU,IAERP,EAAO7F,MAAQ,0BAAMyE,cAAY,OAAOD,UAAU,wBAAwB/E,EAAO4G,aACnF,2BACE7B,UAAU,uBACVvK,KAAK,SACL2G,GAAG,gBACH/C,KAAMR,EAAM6E,eACZoE,aAAa,MACbC,oBAAkB,OAClBC,gBAAc,4BACdC,aAAYhH,EAAO4G,YACnBxC,SAAUgC,EAAOhC,SACjBE,QAAS8B,EAAO9B,QAChBO,OAAQuB,EAAOvB,OACfd,UAAWqC,EAAOrC,UAClBI,QAASiC,EAAOjC,QAChB8C,YAAajH,EAAOiH,YACpB1M,MAAO6L,EAAO7F,KACd2G,UAAQ,MAEPd,EAAO7F,MAAQ,4BAAQkF,YAAaW,EAAOzC,gBAAiBnJ,KAAK,QAAQuK,UAAU,yCAAyC/E,EAAOmH,QACpIf,EAAO7F,MAAQ6F,EAAOhG,SAAW,4BAAQqF,YAAaW,EAAOxC,YAAapJ,KAAK,QAAQuK,UAAU,yCAAyC/E,EAAOoH,OACnJ,4BAAQJ,aAAYhH,EAAOqH,aAActC,UAAU,wBAAwBvK,KAAK,SAASiL,YAAaW,EAAO5C,oBAC3G,yBAAK8D,QAAQ,eAAc,yBAAKC,UAAU,eAG9C,kBAAC,EAAD,CAAyBvB,eAAgBI,EAAOhD,cAAewC,aAAcQ,EAAOvF,mBAAoBoE,UAAWmB,EAAOhF,YAAapB,OAAQA,EAAQqF,MAAOe,EAAOzF,eAK3KwF,EAAaqB,aAAe,GAI5BrB,EAAaD,UAAY,GAIVC,QCzDAsB","file":"37.5300b9.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","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","import { useEffect, useMemo, useState, useCallback, useRef } from 'react';\nimport debounce from 'lodash.debounce';\nimport { KEYS, KEYS_DIRECTION } from '../../../constants';\n\nconst $header = _$('.header');\nlet fetchController = new AbortController();\n\nfunction useHeaderSearch(props) {\n const labels = useMemo(() => JSON.parse(props.labels), []);\n const [focused, setFocused] = useState(false);\n const [term, setTerm] = useState('');\n const [fixedTerm, setFixedTerm] = useState('');\n const [suggestions, setSuggestions] = useState([]);\n const [currentResultIndex, setCurrentResultIndex] = useState(-1);\n const { current: $inMenuPrimaryNav } = useRef(_$('.header__panel'));\n const { current: inMenuPrimaryNavFirstPanelId } = useRef(\n _$('.in-menu-primary-nav__trigger').id\n );\n const showResults = suggestions.length && focused && term.length > 2;\n\n const updateDesignElement = () => {\n const currentDesignElementClass =\n 'header-panel__design-element-wrapper--current';\n const current = document.querySelector('[data-nav-id=\"search\"]');\n _$$('.header-panel__design-element-wrapper').forEach(el =>\n el.classList.remove(currentDesignElementClass)\n );\n current?.classList?.add?.(currentDesignElementClass);\n };\n\n const onChange = e => setTerm(e.target.value);\n\n const onFocus = () => {\n setFocused(true);\n updateDesignElement();\n };\n\n const onBlur = () => {\n setFocused(false);\n };\n\n const onKeyDown = e => {\n switch (e.keyCode) {\n case KEYS.ESC:\n e.preventDefault();\n setTerm('');\n break;\n case KEYS.END:\n e.preventDefault();\n setCurrentResultIndex(suggestions.length - 1);\n break;\n case KEYS.HOME:\n e.preventDefault();\n setCurrentResultIndex(0);\n break;\n case KEYS.UP:\n case KEYS.DOWN:\n e.preventDefault();\n break;\n }\n };\n\n const onKeyUp = e => {\n switch (e.keyCode) {\n case KEYS.UP:\n case KEYS.DOWN:\n updateCurrentResultIndexOnArrowPress(e);\n break;\n }\n };\n\n const handleViewAll = () => {\n window.location.href = `${props.searchUrl}?${props.searchUrlQuery}=${fixedTerm}`;\n };\n\n const handleFocusChange = () => {\n if (focused) {\n $header.classList.add('header--search-focused');\n $header.classList.add('header--base-search-activated');\n $header.dispatchEvent(new CustomEvent('pauseheaderpanelfocustrap'));\n } else {\n $header.classList.remove('header--search-focused');\n $header.dispatchEvent(new CustomEvent('continueheaderpanelfocustrap'));\n }\n };\n\n const handlePanelClose = () => {\n $header._on('close', reset);\n };\n\n const hanleShowResultsChange = () => {\n $header.classList.toggle('header--search-suggestions-shown', showResults);\n };\n\n const handleTermChange = async term => {\n fetchController.abort();\n fetchController = new AbortController();\n\n if (!term || term.length <= 2) {\n setSuggestions([]);\n return;\n }\n\n let res = await fetch(`${props.endpoint}?${props.searchUrlQuery}=${term}`, {\n signal: fetchController.signal\n });\n res = await res.json();\n\n setSuggestions(res?.Results || []);\n setFixedTerm(res?.Keyword || '');\n setCurrentResultIndex(-1);\n };\n\n const updateCurrentResultIndexOnArrowPress = e => {\n if (!KEYS_DIRECTION[e.keyCode]) return;\n\n const newIndex = currentResultIndex + KEYS_DIRECTION[e.keyCode];\n\n if (newIndex < suggestions.length && newIndex >= 0) {\n setCurrentResultIndex(currentResultIndex + KEYS_DIRECTION[e.keyCode]);\n return;\n }\n\n if (e.keyCode === KEYS.UP) {\n setCurrentResultIndex(suggestions.length - 1);\n } else if (e.keyCode === KEYS.DOWN) {\n setCurrentResultIndex(0);\n }\n };\n\n const handleSearchSubmit = e => {\n if (!term.length) {\n e.preventDefault();\n return;\n }\n\n const current = suggestions[currentResultIndex];\n\n if (current) {\n e.preventDefault();\n window.location = current.Url;\n }\n\n if (fixedTerm) {\n e.preventDefault();\n window.location = `${props.searchUrl}?${props.searchUrlQuery}=${fixedTerm}`;\n }\n };\n\n const handleFormReset = e => {\n e.preventDefault();\n setTerm('');\n };\n\n const reset = () => {\n setFocused(false);\n setTerm('');\n $header.classList.remove('header--base-search-activated');\n };\n\n const handleClose = () => {\n reset();\n const event = new CustomEvent('activatetab', {\n detail: { id: inMenuPrimaryNavFirstPanelId }\n });\n $inMenuPrimaryNav.dispatchEvent(event);\n };\n\n const debouncedHandleTermChange = useCallback(\n debounce(handleTermChange, 250),\n []\n );\n\n useEffect(hanleShowResultsChange, [showResults]);\n useEffect(handleFocusChange, [focused]);\n useEffect(() => debouncedHandleTermChange(term), [term]);\n useEffect(handlePanelClose, []);\n\n return {\n labels,\n term,\n focused,\n suggestions,\n showResults,\n currentResultIndex,\n handleViewAll,\n handleSearchSubmit,\n handleFormReset,\n handleClose,\n onKeyDown,\n onKeyUp,\n onChange,\n onFocus,\n onBlur\n };\n}\n\nexport default useHeaderSearch;\n","import React from 'react'\nimport PropTypes from 'prop-types'\n\nconst HeaderSearchSuggestions = ({ labels, ...props }) => {\n return (\n
\n

{labels.searchResults}

\n \n {props.items.map((item, i) => (\n window.location = item.Url} key={item.Guid}\n className={`header-search-suggestions__item ${props.focusedIndex === i ? 'header-search-suggestions__item--focused' : ''}`}\n >\n {item.Title}\n \n {item.ContentType}\n {/* Adds spacing between the terms, this seems better than using HTML tags and CSS for this particular case */}\n           \n {item.Institution}\n \n \n ))}\n \n \n {labels.viewAll}\n \n
\n )\n}\n\nHeaderSearchSuggestions.propTypes = {\n\n}\n\nexport default HeaderSearchSuggestions\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport useHeaderSearch from './hooks/useHeaderSearch';\nimport HeaderSearchSuggestions from './HeaderSearchSuggestions';\n\nfunction HeaderSearch(props) {\n const { labels, ...config } = useHeaderSearch(props);\n\n return (\n
\n config.handleSearchSubmit(e)}\n onReset={e => config.handleFormReset(e)}\n noValidate\n >\n {!config.term && {labels.searchLabel}}\n \n {!!config.term && }\n {!config.term && config.focused && }\n \n \n \n
\n )\n}\n\nHeaderSearch.defaultProps = {\n\n};\n\nHeaderSearch.propTypes = {\n\n};\n\nexport default HeaderSearch;\n","import Module from './HeaderSearch';\n\nexport default Module;\n"],"sourceRoot":""}