@maplat/tin 1.1.2-rc.1 → 1.1.2-rc.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.
@@ -2,7 +2,7 @@ function oe(e, t, n = {}) {
2
2
  const i = { type: "Feature" };
3
3
  return (n.id === 0 || n.id) && (i.id = n.id), n.bbox && (i.bbox = n.bbox), i.properties = t || {}, i.geometry = e, i;
4
4
  }
5
- function Rt(e, t, n = {}) {
5
+ function Yt(e, t, n = {}) {
6
6
  if (!e)
7
7
  throw new Error("coordinates is required");
8
8
  if (!Array.isArray(e))
@@ -66,7 +66,7 @@ function si(e) {
66
66
  }
67
67
  function ze(e, t, n) {
68
68
  if (e !== null)
69
- for (var i, o, r, s, a, l, f, h = 0, c = 0, u, d = e.type, _ = d === "FeatureCollection", w = d === "Feature", O = _ ? e.features.length : 1, M = 0; M < O; M++) {
69
+ for (var i, o, r, s, a, c, f, h = 0, l = 0, u, p = e.type, _ = p === "FeatureCollection", w = p === "Feature", O = _ ? e.features.length : 1, M = 0; M < O; M++) {
70
70
  f = _ ? (
71
71
  // @ts-expect-error: Known type conflict
72
72
  e.features[M].geometry
@@ -75,9 +75,9 @@ function ze(e, t, n) {
75
75
  e.geometry
76
76
  ) : e, u = f ? f.type === "GeometryCollection" : !1, a = u ? f.geometries.length : 1;
77
77
  for (var m = 0; m < a; m++) {
78
- var v = 0, p = 0;
78
+ var v = 0, d = 0;
79
79
  if (s = u ? f.geometries[m] : f, s !== null) {
80
- l = s.coordinates;
80
+ c = s.coordinates;
81
81
  var b = s.type;
82
82
  switch (h = n && (b === "Polygon" || b === "MultiPolygon") ? 1 : 0, b) {
83
83
  case null:
@@ -86,73 +86,73 @@ function ze(e, t, n) {
86
86
  if (
87
87
  // @ts-expect-error: Known type conflict
88
88
  t(
89
- l,
90
89
  c,
90
+ l,
91
91
  M,
92
92
  v,
93
- p
93
+ d
94
94
  ) === !1
95
95
  )
96
96
  return !1;
97
- c++, v++;
97
+ l++, v++;
98
98
  break;
99
99
  case "LineString":
100
100
  case "MultiPoint":
101
- for (i = 0; i < l.length; i++) {
101
+ for (i = 0; i < c.length; i++) {
102
102
  if (
103
103
  // @ts-expect-error: Known type conflict
104
104
  t(
105
- l[i],
106
- c,
105
+ c[i],
106
+ l,
107
107
  M,
108
108
  v,
109
- p
109
+ d
110
110
  ) === !1
111
111
  )
112
112
  return !1;
113
- c++, b === "MultiPoint" && v++;
113
+ l++, b === "MultiPoint" && v++;
114
114
  }
115
115
  b === "LineString" && v++;
116
116
  break;
117
117
  case "Polygon":
118
118
  case "MultiLineString":
119
- for (i = 0; i < l.length; i++) {
120
- for (o = 0; o < l[i].length - h; o++) {
119
+ for (i = 0; i < c.length; i++) {
120
+ for (o = 0; o < c[i].length - h; o++) {
121
121
  if (
122
122
  // @ts-expect-error: Known type conflict
123
123
  t(
124
- l[i][o],
125
- c,
124
+ c[i][o],
125
+ l,
126
126
  M,
127
127
  v,
128
- p
128
+ d
129
129
  ) === !1
130
130
  )
131
131
  return !1;
132
- c++;
132
+ l++;
133
133
  }
134
- b === "MultiLineString" && v++, b === "Polygon" && p++;
134
+ b === "MultiLineString" && v++, b === "Polygon" && d++;
135
135
  }
136
136
  b === "Polygon" && v++;
137
137
  break;
138
138
  case "MultiPolygon":
139
- for (i = 0; i < l.length; i++) {
140
- for (p = 0, o = 0; o < l[i].length; o++) {
141
- for (r = 0; r < l[i][o].length - h; r++) {
139
+ for (i = 0; i < c.length; i++) {
140
+ for (d = 0, o = 0; o < c[i].length; o++) {
141
+ for (r = 0; r < c[i][o].length - h; r++) {
142
142
  if (
143
143
  // @ts-expect-error: Known type conflict
144
144
  t(
145
- l[i][o][r],
146
- c,
145
+ c[i][o][r],
146
+ l,
147
147
  M,
148
148
  v,
149
- p
149
+ d
150
150
  ) === !1
151
151
  )
152
152
  return !1;
153
- c++;
153
+ l++;
154
154
  }
155
- p++;
155
+ d++;
156
156
  }
157
157
  v++;
158
158
  }
@@ -174,30 +174,30 @@ function ze(e, t, n) {
174
174
  }
175
175
  const pt = 11102230246251565e-32, q = 134217729, Ln = (3 + 8 * pt) * pt;
176
176
  function ht(e, t, n, i, o) {
177
- let r, s, a, l, f = t[0], h = i[0], c = 0, u = 0;
178
- h > f == h > -f ? (r = f, f = t[++c]) : (r = h, h = i[++u]);
179
- let d = 0;
180
- if (c < e && u < n)
181
- for (h > f == h > -f ? (s = f + r, a = r - (s - f), f = t[++c]) : (s = h + r, a = r - (s - h), h = i[++u]), r = s, a !== 0 && (o[d++] = a); c < e && u < n; )
182
- h > f == h > -f ? (s = r + f, l = s - r, a = r - (s - l) + (f - l), f = t[++c]) : (s = r + h, l = s - r, a = r - (s - l) + (h - l), h = i[++u]), r = s, a !== 0 && (o[d++] = a);
183
- for (; c < e; )
184
- s = r + f, l = s - r, a = r - (s - l) + (f - l), f = t[++c], r = s, a !== 0 && (o[d++] = a);
177
+ let r, s, a, c, f = t[0], h = i[0], l = 0, u = 0;
178
+ h > f == h > -f ? (r = f, f = t[++l]) : (r = h, h = i[++u]);
179
+ let p = 0;
180
+ if (l < e && u < n)
181
+ for (h > f == h > -f ? (s = f + r, a = r - (s - f), f = t[++l]) : (s = h + r, a = r - (s - h), h = i[++u]), r = s, a !== 0 && (o[p++] = a); l < e && u < n; )
182
+ h > f == h > -f ? (s = r + f, c = s - r, a = r - (s - c) + (f - c), f = t[++l]) : (s = r + h, c = s - r, a = r - (s - c) + (h - c), h = i[++u]), r = s, a !== 0 && (o[p++] = a);
183
+ for (; l < e; )
184
+ s = r + f, c = s - r, a = r - (s - c) + (f - c), f = t[++l], r = s, a !== 0 && (o[p++] = a);
185
185
  for (; u < n; )
186
- s = r + h, l = s - r, a = r - (s - l) + (h - l), h = i[++u], r = s, a !== 0 && (o[d++] = a);
187
- return (r !== 0 || d === 0) && (o[d++] = r), d;
186
+ s = r + h, c = s - r, a = r - (s - c) + (h - c), h = i[++u], r = s, a !== 0 && (o[p++] = a);
187
+ return (r !== 0 || p === 0) && (o[p++] = r), p;
188
188
  }
189
189
  function Mt(e, t, n, i, o, r, s, a) {
190
190
  return ht(ht(e, t, n, i, s), s, o, r, a);
191
191
  }
192
- function R(e, t, n, i) {
193
- let o, r, s, a, l, f, h, c, u, d, _;
194
- h = q * n, d = h - (h - n), _ = n - d;
192
+ function Y(e, t, n, i) {
193
+ let o, r, s, a, c, f, h, l, u, p, _;
194
+ h = q * n, p = h - (h - n), _ = n - p;
195
195
  let w = t[0];
196
- o = w * n, h = q * w, c = h - (h - w), u = w - c, s = u * _ - (o - c * d - u * d - c * _);
196
+ o = w * n, h = q * w, l = h - (h - w), u = w - l, s = u * _ - (o - l * p - u * p - l * _);
197
197
  let O = 0;
198
198
  s !== 0 && (i[O++] = s);
199
199
  for (let M = 1; M < e; M++)
200
- w = t[M], a = w * n, h = q * w, c = h - (h - w), u = w - c, l = u * _ - (a - c * d - u * d - c * _), r = o + l, f = r - o, s = o - (r - f) + (l - f), s !== 0 && (i[O++] = s), o = a + r, s = r - (o - a), s !== 0 && (i[O++] = s);
200
+ w = t[M], a = w * n, h = q * w, l = h - (h - w), u = w - l, c = u * _ - (a - l * p - u * p - l * _), r = o + c, f = r - o, s = o - (r - f) + (c - f), s !== 0 && (i[O++] = s), o = a + r, s = r - (o - a), s !== 0 && (i[O++] = s);
201
201
  return (o !== 0 || O === 0) && (i[O++] = o), O;
202
202
  }
203
203
  function Vn(e, t) {
@@ -210,22 +210,22 @@ function tt(e) {
210
210
  }
211
211
  const ai = (3 + 16 * pt) * pt, ci = (2 + 12 * pt) * pt, li = (9 + 64 * pt) * pt * pt, zt = tt(4), Ze = tt(8), tn = tt(12), en = tt(16), mt = tt(4);
212
212
  function fi(e, t, n, i, o, r, s) {
213
- let a, l, f, h, c, u, d, _, w, O, M, m, v, p, b, g, E, S;
213
+ let a, c, f, h, l, u, p, _, w, O, M, m, v, d, b, g, E, S;
214
214
  const k = e - o, P = n - o, N = t - r, C = i - r;
215
- p = k * C, u = q * k, d = u - (u - k), _ = k - d, u = q * C, w = u - (u - C), O = C - w, b = _ * O - (p - d * w - _ * w - d * O), g = N * P, u = q * N, d = u - (u - N), _ = N - d, u = q * P, w = u - (u - P), O = P - w, E = _ * O - (g - d * w - _ * w - d * O), M = b - E, c = b - M, zt[0] = b - (M + c) + (c - E), m = p + M, c = m - p, v = p - (m - c) + (M - c), M = v - g, c = v - M, zt[1] = v - (M + c) + (c - g), S = m + M, c = S - m, zt[2] = m - (S - c) + (M - c), zt[3] = S;
215
+ d = k * C, u = q * k, p = u - (u - k), _ = k - p, u = q * C, w = u - (u - C), O = C - w, b = _ * O - (d - p * w - _ * w - p * O), g = N * P, u = q * N, p = u - (u - N), _ = N - p, u = q * P, w = u - (u - P), O = P - w, E = _ * O - (g - p * w - _ * w - p * O), M = b - E, l = b - M, zt[0] = b - (M + l) + (l - E), m = d + M, l = m - d, v = d - (m - l) + (M - l), M = v - g, l = v - M, zt[1] = v - (M + l) + (l - g), S = m + M, l = S - m, zt[2] = m - (S - l) + (M - l), zt[3] = S;
216
216
  let F = Vn(4, zt), y = ci * s;
217
- if (F >= y || -F >= y || (c = e - k, a = e - (k + c) + (c - o), c = n - P, f = n - (P + c) + (c - o), c = t - N, l = t - (N + c) + (c - r), c = i - C, h = i - (C + c) + (c - r), a === 0 && l === 0 && f === 0 && h === 0) || (y = li * s + Ln * Math.abs(F), F += k * h + C * a - (N * f + P * l), F >= y || -F >= y)) return F;
218
- p = a * C, u = q * a, d = u - (u - a), _ = a - d, u = q * C, w = u - (u - C), O = C - w, b = _ * O - (p - d * w - _ * w - d * O), g = l * P, u = q * l, d = u - (u - l), _ = l - d, u = q * P, w = u - (u - P), O = P - w, E = _ * O - (g - d * w - _ * w - d * O), M = b - E, c = b - M, mt[0] = b - (M + c) + (c - E), m = p + M, c = m - p, v = p - (m - c) + (M - c), M = v - g, c = v - M, mt[1] = v - (M + c) + (c - g), S = m + M, c = S - m, mt[2] = m - (S - c) + (M - c), mt[3] = S;
217
+ if (F >= y || -F >= y || (l = e - k, a = e - (k + l) + (l - o), l = n - P, f = n - (P + l) + (l - o), l = t - N, c = t - (N + l) + (l - r), l = i - C, h = i - (C + l) + (l - r), a === 0 && c === 0 && f === 0 && h === 0) || (y = li * s + Ln * Math.abs(F), F += k * h + C * a - (N * f + P * c), F >= y || -F >= y)) return F;
218
+ d = a * C, u = q * a, p = u - (u - a), _ = a - p, u = q * C, w = u - (u - C), O = C - w, b = _ * O - (d - p * w - _ * w - p * O), g = c * P, u = q * c, p = u - (u - c), _ = c - p, u = q * P, w = u - (u - P), O = P - w, E = _ * O - (g - p * w - _ * w - p * O), M = b - E, l = b - M, mt[0] = b - (M + l) + (l - E), m = d + M, l = m - d, v = d - (m - l) + (M - l), M = v - g, l = v - M, mt[1] = v - (M + l) + (l - g), S = m + M, l = S - m, mt[2] = m - (S - l) + (M - l), mt[3] = S;
219
219
  const I = ht(4, zt, 4, mt, Ze);
220
- p = k * h, u = q * k, d = u - (u - k), _ = k - d, u = q * h, w = u - (u - h), O = h - w, b = _ * O - (p - d * w - _ * w - d * O), g = N * f, u = q * N, d = u - (u - N), _ = N - d, u = q * f, w = u - (u - f), O = f - w, E = _ * O - (g - d * w - _ * w - d * O), M = b - E, c = b - M, mt[0] = b - (M + c) + (c - E), m = p + M, c = m - p, v = p - (m - c) + (M - c), M = v - g, c = v - M, mt[1] = v - (M + c) + (c - g), S = m + M, c = S - m, mt[2] = m - (S - c) + (M - c), mt[3] = S;
220
+ d = k * h, u = q * k, p = u - (u - k), _ = k - p, u = q * h, w = u - (u - h), O = h - w, b = _ * O - (d - p * w - _ * w - p * O), g = N * f, u = q * N, p = u - (u - N), _ = N - p, u = q * f, w = u - (u - f), O = f - w, E = _ * O - (g - p * w - _ * w - p * O), M = b - E, l = b - M, mt[0] = b - (M + l) + (l - E), m = d + M, l = m - d, v = d - (m - l) + (M - l), M = v - g, l = v - M, mt[1] = v - (M + l) + (l - g), S = m + M, l = S - m, mt[2] = m - (S - l) + (M - l), mt[3] = S;
221
221
  const A = ht(I, Ze, 4, mt, tn);
222
- p = a * h, u = q * a, d = u - (u - a), _ = a - d, u = q * h, w = u - (u - h), O = h - w, b = _ * O - (p - d * w - _ * w - d * O), g = l * f, u = q * l, d = u - (u - l), _ = l - d, u = q * f, w = u - (u - f), O = f - w, E = _ * O - (g - d * w - _ * w - d * O), M = b - E, c = b - M, mt[0] = b - (M + c) + (c - E), m = p + M, c = m - p, v = p - (m - c) + (M - c), M = v - g, c = v - M, mt[1] = v - (M + c) + (c - g), S = m + M, c = S - m, mt[2] = m - (S - c) + (M - c), mt[3] = S;
222
+ d = a * h, u = q * a, p = u - (u - a), _ = a - p, u = q * h, w = u - (u - h), O = h - w, b = _ * O - (d - p * w - _ * w - p * O), g = c * f, u = q * c, p = u - (u - c), _ = c - p, u = q * f, w = u - (u - f), O = f - w, E = _ * O - (g - p * w - _ * w - p * O), M = b - E, l = b - M, mt[0] = b - (M + l) + (l - E), m = d + M, l = m - d, v = d - (m - l) + (M - l), M = v - g, l = v - M, mt[1] = v - (M + l) + (l - g), S = m + M, l = S - m, mt[2] = m - (S - l) + (M - l), mt[3] = S;
223
223
  const T = ht(A, tn, 4, mt, en);
224
224
  return en[T - 1];
225
225
  }
226
226
  function Ot(e, t, n, i, o, r) {
227
- const s = (t - r) * (n - o), a = (e - o) * (i - r), l = s - a, f = Math.abs(s + a);
228
- return Math.abs(l) >= ai * f ? l : -fi(e, t, n, i, o, r, f);
227
+ const s = (t - r) * (n - o), a = (e - o) * (i - r), c = s - a, f = Math.abs(s + a);
228
+ return Math.abs(c) >= ai * f ? c : -fi(e, t, n, i, o, r, f);
229
229
  }
230
230
  const hi = (10 + 96 * pt) * pt, ui = (4 + 48 * pt) * pt, di = (44 + 576 * pt) * pt * pt, Xt = tt(4), $t = tt(4), Dt = tt(4), kt = tt(4), At = tt(4), It = tt(4), gt = tt(4), wt = tt(4), Oe = tt(8), Pe = tt(8), Ne = tt(8), Be = tt(8), Te = tt(8), Ce = tt(8), ue = tt(8), de = tt(8), pe = tt(8), Lt = tt(4), Vt = tt(4), Ut = tt(4), z = tt(8), K = tt(16), nt = tt(16), it = tt(16), et = tt(32), Ft = tt(32), at = tt(48), bt = tt(64);
231
231
  let Qt = tt(1152), Xe = tt(1152);
@@ -234,23 +234,23 @@ function ct(e, t, n) {
234
234
  const i = Qt;
235
235
  return Qt = Xe, Xe = i, e;
236
236
  }
237
- function pi(e, t, n, i, o, r, s, a, l) {
238
- let f, h, c, u, d, _, w, O, M, m, v, p, b, g, E, S, k, P, N, C, F, y, I, A, T, X, D, x, B, $, Y, L, V, j, U;
237
+ function pi(e, t, n, i, o, r, s, a, c) {
238
+ let f, h, l, u, p, _, w, O, M, m, v, d, b, g, E, S, k, P, N, C, F, y, I, A, T, X, D, x, B, $, R, L, V, j, U;
239
239
  const G = e - s, J = n - s, Q = o - s, H = t - a, Z = i - a, W = r - a;
240
- Y = J * W, I = q * J, A = I - (I - J), T = J - A, I = q * W, X = I - (I - W), D = W - X, L = T * D - (Y - A * X - T * X - A * D), V = Q * Z, I = q * Q, A = I - (I - Q), T = Q - A, I = q * Z, X = I - (I - Z), D = Z - X, j = T * D - (V - A * X - T * X - A * D), x = L - j, y = L - x, Xt[0] = L - (x + y) + (y - j), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ - V, y = $ - x, Xt[1] = $ - (x + y) + (y - V), U = B + x, y = U - B, Xt[2] = B - (U - y) + (x - y), Xt[3] = U, Y = Q * H, I = q * Q, A = I - (I - Q), T = Q - A, I = q * H, X = I - (I - H), D = H - X, L = T * D - (Y - A * X - T * X - A * D), V = G * W, I = q * G, A = I - (I - G), T = G - A, I = q * W, X = I - (I - W), D = W - X, j = T * D - (V - A * X - T * X - A * D), x = L - j, y = L - x, $t[0] = L - (x + y) + (y - j), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ - V, y = $ - x, $t[1] = $ - (x + y) + (y - V), U = B + x, y = U - B, $t[2] = B - (U - y) + (x - y), $t[3] = U, Y = G * Z, I = q * G, A = I - (I - G), T = G - A, I = q * Z, X = I - (I - Z), D = Z - X, L = T * D - (Y - A * X - T * X - A * D), V = J * H, I = q * J, A = I - (I - J), T = J - A, I = q * H, X = I - (I - H), D = H - X, j = T * D - (V - A * X - T * X - A * D), x = L - j, y = L - x, Dt[0] = L - (x + y) + (y - j), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ - V, y = $ - x, Dt[1] = $ - (x + y) + (y - V), U = B + x, y = U - B, Dt[2] = B - (U - y) + (x - y), Dt[3] = U, f = ht(
240
+ R = J * W, I = q * J, A = I - (I - J), T = J - A, I = q * W, X = I - (I - W), D = W - X, L = T * D - (R - A * X - T * X - A * D), V = Q * Z, I = q * Q, A = I - (I - Q), T = Q - A, I = q * Z, X = I - (I - Z), D = Z - X, j = T * D - (V - A * X - T * X - A * D), x = L - j, y = L - x, Xt[0] = L - (x + y) + (y - j), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ - V, y = $ - x, Xt[1] = $ - (x + y) + (y - V), U = B + x, y = U - B, Xt[2] = B - (U - y) + (x - y), Xt[3] = U, R = Q * H, I = q * Q, A = I - (I - Q), T = Q - A, I = q * H, X = I - (I - H), D = H - X, L = T * D - (R - A * X - T * X - A * D), V = G * W, I = q * G, A = I - (I - G), T = G - A, I = q * W, X = I - (I - W), D = W - X, j = T * D - (V - A * X - T * X - A * D), x = L - j, y = L - x, $t[0] = L - (x + y) + (y - j), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ - V, y = $ - x, $t[1] = $ - (x + y) + (y - V), U = B + x, y = U - B, $t[2] = B - (U - y) + (x - y), $t[3] = U, R = G * Z, I = q * G, A = I - (I - G), T = G - A, I = q * Z, X = I - (I - Z), D = Z - X, L = T * D - (R - A * X - T * X - A * D), V = J * H, I = q * J, A = I - (I - J), T = J - A, I = q * H, X = I - (I - H), D = H - X, j = T * D - (V - A * X - T * X - A * D), x = L - j, y = L - x, Dt[0] = L - (x + y) + (y - j), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ - V, y = $ - x, Dt[1] = $ - (x + y) + (y - V), U = B + x, y = U - B, Dt[2] = B - (U - y) + (x - y), Dt[3] = U, f = ht(
241
241
  ht(
242
242
  ht(
243
- R(R(4, Xt, G, z), z, G, K),
243
+ Y(Y(4, Xt, G, z), z, G, K),
244
244
  K,
245
- R(R(4, Xt, H, z), z, H, nt),
245
+ Y(Y(4, Xt, H, z), z, H, nt),
246
246
  nt,
247
247
  et
248
248
  ),
249
249
  et,
250
250
  ht(
251
- R(R(4, $t, J, z), z, J, K),
251
+ Y(Y(4, $t, J, z), z, J, K),
252
252
  K,
253
- R(R(4, $t, Z, z), z, Z, nt),
253
+ Y(Y(4, $t, Z, z), z, Z, nt),
254
254
  nt,
255
255
  Ft
256
256
  ),
@@ -259,154 +259,154 @@ function pi(e, t, n, i, o, r, s, a, l) {
259
259
  ),
260
260
  bt,
261
261
  ht(
262
- R(R(4, Dt, Q, z), z, Q, K),
262
+ Y(Y(4, Dt, Q, z), z, Q, K),
263
263
  K,
264
- R(R(4, Dt, W, z), z, W, nt),
264
+ Y(Y(4, Dt, W, z), z, W, nt),
265
265
  nt,
266
266
  et
267
267
  ),
268
268
  et,
269
269
  Qt
270
270
  );
271
- let st = Vn(f, Qt), ft = ui * l;
272
- if (st >= ft || -st >= ft || (y = e - G, h = e - (G + y) + (y - s), y = t - H, d = t - (H + y) + (y - a), y = n - J, c = n - (J + y) + (y - s), y = i - Z, _ = i - (Z + y) + (y - a), y = o - Q, u = o - (Q + y) + (y - s), y = r - W, w = r - (W + y) + (y - a), h === 0 && c === 0 && u === 0 && d === 0 && _ === 0 && w === 0) || (ft = di * l + Ln * Math.abs(st), st += (G * G + H * H) * (J * w + W * c - (Z * u + Q * _)) + 2 * (G * h + H * d) * (J * W - Z * Q) + ((J * J + Z * Z) * (Q * d + H * u - (W * h + G * w)) + 2 * (J * c + Z * _) * (Q * H - W * G)) + ((Q * Q + W * W) * (G * _ + Z * h - (H * c + J * d)) + 2 * (Q * u + W * w) * (G * Z - H * J)), st >= ft || -st >= ft))
271
+ let st = Vn(f, Qt), ft = ui * c;
272
+ if (st >= ft || -st >= ft || (y = e - G, h = e - (G + y) + (y - s), y = t - H, p = t - (H + y) + (y - a), y = n - J, l = n - (J + y) + (y - s), y = i - Z, _ = i - (Z + y) + (y - a), y = o - Q, u = o - (Q + y) + (y - s), y = r - W, w = r - (W + y) + (y - a), h === 0 && l === 0 && u === 0 && p === 0 && _ === 0 && w === 0) || (ft = di * c + Ln * Math.abs(st), st += (G * G + H * H) * (J * w + W * l - (Z * u + Q * _)) + 2 * (G * h + H * p) * (J * W - Z * Q) + ((J * J + Z * Z) * (Q * p + H * u - (W * h + G * w)) + 2 * (J * l + Z * _) * (Q * H - W * G)) + ((Q * Q + W * W) * (G * _ + Z * h - (H * l + J * p)) + 2 * (Q * u + W * w) * (G * Z - H * J)), st >= ft || -st >= ft))
273
273
  return st;
274
- if ((c !== 0 || _ !== 0 || u !== 0 || w !== 0) && (Y = G * G, I = q * G, A = I - (I - G), T = G - A, L = T * T - (Y - A * A - (A + A) * T), V = H * H, I = q * H, A = I - (I - H), T = H - A, j = T * T - (V - A * A - (A + A) * T), x = L + j, y = x - L, kt[0] = L - (x - y) + (j - y), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ + V, y = x - $, kt[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, kt[2] = B - (U - y) + (x - y), kt[3] = U), (u !== 0 || w !== 0 || h !== 0 || d !== 0) && (Y = J * J, I = q * J, A = I - (I - J), T = J - A, L = T * T - (Y - A * A - (A + A) * T), V = Z * Z, I = q * Z, A = I - (I - Z), T = Z - A, j = T * T - (V - A * A - (A + A) * T), x = L + j, y = x - L, At[0] = L - (x - y) + (j - y), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ + V, y = x - $, At[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, At[2] = B - (U - y) + (x - y), At[3] = U), (h !== 0 || d !== 0 || c !== 0 || _ !== 0) && (Y = Q * Q, I = q * Q, A = I - (I - Q), T = Q - A, L = T * T - (Y - A * A - (A + A) * T), V = W * W, I = q * W, A = I - (I - W), T = W - A, j = T * T - (V - A * A - (A + A) * T), x = L + j, y = x - L, It[0] = L - (x - y) + (j - y), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ + V, y = x - $, It[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, It[2] = B - (U - y) + (x - y), It[3] = U), h !== 0 && (O = R(4, Xt, h, Oe), f = ct(f, Mt(
275
- R(O, Oe, 2 * G, K),
274
+ if ((l !== 0 || _ !== 0 || u !== 0 || w !== 0) && (R = G * G, I = q * G, A = I - (I - G), T = G - A, L = T * T - (R - A * A - (A + A) * T), V = H * H, I = q * H, A = I - (I - H), T = H - A, j = T * T - (V - A * A - (A + A) * T), x = L + j, y = x - L, kt[0] = L - (x - y) + (j - y), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ + V, y = x - $, kt[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, kt[2] = B - (U - y) + (x - y), kt[3] = U), (u !== 0 || w !== 0 || h !== 0 || p !== 0) && (R = J * J, I = q * J, A = I - (I - J), T = J - A, L = T * T - (R - A * A - (A + A) * T), V = Z * Z, I = q * Z, A = I - (I - Z), T = Z - A, j = T * T - (V - A * A - (A + A) * T), x = L + j, y = x - L, At[0] = L - (x - y) + (j - y), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ + V, y = x - $, At[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, At[2] = B - (U - y) + (x - y), At[3] = U), (h !== 0 || p !== 0 || l !== 0 || _ !== 0) && (R = Q * Q, I = q * Q, A = I - (I - Q), T = Q - A, L = T * T - (R - A * A - (A + A) * T), V = W * W, I = q * W, A = I - (I - W), T = W - A, j = T * T - (V - A * A - (A + A) * T), x = L + j, y = x - L, It[0] = L - (x - y) + (j - y), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ + V, y = x - $, It[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, It[2] = B - (U - y) + (x - y), It[3] = U), h !== 0 && (O = Y(4, Xt, h, Oe), f = ct(f, Mt(
275
+ Y(O, Oe, 2 * G, K),
276
276
  K,
277
- R(R(4, It, h, z), z, Z, nt),
277
+ Y(Y(4, It, h, z), z, Z, nt),
278
278
  nt,
279
- R(R(4, At, h, z), z, -W, it),
279
+ Y(Y(4, At, h, z), z, -W, it),
280
280
  it,
281
281
  et,
282
282
  at
283
- ), at)), d !== 0 && (M = R(4, Xt, d, Pe), f = ct(f, Mt(
284
- R(M, Pe, 2 * H, K),
283
+ ), at)), p !== 0 && (M = Y(4, Xt, p, Pe), f = ct(f, Mt(
284
+ Y(M, Pe, 2 * H, K),
285
285
  K,
286
- R(R(4, At, d, z), z, Q, nt),
286
+ Y(Y(4, At, p, z), z, Q, nt),
287
287
  nt,
288
- R(R(4, It, d, z), z, -J, it),
288
+ Y(Y(4, It, p, z), z, -J, it),
289
289
  it,
290
290
  et,
291
291
  at
292
- ), at)), c !== 0 && (m = R(4, $t, c, Ne), f = ct(f, Mt(
293
- R(m, Ne, 2 * J, K),
292
+ ), at)), l !== 0 && (m = Y(4, $t, l, Ne), f = ct(f, Mt(
293
+ Y(m, Ne, 2 * J, K),
294
294
  K,
295
- R(R(4, kt, c, z), z, W, nt),
295
+ Y(Y(4, kt, l, z), z, W, nt),
296
296
  nt,
297
- R(R(4, It, c, z), z, -H, it),
297
+ Y(Y(4, It, l, z), z, -H, it),
298
298
  it,
299
299
  et,
300
300
  at
301
- ), at)), _ !== 0 && (v = R(4, $t, _, Be), f = ct(f, Mt(
302
- R(v, Be, 2 * Z, K),
301
+ ), at)), _ !== 0 && (v = Y(4, $t, _, Be), f = ct(f, Mt(
302
+ Y(v, Be, 2 * Z, K),
303
303
  K,
304
- R(R(4, It, _, z), z, G, nt),
304
+ Y(Y(4, It, _, z), z, G, nt),
305
305
  nt,
306
- R(R(4, kt, _, z), z, -Q, it),
306
+ Y(Y(4, kt, _, z), z, -Q, it),
307
307
  it,
308
308
  et,
309
309
  at
310
- ), at)), u !== 0 && (p = R(4, Dt, u, Te), f = ct(f, Mt(
311
- R(p, Te, 2 * Q, K),
310
+ ), at)), u !== 0 && (d = Y(4, Dt, u, Te), f = ct(f, Mt(
311
+ Y(d, Te, 2 * Q, K),
312
312
  K,
313
- R(R(4, At, u, z), z, H, nt),
313
+ Y(Y(4, At, u, z), z, H, nt),
314
314
  nt,
315
- R(R(4, kt, u, z), z, -Z, it),
315
+ Y(Y(4, kt, u, z), z, -Z, it),
316
316
  it,
317
317
  et,
318
318
  at
319
- ), at)), w !== 0 && (b = R(4, Dt, w, Ce), f = ct(f, Mt(
320
- R(b, Ce, 2 * W, K),
319
+ ), at)), w !== 0 && (b = Y(4, Dt, w, Ce), f = ct(f, Mt(
320
+ Y(b, Ce, 2 * W, K),
321
321
  K,
322
- R(R(4, kt, w, z), z, J, nt),
322
+ Y(Y(4, kt, w, z), z, J, nt),
323
323
  nt,
324
- R(R(4, At, w, z), z, -G, it),
324
+ Y(Y(4, At, w, z), z, -G, it),
325
325
  it,
326
326
  et,
327
327
  at
328
- ), at)), h !== 0 || d !== 0) {
329
- if (c !== 0 || _ !== 0 || u !== 0 || w !== 0 ? (Y = c * W, I = q * c, A = I - (I - c), T = c - A, I = q * W, X = I - (I - W), D = W - X, L = T * D - (Y - A * X - T * X - A * D), V = J * w, I = q * J, A = I - (I - J), T = J - A, I = q * w, X = I - (I - w), D = w - X, j = T * D - (V - A * X - T * X - A * D), x = L + j, y = x - L, gt[0] = L - (x - y) + (j - y), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ + V, y = x - $, gt[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, gt[2] = B - (U - y) + (x - y), gt[3] = U, Y = u * -Z, I = q * u, A = I - (I - u), T = u - A, I = q * -Z, X = I - (I - -Z), D = -Z - X, L = T * D - (Y - A * X - T * X - A * D), V = Q * -_, I = q * Q, A = I - (I - Q), T = Q - A, I = q * -_, X = I - (I - -_), D = -_ - X, j = T * D - (V - A * X - T * X - A * D), x = L + j, y = x - L, wt[0] = L - (x - y) + (j - y), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ + V, y = x - $, wt[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, wt[2] = B - (U - y) + (x - y), wt[3] = U, E = ht(4, gt, 4, wt, de), Y = c * w, I = q * c, A = I - (I - c), T = c - A, I = q * w, X = I - (I - w), D = w - X, L = T * D - (Y - A * X - T * X - A * D), V = u * _, I = q * u, A = I - (I - u), T = u - A, I = q * _, X = I - (I - _), D = _ - X, j = T * D - (V - A * X - T * X - A * D), x = L - j, y = L - x, Vt[0] = L - (x + y) + (y - j), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ - V, y = $ - x, Vt[1] = $ - (x + y) + (y - V), U = B + x, y = U - B, Vt[2] = B - (U - y) + (x - y), Vt[3] = U, P = 4) : (de[0] = 0, E = 1, Vt[0] = 0, P = 1), h !== 0) {
330
- const rt = R(E, de, h, it);
328
+ ), at)), h !== 0 || p !== 0) {
329
+ if (l !== 0 || _ !== 0 || u !== 0 || w !== 0 ? (R = l * W, I = q * l, A = I - (I - l), T = l - A, I = q * W, X = I - (I - W), D = W - X, L = T * D - (R - A * X - T * X - A * D), V = J * w, I = q * J, A = I - (I - J), T = J - A, I = q * w, X = I - (I - w), D = w - X, j = T * D - (V - A * X - T * X - A * D), x = L + j, y = x - L, gt[0] = L - (x - y) + (j - y), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ + V, y = x - $, gt[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, gt[2] = B - (U - y) + (x - y), gt[3] = U, R = u * -Z, I = q * u, A = I - (I - u), T = u - A, I = q * -Z, X = I - (I - -Z), D = -Z - X, L = T * D - (R - A * X - T * X - A * D), V = Q * -_, I = q * Q, A = I - (I - Q), T = Q - A, I = q * -_, X = I - (I - -_), D = -_ - X, j = T * D - (V - A * X - T * X - A * D), x = L + j, y = x - L, wt[0] = L - (x - y) + (j - y), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ + V, y = x - $, wt[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, wt[2] = B - (U - y) + (x - y), wt[3] = U, E = ht(4, gt, 4, wt, de), R = l * w, I = q * l, A = I - (I - l), T = l - A, I = q * w, X = I - (I - w), D = w - X, L = T * D - (R - A * X - T * X - A * D), V = u * _, I = q * u, A = I - (I - u), T = u - A, I = q * _, X = I - (I - _), D = _ - X, j = T * D - (V - A * X - T * X - A * D), x = L - j, y = L - x, Vt[0] = L - (x + y) + (y - j), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ - V, y = $ - x, Vt[1] = $ - (x + y) + (y - V), U = B + x, y = U - B, Vt[2] = B - (U - y) + (x - y), Vt[3] = U, P = 4) : (de[0] = 0, E = 1, Vt[0] = 0, P = 1), h !== 0) {
330
+ const rt = Y(E, de, h, it);
331
331
  f = ct(f, ht(
332
- R(O, Oe, h, K),
332
+ Y(O, Oe, h, K),
333
333
  K,
334
- R(rt, it, 2 * G, et),
334
+ Y(rt, it, 2 * G, et),
335
335
  et,
336
336
  at
337
337
  ), at);
338
- const ot = R(P, Vt, h, z);
338
+ const ot = Y(P, Vt, h, z);
339
339
  f = ct(f, Mt(
340
- R(ot, z, 2 * G, K),
340
+ Y(ot, z, 2 * G, K),
341
341
  K,
342
- R(ot, z, h, nt),
342
+ Y(ot, z, h, nt),
343
343
  nt,
344
- R(rt, it, h, et),
344
+ Y(rt, it, h, et),
345
345
  et,
346
346
  Ft,
347
347
  bt
348
- ), bt), _ !== 0 && (f = ct(f, R(R(4, It, h, z), z, _, K), K)), w !== 0 && (f = ct(f, R(R(4, At, -h, z), z, w, K), K));
348
+ ), bt), _ !== 0 && (f = ct(f, Y(Y(4, It, h, z), z, _, K), K)), w !== 0 && (f = ct(f, Y(Y(4, At, -h, z), z, w, K), K));
349
349
  }
350
- if (d !== 0) {
351
- const rt = R(E, de, d, it);
350
+ if (p !== 0) {
351
+ const rt = Y(E, de, p, it);
352
352
  f = ct(f, ht(
353
- R(M, Pe, d, K),
353
+ Y(M, Pe, p, K),
354
354
  K,
355
- R(rt, it, 2 * H, et),
355
+ Y(rt, it, 2 * H, et),
356
356
  et,
357
357
  at
358
358
  ), at);
359
- const ot = R(P, Vt, d, z);
359
+ const ot = Y(P, Vt, p, z);
360
360
  f = ct(f, Mt(
361
- R(ot, z, 2 * H, K),
361
+ Y(ot, z, 2 * H, K),
362
362
  K,
363
- R(ot, z, d, nt),
363
+ Y(ot, z, p, nt),
364
364
  nt,
365
- R(rt, it, d, et),
365
+ Y(rt, it, p, et),
366
366
  et,
367
367
  Ft,
368
368
  bt
369
369
  ), bt);
370
370
  }
371
371
  }
372
- if (c !== 0 || _ !== 0) {
373
- if (u !== 0 || w !== 0 || h !== 0 || d !== 0 ? (Y = u * H, I = q * u, A = I - (I - u), T = u - A, I = q * H, X = I - (I - H), D = H - X, L = T * D - (Y - A * X - T * X - A * D), V = Q * d, I = q * Q, A = I - (I - Q), T = Q - A, I = q * d, X = I - (I - d), D = d - X, j = T * D - (V - A * X - T * X - A * D), x = L + j, y = x - L, gt[0] = L - (x - y) + (j - y), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ + V, y = x - $, gt[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, gt[2] = B - (U - y) + (x - y), gt[3] = U, C = -W, F = -w, Y = h * C, I = q * h, A = I - (I - h), T = h - A, I = q * C, X = I - (I - C), D = C - X, L = T * D - (Y - A * X - T * X - A * D), V = G * F, I = q * G, A = I - (I - G), T = G - A, I = q * F, X = I - (I - F), D = F - X, j = T * D - (V - A * X - T * X - A * D), x = L + j, y = x - L, wt[0] = L - (x - y) + (j - y), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ + V, y = x - $, wt[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, wt[2] = B - (U - y) + (x - y), wt[3] = U, S = ht(4, gt, 4, wt, pe), Y = u * d, I = q * u, A = I - (I - u), T = u - A, I = q * d, X = I - (I - d), D = d - X, L = T * D - (Y - A * X - T * X - A * D), V = h * w, I = q * h, A = I - (I - h), T = h - A, I = q * w, X = I - (I - w), D = w - X, j = T * D - (V - A * X - T * X - A * D), x = L - j, y = L - x, Ut[0] = L - (x + y) + (y - j), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ - V, y = $ - x, Ut[1] = $ - (x + y) + (y - V), U = B + x, y = U - B, Ut[2] = B - (U - y) + (x - y), Ut[3] = U, N = 4) : (pe[0] = 0, S = 1, Ut[0] = 0, N = 1), c !== 0) {
374
- const rt = R(S, pe, c, it);
372
+ if (l !== 0 || _ !== 0) {
373
+ if (u !== 0 || w !== 0 || h !== 0 || p !== 0 ? (R = u * H, I = q * u, A = I - (I - u), T = u - A, I = q * H, X = I - (I - H), D = H - X, L = T * D - (R - A * X - T * X - A * D), V = Q * p, I = q * Q, A = I - (I - Q), T = Q - A, I = q * p, X = I - (I - p), D = p - X, j = T * D - (V - A * X - T * X - A * D), x = L + j, y = x - L, gt[0] = L - (x - y) + (j - y), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ + V, y = x - $, gt[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, gt[2] = B - (U - y) + (x - y), gt[3] = U, C = -W, F = -w, R = h * C, I = q * h, A = I - (I - h), T = h - A, I = q * C, X = I - (I - C), D = C - X, L = T * D - (R - A * X - T * X - A * D), V = G * F, I = q * G, A = I - (I - G), T = G - A, I = q * F, X = I - (I - F), D = F - X, j = T * D - (V - A * X - T * X - A * D), x = L + j, y = x - L, wt[0] = L - (x - y) + (j - y), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ + V, y = x - $, wt[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, wt[2] = B - (U - y) + (x - y), wt[3] = U, S = ht(4, gt, 4, wt, pe), R = u * p, I = q * u, A = I - (I - u), T = u - A, I = q * p, X = I - (I - p), D = p - X, L = T * D - (R - A * X - T * X - A * D), V = h * w, I = q * h, A = I - (I - h), T = h - A, I = q * w, X = I - (I - w), D = w - X, j = T * D - (V - A * X - T * X - A * D), x = L - j, y = L - x, Ut[0] = L - (x + y) + (y - j), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ - V, y = $ - x, Ut[1] = $ - (x + y) + (y - V), U = B + x, y = U - B, Ut[2] = B - (U - y) + (x - y), Ut[3] = U, N = 4) : (pe[0] = 0, S = 1, Ut[0] = 0, N = 1), l !== 0) {
374
+ const rt = Y(S, pe, l, it);
375
375
  f = ct(f, ht(
376
- R(m, Ne, c, K),
376
+ Y(m, Ne, l, K),
377
377
  K,
378
- R(rt, it, 2 * J, et),
378
+ Y(rt, it, 2 * J, et),
379
379
  et,
380
380
  at
381
381
  ), at);
382
- const ot = R(N, Ut, c, z);
382
+ const ot = Y(N, Ut, l, z);
383
383
  f = ct(f, Mt(
384
- R(ot, z, 2 * J, K),
384
+ Y(ot, z, 2 * J, K),
385
385
  K,
386
- R(ot, z, c, nt),
386
+ Y(ot, z, l, nt),
387
387
  nt,
388
- R(rt, it, c, et),
388
+ Y(rt, it, l, et),
389
389
  et,
390
390
  Ft,
391
391
  bt
392
- ), bt), w !== 0 && (f = ct(f, R(R(4, kt, c, z), z, w, K), K)), d !== 0 && (f = ct(f, R(R(4, It, -c, z), z, d, K), K));
392
+ ), bt), w !== 0 && (f = ct(f, Y(Y(4, kt, l, z), z, w, K), K)), p !== 0 && (f = ct(f, Y(Y(4, It, -l, z), z, p, K), K));
393
393
  }
394
394
  if (_ !== 0) {
395
- const rt = R(S, pe, _, it);
395
+ const rt = Y(S, pe, _, it);
396
396
  f = ct(f, ht(
397
- R(v, Be, _, K),
397
+ Y(v, Be, _, K),
398
398
  K,
399
- R(rt, it, 2 * Z, et),
399
+ Y(rt, it, 2 * Z, et),
400
400
  et,
401
401
  at
402
402
  ), at);
403
- const ot = R(N, Ut, _, z);
403
+ const ot = Y(N, Ut, _, z);
404
404
  f = ct(f, Mt(
405
- R(ot, z, 2 * Z, K),
405
+ Y(ot, z, 2 * Z, K),
406
406
  K,
407
- R(ot, z, _, nt),
407
+ Y(ot, z, _, nt),
408
408
  nt,
409
- R(rt, it, _, et),
409
+ Y(rt, it, _, et),
410
410
  et,
411
411
  Ft,
412
412
  bt
@@ -414,43 +414,43 @@ function pi(e, t, n, i, o, r, s, a, l) {
414
414
  }
415
415
  }
416
416
  if (u !== 0 || w !== 0) {
417
- if (h !== 0 || d !== 0 || c !== 0 || _ !== 0 ? (Y = h * Z, I = q * h, A = I - (I - h), T = h - A, I = q * Z, X = I - (I - Z), D = Z - X, L = T * D - (Y - A * X - T * X - A * D), V = G * _, I = q * G, A = I - (I - G), T = G - A, I = q * _, X = I - (I - _), D = _ - X, j = T * D - (V - A * X - T * X - A * D), x = L + j, y = x - L, gt[0] = L - (x - y) + (j - y), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ + V, y = x - $, gt[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, gt[2] = B - (U - y) + (x - y), gt[3] = U, C = -H, F = -d, Y = c * C, I = q * c, A = I - (I - c), T = c - A, I = q * C, X = I - (I - C), D = C - X, L = T * D - (Y - A * X - T * X - A * D), V = J * F, I = q * J, A = I - (I - J), T = J - A, I = q * F, X = I - (I - F), D = F - X, j = T * D - (V - A * X - T * X - A * D), x = L + j, y = x - L, wt[0] = L - (x - y) + (j - y), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ + V, y = x - $, wt[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, wt[2] = B - (U - y) + (x - y), wt[3] = U, g = ht(4, gt, 4, wt, ue), Y = h * _, I = q * h, A = I - (I - h), T = h - A, I = q * _, X = I - (I - _), D = _ - X, L = T * D - (Y - A * X - T * X - A * D), V = c * d, I = q * c, A = I - (I - c), T = c - A, I = q * d, X = I - (I - d), D = d - X, j = T * D - (V - A * X - T * X - A * D), x = L - j, y = L - x, Lt[0] = L - (x + y) + (y - j), B = Y + x, y = B - Y, $ = Y - (B - y) + (x - y), x = $ - V, y = $ - x, Lt[1] = $ - (x + y) + (y - V), U = B + x, y = U - B, Lt[2] = B - (U - y) + (x - y), Lt[3] = U, k = 4) : (ue[0] = 0, g = 1, Lt[0] = 0, k = 1), u !== 0) {
418
- const rt = R(g, ue, u, it);
417
+ if (h !== 0 || p !== 0 || l !== 0 || _ !== 0 ? (R = h * Z, I = q * h, A = I - (I - h), T = h - A, I = q * Z, X = I - (I - Z), D = Z - X, L = T * D - (R - A * X - T * X - A * D), V = G * _, I = q * G, A = I - (I - G), T = G - A, I = q * _, X = I - (I - _), D = _ - X, j = T * D - (V - A * X - T * X - A * D), x = L + j, y = x - L, gt[0] = L - (x - y) + (j - y), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ + V, y = x - $, gt[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, gt[2] = B - (U - y) + (x - y), gt[3] = U, C = -H, F = -p, R = l * C, I = q * l, A = I - (I - l), T = l - A, I = q * C, X = I - (I - C), D = C - X, L = T * D - (R - A * X - T * X - A * D), V = J * F, I = q * J, A = I - (I - J), T = J - A, I = q * F, X = I - (I - F), D = F - X, j = T * D - (V - A * X - T * X - A * D), x = L + j, y = x - L, wt[0] = L - (x - y) + (j - y), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ + V, y = x - $, wt[1] = $ - (x - y) + (V - y), U = B + x, y = U - B, wt[2] = B - (U - y) + (x - y), wt[3] = U, g = ht(4, gt, 4, wt, ue), R = h * _, I = q * h, A = I - (I - h), T = h - A, I = q * _, X = I - (I - _), D = _ - X, L = T * D - (R - A * X - T * X - A * D), V = l * p, I = q * l, A = I - (I - l), T = l - A, I = q * p, X = I - (I - p), D = p - X, j = T * D - (V - A * X - T * X - A * D), x = L - j, y = L - x, Lt[0] = L - (x + y) + (y - j), B = R + x, y = B - R, $ = R - (B - y) + (x - y), x = $ - V, y = $ - x, Lt[1] = $ - (x + y) + (y - V), U = B + x, y = U - B, Lt[2] = B - (U - y) + (x - y), Lt[3] = U, k = 4) : (ue[0] = 0, g = 1, Lt[0] = 0, k = 1), u !== 0) {
418
+ const rt = Y(g, ue, u, it);
419
419
  f = ct(f, ht(
420
- R(p, Te, u, K),
420
+ Y(d, Te, u, K),
421
421
  K,
422
- R(rt, it, 2 * Q, et),
422
+ Y(rt, it, 2 * Q, et),
423
423
  et,
424
424
  at
425
425
  ), at);
426
- const ot = R(k, Lt, u, z);
426
+ const ot = Y(k, Lt, u, z);
427
427
  f = ct(f, Mt(
428
- R(ot, z, 2 * Q, K),
428
+ Y(ot, z, 2 * Q, K),
429
429
  K,
430
- R(ot, z, u, nt),
430
+ Y(ot, z, u, nt),
431
431
  nt,
432
- R(rt, it, u, et),
432
+ Y(rt, it, u, et),
433
433
  et,
434
434
  Ft,
435
435
  bt
436
- ), bt), d !== 0 && (f = ct(f, R(R(4, At, u, z), z, d, K), K)), _ !== 0 && (f = ct(f, R(R(4, kt, -u, z), z, _, K), K));
436
+ ), bt), p !== 0 && (f = ct(f, Y(Y(4, At, u, z), z, p, K), K)), _ !== 0 && (f = ct(f, Y(Y(4, kt, -u, z), z, _, K), K));
437
437
  }
438
438
  if (w !== 0) {
439
- const rt = R(g, ue, w, it);
439
+ const rt = Y(g, ue, w, it);
440
440
  f = ct(f, ht(
441
- R(b, Ce, w, K),
441
+ Y(b, Ce, w, K),
442
442
  K,
443
- R(rt, it, 2 * W, et),
443
+ Y(rt, it, 2 * W, et),
444
444
  et,
445
445
  at
446
446
  ), at);
447
- const ot = R(k, Lt, w, z);
447
+ const ot = Y(k, Lt, w, z);
448
448
  f = ct(f, Mt(
449
- R(ot, z, 2 * W, K),
449
+ Y(ot, z, 2 * W, K),
450
450
  K,
451
- R(ot, z, w, nt),
451
+ Y(ot, z, w, nt),
452
452
  nt,
453
- R(rt, it, w, et),
453
+ Y(rt, it, w, et),
454
454
  et,
455
455
  Ft,
456
456
  bt
@@ -460,26 +460,26 @@ function pi(e, t, n, i, o, r, s, a, l) {
460
460
  return Qt[f - 1];
461
461
  }
462
462
  function mi(e, t, n, i, o, r, s, a) {
463
- const l = e - s, f = n - s, h = o - s, c = t - a, u = i - a, d = r - a, _ = f * d, w = h * u, O = l * l + c * c, M = h * c, m = l * d, v = f * f + u * u, p = l * u, b = f * c, g = h * h + d * d, E = O * (_ - w) + v * (M - m) + g * (p - b), S = (Math.abs(_) + Math.abs(w)) * O + (Math.abs(M) + Math.abs(m)) * v + (Math.abs(p) + Math.abs(b)) * g, k = hi * S;
463
+ const c = e - s, f = n - s, h = o - s, l = t - a, u = i - a, p = r - a, _ = f * p, w = h * u, O = c * c + l * l, M = h * l, m = c * p, v = f * f + u * u, d = c * u, b = f * l, g = h * h + p * p, E = O * (_ - w) + v * (M - m) + g * (d - b), S = (Math.abs(_) + Math.abs(w)) * O + (Math.abs(M) + Math.abs(m)) * v + (Math.abs(d) + Math.abs(b)) * g, k = hi * S;
464
464
  return E > k || -E > k ? E : pi(e, t, n, i, o, r, s, a, S);
465
465
  }
466
466
  function gi(e, t) {
467
- var n, i, o = 0, r, s, a, l, f, h, c, u = e[0], d = e[1], _ = t.length;
467
+ var n, i, o = 0, r, s, a, c, f, h, l, u = e[0], p = e[1], _ = t.length;
468
468
  for (n = 0; n < _; n++) {
469
469
  i = 0;
470
470
  var w = t[n], O = w.length - 1;
471
471
  if (h = w[0], h[0] !== w[O][0] && h[1] !== w[O][1])
472
472
  throw new Error("First and last coordinates in a ring must be the same");
473
- for (s = h[0] - u, a = h[1] - d, i; i < O; i++) {
474
- if (c = w[i + 1], l = c[0] - u, f = c[1] - d, a === 0 && f === 0) {
475
- if (l <= 0 && s >= 0 || s <= 0 && l >= 0)
473
+ for (s = h[0] - u, a = h[1] - p, i; i < O; i++) {
474
+ if (l = w[i + 1], c = l[0] - u, f = l[1] - p, a === 0 && f === 0) {
475
+ if (c <= 0 && s >= 0 || s <= 0 && c >= 0)
476
476
  return 0;
477
477
  } else if (f >= 0 && a <= 0 || f <= 0 && a >= 0) {
478
- if (r = Ot(s, l, a, f, 0, 0), r === 0)
478
+ if (r = Ot(s, c, a, f, 0, 0), r === 0)
479
479
  return 0;
480
480
  (r > 0 && f > 0 && a <= 0 || r < 0 && f <= 0 && a > 0) && o++;
481
481
  }
482
- h = c, a = f, s = l;
482
+ h = l, a = f, s = c;
483
483
  }
484
484
  }
485
485
  return o % 2 !== 0;
@@ -494,8 +494,8 @@ function $e(e, t, n = {}) {
494
494
  if (s && wi(i, s) === !1)
495
495
  return !1;
496
496
  r === "Polygon" && (a = [a]);
497
- for (var l = 0; l < a.length; ++l) {
498
- const f = gi(i, a[l]);
497
+ for (var c = 0; c < a.length; ++c) {
498
+ const f = gi(i, a[c]);
499
499
  if (f === 0 && !n.ignoreBoundary) return !0;
500
500
  if (f) return !0;
501
501
  }
@@ -533,8 +533,8 @@ class Je {
533
533
  const { data: n, compare: i } = this, o = this.length >> 1, r = n[t];
534
534
  for (; t < o; ) {
535
535
  let s = (t << 1) + 1, a = n[s];
536
- const l = s + 1;
537
- if (l < this.length && i(n[l], a) < 0 && (s = l, a = n[l]), i(a, r) >= 0) break;
536
+ const c = s + 1;
537
+ if (c < this.length && i(n[c], a) < 0 && (s = c, a = n[c]), i(a, r) >= 0) break;
538
538
  n[t] = a, t = s;
539
539
  }
540
540
  n[t] = r;
@@ -548,17 +548,17 @@ const vi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
548
548
  default: Je
549
549
  }, Symbol.toStringTag, { value: "Module" })), Bt = 11102230246251565e-32, ut = 134217729, bi = (3 + 8 * Bt) * Bt;
550
550
  function De(e, t, n, i, o) {
551
- let r, s, a, l, f = t[0], h = i[0], c = 0, u = 0;
552
- h > f == h > -f ? (r = f, f = t[++c]) : (r = h, h = i[++u]);
553
- let d = 0;
554
- if (c < e && u < n)
555
- for (h > f == h > -f ? (s = f + r, a = r - (s - f), f = t[++c]) : (s = h + r, a = r - (s - h), h = i[++u]), r = s, a !== 0 && (o[d++] = a); c < e && u < n; )
556
- h > f == h > -f ? (s = r + f, l = s - r, a = r - (s - l) + (f - l), f = t[++c]) : (s = r + h, l = s - r, a = r - (s - l) + (h - l), h = i[++u]), r = s, a !== 0 && (o[d++] = a);
557
- for (; c < e; )
558
- s = r + f, l = s - r, a = r - (s - l) + (f - l), f = t[++c], r = s, a !== 0 && (o[d++] = a);
551
+ let r, s, a, c, f = t[0], h = i[0], l = 0, u = 0;
552
+ h > f == h > -f ? (r = f, f = t[++l]) : (r = h, h = i[++u]);
553
+ let p = 0;
554
+ if (l < e && u < n)
555
+ for (h > f == h > -f ? (s = f + r, a = r - (s - f), f = t[++l]) : (s = h + r, a = r - (s - h), h = i[++u]), r = s, a !== 0 && (o[p++] = a); l < e && u < n; )
556
+ h > f == h > -f ? (s = r + f, c = s - r, a = r - (s - c) + (f - c), f = t[++l]) : (s = r + h, c = s - r, a = r - (s - c) + (h - c), h = i[++u]), r = s, a !== 0 && (o[p++] = a);
557
+ for (; l < e; )
558
+ s = r + f, c = s - r, a = r - (s - c) + (f - c), f = t[++l], r = s, a !== 0 && (o[p++] = a);
559
559
  for (; u < n; )
560
- s = r + h, l = s - r, a = r - (s - l) + (h - l), h = i[++u], r = s, a !== 0 && (o[d++] = a);
561
- return (r !== 0 || d === 0) && (o[d++] = r), d;
560
+ s = r + h, c = s - r, a = r - (s - c) + (h - c), h = i[++u], r = s, a !== 0 && (o[p++] = a);
561
+ return (r !== 0 || p === 0) && (o[p++] = r), p;
562
562
  }
563
563
  function xi(e, t) {
564
564
  let n = t[0];
@@ -570,24 +570,24 @@ function fe(e) {
570
570
  }
571
571
  const _i = (3 + 16 * Bt) * Bt, Mi = (2 + 12 * Bt) * Bt, Si = (9 + 64 * Bt) * Bt * Bt, Jt = fe(4), nn = fe(8), rn = fe(12), on = fe(16), yt = fe(4);
572
572
  function Ei(e, t, n, i, o, r, s) {
573
- let a, l, f, h, c, u, d, _, w, O, M, m, v, p, b, g, E, S;
573
+ let a, c, f, h, l, u, p, _, w, O, M, m, v, d, b, g, E, S;
574
574
  const k = e - o, P = n - o, N = t - r, C = i - r;
575
- p = k * C, u = ut * k, d = u - (u - k), _ = k - d, u = ut * C, w = u - (u - C), O = C - w, b = _ * O - (p - d * w - _ * w - d * O), g = N * P, u = ut * N, d = u - (u - N), _ = N - d, u = ut * P, w = u - (u - P), O = P - w, E = _ * O - (g - d * w - _ * w - d * O), M = b - E, c = b - M, Jt[0] = b - (M + c) + (c - E), m = p + M, c = m - p, v = p - (m - c) + (M - c), M = v - g, c = v - M, Jt[1] = v - (M + c) + (c - g), S = m + M, c = S - m, Jt[2] = m - (S - c) + (M - c), Jt[3] = S;
575
+ d = k * C, u = ut * k, p = u - (u - k), _ = k - p, u = ut * C, w = u - (u - C), O = C - w, b = _ * O - (d - p * w - _ * w - p * O), g = N * P, u = ut * N, p = u - (u - N), _ = N - p, u = ut * P, w = u - (u - P), O = P - w, E = _ * O - (g - p * w - _ * w - p * O), M = b - E, l = b - M, Jt[0] = b - (M + l) + (l - E), m = d + M, l = m - d, v = d - (m - l) + (M - l), M = v - g, l = v - M, Jt[1] = v - (M + l) + (l - g), S = m + M, l = S - m, Jt[2] = m - (S - l) + (M - l), Jt[3] = S;
576
576
  let F = xi(4, Jt), y = Mi * s;
577
- if (F >= y || -F >= y || (c = e - k, a = e - (k + c) + (c - o), c = n - P, f = n - (P + c) + (c - o), c = t - N, l = t - (N + c) + (c - r), c = i - C, h = i - (C + c) + (c - r), a === 0 && l === 0 && f === 0 && h === 0) || (y = Si * s + bi * Math.abs(F), F += k * h + C * a - (N * f + P * l), F >= y || -F >= y)) return F;
578
- p = a * C, u = ut * a, d = u - (u - a), _ = a - d, u = ut * C, w = u - (u - C), O = C - w, b = _ * O - (p - d * w - _ * w - d * O), g = l * P, u = ut * l, d = u - (u - l), _ = l - d, u = ut * P, w = u - (u - P), O = P - w, E = _ * O - (g - d * w - _ * w - d * O), M = b - E, c = b - M, yt[0] = b - (M + c) + (c - E), m = p + M, c = m - p, v = p - (m - c) + (M - c), M = v - g, c = v - M, yt[1] = v - (M + c) + (c - g), S = m + M, c = S - m, yt[2] = m - (S - c) + (M - c), yt[3] = S;
577
+ if (F >= y || -F >= y || (l = e - k, a = e - (k + l) + (l - o), l = n - P, f = n - (P + l) + (l - o), l = t - N, c = t - (N + l) + (l - r), l = i - C, h = i - (C + l) + (l - r), a === 0 && c === 0 && f === 0 && h === 0) || (y = Si * s + bi * Math.abs(F), F += k * h + C * a - (N * f + P * c), F >= y || -F >= y)) return F;
578
+ d = a * C, u = ut * a, p = u - (u - a), _ = a - p, u = ut * C, w = u - (u - C), O = C - w, b = _ * O - (d - p * w - _ * w - p * O), g = c * P, u = ut * c, p = u - (u - c), _ = c - p, u = ut * P, w = u - (u - P), O = P - w, E = _ * O - (g - p * w - _ * w - p * O), M = b - E, l = b - M, yt[0] = b - (M + l) + (l - E), m = d + M, l = m - d, v = d - (m - l) + (M - l), M = v - g, l = v - M, yt[1] = v - (M + l) + (l - g), S = m + M, l = S - m, yt[2] = m - (S - l) + (M - l), yt[3] = S;
579
579
  const I = De(4, Jt, 4, yt, nn);
580
- p = k * h, u = ut * k, d = u - (u - k), _ = k - d, u = ut * h, w = u - (u - h), O = h - w, b = _ * O - (p - d * w - _ * w - d * O), g = N * f, u = ut * N, d = u - (u - N), _ = N - d, u = ut * f, w = u - (u - f), O = f - w, E = _ * O - (g - d * w - _ * w - d * O), M = b - E, c = b - M, yt[0] = b - (M + c) + (c - E), m = p + M, c = m - p, v = p - (m - c) + (M - c), M = v - g, c = v - M, yt[1] = v - (M + c) + (c - g), S = m + M, c = S - m, yt[2] = m - (S - c) + (M - c), yt[3] = S;
580
+ d = k * h, u = ut * k, p = u - (u - k), _ = k - p, u = ut * h, w = u - (u - h), O = h - w, b = _ * O - (d - p * w - _ * w - p * O), g = N * f, u = ut * N, p = u - (u - N), _ = N - p, u = ut * f, w = u - (u - f), O = f - w, E = _ * O - (g - p * w - _ * w - p * O), M = b - E, l = b - M, yt[0] = b - (M + l) + (l - E), m = d + M, l = m - d, v = d - (m - l) + (M - l), M = v - g, l = v - M, yt[1] = v - (M + l) + (l - g), S = m + M, l = S - m, yt[2] = m - (S - l) + (M - l), yt[3] = S;
581
581
  const A = De(I, nn, 4, yt, rn);
582
- p = a * h, u = ut * a, d = u - (u - a), _ = a - d, u = ut * h, w = u - (u - h), O = h - w, b = _ * O - (p - d * w - _ * w - d * O), g = l * f, u = ut * l, d = u - (u - l), _ = l - d, u = ut * f, w = u - (u - f), O = f - w, E = _ * O - (g - d * w - _ * w - d * O), M = b - E, c = b - M, yt[0] = b - (M + c) + (c - E), m = p + M, c = m - p, v = p - (m - c) + (M - c), M = v - g, c = v - M, yt[1] = v - (M + c) + (c - g), S = m + M, c = S - m, yt[2] = m - (S - c) + (M - c), yt[3] = S;
582
+ d = a * h, u = ut * a, p = u - (u - a), _ = a - p, u = ut * h, w = u - (u - h), O = h - w, b = _ * O - (d - p * w - _ * w - p * O), g = c * f, u = ut * c, p = u - (u - c), _ = c - p, u = ut * f, w = u - (u - f), O = f - w, E = _ * O - (g - p * w - _ * w - p * O), M = b - E, l = b - M, yt[0] = b - (M + l) + (l - E), m = d + M, l = m - d, v = d - (m - l) + (M - l), M = v - g, l = v - M, yt[1] = v - (M + l) + (l - g), S = m + M, l = S - m, yt[2] = m - (S - l) + (M - l), yt[3] = S;
583
583
  const T = De(A, rn, 4, yt, on);
584
584
  return on[T - 1];
585
585
  }
586
586
  function sn(e, t, n, i, o, r) {
587
- const s = (t - r) * (n - o), a = (e - o) * (i - r), l = s - a;
588
- if (s === 0 || a === 0 || s > 0 != a > 0) return l;
587
+ const s = (t - r) * (n - o), a = (e - o) * (i - r), c = s - a;
588
+ if (s === 0 || a === 0 || s > 0 != a > 0) return c;
589
589
  const f = Math.abs(s + a);
590
- return Math.abs(l) >= _i * f ? l : -Ei(e, t, n, i, o, r, f);
590
+ return Math.abs(c) >= _i * f ? c : -Ei(e, t, n, i, o, r, f);
591
591
  }
592
592
  function ki(e, t) {
593
593
  const n = new Je([], Un);
@@ -616,8 +616,8 @@ function an(e, t) {
616
616
  for (let r = 0; r < i[o].length; r++) {
617
617
  let s = i[o][r][0], a = null;
618
618
  ge = ge + 1;
619
- for (let l = 0; l < i[o][r].length - 1; l++) {
620
- a = i[o][r][l + 1];
619
+ for (let c = 0; c < i[o][r].length - 1; c++) {
620
+ a = i[o][r][c + 1];
621
621
  const f = new cn(s, me, ge, we), h = new cn(a, me, ge, we + 1);
622
622
  f.otherEvent = h, h.otherEvent = f, Un(f, h) > 0 ? (h.isLeftEndpoint = !0, f.isLeftEndpoint = !1) : (f.isLeftEndpoint = !0, h.isLeftEndpoint = !1), t.push(f), t.push(h), s = a, we = we + 1;
623
623
  }
@@ -648,8 +648,8 @@ function Oi(e, t = !1) {
648
648
  const a = i.data[s];
649
649
  if (t && a.leftSweepEvent.featureId === o.featureId)
650
650
  continue;
651
- const l = Ni(r, a);
652
- l !== !1 && n.push(l);
651
+ const c = Ni(r, a);
652
+ c !== !1 && n.push(c);
653
653
  }
654
654
  i.push(r);
655
655
  } else o.isLeftEndpoint === !1 && i.pop();
@@ -664,9 +664,9 @@ var Pi = class {
664
664
  };
665
665
  function Ni(e, t) {
666
666
  if (e === null || t === null) return !1;
667
- const n = e.leftSweepEvent.p.x, i = e.leftSweepEvent.p.y, o = e.rightSweepEvent.p.x, r = e.rightSweepEvent.p.y, s = t.leftSweepEvent.p.x, a = t.leftSweepEvent.p.y, l = t.rightSweepEvent.p.x, f = t.rightSweepEvent.p.y, h = sn(n, i, o, r, s, a), c = sn(n, i, o, r, l, f);
668
- if (h > 0 && c > 0) return !1;
669
- if (h < 0 && c < 0) return !1;
667
+ const n = e.leftSweepEvent.p.x, i = e.leftSweepEvent.p.y, o = e.rightSweepEvent.p.x, r = e.rightSweepEvent.p.y, s = t.leftSweepEvent.p.x, a = t.leftSweepEvent.p.y, c = t.rightSweepEvent.p.x, f = t.rightSweepEvent.p.y, h = sn(n, i, o, r, s, a), l = sn(n, i, o, r, c, f);
668
+ if (h > 0 && l > 0) return !1;
669
+ if (h < 0 && l < 0) return !1;
670
670
  if (e.leftSweepEvent.ringId === t.leftSweepEvent.ringId) {
671
671
  if (e.rightSweepEvent.isSamePoint(t.leftSweepEvent) || e.rightSweepEvent.isSamePoint(t.rightSweepEvent) || e.leftSweepEvent.isSamePoint(t.leftSweepEvent) || e.leftSweepEvent.isSamePoint(t.rightSweepEvent))
672
672
  return !1;
@@ -680,10 +680,10 @@ function Ni(e, t) {
680
680
  if (e.leftSweepEvent.isSamePoint(t.rightSweepEvent))
681
681
  return t.rightSweepEvent.asNewXY();
682
682
  }
683
- const u = (f - a) * (o - n) - (l - s) * (r - i), d = (l - s) * (i - a) - (f - a) * (n - s), _ = (o - n) * (i - a) - (r - i) * (n - s);
683
+ const u = (f - a) * (o - n) - (c - s) * (r - i), p = (c - s) * (i - a) - (f - a) * (n - s), _ = (o - n) * (i - a) - (r - i) * (n - s);
684
684
  if (u === 0)
685
685
  return !1;
686
- const w = d / u, O = _ / u;
686
+ const w = p / u, O = _ / u;
687
687
  if (w >= 0 && w <= 1 && O >= 0 && O <= 1) {
688
688
  const M = n + w * (o - n), m = i + w * (r - i);
689
689
  return [M, m];
@@ -700,14 +700,14 @@ function Bi(e, t, n = {}) {
700
700
  );
701
701
  let a = [];
702
702
  if (i) {
703
- const l = {};
703
+ const c = {};
704
704
  s.forEach((f) => {
705
705
  const h = f.join(",");
706
- l[h] || (l[h] = !0, a.push(f));
706
+ c[h] || (c[h] = !0, a.push(f));
707
707
  });
708
708
  } else
709
709
  a = s;
710
- return Et(a.map((l) => Rt(l)));
710
+ return Et(a.map((c) => Yt(c)));
711
711
  }
712
712
  function Ti(e) {
713
713
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
@@ -744,7 +744,7 @@ function Xi(e, t = {}) {
744
744
  n += r[0], i += r[1], o++;
745
745
  },
746
746
  !0
747
- ), Rt([n / o, i / o], t.properties);
747
+ ), Yt([n / o, i / o], t.properties);
748
748
  }
749
749
  var ye = { exports: {} }, ke = { exports: {} }, $i = ke.exports, ln;
750
750
  function Di() {
@@ -752,7 +752,7 @@ function Di() {
752
752
  (function(n, i) {
753
753
  e.exports = i();
754
754
  })($i, function() {
755
- function n(m, v, p, b, g) {
755
+ function n(m, v, d, b, g) {
756
756
  (function E(S, k, P, N, C) {
757
757
  for (; N > P; ) {
758
758
  if (N - P > 600) {
@@ -766,11 +766,11 @@ function Di() {
766
766
  }
767
767
  C(S[P], x) === 0 ? i(S, P, $) : i(S, ++$, N), $ <= k && (P = $ + 1), k <= $ && (N = $ - 1);
768
768
  }
769
- })(m, v, p || 0, b || m.length - 1, g || o);
769
+ })(m, v, d || 0, b || m.length - 1, g || o);
770
770
  }
771
- function i(m, v, p) {
771
+ function i(m, v, d) {
772
772
  var b = m[v];
773
- m[v] = m[p], m[p] = b;
773
+ m[v] = m[d], m[d] = b;
774
774
  }
775
775
  function o(m, v) {
776
776
  return m < v ? -1 : m > v ? 1 : 0;
@@ -778,17 +778,17 @@ function Di() {
778
778
  var r = function(m) {
779
779
  m === void 0 && (m = 9), this._maxEntries = Math.max(4, m), this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries)), this.clear();
780
780
  };
781
- function s(m, v, p) {
782
- if (!p) return v.indexOf(m);
783
- for (var b = 0; b < v.length; b++) if (p(m, v[b])) return b;
781
+ function s(m, v, d) {
782
+ if (!d) return v.indexOf(m);
783
+ for (var b = 0; b < v.length; b++) if (d(m, v[b])) return b;
784
784
  return -1;
785
785
  }
786
786
  function a(m, v) {
787
- l(m, 0, m.children.length, v, m);
787
+ c(m, 0, m.children.length, v, m);
788
788
  }
789
- function l(m, v, p, b, g) {
789
+ function c(m, v, d, b, g) {
790
790
  g || (g = O(null)), g.minX = 1 / 0, g.minY = 1 / 0, g.maxX = -1 / 0, g.maxY = -1 / 0;
791
- for (var E = v; E < p; E++) {
791
+ for (var E = v; E < d; E++) {
792
792
  var S = m.children[E];
793
793
  f(g, m.leaf ? b(S) : S);
794
794
  }
@@ -800,13 +800,13 @@ function Di() {
800
800
  function h(m, v) {
801
801
  return m.minX - v.minX;
802
802
  }
803
- function c(m, v) {
803
+ function l(m, v) {
804
804
  return m.minY - v.minY;
805
805
  }
806
806
  function u(m) {
807
807
  return (m.maxX - m.minX) * (m.maxY - m.minY);
808
808
  }
809
- function d(m) {
809
+ function p(m) {
810
810
  return m.maxX - m.minX + (m.maxY - m.minY);
811
811
  }
812
812
  function _(m, v) {
@@ -818,37 +818,37 @@ function Di() {
818
818
  function O(m) {
819
819
  return { children: m, height: 1, leaf: !0, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
820
820
  }
821
- function M(m, v, p, b, g) {
822
- for (var E = [v, p]; E.length; ) if (!((p = E.pop()) - (v = E.pop()) <= b)) {
823
- var S = v + Math.ceil((p - v) / b / 2) * b;
824
- n(m, S, v, p, g), E.push(v, S, S, p);
821
+ function M(m, v, d, b, g) {
822
+ for (var E = [v, d]; E.length; ) if (!((d = E.pop()) - (v = E.pop()) <= b)) {
823
+ var S = v + Math.ceil((d - v) / b / 2) * b;
824
+ n(m, S, v, d, g), E.push(v, S, S, d);
825
825
  }
826
826
  }
827
827
  return r.prototype.all = function() {
828
828
  return this._all(this.data, []);
829
829
  }, r.prototype.search = function(m) {
830
- var v = this.data, p = [];
831
- if (!w(m, v)) return p;
830
+ var v = this.data, d = [];
831
+ if (!w(m, v)) return d;
832
832
  for (var b = this.toBBox, g = []; v; ) {
833
833
  for (var E = 0; E < v.children.length; E++) {
834
834
  var S = v.children[E], k = v.leaf ? b(S) : S;
835
- w(m, k) && (v.leaf ? p.push(S) : _(m, k) ? this._all(S, p) : g.push(S));
835
+ w(m, k) && (v.leaf ? d.push(S) : _(m, k) ? this._all(S, d) : g.push(S));
836
836
  }
837
837
  v = g.pop();
838
838
  }
839
- return p;
839
+ return d;
840
840
  }, r.prototype.collides = function(m) {
841
841
  var v = this.data;
842
842
  if (!w(m, v)) return !1;
843
- for (var p = []; v; ) {
843
+ for (var d = []; v; ) {
844
844
  for (var b = 0; b < v.children.length; b++) {
845
845
  var g = v.children[b], E = v.leaf ? this.toBBox(g) : g;
846
846
  if (w(m, E)) {
847
847
  if (v.leaf || _(m, E)) return !0;
848
- p.push(g);
848
+ d.push(g);
849
849
  }
850
850
  }
851
- v = p.pop();
851
+ v = d.pop();
852
852
  }
853
853
  return !1;
854
854
  }, r.prototype.load = function(m) {
@@ -857,16 +857,16 @@ function Di() {
857
857
  for (var v = 0; v < m.length; v++) this.insert(m[v]);
858
858
  return this;
859
859
  }
860
- var p = this._build(m.slice(), 0, m.length - 1, 0);
861
- if (this.data.children.length) if (this.data.height === p.height) this._splitRoot(this.data, p);
860
+ var d = this._build(m.slice(), 0, m.length - 1, 0);
861
+ if (this.data.children.length) if (this.data.height === d.height) this._splitRoot(this.data, d);
862
862
  else {
863
- if (this.data.height < p.height) {
863
+ if (this.data.height < d.height) {
864
864
  var b = this.data;
865
- this.data = p, p = b;
865
+ this.data = d, d = b;
866
866
  }
867
- this._insert(p, this.data.height - p.height - 1, !0);
867
+ this._insert(d, this.data.height - d.height - 1, !0);
868
868
  }
869
- else this.data = p;
869
+ else this.data = d;
870
870
  return this;
871
871
  }, r.prototype.insert = function(m) {
872
872
  return m && this._insert(m, this.data.height - 1), this;
@@ -874,12 +874,12 @@ function Di() {
874
874
  return this.data = O([]), this;
875
875
  }, r.prototype.remove = function(m, v) {
876
876
  if (!m) return this;
877
- for (var p, b, g, E = this.data, S = this.toBBox(m), k = [], P = []; E || k.length; ) {
878
- if (E || (E = k.pop(), b = k[k.length - 1], p = P.pop(), g = !0), E.leaf) {
877
+ for (var d, b, g, E = this.data, S = this.toBBox(m), k = [], P = []; E || k.length; ) {
878
+ if (E || (E = k.pop(), b = k[k.length - 1], d = P.pop(), g = !0), E.leaf) {
879
879
  var N = s(m, E.children, v);
880
880
  if (N !== -1) return E.children.splice(N, 1), k.push(E), this._condense(k), this;
881
881
  }
882
- g || E.leaf || !_(E, S) ? b ? (p++, E = b.children[p], g = !1) : E = null : (k.push(E), P.push(p), p = 0, b = E, E = E.children[0]);
882
+ g || E.leaf || !_(E, S) ? b ? (d++, E = b.children[d], g = !1) : E = null : (k.push(E), P.push(d), d = 0, b = E, E = E.children[0]);
883
883
  }
884
884
  return this;
885
885
  }, r.prototype.toBBox = function(m) {
@@ -893,16 +893,16 @@ function Di() {
893
893
  }, r.prototype.fromJSON = function(m) {
894
894
  return this.data = m, this;
895
895
  }, r.prototype._all = function(m, v) {
896
- for (var p = []; m; ) m.leaf ? v.push.apply(v, m.children) : p.push.apply(p, m.children), m = p.pop();
896
+ for (var d = []; m; ) m.leaf ? v.push.apply(v, m.children) : d.push.apply(d, m.children), m = d.pop();
897
897
  return v;
898
- }, r.prototype._build = function(m, v, p, b) {
899
- var g, E = p - v + 1, S = this._maxEntries;
900
- if (E <= S) return a(g = O(m.slice(v, p + 1)), this.toBBox), g;
898
+ }, r.prototype._build = function(m, v, d, b) {
899
+ var g, E = d - v + 1, S = this._maxEntries;
900
+ if (E <= S) return a(g = O(m.slice(v, d + 1)), this.toBBox), g;
901
901
  b || (b = Math.ceil(Math.log(E) / Math.log(S)), S = Math.ceil(E / Math.pow(S, b - 1))), (g = O([])).leaf = !1, g.height = b;
902
902
  var k = Math.ceil(E / S), P = k * Math.ceil(Math.sqrt(S));
903
- M(m, v, p, P, this.compareMinX);
904
- for (var N = v; N <= p; N += P) {
905
- var C = Math.min(N + P - 1, p);
903
+ M(m, v, d, P, this.compareMinX);
904
+ for (var N = v; N <= d; N += P) {
905
+ var C = Math.min(N + P - 1, d);
906
906
  M(m, N, C, k, this.compareMinY);
907
907
  for (var F = N; F <= C; F += k) {
908
908
  var y = Math.min(F + k - 1, C);
@@ -910,8 +910,8 @@ function Di() {
910
910
  }
911
911
  }
912
912
  return a(g, this.toBBox), g;
913
- }, r.prototype._chooseSubtree = function(m, v, p, b) {
914
- for (; b.push(v), !v.leaf && b.length - 1 !== p; ) {
913
+ }, r.prototype._chooseSubtree = function(m, v, d, b) {
914
+ for (; b.push(v), !v.leaf && b.length - 1 !== d; ) {
915
915
  for (var g = 1 / 0, E = 1 / 0, S = void 0, k = 0; k < v.children.length; k++) {
916
916
  var P = v.children[k], N = u(P), C = (F = m, y = P, (Math.max(y.maxX, F.maxX) - Math.min(y.minX, F.minX)) * (Math.max(y.maxY, F.maxY) - Math.min(y.minY, F.minY)) - N);
917
917
  C < E ? (E = C, g = N < g ? N : g, S = P) : C === E && N < g && (g = N, S = P);
@@ -920,75 +920,75 @@ function Di() {
920
920
  }
921
921
  var F, y;
922
922
  return v;
923
- }, r.prototype._insert = function(m, v, p) {
924
- var b = p ? m : this.toBBox(m), g = [], E = this._chooseSubtree(b, this.data, v, g);
923
+ }, r.prototype._insert = function(m, v, d) {
924
+ var b = d ? m : this.toBBox(m), g = [], E = this._chooseSubtree(b, this.data, v, g);
925
925
  for (E.children.push(m), f(E, b); v >= 0 && g[v].children.length > this._maxEntries; ) this._split(g, v), v--;
926
926
  this._adjustParentBBoxes(b, g, v);
927
927
  }, r.prototype._split = function(m, v) {
928
- var p = m[v], b = p.children.length, g = this._minEntries;
929
- this._chooseSplitAxis(p, g, b);
930
- var E = this._chooseSplitIndex(p, g, b), S = O(p.children.splice(E, p.children.length - E));
931
- S.height = p.height, S.leaf = p.leaf, a(p, this.toBBox), a(S, this.toBBox), v ? m[v - 1].children.push(S) : this._splitRoot(p, S);
928
+ var d = m[v], b = d.children.length, g = this._minEntries;
929
+ this._chooseSplitAxis(d, g, b);
930
+ var E = this._chooseSplitIndex(d, g, b), S = O(d.children.splice(E, d.children.length - E));
931
+ S.height = d.height, S.leaf = d.leaf, a(d, this.toBBox), a(S, this.toBBox), v ? m[v - 1].children.push(S) : this._splitRoot(d, S);
932
932
  }, r.prototype._splitRoot = function(m, v) {
933
933
  this.data = O([m, v]), this.data.height = m.height + 1, this.data.leaf = !1, a(this.data, this.toBBox);
934
- }, r.prototype._chooseSplitIndex = function(m, v, p) {
935
- for (var b, g, E, S, k, P, N, C = 1 / 0, F = 1 / 0, y = v; y <= p - v; y++) {
936
- var I = l(m, 0, y, this.toBBox), A = l(m, y, p, this.toBBox), T = (g = I, E = A, S = void 0, k = void 0, P = void 0, N = void 0, S = Math.max(g.minX, E.minX), k = Math.max(g.minY, E.minY), P = Math.min(g.maxX, E.maxX), N = Math.min(g.maxY, E.maxY), Math.max(0, P - S) * Math.max(0, N - k)), X = u(I) + u(A);
934
+ }, r.prototype._chooseSplitIndex = function(m, v, d) {
935
+ for (var b, g, E, S, k, P, N, C = 1 / 0, F = 1 / 0, y = v; y <= d - v; y++) {
936
+ var I = c(m, 0, y, this.toBBox), A = c(m, y, d, this.toBBox), T = (g = I, E = A, S = void 0, k = void 0, P = void 0, N = void 0, S = Math.max(g.minX, E.minX), k = Math.max(g.minY, E.minY), P = Math.min(g.maxX, E.maxX), N = Math.min(g.maxY, E.maxY), Math.max(0, P - S) * Math.max(0, N - k)), X = u(I) + u(A);
937
937
  T < C ? (C = T, b = y, F = X < F ? X : F) : T === C && X < F && (F = X, b = y);
938
938
  }
939
- return b || p - v;
940
- }, r.prototype._chooseSplitAxis = function(m, v, p) {
941
- var b = m.leaf ? this.compareMinX : h, g = m.leaf ? this.compareMinY : c;
942
- this._allDistMargin(m, v, p, b) < this._allDistMargin(m, v, p, g) && m.children.sort(b);
943
- }, r.prototype._allDistMargin = function(m, v, p, b) {
939
+ return b || d - v;
940
+ }, r.prototype._chooseSplitAxis = function(m, v, d) {
941
+ var b = m.leaf ? this.compareMinX : h, g = m.leaf ? this.compareMinY : l;
942
+ this._allDistMargin(m, v, d, b) < this._allDistMargin(m, v, d, g) && m.children.sort(b);
943
+ }, r.prototype._allDistMargin = function(m, v, d, b) {
944
944
  m.children.sort(b);
945
- for (var g = this.toBBox, E = l(m, 0, v, g), S = l(m, p - v, p, g), k = d(E) + d(S), P = v; P < p - v; P++) {
945
+ for (var g = this.toBBox, E = c(m, 0, v, g), S = c(m, d - v, d, g), k = p(E) + p(S), P = v; P < d - v; P++) {
946
946
  var N = m.children[P];
947
- f(E, m.leaf ? g(N) : N), k += d(E);
947
+ f(E, m.leaf ? g(N) : N), k += p(E);
948
948
  }
949
- for (var C = p - v - 1; C >= v; C--) {
949
+ for (var C = d - v - 1; C >= v; C--) {
950
950
  var F = m.children[C];
951
- f(S, m.leaf ? g(F) : F), k += d(S);
951
+ f(S, m.leaf ? g(F) : F), k += p(S);
952
952
  }
953
953
  return k;
954
- }, r.prototype._adjustParentBBoxes = function(m, v, p) {
955
- for (var b = p; b >= 0; b--) f(v[b], m);
954
+ }, r.prototype._adjustParentBBoxes = function(m, v, d) {
955
+ for (var b = d; b >= 0; b--) f(v[b], m);
956
956
  }, r.prototype._condense = function(m) {
957
- for (var v = m.length - 1, p = void 0; v >= 0; v--) m[v].children.length === 0 ? v > 0 ? (p = m[v - 1].children).splice(p.indexOf(m[v]), 1) : this.clear() : a(m[v], this.toBBox);
957
+ for (var v = m.length - 1, d = void 0; v >= 0; v--) m[v].children.length === 0 ? v > 0 ? (d = m[v - 1].children).splice(d.indexOf(m[v]), 1) : this.clear() : a(m[v], this.toBBox);
958
958
  }, r;
959
959
  });
960
960
  })(ke)), ke.exports;
961
961
  }
962
962
  const Fi = /* @__PURE__ */ Ci(vi);
963
963
  var Zt = { exports: {} }, Fe, fn;
964
- function Yi() {
964
+ function Ri() {
965
965
  return fn || (fn = 1, Fe = function(t, n, i, o) {
966
966
  var r = t[0], s = t[1], a = !1;
967
967
  i === void 0 && (i = 0), o === void 0 && (o = n.length);
968
- for (var l = (o - i) / 2, f = 0, h = l - 1; f < l; h = f++) {
969
- var c = n[i + f * 2 + 0], u = n[i + f * 2 + 1], d = n[i + h * 2 + 0], _ = n[i + h * 2 + 1], w = u > s != _ > s && r < (d - c) * (s - u) / (_ - u) + c;
968
+ for (var c = (o - i) / 2, f = 0, h = c - 1; f < c; h = f++) {
969
+ var l = n[i + f * 2 + 0], u = n[i + f * 2 + 1], p = n[i + h * 2 + 0], _ = n[i + h * 2 + 1], w = u > s != _ > s && r < (p - l) * (s - u) / (_ - u) + l;
970
970
  w && (a = !a);
971
971
  }
972
972
  return a;
973
973
  }), Fe;
974
974
  }
975
- var Ye, hn;
976
- function Ri() {
977
- return hn || (hn = 1, Ye = function(t, n, i, o) {
975
+ var Re, hn;
976
+ function Yi() {
977
+ return hn || (hn = 1, Re = function(t, n, i, o) {
978
978
  var r = t[0], s = t[1], a = !1;
979
979
  i === void 0 && (i = 0), o === void 0 && (o = n.length);
980
- for (var l = o - i, f = 0, h = l - 1; f < l; h = f++) {
981
- var c = n[f + i][0], u = n[f + i][1], d = n[h + i][0], _ = n[h + i][1], w = u > s != _ > s && r < (d - c) * (s - u) / (_ - u) + c;
980
+ for (var c = o - i, f = 0, h = c - 1; f < c; h = f++) {
981
+ var l = n[f + i][0], u = n[f + i][1], p = n[h + i][0], _ = n[h + i][1], w = u > s != _ > s && r < (p - l) * (s - u) / (_ - u) + l;
982
982
  w && (a = !a);
983
983
  }
984
984
  return a;
985
- }), Ye;
985
+ }), Re;
986
986
  }
987
987
  var un;
988
988
  function Li() {
989
989
  if (un) return Zt.exports;
990
990
  un = 1;
991
- var e = Yi(), t = Ri();
991
+ var e = Ri(), t = Yi();
992
992
  return Zt.exports = function(i, o, r, s) {
993
993
  return o.length > 0 && Array.isArray(o[0]) ? t(i, o, r, s) : e(i, o, r, s);
994
994
  }, Zt.exports.nested = t, Zt.exports.flat = e, Zt.exports;
@@ -1001,42 +1001,42 @@ function Ui() {
1001
1001
  })(Vi, function(n) {
1002
1002
  const o = 33306690738754706e-32;
1003
1003
  function r(w, O, M, m, v) {
1004
- let p, b, g, E, S = O[0], k = m[0], P = 0, N = 0;
1005
- k > S == k > -S ? (p = S, S = O[++P]) : (p = k, k = m[++N]);
1004
+ let d, b, g, E, S = O[0], k = m[0], P = 0, N = 0;
1005
+ k > S == k > -S ? (d = S, S = O[++P]) : (d = k, k = m[++N]);
1006
1006
  let C = 0;
1007
- if (P < w && N < M) for (k > S == k > -S ? (g = p - ((b = S + p) - S), S = O[++P]) : (g = p - ((b = k + p) - k), k = m[++N]), p = b, g !== 0 && (v[C++] = g); P < w && N < M; ) k > S == k > -S ? (g = p - ((b = p + S) - (E = b - p)) + (S - E), S = O[++P]) : (g = p - ((b = p + k) - (E = b - p)) + (k - E), k = m[++N]), p = b, g !== 0 && (v[C++] = g);
1008
- for (; P < w; ) g = p - ((b = p + S) - (E = b - p)) + (S - E), S = O[++P], p = b, g !== 0 && (v[C++] = g);
1009
- for (; N < M; ) g = p - ((b = p + k) - (E = b - p)) + (k - E), k = m[++N], p = b, g !== 0 && (v[C++] = g);
1010
- return p === 0 && C !== 0 || (v[C++] = p), C;
1007
+ if (P < w && N < M) for (k > S == k > -S ? (g = d - ((b = S + d) - S), S = O[++P]) : (g = d - ((b = k + d) - k), k = m[++N]), d = b, g !== 0 && (v[C++] = g); P < w && N < M; ) k > S == k > -S ? (g = d - ((b = d + S) - (E = b - d)) + (S - E), S = O[++P]) : (g = d - ((b = d + k) - (E = b - d)) + (k - E), k = m[++N]), d = b, g !== 0 && (v[C++] = g);
1008
+ for (; P < w; ) g = d - ((b = d + S) - (E = b - d)) + (S - E), S = O[++P], d = b, g !== 0 && (v[C++] = g);
1009
+ for (; N < M; ) g = d - ((b = d + k) - (E = b - d)) + (k - E), k = m[++N], d = b, g !== 0 && (v[C++] = g);
1010
+ return d === 0 && C !== 0 || (v[C++] = d), C;
1011
1011
  }
1012
1012
  function s(w) {
1013
1013
  return new Float64Array(w);
1014
1014
  }
1015
- const a = 33306690738754716e-32, l = 22204460492503146e-32, f = 11093356479670487e-47, h = s(4), c = s(8), u = s(12), d = s(16), _ = s(4);
1016
- n.orient2d = function(w, O, M, m, v, p) {
1017
- const b = (O - p) * (M - v), g = (w - v) * (m - p), E = b - g;
1015
+ const a = 33306690738754716e-32, c = 22204460492503146e-32, f = 11093356479670487e-47, h = s(4), l = s(8), u = s(12), p = s(16), _ = s(4);
1016
+ n.orient2d = function(w, O, M, m, v, d) {
1017
+ const b = (O - d) * (M - v), g = (w - v) * (m - d), E = b - g;
1018
1018
  if (b === 0 || g === 0 || b > 0 != g > 0) return E;
1019
1019
  const S = Math.abs(b + g);
1020
1020
  return Math.abs(E) >= a * S ? E : -(function(k, P, N, C, F, y, I) {
1021
- let A, T, X, D, x, B, $, Y, L, V, j, U, G, J, Q, H, Z, W;
1021
+ let A, T, X, D, x, B, $, R, L, V, j, U, G, J, Q, H, Z, W;
1022
1022
  const st = k - F, ft = N - F, rt = P - y, ot = C - y;
1023
- x = (Q = (Y = st - ($ = (B = 134217729 * st) - (B - st))) * (V = ot - (L = (B = 134217729 * ot) - (B - ot))) - ((J = st * ot) - $ * L - Y * L - $ * V)) - (j = Q - (Z = (Y = rt - ($ = (B = 134217729 * rt) - (B - rt))) * (V = ft - (L = (B = 134217729 * ft) - (B - ft))) - ((H = rt * ft) - $ * L - Y * L - $ * V))), h[0] = Q - (j + x) + (x - Z), x = (G = J - ((U = J + j) - (x = U - J)) + (j - x)) - (j = G - H), h[1] = G - (j + x) + (x - H), x = (W = U + j) - U, h[2] = U - (W - x) + (j - x), h[3] = W;
1023
+ x = (Q = (R = st - ($ = (B = 134217729 * st) - (B - st))) * (V = ot - (L = (B = 134217729 * ot) - (B - ot))) - ((J = st * ot) - $ * L - R * L - $ * V)) - (j = Q - (Z = (R = rt - ($ = (B = 134217729 * rt) - (B - rt))) * (V = ft - (L = (B = 134217729 * ft) - (B - ft))) - ((H = rt * ft) - $ * L - R * L - $ * V))), h[0] = Q - (j + x) + (x - Z), x = (G = J - ((U = J + j) - (x = U - J)) + (j - x)) - (j = G - H), h[1] = G - (j + x) + (x - H), x = (W = U + j) - U, h[2] = U - (W - x) + (j - x), h[3] = W;
1024
1024
  let Ct = (function(ri, Ke) {
1025
1025
  let Qe = Ke[0];
1026
1026
  for (let Ie = 1; Ie < ri; Ie++) Qe += Ke[Ie];
1027
1027
  return Qe;
1028
- })(4, h), Wt = l * I;
1028
+ })(4, h), Wt = c * I;
1029
1029
  if (Ct >= Wt || -Ct >= Wt || (A = k - (st + (x = k - st)) + (x - F), X = N - (ft + (x = N - ft)) + (x - F), T = P - (rt + (x = P - rt)) + (x - y), D = C - (ot + (x = C - ot)) + (x - y), A === 0 && T === 0 && X === 0 && D === 0) || (Wt = f * I + o * Math.abs(Ct), (Ct += st * D + ot * A - (rt * X + ft * T)) >= Wt || -Ct >= Wt)) return Ct;
1030
- x = (Q = (Y = A - ($ = (B = 134217729 * A) - (B - A))) * (V = ot - (L = (B = 134217729 * ot) - (B - ot))) - ((J = A * ot) - $ * L - Y * L - $ * V)) - (j = Q - (Z = (Y = T - ($ = (B = 134217729 * T) - (B - T))) * (V = ft - (L = (B = 134217729 * ft) - (B - ft))) - ((H = T * ft) - $ * L - Y * L - $ * V))), _[0] = Q - (j + x) + (x - Z), x = (G = J - ((U = J + j) - (x = U - J)) + (j - x)) - (j = G - H), _[1] = G - (j + x) + (x - H), x = (W = U + j) - U, _[2] = U - (W - x) + (j - x), _[3] = W;
1031
- const ei = r(4, h, 4, _, c);
1032
- x = (Q = (Y = st - ($ = (B = 134217729 * st) - (B - st))) * (V = D - (L = (B = 134217729 * D) - (B - D))) - ((J = st * D) - $ * L - Y * L - $ * V)) - (j = Q - (Z = (Y = rt - ($ = (B = 134217729 * rt) - (B - rt))) * (V = X - (L = (B = 134217729 * X) - (B - X))) - ((H = rt * X) - $ * L - Y * L - $ * V))), _[0] = Q - (j + x) + (x - Z), x = (G = J - ((U = J + j) - (x = U - J)) + (j - x)) - (j = G - H), _[1] = G - (j + x) + (x - H), x = (W = U + j) - U, _[2] = U - (W - x) + (j - x), _[3] = W;
1033
- const ni = r(ei, c, 4, _, u);
1034
- x = (Q = (Y = A - ($ = (B = 134217729 * A) - (B - A))) * (V = D - (L = (B = 134217729 * D) - (B - D))) - ((J = A * D) - $ * L - Y * L - $ * V)) - (j = Q - (Z = (Y = T - ($ = (B = 134217729 * T) - (B - T))) * (V = X - (L = (B = 134217729 * X) - (B - X))) - ((H = T * X) - $ * L - Y * L - $ * V))), _[0] = Q - (j + x) + (x - Z), x = (G = J - ((U = J + j) - (x = U - J)) + (j - x)) - (j = G - H), _[1] = G - (j + x) + (x - H), x = (W = U + j) - U, _[2] = U - (W - x) + (j - x), _[3] = W;
1035
- const ii = r(ni, u, 4, _, d);
1036
- return d[ii - 1];
1037
- })(w, O, M, m, v, p, S);
1038
- }, n.orient2dfast = function(w, O, M, m, v, p) {
1039
- return (O - p) * (M - v) - (w - v) * (m - p);
1030
+ x = (Q = (R = A - ($ = (B = 134217729 * A) - (B - A))) * (V = ot - (L = (B = 134217729 * ot) - (B - ot))) - ((J = A * ot) - $ * L - R * L - $ * V)) - (j = Q - (Z = (R = T - ($ = (B = 134217729 * T) - (B - T))) * (V = ft - (L = (B = 134217729 * ft) - (B - ft))) - ((H = T * ft) - $ * L - R * L - $ * V))), _[0] = Q - (j + x) + (x - Z), x = (G = J - ((U = J + j) - (x = U - J)) + (j - x)) - (j = G - H), _[1] = G - (j + x) + (x - H), x = (W = U + j) - U, _[2] = U - (W - x) + (j - x), _[3] = W;
1031
+ const ei = r(4, h, 4, _, l);
1032
+ x = (Q = (R = st - ($ = (B = 134217729 * st) - (B - st))) * (V = D - (L = (B = 134217729 * D) - (B - D))) - ((J = st * D) - $ * L - R * L - $ * V)) - (j = Q - (Z = (R = rt - ($ = (B = 134217729 * rt) - (B - rt))) * (V = X - (L = (B = 134217729 * X) - (B - X))) - ((H = rt * X) - $ * L - R * L - $ * V))), _[0] = Q - (j + x) + (x - Z), x = (G = J - ((U = J + j) - (x = U - J)) + (j - x)) - (j = G - H), _[1] = G - (j + x) + (x - H), x = (W = U + j) - U, _[2] = U - (W - x) + (j - x), _[3] = W;
1033
+ const ni = r(ei, l, 4, _, u);
1034
+ x = (Q = (R = A - ($ = (B = 134217729 * A) - (B - A))) * (V = D - (L = (B = 134217729 * D) - (B - D))) - ((J = A * D) - $ * L - R * L - $ * V)) - (j = Q - (Z = (R = T - ($ = (B = 134217729 * T) - (B - T))) * (V = X - (L = (B = 134217729 * X) - (B - X))) - ((H = T * X) - $ * L - R * L - $ * V))), _[0] = Q - (j + x) + (x - Z), x = (G = J - ((U = J + j) - (x = U - J)) + (j - x)) - (j = G - H), _[1] = G - (j + x) + (x - H), x = (W = U + j) - U, _[2] = U - (W - x) + (j - x), _[3] = W;
1035
+ const ii = r(ni, u, 4, _, p);
1036
+ return p[ii - 1];
1037
+ })(w, O, M, m, v, d, S);
1038
+ }, n.orient2dfast = function(w, O, M, m, v, d) {
1039
+ return (O - d) * (M - v) - (w - v) * (m - d);
1040
1040
  }, Object.defineProperty(n, "__esModule", { value: !0 });
1041
1041
  });
1042
1042
  })(ee, ee.exports)), ee.exports;
@@ -1047,9 +1047,9 @@ function ji() {
1047
1047
  pn = 1;
1048
1048
  var e = Di(), t = Fi, n = Li(), i = Ui().orient2d;
1049
1049
  t.default && (t = t.default), ye.exports = o, ye.exports.default = o;
1050
- function o(p, b, g) {
1050
+ function o(d, b, g) {
1051
1051
  b = Math.max(0, b === void 0 ? 2 : b), g = g || 0;
1052
- var E = d(p), S = new e(16);
1052
+ var E = p(d), S = new e(16);
1053
1053
  S.toBBox = function($) {
1054
1054
  return {
1055
1055
  minX: $[0],
@@ -1057,11 +1057,11 @@ function ji() {
1057
1057
  maxX: $[0],
1058
1058
  maxY: $[1]
1059
1059
  };
1060
- }, S.compareMinX = function($, Y) {
1061
- return $[0] - Y[0];
1062
- }, S.compareMinY = function($, Y) {
1063
- return $[1] - Y[1];
1064
- }, S.load(p);
1060
+ }, S.compareMinX = function($, R) {
1061
+ return $[0] - R[0];
1062
+ }, S.compareMinY = function($, R) {
1063
+ return $[1] - R[1];
1064
+ }, S.load(d);
1065
1065
  for (var k = [], P = 0, N; P < E.length; P++) {
1066
1066
  var C = E[P];
1067
1067
  S.remove(C), N = _(C, N), k.push(N);
@@ -1082,8 +1082,8 @@ function ji() {
1082
1082
  while (A !== N);
1083
1083
  return B.push(A.p), B;
1084
1084
  }
1085
- function r(p, b, g, E, S, k, P) {
1086
- for (var N = new t([], s), C = p.data; C; ) {
1085
+ function r(d, b, g, E, S, k, P) {
1086
+ for (var N = new t([], s), C = d.data; C; ) {
1087
1087
  for (var F = 0; F < C.children.length; F++) {
1088
1088
  var y = C.children[F], I = C.leaf ? O(y, g, E) : a(g, E, y);
1089
1089
  I > k || N.push({
@@ -1099,51 +1099,51 @@ function ji() {
1099
1099
  }
1100
1100
  return null;
1101
1101
  }
1102
- function s(p, b) {
1103
- return p.dist - b.dist;
1102
+ function s(d, b) {
1103
+ return d.dist - b.dist;
1104
1104
  }
1105
- function a(p, b, g) {
1106
- if (l(p, g) || l(b, g)) return 0;
1107
- var E = M(p[0], p[1], b[0], b[1], g.minX, g.minY, g.maxX, g.minY);
1105
+ function a(d, b, g) {
1106
+ if (c(d, g) || c(b, g)) return 0;
1107
+ var E = M(d[0], d[1], b[0], b[1], g.minX, g.minY, g.maxX, g.minY);
1108
1108
  if (E === 0) return 0;
1109
- var S = M(p[0], p[1], b[0], b[1], g.minX, g.minY, g.minX, g.maxY);
1109
+ var S = M(d[0], d[1], b[0], b[1], g.minX, g.minY, g.minX, g.maxY);
1110
1110
  if (S === 0) return 0;
1111
- var k = M(p[0], p[1], b[0], b[1], g.maxX, g.minY, g.maxX, g.maxY);
1111
+ var k = M(d[0], d[1], b[0], b[1], g.maxX, g.minY, g.maxX, g.maxY);
1112
1112
  if (k === 0) return 0;
1113
- var P = M(p[0], p[1], b[0], b[1], g.minX, g.maxY, g.maxX, g.maxY);
1113
+ var P = M(d[0], d[1], b[0], b[1], g.minX, g.maxY, g.maxX, g.maxY);
1114
1114
  return P === 0 ? 0 : Math.min(E, S, k, P);
1115
1115
  }
1116
- function l(p, b) {
1117
- return p[0] >= b.minX && p[0] <= b.maxX && p[1] >= b.minY && p[1] <= b.maxY;
1116
+ function c(d, b) {
1117
+ return d[0] >= b.minX && d[0] <= b.maxX && d[1] >= b.minY && d[1] <= b.maxY;
1118
1118
  }
1119
- function f(p, b, g) {
1120
- for (var E = Math.min(p[0], b[0]), S = Math.min(p[1], b[1]), k = Math.max(p[0], b[0]), P = Math.max(p[1], b[1]), N = g.search({ minX: E, minY: S, maxX: k, maxY: P }), C = 0; C < N.length; C++)
1121
- if (c(N[C].p, N[C].next.p, p, b)) return !1;
1119
+ function f(d, b, g) {
1120
+ for (var E = Math.min(d[0], b[0]), S = Math.min(d[1], b[1]), k = Math.max(d[0], b[0]), P = Math.max(d[1], b[1]), N = g.search({ minX: E, minY: S, maxX: k, maxY: P }), C = 0; C < N.length; C++)
1121
+ if (l(N[C].p, N[C].next.p, d, b)) return !1;
1122
1122
  return !0;
1123
1123
  }
1124
- function h(p, b, g) {
1125
- return i(p[0], p[1], b[0], b[1], g[0], g[1]);
1124
+ function h(d, b, g) {
1125
+ return i(d[0], d[1], b[0], b[1], g[0], g[1]);
1126
1126
  }
1127
- function c(p, b, g, E) {
1128
- return p !== E && b !== g && h(p, b, g) > 0 != h(p, b, E) > 0 && h(g, E, p) > 0 != h(g, E, b) > 0;
1127
+ function l(d, b, g, E) {
1128
+ return d !== E && b !== g && h(d, b, g) > 0 != h(d, b, E) > 0 && h(g, E, d) > 0 != h(g, E, b) > 0;
1129
1129
  }
1130
- function u(p) {
1131
- var b = p.p, g = p.next.p;
1132
- return p.minX = Math.min(b[0], g[0]), p.minY = Math.min(b[1], g[1]), p.maxX = Math.max(b[0], g[0]), p.maxY = Math.max(b[1], g[1]), p;
1130
+ function u(d) {
1131
+ var b = d.p, g = d.next.p;
1132
+ return d.minX = Math.min(b[0], g[0]), d.minY = Math.min(b[1], g[1]), d.maxX = Math.max(b[0], g[0]), d.maxY = Math.max(b[1], g[1]), d;
1133
1133
  }
1134
- function d(p) {
1135
- for (var b = p[0], g = p[0], E = p[0], S = p[0], k = 0; k < p.length; k++) {
1136
- var P = p[k];
1134
+ function p(d) {
1135
+ for (var b = d[0], g = d[0], E = d[0], S = d[0], k = 0; k < d.length; k++) {
1136
+ var P = d[k];
1137
1137
  P[0] < b[0] && (b = P), P[0] > E[0] && (E = P), P[1] < g[1] && (g = P), P[1] > S[1] && (S = P);
1138
1138
  }
1139
1139
  var N = [b, g, E, S], C = N.slice();
1140
- for (k = 0; k < p.length; k++)
1141
- n(p[k], N) || C.push(p[k]);
1140
+ for (k = 0; k < d.length; k++)
1141
+ n(d[k], N) || C.push(d[k]);
1142
1142
  return v(C);
1143
1143
  }
1144
- function _(p, b) {
1144
+ function _(d, b) {
1145
1145
  var g = {
1146
- p,
1146
+ p: d,
1147
1147
  prev: null,
1148
1148
  next: null,
1149
1149
  minX: 0,
@@ -1153,38 +1153,38 @@ function ji() {
1153
1153
  };
1154
1154
  return b ? (g.next = b.next, g.prev = b, b.next.prev = g, b.next = g) : (g.prev = g, g.next = g), g;
1155
1155
  }
1156
- function w(p, b) {
1157
- var g = p[0] - b[0], E = p[1] - b[1];
1156
+ function w(d, b) {
1157
+ var g = d[0] - b[0], E = d[1] - b[1];
1158
1158
  return g * g + E * E;
1159
1159
  }
1160
- function O(p, b, g) {
1160
+ function O(d, b, g) {
1161
1161
  var E = b[0], S = b[1], k = g[0] - E, P = g[1] - S;
1162
1162
  if (k !== 0 || P !== 0) {
1163
- var N = ((p[0] - E) * k + (p[1] - S) * P) / (k * k + P * P);
1163
+ var N = ((d[0] - E) * k + (d[1] - S) * P) / (k * k + P * P);
1164
1164
  N > 1 ? (E = g[0], S = g[1]) : N > 0 && (E += k * N, S += P * N);
1165
1165
  }
1166
- return k = p[0] - E, P = p[1] - S, k * k + P * P;
1166
+ return k = d[0] - E, P = d[1] - S, k * k + P * P;
1167
1167
  }
1168
- function M(p, b, g, E, S, k, P, N) {
1169
- var C = g - p, F = E - b, y = P - S, I = N - k, A = p - S, T = b - k, X = C * C + F * F, D = C * y + F * I, x = y * y + I * I, B = C * A + F * T, $ = y * A + I * T, Y = X * x - D * D, L, V, j, U, G = Y, J = Y;
1170
- Y === 0 ? (V = 0, G = 1, U = $, J = x) : (V = D * $ - x * B, U = X * $ - D * B, V < 0 ? (V = 0, U = $, J = x) : V > G && (V = G, U = $ + D, J = x)), U < 0 ? (U = 0, -B < 0 ? V = 0 : -B > X ? V = G : (V = -B, G = X)) : U > J && (U = J, -B + D < 0 ? V = 0 : -B + D > X ? V = G : (V = -B + D, G = X)), L = V === 0 ? 0 : V / G, j = U === 0 ? 0 : U / J;
1171
- var Q = (1 - L) * p + L * g, H = (1 - L) * b + L * E, Z = (1 - j) * S + j * P, W = (1 - j) * k + j * N, st = Z - Q, ft = W - H;
1168
+ function M(d, b, g, E, S, k, P, N) {
1169
+ var C = g - d, F = E - b, y = P - S, I = N - k, A = d - S, T = b - k, X = C * C + F * F, D = C * y + F * I, x = y * y + I * I, B = C * A + F * T, $ = y * A + I * T, R = X * x - D * D, L, V, j, U, G = R, J = R;
1170
+ R === 0 ? (V = 0, G = 1, U = $, J = x) : (V = D * $ - x * B, U = X * $ - D * B, V < 0 ? (V = 0, U = $, J = x) : V > G && (V = G, U = $ + D, J = x)), U < 0 ? (U = 0, -B < 0 ? V = 0 : -B > X ? V = G : (V = -B, G = X)) : U > J && (U = J, -B + D < 0 ? V = 0 : -B + D > X ? V = G : (V = -B + D, G = X)), L = V === 0 ? 0 : V / G, j = U === 0 ? 0 : U / J;
1171
+ var Q = (1 - L) * d + L * g, H = (1 - L) * b + L * E, Z = (1 - j) * S + j * P, W = (1 - j) * k + j * N, st = Z - Q, ft = W - H;
1172
1172
  return st * st + ft * ft;
1173
1173
  }
1174
- function m(p, b) {
1175
- return p[0] === b[0] ? p[1] - b[1] : p[0] - b[0];
1174
+ function m(d, b) {
1175
+ return d[0] === b[0] ? d[1] - b[1] : d[0] - b[0];
1176
1176
  }
1177
- function v(p) {
1178
- p.sort(m);
1179
- for (var b = [], g = 0; g < p.length; g++) {
1180
- for (; b.length >= 2 && h(b[b.length - 2], b[b.length - 1], p[g]) <= 0; )
1177
+ function v(d) {
1178
+ d.sort(m);
1179
+ for (var b = [], g = 0; g < d.length; g++) {
1180
+ for (; b.length >= 2 && h(b[b.length - 2], b[b.length - 1], d[g]) <= 0; )
1181
1181
  b.pop();
1182
- b.push(p[g]);
1182
+ b.push(d[g]);
1183
1183
  }
1184
- for (var E = [], S = p.length - 1; S >= 0; S--) {
1185
- for (; E.length >= 2 && h(E[E.length - 2], E[E.length - 1], p[S]) <= 0; )
1184
+ for (var E = [], S = d.length - 1; S >= 0; S--) {
1185
+ for (; E.length >= 2 && h(E[E.length - 2], E[E.length - 1], d[S]) <= 0; )
1186
1186
  E.pop();
1187
- E.push(p[S]);
1187
+ E.push(d[S]);
1188
1188
  }
1189
1189
  return E.pop(), b.pop(), b.concat(E);
1190
1190
  }
@@ -1273,18 +1273,18 @@ function Gi(e) {
1273
1273
  return e.type === "Feature" ? e.geometry : e;
1274
1274
  }
1275
1275
  const Tt = 11102230246251565e-32, dt = 134217729, Ki = (3 + 8 * Tt) * Tt;
1276
- function Re(e, t, n, i, o) {
1277
- let r, s, a, l, f = t[0], h = i[0], c = 0, u = 0;
1278
- h > f == h > -f ? (r = f, f = t[++c]) : (r = h, h = i[++u]);
1279
- let d = 0;
1280
- if (c < e && u < n)
1281
- for (h > f == h > -f ? (s = f + r, a = r - (s - f), f = t[++c]) : (s = h + r, a = r - (s - h), h = i[++u]), r = s, a !== 0 && (o[d++] = a); c < e && u < n; )
1282
- h > f == h > -f ? (s = r + f, l = s - r, a = r - (s - l) + (f - l), f = t[++c]) : (s = r + h, l = s - r, a = r - (s - l) + (h - l), h = i[++u]), r = s, a !== 0 && (o[d++] = a);
1283
- for (; c < e; )
1284
- s = r + f, l = s - r, a = r - (s - l) + (f - l), f = t[++c], r = s, a !== 0 && (o[d++] = a);
1276
+ function Ye(e, t, n, i, o) {
1277
+ let r, s, a, c, f = t[0], h = i[0], l = 0, u = 0;
1278
+ h > f == h > -f ? (r = f, f = t[++l]) : (r = h, h = i[++u]);
1279
+ let p = 0;
1280
+ if (l < e && u < n)
1281
+ for (h > f == h > -f ? (s = f + r, a = r - (s - f), f = t[++l]) : (s = h + r, a = r - (s - h), h = i[++u]), r = s, a !== 0 && (o[p++] = a); l < e && u < n; )
1282
+ h > f == h > -f ? (s = r + f, c = s - r, a = r - (s - c) + (f - c), f = t[++l]) : (s = r + h, c = s - r, a = r - (s - c) + (h - c), h = i[++u]), r = s, a !== 0 && (o[p++] = a);
1283
+ for (; l < e; )
1284
+ s = r + f, c = s - r, a = r - (s - c) + (f - c), f = t[++l], r = s, a !== 0 && (o[p++] = a);
1285
1285
  for (; u < n; )
1286
- s = r + h, l = s - r, a = r - (s - l) + (h - l), h = i[++u], r = s, a !== 0 && (o[d++] = a);
1287
- return (r !== 0 || d === 0) && (o[d++] = r), d;
1286
+ s = r + h, c = s - r, a = r - (s - c) + (h - c), h = i[++u], r = s, a !== 0 && (o[p++] = a);
1287
+ return (r !== 0 || p === 0) && (o[p++] = r), p;
1288
1288
  }
1289
1289
  function Qi(e, t) {
1290
1290
  let n = t[0];
@@ -1296,40 +1296,40 @@ function he(e) {
1296
1296
  }
1297
1297
  const Hi = (3 + 16 * Tt) * Tt, Wi = (2 + 12 * Tt) * Tt, Zi = (9 + 64 * Tt) * Tt * Tt, Gt = he(4), yn = he(8), vn = he(12), bn = he(16), vt = he(4);
1298
1298
  function tr(e, t, n, i, o, r, s) {
1299
- let a, l, f, h, c, u, d, _, w, O, M, m, v, p, b, g, E, S;
1299
+ let a, c, f, h, l, u, p, _, w, O, M, m, v, d, b, g, E, S;
1300
1300
  const k = e - o, P = n - o, N = t - r, C = i - r;
1301
- p = k * C, u = dt * k, d = u - (u - k), _ = k - d, u = dt * C, w = u - (u - C), O = C - w, b = _ * O - (p - d * w - _ * w - d * O), g = N * P, u = dt * N, d = u - (u - N), _ = N - d, u = dt * P, w = u - (u - P), O = P - w, E = _ * O - (g - d * w - _ * w - d * O), M = b - E, c = b - M, Gt[0] = b - (M + c) + (c - E), m = p + M, c = m - p, v = p - (m - c) + (M - c), M = v - g, c = v - M, Gt[1] = v - (M + c) + (c - g), S = m + M, c = S - m, Gt[2] = m - (S - c) + (M - c), Gt[3] = S;
1301
+ d = k * C, u = dt * k, p = u - (u - k), _ = k - p, u = dt * C, w = u - (u - C), O = C - w, b = _ * O - (d - p * w - _ * w - p * O), g = N * P, u = dt * N, p = u - (u - N), _ = N - p, u = dt * P, w = u - (u - P), O = P - w, E = _ * O - (g - p * w - _ * w - p * O), M = b - E, l = b - M, Gt[0] = b - (M + l) + (l - E), m = d + M, l = m - d, v = d - (m - l) + (M - l), M = v - g, l = v - M, Gt[1] = v - (M + l) + (l - g), S = m + M, l = S - m, Gt[2] = m - (S - l) + (M - l), Gt[3] = S;
1302
1302
  let F = Qi(4, Gt), y = Wi * s;
1303
- if (F >= y || -F >= y || (c = e - k, a = e - (k + c) + (c - o), c = n - P, f = n - (P + c) + (c - o), c = t - N, l = t - (N + c) + (c - r), c = i - C, h = i - (C + c) + (c - r), a === 0 && l === 0 && f === 0 && h === 0) || (y = Zi * s + Ki * Math.abs(F), F += k * h + C * a - (N * f + P * l), F >= y || -F >= y)) return F;
1304
- p = a * C, u = dt * a, d = u - (u - a), _ = a - d, u = dt * C, w = u - (u - C), O = C - w, b = _ * O - (p - d * w - _ * w - d * O), g = l * P, u = dt * l, d = u - (u - l), _ = l - d, u = dt * P, w = u - (u - P), O = P - w, E = _ * O - (g - d * w - _ * w - d * O), M = b - E, c = b - M, vt[0] = b - (M + c) + (c - E), m = p + M, c = m - p, v = p - (m - c) + (M - c), M = v - g, c = v - M, vt[1] = v - (M + c) + (c - g), S = m + M, c = S - m, vt[2] = m - (S - c) + (M - c), vt[3] = S;
1305
- const I = Re(4, Gt, 4, vt, yn);
1306
- p = k * h, u = dt * k, d = u - (u - k), _ = k - d, u = dt * h, w = u - (u - h), O = h - w, b = _ * O - (p - d * w - _ * w - d * O), g = N * f, u = dt * N, d = u - (u - N), _ = N - d, u = dt * f, w = u - (u - f), O = f - w, E = _ * O - (g - d * w - _ * w - d * O), M = b - E, c = b - M, vt[0] = b - (M + c) + (c - E), m = p + M, c = m - p, v = p - (m - c) + (M - c), M = v - g, c = v - M, vt[1] = v - (M + c) + (c - g), S = m + M, c = S - m, vt[2] = m - (S - c) + (M - c), vt[3] = S;
1307
- const A = Re(I, yn, 4, vt, vn);
1308
- p = a * h, u = dt * a, d = u - (u - a), _ = a - d, u = dt * h, w = u - (u - h), O = h - w, b = _ * O - (p - d * w - _ * w - d * O), g = l * f, u = dt * l, d = u - (u - l), _ = l - d, u = dt * f, w = u - (u - f), O = f - w, E = _ * O - (g - d * w - _ * w - d * O), M = b - E, c = b - M, vt[0] = b - (M + c) + (c - E), m = p + M, c = m - p, v = p - (m - c) + (M - c), M = v - g, c = v - M, vt[1] = v - (M + c) + (c - g), S = m + M, c = S - m, vt[2] = m - (S - c) + (M - c), vt[3] = S;
1309
- const T = Re(A, vn, 4, vt, bn);
1303
+ if (F >= y || -F >= y || (l = e - k, a = e - (k + l) + (l - o), l = n - P, f = n - (P + l) + (l - o), l = t - N, c = t - (N + l) + (l - r), l = i - C, h = i - (C + l) + (l - r), a === 0 && c === 0 && f === 0 && h === 0) || (y = Zi * s + Ki * Math.abs(F), F += k * h + C * a - (N * f + P * c), F >= y || -F >= y)) return F;
1304
+ d = a * C, u = dt * a, p = u - (u - a), _ = a - p, u = dt * C, w = u - (u - C), O = C - w, b = _ * O - (d - p * w - _ * w - p * O), g = c * P, u = dt * c, p = u - (u - c), _ = c - p, u = dt * P, w = u - (u - P), O = P - w, E = _ * O - (g - p * w - _ * w - p * O), M = b - E, l = b - M, vt[0] = b - (M + l) + (l - E), m = d + M, l = m - d, v = d - (m - l) + (M - l), M = v - g, l = v - M, vt[1] = v - (M + l) + (l - g), S = m + M, l = S - m, vt[2] = m - (S - l) + (M - l), vt[3] = S;
1305
+ const I = Ye(4, Gt, 4, vt, yn);
1306
+ d = k * h, u = dt * k, p = u - (u - k), _ = k - p, u = dt * h, w = u - (u - h), O = h - w, b = _ * O - (d - p * w - _ * w - p * O), g = N * f, u = dt * N, p = u - (u - N), _ = N - p, u = dt * f, w = u - (u - f), O = f - w, E = _ * O - (g - p * w - _ * w - p * O), M = b - E, l = b - M, vt[0] = b - (M + l) + (l - E), m = d + M, l = m - d, v = d - (m - l) + (M - l), M = v - g, l = v - M, vt[1] = v - (M + l) + (l - g), S = m + M, l = S - m, vt[2] = m - (S - l) + (M - l), vt[3] = S;
1307
+ const A = Ye(I, yn, 4, vt, vn);
1308
+ d = a * h, u = dt * a, p = u - (u - a), _ = a - p, u = dt * h, w = u - (u - h), O = h - w, b = _ * O - (d - p * w - _ * w - p * O), g = c * f, u = dt * c, p = u - (u - c), _ = c - p, u = dt * f, w = u - (u - f), O = f - w, E = _ * O - (g - p * w - _ * w - p * O), M = b - E, l = b - M, vt[0] = b - (M + l) + (l - E), m = d + M, l = m - d, v = d - (m - l) + (M - l), M = v - g, l = v - M, vt[1] = v - (M + l) + (l - g), S = m + M, l = S - m, vt[2] = m - (S - l) + (M - l), vt[3] = S;
1309
+ const T = Ye(A, vn, 4, vt, bn);
1310
1310
  return bn[T - 1];
1311
1311
  }
1312
1312
  function er(e, t, n, i, o, r) {
1313
- const s = (t - r) * (n - o), a = (e - o) * (i - r), l = s - a, f = Math.abs(s + a);
1314
- return Math.abs(l) >= Hi * f ? l : -tr(e, t, n, i, o, r, f);
1313
+ const s = (t - r) * (n - o), a = (e - o) * (i - r), c = s - a, f = Math.abs(s + a);
1314
+ return Math.abs(c) >= Hi * f ? c : -tr(e, t, n, i, o, r, f);
1315
1315
  }
1316
1316
  function nr(e, t) {
1317
- var n, i, o = 0, r, s, a, l, f, h, c, u = e[0], d = e[1], _ = t.length;
1317
+ var n, i, o = 0, r, s, a, c, f, h, l, u = e[0], p = e[1], _ = t.length;
1318
1318
  for (n = 0; n < _; n++) {
1319
1319
  i = 0;
1320
1320
  var w = t[n], O = w.length - 1;
1321
1321
  if (h = w[0], h[0] !== w[O][0] && h[1] !== w[O][1])
1322
1322
  throw new Error("First and last coordinates in a ring must be the same");
1323
- for (s = h[0] - u, a = h[1] - d, i; i < O; i++) {
1324
- if (c = w[i + 1], l = c[0] - u, f = c[1] - d, a === 0 && f === 0) {
1325
- if (l <= 0 && s >= 0 || s <= 0 && l >= 0)
1323
+ for (s = h[0] - u, a = h[1] - p, i; i < O; i++) {
1324
+ if (l = w[i + 1], c = l[0] - u, f = l[1] - p, a === 0 && f === 0) {
1325
+ if (c <= 0 && s >= 0 || s <= 0 && c >= 0)
1326
1326
  return 0;
1327
1327
  } else if (f >= 0 && a <= 0 || f <= 0 && a >= 0) {
1328
- if (r = er(s, l, a, f, 0, 0), r === 0)
1328
+ if (r = er(s, c, a, f, 0, 0), r === 0)
1329
1329
  return 0;
1330
1330
  (r > 0 && f > 0 && a <= 0 || r < 0 && f <= 0 && a > 0) && o++;
1331
1331
  }
1332
- h = c, a = f, s = l;
1332
+ h = l, a = f, s = c;
1333
1333
  }
1334
1334
  }
1335
1335
  return o % 2 !== 0;
@@ -1344,8 +1344,8 @@ function Ue(e, t, n = {}) {
1344
1344
  if (s && ir(i, s) === !1)
1345
1345
  return !1;
1346
1346
  r === "Polygon" && (a = [a]);
1347
- for (var l = 0; l < a.length; ++l) {
1348
- const f = nr(i, a[l]);
1347
+ for (var c = 0; c < a.length; ++c) {
1348
+ const f = nr(i, a[c]);
1349
1349
  if (f === 0 && !n.ignoreBoundary || f) return !0;
1350
1350
  }
1351
1351
  return !1;
@@ -1359,10 +1359,10 @@ function Le(e, t) {
1359
1359
  return t.features[n];
1360
1360
  }
1361
1361
  function zn(e, t) {
1362
- const n = t.geometry.coordinates[0][0], i = t.geometry.coordinates[0][1], o = t.geometry.coordinates[0][2], r = e.geometry.coordinates, s = t.properties.a.geom, a = t.properties.b.geom, l = t.properties.c.geom, f = [i[0] - n[0], i[1] - n[1]], h = [o[0] - n[0], o[1] - n[1]], c = [r[0] - n[0], r[1] - n[1]], u = [a[0] - s[0], a[1] - s[1]], d = [l[0] - s[0], l[1] - s[1]], _ = (h[1] * c[0] - h[0] * c[1]) / (f[0] * h[1] - f[1] * h[0]), w = (f[0] * c[1] - f[1] * c[0]) / (f[0] * h[1] - f[1] * h[0]);
1362
+ const n = t.geometry.coordinates[0][0], i = t.geometry.coordinates[0][1], o = t.geometry.coordinates[0][2], r = e.geometry.coordinates, s = t.properties.a.geom, a = t.properties.b.geom, c = t.properties.c.geom, f = [i[0] - n[0], i[1] - n[1]], h = [o[0] - n[0], o[1] - n[1]], l = [r[0] - n[0], r[1] - n[1]], u = [a[0] - s[0], a[1] - s[1]], p = [c[0] - s[0], c[1] - s[1]], _ = (h[1] * l[0] - h[0] * l[1]) / (f[0] * h[1] - f[1] * h[0]), w = (f[0] * l[1] - f[1] * l[0]) / (f[0] * h[1] - f[1] * h[0]);
1363
1363
  return [
1364
- _ * u[0] + w * d[0] + s[0],
1365
- _ * u[1] + w * d[1] + s[1]
1364
+ _ * u[0] + w * p[0] + s[0],
1365
+ _ * u[1] + w * p[1] + s[1]
1366
1366
  ];
1367
1367
  }
1368
1368
  function rr(e, t, n) {
@@ -1373,14 +1373,14 @@ function rr(e, t, n) {
1373
1373
  return zn(e, a.features[0]);
1374
1374
  }
1375
1375
  function ne(e, t, n, i, o, r, s, a) {
1376
- let l;
1377
- if (s && (l = Le(e, Ht([s]))), !l)
1376
+ let c;
1377
+ if (s && (c = Le(e, Ht([s]))), !c)
1378
1378
  if (n) {
1379
- const f = e.geometry.coordinates, h = n.gridNum, c = n.xOrigin, u = n.yOrigin, d = n.xUnit, _ = n.yUnit, w = n.gridCache, O = xt(f[0], c, d, h), M = xt(f[1], u, _, h), m = w[O] ? w[O][M] ? w[O][M] : [] : [], v = Ht(m.map((p) => t.features[p]));
1380
- l = Le(e, v);
1379
+ const f = e.geometry.coordinates, h = n.gridNum, l = n.xOrigin, u = n.yOrigin, p = n.xUnit, _ = n.yUnit, w = n.gridCache, O = xt(f[0], l, p, h), M = xt(f[1], u, _, h), m = w[O] ? w[O][M] ? w[O][M] : [] : [], v = Ht(m.map((d) => t.features[d]));
1380
+ c = Le(e, v);
1381
1381
  } else
1382
- l = Le(e, t);
1383
- return a && a(l), l ? zn(e, l) : rr(e, i, o);
1382
+ c = Le(e, t);
1383
+ return a && a(c), c ? zn(e, c) : rr(e, i, o);
1384
1384
  }
1385
1385
  function xt(e, t, n, i) {
1386
1386
  let o = Math.floor((e - t) / n);
@@ -1390,15 +1390,15 @@ const or = 36;
1390
1390
  function xn(e, t, n) {
1391
1391
  const i = (t[1][0] - t[0][0]) / n, o = (t[1][1] - t[0][1]) / n;
1392
1392
  return e.reduce((r, s) => {
1393
- const a = xt(s[0][0], t[0][0], i, n), l = xt(s[1][0], t[0][0], i, n), f = xt(s[0][1], t[0][1], o, n), h = xt(s[1][1], t[0][1], o, n), c = (l - a + 1) * (h - f + 1);
1394
- return c > 0 ? r + c : r;
1393
+ const a = xt(s[0][0], t[0][0], i, n), c = xt(s[1][0], t[0][0], i, n), f = xt(s[0][1], t[0][1], o, n), h = xt(s[1][1], t[0][1], o, n), l = (c - a + 1) * (h - f + 1);
1394
+ return l > 0 ? r + l : r;
1395
1395
  }, 0);
1396
1396
  }
1397
1397
  function sr(e, t) {
1398
1398
  let n = _n(e - t[0]), i = Math.PI * 2, o;
1399
1399
  for (let r = 0; r < t.length; r++) {
1400
- const s = (r + 1) % t.length, a = _n(e - t[s]), l = Math.min(Math.abs(n), Math.abs(a));
1401
- n * a <= 0 && l < i && (i = l, o = r), n = a;
1400
+ const s = (r + 1) % t.length, a = _n(e - t[s]), c = Math.min(Math.abs(n), Math.abs(a));
1401
+ n * a <= 0 && c < i && (i = c, o = r), n = a;
1402
1402
  }
1403
1403
  return o;
1404
1404
  }
@@ -1488,16 +1488,16 @@ function ar(e) {
1488
1488
  }
1489
1489
  function je(e, t, n, i, o, r = !1, s) {
1490
1490
  const a = e.map(
1491
- (l) => {
1492
- (!s || s < 2.00703) && (l = cr(l));
1493
- const f = isFinite(l) ? t[l] : l === "c" ? i : (function() {
1494
- const h = l.match(/^b(\d+)$/);
1491
+ (c) => {
1492
+ (!s || s < 2.00703) && (c = cr(c));
1493
+ const f = isFinite(c) ? t[c] : c === "c" ? i : (function() {
1494
+ const h = c.match(/^b(\d+)$/);
1495
1495
  if (h) return o[parseInt(h[1])];
1496
- const c = l.match(/^e(\d+)$/);
1497
- if (c) return n[parseInt(c[1])];
1496
+ const l = c.match(/^e(\d+)$/);
1497
+ if (l) return n[parseInt(l[1])];
1498
1498
  throw new Error("Bad index value for indexesToTri");
1499
1499
  })();
1500
- return r ? [[f[1], f[0]], l] : [[f[0], f[1]], l];
1500
+ return r ? [[f[1], f[0]], c] : [[f[0], f[1]], c];
1501
1501
  }
1502
1502
  );
1503
1503
  return ar(a);
@@ -1661,8 +1661,8 @@ function vr(e) {
1661
1661
  for (let i = 0; i < n.length; i++) {
1662
1662
  const o = n[i];
1663
1663
  ["a", "b", "c"].forEach((r, s) => {
1664
- const a = o.geometry.coordinates[0][s], l = o.properties[r].geom, f = o.properties[r].index;
1665
- typeof f == "number" && (t[f] = [a, l]);
1664
+ const a = o.geometry.coordinates[0][s], c = o.properties[r].geom, f = o.properties[r].index;
1665
+ typeof f == "number" && (t[f] = [a, c]);
1666
1666
  });
1667
1667
  }
1668
1668
  return t;
@@ -1764,7 +1764,7 @@ class St {
1764
1764
  return wn(w)[0].map((M) => {
1765
1765
  r.length === 0 ? r = [Array.from(M), Array.from(M)] : (M[0] < r[0][0] && (r[0][0] = M[0]), M[0] > r[1][0] && (r[1][0] = M[0]), M[1] < r[0][1] && (r[0][1] = M[1]), M[1] > r[1][1] && (r[1][1] = M[1])), O.length === 0 ? O = [Array.from(M), Array.from(M)] : (M[0] < O[0][0] && (O[0][0] = M[0]), M[0] > O[1][0] && (O[1][0] = M[0]), M[1] < O[0][1] && (O[0][1] = M[1]), M[1] > O[1][1] && (O[1][1] = M[1]));
1766
1766
  }), O;
1767
- }), l = i.features.map((w) => {
1767
+ }), c = i.features.map((w) => {
1768
1768
  let O = [];
1769
1769
  return wn(w)[0].map((M) => {
1770
1770
  s.length === 0 ? s = [Array.from(M), Array.from(M)] : (M[0] < s[0][0] && (s[0][0] = M[0]), M[0] > s[1][0] && (s[1][0] = M[0]), M[1] < s[0][1] && (s[0][1] = M[1]), M[1] > s[1][1] && (s[1][1] = M[1])), O.length === 0 ? O = [Array.from(M), Array.from(M)] : (M[0] < O[0][0] && (O[0][0] = M[0]), M[0] > O[1][0] && (O[1][0] = M[0]), M[1] < O[0][1] && (O[0][1] = M[1]), M[1] > O[1][1] && (O[1][1] = M[1]));
@@ -1772,28 +1772,28 @@ class St {
1772
1772
  });
1773
1773
  if (Math.max(
1774
1774
  xn(a, r, o),
1775
- xn(l, s, o)
1775
+ xn(c, s, o)
1776
1776
  ) > or * n.features.length) {
1777
1777
  this.indexedTins = void 0;
1778
1778
  return;
1779
1779
  }
1780
- const f = (r[1][0] - r[0][0]) / o, h = (r[1][1] - r[0][1]) / o, c = a.reduce(
1780
+ const f = (r[1][0] - r[0][0]) / o, h = (r[1][1] - r[0][1]) / o, l = a.reduce(
1781
1781
  (w, O, M) => {
1782
- const m = xt(O[0][0], r[0][0], f, o), v = xt(O[1][0], r[0][0], f, o), p = xt(O[0][1], r[0][1], h, o), b = xt(O[1][1], r[0][1], h, o);
1782
+ const m = xt(O[0][0], r[0][0], f, o), v = xt(O[1][0], r[0][0], f, o), d = xt(O[0][1], r[0][1], h, o), b = xt(O[1][1], r[0][1], h, o);
1783
1783
  for (let g = m; g <= v; g++) {
1784
1784
  w[g] || (w[g] = []);
1785
- for (let E = p; E <= b; E++)
1785
+ for (let E = d; E <= b; E++)
1786
1786
  w[g][E] || (w[g][E] = []), w[g][E].push(M);
1787
1787
  }
1788
1788
  return w;
1789
1789
  },
1790
1790
  []
1791
- ), u = (s[1][0] - s[0][0]) / o, d = (s[1][1] - s[0][1]) / o, _ = l.reduce(
1791
+ ), u = (s[1][0] - s[0][0]) / o, p = (s[1][1] - s[0][1]) / o, _ = c.reduce(
1792
1792
  (w, O, M) => {
1793
- const m = xt(O[0][0], s[0][0], u, o), v = xt(O[1][0], s[0][0], u, o), p = xt(O[0][1], s[0][1], d, o), b = xt(O[1][1], s[0][1], d, o);
1793
+ const m = xt(O[0][0], s[0][0], u, o), v = xt(O[1][0], s[0][0], u, o), d = xt(O[0][1], s[0][1], p, o), b = xt(O[1][1], s[0][1], p, o);
1794
1794
  for (let g = m; g <= v; g++) {
1795
1795
  w[g] || (w[g] = []);
1796
- for (let E = p; E <= b; E++)
1796
+ for (let E = d; E <= b; E++)
1797
1797
  w[g][E] || (w[g][E] = []), w[g][E].push(M);
1798
1798
  }
1799
1799
  return w;
@@ -1807,14 +1807,14 @@ class St {
1807
1807
  yOrigin: r[0][1],
1808
1808
  xUnit: f,
1809
1809
  yUnit: h,
1810
- gridCache: c
1810
+ gridCache: l
1811
1811
  },
1812
1812
  bakw: {
1813
1813
  gridNum: o,
1814
1814
  xOrigin: s[0][0],
1815
1815
  yOrigin: s[0][1],
1816
1816
  xUnit: u,
1817
- yUnit: d,
1817
+ yUnit: p,
1818
1818
  gridCache: _
1819
1819
  }
1820
1820
  };
@@ -1838,26 +1838,26 @@ class St {
1838
1838
  const o = se(t);
1839
1839
  if (this.bounds && !n && !i && !Ue(o, this.boundsPolygon))
1840
1840
  return !1;
1841
- const r = n ? this.tins.bakw : this.tins.forw, s = n ? this.indexedTins?.bakw : this.indexedTins?.forw, a = n ? this.vertices_params.bakw : this.vertices_params.forw, l = n ? this.centroid.bakw : this.centroid.forw;
1841
+ const r = n ? this.tins.bakw : this.tins.forw, s = n ? this.indexedTins?.bakw : this.indexedTins?.forw, a = n ? this.vertices_params.bakw : this.vertices_params.forw, c = n ? this.centroid.bakw : this.centroid.forw;
1842
1842
  let f, h;
1843
1843
  this.stateFull && (this.stateBackward == n ? f = this.stateTriangle : (this.stateBackward = n, this.stateTriangle = void 0), h = (u) => {
1844
1844
  this.stateTriangle = u;
1845
1845
  });
1846
- let c = ne(
1846
+ let l = ne(
1847
1847
  o,
1848
1848
  r,
1849
1849
  s,
1850
1850
  a,
1851
- l,
1851
+ c,
1852
1852
  void 0,
1853
1853
  f,
1854
1854
  h
1855
1855
  );
1856
1856
  if (this.bounds && n && !i) {
1857
- const u = se(c);
1857
+ const u = se(l);
1858
1858
  if (!Ue(u, this.boundsPolygon)) return !1;
1859
- } else this.yaxisMode == St.YAXIS_FOLLOW && !n && (c = [c[0], -1 * c[1]]);
1860
- return c;
1859
+ } else this.yaxisMode == St.YAXIS_FOLLOW && !n && (l = [l[0], -1 * l[1]]);
1860
+ return l;
1861
1861
  }
1862
1862
  }
1863
1863
  const En = Math.pow(2, -52), ve = new Uint32Array(512);
@@ -1899,31 +1899,31 @@ class Ge {
1899
1899
  */
1900
1900
  update() {
1901
1901
  const { coords: t, _hullPrev: n, _hullNext: i, _hullTri: o, _hullHash: r } = this, s = t.length >> 1;
1902
- let a = 1 / 0, l = 1 / 0, f = -1 / 0, h = -1 / 0;
1902
+ let a = 1 / 0, c = 1 / 0, f = -1 / 0, h = -1 / 0;
1903
1903
  for (let k = 0; k < s; k++) {
1904
1904
  const P = t[2 * k], N = t[2 * k + 1];
1905
- P < a && (a = P), N < l && (l = N), P > f && (f = P), N > h && (h = N), this._ids[k] = k;
1905
+ P < a && (a = P), N < c && (c = N), P > f && (f = P), N > h && (h = N), this._ids[k] = k;
1906
1906
  }
1907
- const c = (a + f) / 2, u = (l + h) / 2;
1908
- let d = 0, _ = 0, w = 0;
1907
+ const l = (a + f) / 2, u = (c + h) / 2;
1908
+ let p = 0, _ = 0, w = 0;
1909
1909
  for (let k = 0, P = 1 / 0; k < s; k++) {
1910
- const N = Ve(c, u, t[2 * k], t[2 * k + 1]);
1911
- N < P && (d = k, P = N);
1910
+ const N = Ve(l, u, t[2 * k], t[2 * k + 1]);
1911
+ N < P && (p = k, P = N);
1912
1912
  }
1913
- const O = t[2 * d], M = t[2 * d + 1];
1913
+ const O = t[2 * p], M = t[2 * p + 1];
1914
1914
  for (let k = 0, P = 1 / 0; k < s; k++) {
1915
- if (k === d) continue;
1915
+ if (k === p) continue;
1916
1916
  const N = Ve(O, M, t[2 * k], t[2 * k + 1]);
1917
1917
  N < P && N > 0 && (_ = k, P = N);
1918
1918
  }
1919
- let m = t[2 * _], v = t[2 * _ + 1], p = 1 / 0;
1919
+ let m = t[2 * _], v = t[2 * _ + 1], d = 1 / 0;
1920
1920
  for (let k = 0; k < s; k++) {
1921
- if (k === d || k === _) continue;
1921
+ if (k === p || k === _) continue;
1922
1922
  const P = _r(O, M, m, v, t[2 * k], t[2 * k + 1]);
1923
- P < p && (w = k, p = P);
1923
+ P < d && (w = k, d = P);
1924
1924
  }
1925
1925
  let b = t[2 * w], g = t[2 * w + 1];
1926
- if (p === 1 / 0) {
1926
+ if (d === 1 / 0) {
1927
1927
  for (let N = 0; N < s; N++)
1928
1928
  this._dists[N] = t[2 * N] - t[0] || t[2 * N + 1] - t[1];
1929
1929
  Kt(this._ids, this._dists, 0, s - 1);
@@ -1944,12 +1944,12 @@ class Ge {
1944
1944
  this._cx = E.x, this._cy = E.y;
1945
1945
  for (let k = 0; k < s; k++)
1946
1946
  this._dists[k] = Ve(t[2 * k], t[2 * k + 1], E.x, E.y);
1947
- Kt(this._ids, this._dists, 0, s - 1), this._hullStart = d;
1947
+ Kt(this._ids, this._dists, 0, s - 1), this._hullStart = p;
1948
1948
  let S = 3;
1949
- i[d] = n[w] = _, i[_] = n[d] = w, i[w] = n[_] = d, o[d] = 0, o[_] = 1, o[w] = 2, r.fill(-1), r[this._hashKey(O, M)] = d, r[this._hashKey(m, v)] = _, r[this._hashKey(b, g)] = w, this.trianglesLen = 0, this._addTriangle(d, _, w, -1, -1, -1);
1949
+ i[p] = n[w] = _, i[_] = n[p] = w, i[w] = n[_] = p, o[p] = 0, o[_] = 1, o[w] = 2, r.fill(-1), r[this._hashKey(O, M)] = p, r[this._hashKey(m, v)] = _, r[this._hashKey(b, g)] = w, this.trianglesLen = 0, this._addTriangle(p, _, w, -1, -1, -1);
1950
1950
  for (let k = 0, P = 0, N = 0; k < this._ids.length; k++) {
1951
1951
  const C = this._ids[k], F = t[2 * C], y = t[2 * C + 1];
1952
- if (k > 0 && Math.abs(F - P) <= En && Math.abs(y - N) <= En || (P = F, N = y, C === d || C === _ || C === w)) continue;
1952
+ if (k > 0 && Math.abs(F - P) <= En && Math.abs(y - N) <= En || (P = F, N = y, C === p || C === _ || C === w)) continue;
1953
1953
  let I = 0;
1954
1954
  for (let x = 0, B = this._hashKey(F, y); x < this._hashSize && (I = r[(B + x) % this._hashSize], !(I !== -1 && I !== i[I])); x++)
1955
1955
  ;
@@ -1996,36 +1996,36 @@ class Ge {
1996
1996
  const { _triangles: n, _halfedges: i, coords: o } = this;
1997
1997
  let r = 0, s = 0;
1998
1998
  for (; ; ) {
1999
- const a = i[t], l = t - t % 3;
2000
- if (s = l + (t + 2) % 3, a === -1) {
1999
+ const a = i[t], c = t - t % 3;
2000
+ if (s = c + (t + 2) % 3, a === -1) {
2001
2001
  if (r === 0) break;
2002
2002
  t = ve[--r];
2003
2003
  continue;
2004
2004
  }
2005
- const f = a - a % 3, h = l + (t + 1) % 3, c = f + (a + 2) % 3, u = n[s], d = n[t], _ = n[h], w = n[c];
2005
+ const f = a - a % 3, h = c + (t + 1) % 3, l = f + (a + 2) % 3, u = n[s], p = n[t], _ = n[h], w = n[l];
2006
2006
  if (xr(
2007
2007
  o[2 * u],
2008
2008
  o[2 * u + 1],
2009
- o[2 * d],
2010
- o[2 * d + 1],
2009
+ o[2 * p],
2010
+ o[2 * p + 1],
2011
2011
  o[2 * _],
2012
2012
  o[2 * _ + 1],
2013
2013
  o[2 * w],
2014
2014
  o[2 * w + 1]
2015
2015
  )) {
2016
2016
  n[t] = w, n[a] = u;
2017
- const M = i[c];
2017
+ const M = i[l];
2018
2018
  if (M === -1) {
2019
2019
  let v = this._hullStart;
2020
2020
  do {
2021
- if (this._hullTri[v] === c) {
2021
+ if (this._hullTri[v] === l) {
2022
2022
  this._hullTri[v] = t;
2023
2023
  break;
2024
2024
  }
2025
2025
  v = this._hullPrev[v];
2026
2026
  } while (v !== this._hullStart);
2027
2027
  }
2028
- this._link(t, M), this._link(a, i[s]), this._link(s, c);
2028
+ this._link(t, M), this._link(a, i[s]), this._link(s, l);
2029
2029
  const m = f + (a + 1) % 3;
2030
2030
  r < ve.length && (ve[r++] = m);
2031
2031
  } else {
@@ -2069,16 +2069,16 @@ function Ve(e, t, n, i) {
2069
2069
  return o * o + r * r;
2070
2070
  }
2071
2071
  function xr(e, t, n, i, o, r, s, a) {
2072
- const l = e - s, f = t - a, h = n - s, c = i - a, u = o - s, d = r - a, _ = l * l + f * f, w = h * h + c * c, O = u * u + d * d;
2073
- return l * (c * O - w * d) - f * (h * O - w * u) + _ * (h * d - c * u) < 0;
2072
+ const c = e - s, f = t - a, h = n - s, l = i - a, u = o - s, p = r - a, _ = c * c + f * f, w = h * h + l * l, O = u * u + p * p;
2073
+ return c * (l * O - w * p) - f * (h * O - w * u) + _ * (h * p - l * u) < 0;
2074
2074
  }
2075
2075
  function _r(e, t, n, i, o, r) {
2076
- const s = n - e, a = i - t, l = o - e, f = r - t, h = s * s + a * a, c = l * l + f * f, u = 0.5 / (s * f - a * l), d = (f * h - a * c) * u, _ = (s * c - l * h) * u;
2077
- return d * d + _ * _;
2076
+ const s = n - e, a = i - t, c = o - e, f = r - t, h = s * s + a * a, l = c * c + f * f, u = 0.5 / (s * f - a * c), p = (f * h - a * l) * u, _ = (s * l - c * h) * u;
2077
+ return p * p + _ * _;
2078
2078
  }
2079
2079
  function Mr(e, t, n, i, o, r) {
2080
- const s = n - e, a = i - t, l = o - e, f = r - t, h = s * s + a * a, c = l * l + f * f, u = 0.5 / (s * f - a * l), d = e + (f * h - a * c) * u, _ = t + (s * c - l * h) * u;
2081
- return { x: d, y: _ };
2080
+ const s = n - e, a = i - t, c = o - e, f = r - t, h = s * s + a * a, l = c * c + f * f, u = 0.5 / (s * f - a * c), p = e + (f * h - a * l) * u, _ = t + (s * l - c * h) * u;
2081
+ return { x: p, y: _ };
2082
2082
  }
2083
2083
  function Kt(e, t, n, i) {
2084
2084
  if (i - n <= 20)
@@ -2092,14 +2092,14 @@ function Kt(e, t, n, i) {
2092
2092
  const o = n + i >> 1;
2093
2093
  let r = n + 1, s = i;
2094
2094
  te(e, o, r), t[e[n]] > t[e[i]] && te(e, n, i), t[e[r]] > t[e[i]] && te(e, r, i), t[e[n]] > t[e[r]] && te(e, n, r);
2095
- const a = e[r], l = t[a];
2095
+ const a = e[r], c = t[a];
2096
2096
  for (; ; ) {
2097
2097
  do
2098
2098
  r++;
2099
- while (t[e[r]] < l);
2099
+ while (t[e[r]] < c);
2100
2100
  do
2101
2101
  s--;
2102
- while (t[e[s]] > l);
2102
+ while (t[e[s]] > c);
2103
2103
  if (s < r) break;
2104
2104
  te(e, r, s);
2105
2105
  }
@@ -2184,11 +2184,11 @@ function Pt(e) {
2184
2184
  return e % 3 === 0 ? e + 2 : e - 1;
2185
2185
  }
2186
2186
  function An(e, t, n, i, o, r, s, a) {
2187
- const l = Ot(e, t, o, r, s, a), f = Ot(n, i, o, r, s, a);
2188
- if (l > 0 && f > 0 || l < 0 && f < 0)
2187
+ const c = Ot(e, t, o, r, s, a), f = Ot(n, i, o, r, s, a);
2188
+ if (c > 0 && f > 0 || c < 0 && f < 0)
2189
2189
  return !1;
2190
- const h = Ot(o, r, e, t, n, i), c = Ot(s, a, e, t, n, i);
2191
- return h > 0 && c > 0 || h < 0 && c < 0 ? !1 : l === 0 && f === 0 && h === 0 && c === 0 ? !(Math.max(o, s) < Math.min(e, n) || Math.max(e, n) < Math.min(o, s) || Math.max(r, a) < Math.min(t, i) || Math.max(t, i) < Math.min(r, a)) : !0;
2190
+ const h = Ot(o, r, e, t, n, i), l = Ot(s, a, e, t, n, i);
2191
+ return h > 0 && l > 0 || h < 0 && l < 0 ? !1 : c === 0 && f === 0 && h === 0 && l === 0 ? !(Math.max(o, s) < Math.min(e, n) || Math.max(e, n) < Math.min(o, s) || Math.max(r, a) < Math.min(t, i) || Math.max(t, i) < Math.min(r, a)) : !0;
2192
2192
  }
2193
2193
  class Ar {
2194
2194
  /**
@@ -2232,80 +2232,80 @@ class Ir extends Ar {
2232
2232
  const { triangles: i, halfedges: o } = this.del;
2233
2233
  this.assertVertex(t, t, n), this.assertVertex(n, t, n), this.assertInTriangulation(t, t, n), this.assertInTriangulation(n, t, n);
2234
2234
  const r = this.vertMap[t], s = this.maxConstrainSteps();
2235
- let a = 0, l = r;
2235
+ let a = 0, c = r;
2236
2236
  do {
2237
2237
  if (++a > s)
2238
2238
  throw new Error(
2239
2239
  `Constraining edge [${t}, ${n}] exceeded the iteration limit`
2240
2240
  );
2241
- const c = i[l], u = jt(l);
2242
- if (c === n)
2243
- return this.protect(l);
2244
- const d = Pt(l), _ = i[d];
2241
+ const l = i[c], u = jt(c);
2242
+ if (l === n)
2243
+ return this.protect(c);
2244
+ const p = Pt(c), _ = i[p];
2245
2245
  if (_ === n)
2246
2246
  return this.protect(u), u;
2247
- if (this.intersectSegments(t, n, _, c)) {
2248
- l = d;
2247
+ if (this.intersectSegments(t, n, _, l)) {
2248
+ c = p;
2249
2249
  break;
2250
2250
  }
2251
- l = o[u];
2252
- } while (l !== -1 && l !== r);
2253
- let f = l, h = -1;
2254
- for (; l !== -1; ) {
2251
+ c = o[u];
2252
+ } while (c !== -1 && c !== r);
2253
+ let f = c, h = -1;
2254
+ for (; c !== -1; ) {
2255
2255
  if (++a > s)
2256
2256
  throw new Error(
2257
2257
  `Constraining edge [${t}, ${n}] exceeded the iteration limit`
2258
2258
  );
2259
- const c = o[l], u = Pt(l), d = Pt(c), _ = jt(c);
2260
- if (c === -1)
2259
+ const l = o[c], u = Pt(c), p = Pt(l), _ = jt(l);
2260
+ if (l === -1)
2261
2261
  throw new Error("Constraining edge exited the hull");
2262
- if (this.consd.has(l))
2262
+ if (this.consd.has(c))
2263
2263
  throw new Error("Edge intersects already constrained edge");
2264
- if (this.isCollinear(t, n, i[l]) || this.isCollinear(t, n, i[c]))
2264
+ if (this.isCollinear(t, n, i[c]) || this.isCollinear(t, n, i[l]))
2265
2265
  throw new Error("Constraining edge intersects point");
2266
2266
  if (!this.intersectSegments(
2267
- i[l],
2268
2267
  i[c],
2268
+ i[l],
2269
2269
  i[u],
2270
- i[d]
2270
+ i[p]
2271
2271
  )) {
2272
- if (h === -1 && (h = l), i[d] === n) {
2273
- if (l === h)
2272
+ if (h === -1 && (h = c), i[p] === n) {
2273
+ if (c === h)
2274
2274
  throw new Error("Infinite loop: non-convex quadrilateral");
2275
- l = h, h = -1;
2275
+ c = h, h = -1;
2276
2276
  continue;
2277
2277
  }
2278
2278
  if (this.intersectSegments(
2279
2279
  t,
2280
2280
  n,
2281
- i[d],
2282
- i[c]
2281
+ i[p],
2282
+ i[l]
2283
2283
  ))
2284
- l = d;
2284
+ c = p;
2285
2285
  else if (this.intersectSegments(
2286
2286
  t,
2287
2287
  n,
2288
2288
  i[_],
2289
- i[d]
2289
+ i[p]
2290
2290
  ))
2291
- l = _;
2292
- else if (h === l)
2291
+ c = _;
2292
+ else if (h === c)
2293
2293
  throw new Error("Infinite loop: no further intersect after non-convex");
2294
2294
  continue;
2295
2295
  }
2296
- if (this.flipDiagonal(l), this.intersectSegments(
2296
+ if (this.flipDiagonal(c), this.intersectSegments(
2297
2297
  t,
2298
2298
  n,
2299
2299
  i[u],
2300
- i[d]
2300
+ i[p]
2301
2301
  ) && (h === -1 && (h = u), h === u))
2302
2302
  throw new Error("Infinite loop: flipped diagonal still intersects");
2303
- i[d] === n ? (f = d, l = h, h = -1) : this.intersectSegments(
2303
+ i[p] === n ? (f = p, c = h, h = -1) : this.intersectSegments(
2304
2304
  t,
2305
2305
  n,
2306
2306
  i[_],
2307
- i[d]
2308
- ) && (l = _);
2307
+ i[p]
2308
+ ) && (c = _);
2309
2309
  }
2310
2310
  return this.protect(f), this.delaunify(!0), this.findEdge(t, n);
2311
2311
  }
@@ -2356,8 +2356,8 @@ class Ir extends Ar {
2356
2356
  if (o.has(a))
2357
2357
  continue;
2358
2358
  i.delete(a);
2359
- const l = n[a];
2360
- l !== -1 && (i.delete(l), this.isDelaunay(a) || (this.flipDiagonal(a), s++));
2359
+ const c = n[a];
2360
+ c !== -1 && (i.delete(c), this.isDelaunay(a) || (this.flipDiagonal(a), s++));
2361
2361
  }
2362
2362
  } while (t && s > 0);
2363
2363
  return this;
@@ -2387,9 +2387,9 @@ class Ir extends Ar {
2387
2387
  const i = this.vertMap[n], { triangles: o, halfedges: r } = this.del;
2388
2388
  if (!(i < o.length))
2389
2389
  return 1 / 0;
2390
- let s = i, a, l = 0;
2390
+ let s = i, a, c = 0;
2391
2391
  do {
2392
- if (++l > o.length)
2392
+ if (++c > o.length)
2393
2393
  throw new Error(
2394
2394
  `Looking up edge [${t}, ${n}] exceeded the iteration limit`
2395
2395
  );
@@ -2420,10 +2420,10 @@ class Ir extends Ar {
2420
2420
  * Flip the edge shared by two triangles.
2421
2421
  */
2422
2422
  flipDiagonal(t) {
2423
- const { triangles: n, halfedges: i } = this.del, o = this.flips, r = this.consd, s = i[t], a = Pt(t), l = jt(t), f = Pt(s), h = jt(s), c = i[a], u = i[f];
2423
+ const { triangles: n, halfedges: i } = this.del, o = this.flips, r = this.consd, s = i[t], a = Pt(t), c = jt(t), f = Pt(s), h = jt(s), l = i[a], u = i[f];
2424
2424
  if (r.has(t))
2425
2425
  throw new Error("Trying to flip a constrained edge");
2426
- return n[t] = n[f], i[t] = u, o.set(t, o.has(f)) || r.set(t, r.has(f)), u !== -1 && (i[u] = t), i[a] = f, n[s] = n[a], i[s] = c, o.set(s, o.has(a)) || r.set(s, r.has(a)), c !== -1 && (i[c] = s), i[f] = a, this.markFlip(t), this.markFlip(l), this.markFlip(s), this.markFlip(h), o.add(a), r.delete(a), o.add(f), r.delete(f), this.updateVert(t), this.updateVert(l), this.updateVert(s), this.updateVert(h), a;
2426
+ return n[t] = n[f], i[t] = u, o.set(t, o.has(f)) || r.set(t, r.has(f)), u !== -1 && (i[u] = t), i[a] = f, n[s] = n[a], i[s] = l, o.set(s, o.has(a)) || r.set(s, r.has(a)), l !== -1 && (i[l] = s), i[f] = a, this.markFlip(t), this.markFlip(c), this.markFlip(s), this.markFlip(h), o.add(a), r.delete(a), o.add(f), r.delete(f), this.updateVert(t), this.updateVert(c), this.updateVert(s), this.updateVert(h), a;
2427
2427
  }
2428
2428
  /**
2429
2429
  * Whether point p1, p2, and p are collinear.
@@ -2462,8 +2462,8 @@ class Ir extends Ar {
2462
2462
  const { triangles: n, halfedges: i } = this.del, o = i[t];
2463
2463
  if (o === -1)
2464
2464
  return !0;
2465
- const r = n[Pt(t)], s = n[t], a = n[jt(t)], l = n[Pt(o)];
2466
- return !this.inCircle(r, s, a, l);
2465
+ const r = n[Pt(t)], s = n[t], a = n[jt(t)], c = n[Pt(o)];
2466
+ return !this.inCircle(r, s, a, c);
2467
2467
  }
2468
2468
  /**
2469
2469
  * Update the vertex -> incoming edge map.
@@ -2498,58 +2498,108 @@ function be(e, t, n) {
2498
2498
  throw "Argument points must be FeatureCollection";
2499
2499
  if (!Array.isArray(t)) throw "Argument points must be Array of Array";
2500
2500
  const i = e.features.map(
2501
- (l) => l.geometry.coordinates
2501
+ (c) => c.geometry.coordinates
2502
2502
  ), o = Ge.from(i);
2503
2503
  let r;
2504
2504
  const s = [];
2505
2505
  o.triangles.length !== 0 && t.length !== 0 && (r = new Ir(o), r.constrainAll(t));
2506
- for (let l = 0; l < o.triangles.length; l += 3)
2507
- s.push([o.triangles[l], o.triangles[l + 1], o.triangles[l + 2]]);
2506
+ for (let c = 0; c < o.triangles.length; c += 3)
2507
+ s.push([o.triangles[c], o.triangles[c + 1], o.triangles[c + 2]]);
2508
2508
  const a = ["a", "b", "c"];
2509
2509
  return Et(
2510
- s.map((l) => {
2511
- const f = {}, h = l.map((c, u) => {
2512
- const d = e.features[c], _ = d.geometry.coordinates, w = [_[0], _[1]];
2513
- return _.length === 3 ? w[2] = _[2] : f[a[u]] = d.properties[n], w;
2510
+ s.map((c) => {
2511
+ const f = {}, h = c.map((l, u) => {
2512
+ const p = e.features[l], _ = p.geometry.coordinates, w = [_[0], _[1]];
2513
+ return _.length === 3 ? w[2] = _[2] : f[a[u]] = p.properties[n], w;
2514
2514
  });
2515
2515
  return h[3] = h[0], le([h], f);
2516
2516
  })
2517
2517
  );
2518
2518
  }
2519
- function Or(e, t) {
2519
+ const Or = 256 * Number.EPSILON;
2520
+ function Pr(e, t) {
2521
+ const n = [e, t].map((o) => {
2522
+ const r = o.map((a, c, f) => {
2523
+ if (c === 0) return 0;
2524
+ const h = f[c - 1];
2525
+ return Math.sqrt(
2526
+ Math.pow(a[0] - h[0], 2) + Math.pow(a[1] - h[1], 2)
2527
+ );
2528
+ }), s = r.reduce((a, c, f) => f === 0 ? [0] : (a.push(a[f - 1] + c), a), []);
2529
+ return s.map((a, c, f) => {
2530
+ const h = a / f[f.length - 1];
2531
+ return [o[c], r[c], s[c], h];
2532
+ });
2533
+ }), i = [];
2534
+ return n.forEach((o, r) => {
2535
+ const s = n[r ? 0 : 1];
2536
+ o.forEach((a, c) => {
2537
+ if (c === 0 || c === o.length - 1 || a[4] === "handled")
2538
+ return;
2539
+ const f = a[0], h = a[3];
2540
+ let l, u = 1 / 0;
2541
+ for (let p = 1; p < s.length - 1; p++) {
2542
+ const _ = s[p];
2543
+ if (_[4] === "handled") continue;
2544
+ const w = Math.abs(_[3] - h);
2545
+ w <= Or && w < u && (l = _, u = w);
2546
+ }
2547
+ if (l) {
2548
+ l[4] = "handled", a[4] = "handled", i.push(
2549
+ r === 0 ? [f, l[0], h] : [l[0], f, h]
2550
+ );
2551
+ return;
2552
+ }
2553
+ for (let p = 0; p < s.length - 1; p++) {
2554
+ const _ = s[p], w = s[p + 1], O = _[3], M = w[3];
2555
+ if (O < h && M > h) {
2556
+ const m = (h - O) / (M - O), v = [
2557
+ (w[0][0] - _[0][0]) * m + _[0][0],
2558
+ (w[0][1] - _[0][1]) * m + _[0][1]
2559
+ ];
2560
+ i.push(
2561
+ r === 0 ? [f, v, h] : [v, f, h]
2562
+ );
2563
+ return;
2564
+ }
2565
+ }
2566
+ });
2567
+ }), i.sort((o, r) => o[2] - r[2]);
2568
+ }
2569
+ function Nr(e, t) {
2520
2570
  const n = [[], [], [], []], i = [];
2521
2571
  return Object.keys(e).forEach((o) => {
2522
- const r = e[o], s = r.forw, a = r.bakw, l = [
2572
+ const r = e[o], s = r.forw, a = r.bakw, c = [
2523
2573
  s[0] - t.forw[0],
2524
2574
  s[1] - t.forw[1]
2525
2575
  ], f = [
2526
2576
  a[0] - t.bakw[0],
2527
2577
  t.bakw[1] - a[1]
2528
- ], h = { forw: l, bakw: f };
2529
- if (i.push(h), l[0] === 0 || l[1] === 0)
2578
+ ], h = { forw: c, bakw: f };
2579
+ if (i.push(h), c[0] === 0 || c[1] === 0)
2530
2580
  return;
2531
- let c = 0;
2532
- l[0] > 0 && (c += 1), l[1] > 0 && (c += 2), n[c].push(h);
2581
+ let l = 0;
2582
+ c[0] > 0 && (l += 1), c[1] > 0 && (l += 2), n[l].push(h);
2533
2583
  }), { perQuad: n, aggregate: i };
2534
2584
  }
2535
- function Pr(e) {
2585
+ function Br(e) {
2536
2586
  let t = 1 / 0, n = 0, i = 0;
2537
2587
  return e.forEach((o) => {
2538
- const { forw: r, bakw: s } = o, a = Math.hypot(r[0], r[1]), l = Math.hypot(s[0], s[1]);
2539
- if (l === 0) return;
2540
- const f = a / l, h = Math.atan2(r[0], r[1]) - Math.atan2(s[0], s[1]);
2588
+ const { forw: r, bakw: s } = o, a = Math.hypot(r[0], r[1]), c = Math.hypot(s[0], s[1]);
2589
+ if (c === 0) return;
2590
+ const f = a / c, h = Math.atan2(r[0], r[1]) - Math.atan2(s[0], s[1]);
2541
2591
  t = Math.min(t, f), n += Math.cos(h), i += Math.sin(h);
2542
2592
  }), isFinite(t) ? [t, Math.atan2(i, n)] : [1, 0];
2543
2593
  }
2544
- function Nr(e, t, n) {
2545
- const { perQuad: i, aggregate: o } = Or(e, t), r = i.every((l) => l.length > 0), a = (n === "birdeye" ? r ? i : [o] : [o]).map((l) => Pr(l));
2594
+ function Tr(e, t, n) {
2595
+ const { perQuad: i, aggregate: o } = Nr(e, t), r = i.every((c) => c.length > 0), a = (n === "birdeye" ? r ? i : [o] : [o]).map((c) => Br(c));
2546
2596
  return a.length === 1 ? [a[0], a[0], a[0], a[0]] : a;
2547
2597
  }
2548
- function Br(e, t) {
2598
+ function Cr(e, t) {
2549
2599
  let n = 0;
2550
2600
  return e[0] > t[0] && (n += 1), e[1] > t[1] && (n += 2), n;
2551
2601
  }
2552
- function Tr(e, t, n) {
2602
+ function Xr(e, t, n) {
2553
2603
  const i = [
2554
2604
  e[0] - t.forw[0],
2555
2605
  e[1] - t.forw[1]
@@ -2559,25 +2609,25 @@ function Tr(e, t, n) {
2559
2609
  t.bakw[1] - r * Math.cos(s)
2560
2610
  ];
2561
2611
  }
2562
- function Cr(e, t, n, i) {
2612
+ function $r(e, t, n, i) {
2563
2613
  const o = t[0] - e[0], r = t[1] - e[1];
2564
2614
  if (Math.abs(o) < 1e-12 && Math.abs(r) < 1e-12) return null;
2565
- const s = i[0] - n[0], a = i[1] - n[1], l = n[0] - e[0], f = n[1] - e[1], h = o * a - r * s;
2615
+ const s = i[0] - n[0], a = i[1] - n[1], c = n[0] - e[0], f = n[1] - e[1], h = o * a - r * s;
2566
2616
  if (Math.abs(h) < 1e-12) return null;
2567
- const c = (l * a - f * s) / h, u = (l * r - f * o) / h;
2568
- return c <= 1e-10 || u < -1e-10 || u > 1 + 1e-10 ? null : { t: c, point: [e[0] + c * o, e[1] + c * r] };
2617
+ const l = (c * a - f * s) / h, u = (c * r - f * o) / h;
2618
+ return l <= 1e-10 || u < -1e-10 || u > 1 + 1e-10 ? null : { t: l, point: [e[0] + l * o, e[1] + l * r] };
2569
2619
  }
2570
- function Xr(e, t, n) {
2620
+ function Dr(e, t, n) {
2571
2621
  const i = n.length;
2572
2622
  let o = -1 / 0, r = null;
2573
2623
  for (let s = 0; s < i; s++) {
2574
- const a = (s + 1) % i, l = Cr(
2624
+ const a = (s + 1) % i, c = $r(
2575
2625
  e,
2576
2626
  t,
2577
2627
  n[s].bakw,
2578
2628
  n[a].bakw
2579
2629
  );
2580
- l && l.t > o && (o = l.t, r = l.point);
2630
+ c && c.t > o && (o = c.t, r = c.point);
2581
2631
  }
2582
2632
  return r;
2583
2633
  }
@@ -2588,39 +2638,39 @@ function In(e, t) {
2588
2638
  function On(e, t, n, i, o, r) {
2589
2639
  const s = t[0] - e[0], a = t[1] - e[1];
2590
2640
  if (s === 0 && a === 0) return null;
2591
- const l = [];
2641
+ const c = [];
2592
2642
  if (s !== 0)
2593
2643
  for (const h of [n, i]) {
2594
- const c = (h - e[0]) / s;
2595
- if (c > 0) {
2596
- const u = e[1] + c * a;
2597
- u >= o && u <= r && l.push({ t: c, x: h, y: u });
2644
+ const l = (h - e[0]) / s;
2645
+ if (l > 0) {
2646
+ const u = e[1] + l * a;
2647
+ u >= o && u <= r && c.push({ t: l, x: h, y: u });
2598
2648
  }
2599
2649
  }
2600
2650
  if (a !== 0)
2601
2651
  for (const h of [o, r]) {
2602
- const c = (h - e[1]) / a;
2603
- if (c > 0) {
2604
- const u = e[0] + c * s;
2605
- u >= n && u <= i && l.push({ t: c, x: u, y: h });
2652
+ const l = (h - e[1]) / a;
2653
+ if (l > 0) {
2654
+ const u = e[0] + l * s;
2655
+ u >= n && u <= i && c.push({ t: l, x: u, y: h });
2606
2656
  }
2607
2657
  }
2608
- if (l.length === 0) return null;
2609
- l.sort((h, c) => h.t - c.t);
2610
- const f = l[0];
2658
+ if (c.length === 0) return null;
2659
+ c.sort((h, l) => h.t - l.t);
2660
+ const f = c[0];
2611
2661
  return [f.x, f.y];
2612
2662
  }
2613
2663
  function Pn(e, t, n) {
2614
2664
  const i = e.length, o = new Array(i).fill(1);
2615
2665
  for (const r of t)
2616
2666
  for (let s = 0; s < i; s++) {
2617
- const a = (s + 1) % i, l = He([e[s].bakw, e[a].bakw]), f = He([n.bakw, r.bakw]), h = Bi(l, f);
2667
+ const a = (s + 1) % i, c = He([e[s].bakw, e[a].bakw]), f = He([n.bakw, r.bakw]), h = Bi(c, f);
2618
2668
  if (h.features.length > 0 && h.features[0].geometry) {
2619
- const c = h.features[0], u = Math.sqrt(
2669
+ const l = h.features[0], u = Math.sqrt(
2620
2670
  Math.pow(r.bakw[0] - n.bakw[0], 2) + Math.pow(r.bakw[1] - n.bakw[1], 2)
2621
- ), d = Math.sqrt(
2622
- Math.pow(c.geometry.coordinates[0] - n.bakw[0], 2) + Math.pow(c.geometry.coordinates[1] - n.bakw[1], 2)
2623
- ), _ = u / d;
2671
+ ), p = Math.sqrt(
2672
+ Math.pow(l.geometry.coordinates[0] - n.bakw[0], 2) + Math.pow(l.geometry.coordinates[1] - n.bakw[1], 2)
2673
+ ), _ = u / p;
2624
2674
  _ > o[s] && (o[s] = _), _ > o[a] && (o[a] = _);
2625
2675
  }
2626
2676
  }
@@ -2633,23 +2683,23 @@ function Pn(e, t, n) {
2633
2683
  });
2634
2684
  }
2635
2685
  function Qn(e, t, n) {
2636
- const { convexBuf: i, centroid: o, allGcps: r, minx: s, maxx: a, miny: l, maxy: f } = e, h = Nr(i, o, t), u = [
2637
- [s, l],
2638
- [a, l],
2686
+ const { convexBuf: i, centroid: o, allGcps: r, minx: s, maxx: a, miny: c, maxy: f } = e, h = Tr(i, o, t), u = [
2687
+ [s, c],
2688
+ [a, c],
2639
2689
  [a, f],
2640
2690
  [s, f]
2641
2691
  ].map((g) => ({
2642
2692
  forw: g,
2643
- bakw: Tr(
2693
+ bakw: Xr(
2644
2694
  g,
2645
2695
  o,
2646
- h[Br(g, o.forw)]
2696
+ h[Cr(g, o.forw)]
2647
2697
  )
2648
2698
  }));
2649
2699
  if (u.sort(
2650
2700
  (g, E) => Math.atan2(g.forw[0] - o.forw[0], g.forw[1] - o.forw[1]) - Math.atan2(E.forw[0] - o.forw[0], E.forw[1] - o.forw[1])
2651
2701
  ), Pn(u, r, o), !n) return u;
2652
- const d = 4, _ = u.map(
2702
+ const p = 4, _ = u.map(
2653
2703
  (g) => Math.atan2(g.forw[0] - o.forw[0], g.forw[1] - o.forw[1])
2654
2704
  ), w = u.map(
2655
2705
  (g) => Math.atan2(
@@ -2658,8 +2708,8 @@ function Qn(e, t, n) {
2658
2708
  )
2659
2709
  );
2660
2710
  function O(g) {
2661
- for (let E = 0; E < d; E++) {
2662
- const S = (E + 1) % d, k = _[E], P = E < d - 1 ? _[S] : _[S] + 2 * Math.PI;
2711
+ for (let E = 0; E < p; E++) {
2712
+ const S = (E + 1) % p, k = _[E], P = E < p - 1 ? _[S] : _[S] + 2 * Math.PI;
2663
2713
  let N = g;
2664
2714
  for (; N < k; ) N += 2 * Math.PI;
2665
2715
  for (; N >= k + 2 * Math.PI; ) N -= 2 * Math.PI;
@@ -2684,7 +2734,7 @@ function Qn(e, t, n) {
2684
2734
  bakw: g.bakw,
2685
2735
  angleDeg: In(g.forw, o.forw),
2686
2736
  forwDist: Math.hypot(g.forw[0] - o.forw[0], g.forw[1] - o.forw[1])
2687
- })), p = [];
2737
+ })), d = [];
2688
2738
  for (let g = 0; g < 36; g++) {
2689
2739
  if (m.has(g)) continue;
2690
2740
  const E = g * 10, S = v.filter(
@@ -2693,43 +2743,43 @@ function Qn(e, t, n) {
2693
2743
  let k = null;
2694
2744
  if (S.length > 0) {
2695
2745
  const I = S.reduce((A, T) => T.forwDist > A.forwDist ? T : A);
2696
- k = On(o.forw, I.forw, s, a, l, f);
2746
+ k = On(o.forw, I.forw, s, a, c, f);
2697
2747
  }
2698
2748
  if (!k) {
2699
2749
  const I = (E + 5) % 360 * (Math.PI / 180), A = [
2700
2750
  o.forw[0] + Math.sin(I),
2701
2751
  o.forw[1] + Math.cos(I)
2702
2752
  ];
2703
- k = On(o.forw, A, s, a, l, f);
2753
+ k = On(o.forw, A, s, a, c, f);
2704
2754
  }
2705
2755
  if (!k) continue;
2706
2756
  const P = [k[0] - o.forw[0], k[1] - o.forw[1]], N = Math.atan2(P[0], P[1]), C = M(N), F = [
2707
2757
  o.bakw[0] + Math.sin(C),
2708
2758
  o.bakw[1] - Math.cos(C)
2709
- ], y = Xr(o.bakw, F, u);
2710
- y && p.push({ forw: k, bakw: y });
2759
+ ], y = Dr(o.bakw, F, u);
2760
+ y && d.push({ forw: k, bakw: y });
2711
2761
  }
2712
- const b = [...u, ...p];
2762
+ const b = [...u, ...d];
2713
2763
  return b.sort(
2714
2764
  (g, E) => Math.atan2(g.forw[0] - o.forw[0], g.forw[1] - o.forw[1]) - Math.atan2(E.forw[0] - o.forw[0], E.forw[1] - o.forw[1])
2715
2765
  ), Pn(b, r, o), b;
2716
2766
  }
2717
- function $r(e, t = !1) {
2767
+ function Fr(e, t = !1) {
2718
2768
  return Qn(e, "plain", t);
2719
2769
  }
2720
- function Dr(e, t = !1) {
2770
+ function Rr(e, t = !1) {
2721
2771
  return Qn(e, "birdeye", t);
2722
2772
  }
2723
- function wo(e) {
2773
+ function vo(e) {
2724
2774
  return Hn(e, 1 / 0);
2725
2775
  }
2726
- const Nn = 1e5, Fr = 16;
2776
+ const Nn = 1e5, Yr = 16;
2727
2777
  function Hn(e, t) {
2728
- return Yr(e), new Rr(e).findSegmentIntersections(t).map(
2729
- (o) => Rt([o.x, o.y])
2778
+ return Lr(e), new Vr(e).findSegmentIntersections(t).map(
2779
+ (o) => Yt([o.x, o.y])
2730
2780
  );
2731
2781
  }
2732
- function Yr(e) {
2782
+ function Lr(e) {
2733
2783
  for (let t = 0, n = e.length; t < n; t++) {
2734
2784
  const i = e[t];
2735
2785
  ae(i) || qt(
@@ -2748,7 +2798,7 @@ function Yr(e) {
2748
2798
  }
2749
2799
  }
2750
2800
  }
2751
- class Rr {
2801
+ class Vr {
2752
2802
  /**
2753
2803
  * 座標データの配列
2754
2804
  * _xx, _yy: Float64Array形式で座標を保持
@@ -2793,7 +2843,7 @@ class Rr {
2793
2843
  let r = 0;
2794
2844
  for (let s = 0; s < o; s++)
2795
2845
  this._ii[s] = r, r += t[s];
2796
- (r != this._xx.length || this._xx.length != this._yy.length) && qt("ArcCollection#initXYData() Counting error"), this.initBounds(), this._arcIter = new so(this._xx, this._yy);
2846
+ (r != this._xx.length || this._xx.length != this._yy.length) && qt("ArcCollection#initXYData() Counting error"), this.initBounds(), this._arcIter = new co(this._xx, this._yy);
2797
2847
  }
2798
2848
  initBounds() {
2799
2849
  const t = this.calcArcBounds_(this._xx, this._yy, this._nn);
@@ -2805,9 +2855,9 @@ class Rr {
2805
2855
  */
2806
2856
  calcArcBounds_(t, n, i) {
2807
2857
  const o = i.length, r = new Float64Array(o * 4), s = new ce();
2808
- let a = 0, l, f, h;
2809
- for (let c = 0; c < o; c++)
2810
- l = i[c], l > 0 && (f = c * 4, h = ao(t, n, a, l), r[f++] = h[0], r[f++] = h[1], r[f++] = h[2], r[f] = h[3], a += l, s.mergeBounds(h));
2858
+ let a = 0, c, f, h;
2859
+ for (let l = 0; l < o; l++)
2860
+ c = i[l], c > 0 && (f = l * 4, h = lo(t, n, a, c), r[f++] = h[0], r[f++] = h[1], r[f++] = h[2], r[f] = h[3], a += c, s.mergeBounds(h));
2811
2861
  return {
2812
2862
  bb: r,
2813
2863
  bounds: s
@@ -2829,9 +2879,9 @@ class Rr {
2829
2879
  // @cb function(i, j, xx, yy)
2830
2880
  forEachArcSegment(t, n) {
2831
2881
  const i = t >= 0, o = i ? t : ~t, r = this.getRetainedInterval(), s = this._nn[o], a = i ? 1 : -1;
2832
- let l = i ? this._ii[o] : this._ii[o] + s - 1, f = l, h = 0;
2833
- for (let c = 1; c < s; c++)
2834
- f += a, (r === 0 || this._zz[f] >= r) && (n(l, f, this._xx, this._yy), l = f, h++);
2882
+ let c = i ? this._ii[o] : this._ii[o] + s - 1, f = c, h = 0;
2883
+ for (let l = 1; l < s; l++)
2884
+ f += a, (r === 0 || this._zz[f] >= r) && (n(c, f, this._xx, this._yy), c = f, h++);
2835
2885
  return h;
2836
2886
  }
2837
2887
  getRetainedInterval() {
@@ -2879,15 +2929,15 @@ class Rr {
2879
2929
  * @returns 検出された交差点の配列(同じ位置の重複なし)
2880
2930
  */
2881
2931
  findSegmentIntersections(t = 1 / 0) {
2882
- const n = this.getBounds(), i = n.ymin || 0, o = (n.ymax || 0) - i, r = this.calcSegmentIntersectionStripeCount(), s = new Uint32Array(r), a = r > 1 ? (v) => Math.floor((r - 1) * (v - i) / o) : () => 0, l = r + 1;
2932
+ const n = this.getBounds(), i = n.ymin || 0, o = (n.ymax || 0) - i, r = this.calcSegmentIntersectionStripeCount(), s = new Uint32Array(r), a = r > 1 ? (v) => Math.floor((r - 1) * (v - i) / o) : () => 0, c = r + 1;
2883
2933
  let f;
2884
2934
  this.forEachSegment(
2885
- (v, p, b, g) => {
2935
+ (v, d, b, g) => {
2886
2936
  let E = a(g[v]);
2887
- const S = a(g[p]);
2937
+ const S = a(g[d]);
2888
2938
  let k = 0;
2889
2939
  for (; s[E] = s[E] + 2, E != S; )
2890
- k++, k > l && qt(
2940
+ k++, k > c && qt(
2891
2941
  "findSegmentIntersections() exceeded the stripe iteration limit:",
2892
2942
  `stripeCount=${r}`,
2893
2943
  `s1=${E}`,
@@ -2895,19 +2945,19 @@ class Rr {
2895
2945
  ), E += S > E ? 1 : -1;
2896
2946
  }
2897
2947
  );
2898
- const h = this.getUint32Array(Ur(s));
2899
- let c = 0;
2948
+ const h = this.getUint32Array(qr(s));
2949
+ let l = 0;
2900
2950
  const u = [];
2901
- jr(s, (v) => {
2902
- const p = c;
2903
- c += v, u.push(h.subarray(p, c));
2904
- }), qr(s, 0), this.forEachSegment(
2905
- (v, p, b, g) => {
2951
+ zr(s, (v) => {
2952
+ const d = l;
2953
+ l += v, u.push(h.subarray(d, l));
2954
+ }), Jr(s, 0), this.forEachSegment(
2955
+ (v, d, b, g) => {
2906
2956
  let E = a(g[v]);
2907
- const S = a(g[p]);
2957
+ const S = a(g[d]);
2908
2958
  let k, P, N = 0;
2909
- for (; k = s[E], s[E] = k + 2, P = u[E], P[k] = v, P[k + 1] = p, E != S; )
2910
- N++, N > l && qt(
2959
+ for (; k = s[E], s[E] = k + 2, P = u[E], P[k] = v, P[k + 1] = d, E != S; )
2960
+ N++, N > c && qt(
2911
2961
  "findSegmentIntersections() exceeded the stripe iteration limit:",
2912
2962
  `stripeCount=${r}`,
2913
2963
  `s1=${E}`,
@@ -2915,15 +2965,15 @@ class Rr {
2915
2965
  ), E += S > E ? 1 : -1;
2916
2966
  }
2917
2967
  );
2918
- const d = this.getVertexData(), _ = t * Fr;
2968
+ const p = this.getVertexData(), _ = t * Yr;
2919
2969
  let w = 0;
2920
2970
  const O = /* @__PURE__ */ new Set(), M = /* @__PURE__ */ new Map(), m = (v) => {
2921
2971
  w++;
2922
- const p = oo(v);
2923
- return O.has(p) || (O.add(p), M.set(`${v.x}:${v.y}`, v)), M.size >= t || w >= _;
2972
+ const d = ao(v);
2973
+ return O.has(d) || (O.add(d), M.set(`${v.x}:${v.y}`, v)), M.size >= t || w >= _;
2924
2974
  };
2925
- if (d.xx && d.yy)
2926
- for (f = 0; f < r && !zr(u[f], d.xx, d.yy, m); f++)
2975
+ if (p.xx && p.yy)
2976
+ for (f = 0; f < r && !Gr(u[f], p.xx, p.yy, m); f++)
2927
2977
  ;
2928
2978
  return Array.from(M.values());
2929
2979
  }
@@ -2933,62 +2983,62 @@ function qt(...e) {
2933
2983
  throw new Error(t);
2934
2984
  }
2935
2985
  function ae(e) {
2936
- return e ? Vr(e) ? !0 : Lr(e) ? !1 : e.length === 0 ? !0 : e.length > 0 : !1;
2986
+ return e ? jr(e) ? !0 : Ur(e) ? !1 : e.length === 0 ? !0 : e.length > 0 : !1;
2937
2987
  }
2938
- function Lr(e) {
2988
+ function Ur(e) {
2939
2989
  return e != null && e.toString === String.prototype.toString;
2940
2990
  }
2941
- function Vr(e) {
2991
+ function jr(e) {
2942
2992
  return Array.isArray(e);
2943
2993
  }
2944
- function Ur(e, t) {
2994
+ function qr(e, t) {
2945
2995
  ae(e) || qt("utils.sum() expects an array, received:", e);
2946
2996
  let n = 0, i;
2947
2997
  for (let o = 0, r = e.length; o < r; o++)
2948
2998
  i = e[o], i && (n += i);
2949
2999
  return n;
2950
3000
  }
2951
- function jr(e, t, n) {
3001
+ function zr(e, t, n) {
2952
3002
  if (!ae(e))
2953
3003
  throw new Error(`#forEach() takes an array-like argument. ${e}`);
2954
3004
  for (let i = 0, o = e.length; i < o; i++)
2955
3005
  t.call(n, e[i], i);
2956
3006
  }
2957
- function qr(e, t) {
3007
+ function Jr(e, t) {
2958
3008
  for (let n = 0, i = e.length; n < i; n++)
2959
3009
  e[n] = t;
2960
3010
  return e;
2961
3011
  }
2962
- function zr(e, t, n, i) {
3012
+ function Gr(e, t, n, i) {
2963
3013
  const o = e.length - 2;
2964
- let r, s, a, l, f, h, c, u, d, _, w, O, M, m, v, p, b;
2965
- for (no(t, e), p = 0; p < o; ) {
2966
- for (r = e[p], s = e[p + 1], f = t[r], h = t[s], d = n[r], _ = n[s], b = p; b < o && (b += 2, a = e[b], c = t[a], !(h < c)); ) {
2967
- if (w = n[a], l = e[b + 1], u = t[l], O = n[l], d >= w) {
2968
- if (d > O && _ > w && _ > O) continue;
2969
- } else if (d < O && _ < w && _ < O) continue;
2970
- if (!(r == a || r == l || s == a || s == l) && (M = Jr(
3014
+ let r, s, a, c, f, h, l, u, p, _, w, O, M, m, v, d, b;
3015
+ for (ro(t, e), d = 0; d < o; ) {
3016
+ for (r = e[d], s = e[d + 1], f = t[r], h = t[s], p = n[r], _ = n[s], b = d; b < o && (b += 2, a = e[b], l = t[a], !(h < l)); ) {
3017
+ if (w = n[a], c = e[b + 1], u = t[c], O = n[c], p >= w) {
3018
+ if (p > O && _ > w && _ > O) continue;
3019
+ } else if (p < O && _ < w && _ < O) continue;
3020
+ if (!(r == a || r == c || s == a || s == c) && (M = Kr(
2971
3021
  f,
2972
- d,
3022
+ p,
2973
3023
  h,
2974
3024
  _,
2975
- c,
3025
+ l,
2976
3026
  w,
2977
3027
  u,
2978
3028
  O
2979
- ), M && (m = [r, s], v = [a, l], i(Tn(M, m, v, t, n)) || M.length == 4 && i(Tn(M.slice(2), m, v, t, n)))))
3029
+ ), M && (m = [r, s], v = [a, c], i(Tn(M, m, v, t, n)) || M.length == 4 && i(Tn(M.slice(2), m, v, t, n)))))
2980
3030
  return !0;
2981
3031
  }
2982
- p += 2;
3032
+ d += 2;
2983
3033
  }
2984
3034
  return !1;
2985
3035
  }
2986
- function Jr(e, t, n, i, o, r, s, a) {
2987
- const l = Gr(e, t, n, i, o, r, s, a);
3036
+ function Kr(e, t, n, i, o, r, s, a) {
3037
+ const c = Qr(e, t, n, i, o, r, s, a);
2988
3038
  let f = null;
2989
- return l && (f = Kr(e, t, n, i, o, r, s, a), f ? eo(e, t, n, i, o, r, s, a) && (f = null) : f = to(e, t, n, i, o, r, s, a)), f;
3039
+ return c && (f = Hr(e, t, n, i, o, r, s, a), f ? io(e, t, n, i, o, r, s, a) && (f = null) : f = no(e, t, n, i, o, r, s, a)), f;
2990
3040
  }
2991
- function Gr(e, t, n, i, o, r, s, a) {
3041
+ function Qr(e, t, n, i, o, r, s, a) {
2992
3042
  return ie(e, t, n, i, o, r) * ie(e, t, n, i, s, a) <= 0 && ie(o, r, s, a, e, t) * ie(o, r, s, a, n, i) <= 0;
2993
3043
  }
2994
3044
  function ie(e, t, n, i, o, r) {
@@ -2997,62 +3047,62 @@ function ie(e, t, n, i, o, r) {
2997
3047
  function Wn(e, t, n, i) {
2998
3048
  return e * i - t * n;
2999
3049
  }
3000
- function Kr(e, t, n, i, o, r, s, a) {
3001
- let l = xe(e, t, n, i, o, r, s, a), f;
3002
- return l && (f = Hr(l[0], l[1], e, t, n, i, o, r, s, a), f == 1 ? l = xe(n, i, e, t, o, r, s, a) : f == 2 ? l = xe(o, r, s, a, e, t, n, i) : f == 3 && (l = xe(s, a, o, r, e, t, n, i))), l && Zr(l, e, t, n, i, o, r, s, a), l;
3050
+ function Hr(e, t, n, i, o, r, s, a) {
3051
+ let c = xe(e, t, n, i, o, r, s, a), f;
3052
+ return c && (f = Zr(c[0], c[1], e, t, n, i, o, r, s, a), f == 1 ? c = xe(n, i, e, t, o, r, s, a) : f == 2 ? c = xe(o, r, s, a, e, t, n, i) : f == 3 && (c = xe(s, a, o, r, e, t, n, i))), c && eo(c, e, t, n, i, o, r, s, a), c;
3003
3053
  }
3004
3054
  function xe(e, t, n, i, o, r, s, a) {
3005
- const l = Wn(n - e, i - t, s - o, a - r), f = 1e-18;
3055
+ const c = Wn(n - e, i - t, s - o, a - r), f = 1e-18;
3006
3056
  let h;
3007
- if (l === 0) return null;
3008
- const c = ie(o, r, s, a, e, t) / l;
3009
- return l <= f && l >= -f ? h = Qr(e, t, n, i, o, r, s, a) : h = [e + c * (n - e), t + c * (i - t)], h;
3057
+ if (c === 0) return null;
3058
+ const l = ie(o, r, s, a, e, t) / c;
3059
+ return c <= f && c >= -f ? h = Wr(e, t, n, i, o, r, s, a) : h = [e + l * (n - e), t + l * (i - t)], h;
3010
3060
  }
3011
- function Qr(e, t, n, i, o, r, s, a) {
3012
- let l = null;
3013
- return !Nt(e, o, s) && !Nt(t, r, a) ? l = [e, t] : !Nt(n, o, s) && !Nt(i, r, a) ? l = [n, i] : !Nt(o, e, n) && !Nt(r, t, i) ? l = [o, r] : !Nt(s, e, n) && !Nt(a, t, i) && (l = [s, a]), l;
3061
+ function Wr(e, t, n, i, o, r, s, a) {
3062
+ let c = null;
3063
+ return !Nt(e, o, s) && !Nt(t, r, a) ? c = [e, t] : !Nt(n, o, s) && !Nt(i, r, a) ? c = [n, i] : !Nt(o, e, n) && !Nt(r, t, i) ? c = [o, r] : !Nt(s, e, n) && !Nt(a, t, i) && (c = [s, a]), c;
3014
3064
  }
3015
3065
  function Nt(e, t, n) {
3016
3066
  let i;
3017
3067
  return t < n ? i = e < t || e > n : t > n ? i = e > t || e < n : i = e != t, i;
3018
3068
  }
3019
- function Hr(e, t, ...n) {
3069
+ function Zr(e, t, ...n) {
3020
3070
  let i = -1, o = 1 / 0, r;
3021
- for (let s = 0, a = 0, l = n.length; a < l; s++, a += 2)
3022
- r = Wr(e, t, n[a], n[a + 1]), r < o && (o = r, i = s);
3071
+ for (let s = 0, a = 0, c = n.length; a < c; s++, a += 2)
3072
+ r = to(e, t, n[a], n[a + 1]), r < o && (o = r, i = s);
3023
3073
  return i;
3024
3074
  }
3025
- function Wr(e, t, n, i) {
3075
+ function to(e, t, n, i) {
3026
3076
  const o = e - n, r = t - i;
3027
3077
  return o * o + r * r;
3028
3078
  }
3029
- function Zr(e, t, n, i, o, r, s, a, l) {
3079
+ function eo(e, t, n, i, o, r, s, a, c) {
3030
3080
  let f = e[0], h = e[1];
3031
- f = _e(f, t, i), f = _e(f, r, a), h = _e(h, n, o), h = _e(h, s, l), e[0] = f, e[1] = h;
3081
+ f = _e(f, t, i), f = _e(f, r, a), h = _e(h, n, o), h = _e(h, s, c), e[0] = f, e[1] = h;
3032
3082
  }
3033
3083
  function _e(e, t, n) {
3034
3084
  let i;
3035
3085
  return Nt(e, t, n) && (i = Math.abs(e - t) < Math.abs(e - n) ? t : n, e = i), e;
3036
3086
  }
3037
- function to(e, t, n, i, o, r, s, a) {
3038
- const l = Math.min(e, n, o, s), f = Math.max(e, n, o, s), h = Math.min(t, i, r, a), c = Math.max(t, i, r, a), u = c - h > f - l;
3039
- let d = [];
3040
- return (u ? Yt(t, h, c) : Yt(e, l, f)) && d.push(e, t), (u ? Yt(i, h, c) : Yt(n, l, f)) && d.push(n, i), (u ? Yt(r, h, c) : Yt(o, l, f)) && d.push(o, r), (u ? Yt(a, h, c) : Yt(s, l, f)) && d.push(s, a), (d.length != 2 && d.length != 4 || d.length == 4 && d[0] == d[2] && d[1] == d[3]) && (d = null), d;
3087
+ function no(e, t, n, i, o, r, s, a) {
3088
+ const c = Math.min(e, n, o, s), f = Math.max(e, n, o, s), h = Math.min(t, i, r, a), l = Math.max(t, i, r, a), u = l - h > f - c;
3089
+ let p = [];
3090
+ return (u ? Rt(t, h, l) : Rt(e, c, f)) && p.push(e, t), (u ? Rt(i, h, l) : Rt(n, c, f)) && p.push(n, i), (u ? Rt(r, h, l) : Rt(o, c, f)) && p.push(o, r), (u ? Rt(a, h, l) : Rt(s, c, f)) && p.push(s, a), (p.length != 2 && p.length != 4 || p.length == 4 && p[0] == p[2] && p[1] == p[3]) && (p = null), p;
3041
3091
  }
3042
- function eo(e, t, n, i, o, r, s, a) {
3092
+ function io(e, t, n, i, o, r, s, a) {
3043
3093
  return e == o && t == r || e == s && t == a || n == o && i == r || n == s && i == a;
3044
3094
  }
3045
- function Yt(e, t, n) {
3095
+ function Rt(e, t, n) {
3046
3096
  return e > t && e < n;
3047
3097
  }
3048
- function no(e, t) {
3049
- io(e, t), Zn(e, t, 0, t.length - 2);
3098
+ function ro(e, t) {
3099
+ oo(e, t), Zn(e, t, 0, t.length - 2);
3050
3100
  }
3051
- function io(e, t) {
3101
+ function oo(e, t) {
3052
3102
  for (let n = 0, i = t.length; n < i; n += 2)
3053
- e[t[n]] > e[t[n + 1]] && ro(t, n, n + 1);
3103
+ e[t[n]] > e[t[n + 1]] && so(t, n, n + 1);
3054
3104
  }
3055
- function ro(e, t, n) {
3105
+ function so(e, t, n) {
3056
3106
  const i = e[t];
3057
3107
  e[t] = e[n], e[n] = i;
3058
3108
  }
@@ -3084,17 +3134,17 @@ function Bn(e, t, n, i) {
3084
3134
  function Tn(e, t, n, i, o) {
3085
3135
  const r = e[0], s = e[1];
3086
3136
  t = Cn(r, s, t[0], t[1], i, o), n = Cn(r, s, n[0], n[1], i, o);
3087
- const a = t[0] < n[0] ? t : n, l = a == t ? n : t;
3088
- return { x: r, y: s, a, b: l };
3137
+ const a = t[0] < n[0] ? t : n, c = a == t ? n : t;
3138
+ return { x: r, y: s, a, b: c };
3089
3139
  }
3090
3140
  function Cn(e, t, n, i, o, r) {
3091
3141
  let s = n < i ? n : i, a = s === n ? i : n;
3092
3142
  return o[s] == e && r[s] == t ? a = s : o[a] == e && r[a] == t && (s = a), [s, a];
3093
3143
  }
3094
- function oo(e) {
3144
+ function ao(e) {
3095
3145
  return `${e.a.join(",")};${e.b.join(",")}`;
3096
3146
  }
3097
- class so {
3147
+ class co {
3098
3148
  _i = 0;
3099
3149
  _n = 0;
3100
3150
  _inc = 1;
@@ -3107,16 +3157,16 @@ class so {
3107
3157
  this._xx = t, this._yy = n;
3108
3158
  }
3109
3159
  }
3110
- function ao(e, t, n, i) {
3160
+ function lo(e, t, n, i) {
3111
3161
  let o = n | 0;
3112
3162
  const r = isNaN(i) ? e.length - o : i + o;
3113
- let s, a, l, f, h, c;
3163
+ let s, a, c, f, h, l;
3114
3164
  if (r > 0)
3115
- l = h = e[o], f = c = t[o];
3165
+ c = h = e[o], f = l = t[o];
3116
3166
  else return [void 0, void 0, void 0, void 0];
3117
3167
  for (o++; o < r; o++)
3118
- s = e[o], a = t[o], s < l && (l = s), s > h && (h = s), a < f && (f = a), a > c && (c = a);
3119
- return [l, f, h, c];
3168
+ s = e[o], a = t[o], s < c && (c = s), s > h && (h = s), a < f && (f = a), a > l && (l = a);
3169
+ return [c, f, h, l];
3120
3170
  }
3121
3171
  class ce {
3122
3172
  xmin;
@@ -3145,18 +3195,18 @@ class ce {
3145
3195
  return this.ymax - this.ymin || 0;
3146
3196
  }
3147
3197
  setBounds(t, n, i, o) {
3148
- let r, s, a, l;
3198
+ let r, s, a, c;
3149
3199
  if (arguments.length == 1)
3150
3200
  if (ae(t)) {
3151
3201
  const f = t;
3152
- r = f[0], s = f[1], a = f[2], l = f[3];
3202
+ r = f[0], s = f[1], a = f[2], c = f[3];
3153
3203
  } else {
3154
3204
  const f = t;
3155
- r = f.xmin, s = f.ymin, a = f.xmax, l = f.ymax;
3205
+ r = f.xmin, s = f.ymin, a = f.xmax, c = f.ymax;
3156
3206
  }
3157
3207
  else
3158
- r = t, s = n, a = i, l = o;
3159
- return this.xmin = r, this.ymin = s, this.xmax = a, this.ymax = l, (r > a || s > l) && this.update(), this;
3208
+ r = t, s = n, a = i, c = o;
3209
+ return this.xmin = r, this.ymin = s, this.xmax = a, this.ymax = c, (r > a || s > c) && this.update(), this;
3160
3210
  }
3161
3211
  update() {
3162
3212
  let t;
@@ -3203,20 +3253,20 @@ ${JSON.stringify(o)}`;
3203
3253
  if (i.forEach((r) => {
3204
3254
  const s = e[r];
3205
3255
  if (!s) return;
3206
- const a = s.filter((l) => l !== t);
3256
+ const a = s.filter((c) => c !== t);
3207
3257
  a.length === 0 ? delete e[r] : e[r] = a;
3208
3258
  }), n) {
3209
3259
  const r = (s, a) => {
3210
- !s || !a || (s.features = s.features.filter((l) => l !== a));
3260
+ !s || !a || (s.features = s.features.filter((c) => c !== a));
3211
3261
  };
3212
3262
  r(n.forw, t.forw), r(n.bakw, t.bakw);
3213
3263
  }
3214
3264
  }
3215
3265
  function Me(e, t, n) {
3216
- return Rt(e, { target: { geom: t, index: n } });
3266
+ return Yt(e, { target: { geom: t, index: n } });
3217
3267
  }
3218
3268
  function Se(e) {
3219
- return Rt(e.properties.target.geom, {
3269
+ return Yt(e.properties.target.geom, {
3220
3270
  target: {
3221
3271
  geom: e.geometry.coordinates,
3222
3272
  index: e.properties.target.index
@@ -3226,12 +3276,12 @@ function Se(e) {
3226
3276
  function $n(e, t) {
3227
3277
  const n = e.length, i = t.geometry.coordinates;
3228
3278
  return Array.from({ length: n }, (o, r) => r).map((o) => {
3229
- const r = (o + 1) % n, s = e[o], a = e[r], l = s.geometry.coordinates, f = Math.atan2(
3230
- l[0] - i[0],
3231
- l[1] - i[1]
3279
+ const r = (o + 1) % n, s = e[o], a = e[r], c = s.geometry.coordinates, f = Math.atan2(
3280
+ c[0] - i[0],
3281
+ c[1] - i[1]
3232
3282
  ), h = [t, s, a, t].map(
3233
- (d) => d.geometry.coordinates
3234
- ), c = {
3283
+ (p) => p.geometry.coordinates
3284
+ ), l = {
3235
3285
  a: {
3236
3286
  geom: t.properties.target.geom,
3237
3287
  index: t.properties.target.index
@@ -3245,7 +3295,7 @@ function $n(e, t) {
3245
3295
  index: a.properties.target.index
3246
3296
  }
3247
3297
  }, u = Et([
3248
- le([h], c)
3298
+ le([h], l)
3249
3299
  ]);
3250
3300
  return [f, u];
3251
3301
  }).reduce(
@@ -3257,7 +3307,7 @@ function Ee(e, t = 1e-6) {
3257
3307
  const [n, i] = e[0], [o, r] = e[1], [s, a] = e[2];
3258
3308
  return Math.abs((o - n) * (a - i) - (s - n) * (r - i)) < t;
3259
3309
  }
3260
- function co(e, t) {
3310
+ function fo(e, t) {
3261
3311
  const n = /* @__PURE__ */ new Set();
3262
3312
  return e.forEach((i) => {
3263
3313
  if (i.length !== 2) return;
@@ -3271,77 +3321,77 @@ function re(e) {
3271
3321
  geom: e.geometry.coordinates[0][n]
3272
3322
  }));
3273
3323
  }
3274
- const lo = 10;
3275
- function fo(e, t, n, i, o, r) {
3324
+ const ho = 10;
3325
+ function uo(e, t, n, i, o, r) {
3276
3326
  if (!e && !t) return !1;
3277
- const s = e ? 0 : 1, a = 1 - s, l = n[s], f = n[a];
3278
- if (!l || !f) return !1;
3327
+ const s = e ? 0 : 1, a = 1 - s, c = n[s], f = n[a];
3328
+ if (!c || !f) return !1;
3279
3329
  const h = _t(f.geom);
3280
- let c = !1, u = !1;
3281
- for (let d = 0; d <= 1; d++) {
3282
- const _ = i[d];
3330
+ let l = !1, u = !1;
3331
+ for (let p = 0; p <= 1; p++) {
3332
+ const _ = i[p];
3283
3333
  if (!_) continue;
3284
- const w = [String(_.prop.index), String(l.prop.index)].sort().join("-"), O = o[w];
3334
+ const w = [String(_.prop.index), String(c.prop.index)].sort().join("-"), O = o[w];
3285
3335
  if (!O || O.length < 2) continue;
3286
3336
  const M = O.find(
3287
3337
  (N) => N.bakw !== r[s].bakw
3288
3338
  );
3289
3339
  if (!M) continue;
3290
3340
  const v = re(M.bakw).find(
3291
- (N) => String(N.prop.index) !== String(_.prop.index) && String(N.prop.index) !== String(l.prop.index)
3341
+ (N) => String(N.prop.index) !== String(_.prop.index) && String(N.prop.index) !== String(c.prop.index)
3292
3342
  );
3293
3343
  if (!v) continue;
3294
- c = !0;
3295
- const p = _t(v.geom), b = _t(_.geom), g = _t(l.geom), E = g[0] - b[0], S = g[1] - b[1], k = E * (h[1] - b[1]) - S * (h[0] - b[0]), P = E * (p[1] - b[1]) - S * (p[0] - b[0]);
3344
+ l = !0;
3345
+ const d = _t(v.geom), b = _t(_.geom), g = _t(c.geom), E = g[0] - b[0], S = g[1] - b[1], k = E * (h[1] - b[1]) - S * (h[0] - b[0]), P = E * (d[1] - b[1]) - S * (d[0] - b[0]);
3296
3346
  if (k * P > 0) {
3297
3347
  u = !0;
3298
3348
  break;
3299
3349
  }
3300
3350
  }
3301
- return c && !u;
3351
+ return l && !u;
3302
3352
  }
3303
- function ho(e, t, n, i) {
3353
+ function po(e, t, n, i) {
3304
3354
  if (!e && !t) return !1;
3305
3355
  if (n[0] && n[1] && i[0] && i[1]) {
3306
- const o = i.map((h) => _t(h.geom)), r = n.map((h) => _t(h.geom)), s = o[1][0] - o[0][0], a = o[1][1] - o[0][1], l = s * (r[0][1] - o[0][1]) - a * (r[0][0] - o[0][0]), f = s * (r[1][1] - o[0][1]) - a * (r[1][0] - o[0][0]);
3307
- return l * f < 0;
3356
+ const o = i.map((h) => _t(h.geom)), r = n.map((h) => _t(h.geom)), s = o[1][0] - o[0][0], a = o[1][1] - o[0][1], c = s * (r[0][1] - o[0][1]) - a * (r[0][0] - o[0][0]), f = s * (r[1][1] - o[0][1]) - a * (r[1][0] - o[0][0]);
3357
+ return c * f < 0;
3308
3358
  }
3309
3359
  return !1;
3310
3360
  }
3311
- function uo(e, t, n, i) {
3312
- const o = co(n, i), r = /* @__PURE__ */ new Set();
3361
+ function mo(e, t, n, i) {
3362
+ const o = fo(n, i), r = /* @__PURE__ */ new Set();
3313
3363
  let s = !1;
3314
- for (let a = 0; a < lo; a++) {
3315
- let l = !1;
3364
+ for (let a = 0; a < ho; a++) {
3365
+ let c = !1;
3316
3366
  for (const f of Object.keys(t)) {
3317
3367
  if (r.has(f)) continue;
3318
3368
  r.add(f);
3319
3369
  const h = t[f];
3320
3370
  if (!h || h.length < 2) continue;
3321
- const c = f.split("-");
3322
- if (c.length !== 2 || o.has(f)) continue;
3323
- const u = re(h[0].bakw), d = re(h[1].bakw), _ = re(h[0].forw), w = re(h[1].forw), O = c.map(
3324
- (x) => u.find((B) => `${B.prop.index}` === x) || d.find((B) => `${B.prop.index}` === x)
3325
- ), M = c.map(
3371
+ const l = f.split("-");
3372
+ if (l.length !== 2 || o.has(f)) continue;
3373
+ const u = re(h[0].bakw), p = re(h[1].bakw), _ = re(h[0].forw), w = re(h[1].forw), O = l.map(
3374
+ (x) => u.find((B) => `${B.prop.index}` === x) || p.find((B) => `${B.prop.index}` === x)
3375
+ ), M = l.map(
3326
3376
  (x) => _.find((B) => `${B.prop.index}` === x) || w.find((B) => `${B.prop.index}` === x)
3327
3377
  );
3328
3378
  if (O.some((x) => !x) || M.some((x) => !x))
3329
3379
  continue;
3330
- const m = [u, d].map(
3331
- (x) => x.find((B) => !c.includes(`${B.prop.index}`))
3380
+ const m = [u, p].map(
3381
+ (x) => x.find((B) => !l.includes(`${B.prop.index}`))
3332
3382
  ), v = [_, w].map(
3333
- (x) => x.find((B) => !c.includes(`${B.prop.index}`))
3383
+ (x) => x.find((B) => !l.includes(`${B.prop.index}`))
3334
3384
  );
3335
3385
  if (m.some((x) => !x) || v.some((x) => !x))
3336
3386
  continue;
3337
- const p = h[0].bakw.geometry.coordinates[0].slice(0, 3).map((x) => _t(x)), b = h[1].bakw.geometry.coordinates[0].slice(0, 3).map((x) => _t(x)), g = h[0].forw.geometry.coordinates[0].slice(0, 3).map((x) => _t(x)), E = h[1].forw.geometry.coordinates[0].slice(0, 3).map((x) => _t(x)), S = Ee(p), k = Ee(b), P = Ee(g), N = Ee(E), C = fo(
3387
+ const d = h[0].bakw.geometry.coordinates[0].slice(0, 3).map((x) => _t(x)), b = h[1].bakw.geometry.coordinates[0].slice(0, 3).map((x) => _t(x)), g = h[0].forw.geometry.coordinates[0].slice(0, 3).map((x) => _t(x)), E = h[1].forw.geometry.coordinates[0].slice(0, 3).map((x) => _t(x)), S = Ee(d), k = Ee(b), P = Ee(g), N = Ee(E), C = uo(
3338
3388
  S,
3339
3389
  k,
3340
3390
  m,
3341
3391
  O,
3342
3392
  t,
3343
3393
  h
3344
- ), F = ho(
3394
+ ), F = po(
3345
3395
  P,
3346
3396
  N,
3347
3397
  m,
@@ -3352,17 +3402,17 @@ function uo(e, t, n, i) {
3352
3402
  b
3353
3403
  ) || Dn(
3354
3404
  _t(m[1].geom),
3355
- p
3405
+ d
3356
3406
  )))
3357
3407
  continue;
3358
3408
  const I = M.map(
3359
3409
  (x) => _t(x.geom)
3360
3410
  ), A = v.map(
3361
3411
  (x) => _t(x.geom)
3362
- ), T = po([
3412
+ ), T = go([
3363
3413
  ...I,
3364
3414
  ...A
3365
- ]), X = mo(T), D = Fn(
3415
+ ]), X = wo(T), D = Fn(
3366
3416
  I[0],
3367
3417
  I[1],
3368
3418
  A[0]
@@ -3382,14 +3432,14 @@ function uo(e, t, n, i) {
3382
3432
  a: x.prop,
3383
3433
  b: m[0].prop,
3384
3434
  c: m[1].prop
3385
- }, Y = le([B], $), L = Jn(Y);
3435
+ }, R = le([B], $), L = Jn(R);
3386
3436
  ti(t, {
3387
3437
  forw: L,
3388
- bakw: Y
3438
+ bakw: R
3389
3439
  }, e);
3390
- }), l = !0, s = !0);
3440
+ }), c = !0, s = !0);
3391
3441
  }
3392
- if (!l) break;
3442
+ if (!c) break;
3393
3443
  }
3394
3444
  return s;
3395
3445
  }
@@ -3397,21 +3447,21 @@ function _t(e) {
3397
3447
  return [e[0], e[1]];
3398
3448
  }
3399
3449
  function Dn(e, t) {
3400
- const [n, i] = t[0], [o, r] = t[1], [s, a] = t[2], l = s - n, f = a - i, h = o - n, c = r - i, u = e[0] - n, d = e[1] - i, _ = l * l + f * f, w = l * h + f * c, O = l * u + f * d, M = h * h + c * c, m = h * u + c * d, v = _ * M - w * w;
3450
+ const [n, i] = t[0], [o, r] = t[1], [s, a] = t[2], c = s - n, f = a - i, h = o - n, l = r - i, u = e[0] - n, p = e[1] - i, _ = c * c + f * f, w = c * h + f * l, O = c * u + f * p, M = h * h + l * l, m = h * u + l * p, v = _ * M - w * w;
3401
3451
  if (v === 0) return !1;
3402
- const p = 1 / v, b = (M * O - w * m) * p, g = (_ * m - w * O) * p, E = 1e-9;
3452
+ const d = 1 / v, b = (M * O - w * m) * d, g = (_ * m - w * O) * d, E = 1e-9;
3403
3453
  return b >= -E && g >= -E && b + g <= 1 + E;
3404
3454
  }
3405
- function po(e) {
3455
+ function go(e) {
3406
3456
  const t = e.map((s) => s.slice()).filter(
3407
- (s, a, l) => l.findIndex(
3457
+ (s, a, c) => c.findIndex(
3408
3458
  (f) => qe(f[0], s[0]) && qe(f[1], s[1])
3409
3459
  ) === a
3410
3460
  );
3411
3461
  if (t.length <= 1) return t;
3412
3462
  const n = t.sort(
3413
3463
  (s, a) => s[0] === a[0] ? s[1] - a[1] : s[0] - a[0]
3414
- ), i = (s, a, l) => (a[0] - s[0]) * (l[1] - s[1]) - (a[1] - s[1]) * (l[0] - s[0]), o = [];
3464
+ ), i = (s, a, c) => (a[0] - s[0]) * (c[1] - s[1]) - (a[1] - s[1]) * (c[0] - s[0]), o = [];
3415
3465
  for (const s of n) {
3416
3466
  for (; o.length >= 2 && i(
3417
3467
  o[o.length - 2],
@@ -3434,7 +3484,7 @@ function po(e) {
3434
3484
  }
3435
3485
  return r.pop(), o.pop(), o.concat(r);
3436
3486
  }
3437
- function mo(e) {
3487
+ function wo(e) {
3438
3488
  if (e.length < 3) return 0;
3439
3489
  let t = 0;
3440
3490
  for (let n = 0; n < e.length; n++) {
@@ -3451,7 +3501,7 @@ function Fn(e, t, n) {
3451
3501
  function qe(e, t, n = 1e-9) {
3452
3502
  return Math.abs(e - t) <= n;
3453
3503
  }
3454
- const Yn = 2.00704, Rn = 3.00001;
3504
+ const Rn = 2.00704, Yn = 3.00001;
3455
3505
  class lt extends St {
3456
3506
  importance;
3457
3507
  priority;
@@ -3468,7 +3518,7 @@ class lt extends St {
3468
3518
  * フォーマットバージョンを取得します
3469
3519
  */
3470
3520
  getFormatVersion() {
3471
- return this.useV2Algorithm ? Yn : Rn;
3521
+ return this.useV2Algorithm ? Rn : Yn;
3472
3522
  }
3473
3523
  /**
3474
3524
  * 制御点(GCP: Ground Control Points)を設定します。
@@ -3495,8 +3545,8 @@ class lt extends St {
3495
3545
  let n = t[0][0], i = n, o = t[0][1], r = o;
3496
3546
  const s = [t[0]];
3497
3547
  for (let a = 1; a < t.length; a++) {
3498
- const l = t[a];
3499
- l[0] < n && (n = l[0]), l[0] > i && (i = l[0]), l[1] < o && (o = l[1]), l[1] > r && (r = l[1]), s.push(l);
3548
+ const c = t[a];
3549
+ c[0] < n && (n = c[0]), c[0] > i && (i = c[0]), c[1] < o && (o = c[1]), c[1] > r && (r = c[1]), s.push(c);
3500
3550
  }
3501
3551
  s.push(t[0]), this.boundsPolygon = le([s]), this.xy = [n, o], this.wh = [i - n, r - o], this.vertexMode = lt.VERTEX_PLAIN, this.tins = void 0, this.indexedTins = void 0;
3502
3552
  }
@@ -3505,7 +3555,7 @@ class lt extends St {
3505
3555
  */
3506
3556
  getCompiled() {
3507
3557
  const t = {};
3508
- t.version = this.useV2Algorithm ? Yn : Rn, t.points = this.points, t.weight_buffer = {}, t.centroid_point = [
3558
+ t.version = this.useV2Algorithm ? Rn : Yn, t.points = this.points, t.weight_buffer = {}, t.centroid_point = [
3509
3559
  this.centroid.forw.geometry.coordinates,
3510
3560
  this.centroid.forw.properties.target.geom
3511
3561
  ], t.vertices_params = [
@@ -3574,13 +3624,13 @@ class lt extends St {
3574
3624
  this.tins.bakw = Et(n);
3575
3625
  const i = {};
3576
3626
  this.tins.forw.features.forEach((s, a) => {
3577
- const l = this.tins.bakw.features[a];
3578
- ti(i, { forw: s, bakw: l });
3627
+ const c = this.tins.bakw.features[a];
3628
+ ti(i, { forw: s, bakw: c });
3579
3629
  });
3580
3630
  const o = (this.pointsSet?.forw.features ?? []).map(
3581
3631
  (s) => s.properties.target.index
3582
3632
  );
3583
- uo(
3633
+ mo(
3584
3634
  this.tins,
3585
3635
  i,
3586
3636
  this.pointsSet?.edges || [],
@@ -3588,7 +3638,7 @@ class lt extends St {
3588
3638
  );
3589
3639
  const r = ["forw", "bakw"].map((s) => {
3590
3640
  const a = this.tins[s].features.map(
3591
- (l) => l.geometry.coordinates[0]
3641
+ (c) => c.geometry.coordinates[0]
3592
3642
  );
3593
3643
  return Hn(a, t);
3594
3644
  });
@@ -3615,63 +3665,24 @@ class lt extends St {
3615
3665
  this.edgeNodes = [], this.edges || (this.edges = []);
3616
3666
  for (let o = 0; o < this.edges.length; o++) {
3617
3667
  const r = this.edges[o][2], s = Object.assign([], this.edges[o][0]), a = Object.assign([], this.edges[o][1]);
3618
- if (go(r, this.points.length, o), s.length === 0 && a.length === 0) {
3668
+ if (yo(r, this.points.length, o), s.length === 0 && a.length === 0) {
3619
3669
  n.push(r);
3620
3670
  continue;
3621
3671
  }
3622
- s.unshift(this.points[r[0]][0]), s.push(this.points[r[1]][0]), a.unshift(this.points[r[0]][1]), a.push(this.points[r[1]][1]);
3623
- const l = [s, a].map((f) => {
3624
- const h = f.map((u, d, _) => {
3625
- if (d === 0) return 0;
3626
- const w = _[d - 1];
3627
- return Math.sqrt(
3628
- Math.pow(u[0] - w[0], 2) + Math.pow(u[1] - w[1], 2)
3629
- );
3630
- }), c = h.reduce((u, d, _) => _ === 0 ? [0] : (u.push(u[_ - 1] + d), u), []);
3631
- return c.map((u, d, _) => {
3632
- const w = u / _[_.length - 1];
3633
- return [f[d], h[d], c[d], w];
3634
- });
3635
- });
3636
- l.map((f, h) => {
3637
- const c = l[h ? 0 : 1];
3638
- return f.filter((u, d) => !(d === 0 || d === f.length - 1 || u[4] === "handled")).flatMap((u) => {
3639
- const d = u[0], _ = u[3], w = c.reduce(
3640
- (O, M, m, v) => {
3641
- if (O) return O;
3642
- const p = v[m + 1];
3643
- if (M[3] === _)
3644
- return M[4] = "handled", [M];
3645
- if (M[3] < _ && p && p[3] > _)
3646
- return [M, p];
3647
- },
3648
- void 0
3649
- );
3650
- if (w && w.length === 1)
3651
- return h === 0 ? [[d, w[0][0], _]] : [[w[0][0], d, _]];
3652
- if (w && w.length === 2) {
3653
- const O = w[0], M = w[1], m = (_ - O[3]) / (M[3] - O[3]), v = [
3654
- (M[0][0] - O[0][0]) * m + O[0][0],
3655
- (M[0][1] - O[0][1]) * m + O[0][1]
3656
- ];
3657
- return h === 0 ? [[d, v, _]] : [[v, d, _]];
3658
- }
3659
- return [];
3660
- });
3661
- }).reduce((f, h) => f.concat(h), []).sort((f, h) => f[2] < h[2] ? -1 : 1).map((f, h, c) => {
3672
+ s.unshift(this.points[r[0]][0]), s.push(this.points[r[1]][0]), a.unshift(this.points[r[0]][1]), a.push(this.points[r[1]][1]), Pr(s, a).map((c, f, h) => {
3662
3673
  this.edgeNodes[i] = [
3663
- f[0],
3664
- f[1]
3674
+ c[0],
3675
+ c[1]
3665
3676
  ];
3666
- const u = Me(
3667
- f[0],
3668
- f[1],
3677
+ const l = Me(
3678
+ c[0],
3679
+ c[1],
3669
3680
  `e${i}`
3670
3681
  );
3671
- i++, t.forw.push(u), t.bakw.push(Se(u)), h === 0 ? n.push([r[0], t.forw.length - 1]) : n.push([
3682
+ i++, t.forw.push(l), t.bakw.push(Se(l)), f === 0 ? n.push([r[0], t.forw.length - 1]) : n.push([
3672
3683
  t.forw.length - 2,
3673
3684
  t.forw.length - 1
3674
- ]), h === c.length - 1 && n.push([t.forw.length - 1, r[1]]);
3685
+ ]), f === h.length - 1 && n.push([t.forw.length - 1, r[1]]);
3675
3686
  });
3676
3687
  }
3677
3688
  return {
@@ -3687,7 +3698,7 @@ class lt extends St {
3687
3698
  const t = this.xy[0] - 0.05 * this.wh[0], n = this.xy[0] + 1.05 * this.wh[0], i = this.xy[1] - 0.05 * this.wh[1], o = this.xy[1] + 1.05 * this.wh[1];
3688
3699
  if (this.bounds && !this.boundsPolygon) throw new Error("Internal error: bounds is set but boundsPolygon is missing");
3689
3700
  const r = this.bounds ? this.boundsPolygon : void 0;
3690
- if (!this.points.reduce((l, f) => l && (r ? $e(f[0], r) : f[0][0] >= t && f[0][0] <= n && f[0][1] >= i && f[0][1] <= o), !0))
3701
+ if (!this.points.reduce((c, f) => c && (r ? $e(f[0], r) : f[0][0] >= t && f[0][0] <= n && f[0][1] >= i && f[0][1] <= o), !0))
3691
3702
  throw "SOME POINTS OUTSIDE";
3692
3703
  let a = [];
3693
3704
  return this.wh && (a = [[t, i], [n, i], [t, o], [n, o]]), {
@@ -3706,8 +3717,8 @@ class lt extends St {
3706
3717
  computeGcpBbox() {
3707
3718
  let t = 1 / 0, n = -1 / 0, i = 1 / 0, o = -1 / 0;
3708
3719
  for (const a of this.points) {
3709
- const l = a[0][0], f = a[0][1];
3710
- l < t && (t = l), l > n && (n = l), f < i && (i = f), f > o && (o = f);
3720
+ const c = a[0][0], f = a[0][1];
3721
+ c < t && (t = c), c > n && (n = c), f < i && (i = f), f > o && (o = f);
3711
3722
  }
3712
3723
  const r = n - t, s = o - i;
3713
3724
  return {
@@ -3740,52 +3751,52 @@ class lt extends St {
3740
3751
  const S = this.validateAndPrepareInputs();
3741
3752
  i = S.pointsSet, o = S.minx, r = S.maxx, s = S.miny, a = S.maxy;
3742
3753
  }
3743
- const l = {
3754
+ const c = {
3744
3755
  forw: Et(i.forw),
3745
3756
  bakw: Et(i.bakw)
3746
3757
  }, f = be(
3747
- l.forw,
3758
+ c.forw,
3748
3759
  i.edges,
3749
3760
  "target"
3750
3761
  ), h = be(
3751
- l.bakw,
3762
+ c.bakw,
3752
3763
  i.edges,
3753
3764
  "target"
3754
3765
  );
3755
3766
  if (f.features.length === 0 || h.features.length === 0)
3756
3767
  throw "TOO LINEAR1";
3757
- const c = Xi(l.forw), u = mn(l.forw);
3768
+ const l = Xi(c.forw), u = mn(c.forw);
3758
3769
  if (!u) throw "TOO LINEAR2";
3759
- const d = {}, _ = u.geometry.coordinates[0];
3770
+ const p = {}, _ = u.geometry.coordinates[0];
3760
3771
  let w;
3761
3772
  try {
3762
3773
  w = _.map((S) => ({
3763
3774
  forw: S,
3764
- bakw: ne(Rt(S), f)
3775
+ bakw: ne(Yt(S), f)
3765
3776
  })), w.forEach((S) => {
3766
- d[`${S.forw[0]}:${S.forw[1]}`] = S;
3777
+ p[`${S.forw[0]}:${S.forw[1]}`] = S;
3767
3778
  });
3768
3779
  } catch {
3769
3780
  throw "TOO LINEAR2";
3770
3781
  }
3771
- const O = mn(l.bakw);
3782
+ const O = mn(c.bakw);
3772
3783
  if (!O) throw "TOO LINEAR2";
3773
3784
  const M = O.geometry.coordinates[0];
3774
3785
  try {
3775
3786
  w = M.map((S) => ({
3776
3787
  bakw: S,
3777
- forw: ne(Rt(S), h)
3788
+ forw: ne(Yt(S), h)
3778
3789
  })), w.forEach((S) => {
3779
- d[`${S.forw[0]}:${S.forw[1]}`] = S;
3790
+ p[`${S.forw[0]}:${S.forw[1]}`] = S;
3780
3791
  });
3781
3792
  } catch {
3782
3793
  throw "TOO LINEAR2";
3783
3794
  }
3784
3795
  let m;
3785
3796
  if (n) {
3786
- const S = c.geometry.coordinates, k = f.features.find(
3797
+ const S = l.geometry.coordinates, k = f.features.find(
3787
3798
  (P) => $e(
3788
- Rt(S),
3799
+ Yt(S),
3789
3800
  P
3790
3801
  )
3791
3802
  );
@@ -3804,30 +3815,30 @@ class lt extends St {
3804
3815
  } else
3805
3816
  m = {
3806
3817
  forw: S,
3807
- bakw: ne(c, f)
3818
+ bakw: ne(l, f)
3808
3819
  };
3809
3820
  } else
3810
3821
  m = {
3811
- forw: c.geometry.coordinates,
3812
- bakw: ne(c, f)
3822
+ forw: l.geometry.coordinates,
3823
+ bakw: ne(l, f)
3813
3824
  };
3814
3825
  const v = Me(m.forw, m.bakw, "c");
3815
3826
  this.centroid = {
3816
3827
  forw: v,
3817
3828
  bakw: Se(v)
3818
3829
  };
3819
- const p = [
3830
+ const d = [
3820
3831
  ...this.points.map((S) => ({ forw: S[0], bakw: S[1] })),
3821
3832
  ...(this.edgeNodes ?? []).map((S) => ({ forw: S[0], bakw: S[1] }))
3822
3833
  ], b = {
3823
- convexBuf: d,
3834
+ convexBuf: p,
3824
3835
  centroid: m,
3825
- allGcps: p,
3836
+ allGcps: d,
3826
3837
  minx: o,
3827
3838
  maxx: r,
3828
3839
  miny: s,
3829
3840
  maxy: a
3830
- }, g = this.vertexMode === lt.VERTEX_BIRDEYE ? Dr(b, n) : $r(b, n), E = {
3841
+ }, g = this.vertexMode === lt.VERTEX_BIRDEYE ? Rr(b, n) : Fr(b, n), E = {
3831
3842
  forw: [],
3832
3843
  bakw: []
3833
3844
  };
@@ -3868,7 +3879,7 @@ class lt extends St {
3868
3879
  this.updateTin();
3869
3880
  }
3870
3881
  }
3871
- function go(e, t, n) {
3882
+ function yo(e, t, n) {
3872
3883
  const i = (o) => Number.isInteger(o) && o >= 0 && o < t;
3873
3884
  if (!Array.isArray(e) || !i(e[0]) || !i(e[1]))
3874
3885
  throw new Error(
@@ -3881,8 +3892,8 @@ export {
3881
3892
  Se as counterPoint,
3882
3893
  Me as createPoint,
3883
3894
  lt as default,
3884
- wo as findIntersections,
3885
- Yn as format_version,
3895
+ vo as findIntersections,
3896
+ Rn as format_version,
3886
3897
  ti as insertSearchIndex,
3887
3898
  $n as vertexCalc
3888
3899
  };