/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
import{a as n,g as t,p as o}from"./p-DfdVaPrt.js";function r(n=0,t=0){return{x:n,y:t}}function c(n,t){const o=s(n,t);return Math.sqrt(o.x*o.x+o.y*o.y)}function s(n,t){return{x:n.x-t.x,y:n.y-t.y}}function e(n,t){return{x:n.x+t.x,y:n.y+t.y}}function u(n,t){return{x:n.x*t,y:n.y*t}}function a(n){return Math.sqrt(n.x*n.x+n.y*n.y)}function i(n){const t=a(n);if(t===0){return r(0,0)}else{return u(n,1/t)}}function f(n,t){return i(s(t,n))}function M(n,t){const o=f(n,t);if(o.x===0||o.y===0){return r(-1*o.y,o.x)}if(Math.abs(o.x)>Math.abs(o.y)){const n=1-Math.pow(o.x,2);const t=-1*o.x*o.y;return i(r(n,t))}else{const n=-1*o.x*o.y;const t=1-Math.pow(o.y,2);return i(r(n,t))}}function h(n){const t=JSON.parse(n);if(Array.isArray(t)){const[n,o]=t;return r(n,o)}else{const{x:n,y:o}=t;return r(n,o)}}function E(n,t,o,r){const c=M(n,t);const a=f(n,t);const i=s(t,e(u(a,o*Math.cos(r)),u(c,o*Math.sin(r))));const h=s(t,s(u(a,o*Math.cos(r)),u(c,o*Math.sin(r))));return{leftPoint:i,rightPoint:h}}function R(t,o,r=65,s=85){const a=c(t,o);const i=Math.max(4,Math.min(16,a*.25));const f=Math.max(4,Math.min(12,a*.16));const M=Math.min(5,a*.1);const h=i/a;const R=e(u(o,1-h),u(t,h));const y=n.toRadians(r/2);const $=i/Math.cos(y);const p=E(t,o,$,y);const x=n.toRadians(s/2);const l=i/Math.cos(x);const L=E(t,o,l,x);const g=n.toRadians(90);const T=E(t,o,f,g);return{tip:o,base:R,arrowTriangle:p,arrowLine:L,hash:T,radius:M}}function y(n,t=1){const o=g(n.tip,n.arrowTriangle.rightPoint,t);const r=g(n.tip,n.arrowTriangle.leftPoint,t);const c=g(n.tip,n.base,t);return[n.tip,o,c,r].map((n=>`${n.x},${n.y}`)).join(" ")}function $(n,t=1){const o=g(n.tip,n.arrowLine.rightPoint,t);const r=g(n.tip,n.arrowLine.leftPoint,t);return`M${o.x} ${o.y} L${n.tip.x} ${n.tip.y} L${r.x} ${r.y} L${n.tip.x} ${n.tip.y} Z`}function p(n,t=1){const o=g(n.tip,n.hash.rightPoint,t);const r=g(n.tip,n.hash.leftPoint,t);return{x1:o.x,y1:o.y,x2:r.x,y2:r.y}}function x(n,t=1){return{cx:n.tip.x,cy:n.tip.y,r:n.radius*t}}function l(n){return n instanceof HTMLElement&&n.nodeName==="VERTEX-VIEWER-MARKUP-ARROW"}function L(n){return typeof n==="string"?h(n):n}function g(n,t,o){return e(n,u(s(t,n),o))}function T(n){return n instanceof HTMLElement&&n.nodeName==="VERTEX-VIEWER-MARKUP-CIRCLE"}function V(n){return typeof n==="string"?t.fromJson(n):n}function P(n){return typeof n==="string"?JSON.parse(n).map((n=>o.fromJson(JSON.stringify(n)))):n}function m(n){return n instanceof HTMLElement&&n.nodeName==="VERTEX-VIEWER-MARKUP-FREEFORM"}export{T as a,m as b,y as c,$ as d,p as e,x as f,R as g,V as h,l as i,P as j,L as p};
//# sourceMappingURL=p-CR7q8bhh.js.map