@hybridcore/ui 1.5.30 → 1.5.32

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.
@@ -1,4 +1,4 @@
1
- import { S as e, F as t, a as c, I as o, C as w, T as g } from "../../../Text-BT5kPHOo.js";
1
+ import { S as e, F as t, a as c, I as o, C as w, T as g } from "../../../Text-Cl1H4b0h.js";
2
2
  const i = "data:image/svg+xml,%3csvg%20id='Layer_1'%20height='512'%20viewBox='0%200%2064%2064'%20width='512'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20data-name='Layer%201'%3e%3clinearGradient%20id='linear-gradient'%20gradientUnits='userSpaceOnUse'%20x1='63.568'%20x2='14.149'%20y1='60.512'%20y2='11.093'%3e%3cstop%20offset='0'%20stop-color='%23c21500'/%3e%3cstop%20offset='1'%20stop-color='%23f85032'/%3e%3c/linearGradient%3e%3cpath%20d='m48.19%2017.36a19.2%2019.2%200%200%200%20-17.18-9.33%2018.905%2018.905%200%200%200%20-17.94%2018.9c0%2012.74%2013%2024.93%2016.98%2028.36a2.969%202.969%200%200%200%203.9%200c5.77-4.97%2023.84-22.39%2014.24-37.93zm-16.19%2018.54a9.825%209.825%200%201%201%209.82-9.83%209.833%209.833%200%200%201%20-9.82%209.83z'%20fill='url(%23linear-gradient)'/%3e%3c/svg%3e", s = 0.5, h = new e({
3
3
  fill: new t({
4
4
  color: "rgba(255, 255, 255, 0.2)"
@@ -10,7 +10,7 @@ function L({ coordinate: u, onChange: d }) {
10
10
  {
11
11
  label: "Latitude",
12
12
  size: "small",
13
- value: l.latLonStr.latitude,
13
+ value: l.data.latLon.latitude,
14
14
  onChange: a.onChangeLat
15
15
  }
16
16
  ) }),
@@ -19,7 +19,7 @@ function L({ coordinate: u, onChange: d }) {
19
19
  {
20
20
  label: "Longitude",
21
21
  size: "small",
22
- value: l.latLonStr.longitude,
22
+ value: l.data.latLon.longitude,
23
23
  onChange: a.onChangeLon
24
24
  }
25
25
  ) })
@@ -1,4 +1,4 @@
1
- import { useState as it, useEffect as ct } from "react";
1
+ import { useState as ht, useEffect as ct } from "react";
2
2
  let ut = " ";
3
3
  class h {
4
4
  // note Unicode Degree = U+00B0. Prime = U+2032, Double prime = U+2033
@@ -268,7 +268,7 @@ Number.prototype.toRadians = function() {
268
268
  Number.prototype.toDegrees = function() {
269
269
  return this * 180 / Math.PI;
270
270
  };
271
- class $ {
271
+ class b {
272
272
  /**
273
273
  * Creates a 3-d vector.
274
274
  *
@@ -299,8 +299,8 @@ class $ {
299
299
  * @returns {Vector3d} Vector representing sum of this and v.
300
300
  */
301
301
  plus(t) {
302
- if (!(t instanceof $)) throw new TypeError("v is not Vector3d object");
303
- return new $(this.x + t.x, this.y + t.y, this.z + t.z);
302
+ if (!(t instanceof b)) throw new TypeError("v is not Vector3d object");
303
+ return new b(this.x + t.x, this.y + t.y, this.z + t.z);
304
304
  }
305
305
  /**
306
306
  * Subtracts supplied vector from ‘this’ vector.
@@ -309,8 +309,8 @@ class $ {
309
309
  * @returns {Vector3d} Vector representing difference between this and v.
310
310
  */
311
311
  minus(t) {
312
- if (!(t instanceof $)) throw new TypeError("v is not Vector3d object");
313
- return new $(this.x - t.x, this.y - t.y, this.z - t.z);
312
+ if (!(t instanceof b)) throw new TypeError("v is not Vector3d object");
313
+ return new b(this.x - t.x, this.y - t.y, this.z - t.z);
314
314
  }
315
315
  /**
316
316
  * Multiplies ‘this’ vector by a scalar value.
@@ -320,7 +320,7 @@ class $ {
320
320
  */
321
321
  times(t) {
322
322
  if (isNaN(t)) throw new TypeError(`invalid scalar value ‘${t}’`);
323
- return new $(this.x * t, this.y * t, this.z * t);
323
+ return new b(this.x * t, this.y * t, this.z * t);
324
324
  }
325
325
  /**
326
326
  * Divides ‘this’ vector by a scalar value.
@@ -330,7 +330,7 @@ class $ {
330
330
  */
331
331
  dividedBy(t) {
332
332
  if (isNaN(t)) throw new TypeError(`invalid scalar value ‘${t}’`);
333
- return new $(this.x / t, this.y / t, this.z / t);
333
+ return new b(this.x / t, this.y / t, this.z / t);
334
334
  }
335
335
  /**
336
336
  * Multiplies ‘this’ vector by the supplied vector using dot (scalar) product.
@@ -339,7 +339,7 @@ class $ {
339
339
  * @returns {number} Dot product of ‘this’ and v.
340
340
  */
341
341
  dot(t) {
342
- if (!(t instanceof $)) throw new TypeError("v is not Vector3d object");
342
+ if (!(t instanceof b)) throw new TypeError("v is not Vector3d object");
343
343
  return this.x * t.x + this.y * t.y + this.z * t.z;
344
344
  }
345
345
  /**
@@ -349,9 +349,9 @@ class $ {
349
349
  * @returns {Vector3d} Cross product of ‘this’ and v.
350
350
  */
351
351
  cross(t) {
352
- if (!(t instanceof $)) throw new TypeError("v is not Vector3d object");
352
+ if (!(t instanceof b)) throw new TypeError("v is not Vector3d object");
353
353
  const n = this.y * t.z - this.z * t.y, s = this.z * t.x - this.x * t.z, e = this.x * t.y - this.y * t.x;
354
- return new $(n, s, e);
354
+ return new b(n, s, e);
355
355
  }
356
356
  /**
357
357
  * Negates a vector to point in the opposite direction.
@@ -359,7 +359,7 @@ class $ {
359
359
  * @returns {Vector3d} Negated vector.
360
360
  */
361
361
  negate() {
362
- return new $(-this.x, -this.y, -this.z);
362
+ return new b(-this.x, -this.y, -this.z);
363
363
  }
364
364
  /**
365
365
  * Normalizes a vector to its unit vector
@@ -372,7 +372,7 @@ class $ {
372
372
  if (t == 1) return this;
373
373
  if (t == 0) return this;
374
374
  const n = this.x / t, s = this.y / t, e = this.z / t;
375
- return new $(n, s, e);
375
+ return new b(n, s, e);
376
376
  }
377
377
  /**
378
378
  * Calculates the angle between ‘this’ vector and supplied vector atan2(|p₁×p₂|, p₁·p₂) (or if
@@ -385,8 +385,8 @@ class $ {
385
385
  * if n not supplied, range -π..+π if n supplied).
386
386
  */
387
387
  angleTo(t, n = void 0) {
388
- if (!(t instanceof $)) throw new TypeError("v is not Vector3d object");
389
- if (!(n instanceof $ || n == null)) throw new TypeError("n is not Vector3d object");
388
+ if (!(t instanceof b)) throw new TypeError("v is not Vector3d object");
389
+ if (!(n instanceof b || n == null)) throw new TypeError("n is not Vector3d object");
390
390
  const s = n == null || this.cross(t).dot(n) >= 0 ? 1 : -1, e = this.cross(t).length * s, i = this.dot(t);
391
391
  return Math.atan2(e, i);
392
392
  }
@@ -398,18 +398,18 @@ class $ {
398
398
  * @returns {Vector3d} The rotated point.
399
399
  */
400
400
  rotateAround(t, n) {
401
- if (!(t instanceof $)) throw new TypeError("axis is not Vector3d object");
402
- const s = n.toRadians(), e = this.unit(), i = t.unit(), r = Math.sin(s), a = Math.cos(s), o = 1 - a, p = i.x, u = i.y, d = i.z, w = [
401
+ if (!(t instanceof b)) throw new TypeError("axis is not Vector3d object");
402
+ const s = n.toRadians(), e = this.unit(), i = t.unit(), r = Math.sin(s), a = Math.cos(s), l = 1 - a, p = i.x, c = i.y, d = i.z, m = [
403
403
  // rotation matrix for rotation about supplied axis
404
- [o * p * p + a, o * p * u - r * d, o * p * d + r * u],
405
- [o * p * u + r * d, o * u * u + a, o * u * d - r * p],
406
- [o * p * d - r * u, o * u * d + r * p, o * d * d + a]
407
- ], N = [
408
- w[0][0] * e.x + w[0][1] * e.y + w[0][2] * e.z,
409
- w[1][0] * e.x + w[1][1] * e.y + w[1][2] * e.z,
410
- w[2][0] * e.x + w[2][1] * e.y + w[2][2] * e.z
404
+ [l * p * p + a, l * p * c - r * d, l * p * d + r * c],
405
+ [l * p * c + r * d, l * c * c + a, l * c * d - r * p],
406
+ [l * p * d - r * c, l * c * d + r * p, l * d * d + a]
407
+ ], f = [
408
+ m[0][0] * e.x + m[0][1] * e.y + m[0][2] * e.z,
409
+ m[1][0] * e.x + m[1][1] * e.y + m[1][2] * e.z,
410
+ m[2][0] * e.x + m[2][1] * e.y + m[2][2] * e.z
411
411
  ];
412
- return new $(N[0], N[1], N[2]);
412
+ return new b(f[0], f[1], f[2]);
413
413
  }
414
414
  /**
415
415
  * String representation of vector.
@@ -579,8 +579,8 @@ class Q {
579
579
  * earth centre.
580
580
  */
581
581
  toCartesian() {
582
- const t = this.datum ? this.datum.ellipsoid : this.referenceFrame ? this.referenceFrame.ellipsoid : B.WGS84, n = this.lat.toRadians(), s = this.lon.toRadians(), e = this.height, { a: i, f: r } = t, a = Math.sin(n), o = Math.cos(n), p = Math.sin(s), u = Math.cos(s), d = 2 * r - r * r, w = i / Math.sqrt(1 - d * a * a), N = (w + e) * o * u, g = (w + e) * o * p, f = (w * (1 - d) + e) * a;
583
- return new ft(N, g, f);
582
+ const t = this.datum ? this.datum.ellipsoid : this.referenceFrame ? this.referenceFrame.ellipsoid : B.WGS84, n = this.lat.toRadians(), s = this.lon.toRadians(), e = this.height, { a: i, f: r } = t, a = Math.sin(n), l = Math.cos(n), p = Math.sin(s), c = Math.cos(s), d = 2 * r - r * r, m = i / Math.sqrt(1 - d * a * a), f = (m + e) * l * c, u = (m + e) * l * p, w = (m * (1 - d) + e) * a;
583
+ return new ft(f, u, w);
584
584
  }
585
585
  /**
586
586
  * Checks if another point is equal to ‘this’ point.
@@ -620,14 +620,14 @@ class Q {
620
620
  const e = (this.height >= 0 ? " +" : " ") + this.height.toFixed(s) + "m";
621
621
  if (t == "n") {
622
622
  n == null && (n = 4);
623
- const a = this.lat.toFixed(n), o = this.lon.toFixed(n);
624
- return `${a}, ${o}${s == null ? "" : e}`;
623
+ const a = this.lat.toFixed(n), l = this.lon.toFixed(n);
624
+ return `${a}, ${l}${s == null ? "" : e}`;
625
625
  }
626
626
  const i = h.toLat(this.lat, t, n), r = h.toLon(this.lon, t, n);
627
627
  return `${i}, ${r}${s == null ? "" : e}`;
628
628
  }
629
629
  }
630
- class ft extends $ {
630
+ class ft extends b {
631
631
  /**
632
632
  * Creates cartesian coordinate representing ECEF (earth-centric earth-fixed) point.
633
633
  *
@@ -659,8 +659,8 @@ class ft extends $ {
659
659
  */
660
660
  toLatLon(t = B.WGS84) {
661
661
  if (!t || !t.a) throw new TypeError(`invalid ellipsoid ‘${t}’`);
662
- const { x: n, y: s, z: e } = this, { a: i, b: r, f: a } = t, o = 2 * a - a * a, p = o / (1 - o), u = Math.sqrt(n * n + s * s), d = Math.sqrt(u * u + e * e), w = r * e / (i * u) * (1 + p * r / d), N = w / Math.sqrt(1 + w * w), g = N / w, f = isNaN(g) ? 0 : Math.atan2(e + p * r * N * N * N, u - o * i * g * g * g), c = Math.atan2(s, n), m = Math.sin(f), y = Math.cos(f), b = i / Math.sqrt(1 - o * m * m), S = u * y + e * m - i * i / b;
663
- return new Q(f.toDegrees(), c.toDegrees(), S);
662
+ const { x: n, y: s, z: e } = this, { a: i, b: r, f: a } = t, l = 2 * a - a * a, p = l / (1 - l), c = Math.sqrt(n * n + s * s), d = Math.sqrt(c * c + e * e), m = r * e / (i * c) * (1 + p * r / d), f = m / Math.sqrt(1 + m * m), u = f / m, w = isNaN(u) ? 0 : Math.atan2(e + p * r * f * f * f, c - l * i * u * u * u), N = Math.atan2(s, n), S = Math.sin(w), M = Math.cos(w), E = i / Math.sqrt(1 - l * S * S), $ = c * M + e * S - i * i / E;
663
+ return new Q(w.toDegrees(), N.toDegrees(), $);
664
664
  }
665
665
  /**
666
666
  * Returns a string representation of ‘this’ cartesian point.
@@ -702,9 +702,9 @@ const x = {
702
702
  WGS72: { ellipsoid: x.WGS72, transform: [0, 0, -4.5, -0.22, 0, 0, 0.554] },
703
703
  WGS84: { ellipsoid: x.WGS84, transform: [0, 0, 0, 0, 0, 0, 0] }
704
704
  };
705
- Object.keys(x).forEach((M) => Object.freeze(x[M]));
706
- Object.keys(R).forEach((M) => {
707
- Object.freeze(R[M]), Object.freeze(R[M].transform);
705
+ Object.keys(x).forEach((g) => Object.freeze(x[g]));
706
+ Object.keys(R).forEach((g) => {
707
+ Object.freeze(R[g]), Object.freeze(R[g].transform);
708
708
  });
709
709
  class D extends Q {
710
710
  /**
@@ -816,10 +816,10 @@ class D extends Q {
816
816
  */
817
817
  toCartesian() {
818
818
  const t = super.toCartesian();
819
- return new lt(t.x, t.y, t.z, this.datum);
819
+ return new at(t.x, t.y, t.z, this.datum);
820
820
  }
821
821
  }
822
- class lt extends ft {
822
+ class at extends ft {
823
823
  /**
824
824
  * Creates cartesian coordinate representing ECEF (earth-centric earth-fixed) point, on a given
825
825
  * datum. The datum will identify the primary meridian (for the x-coordinate), and is also
@@ -899,8 +899,8 @@ class lt extends ft {
899
899
  * @returns {Cartesian} Transformed point.
900
900
  */
901
901
  applyTransform(t) {
902
- const { x: n, y: s, z: e } = this, i = t[0], r = t[1], a = t[2], o = t[3] / 1e6 + 1, p = (t[4] / 3600).toRadians(), u = (t[5] / 3600).toRadians(), d = (t[6] / 3600).toRadians(), w = i + n * o - s * d + e * u, N = r + n * d + s * o - e * p, g = a - n * u + s * p + e * o;
903
- return new lt(w, N, g);
902
+ const { x: n, y: s, z: e } = this, i = t[0], r = t[1], a = t[2], l = t[3] / 1e6 + 1, p = (t[4] / 3600).toRadians(), c = (t[5] / 3600).toRadians(), d = (t[6] / 3600).toRadians(), m = i + n * l - s * d + e * c, f = r + n * d + s * l - e * p, u = a - n * c + s * p + e * l;
903
+ return new at(m, f, u);
904
904
  }
905
905
  }
906
906
  class pt {
@@ -925,11 +925,11 @@ class pt {
925
925
  * import Utm from '/js/geodesy/utm.js';
926
926
  * const utmCoord = new Utm(31, 'N', 448251, 5411932);
927
927
  */
928
- constructor(t, n, s, e, i = D.datums.WGS84, r = null, a = null, o = !0) {
928
+ constructor(t, n, s, e, i = D.datums.WGS84, r = null, a = null, l = !0) {
929
929
  if (!(1 <= t && t <= 60)) throw new RangeError(`invalid UTM zone ‘${t}’`);
930
930
  if (t != parseInt(t)) throw new RangeError(`invalid UTM zone ‘${t}’`);
931
931
  if (typeof n != "string" || !n.match(/[NS]/i)) throw new RangeError(`invalid UTM hemisphere ‘${n}’`);
932
- if (o) {
932
+ if (l) {
933
933
  if (!(0 <= s && s <= 1e6)) throw new RangeError(`invalid UTM easting ‘${s}’`);
934
934
  if (n.toUpperCase() == "N" && !(0 <= e && e < 9328094)) throw new RangeError(`invalid UTM northing ‘${e}’`);
935
935
  if (n.toUpperCase() == "S" && !(1118414 < e && e <= 1e7)) throw new RangeError(`invalid UTM northing ‘${e}’`);
@@ -951,32 +951,32 @@ class pt {
951
951
  * const latlong = grid.toLatLon(); // 48°51′29.52″N, 002°17′40.20″E
952
952
  */
953
953
  toLatLon() {
954
- const { zone: t, hemisphere: n } = this, s = 5e5, e = 1e7, { a: i, f: r } = this.datum.ellipsoid, a = 0.9996, o = this.easting - s, p = n == "S" ? this.northing - e : this.northing, u = Math.sqrt(r * (2 - r)), d = r / (2 - r), w = d * d, N = d * w, g = d * N, f = d * g, c = d * f, m = i / (1 + d) * (1 + 1 / 4 * w + 1 / 64 * g + 1 / 256 * c), y = o / (a * m), b = p / (a * m), S = [
954
+ const { zone: t, hemisphere: n } = this, s = 5e5, e = 1e7, { a: i, f: r } = this.datum.ellipsoid, a = 0.9996, l = this.easting - s, p = n == "S" ? this.northing - e : this.northing, c = Math.sqrt(r * (2 - r)), d = r / (2 - r), m = d * d, f = d * m, u = d * f, w = d * u, N = d * w, S = i / (1 + d) * (1 + 1 / 4 * m + 1 / 64 * u + 1 / 256 * N), M = l / (a * S), E = p / (a * S), $ = [
955
955
  null,
956
956
  // note β is one-based array (6th order Krüger expressions)
957
- 1 / 2 * d - 2 / 3 * w + 37 / 96 * N - 1 / 360 * g - 81 / 512 * f + 96199 / 604800 * c,
958
- 1 / 48 * w + 1 / 15 * N - 437 / 1440 * g + 46 / 105 * f - 1118711 / 3870720 * c,
959
- 17 / 480 * N - 37 / 840 * g - 209 / 4480 * f + 5569 / 90720 * c,
960
- 4397 / 161280 * g - 11 / 504 * f - 830251 / 7257600 * c,
961
- 4583 / 161280 * f - 108847 / 3991680 * c,
962
- 20648693 / 638668800 * c
957
+ 1 / 2 * d - 2 / 3 * m + 37 / 96 * f - 1 / 360 * u - 81 / 512 * w + 96199 / 604800 * N,
958
+ 1 / 48 * m + 1 / 15 * f - 437 / 1440 * u + 46 / 105 * w - 1118711 / 3870720 * N,
959
+ 17 / 480 * f - 37 / 840 * u - 209 / 4480 * w + 5569 / 90720 * N,
960
+ 4397 / 161280 * u - 11 / 504 * w - 830251 / 7257600 * N,
961
+ 4583 / 161280 * w - 108847 / 3991680 * N,
962
+ 20648693 / 638668800 * N
963
963
  ];
964
- let L = b;
965
- for (let l = 1; l <= 6; l++) L -= S[l] * Math.sin(2 * l * b) * Math.cosh(2 * l * y);
966
- let P = y;
967
- for (let l = 1; l <= 6; l++) P -= S[l] * Math.cos(2 * l * b) * Math.sinh(2 * l * y);
964
+ let L = E;
965
+ for (let o = 1; o <= 6; o++) L -= $[o] * Math.sin(2 * o * E) * Math.cosh(2 * o * M);
966
+ let P = M;
967
+ for (let o = 1; o <= 6; o++) P -= $[o] * Math.cos(2 * o * E) * Math.sinh(2 * o * M);
968
968
  const G = Math.sinh(P), v = Math.sin(L), F = Math.cos(L), T = v / Math.sqrt(G * G + F * F);
969
- let W = null, E = T;
969
+ let W = null, y = T;
970
970
  do {
971
- const l = Math.sinh(u * Math.atanh(u * E / Math.sqrt(1 + E * E))), st = E * Math.sqrt(1 + l * l) - l * Math.sqrt(1 + E * E);
972
- W = (T - st) / Math.sqrt(1 + st * st) * (1 + (1 - u * u) * E * E) / ((1 - u * u) * Math.sqrt(1 + E * E)), E += W;
971
+ const o = Math.sinh(c * Math.atanh(c * y / Math.sqrt(1 + y * y))), st = y * Math.sqrt(1 + o * o) - o * Math.sqrt(1 + y * y);
972
+ W = (T - st) / Math.sqrt(1 + st * st) * (1 + (1 - c * c) * y * y) / ((1 - c * c) * Math.sqrt(1 + y * y)), y += W;
973
973
  } while (Math.abs(W) > 1e-12);
974
- const q = E, U = Math.atan(q);
974
+ const q = y, U = Math.atan(q);
975
975
  let O = Math.atan2(G, F), C = 1;
976
- for (let l = 1; l <= 6; l++) C -= 2 * l * S[l] * Math.cos(2 * l * b) * Math.cosh(2 * l * y);
976
+ for (let o = 1; o <= 6; o++) C -= 2 * o * $[o] * Math.cos(2 * o * E) * Math.cosh(2 * o * M);
977
977
  let z = 0;
978
- for (let l = 1; l <= 6; l++) z += 2 * l * S[l] * Math.sin(2 * l * b) * Math.sinh(2 * l * y);
979
- const k = Math.atan(Math.tan(L) * Math.tanh(P)), j = Math.atan2(z, C), A = k + j, X = Math.sin(U), H = Math.sqrt(1 - u * u * X * X) * Math.sqrt(1 + q * q) * Math.sqrt(G * G + F * F), Y = m / i / Math.sqrt(C * C + z * z), J = a * H * Y, Z = ((t - 1) * 6 - 180 + 3).toRadians();
978
+ for (let o = 1; o <= 6; o++) z += 2 * o * $[o] * Math.sin(2 * o * E) * Math.sinh(2 * o * M);
979
+ const k = Math.atan(Math.tan(L) * Math.tanh(P)), j = Math.atan2(z, C), A = k + j, X = Math.sin(U), H = Math.sqrt(1 - c * c * X * X) * Math.sqrt(1 + q * q) * Math.sqrt(G * G + F * F), Y = S / i / Math.sqrt(C * C + z * z), J = a * H * Y, Z = ((t - 1) * 6 - 180 + 3).toRadians();
980
980
  O += Z;
981
981
  const V = Number(U.toDegrees().toFixed(14)), tt = Number(O.toDegrees().toFixed(14)), nt = Number(A.toDegrees().toFixed(9)), et = Number(J.toFixed(12)), I = new K(V, tt, 0, this.datum);
982
982
  return I.convergence = nt, I.scale = et, I;
@@ -1046,31 +1046,31 @@ class K extends D {
1046
1046
  let e = t || Math.floor((this.lon + 180) / 6) + 1, i = ((e - 1) * 6 - 180 + 3).toRadians();
1047
1047
  const a = "CDEFGHJKLMNPQRSTUVWXX".charAt(Math.floor(this.lat / 8 + 10));
1048
1048
  e == 31 && a == "V" && this.lon >= 3 && (e++, i += 6 .toRadians()), e == 32 && a == "X" && this.lon < 9 && (e--, i -= 6 .toRadians()), e == 32 && a == "X" && this.lon >= 9 && (e++, i += 6 .toRadians()), e == 34 && a == "X" && this.lon < 21 && (e--, i -= 6 .toRadians()), e == 34 && a == "X" && this.lon >= 21 && (e++, i += 6 .toRadians()), e == 36 && a == "X" && this.lon < 33 && (e--, i -= 6 .toRadians()), e == 36 && a == "X" && this.lon >= 33 && (e++, i += 6 .toRadians());
1049
- const o = this.lat.toRadians(), p = this.lon.toRadians() - i, u = this.datum ? this.datum.ellipsoid : D.ellipsoids.WGS84, { a: d, f: w } = u, N = 0.9996, g = Math.sqrt(w * (2 - w)), f = w / (2 - w), c = f * f, m = f * c, y = f * m, b = f * y, S = f * b, L = Math.cos(p), P = Math.sin(p), G = Math.tan(p), v = Math.tan(o), F = Math.sinh(g * Math.atanh(g * v / Math.sqrt(1 + v * v))), T = v * Math.sqrt(1 + F * F) - F * Math.sqrt(1 + v * v), W = Math.atan2(T, L), E = Math.asinh(P / Math.sqrt(T * T + L * L)), q = d / (1 + f) * (1 + 1 / 4 * c + 1 / 64 * y + 1 / 256 * S), U = [
1049
+ const l = this.lat.toRadians(), p = this.lon.toRadians() - i, c = this.datum ? this.datum.ellipsoid : D.ellipsoids.WGS84, { a: d, f: m } = c, f = 0.9996, u = Math.sqrt(m * (2 - m)), w = m / (2 - m), N = w * w, S = w * N, M = w * S, E = w * M, $ = w * E, L = Math.cos(p), P = Math.sin(p), G = Math.tan(p), v = Math.tan(l), F = Math.sinh(u * Math.atanh(u * v / Math.sqrt(1 + v * v))), T = v * Math.sqrt(1 + F * F) - F * Math.sqrt(1 + v * v), W = Math.atan2(T, L), y = Math.asinh(P / Math.sqrt(T * T + L * L)), q = d / (1 + w) * (1 + 1 / 4 * N + 1 / 64 * M + 1 / 256 * $), U = [
1050
1050
  null,
1051
1051
  // note α is one-based array (6th order Krüger expressions)
1052
- 1 / 2 * f - 2 / 3 * c + 5 / 16 * m + 41 / 180 * y - 127 / 288 * b + 7891 / 37800 * S,
1053
- 13 / 48 * c - 3 / 5 * m + 557 / 1440 * y + 281 / 630 * b - 1983433 / 1935360 * S,
1054
- 61 / 240 * m - 103 / 140 * y + 15061 / 26880 * b + 167603 / 181440 * S,
1055
- 49561 / 161280 * y - 179 / 168 * b + 6601661 / 7257600 * S,
1056
- 34729 / 80640 * b - 3418889 / 1995840 * S,
1057
- 212378941 / 319334400 * S
1052
+ 1 / 2 * w - 2 / 3 * N + 5 / 16 * S + 41 / 180 * M - 127 / 288 * E + 7891 / 37800 * $,
1053
+ 13 / 48 * N - 3 / 5 * S + 557 / 1440 * M + 281 / 630 * E - 1983433 / 1935360 * $,
1054
+ 61 / 240 * S - 103 / 140 * M + 15061 / 26880 * E + 167603 / 181440 * $,
1055
+ 49561 / 161280 * M - 179 / 168 * E + 6601661 / 7257600 * $,
1056
+ 34729 / 80640 * E - 3418889 / 1995840 * $,
1057
+ 212378941 / 319334400 * $
1058
1058
  ];
1059
1059
  let O = W;
1060
- for (let l = 1; l <= 6; l++) O += U[l] * Math.sin(2 * l * W) * Math.cosh(2 * l * E);
1061
- let C = E;
1062
- for (let l = 1; l <= 6; l++) C += U[l] * Math.cos(2 * l * W) * Math.sinh(2 * l * E);
1063
- let z = N * q * C, k = N * q * O, j = 1;
1064
- for (let l = 1; l <= 6; l++) j += 2 * l * U[l] * Math.cos(2 * l * W) * Math.cosh(2 * l * E);
1060
+ for (let o = 1; o <= 6; o++) O += U[o] * Math.sin(2 * o * W) * Math.cosh(2 * o * y);
1061
+ let C = y;
1062
+ for (let o = 1; o <= 6; o++) C += U[o] * Math.cos(2 * o * W) * Math.sinh(2 * o * y);
1063
+ let z = f * q * C, k = f * q * O, j = 1;
1064
+ for (let o = 1; o <= 6; o++) j += 2 * o * U[o] * Math.cos(2 * o * W) * Math.cosh(2 * o * y);
1065
1065
  let A = 0;
1066
- for (let l = 1; l <= 6; l++) A += 2 * l * U[l] * Math.sin(2 * l * W) * Math.sinh(2 * l * E);
1067
- const X = Math.atan(T / Math.sqrt(1 + T * T) * G), H = Math.atan2(A, j), Y = X + H, J = Math.sin(o), Z = Math.sqrt(1 - g * g * J * J) * Math.sqrt(1 + v * v) / Math.sqrt(T * T + L * L), V = q / d * Math.sqrt(j * j + A * A), tt = N * Z * V;
1066
+ for (let o = 1; o <= 6; o++) A += 2 * o * U[o] * Math.sin(2 * o * W) * Math.sinh(2 * o * y);
1067
+ const X = Math.atan(T / Math.sqrt(1 + T * T) * G), H = Math.atan2(A, j), Y = X + H, J = Math.sin(l), Z = Math.sqrt(1 - u * u * J * J) * Math.sqrt(1 + v * v) / Math.sqrt(T * T + L * L), V = q / d * Math.sqrt(j * j + A * A), tt = f * Z * V;
1068
1068
  z = z + n, k < 0 && (k = k + s), z = Number(z.toFixed(9)), k = Number(k.toFixed(9));
1069
1069
  const nt = Number(Y.toDegrees().toFixed(9)), et = Number(tt.toFixed(12)), I = this.lat >= 0 ? "N" : "S";
1070
1070
  return new pt(e, I, z, k, this.datum, nt, et, !!t);
1071
1071
  }
1072
1072
  }
1073
- const rt = "CDEFGHJKLMNPQRSTUVWXX", ot = ["ABCDEFGH", "JKLMNPQR", "STUVWXYZ"], at = ["ABCDEFGHJKLMNPQRSTUV", "FGHJKLMNPQRSTUVABCDE"];
1073
+ const it = "CDEFGHJKLMNPQRSTUVWXX", rt = ["ABCDEFGH", "JKLMNPQR", "STUVWXYZ"], ot = ["ABCDEFGHJKLMNPQRSTUV", "FGHJKLMNPQRSTUVABCDE"];
1074
1074
  class _ {
1075
1075
  /**
1076
1076
  * Creates an Mgrs grid reference object.
@@ -1091,8 +1091,8 @@ class _ {
1091
1091
  constructor(t, n, s, e, i, r, a = K.datums.WGS84) {
1092
1092
  if (!(1 <= t && t <= 60)) throw new RangeError(`invalid MGRS zone ‘${t}’`);
1093
1093
  if (t != parseInt(t)) throw new RangeError(`invalid MGRS zone ‘${t}’`);
1094
- const o = [];
1095
- if ((n.length != 1 || rt.indexOf(n) == -1) && o.push(`invalid MGRS band ‘${n}’`), (s.length != 1 || ot[(t - 1) % 3].indexOf(s) == -1) && o.push(`invalid MGRS 100km grid square column ‘${s}’ for zone ${t}`), (e.length != 1 || at[0].indexOf(e) == -1) && o.push(`invalid MGRS 100km grid square row ‘${e}’`), isNaN(Number(i)) && o.push(`invalid MGRS easting ‘${i}’`), isNaN(Number(r)) && o.push(`invalid MGRS northing ‘${r}’`), (!a || a.ellipsoid == null) && o.push(`unrecognised datum ‘${a}’`), o.length > 0) throw new RangeError(o.join(", "));
1094
+ const l = [];
1095
+ if ((n.length != 1 || it.indexOf(n) == -1) && l.push(`invalid MGRS band ‘${n}’`), (s.length != 1 || rt[(t - 1) % 3].indexOf(s) == -1) && l.push(`invalid MGRS 100km grid square column ‘${s}’ for zone ${t}`), (e.length != 1 || ot[0].indexOf(e) == -1) && l.push(`invalid MGRS 100km grid square row ‘${e}’`), isNaN(Number(i)) && l.push(`invalid MGRS easting ‘${i}’`), isNaN(Number(r)) && l.push(`invalid MGRS northing ‘${r}’`), (!a || a.ellipsoid == null) && l.push(`unrecognised datum ‘${a}’`), l.length > 0) throw new RangeError(l.join(", "));
1096
1096
  this.zone = Number(t), this.band = n, this.e100k = s, this.n100k = e, this.easting = Number(i), this.northing = Number(r), this.datum = a;
1097
1097
  }
1098
1098
  /**
@@ -1109,10 +1109,10 @@ class _ {
1109
1109
  * const utmCoord = mgrsRef.toUtm(); // 31 N 448251 5411932
1110
1110
  */
1111
1111
  toUtm() {
1112
- const t = this.band >= "N" ? "N" : "S", s = (ot[(this.zone - 1) % 3].indexOf(this.e100k) + 1) * 1e5, i = at[(this.zone - 1) % 2].indexOf(this.n100k) * 1e5, r = (rt.indexOf(this.band) - 10) * 8, a = Math.floor(new K(r, 3).toUtm().northing / 1e5) * 1e5;
1113
- let o = 0;
1114
- for (; o + i + this.northing < a; ) o += 2e6;
1115
- return new ht(this.zone, t, s + this.easting, o + i + this.northing, this.datum);
1112
+ const t = this.band >= "N" ? "N" : "S", s = (rt[(this.zone - 1) % 3].indexOf(this.e100k) + 1) * 1e5, i = ot[(this.zone - 1) % 2].indexOf(this.n100k) * 1e5, r = (it.indexOf(this.band) - 10) * 8, a = Math.floor(new K(r, 3).toUtm().northing / 1e5) * 1e5;
1113
+ let l = 0;
1114
+ for (; l + i + this.northing < a; ) l += 2e6;
1115
+ return new lt(this.zone, t, s + this.easting, l + i + this.northing, this.datum);
1116
1116
  }
1117
1117
  /**
1118
1118
  * Parses string representation of MGRS grid reference.
@@ -1141,9 +1141,9 @@ class _ {
1141
1141
  }
1142
1142
  const n = t.match(/\S+/g);
1143
1143
  if (n == null || n.length != 4) throw new Error(`invalid MGRS grid reference ‘${t}’`);
1144
- const s = n[0], e = s.slice(0, 2), i = s.slice(2, 3), r = n[1], a = r.slice(0, 1), o = r.slice(1, 2);
1145
- let p = n[2], u = n[3];
1146
- return p = p.length >= 5 ? p : (p + "00000").slice(0, 5), u = u.length >= 5 ? u : (u + "00000").slice(0, 5), new _(e, i, a, o, p, u);
1144
+ const s = n[0], e = s.slice(0, 2), i = s.slice(2, 3), r = n[1], a = r.slice(0, 1), l = r.slice(1, 2);
1145
+ let p = n[2], c = n[3];
1146
+ return p = p.length >= 5 ? p : (p + "00000").slice(0, 5), c = c.length >= 5 ? c : (c + "00000").slice(0, 5), new _(e, i, a, l, p, c);
1147
1147
  }
1148
1148
  /**
1149
1149
  * Returns a string representation of an MGRS grid reference.
@@ -1169,11 +1169,11 @@ class _ {
1169
1169
  */
1170
1170
  toString(t = 10) {
1171
1171
  if (![2, 4, 6, 8, 10].includes(Number(t))) throw new RangeError(`invalid precision ‘${t}’`);
1172
- const { zone: n, band: s, e100k: e, n100k: i, easting: r, northing: a } = this, o = Math.floor(r / Math.pow(10, 5 - t / 2)), p = Math.floor(a / Math.pow(10, 5 - t / 2)), u = n.toString().padStart(2, "0"), d = o.toString().padStart(t / 2, "0"), w = p.toString().padStart(t / 2, "0");
1173
- return `${u}${s} ${e}${i} ${d} ${w}`;
1172
+ const { zone: n, band: s, e100k: e, n100k: i, easting: r, northing: a } = this, l = Math.floor(r / Math.pow(10, 5 - t / 2)), p = Math.floor(a / Math.pow(10, 5 - t / 2)), c = n.toString().padStart(2, "0"), d = l.toString().padStart(t / 2, "0"), m = p.toString().padStart(t / 2, "0");
1173
+ return `${c}${s} ${e}${i} ${d} ${m}`;
1174
1174
  }
1175
1175
  }
1176
- class ht extends pt {
1176
+ class lt extends pt {
1177
1177
  /**
1178
1178
  * Converts UTM coordinate to MGRS reference.
1179
1179
  *
@@ -1185,9 +1185,9 @@ class ht extends pt {
1185
1185
  * const mgrsRef = utmCoord.toMgrs(); // 31U DQ 48251 11932
1186
1186
  */
1187
1187
  toMgrs() {
1188
- const t = this.zone, n = this.toLatLon(), s = rt.charAt(Math.floor(n.lat / 8 + 10)), e = Math.floor(this.easting / 1e5), i = ot[(t - 1) % 3].charAt(e - 1), r = Math.floor(this.northing / 1e5) % 20, a = at[(t - 1) % 2].charAt(r);
1189
- let o = this.easting % 1e5, p = this.northing % 1e5;
1190
- return o = Number(o.toFixed(6)), p = Number(p.toFixed(6)), new _(t, s, i, a, o, p);
1188
+ const t = this.zone, n = this.toLatLon(), s = it.charAt(Math.floor(n.lat / 8 + 10)), e = Math.floor(this.easting / 1e5), i = rt[(t - 1) % 3].charAt(e - 1), r = Math.floor(this.northing / 1e5) % 20, a = ot[(t - 1) % 2].charAt(r);
1189
+ let l = this.easting % 1e5, p = this.northing % 1e5;
1190
+ return l = Number(l.toFixed(6)), p = Number(p.toFixed(6)), new _(t, s, i, a, l, p);
1191
1191
  }
1192
1192
  }
1193
1193
  class wt extends K {
@@ -1209,96 +1209,83 @@ class wt extends K {
1209
1209
  */
1210
1210
  toUtm(t = void 0) {
1211
1211
  const n = super.toUtm(t);
1212
- return new ht(n.zone, n.hemisphere, n.easting, n.northing, n.datum, n.convergence, n.scale);
1212
+ return new lt(n.zone, n.hemisphere, n.easting, n.northing, n.datum, n.convergence, n.scale);
1213
1213
  }
1214
1214
  }
1215
1215
  function Nt({
1216
- coordinate: M,
1216
+ coordinate: g,
1217
1217
  onChange: t
1218
1218
  }) {
1219
- const [n, s] = it("LATLON"), [e, i] = it({
1219
+ const [n, s] = ht("LATLON"), [e, i] = ht({
1220
1220
  latLon: {
1221
- latitude: M[1],
1222
- longitude: M[0]
1221
+ latitude: g[1],
1222
+ longitude: g[0]
1223
1223
  },
1224
1224
  utm: "",
1225
1225
  mgrs: "",
1226
1226
  dms: ""
1227
- }), [r, a] = it({
1228
- latitude: String(M[1]),
1229
- longitude: String(M[0])
1230
1227
  });
1231
- ct(() => (o(M[1], M[0]), () => {
1232
- }), [M]), ct(() => {
1233
- const { latitude: f, longitude: c } = e.latLon;
1234
- return t && (f !== M[1] || c !== M[0]) && t({
1228
+ ct(() => (r(g[1], g[0]), () => {
1229
+ }), [g]), ct(() => {
1230
+ const { latitude: f, longitude: u } = e.latLon;
1231
+ return t && (f !== g[1] || u !== g[0]) && t({
1235
1232
  latitude: f,
1236
- longitude: c
1233
+ longitude: u
1237
1234
  }), () => {
1238
1235
  };
1239
1236
  }, [e]);
1240
- const o = (f, c) => {
1237
+ const r = (f, u) => {
1241
1238
  try {
1242
- const m = new wt(f, c), y = m.toUtm(), b = y.toMgrs(), S = m.toString("dms");
1239
+ const w = new wt(f, u), N = w.toUtm(), S = N.toMgrs(), M = w.toString("dms");
1243
1240
  i({
1244
1241
  latLon: {
1245
- latitude: m.latitude,
1246
- longitude: m.longitude
1242
+ latitude: w.latitude,
1243
+ longitude: w.longitude
1247
1244
  },
1248
- utm: y.toString(),
1249
- mgrs: b.toString(),
1250
- dms: S
1245
+ utm: N.toString(),
1246
+ mgrs: S.toString(),
1247
+ dms: M
1251
1248
  });
1252
- } catch (m) {
1253
- console.log("error", m);
1249
+ } catch {
1250
+ console.log("conv err");
1254
1251
  }
1255
1252
  };
1256
1253
  return {
1257
1254
  state: {
1258
1255
  format: n,
1259
- data: e,
1260
- latLonStr: r
1256
+ data: e
1261
1257
  },
1262
1258
  action: {
1263
1259
  onChangeFormat: (f) => {
1264
1260
  s(f.target.value);
1265
1261
  },
1266
1262
  onChangeLat: (f) => {
1267
- let c = f.target.value;
1268
- c = c.replace(",", "."), a({
1269
- latitude: c,
1270
- longitude: r.longitude
1271
- }), o(Number(c), e.latLon.longitude);
1263
+ let u = f.target.value;
1264
+ u = u.replace(",", "."), r(Number(u), e.latLon.longitude);
1272
1265
  },
1273
1266
  onChangeLon: (f) => {
1274
- let c = f.target.value;
1275
- c = c.replace(",", "."), a({
1276
- latitude: r.latitude,
1277
- longitude: c
1278
- }), o(e.latLon.latitude, Number(c));
1267
+ let u = f.target.value;
1268
+ u = u.replace(",", "."), r(e.latLon.latitude, Number(u));
1279
1269
  },
1280
1270
  onChangeDms: (f) => {
1281
1271
  try {
1282
- const c = f.target.value.split(","), m = c[0].trim(), y = c[1].trim(), b = h.parse(m), S = h.parse(y);
1283
- o(b, S);
1284
- } catch (c) {
1285
- console.log("error", c);
1272
+ const u = f.target.value.split(","), w = u[0].trim(), N = u[1].trim(), S = h.parse(w), M = h.parse(N);
1273
+ r(S, M);
1274
+ } catch {
1286
1275
  }
1287
1276
  },
1288
1277
  onChangeMgrs: (f) => {
1289
1278
  try {
1290
- const m = _.parse(f.target.value).toUtm().toLatLon();
1291
- o(m.latitude, m.longitude);
1292
- } catch (c) {
1293
- console.log("error", c);
1279
+ const w = _.parse(f.target.value).toUtm().toLatLon();
1280
+ r(w.latitude, w.longitude);
1281
+ } catch {
1294
1282
  }
1295
1283
  },
1296
1284
  onChangeUtm: (f) => {
1297
1285
  try {
1298
- const m = ht.parse(f.target.value).toLatLon();
1299
- o(m.latitude, m.longitude);
1300
- } catch (c) {
1301
- console.log("error", c);
1286
+ const w = lt.parse(f.target.value).toLatLon();
1287
+ r(w.latitude, w.longitude);
1288
+ } catch {
1302
1289
  }
1303
1290
  }
1304
1291
  }
@@ -1,5 +1,5 @@
1
1
  import n from "mapbox-gl";
2
- import { L as b, b as y, S as u } from "../../../Source-CnCcu5UP.js";
2
+ import { L as b, a as y, S as u } from "../../../Source-BESIjd9X.js";
3
3
  const v = ({
4
4
  id: r = "map",
5
5
  center: s,
@@ -1,13 +1,13 @@
1
1
  import "lodash";
2
- import "../../../Source-CnCcu5UP.js";
3
- import { y as K, c as n, E as T, H as i, b as p, a as u, A as M, z as L, d as l, x as k, D as W, g as f, e as g, B as x, J as C } from "../../../ol-9hySGI6D.js";
2
+ import "../../../Source-BESIjd9X.js";
3
+ import { E as F, c as n, O as T, Q as i, a as p, A as u, J as M, H as L, b as l, D as k, N as W, g as f, d as g, K as C, S as x } from "../../../ol-lGwSyEIV.js";
4
4
  import "ol";
5
5
  import "./kml.js";
6
6
  import "../styled.js";
7
7
  import "./wkt.js";
8
- import "../../../Text-BT5kPHOo.js";
8
+ import "../../../Text-Cl1H4b0h.js";
9
9
  export {
10
- K as convertFeaturesToKML,
10
+ F as convertFeaturesToKML,
11
11
  n as convertFeaturesToWKT,
12
12
  T as createClusterFromKMLMarkers,
13
13
  i as createClusterFromWKTMarkers,
@@ -20,6 +20,6 @@ export {
20
20
  W as findCenterOfKMLPolygon,
21
21
  f as getWKTCenterOfExtent,
22
22
  g as getWKTExtent,
23
- x as kmlToIconFeatures,
24
- C as wktToIconFeatures
23
+ C as kmlToIconFeatures,
24
+ x as wktToIconFeatures
25
25
  };
@@ -1,6 +1,6 @@
1
1
  import a from "react";
2
- import { d as R } from "../../ol-9hySGI6D.js";
3
- import { a as _ } from "../../Source-CnCcu5UP.js";
2
+ import { b as R } from "../../ol-lGwSyEIV.js";
3
+ import { t as b } from "../../Source-BESIjd9X.js";
4
4
  function U({
5
5
  id: l = "map",
6
6
  layers: c = [],
@@ -56,7 +56,7 @@ function U({
56
56
  t.current.on(e, r);
57
57
  }, A = () => t.current.getView(), T = (e) => t.current.getEventPixel(e), Z = (e) => t.current.getEventCoordinate(e), h = () => {
58
58
  let e = t.current.getView().calculateExtent();
59
- return e = _(e, "EPSG:3857", "EPSG:4326"), {
59
+ return e = b(e, "EPSG:3857", "EPSG:4326"), {
60
60
  bottomLeft: {
61
61
  latitude: e[1],
62
62
  longitude: e[0]