function e(e,n,r){return(n=t(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function t(e){var t=n(e,`string`);return typeof t==`symbol`?t:t+``}function n(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function r(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function i(e,t){return e.size===t.size&&Array.from(e).every(e=>t.has(e))}function a(e,t){return Array.isArray(e)?e.every(e=>typeof e===t):!1}function o(e){return JSON.parse(JSON.stringify(e))}function s(e){return e.replace(/[\u00A0-\u9999<>\&]/g,e=>`&#`+e.charCodeAt(0)+`;`)}function c(e){return Array.from({length:e},(e,t)=>t)}function l(e,t){let n=e.charAt(t);return n===n.toUpperCase()}function u(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.6;return t-t/(.1*e+1)}function d(e,t){let n=e.slice(1).match(/.{1,2}/g),r=[0,0,0];return n!==null&&(r=[parseInt(n[0],16),parseInt(n[1],16),parseInt(n[2],16)]),`rgb(`+r.map(e=>(e+=t,e<0&&(e=0),e>255&&(e=255),e)).toString()+`)`}function f(e,t){for(;e.length<t;)e=`0`+e;return e}function p(e){let t=Math.round(e*1e6)/1e6;return t===-0&&(t=0),t}function m(e){let t=Math.floor(e),n=Math.floor((e-t)*1e3);return t.toString()+`.`+n.toString().padStart(3,`0`)}function h(e,t,n){return(e-t[0])/(t[1]-t[0])*(n[1]-n[0])+n[0]}function g(e,t,n){return v((e-t[0])/(t[1]-t[0]),0,1)*(n[1]-n[0])+n[0]}var _=class{constructor(t,n){e(this,`a`,void 0),e(this,`b`,void 0),this.a=(n[1]-n[0])/(t[1]-t[0]),this.b=n[0]-this.a*t[0]}calculate(e){return e*this.a+this.b}};function v(e,t,n){return Math.min(Math.max(e,t),n)}function y(e,t,n){let r=Math.hypot(n[0],n[1]),i=Math.atan2(n[1],n[0])+t;return[e[0]+Math.cos(i)*r,e[1]-Math.sin(i)*r]}function b(e){let t=(e+Math.PI)%(2*Math.PI);return t>0?t-Math.PI:t+Math.PI}function x(){let e=``;for(let t=0;t<32;t++)e+=`abcdefghijklmnopqrstuvwxyz0123456789`.charAt(Math.floor(Math.random()*36));return e}function S(e,t,n){let r=t/n,i=(e[1]-e[0])/r,a=10**Math.floor(Math.log10(i));return a*[0,1,2,2,5,5,5,5,5,10,10][Math.round(i/a)]}function C(e,t){let n=e=>{let t=Math.max(Math.abs(e.x),Math.abs(e.y));return(2*t-1)*(2*t-1)},r=e=>{let t=Math.max(Math.abs(e.x),Math.abs(e.y));return{x:t,y:-(t-1)}},i=(e,t)=>t.y-e.y+1,a={x:e,y:t},o=Math.max(Math.abs(a.x),Math.abs(a.y)),s=0,c=n(a),l=r(a);if(a.x===o&&a.y>=l.y)return s=i(l,a),s+c;if(a.y===o){let e={x:o,y:o};return s=i(l,e)+(e.x-a.x),s+c}else if(a.x===-o){let e={x:o,y:o},t=i(l,e),n={x:-o,y:o},r=e.x-n.x,u=n.y-a.y;return s=t+r+u,s+c}else{let e={x:o,y:o},t=i(l,e),n={x:-o,y:o},r=e.x-n.x,u=n.y-a.y,d={x:-o,y:-o},f=a.x-d.x;return s=t+r+u+f,c+s}}export{i as _,l as a,b,p as c,C as d,s as f,g,h,u as i,x as l,o as m,r as n,a as o,c as p,S as r,v as s,_ as t,m as u,d as v,f as x,y};