import{l as e,n as t,o as n,r,t as i}from"./string.glgWnFY6.js";function a(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function o(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function s(e){let t,n,r;e.length===2?(t=e===a||e===o?e:c,n=e,r=e):(t=a,n=(t,n)=>a(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function s(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function l(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:l,right:s}}function c(){return 0}function l(e){return e===null?NaN:+e}var u=s(a),d=u.right;u.left,s(l).center;var f=Math.sqrt(50),p=Math.sqrt(10),m=Math.sqrt(2);function h(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=f?10:a>=p?5:a>=m?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?h(e,t,n*2):[s,c,l]}function g(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?h(t,e,n):h(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function _(e,t,n){return t=+t,e=+e,n=+n,h(e,t,n)[2]}function v(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?_(t,e,n):_(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function y(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function b(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function x(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=w(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function S(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function C(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=w(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function w(a,o){var s=typeof o,c;return o==null||s===`boolean`?n(o):(s===`number`?t:s===`string`?(c=e(o))?(o=c,r):i:o instanceof e?r:o instanceof Date?S:b(o)?y:Array.isArray(o)?x:typeof o.valueOf!=`function`&&typeof o.toString!=`function`||isNaN(o)?C:t)(a,o)}function T(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function E(e){return function(){return e}}function D(e){return+e}var O=[0,1];function k(e){return e}function A(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:E(isNaN(t)?NaN:.5)}function j(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function M(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=A(i,r),a=n(o,a)):(r=A(r,i),a=n(a,o)),function(e){return a(r(e))}}function N(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=A(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=d(e,t,1,r)-1;return a[n](i[n](t))}}function P(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function F(){var e=O,n=O,r=w,i,a,o,s=k,c,l,u;function d(){var t=Math.min(e.length,n.length);return s!==k&&(s=j(e[0],e[t-1])),c=t>2?N:M,l=u=null,f}function f(t){return t==null||isNaN(t=+t)?o:(l||=c(e.map(i),n,r))(i(s(t)))}return f.invert=function(r){return s(a((u||=c(n,e.map(i),t))(r)))},f.domain=function(t){return arguments.length?(e=Array.from(t,D),d()):e.slice()},f.range=function(e){return arguments.length?(n=Array.from(e),d()):n.slice()},f.rangeRound=function(e){return n=Array.from(e),r=T,d()},f.clamp=function(e){return arguments.length?(s=e?!0:k,d()):s!==k},f.interpolate=function(e){return arguments.length?(r=e,d()):r},f.unknown=function(e){return arguments.length?(o=e,f):o},function(e,t){return i=e,a=t,d()}}function I(){return F()(k,k)}export{v as a,_ as i,P as n,g as o,F as r,s,I as t};