// https://github.com/jamesleesaunders/ v1.0.4 Copyright 2022 James Saunders
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("d3-shape"),require("d3-array"),require("d3-interpolate")):"function"==typeof define&&define.amd?define(["exports","d3-shape","d3-array","d3-interpolate"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{},t.d3,t.d3,t.d3)}(this,(function(t,e,n,r){"use strict";function o(t,n,r,o){return function(t,e,n){t=t||"M0,0L1,1";const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.innerHTML="<path></path>";const o=r.querySelector("path");o.setAttribute("d",t);const i=o.getTotalLength(),u=o.getPointAtLength(0),a=o.getPointAtLength(i);let c=a.x<u.x;const l=c?[a,u]:[u,a];return c=c?-1:1,function(t){const r=0===t?0:t||u.x;if(r<l[0].x)return l[0];if(r>l[1].x)return l[1];function a(t,i,u){let a=o.getPointAtLength(t).x-r,l=0,f=0;for(;Math.abs(a)>e&&f<n;){if(f>n)return!1;f++,c*a<0?(i=t,t=(t+u)/2):(u=t,t=(i+t)/2),l=o.getPointAtLength(t).x-r,a=l}return t}const f=a(i/2,0,i);return o.getPointAtLength(f).y}}(e.line().curve(n)(t),r,o)}function i(t,i,u=1e-5,a=100){const c=t.length,l=n.range(c).map((function(t,e){return e*(1/(c-1))})),f=t.map(((t,e)=>[l[e],t]));return i===e.curveBasis?r.interpolateBasis(t):o(f,i,u,a)}t.interpolateCardinal=function(t){return i(t,e.curveCardinal)},t.interpolateCatmullRom=function(t){return i(t,e.curveCatmullRom)},t.interpolateFromCurve=i,t.interpolateMonotoneX=function(t){return i(t,e.curveMonotoneX)},Object.defineProperty(t,"__esModule",{value:!0})}));
