!function(){if(window.aipkitHeaderButtonsInitialized)return;window.aipkitHeaderButtonsInitialized=!0;let e="aipkit-inline-actions",t="aipkitHeaderButtons";function n(e){return!!document.getElementById(e)}function i(){let i=function(){try{return Array.isArray(window[t])?window[t]:[]}catch{return[]}}();if(!i.length)return!1;let r=function(){let t=document.querySelector("."+e);if(t)return t;let n=document.querySelector(".wp-header-end, .wrap h1.wp-heading-inline");if(!n)return null;let i=document.querySelector(".wrap .page-title-action"),r=document.createElement("span");return r.className=e,i&&i.parentNode?i.parentNode.insertBefore(r,i.nextSibling):n.parentNode&&n.parentNode.insertBefore(r,n.nextSibling),r}();return!!r&&(i.forEach(e=>{if(!e.id||n(e.id))return;let t=function(e){let t=document.createElement("a");return t.id=e.id,t.className="page-title-action",t.href=e.href?e.href:"javascript:void(0)",t.textContent=e.label||e.id,e.title&&(t.title=e.title),e.dataset&&Object.keys(e.dataset).forEach(n=>{t.dataset[n]=e.dataset[n]}),e.onClick&&t.addEventListener("click",function(t){void 0===e.href&&t.preventDefault();try{new Function(e.onClick).call(this,t)}catch(e){}}),t}(e);r.appendChild(t)}),i.every(e=>e.id&&n(e.id)))}function r(){i();let e=Date.now(),t=document.querySelector("#wpbody-content")||document.querySelector(".wrap")||document.body,n=new MutationObserver(()=>{(i()||Date.now()-e>15e3)&&n.disconnect()});t&&n.observe(t,{childList:!0,subtree:!0});let r=setInterval(()=>{(i()||Date.now()-e>15e3)&&clearInterval(r)},250);window.addEventListener("load",i)}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",r):r()}();