@idm-plugin/geo 1.7.9 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +107 -94
- package/dist/index.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -24,18 +24,18 @@ var j = { exports: {} };
|
|
|
24
24
|
return c > 96 ? c - 87 : c > 64 ? c - 29 : c - 48;
|
|
25
25
|
}
|
|
26
26
|
function T(c) {
|
|
27
|
-
var a = 0, n = c.split("."), R = n[0], i = n[1] || "",
|
|
27
|
+
var a = 0, n = c.split("."), R = n[0], i = n[1] || "", r = 1, V, U = 0, t = 1;
|
|
28
28
|
for (c.charCodeAt(0) === 45 && (a = 1, t = -1), a; a < R.length; a++)
|
|
29
|
-
V = L(R.charCodeAt(a)),
|
|
29
|
+
V = L(R.charCodeAt(a)), U = 60 * U + V;
|
|
30
30
|
for (a = 0; a < i.length; a++)
|
|
31
|
-
|
|
32
|
-
return
|
|
31
|
+
r = r / 60, V = L(i.charCodeAt(a)), U += V * r;
|
|
32
|
+
return U * t;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function f(c) {
|
|
35
35
|
for (var a = 0; a < c.length; a++)
|
|
36
36
|
c[a] = T(c[a]);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function S(c, a) {
|
|
39
39
|
for (var n = 0; n < a; n++)
|
|
40
40
|
c[n] = Math.round((c[n - 1] || 0) + c[n] * 6e4);
|
|
41
41
|
c[a - 1] = 1 / 0;
|
|
@@ -48,7 +48,7 @@ var j = { exports: {} };
|
|
|
48
48
|
}
|
|
49
49
|
function P(c) {
|
|
50
50
|
var a = c.split("|"), n = a[2].split(" "), R = a[3].split(""), i = a[4].split(" ");
|
|
51
|
-
return
|
|
51
|
+
return f(n), f(R), f(i), S(i, R.length), {
|
|
52
52
|
name: a[0],
|
|
53
53
|
abbrs: s(a[1].split(" "), R),
|
|
54
54
|
offsets: s(n, R),
|
|
@@ -67,9 +67,9 @@ var j = { exports: {} };
|
|
|
67
67
|
return n - 1;
|
|
68
68
|
if (c >= a[n - 1])
|
|
69
69
|
return -1;
|
|
70
|
-
for (var R, i = 0,
|
|
71
|
-
R = Math.floor((i +
|
|
72
|
-
return
|
|
70
|
+
for (var R, i = 0, r = n - 1; r - i > 1; )
|
|
71
|
+
R = Math.floor((i + r) / 2), a[R] <= c ? i = R : r = R;
|
|
72
|
+
return r;
|
|
73
73
|
}
|
|
74
74
|
I.prototype = {
|
|
75
75
|
_set: function(c) {
|
|
@@ -87,9 +87,9 @@ var j = { exports: {} };
|
|
|
87
87
|
});
|
|
88
88
|
},
|
|
89
89
|
parse: function(c) {
|
|
90
|
-
var a = +c, n = this.offsets, R = this.untils, i = R.length - 1,
|
|
90
|
+
var a = +c, n = this.offsets, R = this.untils, i = R.length - 1, r, V, U, t;
|
|
91
91
|
for (t = 0; t < i; t++)
|
|
92
|
-
if (
|
|
92
|
+
if (r = n[t], V = n[t + 1], U = n[t && t - 1], r < V && u.moveAmbiguousForward ? r = V : r > U && u.moveInvalidForward && (r = U), a < R[t] - r * 6e4)
|
|
93
93
|
return n[t];
|
|
94
94
|
return n[i];
|
|
95
95
|
},
|
|
@@ -103,7 +103,7 @@ var j = { exports: {} };
|
|
|
103
103
|
return this.offsets[this._index(c)];
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
|
-
function
|
|
106
|
+
function B(c, a) {
|
|
107
107
|
this.name = c, this.zones = a;
|
|
108
108
|
}
|
|
109
109
|
function G(c) {
|
|
@@ -122,11 +122,11 @@ var j = { exports: {} };
|
|
|
122
122
|
return c;
|
|
123
123
|
}
|
|
124
124
|
function F() {
|
|
125
|
-
var c = (/* @__PURE__ */ new Date()).getFullYear() - 2, a = new G(new Date(c, 0, 1)), n = a.offset, R = [a], i,
|
|
126
|
-
for (
|
|
127
|
-
V = new Date(c,
|
|
128
|
-
for (
|
|
129
|
-
R.push(new G(new Date(c +
|
|
125
|
+
var c = (/* @__PURE__ */ new Date()).getFullYear() - 2, a = new G(new Date(c, 0, 1)), n = a.offset, R = [a], i, r, V, U;
|
|
126
|
+
for (U = 1; U < 48; U++)
|
|
127
|
+
V = new Date(c, U, 1).getTimezoneOffset(), V !== n && (r = new G(new Date(c, U, 1)), i = Q(a, r), R.push(i), R.push(new G(new Date(i.at + 6e4))), a = r, n = V);
|
|
128
|
+
for (U = 0; U < 4; U++)
|
|
129
|
+
R.push(new G(new Date(c + U, 0, 1))), R.push(new G(new Date(c + U, 6, 1)));
|
|
130
130
|
return R;
|
|
131
131
|
}
|
|
132
132
|
function M0(c, a) {
|
|
@@ -134,20 +134,20 @@ var j = { exports: {} };
|
|
|
134
134
|
}
|
|
135
135
|
function z0(c, a) {
|
|
136
136
|
var n, R;
|
|
137
|
-
for (
|
|
137
|
+
for (f(a), n = 0; n < a.length; n++)
|
|
138
138
|
R = a[n], W[R] = W[R] || {}, W[R][c] = !0;
|
|
139
139
|
}
|
|
140
140
|
function b0(c) {
|
|
141
|
-
var a = c.length, n = {}, R = [], i = {},
|
|
142
|
-
for (
|
|
143
|
-
if (
|
|
144
|
-
t = W[
|
|
141
|
+
var a = c.length, n = {}, R = [], i = {}, r, V, U, t;
|
|
142
|
+
for (r = 0; r < a; r++)
|
|
143
|
+
if (U = c[r].offset, !i.hasOwnProperty(U)) {
|
|
144
|
+
t = W[U] || {};
|
|
145
145
|
for (V in t)
|
|
146
146
|
t.hasOwnProperty(V) && (n[V] = !0);
|
|
147
|
-
i[
|
|
147
|
+
i[U] = !0;
|
|
148
148
|
}
|
|
149
|
-
for (
|
|
150
|
-
n.hasOwnProperty(
|
|
149
|
+
for (r in n)
|
|
150
|
+
n.hasOwnProperty(r) && R.push(b[r]);
|
|
151
151
|
return R;
|
|
152
152
|
}
|
|
153
153
|
function p0() {
|
|
@@ -161,13 +161,13 @@ var j = { exports: {} };
|
|
|
161
161
|
}
|
|
162
162
|
} catch {
|
|
163
163
|
}
|
|
164
|
-
var n = F(), R = n.length, i = b0(n),
|
|
165
|
-
for (
|
|
166
|
-
for (V = new H(g(i[
|
|
164
|
+
var n = F(), R = n.length, i = b0(n), r = [], V, U, t;
|
|
165
|
+
for (U = 0; U < i.length; U++) {
|
|
166
|
+
for (V = new H(g(i[U])), t = 0; t < R; t++)
|
|
167
167
|
V.scoreOffsetAt(n[t]);
|
|
168
|
-
|
|
168
|
+
r.push(V);
|
|
169
169
|
}
|
|
170
|
-
return
|
|
170
|
+
return r.sort(M0), r.length > 0 ? r[0].zone.name : void 0;
|
|
171
171
|
}
|
|
172
172
|
function O0(c) {
|
|
173
173
|
return (!o || c) && (o = p0()), o;
|
|
@@ -203,7 +203,7 @@ var j = { exports: {} };
|
|
|
203
203
|
var a, n, R, i;
|
|
204
204
|
if (!(!c || !c.length))
|
|
205
205
|
for (a = 0; a < c.length; a++)
|
|
206
|
-
i = c[a].split("|"), n = i[0].toUpperCase(), R = i[1].split(" "), A[n] = new
|
|
206
|
+
i = c[a].split("|"), n = i[0].toUpperCase(), R = i[1].split(" "), A[n] = new B(
|
|
207
207
|
n,
|
|
208
208
|
R
|
|
209
209
|
);
|
|
@@ -1429,8 +1429,8 @@ class N {
|
|
|
1429
1429
|
const L = e.lineIntersect(Y, d);
|
|
1430
1430
|
let T;
|
|
1431
1431
|
if (L.features.length) {
|
|
1432
|
-
const
|
|
1433
|
-
T = X.roundPrecision(
|
|
1432
|
+
const f = e.getCoord(L.features[0]);
|
|
1433
|
+
T = X.roundPrecision(f[1], 8);
|
|
1434
1434
|
} else
|
|
1435
1435
|
T = M[W].lat;
|
|
1436
1436
|
o > 0 ? (p.push([180 - 1e-6, T]), O.push([...p]), p = [], p.push([-(180 - 1e-6), T])) : (p.push([-(180 - 1e-6), T]), O.push([...p]), p = [], p.push([180 - 1e-6, T]));
|
|
@@ -1766,15 +1766,15 @@ class N {
|
|
|
1766
1766
|
var L;
|
|
1767
1767
|
const A = M.speed || 12, b = [];
|
|
1768
1768
|
let W = [], o = !1, q = 0, Y = 0, d;
|
|
1769
|
-
if (z && p.length ? (b.push(M), p.forEach((T,
|
|
1769
|
+
if (z && p.length ? (b.push(M), p.forEach((T, f) => {
|
|
1770
1770
|
if (o)
|
|
1771
1771
|
W.push(T);
|
|
1772
1772
|
else {
|
|
1773
|
-
const
|
|
1773
|
+
const S = [];
|
|
1774
1774
|
let s;
|
|
1775
1775
|
for (let P = 0; P < T.length; P++)
|
|
1776
1776
|
if (d)
|
|
1777
|
-
|
|
1777
|
+
S.push(T[P]);
|
|
1778
1778
|
else {
|
|
1779
1779
|
s = { lng: T[P][0], lat: T[P][1] };
|
|
1780
1780
|
const I = this.calculateDistance(M, s, !0, 8, O);
|
|
@@ -1782,15 +1782,15 @@ class N {
|
|
|
1782
1782
|
Y += I, I && b.push(s), M = s;
|
|
1783
1783
|
else {
|
|
1784
1784
|
if (Y = z, q === z)
|
|
1785
|
-
d = s,
|
|
1785
|
+
d = s, S.push([d.lng, d.lat]);
|
|
1786
1786
|
else {
|
|
1787
|
-
const l = q - z,
|
|
1788
|
-
d = this.calculateCoordinate(s,
|
|
1787
|
+
const l = q - z, B = this.calculateBearing(s, M);
|
|
1788
|
+
d = this.calculateCoordinate(s, B, l, O), S.push([d.lng, d.lat]), S.push([s.lng, s.lat]);
|
|
1789
1789
|
}
|
|
1790
1790
|
o = !0;
|
|
1791
1791
|
}
|
|
1792
1792
|
}
|
|
1793
|
-
|
|
1793
|
+
S.length && W.push(S), f === p.length - 1 && !d && (d = s);
|
|
1794
1794
|
}
|
|
1795
1795
|
})) : (W = p, d = { ...M }), d)
|
|
1796
1796
|
if (b.push(d), d.distanceFromPrevious = Y, d.hourFromPrevious = Math.round(Y / A * 1e4) / 1e4, ((L = W[0]) == null ? void 0 : L.length) > 1) {
|
|
@@ -1925,8 +1925,8 @@ class N {
|
|
|
1925
1925
|
const b = M[A - 1], W = M[A], o = M[A + 1];
|
|
1926
1926
|
let q = !1, Y = !1;
|
|
1927
1927
|
if ((b.velocity || b.suspend || b.important || b.pilot || A === 1) && (q = !0, O.push(b)), W.gcToPrevious && (q || (q = !0, O.push(b)), Y = !0, O.push(W), A++), o) {
|
|
1928
|
-
const d = N.calculateDistance(b, W, !0), L = N.calculateDistance(W, o, !0), T = N.calculateDistance(b, o, !0),
|
|
1929
|
-
Math.round(Math.acos(
|
|
1928
|
+
const d = N.calculateDistance(b, W, !0), L = N.calculateDistance(W, o, !0), T = N.calculateDistance(b, o, !0), f = (Math.pow(d, 2) + Math.pow(L, 2) - Math.pow(T, 2)) / (2 * d * L);
|
|
1929
|
+
Math.round(Math.acos(f) * 180 / Math.PI) < p && T > z && !Y && (O.push(W), A++);
|
|
1930
1930
|
}
|
|
1931
1931
|
if (A >= M.length - 1) {
|
|
1932
1932
|
const d = M.at(-1);
|
|
@@ -1985,8 +1985,8 @@ class N {
|
|
|
1985
1985
|
else if (o === 0)
|
|
1986
1986
|
M = b;
|
|
1987
1987
|
else {
|
|
1988
|
-
const q = N.nearestCoordinateInLine(M, A, b), Y = A.positionTime, d = b.positionTime, L = N.calculateDistance(A, q), T = N.calculateDistance(A, b),
|
|
1989
|
-
M.positionTime =
|
|
1988
|
+
const q = N.nearestCoordinateInLine(M, A, b), Y = A.positionTime, d = b.positionTime, L = N.calculateDistance(A, q), T = N.calculateDistance(A, b), f = Math.round(Y + (d - Y) * (L / T));
|
|
1989
|
+
M.positionTime = f;
|
|
1990
1990
|
}
|
|
1991
1991
|
return M.utc = M.positionTime ? m.unix(M.positionTime).utc().format() : void 0, M.positionTime ? M : void 0;
|
|
1992
1992
|
}
|
|
@@ -2023,48 +2023,61 @@ class t0 {
|
|
|
2023
2023
|
const A = (p = O.history) == null ? void 0 : p[0];
|
|
2024
2024
|
A && A.wind && (A.wind.kts = A.kts);
|
|
2025
2025
|
for (const b of O.forecasts) {
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2026
|
+
let W;
|
|
2027
|
+
const o = [], q = m(b.date).utc(), Y = `${O.name}-${b.model}`;
|
|
2028
|
+
for (const L in b == null ? void 0 : b.hours) {
|
|
2029
|
+
const T = b.hours[L];
|
|
2030
|
+
W = W || T;
|
|
2031
|
+
const f = q.clone().add(Number(L), "hour"), S = e.point([T.lng, T.lat], {
|
|
2029
2032
|
model: b.model,
|
|
2030
2033
|
name: O.name,
|
|
2031
|
-
date:
|
|
2032
|
-
hour:
|
|
2033
|
-
format:
|
|
2034
|
-
pressure:
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2034
|
+
date: f.format(),
|
|
2035
|
+
hour: Number(L),
|
|
2036
|
+
format: f.format("MMM-DD/HHmm[Z]"),
|
|
2037
|
+
pressure: T.pressure > 1e4 ? X.roundPrecision(T.pressure / 100, 0) : X.roundPrecision(T.pressure, 0),
|
|
2038
|
+
gusts: T.gusts,
|
|
2039
|
+
wind: T.wind || {},
|
|
2040
|
+
movement: T.movement,
|
|
2041
|
+
category: Y,
|
|
2038
2042
|
type: "forecast"
|
|
2039
2043
|
});
|
|
2040
|
-
z.features.push(
|
|
2044
|
+
z.features.push(S), o.push(S.geometry.coordinates);
|
|
2041
2045
|
}
|
|
2042
|
-
|
|
2043
|
-
|
|
2046
|
+
const d = {
|
|
2047
|
+
kts: void 0,
|
|
2048
|
+
deg: void 0
|
|
2049
|
+
};
|
|
2050
|
+
if (A) {
|
|
2051
|
+
const L = m(A.updated).utc();
|
|
2052
|
+
if (W) {
|
|
2053
|
+
const f = N.calculateDistance(A, W), S = m(W.utc || W.updated).diff(L, "h", !0);
|
|
2054
|
+
d.kts = Math.round(f / S * 100) / 100, d.deg = N.calculateBearing(A, W, !0, 0);
|
|
2055
|
+
}
|
|
2056
|
+
const T = e.point([A.lng, A.lat], {
|
|
2044
2057
|
model: b.model,
|
|
2045
2058
|
name: O.name,
|
|
2046
2059
|
date: L.format(),
|
|
2047
|
-
hour:
|
|
2060
|
+
hour: 0,
|
|
2048
2061
|
format: L.format("MMM-DD/HHmm[Z]"),
|
|
2049
|
-
pressure:
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
category: q,
|
|
2062
|
+
pressure: A.pressure > 1e4 ? X.roundPrecision((A == null ? void 0 : A.pressure) / 100, 0) : X.roundPrecision(A.pressure, 0),
|
|
2063
|
+
wind: A.wind,
|
|
2064
|
+
movement: d,
|
|
2065
|
+
category: Y,
|
|
2054
2066
|
type: "forecast"
|
|
2055
2067
|
});
|
|
2056
|
-
z.features.push(T),
|
|
2068
|
+
z.features.push(T), o.push(T.geometry.coordinates);
|
|
2057
2069
|
}
|
|
2058
|
-
if ((
|
|
2059
|
-
const
|
|
2070
|
+
if ((o == null ? void 0 : o.length) > 1) {
|
|
2071
|
+
const L = e.lineString(X.convertToMonotonicLng2(o), {
|
|
2060
2072
|
date: b.date,
|
|
2061
2073
|
id: O.id || O.name,
|
|
2062
2074
|
model: b.model,
|
|
2063
2075
|
name: O.name,
|
|
2064
|
-
category:
|
|
2065
|
-
type: "forecast"
|
|
2076
|
+
category: Y,
|
|
2077
|
+
type: "forecast",
|
|
2078
|
+
movement: d
|
|
2066
2079
|
});
|
|
2067
|
-
z.features.push(
|
|
2080
|
+
z.features.push(L);
|
|
2068
2081
|
}
|
|
2069
2082
|
}
|
|
2070
2083
|
}
|
|
@@ -2110,32 +2123,32 @@ class t0 {
|
|
|
2110
2123
|
var A, b, W, o;
|
|
2111
2124
|
const p = (A = M == null ? void 0 : M.data) == null ? void 0 : A.features.filter((q) => q.geometry.type === "LineString" && q.properties.type === "forecast"), O = [];
|
|
2112
2125
|
for (const q of p) {
|
|
2113
|
-
const Y = q.properties.name, d = q.properties.model, L = q.properties.showCircle, T = q.properties.disabled,
|
|
2114
|
-
let
|
|
2126
|
+
const Y = q.properties.name, d = q.properties.model, L = q.properties.showCircle, T = q.properties.disabled, f = m(q.properties.date).utc();
|
|
2127
|
+
let S = z * 60 - (f.get("hour") * 60 + f.get("minute")) % (z * 60);
|
|
2115
2128
|
const s = (b = M == null ? void 0 : M.data) == null ? void 0 : b.features.filter(
|
|
2116
2129
|
(l) => l.geometry.type === "Point" && l.properties.type === "forecast" && l.properties.category === `${Y}-${d}`
|
|
2117
2130
|
);
|
|
2118
|
-
let P, I =
|
|
2131
|
+
let P, I = f.clone().add(S, "minute").set({ minute: 0, second: 0, millisecond: 0 });
|
|
2119
2132
|
for (; P = this.pickIndex(s, I), P <= s.length - 1; ) {
|
|
2120
2133
|
if (P > 0) {
|
|
2121
|
-
const l = s[P],
|
|
2134
|
+
const l = s[P], B = P === 0 ? void 0 : s[P - 1], G = (S / 60 - ((W = B == null ? void 0 : B.properties) == null ? void 0 : W.hour)) / (l.properties.hour - ((o = B == null ? void 0 : B.properties) == null ? void 0 : o.hour)), H = this.computeNumber(B == null ? void 0 : B.geometry.coordinates[0], l.geometry.coordinates[0], G), Q = this.computeNumber(B == null ? void 0 : B.geometry.coordinates[1], l.geometry.coordinates[1], G), F = e.point([H, Q], {
|
|
2122
2135
|
name: Y,
|
|
2123
2136
|
model: d,
|
|
2124
2137
|
category: l == null ? void 0 : l.properties.category,
|
|
2125
2138
|
date: I.format(),
|
|
2126
2139
|
format: I.format("MMM-DD/HHmm[Z]"),
|
|
2127
|
-
gusts: this.computeNumber(
|
|
2128
|
-
hour: this.computeNumber(
|
|
2129
|
-
movement: this.computeNumber(
|
|
2130
|
-
pressure: this.computeNumber(
|
|
2131
|
-
wind: this.computeNumber(
|
|
2140
|
+
gusts: this.computeNumber(B == null ? void 0 : B.properties.gusts, l.properties.gusts, G),
|
|
2141
|
+
hour: this.computeNumber(B == null ? void 0 : B.properties.hour, l.properties.hour, G),
|
|
2142
|
+
movement: this.computeNumber(B == null ? void 0 : B.properties.movement, l.properties.movement, G),
|
|
2143
|
+
pressure: this.computeNumber(B == null ? void 0 : B.properties.pressure, l.properties.pressure, G),
|
|
2144
|
+
wind: this.computeNumber(B == null ? void 0 : B.properties.wind, l.properties.wind, G),
|
|
2132
2145
|
type: "forecast",
|
|
2133
2146
|
disabled: T,
|
|
2134
2147
|
showCircle: L
|
|
2135
2148
|
});
|
|
2136
2149
|
O.push(F);
|
|
2137
2150
|
}
|
|
2138
|
-
|
|
2151
|
+
S += z * 60, I = f.clone().add(S, "minute").set({ minute: 0, second: 0, millisecond: 0 });
|
|
2139
2152
|
}
|
|
2140
2153
|
}
|
|
2141
2154
|
return O;
|
|
@@ -2165,9 +2178,9 @@ class t0 {
|
|
|
2165
2178
|
const { t1: A, t2: b, hr: W, hours: o } = this.tropicalCenterTwin(z, 24, O);
|
|
2166
2179
|
if (A && b) {
|
|
2167
2180
|
if (!O.debug) {
|
|
2168
|
-
const
|
|
2169
|
-
if (
|
|
2170
|
-
return Z == null || Z.info("[%s] the distance between from and t1(%d) and t2(%d) is enough, no need diversion: %j", O.requestId,
|
|
2181
|
+
const f = N.calculateDistance(M, A), S = N.calculateDistance(M, b);
|
|
2182
|
+
if (f > 2 * p && S > 2 * p)
|
|
2183
|
+
return Z == null || Z.info("[%s] the distance between from and t1(%d) and t2(%d) is enough, no need diversion: %j", O.requestId, f, S, {
|
|
2171
2184
|
from: M,
|
|
2172
2185
|
t1: A,
|
|
2173
2186
|
t2: b,
|
|
@@ -2204,9 +2217,9 @@ class t0 {
|
|
|
2204
2217
|
const { t1: A, t2: b, hr: W, hours: o } = this.tropicalCenterTwin(z, 24, O);
|
|
2205
2218
|
if (A && b) {
|
|
2206
2219
|
if (!O.debug) {
|
|
2207
|
-
const T = N.calculateDistance(M, A),
|
|
2208
|
-
if (T > 2 * p &&
|
|
2209
|
-
return Z == null || Z.info("[%s] the distance between from and t1(%d) and t2(%d) is enough, no need drifting: %j", O.requestId, T,
|
|
2220
|
+
const T = N.calculateDistance(M, A), f = N.calculateDistance(M, b);
|
|
2221
|
+
if (T > 2 * p && f > 2 * p)
|
|
2222
|
+
return Z == null || Z.info("[%s] the distance between from and t1(%d) and t2(%d) is enough, no need drifting: %j", O.requestId, T, f, {
|
|
2210
2223
|
from: M,
|
|
2211
2224
|
t1: A,
|
|
2212
2225
|
t2: b,
|
|
@@ -2227,20 +2240,20 @@ class t0 {
|
|
|
2227
2240
|
* @private
|
|
2228
2241
|
*/
|
|
2229
2242
|
static tropicalCenterTwin(M, z = 24, p = {}) {
|
|
2230
|
-
var Y, d, L, T,
|
|
2243
|
+
var Y, d, L, T, f;
|
|
2231
2244
|
let O = {};
|
|
2232
|
-
(Y = M.forecasts) == null || Y.forEach((
|
|
2233
|
-
O = { ...
|
|
2245
|
+
(Y = M.forecasts) == null || Y.forEach((S) => {
|
|
2246
|
+
O = { ...S.hours, ...O };
|
|
2234
2247
|
});
|
|
2235
2248
|
const A = ((d = M == null ? void 0 : M.history) == null ? void 0 : d[0]) || (O == null ? void 0 : O[(L = Object.keys(O)) == null ? void 0 : L[0]]);
|
|
2236
2249
|
Z == null || Z.info("[%s] the first tropical center: %j", p.requestId, A);
|
|
2237
|
-
let b = (T = Object.keys(O || {}).filter((
|
|
2238
|
-
b || (b = (
|
|
2250
|
+
let b = (T = Object.keys(O || {}).filter((S) => Number(S) <= (z < 0 ? 24 : z))) == null ? void 0 : T.at(-1);
|
|
2251
|
+
b || (b = (f = Object.keys(O || {}).filter((S) => Number(S) <= (z < 0 ? 24 : 2 * z))) == null ? void 0 : f.at(-1));
|
|
2239
2252
|
const W = O == null ? void 0 : O[b || -1];
|
|
2240
2253
|
Z == null || Z.info("[%s] the second tropical center: %j in %d hrs", p.requestId, W, b);
|
|
2241
|
-
const o = Object.keys(O || {}).filter((
|
|
2242
|
-
for (const
|
|
2243
|
-
q[
|
|
2254
|
+
const o = Object.keys(O || {}).filter((S) => Number(S) <= Number(b)), q = { 0: A };
|
|
2255
|
+
for (const S of o)
|
|
2256
|
+
q[S] = O[S];
|
|
2244
2257
|
return { t1: A, t2: W, hr: Number(b), hours: q };
|
|
2245
2258
|
}
|
|
2246
2259
|
static pickIndex(M, z) {
|