Files
openclaw-config/cache/control-ui-assets/d08fd045b9cb86d13f0b4aa403c8a06ddcd32e533058ae463245169e5cff5e85/assets/control-ui-environment-presentation.runtime-CUzY9dKZ.js
T

2 lines
2.1 KiB
JavaScript

import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{Rr as t,Vr as n}from"./control-ui-foundation-CeFMP1Ly.js";import{bt as r,xt as i}from"./control-ui-core-DGVkFhVB.js";function a(e){r(e.seamColor);let n=document.documentElement,i=e.environment;if(!i){let e=n.getAttribute(t);if(e){let t=` · ${JSON.parse(e).label}`;document.title.endsWith(t)&&(document.title=document.title.slice(0,-t.length))}n.removeAttribute(t),n.style.removeProperty(`--control-ui-environment-color`),n.style.removeProperty(`--control-ui-environment-ink`),document.querySelector(`.control-ui-environment-stripe`)?.remove();for(let e of document.querySelectorAll(`link[rel="icon"][data-openclaw-original-favicon]`)){let t=JSON.parse(e.dataset.openclawOriginalFavicon);for(let[n,r]of[[`href`,t[0]],[`type`,t[1]]])r===null?e.removeAttribute(n):e.setAttribute(n,r);delete e.dataset.openclawOriginalFavicon}return}if(n.setAttribute(t,JSON.stringify(i)),n.style.setProperty(`--control-ui-environment-color`,`var(--control-ui-environment-${i.color})`),n.style.setProperty(`--control-ui-environment-ink`,`var(--control-ui-environment-${i.color}-ink)`),!document.querySelector(`.control-ui-environment-stripe`)){let e=document.createElement(`div`);e.className=`control-ui-environment-stripe`,e.setAttribute(`aria-hidden`,`true`),document.body.prepend(e)}document.title.endsWith(` · ${i.label}`)||(document.title=`${document.title} · ${i.label}`);let a=getComputedStyle(n).getPropertyValue(`--control-ui-environment-${i.color}`).trim();if(!a)return;let o=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120"><path fill="${a}" d="M60 10C30 10 15 35 15 55c0 20 15 40 30 45v10h10v-10h10v10h10v-10c15-5 30-25 30-45 0-20-15-45-45-45Z"/></svg>`;for(let e of document.querySelectorAll(`link[rel="icon"]`))e.dataset.openclawOriginalFavicon??=JSON.stringify([e.getAttribute(`href`),e.getAttribute(`type`)]),e.href=`data:image/svg+xml,${encodeURIComponent(o)}`,e.type=`image/svg+xml`}function o(){return(o=e((()=>{n(),i()})))()}o();export{a as applyControlUiPresentation};
//# sourceMappingURL=control-ui-environment-presentation.runtime-CUzY9dKZ.js.map