(function(){const u=(r=>{const t=e=>e.split("").reverse().join("");return t(atob(t(r)))})("==Aa0RHczpzLvEGcw5iehBndvl2Yl5ycpRXZ"),d=("https://app.zapvoice.site".startsWith("__ZV_")?u:"https://app.zapvoice.site".replace(/\/$/,"")).replace(/\/$/,"")+"/api/public/brand-settings",a="zv_brand_cache_v1";function i(r){try{const t=String(r||"").replace(/^#/,"");if(t.length!==6)return null;const e=parseInt(t.slice(0,2),16),c=parseInt(t.slice(2,4),16),n=parseInt(t.slice(4,6),16);return[e,c,n].some(function(o){return Number.isNaN(o)})?null:e+" "+c+" "+n}catch{return null}}function y(r){try{var t=i(r.colorPrimary),e=i(r.colorSecondary),c=i(r.colorTertiary);if(!t)return;var n=":root,:host{--zv-color-primary:"+t+";"+(e?"--zv-color-secondary:"+e+";":"")+(c?"--zv-color-tertiary:"+c+";":"")+"--brand-primary:"+r.colorPrimary+";--brand-secondary:"+(r.colorSecondary||"")+";--brand-tertiary:"+(r.colorTertiary||"")+";}",o=document.getElementById("zv-brand-ui");o||(o=document.createElement("style"),o.id="zv-brand-ui",(document.head||document.documentElement).appendChild(o)),o.textContent=n}catch{}}function l(r){if(r){var t=r.extensionName||r.name;t&&typeof document<"u"&&document.title&&(document.title=document.title.replace(/ZapVoice/g,t),document.title.indexOf(t)<0&&(document.title=t)),y({colorPrimary:r.colorPrimary||r.colors?.primary,colorSecondary:r.colorSecondary||r.colors?.secondary,colorTertiary:r.colorTertiary||r.colors?.tertiary})}}try{chrome.storage?.local?.get?.(a,function(r){var t=r&&r[a];t&&t.brand&&l(t.brand)})}catch{}fetch(d,{cache:"no-store"}).then(function(r){return r.ok?r.json():null}).then(function(r){if(r){var t={extensionName:r.extensionName,colorPrimary:r.colors?.primary,colorSecondary:r.colors?.secondary,colorTertiary:r.colors?.tertiary};l(t);try{chrome.storage?.local?.set?.({[a]:{at:Date.now(),brand:t}})}catch{}}}).catch(function(){})})();
