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OX,CACX,E","sources":["webpack://frontendplaceholder/./Src/Scripts/components/toggle-button.js"],"sourcesContent":["export default class ToggleButton {\n constructor(elm, args) {\n const bodyClasslist = document.body.classList;\n const toggleButtons = document.querySelectorAll(\n '[data-component=\"toggle-button\"]',\n );\n setTimeout(() => {\n elm.classList.remove('toggle-button--disable-animation');\n }, 40);\n\n if (bodyClasslist.contains('animate')) {\n bodyClasslist.remove('animate-in');\n bodyClasslist.remove('animate');\n window.history.pushState(\n {},\n document.title,\n this.removeURLParameter(\n this.removeURLParameter(document.location.href, 'animate'),\n 'menu',\n ),\n );\n }\n\n const radios = elm.querySelectorAll('input');\n radios.forEach((radio) =>\n radio.addEventListener('change', () => {\n document.body.style.marginTop = '0';\n if (radio.id === 'b2c') {\n document.cookie =\n 'moment_universe=jobseeker-theme;path=/;secure;SameSite=Strict';\n toggleButtons.forEach((btn) => {\n btn.classList.add('animate-left');\n btn.classList.remove('animate-right');\n });\n } else {\n document.cookie =\n 'moment_universe=company-theme;secure;SameSite=Strict';\n toggleButtons.forEach((btn) => {\n btn.classList.add('animate-right');\n btn.classList.remove('animate-left');\n });\n }\n setTimeout(() => {\n const openMenu = document.querySelector('.mobile-menu-open')\n ? '?openMenu=true'\n : '';\n window.location.href = `${radio.dataset.url}${openMenu}`;\n }, 750);\n }),\n );\n }\n\n removeURLParameter(url, parameter) {\n // prefer to use l.search if you have a location/link object\n const urlparts = url.split('?');\n if (urlparts.length >= 2) {\n const prefix = encodeURIComponent(parameter) + '=';\n const pars = urlparts[1].split(/[&;]/g);\n\n // reverse iteration as may be destructive\n for (let i = pars.length; i-- > 0; ) {\n // idiom for string.startsWith\n if (pars[i].lastIndexOf(prefix, 0) !== -1) {\n pars.splice(i, 1);\n }\n }\n return urlparts[0] + (pars.length > 0 ? '?' + pars.join('&') : '');\n }\n return url;\n }\n}\n"],"names":["exports","constructor","elm","args","bodyClasslist","document","body","classList","toggleButtons","querySelectorAll","setTimeout","remove","contains","window","history","pushState","title","this","removeURLParameter","location","href","forEach","radio","addEventListener","style","marginTop","id","cookie","btn","add","openMenu","querySelector","dataset","url","parameter","urlparts","split","length","prefix","encodeURIComponent","pars","i","lastIndexOf","splice","join"],"sourceRoot":""}