import*asefrom"@wordpress/interactivity";vart={d:(e,o)=>{for(variino)t.o(o,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:o[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},o={};t.d(o,{o:()=>p,w:()=>h});consti=(e=>{varo={};returnt.d(o,e),o})({getConfig:()=>e.getConfig,privateApis:()=>e.privateApis,store:()=>e.store}),{directivePrefix:n,getRegionRootFragment:r,initialVdom:a,toVdom:s,render:c}=(0,i.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),d=newMap,l=e=>{constt=newURL(e,window.location);returnt.pathname+t.search},g=(e,{vdom:t}={})=>{consto={},i=`data-${n}-router-region`;e.querySelectorAll(`[${i}]`).forEach((e=>{constn=e.getAttribute(i);o[n]=t?.has(e)?t.get(e):s(e)}));constr=e.querySelector("title")?.innerText;return{regions:o,title:r}},w=e=>{constt=`data-${n}-router-region`;document.querySelectorAll(`[${t}]`).forEach((o=>{consti=o.getAttribute(t),n=r(o);c(e.regions[i],n)})),e.title&&(document.title=e.title)},m=e=>(window.location.assign(e),newPromise((()=>{})));window.addEventListener("popstate",(async()=>{conste=l(window.location),t=d.has(e)&&awaitd.get(e);t?(w(t),h.url=window.location.href):window.location.reload()})),d.set(l(window.location),Promise.resolve(g(document,{vdom:a})));letu="";const{state:h,actions:p}=(0,i.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1,texts:{}}},actions:{*navigate(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();o&&(yieldm(e));constn=l(e),{navigation:r}=h,{loadingAnimation:a=!0,screenReaderAnnouncement:s=!0,timeout:c=1e4}=t;u=e,p.prefetch(n,t);constg=newPromise((e=>setTimeout(e,c))),v=setTimeout((()=>{u===e&&(a&&(r.hasStarted=!0,r.hasFinished=!1),s&&(r.message=r.texts.loading))}),400),f=yieldPromise.race([d.get(n),g]);clearTimeout(v),u===e&&(f?(w(f),window.history[t.replace?"replaceState":"pushState"]({},"",e),h.url=e,a&&(r.hasStarted=!1,r.hasFinished=!0),s&&(r.message=r.texts.loaded+(r.message===r.texts.loaded?"":""))):yieldm(e))},prefetch(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();if(o)return;constn=l(e);!t.force&&d.has(n)||d.set(n,(async(e,{html:t})=>{try{if(!t){consto=awaitwindow.fetch(e);if(200!==o.status)return!1;t=awaito.text()}consto=(newwindow.DOMParser).parseFromString(t,"text/html");returng(o)}catch(e){return!1}})(n,t))}}});varv=o.o,f=o.w;export{vasactions,fasstate};