import{ak as P,am as d,al as L,an as k,as as A}from"./index-b5c8f851.js";const f=(r,n,t)=>[n,t],s=(r,n,t)=>[n,t,r[2]],m=(r,n,t)=>[n,t,r[2],r[3]];function j(r){return r?{originPosition:r.originPosition==="upper-left"?"upperLeft":r.originPosition==="lower-left"?"lowerLeft":r.originPosition,scale:r.tolerance?[r.tolerance,r.tolerance]:[1,1],translate:r.extent!=null?[r.extent.xmin,r.extent.ymax]:[0,0]}:null}function h({scale:r,translate:n},t){return Math.round((t-n[0])/r[0])}function x({scale:r,translate:n},t){return Math.round((n[1]-t)/r[1])}function g(r,n,t){const u=[];let o,l,i,e;for(let c=0;c0?(i=h(r,a[0]),e=x(r,a[1]),i===o&&e===l||(u.push(n(a,i-o,e-l)),o=i,l=e)):(o=h(r,a[0]),l=x(r,a[1]),u.push(n(a,o,l)))}return u.length>0?u:null}function M(r,n,t,u){return g(r,t?u?m:s:u?s:f,n)}function b(r,n,t,u){const o=[],l=t?u?m:s:u?s:f;for(let i=0;i=3&&o.push(e)}return o.length?o:null}function q(r,n,t,u){const o=[],l=t?u?m:s:u?s:f;for(let i=0;i=2&&o.push(e)}return o.length?o:null}function p({scale:r,translate:n},t){return t*r[0]+n[0]}function y({scale:r,translate:n},t){return n[1]-t*r[1]}function z(r,n,t){const u=new Array(t.length);if(!t.length)return u;const[o,l]=r.scale;let i=p(r,t[0][0]),e=y(r,t[0][1]);u[0]=n(t[0],i,e);for(let c=1;c