2 lines
589 B
JavaScript
2 lines
589 B
JavaScript
import{Q as i,k as d,X as u,ao as m}from"./index-C7vQR2oS.js";const l=2500;function h(s){const a=d();let c="";i([()=>m(s),()=>a.hash],([n,e])=>{!n||!e||e===c||(c=e,u(()=>{if(typeof document>"u")return;let o=e.slice(1);try{o=decodeURIComponent(o)}catch{}const t=document.getElementById(o);if(!t)return;const r=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;t.scrollIntoView({behavior:r?"auto":"smooth",block:"start"}),t.classList.add("hash-target"),setTimeout(()=>t.classList.remove("hash-target"),l)}))},{immediate:!0})}export{h as u};
|