{"version":3,"sources":["../assets/scripts/global.js"],"names":["toggleNav","document","body","className","indexOf","replace","toggleSubNav","e","target","nodeName","accessibleNav","event","code","keyCode","which","focus","activeElement","parentNode","classList","contains","forEach","call","getElementsByClassName","el","doc","documentElement","setAttribute","navigator","userAgent","window","addEventListener","getElementById"],"mappings":"AAGA,QAAAA,cACA,IAAAC,SAAAC,KAAAC,UAAA,KAAAC,QAAA,gBACAH,SAAAC,KAAAC,UAAAF,SAAAC,KAAAC,UAAAE,QAAA,WAAA,IAEAJ,SAAAC,KAAAC,WAAA,WAIA,QAAAG,cAAAC,GAEA,OAAAA,EAAAC,OAAAC,YAIA,IAAAF,EAAAC,OAAAL,UAAA,KAAAC,QAAA,aACAG,EAAAC,OAAAL,UAAAI,EAAAC,OAAAL,UAAAE,QAAA,QAAA,IAEAE,EAAAC,OAAAL,WAAA,SAIA,QAAAO,eAAAC,GAEA,GAAAC,GAAAD,EAAAE,SAAAF,EAAAG,MACAC,EAAAd,SAAAe,aAGA,MAAAJ,IAGAG,EAAAE,WAAAA,WAAAC,UAAAC,SAAA,iBAGAC,QAAAC,KAAApB,SAAAqB,uBAAA,SAAA,SAAAC,GACAA,EAAApB,UAAAoB,EAAApB,UAAAE,QAAA,SAAA,MAKAU,EAAAE,WAAAC,UAAAC,SAAA,4BAEAJ,EAAAE,WAAAd,WAAA,YA5CA,GAAAqB,KAAAvB,SAAAwB,eACAD,KAAAE,aAAA,iBAAAC,UAAAC,WA+CAC,OAAAC,iBAAA,QAAApB,eAEAT,SAAA8B,eAAA,2BAAAD,iBAAA,QAAAxB,cAAA","file":"global.js","sourcesContent":["var doc = document.documentElement;\ndoc.setAttribute( 'data-useragent', navigator.userAgent );\n\nfunction toggleNav() {\n\tif ( ( ' ' + document.body.className + ' ' ).indexOf( ' openNav ' ) > -1 ) {\n\t\tdocument.body.className = document.body.className.replace( \" openNav\", \"\" );\n\t} else {\n\t\tdocument.body.className += ' openNav';\n\t}\n}\n\nfunction toggleSubNav(e) {\n\n\tif ( e.target.nodeName !== 'LI' ) {\n\t\treturn;\n\t}\n\t\n\tif ( ( ' ' + e.target.className + ' ' ).indexOf( ' open ' ) > -1 ) {\n\t\te.target.className = e.target.className.replace( \" open\", \"\" );\n\t} else {\n\t\te.target.className += ' open';\n\t}\n}\n\nfunction accessibleNav( event ) {\n\n\tvar code = event.keyCode || event.which;\n\tvar focus = document.activeElement;\n\t\n\t// Exit early if not Tab key\n\tif ( code != '9' ) return;\n\n\t// Exit early if the currently focused element is in a submenu\n\tif ( focus.parentNode.parentNode.classList.contains( 'sub-menu' ) ) return;\n\t\n\t// Otherwise, clear all the 'hovers' from the DOM\n\t[].forEach.call( document.getElementsByClassName( 'hover' ), function ( el ) {\n\t\tel.className = el.className.replace( ' hover', '' );\n\t} );\n\n\t// Exit early if the current nav item doesn't have children\n\t// (it shouldn't have a 'hover' state added)\n\tif ( ! focus.parentNode.classList.contains( 'menu-item-has-children' ) ) return;\n\n\tfocus.parentNode.className += ' hover';\n\n}\n\nwindow.addEventListener( 'keyup', accessibleNav );\n\ndocument.getElementById( 'menu-primary-navigation').addEventListener( 'click', toggleSubNav, false );"],"sourceRoot":"assets/scripts/"}