"use strict";var WPMLLanguageSwitcherDropdownClick=function(){function l(e){var t=this.querySelectorAll(i)[0];return"visible"===t.style.visibility?(t.style.visibility="hidden",document.removeEventListener("click",o)):(t.style.visibility="visible",document.addEventListener("click",o),n=!0),!1}function r(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.returnValue=!1}var c=".js-wpml-ls-legacy-dropdown-click",i=".js-wpml-ls-sub-menu",n=!1,o=function(){if(!n)for(var e=document.querySelectorAll(c),t=0;t<e.length;t++)e[t].querySelectorAll(i)[0].style.visibility="hidden";n=!1};return{init:function(){for(var e=document.querySelectorAll(c),t=0;t<e.length;t++)e[t].addEventListener("click",l);for(var i=document.querySelectorAll(c+" a.js-wpml-ls-item-toggle"),n=0;n<i.length;n++)i[n].addEventListener("click",r)}}}();document.addEventListener("DOMContentLoaded",function(){WPMLLanguageSwitcherDropdownClick.init()});