@idmui/spot 0.1.2 → 0.1.3

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 CHANGED
@@ -1,4 +1,4 @@
1
- import T from "moment";
1
+ import K from "moment";
2
2
  import X from "moment-timezone";
3
3
  import { Search as be } from "@element-plus/icons-vue";
4
4
  import { LngLatHelper as re } from "@idm-plugin/geo";
@@ -7,15 +7,15 @@ import { markRaw as ke, resolveComponent as le, openBlock as n, createElementBlo
7
7
  import ve from "axios";
8
8
  class fe {
9
9
  static pickHourly(e, t) {
10
- var d, s, v, M, C, S, L, N, I, P, H, a, r, K, z, R, A, E, G, F, B, V, O, U, J, Z, Y, q, w, D, m, k, W, u, j, p, $, g, se, ae;
11
- const ue = typeof t == "string" ? T(t) : t, te = e.weather, pe = e.marine, me = T(te[0].hourly.date).utc(), ne = me.clone().add(te[0].hourly.time.at(0), "h"), ye = me.clone().add(te[0].hourly.time.at(-1), "h"), we = [];
10
+ var d, s, v, M, C, S, L, N, I, P, H, a, r, q, z, T, R, A, E, G, F, B, V, O, U, J, Z, Y, w, D, m, k, W, u, Q, p, $, g, se, ae;
11
+ const ue = typeof t == "string" ? K(t) : t, te = e.weather, pe = e.marine, me = K(te[0].hourly.date).utc(), ne = me.clone().add(te[0].hourly.time.at(0), "h"), ye = me.clone().add(te[0].hourly.time.at(-1), "h"), we = [];
12
12
  if (ue.isBetween(ne, ye, "millisecond", "[]")) {
13
13
  const h = ue.utc().diff(ne, "h", !1);
14
- let Q, ee;
14
+ let j, ee;
15
15
  if (te)
16
16
  for (const oe of te) {
17
17
  const c = oe.hourly;
18
- Q = {
18
+ j = {
19
19
  temp: (d = c.temperature_2m) == null ? void 0 : d.at(h),
20
20
  apparentTemp: (s = c.apparent_temperature) == null ? void 0 : s.at(h),
21
21
  rh: (v = c.relative_humidity_2m) == null ? void 0 : v.at(h),
@@ -32,13 +32,13 @@ class fe {
32
32
  speed: (H = c.wind_speed_10m) == null ? void 0 : H.at(h),
33
33
  kts: (a = c.wind_speed_10m) == null ? void 0 : a.at(h),
34
34
  degree: (r = c.wind_direction_10m) == null ? void 0 : r.at(h),
35
- bearing: ((K = c.wind_direction_10m) == null ? void 0 : K.at(h)) !== null ? (((z = c.wind_direction_10m) == null ? void 0 : z.at(h)) + 180) % 360 : null,
36
- gusts: (R = c.wind_gusts_10m) == null ? void 0 : R.at(h)
35
+ bearing: ((q = c.wind_direction_10m) == null ? void 0 : q.at(h)) !== null ? (((z = c.wind_direction_10m) == null ? void 0 : z.at(h)) + 180) % 360 : null,
36
+ gusts: (T = c.wind_gusts_10m) == null ? void 0 : T.at(h)
37
37
  },
38
- isDay: (A = c.is_day) == null ? void 0 : A.at(h)
38
+ isDay: (R = c.is_day) == null ? void 0 : R.at(h)
39
39
  };
40
- const { name: xe, url: _e } = this.parseWeatherCode(Q.code, Q.isDay);
41
- Q.name = xe, Q.url = _e, Q.wind.scale = this.beaufort(this.kts2ms(Q.wind.kts)), Q.wind.direction = this.degree2Direction(Q.wind.degree);
40
+ const { name: xe, url: _e } = this.parseWeatherCode(j.code, j.isDay);
41
+ j.name = xe, j.url = _e, j.wind.scale = this.beaufort(this.kts2ms(j.wind.kts)), j.wind.direction = this.degree2Direction(j.wind.degree);
42
42
  }
43
43
  if (pe)
44
44
  for (const oe of pe) {
@@ -46,17 +46,17 @@ class fe {
46
46
  ee = {
47
47
  wave: {
48
48
  sig: {
49
- height: (E = c.wave_height) == null ? void 0 : E.at(h),
50
- degree: (G = c.wave_direction) == null ? void 0 : G.at(h),
51
- bearing: ((F = c.wave_direction) == null ? void 0 : F.at(h)) !== null ? (((B = c.wave_direction) == null ? void 0 : B.at(h)) + 180) % 360 : null,
52
- period: (V = c.wave_period) == null ? void 0 : V.at(h)
49
+ height: (A = c.wave_height) == null ? void 0 : A.at(h),
50
+ degree: (E = c.wave_direction) == null ? void 0 : E.at(h),
51
+ bearing: ((G = c.wave_direction) == null ? void 0 : G.at(h)) !== null ? (((F = c.wave_direction) == null ? void 0 : F.at(h)) + 180) % 360 : null,
52
+ period: (B = c.wave_period) == null ? void 0 : B.at(h)
53
53
  },
54
54
  swell: {
55
- height: (O = c.swell_wave_height) == null ? void 0 : O.at(h),
56
- degree: (U = c.swell_wave_direction) == null ? void 0 : U.at(h),
57
- bearing: ((J = c.swell_wave_direction) == null ? void 0 : J.at(h)) !== null ? (((Z = c.swell_wave_direction) == null ? void 0 : Z.at(h)) + 180) % 360 : null,
58
- period: (Y = c.swell_wave_period) == null ? void 0 : Y.at(h),
59
- peakPeriod: (q = c.swell_wave_peak_period) == null ? void 0 : q.at(h)
55
+ height: (V = c.swell_wave_height) == null ? void 0 : V.at(h),
56
+ degree: (O = c.swell_wave_direction) == null ? void 0 : O.at(h),
57
+ bearing: ((U = c.swell_wave_direction) == null ? void 0 : U.at(h)) !== null ? (((J = c.swell_wave_direction) == null ? void 0 : J.at(h)) + 180) % 360 : null,
58
+ period: (Z = c.swell_wave_period) == null ? void 0 : Z.at(h),
59
+ peakPeriod: (Y = c.swell_wave_peak_period) == null ? void 0 : Y.at(h)
60
60
  },
61
61
  wd: {
62
62
  height: (w = c.wind_wave_height) == null ? void 0 : w.at(h),
@@ -67,7 +67,7 @@ class fe {
67
67
  }
68
68
  },
69
69
  current: {
70
- speed: (j = c.ocean_current_velocity) == null ? void 0 : j.at(h),
70
+ speed: (Q = c.ocean_current_velocity) == null ? void 0 : Q.at(h),
71
71
  kts: (p = c.ocean_current_velocity) == null ? void 0 : p.at(h),
72
72
  degree: ($ = c.ocean_current_direction) == null ? void 0 : $.at(h),
73
73
  bearing: ((g = c.ocean_current_direction) == null ? void 0 : g.at(h)) ?? null
@@ -78,7 +78,7 @@ class fe {
78
78
  }
79
79
  we.push({
80
80
  utc: ne.add(h, "h").format(),
81
- weather: { ...Q },
81
+ weather: { ...j },
82
82
  ...ee
83
83
  });
84
84
  }
@@ -105,11 +105,11 @@ class fe {
105
105
  };
106
106
  }
107
107
  static pickDaily(e, t) {
108
- var d, s, v, M, C, S, L, N, I, P, H, a, r, K, z, R, A, E, G, F, B, V, O, U, J, Z, Y;
109
- const q = typeof t == "string" ? T(t) : t, w = e.weather, D = e.marine, m = T(w[0].daily.time.at(0)), k = T(w[0].daily.time.at(-1)), W = [];
110
- if (q.isBetween(m, k, "millisecond", "[]")) {
111
- let u, j;
112
- const p = q.diff(m, "d", !1);
108
+ var d, s, v, M, C, S, L, N, I, P, H, a, r, q, z, T, R, A, E, G, F, B, V, O, U, J, Z;
109
+ const Y = typeof t == "string" ? K(t) : t, w = e.weather, D = e.marine, m = K(w[0].daily.time.at(0)), k = K(w[0].daily.time.at(-1)), W = [];
110
+ if (Y.isBetween(m, k, "millisecond", "[]")) {
111
+ let u, Q;
112
+ const p = Y.diff(m, "d", !1);
113
113
  if (w)
114
114
  for (const $ of w) {
115
115
  const g = $.daily;
@@ -136,9 +136,9 @@ class fe {
136
136
  },
137
137
  wind: {
138
138
  speed: (r = g.wind_speed_10m_max) == null ? void 0 : r.at(p),
139
- kts: (K = g.wind_speed_10m_max) == null ? void 0 : K.at(p),
139
+ kts: (q = g.wind_speed_10m_max) == null ? void 0 : q.at(p),
140
140
  degree: (z = g.wind_direction_10m_dominant) == null ? void 0 : z.at(p),
141
- gusts: (R = g.wind_gusts_10m_max) == null ? void 0 : R.at(p)
141
+ gusts: (T = g.wind_gusts_10m_max) == null ? void 0 : T.at(p)
142
142
  }
143
143
  };
144
144
  const { name: se, url: ae } = this.parseWeatherCode(u.code, !0);
@@ -147,32 +147,32 @@ class fe {
147
147
  if (D)
148
148
  for (const $ of D) {
149
149
  const g = $.daily;
150
- j = {
150
+ Q = {
151
151
  wave: {
152
152
  sig: {
153
- height: (A = g.wave_height_max) == null ? void 0 : A.at(p),
154
- degree: (E = g.wave_direction_dominant) == null ? void 0 : E.at(p),
155
- period: (G = g.wave_period_max) == null ? void 0 : G.at(p)
153
+ height: (R = g.wave_height_max) == null ? void 0 : R.at(p),
154
+ degree: (A = g.wave_direction_dominant) == null ? void 0 : A.at(p),
155
+ period: (E = g.wave_period_max) == null ? void 0 : E.at(p)
156
156
  },
157
157
  swell: {
158
- height: (F = g.swell_wave_height_max) == null ? void 0 : F.at(p),
159
- degree: (B = g.wave_direction_dominant) == null ? void 0 : B.at(p),
160
- period: (V = g.swell_wave_period_max) == null ? void 0 : V.at(p),
161
- peakPeriod: (O = g.swell_wave_peak_period_max) == null ? void 0 : O.at(p)
158
+ height: (G = g.swell_wave_height_max) == null ? void 0 : G.at(p),
159
+ degree: (F = g.wave_direction_dominant) == null ? void 0 : F.at(p),
160
+ period: (B = g.swell_wave_period_max) == null ? void 0 : B.at(p),
161
+ peakPeriod: (V = g.swell_wave_peak_period_max) == null ? void 0 : V.at(p)
162
162
  },
163
163
  wd: {
164
- height: (U = g.wind_wave_height_max) == null ? void 0 : U.at(p),
165
- degree: (J = g.wind_wave_direction_dominant) == null ? void 0 : J.at(p),
166
- period: (Z = g.wind_wave_period_max) == null ? void 0 : Z.at(p),
167
- peakPeriod: (Y = g.wind_wave_peak_period_max) == null ? void 0 : Y.at(p)
164
+ height: (O = g.wind_wave_height_max) == null ? void 0 : O.at(p),
165
+ degree: (U = g.wind_wave_direction_dominant) == null ? void 0 : U.at(p),
166
+ period: (J = g.wind_wave_period_max) == null ? void 0 : J.at(p),
167
+ peakPeriod: (Z = g.wind_wave_peak_period_max) == null ? void 0 : Z.at(p)
168
168
  }
169
169
  }
170
- }, j.wave = this.parseWave(j.wave);
170
+ }, Q.wave = this.parseWave(Q.wave);
171
171
  }
172
172
  W.push({
173
173
  utc: m.add(p, "d").utc().format(),
174
174
  weather: { ...u },
175
- ...j
175
+ ...Q
176
176
  });
177
177
  }
178
178
  return W;
@@ -515,7 +515,7 @@ const ze = (l, e) => {
515
515
  },
516
516
  ts: {
517
517
  type: String,
518
- default: T().utc().format()
518
+ default: K().utc().format()
519
519
  },
520
520
  timeZone: {
521
521
  type: Number,
@@ -554,7 +554,7 @@ const ze = (l, e) => {
554
554
  },
555
555
  computeHourZ() {
556
556
  return function(l) {
557
- return l ? `${T(l).utc().format("HH")}Z` : "-";
557
+ return l ? `${K(l).utc().format("HH")}Z` : "-";
558
558
  };
559
559
  },
560
560
  computeWeek() {
@@ -604,13 +604,13 @@ const ze = (l, e) => {
604
604
  },
605
605
  initInfo() {
606
606
  var l, e;
607
- this.loading = !1, this.positionGmt = (e = (l = this.meteoData.weather) == null ? void 0 : l[0]) == null ? void 0 : e.timezone, this.issuedDate = T(this.ts).utc().format("MMM-DD/HHmm[Z], YYYY"), this.activeIndex = X(this.ts).tz(this.positionGmt).hour(), this.pickedDate = X(this.ts).tz(this.positionGmt).set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).format(), this.collectList = JSON.parse(localStorage.getItem("idmCollectList") || "[]"), this.positionList = JSON.parse(JSON.stringify(this.collectList)), this.isCollected = this.collectList.some((t) => {
607
+ this.loading = !1, this.positionGmt = (e = (l = this.meteoData.weather) == null ? void 0 : l[0]) == null ? void 0 : e.timezone, this.issuedDate = K(this.ts).utc().format("MMM-DD/HHmm[Z], YYYY"), this.activeIndex = X(this.ts).tz(this.positionGmt).hour(), this.pickedDate = X(this.ts).tz(this.positionGmt).set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).format(), this.collectList = JSON.parse(localStorage.getItem("idmCollectList") || "[]"), this.positionList = JSON.parse(JSON.stringify(this.collectList)), this.isCollected = this.collectList.some((t) => {
608
608
  var d;
609
609
  return t.name === ((d = this.position) == null ? void 0 : d.name);
610
610
  });
611
611
  },
612
612
  initTableData() {
613
- var l, e, t, d, s, v, M, C, S, L, N, I, P, H, a, r, K, z, R, A, E, G, F, B, V, O, U, J, Z, Y, q, w, D, m;
613
+ var l, e, t, d, s, v, M, C, S, L, N, I, P, H, a, r, q, z, T, R, A, E, G, F, B, V, O, U, J, Z, Y, w, D, m;
614
614
  this.tableData = {
615
615
  hours: [],
616
616
  utcHours: [],
@@ -638,20 +638,20 @@ const ze = (l, e) => {
638
638
  seaTemp: []
639
639
  };
640
640
  for (let k = 0; k < 24; k++) {
641
- const W = T(this.pickedDate).clone().add(k, "h").format();
641
+ const W = K(this.pickedDate).clone().add(k, "h").format();
642
642
  this.tableData.hours.push(W);
643
643
  const u = ((l = fe.pickHourly(this.meteoData, W)) == null ? void 0 : l[0]) || {};
644
- this.tableData.weatherUrls.push((e = u.weather) == null ? void 0 : e.url), this.tableData.weatherNames.push(((t = u.weather) == null ? void 0 : t.name) ?? "-"), this.tableData.temp.push(this.roundPrecision((d = u.weather) == null ? void 0 : d.temp, 0) ?? "-"), this.tableData.precipProbability.push(this.roundPrecision((v = (s = u.weather) == null ? void 0 : s.precip) == null ? void 0 : v.probability, 0) ?? "-"), this.tableData.precip1h.push(this.roundPrecision((C = (M = u.weather) == null ? void 0 : M.precip) == null ? void 0 : C.sum, 0) ?? "-"), this.tableData.visibility.push(this.roundPrecision((S = u.weather) == null ? void 0 : S.visibility, 0) ?? "-"), this.tableData.humidity.push(this.roundPrecision((L = u.weather) == null ? void 0 : L.rh, 0) ?? "-"), this.tableData.windSpeed.push(this.roundPrecision((I = (N = u.weather) == null ? void 0 : N.wind) == null ? void 0 : I.kts, 1)), this.tableData.windDir.push((H = (P = u.weather) == null ? void 0 : P.wind) == null ? void 0 : H.bearing), this.tableData.windGust.push(this.roundPrecision((r = (a = u.weather) == null ? void 0 : a.wind) == null ? void 0 : r.gusts, 1) ?? "-"), this.tableData.sigwaveHeight.push(this.roundPrecision((z = (K = u.wave) == null ? void 0 : K.sig) == null ? void 0 : z.height, 1) ?? "-"), this.tableData.sigwaveDir.push((A = (R = u.wave) == null ? void 0 : R.sig) == null ? void 0 : A.bearing), this.tableData.windwaveHeight.push(this.roundPrecision((G = (E = u.wave) == null ? void 0 : E.wd) == null ? void 0 : G.height, 1) ?? "-"), this.tableData.windwaveDir.push((B = (F = u.wave) == null ? void 0 : F.wd) == null ? void 0 : B.bearing), this.tableData.windwavePeriod.push(this.roundPrecision((O = (V = u.wave) == null ? void 0 : V.wd) == null ? void 0 : O.period, 1) ?? "-"), this.tableData.swellHeight.push(this.roundPrecision((J = (U = u.wave) == null ? void 0 : U.swell) == null ? void 0 : J.height, 1) ?? "-"), this.tableData.swellDir.push((Y = (Z = u.wave) == null ? void 0 : Z.swell) == null ? void 0 : Y.bearing), this.tableData.swellPeriod.push(this.roundPrecision((w = (q = u.wave) == null ? void 0 : q.swell) == null ? void 0 : w.period, 1) ?? "-"), this.tableData.currentSpeed.push(this.roundPrecision((D = u.current) == null ? void 0 : D.speed, 1) ?? "-"), this.tableData.currentDir.push((m = u.current) == null ? void 0 : m.bearing), this.tableData.seaLevel.push(this.roundPrecision(u.height, 1) ?? "-"), this.tableData.seaTemp.push(this.roundPrecision(u.sst, 0) ?? "-");
644
+ this.tableData.weatherUrls.push((e = u.weather) == null ? void 0 : e.url), this.tableData.weatherNames.push(((t = u.weather) == null ? void 0 : t.name) ?? "-"), this.tableData.temp.push(this.roundPrecision((d = u.weather) == null ? void 0 : d.temp, 0) ?? "-"), this.tableData.precipProbability.push(this.roundPrecision((v = (s = u.weather) == null ? void 0 : s.precip) == null ? void 0 : v.probability, 0) ?? "-"), this.tableData.precip1h.push(this.roundPrecision((C = (M = u.weather) == null ? void 0 : M.precip) == null ? void 0 : C.sum, 0) ?? "-"), this.tableData.visibility.push(this.roundPrecision((S = u.weather) == null ? void 0 : S.visibility, 0) ?? "-"), this.tableData.humidity.push(this.roundPrecision((L = u.weather) == null ? void 0 : L.rh, 0) ?? "-"), this.tableData.windSpeed.push(this.roundPrecision((I = (N = u.weather) == null ? void 0 : N.wind) == null ? void 0 : I.kts, 1)), this.tableData.windDir.push((H = (P = u.weather) == null ? void 0 : P.wind) == null ? void 0 : H.bearing), this.tableData.windGust.push(this.roundPrecision((r = (a = u.weather) == null ? void 0 : a.wind) == null ? void 0 : r.gusts, 1) ?? "-"), this.tableData.sigwaveHeight.push(this.roundPrecision((z = (q = u.wave) == null ? void 0 : q.sig) == null ? void 0 : z.height, 1) ?? "-"), this.tableData.sigwaveDir.push((R = (T = u.wave) == null ? void 0 : T.sig) == null ? void 0 : R.bearing), this.tableData.windwaveHeight.push(this.roundPrecision((E = (A = u.wave) == null ? void 0 : A.wd) == null ? void 0 : E.height, 1) ?? "-"), this.tableData.windwaveDir.push((F = (G = u.wave) == null ? void 0 : G.wd) == null ? void 0 : F.bearing), this.tableData.windwavePeriod.push(this.roundPrecision((V = (B = u.wave) == null ? void 0 : B.wd) == null ? void 0 : V.period, 1) ?? "-"), this.tableData.swellHeight.push(this.roundPrecision((U = (O = u.wave) == null ? void 0 : O.swell) == null ? void 0 : U.height, 1) ?? "-"), this.tableData.swellDir.push((Z = (J = u.wave) == null ? void 0 : J.swell) == null ? void 0 : Z.bearing), this.tableData.swellPeriod.push(this.roundPrecision((w = (Y = u.wave) == null ? void 0 : Y.swell) == null ? void 0 : w.period, 1) ?? "-"), this.tableData.currentSpeed.push(this.roundPrecision((D = u.current) == null ? void 0 : D.speed, 1) ?? "-"), this.tableData.currentDir.push((m = u.current) == null ? void 0 : m.bearing), this.tableData.seaLevel.push(this.roundPrecision(u.height, 1) ?? "-"), this.tableData.seaTemp.push(this.roundPrecision(u.sst, 0) ?? "-");
645
645
  }
646
646
  },
647
647
  initEchart() {
648
- var R, A, E, G, F, B, V, O, U, J, Z, Y, q;
648
+ var T, R, A, E, G, F, B, V, O, U, J, Z, Y;
649
649
  const l = [], e = [], t = [], d = [], s = [], v = [], M = [], C = [], S = [], L = [], N = {};
650
650
  for (let w = 0; w < 7; w++) {
651
- const D = T(this.pickedDate).clone().add(w, "d");
651
+ const D = K(this.pickedDate).clone().add(w, "d");
652
652
  l.push(X(D).tz(this.positionGmt).format("yyyy-MM-DD")), e.push(this.computeMMMDD(D)), t.push(w === 0 ? "Today" : this.computeWeek(D));
653
- const m = ((R = fe.pickDaily(this.meteoData, D)) == null ? void 0 : R[0]) || {};
654
- d.push(this.roundPrecision((E = (A = m.weather) == null ? void 0 : A.temp) == null ? void 0 : E.min, 0)), s.push(this.roundPrecision((F = (G = m.weather) == null ? void 0 : G.temp) == null ? void 0 : F.max, 0)), C.push(this.roundPrecision((V = (B = m.weather) == null ? void 0 : B.wind) == null ? void 0 : V.kts, 1) ?? "- kts"), L.push(this.roundPrecision((U = (O = m.weather) == null ? void 0 : O.precip) == null ? void 0 : U.sum, 0) ?? "- mm"), v.push({ symbol: "image://" + ((J = m.weather) == null ? void 0 : J.url) }), M.push((Z = m.weather) == null ? void 0 : Z.name), S.push((q = (Y = m.weather) == null ? void 0 : Y.wind) == null ? void 0 : q.degree);
653
+ const m = ((T = fe.pickDaily(this.meteoData, D)) == null ? void 0 : T[0]) || {};
654
+ d.push(this.roundPrecision((A = (R = m.weather) == null ? void 0 : R.temp) == null ? void 0 : A.min, 0)), s.push(this.roundPrecision((G = (E = m.weather) == null ? void 0 : E.temp) == null ? void 0 : G.max, 0)), C.push(this.roundPrecision((B = (F = m.weather) == null ? void 0 : F.wind) == null ? void 0 : B.kts, 1) ?? "- kts"), L.push(this.roundPrecision((O = (V = m.weather) == null ? void 0 : V.precip) == null ? void 0 : O.sum, 0) ?? "- mm"), v.push({ symbol: "image://" + ((U = m.weather) == null ? void 0 : U.url) }), M.push((J = m.weather) == null ? void 0 : J.name), S.push((Y = (Z = m.weather) == null ? void 0 : Z.wind) == null ? void 0 : Y.degree);
655
655
  }
656
656
  const I = Math.max(...s.filter((w) => typeof w == "number" && !isNaN(w))) - Math.min(...d.filter((w) => typeof w == "number" && !isNaN(w))), P = Math.min(...d.filter((w) => typeof w == "number" && !isNaN(w))) - 1.5 * I, H = Math.max(...s.filter((w) => typeof w == "number" && !isNaN(w))) + 2 * I, a = 4 + 0.5 / l.length * 92 + "%", r = "data:image/svg+xml;base64," + window.btoa(
657
657
  unescape(
@@ -659,19 +659,19 @@ const ze = (l, e) => {
659
659
  '<svg t="1740385441519" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10951" width="200" height="200"><path d="M512 804.83593751A276.87183211 276.87183211 0 0 1 235.12816789 527.9641054Q235.12816789 375.21005376 512 13.82031251q276.87183211 361.30792288 276.87183211 514.14379289a276.87183211 276.87183211 0 0 1-276.87183211 276.87183211zM294.4461577 527.9641054a217.47202472 217.47202472 0 0 0 217.5538423 217.55384231 19.79993605 19.79993605 0 1 0 0-39.51805453 177.9539702 177.9539702 0 0 1-177.9539702-178.03578778 19.79993605 19.79993605 0 0 0-39.5998721 0z" fill="#0c73a8" p-id="10952"></path></svg>'
660
660
  )
661
661
  )
662
- ), K = "data:image/svg+xml;base64," + window.btoa(
662
+ ), q = "data:image/svg+xml;base64," + window.btoa(
663
663
  unescape(
664
664
  encodeURIComponent(
665
665
  '<svg t="1740383449285" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10797" width="200" height="200"><path d="M133.8 579l-44.4-44.4c-18.8-18.8-18.8-49.2 0-67.8L478 78c18.8-18.8 49.2-18.8 67.8 0l388.6 388.6c18.8 18.8 18.8 49.2 0 67.8L890 578.8c-19 19-50 18.6-68.6-0.8L592 337.2V912c0 26.6-21.4 48-48 48h-64c-26.6 0-48-21.4-48-48V337.2L202.4 578.2c-18.6 19.6-49.6 20-68.6 0.8z" fill="#ffffff" p-id="10798"></path></svg>'
666
666
  )
667
667
  )
668
668
  ), z = new Image(64, 64);
669
- z.src = K, z.onload = () => {
669
+ z.src = q, z.onload = () => {
670
670
  for (let m = 0; m < 7; m++) {
671
671
  const k = document.createElement("canvas"), W = k.getContext("2d");
672
672
  k.width = z.width, k.height = z.height;
673
- const j = S[m] * (Math.PI / 180);
674
- W.translate(k.width / 2, k.height / 2), W.rotate(j), W.translate(-z.width / 2, -z.height / 2), W.drawImage(z, 0, 0, 64, 64);
673
+ const Q = S[m] * (Math.PI / 180);
674
+ W.translate(k.width / 2, k.height / 2), W.rotate(Q), W.translate(-z.width / 2, -z.height / 2), W.drawImage(z, 0, 0, 64, 64);
675
675
  const p = k.toDataURL();
676
676
  N[`WindIcon${m}`] = {
677
677
  height: 12,
@@ -1033,7 +1033,7 @@ const ze = (l, e) => {
1033
1033
  const l = {
1034
1034
  lat: this.position.lat,
1035
1035
  lng: this.position.lng,
1036
- datetime: this.ts ? T(this.ts).utc().add(-1, "d").format() : T().add(-1, "d").utc().format(),
1036
+ // datetime: this.ts ? moment(this.ts).utc().add(-1,'d').format() : moment().add(-1,'d').utc().format(),
1037
1037
  forecastDays: 8,
1038
1038
  selfHosted: !1
1039
1039
  }, e = await ve.post("https://cbe.idmwx.com/api/arc/meteo2/spot/forecast", l, {
@@ -1061,7 +1061,7 @@ const ze = (l, e) => {
1061
1061
  }, Ge = {
1062
1062
  key: 3,
1063
1063
  class: "card-box"
1064
- }, Fe = { class: "date" }, Be = { class: "basic-table" }, Ve = { class: "day" }, Oe = { class: "hour" }, Ue = { class: "icon" }, Je = ["src"], Ze = { class: "text" }, Ye = { class: "text" }, qe = { class: "text" }, Ke = { class: "text" }, Qe = { class: "text" }, je = { class: "text" }, Xe = { key: 1 }, $e = { class: "text" }, et = { class: "text" }, tt = { class: "wave-current-table" }, st = { class: "text" }, at = { class: "text" }, it = { key: 1 }, nt = { class: "text" }, ot = { class: "text" }, rt = { class: "text" }, lt = { key: 1 }, dt = { class: "text" }, ht = { class: "text" }, ct = { class: "text" }, ut = { key: 1 }, pt = { class: "text" }, mt = { class: "sea-table" }, wt = { class: "text" }, gt = { class: "text" }, vt = {
1064
+ }, Fe = { class: "date" }, Be = { class: "basic-table" }, Ve = { class: "day" }, Oe = { class: "hour" }, Ue = { class: "icon" }, Je = ["src"], Ze = { class: "text" }, Ye = { class: "text" }, qe = { class: "text" }, je = { class: "text" }, Ke = { class: "text" }, Qe = { class: "text" }, Xe = { key: 1 }, $e = { class: "text" }, et = { class: "text" }, tt = { class: "wave-current-table" }, st = { class: "text" }, at = { class: "text" }, it = { key: 1 }, nt = { class: "text" }, ot = { class: "text" }, rt = { class: "text" }, lt = { key: 1 }, dt = { class: "text" }, ht = { class: "text" }, ct = { class: "text" }, ut = { key: 1 }, pt = { class: "text" }, mt = { class: "sea-table" }, wt = { class: "text" }, gt = { class: "text" }, vt = {
1065
1065
  key: 4,
1066
1066
  class: "card-box flex-center"
1067
1067
  }, ft = {
@@ -1246,7 +1246,7 @@ function yt(l, e, t, d, s, v) {
1246
1246
  key: Math.random() + a
1247
1247
  }, x(a), 3))), 128))
1248
1248
  ]),
1249
- i("tr", Ke, [
1249
+ i("tr", je, [
1250
1250
  e[11] || (e[11] = i("td", {
1251
1251
  rowspan: "1",
1252
1252
  colspan: "1",
@@ -1262,7 +1262,7 @@ function yt(l, e, t, d, s, v) {
1262
1262
  key: Math.random() + a
1263
1263
  }, x(a), 3))), 128))
1264
1264
  ]),
1265
- i("tr", Qe, [
1265
+ i("tr", Ke, [
1266
1266
  e[12] || (e[12] = i("td", {
1267
1267
  rowspan: "1",
1268
1268
  colspan: "1",
@@ -1278,7 +1278,7 @@ function yt(l, e, t, d, s, v) {
1278
1278
  key: Math.random() + a
1279
1279
  }, x(a), 3))), 128))
1280
1280
  ]),
1281
- i("tr", je, [
1281
+ i("tr", Qe, [
1282
1282
  e[13] || (e[13] = i("td", {
1283
1283
  rowspan: "1",
1284
1284
  colspan: "1",
@@ -1537,7 +1537,7 @@ function yt(l, e, t, d, s, v) {
1537
1537
  ])
1538
1538
  ]);
1539
1539
  }
1540
- const xt = /* @__PURE__ */ ze(Se, [["render", yt], ["__scopeId", "data-v-e4818d13"]]), Lt = {
1540
+ const xt = /* @__PURE__ */ ze(Se, [["render", yt], ["__scopeId", "data-v-4a0bd795"]]), Lt = {
1541
1541
  install(l) {
1542
1542
  l.component("SpotReport", xt);
1543
1543
  }
@@ -1 +1 @@
1
- (function(x,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("moment"),require("moment-timezone"),require("@element-plus/icons-vue"),require("@idm-plugin/geo"),require("echarts"),require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["exports","moment","moment-timezone","@element-plus/icons-vue","@idm-plugin/geo","echarts","vue","axios"],y):(x=typeof globalThis<"u"?globalThis:x||self,y(x["idmui-report"]={},x.moment,x["moment-timezone"],x["@element-plus/icons-vue"],x["@idm-plugin/geo"],x.echarts,x.Vue,x.axios))})(this,function(x,y,J,ce,v,de,e,te){"use strict";function he(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const s in o)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(o,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>o[s]})}}return t.default=o,Object.freeze(t)}const se=he(de);class ae{static pickHourly(t,s){var r,a,g,D,B,_,b,N,E,z,V,n,i,q,f,L,C,I,M,P,T,H,F,W,R,A,G,O,p,k,m,u,S,d,j,h,Z,w,Q,X;const oe=typeof s=="string"?y(s):s,K=t.weather,ie=t.marine,re=y(K[0].hourly.date).utc(),$=re.clone().add(K[0].hourly.time.at(0),"h"),lt=re.clone().add(K[0].hourly.time.at(-1),"h"),le=[];if(oe.isBetween($,lt,"millisecond","[]")){const l=oe.utc().diff($,"h",!1);let U,Y;if(K)for(const ee of K){const c=ee.hourly;U={temp:(r=c.temperature_2m)==null?void 0:r.at(l),apparentTemp:(a=c.apparent_temperature)==null?void 0:a.at(l),rh:(g=c.relative_humidity_2m)==null?void 0:g.at(l),dp:(D=c.dew_point_2m)==null?void 0:D.at(l),precip:{probability:(B=c.precipitation_probability)==null?void 0:B.at(l),sum:(_=c.precipitation)==null?void 0:_.at(l)},pmsl:(b=c.pressure_msl)==null?void 0:b.at(l),psurf:(N=c.surface_pressure)==null?void 0:N.at(l),code:(E=c.weather_code)==null?void 0:E.at(l),visibility:this.m2nm((z=c.visibility)==null?void 0:z.at(l)),wind:{speed:(V=c.wind_speed_10m)==null?void 0:V.at(l),kts:(n=c.wind_speed_10m)==null?void 0:n.at(l),degree:(i=c.wind_direction_10m)==null?void 0:i.at(l),bearing:((q=c.wind_direction_10m)==null?void 0:q.at(l))!==null?(((f=c.wind_direction_10m)==null?void 0:f.at(l))+180)%360:null,gusts:(L=c.wind_gusts_10m)==null?void 0:L.at(l)},isDay:(C=c.is_day)==null?void 0:C.at(l)};const{name:ct,url:dt}=this.parseWeatherCode(U.code,U.isDay);U.name=ct,U.url=dt,U.wind.scale=this.beaufort(this.kts2ms(U.wind.kts)),U.wind.direction=this.degree2Direction(U.wind.degree)}if(ie)for(const ee of ie){const c=ee.hourly;Y={wave:{sig:{height:(I=c.wave_height)==null?void 0:I.at(l),degree:(M=c.wave_direction)==null?void 0:M.at(l),bearing:((P=c.wave_direction)==null?void 0:P.at(l))!==null?(((T=c.wave_direction)==null?void 0:T.at(l))+180)%360:null,period:(H=c.wave_period)==null?void 0:H.at(l)},swell:{height:(F=c.swell_wave_height)==null?void 0:F.at(l),degree:(W=c.swell_wave_direction)==null?void 0:W.at(l),bearing:((R=c.swell_wave_direction)==null?void 0:R.at(l))!==null?(((A=c.swell_wave_direction)==null?void 0:A.at(l))+180)%360:null,period:(G=c.swell_wave_period)==null?void 0:G.at(l),peakPeriod:(O=c.swell_wave_peak_period)==null?void 0:O.at(l)},wd:{height:(p=c.wind_wave_height)==null?void 0:p.at(l),degree:(k=c.wind_wave_direction)==null?void 0:k.at(l),bearing:((m=c.wind_wave_direction)==null?void 0:m.at(l))!==null?(((u=c.wind_wave_direction)==null?void 0:u.at(l))+180)%360:null,period:(S=c.wind_wave_period)==null?void 0:S.at(l),peakPeriod:(d=c.wind_wave_peak_period)==null?void 0:d.at(l)}},current:{speed:(j=c.ocean_current_velocity)==null?void 0:j.at(l),kts:(h=c.ocean_current_velocity)==null?void 0:h.at(l),degree:(Z=c.ocean_current_direction)==null?void 0:Z.at(l),bearing:((w=c.ocean_current_direction)==null?void 0:w.at(l))??null},sst:(Q=c.sea_surface_temperature)==null?void 0:Q.at(l),height:(X=c.sea_level_height_msl)==null?void 0:X.at(l)},Y.wave=this.parseWave(Y.wave),Y.current.direction=this.degree2Direction(Y.current.degree)}le.push({utc:$.add(l,"h").format(),weather:{...U},...Y})}return le}static toLegacy(t){return{wind:t.weather.wind,visibility:t.weather.visibility,temp:t.weather.temp,prmsl:t.weather.pmsl,gusts:{kts:t.weather.wind.gusts},precip:t.weather.precip,code:t.weather.code,name:t.weather.name,url:t.weather.url,wave:t.wave,current:t.current,sst:t.sst,height:t.height,utc:t.utc}}static pickDaily(t,s){var r,a,g,D,B,_,b,N,E,z,V,n,i,q,f,L,C,I,M,P,T,H,F,W,R,A,G;const O=typeof s=="string"?y(s):s,p=t.weather,k=t.marine,m=y(p[0].daily.time.at(0)),u=y(p[0].daily.time.at(-1)),S=[];if(O.isBetween(m,u,"millisecond","[]")){let d,j;const h=O.diff(m,"d",!1);if(p)for(const Z of p){const w=Z.daily;d={code:(r=w.weather_code)==null?void 0:r.at(h),temp:{max:(a=w.temperature_2m_max)==null?void 0:a.at(h),min:(g=w.temperature_2m_min)==null?void 0:g.at(h),mean:(D=w.temperature_2m_mean)==null?void 0:D.at(h)},apparentTemp:{max:(B=w.apparent_temperature_max)==null?void 0:B.at(h),min:(_=w.apparent_temperature_min)==null?void 0:_.at(h)},precip:{sum:(b=w.precipitation_sum)==null?void 0:b.at(h),hours:(N=w.precipitation_hours)==null?void 0:N.at(h),probability:(E=w.precipitation_probability_max)==null?void 0:E.at(h)},rh:{max:(z=w.relative_humidity_2m_max)==null?void 0:z.at(h),min:(V=w.relative_humidity_2m_min)==null?void 0:V.at(h),mean:(n=w.relative_humidity_2m_mean)==null?void 0:n.at(h)},wind:{speed:(i=w.wind_speed_10m_max)==null?void 0:i.at(h),kts:(q=w.wind_speed_10m_max)==null?void 0:q.at(h),degree:(f=w.wind_direction_10m_dominant)==null?void 0:f.at(h),gusts:(L=w.wind_gusts_10m_max)==null?void 0:L.at(h)}};const{name:Q,url:X}=this.parseWeatherCode(d.code,!0);d.name=Q,d.url=X,d.wind.scale=this.beaufort(this.kts2ms(d.wind.kts)),d.wind.direction=this.degree2Direction(d.wind.degree)}if(k)for(const Z of k){const w=Z.daily;j={wave:{sig:{height:(C=w.wave_height_max)==null?void 0:C.at(h),degree:(I=w.wave_direction_dominant)==null?void 0:I.at(h),period:(M=w.wave_period_max)==null?void 0:M.at(h)},swell:{height:(P=w.swell_wave_height_max)==null?void 0:P.at(h),degree:(T=w.wave_direction_dominant)==null?void 0:T.at(h),period:(H=w.swell_wave_period_max)==null?void 0:H.at(h),peakPeriod:(F=w.swell_wave_peak_period_max)==null?void 0:F.at(h)},wd:{height:(W=w.wind_wave_height_max)==null?void 0:W.at(h),degree:(R=w.wind_wave_direction_dominant)==null?void 0:R.at(h),period:(A=w.wind_wave_period_max)==null?void 0:A.at(h),peakPeriod:(G=w.wind_wave_peak_period_max)==null?void 0:G.at(h)}}},j.wave=this.parseWave(j.wave)}S.push({utc:m.add(h,"d").utc().format(),weather:{...d},...j})}return S}static parseWave(t){return t.sig.direction=this.degree2Direction(t.sig.degree),t.swell.direction=this.degree2Direction(t.swell.degree),t.wd.direction=this.degree2Direction(t.wd.degree),t.sig.scale=this.douglas(t.sig.height),t.swell.scale=this.douglas(t.swell.height),t.wd.scale=this.douglas(t.wd.height),t}static parseWeatherCode(t,s){const r=this.weatherCode(t);return(s?r.day:r.night)||{}}static weatherCode(t){const s={code:t};switch(t){case 0:s.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},s.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 1:s.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},s.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 2:s.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg"},s.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg"};break;case 3:s.day={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03d.svg"},s.night={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03n.svg"};break;case 45:s.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},s.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 48:s.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},s.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 51:s.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 53:s.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 55:s.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 56:s.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 57:s.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 61:s.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 63:s.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 65:s.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 66:s.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 67:s.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 71:s.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 73:s.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 75:s.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 77:s.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 80:s.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 81:s.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 82:s.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 85:s.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 86:s.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 95:s.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 96:s.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 99:s.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break}return s}static kts2ms(t){return isNaN(t)||t===null?t:Math.round(t*1852/3600*1e4)/1e4}static kts2kmh(t){return isNaN(t)||t===null?t:t*1.852}static m2nm(t){return isNaN(t)||t===null?t:Math.round(t/1e3/1.852*1e4)/1e4}static kmh2kts(t){return isNaN(t)||t===null?t:this.ms2kts(t*1e3/3600)}static ms2kts(t){return isNaN(t)||t===null?t:Math.round(t*3600/1852*1e4)/1e4}static degree2Radian(t){if(isNaN(t)||t===null)return t;let s=t%360/360*2*Math.PI;return s=s<0?s+2*Math.PI:s,s}static degree2Direction(t){const s=this.degree2Radian(t);if(isNaN(s)||s===null)return null;let r="N/A";const a=Math.PI/16;return s<a?r="N":s>=a&&s<3*a?r="NNE":s>=3*a&&s<5*a?r="NE":s>=5*a&&s<7*a?r="ENE":s>=7*a&&s<9*a?r="E":s>=9*a&&s<11*a?r="ESE":s>=11*a&&s<13*a?r="SE":s>=13*a&&s<15*a?r="SSE":s>=15*a&&s<17*a?r="S":s>=17*a&&s<19*a?r="SSW":s>=19*a&&s<21*a?r="SW":s>=21*a&&s<23*a?r="WSW":s>=23*a&&s<25*a?r="W":s>=25*a&&s<27*a?r="WNW":s>=27*a&&s<29*a?r="NW":s>=29*a&&s<31*a?r="NNW":s>=31*a&&s<32*a&&(r="N"),r}static beaufort(t){let s=0;return isNaN(t)||(t=Math.round(t*10)/10,t<=.2?s=0:t<=1.5?s=1:t<=3.3?s=2:t<=5.4?s=3:t<=7.9?s=4:t<=10.7?s=5:t<=13.8?s=6:t<=17.1?s=7:t<=20.7?s=8:t<=22.4?s=9:t<=28.4?s=10:t<=32.6?s=11:t>32.6&&(s=12)),s}static douglas(t){let s="Calm";return isNaN(t)||t<=.1?s="Calm":t<=.5?s="Smooth":t<=1.25?s="Slight":t<=2.5?s="Moderate":t<=4?s="Rough":t<=6?s="VeryRough":t<=9?s="High":t<=14?s="VeryHigh":s="Precipitous",s}}const ht="",me=(o,t)=>{const s=o.__vccOpts||o;for(const[r,a]of t)s[r]=a;return s},pe={name:"SpotReport",props:{token:{type:String,default:""},ts:{type:String,default:y().utc().format()},timeZone:{type:Number,default:8},report:{type:Object,default:()=>({})}},data(){return{placeholder:"search for port name or coordinates",searchName:void 0,rawSearchIcon:e.markRaw(ce.Search),positionGmt:void 0,issuedDate:void 0,meteoData:{},a:void 0,positionList:[],position:void 0,loading:!0,activeIndex:void 0,tableData:{},pickedDate:void 0,pickedWeek:"Today",collectList:[],isCollected:!1}},computed:{computeHourL(){return function(o){return o?`${J(o).tz(this.positionGmt).format("HH")}`:"-"}},computeHourZ(){return function(o){return o?`${y(o).utc().format("HH")}Z`:"-"}},computeWeek(){return function(o){return o?`${J(o).tz(this.positionGmt).format("dddd")}`:"-"}},computeMMMDD(){return function(o){return o?`${J(o).tz(this.positionGmt).format("MMM-DD")}`:"-"}},computeLat(){return function(o,t=4){return v.LngLatHelper.lat2pretty(o,t).pretty}},computeLng(){return function(o,t=4){return v.LngLatHelper.lng2pretty(o,t).pretty}},roundPrecision(){return function(o,t=4){return isNaN(o)?"-":v.LngLatHelper.roundPrecision(o,t)}}},watch:{"report.version":{handler(){var o,t;this.report&&(this.meteoData=this.report,this.position={id:this.report.portId,lat:(o=this.report)==null?void 0:o.lat,lng:(t=this.report)==null?void 0:t.lng,name:this.computeLat(this.report.lat)+","+this.computeLng(this.report.lng)},this.handleRender())}}},methods:{handleRender(){this.initInfo(),this.initTableData(),this.$nextTick(()=>{this.initEchart()})},initInfo(){var o,t;this.loading=!1,this.positionGmt=(t=(o=this.meteoData.weather)==null?void 0:o[0])==null?void 0:t.timezone,this.issuedDate=y(this.ts).utc().format("MMM-DD/HHmm[Z], YYYY"),this.activeIndex=J(this.ts).tz(this.positionGmt).hour(),this.pickedDate=J(this.ts).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.collectList=JSON.parse(localStorage.getItem("idmCollectList")||"[]"),this.positionList=JSON.parse(JSON.stringify(this.collectList)),this.isCollected=this.collectList.some(s=>{var r;return s.name===((r=this.position)==null?void 0:r.name)})},initTableData(){var o,t,s,r,a,g,D,B,_,b,N,E,z,V,n,i,q,f,L,C,I,M,P,T,H,F,W,R,A,G,O,p,k,m;this.tableData={hours:[],utcHours:[],weatherUrls:[],weatherNames:[],temp:[],precipProbability:[],precip1h:[],visibility:[],humidity:[],windSpeed:[],windDir:[],windGust:[],sigwaveHeight:[],sigwaveDir:[],windwaveHeight:[],windwaveDir:[],windwavePeriod:[],swellHeight:[],swellDir:[],swellPeriod:[],currentSpeed:[],currentDir:[],seaLevel:[],seaTemp:[]};for(let u=0;u<24;u++){const S=y(this.pickedDate).clone().add(u,"h").format();this.tableData.hours.push(S);const d=((o=ae.pickHourly(this.meteoData,S))==null?void 0:o[0])||{};this.tableData.weatherUrls.push((t=d.weather)==null?void 0:t.url),this.tableData.weatherNames.push(((s=d.weather)==null?void 0:s.name)??"-"),this.tableData.temp.push(this.roundPrecision((r=d.weather)==null?void 0:r.temp,0)??"-"),this.tableData.precipProbability.push(this.roundPrecision((g=(a=d.weather)==null?void 0:a.precip)==null?void 0:g.probability,0)??"-"),this.tableData.precip1h.push(this.roundPrecision((B=(D=d.weather)==null?void 0:D.precip)==null?void 0:B.sum,0)??"-"),this.tableData.visibility.push(this.roundPrecision((_=d.weather)==null?void 0:_.visibility,0)??"-"),this.tableData.humidity.push(this.roundPrecision((b=d.weather)==null?void 0:b.rh,0)??"-"),this.tableData.windSpeed.push(this.roundPrecision((E=(N=d.weather)==null?void 0:N.wind)==null?void 0:E.kts,1)),this.tableData.windDir.push((V=(z=d.weather)==null?void 0:z.wind)==null?void 0:V.bearing),this.tableData.windGust.push(this.roundPrecision((i=(n=d.weather)==null?void 0:n.wind)==null?void 0:i.gusts,1)??"-"),this.tableData.sigwaveHeight.push(this.roundPrecision((f=(q=d.wave)==null?void 0:q.sig)==null?void 0:f.height,1)??"-"),this.tableData.sigwaveDir.push((C=(L=d.wave)==null?void 0:L.sig)==null?void 0:C.bearing),this.tableData.windwaveHeight.push(this.roundPrecision((M=(I=d.wave)==null?void 0:I.wd)==null?void 0:M.height,1)??"-"),this.tableData.windwaveDir.push((T=(P=d.wave)==null?void 0:P.wd)==null?void 0:T.bearing),this.tableData.windwavePeriod.push(this.roundPrecision((F=(H=d.wave)==null?void 0:H.wd)==null?void 0:F.period,1)??"-"),this.tableData.swellHeight.push(this.roundPrecision((R=(W=d.wave)==null?void 0:W.swell)==null?void 0:R.height,1)??"-"),this.tableData.swellDir.push((G=(A=d.wave)==null?void 0:A.swell)==null?void 0:G.bearing),this.tableData.swellPeriod.push(this.roundPrecision((p=(O=d.wave)==null?void 0:O.swell)==null?void 0:p.period,1)??"-"),this.tableData.currentSpeed.push(this.roundPrecision((k=d.current)==null?void 0:k.speed,1)??"-"),this.tableData.currentDir.push((m=d.current)==null?void 0:m.bearing),this.tableData.seaLevel.push(this.roundPrecision(d.height,1)??"-"),this.tableData.seaTemp.push(this.roundPrecision(d.sst,0)??"-")}},initEchart(){var L,C,I,M,P,T,H,F,W,R,A,G,O;const o=[],t=[],s=[],r=[],a=[],g=[],D=[],B=[],_=[],b=[],N={};for(let p=0;p<7;p++){const k=y(this.pickedDate).clone().add(p,"d");o.push(J(k).tz(this.positionGmt).format("yyyy-MM-DD")),t.push(this.computeMMMDD(k)),s.push(p===0?"Today":this.computeWeek(k));const m=((L=ae.pickDaily(this.meteoData,k))==null?void 0:L[0])||{};r.push(this.roundPrecision((I=(C=m.weather)==null?void 0:C.temp)==null?void 0:I.min,0)),a.push(this.roundPrecision((P=(M=m.weather)==null?void 0:M.temp)==null?void 0:P.max,0)),B.push(this.roundPrecision((H=(T=m.weather)==null?void 0:T.wind)==null?void 0:H.kts,1)??"- kts"),b.push(this.roundPrecision((W=(F=m.weather)==null?void 0:F.precip)==null?void 0:W.sum,0)??"- mm"),g.push({symbol:"image://"+((R=m.weather)==null?void 0:R.url)}),D.push((A=m.weather)==null?void 0:A.name),_.push((O=(G=m.weather)==null?void 0:G.wind)==null?void 0:O.degree)}const E=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))-Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p))),z=Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p)))-1.5*E,V=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))+2*E,n=4+.5/o.length*92+"%",i="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent('<svg t="1740385441519" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10951" width="200" height="200"><path d="M512 804.83593751A276.87183211 276.87183211 0 0 1 235.12816789 527.9641054Q235.12816789 375.21005376 512 13.82031251q276.87183211 361.30792288 276.87183211 514.14379289a276.87183211 276.87183211 0 0 1-276.87183211 276.87183211zM294.4461577 527.9641054a217.47202472 217.47202472 0 0 0 217.5538423 217.55384231 19.79993605 19.79993605 0 1 0 0-39.51805453 177.9539702 177.9539702 0 0 1-177.9539702-178.03578778 19.79993605 19.79993605 0 0 0-39.5998721 0z" fill="#0c73a8" p-id="10952"></path></svg>'))),q="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent('<svg t="1740383449285" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10797" width="200" height="200"><path d="M133.8 579l-44.4-44.4c-18.8-18.8-18.8-49.2 0-67.8L478 78c18.8-18.8 49.2-18.8 67.8 0l388.6 388.6c18.8 18.8 18.8 49.2 0 67.8L890 578.8c-19 19-50 18.6-68.6-0.8L592 337.2V912c0 26.6-21.4 48-48 48h-64c-26.6 0-48-21.4-48-48V337.2L202.4 578.2c-18.6 19.6-49.6 20-68.6 0.8z" fill="#ffffff" p-id="10798"></path></svg>'))),f=new Image(64,64);f.src=q,f.onload=()=>{for(let m=0;m<7;m++){const u=document.createElement("canvas"),S=u.getContext("2d");u.width=f.width,u.height=f.height;const j=_[m]*(Math.PI/180);S.translate(u.width/2,u.height/2),S.rotate(j),S.translate(-f.width/2,-f.height/2),S.drawImage(f,0,0,64,64);const h=u.toDataURL();N[`WindIcon${m}`]={height:12,width:12,align:"left",backgroundColor:{image:h}}}const p=se.init(document.getElementById("weather-chart")),k={grid:{bottom:0,top:0,left:"4%",right:"4%"},tooltip:{trigger:"item",show:!0,position:"right",formatter:function(m){return m.seriesName==="Weather Icon"?D[m.dataIndex]:!1}},legend:{show:!1},xAxis:{left:0,right:0,top:"50%",height:"50%",type:"category",data:o,show:!1},singleAxis:[{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"7%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"16%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"27%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"84%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"93%",height:"2%"}],yAxis:{type:"value",name:"温度(℃)",show:!1,min:z,max:V,axisLabel:{formatter:"{value} °C"}},series:[{singleAxisIndex:0,coordinateSystem:"singleAxis",type:"scatter",data:s,label:{show:!0,color:"#fff",fontSize:14,formatter:"{c}"},symbolSize:0},{singleAxisIndex:1,coordinateSystem:"singleAxis",type:"scatter",data:t,label:{show:!0,color:"#fff",formatter:"{c}"},symbolSize:0},{name:"Weather Icon",singleAxisIndex:2,coordinateSystem:"singleAxis",type:"scatter",data:g,symbolSize:36},{name:"温度(℃)",type:"line",data:r,smooth:!0,itemStyle:{color:"rgba(255,255,255,0.7)"},label:{show:!0,color:"rgba(255,255,255,1)",position:[-10,12],formatter:"{c} °C",fontSize:12},markArea:{itemStyle:{color:"rgb(71,143,206)"},data:[[{x:"4%"},{x:4+1/o.length*92+"%"}]]}},{name:"温度(℃)",type:"line",data:a,smooth:!0,itemStyle:{color:"rgba(255,255,255,0.7)"},label:{show:!0,color:"rgba(255,255,255,1)",position:[-10,-12],formatter:"{c} °C",fontSize:12}},{singleAxisIndex:3,coordinateSystem:"singleAxis",type:"scatter",data:B,label:{show:!0,color:"#fff",rich:{...N,title:{align:"center",vertical:"center"}},formatter:function(m){return`{WindIcon${m.dataIndex}|}{title|${m.value}} kts`}},symbolSize:0},{singleAxisIndex:4,coordinateSystem:"singleAxis",type:"scatter",data:b,label:{show:!0,color:"#fff",rich:{dIcon:{height:16,width:16,align:"left",backgroundColor:{image:i}},title:{align:"center",vertical:"center"}},formatter:function(m){return`{dIcon|}{title|${m.value}} mm`}},symbolSize:0}]};p.setOption(k),p.on("click",m=>{const u=m.dataIndex;this.pickedDate=J(o[u]).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.pickedWeek=u===0?"Today":this.computeWeek(this.pickedDate),this.activeIndex=u===0?J(this.ts).tz(this.positionGmt).hour():void 0,this.initTableData(),k.series[3].markArea={itemStyle:{color:"rgb(71,143,206)"},data:[[{x:4+u/o.length*92+"%"},{x:4+(u+1)/o.length*92+"%"}]]},p.setOption(k)})}},handleCollect(){this.isCollected=!this.isCollected,this.isCollected?this.collectList.push({name:this.position.name,lat:this.position.lat,lng:this.position.lng}):this.collectList=this.collectList.filter(o=>o.name!==this.position.name),localStorage.setItem("idmCollectList",JSON.stringify(this.collectList))},async fetchSuggestPosition(o){var r;const t=o.replaceAll(",",",");if(!t)return this.positionList=this.collectList,!1;const s=await te.get(`https://cbe.idmwx.com/api/arc/ports/suggest?n=${t}`,{headers:{Authorization:this.token}});(s==null?void 0:s.data.code)===0&&(this.positionList=(r=s==null?void 0:s.data.data)==null?void 0:r.map(a=>(a.name=a.id?a.name:this.computeLat(a.lat)+", "+this.computeLng(a.lng),a)))},async handleFetchMeteo(){var s,r,a;if(!this.searchName)return!1;this.position={portId:(s=this.positionList.find(g=>g.name===this.searchName))==null?void 0:s.id,lat:(r=this.positionList.find(g=>g.name===this.searchName))==null?void 0:r.lat,lng:(a=this.positionList.find(g=>g.name===this.searchName))==null?void 0:a.lng,name:this.searchName},this.handleClear();const o={lat:this.position.lat,lng:this.position.lng,datetime:this.ts?y(this.ts).utc().add(-1,"d").format():y().add(-1,"d").utc().format(),forecastDays:8,selfHosted:!1},t=await te.post("https://cbe.idmwx.com/api/arc/meteo2/spot/forecast",o,{headers:{Authorization:this.token}});(t==null?void 0:t.data.code)===0&&(this.meteoData={...t==null?void 0:t.data.data}),this.handleRender()},handleClear(){this.loading=!0,this.meteoData={},this.isCollected=!1,se.dispose(document.getElementById("weather-chart"))}}},we={class:"spot-report"},ge={class:"header-box flex-between"},ue={class:"bg"},ke={class:"search-box flex-start"},ye={class:"content-box"},fe={class:"title-box flex-between"},xe={class:"main-title"},_e={class:"sub-title"},be={class:"flex-end"},Ne={key:0,id:"weather-chart"},Ee={key:1,class:"weather-chart flex-center"},De={key:2,class:"weather-chart flex-center"},Be={key:3,class:"card-box"},ze={class:"date"},Ve={class:"basic-table"},Se={class:"day"},Le={class:"hour"},Ce={class:"icon"},Ie=["src"],Me={class:"text"},Pe={class:"text"},Te={class:"text"},He={class:"text"},Fe={class:"text"},We={class:"text"},Re={key:1},Ae={class:"text"},Ge={class:"text"},Oe={class:"wave-current-table"},qe={class:"text"},Ue={class:"text"},je={key:1},Je={class:"text"},Ze={class:"text"},Ye={class:"text"},Ke={key:1},Qe={class:"text"},Xe={class:"text"},ve={class:"text"},$e={key:1},et={class:"text"},tt={class:"sea-table"},st={class:"text"},at={class:"text"},nt={key:4,class:"card-box flex-center"},ot={key:5,class:"card-box flex-center"};function it(o,t,s,r,a,g){var b,N,E,z,V;const D=e.resolveComponent("ElOption"),B=e.resolveComponent("ElSelect"),_=e.resolveComponent("ElTooltip");return e.openBlock(),e.createElementBlock("div",we,[e.createElementVNode("div",ge,[e.createElementVNode("div",ue,[e.createElementVNode("div",ke,[e.createVNode(B,{modelValue:a.searchName,"onUpdate:modelValue":t[0]||(t[0]=n=>a.searchName=n),filterable:"",class:"input",clearable:"",remote:"",placeholder:a.placeholder,autocomplete:"","remote-show-suffix":"",onFocus:t[1]||(t[1]=n=>a.placeholder=""),onBlur:t[2]||(t[2]=n=>a.placeholder="search for port name or coordinates"),"remote-method":g.fetchSuggestPosition,onChange:g.handleFetchMeteo},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.positionList,n=>(e.openBlock(),e.createBlock(D,{key:n.name,label:n.name,value:n.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","remote-method","onChange"])])])]),e.createElementVNode("div",ye,[e.createElementVNode("div",fe,[e.createElementVNode("div",null,[e.createElementVNode("div",xe,"Weather forecast for "+e.toDisplayString(((b=a.position)==null?void 0:b.name)||"-")+" ( "+e.toDisplayString(a.positionGmt)+" )",1),e.createElementVNode("div",_e,"At "+e.toDisplayString((N=a.position)!=null&&N.portId?"port":"coordinates")+", issued "+e.toDisplayString(a.issuedDate),1)]),e.createElementVNode("div",be,[e.createVNode(_,{placement:"left",effect:"light",content:a.isCollected?"remove the port/coordinate from the search list":"add the port/coordinate to the search list","show-after":1e3},{default:e.withCtx(()=>[a.isCollected?(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon active",onClick:t[3]||(t[3]=(...n)=>g.handleCollect&&g.handleCollect(...n))},"")):(e.openBlock(),e.createElementBlock("span",{key:1,class:"iconfont icon",onClick:t[4]||(t[4]=(...n)=>g.handleCollect&&g.handleCollect(...n))},""))]),_:1},8,["content"])])]),(E=a.position)!=null&&E.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Ne)):a.loading?(e.openBlock(),e.createElementBlock("div",Ee,"Loading....")):a.position.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",De,"No Data")),(z=a.position)!=null&&z.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",ze,e.toDisplayString(a.pickedWeek)+" "+e.toDisplayString(g.computeMMMDD(a.pickedDate)),1),e.createElementVNode("table",Ve,[e.createElementVNode("tr",Se,[t[5]||(t[5]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Local time"),e.createElementVNode("span",{class:"unit"},"(LT)")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(n,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"local"},e.toDisplayString(g.computeHourL(n)),3))),128))]),e.createElementVNode("tr",Le,[t[6]||(t[6]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("UTC"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(n,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"z"},e.toDisplayString(g.computeHourZ(n)),3))),128))]),e.createElementVNode("tr",Ce,[t[7]||(t[7]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Weather"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.weatherUrls,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"url"},[e.createVNode(_,{placement:"top",effect:"light",content:a.tableData.weatherNames[i],"show-after":500},{default:e.withCtx(()=>[n?(e.openBlock(),e.createElementBlock("img",{key:0,class:"iconfont weather-icon",src:n},null,8,Ie)):e.createCommentVNode("",!0)]),_:2},1032,["content"])],2))),128))]),e.createElementVNode("tr",Me,[t[8]||(t[8]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.temp,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Pe,[t[9]||(t[9]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation Probability"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precipProbability,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Te,[t[10]||(t[10]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation 1h"),e.createElementVNode("span",{class:"unit"},"mm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precip1h,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",He,[t[11]||(t[11]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Visibility"),e.createElementVNode("span",{class:"unit"},"nm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.visibility,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Fe,[t[12]||(t[12]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Relative Humidity"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.humidity,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",We,[t[13]||(t[13]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Re,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Ae,[t[14]||(t[14]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windSpeed,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ge,[t[15]||(t[15]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind gust"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windGust,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])]),t[27]||(t[27]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",Oe,[e.createElementVNode("tr",qe,[t[16]||(t[16]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ue,[t[17]||(t[17]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",je,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Je,[t[18]||(t[18]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwavePeriod,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ze,[t[19]||(t[19]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ye,[t[20]||(t[20]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Ke,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Qe,[t[21]||(t[21]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellPeriod,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Xe,[t[22]||(t[22]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sig wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.sigwaveHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",ve,[t[23]||(t[23]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",$e,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",et,[t[24]||(t[24]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentSpeed,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])]),t[28]||(t[28]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",tt,[e.createElementVNode("tr",st,[t[25]||(t[25]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea level height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaLevel,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",at,[t[26]||(t[26]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea surface temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaTemp,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])])])):a.loading?(e.openBlock(),e.createElementBlock("div",nt,"Loading....")):(V=a.position)!=null&&V.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ot,"No Data"))])])}const ne=me(pe,[["render",it],["__scopeId","data-v-e4818d13"]]),rt={install(o){o.component("SpotReport",ne)}};x.SpotReport=ne,x.SpotReportPlugin=rt,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
1
+ (function(f,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("moment"),require("moment-timezone"),require("@element-plus/icons-vue"),require("@idm-plugin/geo"),require("echarts"),require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["exports","moment","moment-timezone","@element-plus/icons-vue","@idm-plugin/geo","echarts","vue","axios"],x):(f=typeof globalThis<"u"?globalThis:f||self,x(f["idmui-spot"]={},f.moment,f["moment-timezone"],f["@element-plus/icons-vue"],f["@idm-plugin/geo"],f.echarts,f.Vue,f.axios))})(this,function(f,x,Z,ce,v,de,e,te){"use strict";function he(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const s in o)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(o,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>o[s]})}}return t.default=o,Object.freeze(t)}const se=he(de);class ae{static pickHourly(t,s){var r,a,g,D,B,_,b,N,E,z,V,n,i,q,y,L,C,I,M,P,T,H,F,W,R,A,G,O,p,k,m,u,S,d,J,h,Y,w,X,j;const oe=typeof s=="string"?x(s):s,Q=t.weather,ie=t.marine,re=x(Q[0].hourly.date).utc(),$=re.clone().add(Q[0].hourly.time.at(0),"h"),lt=re.clone().add(Q[0].hourly.time.at(-1),"h"),le=[];if(oe.isBetween($,lt,"millisecond","[]")){const l=oe.utc().diff($,"h",!1);let U,K;if(Q)for(const ee of Q){const c=ee.hourly;U={temp:(r=c.temperature_2m)==null?void 0:r.at(l),apparentTemp:(a=c.apparent_temperature)==null?void 0:a.at(l),rh:(g=c.relative_humidity_2m)==null?void 0:g.at(l),dp:(D=c.dew_point_2m)==null?void 0:D.at(l),precip:{probability:(B=c.precipitation_probability)==null?void 0:B.at(l),sum:(_=c.precipitation)==null?void 0:_.at(l)},pmsl:(b=c.pressure_msl)==null?void 0:b.at(l),psurf:(N=c.surface_pressure)==null?void 0:N.at(l),code:(E=c.weather_code)==null?void 0:E.at(l),visibility:this.m2nm((z=c.visibility)==null?void 0:z.at(l)),wind:{speed:(V=c.wind_speed_10m)==null?void 0:V.at(l),kts:(n=c.wind_speed_10m)==null?void 0:n.at(l),degree:(i=c.wind_direction_10m)==null?void 0:i.at(l),bearing:((q=c.wind_direction_10m)==null?void 0:q.at(l))!==null?(((y=c.wind_direction_10m)==null?void 0:y.at(l))+180)%360:null,gusts:(L=c.wind_gusts_10m)==null?void 0:L.at(l)},isDay:(C=c.is_day)==null?void 0:C.at(l)};const{name:ct,url:dt}=this.parseWeatherCode(U.code,U.isDay);U.name=ct,U.url=dt,U.wind.scale=this.beaufort(this.kts2ms(U.wind.kts)),U.wind.direction=this.degree2Direction(U.wind.degree)}if(ie)for(const ee of ie){const c=ee.hourly;K={wave:{sig:{height:(I=c.wave_height)==null?void 0:I.at(l),degree:(M=c.wave_direction)==null?void 0:M.at(l),bearing:((P=c.wave_direction)==null?void 0:P.at(l))!==null?(((T=c.wave_direction)==null?void 0:T.at(l))+180)%360:null,period:(H=c.wave_period)==null?void 0:H.at(l)},swell:{height:(F=c.swell_wave_height)==null?void 0:F.at(l),degree:(W=c.swell_wave_direction)==null?void 0:W.at(l),bearing:((R=c.swell_wave_direction)==null?void 0:R.at(l))!==null?(((A=c.swell_wave_direction)==null?void 0:A.at(l))+180)%360:null,period:(G=c.swell_wave_period)==null?void 0:G.at(l),peakPeriod:(O=c.swell_wave_peak_period)==null?void 0:O.at(l)},wd:{height:(p=c.wind_wave_height)==null?void 0:p.at(l),degree:(k=c.wind_wave_direction)==null?void 0:k.at(l),bearing:((m=c.wind_wave_direction)==null?void 0:m.at(l))!==null?(((u=c.wind_wave_direction)==null?void 0:u.at(l))+180)%360:null,period:(S=c.wind_wave_period)==null?void 0:S.at(l),peakPeriod:(d=c.wind_wave_peak_period)==null?void 0:d.at(l)}},current:{speed:(J=c.ocean_current_velocity)==null?void 0:J.at(l),kts:(h=c.ocean_current_velocity)==null?void 0:h.at(l),degree:(Y=c.ocean_current_direction)==null?void 0:Y.at(l),bearing:((w=c.ocean_current_direction)==null?void 0:w.at(l))??null},sst:(X=c.sea_surface_temperature)==null?void 0:X.at(l),height:(j=c.sea_level_height_msl)==null?void 0:j.at(l)},K.wave=this.parseWave(K.wave),K.current.direction=this.degree2Direction(K.current.degree)}le.push({utc:$.add(l,"h").format(),weather:{...U},...K})}return le}static toLegacy(t){return{wind:t.weather.wind,visibility:t.weather.visibility,temp:t.weather.temp,prmsl:t.weather.pmsl,gusts:{kts:t.weather.wind.gusts},precip:t.weather.precip,code:t.weather.code,name:t.weather.name,url:t.weather.url,wave:t.wave,current:t.current,sst:t.sst,height:t.height,utc:t.utc}}static pickDaily(t,s){var r,a,g,D,B,_,b,N,E,z,V,n,i,q,y,L,C,I,M,P,T,H,F,W,R,A,G;const O=typeof s=="string"?x(s):s,p=t.weather,k=t.marine,m=x(p[0].daily.time.at(0)),u=x(p[0].daily.time.at(-1)),S=[];if(O.isBetween(m,u,"millisecond","[]")){let d,J;const h=O.diff(m,"d",!1);if(p)for(const Y of p){const w=Y.daily;d={code:(r=w.weather_code)==null?void 0:r.at(h),temp:{max:(a=w.temperature_2m_max)==null?void 0:a.at(h),min:(g=w.temperature_2m_min)==null?void 0:g.at(h),mean:(D=w.temperature_2m_mean)==null?void 0:D.at(h)},apparentTemp:{max:(B=w.apparent_temperature_max)==null?void 0:B.at(h),min:(_=w.apparent_temperature_min)==null?void 0:_.at(h)},precip:{sum:(b=w.precipitation_sum)==null?void 0:b.at(h),hours:(N=w.precipitation_hours)==null?void 0:N.at(h),probability:(E=w.precipitation_probability_max)==null?void 0:E.at(h)},rh:{max:(z=w.relative_humidity_2m_max)==null?void 0:z.at(h),min:(V=w.relative_humidity_2m_min)==null?void 0:V.at(h),mean:(n=w.relative_humidity_2m_mean)==null?void 0:n.at(h)},wind:{speed:(i=w.wind_speed_10m_max)==null?void 0:i.at(h),kts:(q=w.wind_speed_10m_max)==null?void 0:q.at(h),degree:(y=w.wind_direction_10m_dominant)==null?void 0:y.at(h),gusts:(L=w.wind_gusts_10m_max)==null?void 0:L.at(h)}};const{name:X,url:j}=this.parseWeatherCode(d.code,!0);d.name=X,d.url=j,d.wind.scale=this.beaufort(this.kts2ms(d.wind.kts)),d.wind.direction=this.degree2Direction(d.wind.degree)}if(k)for(const Y of k){const w=Y.daily;J={wave:{sig:{height:(C=w.wave_height_max)==null?void 0:C.at(h),degree:(I=w.wave_direction_dominant)==null?void 0:I.at(h),period:(M=w.wave_period_max)==null?void 0:M.at(h)},swell:{height:(P=w.swell_wave_height_max)==null?void 0:P.at(h),degree:(T=w.wave_direction_dominant)==null?void 0:T.at(h),period:(H=w.swell_wave_period_max)==null?void 0:H.at(h),peakPeriod:(F=w.swell_wave_peak_period_max)==null?void 0:F.at(h)},wd:{height:(W=w.wind_wave_height_max)==null?void 0:W.at(h),degree:(R=w.wind_wave_direction_dominant)==null?void 0:R.at(h),period:(A=w.wind_wave_period_max)==null?void 0:A.at(h),peakPeriod:(G=w.wind_wave_peak_period_max)==null?void 0:G.at(h)}}},J.wave=this.parseWave(J.wave)}S.push({utc:m.add(h,"d").utc().format(),weather:{...d},...J})}return S}static parseWave(t){return t.sig.direction=this.degree2Direction(t.sig.degree),t.swell.direction=this.degree2Direction(t.swell.degree),t.wd.direction=this.degree2Direction(t.wd.degree),t.sig.scale=this.douglas(t.sig.height),t.swell.scale=this.douglas(t.swell.height),t.wd.scale=this.douglas(t.wd.height),t}static parseWeatherCode(t,s){const r=this.weatherCode(t);return(s?r.day:r.night)||{}}static weatherCode(t){const s={code:t};switch(t){case 0:s.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},s.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 1:s.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},s.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 2:s.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg"},s.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg"};break;case 3:s.day={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03d.svg"},s.night={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03n.svg"};break;case 45:s.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},s.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 48:s.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},s.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 51:s.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 53:s.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 55:s.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 56:s.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 57:s.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 61:s.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 63:s.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 65:s.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 66:s.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 67:s.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 71:s.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 73:s.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 75:s.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 77:s.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 80:s.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 81:s.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 82:s.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 85:s.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 86:s.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 95:s.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 96:s.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 99:s.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break}return s}static kts2ms(t){return isNaN(t)||t===null?t:Math.round(t*1852/3600*1e4)/1e4}static kts2kmh(t){return isNaN(t)||t===null?t:t*1.852}static m2nm(t){return isNaN(t)||t===null?t:Math.round(t/1e3/1.852*1e4)/1e4}static kmh2kts(t){return isNaN(t)||t===null?t:this.ms2kts(t*1e3/3600)}static ms2kts(t){return isNaN(t)||t===null?t:Math.round(t*3600/1852*1e4)/1e4}static degree2Radian(t){if(isNaN(t)||t===null)return t;let s=t%360/360*2*Math.PI;return s=s<0?s+2*Math.PI:s,s}static degree2Direction(t){const s=this.degree2Radian(t);if(isNaN(s)||s===null)return null;let r="N/A";const a=Math.PI/16;return s<a?r="N":s>=a&&s<3*a?r="NNE":s>=3*a&&s<5*a?r="NE":s>=5*a&&s<7*a?r="ENE":s>=7*a&&s<9*a?r="E":s>=9*a&&s<11*a?r="ESE":s>=11*a&&s<13*a?r="SE":s>=13*a&&s<15*a?r="SSE":s>=15*a&&s<17*a?r="S":s>=17*a&&s<19*a?r="SSW":s>=19*a&&s<21*a?r="SW":s>=21*a&&s<23*a?r="WSW":s>=23*a&&s<25*a?r="W":s>=25*a&&s<27*a?r="WNW":s>=27*a&&s<29*a?r="NW":s>=29*a&&s<31*a?r="NNW":s>=31*a&&s<32*a&&(r="N"),r}static beaufort(t){let s=0;return isNaN(t)||(t=Math.round(t*10)/10,t<=.2?s=0:t<=1.5?s=1:t<=3.3?s=2:t<=5.4?s=3:t<=7.9?s=4:t<=10.7?s=5:t<=13.8?s=6:t<=17.1?s=7:t<=20.7?s=8:t<=22.4?s=9:t<=28.4?s=10:t<=32.6?s=11:t>32.6&&(s=12)),s}static douglas(t){let s="Calm";return isNaN(t)||t<=.1?s="Calm":t<=.5?s="Smooth":t<=1.25?s="Slight":t<=2.5?s="Moderate":t<=4?s="Rough":t<=6?s="VeryRough":t<=9?s="High":t<=14?s="VeryHigh":s="Precipitous",s}}const ht="",me=(o,t)=>{const s=o.__vccOpts||o;for(const[r,a]of t)s[r]=a;return s},pe={name:"SpotReport",props:{token:{type:String,default:""},ts:{type:String,default:x().utc().format()},timeZone:{type:Number,default:8},report:{type:Object,default:()=>({})}},data(){return{placeholder:"search for port name or coordinates",searchName:void 0,rawSearchIcon:e.markRaw(ce.Search),positionGmt:void 0,issuedDate:void 0,meteoData:{},a:void 0,positionList:[],position:void 0,loading:!0,activeIndex:void 0,tableData:{},pickedDate:void 0,pickedWeek:"Today",collectList:[],isCollected:!1}},computed:{computeHourL(){return function(o){return o?`${Z(o).tz(this.positionGmt).format("HH")}`:"-"}},computeHourZ(){return function(o){return o?`${x(o).utc().format("HH")}Z`:"-"}},computeWeek(){return function(o){return o?`${Z(o).tz(this.positionGmt).format("dddd")}`:"-"}},computeMMMDD(){return function(o){return o?`${Z(o).tz(this.positionGmt).format("MMM-DD")}`:"-"}},computeLat(){return function(o,t=4){return v.LngLatHelper.lat2pretty(o,t).pretty}},computeLng(){return function(o,t=4){return v.LngLatHelper.lng2pretty(o,t).pretty}},roundPrecision(){return function(o,t=4){return isNaN(o)?"-":v.LngLatHelper.roundPrecision(o,t)}}},watch:{"report.version":{handler(){var o,t;this.report&&(this.meteoData=this.report,this.position={id:this.report.portId,lat:(o=this.report)==null?void 0:o.lat,lng:(t=this.report)==null?void 0:t.lng,name:this.computeLat(this.report.lat)+","+this.computeLng(this.report.lng)},this.handleRender())}}},methods:{handleRender(){this.initInfo(),this.initTableData(),this.$nextTick(()=>{this.initEchart()})},initInfo(){var o,t;this.loading=!1,this.positionGmt=(t=(o=this.meteoData.weather)==null?void 0:o[0])==null?void 0:t.timezone,this.issuedDate=x(this.ts).utc().format("MMM-DD/HHmm[Z], YYYY"),this.activeIndex=Z(this.ts).tz(this.positionGmt).hour(),this.pickedDate=Z(this.ts).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.collectList=JSON.parse(localStorage.getItem("idmCollectList")||"[]"),this.positionList=JSON.parse(JSON.stringify(this.collectList)),this.isCollected=this.collectList.some(s=>{var r;return s.name===((r=this.position)==null?void 0:r.name)})},initTableData(){var o,t,s,r,a,g,D,B,_,b,N,E,z,V,n,i,q,y,L,C,I,M,P,T,H,F,W,R,A,G,O,p,k,m;this.tableData={hours:[],utcHours:[],weatherUrls:[],weatherNames:[],temp:[],precipProbability:[],precip1h:[],visibility:[],humidity:[],windSpeed:[],windDir:[],windGust:[],sigwaveHeight:[],sigwaveDir:[],windwaveHeight:[],windwaveDir:[],windwavePeriod:[],swellHeight:[],swellDir:[],swellPeriod:[],currentSpeed:[],currentDir:[],seaLevel:[],seaTemp:[]};for(let u=0;u<24;u++){const S=x(this.pickedDate).clone().add(u,"h").format();this.tableData.hours.push(S);const d=((o=ae.pickHourly(this.meteoData,S))==null?void 0:o[0])||{};this.tableData.weatherUrls.push((t=d.weather)==null?void 0:t.url),this.tableData.weatherNames.push(((s=d.weather)==null?void 0:s.name)??"-"),this.tableData.temp.push(this.roundPrecision((r=d.weather)==null?void 0:r.temp,0)??"-"),this.tableData.precipProbability.push(this.roundPrecision((g=(a=d.weather)==null?void 0:a.precip)==null?void 0:g.probability,0)??"-"),this.tableData.precip1h.push(this.roundPrecision((B=(D=d.weather)==null?void 0:D.precip)==null?void 0:B.sum,0)??"-"),this.tableData.visibility.push(this.roundPrecision((_=d.weather)==null?void 0:_.visibility,0)??"-"),this.tableData.humidity.push(this.roundPrecision((b=d.weather)==null?void 0:b.rh,0)??"-"),this.tableData.windSpeed.push(this.roundPrecision((E=(N=d.weather)==null?void 0:N.wind)==null?void 0:E.kts,1)),this.tableData.windDir.push((V=(z=d.weather)==null?void 0:z.wind)==null?void 0:V.bearing),this.tableData.windGust.push(this.roundPrecision((i=(n=d.weather)==null?void 0:n.wind)==null?void 0:i.gusts,1)??"-"),this.tableData.sigwaveHeight.push(this.roundPrecision((y=(q=d.wave)==null?void 0:q.sig)==null?void 0:y.height,1)??"-"),this.tableData.sigwaveDir.push((C=(L=d.wave)==null?void 0:L.sig)==null?void 0:C.bearing),this.tableData.windwaveHeight.push(this.roundPrecision((M=(I=d.wave)==null?void 0:I.wd)==null?void 0:M.height,1)??"-"),this.tableData.windwaveDir.push((T=(P=d.wave)==null?void 0:P.wd)==null?void 0:T.bearing),this.tableData.windwavePeriod.push(this.roundPrecision((F=(H=d.wave)==null?void 0:H.wd)==null?void 0:F.period,1)??"-"),this.tableData.swellHeight.push(this.roundPrecision((R=(W=d.wave)==null?void 0:W.swell)==null?void 0:R.height,1)??"-"),this.tableData.swellDir.push((G=(A=d.wave)==null?void 0:A.swell)==null?void 0:G.bearing),this.tableData.swellPeriod.push(this.roundPrecision((p=(O=d.wave)==null?void 0:O.swell)==null?void 0:p.period,1)??"-"),this.tableData.currentSpeed.push(this.roundPrecision((k=d.current)==null?void 0:k.speed,1)??"-"),this.tableData.currentDir.push((m=d.current)==null?void 0:m.bearing),this.tableData.seaLevel.push(this.roundPrecision(d.height,1)??"-"),this.tableData.seaTemp.push(this.roundPrecision(d.sst,0)??"-")}},initEchart(){var L,C,I,M,P,T,H,F,W,R,A,G,O;const o=[],t=[],s=[],r=[],a=[],g=[],D=[],B=[],_=[],b=[],N={};for(let p=0;p<7;p++){const k=x(this.pickedDate).clone().add(p,"d");o.push(Z(k).tz(this.positionGmt).format("yyyy-MM-DD")),t.push(this.computeMMMDD(k)),s.push(p===0?"Today":this.computeWeek(k));const m=((L=ae.pickDaily(this.meteoData,k))==null?void 0:L[0])||{};r.push(this.roundPrecision((I=(C=m.weather)==null?void 0:C.temp)==null?void 0:I.min,0)),a.push(this.roundPrecision((P=(M=m.weather)==null?void 0:M.temp)==null?void 0:P.max,0)),B.push(this.roundPrecision((H=(T=m.weather)==null?void 0:T.wind)==null?void 0:H.kts,1)??"- kts"),b.push(this.roundPrecision((W=(F=m.weather)==null?void 0:F.precip)==null?void 0:W.sum,0)??"- mm"),g.push({symbol:"image://"+((R=m.weather)==null?void 0:R.url)}),D.push((A=m.weather)==null?void 0:A.name),_.push((O=(G=m.weather)==null?void 0:G.wind)==null?void 0:O.degree)}const E=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))-Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p))),z=Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p)))-1.5*E,V=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))+2*E,n=4+.5/o.length*92+"%",i="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent('<svg t="1740385441519" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10951" width="200" height="200"><path d="M512 804.83593751A276.87183211 276.87183211 0 0 1 235.12816789 527.9641054Q235.12816789 375.21005376 512 13.82031251q276.87183211 361.30792288 276.87183211 514.14379289a276.87183211 276.87183211 0 0 1-276.87183211 276.87183211zM294.4461577 527.9641054a217.47202472 217.47202472 0 0 0 217.5538423 217.55384231 19.79993605 19.79993605 0 1 0 0-39.51805453 177.9539702 177.9539702 0 0 1-177.9539702-178.03578778 19.79993605 19.79993605 0 0 0-39.5998721 0z" fill="#0c73a8" p-id="10952"></path></svg>'))),q="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent('<svg t="1740383449285" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10797" width="200" height="200"><path d="M133.8 579l-44.4-44.4c-18.8-18.8-18.8-49.2 0-67.8L478 78c18.8-18.8 49.2-18.8 67.8 0l388.6 388.6c18.8 18.8 18.8 49.2 0 67.8L890 578.8c-19 19-50 18.6-68.6-0.8L592 337.2V912c0 26.6-21.4 48-48 48h-64c-26.6 0-48-21.4-48-48V337.2L202.4 578.2c-18.6 19.6-49.6 20-68.6 0.8z" fill="#ffffff" p-id="10798"></path></svg>'))),y=new Image(64,64);y.src=q,y.onload=()=>{for(let m=0;m<7;m++){const u=document.createElement("canvas"),S=u.getContext("2d");u.width=y.width,u.height=y.height;const J=_[m]*(Math.PI/180);S.translate(u.width/2,u.height/2),S.rotate(J),S.translate(-y.width/2,-y.height/2),S.drawImage(y,0,0,64,64);const h=u.toDataURL();N[`WindIcon${m}`]={height:12,width:12,align:"left",backgroundColor:{image:h}}}const p=se.init(document.getElementById("weather-chart")),k={grid:{bottom:0,top:0,left:"4%",right:"4%"},tooltip:{trigger:"item",show:!0,position:"right",formatter:function(m){return m.seriesName==="Weather Icon"?D[m.dataIndex]:!1}},legend:{show:!1},xAxis:{left:0,right:0,top:"50%",height:"50%",type:"category",data:o,show:!1},singleAxis:[{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"7%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"16%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"27%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"84%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"93%",height:"2%"}],yAxis:{type:"value",name:"温度(℃)",show:!1,min:z,max:V,axisLabel:{formatter:"{value} °C"}},series:[{singleAxisIndex:0,coordinateSystem:"singleAxis",type:"scatter",data:s,label:{show:!0,color:"#fff",fontSize:14,formatter:"{c}"},symbolSize:0},{singleAxisIndex:1,coordinateSystem:"singleAxis",type:"scatter",data:t,label:{show:!0,color:"#fff",formatter:"{c}"},symbolSize:0},{name:"Weather Icon",singleAxisIndex:2,coordinateSystem:"singleAxis",type:"scatter",data:g,symbolSize:36},{name:"温度(℃)",type:"line",data:r,smooth:!0,itemStyle:{color:"rgba(255,255,255,0.7)"},label:{show:!0,color:"rgba(255,255,255,1)",position:[-10,12],formatter:"{c} °C",fontSize:12},markArea:{itemStyle:{color:"rgb(71,143,206)"},data:[[{x:"4%"},{x:4+1/o.length*92+"%"}]]}},{name:"温度(℃)",type:"line",data:a,smooth:!0,itemStyle:{color:"rgba(255,255,255,0.7)"},label:{show:!0,color:"rgba(255,255,255,1)",position:[-10,-12],formatter:"{c} °C",fontSize:12}},{singleAxisIndex:3,coordinateSystem:"singleAxis",type:"scatter",data:B,label:{show:!0,color:"#fff",rich:{...N,title:{align:"center",vertical:"center"}},formatter:function(m){return`{WindIcon${m.dataIndex}|}{title|${m.value}} kts`}},symbolSize:0},{singleAxisIndex:4,coordinateSystem:"singleAxis",type:"scatter",data:b,label:{show:!0,color:"#fff",rich:{dIcon:{height:16,width:16,align:"left",backgroundColor:{image:i}},title:{align:"center",vertical:"center"}},formatter:function(m){return`{dIcon|}{title|${m.value}} mm`}},symbolSize:0}]};p.setOption(k),p.on("click",m=>{const u=m.dataIndex;this.pickedDate=Z(o[u]).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.pickedWeek=u===0?"Today":this.computeWeek(this.pickedDate),this.activeIndex=u===0?Z(this.ts).tz(this.positionGmt).hour():void 0,this.initTableData(),k.series[3].markArea={itemStyle:{color:"rgb(71,143,206)"},data:[[{x:4+u/o.length*92+"%"},{x:4+(u+1)/o.length*92+"%"}]]},p.setOption(k)})}},handleCollect(){this.isCollected=!this.isCollected,this.isCollected?this.collectList.push({name:this.position.name,lat:this.position.lat,lng:this.position.lng}):this.collectList=this.collectList.filter(o=>o.name!==this.position.name),localStorage.setItem("idmCollectList",JSON.stringify(this.collectList))},async fetchSuggestPosition(o){var r;const t=o.replaceAll(",",",");if(!t)return this.positionList=this.collectList,!1;const s=await te.get(`https://cbe.idmwx.com/api/arc/ports/suggest?n=${t}`,{headers:{Authorization:this.token}});(s==null?void 0:s.data.code)===0&&(this.positionList=(r=s==null?void 0:s.data.data)==null?void 0:r.map(a=>(a.name=a.id?a.name:this.computeLat(a.lat)+", "+this.computeLng(a.lng),a)))},async handleFetchMeteo(){var s,r,a;if(!this.searchName)return!1;this.position={portId:(s=this.positionList.find(g=>g.name===this.searchName))==null?void 0:s.id,lat:(r=this.positionList.find(g=>g.name===this.searchName))==null?void 0:r.lat,lng:(a=this.positionList.find(g=>g.name===this.searchName))==null?void 0:a.lng,name:this.searchName},this.handleClear();const o={lat:this.position.lat,lng:this.position.lng,forecastDays:8,selfHosted:!1},t=await te.post("https://cbe.idmwx.com/api/arc/meteo2/spot/forecast",o,{headers:{Authorization:this.token}});(t==null?void 0:t.data.code)===0&&(this.meteoData={...t==null?void 0:t.data.data}),this.handleRender()},handleClear(){this.loading=!0,this.meteoData={},this.isCollected=!1,se.dispose(document.getElementById("weather-chart"))}}},we={class:"spot-report"},ge={class:"header-box flex-between"},ue={class:"bg"},ke={class:"search-box flex-start"},ye={class:"content-box"},fe={class:"title-box flex-between"},xe={class:"main-title"},_e={class:"sub-title"},be={class:"flex-end"},Ne={key:0,id:"weather-chart"},Ee={key:1,class:"weather-chart flex-center"},De={key:2,class:"weather-chart flex-center"},Be={key:3,class:"card-box"},ze={class:"date"},Ve={class:"basic-table"},Se={class:"day"},Le={class:"hour"},Ce={class:"icon"},Ie=["src"],Me={class:"text"},Pe={class:"text"},Te={class:"text"},He={class:"text"},Fe={class:"text"},We={class:"text"},Re={key:1},Ae={class:"text"},Ge={class:"text"},Oe={class:"wave-current-table"},qe={class:"text"},Ue={class:"text"},Je={key:1},Ze={class:"text"},Ye={class:"text"},Ke={class:"text"},Qe={key:1},Xe={class:"text"},je={class:"text"},ve={class:"text"},$e={key:1},et={class:"text"},tt={class:"sea-table"},st={class:"text"},at={class:"text"},nt={key:4,class:"card-box flex-center"},ot={key:5,class:"card-box flex-center"};function it(o,t,s,r,a,g){var b,N,E,z,V;const D=e.resolveComponent("ElOption"),B=e.resolveComponent("ElSelect"),_=e.resolveComponent("ElTooltip");return e.openBlock(),e.createElementBlock("div",we,[e.createElementVNode("div",ge,[e.createElementVNode("div",ue,[e.createElementVNode("div",ke,[e.createVNode(B,{modelValue:a.searchName,"onUpdate:modelValue":t[0]||(t[0]=n=>a.searchName=n),filterable:"",class:"input",clearable:"",remote:"",placeholder:a.placeholder,autocomplete:"","remote-show-suffix":"",onFocus:t[1]||(t[1]=n=>a.placeholder=""),onBlur:t[2]||(t[2]=n=>a.placeholder="search for port name or coordinates"),"remote-method":g.fetchSuggestPosition,onChange:g.handleFetchMeteo},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.positionList,n=>(e.openBlock(),e.createBlock(D,{key:n.name,label:n.name,value:n.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","remote-method","onChange"])])])]),e.createElementVNode("div",ye,[e.createElementVNode("div",fe,[e.createElementVNode("div",null,[e.createElementVNode("div",xe,"Weather forecast for "+e.toDisplayString(((b=a.position)==null?void 0:b.name)||"-")+" ( "+e.toDisplayString(a.positionGmt)+" )",1),e.createElementVNode("div",_e,"At "+e.toDisplayString((N=a.position)!=null&&N.portId?"port":"coordinates")+", issued "+e.toDisplayString(a.issuedDate),1)]),e.createElementVNode("div",be,[e.createVNode(_,{placement:"left",effect:"light",content:a.isCollected?"remove the port/coordinate from the search list":"add the port/coordinate to the search list","show-after":1e3},{default:e.withCtx(()=>[a.isCollected?(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon active",onClick:t[3]||(t[3]=(...n)=>g.handleCollect&&g.handleCollect(...n))},"")):(e.openBlock(),e.createElementBlock("span",{key:1,class:"iconfont icon",onClick:t[4]||(t[4]=(...n)=>g.handleCollect&&g.handleCollect(...n))},""))]),_:1},8,["content"])])]),(E=a.position)!=null&&E.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Ne)):a.loading?(e.openBlock(),e.createElementBlock("div",Ee,"Loading....")):a.position.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",De,"No Data")),(z=a.position)!=null&&z.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",ze,e.toDisplayString(a.pickedWeek)+" "+e.toDisplayString(g.computeMMMDD(a.pickedDate)),1),e.createElementVNode("table",Ve,[e.createElementVNode("tr",Se,[t[5]||(t[5]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Local time"),e.createElementVNode("span",{class:"unit"},"(LT)")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(n,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"local"},e.toDisplayString(g.computeHourL(n)),3))),128))]),e.createElementVNode("tr",Le,[t[6]||(t[6]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("UTC"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(n,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"z"},e.toDisplayString(g.computeHourZ(n)),3))),128))]),e.createElementVNode("tr",Ce,[t[7]||(t[7]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Weather"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.weatherUrls,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"url"},[e.createVNode(_,{placement:"top",effect:"light",content:a.tableData.weatherNames[i],"show-after":500},{default:e.withCtx(()=>[n?(e.openBlock(),e.createElementBlock("img",{key:0,class:"iconfont weather-icon",src:n},null,8,Ie)):e.createCommentVNode("",!0)]),_:2},1032,["content"])],2))),128))]),e.createElementVNode("tr",Me,[t[8]||(t[8]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.temp,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Pe,[t[9]||(t[9]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation Probability"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precipProbability,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Te,[t[10]||(t[10]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation 1h"),e.createElementVNode("span",{class:"unit"},"mm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precip1h,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",He,[t[11]||(t[11]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Visibility"),e.createElementVNode("span",{class:"unit"},"nm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.visibility,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Fe,[t[12]||(t[12]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Relative Humidity"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.humidity,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",We,[t[13]||(t[13]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Re,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Ae,[t[14]||(t[14]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windSpeed,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ge,[t[15]||(t[15]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind gust"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windGust,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])]),t[27]||(t[27]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",Oe,[e.createElementVNode("tr",qe,[t[16]||(t[16]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ue,[t[17]||(t[17]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Je,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Ze,[t[18]||(t[18]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwavePeriod,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ye,[t[19]||(t[19]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ke,[t[20]||(t[20]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Qe,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Xe,[t[21]||(t[21]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellPeriod,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",je,[t[22]||(t[22]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sig wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.sigwaveHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",ve,[t[23]||(t[23]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",$e,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",et,[t[24]||(t[24]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentSpeed,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])]),t[28]||(t[28]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",tt,[e.createElementVNode("tr",st,[t[25]||(t[25]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea level height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaLevel,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",at,[t[26]||(t[26]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea surface temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaTemp,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])])])):a.loading?(e.openBlock(),e.createElementBlock("div",nt,"Loading....")):(V=a.position)!=null&&V.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ot,"No Data"))])])}const ne=me(pe,[["render",it],["__scopeId","data-v-4a0bd795"]]),rt={install(o){o.component("SpotReport",ne)}};f.SpotReport=ne,f.SpotReportPlugin=rt,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- @page{size:1200px;margin:20px auto 40px}.spot-report[data-v-e4818d13]{height:100%;width:1160px;margin:0 auto;padding:0;display:flex;flex-direction:column;color:var(--idm-black-8)}.spot-report .header-box[data-v-e4818d13]{width:100%;padding:10px 0}.spot-report .header-box .search-box .input[data-v-e4818d13]{width:300px}.spot-report .header-box .search-box .info[data-v-e4818d13]{margin:0 10px;color:var(--idm-info-color);font-size:12px}.spot-report .content-box[data-v-e4818d13]{flex:1;width:100%;box-sizing:border-box}.spot-report .content-box .title-box .main-title[data-v-e4818d13]{font-size:16px;font-weight:700}.spot-report .content-box .title-box .sub-title[data-v-e4818d13]{font-size:13px;padding:2px 0}.spot-report .content-box .title-box .icon[data-v-e4818d13]{cursor:pointer;margin-left:10px;font-size:16px}.spot-report .content-box .title-box .icon[data-v-e4818d13]:hover{color:var(--idm-primary-color)}.spot-report .content-box .title-box .icon.active[data-v-e4818d13]{color:var(--idm-warning-color)}.spot-report .content-box #weather-chart[data-v-e4818d13],.spot-report .content-box .weather-chart[data-v-e4818d13]{height:225px;width:100%;font-size:14px;color:#fff;border:1px solid var(--idm-gray-light);border-radius:5px;box-sizing:border-box;background:rgb(104,184,251)}.spot-report .content-box .card-box[data-v-e4818d13]{min-height:500px;margin:5px 0;background:var(--idm-gray-light);border-radius:4px;font-size:14px;color:var(--idm-black-8);line-height:26px}.spot-report .content-box .card-box .date[data-v-e4818d13]{font-weight:700;padding:2px 10px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table[data-v-e4818d13],.spot-report .content-box .card-box .wave-current-table[data-v-e4818d13],.spot-report .content-box .card-box .sea-table[data-v-e4818d13]{width:100%;font-size:12px;padding:5px;border-collapse:collapse;border:1px solid var(--idm-gray-light)}.spot-report .content-box .card-box .basic-table .tr-title[data-v-e4818d13],.spot-report .content-box .card-box .wave-current-table .tr-title[data-v-e4818d13],.spot-report .content-box .card-box .sea-table .tr-title[data-v-e4818d13]{width:200px;padding-right:10px;text-align:right!important;background:none}.spot-report .content-box .card-box .basic-table .tr-title .unit[data-v-e4818d13],.spot-report .content-box .card-box .wave-current-table .tr-title .unit[data-v-e4818d13],.spot-report .content-box .card-box .sea-table .tr-title .unit[data-v-e4818d13]{width:20px;padding:0 5px;text-align:left;display:inline-block;color:var(--idm-info-color)}.spot-report .content-box .card-box .basic-table td[data-v-e4818d13],.spot-report .content-box .card-box .wave-current-table td[data-v-e4818d13],.spot-report .content-box .card-box .sea-table td[data-v-e4818d13]{text-align:center;line-height:20px;width:40px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table td.active[data-v-e4818d13],.spot-report .content-box .card-box .wave-current-table td.active[data-v-e4818d13],.spot-report .content-box .card-box .sea-table td.active[data-v-e4818d13]{color:#fff;background:rgb(71,143,206)}.spot-report .content-box .card-box .basic-table th[data-v-e4818d13],.spot-report .content-box .card-box .wave-current-table th[data-v-e4818d13],.spot-report .content-box .card-box .sea-table th[data-v-e4818d13]{color:var(--idm-info-color);font-weight:400;text-align:center;line-height:20px;width:40px}.spot-report .content-box .card-box .basic-table .weather-icon[data-v-e4818d13],.spot-report .content-box .card-box .wave-current-table .weather-icon[data-v-e4818d13],.spot-report .content-box .card-box .sea-table .weather-icon[data-v-e4818d13]{width:24px;height:24px;cursor:pointer}
1
+ @page{size:1200px;margin:20px auto 40px}.spot-report[data-v-4a0bd795]{height:100%;width:1160px;margin:0 auto;padding:0;display:flex;flex-direction:column;color:var(--idm-black-8)}.spot-report .header-box[data-v-4a0bd795]{width:100%;padding:10px 0}.spot-report .header-box .search-box .input[data-v-4a0bd795]{width:300px}.spot-report .header-box .search-box .info[data-v-4a0bd795]{margin:0 10px;color:var(--idm-info-color);font-size:12px}.spot-report .content-box[data-v-4a0bd795]{flex:1;width:100%;box-sizing:border-box}.spot-report .content-box .title-box .main-title[data-v-4a0bd795]{font-size:16px;font-weight:700}.spot-report .content-box .title-box .sub-title[data-v-4a0bd795]{font-size:13px;padding:2px 0}.spot-report .content-box .title-box .icon[data-v-4a0bd795]{cursor:pointer;margin-left:10px;font-size:16px}.spot-report .content-box .title-box .icon[data-v-4a0bd795]:hover{color:var(--idm-primary-color)}.spot-report .content-box .title-box .icon.active[data-v-4a0bd795]{color:var(--idm-warning-color)}.spot-report .content-box #weather-chart[data-v-4a0bd795],.spot-report .content-box .weather-chart[data-v-4a0bd795]{height:225px;width:100%;font-size:14px;color:#fff;border:1px solid var(--idm-gray-light);border-radius:5px;box-sizing:border-box;background:rgb(104,184,251)}.spot-report .content-box .card-box[data-v-4a0bd795]{min-height:500px;margin:5px 0;background:var(--idm-gray-light);border-radius:4px;font-size:14px;color:var(--idm-black-8);line-height:26px}.spot-report .content-box .card-box .date[data-v-4a0bd795]{font-weight:700;padding:2px 10px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table[data-v-4a0bd795],.spot-report .content-box .card-box .wave-current-table[data-v-4a0bd795],.spot-report .content-box .card-box .sea-table[data-v-4a0bd795]{width:100%;font-size:12px;padding:5px;border-collapse:collapse;border:1px solid var(--idm-gray-light)}.spot-report .content-box .card-box .basic-table .tr-title[data-v-4a0bd795],.spot-report .content-box .card-box .wave-current-table .tr-title[data-v-4a0bd795],.spot-report .content-box .card-box .sea-table .tr-title[data-v-4a0bd795]{width:200px;padding-right:10px;text-align:right!important;background:none}.spot-report .content-box .card-box .basic-table .tr-title .unit[data-v-4a0bd795],.spot-report .content-box .card-box .wave-current-table .tr-title .unit[data-v-4a0bd795],.spot-report .content-box .card-box .sea-table .tr-title .unit[data-v-4a0bd795]{width:20px;padding:0 5px;text-align:left;display:inline-block;color:var(--idm-info-color)}.spot-report .content-box .card-box .basic-table td[data-v-4a0bd795],.spot-report .content-box .card-box .wave-current-table td[data-v-4a0bd795],.spot-report .content-box .card-box .sea-table td[data-v-4a0bd795]{text-align:center;line-height:20px;width:40px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table td.active[data-v-4a0bd795],.spot-report .content-box .card-box .wave-current-table td.active[data-v-4a0bd795],.spot-report .content-box .card-box .sea-table td.active[data-v-4a0bd795]{color:#fff;background:rgb(71,143,206)}.spot-report .content-box .card-box .basic-table th[data-v-4a0bd795],.spot-report .content-box .card-box .wave-current-table th[data-v-4a0bd795],.spot-report .content-box .card-box .sea-table th[data-v-4a0bd795]{color:var(--idm-info-color);font-weight:400;text-align:center;line-height:20px;width:40px}.spot-report .content-box .card-box .basic-table .weather-icon[data-v-4a0bd795],.spot-report .content-box .card-box .wave-current-table .weather-icon[data-v-4a0bd795],.spot-report .content-box .card-box .sea-table .weather-icon[data-v-4a0bd795]{width:24px;height:24px;cursor:pointer}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@idmui/spot",
3
3
  "private": false,
4
- "version": "0.1.2",
4
+ "version": "0.1.3",
5
5
  "description": "idm ui spot",
6
6
  "type": "module",
7
7
  "keywords": [