import{n as x}from"./src-Ci62OB0C.js";var h={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:4};function c(e,n){if(e===void 0||n===void 0)return{angle:0,deltaX:0,deltaY:0};e=a(e),n=a(n);let[y,t]=[e.x,e.y],[l,g]=[n.x,n.y],s=l-y,w=g-t;return{angle:Math.atan(w/s),deltaX:s,deltaY:w}}x(c,"calculateDeltaAndAngle");var a=x(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),b=x(e=>({x:x(function(n,y,t){let l=0,g=a(t[0]).x<a(t[t.length-1]).x?"left":"right";if(y===0&&Object.hasOwn(h,e.arrowTypeStart)){let{angle:r,deltaX:f}=c(t[0],t[1]);l=h[e.arrowTypeStart]*Math.cos(r)*(f>=0?1:-1)}else if(y===t.length-1&&Object.hasOwn(h,e.arrowTypeEnd)){let{angle:r,deltaX:f}=c(t[t.length-1],t[t.length-2]);l=h[e.arrowTypeEnd]*Math.cos(r)*(f>=0?1:-1)}let s=Math.abs(a(n).x-a(t[t.length-1]).x),w=Math.abs(a(n).y-a(t[t.length-1]).y),p=Math.abs(a(n).x-a(t[0]).x),M=Math.abs(a(n).y-a(t[0]).y),d=h[e.arrowTypeStart],i=h[e.arrowTypeEnd];if(s<i&&s>0&&w<i){let r=i+1-s;r*=g==="right"?-1:1,l-=r}if(p<d&&p>0&&M<d){let r=d+1-p;r*=g==="right"?-1:1,l+=r}return a(n).x+l},"x"),y:x(function(n,y,t){let l=0,g=a(t[0]).y<a(t[t.length-1]).y?"down":"up";if(y===0&&Object.hasOwn(h,e.arrowTypeStart)){let{angle:r,deltaY:f}=c(t[0],t[1]);l=h[e.arrowTypeStart]*Math.abs(Math.sin(r))*(f>=0?1:-1)}else if(y===t.length-1&&Object.hasOwn(h,e.arrowTypeEnd)){let{angle:r,deltaY:f}=c(t[t.length-1],t[t.length-2]);l=h[e.arrowTypeEnd]*Math.abs(Math.sin(r))*(f>=0?1:-1)}let s=Math.abs(a(n).y-a(t[t.length-1]).y),w=Math.abs(a(n).x-a(t[t.length-1]).x),p=Math.abs(a(n).y-a(t[0]).y),M=Math.abs(a(n).x-a(t[0]).x),d=h[e.arrowTypeStart],i=h[e.arrowTypeEnd];if(s<i&&s>0&&w<i){let r=i+1-s;r*=g==="up"?-1:1,l-=r}if(p<d&&p>0&&M<d){let r=d+1-p;r*=g==="up"?-1:1,l+=r}return a(n).y+l},"y")}),"getLineFunctionsWithOffset");export{b as t};
