import{c as a}from"./links.DYfvsp_u.js";import{g,r as c}from"./params.B3T1WKlC.js";const f={setup(){return{rootStore:a()}},data(){return{running:!1}},watch:{"rootStore.navigate.scroll"(){this.running||(this.running=!0,this.scrollAndHighlight())},"rootStore.navigate.highlight"(){this.running||(this.running=!0,this.scrollAndHighlight())}},methods:{scrollAndHighlight(){var r,s;const t=a(),o=g()["aioseo-scroll"]||((r=history.state)==null?void 0:r.scroll)||t.navigate.scroll;o&&typeof o=="string"&&setTimeout(()=>{var i;this.$scrollTo(`#${o}`,{offset:-130,container:document.querySelector(this.scrollContainer||null)?this.scrollContainer:"body"}),c("aioseo-scroll"),(i=history.state)==null||delete i.scroll,t.navigate.scroll=null,this.running=!1},this.scrollTimeout||500);const n=g()["aioseo-highlight"]||((s=history.state)==null?void 0:s.highlight)||t.navigate.highlight;if(n&&typeof n=="string"){const i=o?this.scrollAndHighlightTimeout||1500:this.highlightTimeout||500;setTimeout(()=>{var l;const e=document.querySelectorAll(`#${n.replace(/,/g,", #").replace(/%2C/ig,", #")}`);e.length&&e.forEach(h=>{h.classList.add("aioseo-row-highlight"),setTimeout(()=>{h.classList.remove("aioseo-row-highlight")},1500)}),c("aioseo-highlight"),(l=history.state)==null||delete l.highlight,t.navigate.highlight=null,this.running=!1},i)}}},mounted(){this.scrollAndHighlight()}};export{f as S};
