!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2d65d8c9-569b-4b92-89dd-566b0a94aedf",e._sentryDebugIdIdentifier="sentry-dbid-2d65d8c9-569b-4b92-89dd-566b0a94aedf")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"d422ce2331ff96843ff0d5950a5823013ab19d3d"},function(){"use strict";function e(e,...i){const n=document.createElement("template"),o=Math.random().toString(36).slice(2),r=`slot-${o}`,s=`data-event-${o}`;let a=[],l=[],c=[];const d=(e,i)=>{a.push(e),i instanceof Node||i instanceof DocumentFragment||i instanceof HTMLTemplateElement?(a.push(`<${r}>`),l.push(i)):i instanceof t?a.push(String(i)):Array.isArray(i)?i.forEach((e=>d("",e))):"object"==typeof i&&null!==i&&"type"in i&&"event"===i.type?(a.push(` ${s}`),c.push(i)):null!=i&&a.push(String(i).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'"))};return e.forEach(((e,t)=>d(e,i[t]))),n.innerHTML=a.join("").trim(),n.content.querySelectorAll(r).forEach((e=>{const t=l.shift();e.parentNode.replaceChild(t,e)})),n.content.querySelectorAll(`[${s}]`).forEach((e=>{const t=c.shift();e.removeAttribute(s),e.addEventListener(t.name,t.handler)})),1===n.content.childNodes.length?n.content.firstChild:n.content}class t{constructor(e){this.value=e}toString(){return this.value}}function i(e){return new t(e)}class n{constructor(e){this.cache=new Map,this.expirationDuration=e}get(e){const t=this.cache.get(e);return t&&Date.now()-t.timestamp{const t=e.target.closest(o);t&&(t.contains(e.relatedTarget)||this.#s(t)&&(t.href,this.#a(),this.#l(t)))})),document.addEventListener("mouseout",(e=>{const t=e.target.closest(o);t&&this.#s(t)&&(t.contains(e.relatedTarget)||e.relatedTarget&&e.relatedTarget.closest(".preview-popover")||(t.href,this.#c()))}))}#o(){document.addEventListener("focusin",(e=>{const t=e.target.closest(o);t&&this.#s(t)&&(t.href,this.#a(),this.#l(t))})),document.addEventListener("focusout",(e=>{const t=e.target.closest(o);t&&this.#s(t)&&(e.relatedTarget&&e.relatedTarget.closest(".preview-popover")||(t.href,this.#a(),this.#d()))}))}#r(){document.addEventListener("keydown",(e=>{"Escape"===e.key&&this.currentLink&&(this.#a(),this.#d())}))}#e(){this.popoverElement=document.createElement("div"),this.popoverElement.className="preview-popover",this.popoverElement.id="preview-popover",this.popoverElement.role="tooltip",this.popoverElement.style.display="none",document.body.appendChild(this.popoverElement)}#i(){this.popoverElement.addEventListener("mouseenter",(()=>{clearTimeout(this.hideTimeout)})),this.popoverElement.addEventListener("mouseleave",(()=>{this.#c()}))}#t(){return!window.matchMedia("(any-hover: hover)").matches}#a(){clearTimeout(this.showTimeout),clearTimeout(this.hideTimeout)}#s(e){const t="previewable"in e.dataset;if(e.classList.contains("stretched-link")&&!t)return!1;if(e.classList.contains("btn")&&!t)return!1;const i=!!e.closest(".article-body"),n=e.classList.contains("ref-link");if(!i&&!t&&!n)return!1;if("notPreviewable"in e.dataset)return!1;const o=e.getAttribute("href");return!o.startsWith("/feedback/")&&o&&!o.startsWith("#")&&(o.startsWith("/")||o.startsWith(window.location.origin))}async#l(e){clearTimeout(this.hideTimeout),this.currentLink!==e&&(this.currentLink=e,this.showTimeout=setTimeout((async()=>{if(this.currentLink===e){e.href;try{const i=Date.now(),n=await this.#h(e);if(this.currentLink===e){if("not_found"===n.type)return void e.href;const o=Date.now()-i,r=Math.max(0,500-o);if(await(t=r,new Promise((e=>setTimeout(e,t)))),this.currentLink!==e)return;this.#p(e,n)}}catch(t){console.error("Preview fetch failed:",t),e.href}var t}}),150))}#c(){clearTimeout(this.showTimeout),this.hideTimeout=setTimeout((()=>{this.#d()}),100)}#d(){this.popoverElement.classList.remove("visible"),this.currentLink&&this.currentLink.removeAttribute("aria-describedby"),this.currentLink=null}async#h(e){const t=this.#u(e),i=this.cache.get(t);if(i)return i;const n=await fetch(`/api/v1/preview/${t.replace(/^\//,"")}`),o=await n.json();return this.cache.set(t,o),o}#u(e){const t=e.getAttribute("href");return new URL(t,window.location.origin).pathname.trim()}#p(e,t){this.popoverElement.replaceChildren(this.#v(t)),this.popoverElement.style.display="",this.popoverElement.classList.add("visible"),e.setAttribute("aria-describedby","preview-popover"),requestAnimationFrame((()=>this.#m(e)))}#v(t){return e`
${t.image?e`
${t.image.alt||
`:""}
${t.parent_title?i(t.parent_title):{reference:"Reference",article:"Tutorial",course:"Course",lesson:"Course Lesson",topic:"Topic",podcast_episode:"Podcast Episode",podcast_show:"Podcast",learning_path:"Learning Path",quiz:"Quiz"}[t.type]||"Article"}

${i(t.title)}

${i(t.short_preview)}
`}#m(e){const t=e.getBoundingClientRect(),i=this.popoverElement.getBoundingClientRect(),{left:n,arrowOffset:o}=this.#f(t,i);this.popoverElement.style.left=`${n}px`,this.popoverElement.style.setProperty("--arrow-offset",`${o}px`);const{top:r,positionClass:s}=this.#w(t,i);this.popoverElement.style.top=`${r}px`,this.popoverElement.classList.remove("above","below"),this.popoverElement.classList.add(s)}#f(e,t){const i=e.left+e.width/2;let n=i-t.width/2;const o=window.innerWidth-t.width-20,r=Math.max(10,Math.min(n,o));return{left:r,arrowOffset:Math.max(20,Math.min(i-r,t.width-20))}}#w(e,t){const i=window.innerHeight-e.bottom,n=e.top;return i>=t.height+8||i>=n?{top:e.bottom+window.scrollY+8,positionClass:"below"}:{top:e.top+window.scrollY-t.height-8,positionClass:"above"}}}var s;s=()=>{window.previewPopoverController||(window.previewPopoverController=new r)},"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?s():document.addEventListener("DOMContentLoaded",s)}();