(function(){function e(e){return e?/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)||/^rgb\([^{}'";:]+\)$/.test(e):!1}var t=document.querySelector(`script#gitea-external-render-helper`)?.getAttribute(`data-render-query-string`)??window.location.search.substring(1),n=new URLSearchParams(t),r=n.get(`gitea-is-dark-theme`)===`true`;r&&document.documentElement.setAttribute(`data-gitea-theme-dark`,String(r));var i=n.get(`gitea-iframe-bgcolor`);if(e(i)){let e=document.createElement(`style`);e.textContent=`
:root {
  --gitea-iframe-bgcolor: ${i};
}
html, body { margin: 0; padding: 0 }
body { background: ${i}; }
`,document.head.append(e)}var a=n.get(`gitea-iframe-id`);if(a){let e=(e,t={})=>{window.parent.postMessage({giteaIframeCmd:e,giteaIframeId:a,...t},`*`)},t=()=>{document.body&&(e(`resize`,{iframeHeight:Math.max(document.documentElement.scrollHeight,document.body.scrollHeight)}),document.documentElement.style.overflowY=`hidden`)};new ResizeObserver(()=>t()).observe(window.document.documentElement),t(),window.addEventListener(`DOMContentLoaded`,t),setInterval(t,1e3);let n=(t,n)=>e(`open-link`,{openLink:t,anchorTarget:n});document.addEventListener(`click`,e=>{let t=e.target;if(t.nodeName!==`A`)return;let r=t.getAttribute(`href`)??``;(r.startsWith(`.`)||r.startsWith(`/`)||r.startsWith(`http://`)||r.startsWith(`https://`))&&(e.preventDefault(),n(r,(e.metaKey||e.ctrlKey?`_blank`:null)??t.getAttribute(`target`)))})}window.testModules&&(window.testModules.externalRenderHelper={isValidCssColor:e})})();
//# sourceMappingURL=external-render-helper.Cf35y6lL.js.map