import{h as t}from"./shared-DSdTChh7.js";const i="KChat is beta software.";function r(){const n=t("h2",{id:"beta-gate-title",text:i}),a=t("a",{class:"btn btn-solid btn-sm",href:"#","data-gate-go":""}),o=t("button",{class:"btn btn-ghost btn-sm",type:"button",text:"Not now"}),e=t("dialog",{class:"beta-gate glass","aria-labelledby":"beta-gate-title"},t("p",{class:"kicker",text:"Before you download"}),n,t("ul",{},t("li",{text:"It works, and it is early. Expect rough edges, and a few things that change between updates."}),t("li",{text:"The installer is not signed yet. Your Mac or Windows will ask you to confirm the first launch."}),t("li",{},t("span",{text:"Tell us what breaks: "}),t("a",{class:"link",href:"mailto:support@the-karya.com",text:"support@the-karya.com"}),t("span",{text:"."}))),t("div",{class:"actions"},a,o));return o.addEventListener("click",()=>e.close()),e.addEventListener("click",l=>{l.target===e&&e.close()}),a.addEventListener("click",()=>e.close()),document.body.append(e),e}function d(){let n;document.addEventListener("click",a=>{const o=a.target?.closest('a[href^="/download/"]');if(!o||a.defaultPrevented||a.metaKey||a.ctrlKey||typeof HTMLDialogElement>"u")return;a.preventDefault(),n??=r();const e=n.querySelector("[data-gate-go]");if(e){e.href=o.href;const l=Array.from(o.childNodes).filter(s=>!(s instanceof Element&&s.classList.contains("hint"))).map(s=>s.textContent??"").join("").replace(/\s+/g," ").trim();e.textContent=l||"Download"}n.showModal()})}export{d as i};