@idmwx/idmui-gl4 3.8.1 → 3.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { l as b } from "./index-28a4f6f9.js";
1
+ import { l as b } from "./index-a6959b8a.js";
2
2
  function M(e) {
3
3
  return typeof e == "string" && /^data:image\/svg\+xml/i.test(e);
4
4
  }
@@ -1,4 +1,4 @@
1
- import { W as a } from "./chunk-3VYIPD3A-7c3245c9.js";
1
+ import { W as a } from "./chunk-3VYIPD3A-f3c90593.js";
2
2
  async function o(r, t) {
3
3
  let i = await a(r, t), e = new Image();
4
4
  return e.src = i.toDataURL(`image/${t.format}`, t.quality), await e.decode(), e.style.width = `${i.width / t.dpr}px`, e.style.height = `${i.height / t.dpr}px`, e;
@@ -1,4 +1,4 @@
1
- import { W as m } from "./chunk-3VYIPD3A-7c3245c9.js";
1
+ import { W as m } from "./chunk-3VYIPD3A-f3c90593.js";
2
2
  async function a(n, e) {
3
3
  let o = e.type;
4
4
  if (o === "svg") {
@@ -1,6 +1,6 @@
1
- import { m as d } from "./chunk-T4JIPPZO-4cdcfb4a.js";
2
- import { W as f } from "./chunk-3VYIPD3A-7c3245c9.js";
3
- import "./index-28a4f6f9.js";
1
+ import { m as d } from "./chunk-T4JIPPZO-25c7d9fb.js";
2
+ import { W as f } from "./chunk-3VYIPD3A-f3c90593.js";
3
+ import "./index-a6959b8a.js";
4
4
  import "axios";
5
5
  import "vuetify";
6
6
  import "vue";
@@ -5993,6 +5993,12 @@ const qc = /* @__PURE__ */ ne(Kc, [["render", Qc]]), $c = {
5993
5993
  },
5994
5994
  theme: {
5995
5995
  type: String
5996
+ },
5997
+ hasRampLayer: {
5998
+ type: Boolean
5999
+ },
6000
+ nautical: {
6001
+ type: String
5996
6002
  }
5997
6003
  },
5998
6004
  data() {
@@ -6004,6 +6010,11 @@ const qc = /* @__PURE__ */ ne(Kc, [["render", Qc]]), $c = {
6004
6010
  empty: W.featureCollection([])
6005
6011
  };
6006
6012
  },
6013
+ computed: {
6014
+ opacity() {
6015
+ return (this.theme === "light" || this.nautical === "hi" || this.nautical === "i4") && !this.hasRampLayer ? 1 : 0.3;
6016
+ }
6017
+ },
6007
6018
  watch: {
6008
6019
  "prmsl.version": {
6009
6020
  handler() {
@@ -6011,6 +6022,12 @@ const qc = /* @__PURE__ */ ne(Kc, [["render", Qc]]), $c = {
6011
6022
  (t = this.prmsl) != null && t.active ? this.handleRender() : this.handleClear();
6012
6023
  },
6013
6024
  immediate: !0
6025
+ },
6026
+ opacity: {
6027
+ handler() {
6028
+ var t;
6029
+ (t = this.prmsl) != null && t.active && (this.handleClear(), this.handleRender());
6030
+ }
6014
6031
  }
6015
6032
  },
6016
6033
  methods: {
@@ -6038,7 +6055,7 @@ const qc = /* @__PURE__ */ ne(Kc, [["render", Qc]]), $c = {
6038
6055
  "rgba(199,171,250,1)"
6039
6056
  ],
6040
6057
  "line-width": 1,
6041
- "line-opacity": this.theme === "light" ? 1 : 0.3
6058
+ "line-opacity": this.opacity
6042
6059
  }
6043
6060
  },
6044
6061
  this.beforeLayer
@@ -17777,52 +17794,52 @@ Te.capture = async (t, e, a) => {
17777
17794
  if (a !== tl)
17778
17795
  throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");
17779
17796
  let i = await el(t, e), o = { img: async (u, h) => {
17780
- let { toImg: y } = await import("./toImg-d29e4678.js");
17797
+ let { toImg: y } = await import("./toImg-351e9073.js");
17781
17798
  return y(i, { ...u, ...h || {} });
17782
17799
  }, svg: async (u, h) => {
17783
- let { toSvg: y } = await import("./toImg-d29e4678.js");
17800
+ let { toSvg: y } = await import("./toImg-351e9073.js");
17784
17801
  return y(i, { ...u, ...h || {} });
17785
17802
  }, canvas: async (u, h) => {
17786
- let { toCanvas: y } = await import("./toCanvas-5845fed6.js");
17803
+ let { toCanvas: y } = await import("./toCanvas-944333ee.js");
17787
17804
  return y(i, { ...u, ...h || {} });
17788
17805
  }, blob: async (u, h) => {
17789
- let { toBlob: y } = await import("./toBlob-09130b9b.js");
17806
+ let { toBlob: y } = await import("./toBlob-15aac33f.js");
17790
17807
  return y(i, { ...u, ...h || {} });
17791
17808
  }, png: async (u, h) => {
17792
- let { rasterize: y } = await import("./rasterize-JS5G2XHH-c48564a9.js");
17809
+ let { rasterize: y } = await import("./rasterize-JS5G2XHH-90e5dfc4.js");
17793
17810
  return y(i, { ...u, ...h || {}, format: "png" });
17794
17811
  }, jpeg: async (u, h) => {
17795
- let { rasterize: y } = await import("./rasterize-JS5G2XHH-c48564a9.js");
17812
+ let { rasterize: y } = await import("./rasterize-JS5G2XHH-90e5dfc4.js");
17796
17813
  return y(i, { ...u, ...h || {}, format: "jpeg" });
17797
17814
  }, webp: async (u, h) => {
17798
- let { rasterize: y } = await import("./rasterize-JS5G2XHH-c48564a9.js");
17815
+ let { rasterize: y } = await import("./rasterize-JS5G2XHH-90e5dfc4.js");
17799
17816
  return y(i, { ...u, ...h || {}, format: "webp" });
17800
17817
  }, download: async (u, h) => {
17801
- let { download: y } = await import("./download-87732143.js");
17818
+ let { download: y } = await import("./download-a8d2dc8d.js");
17802
17819
  return y(i, { ...u, ...h || {} });
17803
17820
  } }, r = { ...e, export: { url: i }, exports: { svg: async (u) => {
17804
- let { toSvg: h } = await import("./toImg-d29e4678.js");
17821
+ let { toSvg: h } = await import("./toImg-351e9073.js");
17805
17822
  return h(i, { ...e, ...u || {}, [da]: !0 });
17806
17823
  }, canvas: async (u) => {
17807
- let { toCanvas: h } = await import("./toCanvas-5845fed6.js");
17824
+ let { toCanvas: h } = await import("./toCanvas-944333ee.js");
17808
17825
  return h(i, { ...e, ...u || {}, [da]: !0 });
17809
17826
  }, png: async (u) => {
17810
- let { rasterize: h } = await import("./rasterize-JS5G2XHH-c48564a9.js");
17827
+ let { rasterize: h } = await import("./rasterize-JS5G2XHH-90e5dfc4.js");
17811
17828
  return h(i, { ...e, ...u || {}, format: "png", [da]: !0 });
17812
17829
  }, jpeg: async (u) => {
17813
- let { rasterize: h } = await import("./rasterize-JS5G2XHH-c48564a9.js");
17830
+ let { rasterize: h } = await import("./rasterize-JS5G2XHH-90e5dfc4.js");
17814
17831
  return h(i, { ...e, ...u || {}, format: "jpeg", [da]: !0 });
17815
17832
  }, jpg: async (u) => {
17816
- let { rasterize: h } = await import("./rasterize-JS5G2XHH-c48564a9.js");
17833
+ let { rasterize: h } = await import("./rasterize-JS5G2XHH-90e5dfc4.js");
17817
17834
  return h(i, { ...e, ...u || {}, format: "jpeg", [da]: !0 });
17818
17835
  }, webp: async (u) => {
17819
- let { rasterize: h } = await import("./rasterize-JS5G2XHH-c48564a9.js");
17836
+ let { rasterize: h } = await import("./rasterize-JS5G2XHH-90e5dfc4.js");
17820
17837
  return h(i, { ...e, ...u || {}, format: "webp", [da]: !0 });
17821
17838
  }, blob: async (u) => {
17822
- let { toBlob: h } = await import("./toBlob-09130b9b.js");
17839
+ let { toBlob: h } = await import("./toBlob-15aac33f.js");
17823
17840
  return h(i, { ...e, ...u || {}, [da]: !0 });
17824
17841
  }, img: async (u) => {
17825
- let { toImg: h } = await import("./toImg-d29e4678.js");
17842
+ let { toImg: h } = await import("./toImg-351e9073.js");
17826
17843
  return h(i, { ...e, ...u || {}, [da]: !0 });
17827
17844
  } } }, l = await qf("defineExports", r), s = Object.assign({}, ...l.filter((u) => u && typeof u == "object")), c = { ...o, ...s };
17828
17845
  c.jpeg && !c.jpg && (c.jpg = (u, h) => c.jpeg(u, h));
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { B as g, c as n, D as x, L as D, a as T, b as W, M as h, f, e as k, P as y, S as B, T as V, V as d, W as u, d as v } from "./index-28a4f6f9.js";
1
+ import { B as g, c as n, D as x, L as D, a as T, b as W, M as h, f, e as k, P as y, S as B, T as V, V as d, W as u, d as v } from "./index-a6959b8a.js";
2
2
  import "axios";
3
3
  import "vuetify";
4
4
  import "vue";
@@ -401,7 +401,7 @@ ${a==="fragment"?`out vec4 fragColor;
401
401
  }`);let so=Me;const fc={"000kts":'<svg t="1756203850656" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4213" width="200" height="200"><path d="M729.6 512a217.6 217.6 0 1 0-217.6 217.6v59.733333a277.333333 277.333333 0 1 1 0-554.666666 277.333333 277.333333 0 0 1 0 554.666666v-59.733333a217.6 217.6 0 0 0 217.6-217.6z" fill="#ffffff" p-id="4214"></path><path d="M558.933333 512a46.933333 46.933333 0 1 0-46.933333 46.933333v59.733334a106.666667 106.666667 0 1 1 0-213.333334 106.666667 106.666667 0 0 1 0 213.333334v-59.733334a46.933333 46.933333 0 0 0 46.933333-46.933333z" fill="#ffffff" p-id="4215"></path></svg>',"002kts":'<svg t="1756203870666" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4371" width="200" height="200"><path d="M511.975255 4.26646a29.865223 29.865223 0 0 1 29.865223 29.865224v897.791273l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684a29.865223 29.865223 0 0 1 29.865224-29.865224z" fill="#ffffff" p-id="4372"></path></svg>',"005kts":'<svg t="1756203883896" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4528" width="200" height="200"><path d="M511.825979 4.265216a29.856515 29.856515 0 0 1 29.856516 29.856516v102.706413l145.443882-97.673458a29.856515 29.856515 0 0 1 33.268689 49.604468l-174.873877 117.378758c-1.194261 0.853043-2.55913 1.364869-3.838694 2.004652v723.508674l58.1349-46.49086a29.899168 29.899168 0 0 1 37.277993 46.70412l-106.630413 85.30433a29.856515 29.856515 0 0 1-37.277992 0l-106.630412-85.30433a29.856515 29.856515 0 0 1 37.277992-46.661468l58.134901 46.448208V34.121732a29.856515 29.856515 0 0 1 29.856515-29.856516z" fill="#ffffff" p-id="4529"></path></svg>',"010kts":'<svg t="1756203893742" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4685" width="200" height="200"><path d="M687.93386 4.887188a29.854538 29.854538 0 1 1 31.560512 50.667416L541.646623 166.186993v765.768907l58.131051-46.445132a29.854538 29.854538 0 0 1 37.275523 46.658378l-106.623351 85.298681a29.854538 29.854538 0 0 1-37.275523 0l-106.623351-85.298681a29.854538 29.854538 0 0 1 37.275523-46.658378l58.131051 46.487781V153.903983c0-0.767688 0.127948-1.535376 0.213247-2.345714a29.72659 29.72659 0 0 1 13.861036-27.295577l191.922031-119.375504z" fill="#ffffff" p-id="4686"></path></svg>',"015kts":'<svg t="1756203906240" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4842" width="200" height="200"><path d="M687.93386 4.887188a29.854538 29.854538 0 1 1 31.560512 50.667416L541.646623 166.186993v76.683514l73.783359-46.018638a29.854538 29.854538 0 1 1 31.560511 50.582118L541.646623 313.327217v618.628683l58.131051-46.445132a29.854538 29.854538 0 0 1 37.275523 46.658378l-106.623351 85.298681a29.854538 29.854538 0 0 1-37.275523 0l-106.623351-85.298681a29.854538 29.854538 0 0 1 37.275523-46.658378l58.131051 46.487781V153.903983c0-0.767688 0.127948-1.535376 0.213247-2.345714a29.72659 29.72659 0 0 1 13.861036-27.295577l191.922031-119.375504z" fill="#ffffff" p-id="4843"></path></svg>',"020kts":'<svg t="1756203915478" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4999" width="200" height="200"><path d="M687.93386 4.887188a29.854538 29.854538 0 1 1 31.560512 50.667416L541.646623 166.186993V240.908638l146.287237-91.013693a29.854538 29.854538 0 1 1 31.560512 50.667417L541.646623 311.2374v620.7185l58.131051-46.445132a29.854538 29.854538 0 0 1 37.275523 46.658378l-106.623351 85.298681a29.854538 29.854538 0 0 1-37.275523 0l-106.623351-85.298681a29.854538 29.854538 0 0 1 37.275523-46.658378l58.131051 46.487781V153.903983c0-0.767688 0.127948-1.535376 0.213247-2.345714a29.72659 29.72659 0 0 1 13.861036-27.295577l191.922031-119.375504z" fill="#ffffff" p-id="5000"></path></svg>',"025kts":'<svg t="1756203931490" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5156" width="200" height="200"><path d="M687.910653 4.887023a29.853531 29.853531 0 1 1 31.559447 50.665707L541.62835 166.181387V240.90051l146.282303-91.010622a29.853531 29.853531 0 1 1 31.559447 50.665708L541.62835 311.2269v76.638279l73.738222-46.059733a29.853531 29.853531 0 0 1 31.644743 50.665707l-105.340317 65.84836v473.604947l58.043794-46.443565a29.853531 29.853531 0 0 1 37.359562 46.656804l-106.619754 85.295804a29.853531 29.853531 0 0 1-37.359562 0l-106.619754-85.295804a29.853531 29.853531 0 0 1 37.359562-46.656804l58.086442 46.486213V153.898791c0-0.767662 0.127944-1.535324 0.213239-2.345634a29.725587 29.725587 0 0 1 13.860568-27.294657l191.915558-119.371477z" fill="#ffffff" p-id="5157"></path></svg>',"030kts":'<svg t="1756203940193" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5313" width="200" height="200"><path d="M687.93386 4.887188a29.854538 29.854538 0 1 1 31.560512 50.667416L541.646623 166.186993V240.908638l146.287237-91.013693a29.854538 29.854538 0 1 1 31.560512 50.667417L541.646623 311.2374v74.636345l146.287237-90.971043a29.854538 29.854538 0 1 1 31.560512 50.667417l-177.847749 110.632389v475.753392l58.131051-46.445132a29.854538 29.854538 0 0 1 37.275523 46.658378l-106.623351 85.298681a29.854538 29.854538 0 0 1-37.275523 0l-106.623351-85.298681a29.854538 29.854538 0 0 1 37.275523-46.658378l58.131051 46.487781V153.903983c0-0.767688 0.127948-1.535376 0.213247-2.345714a29.72659 29.72659 0 0 1 13.861036-27.295577l191.922031-119.375504z" fill="#ffffff" p-id="5314"></path></svg>',"035kts":'<svg t="1756203952289" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5470" width="200" height="200"><path d="M687.910653 4.887023a29.853531 29.853531 0 1 1 31.559447 50.665707L541.62835 166.181387V240.90051l146.282303-91.010622a29.853531 29.853531 0 1 1 31.559447 50.665708L541.62835 311.2269v74.633828l146.282303-90.967974a29.853531 29.853531 0 1 1 31.559447 50.665707l-177.84175 110.628657v76.680927l73.738222-46.059734a29.853531 29.853531 0 0 1 31.644743 50.623059l-105.340317 65.891008v328.602082l58.043794-46.443565a29.853531 29.853531 0 0 1 37.359562 46.656804l-106.619754 85.295804a29.853531 29.853531 0 0 1-37.359562 0l-106.619754-85.295804a29.853531 29.853531 0 0 1 37.359562-46.656804l58.086442 46.486213V153.898791c0-0.767662 0.127944-1.535324 0.213239-2.345634a29.725587 29.725587 0 0 1 13.860568-27.294657l191.915558-119.371477z" fill="#ffffff" p-id="5471"></path></svg>',"040kts":'<svg t="1756203961957" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5627" width="200" height="200"><path d="M687.93386 4.887188a29.854538 29.854538 0 1 1 31.560512 50.667416L541.646623 166.186993V240.908638l146.287237-91.013693a29.854538 29.854538 0 1 1 31.560512 50.667417L541.646623 311.2374v74.636345l146.287237-90.971043a29.854538 29.854538 0 1 1 31.560512 50.667417l-177.847749 110.632389v74.721644l146.287237-91.013692a29.854538 29.854538 0 1 1 31.560512 50.667416l-177.847749 110.632389v330.745635l58.131051-46.445132a29.854538 29.854538 0 0 1 37.275523 46.658378l-106.623351 85.298681a29.854538 29.854538 0 0 1-37.275523 0l-106.623351-85.298681a29.854538 29.854538 0 0 1 37.275523-46.658378l58.131051 46.487781V153.903983c0-0.767688 0.127948-1.535376 0.213247-2.345714a29.72659 29.72659 0 0 1 13.861036-27.295577l191.922031-119.375504z" fill="#ffffff" p-id="5628"></path></svg>',"045kts":'<svg t="1756203969362" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5784" width="200" height="200"><path d="M687.910653 4.887023a29.853531 29.853531 0 1 1 31.559447 50.665707L541.62835 166.181387V240.90051l146.282303-91.010622a29.853531 29.853531 0 1 1 31.559447 50.665708L541.62835 311.2269v74.633828l146.282303-90.967974a29.853531 29.853531 0 1 1 31.559447 50.665707l-177.84175 110.628657v74.719123l146.282303-91.010622a29.853531 29.853531 0 1 1 31.559447 50.665707l-177.84175 110.628657v76.680927l73.738222-46.059734a29.853531 29.853531 0 0 1 31.644743 50.665708l-105.340317 65.84836v183.599216l58.043794-46.443565a29.853531 29.853531 0 0 1 37.359562 46.656804l-106.619754 85.295804a29.853531 29.853531 0 0 1-37.359562 0l-106.619754-85.295804a29.853531 29.853531 0 0 1 37.359562-46.656804l58.086442 46.486213V153.898791c0-0.767662 0.127944-1.535324 0.213239-2.345634a29.725587 29.725587 0 0 1 13.860568-27.294657l191.915558-119.371477z" fill="#ffffff" p-id="5785"></path></svg>',"050kts":'<svg t="1756203979191" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5941" width="200" height="200"><path d="M699.699515 0a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238732l-170.658418 106.74684c-0.938621 0.597304-1.962572 0.981286-2.986522 1.450597v766.384291l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684c0-0.725298 0.127994-1.407932 0.213323-2.133231C482.238025 31.273155 482.110031 30.590521 482.110031 29.865223A29.865223 29.865223 0 0 1 511.975255 0h187.72426z" fill="#ffffff" p-id="5942"></path></svg>',"055kts":'<svg t="1756203990154" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6098" width="200" height="200"><path d="M699.676193 0a29.864228 29.864228 0 0 1 29.864228 29.864228c0 0.426632-0.170653 0.853264-0.170653 1.237232a29.736238 29.736238 0 0 1-13.908197 26.237857l-170.65273 106.743283c-0.93859 0.597285-1.962506 0.981253-2.986423 1.450548v77.092371l73.764642-46.076237a29.864228 29.864228 0 0 1 31.656082 50.641197L541.822418 313.062433v618.829462l58.064591-46.502868a29.906891 29.906891 0 0 1 37.372948 46.716184l-106.657956 85.326365a29.864228 29.864228 0 0 1-37.372948 0l-106.657956-85.326365a29.864228 29.864228 0 0 1 37.372948-46.673521l58.107254 46.460205V34.130546c0-0.725274 0.12799-1.407885 0.213316-2.133159C482.221952 31.272113 482.093962 30.589502 482.093962 29.864228A29.864228 29.864228 0 0 1 511.95819 0h187.718003z" fill="#ffffff" p-id="6099"></path></svg>',"060kts":'<svg t="1756203999756" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6255" width="200" height="200"><path d="M699.699515 0a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238732l-170.658418 106.74684c-0.938621 0.597304-1.962572 0.981286-2.986522 1.450597v75.089704l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555L541.840478 310.939638v620.983319l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684c0-0.725298 0.127994-1.407932 0.213323-2.133231C482.238025 31.273155 482.110031 30.590521 482.110031 29.865223A29.865223 29.865223 0 0 1 511.975255 0h187.72426z" fill="#ffffff" p-id="6256"></path></svg>',"065kts":'<svg t="1756204005834" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6412" width="200" height="200"><path d="M699.676193 0a29.864228 29.864228 0 0 1 29.864228 29.864228c0 0.426632-0.170653 0.853264-0.170653 1.237232a29.736238 29.736238 0 0 1-13.908197 26.237857l-170.65273 106.743283c-0.93859 0.597285-1.962506 0.981253-2.986423 1.450548v75.087201l146.334716-91.043231a29.864228 29.864228 0 1 1 31.570755 50.683861L541.822418 310.929274v76.708402l73.764642-46.076237a29.864228 29.864228 0 0 1 31.656082 50.641198l-105.378061 65.914617v473.774641l58.064591-46.502868a29.906891 29.906891 0 0 1 37.372948 46.716184l-106.657956 85.326365a29.864228 29.864228 0 0 1-37.372948 0l-106.657956-85.326365a29.864228 29.864228 0 0 1 37.372948-46.673521l58.107254 46.460205V34.130546c0-0.725274 0.12799-1.407885 0.213316-2.133159C482.221952 31.272113 482.093962 30.589502 482.093962 29.864228A29.864228 29.864228 0 0 1 511.95819 0h187.718003z" fill="#ffffff" p-id="6413"></path></svg>',"070kts":'<svg t="1756204018577" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6569" width="200" height="200"><path d="M699.699515 0a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238732l-170.658418 106.74684c-0.938621 0.597304-1.962572 0.981286-2.986522 1.450597v75.089704l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555L541.840478 310.939638V385.688025l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555l-177.911401 110.714649v475.880999l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684c0-0.725298 0.127994-1.407932 0.213323-2.133231C482.238025 31.273155 482.110031 30.590521 482.110031 29.865223A29.865223 29.865223 0 0 1 511.975255 0h187.72426z" fill="#ffffff" p-id="6570"></path></svg>',"075kts":'<svg t="1756204027005" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6726" width="200" height="200"><path d="M699.676193 0a29.864228 29.864228 0 0 1 29.864228 29.864228c0 0.426632-0.170653 0.853264-0.170653 1.237232a29.736238 29.736238 0 0 1-13.908197 26.237857l-170.65273 106.743283c-0.93859 0.597285-1.962506 0.981253-2.986423 1.450548v75.087201l146.334716-91.043231a29.864228 29.864228 0 1 1 31.570755 50.683861L541.822418 310.929274V385.67517l146.334716-91.043232a29.864228 29.864228 0 1 1 31.570755 50.683861l-177.905471 110.710959v76.665739l73.764642-46.076237a29.864228 29.864228 0 0 1 31.656082 50.68386l-105.378061 65.871954v328.719821l58.064591-46.502868a29.906891 29.906891 0 0 1 37.372948 46.716184l-106.657956 85.326365a29.864228 29.864228 0 0 1-37.372948 0l-106.657956-85.326365a29.864228 29.864228 0 0 1 37.372948-46.673521l58.107254 46.460205V34.130546c0-0.725274 0.12799-1.407885 0.213316-2.133159C482.221952 31.272113 482.093962 30.589502 482.093962 29.864228A29.864228 29.864228 0 0 1 511.95819 0h187.718003z" fill="#ffffff" p-id="6727"></path></svg>',"080kts":'<svg t="1756204045675" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6883" width="200" height="200"><path d="M699.699515 0a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238732l-170.658418 106.74684c-0.938621 0.597304-1.962572 0.981286-2.986522 1.450597v75.089704l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555L541.840478 310.939638V385.688025l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555l-177.911401 110.714649v74.663058l146.339593-91.003602a29.865223 29.865223 0 0 1 31.571808 50.685551l-177.911401 110.671984v330.864008l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684c0-0.725298 0.127994-1.407932 0.213323-2.133231C482.238025 31.273155 482.110031 30.590521 482.110031 29.865223A29.865223 29.865223 0 0 1 511.975255 0h187.72426z" fill="#ffffff" p-id="6884"></path></svg>',"085kts":'<svg t="1756204058904" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7040" width="200" height="200"><path d="M699.676193 0a29.864228 29.864228 0 0 1 29.864228 29.864228c0 0.426632-0.170653 0.853264-0.170653 1.237232a29.736238 29.736238 0 0 1-13.908197 26.237857l-170.65273 106.743283c-0.93859 0.597285-1.962506 0.981253-2.986423 1.450548v58.021928l146.334716-91.043231a29.864228 29.864228 0 1 1 31.570755 50.683861L541.822418 293.906664V351.544624l146.334716-91.043232a29.864228 29.864228 0 1 1 31.570755 50.683861L541.822418 421.896212v57.637959l146.334716-91.043231a29.864228 29.864228 0 1 1 31.570755 50.683861l-177.905471 110.710958v55.376811l73.764642-46.076237a29.864228 29.864228 0 0 1 31.656082 50.641198l-105.378061 65.871954v256.19241l58.064591-46.502868a29.906891 29.906891 0 0 1 37.372948 46.716184l-106.657956 85.326365a29.864228 29.864228 0 0 1-37.372948 0l-106.657956-85.326365a29.864228 29.864228 0 0 1 37.372948-46.673521l58.107254 46.460205V34.130546c0-0.725274 0.12799-1.407885 0.213316-2.133159C482.221952 31.272113 482.093962 30.589502 482.093962 29.864228A29.864228 29.864228 0 0 1 511.95819 0h187.718003z" fill="#ffffff" p-id="7041"></path></svg>',"090kts":'<svg t="1756204072839" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7197" width="200" height="200"><path d="M699.699515 0a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238732l-170.658418 106.74684c-0.938621 0.597304-1.962572 0.981286-2.986522 1.450597v58.023862l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555L541.840478 293.916461V351.556341l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.685551L541.840478 421.910274v57.639881l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555l-177.911401 110.714649v57.639881l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555l-177.911401 110.714649v254.025055l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684c0-0.725298 0.127994-1.407932 0.213323-2.133231C482.238025 31.273155 482.110031 30.590521 482.110031 29.865223A29.865223 29.865223 0 0 1 511.975255 0h187.72426z" fill="#ffffff" p-id="7198"></path></svg>',"095kts":'<svg t="1756204086889" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7354" width="200" height="200"><path d="M699.676193 0a29.864228 29.864228 0 0 1 29.864228 29.864228c0 0.426632-0.170653 0.853264-0.170653 1.237232a29.736238 29.736238 0 0 1-13.908197 26.237857l-170.65273 106.743283c-0.93859 0.597285-1.962506 0.981253-2.986423 1.450548v45.222974l146.334716-91.043232a29.864228 29.864228 0 0 1 31.570755 50.683861L541.822418 281.150373V330.213033l146.334716-91.043232a29.864228 29.864228 0 1 1 31.570755 50.683861L541.822418 400.564621v49.105323l146.334716-91.043232a29.864228 29.864228 0 1 1 31.570755 50.683861l-177.905471 110.710959v49.062659l146.334716-91.000568a29.864228 29.864228 0 1 1 31.570755 50.683861l-177.905471 110.668295v42.577857l73.764642-46.076238a29.864228 29.864228 0 0 1 31.656082 50.683861l-105.378061 65.871954v179.398682l58.064591-46.502868a29.906891 29.906891 0 0 1 37.372948 46.716184l-106.657956 85.326365a29.864228 29.864228 0 0 1-37.372948 0l-106.657956-85.326365a29.864228 29.864228 0 0 1 37.372948-46.673521l58.107254 46.460205V34.130546c0-0.725274 0.12799-1.407885 0.213316-2.133159C482.221952 31.272113 482.093962 30.589502 482.093962 29.864228A29.864228 29.864228 0 0 1 511.95819 0h187.718003z" fill="#ffffff" p-id="7355"></path></svg>',"100kts":'<svg t="1756204093086" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7511" width="200" height="200"><path d="M699.699515 0a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238732L568.420526 149.326116H699.699515a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238731l-170.573089 106.746841c-0.981286 0.597304-2.047901 0.981286-3.071851 1.450597v617.058175l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684c0-0.725298 0.127994-1.407932 0.213323-2.133231C482.238025 31.273155 482.110031 30.590521 482.110031 29.865223A29.865223 29.865223 0 0 1 511.975255 0h187.72426z" fill="#ffffff" p-id="7512"></path></svg>',"105kts":'<svg t="1756204103259" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7668" width="200" height="200"><path d="M699.699515 0a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238732L568.420526 149.326116H699.699515a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238731l-170.658418 106.746841c-0.938621 0.597304-1.962572 0.981286-2.986522 1.450597v79.356164l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555l-177.911401 110.714649v467.348078l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684c0-0.725298 0.127994-1.407932 0.213323-2.133231C482.238025 31.273155 482.110031 30.590521 482.110031 29.865223A29.865223 29.865223 0 0 1 511.975255 0h187.72426z" fill="#ffffff" p-id="7669"></path></svg>'},yc={name:"IdmWindBarb",props:{map:{type:Object},wind:{type:Object},beforeLayer:{type:String},theme:{type:String},mapFeather:{type:String},hasRampLayer:{type:Boolean},nautical:{type:String}},emits:[],data(){return{source:"wind-barb-source",barbs:[0,2,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105],empty:V.featureCollection([]),windBarbLoaded:!1,svgs:fc}},computed:{opacity(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?.6:.7},color(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?"#000623":"#ffffff"}},watch:{"wind.version":{handler(){var t;(t=this.wind)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},color:{handler(){var t;(t=this.wind)!=null&&t.active&&(this.handleClear(),this.handleRender())}}},methods:{handleRender(){var t,e,a;if(this.map&&this.wind){const r=new Date().valueOf();let i=0;const l=this.wind.active?this.wind.data:this.empty;if((t=this.map)!=null&&t.getSource(this.source))(e=this.map)==null||e.getSource(this.source).setData(l),new Date().valueOf()-(r+i);else{this.map.addSource(this.source,{type:"geojson",data:l});for(let n=0;n<(this.barbs??[]).length-1;n++){const s=(this.barbs??[])[n]||0,c=(this.barbs??[])[n+1]||0,m=s<10?`00${s}kts`:s<100?`0${s}kts`:`${s}kts`,d=new Image(48,48),u=(a=this.svgs[m].replace(/fill="#ffffff"/g,`fill="${this.color}"`))==null?void 0:a.replace(/fill="#000623"/g,`fill="${this.color}"`);d.src="data:image/svg+xml;base64,"+window.btoa(u),d.onload=()=>{this.map.hasImage(m+"-icon")?this.map.updateImage(m+"-icon",d):this.map.addImage(m+"-icon",d),this.map.getLayer(m)||this.map.addLayer({id:m,type:"symbol",filter:["all",[">=","spd",s],["<","spd",c]],source:this.source,layout:{"symbol-placement":"point","icon-image":m+"-icon","icon-size":.5,"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"dir",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)}}this.windBarbLoaded=!0,new Date().valueOf()-(r+i)}}},handleClear(){for(const t of this.barbs??[]){const e=t<10?`00${t}kts`:t<100?`0${t}kts`:`${t}kts`;this.map.getLayer(e)&&this.map.removeLayer(e),this.map.hasImage(e+"-icon")&&this.map.removeImage(e+"-icon")}this.map.getSource(this.source)&&this.map.removeSource(this.source),this.windBarbLoaded=!1}}};function bc(t,e,a,r,i,l){return null}const wc=K(yc,[["render",bc]]),ab="",xc={name:"IdmWindParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:to},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?3e3:9e3,particleOptions:{fadeOpacity:.95,speedFactor:this.simple?.1:.2,dropRate:.003,dropRateBump:.01,uvRange:[-25,26],sRange:[0,31.985]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){t!==e&&e!==void 0&&(t?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},beforeUnmount(){this.handleClear()},methods:{async handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;await this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[wind-particle] add elapsed: ",a,", total: ",e+=a)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const e=[[0,"rgb(98, 113, 184, 0.8)"],[12/255,"rgb(98, 113, 184)"],[24/255,"rgb(61, 110, 163)"],[32/255,"rgb(74, 146, 148)"],[40/255,"rgb(77, 142, 124)"],[60/255,"rgb(76, 164, 76)"],[80/255,"rgb(103, 164, 54)"],[100/255,"rgb(162, 135, 64)"],[120/255,"rgb(162, 109, 92)"],[140/255,"rgb(141, 63, 92)"],[160/255,"rgb(151, 75, 145)"],[200/255,"rgb(95, 100, 160)"],[240/255,"rgb(91, 136, 161)"],[1,"rgb(91, 136, 161)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,fe.uvFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...at.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){var a;if(this.handleSetup(),!this.context)return;const t=this.context,e=this.factor.etime;if(this.etime!==e||this.particleContext&&!this.particleTexture){const r=await this.webgl.loadImg(this.factor.raw);if(this.context!==t||!((a=this.factor)!=null&&a.active)||this.factor.etime!==e)return;this.etime=e,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,r),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,r),this.wrapper.image=r)}this.initial&&this.particleTexture&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){!this.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,(t=this.viewport)==null||t.toggleParticle(!1)},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(()=>{var a,r;this.animation=void 0,!(this.paused||!((a=this.factor)!=null&&a.active)||!((r=this.factor)!=null&&r.particle)||!this.particleContext||!this.wrapper)&&(this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay())}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.map)==null||a.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay)},handleClear(){var t;(t=this.viewport)==null||t.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},kc={key:0};function Ac(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",kc,[o.createElementVNode("div",{class:"legend-bars-gl4 wind",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"kts",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"5",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1),o.createElementVNode("span",null,"40",-1),o.createElementVNode("span",null,"60",-1)]),4)])):o.createCommentVNode("",!0)}const Lc=K(xc,[["render",Ac]]),vc={name:"IdmCurrent",props:{map:{type:Object},current:{type:Object},beforeLayer:{type:String},theme:{type:String},mapFeather:{type:String},hasRampLayer:{type:Boolean},nautical:{type:String}},emits:[],data(){return{source:"current-source",directionLayer:"current-direction-layer",speedLayer:"current-speed-layer",speedLabelLayer:"current-speed-label-layer",empty:V.featureCollection([])}},computed:{opacity(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?.6:.7},color(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?"#000623":"#ffffff"}},watch:{"current.version":{handler(){var t;(t=this.current)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},color:{handler(){var t;(t=this.current)!=null&&t.active&&(this.handleClear(),this.handleRender())}}},methods:{handleRender(){var t,e;if(this.map&&this.current){const a=new Date().valueOf();let r=0,i=0;const l=this.current.active?this.current.data:this.empty;if((t=this.map)!=null&&t.getSource(this.source))(e=this.map)==null||e.getSource(this.source).setData(l),i=new Date().valueOf()-(a+r),console.log("[current] update elapsed: ",i,", total: ",r+=i);else{this.map.addSource(this.source,{type:"geojson",data:l}),this.map.addLayer({id:this.speedLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["step",["get","val"],"rgb(58, 164, 58)",1,"#ffff00",2,"#ff9500",3,"#f44336"]}},this.beforeLayer),this.map.addLayer({id:this.speedLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Polygon"],layout:{"symbol-placement":"line","text-field":"{val} kts","text-allow-overlap":!0,"text-rotation-alignment":"viewport","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 0.8)"}},this.beforeLayer);const n=new Image(48,48),s=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
402
402
  <path d="M10 2.5V17.5" stroke="${this.color}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
403
403
  <path d="M5 7.5L10 2.5L15 7.5" stroke="${this.color}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
404
- </svg>`;n.src="data:image/svg+xml;base64,"+window.btoa(s);const c=[n];let m=0;c.forEach(d=>{d.onload=()=>{m++,this.map.hasImage("currentDirIcon")?this.map.updateImage("currentDirIcon",n):this.map.addImage("currentDirIcon",n),m===1&&!this.map.getLayer(this.directionLayer)&&this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"currentDirIcon","icon-size":["interpolate",["linear"],["get","spd"],.5,.3,1,.5,1.5,.7,2,.8,3.5,1],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)}}),i=new Date().valueOf()-(a+r)}}},handleClear(){this.map.getLayer(this.speedLayer)&&this.map.removeLayer(this.speedLayer),this.map.getLayer(this.speedLabelLayer)&&this.map.removeLayer(this.speedLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.hasImage("currentDirIcon")&&this.map.removeImage("currentDirIcon"),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Cc(t,e,a,r,i,l){return null}const zc=K(vc,[["render",Cc]]),ib="",_c={name:"IdmCurrentParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:to},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?6e3:13e3,particleOptions:{fadeOpacity:.99,speedFactor:this.simple?1.2:2,dropRate:.005,dropRateBump:.01,uvRange:[-2.5,2.6],sRange:[0,3],scale:.3},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){t!==e&&e!==void 0&&(t?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},beforeUnmount(){this.handleClear()},methods:{async handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;await this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[current-particle] add elapsed: ",a,", total: ",e+=a)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const e=[[0/255,"rgba(95, 143, 197,1)"],[5/255,"rgba(64,127,115,1)"],[10/255,"rgb(58,164,58)"],[15/255,"rgb(191,182,67)"],[20/255,"rgb(197,154,68)"],[30/255,"rgb(160,70,94)"],[40/255,"rgb(138,84,166)"],[45/255,"rgb(82,113,165)"],[50/255,"rgb(84,142,152)"],[65/255,"rgb(150,181,184)"],[80/255,"rgb(195,194,194)"],[254/255,"rgb(195,194,194)"],[1,"rgb(195,194,194)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,fe.uvFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"],[.6,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...at.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){var a;if(this.handleSetup(),!this.context)return;const t=this.context,e=this.factor.etime;if(this.etime!==e||this.particleContext&&!this.particleTexture){const r=await this.webgl.loadImg(this.factor.raw);if(this.context!==t||!((a=this.factor)!=null&&a.active)||this.factor.etime!==e)return;this.etime=e,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,r),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,r),this.wrapper.image=r)}this.initial&&this.particleTexture&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){!this.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,(t=this.viewport)==null||t.toggleParticle(!1)},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(()=>{var a,r;this.animation=void 0,!(this.paused||!((a=this.factor)!=null&&a.active)||!((r=this.factor)!=null&&r.particle)||!this.particleContext||!this.wrapper)&&(this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay())}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.map)==null||a.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay)},handleClear(){var t;(t=this.viewport)==null||t.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},Sc={key:0};function Pc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Sc,[o.createElementVNode("div",{class:"legend-bars-gl4 current",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"kts",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"0.4",-1),o.createElementVNode("span",null,"0.8",-1),o.createElementVNode("span",null,"1.6",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"3.2",-1)]),4)])):o.createCommentVNode("",!0)}const Nc=K(_c,[["render",Pc]]),rb="",Mc={name:"IdmSigWaveParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:to},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,rendererKey:"sig-wave-particle",backgroundFragmentSchema:fe.sigWaveFragmentSchema,etime:void 0,dataSource:void 0,imageSource:void 0,imageEtime:void 0,imagePromise:void 0,drawVersion:0,wrapper:void 0,animation:void 0,lastParticleFrameTime:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?3e3:9e3,particleOptions:{fadeOpacity:0,lineLength:6,lineOpacity:.9,speedFactor:this.simple?.1:.2,dropRate:0,dropRateBump:0,uvRange:[0,12.75],sRange:[0,12.75]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){var a;t!==e&&e!==void 0&&(t&&((a=this.factor)!=null&&a.active)?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},beforeUnmount(){this.handleClear(),this.imagePromise=void 0,this.imageSource=void 0,this.imageEtime=void 0},methods:{async handleRender(){var t;if(!(!((t=this.factor)!=null&&t.active)||!this.viewport))try{const e=new Date().valueOf();let a=0,r=0;await this.handleDraw(),r=new Date().valueOf()-(e+a),console.log(`[${this.rendererKey}] add elapsed: `,r,", total: ",a+=r)}catch(e){this.handleClear(),console.error(`[${this.rendererKey}] Render failed:`,e)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const e=[[0,"rgb(50, 158, 186)"],[10/255,"rgb(50, 158, 186)"],[20/255,"rgb(48, 128, 164)"],[30/255,"rgb(48, 99, 142)"],[40/255,"rgb(57, 61, 143)"],[50/255,"rgb(179, 86, 189)"],[60/255,"rgb(154, 45, 123)"],[80/255,"rgb(134, 48, 48)"],[120/255,"rgb(194, 77, 91)"],[150/255,"rgb(192, 118, 105)"],[180/255,"rgb(192, 163, 157)"],[1,"rgb(192, 163, 157)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,this.backgroundFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...so.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount,"lines",!0),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){var i;this.handleSetup();const t=this.context;if(!t)return;const e=++this.drawVersion,{raw:a,etime:r}=this.factor;if(!this.texture||this.etime!==r||this.dataSource!==a||this.particleContext&&!this.particleTexture){(this.imageSource!==a||this.imageEtime!==r||!this.imagePromise)&&(this.imageSource=a,this.imageEtime=r,this.imagePromise=this.webgl.loadImg(a));let l;try{l=await this.imagePromise}catch(n){if(e!==this.drawVersion)return;throw this.imagePromise=void 0,n}if(e!==this.drawVersion||this.context!==t||!((i=this.factor)!=null&&i.active)||this.factor.raw!==a||this.factor.etime!==r)return;this.etime=r,this.dataSource=a,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,l),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.NEAREST,this.particleContext.CLAMP_TO_EDGE,l),this.wrapper.image=l,this.wrapper.resetLifecycle=!0,this.lastParticleFrameTime=void 0)}this.initial&&this.particleTexture&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){!this.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,this.lastParticleFrameTime=void 0,this.particleContext&&((t=this.viewport)==null||t.toggleParticle(!1))},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(a=>{var i,l;if(this.animation=void 0,this.paused||!((i=this.factor)!=null&&i.active)||!((l=this.factor)!=null&&l.particle)||!this.particleContext||!this.wrapper)return;const r=this.lastParticleFrameTime==null?0:Math.max(0,(a-this.lastParticleFrameTime)/1e3);this.lastParticleFrameTime=a,this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions,r),this.viewport.toggleParticle(!0),this.handlePlay()}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.map)==null||a.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay)},handleClear(){var t,e;++this.drawVersion,this.context&&((t=this.viewport)==null||t.toggle(!1),this.context.deleteTexture(this.texture||null),this.context.deleteTexture(((e=this.rampColor)==null?void 0:e.texture)||null),this.context.deleteBuffer(this.aPositionBuffer||null),this.context.deleteProgram(this.program||null)),this.context=void 0,this.texture=void 0,this.rampColor=void 0,this.aPositionBuffer=void 0,this.program=void 0,this.etime=void 0,this.dataSource=void 0,this.handleClearParticle()}}},Tc={key:0};function Vc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Tc,[o.createElementVNode("div",{class:"legend-bars-gl4 sig-wave-particle",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"m",-1),o.createElementVNode("span",null,"0.5",-1),o.createElementVNode("span",null,"1",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"6",-1),o.createElementVNode("span",null,"9",-1)]),4)])):o.createCommentVNode("",!0)}const Ec=K(Mc,[["render",Vc],["__scopeId","data-v-0e362094"]]),Rc={name:"IdmSigWaveHeight",props:{map:{type:Object},sigWaveHeight:{type:Object},beforeLayer:{type:String}},data(){return{source:"sig-wave-height-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:V.featureCollection([])}},watch:{"sigWaveHeight.version":{handler(){var t;(t=this.sigWaveHeight)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t,e;if(this.sigWaveHeight){const a=new Date().valueOf();let r=0,i=0,l=this.empty;this.sigWaveHeight.active&&(l=this.sigWaveHeight.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(l),i=new Date().valueOf()-(a+r),console.log("[sig-wave-height] update elapsed: ",i,", total: ",r+=i)):(this.map.addSource(this.source,{type:"geojson",data:l}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-opacity":.8,"fill-color":["step",["get","val"],"rgba(0,235,156,0)",2,"rgba(0,235,156,0.4)",3,"#ffed00",4,"#ff9800",5,"#f77800",6,"#e4711e",7,"#e06128",8,"#dc5132",9,"#d5453c",10,"#cd3a46",12,"#be2c50",14,"#b41a5a"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","symbol-spacing":100,"text-field":["format",["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":10},paint:{"text-color":["step",["get","val"],"rgba(0, 0, 0, 0.7)",9,"rgba(255,255,255,0.8)"]}},this.beforeLayer),i=new Date().valueOf()-(a+r),console.log("[sig-wave-height] add elapsed: ",i,", total: ",r+=i))}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Dc(t,e,a,r,i,l){return null}const Bc=K(Rc,[["render",Dc]]),lb="",Ic={name:"IdmSwellParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:to},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,rendererKey:"swell-particle",backgroundFragmentSchema:fe.fragmentSchema,etime:void 0,dataSource:void 0,imageSource:void 0,imagePromise:void 0,drawVersion:0,wrapper:void 0,animation:void 0,lastParticleFrameTime:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?3e3:9e3,particleOptions:{fadeOpacity:0,lineLength:6,lineOpacity:.9,speedFactor:this.simple?.1:.2,dropRate:0,dropRateBump:0,uvRange:[0,12.75],sRange:[0,12.75]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){var a;t!==e&&e!==void 0&&(t&&((a=this.factor)!=null&&a.active)?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},beforeUnmount(){this.handleClear(),this.imagePromise=void 0,this.imageSource=void 0},methods:{async handleRender(){var t;if(!(!((t=this.factor)!=null&&t.active)||!this.viewport))try{const e=new Date().valueOf();await this.handleDraw(),console.log(`[${this.rendererKey}] 渲染耗时: `,new Date().valueOf()-e)}catch(e){this.handleClear(),console.error(`[${this.rendererKey}] 渲染失败:`,e)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const e=[[0,"rgb(50, 158, 186)"],[10/255,"rgb(50, 158, 186)"],[20/255,"rgb(48, 128, 164)"],[30/255,"rgb(48, 99, 142)"],[40/255,"rgb(57, 61, 143)"],[50/255,"rgb(179, 86, 189)"],[60/255,"rgb(154, 45, 123)"],[80/255,"rgb(134, 48, 48)"],[120/255,"rgb(194, 77, 91)"],[150/255,"rgb(192, 118, 105)"],[180/255,"rgb(192, 163, 157)"],[1,"rgb(192, 163, 157)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,this.backgroundFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...so.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount,"lines",!0),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){var i;this.handleSetup();const t=this.context;if(!t)return;const e=++this.drawVersion,{raw:a,etime:r}=this.factor;if(!this.texture||this.etime!==r||this.dataSource!==a||this.particleContext&&!this.particleTexture){(this.imageSource!==a||!this.imagePromise)&&(this.imageSource=a,this.imagePromise=this.webgl.loadImg(a));let l;try{l=await this.imagePromise}catch(n){if(e!==this.drawVersion)return;throw this.imagePromise=void 0,n}if(e!==this.drawVersion||this.context!==t||!((i=this.factor)!=null&&i.active)||this.factor.raw!==a||this.factor.etime!==r)return;this.etime=r,this.dataSource=a,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,l),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.NEAREST,this.particleContext.CLAMP_TO_EDGE,l),this.wrapper.image=l,this.wrapper.resetLifecycle=!0,this.lastParticleFrameTime=void 0)}this.initial&&this.particleTexture&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){!this.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,this.lastParticleFrameTime=void 0,this.particleContext&&((t=this.viewport)==null||t.toggleParticle(!1))},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(a=>{var i,l;if(this.animation=void 0,this.paused||!((i=this.factor)!=null&&i.active)||!((l=this.factor)!=null&&l.particle)||!this.particleContext||!this.wrapper)return;const r=this.lastParticleFrameTime==null?0:Math.max(0,(a-this.lastParticleFrameTime)/1e3);this.lastParticleFrameTime=a,this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions,r),this.viewport.toggleParticle(!0),this.handlePlay()}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.map)==null||a.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay)},handleClear(){var t,e;++this.drawVersion,this.context&&((t=this.viewport)==null||t.toggle(!1),this.context.deleteTexture(this.texture||null),this.context.deleteTexture(((e=this.rampColor)==null?void 0:e.texture)||null),this.context.deleteBuffer(this.aPositionBuffer||null),this.context.deleteProgram(this.program||null)),this.context=void 0,this.texture=void 0,this.rampColor=void 0,this.aPositionBuffer=void 0,this.program=void 0,this.etime=void 0,this.dataSource=void 0,this.handleClearParticle()}}},Fc={key:0};function Gc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Fc,[o.createElementVNode("div",{class:"legend-bars-gl4 swell",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"m",-1),o.createElementVNode("span",null,"0.5",-1),o.createElementVNode("span",null,"1",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"6",-1),o.createElementVNode("span",null,"9",-1)]),4)])):o.createCommentVNode("",!0)}const jc=K(Ic,[["render",Gc],["__scopeId","data-v-c0342437"]]),Wc={name:"IdmSwellDirection",props:{map:{type:Object},swell:{type:Object},beforeLayer:{type:String},mapFeather:{type:String},hasRampLayer:{type:Boolean},nautical:{type:String}},data(){return{source:"swell-source",directionLayer:"swell-direction-layer",heightLayer:"swell-height-layer",heightLabelLayer:"swell-height-label-layer",empty:V.featureCollection([])}},computed:{opacity(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?.6:.7},color(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?"#000623":"#ffffff"}},watch:{"swell.version":{handler(){var t;(t=this.swell)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},color:{handler(){var t;(t=this.swell)!=null&&t.active&&(this.handleClear(),this.handleRender())}}},methods:{handleRender(){var t,e;if(this.swell){const a=new Date().valueOf();let r=0,i=this.empty;if(this.swell.active&&(i=this.swell.data),(t=this.map)!=null&&t.getSource(this.source))(e=this.map)==null||e.getSource(this.source).setData(i),new Date().valueOf()-(a+r);else{this.map.addSource(this.source,{type:"geojson",data:i}),this.map.addLayer({id:this.heightLayer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-opacity":1,"line-width":1,"line-color":["match",["get","val"],2,"rgba(255,255,0,0.9)",3,"rgba(255,149,0,0.9)",4,"rgba(244,67,54,0.9)",5,"rgba(162,2,31,0.9)",6,"rgba(162,2,31,0.9)","rgba(162,2,31,0.9)"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}m","text-size":11},paint:{"text-color":["step",["get","val"],"black",4,"white",5,"white",6,"white"],"text-halo-color":["match",["get","val"],2,"rgba(255,255,0,0.7)",3,"rgba(255,149,0,0.7)",4,"rgba(244,67,54,0.7)",5,"rgba(162,13,2,0.7)",6,"rgba(162,13,2,0.7)","rgba(162,13,2,0.7)"],"text-halo-width":2}},this.beforeLayer);const l=new Image(72,72);let n=`<svg t="1752721890391" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12518" width="200" height="200"><path d="M481.386772 959.514313 481.386772 334.713224c-56.000432 37.288255-92.523253 55.876612-142.312216 57.787124 85.834924-84.884272 130.528845-195.161888 172.552961-328.434218 40.259936 133.272329 89.39296 238.731196 172.622546 328.434218-54.105269-5.729491-86.780459-21.201881-146.338926-58.965973l0 625.979938L481.386772 959.514313z" p-id="12519" fill="${this.color}"></path></svg>`,s="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(n)));l.src=s,l.onload=()=>{this.map.hasImage("swellDirIconWhite")?this.map.updateImage("swellDirIconWhite",l):this.map.addImage("swellDirIconWhite",l),this.map.getLayer(this.directionLayer)||this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"swellDirIconWhite","icon-size":{base:1,stops:[[2,.32],[6,.5]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)},new Date().valueOf()-(a+r)}}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.hasImage("swellDirIconWhite")&&this.map.removeImage("swellDirIconWhite"),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Zc(t,e,a,r,i,l){return o.openBlock(),o.createElementBlock("div")}const Hc=K(Wc,[["render",Zc]]),Xc={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},theme:{type:String}},data(){return{source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:V.featureCollection([])}},watch:{"prmsl.version":{handler(){var t;(t=this.prmsl)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t,e,a;if(this.prmsl){const r=new Date().valueOf();let i=0,l=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(n),l=new Date().valueOf()-(r+i),console.log("[prmsl] update elapsed: ",l,", total: ",i+=l)):(this.map.addSource(this.source,{type:"geojson",data:n}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":["step",["get","val"],"rgba(162,13,2,1)",920,"rgba(255, 96, 98, 1)",980,"rgba(255, 246, 184, 1)",1100,"rgba(199,171,250,1)"],"line-width":1,"line-opacity":this.theme==="light"?1:.3}},this.beforeLayer),(a=this.map)==null||a.addLayer({id:this.labelLayer,type:"symbol",source:this.source,minzoom:4,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}","text-size":10},paint:{"text-color":"black","text-halo-color":"rgba(255,255,255,1)","text-opacity":.7,"text-halo-width":1}},this.beforeLayer),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-allow-overlap":!0,"text-field":["format",["get","type"],{"font-scale":1.03},`
404
+ </svg>`;n.src="data:image/svg+xml;base64,"+window.btoa(s);const c=[n];let m=0;c.forEach(d=>{d.onload=()=>{m++,this.map.hasImage("currentDirIcon")?this.map.updateImage("currentDirIcon",n):this.map.addImage("currentDirIcon",n),m===1&&!this.map.getLayer(this.directionLayer)&&this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"currentDirIcon","icon-size":["interpolate",["linear"],["get","spd"],.5,.3,1,.5,1.5,.7,2,.8,3.5,1],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)}}),i=new Date().valueOf()-(a+r)}}},handleClear(){this.map.getLayer(this.speedLayer)&&this.map.removeLayer(this.speedLayer),this.map.getLayer(this.speedLabelLayer)&&this.map.removeLayer(this.speedLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.hasImage("currentDirIcon")&&this.map.removeImage("currentDirIcon"),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Cc(t,e,a,r,i,l){return null}const zc=K(vc,[["render",Cc]]),ib="",_c={name:"IdmCurrentParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:to},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?6e3:13e3,particleOptions:{fadeOpacity:.99,speedFactor:this.simple?1.2:2,dropRate:.005,dropRateBump:.01,uvRange:[-2.5,2.6],sRange:[0,3],scale:.3},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){t!==e&&e!==void 0&&(t?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},beforeUnmount(){this.handleClear()},methods:{async handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;await this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[current-particle] add elapsed: ",a,", total: ",e+=a)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const e=[[0/255,"rgba(95, 143, 197,1)"],[5/255,"rgba(64,127,115,1)"],[10/255,"rgb(58,164,58)"],[15/255,"rgb(191,182,67)"],[20/255,"rgb(197,154,68)"],[30/255,"rgb(160,70,94)"],[40/255,"rgb(138,84,166)"],[45/255,"rgb(82,113,165)"],[50/255,"rgb(84,142,152)"],[65/255,"rgb(150,181,184)"],[80/255,"rgb(195,194,194)"],[254/255,"rgb(195,194,194)"],[1,"rgb(195,194,194)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,fe.uvFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"],[.6,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...at.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){var a;if(this.handleSetup(),!this.context)return;const t=this.context,e=this.factor.etime;if(this.etime!==e||this.particleContext&&!this.particleTexture){const r=await this.webgl.loadImg(this.factor.raw);if(this.context!==t||!((a=this.factor)!=null&&a.active)||this.factor.etime!==e)return;this.etime=e,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,r),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,r),this.wrapper.image=r)}this.initial&&this.particleTexture&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){!this.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,(t=this.viewport)==null||t.toggleParticle(!1)},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(()=>{var a,r;this.animation=void 0,!(this.paused||!((a=this.factor)!=null&&a.active)||!((r=this.factor)!=null&&r.particle)||!this.particleContext||!this.wrapper)&&(this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay())}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.map)==null||a.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay)},handleClear(){var t;(t=this.viewport)==null||t.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},Sc={key:0};function Pc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Sc,[o.createElementVNode("div",{class:"legend-bars-gl4 current",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"kts",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"0.4",-1),o.createElementVNode("span",null,"0.8",-1),o.createElementVNode("span",null,"1.6",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"3.2",-1)]),4)])):o.createCommentVNode("",!0)}const Nc=K(_c,[["render",Pc]]),rb="",Mc={name:"IdmSigWaveParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:to},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,rendererKey:"sig-wave-particle",backgroundFragmentSchema:fe.sigWaveFragmentSchema,etime:void 0,dataSource:void 0,imageSource:void 0,imageEtime:void 0,imagePromise:void 0,drawVersion:0,wrapper:void 0,animation:void 0,lastParticleFrameTime:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?3e3:9e3,particleOptions:{fadeOpacity:0,lineLength:6,lineOpacity:.9,speedFactor:this.simple?.1:.2,dropRate:0,dropRateBump:0,uvRange:[0,12.75],sRange:[0,12.75]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){var a;t!==e&&e!==void 0&&(t&&((a=this.factor)!=null&&a.active)?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},beforeUnmount(){this.handleClear(),this.imagePromise=void 0,this.imageSource=void 0,this.imageEtime=void 0},methods:{async handleRender(){var t;if(!(!((t=this.factor)!=null&&t.active)||!this.viewport))try{const e=new Date().valueOf();let a=0,r=0;await this.handleDraw(),r=new Date().valueOf()-(e+a),console.log(`[${this.rendererKey}] add elapsed: `,r,", total: ",a+=r)}catch(e){this.handleClear(),console.error(`[${this.rendererKey}] Render failed:`,e)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const e=[[0,"rgb(50, 158, 186)"],[10/255,"rgb(50, 158, 186)"],[20/255,"rgb(48, 128, 164)"],[30/255,"rgb(48, 99, 142)"],[40/255,"rgb(57, 61, 143)"],[50/255,"rgb(179, 86, 189)"],[60/255,"rgb(154, 45, 123)"],[80/255,"rgb(134, 48, 48)"],[120/255,"rgb(194, 77, 91)"],[150/255,"rgb(192, 118, 105)"],[180/255,"rgb(192, 163, 157)"],[1,"rgb(192, 163, 157)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,this.backgroundFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...so.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount,"lines",!0),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){var i;this.handleSetup();const t=this.context;if(!t)return;const e=++this.drawVersion,{raw:a,etime:r}=this.factor;if(!this.texture||this.etime!==r||this.dataSource!==a||this.particleContext&&!this.particleTexture){(this.imageSource!==a||this.imageEtime!==r||!this.imagePromise)&&(this.imageSource=a,this.imageEtime=r,this.imagePromise=this.webgl.loadImg(a));let l;try{l=await this.imagePromise}catch(n){if(e!==this.drawVersion)return;throw this.imagePromise=void 0,n}if(e!==this.drawVersion||this.context!==t||!((i=this.factor)!=null&&i.active)||this.factor.raw!==a||this.factor.etime!==r)return;this.etime=r,this.dataSource=a,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,l),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.NEAREST,this.particleContext.CLAMP_TO_EDGE,l),this.wrapper.image=l,this.wrapper.resetLifecycle=!0,this.lastParticleFrameTime=void 0)}this.initial&&this.particleTexture&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){!this.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,this.lastParticleFrameTime=void 0,this.particleContext&&((t=this.viewport)==null||t.toggleParticle(!1))},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(a=>{var i,l;if(this.animation=void 0,this.paused||!((i=this.factor)!=null&&i.active)||!((l=this.factor)!=null&&l.particle)||!this.particleContext||!this.wrapper)return;const r=this.lastParticleFrameTime==null?0:Math.max(0,(a-this.lastParticleFrameTime)/1e3);this.lastParticleFrameTime=a,this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions,r),this.viewport.toggleParticle(!0),this.handlePlay()}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.map)==null||a.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay)},handleClear(){var t,e;++this.drawVersion,this.context&&((t=this.viewport)==null||t.toggle(!1),this.context.deleteTexture(this.texture||null),this.context.deleteTexture(((e=this.rampColor)==null?void 0:e.texture)||null),this.context.deleteBuffer(this.aPositionBuffer||null),this.context.deleteProgram(this.program||null)),this.context=void 0,this.texture=void 0,this.rampColor=void 0,this.aPositionBuffer=void 0,this.program=void 0,this.etime=void 0,this.dataSource=void 0,this.handleClearParticle()}}},Tc={key:0};function Vc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Tc,[o.createElementVNode("div",{class:"legend-bars-gl4 sig-wave-particle",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"m",-1),o.createElementVNode("span",null,"0.5",-1),o.createElementVNode("span",null,"1",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"6",-1),o.createElementVNode("span",null,"9",-1)]),4)])):o.createCommentVNode("",!0)}const Ec=K(Mc,[["render",Vc],["__scopeId","data-v-0e362094"]]),Rc={name:"IdmSigWaveHeight",props:{map:{type:Object},sigWaveHeight:{type:Object},beforeLayer:{type:String}},data(){return{source:"sig-wave-height-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:V.featureCollection([])}},watch:{"sigWaveHeight.version":{handler(){var t;(t=this.sigWaveHeight)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t,e;if(this.sigWaveHeight){const a=new Date().valueOf();let r=0,i=0,l=this.empty;this.sigWaveHeight.active&&(l=this.sigWaveHeight.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(l),i=new Date().valueOf()-(a+r),console.log("[sig-wave-height] update elapsed: ",i,", total: ",r+=i)):(this.map.addSource(this.source,{type:"geojson",data:l}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-opacity":.8,"fill-color":["step",["get","val"],"rgba(0,235,156,0)",2,"rgba(0,235,156,0.4)",3,"#ffed00",4,"#ff9800",5,"#f77800",6,"#e4711e",7,"#e06128",8,"#dc5132",9,"#d5453c",10,"#cd3a46",12,"#be2c50",14,"#b41a5a"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","symbol-spacing":100,"text-field":["format",["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":10},paint:{"text-color":["step",["get","val"],"rgba(0, 0, 0, 0.7)",9,"rgba(255,255,255,0.8)"]}},this.beforeLayer),i=new Date().valueOf()-(a+r),console.log("[sig-wave-height] add elapsed: ",i,", total: ",r+=i))}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Dc(t,e,a,r,i,l){return null}const Bc=K(Rc,[["render",Dc]]),lb="",Ic={name:"IdmSwellParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:to},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,rendererKey:"swell-particle",backgroundFragmentSchema:fe.fragmentSchema,etime:void 0,dataSource:void 0,imageSource:void 0,imagePromise:void 0,drawVersion:0,wrapper:void 0,animation:void 0,lastParticleFrameTime:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?3e3:9e3,particleOptions:{fadeOpacity:0,lineLength:6,lineOpacity:.9,speedFactor:this.simple?.1:.2,dropRate:0,dropRateBump:0,uvRange:[0,12.75],sRange:[0,12.75]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){var a;t!==e&&e!==void 0&&(t&&((a=this.factor)!=null&&a.active)?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},beforeUnmount(){this.handleClear(),this.imagePromise=void 0,this.imageSource=void 0},methods:{async handleRender(){var t;if(!(!((t=this.factor)!=null&&t.active)||!this.viewport))try{const e=new Date().valueOf();await this.handleDraw(),console.log(`[${this.rendererKey}] 渲染耗时: `,new Date().valueOf()-e)}catch(e){this.handleClear(),console.error(`[${this.rendererKey}] 渲染失败:`,e)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const e=[[0,"rgb(50, 158, 186)"],[10/255,"rgb(50, 158, 186)"],[20/255,"rgb(48, 128, 164)"],[30/255,"rgb(48, 99, 142)"],[40/255,"rgb(57, 61, 143)"],[50/255,"rgb(179, 86, 189)"],[60/255,"rgb(154, 45, 123)"],[80/255,"rgb(134, 48, 48)"],[120/255,"rgb(194, 77, 91)"],[150/255,"rgb(192, 118, 105)"],[180/255,"rgb(192, 163, 157)"],[1,"rgb(192, 163, 157)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,this.backgroundFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...so.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount,"lines",!0),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){var i;this.handleSetup();const t=this.context;if(!t)return;const e=++this.drawVersion,{raw:a,etime:r}=this.factor;if(!this.texture||this.etime!==r||this.dataSource!==a||this.particleContext&&!this.particleTexture){(this.imageSource!==a||!this.imagePromise)&&(this.imageSource=a,this.imagePromise=this.webgl.loadImg(a));let l;try{l=await this.imagePromise}catch(n){if(e!==this.drawVersion)return;throw this.imagePromise=void 0,n}if(e!==this.drawVersion||this.context!==t||!((i=this.factor)!=null&&i.active)||this.factor.raw!==a||this.factor.etime!==r)return;this.etime=r,this.dataSource=a,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,l),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.NEAREST,this.particleContext.CLAMP_TO_EDGE,l),this.wrapper.image=l,this.wrapper.resetLifecycle=!0,this.lastParticleFrameTime=void 0)}this.initial&&this.particleTexture&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){!this.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,this.lastParticleFrameTime=void 0,this.particleContext&&((t=this.viewport)==null||t.toggleParticle(!1))},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(a=>{var i,l;if(this.animation=void 0,this.paused||!((i=this.factor)!=null&&i.active)||!((l=this.factor)!=null&&l.particle)||!this.particleContext||!this.wrapper)return;const r=this.lastParticleFrameTime==null?0:Math.max(0,(a-this.lastParticleFrameTime)/1e3);this.lastParticleFrameTime=a,this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions,r),this.viewport.toggleParticle(!0),this.handlePlay()}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.map)==null||a.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay)},handleClear(){var t,e;++this.drawVersion,this.context&&((t=this.viewport)==null||t.toggle(!1),this.context.deleteTexture(this.texture||null),this.context.deleteTexture(((e=this.rampColor)==null?void 0:e.texture)||null),this.context.deleteBuffer(this.aPositionBuffer||null),this.context.deleteProgram(this.program||null)),this.context=void 0,this.texture=void 0,this.rampColor=void 0,this.aPositionBuffer=void 0,this.program=void 0,this.etime=void 0,this.dataSource=void 0,this.handleClearParticle()}}},Fc={key:0};function Gc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Fc,[o.createElementVNode("div",{class:"legend-bars-gl4 swell",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"m",-1),o.createElementVNode("span",null,"0.5",-1),o.createElementVNode("span",null,"1",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"6",-1),o.createElementVNode("span",null,"9",-1)]),4)])):o.createCommentVNode("",!0)}const jc=K(Ic,[["render",Gc],["__scopeId","data-v-c0342437"]]),Wc={name:"IdmSwellDirection",props:{map:{type:Object},swell:{type:Object},beforeLayer:{type:String},mapFeather:{type:String},hasRampLayer:{type:Boolean},nautical:{type:String}},data(){return{source:"swell-source",directionLayer:"swell-direction-layer",heightLayer:"swell-height-layer",heightLabelLayer:"swell-height-label-layer",empty:V.featureCollection([])}},computed:{opacity(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?.6:.7},color(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?"#000623":"#ffffff"}},watch:{"swell.version":{handler(){var t;(t=this.swell)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},color:{handler(){var t;(t=this.swell)!=null&&t.active&&(this.handleClear(),this.handleRender())}}},methods:{handleRender(){var t,e;if(this.swell){const a=new Date().valueOf();let r=0,i=this.empty;if(this.swell.active&&(i=this.swell.data),(t=this.map)!=null&&t.getSource(this.source))(e=this.map)==null||e.getSource(this.source).setData(i),new Date().valueOf()-(a+r);else{this.map.addSource(this.source,{type:"geojson",data:i}),this.map.addLayer({id:this.heightLayer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-opacity":1,"line-width":1,"line-color":["match",["get","val"],2,"rgba(255,255,0,0.9)",3,"rgba(255,149,0,0.9)",4,"rgba(244,67,54,0.9)",5,"rgba(162,2,31,0.9)",6,"rgba(162,2,31,0.9)","rgba(162,2,31,0.9)"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}m","text-size":11},paint:{"text-color":["step",["get","val"],"black",4,"white",5,"white",6,"white"],"text-halo-color":["match",["get","val"],2,"rgba(255,255,0,0.7)",3,"rgba(255,149,0,0.7)",4,"rgba(244,67,54,0.7)",5,"rgba(162,13,2,0.7)",6,"rgba(162,13,2,0.7)","rgba(162,13,2,0.7)"],"text-halo-width":2}},this.beforeLayer);const l=new Image(72,72);let n=`<svg t="1752721890391" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12518" width="200" height="200"><path d="M481.386772 959.514313 481.386772 334.713224c-56.000432 37.288255-92.523253 55.876612-142.312216 57.787124 85.834924-84.884272 130.528845-195.161888 172.552961-328.434218 40.259936 133.272329 89.39296 238.731196 172.622546 328.434218-54.105269-5.729491-86.780459-21.201881-146.338926-58.965973l0 625.979938L481.386772 959.514313z" p-id="12519" fill="${this.color}"></path></svg>`,s="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(n)));l.src=s,l.onload=()=>{this.map.hasImage("swellDirIconWhite")?this.map.updateImage("swellDirIconWhite",l):this.map.addImage("swellDirIconWhite",l),this.map.getLayer(this.directionLayer)||this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"swellDirIconWhite","icon-size":{base:1,stops:[[2,.32],[6,.5]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)},new Date().valueOf()-(a+r)}}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.hasImage("swellDirIconWhite")&&this.map.removeImage("swellDirIconWhite"),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Zc(t,e,a,r,i,l){return o.openBlock(),o.createElementBlock("div")}const Hc=K(Wc,[["render",Zc]]),Xc={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},theme:{type:String},hasRampLayer:{type:Boolean},nautical:{type:String}},data(){return{source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:V.featureCollection([])}},computed:{opacity(){return(this.theme==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?1:.3}},watch:{"prmsl.version":{handler(){var t;(t=this.prmsl)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},opacity:{handler(){var t;(t=this.prmsl)!=null&&t.active&&(this.handleClear(),this.handleRender())}}},methods:{handleRender(){var t,e,a;if(this.prmsl){const r=new Date().valueOf();let i=0,l=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(n),l=new Date().valueOf()-(r+i),console.log("[prmsl] update elapsed: ",l,", total: ",i+=l)):(this.map.addSource(this.source,{type:"geojson",data:n}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":["step",["get","val"],"rgba(162,13,2,1)",920,"rgba(255, 96, 98, 1)",980,"rgba(255, 246, 184, 1)",1100,"rgba(199,171,250,1)"],"line-width":1,"line-opacity":this.opacity}},this.beforeLayer),(a=this.map)==null||a.addLayer({id:this.labelLayer,type:"symbol",source:this.source,minzoom:4,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}","text-size":10},paint:{"text-color":"black","text-halo-color":"rgba(255,255,255,1)","text-opacity":.7,"text-halo-width":1}},this.beforeLayer),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-allow-overlap":!0,"text-field":["format",["get","type"],{"font-scale":1.03},`
405
405
  `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12,"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.theme==="light"?["step",["get","val"],"rgba(0, 0, 0, 0.5)",920,"rgba(0, 0, 0, 0.5)",980,"rgba(0, 0, 0, 0.7)",1100,"rgba(0, 0, 0, 0.7)"]:"rgba(0,0,0,1)","text-halo-color":["step",["get","val"],"rgba(162,13,2,1)",920,"rgba(255, 96, 98, 1)",980,"rgba(255, 246, 184, 1)",1100,"rgba(199,171,250,1)"],"text-halo-width":1}},this.beforeLayer),l=new Date().valueOf()-(r+i),console.log("[prmsl] add elapsed: ",l,", total: ",i+=l))}},handleClear(){this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.labelLayer)&&this.map.removeLayer(this.labelLayer),this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Oc(t,e,a,r,i,l){return null}const Yc=K(Xc,[["render",Oc]]),nb="",Uc={name:"IdmIceEdge",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-edge] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(86, 169, 230, 0)"],[1/255,"rgba(86, 169, 230, 0)"],[25/255,"rgba(86, 169, 230, 1)"],[25/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 84, 39, 1)"],[250/255,"rgba(230, 84, 39, 1)"],[1,"rgba(230, 84, 39, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},Jc={key:0};function Kc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Jc,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-edge",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",{style:{color:"rgba(var(--v-theme-black), 0.7)"}},"%",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"40",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"70",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"90",-1),o.createElementVNode("span",null,null,-1)]),4)])):o.createCommentVNode("",!0)}const Qc=K(Uc,[["render",Kc]]),sb="",qc={name:"IdmCover",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-cover] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(68, 1, 84, 0)"],[1/255,"rgba(63, 72, 137, 0)"],[50/255,"rgba(53, 125, 177, 1)"],[100/255,"rgba(33, 145, 140, 1)"],[150/255,"rgba(45, 178, 125, 1)"],[200/255,"rgba(112, 207, 87, 1)"],[250/255,"rgba(253, 231, 37, 0.8)"],[1,"rgba(253, 231, 37, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},$c={key:0};function em(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",$c,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-cover",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"%",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"40",-1),o.createElementVNode("span",null,"60",-1),o.createElementVNode("span",null,"80",-1),o.createElementVNode("span",null,"100",-1)]),4)])):o.createCommentVNode("",!0)}const tm=K(qc,[["render",em],["__scopeId","data-v-2e9090ae"]]),cb="",om={name:"IdmThickness",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},menuToggle:{type:Object},bottom:{type:String,default:"70px"}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-thickness] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(4, 6, 19, 0)"],[1/255,"rgba(4, 6, 19, 0)"],[20/255,"rgba(51, 50, 102, 1)"],[40/255,"rgba(63, 82, 158, 1)"],[50/255,"rgba(66, 123, 183, 1)"],[60/255,"rgba(92, 161, 197, 1)"],[80/255,"rgba(134, 199, 212, 0.7)"],[100/255,"rgba(134, 199, 212, 1)"],[150/255,"rgba(234, 253, 2536, 0.8)"],[250/255,"rgba(234, 253, 2536, 0.9)"],[1,"rgba(234, 253, 2536, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},am={key:0};function im(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",am,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-thickness",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"m",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"0.6",-1),o.createElementVNode("span",null,"1",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"3",-1)]),4)])):o.createCommentVNode("",!0)}const rm=K(om,[["render",im]]),mb="",lm={name:"IdmPrecip3h",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},deeimmediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[precip3h] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(59, 126, 162, 0)"],[14/255,"rgba(84,170,230, 0)"],[15/255,"rgba(172, 210, 255, 0.8)"],[20/255,"rgba(51,202,248,0.8)"],[30/255,"rgba(3,248,103,0.8)"],[49/255,"rgba(14,201,3,0.8)"],[57/255,"rgba(190,226,2,0.8)"],[73/255,"rgba(248,1,1,0.8)"],[82/255,"rgba(197,5,58,0.8)"],[1,"rgba(197,5,58,0.8)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},nm={key:0};function sm(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",nm,[o.createElementVNode("div",{class:"legend-bars-gl4 precip3h",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"mm",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"3",-1),o.createElementVNode("span",null,"7",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1)]),4)])):o.createCommentVNode("",!0)}const cm=K(lm,[["render",sm]]),db="",mm={name:"IdmVisibility",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{right:10,program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[visibility] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(189,50,160,0.8)"],[8/255,"rgba(208,56,56,0.8)"],[27/255,"rgba(190,226,2,0.8)"],[60/255,"rgba(3,236,118,0.8)"],[160/255,"rgba(172, 210,255,0.8)"],[161/255,"rgba(172, 210,255,0)"],[1,"rgba(144,144,144,0)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},dm={key:0};function hm(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",dm,[o.createElementVNode("div",{class:"legend-bars-gl4 visibility",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"nm",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"0.5",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"3",-1),o.createElementVNode("span",null,"9",-1)]),4)])):o.createCommentVNode("",!0)}const pm=K(mm,[["render",hm]]),hb="",gm={name:"IdmWaterTemp",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[water-temp] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(95, 143, 197)"],[46/255,"rgba(95, 143, 197)"],[69/255,"rgb(80, 140, 62)"],[92/255,"rgb(121, 146, 28)"],[115/255,"rgb(171, 161, 14)"],[138/255,"rgb(223, 177, 69)"],[161/255,"rgb(243, 150, 6)"],[184/255,"rgb(236, 95, 21)"],[207/255,"rgb(190, 65, 18)"],[230/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},um={key:0};function fm(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",um,[o.createElementVNode("div",{class:"legend-bars-gl4 water-temp",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"°C",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1),o.createElementVNode("span",null,"40",-1)]),4)])):o.createCommentVNode("",!0)}const ym=K(gm,[["render",fm]]),pb="",bm={name:"IdmTemp",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0;this.handleDraw(),new Date().valueOf()-(t+e)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgb(149, 137, 211)"],[100/255,"rgb(149, 137, 211)"],[110/255,"rgb(150, 209, 216)"],[120/255,"rgb(129, 204, 197)"],[130/255,"rgb(103, 180, 186)"],[140/255,"rgb(95, 143, 197)"],[150/255,"rgb(80, 140, 62)"],[160/255,"rgb(121, 146, 28)"],[170/255,"rgb(171, 161, 14)"],[180/255,"rgb(223, 177, 6)"],[190/255,"rgb(243, 150, 6)"],[200/255,"rgb(236, 95, 21)"],[210/255,"rgb(190, 65, 18)"],[220/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},wm={key:0};function xm(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",wm,[o.createElementVNode("div",{class:"legend-bars-gl4 temp",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"°C",-1),o.createElementVNode("span",null,"-20",-1),o.createElementVNode("span",null,"-10",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1),o.createElementVNode("span",null,"40",-1)]),4)])):o.createCommentVNode("",!0)}const km=K(bm,[["render",xm]]),gb="",Am={name:"IdmGlLayer",components:{IdmWindBarb:wc,IdmWindParticle:Lc,IdmCurrentDirection:zc,IdmCurrentParticle:Nc,IdmSigWaveParticle:Ec,IdmSigWaveHeight:Bc,IdmSwellParticle:jc,IdmSwellDirection:Hc,IdmPrmsl:Yc,IdmIceEdge:Qc,IdmIceCover:tm,IdmIceThickness:rm,IdmPrecip3h:cm,IdmVisibility:pm,IdmWaterTemp:ym,IdmTemp:km},props:{simple:{type:Boolean,default:!1},isLogin:{type:Boolean,default:!1},theme:{type:String},map:{type:Object},mapFeather:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},defaultMeteoToken:{type:String},top:{type:Number,default:0},paddingTop:{type:Number,default:8},menuHeight:{type:Number,default:248},menuToggle:{type:Object,default:{}},realTime:{type:String},forecastModel:{type:String},beforeLayer:{type:String},platform:{type:String}},emits:["forecastModel","menuToggle","weatherCheckList","autoActive","weatherRendered"],data(){const t=[...no.LayerHelper.WEATHER_LAYERS];return{right:10,toggle:!1,autoActive:!0,weatherWeight:0,allLayers:t,tagLayers:t.filter(e=>!e.hide),checkList:[],renderKey:"",iceToggleValue:void 0,weatherLayers:{},activeWeatherLayers:[],cache:{v:"0.0.2",versionKey:"weatherLayerCacheVersionGL4",autoActiveKey:"autoActiveCacheGL4",checkListKey:"weatherCheckListCacheGL4"},models:{},currentModel:localStorage.getItem("forecastModelCacheGL4")==="GFS"?"GFS":"ECMWF",zoom:6,viewport:void 0,particleFactor:void 0,showWindParticle:!0,showCurrentParticle:!0,showSigWaveParticle:!0,showSwellParticle:!0,legendToggle:!1,legend:{barbs:[2,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,0],current:[{label:"0-0.5 kts",size:.3,color:"rgb(58, 164, 58)"},{label:"0.5-1 kts",size:.4,color:"#ffff00"},{label:"1-1.5 kts",size:.6,color:"#ff9500"},{label:"1.5-2 kts",size:.8,color:"#f44336"},{label:">= 2 kts",size:1,color:"#e4711e"}],sigWaveHeight:[{label:"< 2 m",color:"rgba(0,235,156,0)"},{label:"2-3 m",color:"rgba(0,235,156,0.4)"},{label:"3-4 m",color:"#ffed00"},{label:"4-5 m",color:"#ff9800"},{label:"5-6 m",color:"#f77800"},{label:"6-7 m",color:"#e4711e"},{label:"7-8 m",color:"#e06128"},{label:"8-9 m",color:"#dc5132"},{label:"9-10 m",color:"#d5453c"},{label:"10-12 m",color:"#cd3a46"},{label:"12-14 m",color:"#be2c50"},{label:"> 14 m",color:"#aa1a5a"}]}}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}:{top:this.top+"px",right:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}},computeDateZ(){return function(t){var e;if(t){const a=z(t);return`${(e=a==null?void 0:a.utc())==null?void 0:e.format("MMM-DD/HHmm")}Z`}return"-"}},computeDateUpdate(){return function(t){return t?z(t).fromNow():"-"}},overlaysKeys(){return this.tagLayers.filter(t=>t.overlays).map(t=>t.key)},rendersKeys(){return this.allLayers.filter(t=>!t.overlays&&t.enabled).map(t=>t.key)},showTipMenu(){return this.checkList.includes("wind")||this.checkList.includes("current-direction")||this.checkList.includes("sig-wave-height")},barbsIconName(){var e,a,r;const t=[];for(let i=0;i<((a=(e=this.legend)==null?void 0:e.barbs)==null?void 0:a.length);i++){const l=((r=this.legend)==null?void 0:r.barbs[i])||0,n=l<10?`00${l}kts`:l<100?`0${l}kts`:`${l}kts`;t.push("icon-a-"+n)}return t},lengendTipTop(){return this.platform==="ops"?this.top+this.menuHeight+232:this.top+this.menuHeight+142}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.weatherLayers,this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})}},currentModel:{handler(t,e){this.$emit("forecastModel",t),localStorage.setItem("forecastModelCacheGL4",t)},immediate:!0},forecastModel:{handler(t,e){t&&t!==e&&this.handleWeatherLayerChange({sourceChanged:!0})}},map:{handler(){const t=this.map;t&&(this.viewport=new to(t),t.once("idle",()=>{this.map===t&&(this.fetchCache(),t.on("move",this.handleMove4Weather),this.handleRampColorInitial())}),t.triggerRepaint())},immediate:!0},realTime:{handler(t,e){t&&e&&z(t).utc().format("yyyy-MM-DD HH")!==z(e).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.fetchWeatherLayers()})},immediate:!0},renderKey:{handler(t,e){if(t&&t!==e){const a=this.checkList.filter(r=>!this.rendersKeys.some(i=>i===r));t==="ice-forecast"?(this.iceToggleValue=this.iceToggleValue||"ice-cover",this.checkList=[...a,"ice-forecast",this.iceToggleValue||"ice-cover"]):this.checkList=[...a,t]}else!t&&e&&(this.checkList=this.checkList.filter(a=>a!==e))}},checkList:{handler(t,e){var a,r,i,l,n,s;this.handleCheckListChange(t,e),this.$emit("weatherCheckList",t),this.autoActive&&this.checkList.length?(i=(r=(a=this.$parent)==null?void 0:a.$refs)==null?void 0:r.idmBottomBar)==null||i.handleToggle("weather",!0):(s=(n=(l=this.$parent)==null?void 0:l.$refs)==null?void 0:n.idmBottomBar)==null||s.handleToggle("weather",!1)}},autoActive:{handler(t){var e,a,r,i,l,n;localStorage.setItem(this.cache.autoActiveKey,this.autoActive),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(s=>this.checkList.includes(s.key)):[],this.handleWeatherLayerChange(),this.autoActive&&this.checkList.length?(r=(a=(e=this.$parent)==null?void 0:e.$refs)==null?void 0:a.idmBottomBar)==null||r.handleToggle("weather",!0):(n=(l=(i=this.$parent)==null?void 0:i.$refs)==null?void 0:l.idmBottomBar)==null||n.handleToggle("weather",!1),this.$emit("autoActive",this.autoActive)}},iceToggleValue:{handler(t){if(t){const e=this.checkList.filter(a=>!this.rendersKeys.some(r=>r===a));this.checkList=[...e,"ice-forecast",this.iceToggleValue]}}},showWindParticle:{handler(t){let e="wind-particle";this.weatherLayers[e]&&(this.weatherLayers[e].particle=t,this.weatherLayers[e].version=Math.random()+1)}},showCurrentParticle:{handler(t){let e="current-particle";this.weatherLayers[e]&&(this.weatherLayers[e].particle=t,this.weatherLayers[e].version=Math.random()+1)}},showSigWaveParticle:{handler(t){const e=this.weatherLayers["sig-wave-particle"];e&&(e.particle=t)}},showSwellParticle:{handler(t){const e=this.weatherLayers["swell-particle"];e&&(e.particle=t)}},isLogin:{handler(t){t?this.fetchModels():this.models={}},immediate:!0}},mounted(){this.fetchModels()},methods:{arraysEqual(t,e){if((t==null?void 0:t.length)!==(e==null?void 0:e.length))return!1;for(let a=0;a<(t==null?void 0:t.length);a++)if((t==null?void 0:t[a])!==(e==null?void 0:e[a]))return!1;return!0},normalizeWaveSelection(t){const e=t.map(a=>a==="sig-wave"?"sig-wave-particle":a==="swell"?"swell-particle":a);return[...new Set(e)].filter(a=>this.allLayers.some(r=>r.key===a))},fetchCache(){const t=localStorage.getItem(this.cache.versionKey);this.cache.v!==t&&(localStorage.removeItem(this.cache.autoActiveKey),localStorage.removeItem(this.cache.checkListKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let e=localStorage.getItem(this.cache.autoActiveKey);this.autoActive=e!=="false",localStorage.setItem(this.cache.autoActiveKey,this.autoActive),e=localStorage.getItem(this.cache.checkListKey);const a=JSON.parse(e||JSON.stringify(["wind","sig-wave-height"]));this.iceToggleValue=a.includes("ice-thickness")?"ice-thickness":void 0,this.checkList=this.normalizeWaveSelection(a),this.renderKey=this.checkList.find(r=>this.rendersKeys.includes(r))||"",localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList))},handleMenuToggle(){this.$emit("menuToggle","weatherLayers")},handleFastWeatherToggle(t){let e=[];this.checkList.includes(t)?e=this.checkList.filter(a=>a!==t):(e=[...this.checkList,t],this.checkList=e),this.handleCheckListChange(e,this.checkList)},handleCheckListChange(t,e){if(this.arraysEqual(t,e))return this.handleMove4Weather(),!1;const a=[...new Set(t)],r=a==null?void 0:a.filter(n=>!(e!=null&&e.includes(n)))[0],i=e==null?void 0:e.filter(n=>!(a!=null&&a.includes(n)))[0],l=this.checkList.filter(n=>!this.rendersKeys.some(s=>s===n));if(r)if(r==="ice-cover"||r==="ice-thickness"||r==="ice-forecast")this.checkList=[...l,"ice-forecast",this.iceToggleValue||"ice-cover"],this.iceToggleValue=this.iceToggleValue||"ice-cover";else if(this.rendersKeys.includes(r))this.checkList=[...l,r];else{const n=a.filter(c=>!this.rendersKeys.includes(c)),s=this.checkList.filter(c=>this.rendersKeys.includes(c));this.checkList=[...n,...s]}i&&(i==="ice-forecast"?(this.checkList=a.filter(n=>!["ice-cover","ice-thickness","ice-forecast"].includes(n)),this.iceToggleValue=void 0):this.checkList=a),this.checkList.includes("wind-particle")&&!(e!=null&&e.includes("wind-particle"))&&(this.showWindParticle=!0),this.checkList.includes("current-particle")&&!(e!=null&&e.includes("current-particle"))&&(this.showCurrentParticle=!0),this.checkList.includes("sig-wave-particle")&&!(e!=null&&e.includes("sig-wave-particle"))&&(this.showSigWaveParticle=!0),this.checkList.includes("swell-particle")&&!(e!=null&&e.includes("swell-particle"))&&(this.showSwellParticle=!0),localStorage.setItem(this.cache.checkListKey,JSON.stringify(a)),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(n=>a.includes(n.key)):[],this.handleWeatherLayerChange()},async fetchModels(){this.models={};const t=await he.get(`${this.gateway}/api/arc/meteo2/models2`,{headers:{Authorization:this.defaultMeteoToken}});(t==null?void 0:t.data.code)===0&&(this.models=t==null?void 0:t.data.data)},async fetchWeatherLayers(t={}){var r,i,l,n,s,c,m,d,u;const e=new Date().valueOf();let a=0;if(this.map){const f=((r=this.map)==null?void 0:r.getZoom())+1,g=(i=this.map)==null?void 0:i.getBounds(),p=`${g._sw.lng},${g._sw.lat},${g._ne.lng},${g._ne.lat}`;if(this.particleFactor&&((l=this.$refs.layer)!=null&&l.autoActive)){const h=no.LayerHelper.WEATHER_LAYERS.find(y=>{var k;return((k=y.peer)==null?void 0:k.weight)===this.particleFactor.weight});this.particleFactor.particle&&(this.showWindParticle||this.showCurrentParticle)?this.weatherWeight=this.weatherWeight&h.weight?this.weatherWeight:this.weatherWeight+h.weight:this.weatherWeight=this.weatherWeight&h.weight?this.weatherWeight-h.weight:this.weatherWeight}if(this.weatherWeight>0){let h=this.weatherWeight;if(h>0){const y=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],k=await he.get(`${y}/api/arc/weather/layers2/links?l=${h}&v=${this.forecastModel}&z=${f}&bbox=${p}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(new Date().valueOf()-(e+a),((n=k==null?void 0:k.data)==null?void 0:n.code)===0){const x=(s=k==null?void 0:k.data)==null?void 0:s.data,b=[];for(const v in x)b.push(he.get(x[v],{headers:{Authorization:this.defaultMeteoToken,key:v},responseType:/\.(jpg|png)$/.test(x[v])?"blob":"json"}).catch(L=>{console.log(`[${v}] fetch layer error: ${L}`)}));const A=await Promise.all(b);this.weatherLayers={},A.map(v=>{var _,N,M,T;const L=((_=v==null?void 0:v.data)==null?void 0:_.data)||(v==null?void 0:v.data);let C=(M=(N=v==null?void 0:v.config)==null?void 0:N.headers)==null?void 0:M.key;C==="sig-wave"&&(C="sig-wave-particle"),C==="swell"&&(C="swell-particle"),C&&L&&(this.weatherLayers[C]={raw:L,type:((T=v==null?void 0:v.config)==null?void 0:T.responseType)==="blob"?"image":"json",etime:k.data.etime})})}if(new Date().valueOf()-(e+a),this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const x=(c=this.weatherLayers["current-direction"])==null?void 0:c.raw,b=(m=this.weatherLayers["current-speed"])==null?void 0:m.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:x,speed:{raw:b},etime:k.data.etime}}if(this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const x=(d=this.weatherLayers["swell-direction"])==null?void 0:d.raw,b=(u=this.weatherLayers["swell-height"])==null?void 0:u.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers["swell-direction-contour"]={type:"json",direction:x,height:{raw:b},etime:k.data.etime}}}}this.handleWeatherLayerToggle(),this.handleDrawWeather4Json(),this.$nextTick(()=>{var h,y,k,x,b;(b=(x=(k=(y=(h=this.$parent)==null?void 0:h.$refs)==null?void 0:y.idmBottomBar)==null?void 0:k.$refs)==null?void 0:x.capture)==null||b.captureCurrentFrame()})}},handleWeatherLayerToggle(){for(const t in this.weatherLayers)this.weatherLayers[t].active=!1,this.weatherLayers[t].version=Math.random()+1;for(const t of this.activeWeatherLayers){let e=t.key;e==="current-direction"&&(e="current"),this.weatherLayers[e]&&(this.weatherLayers[e].active=!0,this.weatherLayers[e].version=Math.random()+1,e==="wind-particle"&&(this.weatherLayers[e].particle=this.showWindParticle),e==="current-particle"&&(this.weatherLayers[e].particle=this.showCurrentParticle),e==="sig-wave-particle"&&(this.weatherLayers[e].particle=this.showSigWaveParticle),e==="swell-particle"&&(this.weatherLayers[e].particle=this.showSwellParticle))}},handleWeatherLayerChange(t={sourceChanged:!1}){var a;const e=(a=this.activeWeatherLayers)==null?void 0:a.reduce((r,i)=>r+(r&(i==null?void 0:i.weight)?0:i==null?void 0:i.weight),0);t!=null&&t.sourceChanged||this.weatherWeight!==e?(this.weatherWeight=e,this.fetchWeatherLayers()):this.handleWeatherLayerToggle()},handleRampColorInitial(){var t,e,a,r,i,l,n,s,c,m,d,u;this.viewport.map.getSource((t=this.viewport)==null?void 0:t.rampColorSource)||this.viewport.map.addSource((e=this.viewport)==null?void 0:e.rampColorSource,{type:"canvas",canvas:(a=this.viewport)==null?void 0:a.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((r=this.viewport)==null?void 0:r.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(i=this.viewport)==null?void 0:i.rampColorLayer,source:(l=this.viewport)==null?void 0:l.rampColorSource,layout:{visibility:"none"},paint:{"raster-fade-duration":0}},this.beforeLayer),this.viewport.map.getSource((n=this.viewport)==null?void 0:n.particleSource)||this.viewport.map.addSource((s=this.viewport)==null?void 0:s.particleSource,{type:"canvas",canvas:(c=this.viewport)==null?void 0:c.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((m=this.viewport)==null?void 0:m.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(d=this.viewport)==null?void 0:d.particleLayer,source:(u=this.viewport)==null?void 0:u.particleSource,layout:{visibility:"none"},paint:{"raster-fade-duration":0}},this.beforeLayer)},handleDrawWeather4Json(){var l,n,s,c,m,d,u;const t=new Date().valueOf();let e=0,a=0;const r=(l=this.map)==null?void 0:l.getBounds(),i=(n=this.map)==null?void 0:n.getZoom();if(r&&i){const f=P.LngLatHelper.convertToStdLng(r._sw.lng),g=P.LngLatHelper.convertToStdLng(r._ne.lng),p=Math.floor(r._sw.lat),h=Math.ceil(r._ne.lat);for(const y in this.weatherLayers){let k=!1;if(this.weatherLayers[y].active&&this.weatherLayers[y].type==="json"){let x=[];if(y==="current"){k=!0;const b=((s=this.weatherLayers[y])==null?void 0:s.direction)||{};for(const v in b)if(v>p&&v<h&&(!(i<=this.zoom)||v%(i<2?10:i<4?5:3)===0)){const L=b[v].lng;f>g?L.forEach((C,_)=>{var N,M,T,I,X,Q;if(i<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const q=V.point([C,v],{val:((N=b[v].val)==null?void 0:N[_])||((M=b[v].dir)==null?void 0:M[_]),spd:(T=b[v].spd)==null?void 0:T[_]});x.push(q)}}else if((C>=f&&C<=180||C>=-180&&C<=g)&&(!(i<=this.zoom)||C%(i<2?10:i<4?5:3)===0)){const q=V.point([C,v],{val:((I=b[v].val)==null?void 0:I[_])||((X=b[v].dir)==null?void 0:X[_]),spd:(Q=b[v].spd)==null?void 0:Q[_]});x.push(q)}}):L.forEach((C,_)=>{var N,M,T,I,X,Q;if(f<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const q=V.point([C,v],{val:((N=b[v].val)==null?void 0:N[_])||((M=b[v].dir)==null?void 0:M[_]),spd:(T=b[v].spd)==null?void 0:T[_]});x.push(q)}}else if(C>=f&&C<=g&&(!(i<=this.zoom)||C%(i<this.zoom/2?5:3)===0)){const q=V.point([C,v],{val:((I=b[v].val)==null?void 0:I[_])||((X=b[v].dir)==null?void 0:X[_]),spd:(Q=b[v].spd)==null?void 0:Q[_]});x.push(q)}})}a=new Date().valueOf()-(t+e);const A=this.weatherLayers[y].speed;if(A){if(!A.data){const L=[];for(const C in(c=A.raw)==null?void 0:c.Polygon){const _=A.raw.Polygon[C];for(const N of _)L.push(V.polygon(N,{val:Number(C)}))}A.data=V.featureCollection(L)}const v=i<this.zoom?A.data.features.filter(L=>L.properties.val>.5):A.data.features;x=x.concat(v),a=new Date().valueOf()-(t+e)}}else if(y==="wind"){k=!0;const b=this.weatherLayers.wind.raw;for(const A in b)if(A>p&&A<h&&(!(i<=this.zoom)||A%(i<2?10:i<4?5:3)===0)){const v=b[A].lng;f>g?v.forEach((L,C)=>{var _,N,M,T;if(i<2){if((L>=0&&L<=360||L>=-360&&L<=0)&&L%10===0){const I=V.point([L,A],{dir:((_=b[A].val)==null?void 0:_[C])||((N=b[A].dir)==null?void 0:N[C]),spd:b[A].spd[C]});x.push(I)}}else if((L>=f&&L<=180||L>=-180&&L<=g)&&(!(i<=this.zoom)||L%(i<2?10:i<4?5:3)===0)){const I=V.point([L,A],{dir:((M=b[A].val)==null?void 0:M[C])||((T=b[A].dir)==null?void 0:T[C]),spd:b[A].spd[C]});x.push(I)}}):v.forEach((L,C)=>{var _,N,M,T;if(i<2){if((L>=0&&L<=360||L>=-360&&L<=0)&&L%10===0){const I=V.point([L,A],{dir:((_=b[A].val)==null?void 0:_[C])||((N=b[A].dir)==null?void 0:N[C]),spd:b[A].spd[C]});x.push(I)}}else if(L>=f&&L<=g&&(!(i<=this.zoom)||L%(i<2?10:i<4?5:3)===0)){const I=V.point([L,A],{dir:((M=b[A].val)==null?void 0:M[C])||((T=b[A].dir)==null?void 0:T[C]),spd:b[A].spd[C]});x.push(I)}})}a=new Date().valueOf()-(t+e)}else if(y==="sig-wave-height"){if(this.weatherLayers[y].data)x=this.weatherLayers[y].data;else{k=!0;const b=this.weatherLayers[y].raw;if(b){const A=[];for(const v in b.Polygon){const L=b.Polygon[v];for(const C of L)A.push(V.polygon(C,{val:Number(v)}))}for(const v in b.MultiPolygon){const L=b.MultiPolygon[v];for(const C of L)A.push(V.multiPolygon(C,{val:Number(v)}))}for(const v in b.Point){const L=b.Point[v];for(let C=0;C<((m=L.lng)==null?void 0:m.length);C++)A.push(V.point([L.lng[C],v],{val:Number(L.val[C])}))}x=x.concat(A)}}a=new Date().valueOf()-(t+e)}else if(y==="prmsl"){if(this.weatherLayers[y].data)x=this.weatherLayers[y].data;else{k=!0;const b=this.weatherLayers[y].raw;if(b){const A=[];for(const v in b.LineString){const L=b.LineString[v];for(const C of L)A.push(V.lineString(C,{val:Number(v)}))}for(const v in b.Point)b.Point[v].lng.forEach((L,C)=>{L=P.LngLatHelper.convertToStdLng(L),A.push(V.point([L,v],{val:b.Point[v].val[C],type:b.Point[v].type[C]}))});x=x.concat(A)}}a=new Date().valueOf()-(t+e)}else if(y==="swell-direction-contour"){k=!0;const b=((d=this.weatherLayers[y])==null?void 0:d.direction)||{};for(const v in b)if(v>p&&v<h&&(!(i<=this.zoom)||v%(i<2?10:i<4?5:3)===0)){const L=b[v].lng;f>g?L.forEach((C,_)=>{var N,M,T,I,X,Q;if(i<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const q=V.point([C,v],{val:((N=b[v].val)==null?void 0:N[_])||((M=b[v].dir)==null?void 0:M[_]),spd:(T=b[v].spd)==null?void 0:T[_]});x.push(q)}}else if((C>=f&&C<=180||C>=-180&&C<=g)&&(!(i<=this.zoom)||C%(i<2?10:i<4?5:3)===0)){const q=V.point([C,v],{val:((I=b[v].val)==null?void 0:I[_])||((X=b[v].dir)==null?void 0:X[_]),spd:(Q=b[v].spd)==null?void 0:Q[_]});x.push(q)}}):L.forEach((C,_)=>{var N,M,T,I,X,Q;if(f<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const q=V.point([C,v],{val:((N=b[v].val)==null?void 0:N[_])||((M=b[v].dir)==null?void 0:M[_]),spd:(T=b[v].spd)==null?void 0:T[_]});x.push(q)}}else if(C>=f&&C<=g&&(!(i<=this.zoom)||C%(i<2?10:i<4?5:3)===0)){const q=V.point([C,v],{val:((I=b[v].val)==null?void 0:I[_])||((X=b[v].dir)==null?void 0:X[_]),spd:(Q=b[v].spd)==null?void 0:Q[_]});x.push(q)}})}a=new Date().valueOf()-(t+e),console.log("swell direction elapsed: ",a,", total: ",e+=a);const A=this.weatherLayers[y].height;if(A){if(!A.data){const v=[];for(const L in(u=A.raw)==null?void 0:u.LineString){const C=A.raw.LineString[L];for(const _ of C)v.push(V.lineString(_,{val:Number(L)}));A.data=V.featureCollection(v)}}if(A.data){const v=this.handleBboxClip(A.data,r);x=x.concat(v)}a=new Date().valueOf()-(t+e),console.log("swell height elapsed: ",a,", total: ",e+=a)}}x.length&&(this.weatherLayers[y].data=V.featureCollection(x)),k&&(this.weatherLayers[y].version=Math.random()+1)}}}},handleBboxClip(t,e){const a=[],r=P.LngLatHelper.convertToStdLng(e._sw.lng),i=P.LngLatHelper.convertToStdLng(e._ne.lng);return t.features.forEach(l=>{if(l.geometry.type!=="Point")if(r>i){let n=[r,e._sw.lat,180,e._ne.lat],s=V.bboxClip(l,n);s.geometry.coordinates.length&&a.push(s),n=[-180,e._sw.lat,i,e._ne.lat],s=V.bboxClip(l,n),s.geometry.coordinates.length&&a.push(s)}else{const n=[r,e._sw.lat,i,e._ne.lat],s=V.bboxClip(l,n);s.geometry.coordinates.length&&a.push(s)}else a.push(l)}),a},handleMove4Weather(){for(const t in this.weatherLayers)this.weatherLayers[t].active&&this.weatherLayers[t].type==="image"&&(this.weatherLayers[t].active=!0,this.weatherLayers[t].version=Math.random()+1);this.handleDrawWeather4Json()}}},Lm={class:"idm-gl4-meteo-layers"},vm={key:0,class:"legend-tip-btn-gl4"},Cm={class:"d-flex flex-row justify-start align-center flex-wrap text-body-2"},zm={class:"d-flex flex-row justify-center align-center"},_m={class:"text-caption"},Sm={class:"d-flex flex-row justify-start align-center flex-wrap text-body-2"},Pm={class:"d-flex flex-row justify-center align-center"},Nm={key:0,style:{width:"24px",height:"12px",border:"1px solid rgba(var(--v-border-color), var(--v-border-opacity))"}},Mm={class:"text-caption px-2"},Tm={class:"d-flex flex-row justify-start align-start flex-wrap text-body-2 ml-n1"},Vm={class:"d-flex flex-row justify-start align-center"},Em={class:"d-flex flex-row justify-center align-center",style:{width:"40px"}},Rm={class:"text-caption"},Dm={class:"d-flex justify-start align-center ga-3"},Bm={class:"text-h5 font-weight-medium"},Im={key:0,class:"w-100 d-flex justify-space-between align-center ga-1 mb-2 px-3"},Fm={key:0,class:"d-flex justify-start align-center ga-4 pl-6"},Gm={key:1,class:"d-flex justify-start align-center ga-4 pl-6"},jm={key:2,class:"d-flex justify-start align-center ga-4 pl-6"},Wm={key:3,class:"d-flex justify-start align-center ga-4 pl-6"},Zm={class:"text-body-1 py-2"},Hm={class:"text-body-1 font-weight-medium"},Xm={class:"text-body-2 text-label"},Om={class:"text-body-2 text-label"},Ym={class:"text-body-2 text-label mb-3"},Um={class:"text-body-1 font-weight-medium"},Jm={class:"text-body-2 text-label"},Km={class:"text-body-2 text-label"},Qm={class:"text-body-2 text-label mb-3"},qm={class:"text-body-1 py-2"},$m={class:"text-body-1 font-weight-medium"},ed={class:"text-body-2 text-label"},td={class:"text-body-2 text-label"},od={class:"text-body-2 text-label mb-3"},ad={class:"text-body-1 font-weight-medium"},id={class:"text-body-2 text-label"},rd={class:"text-body-2 text-label"},ld={class:"text-body-2 text-label mb-3"},nd={class:"text-body-1 py-2"},sd={class:"text-body-1 font-weight-medium"},cd={class:"text-body-2 text-label"},md={class:"text-body-2 text-label"},dd={class:"text-body-2 text-label mb-3"};function hd(t,e,a,r,i,l){var S,W,Z,ee,j,B,J,E,O,$,de,ue,re,ge,ye,_e;const n=o.resolveComponent("VBtn"),s=o.resolveComponent("VTooltip"),c=o.resolveComponent("VCardText"),m=o.resolveComponent("VDivider"),d=o.resolveComponent("VCard"),u=o.resolveComponent("VSwitch"),f=o.resolveComponent("VBtnToggle"),g=o.resolveComponent("VCardTitle"),p=o.resolveComponent("VCardItem"),h=o.resolveComponent("VCheckbox"),y=o.resolveComponent("VRadio"),k=o.resolveComponent("IdmWindBarb"),x=o.resolveComponent("IdmSigWaveHeight"),b=o.resolveComponent("IdmCurrentDirection"),A=o.resolveComponent("IdmSwellDirection"),v=o.resolveComponent("IdmPrmsl"),L=o.resolveComponent("IdmWindParticle"),C=o.resolveComponent("IdmCurrentParticle"),_=o.resolveComponent("IdmSigWaveParticle"),N=o.resolveComponent("IdmSwellParticle"),M=o.resolveComponent("IdmIceEdge"),T=o.resolveComponent("IdmIceCover"),I=o.resolveComponent("IdmIceThickness"),X=o.resolveComponent("IdmPrecip3h"),Q=o.resolveComponent("IdmVisibility"),q=o.resolveComponent("IdmWaterTemp"),le=o.resolveComponent("IdmTemp");return o.openBlock(),o.createElementBlock("div",Lm,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+46+"px",right:i.right+"px"})},[o.createVNode(s,{text:t.$t("weather.weatherLayers"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:U})=>[o.createVNode(n,o.mergeProps(U,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[10]||(e[10]=[o.createElementVNode("i",{class:"iconfont icon-Weather text-h4"},null,-1)])),_:2,__:[10]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),l.showTipMenu?(o.openBlock(),o.createElementBlock("div",vm,[o.createElementVNode("div",{class:o.normalizeClass(["menu-bar-box pa-1 rounded",a.simple?"simple":""]),style:o.normalizeStyle({right:i.right+"px",top:a.simple?"394px":l.lengendTipTop+"px"})},[o.createVNode(s,{text:t.$t("weather.legend"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:U})=>[o.createVNode(n,o.mergeProps(U,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.legendToggle?"bg-primary active-border":""],onClick:e[0]||(e[0]=ne=>i.legendToggle=!i.legendToggle)}),{default:o.withCtx(()=>e[11]||(e[11]=[o.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[11]},1040,["class"])]),_:1},8,["text","open-on-focus","open-on-hover"])],6),i.legendToggle?(o.openBlock(),o.createBlock(d,{key:0,elevation:"16",class:"card-info d-flex justify-center align-start",style:o.normalizeStyle({position:"absolute",top:a.simple?"200px":"340px",right:i.right+50+"px"})},{default:o.withCtx(()=>[o.createVNode(c,{class:"d-flex flex-column justify-center align-start text-label px-1",style:{width:"120px"}},{default:o.withCtx(()=>[e[12]||(e[12]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2 mx-1"},"Wind Level",-1)),o.createElementVNode("div",Cm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.barbs,(U,ne)=>(o.openBlock(),o.createElementBlock("div",{key:U,class:"w-50 d-flex flex-row justify-start align-center py-1 px-0 ma-0"},[o.createElementVNode("div",zm,[o.createElementVNode("i",{class:o.normalizeClass(["iconfont",l.barbsIconName[ne]]),style:o.normalizeStyle({color:a.theme==="dark"?"#fff":"#000"})},null,6),o.createElementVNode("span",_m,o.toDisplayString(Number(U)<10?`00${U}kts`:Number(U)<100?`0${U}kts`:`${U}kts`),1)])]))),128))])]),_:1,__:[12]}),o.createVNode(m,{vertical:""}),o.createVNode(c,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"100px"}},{default:o.withCtx(()=>[e[13]||(e[13]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Wave Height",-1)),o.createElementVNode("div",Sm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.sigWaveHeight,(U,ne)=>(o.openBlock(),o.createElementBlock("div",{key:ne,class:"w-100 d-flex flex-row justify-start align-center py-1 px-0 ma-0"},[o.createElementVNode("div",Pm,[ne===0?(o.openBlock(),o.createElementBlock("div",Nm)):(o.openBlock(),o.createElementBlock("div",{key:1,style:o.normalizeStyle({width:"24px",height:"12px",background:U.color})},null,4)),o.createElementVNode("div",Mm,o.toDisplayString(U.label),1)])]))),128))])]),_:1,__:[13]}),o.createVNode(m,{vertical:""}),o.createVNode(c,{class:"d-flex flex-column justify-center align-start text-label pl-0 pr-2",style:{width:"100px"}},{default:o.withCtx(()=>[e[14]||(e[14]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2 mx-2"},"Current",-1)),o.createElementVNode("div",Tm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.current,(U,ne)=>(o.openBlock(),o.createElementBlock("div",{key:ne,class:"w-100 d-flex flex-row justify-center align-center py-1 px-0 ma-0"},[o.createElementVNode("div",Vm,[o.createElementVNode("div",Em,[o.createElementVNode("i",{class:"iconfont icon-a-direction-arrow text-label",style:o.normalizeStyle({fontSize:40*U.size+"px"})},null,4)]),o.createElementVNode("div",Rm,o.toDisplayString(U.label),1)])]))),128))])]),_:1,__:[14]})]),_:1},8,["style"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["available-layers transition d-flex flex-column justify-start align-start",i.toggle?"right-bar":""]),style:o.normalizeStyle(l.listStyle)},[o.createElementVNode("div",{class:o.normalizeClass(["header-box w-100 d-flex justify-space-between align-center",a.simple?"px-3":"px-4"])},[o.createElementVNode("div",Dm,[o.createElementVNode("div",Bm,o.toDisplayString(t.$t("weather.weather")),1),o.createVNode(u,{modelValue:i.autoActive,"onUpdate:modelValue":e[1]||(e[1]=U=>i.autoActive=U),class:"small-switch",color:"primary","base-color":"disabled",inset:"","hide-details":""},null,8,["modelValue"])]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:o.withCtx(()=>e[15]||(e[15]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[15]},8,["onClick"])],2),a.simple?(o.openBlock(),o.createElementBlock("div",Im,[o.createElementVNode("div",null,o.toDisplayString(t.$t("weather.forecastModel")),1),o.createVNode(f,{modelValue:i.currentModel,"onUpdate:modelValue":e[2]||(e[2]=U=>i.currentModel=U),rounded:"",height:"28",density:"compact",mandatory:"",group:""},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"28",value:"GFS",class:"text-none btn-bg-2 px-1 text-body-1 mt-1",color:i.currentModel==="GFS"?"primary":"","base-color":""},{default:o.withCtx(()=>e[16]||(e[16]=[o.createTextVNode(" NOAA ",-1)])),_:1,__:[16]},8,["color"]),o.createVNode(n,{density:"compact",height:"28",class:"text-none btn-bg-2 px-1 text-body-1 mt-1",color:i.currentModel==="ECMWF"?"primary":"","base-color":"",value:"ECMWF"},{default:o.withCtx(()=>e[17]||(e[17]=[o.createTextVNode(" ECMWF ",-1)])),_:1,__:[17]},8,["color"])]),_:1},8,["modelValue"])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["list-box w-100 scroll overflow-y-auto",[i.autoActive?"":"cursor-not-allowed",a.simple?"px-3":"pl-4 pr-2"]])},[o.createVNode(d,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(g,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.overlays")),1)]),_:1})]),_:1}),o.createVNode(c,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(U=>U.overlays),U=>(o.openBlock(),o.createBlock(h,{key:U.key,modelValue:i.checkList,"onUpdate:modelValue":e[3]||(e[3]=ne=>i.checkList=ne),value:U.key,label:t.$t(`weather.${U.locale}`),disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label","disabled"]))),128))]),_:1})]),_:1}),o.createVNode(d,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(g,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.renders")),1)]),_:1})]),_:1}),o.createVNode(c,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(U=>!U.overlays),U=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:U.key},[o.createVNode(y,{modelValue:i.renderKey,"onUpdate:modelValue":e[4]||(e[4]=ne=>i.renderKey=ne),label:t.$t(`weather.${U.locale}`),value:U.key,disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"text-body-2 py-1","hide-details":"",onClick:ne=>i.renderKey=i.renderKey===U.key?"":U.key},null,8,["modelValue","label","value","disabled","onClick"]),i.renderKey==="wind-particle"&&U.key==="wind-particle"?(o.openBlock(),o.createElementBlock("div",Fm,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(u,{modelValue:i.showWindParticle,"onUpdate:modelValue":e[5]||(e[5]=ne=>i.showWindParticle=ne),label:"",class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"",style:{"font-size":"14px"},"hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="current-particle"&&U.key==="current-particle"?(o.openBlock(),o.createElementBlock("div",Gm,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(u,{modelValue:i.showCurrentParticle,"onUpdate:modelValue":e[6]||(e[6]=ne=>i.showCurrentParticle=ne),label:"",class:"small-switch",color:"primary","base-color":"disabled",inset:"",density:"compact",height:"20","hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="sig-wave-particle"&&U.key==="sig-wave-particle"?(o.openBlock(),o.createElementBlock("div",jm,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(u,{modelValue:i.showSigWaveParticle,"onUpdate:modelValue":e[7]||(e[7]=ne=>i.showSigWaveParticle=ne),class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"","hide-details":"",disabled:!i.autoActive},null,8,["modelValue","disabled"])])):o.createCommentVNode("",!0),i.renderKey==="swell-particle"&&U.key==="swell-particle"?(o.openBlock(),o.createElementBlock("div",Wm,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(u,{modelValue:i.showSwellParticle,"onUpdate:modelValue":e[8]||(e[8]=ne=>i.showSwellParticle=ne),class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"","hide-details":"",disabled:!i.autoActive},null,8,["modelValue","disabled"])])):o.createCommentVNode("",!0),i.renderKey==="ice-forecast"&&U.key==="ice-forecast"?(o.openBlock(),o.createBlock(f,{key:4,modelValue:i.iceToggleValue,"onUpdate:modelValue":e[9]||(e[9]=ne=>i.iceToggleValue=ne),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",mandatory:"",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"ice-cover",class:"w-50 text-none px-2 text-body-1",color:i.iceToggleValue==="ice-cover"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.coverage")),1)]),_:1},8,["color","disabled"]),o.createVNode(n,{density:"compact",height:"30",class:"w-50 text-none px-2 text-body-1",color:i.iceToggleValue==="ice-thickness"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive,value:"ice-thickness"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.thickness")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):o.createCommentVNode("",!0)],64))),128))]),_:1})]),_:1}),o.createVNode(d,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(g,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.forecastModel")),1)]),_:1})]),_:1}),o.createVNode(c,{class:""},{default:o.withCtx(()=>{var U,ne,Fe,Ge,Re,Ce,je,Te,Ve,De,We,Ze,Be,xe,ke,ze,He,Xe,Oe,Pe,it,rt,lt,nt,st,ct,mt,dt,ht,pt,gt,ut,ft,yt,bt,wt,xt,kt,At,Lt,vt,Ct,zt,_t,St,Pt,Nt,Mt,Tt,Vt,Et,Rt,Dt,Bt,It,Ft,Gt,jt,Wt,Ne,Ee,Zt,Ye,Ht,et,Ae,Ue,ie,Le,Y,H,Je,Ie,Se,F,Xt,te,ve,Ke,tt,ot,D,Qe,G,qe,Yt,se,eo,me,yo,bo,wo,xo,ko,Ao,Lo,vo,Co,zo,_o,So,Po,No,Mo,To;return[o.createElementVNode("div",Zm,o.toDisplayString(t.$t("weather.atmospheric")),1),o.createElementVNode("div",Hm,o.toDisplayString((Fe=(ne=(U=i.models)==null?void 0:U.weather)==null?void 0:ne.NOAA)==null?void 0:Fe.source)+" "+o.toDisplayString((Ce=(Re=(Ge=i.models)==null?void 0:Ge.weather)==null?void 0:Re.NOAA)==null?void 0:Ce.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((De=(Ve=(Te=(je=i.models)==null?void 0:je.weather)==null?void 0:Te.NOAA)==null?void 0:Ve.meta)==null?void 0:De.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Xm,o.toDisplayString(t.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",Om,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((xe=(Be=(Ze=(We=i.models)==null?void 0:We.weather)==null?void 0:Ze.NOAA)==null?void 0:Be.meta)==null?void 0:xe.availabilityTime)),1),o.createElementVNode("div",Ym,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Xe=(He=(ze=(ke=i.models)==null?void 0:ke.weather)==null?void 0:ze.NOAA)==null?void 0:He.meta)==null?void 0:Xe.initialisationTime)),1),o.createElementVNode("div",Um,o.toDisplayString((it=(Pe=(Oe=i.models)==null?void 0:Oe.weather)==null?void 0:Pe.ECMWF)==null?void 0:it.source)+" "+o.toDisplayString((nt=(lt=(rt=i.models)==null?void 0:rt.weather)==null?void 0:lt.ECMWF)==null?void 0:nt.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((dt=(mt=(ct=(st=i.models)==null?void 0:st.weather)==null?void 0:ct.ECMWF)==null?void 0:mt.meta)==null?void 0:dt.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Jm,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",Km,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((ut=(gt=(pt=(ht=i.models)==null?void 0:ht.weather)==null?void 0:pt.ECMWF)==null?void 0:gt.meta)==null?void 0:ut.availabilityTime)),1),o.createElementVNode("div",Qm,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((wt=(bt=(yt=(ft=i.models)==null?void 0:ft.weather)==null?void 0:yt.ECMWF)==null?void 0:bt.meta)==null?void 0:wt.initialisationTime)),1),o.createVNode(m),o.createElementVNode("div",qm,o.toDisplayString(t.$t("weather.wave")),1),o.createElementVNode("div",$m,o.toDisplayString((Lt=(At=(kt=(xt=i.models)==null?void 0:xt.marine)==null?void 0:kt.wave)==null?void 0:At.NOAA)==null?void 0:Lt.source)+" "+o.toDisplayString((_t=(zt=(Ct=(vt=i.models)==null?void 0:vt.marine)==null?void 0:Ct.wave)==null?void 0:zt.NOAA)==null?void 0:_t.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((Tt=(Mt=(Nt=(Pt=(St=i.models)==null?void 0:St.marine)==null?void 0:Pt.wave)==null?void 0:Nt.NOAA)==null?void 0:Mt.meta)==null?void 0:Tt.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",ed,o.toDisplayString(t.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",td,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((Bt=(Dt=(Rt=(Et=(Vt=i.models)==null?void 0:Vt.marine)==null?void 0:Et.wave)==null?void 0:Rt.NOAA)==null?void 0:Dt.meta)==null?void 0:Bt.availabilityTime)),1),o.createElementVNode("div",od,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Wt=(jt=(Gt=(Ft=(It=i.models)==null?void 0:It.marine)==null?void 0:Ft.wave)==null?void 0:Gt.NOAA)==null?void 0:jt.meta)==null?void 0:Wt.initialisationTime)),1),o.createElementVNode("div",ad,o.toDisplayString((Ye=(Zt=(Ee=(Ne=i.models)==null?void 0:Ne.marine)==null?void 0:Ee.wave)==null?void 0:Zt.ECMWF)==null?void 0:Ye.source)+" "+o.toDisplayString((Ue=(Ae=(et=(Ht=i.models)==null?void 0:Ht.marine)==null?void 0:et.wave)==null?void 0:Ae.ECMWF)==null?void 0:Ue.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((Je=(H=(Y=(Le=(ie=i.models)==null?void 0:ie.marine)==null?void 0:Le.wave)==null?void 0:Y.ECMWF)==null?void 0:H.meta)==null?void 0:Je.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",id,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",rd,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((te=(Xt=(F=(Se=(Ie=i.models)==null?void 0:Ie.marine)==null?void 0:Se.wave)==null?void 0:F.ECMWF)==null?void 0:Xt.meta)==null?void 0:te.availabilityTime)),1),o.createElementVNode("div",ld,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((D=(ot=(tt=(Ke=(ve=i.models)==null?void 0:ve.marine)==null?void 0:Ke.wave)==null?void 0:tt.ECMWF)==null?void 0:ot.meta)==null?void 0:D.initialisationTime)),1),o.createVNode(m),o.createElementVNode("div",nd,o.toDisplayString(t.$t("weather.currents")),1),o.createElementVNode("div",sd,o.toDisplayString((Yt=(qe=(G=(Qe=i.models)==null?void 0:Qe.marine)==null?void 0:G.current)==null?void 0:qe.ECMWF)==null?void 0:Yt.source)+" "+o.toDisplayString((yo=(me=(eo=(se=i.models)==null?void 0:se.marine)==null?void 0:eo.current)==null?void 0:me.ECMWF)==null?void 0:yo.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((Ao=(ko=(xo=(wo=(bo=i.models)==null?void 0:bo.marine)==null?void 0:wo.current)==null?void 0:xo.ECMWF)==null?void 0:ko.meta)==null?void 0:Ao.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",cd,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",md,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((_o=(zo=(Co=(vo=(Lo=i.models)==null?void 0:Lo.marine)==null?void 0:vo.current)==null?void 0:Co.ECMWF)==null?void 0:zo.meta)==null?void 0:_o.availabilityTime)),1),o.createElementVNode("div",dd,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((To=(Mo=(No=(Po=(So=i.models)==null?void 0:So.marine)==null?void 0:Po.current)==null?void 0:No.ECMWF)==null?void 0:Mo.meta)==null?void 0:To.initialisationTime)),1)]}),_:1})]),_:1})],2)],6),a.map?(o.openBlock(),o.createBlock(k,o.mergeProps({key:1,ref:"windBarb",map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-3",wind:(S=i.weatherLayers)==null?void 0:S.wind},t.$attrs),null,16,["map","map-feather","wind"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(x,o.mergeProps({key:2,map:a.map,"before-layer":"empty-layer-2","sig-wave-height":(W=i.weatherLayers)==null?void 0:W["sig-wave-height"]},t.$attrs),null,16,["map","sig-wave-height"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(b,o.mergeProps({key:3,map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-1",current:(Z=i.weatherLayers)==null?void 0:Z.current},t.$attrs),null,16,["map","map-feather","current"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(A,o.mergeProps({key:4,map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-1",swell:(ee=i.weatherLayers)==null?void 0:ee["swell-direction-contour"]},t.$attrs,{theme:a.theme}),null,16,["map","map-feather","swell","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(v,o.mergeProps({key:5,map:a.map,"before-layer":"empty-layer-3",prmsl:(j=i.weatherLayers)==null?void 0:j.prmsl},t.$attrs,{theme:a.theme}),null,16,["map","prmsl","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(L,o.mergeProps({key:6,viewport:i.viewport,factor:(B=i.weatherLayers)==null?void 0:B["wind-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(C,o.mergeProps({key:7,viewport:i.viewport,factor:(J=i.weatherLayers)==null?void 0:J["current-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(_,o.mergeProps({key:8,viewport:i.viewport,factor:(E=i.weatherLayers)==null?void 0:E["sig-wave-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(N,o.mergeProps({key:9,viewport:i.viewport,factor:(O=i.weatherLayers)==null?void 0:O["swell-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(M,o.mergeProps({key:10,viewport:i.viewport,factor:($=i.weatherLayers)==null?void 0:$["ice-edge"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(T,o.mergeProps({key:11,viewport:i.viewport,factor:(de=i.weatherLayers)==null?void 0:de["ice-cover"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(I,o.mergeProps({key:12,viewport:i.viewport,factor:(ue=i.weatherLayers)==null?void 0:ue["ice-thickness"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(X,o.mergeProps({key:13,viewport:i.viewport,factor:(re=i.weatherLayers)==null?void 0:re.precip3h,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(Q,o.mergeProps({key:14,viewport:i.viewport,factor:(ge=i.weatherLayers)==null?void 0:ge.visibility,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(q,o.mergeProps({key:15,viewport:i.viewport,factor:(ye=i.weatherLayers)==null?void 0:ye["water-temp"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(le,o.mergeProps({key:16,viewport:i.viewport,factor:(_e=i.weatherLayers)==null?void 0:_e.temp,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0)])}const pd=K(Am,[["render",hd]]),co=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"GFS",alias:"GFS",model:"gfs_seamless",provider:"NOAA",country:"United States",resolution:25,tips:"3-25km",length:16,frequency:1,models:["gfs_seamless"],categories:"ncep_gfs013,ncep_gfs025,ncep_gfs_graphcast025,ncep_hrrr_conus,ncep_nbm_conus",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:2,name:"ECMWF",alias:"ECMWF",model:"ecmwf_ifs025",provider:"ECMWF",country:"European Union",resolution:25,tips:"25km",length:15,frequency:6,models:["ecmwf_ifs025","ecmwf_aifs025_single","ecmwf_ifs"],categories:"ecmwf_ifs025,ecmwf_aifs025_single,ecmwf_ifs",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:3,disabled:!0,name:"ICON",alias:"ECMWF",model:"icon_seamless",provider:"Deutscher Wetterdienst (DWD)",country:"Germany",resolution:13,tips:"2-13km",length:7.5,frequency:3,models:["icon_seamless","icon_global","icon_eu","icon_d2"],categories:"dwd_icon,dwd_icon_eps,dwd_icon_d2,dwd_icon_d2_eps,dwd_icon_eu,dwd_icon_eu_eps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:4,name:"ARPEGE",disabled:!0,alias:"ECMWF",model:"arpege_seamless",provider:"Météo-France",country:"France",resolution:25,tips:"1-25km",length:4,frequency:1,models:["arpege_seamless","arpege_world","arpege_europe"],categories:"meteofrance_arpege_europe,meteofrance_arpege_europe_probabilities,meteofrance_arpege_world025",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:5,name:"UKMO",disabled:!0,alias:"ECMWF",model:"ukmo_seamless",provider:"UK Met Office",country:"United Kingdom",resolution:10,tips:"2-10km",length:7,frequency:1,models:["ukmo_seamless","ukmo_global_deterministic_10km","ukmo_uk_deterministic_2km"],categories:"ukmo_global_deterministic_10km,ukmo_uk_deterministic_2km",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:6,name:"JMA",disabled:!0,alias:"GFS",model:"jma_seamless",provider:"JMA",country:"Japan",resolution:55,tips:"5-55km",length:11,frequency:3,models:["jma_seamless","jma_msm","jma_gsm"],categories:"jma_gsm,jma_msm",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:7,name:"GEM",disabled:!0,alias:"GFS",model:"gem_seamless",provider:"Canadian Weather Service",country:"Canada",resolution:2.5,tips:"2.5km",length:10,frequency:6,models:["gem_seamless","gem_global","gem_regional"],categories:"cmc_gem_gdps,cmc_gem_hrdps,cmc_gem_rdps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:8,name:"GRAPES",disabled:!0,alias:"GFS",model:"cma_grapes_global",provider:"China Meteorological Administration (CMA)",country:"China",resolution:15,tips:"15km",length:10,frequency:6,models:["cma_grapes_global"],categories:"cma_grapes_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:9,name:"ACCESS-G",disabled:!0,alias:"GFS",model:"bom_access_global",provider:"Australian Bureau of Meteorology (BOM)",country:"Australia",resolution:15,tips:"15km",length:10,frequency:6,models:["bom_access_global"],categories:"bom_access_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"}],mo=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"MFWAM",alias:"ECMWF",model:"meteofrance_wave",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:12,models:["meteofrance_wave"],categories:"meteofrance_wave",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:2,disabled:!0,name:"SMOC",alias:"ECMWF",model:"meteofrance_currents",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:24,models:["meteofrance_currents"],categories:"meteofrance_currents, meteofrance_sea_surface_temperature",variables:"ocean_u_current,ocean_v_current,invert_barometer_height,sea_level_height_msl,sea_surface_temperature"},{rank:3,disabled:!0,name:"EWAM",alias:"ECMWF",model:"ewam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:8,frequency:2,models:["ewam"],categories:"dwd_ewam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:4,disabled:!0,name:"GWAM",alias:"ECMWF",model:"gwam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:4,frequency:2,models:["gwam"],categories:"dwd_gwam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:5,disabled:!0,name:"ECWAM",alias:"ECMWF",model:"ecmwf_wam025",provider:"ECMWF",country:"Europe",resolution:25,tips:"25km",length:10,frequency:6,models:["ecmwf_wam025"],categories:"ecmwf_wam025",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:6,name:"GFSWave",alias:"GFS",model:"ncep_gfswave025",provider:"NCEP",country:"USA",resolution:25,tips:"25km",length:10,frequency:6,models:["ncep_gfswave025","ncep_gfswave016"],categories:"ncep_gfswave025,ncep_gfswave016",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:7,disabled:!0,name:"ERA5-Ocean",alias:"ECMWF",model:"era5_ocean",provider:"Copernicus",country:"Europe",resolution:50,tips:"50km",length:-5,frequency:1,models:["era5_ocean"],categories:"copernicus_era5_ocean",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"}];let ma=class{static standardWeatherModels(){return co.filter(e=>!e.disabled&&e.alias)}static standardMarineModels(){return mo.filter(e=>!e.disabled&&e.alias)}static autoPickLayerModel(e,a="copernicus"){return a=a||"copernicus",a=a==null?void 0:a.toLowerCase(),a=["gfs","ecmwf","copernicus"].includes(a)?a:"copernicus",e=e==null?void 0:e.toLowerCase(),e==="gfs"?"gfs":["ec","ecmwf"].includes(e)?"ecmwf":["copernicus","cmems"].includes(e)?"copernicus":a}static autoPickPeerModel(e,a,r="copernicus"){if(a=this.autoPickLayerModel(a,r),el.LayerHelper.WEATHER_LAYERS.reduce((i,l)=>l.atmos?i+l.weight:i,0)&e.weight){if(a==="copernicus")return"ecmwf"}else{if(["sig-wave","sig-wave-height","sig-wave-height-contour"].includes(e.key))return a;if(a==="ecmwf")return"copernicus"}return a}static autoPickMeteoModel(e="best_match"){var a,r;e=e==null?void 0:e.toLowerCase(),e=e==="ec"?"ecmwf":e;const i=e.toLowerCase().split(","),l=[],n=[];for(const s of i){let c=co.find(d=>{var u,f,g;return((u=d.models)==null?void 0:u.includes(s))||((f=d.alias)==null?void 0:f.toLowerCase())===s||((g=d.name)==null?void 0:g.toLowerCase())===s}),m=mo.find(d=>{var u,f,g;return((u=d.models)==null?void 0:u.includes(s))||((f=d.alias)==null?void 0:f.toLowerCase())===s||((g=d.name)==null?void 0:g.toLowerCase())===s});c=c||co.find(d=>{var u,f;return((u=d.alias)==null?void 0:u.toLowerCase())===((f=m==null?void 0:m.alias)==null?void 0:f.toLowerCase())}),m=m||mo.find(d=>{var u,f;return((u=d.alias)==null?void 0:u.toLowerCase())===((f=c==null?void 0:c.alias)==null?void 0:f.toLowerCase())}),c=c||co[0],m=m||mo[0],l.push((a=c.models)!=null&&a.includes(s)?s:c.model),n.push((r=m.models)!=null&&r.includes(s)?s:m.model)}return{weatherModels:l.join(","),marineModels:n.join(",")}}static autoPickSubCategories(e){e=e.toUpperCase();const a=co.filter(l=>l.alias===e),r=mo.filter(l=>l.alias===e),i=[];return a.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),r.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),i}static pickHourly(e,a){var r,i,l,n,s,c,m,d,u,f,g,p,h,y,k,x,b,A,v,L,C,_,N,M,T,I,X,Q,q,le,S,W,Z,ee,j,B,J,E,O,$,de,ue,re,ge,ye,_e,U,ne,Fe,Ge,Re,Ce,je,Te,Ve,De,We,Ze,Be,xe,ke,ze,He,Xe,Oe,Pe,it,rt,lt,nt,st,ct,mt,dt,ht,pt,gt,ut,ft,yt,bt,wt,xt,kt,At,Lt,vt,Ct,zt,_t,St,Pt,Nt,Mt,Tt,Vt,Et,Rt,Dt,Bt,It,Ft,Gt,jt,Wt,Ne,Ee,Zt,Ye,Ht,et,Ae,Ue;const ie=typeof a=="string"?z(a):a;let Le=ie.clone();const Y=e==null?void 0:e.weather,H=e==null?void 0:e.marine,Je=((i=(r=Y==null?void 0:Y[0])==null?void 0:r.hourly)==null?void 0:i.date)||((n=(l=H==null?void 0:H[0])==null?void 0:l.hourly)==null?void 0:n.date),Ie=z.utc(Je),Se=Ie.clone().add(((m=(c=(s=Y==null?void 0:Y[0])==null?void 0:s.hourly)==null?void 0:c.time)==null?void 0:m.at(0))||((f=(u=(d=H==null?void 0:H[0])==null?void 0:d.hourly)==null?void 0:u.time)==null?void 0:f.at(0)),"h"),F=Ie.clone().add(((h=(p=(g=Y==null?void 0:Y[0])==null?void 0:g.hourly)==null?void 0:p.time)==null?void 0:h.at(-1))||((x=(k=(y=H==null?void 0:H[0])==null?void 0:y.hourly)==null?void 0:k.time)==null?void 0:x.at(-1)),"h"),Xt=[];Le=Le.isBefore(Se)?Se.clone():Le,Le=Le.isAfter(F)?F.clone():Le;const te=Le.utc().diff(Se,"h",!1);let ve,Ke;if(Y!=null&&Y.length){let tt=0,ot=0,D=0;for(const Qe of Y){const G=Qe==null?void 0:Qe.hourly;for(let me=te-(te-1)%3;me<=te;me++)tt+=((b=G==null?void 0:G.precipitation)==null?void 0:b.at(me))??0;for(let me=te-(te-1)%6;me<=te;me++)ot+=((A=G==null?void 0:G.precipitation)==null?void 0:A.at(me))??0;for(let me=te-(te-1)%12;me<=te;me++)D+=((v=G==null?void 0:G.precipitation)==null?void 0:v.at(me))??0;const qe=((L=G==null?void 0:G.wind_direction_10m)==null?void 0:L.at(te))??((_=(C=G==null?void 0:G.wind_direction_10m)==null?void 0:C.filter(me=>me!==null))==null?void 0:_.at(-1));ve={temp:((N=G==null?void 0:G.temperature_2m)==null?void 0:N.at(te))??((T=(M=G==null?void 0:G.temperature_2m)==null?void 0:M.filter(me=>me!==null))==null?void 0:T.at(-1)),apparentTemp:((I=G==null?void 0:G.apparent_temperature)==null?void 0:I.at(te))??((Q=(X=G==null?void 0:G.apparent_temperature)==null?void 0:X.filter(me=>me!==null))==null?void 0:Q.at(-1)),rh:((q=G==null?void 0:G.relative_humidity_2m)==null?void 0:q.at(te))??((S=(le=G==null?void 0:G.relative_humidity_2m)==null?void 0:le.filter(me=>me!==null))==null?void 0:S.at(-1)),dp:((W=G==null?void 0:G.dew_point_2m)==null?void 0:W.at(te))??((ee=(Z=G==null?void 0:G.dew_point_2m)==null?void 0:Z.filter(me=>me!==null))==null?void 0:ee.at(-1)),precip:{probability:((j=G==null?void 0:G.precipitation_probability)==null?void 0:j.at(te))??0,sum:((B=G==null?void 0:G.precipitation)==null?void 0:B.at(te))??0,sum1Hours:((J=G==null?void 0:G.precipitation)==null?void 0:J.at(te))??0,sum3Hours:Math.round(tt*100)/100,sum6Hours:Math.round(ot*100)/100,sum12Hours:Math.round(D*100)/100},pmsl:((E=G==null?void 0:G.pressure_msl)==null?void 0:E.at(te))??(($=(O=G==null?void 0:G.pressure_msl)==null?void 0:O.filter(me=>me!==null))==null?void 0:$.at(-1)),psurf:((de=G==null?void 0:G.surface_pressure)==null?void 0:de.at(te))??((re=(ue=G==null?void 0:G.surface_pressure)==null?void 0:ue.filter(me=>me!==null))==null?void 0:re.at(-1)),code:((ge=G==null?void 0:G.weather_code)==null?void 0:ge.at(te))??((_e=(ye=G==null?void 0:G.weather_code)==null?void 0:ye.filter(me=>me!==null))==null?void 0:_e.at(-1)),visibility:this.m2nm(((U=G==null?void 0:G.visibility)==null?void 0:U.at(te))??((Fe=(ne=G==null?void 0:G.visibility)==null?void 0:ne.filter(me=>me!==null))==null?void 0:Fe.at(-1))),wind:{speed:((Ge=G==null?void 0:G.wind_speed_10m)==null?void 0:Ge.at(te))??((Ce=(Re=G==null?void 0:G.wind_speed_10m)==null?void 0:Re.filter(me=>me!==null))==null?void 0:Ce.at(-1)),kts:((je=G==null?void 0:G.wind_speed_10m)==null?void 0:je.at(te))??((Ve=(Te=G==null?void 0:G.wind_speed_10m)==null?void 0:Te.filter(me=>me!==null))==null?void 0:Ve.at(-1)),degree:qe,bearing:qe!==null?Math.round((qe+180)%360):null,gusts:((De=G==null?void 0:G.wind_gusts_10m)==null?void 0:De.at(te))??((Ze=(We=G==null?void 0:G.wind_gusts_10m)==null?void 0:We.filter(me=>me!==null))==null?void 0:Ze.at(-1))},isDay:(Be=G==null?void 0:G.is_day)==null?void 0:Be.at(te)};const{name:Yt,url:se,bg:eo}=this.parseWeatherCode(ve.code,ve.isDay);ve.name=Yt,ve.url=se,ve.bg=eo,ve.wind.scale=this.beaufort(this.kts2ms(ve.wind.kts)),ve.wind.direction=this.degree2Direction(ve.wind.degree),Xt.push({utc:ie.utc().format(),realUTC:Se.add(te,"h").format(),model:Qe.model,weather:{...ve}})}}if(H!=null&&H.length){let tt=0;for(const ot of H){const D=ot==null?void 0:ot.hourly,Qe=((xe=D==null?void 0:D.wave_direction)==null?void 0:xe.at(te))??((ze=(ke=D==null?void 0:D.wave_direction)==null?void 0:ke.filter(se=>se!==null))==null?void 0:ze.at(-1)),G=((He=D==null?void 0:D.swell_wave_direction)==null?void 0:He.at(te))??((Oe=(Xe=D==null?void 0:D.swell_wave_direction)==null?void 0:Xe.filter(se=>se!==null))==null?void 0:Oe.at(-1)),qe=((Pe=D==null?void 0:D.wind_wave_direction)==null?void 0:Pe.at(te))??((rt=(it=D==null?void 0:D.wind_wave_direction)==null?void 0:it.filter(se=>se!==null))==null?void 0:rt.at(-1)),Yt=((lt=D==null?void 0:D.ocean_current_direction)==null?void 0:lt.at(te))??((st=(nt=D==null?void 0:D.ocean_current_direction)==null?void 0:nt.filter(se=>se!==null))==null?void 0:st.at(-1));Ke={wave:{sig:{height:((ct=D==null?void 0:D.wave_height)==null?void 0:ct.at(te))??((dt=(mt=D==null?void 0:D.wave_height)==null?void 0:mt.filter(se=>se!==null))==null?void 0:dt.at(-1)),degree:Qe,bearing:Qe!==null?Math.round((Qe+180)%360):null,period:((ht=D==null?void 0:D.wave_period)==null?void 0:ht.at(te))??((gt=(pt=D==null?void 0:D.wave_period)==null?void 0:pt.filter(se=>se!==null))==null?void 0:gt.at(-1))},swell:{height:((ut=D==null?void 0:D.swell_wave_height)==null?void 0:ut.at(te))??((yt=(ft=D==null?void 0:D.swell_wave_height)==null?void 0:ft.filter(se=>se!==null))==null?void 0:yt.at(-1)),degree:G,bearing:G!==null?Math.round((G+180)%360):null,period:((bt=D==null?void 0:D.swell_wave_period)==null?void 0:bt.at(te))??((xt=(wt=D==null?void 0:D.swell_wave_period)==null?void 0:wt.filter(se=>se!==null))==null?void 0:xt.at(-1)),peakPeriod:((kt=D==null?void 0:D.swell_wave_peak_period)==null?void 0:kt.at(te))??((Lt=(At=D==null?void 0:D.swell_wave_peak_period)==null?void 0:At.filter(se=>se!==null))==null?void 0:Lt.at(-1))},wd:{height:((vt=D==null?void 0:D.wind_wave_height)==null?void 0:vt.at(te))??((zt=(Ct=D==null?void 0:D.wind_wave_height)==null?void 0:Ct.filter(se=>se!==null))==null?void 0:zt.at(-1)),degree:qe,bearing:qe!==null?Math.round((qe+180)%360):null,period:((_t=D==null?void 0:D.wind_wave_period)==null?void 0:_t.at(te))??((Pt=(St=D==null?void 0:D.wind_wave_period)==null?void 0:St.filter(se=>se!==null))==null?void 0:Pt.at(-1)),peakPeriod:((Nt=D==null?void 0:D.wind_wave_peak_period)==null?void 0:Nt.at(te))??((Tt=(Mt=D==null?void 0:D.wind_wave_peak_period)==null?void 0:Mt.filter(se=>se!==null))==null?void 0:Tt.at(-1))}},current:{speed:((Vt=D==null?void 0:D.ocean_current_velocity)==null?void 0:Vt.at(te))??((Rt=(Et=D==null?void 0:D.ocean_current_velocity)==null?void 0:Et.filter(se=>se!==null))==null?void 0:Rt.at(-1)),kts:((Dt=D==null?void 0:D.ocean_current_velocity)==null?void 0:Dt.at(te))??((It=(Bt=D==null?void 0:D.ocean_current_velocity)==null?void 0:Bt.filter(se=>se!==null))==null?void 0:It.at(-1)),degree:Yt,bearing:Yt},sst:((Ft=D==null?void 0:D.sea_surface_temperature)==null?void 0:Ft.at(te))??((jt=(Gt=D==null?void 0:D.sea_surface_temperature)==null?void 0:Gt.filter(se=>se!==null))==null?void 0:jt.at(-1)),height:((Wt=D==null?void 0:D.sea_level_height_msl)==null?void 0:Wt.at(te))??((Ee=(Ne=D==null?void 0:D.sea_level_height_msl)==null?void 0:Ne.filter(se=>se!==null))==null?void 0:Ee.at(-1)),ice:{sit:((Zt=D==null?void 0:D.sea_ice_thickness)==null?void 0:Zt.at(te))??((Ht=(Ye=D==null?void 0:D.sea_ice_thickness)==null?void 0:Ye.filter(se=>se!==null))==null?void 0:Ht.at(-1)),sic:((et=D==null?void 0:D.sea_ice_concentration)==null?void 0:et.at(te))??((Ue=(Ae=D==null?void 0:D.sea_ice_concentration)==null?void 0:Ae.filter(se=>se!==null))==null?void 0:Ue.at(-1))}},Ke.wave=this.parseWave(Ke.wave,ve==null?void 0:ve.wind),Ke.current.direction=this.degree2Direction(Ke.current.degree),Xt[tt]?Object.assign(Xt[tt],Ke):Xt.push({utc:ie.utc().format(),realUTC:Se.add(te,"h").format(),model:ot.model,...Ke}),tt++}}return Xt}static toLegacy(e){var a,r,i,l,n,s,c,m,d,u;return{wind:(a=e==null?void 0:e.weather)==null?void 0:a.wind,visibility:(r=e==null?void 0:e.weather)==null?void 0:r.visibility,temp:(i=e==null?void 0:e.weather)==null?void 0:i.temp,prmsl:(l=e==null?void 0:e.weather)==null?void 0:l.pmsl,gusts:{kts:(s=(n=e==null?void 0:e.weather)==null?void 0:n.wind)==null?void 0:s.gusts},precip:(c=e==null?void 0:e.weather)==null?void 0:c.precip,code:(m=e==null?void 0:e.weather)==null?void 0:m.code,name:(d=e==null?void 0:e.weather)==null?void 0:d.name,url:(u=e==null?void 0:e.weather)==null?void 0:u.url,wave:e==null?void 0:e.wave,current:e==null?void 0:e.current,sst:e==null?void 0:e.sst,height:e==null?void 0:e.height,utc:e==null?void 0:e.utc,source:e==null?void 0:e.model,ice:e==null?void 0:e.ice}}static pickDaily(e,a){var r,i,l,n,s,c,m,d,u,f,g,p,h,y,k,x,b,A,v,L,C,_,N,M,T,I,X,Q,q,le,S,W,Z,ee,j,B,J,E,O,$,de,ue,re,ge,ye,_e,U,ne,Fe,Ge,Re,Ce,je,Te,Ve,De,We,Ze,Be,xe,ke,ze,He,Xe,Oe,Pe,it,rt,lt,nt,st,ct,mt,dt,ht,pt,gt,ut,ft,yt,bt,wt,xt,kt,At,Lt,vt,Ct,zt,_t,St,Pt,Nt,Mt,Tt,Vt,Et,Rt,Dt,Bt,It,Ft,Gt,jt;const Wt=typeof a=="string"?z(a):a;let Ne=Wt.clone();const Ee=e==null?void 0:e.weather,Zt=e==null?void 0:e.marine,Ye=z((l=(i=(r=Ee==null?void 0:Ee[0])==null?void 0:r.daily)==null?void 0:i.time)==null?void 0:l.at(0)),Ht=z((c=(s=(n=Ee==null?void 0:Ee[0])==null?void 0:n.daily)==null?void 0:s.time)==null?void 0:c.at(-1)),et=[];Ne=Ne.isBefore(Ye)?Ye.clone():Ne,Ne=Ne.isAfter(Ht)?Ht.clone():Ne;let Ae,Ue;const ie=Ne.diff(Ye,"d",!1);if(Ee)for(const Le of Ee){const Y=Le.daily,H=((m=Y.wind_direction_10m_dominant)==null?void 0:m.at(ie))??((u=(d=Y.wind_direction_10m_dominant)==null?void 0:d.filter(F=>F!==null))==null?void 0:u.at(-1));Ae={code:((f=Y.weather_code)==null?void 0:f.at(ie))??((p=(g=Y.weather_code)==null?void 0:g.filter(F=>F!==null))==null?void 0:p.at(-1)),temp:{max:((h=Y.temperature_2m_max)==null?void 0:h.at(ie))??((k=(y=Y.temperature_2m_max)==null?void 0:y.filter(F=>F!==null))==null?void 0:k.at(-1)),min:((x=Y.temperature_2m_min)==null?void 0:x.at(ie))??((A=(b=Y.temperature_2m_min)==null?void 0:b.filter(F=>F!==null))==null?void 0:A.at(-1)),mean:((v=Y.temperature_2m_mean)==null?void 0:v.at(ie))??((C=(L=Y.temperature_2m_mean)==null?void 0:L.filter(F=>F!==null))==null?void 0:C.at(-1))},apparentTemp:{max:((_=Y.apparent_temperature_max)==null?void 0:_.at(ie))??((M=(N=Y.apparent_temperature_max)==null?void 0:N.filter(F=>F!==null))==null?void 0:M.at(-1)),min:((T=Y.apparent_temperature_min)==null?void 0:T.at(ie))??((X=(I=Y.apparent_temperature_min)==null?void 0:I.filter(F=>F!==null))==null?void 0:X.at(-1))},precip:{sum:((Q=Y.precipitation_sum)==null?void 0:Q.at(ie))??((le=(q=Y.precipitation_sum)==null?void 0:q.filter(F=>F!==null))==null?void 0:le.at(-1)),rainSum:((S=Y.rain_sum)==null?void 0:S.at(ie))??((Z=(W=Y.rain_sum)==null?void 0:W.filter(F=>F!==null))==null?void 0:Z.at(-1)),snowfallSum:((ee=Y.snowfall_sum)==null?void 0:ee.at(ie))??((B=(j=Y.snowfall_sum)==null?void 0:j.filter(F=>F!==null))==null?void 0:B.at(-1)),showersSum:((J=Y.showers_sum)==null?void 0:J.at(ie))??((O=(E=Y.showers_sum)==null?void 0:E.filter(F=>F!==null))==null?void 0:O.at(-1)),hours:(($=Y.precipitation_hours)==null?void 0:$.at(ie))??0,probability:((de=Y.precipitation_probability_max)==null?void 0:de.at(ie))??0},rh:{max:((ue=Y.relative_humidity_2m_max)==null?void 0:ue.at(ie))??((ge=(re=Y.relative_humidity_2m_max)==null?void 0:re.filter(F=>F!==null))==null?void 0:ge.at(-1)),min:((ye=Y.relative_humidity_2m_min)==null?void 0:ye.at(ie))??((U=(_e=Y.relative_humidity_2m_min)==null?void 0:_e.filter(F=>F!==null))==null?void 0:U.at(-1)),mean:((ne=Y.relative_humidity_2m_mean)==null?void 0:ne.at(ie))??((Ge=(Fe=Y.relative_humidity_2m_mean)==null?void 0:Fe.filter(F=>F!==null))==null?void 0:Ge.at(-1))},wind:{speed:((Re=Y.wind_speed_10m_max)==null?void 0:Re.at(ie))??((je=(Ce=Y.wind_speed_10m_max)==null?void 0:Ce.filter(F=>F!==null))==null?void 0:je.at(-1)),kts:((Te=Y.wind_speed_10m_max)==null?void 0:Te.at(ie))??((De=(Ve=Y.wind_speed_10m_max)==null?void 0:Ve.filter(F=>F!==null))==null?void 0:De.at(-1)),degree:H,gusts:((We=Y.wind_gusts_10m_max)==null?void 0:We.at(ie))??((Be=(Ze=Y.wind_gusts_10m_max)==null?void 0:Ze.filter(F=>F!==null))==null?void 0:Be.at(-1)),mean:((xe=Y.wind_speed_10m_mean)==null?void 0:xe.at(ie))??((ze=(ke=Y.wind_speed_10m_mean)==null?void 0:ke.filter(F=>F!==null))==null?void 0:ze.at(-1)),bearing:H!==null?Math.round((H+180)%360):null},visibility:{max:this.m2nm(((He=Y.visibility_max)==null?void 0:He.at(ie))??((Oe=(Xe=Y.visibility_max)==null?void 0:Xe.filter(F=>F!==null))==null?void 0:Oe.at(-1))),min:this.m2nm(((Pe=Y.visibility_min)==null?void 0:Pe.at(ie))??((rt=(it=Y.visibility_min)==null?void 0:it.filter(F=>F!==null))==null?void 0:rt.at(-1))),mean:this.m2nm(((lt=Y.visibility_mean)==null?void 0:lt.at(ie))??((st=(nt=Y.visibility_mean)==null?void 0:nt.filter(F=>F!==null))==null?void 0:st.at(-1)))}};const{name:Je,url:Ie,bg:Se}=this.parseWeatherCode(Ae.code,!0);Ae.name=Je,Ae.url=Ie,Ae.bg=Se,Ae.wind.scale=this.beaufort(this.kts2ms(Ae.wind.kts)),Ae.wind.direction=this.degree2Direction(Ae.wind.degree),et.push({utc:Wt.utc().format(),realUTC:Ye.add(ie,"d").utc().format(),model:Le.model,weather:{...Ae}})}if(Zt){let Le=0;for(const Y of Zt){const H=Y.daily,Je=((ct=H==null?void 0:H.wave_direction_dominant)==null?void 0:ct.at(ie))||((dt=(mt=H==null?void 0:H.wave_direction_dominant)==null?void 0:mt.filter(F=>F!==null))==null?void 0:dt.at(-1)),Ie=((ht=H==null?void 0:H.swell_wave_direction_dominant)==null?void 0:ht.at(ie))||((gt=(pt=H==null?void 0:H.swell_wave_direction_dominant)==null?void 0:pt.filter(F=>F!==null))==null?void 0:gt.at(-1)),Se=((ut=H==null?void 0:H.wind_wave_direction_dominant)==null?void 0:ut.at(ie))||((yt=(ft=H==null?void 0:H.wind_wave_direction_dominant)==null?void 0:ft.filter(F=>F!==null))==null?void 0:yt.at(-1));Ue={wave:{sig:{height:((bt=H==null?void 0:H.wave_height_max)==null?void 0:bt.at(ie))||((xt=(wt=H==null?void 0:H.wave_height_max)==null?void 0:wt.filter(F=>F!==null))==null?void 0:xt.at(-1)),degree:Je,period:((kt=H==null?void 0:H.wave_period_max)==null?void 0:kt.at(ie))||((Lt=(At=H==null?void 0:H.wave_period_max)==null?void 0:At.filter(F=>F!==null))==null?void 0:Lt.at(-1)),bearing:Je!==null?Math.round((Je+180)%360):null},swell:{height:((vt=H==null?void 0:H.swell_wave_height_max)==null?void 0:vt.at(ie))??((zt=(Ct=H==null?void 0:H.swell_wave_height_max)==null?void 0:Ct.filter(F=>F!==null))==null?void 0:zt.at(-1)),degree:Ie,period:((_t=H==null?void 0:H.swell_wave_period_max)==null?void 0:_t.at(ie))??((Pt=(St=H==null?void 0:H.swell_wave_period_max)==null?void 0:St.filter(F=>F!==null))==null?void 0:Pt.at(-1)),peakPeriod:((Nt=H==null?void 0:H.swell_wave_peak_period_max)==null?void 0:Nt.at(ie))??((Tt=(Mt=H==null?void 0:H.swell_wave_peak_period_max)==null?void 0:Mt.filter(F=>F!==null))==null?void 0:Tt.at(-1)),bearing:Ie!==null?Math.round((Ie+180)%360):null},wd:{height:((Vt=H==null?void 0:H.wind_wave_height_max)==null?void 0:Vt.at(ie))??((Rt=(Et=H==null?void 0:H.wind_wave_height_max)==null?void 0:Et.filter(F=>F!==null))==null?void 0:Rt.at(-1)),degree:Se,period:((Dt=H==null?void 0:H.wind_wave_period_max)==null?void 0:Dt.at(ie))??((It=(Bt=H==null?void 0:H.wind_wave_period_max)==null?void 0:Bt.filter(F=>F!==null))==null?void 0:It.at(-1)),peakPeriod:((Ft=H==null?void 0:H.wind_wave_peak_period_max)==null?void 0:Ft.at(ie))??((jt=(Gt=H==null?void 0:H.wind_wave_peak_period_max)==null?void 0:Gt.filter(F=>F!==null))==null?void 0:jt.at(-1)),bearing:Se!==null?Math.round((Se+180)%360):null}}},Ue.wave=this.parseWave(Ue.wave,Ae==null?void 0:Ae.wind),Object.assign(et[Le]||{},Ue),Le++}}return et}static parseWave(e,a){if(e.sig.direction=this.degree2Direction(e.sig.degree),e.swell.direction=this.degree2Direction(e.swell.degree),e.wd.direction=this.degree2Direction(e.wd.degree),e.sig.scale=this.douglas(e.sig.height),e.swell.scale=this.douglas(e.swell.height),e.wd.scale=this.douglas(e.wd.height),e.sig.height==0){const r=Math.sqrt(Math.pow(e.swell.height||0,2)+Math.pow(e.wd.height||0,2));e.sig.height=r?Math.round(r*100)/100:.1}if(e.swell.height===0)if(e.sig.height>e.wd.height){const r=Math.sqrt(Math.abs(Math.pow(e.sig.height||0,2)-Math.pow(e.wd.height||0,2)));e.swell.height=Math.round(r*100)/100}else{const r=Math.round(.12*this.kts2ms((a==null?void 0:a.kts)||0)*100)/100,i=r>1?r/10:r>.5?r/5:r>.3?r/2:r,l=Math.max(e.sig.height,e.wd.height);e.swell.height=Math.round((i<l?i:l/2)*100)/100}if(e.wd.height===0)if(e.sig.height>e.swell.height){const r=Math.sqrt(Math.abs(Math.pow(e.sig.height||0,2)-Math.pow(e.swell.height||0,2))),i=.24*this.kts2ms((a==null?void 0:a.kts)||0);e.wd.height=Math.round(Math.min(r,i)*100)/100}else{const r=.24*this.kts2ms((a==null?void 0:a.kts)||0),i=Math.max(e.sig.height,e.swell.height);e.wd.height=Math.round((r<i?r:i/2)*100)/100}if(e.swell.height>=e.sig.height&&(e.swell.height=Math.round(e.sig.height*.8*100)/100),e.wd.height>=e.sig.height&&(e.wd.height=Math.round(e.sig.height*.8*100)/100),!e.sig.period){const r=Math.max(e.swell.period,e.wd.period);e.sig.period=Math.round(6*Math.sqrt(e.sig.height)),e.sig.period=isNaN(r)?void 0:e.sig.period>r?r:e.sig.period}if(!e.swell.period){e.swell.period=Math.round(6*Math.sqrt(e.swell.height));const r=Math.max(e.sig.period,e.wd.period);e.swell.period=isNaN(r)?void 0:e.swell.period>r?r:e.swell.period}if(!e.wd.period){e.wd.period=Math.round(6*Math.sqrt(e.wd.height));const r=Math.max(e.sig.period,e.swell.period);e.wd.period=isNaN(r)?void 0:e.wd.period>r?r:e.wd.period}return e}static parseWeatherCode(e,a){const r=this.weatherCode(e);return(a?r.day:r.night)||{}}static weatherCode(e){const a={code:e};switch(e){case 0:a.day={name:"Sunny",url:"https://ossimg.ormwx.com/asset/weather/01d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"},a.night={name:"Clear",url:"https://ossimg.ormwx.com/asset/weather/01n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"};break;case 1:a.day={name:"Mainly Sunny",url:"https://ossimg.ormwx.com/asset/weather/01d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"},a.night={name:"Mainly Clear",url:"https://ossimg.ormwx.com/asset/weather/01n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"};break;case 2:a.day={name:"Partly Cloudy",url:"https://ossimg.ormwx.com/asset/weather/02d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg2.png"},a.night={name:"Partly Cloudy",url:"https://ossimg.ormwx.com/asset/weather/02n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg2.png"};break;case 3:a.day={name:"Overcast",url:"https://ossimg.ormwx.com/asset/weather/04d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg3.png"},a.night={name:"Overcast",url:"https://ossimg.ormwx.com/asset/weather/04n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg3.png"};break;case 45:a.day={name:"Foggy",url:"https://ossimg.ormwx.com/asset/weather/50d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"},a.night={name:"Foggy",url:"https://ossimg.ormwx.com/asset/weather/50n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"};break;case 48:a.day={name:"Rime Fog",url:"https://ossimg.ormwx.com/asset/weather/50d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"},a.night={name:"Rime Fog",url:"https://ossimg.ormwx.com/asset/weather/50n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"};break;case 51:a.day={name:"Light Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 53:a.day={name:"Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 55:a.day={name:"Heavy Drizzle",url:"https://ossimg.ormwx.com/asset/weather/15d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Drizzle",url:"https://ossimg.ormwx.com/asset/weather/15n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 56:a.day={name:"Light Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 57:a.day={name:"Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 61:a.day={name:"Light Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 63:a.day={name:"Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 65:a.day={name:"Heavy Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 66:a.day={name:"Light Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 67:a.day={name:"Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 71:a.day={name:"Light Snow",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 73:a.day={name:"Snow",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Snow",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 75:a.day={name:"Heavy Snow",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Heavy Snow",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 77:a.day={name:"Snow Grains",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Snow Grains",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 80:a.day={name:"Light Showers",url:"https://ossimg.ormwx.com/asset/weather/09d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Showers",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 81:a.day={name:"Showers",url:"https://ossimg.ormwx.com/asset/weather/09d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Showers",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 82:a.day={name:"Heavy Showers",url:"https://ossimg.ormwx.com/asset/weather/09d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Showers",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 85:a.day={name:"Light Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 86:a.day={name:"Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 95:a.day={name:"Thunderstorm",url:"https://ossimg.ormwx.com/asset/weather/11d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorm",url:"https://ossimg.ormwx.com/asset/weather/11n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 96:a.day={name:"Light Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 99:a.day={name:"Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break}return a}static kts2ms(e){return isNaN(e)||e===null?e:Math.round(e*1852/3600*1e4)/1e4}static kts2kmh(e){return isNaN(e)||e===null?e:e*1.852}static m2nm(e){return isNaN(e)||e===null?e:Math.round(e/1e3/1.852*1e4)/1e4}static kmh2kts(e){return isNaN(e)||e===null?e:this.ms2kts(e*1e3/3600)}static ms2kts(e){return isNaN(e)||e===null?e:Math.round(e*3600/1852*1e4)/1e4}static degree2Radian(e){if(isNaN(e)||e===null)return e;let a=e%360/360*2*Math.PI;return a=a<0?a+2*Math.PI:a,a}static degree2Direction(e){const a=this.degree2Radian(e);if(isNaN(a)||a===null)return null;let r="N/A";const i=Math.PI/16;return a<i?r="N":a>=i&&a<3*i?r="NNE":a>=3*i&&a<5*i?r="NE":a>=5*i&&a<7*i?r="ENE":a>=7*i&&a<9*i?r="E":a>=9*i&&a<11*i?r="ESE":a>=11*i&&a<13*i?r="SE":a>=13*i&&a<15*i?r="SSE":a>=15*i&&a<17*i?r="S":a>=17*i&&a<19*i?r="SSW":a>=19*i&&a<21*i?r="SW":a>=21*i&&a<23*i?r="WSW":a>=23*i&&a<25*i?r="W":a>=25*i&&a<27*i?r="WNW":a>=27*i&&a<29*i?r="NW":a>=29*i&&a<31*i?r="NNW":a>=31*i&&a<32*i&&(r="N"),r}static beaufort(e){let a=0;return isNaN(e)||(e=Math.round(e*10)/10,e<=.2?a=0:e<=1.5?a=1:e<=3.3?a=2:e<=5.4?a=3:e<=7.9?a=4:e<=10.7?a=5:e<=13.8?a=6:e<=17.1?a=7:e<=20.7?a=8:e<=22.4?a=9:e<=28.4?a=10:e<=32.6?a=11:e<=36.9?a=12:e<=41.4?a=13:e<=46.1?a=14:e<=50.9?a=15:e<=55.9?a=16:e<=61.2?a=17:e>61.2&&(a=18)),a}static douglas(e){let a="Calm";return isNaN(e)||e<=.1?a="Calm":e<=.5?a="Smooth":e<=1.25?a="Slight":e<=2.5?a="Moderate":e<=4?a="Rough":e<=6?a="VeryRough":e<=9?a="High":e<=14?a="VeryHigh":a="Precipitous",a}};const ub="",gd={name:"IdmTropicals",props:{simple:{type:Boolean,default:!1},permission:{type:Number},locale:{type:String},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},timeZone:{type:Number},token:{type:String},defaultMeteoToken:{type:String},gateway:{type:String,default:"aa"},assistGateway:{type:Array,default:[]},forecastModel:{type:String},realTime:{type:String},beforeLayer:{type:String}},emits:["tropical","tropicalCenterPoints","tropicalProbability","tropicalNotification"],setup(){return{Theme:be.useTheme()}},data(){return{right:10,toggle:!1,helper:no.CompanyHelper,tropicals:void 0,tropicalCacheKey:"tropicalCacheGL4",source:"tropicals-source",clusterSource:"tropicals-cluster-source",historyLayer:"tropicals-history-layer",forecastLayer:"tropicals-forecast-layer",forecastModelLayer:"tropicals-forecast-model-layer",forecastNameLayer:"tropicals-forecast-name-layer",pointCircleLayer:"tropicals-point-circle-layer",pointLabelLayer:"tropicals-point-label-layer",historyPointCircleLayer:"history-tropicals-point-circle-layer",historyPointLabelLayer:"history-tropicals-point-label-layer",interpolateData:[],interpolateMarkers:[],interpolateSource:"tropicals-interpolate-source",interpolateLineLayer:"tropicals-interpolate-line-layer",showTropicalsInfo:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:V.featureCollection([]),showLegend:!1,showHoverPoint:!1,hoverPoint:void 0,hoverMarker:void 0}},computed:{hoverLayers(){return[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.pointCircleLayer,this.pointCircleLayer+"-border",this.historyPointCircleLayer,this.historyPointCircleLayer+"-border",this.historyPointCircleLayer+"-inner"]},clickLayers(){return[this.forecastNameLayer,this.historyLayer]},computeTime(){return(t,e)=>{if(t){const a=z(t).utcOffset(e),r=e<0?e:"+"+e;return`${a==null?void 0:a.format("MMM-DD/HHmm")} (UTC${r}) ${a==null?void 0:a.fromNow()} `}return"-"}},computeTzTime(){return(t,e,a="MM-DD HH:mm")=>{var r,i;if(t){const l=e||0,n=(i=(r=z(t))==null?void 0:r.utcOffset(l))==null?void 0:i.format(a),s=`(UTC ${l>=0?"+":""}${l})`;return n+" "+s}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone},computeBF(){return function(t){const e=ma.kts2ms(t);return ma.beaufort(e)}},computeMovement(){return function(t){var e,a;return(a=(e=t==null?void 0:t.forecasts)==null?void 0:e.find(r=>!r.disabled))==null?void 0:a.movement}},computePosition(){return t=>!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat)?"-":P.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty+" / "+P.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},map:{handler(){this.map?(this.toggle=localStorage.getItem(this.tropicalCacheKey)==="true"||!1,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle&&this.fetchTropicals()):this.handleClear()}},showTropicalsInfo:{handler(){this.$emit("tropical",this.showTropicalsInfo),this.simple&&this.showTropicalsInfo?this.$nextTick(()=>{var t,e;this.$parent.playerBottom=((e=(t=this.$refs.tropicalsInfo)==null?void 0:t.$el)==null?void 0:e.clientHeight)+10}):this.simple&&(this.$parent.playerBottom=30)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(t,e){t!==e&&this.handleRefresh()}},realTime:{handler(t){this.map&&t&&this.toggle&&this.handleRender()}},locale:{handler(t){this.map&&this.toggle&&this.handleRefresh()}}},methods:{handleMenuToggle(){var t,e,a;this.toggle=!this.toggle,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle?this.fetchTropicals():(this.handleClear(),(a=(e=(t=this.$parent)==null?void 0:t.$refs)==null?void 0:e.idmBottomBar)==null||a.handleToggle("tropical",!1))},async fetchTropicals(){var i,l,n;const t=new Date().valueOf();let e=0,a=0,r=(i=no.LayerHelper.WEATHER_LAYERS.find(s=>s.key==="tropicals"))==null?void 0:i.weight;if(r>0){const s=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],c=await he.get(`${s}/api/arc/weather/layers2/links?l=${r}&v=${this.forecastModel}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(a=new Date().valueOf()-(t+e),console.log("weather links elapsed: ",a,", total: ",e+=a),((l=c==null?void 0:c.data)==null?void 0:l.code)===0){const m=(n=c==null?void 0:c.data)==null?void 0:n.data;await he.get(m.tropicals,{headers:{Authorization:this.defaultMeteoToken,key:"tropicals"},responseType:/\.(jpg|png)$/.test(m.tropicals)?"blob":"json"}).then(d=>{var g,p,h;const u=P.TropicalHelper.convert2Geojson(((g=d==null?void 0:d.data)==null?void 0:g.data)||(d==null?void 0:d.data));((h=(p=d==null?void 0:d.config)==null?void 0:p.headers)==null?void 0:h.key)&&u&&(this.tropicals={data:u,active:!0,cached:!0,type:"json",etime:c.data.etime,version:Math.random()+1})}).catch(d=>{console.log(`tropicals fetch layer error: ${d}`)})}a=new Date().valueOf()-(t+e),console.log("tropicals elapsed: ",a,", total: ",e+=a)}},handleRefresh(){var e,a;(((a=(e=this.tropicals)==null?void 0:e.data)==null?void 0:a.features)||[]).forEach(r=>{var l,n,s,c,m,d,u,f,g,p,h,y,k,x,b,A,v,L,C;let i="";switch(!0){case(((l=r.properties.wind)==null?void 0:l.kts)<32||((n=r.properties)==null?void 0:n.kts)<32):i="td";break;case(((s=r.properties.wind)==null?void 0:s.kts)<47||((c=r.properties)==null?void 0:c.kts)<47):i="ts";break;case(((m=r.properties.wind)==null?void 0:m.kts)<63||((d=r.properties)==null?void 0:d.kts)<63):i="sts";break;case(((u=r.properties.wind)==null?void 0:u.kts)<79||((f=r.properties)==null?void 0:f.kts)<79):i="ty";break;case(((g=r.properties.wind)==null?void 0:g.kts)<94||((p=r.properties)==null?void 0:p.kts)<94):i="sty";break;case(((h=r.properties.wind)==null?void 0:h.kts)>=94||((y=r.properties)==null?void 0:y.kts)>=94):i="superTy";break;default:i="superTy";break}r.properties.levelI18n=i,((k=r.geometry)==null?void 0:k.type)==="Point"&&((x=r.properties)!=null&&x.important)&&(r.properties.format=(A=(b=z(r.properties.date))==null?void 0:b.utcOffset(this.timeZone))==null?void 0:A.format(`MMM-DD/HHmm [(utc${this.computeTimezone})]`)),((v=r.geometry)==null?void 0:v.type)==="Point"&&(r.properties.Name=((C=(L=r.properties.name)==null?void 0:L.trim())==null?void 0:C.replace(/^./,_=>_.toUpperCase()))||r.properties.nameCn,r.properties.nameCn=r.properties.nameCn||r.properties.Name||"-")}),this.handleInit()},handleInit(){var t,e,a,r,i,l,n,s,c,m,d,u;this.handleClear(),this.tropicals&&this.map&&(this.handleRender(),(t=this.map)==null||t.on("click",this.clickLayers,this.handleClick),(e=this.map)==null||e.on("mousemove",this.hoverLayers,this.handleHover),(a=this.map)==null||a.on("mouseleave",this.hoverLayers,this.handleLeave)),((l=(i=(r=this.tropicals)==null?void 0:r.data)==null?void 0:i.features)==null?void 0:l.length)>0?(c=(s=(n=this.$parent)==null?void 0:n.$refs)==null?void 0:s.idmBottomBar)==null||c.handleToggle("tropical",!0):(u=(d=(m=this.$parent)==null?void 0:m.$refs)==null?void 0:d.idmBottomBar)==null||u.handleToggle("tropical",!1)},handleRender(){var t,e,a,r,i,l,n,s,c,m;if(this.tropicals&&this.map){const d=new Date().valueOf();let u=0,f=0;(t=this.map)!=null&&t.getSource(this.source)?((a=this.map)==null||a.getSource(this.source).setData((e=this.tropicals)!=null&&e.active?this.tropicals.data:this.empty),f=new Date().valueOf()-(d+u)):(this.map.addSource(this.source,{type:"geojson",data:(r=this.tropicals)!=null&&r.active?(i=this.tropicals)==null?void 0:i.data:this.empty}),this.map.addLayer({id:this.historyLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","history"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["on-surface"],"line-width":3,"line-opacity":.7}},this.beforeLayer),this.map.addLayer({id:this.forecastLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["match",["get","model"],"cma",this.Theme.current.value.colors["tropicals-cma"],"jma",this.Theme.current.value.colors["tropicals-jma"],"ecmwf",this.Theme.current.value.colors["tropicals-ecmwf"],"ukm",this.Theme.current.value.colors["tropicals-ukm"],"noaa-at",this.Theme.current.value.colors["tropicals-noaa-at"],"noaa-ep",this.Theme.current.value.colors["tropicals-noaa-ep"],this.Theme.current.value.colors["tropicals-noaa-other"]],"line-width":2,"line-opacity":1,"line-dasharray":[1,2]}},this.beforeLayer),this.map.addLayer({id:this.forecastModelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"symbol-placement":"line","text-field":"{model}","text-rotation-alignment":"viewport","text-size":12},paint:{"text-color":this.Theme.current.value.dark?"#333":"#fff","text-opacity":1,"text-halo-color":["match",["get","model"],"cma",this.Theme.current.value.colors["tropicals-cma"],"jma",this.Theme.current.value.colors["tropicals-jma"],"ecmwf",this.Theme.current.value.colors["tropicals-ecmwf"],"ukm",this.Theme.current.value.colors["tropicals-ukm"],"noaa-at",this.Theme.current.value.colors["tropicals-noaa-at"],"noaa-ep",this.Theme.current.value.colors["tropicals-noaa-ep"],this.Theme.current.value.colors["tropicals-noaa-other"]],"text-halo-width":4}},this.beforeLayer),f=new Date().valueOf()-(d+u),console.log("[tropical] add elapsed: ",f,", total: ",u+=f)),(l=this.map)!=null&&l.getSource(this.clusterSource)?((s=this.map)==null||s.getSource(this.clusterSource).setData((n=this.tropicals)!=null&&n.active?this.tropicals.data:this.empty),f=new Date().valueOf()-(d+u),console.log("[tropical] update elapsed: ",f,", total: ",u+=f)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(c=this.tropicals)!=null&&c.active?(m=this.tropicals)==null?void 0:m.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.pointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":["case",["boolean",["==",["get","kts",["get","wind"]],null]],this.Theme.current.value.colors["tropicals-td"],["boolean",["<",["get","kts",["get","wind"]],32]],this.Theme.current.value.colors["tropicals-td"],["boolean",["<",["get","kts",["get","wind"]],47]],this.Theme.current.value.colors["tropicals-ts"],["boolean",["<",["get","kts",["get","wind"]],63]],this.Theme.current.value.colors["tropicals-sts"],["boolean",["<",["get","kts",["get","wind"]],79]],this.Theme.current.value.colors["tropicals-ty"],["boolean",["<",["get","kts",["get","wind"]],94]],this.Theme.current.value.colors["tropicals-sty"],["boolean",[">=",["get","kts",["get","wind"]],94]],this.Theme.current.value.colors["tropicals-super-ty"],"#fff"]}},this.beforeLayer),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,minzoom:5,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[1,0],"text-anchor":"left","text-size":10},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":"rgba(0,0,0,0.7)"}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer+"-inner",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":3,"circle-color":"#fff"}},this.beforeLayer),this.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,minzoom:5,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[1,0],"text-anchor":"left","text-size":10},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["==","important",!0]],layout:{"text-field":["get",this.locale==="en"?"Name":"nameCn"],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-offset":[0,2]},paint:{"text-color":this.Theme.current.value.colors["map-blue"],"text-halo-color":"#ffffff","text-halo-width":2}},this.beforeLayer),f=new Date().valueOf()-(d+u),console.log("[tropical] add elapsed: ",f,", total: ",u+=f));const g=P.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(g)),this.handleDateChange()}},handleClear(){var t,e,a,r;this.map&&(this.map.getLayer(this.historyLayer)&&this.map.removeLayer(this.historyLayer),this.map.getLayer(this.forecastLayer)&&this.map.removeLayer(this.forecastLayer),this.map.getLayer(this.forecastModelLayer)&&this.map.removeLayer(this.forecastModelLayer),this.map.getLayer(this.forecastNameLayer)&&this.map.removeLayer(this.forecastNameLayer),this.map.getLayer(this.pointCircleLayer)&&this.map.removeLayer(this.pointCircleLayer),this.map.getLayer(this.pointCircleLayer+"-border")&&this.map.removeLayer(this.pointCircleLayer+"-border"),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.historyPointCircleLayer)&&this.map.removeLayer(this.historyPointCircleLayer),this.map.getLayer(this.historyPointCircleLayer+"-border")&&this.map.removeLayer(this.historyPointCircleLayer+"-border"),this.map.getLayer(this.historyPointCircleLayer+"-inner")&&this.map.removeLayer(this.historyPointCircleLayer+"-inner"),this.map.getLayer(this.historyPointLabelLayer)&&this.map.removeLayer(this.historyPointLabelLayer),this.map.getLayer(this.interpolateLineLayer)&&this.map.removeLayer(this.interpolateLineLayer),(t=this.interpolateMarkers)==null||t.forEach(i=>i==null?void 0:i.remove()),this.map.getSource(this.source)&&this.map.removeSource(this.source),this.map.getSource(this.clusterSource)&&this.map.removeSource(this.clusterSource),this.map.getSource(this.interpolateSource)&&this.map.removeSource(this.interpolateSource)),(e=this.map)==null||e.off("click",this.clickLayers,this.handleClick),(a=this.map)==null||a.off("mousemove",this.hoverLayers,this.handleHover),(r=this.map)==null||r.off("mouseleave",this.hoverLayers,this.handleLeave),this.handleCloseInfoMarker()},handleDateChange(){var t,e,a,r,i,l,n,s,c,m,d,u,f,g,p,h,y,k,x,b,A,v,L,C,_,N,M,T,I,X,Q,q,le,S,W;if((t=this.interpolateMarkers)==null||t.forEach(Z=>Z==null?void 0:Z.remove()),(e=this.interpolateData)!=null&&e.length&&this.tropicals.active){const Z=z(this.realTime).utc().set({minute:0,second:0,millisecond:0}),ee=this.interpolateData.filter(E=>E.properties.date===(Z==null?void 0:Z.format())&&!E.properties.disabled),j=this.handleComputePolygons(ee),B=V.featureCollection([...ee]);j.forEach(E=>{B.features.push(E)}),(a=this.map)!=null&&a.getSource(this.interpolateSource)?(r=this.map)==null||r.getSource(this.interpolateSource).setData(B):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:B}),(l=this.map)==null||l.addLayer({id:this.interpolateLineLayer,type:"line",source:this.interpolateSource,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-opacity":1,"line-color":["match",["get","level"],7,this.Theme.current.value.colors["tropicals-r7"],10,this.Theme.current.value.colors["tropicals-r10"],this.Theme.current.value.colors["tropicals-r10"]],"line-width":1}},"empty-layer-3")),this.interpolateMarkers=[];const J=[];for(const E of ee)if(!E.properties.disabled){if(!J.some(re=>{var ge;return re.properties.name===((ge=E.properties)==null?void 0:ge.name)})){const re=((s=(n=this.tropicals.data.features.find(ge=>{var ye;return ge.properties.name===((ye=E.properties)==null?void 0:ye.name)}))==null?void 0:n.properties)==null?void 0:s.nameCn)||((c=E.properties)==null?void 0:c.Name)||"-";E.properties.nameCn=re,E.properties.Name=((d=(m=E.properties.name)==null?void 0:m.trim())==null?void 0:d.replace(/^./,ge=>ge.toUpperCase()))||E.properties.nameCn,J.push(E)}let O=this.Theme.current.value.colors["tropicals-ty"];((f=(u=E.properties)==null?void 0:u.wind)==null?void 0:f.kts)<32||!((p=(g=E.properties)==null?void 0:g.wind)!=null&&p.kts)?O=this.Theme.current.value.colors["tropicals-td"]:((y=(h=E.properties)==null?void 0:h.wind)==null?void 0:y.kts)>=32&&((x=(k=E.properties)==null?void 0:k.wind)==null?void 0:x.kts)<47?O=this.Theme.current.value.colors["tropicals-ts"]:((A=(b=E.properties)==null?void 0:b.wind)==null?void 0:A.kts)>=47&&((L=(v=E.properties)==null?void 0:v.wind)==null?void 0:L.kts)<63?O=this.Theme.current.value.colors["tropicals-sts"]:((_=(C=E.properties)==null?void 0:C.wind)==null?void 0:_.kts)>=63&&((M=(N=E.properties)==null?void 0:N.wind)==null?void 0:M.kts)<79?O=this.Theme.current.value.colors["tropicals-ty"]:((I=(T=E.properties)==null?void 0:T.wind)==null?void 0:I.kts)>=79&&((Q=(X=E.properties)==null?void 0:X.wind)==null?void 0:Q.kts)<94?O=this.Theme.current.value.colors["tropicals-sty"]:((le=(q=E.properties)==null?void 0:q.wind)==null?void 0:le.kts)>=94?O=this.Theme.current.value.colors["tropicals-super-ty"]:O=this.Theme.current.value.colors["tropicals-ty"];const $=`<svg t="1719918955501"
406
406
  class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="18382"
407
407
  xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
@@ -17,6 +17,14 @@ declare namespace _sfc_main {
17
17
  const type_3: StringConstructor;
18
18
  export { type_3 as type };
19
19
  }
20
+ namespace hasRampLayer {
21
+ const type_4: BooleanConstructor;
22
+ export { type_4 as type };
23
+ }
24
+ namespace nautical {
25
+ const type_5: StringConstructor;
26
+ export { type_5 as type };
27
+ }
20
28
  }
21
29
  function data(): {
22
30
  source: string;
@@ -25,11 +33,17 @@ declare namespace _sfc_main {
25
33
  pointLabelLayer: string;
26
34
  empty: turf.helpers.FeatureCollection<turf.helpers.Geometry, turf.helpers.Properties>;
27
35
  };
36
+ namespace computed {
37
+ function opacity(): any;
38
+ }
28
39
  const watch: {
29
40
  'prmsl.version': {
30
41
  handler(): void;
31
42
  immediate: boolean;
32
43
  };
44
+ opacity: {
45
+ handler(): void;
46
+ };
33
47
  };
34
48
  namespace methods {
35
49
  function handleRender(): void;
@@ -1,6 +1,6 @@
1
- import { d as l } from "./chunk-ANSXOGKI-2015e9ff.js";
2
- import "./chunk-3VYIPD3A-7c3245c9.js";
3
- import "./index-28a4f6f9.js";
1
+ import { d as l } from "./chunk-ANSXOGKI-02183312.js";
2
+ import "./chunk-3VYIPD3A-f3c90593.js";
3
+ import "./index-a6959b8a.js";
4
4
  import "axios";
5
5
  import "vuetify";
6
6
  import "vue";
@@ -1,6 +1,6 @@
1
- import { m as k } from "./chunk-T4JIPPZO-4cdcfb4a.js";
2
- import "./chunk-3VYIPD3A-7c3245c9.js";
3
- import "./index-28a4f6f9.js";
1
+ import { m as k } from "./chunk-T4JIPPZO-25c7d9fb.js";
2
+ import "./chunk-3VYIPD3A-f3c90593.js";
3
+ import "./index-a6959b8a.js";
4
4
  import "axios";
5
5
  import "vuetify";
6
6
  import "vue";
@@ -1,5 +1,5 @@
1
- import { W as g } from "./chunk-3VYIPD3A-7c3245c9.js";
2
- import "./index-28a4f6f9.js";
1
+ import { W as g } from "./chunk-3VYIPD3A-f3c90593.js";
2
+ import "./index-a6959b8a.js";
3
3
  import "axios";
4
4
  import "vuetify";
5
5
  import "vue";
@@ -1,6 +1,6 @@
1
- import { d as u } from "./chunk-ANSXOGKI-2015e9ff.js";
2
- import { l as g } from "./index-28a4f6f9.js";
3
- import "./chunk-3VYIPD3A-7c3245c9.js";
1
+ import { d as u } from "./chunk-ANSXOGKI-02183312.js";
2
+ import { l as g } from "./index-a6959b8a.js";
3
+ import "./chunk-3VYIPD3A-f3c90593.js";
4
4
  import "axios";
5
5
  import "vuetify";
6
6
  import "vue";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@idmwx/idmui-gl4",
3
3
  "private": false,
4
- "version": "3.8.1",
4
+ "version": "3.8.2",
5
5
  "description": "idm webgl4",
6
6
  "type": "module",
7
7
  "keywords": [