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CAAC,OAAO,CAAC,KAAK,KAC3C,GAChB,EAAK,SAAS,CAAC,MAAM,CAAC,YAE1B,IAIF,EAAS,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,aAGpC,EAAS,OAAO,CAAC,EAAY,EAC/B,IAeA,IAAM,EAAO,SAAS,aAAa,CAAC,mBAC9B,EAAQ,SAAS,aAAa,CAAC,8BAC/B,EAAc,EAAM,aAAa,CAAC,4BAClC,EAAU,EAAK,aAAa,CAAC,kCAI7B,EAAe,SAAU,CAAK,EAC/B,GAAM,EAAM,cAAc,CAG1B,IAAK,CAAC,UAAU,CANJ,MAMqB,EAAM,QAAQ,CAAC,IACjD,EAAK,YAAY,CAAC,EAAY,GAC9B,EAAY,SAAS,CAAC,GAAG,CAAC,aAElB,IAAI,CAAC,UAAU,EAVV,MAU4B,EAAK,QAAQ,CAAC,KACvD,EAAM,YAAY,CAAC,EAAY,EAAM,QAAQ,CAAC,EAAE,EAChD,EAAY,SAAS,CAAC,MAAM,CAAC,YAEjC,EAGA,IAEA,OAAO,gBAAgB,CAAC,SAAU,EACpC","sources":["","src/components/program/program.js"],"sourcesContent":["var $855673fb3ef18df6$exports = {};\n{\n const navItems = document.querySelectorAll('a.navigation__link.-gridItem');\n const sections = [];\n navItems.forEach((item)=>{\n const sectionId = item.href.substring(item.href.indexOf(\"#\") + 1);\n const matchingSection = document.getElementById(sectionId);\n if (matchingSection) {\n sections.push(matchingSection);\n item.addEventListener('click', toggleSections);\n }\n });\n function toggleSections(e) {\n e.preventDefault();\n currentItem = document.querySelector('.navigation__link.-gridItem.-selected');\n if (currentItem !== this) {\n currentItem.classList.toggle('-selected');\n this.classList.toggle('-selected');\n }\n const href = this.href;\n const currentSection = document.querySelector('.program-section.-show');\n if (href.includes('#')) {\n const hash = href.substring(href.indexOf(\"#\") + 1);\n const section = document.getElementById(hash);\n section.classList.toggle('-show');\n currentSection.classList.toggle('-show');\n return false;\n }\n }\n loadSections();\n function loadSections() {\n const hash = window.location.hash.substring(1);\n let section;\n if (hash.length !== 0) {\n section = document.getElementById(hash);\n navItems.forEach((item)=>{\n const sectionId = item.href.substring(item.href.indexOf(\"#\") + 1);\n if (sectionId === hash) item.classList.toggle('-selected');\n });\n } else navItems.item(0).classList.toggle('-selected');\n sections.forEach(setClasses, section);\n }\n function setClasses(element) {\n if (this instanceof Window) {\n element.classList.add('program-section');\n document.getElementById('overview').classList.toggle('-show');\n } else if (element === this) element.classList.add('program-section', '-show');\n else element.classList.add('program-section');\n }\n //Variables used to grab the Main, Aside, Inquiry Form, and Navigation Grid elements.\n const main = document.querySelector('main.grid__main');\n const aside = document.querySelector('aside.grid__sidebar.-right');\n const inquiryForm = aside.querySelector('div.sidebar.-inquiryForm');\n const navGrid = main.querySelector('div.navigation.-programNavGrid');\n //The minimum width at which the inquiry form will shift from the sidebar to the top of the main content.\n const minWidth = 1025;\n //The function that shifts the inquiryForm from the sidebar to the atop the main content and back\n const inquiryShift = function(event) {\n if (event) event.preventDefault;\n //Shifts the inquiry form to above the Navigation Grid\n if (this.innerWidth < minWidth && aside.contains(inquiryForm)) {\n main.insertBefore(inquiryForm, navGrid);\n inquiryForm.classList.add('-shifted');\n //Shifts the inquiry form back to the top of the right sidebar.\n } else if (this.innerWidth >= minWidth && main.contains(inquiryForm)) {\n aside.insertBefore(inquiryForm, aside.children[0]);\n inquiryForm.classList.remove('-shifted');\n }\n };\n //Fire inquiryShift on page load\n inquiryShift();\n //Fire inquiryShift when screen resizes\n window.addEventListener(\"resize\", inquiryShift);\n}\n\n//# sourceMappingURL=program.js.map\n","{\n const navItems = document.querySelectorAll('a.navigation__link.-gridItem');\n const sections = [];\n\n navItems.forEach (\n item => {\n const sectionId = item.href.substring(item.href.indexOf(\"#\")+1);\n const matchingSection = document.getElementById(sectionId);\n\n if (matchingSection) {\n sections.push(matchingSection);\n item.addEventListener('click', toggleSections);\n }\n }\n );\n\n function toggleSections (e) {\n e.preventDefault();\n\n currentItem = document.querySelector('.navigation__link.-gridItem.-selected');\n\n if (currentItem!==this) {\n currentItem.classList.toggle('-selected');\n this.classList.toggle('-selected');\n }\n\n const href = this.href;\n const currentSection = document.querySelector('.program-section.-show');\n\n if (href.includes('#')) {\n const hash = href.substring(href.indexOf(\"#\")+1);\n const section = document.getElementById(hash);\n section.classList.toggle('-show');\n currentSection.classList.toggle('-show');\n return false;\n }\n }\n\n loadSections();\n\n function loadSections () {\n const hash = window.location.hash.substring(1);\n let section;\n\n if (hash.length !== 0) {\n section = document.getElementById(hash);\n navItems.forEach (\n item => {\n const sectionId = item.href.substring(item.href.indexOf(\"#\")+1);\n if (sectionId === hash) {\n item.classList.toggle('-selected');\n }\n }\n )\n }\n else {\n navItems.item(0).classList.toggle('-selected');\n }\n\n sections.forEach(setClasses, section);\n }\n\n function setClasses (element) {\n if (this instanceof Window) {\n element.classList.add('program-section');\n document.getElementById('overview').classList.toggle('-show');\n }\n else if (element === this) {\n element.classList.add('program-section', '-show');\n }\n else {\n element.classList.add('program-section');\n }\n }\n //Variables used to grab the Main, Aside, Inquiry Form, and Navigation Grid elements.\n const main = document.querySelector('main.grid__main');\n const aside = document.querySelector('aside.grid__sidebar.-right');\n const inquiryForm = aside.querySelector('div.sidebar.-inquiryForm');\n const navGrid = main.querySelector('div.navigation.-programNavGrid');\n //The minimum width at which the inquiry form will shift from the sidebar to the top of the main content.\n const minWidth = 1025;\n //The function that shifts the inquiryForm from the sidebar to the atop the main content and back\n const inquiryShift = function (event){\n if(event)event.preventDefault;\n\n //Shifts the inquiry form to above the Navigation Grid\n if((this.innerWidth < minWidth) && (aside.contains(inquiryForm))){\n main.insertBefore(inquiryForm,navGrid);\n inquiryForm.classList.add('-shifted');\n //Shifts the inquiry form back to the top of the right sidebar.\n }else if((this.innerWidth >= minWidth) && (main.contains(inquiryForm))){\n aside.insertBefore(inquiryForm,aside.children[0]);\n inquiryForm.classList.remove('-shifted');\n }\n }\n\n //Fire inquiryShift on page load\n inquiryShift();\n //Fire inquiryShift when screen resizes\n window.addEventListener(\"resize\", inquiryShift);\n}"],"names":["navItems","document","querySelectorAll","sections","toggleSections","e","preventDefault","currentItem","querySelector","classList","toggle","href","currentSection","includes","hash","substring","indexOf","section","getElementById","setClasses","element","Window","add","forEach","item","sectionId","matchingSection","push","addEventListener","loadSections","window","location","length","main","aside","inquiryForm","navGrid","inquiryShift","event","innerWidth","contains","insertBefore","children","remove"],"version":3,"file":"program.js.map"}