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,YAAYoC,EAAExC,QAAQjB,MAAK,EAAM,IAE1CvD,EAAAA,GAAeE,iBAAgB,GAC/B0F,EAAE3D,aAAae,aAAa,iBAAiB,GAC7ChD,EAAAA,GAAeK,kBAAiB,GAChCgB,EAAML,UAAUsC,OAAO,sBACvBjC,EAAML,UAAUsC,OAAO,uBAC3B,EAGJqD,IACApH,OAAO2B,iBAAiB,UAAU,KAC1BM,IACAA,GAAkB,EAClBX,YAAW,KACP8F,IACAnF,GAAkB,CAAK,GACxB,KACP,GAGR,C","sources":["webpack://UKCISA/./wwwroot/app/src/js/global.js","webpack://UKCISA/./wwwroot/app/src/js/keyboard-accessibility-check.js","webpack://UKCISA/./wwwroot/app/src/js/main-navigation.js"],"sourcesContent":["// global site variables\r\n\r\nconst detectReducedMotionPref = window.matchMedia('(prefers-reduced-motion: reduce)');\r\n\r\nexport const siteSettings = {\r\n reducedMotionPref: detectReducedMotionPref.matches\r\n}\r\n\r\nexport const viewport = {\r\n vw: 0,\r\n vh: 0,\r\n setVw: (val) => {\r\n viewport.vw = val;\r\n },\r\n setVh: (val) => {\r\n viewport.vh = val;\r\n }\r\n}\r\n\r\nexport const mainNavigation = {\r\n mobileActive: false,\r\n setMobileActive: (mode) => {\r\n mainNavigation.mobileActive = mode;\r\n },\r\n desktopActive: false,\r\n setDesktopActive: (mode) => {\r\n mainNavigation.desktopActive = mode;\r\n }\r\n};\r\n\r\nexport const headerSearch = {\r\n active: false,\r\n setActive: (mode) => {\r\n headerSearch.active = mode;\r\n }\r\n};","// keyboard control detection\r\n\r\nexport const keyboardControl = {\r\n active: false\r\n}\r\n\r\nlet accessibilityTimeout = null;\r\nconst toggleAccessibilityClass = (mode) => {\r\n clearTimeout(accessibilityTimeout);\r\n accessibilityTimeout = setTimeout(() => {\r\n document.body.classList.toggle('keyboard-control', mode);\r\n keyboardControl.active = mode;\r\n }, 100);\r\n}\r\ndocument.body.addEventListener('keydown', function(e) {\r\n switch (e.key) {\r\n case 'Escape':\r\n case 'Up':\r\n case 'ArrowUp':\r\n case 'Down':\r\n case 'ArrowDown':\r\n case 'Left':\r\n case 'ArrowLeft':\r\n case 'Tab':\r\n case 'Right':\r\n case 'ArrowRight':\r\n case 'PageUp':\r\n case 'PageDown':\r\n case 'Spacebar':\r\n case ' ':\r\n case 'Enter':\r\n case 'Return':\r\n toggleAccessibilityClass(true);\r\n break;\r\n }\r\n});\r\ndocument.body.addEventListener('mousedown', function() {\r\n toggleAccessibilityClass(false);\r\n});\r\ndocument.body.addEventListener('touchstart', function() {\r\n toggleAccessibilityClass(false);\r\n});","// *****************************\r\n// ***** Main Navigation *****\r\n// *****************************\r\nimport { breakPoint } from './config';\r\nimport { keyboardControl } from './keyboard-accessibility-check';\r\nimport { mainNavigation } from './global';\r\n\r\nconst $html = document.querySelector('html');\r\nlet isMobile = true,\r\n resizeRequested = false;\r\n\r\nmainNavigation.setMobileActive(false);\r\nmainNavigation.setDesktopActive(false);\r\n\r\nclass menu {\r\n\r\n constructor(wrapper, toggleButton, ul) {\r\n if(wrapper != null && toggleButton != null && ul != null) {\r\n this.wrapper = wrapper;\r\n this.desktopSubmenuIndicator = wrapper.querySelector('.submenu--menu-indicator');\r\n this.navContent = wrapper.querySelector('nav');\r\n this.mobileToggle = toggleButton;\r\n this.ul = ul;\r\n this.expanded = false;\r\n this.focusTimeout = null;\r\n this.hideTimeout = null;\r\n this.hideDelay = 500;\r\n this.activeItemIndex = -1;\r\n this.activeSubmenuItemIndex = -1;\r\n this.items = [];\r\n [...this.ul.querySelectorAll('.header--content--menu > nav > ul > li')].forEach(i => {\r\n let x = this.items.length;\r\n this.items[x] = new menuItem(x, i, 1);\r\n });\r\n }\r\n }\r\n\r\n show() {\r\n // make menu semantically visible in both mobile and desktop versions\r\n this.expanded = true;\r\n this.wrapper.setAttribute('aria-hidden', false);\r\n if(isMobile) {\r\n // mobile - animate in the menu element\r\n this.mobileToggle.setAttribute('aria-expanded', true);\r\n $html.classList.add('mobile-menu-fading');\r\n mainNavigation.setMobileActive(true);\r\n window.requestAnimationFrame(() => {\r\n $html.classList.add('mobile-menu-active');\r\n this.wrapper.ontransitionend = () => {\r\n this.transitionEnd(true);\r\n this.update(true, 0, -1);\r\n };\r\n });\r\n } else {\r\n // desktop resets\r\n mainNavigation.setMobileActive(false);\r\n window.requestAnimationFrame(() => {\r\n $html.classList.remove('mobile-menu-active');\r\n });\r\n }\r\n }\r\n\r\n hide() {\r\n if(isMobile && mainNavigation.mobileActive) {\r\n // mobile - animate out menu element\r\n this.expanded = false;\r\n mainNavigation.setMobileActive(false);\r\n this.mobileToggle.setAttribute('aria-expanded', false);\r\n $html.classList.add('mobile-menu-fading');\r\n $html.classList.remove('mobile-menu-active');\r\n this.wrapper.ontransitionend = () => {\r\n this.transitionEnd(false);\r\n };\r\n } else {\r\n // hide menu semantically in both mobile and desktop versions\r\n this.expanded = false;\r\n this.wrapper.setAttribute('aria-hidden', true);\r\n }\r\n }\r\n\r\n transitionEnd(mode) {\r\n if(!mode) {\r\n // menu has hidden\r\n this.wrapper.setAttribute('aria-hidden', true);\r\n }\r\n $html.classList.remove('mobile-menu-fading');\r\n this.wrapper.ontransitionend = null;\r\n }\r\n\r\n storeTriggerPositions() {\r\n for(let x = 0, l = this.items.length; x < l; x++) {\r\n if(this.items[x].button != null) {\r\n let b = this.items[x].button.getBoundingClientRect();\r\n this.items[x].buttonX = Math.floor((b.left + b.right) / 2);\r\n }\r\n }\r\n if(this.desktopSubmenuIndicator != null && this.activeItemIndex > -1) this.desktopSubmenuIndicator.style.left = `${this.items[this.activeItemIndex].buttonX - 16}px`;\r\n }\r\n\r\n update(setFocus = false, itemIndex = -1, submenuItemIndex = -1) {\r\n if(!isMobile) this.storeTriggerPositions();\r\n if (itemIndex > -1 && submenuItemIndex > -1) {\r\n\r\n // FOCUS TARGET IS SUBMENU MENU ITEM\r\n\r\n if (isMobile && !this.expanded) this.show();\r\n // close old submenu without animation?\r\n if (this.activeItemIndex > -1 && this.activeSubmenuItemIndex > -1 && itemIndex != this.activeItemIndex && this.items[this.activeItemIndex].submenu.expanded) this.items[this.activeItemIndex].submenu.hide(isMobile);\r\n // desktop - update submenu indicator\r\n if(this.desktopSubmenuIndicator != null) this.desktopSubmenuIndicator.style.left = `${this.items[itemIndex].buttonX - 15}px`;\r\n // open new submenu\r\n if (!this.items[itemIndex].submenu.expanded) this.items[itemIndex].submenu.show(isMobile || (this.activeItemIndex == -1 || this.activeSubmenuItemIndex == -1));\r\n // focus on item\r\n if (keyboardControl.active && setFocus) {\r\n if(isMobile) {\r\n this.items[itemIndex].submenu.mobileItems[submenuItemIndex].focus();\r\n } else {\r\n this.items[itemIndex].submenu.desktopItems[submenuItemIndex].focus();\r\n }\r\n }\r\n\r\n } else if (itemIndex > -1) {\r\n\r\n // FOCUS TARGET IS TOP-LEVEL MENU ITEM\r\n\r\n if (isMobile && !this.expanded) this.show();\r\n // close old submenu with animation?\r\n if (this.activeItemIndex > -1 && this.items[this.activeItemIndex].hasSubmenu) {\r\n if (this.items[this.activeItemIndex].submenu.expanded) this.items[this.activeItemIndex].submenu.hide(true);\r\n }\r\n // focus on item\r\n if (keyboardControl.active && setFocus) {\r\n if (this.items[itemIndex].hasSubmenu) {\r\n this.items[itemIndex].submenu.toggle.focus();\r\n } else {\r\n this.items[itemIndex].link.focus();\r\n }\r\n }\r\n\r\n } else {\r\n if (this.activeItemIndex > -1 && this.activeSubmenuItemIndex > -1 && this.items[this.activeItemIndex].submenu.expanded) this.items[this.activeItemIndex].submenu.hide(!isMobile);\r\n if (isMobile && this.expanded) {\r\n this.hide();\r\n if (keyboardControl.active && setFocus) this.mobileToggle.focus();\r\n }\r\n }\r\n // update tabIndex setting\r\n if (this.activeItemIndex != itemIndex) {\r\n if (this.activeItemIndex > -1) {\r\n if (this.items[this.activeItemIndex].hasSubmenu) {\r\n this.items[this.activeItemIndex].submenu.toggle.setAttribute('tabindex', '-1');\r\n } else {\r\n this.items[this.activeItemIndex].link.setAttribute('tabindex', '-1');\r\n }\r\n }\r\n let nextTabIndex = itemIndex;\r\n if (!isMobile && nextTabIndex == -1) nextTabIndex = 0;\r\n if (nextTabIndex > -1) {\r\n if (this.items[nextTabIndex].hasSubmenu) {\r\n this.items[nextTabIndex].submenu.toggle.setAttribute('tabindex', '0');\r\n } else {\r\n this.items[nextTabIndex].link.setAttribute('tabindex', '0');\r\n }\r\n }\r\n }\r\n // store new values\r\n this.activeItemIndex = itemIndex;\r\n this.activeSubmenuItemIndex = submenuItemIndex;\r\n }\r\n}\r\n\r\nclass menuItem {\r\n constructor(itemIndex, obj, level) {\r\n this.level = level;\r\n this.index = itemIndex;\r\n this.li = obj;\r\n this.button = obj.querySelector('button.submenu--toggle');\r\n this.buttonX = 0;\r\n let sub = obj.querySelector('div.submenu');\r\n if (this.button && sub) {\r\n this.hasSubmenu = true;\r\n this.submenu = new subMenu(sub, this.button, level);\r\n } else {\r\n this.hasSubmenu = false;\r\n this.link = obj.querySelector('a');\r\n }\r\n }\r\n}\r\n\r\nclass subMenu {\r\n constructor(sub, button, level) {\r\n this.expanded = false;\r\n this.toggle = button;\r\n this.wrapper = sub;\r\n this.level = level;\r\n this.closeBtn = this.wrapper.querySelector('.submenu--close');\r\n this.inner = this.wrapper.querySelector('.submenu--content-area');\r\n this.mobileItems = [];\r\n [...this.inner.querySelectorAll('a:not(.ignore-mobile), button:not(.ignore-mobile)')].forEach(i => {\r\n this.mobileItems.push(i);\r\n });\r\n this.desktopItems = [];\r\n [...this.inner.querySelectorAll('a, button')].forEach(i => {\r\n this.desktopItems.push(i);\r\n });\r\n }\r\n show(animate) {\r\n this.expanded = true;\r\n this.wrapper.setAttribute('aria-hidden', false);\r\n this.toggle.setAttribute('aria-expanded', true);\r\n if(isMobile) {\r\n this.wrapper.style.maxHeight = this.inner.offsetHeight + 'px';\r\n if (animate) {\r\n this.wrapper.classList.add('animate');\r\n this.wrapper.ontransitionend = () => {\r\n this.wrapper.classList.remove('animate');\r\n if (this.level > 1 || isMobile) {\r\n this.wrapper.style.maxHeight = 'none';\r\n this.wrapper.ontransitionend = null;\r\n }\r\n };\r\n } else {\r\n this.wrapper.style.maxHeight = 'none';\r\n }\r\n } else {\r\n this.wrapper.style.maxHeight = 'none';\r\n mainNavigation.setDesktopActive(true);\r\n if (animate) {\r\n window.requestAnimationFrame(() => {\r\n $html.classList.add('desktop-menu-fading');\r\n window.requestAnimationFrame(() => {\r\n $html.classList.add('desktop-menu-active');\r\n this.wrapper.ontransitionend = () => {\r\n $html.classList.remove('desktop-menu-fading');\r\n this.wrapper.ontransitionend = null;\r\n };\r\n });\r\n });\r\n } else {\r\n $html.classList.add('desktop-menu-active');\r\n }\r\n }\r\n }\r\n hide(animate) {\r\n this.expanded = false;\r\n if (isMobile) {\r\n this.wrapper.setAttribute('aria-hidden', true);\r\n this.toggle.setAttribute('aria-expanded', false);\r\n this.wrapper.style.maxHeight = this.inner.offsetHeight + 'px';\r\n window.requestAnimationFrame(() => {\r\n this.wrapper.style.maxHeight = 0;\r\n });\r\n if (animate) {\r\n this.wrapper.classList.add('animate');\r\n this.wrapper.ontransitionend = (e) => {\r\n if(e.target == this.wrapper) this.wrapper.classList.remove('animate');\r\n };\r\n }\r\n } else {\r\n mainNavigation.setDesktopActive(false);\r\n if (animate) {\r\n $html.classList.add('desktop-menu-fading');\r\n $html.classList.remove('desktop-menu-active');\r\n this.wrapper.ontransitionend = () => {\r\n this.wrapper.ontransitionend = null;\r\n $html.classList.remove('desktop-menu-fading');\r\n this.wrapper.setAttribute('aria-hidden', true);\r\n this.toggle.setAttribute('aria-expanded', false);\r\n };\r\n } else {\r\n $html.classList.remove('desktop-menu-active');\r\n this.wrapper.setAttribute('aria-hidden', true);\r\n this.toggle.setAttribute('aria-expanded', false);\r\n }\r\n }\r\n }\r\n}\r\n\r\n// create instance of menu\r\n\r\nif(document.querySelector('.header--content--menu > nav > ul') != null) {\r\n const m = new menu(document.querySelector('.header--content--menu'), document.querySelector('.header--content--menu-toggle button'), document.querySelector('.header--content--menu > nav > ul'));\r\n\r\n\r\n // mobile 'whole menu toggle' functionality\r\n\r\n m.mobileToggle.addEventListener('click', () => {\r\n if (isMobile) {\r\n if (m.expanded) {\r\n // close\r\n m.hide();\r\n } else {\r\n // open\r\n m.show();\r\n }\r\n }\r\n });\r\n\r\n // close menu if user focus moves outside\r\n\r\n const bodyClickTouch = (t) => {\r\n if (!isMobile && m.activeSubmenuItemIndex > -1) {\r\n let inMenu = false;\r\n while (t != document.body) {\r\n if (t == m.wrapper) {\r\n inMenu = true;\r\n break\r\n }\r\n t = t.parentNode;\r\n }\r\n if (!inMenu) {\r\n m.update();\r\n }\r\n }\r\n }\r\n document.body.addEventListener('click', (e) => {\r\n bodyClickTouch(e.target);\r\n });\r\n\r\n // add menu item listeners\r\n\r\n for (let x = 0, l = m.items.length; x < l; x++) {\r\n let o = m.items[x];\r\n if (o.hasSubmenu) {\r\n\r\n o.submenu.toggle.addEventListener('click', () => {\r\n clearTimeout(m.focusTimeout);\r\n m.focusTimeout = null;\r\n if (o.submenu.expanded) {\r\n m.update(true, o.index);\r\n } else {\r\n m.update(true, o.index, 0);\r\n }\r\n });\r\n\r\n o.submenu.toggle.addEventListener('focus', () => {\r\n if (m.expanded && m.activeItemIndex != o.index) {\r\n clearTimeout(m.focusTimeout);\r\n m.focusTimeout = setTimeout(() => {\r\n m.update(true, o.index);\r\n m.focusTimeout = null;\r\n }, 250);\r\n }\r\n });\r\n\r\n // add submenu expander listeners if required\r\n\r\n let itemsArray = isMobile ? o.submenu.mobileItems : o.submenu.desktopItems;\r\n for (let xx = 0, ll = itemsArray.length; xx < ll; xx++) {\r\n let oo = itemsArray[xx];\r\n if (oo.hasSubmenu) {\r\n oo.submenu.toggle.addEventListener('click', () => {\r\n m.update(true, o.index, oo.index);\r\n });\r\n }\r\n }\r\n\r\n // desktop only - submenu close button\r\n\r\n o.submenu.closeBtn.addEventListener('click', () => {\r\n if (o.submenu.expanded) m.update(true, o.index);\r\n });\r\n }\r\n }\r\n\r\n // add keyboard accessibility\r\n m.ul.addEventListener('keydown', (e) => {\r\n switch (e.key) {\r\n // ESCAPE jumps out a level\r\n case 'Escape':\r\n e.preventDefault();\r\n if (m.activeSubmenuItemIndex > -1) {\r\n m.update(true, m.activeItemIndex);\r\n } else {\r\n m.update(true);\r\n }\r\n break;\r\n // DOWN / RIGHT to move through items at current level\r\n case 'Down':\r\n case 'ArrowDown':\r\n case 'Right':\r\n case 'ArrowRight':\r\n e.preventDefault();\r\n if (m.activeSubmenuItemIndex > -1) {\r\n let next = m.activeSubmenuItemIndex + 1,\r\n list = isMobile? m.items[m.activeItemIndex].submenu.mobileItems : m.items[m.activeItemIndex].submenu.desktopItems;\r\n if (next >= (isMobile ? list.length - 1 : list.length)) next = 0; // don't include submenu close button in mobile mode\r\n m.update(true, m.activeItemIndex, next);\r\n } else {\r\n let next = m.activeItemIndex + 1,\r\n list = m.items;\r\n if (next >= list.length) next = 0;\r\n m.update(true, next);\r\n }\r\n break;\r\n // UP / LEFT to move backwards through items at current level\r\n case 'Up':\r\n case 'ArrowUp':\r\n case 'Left':\r\n case 'ArrowLeft':\r\n e.preventDefault();\r\n if (m.activeSubmenuItemIndex > -1) {\r\n let next = m.activeSubmenuItemIndex - 1,\r\n list = isMobile? m.items[m.activeItemIndex].submenu.mobileItems : m.items[m.activeItemIndex].submenu.desktopItems;\r\n if (next < 0) next = isMobile ? list.length - 2 : list.length - 1; // don't include submenu close button in mobile mode\r\n m.update(true, m.activeItemIndex, next);\r\n } else {\r\n let next = m.activeItemIndex - 1,\r\n list = m.items;\r\n if (next < 0) next = list.length - 1;\r\n m.update(true, next);\r\n }\r\n break;\r\n // TAB close menu (if open) and move to next tab element\r\n case 'Tab':\r\n if(isMobile) {\r\n if (!m.hasSearch && m.activeItemIndex > -1) {\r\n m.hide();\r\n }\r\n } else {\r\n m.update();\r\n }\r\n break;\r\n // SPACE/ENTER/RETURN to click a item\r\n case 'Spacebar':\r\n case ' ':\r\n case 'Enter':\r\n case 'Return':\r\n e.preventDefault();\r\n if (m.activeSubmenuItemIndex > -1) {\r\n if(isMobile) {\r\n m.items[m.activeItemIndex].submenu.mobileItems[m.activeSubmenuItemIndex].click();\r\n } else {\r\n m.items[m.activeItemIndex].submenu.desktopItems[m.activeSubmenuItemIndex].click();\r\n }\r\n } else {\r\n if (m.items[m.activeItemIndex].hasSubmenu) {\r\n m.items[m.activeItemIndex].submenu.toggle.click();\r\n } else {\r\n m.items[m.activeItemIndex].link.click();\r\n }\r\n }\r\n break;\r\n }\r\n });\r\n\r\n // define and trigger resize check\r\n\r\n const resize = () => {\r\n let prev = isMobile;\r\n isMobile = window.innerWidth < breakPoint.LG;\r\n if(!isMobile) m.storeTriggerPositions();\r\n if(isMobile !== prev) {\r\n if(!isMobile) {\r\n m.show();\r\n m.update(false,1); // 'home' is hidden on desktop, so set menu to item 1 (without setting focus)\r\n } else {\r\n m.update(false);\r\n }\r\n // loop through all submenus and force close them\r\n m.items.forEach(s => {\r\n if(s.hasSubmenu) s.submenu.hide(false);\r\n });\r\n mainNavigation.setMobileActive(false);\r\n m.mobileToggle.setAttribute('aria-expanded', false);\r\n mainNavigation.setDesktopActive(false);\r\n $html.classList.remove('mobile-menu-active');\r\n $html.classList.remove('desktop-menu-active');\r\n }\r\n };\r\n\r\n resize();\r\n window.addEventListener('resize', () => {\r\n if(!resizeRequested) {\r\n resizeRequested = true;\r\n setTimeout(() => {\r\n resize();\r\n resizeRequested = false;\r\n }, 200);\r\n }\r\n });\r\n\r\n}\r\n"],"names":["siteSettings","reducedMotionPref","window","matchMedia","matches","viewport","vw","vh","setVw","val","setVh","mainNavigation","mobileActive","setMobileActive","mode","desktopActive","setDesktopActive","headerSearch","active","setActive","keyboardControl","accessibilityTimeout","toggleAccessibilityClass","clearTimeout","setTimeout","document","body","classList","toggle","addEventListener","e","key","$html","querySelector","isMobile","resizeRequested","menu","constructor","wrapper","toggleButton","ul","this","desktopSubmenuIndicator","navContent","mobileToggle","expanded","focusTimeout","hideTimeout","hideDelay","activeItemIndex","activeSubmenuItemIndex","items","querySelectorAll","forEach","i","x","length","menuItem","show","setAttribute","add","requestAnimationFrame","ontransitionend","transitionEnd","update","remove","hide","storeTriggerPositions","l","button","b","getBoundingClientRect","buttonX","Math","floor","left","right","style","setFocus","arguments","undefined","itemIndex","submenuItemIndex","submenu","mobileItems","focus","desktopItems","hasSubmenu","link","nextTabIndex","obj","level","index","li","sub","subMenu","closeBtn","inner","push","animate","maxHeight","offsetHeight","target","m","bodyClickTouch","t","inMenu","parentNode","o","itemsArray","xx","ll","oo","preventDefault","next","list","hasSearch","click","resize","prev","innerWidth","breakPoint","LG","s"],"sourceRoot":""}