import{t as e}from"./i18n-D2feMeB7.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){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 o(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 o=i-r;if(o<=Math.max(1,n-1))return Array.from({length:o+1},(e,t)=>r+t);let s=a(o,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 s(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 c=[`#6aa8ff`,`#fbbf24`],l=[`#6aa8ff`,`#f0abfc`,`#86efac`];function u(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 d(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 f(e){return e>0?Math.max(16,Math.ceil(e*1.08)):256}var p=1024;function m(e){return e>=p?{mode:`gib`,divisor:p,yMax:e/p}:{mode:`mib`,divisor:1,yMax:e}}function h(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 g(e){let{range:n,language:a,kind:c,xDomain:l,yDomain:u,smooth:d=!0,colorRange:f,yLabelFormatter:p}=e,m=p??(c===`cpu`?s:i(c===`int`?0:c===`dec1`?1:2)),h={x:{type:`time`,domainMin:l[0],domainMax:l[1]}};u?h.y={type:`linear`,domainMin:u.min,domainMax:u.max,nice:!1}:h.y={type:`linear`,nice:!0},f?.length&&(h.color={range:f});let g={animation:!1,connectNulls:!1,smooth:d,scale:h,axis:{x:{...t.x,labelFormatter:r(n,a),tickCount:6,labelAutoRotate:!1,labelAutoWrap:!0},y:{...t.y,labelFormatter:m,tickCount:6,...c===`int`?{tickMethod:o}:{}}}};return f?.length&&(g.legend={color:{itemLabelFill:`rgba(255,255,255,0.82)`,position:`top`,layout:{justifyContent:`center`}}}),g}export{u as a,f as c,h as i,n as l,l as n,d as o,g as r,m as s,c as t};