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B,KAAM,eAGR,QAAQoB,EAAQ/E,KAAK,qBAAsB,CACzCwD,SAAU,GACV0B,MAAO,OACPC,EAAG,EACHxB,KAAM,eAGR,QAAQoB,EAAQ/E,KAAK,qBAAsB,CACzCwD,SAAU,GACVwB,OAAQ,EACRC,EAAG,EACHtB,KAAM,iBAvCR,QAAQoB,EAAQ/E,KAAK,qBAAsB,CACzCwD,SAAU,GACVwB,OAAQ,GACRC,EAAG,EACHtB,KAAM,eAGR,QAAQoB,EAAQ/E,KAAK,qBAAsB,CACzCwD,SAAU,GACV0B,MAAO,EACPC,EAAG,GACHxB,KAAM,eAGR,QAAQoB,EAAQ/E,KAAK,qBAAsB,CACzCwD,SAAU,GACVwB,QAAS,GACTC,GAAI,GACJtB,KAAM,eAwBZ,E","sources":["webpack://bunker/./node_modules/.pnpm/@gsap+shockingly@3.11.5/node_modules/@gsap/shockingly/index.js","webpack://bunker/./src/js/navigation.js"],"sourcesContent":["import { gsap, Power0, Power1, Power2, Power3, Power4, Linear, Quad, Cubic, Quart, Quint, Strong, Elastic, Back, SteppedEase, Bounce, Sine, Expo, Circ, TweenLite, TimelineLite, TimelineMax } from \"./gsap-core.js\";\nimport { CSSPlugin } from \"./CSSPlugin.js\";\nvar gsapWithCSS = gsap.registerPlugin(CSSPlugin) || gsap,\n // to protect from tree shaking\nTweenMaxWithCSS = gsapWithCSS.core.Tween;\nexport { gsapWithCSS as gsap, gsapWithCSS as default, CSSPlugin, TweenMaxWithCSS as TweenMax, TweenLite, TimelineMax, TimelineLite, Power0, Power1, Power2, Power3, Power4, Linear, Quad, Cubic, Quart, Quint, Strong, Elastic, Back, SteppedEase, Bounce, Sine, Expo, Circ };","import gsap from \"gsap\";\nimport { MorphSVGPlugin } from \"gsap/all\";\n\nexport default class Navigation {\n $masthead = $(\"#masthead\");\n $bg = this.$masthead.find(\".masthead-bg\");\n $logo = $(\"#masthead .logo svg\");\n $button = $(\".toggle-menu\");\n $nav = $(\"nav#primary\");\n isOpen = false;\n $els = $(\"a[href='#top-page']\");\n backgroundColour = \"#5F2467\";\n logoColour = \"#222a53\";\n style = \"dark\";\n\n constructor() {\n this.init();\n }\n\n init() {\n gsap.registerPlugin(MorphSVGPlugin);\n\n this.style = this.$masthead.data(\"style\");\n\n this.$button.on(\"click\", () => {\n this.handleClick();\n });\n\n this.$els.each(function (index) {\n $(this).on(\"click\", function () {\n window.scroll({\n top: 0,\n left: 0,\n behavior: \"smooth\",\n });\n });\n });\n\n $(document).on(\"click\", (e) => {\n if ($(e.target).closest(\"#masthead\").length === 0) {\n this.closeMenu();\n this.isOpen = false;\n }\n });\n\n window.setTimeout(() => {\n this.handleSubmenus();\n }, 200);\n\n this.setMastheadColour();\n\n this.onScroll();\n\n window.addEventListener(\"scroll\", () => {\n this.onScroll();\n });\n\n $(\"#hamburger\").on(\"click\", () => {\n this.toggleMobileMenu();\n });\n }\n\n isTouchDevice() {\n return (\n \"ontouchstart\" in window ||\n navigator.maxTouchPoints > 0 ||\n navigator.msMaxTouchPoints > 0\n );\n }\n\n onScroll() {\n if (window.scrollY > 0) {\n this.$masthead.addClass(\"is-scrolled\");\n this.pulldownMasthead();\n } else {\n this.$masthead.removeClass(\"is-scrolled\");\n this.regularMasterhead();\n }\n }\n\n setMastheadColour() {\n this.backgroundColour = $(\"#masthead-bg\").attr(\"fill\");\n\n // Append the document with a style tag that sets the background colour of the masthead.\n const style = document.createElement(\"style\");\n\n let html = `#masthead.pulldown .btn-secondary::after { background-color: ${this.backgroundColour}; } #masthead.pulldown .btn-secondary:hover { color: #fff !important; } #masthead.pulldown .btn-primary:hover {color: ${this.backgroundColour} !important;}`;\n\n style.innerHTML = html;\n\n document.head.appendChild(style);\n }\n\n pulldownMasthead() {\n const $logo = $(this.$masthead).find(\".logo svg\");\n const $navStroke = $(this.$masthead).find(\".masthead-bg\");\n\n const $btnPrimary = $(this.$masthead).find(\".btn-primary\");\n const $btnSecondary = $(this.$masthead).find(\".btn-secondary\");\n\n const $triangleWrapper = $(this.$masthead).find(\n \".masthead-triangle-wrapper\"\n );\n\n const colour = $navStroke.data(\"pulldown-colour\");\n\n $(this.$masthead).addClass(\"pulldown text-white\");\n\n $($navStroke).css(\"background\", colour);\n $navStroke.removeClass(\"lg:-translate-y-full\");\n\n $logo.find(\"path\").css(\"fill\", \"#fff\");\n\n $triangleWrapper.addClass(\"-translate-y-full\");\n\n $btnPrimary.css({\n \"background-color\": this.backgroundColour,\n \"border-color\": \"#fff\",\n });\n\n $btnSecondary.css({\n \"border-color\": \"#fff\",\n color: this.backgroundColour,\n });\n\n this.$masthead.find(\".underline\").addClass(\"bg-white\");\n }\n\n regularMasterhead() {\n const $logo = $(this.$masthead).find(\".logo svg\");\n const $menuWrapper = $(this.$masthead).find(\".menu-wrapper\");\n const $navStroke = $(this.$masthead).find(\".masthead-bg\");\n\n const $btnPrimary = $(this.$masthead).find(\".btn-primary\");\n const $btnSecondary = $(this.$masthead).find(\".btn-secondary\");\n\n const $triangleWrapper = $(this.$masthead).find(\n \".masthead-triangle-wrapper\"\n );\n\n $(this.$masthead).removeClass(\"pulldown text-white\");\n\n //$($navStroke).css(\"background\", \"#fff\");\n $navStroke.addClass(\"lg:-translate-y-full\");\n\n if (this.style === \"dark\") {\n $logo.find(\"path\").css(\"fill\", \"#222a53\");\n } else {\n $logo.find(\"path\").css(\"fill\", \"#fff\");\n }\n\n $triangleWrapper.removeClass(\"-translate-y-full\");\n\n $btnPrimary.css({ \"background-color\": \"\", \"border-color\": \"\" });\n\n $btnSecondary.css({\n \"border-color\": \"\",\n color: \"\",\n });\n\n this.$masthead.find(\".underline\").removeClass(\"bg-white\");\n }\n\n handleClick() {\n if (!this.isOpen) {\n this.openMenu();\n this.isOpen = true;\n } else {\n this.closeMenu();\n this.isOpen = false;\n }\n }\n\n openMenu() {\n gsap.to(this.$nav, {\n duration: 0.5,\n height: this.$nav.find(\".inner\").height() + 100,\n opacity: 1,\n ease: \"power2.out\",\n });\n }\n\n closeMenu() {\n gsap.to(this.$nav, {\n duration: 0.5,\n height: \"0vh\",\n opacity: 0,\n ease: \"power2.out\",\n });\n }\n\n handleSubmenus() {\n $(\"#main-menu .menu-item-has-children > .menu-link\").on(\"click\", (e) => {\n const $target = $(e.currentTarget);\n const $subMenu = $target.siblings(\".sub-menu\");\n\n console.log($subMenu);\n\n if (this.isTouchDevice()) {\n console.log(\"Touch device\");\n e.preventDefault();\n }\n\n if (!$subMenu.hasClass(\"is-open\")) {\n this.openSubmenu($subMenu);\n } else {\n this.closeSubmenu($subMenu);\n }\n });\n\n $(\"#main-menu .menu-item-has-children\").on(\"mouseenter\", (e) => {\n e.preventDefault();\n\n const $target = $(e.currentTarget);\n const $subMenu = $target.find(\".sub-menu\");\n\n $target.closest(\"li\").addClass(\"is-hovered\");\n\n // Close all other menus.\n $(e.currentTarget)\n .parent()\n .siblings(\".menu-item-has-children\")\n .each((index, item) => {\n this.closeSubmenu($(item).find(\".sub-menu\"));\n });\n\n if (!$subMenu.hasClass(\"is-open\")) {\n this.openSubmenu($subMenu);\n }\n });\n\n $(\".menu-item-has-children\").on(\"mouseleave\", (e) => {\n e.preventDefault();\n\n const $target = $(e.currentTarget);\n const $subMenu = $target.find(\".sub-menu\");\n\n $target.closest(\"li\").removeClass(\"is-hovered\");\n\n if ($subMenu.hasClass(\"is-open\")) {\n this.closeSubmenu($subMenu);\n }\n });\n\n // If the user clicks on the body, close all submenus.\n $(\"body\").on(\"mouseenter\", (e) => {\n if (!$(e.target).closest(\"#main-menu .sub-menu\").length) {\n this.closeAllSubmenus();\n }\n });\n }\n\n openSubmenu(submenu) {\n let targetHeight = 10;\n\n // Calculate the target height of the submenu\n // by adding up the height of all list items.\n $(submenu)\n .find(\"li\")\n .each(function (index) {\n targetHeight += $(this).outerHeight();\n });\n\n this.$bg.css(\n \"height\",\n targetHeight + $(this.$masthead).outerHeight() - 20 + \"px\"\n );\n\n gsap.to(submenu.get(0), {\n duration: 0.5,\n height: targetHeight,\n ease: \"power2.out\",\n });\n\n $(submenu).addClass(\"is-open\");\n $(submenu).siblings(\"a\").addClass(\"active\");\n }\n\n closeSubmenu(submenu) {\n gsap.to(submenu.get(0), {\n duration: 0.5,\n height: 0,\n ease: \"power2.out\",\n });\n\n this.$bg.css(\"height\", \"100px\");\n\n $(submenu).removeClass(\"is-open\");\n $(submenu).siblings(\"a\").removeClass(\"active\");\n }\n\n closeAllSubmenus(ignore = null) {\n $(\"#main-menu .sub-menu\").each(function (index, submenu) {\n if (submenu === ignore) {\n return;\n }\n\n gsap.to($(submenu).get(0), {\n duration: 0.5,\n height: 0,\n ease: \"power2.out\",\n });\n\n $(submenu).removeClass(\"is-open\");\n $(submenu).siblings(\"a\").removeClass(\"active\");\n });\n }\n\n toggleMobileMenu() {\n $(\"#mobile-menu-wrapper\").toggleClass(\"-translate-x-[102%]\");\n $(\"#mobile-menu-fader\").toggleClass(\"opacity-60 opacity-0\");\n\n // Animate burger to a cross.\n\n const $burger = $(\"#hamburger\");\n\n if (!$(\"#mobile-menu-wrapper\").hasClass(\"-translate-x-[102%]\")) {\n gsap.to($burger.find(\"span:nth-child(1)\"), {\n duration: 0.3,\n rotate: 45,\n y: 8,\n ease: \"power2.out\",\n });\n\n gsap.to($burger.find(\"span:nth-child(2)\"), {\n duration: 0.3,\n width: 0,\n x: 20,\n ease: \"power2.out\",\n });\n\n gsap.to($burger.find(\"span:nth-child(3)\"), {\n duration: 0.3,\n rotate: -45,\n y: -10,\n ease: \"power2.out\",\n });\n } else {\n gsap.to($burger.find(\"span:nth-child(1)\"), {\n duration: 0.3,\n rotate: 0,\n y: 0,\n ease: \"power2.out\",\n });\n\n gsap.to($burger.find(\"span:nth-child(2)\"), {\n duration: 0.3,\n width: \"100%\",\n x: 0,\n ease: \"power2.out\",\n });\n\n gsap.to($burger.find(\"span:nth-child(3)\"), {\n duration: 0.3,\n rotate: 0,\n y: 0,\n ease: \"power2.out\",\n });\n }\n }\n}\n"],"names":["gsapWithCSS","core","Tween","Navigation","$masthead","$","$bg","this","find","$logo","$button","$nav","isOpen","$els","backgroundColour","logoColour","style","constructor","init","data","on","handleClick","each","index","window","scroll","top","left","behavior","document","e","target","closest","length","closeMenu","setTimeout","handleSubmenus","setMastheadColour","onScroll","addEventListener","toggleMobileMenu","isTouchDevice","navigator","maxTouchPoints","msMaxTouchPoints","scrollY","addClass","pulldownMasthead","removeClass","regularMasterhead","attr","createElement","html","innerHTML","head","appendChild","$navStroke","$btnPrimary","$btnSecondary","$triangleWrapper","colour","css","color","openMenu","duration","height","opacity","ease","$subMenu","currentTarget","siblings","console","log","preventDefault","hasClass","closeSubmenu","openSubmenu","$target","parent","item","closeAllSubmenus","submenu","targetHeight","outerHeight","get","ignore","toggleClass","$burger","rotate","y","width","x"],"sourceRoot":""}