dielines 0.11.1 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dielines.js CHANGED
@@ -3,14 +3,14 @@ var es = (i, t, e) => t in i ? ts(i, t, { enumerable: !0, configurable: !0, writ
3
3
  var Et = (i, t, e) => es(i, typeof t != "symbol" ? t + "" : t, e);
4
4
  var ns = Object.defineProperty, pi = (i) => {
5
5
  throw TypeError(i);
6
- }, is = (i, t, e) => t in i ? ns(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, _ = (i, t, e) => is(i, typeof t != "symbol" ? t + "" : t, e), tn = (i, t, e) => t.has(i) || pi("Cannot " + e), Pt = (i, t, e) => (tn(i, t, "read from private field"), e ? e.call(i) : t.get(i)), wi = (i, t, e) => t.has(i) ? pi("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), qe = (i, t, e, n) => (tn(i, t, "write to private field"), t.set(i, e), e), Pn = (i, t, e) => (tn(i, t, "access private method"), e);
6
+ }, is = (i, t, e) => t in i ? ns(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, F = (i, t, e) => is(i, typeof t != "symbol" ? t + "" : t, e), tn = (i, t, e) => t.has(i) || pi("Cannot " + e), Pt = (i, t, e) => (tn(i, t, "read from private field"), e ? e.call(i) : t.get(i)), wi = (i, t, e) => t.has(i) ? pi("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), qe = (i, t, e, n) => (tn(i, t, "write to private field"), t.set(i, e), e), Pn = (i, t, e) => (tn(i, t, "access private method"), e);
7
7
  const Mn = Symbol.for("pantograph:BoundingBox");
8
8
  function fe(i, t, e, n) {
9
9
  return i <= n && t >= e;
10
10
  }
11
11
  let re = class Ht {
12
12
  constructor(t = 1 / 0, e = 1 / 0, n = -1 / 0, s = -1 / 0) {
13
- _(this, "xMin"), _(this, "yMin"), _(this, "xMax"), _(this, "yMax"), Object.defineProperty(this, Mn, { value: !0 }), this.xMin = t, this.yMin = e, this.xMax = n, this.yMax = s;
13
+ F(this, "xMin"), F(this, "yMin"), F(this, "xMax"), F(this, "yMax"), Object.defineProperty(this, Mn, { value: !0 }), this.xMin = t, this.yMin = e, this.xMax = n, this.yMax = s;
14
14
  }
15
15
  static isInstance(t) {
16
16
  return !!t && t[Mn] === !0;
@@ -151,7 +151,7 @@ const bn = Symbol.for(
151
151
  };
152
152
  let ut = class Pi {
153
153
  constructor(t) {
154
- _(this, "_matrix", [1, 0, 0, 0, 1, 0, 0, 0, 1]), Object.defineProperty(this, bn, {
154
+ F(this, "_matrix", [1, 0, 0, 0, 1, 0, 0, 0, 1]), Object.defineProperty(this, bn, {
155
155
  value: !0
156
156
  }), t && (this._matrix = [...t]);
157
157
  }
@@ -207,7 +207,7 @@ let ut = class Pi {
207
207
  return Math.sqrt(t * t + e * e);
208
208
  }
209
209
  };
210
- class Ft {
210
+ class _t {
211
211
  translateX(t) {
212
212
  const e = new ut().translate(t, 0);
213
213
  return this.transform(e);
@@ -244,9 +244,9 @@ class Ft {
244
244
  return t === "x" ? n.mirrorX() : t === "y" ? n.mirrorY() : n.mirrorLine(t, e), this.transform(n);
245
245
  }
246
246
  }
247
- let oe = class extends Ft {
247
+ let oe = class extends _t {
248
248
  constructor(t, e) {
249
- super(), _(this, "precision", 1e-9), this.firstPoint = t, this.lastPoint = e, this.firstPoint = t, this.lastPoint = e;
249
+ super(), F(this, "precision", 1e-9), this.firstPoint = t, this.lastPoint = e, this.firstPoint = t, this.lastPoint = e;
250
250
  }
251
251
  get repr() {
252
252
  return `${this.segmentType} ${it(this.firstPoint)} - ${it(
@@ -263,7 +263,7 @@ let oe = class extends Ft {
263
263
  const xn = Symbol.for("pantograph:Line");
264
264
  let U = class Vt extends oe {
265
265
  constructor(t, e) {
266
- super(t, e), _(this, "segmentType", "LINE"), _(this, "_V", null), _(this, "_slope", null), _(this, "_yIntercept", null), _(this, "_boundingBox", null), Object.defineProperty(this, xn, { value: !0 });
266
+ super(t, e), F(this, "segmentType", "LINE"), F(this, "_V", null), F(this, "_slope", null), F(this, "_yIntercept", null), F(this, "_boundingBox", null), Object.defineProperty(this, xn, { value: !0 });
267
267
  }
268
268
  static isInstance(t) {
269
269
  return !!t && t[xn] === !0;
@@ -421,7 +421,7 @@ const me = (i, t) => {
421
421
  }, vn = Symbol.for("pantograph:Arc");
422
422
  let D = class jt extends oe {
423
423
  constructor(t, e, n, s = !1, { ignoreChecks: r = !1 } = {}) {
424
- if (super(t, e), _(this, "segmentType", "ARC"), _(this, "center"), _(this, "clockwise"), _(this, "_coefficients", null), _(this, "_angularLength", null), _(this, "_radius", null), _(this, "_firstAngle", null), _(this, "_lastAngle", null), _(this, "_boundingBox", null), Object.defineProperty(this, vn, { value: !0 }), this.center = n, this.clockwise = s, !r) {
424
+ if (super(t, e), F(this, "segmentType", "ARC"), F(this, "center"), F(this, "clockwise"), F(this, "_coefficients", null), F(this, "_angularLength", null), F(this, "_radius", null), F(this, "_firstAngle", null), F(this, "_lastAngle", null), F(this, "_boundingBox", null), Object.defineProperty(this, vn, { value: !0 }), this.center = n, this.clockwise = s, !r) {
425
425
  if (k(t, e))
426
426
  throw new Error("Invalid arc, cannot be a full circle");
427
427
  if (Math.abs(this.radius - Z(this.lastPoint, this.center)) > this.precision)
@@ -680,7 +680,7 @@ function En(i, t = 0, e = 1, n = 110, s = 1e3) {
680
680
  const In = 0.381966, cs = 1e-11;
681
681
  class fs {
682
682
  constructor(t, e = 148e-10, n = 500) {
683
- _(this, "xmin"), _(this, "fval"), _(this, "iter"), _(this, "funcalls"), _(this, "brack"), this.func = t, this.tol = e, this.maxiter = n, this.func = t, this.tol = e, this.maxiter = n, this.xmin = 1 / 0, this.fval = 1 / 0, this.iter = 0, this.funcalls = 0, this.brack = null;
683
+ F(this, "xmin"), F(this, "fval"), F(this, "iter"), F(this, "funcalls"), F(this, "brack"), this.func = t, this.tol = e, this.maxiter = n, this.func = t, this.tol = e, this.maxiter = n, this.xmin = 1 / 0, this.fval = 1 / 0, this.iter = 0, this.funcalls = 0, this.brack = null;
684
684
  }
685
685
  setBracket(t = null) {
686
686
  this.brack = t;
@@ -1325,7 +1325,7 @@ function Ye(i, t, e, n, s) {
1325
1325
  if (we("startRow", t), we("endRow", e), we("startColumn", n), we("endColumn", s), t > e || n > s || t < 0 || t >= i.rows || e < 0 || e >= i.rows || n < 0 || n >= i.columns || s < 0 || s >= i.columns)
1326
1326
  throw new RangeError("Submatrix indices are out of range");
1327
1327
  }
1328
- function Fe(i, t = 0) {
1328
+ function _e(i, t = 0) {
1329
1329
  let e = [];
1330
1330
  for (let n = 0; n < i; n++)
1331
1331
  e.push(t);
@@ -1340,14 +1340,14 @@ function Bt(i) {
1340
1340
  throw new Error("Empty matrix has no elements to index");
1341
1341
  }
1342
1342
  function Es(i) {
1343
- let t = Fe(i.rows);
1343
+ let t = _e(i.rows);
1344
1344
  for (let e = 0; e < i.rows; ++e)
1345
1345
  for (let n = 0; n < i.columns; ++n)
1346
1346
  t[e] += i.get(e, n);
1347
1347
  return t;
1348
1348
  }
1349
1349
  function Is(i) {
1350
- let t = Fe(i.columns);
1350
+ let t = _e(i.columns);
1351
1351
  for (let e = 0; e < i.rows; ++e)
1352
1352
  for (let n = 0; n < i.columns; ++n)
1353
1353
  t[n] += i.get(e, n);
@@ -1361,14 +1361,14 @@ function Ss(i) {
1361
1361
  return t;
1362
1362
  }
1363
1363
  function ks(i) {
1364
- let t = Fe(i.rows, 1);
1364
+ let t = _e(i.rows, 1);
1365
1365
  for (let e = 0; e < i.rows; ++e)
1366
1366
  for (let n = 0; n < i.columns; ++n)
1367
1367
  t[e] *= i.get(e, n);
1368
1368
  return t;
1369
1369
  }
1370
1370
  function Cs(i) {
1371
- let t = Fe(i.columns, 1);
1371
+ let t = _e(i.columns, 1);
1372
1372
  for (let e = 0; e < i.rows; ++e)
1373
1373
  for (let n = 0; n < i.columns; ++n)
1374
1374
  t[n] *= i.get(e, n);
@@ -1401,7 +1401,7 @@ function $s(i, t, e) {
1401
1401
  }
1402
1402
  return r;
1403
1403
  }
1404
- function Fs(i, t, e) {
1404
+ function _s(i, t, e) {
1405
1405
  const n = i.rows, s = i.columns, r = n * s;
1406
1406
  let o = 0, a = 0, h = 0;
1407
1407
  for (let l = 0; l < n; l++)
@@ -1409,7 +1409,7 @@ function Fs(i, t, e) {
1409
1409
  h = i.get(l, c) - e, o += h, a += h * h;
1410
1410
  return t ? (a - o * o / r) / (r - 1) : (a - o * o / r) / r;
1411
1411
  }
1412
- function _s(i, t) {
1412
+ function Fs(i, t) {
1413
1413
  for (let e = 0; e < i.rows; e++)
1414
1414
  for (let n = 0; n < i.columns; n++)
1415
1415
  i.set(e, n, i.get(e, n) - t[e]);
@@ -2028,7 +2028,7 @@ class j {
2028
2028
  strassen3x3(t) {
2029
2029
  t = E.checkMatrix(t);
2030
2030
  let e = new E(3, 3);
2031
- const n = this.get(0, 0), s = this.get(0, 1), r = this.get(0, 2), o = this.get(1, 0), a = this.get(1, 1), h = this.get(1, 2), l = this.get(2, 0), c = this.get(2, 1), u = this.get(2, 2), m = t.get(0, 0), w = t.get(0, 1), g = t.get(0, 2), p = t.get(1, 0), M = t.get(1, 1), f = t.get(1, 2), P = t.get(2, 0), b = t.get(2, 1), I = t.get(2, 2), C = (n + s + r - o - a - c - u) * M, V = (n - o) * (-w + M), v = a * (-m + w + p - M - f - P + I), S = (-n + o + a) * (m - w + M), O = (o + a) * (-m + w), d = n * m, x = (-n + l + c) * (m - g + f), A = (-n + l) * (g - f), y = (l + c) * (-m + g), T = (n + s + r - a - h - l - c) * f, $ = c * (-m + g + p - M - f - P + b), F = (-r + c + u) * (M + P - b), H = (r - u) * (M - b), L = r * P, z = (c + u) * (-P + b), B = (-r + a + h) * (f + P - I), X = (r - h) * (f - I), Q = (a + h) * (-P + I), R = s * p, Y = h * b, tt = o * g, K = l * w, J = u * I, Be = d + L + R, Ve = C + S + O + d + F + L + z, je = d + x + y + T + L + B + Q, Oe = V + v + S + d + L + B + X, ae = V + S + O + d + Y, he = L + B + X + Q + tt, le = d + x + A + $ + F + H + L, ue = F + H + L + z + K, ce = d + x + A + y + J;
2031
+ const n = this.get(0, 0), s = this.get(0, 1), r = this.get(0, 2), o = this.get(1, 0), a = this.get(1, 1), h = this.get(1, 2), l = this.get(2, 0), c = this.get(2, 1), u = this.get(2, 2), m = t.get(0, 0), w = t.get(0, 1), g = t.get(0, 2), p = t.get(1, 0), M = t.get(1, 1), f = t.get(1, 2), P = t.get(2, 0), b = t.get(2, 1), I = t.get(2, 2), C = (n + s + r - o - a - c - u) * M, V = (n - o) * (-w + M), v = a * (-m + w + p - M - f - P + I), S = (-n + o + a) * (m - w + M), O = (o + a) * (-m + w), d = n * m, x = (-n + l + c) * (m - g + f), A = (-n + l) * (g - f), y = (l + c) * (-m + g), T = (n + s + r - a - h - l - c) * f, $ = c * (-m + g + p - M - f - P + b), _ = (-r + c + u) * (M + P - b), H = (r - u) * (M - b), L = r * P, z = (c + u) * (-P + b), B = (-r + a + h) * (f + P - I), X = (r - h) * (f - I), Q = (a + h) * (-P + I), R = s * p, Y = h * b, tt = o * g, K = l * w, J = u * I, Be = d + L + R, Ve = C + S + O + d + _ + L + z, je = d + x + y + T + L + B + Q, Oe = V + v + S + d + L + B + X, ae = V + S + O + d + Y, he = L + B + X + Q + tt, le = d + x + A + $ + _ + H + L, ue = _ + H + L + z + K, ce = d + x + A + y + J;
2032
2032
  return e.set(0, 0, Be), e.set(0, 1, Ve), e.set(0, 2, je), e.set(1, 0, Oe), e.set(1, 1, ae), e.set(1, 2, he), e.set(2, 0, le), e.set(2, 1, ue), e.set(2, 2, ce), e;
2033
2033
  }
2034
2034
  mmulStrassen(t) {
@@ -2067,12 +2067,12 @@ class j {
2067
2067
  j.add(V, S),
2068
2068
  p,
2069
2069
  M
2070
- ), F = j.add(O, A);
2071
- F.sub(y), F.add($);
2070
+ ), _ = j.add(O, A);
2071
+ _.sub(y), _.add($);
2072
2072
  let H = j.add(x, y), L = j.add(d, A), z = j.sub(O, d);
2073
2073
  z.add(x), z.add(T);
2074
- let B = j.zeros(2 * F.rows, 2 * F.columns);
2075
- return B = B.setSubMatrix(F, 0, 0), B = B.setSubMatrix(H, F.rows, 0), B = B.setSubMatrix(L, 0, F.columns), B = B.setSubMatrix(z, F.rows, F.columns), B.subMatrix(0, w - 1, 0, g - 1);
2074
+ let B = j.zeros(2 * _.rows, 2 * _.columns);
2075
+ return B = B.setSubMatrix(_, 0, 0), B = B.setSubMatrix(H, _.rows, 0), B = B.setSubMatrix(L, 0, _.columns), B = B.setSubMatrix(z, _.rows, _.columns), B.subMatrix(0, w - 1, 0, g - 1);
2076
2076
  }
2077
2077
  return c(e, t, h, l);
2078
2078
  }
@@ -2299,7 +2299,7 @@ class j {
2299
2299
  case void 0: {
2300
2300
  if (typeof s != "number")
2301
2301
  throw new TypeError("mean must be a number");
2302
- return Fs(this, n, s);
2302
+ return _s(this, n, s);
2303
2303
  }
2304
2304
  default:
2305
2305
  throw new Error(`invalid option: ${t}`);
@@ -2322,7 +2322,7 @@ class j {
2322
2322
  case "row": {
2323
2323
  if (!ct.isAnyArray(n))
2324
2324
  throw new TypeError("center must be an array");
2325
- return _s(this, n), this;
2325
+ return Fs(this, n), this;
2326
2326
  }
2327
2327
  case "column": {
2328
2328
  if (!ct.isAnyArray(n))
@@ -2413,7 +2413,7 @@ j.prototype.tensorProduct = j.prototype.kroneckerProduct;
2413
2413
  var de, ze, Pe;
2414
2414
  let E = (Pe = class extends j {
2415
2415
  constructor(i, t) {
2416
- if (super(), wi(this, de), _(this, "data"), Pe.isMatrix(i))
2416
+ if (super(), wi(this, de), F(this, "data"), Pe.isMatrix(i))
2417
2417
  Pn(this, de, ze).call(this, i.rows, i.columns), Pe.copy(i, this);
2418
2418
  else if (Number.isInteger(i) && i >= 0)
2419
2419
  Pn(this, de, ze).call(this, i, t);
@@ -2876,7 +2876,7 @@ function Ks(i, t) {
2876
2876
  return i[0] && ct.isAnyArray(i[0]) ? new mt(i) : new Si(i, t);
2877
2877
  throw new Error("the argument is not an array");
2878
2878
  }
2879
- let _e = class {
2879
+ let Fe = class {
2880
2880
  constructor(t) {
2881
2881
  t = mt.checkMatrix(t);
2882
2882
  let e = t.clone(), n = e.rows, s = e.columns, r = new Float64Array(n), o = 1, a, h, l, c, u, m, w, g, p;
@@ -3188,10 +3188,10 @@ let an = class {
3188
3188
  let A = f[v - 2];
3189
3189
  f[v - 2] = 0;
3190
3190
  for (let y = v - 2; y >= d; y--) {
3191
- let T = bt(g[y], A), $ = g[y] / T, F = A / T;
3192
- if (g[y] = T, y !== d && (A = -F * f[y - 1], f[y - 1] = $ * f[y - 1]), l)
3191
+ let T = bt(g[y], A), $ = g[y] / T, _ = A / T;
3192
+ if (g[y] = T, y !== d && (A = -_ * f[y - 1], f[y - 1] = $ * f[y - 1]), l)
3193
3193
  for (let H = 0; H < s; H++)
3194
- T = $ * M.get(H, y) + F * M.get(H, v - 1), M.set(H, v - 1, -F * M.get(H, y) + $ * M.get(H, v - 1)), M.set(H, y, T);
3194
+ T = $ * M.get(H, y) + _ * M.get(H, v - 1), M.set(H, v - 1, -_ * M.get(H, y) + $ * M.get(H, v - 1)), M.set(H, y, T);
3195
3195
  }
3196
3196
  break;
3197
3197
  }
@@ -3199,10 +3199,10 @@ let an = class {
3199
3199
  let A = f[d - 1];
3200
3200
  f[d - 1] = 0;
3201
3201
  for (let y = d; y < v; y++) {
3202
- let T = bt(g[y], A), $ = g[y] / T, F = A / T;
3203
- if (g[y] = T, A = -F * f[y], f[y] = $ * f[y], h)
3202
+ let T = bt(g[y], A), $ = g[y] / T, _ = A / T;
3203
+ if (g[y] = T, A = -_ * f[y], f[y] = $ * f[y], h)
3204
3204
  for (let H = 0; H < n; H++)
3205
- T = $ * p.get(H, y) + F * p.get(H, d - 1), p.set(H, d - 1, -F * p.get(H, y) + $ * p.get(H, d - 1)), p.set(H, y, T);
3205
+ T = $ * p.get(H, y) + _ * p.get(H, d - 1), p.set(H, d - 1, -_ * p.get(H, y) + $ * p.get(H, d - 1)), p.set(H, y, T);
3206
3206
  }
3207
3207
  break;
3208
3208
  }
@@ -3213,10 +3213,10 @@ let an = class {
3213
3213
  Math.abs(f[v - 2]),
3214
3214
  Math.abs(g[d]),
3215
3215
  Math.abs(f[d])
3216
- ), y = g[v - 1] / A, T = g[v - 2] / A, $ = f[v - 2] / A, F = g[d] / A, H = f[d] / A, L = ((T + y) * (T - y) + $ * $) / 2, z = y * $ * (y * $);
3216
+ ), y = g[v - 1] / A, T = g[v - 2] / A, $ = f[v - 2] / A, _ = g[d] / A, H = f[d] / A, L = ((T + y) * (T - y) + $ * $) / 2, z = y * $ * (y * $);
3217
3217
  let B = 0;
3218
3218
  (L !== 0 || z !== 0) && (L < 0 ? B = 0 - Math.sqrt(L * L + z) : B = Math.sqrt(L * L + z), B = z / (L + B));
3219
- let X = (F + y) * (F - y) + B, Q = F * H;
3219
+ let X = (_ + y) * (_ - y) + B, Q = _ * H;
3220
3220
  for (let R = d; R < v - 1; R++) {
3221
3221
  let Y = bt(X, Q);
3222
3222
  Y === 0 && (Y = Number.MIN_VALUE);
@@ -3320,7 +3320,7 @@ function tr(i, t = !1) {
3320
3320
  return i = mt.checkMatrix(i), t ? new Xt(i).inverse() : ki(i, E.eye(i.rows));
3321
3321
  }
3322
3322
  function ki(i, t, e = !1) {
3323
- return i = mt.checkMatrix(i), t = mt.checkMatrix(t), e ? new Xt(i).solve(t) : i.isSquare() ? new _e(i).solve(t) : new an(i).solve(t);
3323
+ return i = mt.checkMatrix(i), t = mt.checkMatrix(t), e ? new Xt(i).solve(t) : i.isSquare() ? new Fe(i).solve(t) : new an(i).solve(t);
3324
3324
  }
3325
3325
  function Ae(i) {
3326
3326
  if (i = E.checkMatrix(i), i.isSquare()) {
@@ -3333,7 +3333,7 @@ function Ae(i) {
3333
3333
  let r, o, a;
3334
3334
  return r = new ve(i, [1, 2], [1, 2]), o = new ve(i, [1, 2], [0, 2]), a = new ve(i, [1, 2], [0, 1]), t = i.get(0, 0), e = i.get(0, 1), n = i.get(0, 2), t * Ae(r) - e * Ae(o) + n * Ae(a);
3335
3335
  } else
3336
- return new _e(i).determinant;
3336
+ return new Fe(i).determinant;
3337
3337
  } else
3338
3338
  throw Error("determinant can only be calculated for a square matrix");
3339
3339
  }
@@ -3751,8 +3751,8 @@ N.CholeskyDecomposition = Ri;
3751
3751
  N.DistanceMatrix = Ei;
3752
3752
  N.EVD = Ci;
3753
3753
  var cr = N.EigenvalueDecomposition = Ci;
3754
- N.LU = _e;
3755
- N.LuDecomposition = _e;
3754
+ N.LU = Fe;
3755
+ N.LuDecomposition = Fe;
3756
3756
  var fr = N.Matrix = E;
3757
3757
  N.MatrixColumnSelectionView = Xs;
3758
3758
  N.MatrixColumnView = Ys;
@@ -3882,44 +3882,44 @@ function wr(i, t, e, n, s) {
3882
3882
  (L == 0 || Y < d) && (S = z, O = B, d = Y);
3883
3883
  }
3884
3884
  const x = S, A = O;
3885
- let y = 0, T = 0, $ = 0, F = 0;
3885
+ let y = 0, T = 0, $ = 0, _ = 0;
3886
3886
  if (x < 0) {
3887
3887
  const L = Math.sqrt(-x);
3888
- if (y = f + L, T = P + L * A, $ = f - L, F = P - L * A, Math.abs(F) < Math.abs(T) ? F = n / T : Math.abs(F) > Math.abs(T) && (T = n / F), Math.abs(y) != Math.abs($)) {
3888
+ if (y = f + L, T = P + L * A, $ = f - L, _ = P - L * A, Math.abs(_) < Math.abs(T) ? _ = n / T : Math.abs(_) > Math.abs(T) && (T = n / _), Math.abs(y) != Math.abs($)) {
3889
3889
  let z = null, B = null;
3890
3890
  if (Math.abs(y) < Math.abs($)) {
3891
- const Q = (e - T * $) / F, R = (t - F - T) / $;
3891
+ const Q = (e - T * $) / _, R = (t - _ - T) / $;
3892
3892
  z = [i - $, Q, R], B = [$, $, $];
3893
3893
  } else {
3894
- const Q = (e - y * F) / T, R = (t - F - T) / y, Y = i - y;
3894
+ const Q = (e - y * _) / T, R = (t - _ - T) / y, Y = i - y;
3895
3895
  z = [y, y, y], B = [Y, Q, R];
3896
3896
  }
3897
3897
  let X = 0;
3898
3898
  for (let Q = 0; Q < 3; Q++) {
3899
3899
  const R = z[Q], Y = B[Q];
3900
3900
  if (isFinite(R) && isFinite(Y)) {
3901
- const tt = r(R, T, Y, F);
3901
+ const tt = r(R, T, Y, _);
3902
3902
  (Q == 0 || tt < X) && (y = R, $ = Y, X = tt);
3903
3903
  }
3904
3904
  }
3905
3905
  }
3906
3906
  } else if (x == 0) {
3907
3907
  const L = n - P * P;
3908
- y = f, T = P + Math.sqrt(-L), $ = f, F = P - Math.sqrt(-L), Math.abs(T) > Math.abs(F) ? F = n / T : Math.abs(F) > Math.abs(T) && (T = n / F);
3908
+ y = f, T = P + Math.sqrt(-L), $ = f, _ = P - Math.sqrt(-L), Math.abs(T) > Math.abs(_) ? _ = n / T : Math.abs(_) > Math.abs(T) && (T = n / _);
3909
3909
  } else
3910
3910
  return [];
3911
- let H = o(y, T, $, F);
3911
+ let H = o(y, T, $, _);
3912
3912
  for (let L = 0; L < 8 && H != 0; L++) {
3913
- const z = T * F - n, B = T * $ + y * F - e, X = T + y * $ + F - t, Q = y + $ - i, R = y - $, Y = T * T - T * ($ * R + 2 * F) + F * (y * R + F);
3913
+ const z = T * _ - n, B = T * $ + y * _ - e, X = T + y * $ + _ - t, Q = y + $ - i, R = y - $, Y = T * T - T * ($ * R + 2 * _) + _ * (y * R + _);
3914
3914
  if (Y == 0)
3915
3915
  break;
3916
- const tt = 1 / Y, K = F - T, J = T * $ - y * F, Be = R * z + K * B + J * X - (T * K + y * J) * Q, Ve = (y * R + K) * z - T * (R * B + K * X + J * Q), je = -R * z - K * B - J * X + ($ * J + F * K) * Q, Oe = -($ * R + K) * z + F * (R * B + K * X + J * Q), ae = y - tt * Be, he = T - tt * Ve, le = $ - tt * je, ue = F - tt * Oe, ce = o(ae, he, le, ue);
3916
+ const tt = 1 / Y, K = _ - T, J = T * $ - y * _, Be = R * z + K * B + J * X - (T * K + y * J) * Q, Ve = (y * R + K) * z - T * (R * B + K * X + J * Q), je = -R * z - K * B - J * X + ($ * J + _ * K) * Q, Oe = -($ * R + K) * z + _ * (R * B + K * X + J * Q), ae = y - tt * Be, he = T - tt * Ve, le = $ - tt * je, ue = _ - tt * Oe, ce = o(ae, he, le, ue);
3917
3917
  if (ce < H)
3918
- y = ae, T = he, $ = le, F = ue, H = ce;
3918
+ y = ae, T = he, $ = le, _ = ue, H = ce;
3919
3919
  else
3920
3920
  break;
3921
3921
  }
3922
- return [y, T, $, F];
3922
+ return [y, T, $, _];
3923
3923
  }
3924
3924
  function dr(i, t) {
3925
3925
  const e = -0.3333333333333333 * i, n = 0.5 * t;
@@ -3983,7 +3983,7 @@ function ln(i, t) {
3983
3983
  const $n = Symbol.for("pantograph:CubicBezier");
3984
3984
  let st = class zt extends oe {
3985
3985
  constructor(t, e, n, s) {
3986
- super(t, e), _(this, "segmentType", "CUBIC_BEZIER"), _(this, "firstControlPoint"), _(this, "lastControlPoint"), _(this, "_boundingBox", null), _(this, "_polynomialCoefficients", null), Object.defineProperty(this, $n, { value: !0 }), this.firstControlPoint = n, this.lastControlPoint = s;
3986
+ super(t, e), F(this, "segmentType", "CUBIC_BEZIER"), F(this, "firstControlPoint"), F(this, "lastControlPoint"), F(this, "_boundingBox", null), F(this, "_polynomialCoefficients", null), Object.defineProperty(this, $n, { value: !0 }), this.firstControlPoint = n, this.lastControlPoint = s;
3987
3987
  }
3988
3988
  static isInstance(t) {
3989
3989
  return !!t && t[$n] === !0;
@@ -4186,13 +4186,13 @@ let st = class zt extends oe {
4186
4186
  return s;
4187
4187
  }
4188
4188
  };
4189
- const Fn = Symbol.for("pantograph:EllipseArc");
4189
+ const _n = Symbol.for("pantograph:EllipseArc");
4190
4190
  let ot = class Qt extends oe {
4191
4191
  constructor(t, e, n, s, r, o, a = !1, {
4192
4192
  ignoreChecks: h = !1,
4193
4193
  angleUnits: l = "deg"
4194
4194
  } = {}) {
4195
- super(t, e), _(this, "segmentType", "ELLIPSE_ARC"), _(this, "precision", 1e-6), _(this, "majorRadius"), _(this, "minorRadius"), _(this, "center"), _(this, "tiltAngle"), _(this, "clockwise"), _(this, "_coefficients", null), _(this, "_boundingBox"), _(this, "_linearExentricity"), _(this, "_exentricity"), _(this, "_focals"), _(this, "_ellipseReferenceFrameTransform"), _(this, "_reverseEllipseReferenceFrameTransform"), _(this, "_rotateFromEllipseReferenceFrame"), _(this, "_firstAngle"), _(this, "_lastAngle"), _(this, "_deltaAngle"), Object.defineProperty(this, Fn, { value: !0 }), this.center = n;
4195
+ super(t, e), F(this, "segmentType", "ELLIPSE_ARC"), F(this, "precision", 1e-6), F(this, "majorRadius"), F(this, "minorRadius"), F(this, "center"), F(this, "tiltAngle"), F(this, "clockwise"), F(this, "_coefficients", null), F(this, "_boundingBox"), F(this, "_linearExentricity"), F(this, "_exentricity"), F(this, "_focals"), F(this, "_ellipseReferenceFrameTransform"), F(this, "_reverseEllipseReferenceFrameTransform"), F(this, "_rotateFromEllipseReferenceFrame"), F(this, "_firstAngle"), F(this, "_lastAngle"), F(this, "_deltaAngle"), Object.defineProperty(this, _n, { value: !0 }), this.center = n;
4196
4196
  const c = s >= r;
4197
4197
  this.majorRadius = c ? s : r, this.minorRadius = c ? r : s;
4198
4198
  const u = l === "deg" ? o * Tt : o;
@@ -4218,7 +4218,7 @@ let ot = class Qt extends oe {
4218
4218
  }
4219
4219
  }
4220
4220
  static isInstance(t) {
4221
- return !!t && t[Fn] === !0;
4221
+ return !!t && t[_n] === !0;
4222
4222
  }
4223
4223
  get coefficients() {
4224
4224
  if (this._coefficients === null) {
@@ -4496,13 +4496,13 @@ function xr(i, t, e) {
4496
4496
  }
4497
4497
  return [a * r * Math.sign(e[0]), h * o * Math.sign(e[1])];
4498
4498
  }
4499
- const _n = Symbol.for("pantograph:QuadraticBezier");
4499
+ const Fn = Symbol.for("pantograph:QuadraticBezier");
4500
4500
  let et = class Nt extends oe {
4501
4501
  constructor(t, e, n) {
4502
- super(t, e), _(this, "segmentType", "QUADRATIC_BEZIER"), _(this, "controlPoint"), _(this, "_boundingBox", null), _(this, "_polynomialCoefficients", null), Object.defineProperty(this, _n, { value: !0 }), this.controlPoint = n;
4502
+ super(t, e), F(this, "segmentType", "QUADRATIC_BEZIER"), F(this, "controlPoint"), F(this, "_boundingBox", null), F(this, "_polynomialCoefficients", null), Object.defineProperty(this, Fn, { value: !0 }), this.controlPoint = n;
4503
4503
  }
4504
4504
  static isInstance(t) {
4505
- return !!t && t[_n] === !0;
4505
+ return !!t && t[Fn] === !0;
4506
4506
  }
4507
4507
  get midPoint() {
4508
4508
  return this.paramPoint(0.5);
@@ -4746,7 +4746,7 @@ const Ir = (i) => {
4746
4746
  ];
4747
4747
  throw new Error("Bug in the arc arc overlap algorithm");
4748
4748
  };
4749
- function Fi(i, t, e = !1, n) {
4749
+ function _i(i, t, e = !1, n) {
4750
4750
  const s = n || i.precision, r = Z(i.center, t.center), o = i.radius + t.radius;
4751
4751
  if (r > o + s)
4752
4752
  return [];
@@ -4804,7 +4804,7 @@ function We(i, t, e = 1e-9) {
4804
4804
  ];
4805
4805
  return u([p, M]);
4806
4806
  }
4807
- function _i(i, t) {
4807
+ function Fi(i, t) {
4808
4808
  const e = Math.max(i.precision, t.precision), n = i.coefficients, s = n.x2, r = n.xy, o = n.y2, a = n.x, h = n.y, l = n.c, c = t.coefficients, u = c.x2, m = c.xy, w = c.y2, g = c.x, p = c.y, M = c.c, f = {
4809
4809
  z0: l * s * g * g + s * s * M * M - a * s * g * M + u * u * l * l - 2 * s * M * u * l - a * g * u * l + u * a * a * M,
4810
4810
  z1: p * a * a * u - M * g * s * r - 2 * s * M * u * h - l * u * m * a + 2 * g * m * s * l + 2 * p * M * s * s + g * g * s * h - p * g * s * a - 2 * s * p * u * l - l * u * g * r + 2 * l * h * u * u - M * m * s * a - h * u * g * a + 2 * M * r * u * a,
@@ -4830,7 +4830,7 @@ function _i(i, t) {
4830
4830
  return vt(P, e);
4831
4831
  }
4832
4832
  function Ln(i, t) {
4833
- return _i(i, t).filter((e) => i.isOnSegment(e) && t.isOnSegment(e));
4833
+ return Fi(i, t).filter((e) => i.isOnSegment(e) && t.isOnSegment(e));
4834
4834
  }
4835
4835
  const kr = (i) => {
4836
4836
  const {
@@ -4890,7 +4890,7 @@ const kr = (i) => {
4890
4890
  };
4891
4891
  function Rr(i, t, e = !1) {
4892
4892
  const n = Math.max(i.precision, t.precision);
4893
- return k(i.center, t.center) && Math.abs(i.majorRadius - t.majorRadius) < n && Math.abs(i.minorRadius - t.minorRadius) < n && (Math.abs(i.tiltAngle - t.tiltAngle) < n || Math.abs(Math.abs(i.tiltAngle - t.tiltAngle) - Math.PI) < n) ? e ? Cr(i, t) : [] : _i(i, t).filter((s) => i.isOnSegment(s) && t.isOnSegment(s));
4893
+ return k(i.center, t.center) && Math.abs(i.majorRadius - t.majorRadius) < n && Math.abs(i.minorRadius - t.minorRadius) < n && (Math.abs(i.tiltAngle - t.tiltAngle) < n || Math.abs(Math.abs(i.tiltAngle - t.tiltAngle) - Math.PI) < n) ? e ? Cr(i, t) : [] : Fi(i, t).filter((s) => i.isOnSegment(s) && t.isOnSegment(s));
4894
4894
  }
4895
4895
  function Bn(i, t) {
4896
4896
  const [e, n] = i.firstPoint, [s, r] = i.lastPoint, o = new ut().translate(-e, -n).rotate(-Math.atan2(r - n, s - e)), a = o.clone().inverse(), h = t.transform(o);
@@ -4913,12 +4913,12 @@ function Vn(i, t) {
4913
4913
  const e = Math.max(i.precision, t.precision), n = $r(i, t), s = hn(n, e).filter((r) => r >= -t.precision && r <= 1 + t.precision);
4914
4914
  return Li(s, e).map((r) => t.paramPoint(r)).filter((r) => i.isOnSegment(r));
4915
4915
  }
4916
- const Fr = (i, t) => {
4916
+ const _r = (i, t) => {
4917
4917
  const [[e, n, s], [r, o, a]] = t.polynomialCoefficients, h = i.coefficients, l = h.x2, c = h.xy, u = h.y2, m = h.x, w = h.y, g = h.c, p = e * e, M = n * n, f = s * s, P = r * r, b = o * o, I = a * a, C = l * p + c * e * r + u * P + m * e + w * r + g, V = 2 * l * e * n + c * e * o + c * n * r + 2 * u * r * o + m * n + w * o, v = 2 * l * e * s + l * M + c * e * a + c * n * o + c * s * r + 2 * u * r * a + u * b + m * s + w * a, S = 2 * l * n * s + c * n * a + c * s * o + 2 * u * o * a, O = l * f + c * s * a + u * I;
4918
4918
  return [C, V, v, S, O];
4919
4919
  };
4920
4920
  function jn(i, t) {
4921
- const e = Math.max(i.precision, t.precision), n = Fr(i, t), s = pr(...n).filter((r) => r >= -t.precision && r <= 1 + t.precision);
4921
+ const e = Math.max(i.precision, t.precision), n = _r(i, t), s = pr(...n).filter((r) => r >= -t.precision && r <= 1 + t.precision);
4922
4922
  return Li(s, e).map((r) => t.paramPoint(r)).filter((r) => i.isOnSegment(r));
4923
4923
  }
4924
4924
  function ht(i, { firstPoint: t, lastPoint: e }, n = 1e-9) {
@@ -4933,9 +4933,9 @@ let un = class {
4933
4933
  return this.positiveThickness - this.negativeThickness;
4934
4934
  }
4935
4935
  };
4936
- const _r = 3 / 4, Lr = 4 / 9;
4936
+ const Fr = 3 / 4, Lr = 4 / 9;
4937
4937
  function Br(i) {
4938
- const t = ht(i.firstControlPoint, i), e = ht(i.lastControlPoint, i), n = t * e > 0 ? _r : Lr;
4938
+ const t = ht(i.firstControlPoint, i), e = ht(i.lastControlPoint, i), n = t * e > 0 ? Fr : Lr;
4939
4939
  return new un(
4940
4940
  i.firstPoint,
4941
4941
  i.lastPoint,
@@ -5207,7 +5207,7 @@ function Wr(i, t, e) {
5207
5207
  if (D.isInstance(i) && U.isInstance(t))
5208
5208
  return ke(t, i, e);
5209
5209
  if (D.isInstance(i) && D.isInstance(t))
5210
- return Fi(i, t, !1, e);
5210
+ return _i(i, t, !1, e);
5211
5211
  throw new Error("Not implemented");
5212
5212
  }
5213
5213
  function ie(i, t, e) {
@@ -5231,7 +5231,7 @@ function ie(i, t, e) {
5231
5231
  return { intersections: n, overlaps: [], count: n.length };
5232
5232
  }
5233
5233
  if (D.isInstance(i) && D.isInstance(t)) {
5234
- const n = Fi(
5234
+ const n = _i(
5235
5235
  i,
5236
5236
  t,
5237
5237
  !0,
@@ -5358,7 +5358,7 @@ function* He(i) {
5358
5358
  for (const [t, e] of Bi(i.length))
5359
5359
  t !== e && (yield [i[t], i[e]]);
5360
5360
  }
5361
- class Vi extends Ft {
5361
+ class Vi extends _t {
5362
5362
  constructor(t, { ignoreChecks: e = !1 } = {}) {
5363
5363
  super(), lt(this, "segments"), lt(this, "_boundingBox", null), e || ji(t), this.segments = t;
5364
5364
  }
@@ -5595,7 +5595,7 @@ function Kr(i, t) {
5595
5595
  throw new Error("Not implemented");
5596
5596
  }
5597
5597
  const Yn = Symbol.for("pantograph:Loop");
5598
- let _t = class Gt extends Vi {
5598
+ let Ft = class Gt extends Vi {
5599
5599
  constructor(t, { ignoreChecks: e = !1 } = {}) {
5600
5600
  super(t, { ignoreChecks: !0 }), lt(this, "strokeType", "LOOP"), lt(this, "_clockwise", null), Object.defineProperty(this, Yn, { value: !0 }), e || to(t);
5601
5601
  }
@@ -5717,7 +5717,7 @@ function Xn(i) {
5717
5717
  return no(i);
5718
5718
  if (ft.isInstance(i))
5719
5719
  return Ni(i);
5720
- if (_t.isInstance(i))
5720
+ if (Ft.isInstance(i))
5721
5721
  return Qe(i);
5722
5722
  if (qi(i))
5723
5723
  return zi(i);
@@ -5987,7 +5987,7 @@ function Di(i, t = 1e-7) {
5987
5987
  }), n;
5988
5988
  }
5989
5989
  const Gn = Symbol.for("pantograph:Figure");
5990
- let ft = class Ee extends Ft {
5990
+ let ft = class Ee extends _t {
5991
5991
  constructor(t, e = [], { ignoreChecks: n = !1 } = {}) {
5992
5992
  super(), lt(this, "contour"), lt(this, "holes"), Object.defineProperty(this, Gn, { value: !0 }), n || oo(t, e), this.contour = t, this.holes = e;
5993
5993
  }
@@ -6217,7 +6217,7 @@ function Kn(i) {
6217
6217
  it(t.firstPoint),
6218
6218
  it(t.lastPoint)
6219
6219
  ), new Error("Bug in the intersection algo on non closing strand");
6220
- return new _t(t.segments);
6220
+ return new Ft(t.segments);
6221
6221
  }
6222
6222
  function wo(i, t) {
6223
6223
  const e = dt([
@@ -6240,7 +6240,7 @@ function Po(i) {
6240
6240
  try {
6241
6241
  return wo(i, n);
6242
6242
  } catch {
6243
- return Di(i.flatMap((s) => s.segments)).filter((s) => s.length > 1).filter((s) => k(s[0].firstPoint, s.at(-1).lastPoint)).map((s) => new _t(s));
6243
+ return Di(i.flatMap((s) => s.segments)).filter((s) => s.length > 1).filter((s) => k(s[0].firstPoint, s.at(-1).lastPoint)).map((s) => new Ft(s));
6244
6244
  }
6245
6245
  }
6246
6246
  const ti = (i, t) => {
@@ -6418,7 +6418,7 @@ function Ze(i, t) {
6418
6418
  return !i.length || !t.length ? [] : i.length === 1 && t.length === 1 ? xo(i[0], t[0]) : i.length > 1 ? i.flatMap((e) => Ze([e], t)) : t.flatMap((e) => Ze(i, [e]));
6419
6419
  }
6420
6420
  const ei = Symbol.for("pantograph:Diagram");
6421
- class wt extends Ft {
6421
+ class wt extends _t {
6422
6422
  constructor(t = [], { ignoreChecks: e = !1 } = {}) {
6423
6423
  super(), lt(this, "figures"), lt(this, "_boundingBox", null), Object.defineProperty(this, ei, { value: !0 }), e || vo(t), this.figures = t;
6424
6424
  }
@@ -6653,7 +6653,7 @@ const Co = (i) => {
6653
6653
  return typeof r == "number" ? a = xt(1, r * Tt) : a = r, { endTangent: o, startFactor: n, endFactor: s, startTangent: a };
6654
6654
  };
6655
6655
  function oi(i, { ignoreChecks: t = !1 } = {}) {
6656
- return new wt([new ft(new _t([...i], { ignoreChecks: t }))]);
6656
+ return new wt([new ft(new Ft([...i], { ignoreChecks: t }))]);
6657
6657
  }
6658
6658
  class Ro {
6659
6659
  constructor(t = [0, 0]) {
@@ -6922,12 +6922,12 @@ function $o(i) {
6922
6922
  const t = `M ${i.firstPoint.join(" ")}`, e = i.segments.map(wn).join(" ");
6923
6923
  return `${t} ${e}`;
6924
6924
  }
6925
- function Fo(i, t = 1) {
6925
+ function _o(i, t = 1) {
6926
6926
  const e = i.xMin - t, n = i.yMin - t;
6927
6927
  return `${e} ${n} ${i.width + 2 * t} ${i.height + 2 * t}`;
6928
6928
  }
6929
6929
  function ai(i, t, e = 1, n) {
6930
- const s = Fo(t, e), r = n ? `width="${t.width + 2 * e}${n}" height="${t.height + 2 * e}${n}"` : "";
6930
+ const s = _o(t, e), r = n ? `width="${t.width + 2 * e}${n}" height="${t.height + 2 * e}${n}"` : "";
6931
6931
  return `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
6932
6932
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="${s}" fill="none" stroke="grey" stroke-width="0.2%" vector-effect="non-scaling-stroke" ${r}>
6933
6933
  ${i}
@@ -6936,7 +6936,7 @@ function ai(i, t, e = 1, n) {
6936
6936
  function hi(i) {
6937
6937
  if (ft.isInstance(i))
6938
6938
  return [i];
6939
- if (_t.isInstance(i))
6939
+ if (Ft.isInstance(i))
6940
6940
  return [new ft(i)];
6941
6941
  if (wt.isInstance(i))
6942
6942
  return i.figures;
@@ -6975,7 +6975,7 @@ function Zi(i, t, e = !1) {
6975
6975
  return t.onStroke(s) ? !e : !t.contains(s);
6976
6976
  });
6977
6977
  }
6978
- function _o(i, t, e = !1) {
6978
+ function Fo(i, t, e = !1) {
6979
6979
  return Ji(t, i).filter((n) => {
6980
6980
  const s = n.segments[0].midPoint;
6981
6981
  return t.onStroke(s) ? !e : t.contains(s);
@@ -6987,7 +6987,7 @@ function li(i, t, e = !1) {
6987
6987
  t.contour,
6988
6988
  e
6989
6989
  ), s = t.holes.flatMap(
6990
- (r) => _o(i, r, e)
6990
+ (r) => Fo(i, r, e)
6991
6991
  );
6992
6992
  return [...n, ...s];
6993
6993
  }
@@ -6997,7 +6997,7 @@ function Lo(i, t) {
6997
6997
  );
6998
6998
  }
6999
6999
  function Ue(i, t, e = !0) {
7000
- if (_t.isInstance(t))
7000
+ if (Ft.isInstance(t))
7001
7001
  return Zi(i, t, e);
7002
7002
  if (ft.isInstance(t))
7003
7003
  return li(i, t, e);
@@ -7011,7 +7011,7 @@ function ui(i) {
7011
7011
  return To(i);
7012
7012
  if (ft.isInstance(i))
7013
7013
  return Gi(i);
7014
- if (_t.isInstance(i))
7014
+ if (Ft.isInstance(i))
7015
7015
  return `<path d="${Qi(i)}" />`;
7016
7016
  if (St.isInstance(i))
7017
7017
  return `<path d="${$o(i)}" />`;
@@ -7044,7 +7044,7 @@ function Bo(i, {
7044
7044
  e
7045
7045
  );
7046
7046
  }
7047
- class Jt extends Ft {
7047
+ class Jt extends _t {
7048
7048
  constructor(e, {
7049
7049
  cutLines: n = [],
7050
7050
  foldLines: s = [],
@@ -7156,7 +7156,7 @@ const Go = {
7156
7156
  top: Vo,
7157
7157
  bottom: jo
7158
7158
  }, gi = (i, t) => Hi([-i / 2, 0]).line(t, -t).hLine(i - 2 * t).line(t, t);
7159
- class Ke extends Ft {
7159
+ class Ke extends _t {
7160
7160
  constructor(e, n = 0.2) {
7161
7161
  super();
7162
7162
  Et(this, "cut");
@@ -7186,7 +7186,7 @@ class Ke extends Ft {
7186
7186
  e.fuseBody(this.bump);
7187
7187
  }
7188
7188
  }
7189
- class Le extends Ft {
7189
+ class Le extends _t {
7190
7190
  constructor(t) {
7191
7191
  super(), this.points = t, this.points = t;
7192
7192
  }