import{t as e}from"./preload-helper.BbTAn5NJ.js";var t=window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`),n=t&&!t.matches||!0,r,i,a;function o(e,t){return Math.floor(Math.random()*(t-e+1)+e)}var s=60,c=3,l=2,u=360-s-c*l,d=[{value:s,name:`0`,itemStyle:{color:`rgba(255,255,255,0.0)`,borderWidth:0}}],f=!0;function p(){let e;f?(f=!1,e=[30,42,28]):e=Array.apply(null,Array(c)).map(()=>o(20,100));let t=e.reduce((e,t)=>e+t,0);return e=e.map(e=>e/t*u),e=e.map((e,t)=>({value:e,name:``+(t+1)})).map((t,n)=>n<e.length-1?[t,{value:l,itemStyle:{color:`rgba(0, 0, 0, 0)`}}]:[t]).reduce((e,t)=>e.concat(t)),d.concat(e)}function m(){i.setOption({series:[{name:`C`,data:p()}]})}var h=`#00682d`,g=`#31e0a8`,_=!1;function v(e){if(_)return;if(!a){setTimeout(()=>{v(e)},10);return}let t;t=e===!0?h:g,e===`chart`?(_=!0,n&&a.setAttribute(`style`,`fill: `+t+`00;transition: fill 10s ease;`)):a.setAttribute(`style`,`fill: `+t+`;transition: fill 0.2s ease;`)}function y(){return setInterval(function(){m()},60*1e3)}function b(){if(n){if(!r)e(()=>import(`./nc-echart.DAizfQkX.js`).then(e=>e.n).then(e=>{r=e.default,b()}),[]);else if(document.getElementById(`logo-graph`)){i=r.init(document.getElementById(`logo-graph`),null,{renderer:`svg`,width:70,height:70});let e={color:[`#d87a80`,`#82b6e9`,`#31e0a8`],series:[{name:`C`,type:`pie`,startAngle:30,radius:[`18.1`,`28.6`],avoidLabelOverlap:!1,itemStyle:{borderRadius:10,borderWidth:0},animationDuration:6e3,animationDurationUpdate:4e3,label:{show:!1,position:`center`},emphasis:{label:{show:!1,fontSize:`40`,fontWeight:`bold`}},labelLine:{show:!1},data:p()}]},t=y();i.setOption(e),i.on(`click`,()=>{n=!n,t&&(clearInterval(t),t=null),n&&(setTimeout(()=>{b()},500),t=y())})}}}var x=0;function S(){let e=document.getElementById(`frontpage-logo`),t=e==null?void 0:e.contentDocument;if(a=t&&t.getElementById(`logoEnd`),a){let n=document.createElement(`div`);n.appendChild(t.children[0]),e.replaceWith(n),setTimeout(()=>{v(`chart`),setTimeout(()=>{b()},600)},2e3)}else x<1e3&&(x++,setTimeout(S,10))}export{v as n,S as t};