import{t as e}from"./i18n-BEvBfIF0.js";var t={x:{labelFill:`rgba(255, 255, 255, 0.55)`,lineStroke:`rgba(255, 255, 255, 0.25)`,tickStroke:`rgba(255, 255, 255, 0.3)`,line:!0,grid:!0,gridStroke:`rgba(255, 255, 255, 0.08)`},y:{labelFill:`rgba(255, 255, 255, 0.55)`,lineStroke:`rgba(255, 255, 255, 0.25)`,tickStroke:`rgba(255, 255, 255, 0.3)`,line:!0,grid:!0,gridStroke:`rgba(255, 255, 255, 0.08)`}};function n(e,t){if(!Number.isFinite(e)||!Number.isFinite(t)){let e=Date.now();return[e-36e5,e]}if(t<=e)return[e-6e4,e+6e4];let n=t-e,r=Math.max(Math.floor(n*.06),3e4);return[e-r,t+r]}function r(t,n){let r=e(n),i=new Intl.DateTimeFormat(r,{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1});return e=>{let t;t=e instanceof Date?e.getTime():typeof e==`number`?e:Date.parse(String(e));let n=new Date(t);return Number.isNaN(n.getTime())?``:i.format(n)}}function i(e){return t=>{let n=Number(t);return Number.isFinite(n)?e===0?String(Math.round(n)):e===1?(Math.round(n*10)/10).toFixed(1):(Math.round(n*100)/100).toFixed(2):``}}function a(e,t,n){let r=Number(e),i=Number(t);if(!Number.isFinite(r)||!Number.isFinite(i))return[];if(i<=r)return[r];let a=Math.max(2,Math.floor(n)),o=(i-r)/(a-1);return Array.from({length:a},(e,t)=>t===a-1?i:r+o*t)}function o(e,t){let n=e/(Math.max(2,Math.floor(t))-1);if(!(n>1))return 1;let r=10**Math.floor(Math.log10(n)),i=n/r;return i<=1?r:i<=2?2*r:i<=5?5*r:10*r}function s(e,t,n){let r=Math.floor(Math.min(Number(e),Number(t))),i=Math.ceil(Math.max(Number(e),Number(t)));if(!Number.isFinite(r)||!Number.isFinite(i))return[];if(i<=r)return[r];let a=i-r;if(a<=Math.max(1,n-1))return Array.from({length:a+1},(e,t)=>r+t);let s=o(a,n),c=[],l=Math.ceil(r/s)*s;l!==r&&c.push(r);for(let e=l;e<=i;e+=s)c.push(e);return c[c.length-1]!==i&&c.push(i),c}function c(e){let t=Number(e);return Number.isFinite(t)?Math.abs(t)>=10?String(Math.round(t)):(Math.round(t*10)/10).toFixed(1):``}var l=[`#6aa8ff`,`#fbbf24`],u=[`#6aa8ff`,`#f0abfc`,`#86efac`];function d(e){if(!e.length)return{min:0,max:5};let t=Math.max(...e.map(e=>Math.floor(Number(e))));return t<=0||t<=1?{min:0,max:5}:{min:0,max:Math.max(t+1,Math.ceil(t*1.12))}}function f(e,t,n){if(!e.length)return{min:0,max:t};let r=Math.max(0,...e.map(e=>Number(e)));return{min:0,max:Math.max(t,r*n+1e-12)}}function p(e){return e>0?Math.max(16,Math.ceil(e*1.08)):256}var m=1024;function h(e){return e>=m?{mode:`gib`,divisor:m,yMax:e/m}:{mode:`mib`,divisor:1,yMax:e}}function g(e,t){let n=Number(e);if(!Number.isFinite(n))return``;if(t===`mib`)return String(Math.round(n));let r=Math.abs(n);return r>=100?String(Math.round(n)):r>=10?(Math.round(n*10)/10).toFixed(1):(Math.round(n*100)/100).toFixed(2)}function _(e){let{range:n,language:o,kind:l,xDomain:u,yDomain:d,smooth:f=!0,colorRange:p,yLabelFormatter:m}=e,h=m??(l===`cpu`?c:i(l===`int`?0:l===`dec1`?1:2)),g={x:{type:`time`,domainMin:u[0],domainMax:u[1]}};d?g.y={type:`linear`,domainMin:d.min,domainMax:d.max,nice:!1}:g.y={type:`linear`,nice:!0},p?.length&&(g.color={range:p});let _={animation:!1,connectNulls:!1,smooth:f,scale:g,axis:{x:{...t.x,labelFormatter:r(n,o),tickCount:6,tickMethod:a,labelAutoRotate:!1,labelAutoWrap:!0},y:{...t.y,labelFormatter:h,tickCount:6,...l===`int`?{tickMethod:s}:{}}}};return p?.length&&(_.legend={color:{itemLabelFill:`rgba(255,255,255,0.82)`,position:`top`,layout:{justifyContent:`center`}}}),_}export{d as a,p as c,g as i,n as l,u as n,f as o,_ as r,h as s,l as t};