function htmlToElement(e){const t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild}function initPopover(e,t){const n=e.replace(window.location.origin,"");fetchData.then(({content:e})=>{const s=[...document.getElementsByClassName("internal-link")];s.filter(e=>e.dataset.src||e.dataset.idx&&t).forEach(t=>{let s;if(t.dataset.ctx){const n=e[t.dataset.src],o=`

${n.title}

${highlight(removeMarkdown(n.content),t.dataset.ctx)}...

${new Date(n.lastmodified).toLocaleDateString()}

`;s=htmlToElement(o)}else{const o=e[t.dataset.src.replace(/\/$/g,"").replace(n,"")];if(o){let n=t.href.split("#"),e=removeMarkdown(o.content);if(n.length>1){let t=decodeURIComponent(n[1]).replace(/-/g," "),s=e.toLowerCase().indexOf(""+t+"");e=e.substring(s,e.length)}const i=`

${o.title}

${e.split(" ",20).join(" ")}...

${new Date(o.lastmodified).toLocaleDateString()}

`;s=htmlToElement(i)}}s&&(t.appendChild(s),LATEX_ENABLED&&renderMathInElement(s,{delimiters:[{left:"$$",right:"$$",display:!1},{left:"$",right:"$",display:!1}],throwOnError:!1}),t.addEventListener("mouseover",()=>{window.FloatingUIDOM.computePosition(t,s,{middleware:[window.FloatingUIDOM.offset(10),window.FloatingUIDOM.inline(),window.FloatingUIDOM.shift()]}).then(({x:e,y:t})=>{Object.assign(s.style,{left:`${e}px`,top:`${t}px`})}),s.classList.add("visible"),plausible("Popover Hover",{props:{href:t.dataset.src}})}),t.addEventListener("mouseout",()=>{s.classList.remove("visible")}))})})}