!function(){"use strict";var e=window.ctFrontend;const t=async function(t={}){const n=(t.styles||[]).map(function({src:t,handle:n,inline:i}){if(n&&document.getElementById(`${n}-css`))return Promise.resolve();if(!t&&i){const e=document.createElement("style");return n&&(e.id=`${n}-css`,e.dataset.handle=n),e.textContent=i,document.head.appendChild(e),Promise.resolve()}return t?(0,e.loadStyle)(t).then(function(){if(i){const e=document.createElement("style");document.head.appendChild(e),e.textContent=i}}):Promise.resolve()});await Promise.all(n),t.inline_css&&function(e){let t=document.getElementById("ct-main-styles-inline-css");t||(t=document.createElement("style"),t.id="ct-main-styles-inline-css",document.head.appendChild(t)),t.textContent.includes(e)||(t.textContent+=e)}(t.inline_css),(t.scripts||[]).forEach(function({src:e,handle:t,data:n}){if(document.getElementById(`${t}-js`)||document.querySelector(`script[src="${e}"]`))return;if(n){const e=document.createElement("script");e.textContent=n,document.head.appendChild(e)}const i=document.createElement("script");i.src=e,t&&(i.id=`${t}-js`),i.dataset.handle=t,document.body.appendChild(i)})};(0,e.registerDynamicChunk)("blocksy_mega_menu",{mount:function(e){const n=e.filter(function(e){return e.closest("ul")}).map(function(e){return parseFloat([...e.parentNode.classList].find(function(e){return e.match(/^menu-item-\d{1,}/)}).replace("menu-item-",""))});(function(e,t){return new Promise(function(n){const i=localStorage.getItem(blocksyMegaMenu.persistence_key+":"+e);if(i){const e=JSON.parse(i);if(e&&t.every(function(t){return e.find(function(e){return e.id===t})}))return void n(JSON.parse(i))}const c=new FormData;c.append("ids",t.join(",")),c.append("menu_id",e),fetch(`${ct_localizations.ajax_url}?action=blc_retrieve_mega_menu_content`,{method:"POST",body:c}).then(function(e){return e.json()}).then(function({success:t,data:i}){if(!t)return;if(!i)return;const[c,s,o]=blocksyMegaMenu.persistence_key.split(":"),r=[];for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);if(0!==n.indexOf([c,s].join(":")))continue;const[i,o,l,a]=n.split(":");c===i&&s===o&&a===e&&r.push(n)}r.map(function(e){localStorage.removeItem(e)}),localStorage.setItem(blocksyMegaMenu.persistence_key+":"+e,JSON.stringify(i.content)),n(i.content)})})})(e[0].closest('ul[id^="menu-"]').id.replace("menu-",""),n).then(function(n){e.filter(function(e){return e.closest("ul")}).map(function(e){const t=parseFloat([...e.parentNode.classList].find(function(e){return e.match(/^menu-item-\d{1,}/)}).replace("menu-item-","")),i=n.find(function(e){return e.id===t});if(!i)return;const c=document.createElement("div");c.innerHTML=e.innerHTML;const s=document.createElement("div");s.innerHTML=i.content,e.innerHTML=s.firstElementChild.innerHTML,e.className=s.firstElementChild.className,[...e.querySelectorAll(".menu-item")].map(function(e){const t=c.querySelector(`#${e.id}`);t&&(e.firstElementChild&&t.firstElementChild&&t.matches(".ct-menu-link")&&(e.firstElementChild.innerHTML=t.firstElementChild.innerHTML),e.firstElementChild&&t.firstElementChild&&t.firstElementChild.matches(".ct-menu-link")&&(e.firstElementChild.outerHTML=t.firstElementChild.outerHTML),e.className=t.className)})}),n.forEach(function(e){e.assets&&t(e.assets)}),ctEvents.trigger("blocksy:frontend:init")})}})}();