wp.customize.bind("ready",function(){(()=>{let t=document.querySelectorAll("[data-kirki-parent-tab-id]");if(!t.length)return;let e=[];Array.from(t).forEach(function(t){let i=t.dataset.kirkiParentTabId;e.includes(i)||e.push(i)});let i=(t,e)=>{Array.from(document.querySelectorAll('[data-kirki-tab-id="'+t+'"] .kirki-tab-menu-item')).forEach(function(t){t.classList.remove("is-active")});let i=document.querySelector('[data-kirki-tab-id="'+t+'"] [data-kirki-tab-menu-id="'+e+'"]');i&&i.classList.add("is-active"),Array.from(document.querySelectorAll('[data-kirki-parent-tab-id="'+t+'"]')).forEach(function(t){t.dataset.kirkiParentTabItem===e?t.classList.remove("kirki-tab-item-hidden"):t.classList.add("kirki-tab-item-hidden")})};document.addEventListener("click",function(t){let e=t.target.closest(".kirki-tab-menu-item a");if(!e)return;t.preventDefault();let a=e.closest(".kirki-tab-menu-item");i(a.closest("[data-kirki-tab-id]").dataset.kirkiTabId,a.dataset.kirkiTabMenuId)}),e.forEach(function(t){wp.customize.section(t,function(e){e.expanded.bind(function(e){if(e){let e=document.querySelector('[data-kirki-tab-id="'+t+'"] .kirki-tab-menu-item.is-active');e&&i(t,e.dataset.kirkiTabMenuId)}})})})})()});