- md5
- 85c6ad8533a5838d15da53eb80337f41
- sha1
- 252b7cac3648e23db9efdaed967f43b3137669f2
- sha256
- d318027c049c1ded9953456a92afd4a6aef2c31108ed541ceaa2d06ba02773d3
/*! This file is auto-generated */
import*as t from"@wordpress/interactivity";var e={d:(t,i)=>{for(var a in i)e.o(i,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:i[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},i={};e.d(i,{o:()=>b,w:()=>f});const a=(t=>{var i={};return e.d(i,t),i})({getConfig:()=>t.getConfig,privateApis:()=>t.privateApis,store:()=>t.store}),{directivePrefix:o,getRegionRootFragment:n,initialVdom:r,toVdom:s,render:c,parseInitialData:l,populateInitialData:d,batch:g}=(0,a.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),u=new Map,w=t=>{const e=new URL(t,window.location);return e.pathname+e.search},h=(t,{vdom:e}={})=>{const i=Object.create(null),a=`data-${o}-router-region`;t.querySelectorAll(`[${a}]`).forEach((t=>{const o=t.getAttribute(a);i[o]=e?.has(t)?e.get(t):s(t)}));const n=t.querySelector("title")?.innerText,r=l(t);return{regions:i,title:n,initialData:r}},m=t=>{g((()=>{d(t.initialData);const e=`data-${o}-router-region`;document.querySelectorAll(`[${e}]`).forEach((i=>{const a=i.getAttribute(e),o=n(i);c(t.regions[a],o)})),t.title&&(document.title=t.title)}))},p=t=>(window.location.assign(t),new Promise((()=>{})));window.addEventListener("popstate",(async()=>{const t=w(window.location),e=u.has(t)&&await u.get(t);e?(m(e),f.url=window.location.href):window.location.reload()})),u.set(w(window.location),Promise.resolve(h(document,{vdom:r})));let v="";const{state:f,actions:b}=(0,a.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1,texts:{}}},actions:{*navigate(t,e={}){e=Object.assign(Object.create(null),e);const{clientNavigationDisabled:i}=(0,a.getConfig)();i&&(yield p(t));const o=w(t),{navigation:n}=f,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:c=1e4}=e;v=t,b.prefetch(o,e);const l=new Promise((t=>setTimeout(t,c))),d=setTimeout((()=>{v===t&&(r&&(n.hasStarted=!0,n.hasFinished=!1),s&&(n.message=n.texts.loading))}),400),g=yield Promise.race([u.get(o),l]);clearTimeout(d),v===t&&(g&&!g.initialData?.config?.["core/router"]?.clientNavigationDisabled?(m(g),window.history[e.replace?"replaceState":"pushState"]({},"",t),f.url=t,r&&(n.hasStarted=!1,n.hasFinished=!0),s&&(n.message=n.texts.loaded+(n.message===n.texts.loaded?" ":""))):yield p(t))},prefetch(t,e={}){e=Object.assign(Object.create(null),e);const{clientNavigationDisabled:i}=(0,a.getConfig)();if(i)return;const o=w(t);!e.force&&u.has(o)||u.set(o,(async(t,{html:e})=>{try{if(!e){const i=await window.fetch(t);if(200!==i.status)return!1;e=await i.text()}const i=(new window.DOMParser).parseFromString(e,"text/html");return h(i)}catch(t){return!1}})(o,e))}}});var y=i.o,x=i.w;export{y as actions,x as state};
The same content is in 2 releases, WordPress 6.5.14 to 6.5.15. See them all, or every version of this file.