summaryrefslogtreecommitdiffstats
path: root/wp-includes/js/dist/interactivity-router.min.js
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/js/dist/interactivity-router.min.js')
-rw-r--r--wp-includes/js/dist/interactivity-router.min.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/wp-includes/js/dist/interactivity-router.min.js b/wp-includes/js/dist/interactivity-router.min.js
index 9946988..23bc594 100644
--- a/wp-includes/js/dist/interactivity-router.min.js
+++ b/wp-includes/js/dist/interactivity-router.min.js
@@ -1,2 +1,2 @@
/*! This file is auto-generated */
-import*as t from"@wordpress/interactivity";var e={d:(t,i)=>{for(var o in i)e.o(i,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:i[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},i={};e.d(i,{o:()=>y,w:()=>f});const o=(t=>{var i={};return e.d(i,t),i})({getConfig:()=>t.getConfig,privateApis:()=>t.privateApis,store:()=>t.store}),{directivePrefix:a,getRegionRootFragment:n,initialVdom:r,toVdom:s,render:c,parseInitialData:l,populateInitialData:d,batch:g}=(0,o.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),w=new Map,u=t=>{const e=new URL(t,window.location);return e.pathname+e.search},h=(t,{vdom:e}={})=>{const i={},o=`data-${a}-router-region`;t.querySelectorAll(`[${o}]`).forEach((t=>{const a=t.getAttribute(o);i[a]=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-${a}-router-region`;document.querySelectorAll(`[${e}]`).forEach((i=>{const o=i.getAttribute(e),a=n(i);c(t.regions[o],a)})),t.title&&(document.title=t.title)}))},p=t=>(window.location.assign(t),new Promise((()=>{})));window.addEventListener("popstate",(async()=>{const t=u(window.location),e=w.has(t)&&await w.get(t);e?(m(e),f.url=window.location.href):window.location.reload()})),w.set(u(window.location),Promise.resolve(h(document,{vdom:r})));let v="";const{state:f,actions:y}=(0,o.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1,texts:{}}},actions:{*navigate(t,e={}){const{clientNavigationDisabled:i}=(0,o.getConfig)();i&&(yield p(t));const a=u(t),{navigation:n}=f,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:c=1e4}=e;v=t,y.prefetch(a,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([w.get(a),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={}){const{clientNavigationDisabled:i}=(0,o.getConfig)();if(i)return;const a=u(t);!e.force&&w.has(a)||w.set(a,(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}})(a,e))}}});var b=i.o,x=i.w;export{b as actions,x as state}; \ No newline at end of file
+import*as e from"@wordpress/interactivity";var t={d:(e,o)=>{for(var i in o)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:()=>x,w:()=>b});const i=(e=>{var o={};return t.d(o,e),o})({getConfig:()=>e.getConfig,privateApis:()=>e.privateApis,store:()=>e.store});var a;const{directivePrefix:n,getRegionRootFragment:r,initialVdom:s,toVdom:c,render:l,parseInitialData:d,populateInitialData:g,batch:w}=(0,i.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),h=null!==(a=(0,i.getConfig)("core/router").navigationMode)&&void 0!==a?a:"regionBased",u=new Map,m=(new Map,e=>{const t=new URL(e,window.location.href);return t.pathname+t.search}),f=async(e,{vdom:t}={})=>{const o={body:void 0};if("regionBased"===h){const i=`data-${n}-router-region`;e.querySelectorAll(`[${i}]`).forEach((e=>{const a=e.getAttribute(i);o[a]=t?.has(e)?t.get(e):c(e)}))}const i=e.querySelector("title")?.innerText,a=d(e);return{regions:o,head:undefined,title:i,initialData:a}},p=e=>{w((()=>{if("regionBased"===h){g(e.initialData);const t=`data-${n}-router-region`;document.querySelectorAll(`[${t}]`).forEach((o=>{const i=o.getAttribute(t),a=r(o);l(e.regions[i],a)}))}e.title&&(document.title=e.title)}))},v=e=>(window.location.assign(e),new Promise((()=>{})));window.addEventListener("popstate",(async()=>{const e=m(window.location.href),t=u.has(e)&&await u.get(e);t?(p(t),b.url=window.location.href):window.location.reload()})),u.set(m(window.location.href),Promise.resolve(f(document,{vdom:s})));let y="";const{state:b,actions:x}=(0,i.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1,texts:{loading:"",loaded:""},message:""}},actions:{*navigate(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();o&&(yield v(e));const a=m(e),{navigation:n}=b,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:c=1e4}=t;y=e,x.prefetch(a,t);const l=new Promise((e=>setTimeout(e,c))),d=setTimeout((()=>{y===e&&(r&&(n.hasStarted=!0,n.hasFinished=!1),s&&(n.message=n.texts.loading))}),400),g=yield Promise.race([u.get(a),l]);if(clearTimeout(d),y===e)if(g&&!g.initialData?.config?.["core/router"]?.clientNavigationDisabled){yield p(g),window.history[t.replace?"replaceState":"pushState"]({},"",e),b.url=e,r&&(n.hasStarted=!1,n.hasFinished=!0),s&&(n.message=n.texts.loaded+(n.message===n.texts.loaded?" ":""));const{hash:o}=new URL(e,window.location.href);o&&document.querySelector(o)?.scrollIntoView()}else yield v(e)},prefetch(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();if(o)return;const a=m(e);!t.force&&u.has(a)||u.set(a,(async(e,{html:t})=>{try{if(!t){const o=await window.fetch(e);if(200!==o.status)return!1;t=await o.text()}const o=(new window.DOMParser).parseFromString(t,"text/html");return f(o)}catch(e){return!1}})(a,{html:t.html}))}}});var A=o.o,P=o.w;export{A as actions,P as state}; \ No newline at end of file