import{t as o}from"./zaraz.DYl4KQ0l.js";function c(t,e){e.addEventListener("click",()=>{o(t,{href:e.href,hostname:e.hostname})})}function s(){const t=document.querySelectorAll("a[href]");if(!(!t||t.length===0))for(const e of t){const{hostname:n,pathname:r}=new URL(e.href);if(e.dataset.tagSerpLink){e.addEventListener("click",()=>{o("click docs tag",{value:e.innerText})});continue}if(!(n==="developers.cloudflare.com"||n==="localhost")){if(n==="deploy.workers.cloudflare.com"){c("deploy button click",e);continue}if(n==="workers.cloudflare.com"&&r.startsWith("/playground#")){c("playground link click",e);continue}if(n.endsWith(".cloudflare.com")){c("Cross Domain Click",e);continue}c("external link click",e)}}}function a(){const t=document.querySelectorAll("starlight-tabs a[role='tab']");!t||t.length===0||t.forEach(e=>e.addEventListener("click",()=>{o("tab click",{selected_option:e.innerText})}))}function u(){const t=document.querySelectorAll("details");if(!(!t||t.length===0))for(const e of t){const n=e.querySelector("summary");n&&e.addEventListener("toggle",()=>{e.open&&o("dropdown click",{text:n.innerText})})}}function d(){const t=document.querySelectorAll(".expressive-code > figure.frame");if(!(!t||t.length===0))for(const e of t){const r=e.classList.contains("has-title")?e.querySelector(".header")?.innerText:"title not set",l=e.querySelector("pre")?.dataset.language??"language not set",i=e.querySelector(".copy > button");i&&i.addEventListener("click",()=>{o("copy button link click",{title:r,language:l})})}}function f(){document.querySelector("#docsearch")?.addEventListener("click",()=>{o("click docs search pop-up")})}s();a();u();d();f();