const asciiToHex=e=>"0x"+e.split("").map((e=>e.charCodeAt(0).toString(16))).join(""),getCurrentTimeString=()=>{const e=new Date;return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()+"-"+e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()+":"+e.getMinutes()},helixHash=e=>{let t=0;const{length:n}=e;if(0===n)return t;for(let i=0;i<n;i++){t=(t<<5)-t+e.charCodeAt(i),t&=t}return t},triggerEvent=(e,t)=>{if(document.createEvent&&e){const n=document.createEvent("HTMLEvents");n.initEvent(t,!1,!1),e.dispatchEvent(n)}},setCookie=(e,t="",n=1)=>{let i="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=e+"="+t+i+"; path=/"},getCookie=e=>{e+="=";let t=document.cookie.split(";");for(let n=0;n<t.length;n++){let i=t[n];for(;" "==i.charAt(0);)i=i.substring(1,i.length);if(0==i.indexOf(e))return i.substring(e.length,i.length)}},deleteCookie=e=>{document.cookie=e+"=; Max-Age=-99999999;"},debounce=(e,t)=>{let n;return function(){let i=this,o=arguments,s=function(){n=null,e.apply(i,o)};clearTimeout(n),n=setTimeout(s,t||200)}},getCenterPosition=e=>{const{top:t,left:n,width:i,height:o}=e.getBoundingClientRect();return{x:n+i/2,y:t+o/2}},getDistance=(e,t)=>{const n=getCenterPosition(e),i=getCenterPosition(t);return{distanceX:Math.floor(Math.abs(n.x-i.x)),distanceY:Math.floor(Math.abs(n.y-i.y))}};function calculateSiblingDistances(){const e=".hu-menu-tree-branch";$(e).each((function(){const t=$(this).getBranchLevel()||1;if($(this).find(".hu-menu-branch-path").show(),"function"==typeof $(this).nextSibling)if(t>1){const n=$(this).nextSibling();if(n.length){const e=getDistance($(this).get(0),n.get(0));n.find(".hu-menu-branch-path").css("height",`${Math.max(e.distanceY+8,55)}px`)}else{const n=$(this).next(e),i=n.getBranchLevel()||1;n.length>0&&i>t&&n.find(".hu-menu-branch-path").css("height","55px")}}else $(this).find(".hu-menu-branch-path").hide()}))}Joomla.utils={asciiToHex:asciiToHex,getCurrentTimeString:getCurrentTimeString,helixHash:helixHash,triggerEvent:triggerEvent,setCookie:setCookie,getCookie:getCookie,deleteCookie:deleteCookie,debounce:debounce,getDistance:getDistance,calculateSiblingDistances:calculateSiblingDistances};