import V from"/-/delaunator@v5.0.0-5MwqNhLRHOkBYnNXuoGN/dist=es2020,mode=imports,min/optimized/delaunator.js";const X=1e-6;class y{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){t=+t,e=+e,n=+n;const i=t+n,s=e;if(n<0)throw new Error("negative radius");if(this._x1===null?this._+=`M${i},${s}`:(Math.abs(this._x1-i)>X||Math.abs(this._y1-s)>X)&&(this._+="L"+i+","+s),!n)return;this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=i},${this._y1=s}`}rect(t,e,n,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+i}h${-n}Z`}value(){return this._||null}}class S{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class Y{constructor(t,[e,n,i,s]=[0,0,960,500]){if(!((i=+i)>=(e=+e))||!((s=+s)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=e,this.ymax=s,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:i}=this;let s,l;const r=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let d=0,m=0,b=n.length,p,k;d1;)s-=2;for(let l=2;l0){if(e>=this.ymax)return null;(l=(this.ymax-e)/i)0){if(t>=this.xmax)return null;(l=(this.xmax-t)/n)this.xmax?2:0)|(ethis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e1e-10)return!1}return!0}function J(_,t,e){return[_+Math.sin(_+t)*e,t+Math.cos(_-t)*e]}class F{static from(t,e=D,n=G,i){return new F("length"in t?K(t,e,n,i):Float64Array.from(P(t,e,n,i)))}constructor(t){this._delaunator=new V(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&R(t)){this.collinear=Int32Array.from({length:e.length/2},(c,f)=>f).sort((c,f)=>e[2*c]-e[2*f]||e[2*c+1]-e[2*f+1]);const h=this.collinear[0],o=this.collinear[this.collinear.length-1],a=[e[2*h],e[2*h+1],e[2*o],e[2*o+1]],u=1e-8*Math.hypot(a[3]-a[1],a[2]-a[0]);for(let c=0,f=e.length/2;c0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],l[i[0]]=1,i.length===2&&(l[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new Y(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:i,halfedges:s,triangles:l,collinear:r}=this;if(r){const u=r.indexOf(t);u>0&&(yield r[u-1]),u=0&&s!==n&&s!==i;)n=s;return s}_step(t,e,n){const{inedges:i,hull:s,_hullIndex:l,halfedges:r,triangles:h,points:o}=this;if(i[t]===-1||!o.length)return(t+1)%(o.length>>1);let a=t,u=v(e-o[t*2],2)+v(n-o[t*2+1],2);const c=i[t];let f=c;do{let g=h[f];const d=v(e-o[g*2],2)+v(n-o[g*2+1],2);if(d