@idmwx/idmui-gl4 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2433,7 +2433,7 @@ y0(k0, "vertexSchema", `
2433
2433
  fract(pos * 255.0),
2434
2434
  floor(pos * 255.0) / 255.0);
2435
2435
  }`);
2436
- const Oo = (t = "#fff") => ({
2436
+ const Oo = (t = "#000") => ({
2437
2437
  "000kts": `<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 245.76c-146.80064 0-266.24 119.43936-266.24 266.24s119.43936 266.24 266.24 266.24 266.24-119.43936 266.24-266.24-119.43936-266.24-266.24-266.24z m0 40.96c124.64128 0 225.28 100.63872 225.28 225.28s-100.63872 225.28-225.28 225.28-225.28-100.63872-225.28-225.28 100.63872-225.28 225.28-225.28z m0 81.92c-78.9504 0-143.36 64.4096-143.36 143.36s64.4096 143.36 143.36 143.36 143.36-64.4096 143.36-143.36-64.4096-143.36-143.36-143.36z m0 40.96c56.79104 0 102.4 45.60896 102.4 102.4s-45.60896 102.4-102.4 102.4-102.4-45.60896-102.4-102.4 45.60896-102.4 102.4-102.4z" fill="${t}"></path></svg>`,
2438
2438
  "002kts": `<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M638 835.99999999c0-63.288-47.10599999-115.524-108-124.30799999L530.00000001 62l-36.00000002 0 1e-8 649.692c-60.894 8.784-108 61.02-108 124.30799999 0 69.39 56.61 126 126 126s126-56.61 126-126z m-36 1e-8c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${t}"></path></svg>`,
2439
2439
  "005kts": `<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 166.634l-20.232-29.25000001L530 243.674 530.00000001 62l-36.00000002 0 1e-8 649.692c-60.894 8.784-108 61.02-108 124.30799999 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.288-47.10599999-115.524-108-124.30799999L530 287zM602 836c0 49.91400001-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${t}"></path></svg>`,
@@ -2494,7 +2494,7 @@ const Oo = (t = "#fff") => ({
2494
2494
  },
2495
2495
  computed: {
2496
2496
  windSvgUrl() {
2497
- const t = this.theme === "customDark" ? "rgba(255, 255, 255, 1)" : "rgba(0, 0, 0, 1)";
2497
+ const t = this.theme === "customDark" ? "#fff" : "#000";
2498
2498
  return Oo(t);
2499
2499
  },
2500
2500
  getSvgUrlBase64() {
@@ -2628,10 +2628,11 @@ function go(t, e, o, b, a, c) {
2628
2628
  C0(W(r, {
2629
2629
  width: "120",
2630
2630
  elevation: "16",
2631
+ class: "card-info",
2631
2632
  style: O0({ position: "absolute", top: "300px", right: a.right + 50 + "px" })
2632
2633
  }, {
2633
2634
  default: w(() => [
2634
- W(O, { class: "pa-1 text-caption d-flex flex-column justify-center align-start opacity-70" }, {
2635
+ W(O, { class: "pa-1 text-body-2 d-flex flex-column justify-center align-start opacity-80 z" }, {
2635
2636
  default: w(() => [
2636
2637
  e[1] || (e[1] = p("div", { class: "text-body-2 ma-1" }, "Wind Level", -1)),
2637
2638
  W(n, { class: "ma-0" }, {
@@ -3066,10 +3067,11 @@ function ko(t, e, o, b, a, c) {
3066
3067
  C0(W(A, {
3067
3068
  width: "120",
3068
3069
  elevation: "16",
3070
+ class: "card-info",
3069
3071
  style: O0({ position: "absolute", top: "340px", right: a.right + 50 + "px" })
3070
3072
  }, {
3071
3073
  default: w(() => [
3072
- W(r, { class: "pa-1 text-caption d-flex flex-column justify-center align-start opacity-70" }, {
3074
+ W(r, { class: "pa-1 text-body-2 d-flex flex-column justify-center align-start opacity-80" }, {
3073
3075
  default: w(() => [
3074
3076
  e[1] || (e[1] = p("div", { class: "text-body-2 ma-1" }, "Current", -1)),
3075
3077
  W(O, { class: "ma-0" }, {
@@ -3599,10 +3601,11 @@ function Uo(t, e, o, b, a, c) {
3599
3601
  C0(W(r, {
3600
3602
  width: "100",
3601
3603
  elevation: "16",
3602
- style: O0({ position: "absolute", top: "300px", right: a.right + 50 + "px" })
3604
+ class: "card-info",
3605
+ style: O0({ position: "absolute", top: "240px", right: a.right + 50 + "px" })
3603
3606
  }, {
3604
3607
  default: w(() => [
3605
- W(O, { class: "pa-1 text-caption d-flex flex-column justify-center align-start opacity-70" }, {
3608
+ W(O, { class: "pa-1 text-body-2 d-flex flex-column justify-center align-start opacity-80" }, {
3606
3609
  default: w(() => [
3607
3610
  e[1] || (e[1] = p("div", { class: "text-body-2 ma-1" }, "Wave Height", -1)),
3608
3611
  W(n, { class: "ma-0" }, {
@@ -4797,6 +4800,10 @@ const vt = {
4797
4800
  IdmTemp: xt
4798
4801
  },
4799
4802
  props: {
4803
+ isLogin: {
4804
+ type: Boolean,
4805
+ default: !1
4806
+ },
4800
4807
  map: {
4801
4808
  type: Object
4802
4809
  },
@@ -4930,14 +4937,19 @@ const vt = {
4930
4937
  }
4931
4938
  },
4932
4939
  showCurrentParticle: {
4933
- handler(t, e) {
4934
- let o = "current-particle";
4935
- this.weatherLayers[o].particle = t, this.weatherLayers[o].version = Math.random() + 1;
4940
+ handler(t) {
4941
+ let e = "current-particle";
4942
+ this.weatherLayers[e].particle = t, this.weatherLayers[e].version = Math.random() + 1;
4943
+ }
4944
+ },
4945
+ isLogin: {
4946
+ handler(t) {
4947
+ t ? this.fetchMeteoSource() : this.sourceList = {};
4936
4948
  }
4937
4949
  }
4938
4950
  },
4939
- async mounted() {
4940
- await this.fetchMeteoSource(), this.fetchCache();
4951
+ mounted() {
4952
+ this.fetchCache();
4941
4953
  },
4942
4954
  methods: {
4943
4955
  arraysEqual(t, e) {
@@ -187,8 +187,8 @@
187
187
  gl_FragColor = vec4(
188
188
  fract(pos * 255.0),
189
189
  floor(pos * 255.0) / 255.0);
190
- }`);const Jo=(a="#fff")=>({"000kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 245.76c-146.80064 0-266.24 119.43936-266.24 266.24s119.43936 266.24 266.24 266.24 266.24-119.43936 266.24-266.24-119.43936-266.24-266.24-266.24z m0 40.96c124.64128 0 225.28 100.63872 225.28 225.28s-100.63872 225.28-225.28 225.28-225.28-100.63872-225.28-225.28 100.63872-225.28 225.28-225.28z m0 81.92c-78.9504 0-143.36 64.4096-143.36 143.36s64.4096 143.36 143.36 143.36 143.36-64.4096 143.36-143.36-64.4096-143.36-143.36-143.36z m0 40.96c56.79104 0 102.4 45.60896 102.4 102.4s-45.60896 102.4-102.4 102.4-102.4-45.60896-102.4-102.4 45.60896-102.4 102.4-102.4z" fill="${a}"></path></svg>`,"002kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M638 835.99999999c0-63.288-47.10599999-115.524-108-124.30799999L530.00000001 62l-36.00000002 0 1e-8 649.692c-60.894 8.784-108 61.02-108 124.30799999 0 69.39 56.61 126 126 126s126-56.61 126-126z m-36 1e-8c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"005kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 166.634l-20.232-29.25000001L530 243.674 530.00000001 62l-36.00000002 0 1e-8 649.692c-60.894 8.784-108 61.02-108 124.30799999 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.288-47.10599999-115.524-108-124.30799999L530 287zM602 836c0 49.91400001-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"010kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 215zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}" ></path></svg>`,"015kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 322.99999999l82.134-57.38399999-20.25-29.232L530 279.692 530 215zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"020kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 322.99999999l172.134-120.38399999-20.268-29.24999999L530 279.71 530 215zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"025kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L529.99999999 431l82.13400001-57.384-20.25-29.25L530 387.71 530 322.99999999l172.134-120.38399999-20.268-29.24999999L530 279.71 530 215zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"030kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L529.99999999 431l172.13400001-120.384-20.26800001-29.232L530 387.674 530 322.99999999l172.134-120.38399999-20.268-29.24999999L530 279.71 530 215zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"035kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.80199999-108 61.056-108 124.308 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.106-115.506-108-124.308L530 539l82.134-57.38400001-20.25-29.24999999L529.99999999 495.71 529.99999999 431l172.13400001-120.384-20.26800001-29.232L530 387.674 530 322.99999999l172.134-120.38399999-20.268-29.24999999L530 279.71 530 215l172.134-120.384zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"040kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 539l172.134-120.384-20.268-29.25L529.99999999 495.71 529.99999999 431l172.13400001-120.384-20.26800001-29.232L530 387.674 530 322.99999999l172.134-120.38399999-20.268-29.24999999L530 279.71 530 215zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"045kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 647l82.13400001-57.384-20.25000001-29.25L530 603.71 530 539l172.134-120.384-20.268-29.25L529.99999999 495.71 529.99999999 431l172.13400001-120.384-20.26800001-29.232L530 387.674 530 322.99999999l172.134-120.38399999-20.268-29.24999999L530 279.71 530 215zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"050kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.366 62L494 62l0 649.692c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 215l172.134-120.384zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}" ></path></svg>`,"055kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.366 62L494 62l0 649.692c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 322.99999999l82.134-57.38399999-20.25-29.232L530 279.692 530 215l172.134-120.384zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}" ></path></svg>`,"060kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.366 62L494 62l0 649.692c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 322.99999999l135.558-94.49999999-20.25000001-29.808-115.30799999 81L530 215l172.134-120.384zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}" ></path></svg>`,"065kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.096 62L494 62l1e-8 649.44c-60.894 8.82-108 61.308-108.00000001 124.56 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.106-115.74-108.00000001-124.56L530 431.36l82.332-57.636-20.664-29.448L530 387.44l0-64.08 135.774-95.004-20.646-29.484L530 279.44 529.99999999 215.378 749.096 62zM602 836c0 49.932-40.068 90-90 90s-90-40.068-90-90 40.068-90 90-90 90 40.068 90 90z" fill="${a}" ></path></svg>`,"070kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.096 62L494 62l1e-8 649.44c-60.87599999 8.82-108 61.308-108.00000001 124.56 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.124-115.74-108.00000001-124.56L530 431.36l135.774-95.004-20.646-29.48399999L530 387.44l0-64.08 135.774-95.004-20.646-29.484L530 279.44 529.99999999 215.378 749.096 62zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"075kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.096 62L494 62l1e-8 649.44c-60.87599999 8.82-108 61.308-108.00000001 124.56 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.124-115.74-108.00000001-124.56l0-172.08 82.33200001-57.636-20.664-29.448L530 495.44l0-64.08 135.774-95.004-20.646-29.48399999L530 387.44l0-64.08 135.774-95.004-20.646-29.484L530 279.44 529.99999999 215.378 749.096 62zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"080kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.096 62L494 62l1e-8 649.44c-60.87599999 8.82-108 61.308-108.00000001 124.56 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.124-115.74-108.00000001-124.56l0-172.08 135.774-95.004-20.64599999-29.484L530 495.44l0-64.08 135.774-95.004-20.646-29.48399999L530 387.44l0-64.08 135.774-95.004-20.646-29.484L530 279.44 529.99999999 215.378 749.096 62zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"085kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.096 62L494 62l1e-8 649.44c-60.87599999 8.82-108 61.308-108.00000001 124.56 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.124-115.74-108.00000001-124.56l1e-8-64.08 82.332-57.636-20.664-29.44800001L529.99999999 603.44l0-64.08 135.774-95.004-20.64599999-29.484L530 495.44l0-64.08 135.774-95.004-20.646-29.48399999L530 387.44l0-64.08 135.774-95.004-20.646-29.484L530 279.44 529.99999999 215.378 749.096 62zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"090kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.096 62L494 62l1e-8 649.44c-60.87599999 8.82-108 61.308-108.00000001 124.56 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.124-115.74-108.00000001-124.56l1e-8-64.08 135.774-95.004-20.646-29.484L529.99999999 603.44l0-64.08 135.774-95.004-20.64599999-29.484L530 495.44l0-64.08 135.774-95.004-20.646-29.48399999L530 387.44l0-64.08 135.774-95.004-20.646-29.484L530 279.44 529.99999999 215.378 749.096 62zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"095kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.096 62L494 62l1e-8 649.44c-60.87599999 8.82-108 61.308-108.00000001 124.56 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.124-115.74-108.00000001-124.56l1e-8-46.08 82.332-57.636-20.664-29.448L530 621.44l0-46.08 135.774-95.004-20.64600001-29.484L530 531.44l0-46.08 135.774-95.004-20.646-29.484L529.99999999 441.44l0-46.08 135.774-95.004-20.64599999-29.484L530 351.44l0-46.08 135.774-95.004-20.646-29.48400001L530 261.44 529.99999999 215.378 749.096 62zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}" ></path></svg>`,"100kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.366 62L494 62l0 649.692c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 360.116 746 206l-203.058 0 159.174-111.384zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}" ></path></svg>`,"105kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.366 62L494 62l0 649.692c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 467l135.558-94.5-20.25000001-29.808-115.30799999 81 0-63.576L746 206l-203.058 0 159.174-111.384zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}" ></path></svg>`}),Zo={name:"IdmWindBarb",props:{map:{type:Object},wind:{type:Object},current:{type:Object},beforeLayer:{type:String},menuToggle:{type:Object},theme:{type:String}},emits:[],data(){return{toggle:!1,showCaption:!1,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:I.featureCollection([]),right:10,bottom:125,windBarbLoaded:!1}},computed:{windSvgUrl(){const a=this.theme==="customDark"?"rgba(255, 255, 255, 1)":"rgba(0, 0, 0, 1)";return Jo(a)},getSvgUrlBase64(){return a=>`data:image/svg+xml;base64,${window.btoa(unescape(encodeURIComponent(a)))}`}},watch:{"wind.version":{handler(){var a;(a=this.wind)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var a,o,t,b;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.wind){const p=new Date().valueOf();let c=0,i=0,M=this.empty;if((a=this.wind)!=null&&a.active&&(M=(o=this.wind)==null?void 0:o.data),(t=this.map)!=null&&t.getSource(this.source))(b=this.map)==null||b.getSource(this.source).setData(M),i=new Date().valueOf()-(p+c),console.log("[windBarbs] update elapsed: ",i,", total: ",c+=i);else{this.map.addSource(this.source,{type:"geojson",data:M});for(let n=0;n<(this.barbs??[]).length-1;n++){const s=(this.barbs??[])[n]||0,r=(this.barbs??[])[n+1]||0,O=s<10?`00${s}kts`:s<100?`0${s}kts`:`${s}kts`;this.map.addLayer({id:O,type:"symbol",filter:["all",[">=","spd",s],["<","spd",r]],source:this.source,layout:{"symbol-placement":"point","icon-image":O,"icon-size":.14,"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"dir",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":1,"text-color":"#222"}},this.beforeLayer)}this.windBarbLoaded=!0,i=new Date().valueOf()-(p+c),console.log("[windBarbs] add elapsed: ",i,", total: ",c+=i)}}},handleClear(){for(const a of this.barbs??[]){const o=a<10?`00${a}kts`:a<100?`0${a}kts`:`${a}kts`;this.map.getLayer(o)&&this.map.removeLayer(o)}this.map.getSource(this.source)&&this.map.removeSource(this.source),this.windBarbLoaded=!1}}},$o={key:0,class:"legend-tip-btn-gl4"},e2={class:"d-flex flex-row justify-center align-center"},o2=["src"],t2={class:"text-caption"};function a2(a,o,t,b,p,c){var O;const i=e.resolveComponent("v-btn"),M=e.resolveComponent("v-col"),n=e.resolveComponent("v-row"),s=e.resolveComponent("v-card-text"),r=e.resolveComponent("v-card");return(O=t.wind)!=null&&O.active?(e.openBlock(),e.createElementBlock("div",$o,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:p.right+"px"})},[e.createVNode(i,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:p.toggle?"primary":"",onClick:c.handleMenuToggle},{default:e.withCtx(()=>o[0]||(o[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4 font-weight-bold menu-icon-color"},null,-1)])),_:1,__:[0]},8,["color","onClick"])],4),e.withDirectives(e.createVNode(r,{width:"120",elevation:"16",style:e.normalizeStyle({position:"absolute",top:"300px",right:p.right+50+"px"})},{default:e.withCtx(()=>[e.createVNode(s,{class:"pa-1 text-caption d-flex flex-column justify-center align-start opacity-70"},{default:e.withCtx(()=>[o[1]||(o[1]=e.createElementVNode("div",{class:"text-body-2 ma-1"},"Wind Level",-1)),e.createVNode(n,{class:"ma-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(c.windSvgUrl),(m,h)=>(e.openBlock(),e.createBlock(M,{cols:"6",key:h,class:"d-flex flex-row justify-center align-center pa-1"},{default:e.withCtx(()=>{var R;return[e.createElementVNode("div",e2,[e.createElementVNode("img",{src:c.getSvgUrlBase64((R=c.windSvgUrl)==null?void 0:R[m]),style:{width:"14px",height:"14px"}},null,8,o2),e.createElementVNode("span",t2,e.toDisplayString(m),1)])]}),_:2},1024))),128))]),_:1})]),_:1,__:[1]})]),_:1},8,["style"]),[[e.vShow,p.showCaption]])])):e.createCommentVNode("",!0)}const p2=$(Zo,[["render",a2]]),Kp="",b2={name:"IdmWindParticle",props:{factor:{type:Object},viewport:{type:Q0},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new L0,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.9,speedFactor:.25,dropRate:.003,dropRateBump:.01,uvRange:[-25,26],sRange:[0,31.985]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var a,o;(a=this.factor)!=null&&a.active?await this.handleRender():this.handleClear(),(o=this.factor)!=null&&o.particle||this.handleClearParticle()}},"factor.particle":{async handler(a,o){a!==o&&o!==void 0&&(a?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{async handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;await this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[wind-particle] add elapsed: ",t,", total: ",o+=t)}},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.uvFragmentSchema);this.program=o,this.aPositionBuffer=t}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,u0.vertexSchema,u0.fragmentSchema,u0.quadVertSchema,u0.screenFragmentSchema,u0.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,9e3),...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(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(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.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})},handleClearParticle(){var a,o,t,b,p,c,i;(a=this.viewport)==null||a.toggleParticle(!1),this.particleContext=void 0,this.initial=!0,(t=(o=this.viewport)==null?void 0:o.map)==null||t.off("resize",this.handleResize),(p=(b=this.viewport)==null?void 0:b.map)==null||p.off("movestart",this.handlePause),(i=(c=this.viewport)==null?void 0:c.map)==null||i.off("moveend",this.handlePlay),this.handlePause()},handleClear(){var a;(a=this.viewport)==null||a.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},c2={key:0};function i2(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",c2,[e.createElementVNode("div",{class:"legend-bars-gl4 wind",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"kts",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"5",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1),e.createElementVNode("span",null,"40",-1),e.createElementVNode("span",null,"60",-1)]),4)])):e.createCommentVNode("",!0)}const M2=$(b2,[["render",i2]]),z2={name:"IdmCurrent",props:{map:{type:Object},current:{type:Object},beforeLayer:{type:String},menuToggle:{type:Object},theme:{type:String}},emits:[],data(){return{right:10,toggle:!1,showCaption:!1,source:"current-source",directionLayer:"current-direction-layer",speedLayer:"current-speed-layer",speedLabelLayer:"current-speed-label-layer",empty:I.featureCollection([]),list:[{label:"0-0.5 kts",size:.25,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"}]}},computed:{getSvgUrlBase64(){return a=>`data:image/svg+xml;base64,${btoa(a)}`}},watch:{"current.version":{handler(){var a;(a=this.current)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var a,o;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.current){const t=new Date().valueOf();let b=0,p=0,c=this.empty;if(this.current.active&&(c=this.current.data),(a=this.map)!=null&&a.getSource(this.source))(o=this.map)==null||o.getSource(this.source).setData(c),p=new Date().valueOf()-(t+b),console.log("[current] update elapsed: ",p,", total: ",b+=p);else{this.map.addSource(this.source,{type:"geojson",data:c}),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 i=new Image(48,48);let M='<svg class="icon" viewBox="0 0 1024 1024" 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="#ffffff"></path></svg>',n="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(M)));i.src=n;const s=new Image(48,48);M='<svg class="icon" viewBox="0 0 1024 1024" 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="#f44336"></path></svg>',n="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(M))),s.src=n;const r=[i,s];let O=0;r.forEach(m=>{m.onload=()=>{O++,this.map.hasImage("currentDirIconWhite")||this.map.addImage("currentDirIconWhite",i),this.map.hasImage("currentDirIconRed")||this.map.addImage("currentDirIconRed",s),O===2&&this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":["step",["get","spd"],"currentDirIconWhite",1,"currentDirIconWhite"],"icon-size":["step",["get","spd"],.25,.5,.4,1,.6,1.5,.8,2,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":1}},this.beforeLayer)}}),p=new Date().valueOf()-(t+b),console.log("[current] add elapsed: ",p,", total: ",b+=p)}}},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.getSource(this.source)&&this.map.removeSource(this.source)}}},n2={key:0,class:"legend-tip-btn-gl4"},r2={class:"d-flex flex-row justify-start align-center"},l2={class:"d-flex flex-row justify-center align-center",style:{width:"48px"}},s2={class:"text-caption px-2"};function O2(a,o,t,b,p,c){var m;const i=e.resolveComponent("v-btn"),M=e.resolveComponent("v-tooltip"),n=e.resolveComponent("v-col"),s=e.resolveComponent("v-row"),r=e.resolveComponent("v-card-text"),O=e.resolveComponent("v-card");return(m=t.current)!=null&&m.active?(e.openBlock(),e.createElementBlock("div",n2,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:p.right+"px"})},[e.createVNode(M,{text:"Map Layers",location:"left","open-delay":1e3},{activator:e.withCtx(({props:h})=>[e.createVNode(i,e.mergeProps(h,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:p.toggle?"primary":"",onClick:c.handleMenuToggle}),{default:e.withCtx(()=>o[0]||(o[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4 font-weight-bold menu-icon-color"},null,-1)])),_:2,__:[0]},1040,["color","onClick"])]),_:1})],4),e.withDirectives(e.createVNode(O,{width:"120",elevation:"16",style:e.normalizeStyle({position:"absolute",top:"340px",right:p.right+50+"px"})},{default:e.withCtx(()=>[e.createVNode(r,{class:"pa-1 text-caption d-flex flex-column justify-center align-start opacity-70"},{default:e.withCtx(()=>[o[1]||(o[1]=e.createElementVNode("div",{class:"text-body-2 ma-1"},"Current",-1)),e.createVNode(s,{class:"ma-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.list,(h,R)=>(e.openBlock(),e.createBlock(n,{cols:"12",key:R,class:"d-flex flex-row justify-start align-center pa-0"},{default:e.withCtx(()=>[e.createElementVNode("div",r2,[e.createElementVNode("div",l2,[e.createElementVNode("i",{class:"iconfont icon-direction-arrow",style:e.normalizeStyle({fontSize:48*h.size+"px"})},null,4)]),e.createElementVNode("div",s2,e.toDisplayString(h.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[1]})]),_:1},8,["style"]),[[e.vShow,p.showCaption]])])):e.createCommentVNode("",!0)}const A2=$(z2,[["render",O2]]),Yp="",d2={name:"IdmCurrentParticle",props:{factor:{type:Object},viewport:{type:Q0},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new L0,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.96,speedFactor:4,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 a,o;console.log("factor.version",this.viewport),(a=this.factor)!=null&&a.active?await this.handleRender():this.handleClear(),(o=this.factor)!=null&&o.particle||this.handleClearParticle()}},"factor.particle":{async handler(a,o){a!==o&&o!==void 0&&(console.log("factor.particle",a,o,this.viewport),a?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{async handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;await this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[current-particle] add elapsed: ",t,", total: ",o+=t)}},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.uvFragmentSchema);this.program=o,this.aPositionBuffer=t}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"],[.6,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,u0.vertexSchema,u0.fragmentSchema,u0.quadVertSchema,u0.screenFragmentSchema,u0.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,9e3),...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(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(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.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})},handleClearParticle(){var a,o,t,b,p,c,i;(a=this.viewport)==null||a.toggleParticle(!1),this.particleContext=void 0,this.initial=!0,(t=(o=this.viewport)==null?void 0:o.map)==null||t.off("resize",this.handleResize),(p=(b=this.viewport)==null?void 0:b.map)==null||p.off("movestart",this.handlePause),(i=(c=this.viewport)==null?void 0:c.map)==null||i.off("moveend",this.handlePlay),this.handlePause()},handleClear(){var a;(a=this.viewport)==null||a.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},m2={key:0};function q2(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",m2,[e.createElementVNode("div",{class:"legend-bars-gl4 current",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"kts",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.4",-1),e.createElementVNode("span",null,"0.8",-1),e.createElementVNode("span",null,"1.6",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3.2",-1)]),4)])):e.createCommentVNode("",!0)}const h2=$(d2,[["render",q2]]),Jp="",g2={name:"IdmTemp",props:{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 L0,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[sig-wave] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},u2={key:0};function f2(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",u2,[e.createElementVNode("div",{class:"legend-bars-gl4 sig-wave",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"m",-1),e.createElementVNode("span",null,"0.5",-1),e.createElementVNode("span",null,"1",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"6",-1),e.createElementVNode("span",null,"9",-1)]),4)])):e.createCommentVNode("",!0)}const W2=$(g2,[["render",f2],["__scopeId","data-v-79ce70e2"]]),y2={name:"IdmSigWave",props:{map:{type:Object},sigWaveHeight:{type:Object},beforeLayer:{type:String},menuToggle:{type:Object}},data(){return{right:10,toggle:!1,showCaption:!1,source:"sig-wave-height-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:I.featureCollection([]),list:[{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-16 m",color:"#aa1a5a"},{label:"16-18 m",color:"#962878"},{label:"18-20 m",color:"#8c328c"},{label:"> 20 m",color:"#8c328c"}]}},watch:{"sigWaveHeight.version":{handler(){var a;(a=this.sigWaveHeight)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var a,o;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.sigWaveHeight){const t=new Date().valueOf();let b=0,p=0,c=this.empty;this.sigWaveHeight.active&&(c=this.sigWaveHeight.data),(a=this.map)!=null&&a.getSource(this.source)?((o=this.map)==null||o.getSource(this.source).setData(c),p=new Date().valueOf()-(t+b),console.log("[sig-wave-height] update elapsed: ",p,", total: ",b+=p)):(this.map.addSource(this.source,{type:"geojson",data:c}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"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",16,"#aa1464",18,"#962878",20,"#8c328c"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","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),p=new Date().valueOf()-(t+b),console.log("[sig-wave-height] add elapsed: ",p,", total: ",b+=p))}},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)}}},L2={key:0,class:"legend-tip-btn-gl4"},R2={class:"d-flex flex-row justify-start align-center"},w2={key:0,style:{width:"24px",height:"12px",border:"1px solid rgba(var(--v-border-color), var(--v-border-opacity))"}},B2={class:"text-caption px-2"};function x2(a,o,t,b,p,c){var O;const i=e.resolveComponent("v-btn"),M=e.resolveComponent("v-col"),n=e.resolveComponent("v-row"),s=e.resolveComponent("v-card-text"),r=e.resolveComponent("v-card");return(O=t.sigWaveHeight)!=null&&O.active?(e.openBlock(),e.createElementBlock("div",L2,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:p.right+"px"})},[e.createVNode(i,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:p.toggle?"primary":"",onClick:c.handleMenuToggle},{default:e.withCtx(()=>o[0]||(o[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend font-weight-bold menu-icon-color"},null,-1)])),_:1,__:[0]},8,["color","onClick"])],4),e.withDirectives(e.createVNode(r,{width:"100",elevation:"16",style:e.normalizeStyle({position:"absolute",top:"300px",right:p.right+50+"px"})},{default:e.withCtx(()=>[e.createVNode(s,{class:"pa-1 text-caption d-flex flex-column justify-center align-start opacity-70"},{default:e.withCtx(()=>[o[1]||(o[1]=e.createElementVNode("div",{class:"text-body-2 ma-1"},"Wave Height",-1)),e.createVNode(n,{class:"ma-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.list,(m,h)=>(e.openBlock(),e.createBlock(M,{cols:"12",key:h,class:"d-flex flex-row justify-start align-center pa-1"},{default:e.withCtx(()=>[e.createElementVNode("div",R2,[h===0?(e.openBlock(),e.createElementBlock("div",w2)):(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle({width:"24px",height:"12px",background:m.color})},null,4)),e.createElementVNode("div",B2,e.toDisplayString(m.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[1]})]),_:1},8,["style"]),[[e.vShow,p.showCaption]])])):e.createCommentVNode("",!0)}const N2=$(y2,[["render",x2]]),k2={name:"IdmSwell",props:{map:{type:Object},swell:{type:Object},beforeLayer:{type:String},activeWeatherLayers:{type:Array}},data(){return{source:"swell-source",directionLayer:"swell-direction-layer",heightLayer:"swell-height-layer",heightLabelLayer:"swell-height-label-layer",empty:I.featureCollection([])}},watch:{"swell.version":{handler(){var a;(a=this.swell)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,o;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.swell){const t=new Date().valueOf();let b=0,p=0,c=this.empty;if(this.swell.active&&(c=this.swell.data),(a=this.map)!=null&&a.getSource(this.source))(o=this.map)==null||o.getSource(this.source).setData(c),p=new Date().valueOf()-(t+b),console.log("[swell] update elapsed: ",p,", total: ",b+=p);else{this.map.addSource(this.source,{type:"geojson",data:c}),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 i=new Image(72,72);let M='<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="#ffffff"></path></svg>',n="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(M)));i.src=n,i.onload=()=>{this.map.hasImage("swellDirIconWhite")||this.map.addImage("swellDirIconWhite",i),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":1}},this.beforeLayer)},p=new Date().valueOf()-(t+b),console.log("[swell] add elapsed: ",p,", total: ",b+=p)}}},handleClear(){var a,o;this.activeWeatherLayers.length===0&&(a=this.map)!=null&&a.getLayer("country-boundaries")&&((o=this.map)==null||o.setLayoutProperty("country-boundaries","visibility","none")),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.getSource(this.source)&&this.map.removeSource(this.source)}}};function X2(a,o,t,b,p,c){return e.openBlock(),e.createElementBlock("div")}const C2=$(k2,[["render",X2]]),v2={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},showRampColor:{type:Boolean},activeWeatherLayers:{type:Array}},data(){return{right:10,toggle:!1,source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:I.featureCollection([])}},watch:{"prmsl.version":{handler(){var a;(a=this.prmsl)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle},handleRender(){var a,o,t;if(console.log("prmsl",this.beforeLayer),!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.prmsl){const b=new Date().valueOf();let p=0,c=0,i=this.empty;this.prmsl.active&&(i=this.prmsl.data),(a=this.map)!=null&&a.getSource(this.source)?((o=this.map)==null||o.getSource(this.source).setData(i),c=new Date().valueOf()-(b+p),console.log("[prmsl] update elapsed: ",c,", total: ",p+=c)):(this.map.addSource(this.source,{type:"geojson",data:i}),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(244,67,54,1)",980,"rgba(255,255,0,1)",1100,"rgba(199,171,250,1)"],"line-width":1,"line-opacity":.6}},this.beforeLayer),(t=this.map)==null||t.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),setTimeout(()=>{this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":["format",["get","type"],{"font-scale":1.03},`
191
- `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12},paint:{"text-color":["step",["get","val"],"rgba(255,255,255,0.8)",980,"rgba(0,0,0,0.6)",1100,"rgba(0,0,0,0.6)"],"text-halo-color":["step",["get","val"],"rgba(162,13,2,0.7)",920,"rgba(244,67,54,0.7)",980,"rgba(255,255,0,0.7)",1100,"rgba(199,171,250,0.7)"],"text-halo-width":2}})},0),c=new Date().valueOf()-(b+p),console.log("[prmsl] add elapsed: ",c,", total: ",p+=c))}},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)}}},T2={key:0,class:"legend-tip-btn-gl4"};function E2(a,o,t,b,p,c){var n;const i=e.resolveComponent("v-btn"),M=e.resolveComponent("v-tooltip");return(n=t.prmsl)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",T2,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:p.right+"px"})},[e.createVNode(M,{text:"Map Layers",location:"left","open-delay":1e3},{activator:e.withCtx(({props:s})=>[e.createVNode(i,e.mergeProps(s,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:p.toggle?"primary":"",onClick:c.handleMenuToggle}),{default:e.withCtx(()=>o[0]||(o[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4 font-weight-bold menu-icon-color"},null,-1)])),_:2,__:[0]},1040,["color","onClick"])]),_:1})],4)])):e.createCommentVNode("",!0)}const _2=$(v2,[["render",E2]]),Zp="",P2={name:"IdmIceEdge",props:{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 L0,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()}},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[ice-edge] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},S2={key:0};function D2(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",S2,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-edge",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",{style:{color:"rgba(var(--v-theme-black), 0.7)"}},"%",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"40",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"70",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"90",-1),e.createElementVNode("span",null,null,-1)]),4)])):e.createCommentVNode("",!0)}const I2=$(P2,[["render",D2]]),$p="",j2={name:"IdmCover",props:{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 L0,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()}},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[ice-cover] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},H2={key:0};function Q2(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",H2,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-cover",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"%",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"40",-1),e.createElementVNode("span",null,"60",-1),e.createElementVNode("span",null,"80",-1),e.createElementVNode("span",null,"100",-1)]),4)])):e.createCommentVNode("",!0)}const F2=$(j2,[["render",Q2],["__scopeId","data-v-9696d73b"]]),eb="",V2={name:"IdmThickness",props:{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 L0,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[ice-thickness] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},G2={key:0};function U2(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",G2,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-thickness",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"m",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.6",-1),e.createElementVNode("span",null,"1",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3",-1)]),4)])):e.createCommentVNode("",!0)}const K2=$(V2,[["render",U2]]),ob="",Y2={name:"IdmPrecip3h",props:{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 L0,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[precip3h] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},J2={key:0};function Z2(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",J2,[e.createElementVNode("div",{class:"legend-bars-gl4 precip3h",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"mm",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3",-1),e.createElementVNode("span",null,"7",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1)]),4)])):e.createCommentVNode("",!0)}const $2=$(Y2,[["render",Z2]]),tb="",et={name:"IdmVisibility",props:{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 L0,etime:void 0}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[visibility] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ot={key:0};function tt(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("div",{class:"legend-bars-gl4 visibility",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"nm",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.5",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"3",-1),e.createElementVNode("span",null,"9",-1)]),4)])):e.createCommentVNode("",!0)}const at=$(et,[["render",tt]]),ab="",pt={name:"IdmWaterTemp",props:{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 L0,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[water-temp] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},bt={key:0};function ct(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",bt,[e.createElementVNode("div",{class:"legend-bars-gl4 water-temp",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"°C",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1),e.createElementVNode("span",null,"40",-1)]),4)])):e.createCommentVNode("",!0)}const it=$(pt,[["render",ct]]),pb="",Mt={name:"IdmTemp",props:{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 L0,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[temp] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},zt={key:0};function nt(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",zt,[e.createElementVNode("div",{class:"legend-bars-gl4 temp",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"°C",-1),e.createElementVNode("span",null,"-20",-1),e.createElementVNode("span",null,"-10",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1),e.createElementVNode("span",null,"40",-1)]),4)])):e.createCommentVNode("",!0)}const rt=$(Mt,[["render",nt]]),bb="",lt={name:"IdmGlLayer",components:{IdmWindBarb:p2,IdmWindParticle:M2,IdmCurrentDirection:A2,IdmCurrentParticle:h2,IdmWave:W2,IdmSigWaveHeight:N2,IdmSwell:C2,IdmPrmsl:_2,IdmIceEdge:I2,IdmIceCover:F2,IdmIceThickness:K2,IdmPrecip3h:$2,IdmVisibility:at,IdmWaterTemp:it,IdmTemp:rt},props:{map:{type:Object},mapFeather:{type:String},gateway:{type:String,default:"aa"},assistGateway:{type:Array,default:[]},token:{type:String},defaultMeteoToken:{type:String},top:{type:Number,default:60},menuToggle:{type:Object,default:{}},realTime:{type:String},forecastModel:{type:String},beforeLayer:{type:String}},emits:["menuToggle","weatherCheckList"],data(){return{right:10,toggle:!1,autoActive:!0,allLayers:[...C0.LayerHelper.WEATHER_LAYERS],tagLayers:[...C0.LayerHelper.WEATHER_LAYERS.filter(a=>!a.hide)],checkList:[],iceToggleValue:void 0,weatherLayers:{},activeWeatherLayers:[],cache:{v:"0.0.1",versionKey:"weatherLayerCacheVersionGL4",autoActiveKey:"autoActiveCacheGL4",checkListKey:"weatherCheckListCacheGL4"},sourceList:{},rampColorLayers:["visibility","precip3h","temp","water-temp","ice-thickness","ice-cover"],zoom:6,viewport:void 0,particleFactor:void 0,showWindParticle:!0,showCurrentParticle:!0}},computed:{computeDateZ(){return function(a){var o;if(a){const t=G(a);return`${(o=t==null?void 0:t.utc())==null?void 0:o.format("MMM-DD/HHmm")}Z`}return"-"}},overlaysKeys(){return this.tagLayers.filter(a=>a.overlays).map(a=>a.key)},rendersKeys(){return this.tagLayers.filter(a=>!a.overlays).map(a=>a.key)}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.weatherLayers,this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})}},forecastModel:{handler(a,o){a&&a!==o&&this.handleWeatherLayerChange({sourceChanged:!0})}},map:{handler(){this.map&&(this.map.on("move",this.handleMove4Weather),this.viewport=new Q0(this.map),this.handleRampColorInitial(),this.handleWeatherLayerChange())},immediate:!0},realTime:{handler(a,o){a&&o&&G(a).utc().format("yyyy-MM-DD HH")!==G(o).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.fetchWeatherLayers()})},immediate:!0},checkList:{handler(a,o){this.handleCheckListChange(a,o),this.$emit("weatherCheckList",a)}},autoActive:{handler(a){localStorage.setItem(this.cache.autoActiveKey,this.autoActive),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(o=>this.checkList.includes(o.key)):[],this.handleWeatherLayerChange(),this.$parent.$refs.idmBottomBar.handleToggle(a),this.autoActive||this.handleMenuToggle()}},iceToggleValue:{handler(a){a&&(this.checkList=["ice-forecast",this.iceToggleValue])}},showWindParticle:{handler(a){let o="wind-particle";this.weatherLayers[o].particle=a,this.weatherLayers[o].version=Math.random()+1}},showCurrentParticle:{handler(a,o){let t="current-particle";this.weatherLayers[t].particle=a,this.weatherLayers[t].version=Math.random()+1}}},async mounted(){await this.fetchMeteoSource(),this.fetchCache()},methods:{arraysEqual(a,o){if((a==null?void 0:a.length)!==(o==null?void 0:o.length))return!1;for(let t=0;t<(a==null?void 0:a.length);t++)if((a==null?void 0:a[t])!==(o==null?void 0:o[t]))return!1;return!0},fetchCache(){const a=localStorage.getItem(this.cache.versionKey);this.cache.v!==a&&(localStorage.removeItem(this.cache.autoActiveKey),localStorage.removeItem(this.cache.checkListKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let o=localStorage.getItem(this.cache.autoActiveKey);this.autoActive=o!=="false",localStorage.setItem(this.cache.autoActiveKey,this.autoActive),o=localStorage.getItem(this.cache.checkListKey),this.checkList=JSON.parse(o||"[]"),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList))},handleMenuToggle(){this.$emit("menuToggle","weatherLayers"),this.autoActive&&this.$parent.$refs.idmBottomBar.handleToggle(this.autoActive)},handleFastWeatherToggle(a){let o=[];this.checkList.includes(a)?o=this.checkList.filter(t=>t!==a):o=[...this.checkList,a],this.handleCheckListChange(o,this.checkList)},handleCheckListChange(a,o){if(this.arraysEqual(a,o))return!1;const t=[...new Set(a)],b=t==null?void 0:t.filter(c=>!(o!=null&&o.includes(c)))[0],p=o==null?void 0:o.filter(c=>!(t!=null&&t.includes(c)))[0];b&&(b==="ice-cover"||b==="ice-thickness"||b==="ice-forecast"?(this.checkList=["ice-forecast",this.iceToggleValue||"ice-cover"],this.iceToggleValue=this.iceToggleValue||"ice-cover"):this.rendersKeys.includes(b)?this.checkList=[b]:this.checkList=t.filter(c=>!this.rendersKeys.includes(c))),p&&(p==="ice-forecast"?(this.checkList=t.filter(c=>!["ice-cover","ice-thickness","ice-forecast"].includes(c)),this.iceToggleValue=void 0):this.checkList=t),this.checkList.includes("wind-particle")&&(this.showWindParticle=!0),this.checkList.includes("current-particle")&&(this.showCurrentParticle=!0),localStorage.setItem(this.cache.checkListKey,JSON.stringify(t)),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(c=>t.includes(c.key)):[],this.handleWeatherLayerChange()},async fetchMeteoSource(){this.sourceList={};let a=await r0.get(`${this.gateway}/api/arc/meteo2/models`,{headers:{Authorization:this.token}});(a==null?void 0:a.data.code)===0&&(this.sourceList=a==null?void 0:a.data.data)},async fetchWeatherLayers(a={}){var p,c,i,M,n,s,r,O,m;const o=new Date().valueOf();let t=0,b=0;if(this.map){const h=((p=this.map)==null?void 0:p.getZoom())+1,R=(c=this.map)==null?void 0:c.getBounds(),C=`${R._sw.lng},${R._sw.lat},${R._ne.lng},${R._ne.lat}`;if(this.particleFactor&&((i=this.$refs.layer)!=null&&i.autoActive)){const w=C0.LayerHelper.WEATHER_LAYERS.find(B=>{var L;return((L=B.peer)==null?void 0:L.weight)===this.particleFactor.weight});this.particleFactor.particle&&(this.showWindParticle||this.showCurrentParticle)?this.weatherWeight=this.weatherWeight&w.weight?this.weatherWeight:this.weatherWeight+w.weight:this.weatherWeight=this.weatherWeight&w.weight?this.weatherWeight-w.weight:this.weatherWeight}if(this.weatherWeight>0){let w=this.weatherWeight;if(w>0){const B=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],L=await r0.get(`${B}/api/arc/weather/layers2/links?l=${w}&v=${this.forecastModel}&z=${h}&bbox=${C}&t=${this.realTime}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(b=new Date().valueOf()-(o+t),console.log("weather links elapsed: ",b,", total: ",t+=b),((M=L==null?void 0:L.data)==null?void 0:M.code)===0){const g=(n=L==null?void 0:L.data)==null?void 0:n.data,x=[];for(const W in g)x.push(r0.get(g[W],{headers:{Authorization:this.token||this.defaultMeteoToken,key:W},responseType:/\.(jpg|png)$/.test(g[W])?"blob":"json"}).catch(q=>{console.log(`[${W}] fetch layer error: ${q}`)}));const u=await Promise.all(x);this.weatherLayers={},u.map(W=>{var j,F,H,Q;const q=((j=W==null?void 0:W.data)==null?void 0:j.data)||(W==null?void 0:W.data);let v=(H=(F=W==null?void 0:W.config)==null?void 0:F.headers)==null?void 0:H.key;v&&q&&(this.weatherLayers[v]={raw:q,type:((Q=W==null?void 0:W.config)==null?void 0:Q.responseType)==="blob"?"image":"json",etime:L.data.etime})})}if(b=new Date().valueOf()-(o+t),console.log("weather layers elapsed: ",b,", total: ",t+=b),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const g=(s=this.weatherLayers["swell-direction"])==null?void 0:s.raw,x=(r=this.weatherLayers["swell-height"])==null?void 0:r.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:g,height:{raw:x},etime:L.data.etime}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const g=(O=this.weatherLayers["current-direction"])==null?void 0:O.raw,x=(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:g,speed:{raw:x},etime:L.data.etime}}}}this.handleWeatherLayerToggle(),this.handleDrawWeather4Json()}},handleWeatherLayerToggle(){var o,t;for(const b in this.weatherLayers)this.weatherLayers[b].active=!1,this.weatherLayers[b].version=Math.random()+1;for(const b of this.activeWeatherLayers){let p=b.key;p==="current-direction"&&(p="current"),this.weatherLayers[p]&&(this.weatherLayers[p].active=!0,this.weatherLayers[p].version=Math.random()+1,p==="wind-particle"&&(this.weatherLayers[p].particle=this.showWindParticle),p==="current-particle"&&(this.weatherLayers[p].particle=this.showCurrentParticle))}this.autoActive&&this.activeWeatherLayers.some(b=>["wind-particle","sig-wave","current-particle","water-temp","temp"].some(p=>p===b.key))?(this.map.getLayer("country-boundaries")&&this.map.setLayoutProperty("country-boundaries","visibility","visible"),this.map.getLayer("water-outline2")&&this.map.setLayoutProperty("water-outline2","visibility","visible"),this.map.moveLayer((o=this.viewport)==null?void 0:o.rampColorLayer,"country-boundaries"),this.map.moveLayer((t=this.viewport)==null?void 0:t.particleLayer,"country-boundaries"),this.mapFeather==="nautical"&&(this.map.getLayer("i4")&&this.map.setLayoutProperty("i4","visibility","none"),this.map.getLayer("hi")&&this.map.setLayoutProperty("hi","visibility","none"),this.map.getLayer("admin-0-boundary-bg")&&this.map.setLayoutProperty("admin-0-boundary-bg","visibility","visible"),this.map.getLayer("admin-0-boundary")&&this.map.setLayoutProperty("admin-0-boundary","visibility","visible"),this.map.getLayer("admin-0-boundary-disputed")&&this.map.setLayoutProperty("admin-0-boundary-disputed","visibility","visible"),this.map.getLayer("country-label")&&this.map.setLayoutProperty("country-label","visibility","visible"),this.map.getLayer("continent-label")&&this.map.setLayoutProperty("continent-label","visibility","visible"),this.map.getLayer("state-label")&&this.map.setLayoutProperty("state-label","visibility","visible"))):(this.map.getLayer("country-boundaries")&&this.map.setLayoutProperty("country-boundaries","visibility","none"),this.map.getLayer("water-outline2")&&this.map.setLayoutProperty("water-outline2","visibility","none"),this.mapFeather==="nautical"&&(this.map.getLayer("i4")&&this.map.setLayoutProperty("i4","visibility","visible"),this.map.getLayer("hi")&&this.map.setLayoutProperty("hi","visibility","visible"),this.map.getLayer("admin-0-boundary-bg")&&this.map.setLayoutProperty("admin-0-boundary-bg","visibility","none"),this.map.getLayer("country-label")&&this.map.setLayoutProperty("admin-0-boundary","visibility","none"),this.map.getLayer("admin-0-boundary-disputed")&&this.map.setLayoutProperty("admin-0-boundary-disputed","visibility","none"),this.map.getLayer("country-label")&&this.map.setLayoutProperty("country-label","visibility","none"),this.map.getLayer("continent-label")&&this.map.setLayoutProperty("continent-label","visibility","none"),this.map.getLayer("state-label")&&this.map.setLayoutProperty("state-label","visibility","none")))},handleWeatherLayerChange(a={sourceChanged:!1}){this.map?setTimeout(()=>{var t;const o=(t=this.activeWeatherLayers)==null?void 0:t.reduce((b,p)=>b+(b&(p==null?void 0:p.weight)?0:p==null?void 0:p.weight),0);a!=null&&a.sourceChanged||this.weatherWeight!==o?(this.weatherWeight=o,this.fetchWeatherLayers()):this.handleWeatherLayerToggle()}):setTimeout(()=>{this.handleWeatherLayerChange()},500)},handleRampColorInitial(){var a,o,t,b,p,c,i,M,n,s,r,O;this.viewport.map.getSource((a=this.viewport)==null?void 0:a.rampColorSource)||this.viewport.map.addSource((o=this.viewport)==null?void 0:o.rampColorSource,{type:"canvas",canvas:(t=this.viewport)==null?void 0:t.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((b=this.viewport)==null?void 0:b.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(p=this.viewport)==null?void 0:p.rampColorLayer,source:(c=this.viewport)==null?void 0:c.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((i=this.viewport)==null?void 0:i.particleSource)||this.viewport.map.addSource((M=this.viewport)==null?void 0:M.particleSource,{type:"canvas",canvas:(n=this.viewport)==null?void 0:n.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((s=this.viewport)==null?void 0:s.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(r=this.viewport)==null?void 0:r.particleLayer,source:(O=this.viewport)==null?void 0:O.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDrawWeather4Json(){var s,r,O,m,h,R,C;const a=new Date().valueOf();let o=0,t=0;const b=(s=this.map)==null?void 0:s.getBounds(),p=(r=this.map)==null?void 0:r.getZoom(),c=t0.LngLatHelper.convertToStdLng(b._sw.lng),i=t0.LngLatHelper.convertToStdLng(b._ne.lng),M=Math.floor(b._sw.lat),n=Math.ceil(b._ne.lat);for(const w in this.weatherLayers){let B=!1;if(this.weatherLayers[w].active&&this.weatherLayers[w].type==="json"){let L=[];if(w==="swell"){B=!0;const g=((O=this.weatherLayers[w])==null?void 0:O.direction)||{};for(const u in g)if(u>M&&u<n&&(!(p<=this.zoom)||u%(p<2?10:p<4?5:3)===0)){const W=g[u].lng;c>i?W.forEach((q,v)=>{var j,F,H,Q,o0,Z;if(p<2){if((q>=0&&q<=360||q>=-360&&q<=0)&&q%10===0){const Y=I.point([q,u],{val:((j=g[u].val)==null?void 0:j[v])||((F=g[u].dir)==null?void 0:F[v]),spd:(H=g[u].spd)==null?void 0:H[v]});L.push(Y)}}else if((q>=c&&q<=180||q>=-180&&q<=i)&&(!(p<=this.zoom)||q%(p<2?10:p<4?5:3)===0)){const Y=I.point([q,u],{val:((Q=g[u].val)==null?void 0:Q[v])||((o0=g[u].dir)==null?void 0:o0[v]),spd:(Z=g[u].spd)==null?void 0:Z[v]});L.push(Y)}}):W.forEach((q,v)=>{var j,F,H,Q,o0,Z;if(c<2){if((q>=0&&q<=360||q>=-360&&q<=0)&&q%10===0){const Y=I.point([q,u],{val:((j=g[u].val)==null?void 0:j[v])||((F=g[u].dir)==null?void 0:F[v]),spd:(H=g[u].spd)==null?void 0:H[v]});L.push(Y)}}else if(q>=c&&q<=i&&(!(p<=this.zoom)||q%(p<2?10:p<4?5:3)===0)){const Y=I.point([q,u],{val:((Q=g[u].val)==null?void 0:Q[v])||((o0=g[u].dir)==null?void 0:o0[v]),spd:(Z=g[u].spd)==null?void 0:Z[v]});L.push(Y)}})}t=new Date().valueOf()-(a+o),console.log("swell direction elapsed: ",t,", total: ",o+=t);const x=this.weatherLayers[w].height;if(x){if(!x.data){const u=[];for(const W in(m=x.raw)==null?void 0:m.LineString){const q=x.raw.LineString[W];for(const v of q)u.push(I.lineString(v,{val:Number(W)}));x.data=I.featureCollection(u)}}if(x.data){const u=this.handleBboxClip(x.data,b);L=L.concat(u)}t=new Date().valueOf()-(a+o),console.log("swell height elapsed: ",t,", total: ",o+=t)}}else if(w==="current"){B=!0;const g=((h=this.weatherLayers[w])==null?void 0:h.direction)||{};for(const u in g)if(u>M&&u<n&&(!(p<=this.zoom)||u%(p<2?10:p<4?5:3)===0)){const W=g[u].lng;c>i?W.forEach((q,v)=>{var j,F,H,Q,o0,Z;if(p<2){if((q>=0&&q<=360||q>=-360&&q<=0)&&q%10===0){const Y=I.point([q,u],{val:((j=g[u].val)==null?void 0:j[v])||((F=g[u].dir)==null?void 0:F[v]),spd:(H=g[u].spd)==null?void 0:H[v]});L.push(Y)}}else if((q>=c&&q<=180||q>=-180&&q<=i)&&(!(p<=this.zoom)||q%(p<2?10:p<4?5:3)===0)){const Y=I.point([q,u],{val:((Q=g[u].val)==null?void 0:Q[v])||((o0=g[u].dir)==null?void 0:o0[v]),spd:(Z=g[u].spd)==null?void 0:Z[v]});L.push(Y)}}):W.forEach((q,v)=>{var j,F,H,Q,o0,Z;if(c<2){if((q>=0&&q<=360||q>=-360&&q<=0)&&q%10===0){const Y=I.point([q,u],{val:((j=g[u].val)==null?void 0:j[v])||((F=g[u].dir)==null?void 0:F[v]),spd:(H=g[u].spd)==null?void 0:H[v]});L.push(Y)}}else if(q>=c&&q<=i&&(!(p<=this.zoom)||q%(p<this.zoom/2?5:3)===0)){const Y=I.point([q,u],{val:((Q=g[u].val)==null?void 0:Q[v])||((o0=g[u].dir)==null?void 0:o0[v]),spd:(Z=g[u].spd)==null?void 0:Z[v]});L.push(Y)}})}t=new Date().valueOf()-(a+o),console.log("current direction elapsed: ",t,", total: ",o+=t);const x=this.weatherLayers[w].speed;if(x){if(!x.data){const W=[];for(const q in(R=x.raw)==null?void 0:R.Polygon){const v=x.raw.Polygon[q];for(const j of v)W.push(I.polygon(j,{val:Number(q)}))}x.data=I.featureCollection(W)}const u=p<this.zoom?x.data.features.filter(W=>W.properties.val>.5):x.data.features;L=L.concat(u),t=new Date().valueOf()-(a+o),console.log("current speed elapsed: ",t,", total: ",o+=t)}}else if(w==="wind"){B=!0;const g=this.weatherLayers.wind.raw;for(const x in g)if(x>M&&x<n&&(!(p<=this.zoom)||x%(p<2?10:p<4?5:3)===0)){const u=g[x].lng;c>i?u.forEach((W,q)=>{var v,j,F,H;if(p<2){if((W>=0&&W<=360||W>=-360&&W<=0)&&W%10===0){const Q=I.point([W,x],{dir:((v=g[x].val)==null?void 0:v[q])||((j=g[x].dir)==null?void 0:j[q]),spd:g[x].spd[q]});L.push(Q)}}else if((W>=c&&W<=180||W>=-180&&W<=i)&&(!(p<=this.zoom)||W%(p<2?10:p<4?5:3)===0)){const Q=I.point([W,x],{dir:((F=g[x].val)==null?void 0:F[q])||((H=g[x].dir)==null?void 0:H[q]),spd:g[x].spd[q]});L.push(Q)}}):u.forEach((W,q)=>{var v,j,F,H;if(p<2){if((W>=0&&W<=360||W>=-360&&W<=0)&&W%10===0){const Q=I.point([W,x],{dir:((v=g[x].val)==null?void 0:v[q])||((j=g[x].dir)==null?void 0:j[q]),spd:g[x].spd[q]});L.push(Q)}}else if(W>=c&&W<=i&&(!(p<=this.zoom)||W%(p<2?10:p<4?5:3)===0)){const Q=I.point([W,x],{dir:((F=g[x].val)==null?void 0:F[q])||((H=g[x].dir)==null?void 0:H[q]),spd:g[x].spd[q]});L.push(Q)}})}t=new Date().valueOf()-(a+o),console.log("wind barb elapsed: ",t,", total: ",o+=t)}else if(w==="sig-wave-height"){if(this.weatherLayers[w].data)L=this.weatherLayers[w].data;else{B=!0;const g=this.weatherLayers[w].raw;if(g){const x=[];for(const u in g.Polygon){const W=g.Polygon[u];for(const q of W)x.push(I.polygon(q,{val:Number(u)}))}for(const u in g.Point){const W=g.Point[u];for(let q=0;q<((C=W.lng)==null?void 0:C.length);q++)x.push(I.point([W.lng[q],u],{val:Number(W.val[q])}))}L=L.concat(x)}}t=new Date().valueOf()-(a+o),console.log("sig-wave-height elapsed: ",t,", total: ",o+=t)}else if(w==="prmsl"){if(this.weatherLayers[w].data)L=this.weatherLayers[w].data;else{B=!0;const g=this.weatherLayers[w].raw;if(g){const x=[];for(const u in g.LineString){const W=g.LineString[u];for(const q of W)x.push(I.lineString(q,{val:Number(u)}))}for(const u in g.Point)g.Point[u].lng.forEach((W,q)=>{W=t0.LngLatHelper.convertToStdLng(W),x.push(I.point([W,u],{val:g.Point[u].val[q],type:g.Point[u].type[q]}))});L=L.concat(x)}}t=new Date().valueOf()-(a+o),console.log("prmsl elapsed: ",t,", total: ",o+=t)}L.length&&(this.weatherLayers[w].data=I.featureCollection(L)),B&&(this.weatherLayers[w].version=Math.random()+1)}}},handleMove4Weather(){for(const a in this.weatherLayers)this.weatherLayers[a].active&&this.weatherLayers[a].type==="image"&&(this.weatherLayers[a].active=!0,this.weatherLayers[a].version=Math.random()+1);this.handleDrawWeather4Json()},handleBboxClip(a,o){const t=[],b=t0.LngLatHelper.convertToStdLng(o._sw.lng),p=t0.LngLatHelper.convertToStdLng(o._ne.lng);return a.features.forEach(c=>{if(c.geometry.type!=="Point")if(b>p){let i=[b,o._sw.lat,180,o._ne.lat],M=I.bboxClip(c,i);M.geometry.coordinates.length&&t.push(M),i=[-180,o._sw.lat,p,o._ne.lat],M=I.bboxClip(c,i),M.geometry.coordinates.length&&t.push(M)}else{const i=[b,o._sw.lat,p,o._ne.lat],M=I.bboxClip(c,i);M.geometry.coordinates.length&&t.push(M)}else t.push(c)}),t}}},st={class:"idm-gl4-meteo-layers"},Ot={class:"header-box d-flex justify-space-between align-center pl-4 pr-4"},At={class:"d-flex justify-start align-center ga-3"},dt={class:"text-h5"},mt={class:"layers-body"},qt={class:"layers-body"},ht={key:0,class:"d-flex justify-start align-center ga-4 pl-6"},gt={key:1,class:"d-flex justify-start align-center ga-4 pl-6"},ut={class:"text-body-1 py-2"},ft={class:"text-body-1 font-weight-medium"},Wt={class:"text-body-2 opacity-70"},yt={key:0,class:"text-body-2 opacity-70 mb-3"},Lt={class:"text-body-1 py-2"},Rt={class:"text-body-1 font-weight-medium"},wt={class:"text-body-2 opacity-70"},Bt={class:"text-body-2 opacity-70 pb-1"};function xt(a,o,t,b,p,c){var Y,e0,M0,s0,i0,J,T,b0,d0,m0,q0,n0,K,p0,h0;const i=e.resolveComponent("VBtn"),M=e.resolveComponent("VTooltip"),n=e.resolveComponent("VSwitch"),s=e.resolveComponent("VCardTitle"),r=e.resolveComponent("VCardItem"),O=e.resolveComponent("VCheckbox"),m=e.resolveComponent("VCardText"),h=e.resolveComponent("VCard"),R=e.resolveComponent("VBtnToggle"),C=e.resolveComponent("VDivider"),w=e.resolveComponent("IdmWindBarb"),B=e.resolveComponent("IdmSigWaveHeight"),L=e.resolveComponent("IdmCurrentDirection"),g=e.resolveComponent("IdmPrmsl"),x=e.resolveComponent("IdmWindParticle"),u=e.resolveComponent("IdmCurrentParticle"),W=e.resolveComponent("IdmWave"),q=e.resolveComponent("IdmSwell"),v=e.resolveComponent("IdmIceEdge"),j=e.resolveComponent("IdmIceCover"),F=e.resolveComponent("IdmIceThickness"),H=e.resolveComponent("IdmPrecip3h"),Q=e.resolveComponent("IdmVisibility"),o0=e.resolveComponent("IdmWaterTemp"),Z=e.resolveComponent("IdmTemp");return e.openBlock(),e.createElementBlock("div",st,[e.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:e.normalizeStyle({top:t.top+94+"px",right:p.right+"px"})},[e.createVNode(M,{text:a.$t("weather.weatherLayers"),location:"left","open-delay":1e3},{activator:e.withCtx(({props:f})=>[e.createVNode(i,e.mergeProps(f,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:p.toggle?"primary":"",onClick:c.handleMenuToggle}),{default:e.withCtx(()=>o[6]||(o[6]=[e.createElementVNode("i",{class:"iconfont icon-Weather text-h4 font-weight-bold menu-icon-color"},null,-1)])),_:2,__:[6]},1040,["color","onClick"])]),_:1},8,["text"])],4),e.createElementVNode("div",{class:e.normalizeClass(["available-layers transition flex-center",p.toggle?"right-bar":""]),style:e.normalizeStyle({top:t.top+"px",right:p.toggle?"0px":"-280px"})},[e.createElementVNode("div",Ot,[e.createElementVNode("div",At,[e.createElementVNode("div",dt,e.toDisplayString(a.$t("weather.weather")),1),e.createVNode(n,{modelValue:p.autoActive,"onUpdate:modelValue":o[0]||(o[0]=f=>p.autoActive=f),class:"small-switch",color:"primary","hide-details":""},null,8,["modelValue"])]),e.createVNode(i,{icon:"",density:"comfortable",variant:"plain",class:"mr-n2",onClick:c.handleMenuToggle},{default:e.withCtx(()=>o[7]||(o[7]=[e.createElementVNode("i",{class:"iconfont icon-close",style:{"font-size":"20px"}},null,-1)])),_:1,__:[7]},8,["onClick"])]),e.createElementVNode("div",{class:e.normalizeClass(["list-box scroll pl-4 pr-2 overflow-y-auto",p.autoActive?"":"cursor-not-allowed"])},[e.createVNode(h,{class:"menu-card mx-auto my-3",elevation:"8"},{default:e.withCtx(()=>[e.createVNode(r,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(s,{class:"text-subtitle-1",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.overlays")),1)]),_:1})]),_:1}),e.createVNode(m,null,{default:e.withCtx(()=>[e.createElementVNode("div",mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.tagLayers.filter(f=>f.overlays),f=>(e.openBlock(),e.createBlock(O,{key:f.key,modelValue:p.checkList,"onUpdate:modelValue":o[1]||(o[1]=z0=>p.checkList=z0),value:f.key,label:a.$t(`weather.${f.locale}`),disabled:!p.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}),e.createVNode(h,{class:"menu-card mx-auto mb-3",elevation:"8"},{default:e.withCtx(()=>[e.createVNode(r,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(s,{class:"text-subtitle-1",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.renders")),1)]),_:1})]),_:1}),e.createVNode(m,null,{default:e.withCtx(()=>[e.createElementVNode("div",qt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.tagLayers.filter(f=>!f.overlays&&f.key!=="ice-thickness"),f=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f.key},[e.createVNode(O,{modelValue:p.checkList,"onUpdate:modelValue":o[2]||(o[2]=z0=>p.checkList=z0),value:f.key,label:a.$t(`weather.${f.locale}`),disabled:!p.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label","disabled"]),p.checkList.includes("wind-particle")&&f.key==="wind-particle"?(e.openBlock(),e.createElementBlock("div",ht,[o[8]||(o[8]=e.createElementVNode("span",null,"Particle",-1)),e.createVNode(n,{modelValue:p.showWindParticle,"onUpdate:modelValue":o[3]||(o[3]=z0=>p.showWindParticle=z0),label:"",class:"small-switch",color:"primary",density:"compact",style:{"font-size":"14px"},"hide-details":""},null,8,["modelValue"])])):e.createCommentVNode("",!0),p.checkList.includes("current-particle")&&f.key==="current-particle"?(e.openBlock(),e.createElementBlock("div",gt,[o[9]||(o[9]=e.createElementVNode("span",null,"Particle",-1)),e.createVNode(n,{modelValue:p.showCurrentParticle,"onUpdate:modelValue":o[4]||(o[4]=z0=>p.showCurrentParticle=z0),label:"",class:"small-switch",color:"primary",density:"compact",height:"20","hide-details":""},null,8,["modelValue"])])):e.createCommentVNode("",!0),p.checkList.includes("ice-forecast")&&f.key==="ice-forecast"?(e.openBlock(),e.createBlock(R,{key:2,modelValue:p.iceToggleValue,"onUpdate:modelValue":o[5]||(o[5]=z0=>p.iceToggleValue=z0),class:"ml-7",rounded:"0",height:"30",density:"compact",group:"",disabled:!p.autoActive},{default:e.withCtx(()=>[e.createVNode(i,{density:"compact",height:"30",value:"ice-cover",class:"text-none px-2",color:p.iceToggleValue==="ice-cover"?"primary":"","base-color":"grey-lighten-1",disabled:!p.autoActive},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.coverage")),1)]),_:1},8,["color","disabled"]),e.createVNode(i,{density:"compact",height:"30",class:"text-none px-2",color:p.iceToggleValue==="ice-thickness"?"primary":"","base-color":"grey-lighten-1",disabled:!p.autoActive,value:"ice-thickness"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.thickness")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):e.createCommentVNode("",!0)],64))),128))])]),_:1})]),_:1}),e.createVNode(h,{class:"menu-card mx-auto mb-3",elevation:"8"},{default:e.withCtx(()=>[e.createVNode(r,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(s,{class:"text-subtitle-1",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.forecastModel")),1)]),_:1})]),_:1}),e.createVNode(m,{class:""},{default:e.withCtx(()=>{var f,z0,O0,z;return[e.createElementVNode("div",ut,e.toDisplayString(a.$t("weather.atmospheric")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((z0=(f=p.sourceList)==null?void 0:f.weather)==null?void 0:z0.filter(A=>A.model!=="best_match"),A=>{var d,y,k,P,X,V;return e.openBlock(),e.createElementBlock(e.Fragment,{key:`source${A.name}`},[e.createElementVNode("div",ft,e.toDisplayString(A.name)+" "+e.toDisplayString(A.resolution)+e.toDisplayString(a.$t("units.km"))+" "+e.toDisplayString(A.length)+e.toDisplayString(a.$t("units.days")),1),e.createElementVNode("div",Wt,e.toDisplayString(a.$t("weather.source"))+": "+e.toDisplayString(A.provider),1),(k=(y=(d=A==null?void 0:A.update)==null?void 0:d.default)==null?void 0:y.meta)!=null&&k.initialisationTime?(e.openBlock(),e.createElementBlock("div",yt,e.toDisplayString(a.$t("weather.lastUpdate"))+": "+e.toDisplayString(c.computeDateZ((V=(X=(P=A==null?void 0:A.update)==null?void 0:P.default)==null?void 0:X.meta)==null?void 0:V.initialisationTime)),1)):e.createCommentVNode("",!0)],64)}),128)),e.createVNode(C),e.createElementVNode("div",Lt,e.toDisplayString(a.$t("weather.marine")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((z=(O0=p.sourceList)==null?void 0:O0.marine)==null?void 0:z.filter(A=>A.model!=="best_match"),A=>{var d,y,k;return e.openBlock(),e.createElementBlock(e.Fragment,{key:`source${A.name}`},[e.createElementVNode("div",Rt,e.toDisplayString(A.name)+" "+e.toDisplayString(A.resolution)+e.toDisplayString(a.$t("units.km"))+" "+e.toDisplayString(A.length)+e.toDisplayString(a.$t("units.days")),1),e.createElementVNode("div",wt,e.toDisplayString(a.$t("weather.source"))+": "+e.toDisplayString(A.provider),1),e.createElementVNode("div",Bt,e.toDisplayString(a.$t("weather.lastUpdate"))+": "+e.toDisplayString(c.computeDateZ((k=(y=(d=A==null?void 0:A.update)==null?void 0:d.default)==null?void 0:y.meta)==null?void 0:k.initialisationTime)),1)],64)}),128))]}),_:1})]),_:1})],2)],6),t.map?(e.openBlock(),e.createBlock(w,e.mergeProps({key:0,ref:"windBarb",map:t.map,"map-feather":t.mapFeather,"before-layer":"empty-layer-2",wind:(Y=p.weatherLayers)==null?void 0:Y.wind,"menu-toggle":t.menuToggle},a.$attrs),null,16,["map","map-feather","wind","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(B,e.mergeProps({key:1,map:t.map,"before-layer":"empty-layer-2","sig-wave-height":(e0=p.weatherLayers)==null?void 0:e0["sig-wave-height"],"menu-toggle":t.menuToggle,"active-weather-layers":p.activeWeatherLayers},a.$attrs),null,16,["map","sig-wave-height","menu-toggle","active-weather-layers"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(L,e.mergeProps({key:2,map:t.map,"before-layer":"empty-layer-2",current:(M0=p.weatherLayers)==null?void 0:M0.current,"menu-toggle":t.menuToggle},a.$attrs),null,16,["map","current","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(g,e.mergeProps({key:3,map:t.map,"before-layer":"empty-layer-2",prmsl:(s0=p.weatherLayers)==null?void 0:s0.prmsl,"menu-toggle":t.menuToggle,"active-weather-layers":p.activeWeatherLayers},a.$attrs),null,16,["map","prmsl","menu-toggle","active-weather-layers"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(x,e.mergeProps({key:4,viewport:p.viewport,factor:(i0=p.weatherLayers)==null?void 0:i0["wind-particle"],"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(u,e.mergeProps({key:5,viewport:p.viewport,factor:(J=p.weatherLayers)==null?void 0:J["current-particle"],"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(W,e.mergeProps({key:6,viewport:p.viewport,factor:(T=p.weatherLayers)==null?void 0:T["sig-wave"],"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(q,e.mergeProps({key:7,map:t.map,swell:(b0=p.weatherLayers)==null?void 0:b0.swell,"menu-toggle":t.menuToggle,"active-weather-layers":p.activeWeatherLayers},a.$attrs),null,16,["map","swell","menu-toggle","active-weather-layers"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(v,e.mergeProps({key:8,viewport:p.viewport,factor:(d0=p.weatherLayers)==null?void 0:d0["ice-edge"],"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(j,e.mergeProps({key:9,viewport:p.viewport,factor:(m0=p.weatherLayers)==null?void 0:m0["ice-cover"],"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(F,e.mergeProps({key:10,viewport:p.viewport,factor:(q0=p.weatherLayers)==null?void 0:q0["ice-thickness"],"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(H,e.mergeProps({key:11,viewport:p.viewport,factor:(n0=p.weatherLayers)==null?void 0:n0.precip3h,"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(Q,e.mergeProps({key:12,viewport:p.viewport,factor:(K=p.weatherLayers)==null?void 0:K.visibility,"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(o0,e.mergeProps({key:13,viewport:p.viewport,factor:(p0=p.weatherLayers)==null?void 0:p0["water-temp"],"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(Z,e.mergeProps({key:14,viewport:p.viewport,factor:(h0=p.weatherLayers)==null?void 0:h0.temp,"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0)])}const Nt=$(lt,[["render",xt]]),v0=[{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"],categories:"ecmwf_ifs025,ecmwf_aifs025_single",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"}],T0=[{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"}];class G0{static standardWeatherModels(){return v0.filter(o=>!o.disabled&&o.alias)}static standardMarineModels(){return T0.filter(o=>!o.disabled&&o.alias)}static autoPickLayerModel(o,t="copernicus"){return t=t||"copernicus",t=t==null?void 0:t.toLowerCase(),t=["gfs","ecmwf","copernicus"].includes(t)?t:"copernicus",o=o==null?void 0:o.toLowerCase(),o==="gfs"?"gfs":["ec","ecmwf"].includes(o)?"ecmwf":["copernicus","cmems"].includes(o)?"copernicus":t}static autoPickPeerModel(o,t,b="copernicus"){if(t=this.autoPickLayerModel(t,b),Xe.LayerHelper.WEATHER_LAYERS.reduce((p,c)=>c.atmos?p+c.weight:p,0)&o.weight){if(t==="copernicus")return"ecmwf"}else if(t==="ecmwf")return"copernicus";return t}static autoPickMeteoModel(o="best_match"){var t,b;o=o==null?void 0:o.toLowerCase(),o=o==="ec"?"ecmwf":o;const p=o.toLowerCase().split(","),c=[],i=[];for(const M of p){let n=v0.find(r=>{var O,m,h;return((O=r.models)==null?void 0:O.includes(M))||((m=r.alias)==null?void 0:m.toLowerCase())===M||((h=r.name)==null?void 0:h.toLowerCase())===M}),s=T0.find(r=>{var O,m,h;return((O=r.models)==null?void 0:O.includes(M))||((m=r.alias)==null?void 0:m.toLowerCase())===M||((h=r.name)==null?void 0:h.toLowerCase())===M});n=n||v0.find(r=>{var O,m;return((O=r.alias)==null?void 0:O.toLowerCase())===((m=s==null?void 0:s.alias)==null?void 0:m.toLowerCase())}),s=s||T0.find(r=>{var O,m;return((O=r.alias)==null?void 0:O.toLowerCase())===((m=n==null?void 0:n.alias)==null?void 0:m.toLowerCase())}),n=n||v0[0],s=s||T0[0],c.push((t=n.models)!=null&&t.includes(M)?M:n.model),i.push((b=s.models)!=null&&b.includes(M)?M:s.model)}return{weatherModels:c.join(","),marineModels:i.join(",")}}static autoPickSubCategories(o){o=o.toUpperCase();const t=v0.filter(c=>c.alias===o),b=T0.filter(c=>c.alias===o),p=[];return t.forEach(c=>{c.categories&&p.push(...c.categories.split(","))}),b.forEach(c=>{c.categories&&p.push(...c.categories.split(","))}),p}static pickHourly(o,t){var b,p,c,i,M,n,s,r,O,m,h,R,C,w,B,L,g,x,u,W,q,v,j,F,H,Q,o0,Z,Y,e0,M0,s0,i0,J,T,b0,d0,m0,q0,n0,K,p0,h0,f,z0,O0,z,A,d,y;const k=typeof t=="string"?G(t):t,P=o==null?void 0:o.weather,X=o==null?void 0:o.marine,V=G((p=(b=P==null?void 0:P[0])==null?void 0:b.hourly)==null?void 0:p.date).utc(),E=V.clone().add((M=(i=(c=P==null?void 0:P[0])==null?void 0:c.hourly)==null?void 0:i.time)==null?void 0:M.at(0),"h"),c0=V.clone().add((r=(s=(n=P==null?void 0:P[0])==null?void 0:n.hourly)==null?void 0:s.time)==null?void 0:r.at(-1),"h"),R0=[];if(k.isBetween(E,c0,"millisecond","[]")){const S=k.utc().diff(E,"h",!1);let g0,y0;if(P){let w0=0,B0=0;for(const _ of P){const U=_==null?void 0:_.hourly;for(let f0=S-(S-1)%3;f0<=S;f0++)w0+=(O=U==null?void 0:U.precipitation)==null?void 0:O.at(f0);for(let f0=S-(S-1)%6;f0<=S;f0++)B0+=(m=U==null?void 0:U.precipitation)==null?void 0:m.at(f0);g0={temp:(h=U==null?void 0:U.temperature_2m)==null?void 0:h.at(S),apparentTemp:(R=U==null?void 0:U.apparent_temperature)==null?void 0:R.at(S),rh:(C=U==null?void 0:U.relative_humidity_2m)==null?void 0:C.at(S),dp:(w=U==null?void 0:U.dew_point_2m)==null?void 0:w.at(S),precip:{probability:(B=U==null?void 0:U.precipitation_probability)==null?void 0:B.at(S),sum:(L=U==null?void 0:U.precipitation)==null?void 0:L.at(S),sum3Hours:Math.round(w0*100)/100,sum6Hours:Math.round(B0*100)/100},pmsl:(g=U==null?void 0:U.pressure_msl)==null?void 0:g.at(S),psurf:(x=U==null?void 0:U.surface_pressure)==null?void 0:x.at(S),code:(u=U==null?void 0:U.weather_code)==null?void 0:u.at(S),visibility:this.m2nm((W=U==null?void 0:U.visibility)==null?void 0:W.at(S)),wind:{speed:(q=U==null?void 0:U.wind_speed_10m)==null?void 0:q.at(S),kts:(v=U==null?void 0:U.wind_speed_10m)==null?void 0:v.at(S),degree:(j=U==null?void 0:U.wind_direction_10m)==null?void 0:j.at(S),bearing:((F=U==null?void 0:U.wind_direction_10m)==null?void 0:F.at(S))!==null?(((H=U==null?void 0:U.wind_direction_10m)==null?void 0:H.at(S))+180)%360:null,gusts:(Q=U==null?void 0:U.wind_gusts_10m)==null?void 0:Q.at(S)},isDay:(o0=U==null?void 0:U.is_day)==null?void 0:o0.at(S)};const{name:N0,url:k0,bg:X0}=this.parseWeatherCode(g0.code,g0.isDay);g0.name=N0,g0.url=k0,g0.bg=X0,g0.wind.scale=this.beaufort(this.kts2ms(g0.wind.kts)),g0.wind.direction=this.degree2Direction(g0.wind.degree),R0.push({utc:E.add(S,"h").format(),model:_.model,weather:{...g0}})}}if(X){let w0=0;for(const B0 of X){const _=B0==null?void 0:B0.hourly;y0={wave:{sig:{height:(Z=_==null?void 0:_.wave_height)==null?void 0:Z.at(S),degree:(Y=_==null?void 0:_.wave_direction)==null?void 0:Y.at(S),bearing:((e0=_==null?void 0:_.wave_direction)==null?void 0:e0.at(S))!==null?(((M0=_==null?void 0:_.wave_direction)==null?void 0:M0.at(S))+180)%360:null,period:(s0=_==null?void 0:_.wave_period)==null?void 0:s0.at(S)},swell:{height:(i0=_==null?void 0:_.swell_wave_height)==null?void 0:i0.at(S),degree:(J=_==null?void 0:_.swell_wave_direction)==null?void 0:J.at(S),bearing:((T=_==null?void 0:_.swell_wave_direction)==null?void 0:T.at(S))!==null?(((b0=_==null?void 0:_.swell_wave_direction)==null?void 0:b0.at(S))+180)%360:null,period:(d0=_==null?void 0:_.swell_wave_period)==null?void 0:d0.at(S),peakPeriod:(m0=_==null?void 0:_.swell_wave_peak_period)==null?void 0:m0.at(S)},wd:{height:(q0=_==null?void 0:_.wind_wave_height)==null?void 0:q0.at(S),degree:(n0=_==null?void 0:_.wind_wave_direction)==null?void 0:n0.at(S),bearing:((K=_==null?void 0:_.wind_wave_direction)==null?void 0:K.at(S))!==null?(((p0=_==null?void 0:_.wind_wave_direction)==null?void 0:p0.at(S))+180)%360:null,period:(h0=_==null?void 0:_.wind_wave_period)==null?void 0:h0.at(S),peakPeriod:(f=_==null?void 0:_.wind_wave_peak_period)==null?void 0:f.at(S)}},current:{speed:(z0=_==null?void 0:_.ocean_current_velocity)==null?void 0:z0.at(S),kts:(O0=_==null?void 0:_.ocean_current_velocity)==null?void 0:O0.at(S),degree:(z=_==null?void 0:_.ocean_current_direction)==null?void 0:z.at(S),bearing:((A=_==null?void 0:_.ocean_current_direction)==null?void 0:A.at(S))??null},sst:(d=_==null?void 0:_.sea_surface_temperature)==null?void 0:d.at(S),height:(y=_==null?void 0:_.sea_level_height_msl)==null?void 0:y.at(S)},y0.wave=this.parseWave(y0.wave,g0==null?void 0:g0.wind),y0.current.direction=this.degree2Direction(y0.current.degree),Object.assign(R0[w0],y0),w0++}}}return R0}static toLegacy(o){var t,b,p,c,i,M,n,s,r,O;return{wind:(t=o==null?void 0:o.weather)==null?void 0:t.wind,visibility:(b=o==null?void 0:o.weather)==null?void 0:b.visibility,temp:(p=o==null?void 0:o.weather)==null?void 0:p.temp,prmsl:(c=o==null?void 0:o.weather)==null?void 0:c.pmsl,gusts:{kts:(M=(i=o==null?void 0:o.weather)==null?void 0:i.wind)==null?void 0:M.gusts},precip:(n=o==null?void 0:o.weather)==null?void 0:n.precip,code:(s=o==null?void 0:o.weather)==null?void 0:s.code,name:(r=o==null?void 0:o.weather)==null?void 0:r.name,url:(O=o==null?void 0:o.weather)==null?void 0:O.url,wave:o==null?void 0:o.wave,current:o==null?void 0:o.current,sst:o==null?void 0:o.sst,height:o==null?void 0:o.height,utc:o==null?void 0:o.utc,source:o==null?void 0:o.model}}static pickDaily(o,t){var b,p,c,i,M,n,s,r,O,m,h,R,C,w,B,L,g,x,u,W,q,v,j,F,H,Q,o0,Z,Y,e0,M0,s0,i0,J,T,b0,d0,m0,q0,n0,K,p0,h0,f;const z0=typeof t=="string"?G(t):t,O0=o==null?void 0:o.weather,z=o==null?void 0:o.marine,A=G((c=(p=(b=O0==null?void 0:O0[0])==null?void 0:b.daily)==null?void 0:p.time)==null?void 0:c.at(0)),d=G((n=(M=(i=O0==null?void 0:O0[0])==null?void 0:i.daily)==null?void 0:M.time)==null?void 0:n.at(-1)),y=[];if(z0.isBetween(A,d,"millisecond","[]")){let k,P;const X=z0.diff(A,"d",!1);if(O0)for(const V of O0){const E=V.daily;k={code:(s=E.weather_code)==null?void 0:s.at(X),temp:{max:(r=E.temperature_2m_max)==null?void 0:r.at(X),min:(O=E.temperature_2m_min)==null?void 0:O.at(X),mean:(m=E.temperature_2m_mean)==null?void 0:m.at(X)},apparentTemp:{max:(h=E.apparent_temperature_max)==null?void 0:h.at(X),min:(R=E.apparent_temperature_min)==null?void 0:R.at(X)},precip:{sum:(C=E.precipitation_sum)==null?void 0:C.at(X),rainSum:(w=E.rain_sum)==null?void 0:w.at(X),snowfallSum:(B=E.snowfall_sum)==null?void 0:B.at(X),showersSum:(L=E.showers_sum)==null?void 0:L.at(X),hours:(g=E.precipitation_hours)==null?void 0:g.at(X),probability:(x=E.precipitation_probability_max)==null?void 0:x.at(X)},rh:{max:(u=E.relative_humidity_2m_max)==null?void 0:u.at(X),min:(W=E.relative_humidity_2m_min)==null?void 0:W.at(X),mean:(q=E.relative_humidity_2m_mean)==null?void 0:q.at(X)},wind:{speed:(v=E.wind_speed_10m_max)==null?void 0:v.at(X),kts:(j=E.wind_speed_10m_max)==null?void 0:j.at(X),degree:(F=E.wind_direction_10m_dominant)==null?void 0:F.at(X),gusts:(H=E.wind_gusts_10m_max)==null?void 0:H.at(X),bearing:((Q=E.wind_direction_10m_dominant)==null?void 0:Q.at(X))!==null?(((o0=E.wind_direction_10m_dominant)==null?void 0:o0.at(X))+180)%360:null}};const{name:c0,url:R0,bg:S}=this.parseWeatherCode(k.code,!0);k.name=c0,k.url=R0,k.bg=S,k.wind.scale=this.beaufort(this.kts2ms(k.wind.kts)),k.wind.direction=this.degree2Direction(k.wind.degree),y.push({utc:A.add(X,"d").utc().format(),model:V.model,weather:{...k}})}if(z){let V=0;for(const E of z){const c0=E.daily;P={wave:{sig:{height:(Z=c0.wave_height_max)==null?void 0:Z.at(X),degree:(Y=c0.wave_direction_dominant)==null?void 0:Y.at(X),period:(e0=c0.wave_period_max)==null?void 0:e0.at(X),bearing:((M0=c0.wave_direction_dominant)==null?void 0:M0.at(X))!==null?(((s0=c0.wave_direction_dominant)==null?void 0:s0.at(X))+180)%360:null},swell:{height:(i0=c0.swell_wave_height_max)==null?void 0:i0.at(X),degree:(J=c0.swell_wave_direction_dominant)==null?void 0:J.at(X),period:(T=c0.swell_wave_period_max)==null?void 0:T.at(X),peakPeriod:(b0=c0.swell_wave_peak_period_max)==null?void 0:b0.at(X),bearing:((d0=c0.swell_wave_direction_dominant)==null?void 0:d0.at(X))!==null?((m0=c0.swell_wave_direction_dominant)==null?void 0:m0.at(X))%360:null},wd:{height:(q0=c0.wind_wave_height_max)==null?void 0:q0.at(X),degree:(n0=c0.wind_wave_direction_dominant)==null?void 0:n0.at(X),period:(K=c0.wind_wave_period_max)==null?void 0:K.at(X),peakPeriod:(p0=c0.wind_wave_peak_period_max)==null?void 0:p0.at(X),bearing:((h0=c0.wind_wave_direction_dominant)==null?void 0:h0.at(X))!==null?(((f=c0.wind_wave_direction_dominant)==null?void 0:f.at(X))+180)%360:null}}},P.wave=this.parseWave(P.wave,k==null?void 0:k.wind),Object.assign(y[V],P),V++}}}return y}static parseWave(o,t){if(o.sig.direction=this.degree2Direction(o.sig.degree),o.swell.direction=this.degree2Direction(o.swell.degree),o.wd.direction=this.degree2Direction(o.wd.degree),o.sig.scale=this.douglas(o.sig.height),o.swell.scale=this.douglas(o.swell.height),o.wd.scale=this.douglas(o.wd.height),o.sig.height===0){const b=Math.sqrt(Math.pow(o.swell.height||0,2)+Math.pow(o.wd.height||0,2));o.sig.height=Math.round(b*100)/100}if(o.swell.height===0)if(o.sig.height>o.wd.height){const b=Math.sqrt(Math.abs(Math.pow(o.sig.height||0,2)-Math.pow(o.wd.height||0,2)));o.swell.height=Math.round(b*100)/100}else{const b=Math.round(.12*this.kts2ms((t==null?void 0:t.kts)||0)*100)/100,p=b>1?b/10:b>.5?b/5:b>.3?b/2:b;o.swell.height=Math.round(p*100)/100}if(o.wd.height===0||o.wd.height>o.sig.height)if(o.sig.height>o.swell.height){const b=Math.sqrt(Math.abs(Math.pow(o.sig.height||0,2)-Math.pow(o.swell.height||0,2))),p=.24*this.kts2ms((t==null?void 0:t.kts)||0);o.wd.height=Math.round(Math.min(b,p)*100)/100}else{const b=.24*this.kts2ms((t==null?void 0:t.kts)||0);o.wd.height=Math.round(b*100)/100}return o.swell.height>o.sig.height&&(o.swell.height=Math.round(o.sig.height*.76*100)/100),o.sig.period||(o.sig.period=Math.round(5*Math.sqrt(o.sig.height))),o.swell.period||(o.swell.period=Math.round(5*Math.sqrt(o.swell.height))),o.wd.period||(o.wd.period=Math.round(5*Math.sqrt(o.wd.height))),o}static parseWeatherCode(o,t){const b=this.weatherCode(o);return(t?b.day:b.night)||{}}static weatherCode(o){const t={code:o};switch(o){case 0:t.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},t.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 1:t.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},t.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 2:t.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"},t.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"};break;case 3:t.day={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"},t.night={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"};break;case 45:t.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},t.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 48:t.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},t.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 51:t.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 53:t.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 55:t.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 56:t.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 57:t.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 61:t.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 63:t.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 65:t.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 66:t.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 67:t.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 71:t.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},t.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 73:t.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},t.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 75:t.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},t.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 77:t.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},t.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 80:t.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 81:t.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 82:t.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 85:t.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},t.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 86:t.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},t.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 95:t.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 96:t.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 99:t.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break}return t}static kts2ms(o){return isNaN(o)||o===null?o:Math.round(o*1852/3600*1e4)/1e4}static kts2kmh(o){return isNaN(o)||o===null?o:o*1.852}static m2nm(o){return isNaN(o)||o===null?o:Math.round(o/1e3/1.852*1e4)/1e4}static kmh2kts(o){return isNaN(o)||o===null?o:this.ms2kts(o*1e3/3600)}static ms2kts(o){return isNaN(o)||o===null?o:Math.round(o*3600/1852*1e4)/1e4}static degree2Radian(o){if(isNaN(o)||o===null)return o;let t=o%360/360*2*Math.PI;return t=t<0?t+2*Math.PI:t,t}static degree2Direction(o){const t=this.degree2Radian(o);if(isNaN(t)||t===null)return null;let b="N/A";const p=Math.PI/16;return t<p?b="N":t>=p&&t<3*p?b="NNE":t>=3*p&&t<5*p?b="NE":t>=5*p&&t<7*p?b="ENE":t>=7*p&&t<9*p?b="E":t>=9*p&&t<11*p?b="ESE":t>=11*p&&t<13*p?b="SE":t>=13*p&&t<15*p?b="SSE":t>=15*p&&t<17*p?b="S":t>=17*p&&t<19*p?b="SSW":t>=19*p&&t<21*p?b="SW":t>=21*p&&t<23*p?b="WSW":t>=23*p&&t<25*p?b="W":t>=25*p&&t<27*p?b="WNW":t>=27*p&&t<29*p?b="NW":t>=29*p&&t<31*p?b="NNW":t>=31*p&&t<32*p&&(b="N"),b}static beaufort(o){let t=0;return isNaN(o)||(o=Math.round(o*10)/10,o<=.2?t=0:o<=1.5?t=1:o<=3.3?t=2:o<=5.4?t=3:o<=7.9?t=4:o<=10.7?t=5:o<=13.8?t=6:o<=17.1?t=7:o<=20.7?t=8:o<=22.4?t=9:o<=28.4?t=10:o<=32.6?t=11:o>32.6&&(t=12)),t}static douglas(o){let t="Calm";return isNaN(o)||o<=.1?t="Calm":o<=.5?t="Smooth":o<=1.25?t="Slight":o<=2.5?t="Moderate":o<=4?t="Rough":o<=6?t="VeryRough":o<=9?t="High":o<=14?t="VeryHigh":t="Precipitous",t}}const cb="",kt={name:"IdmTropicals",props:{map:{type:Object},top:{type:Number,default:60},menuToggle:{type:Object,default:{}},timeZone:{type:Number,default:0},token:{type:String},defaultMeteoToken:{type:String},gateway:{type:String,default:"aa"},assistGateway:{type:Array,default:[]},forecastModel:{type:String},realTime:{type:String}},emits:["tropical","tropicalProbability"],data(){return{right:10,toggle:!1,helper:C0.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:I.featureCollection([]),circleSource:"circle-source",circleSourceData:I.featureCollection([]),circleLayer:"tropical-circle-layer"}},computed:{computeTime(){return function(a){if(a){const o=G(a).utcOffset(this.timeZone),t=this.timeZone<0?this.timeZone:"+"+this.timeZone;return`${o.format("MMM-DD/HHmm")} [ UTC${t} ] ( ${o==null?void 0:o.fromNow()} )`}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone},computeBF(){return function(a){const o=G0.kts2ms(a);return G0.beaufort(o)}},computeMovement(){return function(a){var o,t;return(t=(o=a==null?void 0:a.forecasts)==null?void 0:o.find(b=>!b.disabled))==null?void 0:t.movement}}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.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())}},showTropicalsInfo:{handler(){this.$emit("tropical",this.showTropicalsInfo)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(){this.handleRefresh()}}},mounted(){},methods:{handleMenuToggle(){this.toggle=!this.toggle,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle?this.fetchTropicals():this.handleClear()},async fetchTropicals(){var p,c,i;const a=new Date().valueOf();let o=0,t=0,b=(p=C0.LayerHelper.WEATHER_LAYERS.find(M=>M.key==="tropicals"))==null?void 0:p.weight;if(b>0){const M=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],n=await r0.get(`${M}/api/arc/weather/layers2/links?l=${b}&v=${this.forecastModel}&t=${this.realTime}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(t=new Date().valueOf()-(a+o),console.log("weather links elapsed: ",t,", total: ",o+=t),((c=n==null?void 0:n.data)==null?void 0:c.code)===0){const s=(i=n==null?void 0:n.data)==null?void 0:i.data;await r0.get(s.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"},responseType:/\.(jpg|png)$/.test(s.tropicals)?"blob":"json"}).then(r=>{var h,R,C;const O=t0.TropicalHelper.convert2Geojson(((h=r==null?void 0:r.data)==null?void 0:h.data)||(r==null?void 0:r.data));((C=(R=r==null?void 0:r.config)==null?void 0:R.headers)==null?void 0:C.key)&&O&&(this.tropicals={data:O,active:!0,cached:!0,type:"json",etime:n.data.etime,version:Math.random()+1},this.handleInit())}).catch(r=>{console.log(`[${key}] fetch layer error: ${r}`)})}t=new Date().valueOf()-(a+o),console.log("tropicals elapsed: ",t,", total: ",o+=t)}},handleRefresh(){var o,t;(((t=(o=this.tropicals)==null?void 0:o.data)==null?void 0:t.features)||[]).forEach(b=>{var p,c;((p=b.geometry)==null?void 0:p.type)==="Point"&&((c=b.properties)!=null&&c.important)&&(b.properties.format=G(b.properties.date).utcOffset(this.timeZone).format(`MMM-DD/HHmm [(utc${this.computeTimezone})]`))}),this.handleInit()},handleInit(){var a;this.tropicals&&(this.handleRender(),(a=this.map)==null||a.on("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick))},handleRender(){var a,o,t,b,p,c,i,M,n,s;if(!this.map)setTimeout(()=>{this.handleRender()},500);else{if(this.tropicals){const O=new Date().valueOf();let m=0,h=0;(a=this.map)!=null&&a.getSource(this.source)?((t=this.map)==null||t.getSource(this.source).setData((o=this.tropicals)!=null&&o.active?this.tropicals.data:this.empty),h=new Date().valueOf()-(O+m),console.log("[tropicals] update elapsed: ",h,", total: ",m+=h)):(this.map.addSource(this.source,{type:"geojson",data:(b=this.tropicals)!=null&&b.active?(p=this.tropicals)==null?void 0:p.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":"#000","line-width":3,"line-opacity":.5}}),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","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#f2a0a0"],"line-width":3,"line-opacity":.9,"line-dasharray":[1,2]}}),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":13},paint:{"text-color":["match",["get","model"],"cma","#000","jma","#000","ecmwf","#fff","ukm","#fff","noaa-at","#fff","noaa-ep","#fff","#000"],"text-opacity":1,"text-halo-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#f2a0a0"],"text-halo-width":4}}),h=new Date().valueOf()-(O+m),console.log("[tropical] add elapsed: ",h,", total: ",m+=h)),(c=this.map)!=null&&c.getSource(this.clusterSource)?((M=this.map)==null||M.getSource(this.clusterSource).setData((i=this.tropicals)!=null&&i.active?this.tropicals.data:this.empty),h=new Date().valueOf()-(O+m),console.log("[tropical] update elapsed: ",h,", total: ",m+=h)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(n=this.tropicals)!=null&&n.active?(s=this.tropicals)==null?void 0:s.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":6,"circle-color":"#fff"}}),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]],"#03f869",["boolean",["<",["get","kts",["get","wind"]],32]],"#03f869",["boolean",["<",["get","kts",["get","wind"]],47]],"#f2f202",["boolean",["<",["get","kts",["get","wind"]],63]],"#ff9100",["boolean",["<",["get","kts",["get","wind"]],79]],"#f44336",["boolean",["<",["get","kts",["get","wind"]],94]],"#f903d0",["boolean",[">=",["get","kts",["get","wind"]],94]],"#8702f9","#fff"]}}),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),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":7,"circle-color":"#fff"}}),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.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.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["==","important",!0]],layout:{"text-field":["get","name"],"text-offset":[0,1.5],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#fff","text-halo-color":"#0033ff","text-halo-width":4}}),h=new Date().valueOf()-(O+m),console.log("[tropical] add elapsed: ",h,", total: ",m+=h))}this.handleDrawCircle();const r=t0.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(r)),this.handleDateChange()}},handleClear(){var a,o;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),(a=this.interpolateMarkers)==null||a.forEach(t=>t==null?void 0:t.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),this.map.getLayer(this.circleLayer)&&this.map.removeLayer(this.circleLayer),this.map.getSource(this.circleSource)&&this.map.removeSource(this.circleSource)),(o=this.map)==null||o.off("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick)},handleDateChange(){var a,o,t,b,p,c,i,M,n,s,r,O,m,h,R,C,w,B,L,g,x,u,W,q,v,j,F,H,Q,o0,Z,Y;if((a=this.interpolateMarkers)==null||a.forEach(e0=>e0==null?void 0:e0.remove()),this.circleSourceData.features=[],(o=this.interpolateData)!=null&&o.length&&this.tropicals.active){const e0=G(this.realTime).utc().set({minute:0,second:0,millisecond:0}),M0=this.interpolateData.filter(J=>J.properties.date===e0.format()&&!J.properties.disabled),s0=this.handleComputePolygons(M0),i0=I.featureCollection([...M0]);s0.forEach(J=>{i0.features.push(J)}),(t=this.map)!=null&&t.getSource(this.interpolateSource)?(b=this.map)==null||b.getSource(this.interpolateSource).setData(i0):((p=this.map)==null||p.addSource(this.interpolateSource,{type:"geojson",data:i0}),(c=this.map)==null||c.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,"#ff9100",10,"#f44336","#ffffff"],"line-width":1}})),this.interpolateMarkers=[];for(const J of M0)if(!J.properties.disabled){let T="#f44336";((M=(i=J.properties)==null?void 0:i.wind)==null?void 0:M.kts)<32||!((s=(n=J.properties)==null?void 0:n.wind)!=null&&s.kts)?T="#03f869":((O=(r=J.properties)==null?void 0:r.wind)==null?void 0:O.kts)>=32&&((h=(m=J.properties)==null?void 0:m.wind)==null?void 0:h.kts)<47?T="#f2f202":((C=(R=J.properties)==null?void 0:R.wind)==null?void 0:C.kts)>=47&&((B=(w=J.properties)==null?void 0:w.wind)==null?void 0:B.kts)<63?T="#ff9100":((g=(L=J.properties)==null?void 0:L.wind)==null?void 0:g.kts)>=63&&((u=(x=J.properties)==null?void 0:x.wind)==null?void 0:u.kts)<79?T="#f44336":((q=(W=J.properties)==null?void 0:W.wind)==null?void 0:q.kts)>=79&&((j=(v=J.properties)==null?void 0:v.wind)==null?void 0:j.kts)<94?T="#f903d0":((H=(F=J.properties)==null?void 0:F.wind)==null?void 0:H.kts)>=94?T="#8702f9":T="#f44336";const b0=`<svg t="1719918955501"
190
+ }`);const Jo=(a="#000")=>({"000kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 245.76c-146.80064 0-266.24 119.43936-266.24 266.24s119.43936 266.24 266.24 266.24 266.24-119.43936 266.24-266.24-119.43936-266.24-266.24-266.24z m0 40.96c124.64128 0 225.28 100.63872 225.28 225.28s-100.63872 225.28-225.28 225.28-225.28-100.63872-225.28-225.28 100.63872-225.28 225.28-225.28z m0 81.92c-78.9504 0-143.36 64.4096-143.36 143.36s64.4096 143.36 143.36 143.36 143.36-64.4096 143.36-143.36-64.4096-143.36-143.36-143.36z m0 40.96c56.79104 0 102.4 45.60896 102.4 102.4s-45.60896 102.4-102.4 102.4-102.4-45.60896-102.4-102.4 45.60896-102.4 102.4-102.4z" fill="${a}"></path></svg>`,"002kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M638 835.99999999c0-63.288-47.10599999-115.524-108-124.30799999L530.00000001 62l-36.00000002 0 1e-8 649.692c-60.894 8.784-108 61.02-108 124.30799999 0 69.39 56.61 126 126 126s126-56.61 126-126z m-36 1e-8c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"005kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 166.634l-20.232-29.25000001L530 243.674 530.00000001 62l-36.00000002 0 1e-8 649.692c-60.894 8.784-108 61.02-108 124.30799999 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.288-47.10599999-115.524-108-124.30799999L530 287zM602 836c0 49.91400001-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"010kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 215zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}" ></path></svg>`,"015kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 322.99999999l82.134-57.38399999-20.25-29.232L530 279.692 530 215zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"020kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 322.99999999l172.134-120.38399999-20.268-29.24999999L530 279.71 530 215zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"025kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L529.99999999 431l82.13400001-57.384-20.25-29.25L530 387.71 530 322.99999999l172.134-120.38399999-20.268-29.24999999L530 279.71 530 215zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"030kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L529.99999999 431l172.13400001-120.384-20.26800001-29.232L530 387.674 530 322.99999999l172.134-120.38399999-20.268-29.24999999L530 279.71 530 215zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"035kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.80199999-108 61.056-108 124.308 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.106-115.506-108-124.308L530 539l82.134-57.38400001-20.25-29.24999999L529.99999999 495.71 529.99999999 431l172.13400001-120.384-20.26800001-29.232L530 387.674 530 322.99999999l172.134-120.38399999-20.268-29.24999999L530 279.71 530 215l172.134-120.384zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"040kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 539l172.134-120.384-20.268-29.25L529.99999999 495.71 529.99999999 431l172.13400001-120.384-20.26800001-29.232L530 387.674 530 322.99999999l172.134-120.38399999-20.268-29.24999999L530 279.71 530 215zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"045kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M702.116 94.634L681.88400001 65.384l-180.00000001 126-7.884 5.04 0 515.268c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 647l82.13400001-57.384-20.25000001-29.25L530 603.71 530 539l172.134-120.384-20.268-29.25L529.99999999 495.71 529.99999999 431l172.13400001-120.384-20.26800001-29.232L530 387.674 530 322.99999999l172.134-120.38399999-20.268-29.24999999L530 279.71 530 215zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"050kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.366 62L494 62l0 649.692c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 215l172.134-120.384zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}" ></path></svg>`,"055kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.366 62L494 62l0 649.692c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 322.99999999l82.134-57.38399999-20.25-29.232L530 279.692 530 215l172.134-120.384zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}" ></path></svg>`,"060kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.366 62L494 62l0 649.692c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 322.99999999l135.558-94.49999999-20.25000001-29.808-115.30799999 81L530 215l172.134-120.384zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}" ></path></svg>`,"065kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.096 62L494 62l1e-8 649.44c-60.894 8.82-108 61.308-108.00000001 124.56 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.106-115.74-108.00000001-124.56L530 431.36l82.332-57.636-20.664-29.448L530 387.44l0-64.08 135.774-95.004-20.646-29.484L530 279.44 529.99999999 215.378 749.096 62zM602 836c0 49.932-40.068 90-90 90s-90-40.068-90-90 40.068-90 90-90 90 40.068 90 90z" fill="${a}" ></path></svg>`,"070kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.096 62L494 62l1e-8 649.44c-60.87599999 8.82-108 61.308-108.00000001 124.56 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.124-115.74-108.00000001-124.56L530 431.36l135.774-95.004-20.646-29.48399999L530 387.44l0-64.08 135.774-95.004-20.646-29.484L530 279.44 529.99999999 215.378 749.096 62zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"075kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.096 62L494 62l1e-8 649.44c-60.87599999 8.82-108 61.308-108.00000001 124.56 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.124-115.74-108.00000001-124.56l0-172.08 82.33200001-57.636-20.664-29.448L530 495.44l0-64.08 135.774-95.004-20.646-29.48399999L530 387.44l0-64.08 135.774-95.004-20.646-29.484L530 279.44 529.99999999 215.378 749.096 62zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"080kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.096 62L494 62l1e-8 649.44c-60.87599999 8.82-108 61.308-108.00000001 124.56 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.124-115.74-108.00000001-124.56l0-172.08 135.774-95.004-20.64599999-29.484L530 495.44l0-64.08 135.774-95.004-20.646-29.48399999L530 387.44l0-64.08 135.774-95.004-20.646-29.484L530 279.44 529.99999999 215.378 749.096 62zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"085kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.096 62L494 62l1e-8 649.44c-60.87599999 8.82-108 61.308-108.00000001 124.56 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.124-115.74-108.00000001-124.56l1e-8-64.08 82.332-57.636-20.664-29.44800001L529.99999999 603.44l0-64.08 135.774-95.004-20.64599999-29.484L530 495.44l0-64.08 135.774-95.004-20.646-29.48399999L530 387.44l0-64.08 135.774-95.004-20.646-29.484L530 279.44 529.99999999 215.378 749.096 62zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"090kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.096 62L494 62l1e-8 649.44c-60.87599999 8.82-108 61.308-108.00000001 124.56 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.124-115.74-108.00000001-124.56l1e-8-64.08 135.774-95.004-20.646-29.484L529.99999999 603.44l0-64.08 135.774-95.004-20.64599999-29.484L530 495.44l0-64.08 135.774-95.004-20.646-29.48399999L530 387.44l0-64.08 135.774-95.004-20.646-29.484L530 279.44 529.99999999 215.378 749.096 62zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}"></path></svg>`,"095kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.096 62L494 62l1e-8 649.44c-60.87599999 8.82-108 61.308-108.00000001 124.56 0 69.372 56.628 126 126 126s126-56.628 126-126c0-63.252-47.124-115.74-108.00000001-124.56l1e-8-46.08 82.332-57.636-20.664-29.448L530 621.44l0-46.08 135.774-95.004-20.64600001-29.484L530 531.44l0-46.08 135.774-95.004-20.646-29.484L529.99999999 441.44l0-46.08 135.774-95.004-20.64599999-29.484L530 351.44l0-46.08 135.774-95.004-20.646-29.48400001L530 261.44 529.99999999 215.378 749.096 62zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}" ></path></svg>`,"100kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.366 62L494 62l0 649.692c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 360.116 746 206l-203.058 0 159.174-111.384zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}" ></path></svg>`,"105kts":`<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M749.366 62L494 62l0 649.692c-60.894 8.784-108 61.02-108 124.308 0 69.39 56.61 126 126 126s126-56.61 126-126c0-63.28800001-47.106-115.524-108-124.308L530 467l135.558-94.5-20.25000001-29.808-115.30799999 81 0-63.576L746 206l-203.058 0 159.174-111.384zM602 836c0 49.91399999-40.086 90-90 90s-90-40.086-90-90 40.086-90 90-90 90 40.086 90 90z" fill="${a}" ></path></svg>`}),Zo={name:"IdmWindBarb",props:{map:{type:Object},wind:{type:Object},current:{type:Object},beforeLayer:{type:String},menuToggle:{type:Object},theme:{type:String}},emits:[],data(){return{toggle:!1,showCaption:!1,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:I.featureCollection([]),right:10,bottom:125,windBarbLoaded:!1}},computed:{windSvgUrl(){const a=this.theme==="customDark"?"#fff":"#000";return Jo(a)},getSvgUrlBase64(){return a=>`data:image/svg+xml;base64,${window.btoa(unescape(encodeURIComponent(a)))}`}},watch:{"wind.version":{handler(){var a;(a=this.wind)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var a,o,t,b;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.wind){const p=new Date().valueOf();let c=0,i=0,M=this.empty;if((a=this.wind)!=null&&a.active&&(M=(o=this.wind)==null?void 0:o.data),(t=this.map)!=null&&t.getSource(this.source))(b=this.map)==null||b.getSource(this.source).setData(M),i=new Date().valueOf()-(p+c),console.log("[windBarbs] update elapsed: ",i,", total: ",c+=i);else{this.map.addSource(this.source,{type:"geojson",data:M});for(let n=0;n<(this.barbs??[]).length-1;n++){const s=(this.barbs??[])[n]||0,r=(this.barbs??[])[n+1]||0,O=s<10?`00${s}kts`:s<100?`0${s}kts`:`${s}kts`;this.map.addLayer({id:O,type:"symbol",filter:["all",[">=","spd",s],["<","spd",r]],source:this.source,layout:{"symbol-placement":"point","icon-image":O,"icon-size":.14,"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"dir",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":1,"text-color":"#222"}},this.beforeLayer)}this.windBarbLoaded=!0,i=new Date().valueOf()-(p+c),console.log("[windBarbs] add elapsed: ",i,", total: ",c+=i)}}},handleClear(){for(const a of this.barbs??[]){const o=a<10?`00${a}kts`:a<100?`0${a}kts`:`${a}kts`;this.map.getLayer(o)&&this.map.removeLayer(o)}this.map.getSource(this.source)&&this.map.removeSource(this.source),this.windBarbLoaded=!1}}},$o={key:0,class:"legend-tip-btn-gl4"},e2={class:"d-flex flex-row justify-center align-center"},o2=["src"],t2={class:"text-caption"};function a2(a,o,t,b,p,c){var O;const i=e.resolveComponent("v-btn"),M=e.resolveComponent("v-col"),n=e.resolveComponent("v-row"),s=e.resolveComponent("v-card-text"),r=e.resolveComponent("v-card");return(O=t.wind)!=null&&O.active?(e.openBlock(),e.createElementBlock("div",$o,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:p.right+"px"})},[e.createVNode(i,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:p.toggle?"primary":"",onClick:c.handleMenuToggle},{default:e.withCtx(()=>o[0]||(o[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4 font-weight-bold menu-icon-color"},null,-1)])),_:1,__:[0]},8,["color","onClick"])],4),e.withDirectives(e.createVNode(r,{width:"120",elevation:"16",class:"card-info",style:e.normalizeStyle({position:"absolute",top:"300px",right:p.right+50+"px"})},{default:e.withCtx(()=>[e.createVNode(s,{class:"pa-1 text-body-2 d-flex flex-column justify-center align-start opacity-80 z"},{default:e.withCtx(()=>[o[1]||(o[1]=e.createElementVNode("div",{class:"text-body-2 ma-1"},"Wind Level",-1)),e.createVNode(n,{class:"ma-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(c.windSvgUrl),(m,h)=>(e.openBlock(),e.createBlock(M,{cols:"6",key:h,class:"d-flex flex-row justify-center align-center pa-1"},{default:e.withCtx(()=>{var R;return[e.createElementVNode("div",e2,[e.createElementVNode("img",{src:c.getSvgUrlBase64((R=c.windSvgUrl)==null?void 0:R[m]),style:{width:"14px",height:"14px"}},null,8,o2),e.createElementVNode("span",t2,e.toDisplayString(m),1)])]}),_:2},1024))),128))]),_:1})]),_:1,__:[1]})]),_:1},8,["style"]),[[e.vShow,p.showCaption]])])):e.createCommentVNode("",!0)}const p2=$(Zo,[["render",a2]]),Kp="",b2={name:"IdmWindParticle",props:{factor:{type:Object},viewport:{type:Q0},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new L0,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.9,speedFactor:.25,dropRate:.003,dropRateBump:.01,uvRange:[-25,26],sRange:[0,31.985]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var a,o;(a=this.factor)!=null&&a.active?await this.handleRender():this.handleClear(),(o=this.factor)!=null&&o.particle||this.handleClearParticle()}},"factor.particle":{async handler(a,o){a!==o&&o!==void 0&&(a?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{async handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;await this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[wind-particle] add elapsed: ",t,", total: ",o+=t)}},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.uvFragmentSchema);this.program=o,this.aPositionBuffer=t}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,u0.vertexSchema,u0.fragmentSchema,u0.quadVertSchema,u0.screenFragmentSchema,u0.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,9e3),...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(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(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.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})},handleClearParticle(){var a,o,t,b,p,c,i;(a=this.viewport)==null||a.toggleParticle(!1),this.particleContext=void 0,this.initial=!0,(t=(o=this.viewport)==null?void 0:o.map)==null||t.off("resize",this.handleResize),(p=(b=this.viewport)==null?void 0:b.map)==null||p.off("movestart",this.handlePause),(i=(c=this.viewport)==null?void 0:c.map)==null||i.off("moveend",this.handlePlay),this.handlePause()},handleClear(){var a;(a=this.viewport)==null||a.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},c2={key:0};function i2(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",c2,[e.createElementVNode("div",{class:"legend-bars-gl4 wind",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"kts",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"5",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1),e.createElementVNode("span",null,"40",-1),e.createElementVNode("span",null,"60",-1)]),4)])):e.createCommentVNode("",!0)}const M2=$(b2,[["render",i2]]),z2={name:"IdmCurrent",props:{map:{type:Object},current:{type:Object},beforeLayer:{type:String},menuToggle:{type:Object},theme:{type:String}},emits:[],data(){return{right:10,toggle:!1,showCaption:!1,source:"current-source",directionLayer:"current-direction-layer",speedLayer:"current-speed-layer",speedLabelLayer:"current-speed-label-layer",empty:I.featureCollection([]),list:[{label:"0-0.5 kts",size:.25,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"}]}},computed:{getSvgUrlBase64(){return a=>`data:image/svg+xml;base64,${btoa(a)}`}},watch:{"current.version":{handler(){var a;(a=this.current)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var a,o;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.current){const t=new Date().valueOf();let b=0,p=0,c=this.empty;if(this.current.active&&(c=this.current.data),(a=this.map)!=null&&a.getSource(this.source))(o=this.map)==null||o.getSource(this.source).setData(c),p=new Date().valueOf()-(t+b),console.log("[current] update elapsed: ",p,", total: ",b+=p);else{this.map.addSource(this.source,{type:"geojson",data:c}),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 i=new Image(48,48);let M='<svg class="icon" viewBox="0 0 1024 1024" 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="#ffffff"></path></svg>',n="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(M)));i.src=n;const s=new Image(48,48);M='<svg class="icon" viewBox="0 0 1024 1024" 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="#f44336"></path></svg>',n="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(M))),s.src=n;const r=[i,s];let O=0;r.forEach(m=>{m.onload=()=>{O++,this.map.hasImage("currentDirIconWhite")||this.map.addImage("currentDirIconWhite",i),this.map.hasImage("currentDirIconRed")||this.map.addImage("currentDirIconRed",s),O===2&&this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":["step",["get","spd"],"currentDirIconWhite",1,"currentDirIconWhite"],"icon-size":["step",["get","spd"],.25,.5,.4,1,.6,1.5,.8,2,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":1}},this.beforeLayer)}}),p=new Date().valueOf()-(t+b),console.log("[current] add elapsed: ",p,", total: ",b+=p)}}},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.getSource(this.source)&&this.map.removeSource(this.source)}}},n2={key:0,class:"legend-tip-btn-gl4"},r2={class:"d-flex flex-row justify-start align-center"},l2={class:"d-flex flex-row justify-center align-center",style:{width:"48px"}},s2={class:"text-caption px-2"};function O2(a,o,t,b,p,c){var m;const i=e.resolveComponent("v-btn"),M=e.resolveComponent("v-tooltip"),n=e.resolveComponent("v-col"),s=e.resolveComponent("v-row"),r=e.resolveComponent("v-card-text"),O=e.resolveComponent("v-card");return(m=t.current)!=null&&m.active?(e.openBlock(),e.createElementBlock("div",n2,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:p.right+"px"})},[e.createVNode(M,{text:"Map Layers",location:"left","open-delay":1e3},{activator:e.withCtx(({props:h})=>[e.createVNode(i,e.mergeProps(h,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:p.toggle?"primary":"",onClick:c.handleMenuToggle}),{default:e.withCtx(()=>o[0]||(o[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4 font-weight-bold menu-icon-color"},null,-1)])),_:2,__:[0]},1040,["color","onClick"])]),_:1})],4),e.withDirectives(e.createVNode(O,{width:"120",elevation:"16",class:"card-info",style:e.normalizeStyle({position:"absolute",top:"340px",right:p.right+50+"px"})},{default:e.withCtx(()=>[e.createVNode(r,{class:"pa-1 text-body-2 d-flex flex-column justify-center align-start opacity-80"},{default:e.withCtx(()=>[o[1]||(o[1]=e.createElementVNode("div",{class:"text-body-2 ma-1"},"Current",-1)),e.createVNode(s,{class:"ma-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.list,(h,R)=>(e.openBlock(),e.createBlock(n,{cols:"12",key:R,class:"d-flex flex-row justify-start align-center pa-0"},{default:e.withCtx(()=>[e.createElementVNode("div",r2,[e.createElementVNode("div",l2,[e.createElementVNode("i",{class:"iconfont icon-direction-arrow",style:e.normalizeStyle({fontSize:48*h.size+"px"})},null,4)]),e.createElementVNode("div",s2,e.toDisplayString(h.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[1]})]),_:1},8,["style"]),[[e.vShow,p.showCaption]])])):e.createCommentVNode("",!0)}const A2=$(z2,[["render",O2]]),Yp="",d2={name:"IdmCurrentParticle",props:{factor:{type:Object},viewport:{type:Q0},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new L0,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.96,speedFactor:4,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 a,o;console.log("factor.version",this.viewport),(a=this.factor)!=null&&a.active?await this.handleRender():this.handleClear(),(o=this.factor)!=null&&o.particle||this.handleClearParticle()}},"factor.particle":{async handler(a,o){a!==o&&o!==void 0&&(console.log("factor.particle",a,o,this.viewport),a?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{async handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;await this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[current-particle] add elapsed: ",t,", total: ",o+=t)}},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.uvFragmentSchema);this.program=o,this.aPositionBuffer=t}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"],[.6,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,u0.vertexSchema,u0.fragmentSchema,u0.quadVertSchema,u0.screenFragmentSchema,u0.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,9e3),...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(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(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.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})},handleClearParticle(){var a,o,t,b,p,c,i;(a=this.viewport)==null||a.toggleParticle(!1),this.particleContext=void 0,this.initial=!0,(t=(o=this.viewport)==null?void 0:o.map)==null||t.off("resize",this.handleResize),(p=(b=this.viewport)==null?void 0:b.map)==null||p.off("movestart",this.handlePause),(i=(c=this.viewport)==null?void 0:c.map)==null||i.off("moveend",this.handlePlay),this.handlePause()},handleClear(){var a;(a=this.viewport)==null||a.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},m2={key:0};function q2(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",m2,[e.createElementVNode("div",{class:"legend-bars-gl4 current",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"kts",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.4",-1),e.createElementVNode("span",null,"0.8",-1),e.createElementVNode("span",null,"1.6",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3.2",-1)]),4)])):e.createCommentVNode("",!0)}const h2=$(d2,[["render",q2]]),Jp="",g2={name:"IdmTemp",props:{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 L0,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[sig-wave] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},u2={key:0};function f2(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",u2,[e.createElementVNode("div",{class:"legend-bars-gl4 sig-wave",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"m",-1),e.createElementVNode("span",null,"0.5",-1),e.createElementVNode("span",null,"1",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"6",-1),e.createElementVNode("span",null,"9",-1)]),4)])):e.createCommentVNode("",!0)}const W2=$(g2,[["render",f2],["__scopeId","data-v-79ce70e2"]]),y2={name:"IdmSigWave",props:{map:{type:Object},sigWaveHeight:{type:Object},beforeLayer:{type:String},menuToggle:{type:Object}},data(){return{right:10,toggle:!1,showCaption:!1,source:"sig-wave-height-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:I.featureCollection([]),list:[{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-16 m",color:"#aa1a5a"},{label:"16-18 m",color:"#962878"},{label:"18-20 m",color:"#8c328c"},{label:"> 20 m",color:"#8c328c"}]}},watch:{"sigWaveHeight.version":{handler(){var a;(a=this.sigWaveHeight)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var a,o;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.sigWaveHeight){const t=new Date().valueOf();let b=0,p=0,c=this.empty;this.sigWaveHeight.active&&(c=this.sigWaveHeight.data),(a=this.map)!=null&&a.getSource(this.source)?((o=this.map)==null||o.getSource(this.source).setData(c),p=new Date().valueOf()-(t+b),console.log("[sig-wave-height] update elapsed: ",p,", total: ",b+=p)):(this.map.addSource(this.source,{type:"geojson",data:c}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"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",16,"#aa1464",18,"#962878",20,"#8c328c"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","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),p=new Date().valueOf()-(t+b),console.log("[sig-wave-height] add elapsed: ",p,", total: ",b+=p))}},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)}}},L2={key:0,class:"legend-tip-btn-gl4"},R2={class:"d-flex flex-row justify-start align-center"},w2={key:0,style:{width:"24px",height:"12px",border:"1px solid rgba(var(--v-border-color), var(--v-border-opacity))"}},B2={class:"text-caption px-2"};function x2(a,o,t,b,p,c){var O;const i=e.resolveComponent("v-btn"),M=e.resolveComponent("v-col"),n=e.resolveComponent("v-row"),s=e.resolveComponent("v-card-text"),r=e.resolveComponent("v-card");return(O=t.sigWaveHeight)!=null&&O.active?(e.openBlock(),e.createElementBlock("div",L2,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:p.right+"px"})},[e.createVNode(i,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:p.toggle?"primary":"",onClick:c.handleMenuToggle},{default:e.withCtx(()=>o[0]||(o[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend font-weight-bold menu-icon-color"},null,-1)])),_:1,__:[0]},8,["color","onClick"])],4),e.withDirectives(e.createVNode(r,{width:"100",elevation:"16",class:"card-info",style:e.normalizeStyle({position:"absolute",top:"240px",right:p.right+50+"px"})},{default:e.withCtx(()=>[e.createVNode(s,{class:"pa-1 text-body-2 d-flex flex-column justify-center align-start opacity-80"},{default:e.withCtx(()=>[o[1]||(o[1]=e.createElementVNode("div",{class:"text-body-2 ma-1"},"Wave Height",-1)),e.createVNode(n,{class:"ma-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.list,(m,h)=>(e.openBlock(),e.createBlock(M,{cols:"12",key:h,class:"d-flex flex-row justify-start align-center pa-1"},{default:e.withCtx(()=>[e.createElementVNode("div",R2,[h===0?(e.openBlock(),e.createElementBlock("div",w2)):(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle({width:"24px",height:"12px",background:m.color})},null,4)),e.createElementVNode("div",B2,e.toDisplayString(m.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[1]})]),_:1},8,["style"]),[[e.vShow,p.showCaption]])])):e.createCommentVNode("",!0)}const N2=$(y2,[["render",x2]]),k2={name:"IdmSwell",props:{map:{type:Object},swell:{type:Object},beforeLayer:{type:String},activeWeatherLayers:{type:Array}},data(){return{source:"swell-source",directionLayer:"swell-direction-layer",heightLayer:"swell-height-layer",heightLabelLayer:"swell-height-label-layer",empty:I.featureCollection([])}},watch:{"swell.version":{handler(){var a;(a=this.swell)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,o;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.swell){const t=new Date().valueOf();let b=0,p=0,c=this.empty;if(this.swell.active&&(c=this.swell.data),(a=this.map)!=null&&a.getSource(this.source))(o=this.map)==null||o.getSource(this.source).setData(c),p=new Date().valueOf()-(t+b),console.log("[swell] update elapsed: ",p,", total: ",b+=p);else{this.map.addSource(this.source,{type:"geojson",data:c}),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 i=new Image(72,72);let M='<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="#ffffff"></path></svg>',n="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(M)));i.src=n,i.onload=()=>{this.map.hasImage("swellDirIconWhite")||this.map.addImage("swellDirIconWhite",i),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":1}},this.beforeLayer)},p=new Date().valueOf()-(t+b),console.log("[swell] add elapsed: ",p,", total: ",b+=p)}}},handleClear(){var a,o;this.activeWeatherLayers.length===0&&(a=this.map)!=null&&a.getLayer("country-boundaries")&&((o=this.map)==null||o.setLayoutProperty("country-boundaries","visibility","none")),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.getSource(this.source)&&this.map.removeSource(this.source)}}};function X2(a,o,t,b,p,c){return e.openBlock(),e.createElementBlock("div")}const C2=$(k2,[["render",X2]]),v2={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},showRampColor:{type:Boolean},activeWeatherLayers:{type:Array}},data(){return{right:10,toggle:!1,source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:I.featureCollection([])}},watch:{"prmsl.version":{handler(){var a;(a=this.prmsl)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle},handleRender(){var a,o,t;if(console.log("prmsl",this.beforeLayer),!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.prmsl){const b=new Date().valueOf();let p=0,c=0,i=this.empty;this.prmsl.active&&(i=this.prmsl.data),(a=this.map)!=null&&a.getSource(this.source)?((o=this.map)==null||o.getSource(this.source).setData(i),c=new Date().valueOf()-(b+p),console.log("[prmsl] update elapsed: ",c,", total: ",p+=c)):(this.map.addSource(this.source,{type:"geojson",data:i}),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(244,67,54,1)",980,"rgba(255,255,0,1)",1100,"rgba(199,171,250,1)"],"line-width":1,"line-opacity":.6}},this.beforeLayer),(t=this.map)==null||t.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),setTimeout(()=>{this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":["format",["get","type"],{"font-scale":1.03},`
191
+ `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12},paint:{"text-color":["step",["get","val"],"rgba(255,255,255,0.8)",980,"rgba(0,0,0,0.6)",1100,"rgba(0,0,0,0.6)"],"text-halo-color":["step",["get","val"],"rgba(162,13,2,0.7)",920,"rgba(244,67,54,0.7)",980,"rgba(255,255,0,0.7)",1100,"rgba(199,171,250,0.7)"],"text-halo-width":2}})},0),c=new Date().valueOf()-(b+p),console.log("[prmsl] add elapsed: ",c,", total: ",p+=c))}},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)}}},T2={key:0,class:"legend-tip-btn-gl4"};function E2(a,o,t,b,p,c){var n;const i=e.resolveComponent("v-btn"),M=e.resolveComponent("v-tooltip");return(n=t.prmsl)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",T2,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:p.right+"px"})},[e.createVNode(M,{text:"Map Layers",location:"left","open-delay":1e3},{activator:e.withCtx(({props:s})=>[e.createVNode(i,e.mergeProps(s,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:p.toggle?"primary":"",onClick:c.handleMenuToggle}),{default:e.withCtx(()=>o[0]||(o[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4 font-weight-bold menu-icon-color"},null,-1)])),_:2,__:[0]},1040,["color","onClick"])]),_:1})],4)])):e.createCommentVNode("",!0)}const _2=$(v2,[["render",E2]]),Zp="",P2={name:"IdmIceEdge",props:{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 L0,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()}},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[ice-edge] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},S2={key:0};function D2(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",S2,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-edge",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",{style:{color:"rgba(var(--v-theme-black), 0.7)"}},"%",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"40",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"70",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"90",-1),e.createElementVNode("span",null,null,-1)]),4)])):e.createCommentVNode("",!0)}const I2=$(P2,[["render",D2]]),$p="",j2={name:"IdmCover",props:{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 L0,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()}},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[ice-cover] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},H2={key:0};function Q2(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",H2,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-cover",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"%",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"40",-1),e.createElementVNode("span",null,"60",-1),e.createElementVNode("span",null,"80",-1),e.createElementVNode("span",null,"100",-1)]),4)])):e.createCommentVNode("",!0)}const F2=$(j2,[["render",Q2],["__scopeId","data-v-9696d73b"]]),eb="",V2={name:"IdmThickness",props:{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 L0,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[ice-thickness] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},G2={key:0};function U2(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",G2,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-thickness",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"m",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.6",-1),e.createElementVNode("span",null,"1",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3",-1)]),4)])):e.createCommentVNode("",!0)}const K2=$(V2,[["render",U2]]),ob="",Y2={name:"IdmPrecip3h",props:{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 L0,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[precip3h] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},J2={key:0};function Z2(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",J2,[e.createElementVNode("div",{class:"legend-bars-gl4 precip3h",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"mm",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3",-1),e.createElementVNode("span",null,"7",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1)]),4)])):e.createCommentVNode("",!0)}const $2=$(Y2,[["render",Z2]]),tb="",et={name:"IdmVisibility",props:{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 L0,etime:void 0}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[visibility] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ot={key:0};function tt(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("div",{class:"legend-bars-gl4 visibility",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"nm",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.5",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"3",-1),e.createElementVNode("span",null,"9",-1)]),4)])):e.createCommentVNode("",!0)}const at=$(et,[["render",tt]]),ab="",pt={name:"IdmWaterTemp",props:{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 L0,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[water-temp] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},bt={key:0};function ct(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",bt,[e.createElementVNode("div",{class:"legend-bars-gl4 water-temp",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"°C",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1),e.createElementVNode("span",null,"40",-1)]),4)])):e.createCommentVNode("",!0)}const it=$(pt,[["render",ct]]),pb="",Mt={name:"IdmTemp",props:{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 L0,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let o=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+o),console.log("[temp] add elapsed: ",t,", total: ",o+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:o,aPositionBuffer:t}=this.webgl.bind(this.context,l0.vertexSchema,l0.fragmentSchema);this.program=o,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},zt={key:0};function nt(a,o,t,b,p,c){var i;return(i=t.factor)!=null&&i.active?(e.openBlock(),e.createElementBlock("div",zt,[e.createElementVNode("div",{class:"legend-bars-gl4 temp",style:e.normalizeStyle({right:p.right+"px"})},o[0]||(o[0]=[e.createElementVNode("span",null,"°C",-1),e.createElementVNode("span",null,"-20",-1),e.createElementVNode("span",null,"-10",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1),e.createElementVNode("span",null,"40",-1)]),4)])):e.createCommentVNode("",!0)}const rt=$(Mt,[["render",nt]]),bb="",lt={name:"IdmGlLayer",components:{IdmWindBarb:p2,IdmWindParticle:M2,IdmCurrentDirection:A2,IdmCurrentParticle:h2,IdmWave:W2,IdmSigWaveHeight:N2,IdmSwell:C2,IdmPrmsl:_2,IdmIceEdge:I2,IdmIceCover:F2,IdmIceThickness:K2,IdmPrecip3h:$2,IdmVisibility:at,IdmWaterTemp:it,IdmTemp:rt},props:{isLogin:{type:Boolean,default:!1},map:{type:Object},mapFeather:{type:String},gateway:{type:String,default:"aa"},assistGateway:{type:Array,default:[]},token:{type:String},defaultMeteoToken:{type:String},top:{type:Number,default:60},menuToggle:{type:Object,default:{}},realTime:{type:String},forecastModel:{type:String},beforeLayer:{type:String}},emits:["menuToggle","weatherCheckList"],data(){return{right:10,toggle:!1,autoActive:!0,allLayers:[...C0.LayerHelper.WEATHER_LAYERS],tagLayers:[...C0.LayerHelper.WEATHER_LAYERS.filter(a=>!a.hide)],checkList:[],iceToggleValue:void 0,weatherLayers:{},activeWeatherLayers:[],cache:{v:"0.0.1",versionKey:"weatherLayerCacheVersionGL4",autoActiveKey:"autoActiveCacheGL4",checkListKey:"weatherCheckListCacheGL4"},sourceList:{},rampColorLayers:["visibility","precip3h","temp","water-temp","ice-thickness","ice-cover"],zoom:6,viewport:void 0,particleFactor:void 0,showWindParticle:!0,showCurrentParticle:!0}},computed:{computeDateZ(){return function(a){var o;if(a){const t=G(a);return`${(o=t==null?void 0:t.utc())==null?void 0:o.format("MMM-DD/HHmm")}Z`}return"-"}},overlaysKeys(){return this.tagLayers.filter(a=>a.overlays).map(a=>a.key)},rendersKeys(){return this.tagLayers.filter(a=>!a.overlays).map(a=>a.key)}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.weatherLayers,this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})}},forecastModel:{handler(a,o){a&&a!==o&&this.handleWeatherLayerChange({sourceChanged:!0})}},map:{handler(){this.map&&(this.map.on("move",this.handleMove4Weather),this.viewport=new Q0(this.map),this.handleRampColorInitial(),this.handleWeatherLayerChange())},immediate:!0},realTime:{handler(a,o){a&&o&&G(a).utc().format("yyyy-MM-DD HH")!==G(o).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.fetchWeatherLayers()})},immediate:!0},checkList:{handler(a,o){this.handleCheckListChange(a,o),this.$emit("weatherCheckList",a)}},autoActive:{handler(a){localStorage.setItem(this.cache.autoActiveKey,this.autoActive),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(o=>this.checkList.includes(o.key)):[],this.handleWeatherLayerChange(),this.$parent.$refs.idmBottomBar.handleToggle(a),this.autoActive||this.handleMenuToggle()}},iceToggleValue:{handler(a){a&&(this.checkList=["ice-forecast",this.iceToggleValue])}},showWindParticle:{handler(a){let o="wind-particle";this.weatherLayers[o].particle=a,this.weatherLayers[o].version=Math.random()+1}},showCurrentParticle:{handler(a){let o="current-particle";this.weatherLayers[o].particle=a,this.weatherLayers[o].version=Math.random()+1}},isLogin:{handler(a){a?this.fetchMeteoSource():this.sourceList={}}}},mounted(){this.fetchCache()},methods:{arraysEqual(a,o){if((a==null?void 0:a.length)!==(o==null?void 0:o.length))return!1;for(let t=0;t<(a==null?void 0:a.length);t++)if((a==null?void 0:a[t])!==(o==null?void 0:o[t]))return!1;return!0},fetchCache(){const a=localStorage.getItem(this.cache.versionKey);this.cache.v!==a&&(localStorage.removeItem(this.cache.autoActiveKey),localStorage.removeItem(this.cache.checkListKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let o=localStorage.getItem(this.cache.autoActiveKey);this.autoActive=o!=="false",localStorage.setItem(this.cache.autoActiveKey,this.autoActive),o=localStorage.getItem(this.cache.checkListKey),this.checkList=JSON.parse(o||"[]"),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList))},handleMenuToggle(){this.$emit("menuToggle","weatherLayers"),this.autoActive&&this.$parent.$refs.idmBottomBar.handleToggle(this.autoActive)},handleFastWeatherToggle(a){let o=[];this.checkList.includes(a)?o=this.checkList.filter(t=>t!==a):o=[...this.checkList,a],this.handleCheckListChange(o,this.checkList)},handleCheckListChange(a,o){if(this.arraysEqual(a,o))return!1;const t=[...new Set(a)],b=t==null?void 0:t.filter(c=>!(o!=null&&o.includes(c)))[0],p=o==null?void 0:o.filter(c=>!(t!=null&&t.includes(c)))[0];b&&(b==="ice-cover"||b==="ice-thickness"||b==="ice-forecast"?(this.checkList=["ice-forecast",this.iceToggleValue||"ice-cover"],this.iceToggleValue=this.iceToggleValue||"ice-cover"):this.rendersKeys.includes(b)?this.checkList=[b]:this.checkList=t.filter(c=>!this.rendersKeys.includes(c))),p&&(p==="ice-forecast"?(this.checkList=t.filter(c=>!["ice-cover","ice-thickness","ice-forecast"].includes(c)),this.iceToggleValue=void 0):this.checkList=t),this.checkList.includes("wind-particle")&&(this.showWindParticle=!0),this.checkList.includes("current-particle")&&(this.showCurrentParticle=!0),localStorage.setItem(this.cache.checkListKey,JSON.stringify(t)),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(c=>t.includes(c.key)):[],this.handleWeatherLayerChange()},async fetchMeteoSource(){this.sourceList={};let a=await r0.get(`${this.gateway}/api/arc/meteo2/models`,{headers:{Authorization:this.token}});(a==null?void 0:a.data.code)===0&&(this.sourceList=a==null?void 0:a.data.data)},async fetchWeatherLayers(a={}){var p,c,i,M,n,s,r,O,m;const o=new Date().valueOf();let t=0,b=0;if(this.map){const h=((p=this.map)==null?void 0:p.getZoom())+1,R=(c=this.map)==null?void 0:c.getBounds(),C=`${R._sw.lng},${R._sw.lat},${R._ne.lng},${R._ne.lat}`;if(this.particleFactor&&((i=this.$refs.layer)!=null&&i.autoActive)){const w=C0.LayerHelper.WEATHER_LAYERS.find(B=>{var L;return((L=B.peer)==null?void 0:L.weight)===this.particleFactor.weight});this.particleFactor.particle&&(this.showWindParticle||this.showCurrentParticle)?this.weatherWeight=this.weatherWeight&w.weight?this.weatherWeight:this.weatherWeight+w.weight:this.weatherWeight=this.weatherWeight&w.weight?this.weatherWeight-w.weight:this.weatherWeight}if(this.weatherWeight>0){let w=this.weatherWeight;if(w>0){const B=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],L=await r0.get(`${B}/api/arc/weather/layers2/links?l=${w}&v=${this.forecastModel}&z=${h}&bbox=${C}&t=${this.realTime}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(b=new Date().valueOf()-(o+t),console.log("weather links elapsed: ",b,", total: ",t+=b),((M=L==null?void 0:L.data)==null?void 0:M.code)===0){const g=(n=L==null?void 0:L.data)==null?void 0:n.data,x=[];for(const W in g)x.push(r0.get(g[W],{headers:{Authorization:this.token||this.defaultMeteoToken,key:W},responseType:/\.(jpg|png)$/.test(g[W])?"blob":"json"}).catch(q=>{console.log(`[${W}] fetch layer error: ${q}`)}));const u=await Promise.all(x);this.weatherLayers={},u.map(W=>{var j,F,H,Q;const q=((j=W==null?void 0:W.data)==null?void 0:j.data)||(W==null?void 0:W.data);let v=(H=(F=W==null?void 0:W.config)==null?void 0:F.headers)==null?void 0:H.key;v&&q&&(this.weatherLayers[v]={raw:q,type:((Q=W==null?void 0:W.config)==null?void 0:Q.responseType)==="blob"?"image":"json",etime:L.data.etime})})}if(b=new Date().valueOf()-(o+t),console.log("weather layers elapsed: ",b,", total: ",t+=b),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const g=(s=this.weatherLayers["swell-direction"])==null?void 0:s.raw,x=(r=this.weatherLayers["swell-height"])==null?void 0:r.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:g,height:{raw:x},etime:L.data.etime}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const g=(O=this.weatherLayers["current-direction"])==null?void 0:O.raw,x=(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:g,speed:{raw:x},etime:L.data.etime}}}}this.handleWeatherLayerToggle(),this.handleDrawWeather4Json()}},handleWeatherLayerToggle(){var o,t;for(const b in this.weatherLayers)this.weatherLayers[b].active=!1,this.weatherLayers[b].version=Math.random()+1;for(const b of this.activeWeatherLayers){let p=b.key;p==="current-direction"&&(p="current"),this.weatherLayers[p]&&(this.weatherLayers[p].active=!0,this.weatherLayers[p].version=Math.random()+1,p==="wind-particle"&&(this.weatherLayers[p].particle=this.showWindParticle),p==="current-particle"&&(this.weatherLayers[p].particle=this.showCurrentParticle))}this.autoActive&&this.activeWeatherLayers.some(b=>["wind-particle","sig-wave","current-particle","water-temp","temp"].some(p=>p===b.key))?(this.map.getLayer("country-boundaries")&&this.map.setLayoutProperty("country-boundaries","visibility","visible"),this.map.getLayer("water-outline2")&&this.map.setLayoutProperty("water-outline2","visibility","visible"),this.map.moveLayer((o=this.viewport)==null?void 0:o.rampColorLayer,"country-boundaries"),this.map.moveLayer((t=this.viewport)==null?void 0:t.particleLayer,"country-boundaries"),this.mapFeather==="nautical"&&(this.map.getLayer("i4")&&this.map.setLayoutProperty("i4","visibility","none"),this.map.getLayer("hi")&&this.map.setLayoutProperty("hi","visibility","none"),this.map.getLayer("admin-0-boundary-bg")&&this.map.setLayoutProperty("admin-0-boundary-bg","visibility","visible"),this.map.getLayer("admin-0-boundary")&&this.map.setLayoutProperty("admin-0-boundary","visibility","visible"),this.map.getLayer("admin-0-boundary-disputed")&&this.map.setLayoutProperty("admin-0-boundary-disputed","visibility","visible"),this.map.getLayer("country-label")&&this.map.setLayoutProperty("country-label","visibility","visible"),this.map.getLayer("continent-label")&&this.map.setLayoutProperty("continent-label","visibility","visible"),this.map.getLayer("state-label")&&this.map.setLayoutProperty("state-label","visibility","visible"))):(this.map.getLayer("country-boundaries")&&this.map.setLayoutProperty("country-boundaries","visibility","none"),this.map.getLayer("water-outline2")&&this.map.setLayoutProperty("water-outline2","visibility","none"),this.mapFeather==="nautical"&&(this.map.getLayer("i4")&&this.map.setLayoutProperty("i4","visibility","visible"),this.map.getLayer("hi")&&this.map.setLayoutProperty("hi","visibility","visible"),this.map.getLayer("admin-0-boundary-bg")&&this.map.setLayoutProperty("admin-0-boundary-bg","visibility","none"),this.map.getLayer("country-label")&&this.map.setLayoutProperty("admin-0-boundary","visibility","none"),this.map.getLayer("admin-0-boundary-disputed")&&this.map.setLayoutProperty("admin-0-boundary-disputed","visibility","none"),this.map.getLayer("country-label")&&this.map.setLayoutProperty("country-label","visibility","none"),this.map.getLayer("continent-label")&&this.map.setLayoutProperty("continent-label","visibility","none"),this.map.getLayer("state-label")&&this.map.setLayoutProperty("state-label","visibility","none")))},handleWeatherLayerChange(a={sourceChanged:!1}){this.map?setTimeout(()=>{var t;const o=(t=this.activeWeatherLayers)==null?void 0:t.reduce((b,p)=>b+(b&(p==null?void 0:p.weight)?0:p==null?void 0:p.weight),0);a!=null&&a.sourceChanged||this.weatherWeight!==o?(this.weatherWeight=o,this.fetchWeatherLayers()):this.handleWeatherLayerToggle()}):setTimeout(()=>{this.handleWeatherLayerChange()},500)},handleRampColorInitial(){var a,o,t,b,p,c,i,M,n,s,r,O;this.viewport.map.getSource((a=this.viewport)==null?void 0:a.rampColorSource)||this.viewport.map.addSource((o=this.viewport)==null?void 0:o.rampColorSource,{type:"canvas",canvas:(t=this.viewport)==null?void 0:t.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((b=this.viewport)==null?void 0:b.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(p=this.viewport)==null?void 0:p.rampColorLayer,source:(c=this.viewport)==null?void 0:c.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((i=this.viewport)==null?void 0:i.particleSource)||this.viewport.map.addSource((M=this.viewport)==null?void 0:M.particleSource,{type:"canvas",canvas:(n=this.viewport)==null?void 0:n.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((s=this.viewport)==null?void 0:s.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(r=this.viewport)==null?void 0:r.particleLayer,source:(O=this.viewport)==null?void 0:O.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDrawWeather4Json(){var s,r,O,m,h,R,C;const a=new Date().valueOf();let o=0,t=0;const b=(s=this.map)==null?void 0:s.getBounds(),p=(r=this.map)==null?void 0:r.getZoom(),c=t0.LngLatHelper.convertToStdLng(b._sw.lng),i=t0.LngLatHelper.convertToStdLng(b._ne.lng),M=Math.floor(b._sw.lat),n=Math.ceil(b._ne.lat);for(const w in this.weatherLayers){let B=!1;if(this.weatherLayers[w].active&&this.weatherLayers[w].type==="json"){let L=[];if(w==="swell"){B=!0;const g=((O=this.weatherLayers[w])==null?void 0:O.direction)||{};for(const u in g)if(u>M&&u<n&&(!(p<=this.zoom)||u%(p<2?10:p<4?5:3)===0)){const W=g[u].lng;c>i?W.forEach((q,v)=>{var j,F,H,Q,o0,Z;if(p<2){if((q>=0&&q<=360||q>=-360&&q<=0)&&q%10===0){const Y=I.point([q,u],{val:((j=g[u].val)==null?void 0:j[v])||((F=g[u].dir)==null?void 0:F[v]),spd:(H=g[u].spd)==null?void 0:H[v]});L.push(Y)}}else if((q>=c&&q<=180||q>=-180&&q<=i)&&(!(p<=this.zoom)||q%(p<2?10:p<4?5:3)===0)){const Y=I.point([q,u],{val:((Q=g[u].val)==null?void 0:Q[v])||((o0=g[u].dir)==null?void 0:o0[v]),spd:(Z=g[u].spd)==null?void 0:Z[v]});L.push(Y)}}):W.forEach((q,v)=>{var j,F,H,Q,o0,Z;if(c<2){if((q>=0&&q<=360||q>=-360&&q<=0)&&q%10===0){const Y=I.point([q,u],{val:((j=g[u].val)==null?void 0:j[v])||((F=g[u].dir)==null?void 0:F[v]),spd:(H=g[u].spd)==null?void 0:H[v]});L.push(Y)}}else if(q>=c&&q<=i&&(!(p<=this.zoom)||q%(p<2?10:p<4?5:3)===0)){const Y=I.point([q,u],{val:((Q=g[u].val)==null?void 0:Q[v])||((o0=g[u].dir)==null?void 0:o0[v]),spd:(Z=g[u].spd)==null?void 0:Z[v]});L.push(Y)}})}t=new Date().valueOf()-(a+o),console.log("swell direction elapsed: ",t,", total: ",o+=t);const x=this.weatherLayers[w].height;if(x){if(!x.data){const u=[];for(const W in(m=x.raw)==null?void 0:m.LineString){const q=x.raw.LineString[W];for(const v of q)u.push(I.lineString(v,{val:Number(W)}));x.data=I.featureCollection(u)}}if(x.data){const u=this.handleBboxClip(x.data,b);L=L.concat(u)}t=new Date().valueOf()-(a+o),console.log("swell height elapsed: ",t,", total: ",o+=t)}}else if(w==="current"){B=!0;const g=((h=this.weatherLayers[w])==null?void 0:h.direction)||{};for(const u in g)if(u>M&&u<n&&(!(p<=this.zoom)||u%(p<2?10:p<4?5:3)===0)){const W=g[u].lng;c>i?W.forEach((q,v)=>{var j,F,H,Q,o0,Z;if(p<2){if((q>=0&&q<=360||q>=-360&&q<=0)&&q%10===0){const Y=I.point([q,u],{val:((j=g[u].val)==null?void 0:j[v])||((F=g[u].dir)==null?void 0:F[v]),spd:(H=g[u].spd)==null?void 0:H[v]});L.push(Y)}}else if((q>=c&&q<=180||q>=-180&&q<=i)&&(!(p<=this.zoom)||q%(p<2?10:p<4?5:3)===0)){const Y=I.point([q,u],{val:((Q=g[u].val)==null?void 0:Q[v])||((o0=g[u].dir)==null?void 0:o0[v]),spd:(Z=g[u].spd)==null?void 0:Z[v]});L.push(Y)}}):W.forEach((q,v)=>{var j,F,H,Q,o0,Z;if(c<2){if((q>=0&&q<=360||q>=-360&&q<=0)&&q%10===0){const Y=I.point([q,u],{val:((j=g[u].val)==null?void 0:j[v])||((F=g[u].dir)==null?void 0:F[v]),spd:(H=g[u].spd)==null?void 0:H[v]});L.push(Y)}}else if(q>=c&&q<=i&&(!(p<=this.zoom)||q%(p<this.zoom/2?5:3)===0)){const Y=I.point([q,u],{val:((Q=g[u].val)==null?void 0:Q[v])||((o0=g[u].dir)==null?void 0:o0[v]),spd:(Z=g[u].spd)==null?void 0:Z[v]});L.push(Y)}})}t=new Date().valueOf()-(a+o),console.log("current direction elapsed: ",t,", total: ",o+=t);const x=this.weatherLayers[w].speed;if(x){if(!x.data){const W=[];for(const q in(R=x.raw)==null?void 0:R.Polygon){const v=x.raw.Polygon[q];for(const j of v)W.push(I.polygon(j,{val:Number(q)}))}x.data=I.featureCollection(W)}const u=p<this.zoom?x.data.features.filter(W=>W.properties.val>.5):x.data.features;L=L.concat(u),t=new Date().valueOf()-(a+o),console.log("current speed elapsed: ",t,", total: ",o+=t)}}else if(w==="wind"){B=!0;const g=this.weatherLayers.wind.raw;for(const x in g)if(x>M&&x<n&&(!(p<=this.zoom)||x%(p<2?10:p<4?5:3)===0)){const u=g[x].lng;c>i?u.forEach((W,q)=>{var v,j,F,H;if(p<2){if((W>=0&&W<=360||W>=-360&&W<=0)&&W%10===0){const Q=I.point([W,x],{dir:((v=g[x].val)==null?void 0:v[q])||((j=g[x].dir)==null?void 0:j[q]),spd:g[x].spd[q]});L.push(Q)}}else if((W>=c&&W<=180||W>=-180&&W<=i)&&(!(p<=this.zoom)||W%(p<2?10:p<4?5:3)===0)){const Q=I.point([W,x],{dir:((F=g[x].val)==null?void 0:F[q])||((H=g[x].dir)==null?void 0:H[q]),spd:g[x].spd[q]});L.push(Q)}}):u.forEach((W,q)=>{var v,j,F,H;if(p<2){if((W>=0&&W<=360||W>=-360&&W<=0)&&W%10===0){const Q=I.point([W,x],{dir:((v=g[x].val)==null?void 0:v[q])||((j=g[x].dir)==null?void 0:j[q]),spd:g[x].spd[q]});L.push(Q)}}else if(W>=c&&W<=i&&(!(p<=this.zoom)||W%(p<2?10:p<4?5:3)===0)){const Q=I.point([W,x],{dir:((F=g[x].val)==null?void 0:F[q])||((H=g[x].dir)==null?void 0:H[q]),spd:g[x].spd[q]});L.push(Q)}})}t=new Date().valueOf()-(a+o),console.log("wind barb elapsed: ",t,", total: ",o+=t)}else if(w==="sig-wave-height"){if(this.weatherLayers[w].data)L=this.weatherLayers[w].data;else{B=!0;const g=this.weatherLayers[w].raw;if(g){const x=[];for(const u in g.Polygon){const W=g.Polygon[u];for(const q of W)x.push(I.polygon(q,{val:Number(u)}))}for(const u in g.Point){const W=g.Point[u];for(let q=0;q<((C=W.lng)==null?void 0:C.length);q++)x.push(I.point([W.lng[q],u],{val:Number(W.val[q])}))}L=L.concat(x)}}t=new Date().valueOf()-(a+o),console.log("sig-wave-height elapsed: ",t,", total: ",o+=t)}else if(w==="prmsl"){if(this.weatherLayers[w].data)L=this.weatherLayers[w].data;else{B=!0;const g=this.weatherLayers[w].raw;if(g){const x=[];for(const u in g.LineString){const W=g.LineString[u];for(const q of W)x.push(I.lineString(q,{val:Number(u)}))}for(const u in g.Point)g.Point[u].lng.forEach((W,q)=>{W=t0.LngLatHelper.convertToStdLng(W),x.push(I.point([W,u],{val:g.Point[u].val[q],type:g.Point[u].type[q]}))});L=L.concat(x)}}t=new Date().valueOf()-(a+o),console.log("prmsl elapsed: ",t,", total: ",o+=t)}L.length&&(this.weatherLayers[w].data=I.featureCollection(L)),B&&(this.weatherLayers[w].version=Math.random()+1)}}},handleMove4Weather(){for(const a in this.weatherLayers)this.weatherLayers[a].active&&this.weatherLayers[a].type==="image"&&(this.weatherLayers[a].active=!0,this.weatherLayers[a].version=Math.random()+1);this.handleDrawWeather4Json()},handleBboxClip(a,o){const t=[],b=t0.LngLatHelper.convertToStdLng(o._sw.lng),p=t0.LngLatHelper.convertToStdLng(o._ne.lng);return a.features.forEach(c=>{if(c.geometry.type!=="Point")if(b>p){let i=[b,o._sw.lat,180,o._ne.lat],M=I.bboxClip(c,i);M.geometry.coordinates.length&&t.push(M),i=[-180,o._sw.lat,p,o._ne.lat],M=I.bboxClip(c,i),M.geometry.coordinates.length&&t.push(M)}else{const i=[b,o._sw.lat,p,o._ne.lat],M=I.bboxClip(c,i);M.geometry.coordinates.length&&t.push(M)}else t.push(c)}),t}}},st={class:"idm-gl4-meteo-layers"},Ot={class:"header-box d-flex justify-space-between align-center pl-4 pr-4"},At={class:"d-flex justify-start align-center ga-3"},dt={class:"text-h5"},mt={class:"layers-body"},qt={class:"layers-body"},ht={key:0,class:"d-flex justify-start align-center ga-4 pl-6"},gt={key:1,class:"d-flex justify-start align-center ga-4 pl-6"},ut={class:"text-body-1 py-2"},ft={class:"text-body-1 font-weight-medium"},Wt={class:"text-body-2 opacity-70"},yt={key:0,class:"text-body-2 opacity-70 mb-3"},Lt={class:"text-body-1 py-2"},Rt={class:"text-body-1 font-weight-medium"},wt={class:"text-body-2 opacity-70"},Bt={class:"text-body-2 opacity-70 pb-1"};function xt(a,o,t,b,p,c){var Y,e0,M0,s0,i0,J,T,b0,d0,m0,q0,n0,K,p0,h0;const i=e.resolveComponent("VBtn"),M=e.resolveComponent("VTooltip"),n=e.resolveComponent("VSwitch"),s=e.resolveComponent("VCardTitle"),r=e.resolveComponent("VCardItem"),O=e.resolveComponent("VCheckbox"),m=e.resolveComponent("VCardText"),h=e.resolveComponent("VCard"),R=e.resolveComponent("VBtnToggle"),C=e.resolveComponent("VDivider"),w=e.resolveComponent("IdmWindBarb"),B=e.resolveComponent("IdmSigWaveHeight"),L=e.resolveComponent("IdmCurrentDirection"),g=e.resolveComponent("IdmPrmsl"),x=e.resolveComponent("IdmWindParticle"),u=e.resolveComponent("IdmCurrentParticle"),W=e.resolveComponent("IdmWave"),q=e.resolveComponent("IdmSwell"),v=e.resolveComponent("IdmIceEdge"),j=e.resolveComponent("IdmIceCover"),F=e.resolveComponent("IdmIceThickness"),H=e.resolveComponent("IdmPrecip3h"),Q=e.resolveComponent("IdmVisibility"),o0=e.resolveComponent("IdmWaterTemp"),Z=e.resolveComponent("IdmTemp");return e.openBlock(),e.createElementBlock("div",st,[e.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:e.normalizeStyle({top:t.top+94+"px",right:p.right+"px"})},[e.createVNode(M,{text:a.$t("weather.weatherLayers"),location:"left","open-delay":1e3},{activator:e.withCtx(({props:f})=>[e.createVNode(i,e.mergeProps(f,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:p.toggle?"primary":"",onClick:c.handleMenuToggle}),{default:e.withCtx(()=>o[6]||(o[6]=[e.createElementVNode("i",{class:"iconfont icon-Weather text-h4 font-weight-bold menu-icon-color"},null,-1)])),_:2,__:[6]},1040,["color","onClick"])]),_:1},8,["text"])],4),e.createElementVNode("div",{class:e.normalizeClass(["available-layers transition flex-center",p.toggle?"right-bar":""]),style:e.normalizeStyle({top:t.top+"px",right:p.toggle?"0px":"-280px"})},[e.createElementVNode("div",Ot,[e.createElementVNode("div",At,[e.createElementVNode("div",dt,e.toDisplayString(a.$t("weather.weather")),1),e.createVNode(n,{modelValue:p.autoActive,"onUpdate:modelValue":o[0]||(o[0]=f=>p.autoActive=f),class:"small-switch",color:"primary","hide-details":""},null,8,["modelValue"])]),e.createVNode(i,{icon:"",density:"comfortable",variant:"plain",class:"mr-n2",onClick:c.handleMenuToggle},{default:e.withCtx(()=>o[7]||(o[7]=[e.createElementVNode("i",{class:"iconfont icon-close",style:{"font-size":"20px"}},null,-1)])),_:1,__:[7]},8,["onClick"])]),e.createElementVNode("div",{class:e.normalizeClass(["list-box scroll pl-4 pr-2 overflow-y-auto",p.autoActive?"":"cursor-not-allowed"])},[e.createVNode(h,{class:"menu-card mx-auto my-3",elevation:"8"},{default:e.withCtx(()=>[e.createVNode(r,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(s,{class:"text-subtitle-1",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.overlays")),1)]),_:1})]),_:1}),e.createVNode(m,null,{default:e.withCtx(()=>[e.createElementVNode("div",mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.tagLayers.filter(f=>f.overlays),f=>(e.openBlock(),e.createBlock(O,{key:f.key,modelValue:p.checkList,"onUpdate:modelValue":o[1]||(o[1]=z0=>p.checkList=z0),value:f.key,label:a.$t(`weather.${f.locale}`),disabled:!p.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}),e.createVNode(h,{class:"menu-card mx-auto mb-3",elevation:"8"},{default:e.withCtx(()=>[e.createVNode(r,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(s,{class:"text-subtitle-1",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.renders")),1)]),_:1})]),_:1}),e.createVNode(m,null,{default:e.withCtx(()=>[e.createElementVNode("div",qt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.tagLayers.filter(f=>!f.overlays&&f.key!=="ice-thickness"),f=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f.key},[e.createVNode(O,{modelValue:p.checkList,"onUpdate:modelValue":o[2]||(o[2]=z0=>p.checkList=z0),value:f.key,label:a.$t(`weather.${f.locale}`),disabled:!p.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label","disabled"]),p.checkList.includes("wind-particle")&&f.key==="wind-particle"?(e.openBlock(),e.createElementBlock("div",ht,[o[8]||(o[8]=e.createElementVNode("span",null,"Particle",-1)),e.createVNode(n,{modelValue:p.showWindParticle,"onUpdate:modelValue":o[3]||(o[3]=z0=>p.showWindParticle=z0),label:"",class:"small-switch",color:"primary",density:"compact",style:{"font-size":"14px"},"hide-details":""},null,8,["modelValue"])])):e.createCommentVNode("",!0),p.checkList.includes("current-particle")&&f.key==="current-particle"?(e.openBlock(),e.createElementBlock("div",gt,[o[9]||(o[9]=e.createElementVNode("span",null,"Particle",-1)),e.createVNode(n,{modelValue:p.showCurrentParticle,"onUpdate:modelValue":o[4]||(o[4]=z0=>p.showCurrentParticle=z0),label:"",class:"small-switch",color:"primary",density:"compact",height:"20","hide-details":""},null,8,["modelValue"])])):e.createCommentVNode("",!0),p.checkList.includes("ice-forecast")&&f.key==="ice-forecast"?(e.openBlock(),e.createBlock(R,{key:2,modelValue:p.iceToggleValue,"onUpdate:modelValue":o[5]||(o[5]=z0=>p.iceToggleValue=z0),class:"ml-7",rounded:"0",height:"30",density:"compact",group:"",disabled:!p.autoActive},{default:e.withCtx(()=>[e.createVNode(i,{density:"compact",height:"30",value:"ice-cover",class:"text-none px-2",color:p.iceToggleValue==="ice-cover"?"primary":"","base-color":"grey-lighten-1",disabled:!p.autoActive},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.coverage")),1)]),_:1},8,["color","disabled"]),e.createVNode(i,{density:"compact",height:"30",class:"text-none px-2",color:p.iceToggleValue==="ice-thickness"?"primary":"","base-color":"grey-lighten-1",disabled:!p.autoActive,value:"ice-thickness"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.thickness")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):e.createCommentVNode("",!0)],64))),128))])]),_:1})]),_:1}),e.createVNode(h,{class:"menu-card mx-auto mb-3",elevation:"8"},{default:e.withCtx(()=>[e.createVNode(r,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(s,{class:"text-subtitle-1",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.forecastModel")),1)]),_:1})]),_:1}),e.createVNode(m,{class:""},{default:e.withCtx(()=>{var f,z0,O0,z;return[e.createElementVNode("div",ut,e.toDisplayString(a.$t("weather.atmospheric")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((z0=(f=p.sourceList)==null?void 0:f.weather)==null?void 0:z0.filter(A=>A.model!=="best_match"),A=>{var d,y,k,P,X,V;return e.openBlock(),e.createElementBlock(e.Fragment,{key:`source${A.name}`},[e.createElementVNode("div",ft,e.toDisplayString(A.name)+" "+e.toDisplayString(A.resolution)+e.toDisplayString(a.$t("units.km"))+" "+e.toDisplayString(A.length)+e.toDisplayString(a.$t("units.days")),1),e.createElementVNode("div",Wt,e.toDisplayString(a.$t("weather.source"))+": "+e.toDisplayString(A.provider),1),(k=(y=(d=A==null?void 0:A.update)==null?void 0:d.default)==null?void 0:y.meta)!=null&&k.initialisationTime?(e.openBlock(),e.createElementBlock("div",yt,e.toDisplayString(a.$t("weather.lastUpdate"))+": "+e.toDisplayString(c.computeDateZ((V=(X=(P=A==null?void 0:A.update)==null?void 0:P.default)==null?void 0:X.meta)==null?void 0:V.initialisationTime)),1)):e.createCommentVNode("",!0)],64)}),128)),e.createVNode(C),e.createElementVNode("div",Lt,e.toDisplayString(a.$t("weather.marine")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((z=(O0=p.sourceList)==null?void 0:O0.marine)==null?void 0:z.filter(A=>A.model!=="best_match"),A=>{var d,y,k;return e.openBlock(),e.createElementBlock(e.Fragment,{key:`source${A.name}`},[e.createElementVNode("div",Rt,e.toDisplayString(A.name)+" "+e.toDisplayString(A.resolution)+e.toDisplayString(a.$t("units.km"))+" "+e.toDisplayString(A.length)+e.toDisplayString(a.$t("units.days")),1),e.createElementVNode("div",wt,e.toDisplayString(a.$t("weather.source"))+": "+e.toDisplayString(A.provider),1),e.createElementVNode("div",Bt,e.toDisplayString(a.$t("weather.lastUpdate"))+": "+e.toDisplayString(c.computeDateZ((k=(y=(d=A==null?void 0:A.update)==null?void 0:d.default)==null?void 0:y.meta)==null?void 0:k.initialisationTime)),1)],64)}),128))]}),_:1})]),_:1})],2)],6),t.map?(e.openBlock(),e.createBlock(w,e.mergeProps({key:0,ref:"windBarb",map:t.map,"map-feather":t.mapFeather,"before-layer":"empty-layer-2",wind:(Y=p.weatherLayers)==null?void 0:Y.wind,"menu-toggle":t.menuToggle},a.$attrs),null,16,["map","map-feather","wind","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(B,e.mergeProps({key:1,map:t.map,"before-layer":"empty-layer-2","sig-wave-height":(e0=p.weatherLayers)==null?void 0:e0["sig-wave-height"],"menu-toggle":t.menuToggle,"active-weather-layers":p.activeWeatherLayers},a.$attrs),null,16,["map","sig-wave-height","menu-toggle","active-weather-layers"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(L,e.mergeProps({key:2,map:t.map,"before-layer":"empty-layer-2",current:(M0=p.weatherLayers)==null?void 0:M0.current,"menu-toggle":t.menuToggle},a.$attrs),null,16,["map","current","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(g,e.mergeProps({key:3,map:t.map,"before-layer":"empty-layer-2",prmsl:(s0=p.weatherLayers)==null?void 0:s0.prmsl,"menu-toggle":t.menuToggle,"active-weather-layers":p.activeWeatherLayers},a.$attrs),null,16,["map","prmsl","menu-toggle","active-weather-layers"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(x,e.mergeProps({key:4,viewport:p.viewport,factor:(i0=p.weatherLayers)==null?void 0:i0["wind-particle"],"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(u,e.mergeProps({key:5,viewport:p.viewport,factor:(J=p.weatherLayers)==null?void 0:J["current-particle"],"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(W,e.mergeProps({key:6,viewport:p.viewport,factor:(T=p.weatherLayers)==null?void 0:T["sig-wave"],"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(q,e.mergeProps({key:7,map:t.map,swell:(b0=p.weatherLayers)==null?void 0:b0.swell,"menu-toggle":t.menuToggle,"active-weather-layers":p.activeWeatherLayers},a.$attrs),null,16,["map","swell","menu-toggle","active-weather-layers"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(v,e.mergeProps({key:8,viewport:p.viewport,factor:(d0=p.weatherLayers)==null?void 0:d0["ice-edge"],"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(j,e.mergeProps({key:9,viewport:p.viewport,factor:(m0=p.weatherLayers)==null?void 0:m0["ice-cover"],"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(F,e.mergeProps({key:10,viewport:p.viewport,factor:(q0=p.weatherLayers)==null?void 0:q0["ice-thickness"],"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(H,e.mergeProps({key:11,viewport:p.viewport,factor:(n0=p.weatherLayers)==null?void 0:n0.precip3h,"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(Q,e.mergeProps({key:12,viewport:p.viewport,factor:(K=p.weatherLayers)==null?void 0:K.visibility,"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(o0,e.mergeProps({key:13,viewport:p.viewport,factor:(p0=p.weatherLayers)==null?void 0:p0["water-temp"],"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),t.map?(e.openBlock(),e.createBlock(Z,e.mergeProps({key:14,viewport:p.viewport,factor:(h0=p.weatherLayers)==null?void 0:h0.temp,"menu-toggle":t.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0)])}const Nt=$(lt,[["render",xt]]),v0=[{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"],categories:"ecmwf_ifs025,ecmwf_aifs025_single",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"}],T0=[{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"}];class G0{static standardWeatherModels(){return v0.filter(o=>!o.disabled&&o.alias)}static standardMarineModels(){return T0.filter(o=>!o.disabled&&o.alias)}static autoPickLayerModel(o,t="copernicus"){return t=t||"copernicus",t=t==null?void 0:t.toLowerCase(),t=["gfs","ecmwf","copernicus"].includes(t)?t:"copernicus",o=o==null?void 0:o.toLowerCase(),o==="gfs"?"gfs":["ec","ecmwf"].includes(o)?"ecmwf":["copernicus","cmems"].includes(o)?"copernicus":t}static autoPickPeerModel(o,t,b="copernicus"){if(t=this.autoPickLayerModel(t,b),Xe.LayerHelper.WEATHER_LAYERS.reduce((p,c)=>c.atmos?p+c.weight:p,0)&o.weight){if(t==="copernicus")return"ecmwf"}else if(t==="ecmwf")return"copernicus";return t}static autoPickMeteoModel(o="best_match"){var t,b;o=o==null?void 0:o.toLowerCase(),o=o==="ec"?"ecmwf":o;const p=o.toLowerCase().split(","),c=[],i=[];for(const M of p){let n=v0.find(r=>{var O,m,h;return((O=r.models)==null?void 0:O.includes(M))||((m=r.alias)==null?void 0:m.toLowerCase())===M||((h=r.name)==null?void 0:h.toLowerCase())===M}),s=T0.find(r=>{var O,m,h;return((O=r.models)==null?void 0:O.includes(M))||((m=r.alias)==null?void 0:m.toLowerCase())===M||((h=r.name)==null?void 0:h.toLowerCase())===M});n=n||v0.find(r=>{var O,m;return((O=r.alias)==null?void 0:O.toLowerCase())===((m=s==null?void 0:s.alias)==null?void 0:m.toLowerCase())}),s=s||T0.find(r=>{var O,m;return((O=r.alias)==null?void 0:O.toLowerCase())===((m=n==null?void 0:n.alias)==null?void 0:m.toLowerCase())}),n=n||v0[0],s=s||T0[0],c.push((t=n.models)!=null&&t.includes(M)?M:n.model),i.push((b=s.models)!=null&&b.includes(M)?M:s.model)}return{weatherModels:c.join(","),marineModels:i.join(",")}}static autoPickSubCategories(o){o=o.toUpperCase();const t=v0.filter(c=>c.alias===o),b=T0.filter(c=>c.alias===o),p=[];return t.forEach(c=>{c.categories&&p.push(...c.categories.split(","))}),b.forEach(c=>{c.categories&&p.push(...c.categories.split(","))}),p}static pickHourly(o,t){var b,p,c,i,M,n,s,r,O,m,h,R,C,w,B,L,g,x,u,W,q,v,j,F,H,Q,o0,Z,Y,e0,M0,s0,i0,J,T,b0,d0,m0,q0,n0,K,p0,h0,f,z0,O0,z,A,d,y;const k=typeof t=="string"?G(t):t,P=o==null?void 0:o.weather,X=o==null?void 0:o.marine,V=G((p=(b=P==null?void 0:P[0])==null?void 0:b.hourly)==null?void 0:p.date).utc(),E=V.clone().add((M=(i=(c=P==null?void 0:P[0])==null?void 0:c.hourly)==null?void 0:i.time)==null?void 0:M.at(0),"h"),c0=V.clone().add((r=(s=(n=P==null?void 0:P[0])==null?void 0:n.hourly)==null?void 0:s.time)==null?void 0:r.at(-1),"h"),R0=[];if(k.isBetween(E,c0,"millisecond","[]")){const S=k.utc().diff(E,"h",!1);let g0,y0;if(P){let w0=0,B0=0;for(const _ of P){const U=_==null?void 0:_.hourly;for(let f0=S-(S-1)%3;f0<=S;f0++)w0+=(O=U==null?void 0:U.precipitation)==null?void 0:O.at(f0);for(let f0=S-(S-1)%6;f0<=S;f0++)B0+=(m=U==null?void 0:U.precipitation)==null?void 0:m.at(f0);g0={temp:(h=U==null?void 0:U.temperature_2m)==null?void 0:h.at(S),apparentTemp:(R=U==null?void 0:U.apparent_temperature)==null?void 0:R.at(S),rh:(C=U==null?void 0:U.relative_humidity_2m)==null?void 0:C.at(S),dp:(w=U==null?void 0:U.dew_point_2m)==null?void 0:w.at(S),precip:{probability:(B=U==null?void 0:U.precipitation_probability)==null?void 0:B.at(S),sum:(L=U==null?void 0:U.precipitation)==null?void 0:L.at(S),sum3Hours:Math.round(w0*100)/100,sum6Hours:Math.round(B0*100)/100},pmsl:(g=U==null?void 0:U.pressure_msl)==null?void 0:g.at(S),psurf:(x=U==null?void 0:U.surface_pressure)==null?void 0:x.at(S),code:(u=U==null?void 0:U.weather_code)==null?void 0:u.at(S),visibility:this.m2nm((W=U==null?void 0:U.visibility)==null?void 0:W.at(S)),wind:{speed:(q=U==null?void 0:U.wind_speed_10m)==null?void 0:q.at(S),kts:(v=U==null?void 0:U.wind_speed_10m)==null?void 0:v.at(S),degree:(j=U==null?void 0:U.wind_direction_10m)==null?void 0:j.at(S),bearing:((F=U==null?void 0:U.wind_direction_10m)==null?void 0:F.at(S))!==null?(((H=U==null?void 0:U.wind_direction_10m)==null?void 0:H.at(S))+180)%360:null,gusts:(Q=U==null?void 0:U.wind_gusts_10m)==null?void 0:Q.at(S)},isDay:(o0=U==null?void 0:U.is_day)==null?void 0:o0.at(S)};const{name:N0,url:k0,bg:X0}=this.parseWeatherCode(g0.code,g0.isDay);g0.name=N0,g0.url=k0,g0.bg=X0,g0.wind.scale=this.beaufort(this.kts2ms(g0.wind.kts)),g0.wind.direction=this.degree2Direction(g0.wind.degree),R0.push({utc:E.add(S,"h").format(),model:_.model,weather:{...g0}})}}if(X){let w0=0;for(const B0 of X){const _=B0==null?void 0:B0.hourly;y0={wave:{sig:{height:(Z=_==null?void 0:_.wave_height)==null?void 0:Z.at(S),degree:(Y=_==null?void 0:_.wave_direction)==null?void 0:Y.at(S),bearing:((e0=_==null?void 0:_.wave_direction)==null?void 0:e0.at(S))!==null?(((M0=_==null?void 0:_.wave_direction)==null?void 0:M0.at(S))+180)%360:null,period:(s0=_==null?void 0:_.wave_period)==null?void 0:s0.at(S)},swell:{height:(i0=_==null?void 0:_.swell_wave_height)==null?void 0:i0.at(S),degree:(J=_==null?void 0:_.swell_wave_direction)==null?void 0:J.at(S),bearing:((T=_==null?void 0:_.swell_wave_direction)==null?void 0:T.at(S))!==null?(((b0=_==null?void 0:_.swell_wave_direction)==null?void 0:b0.at(S))+180)%360:null,period:(d0=_==null?void 0:_.swell_wave_period)==null?void 0:d0.at(S),peakPeriod:(m0=_==null?void 0:_.swell_wave_peak_period)==null?void 0:m0.at(S)},wd:{height:(q0=_==null?void 0:_.wind_wave_height)==null?void 0:q0.at(S),degree:(n0=_==null?void 0:_.wind_wave_direction)==null?void 0:n0.at(S),bearing:((K=_==null?void 0:_.wind_wave_direction)==null?void 0:K.at(S))!==null?(((p0=_==null?void 0:_.wind_wave_direction)==null?void 0:p0.at(S))+180)%360:null,period:(h0=_==null?void 0:_.wind_wave_period)==null?void 0:h0.at(S),peakPeriod:(f=_==null?void 0:_.wind_wave_peak_period)==null?void 0:f.at(S)}},current:{speed:(z0=_==null?void 0:_.ocean_current_velocity)==null?void 0:z0.at(S),kts:(O0=_==null?void 0:_.ocean_current_velocity)==null?void 0:O0.at(S),degree:(z=_==null?void 0:_.ocean_current_direction)==null?void 0:z.at(S),bearing:((A=_==null?void 0:_.ocean_current_direction)==null?void 0:A.at(S))??null},sst:(d=_==null?void 0:_.sea_surface_temperature)==null?void 0:d.at(S),height:(y=_==null?void 0:_.sea_level_height_msl)==null?void 0:y.at(S)},y0.wave=this.parseWave(y0.wave,g0==null?void 0:g0.wind),y0.current.direction=this.degree2Direction(y0.current.degree),Object.assign(R0[w0],y0),w0++}}}return R0}static toLegacy(o){var t,b,p,c,i,M,n,s,r,O;return{wind:(t=o==null?void 0:o.weather)==null?void 0:t.wind,visibility:(b=o==null?void 0:o.weather)==null?void 0:b.visibility,temp:(p=o==null?void 0:o.weather)==null?void 0:p.temp,prmsl:(c=o==null?void 0:o.weather)==null?void 0:c.pmsl,gusts:{kts:(M=(i=o==null?void 0:o.weather)==null?void 0:i.wind)==null?void 0:M.gusts},precip:(n=o==null?void 0:o.weather)==null?void 0:n.precip,code:(s=o==null?void 0:o.weather)==null?void 0:s.code,name:(r=o==null?void 0:o.weather)==null?void 0:r.name,url:(O=o==null?void 0:o.weather)==null?void 0:O.url,wave:o==null?void 0:o.wave,current:o==null?void 0:o.current,sst:o==null?void 0:o.sst,height:o==null?void 0:o.height,utc:o==null?void 0:o.utc,source:o==null?void 0:o.model}}static pickDaily(o,t){var b,p,c,i,M,n,s,r,O,m,h,R,C,w,B,L,g,x,u,W,q,v,j,F,H,Q,o0,Z,Y,e0,M0,s0,i0,J,T,b0,d0,m0,q0,n0,K,p0,h0,f;const z0=typeof t=="string"?G(t):t,O0=o==null?void 0:o.weather,z=o==null?void 0:o.marine,A=G((c=(p=(b=O0==null?void 0:O0[0])==null?void 0:b.daily)==null?void 0:p.time)==null?void 0:c.at(0)),d=G((n=(M=(i=O0==null?void 0:O0[0])==null?void 0:i.daily)==null?void 0:M.time)==null?void 0:n.at(-1)),y=[];if(z0.isBetween(A,d,"millisecond","[]")){let k,P;const X=z0.diff(A,"d",!1);if(O0)for(const V of O0){const E=V.daily;k={code:(s=E.weather_code)==null?void 0:s.at(X),temp:{max:(r=E.temperature_2m_max)==null?void 0:r.at(X),min:(O=E.temperature_2m_min)==null?void 0:O.at(X),mean:(m=E.temperature_2m_mean)==null?void 0:m.at(X)},apparentTemp:{max:(h=E.apparent_temperature_max)==null?void 0:h.at(X),min:(R=E.apparent_temperature_min)==null?void 0:R.at(X)},precip:{sum:(C=E.precipitation_sum)==null?void 0:C.at(X),rainSum:(w=E.rain_sum)==null?void 0:w.at(X),snowfallSum:(B=E.snowfall_sum)==null?void 0:B.at(X),showersSum:(L=E.showers_sum)==null?void 0:L.at(X),hours:(g=E.precipitation_hours)==null?void 0:g.at(X),probability:(x=E.precipitation_probability_max)==null?void 0:x.at(X)},rh:{max:(u=E.relative_humidity_2m_max)==null?void 0:u.at(X),min:(W=E.relative_humidity_2m_min)==null?void 0:W.at(X),mean:(q=E.relative_humidity_2m_mean)==null?void 0:q.at(X)},wind:{speed:(v=E.wind_speed_10m_max)==null?void 0:v.at(X),kts:(j=E.wind_speed_10m_max)==null?void 0:j.at(X),degree:(F=E.wind_direction_10m_dominant)==null?void 0:F.at(X),gusts:(H=E.wind_gusts_10m_max)==null?void 0:H.at(X),bearing:((Q=E.wind_direction_10m_dominant)==null?void 0:Q.at(X))!==null?(((o0=E.wind_direction_10m_dominant)==null?void 0:o0.at(X))+180)%360:null}};const{name:c0,url:R0,bg:S}=this.parseWeatherCode(k.code,!0);k.name=c0,k.url=R0,k.bg=S,k.wind.scale=this.beaufort(this.kts2ms(k.wind.kts)),k.wind.direction=this.degree2Direction(k.wind.degree),y.push({utc:A.add(X,"d").utc().format(),model:V.model,weather:{...k}})}if(z){let V=0;for(const E of z){const c0=E.daily;P={wave:{sig:{height:(Z=c0.wave_height_max)==null?void 0:Z.at(X),degree:(Y=c0.wave_direction_dominant)==null?void 0:Y.at(X),period:(e0=c0.wave_period_max)==null?void 0:e0.at(X),bearing:((M0=c0.wave_direction_dominant)==null?void 0:M0.at(X))!==null?(((s0=c0.wave_direction_dominant)==null?void 0:s0.at(X))+180)%360:null},swell:{height:(i0=c0.swell_wave_height_max)==null?void 0:i0.at(X),degree:(J=c0.swell_wave_direction_dominant)==null?void 0:J.at(X),period:(T=c0.swell_wave_period_max)==null?void 0:T.at(X),peakPeriod:(b0=c0.swell_wave_peak_period_max)==null?void 0:b0.at(X),bearing:((d0=c0.swell_wave_direction_dominant)==null?void 0:d0.at(X))!==null?((m0=c0.swell_wave_direction_dominant)==null?void 0:m0.at(X))%360:null},wd:{height:(q0=c0.wind_wave_height_max)==null?void 0:q0.at(X),degree:(n0=c0.wind_wave_direction_dominant)==null?void 0:n0.at(X),period:(K=c0.wind_wave_period_max)==null?void 0:K.at(X),peakPeriod:(p0=c0.wind_wave_peak_period_max)==null?void 0:p0.at(X),bearing:((h0=c0.wind_wave_direction_dominant)==null?void 0:h0.at(X))!==null?(((f=c0.wind_wave_direction_dominant)==null?void 0:f.at(X))+180)%360:null}}},P.wave=this.parseWave(P.wave,k==null?void 0:k.wind),Object.assign(y[V],P),V++}}}return y}static parseWave(o,t){if(o.sig.direction=this.degree2Direction(o.sig.degree),o.swell.direction=this.degree2Direction(o.swell.degree),o.wd.direction=this.degree2Direction(o.wd.degree),o.sig.scale=this.douglas(o.sig.height),o.swell.scale=this.douglas(o.swell.height),o.wd.scale=this.douglas(o.wd.height),o.sig.height===0){const b=Math.sqrt(Math.pow(o.swell.height||0,2)+Math.pow(o.wd.height||0,2));o.sig.height=Math.round(b*100)/100}if(o.swell.height===0)if(o.sig.height>o.wd.height){const b=Math.sqrt(Math.abs(Math.pow(o.sig.height||0,2)-Math.pow(o.wd.height||0,2)));o.swell.height=Math.round(b*100)/100}else{const b=Math.round(.12*this.kts2ms((t==null?void 0:t.kts)||0)*100)/100,p=b>1?b/10:b>.5?b/5:b>.3?b/2:b;o.swell.height=Math.round(p*100)/100}if(o.wd.height===0||o.wd.height>o.sig.height)if(o.sig.height>o.swell.height){const b=Math.sqrt(Math.abs(Math.pow(o.sig.height||0,2)-Math.pow(o.swell.height||0,2))),p=.24*this.kts2ms((t==null?void 0:t.kts)||0);o.wd.height=Math.round(Math.min(b,p)*100)/100}else{const b=.24*this.kts2ms((t==null?void 0:t.kts)||0);o.wd.height=Math.round(b*100)/100}return o.swell.height>o.sig.height&&(o.swell.height=Math.round(o.sig.height*.76*100)/100),o.sig.period||(o.sig.period=Math.round(5*Math.sqrt(o.sig.height))),o.swell.period||(o.swell.period=Math.round(5*Math.sqrt(o.swell.height))),o.wd.period||(o.wd.period=Math.round(5*Math.sqrt(o.wd.height))),o}static parseWeatherCode(o,t){const b=this.weatherCode(o);return(t?b.day:b.night)||{}}static weatherCode(o){const t={code:o};switch(o){case 0:t.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},t.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 1:t.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},t.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 2:t.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"},t.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"};break;case 3:t.day={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"},t.night={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"};break;case 45:t.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},t.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 48:t.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},t.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 51:t.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 53:t.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 55:t.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 56:t.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 57:t.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 61:t.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 63:t.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 65:t.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 66:t.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 67:t.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 71:t.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},t.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 73:t.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},t.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 75:t.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},t.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 77:t.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},t.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 80:t.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 81:t.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 82:t.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 85:t.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},t.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 86:t.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},t.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 95:t.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 96:t.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 99:t.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},t.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break}return t}static kts2ms(o){return isNaN(o)||o===null?o:Math.round(o*1852/3600*1e4)/1e4}static kts2kmh(o){return isNaN(o)||o===null?o:o*1.852}static m2nm(o){return isNaN(o)||o===null?o:Math.round(o/1e3/1.852*1e4)/1e4}static kmh2kts(o){return isNaN(o)||o===null?o:this.ms2kts(o*1e3/3600)}static ms2kts(o){return isNaN(o)||o===null?o:Math.round(o*3600/1852*1e4)/1e4}static degree2Radian(o){if(isNaN(o)||o===null)return o;let t=o%360/360*2*Math.PI;return t=t<0?t+2*Math.PI:t,t}static degree2Direction(o){const t=this.degree2Radian(o);if(isNaN(t)||t===null)return null;let b="N/A";const p=Math.PI/16;return t<p?b="N":t>=p&&t<3*p?b="NNE":t>=3*p&&t<5*p?b="NE":t>=5*p&&t<7*p?b="ENE":t>=7*p&&t<9*p?b="E":t>=9*p&&t<11*p?b="ESE":t>=11*p&&t<13*p?b="SE":t>=13*p&&t<15*p?b="SSE":t>=15*p&&t<17*p?b="S":t>=17*p&&t<19*p?b="SSW":t>=19*p&&t<21*p?b="SW":t>=21*p&&t<23*p?b="WSW":t>=23*p&&t<25*p?b="W":t>=25*p&&t<27*p?b="WNW":t>=27*p&&t<29*p?b="NW":t>=29*p&&t<31*p?b="NNW":t>=31*p&&t<32*p&&(b="N"),b}static beaufort(o){let t=0;return isNaN(o)||(o=Math.round(o*10)/10,o<=.2?t=0:o<=1.5?t=1:o<=3.3?t=2:o<=5.4?t=3:o<=7.9?t=4:o<=10.7?t=5:o<=13.8?t=6:o<=17.1?t=7:o<=20.7?t=8:o<=22.4?t=9:o<=28.4?t=10:o<=32.6?t=11:o>32.6&&(t=12)),t}static douglas(o){let t="Calm";return isNaN(o)||o<=.1?t="Calm":o<=.5?t="Smooth":o<=1.25?t="Slight":o<=2.5?t="Moderate":o<=4?t="Rough":o<=6?t="VeryRough":o<=9?t="High":o<=14?t="VeryHigh":t="Precipitous",t}}const cb="",kt={name:"IdmTropicals",props:{map:{type:Object},top:{type:Number,default:60},menuToggle:{type:Object,default:{}},timeZone:{type:Number,default:0},token:{type:String},defaultMeteoToken:{type:String},gateway:{type:String,default:"aa"},assistGateway:{type:Array,default:[]},forecastModel:{type:String},realTime:{type:String}},emits:["tropical","tropicalProbability"],data(){return{right:10,toggle:!1,helper:C0.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:I.featureCollection([]),circleSource:"circle-source",circleSourceData:I.featureCollection([]),circleLayer:"tropical-circle-layer"}},computed:{computeTime(){return function(a){if(a){const o=G(a).utcOffset(this.timeZone),t=this.timeZone<0?this.timeZone:"+"+this.timeZone;return`${o.format("MMM-DD/HHmm")} [ UTC${t} ] ( ${o==null?void 0:o.fromNow()} )`}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone},computeBF(){return function(a){const o=G0.kts2ms(a);return G0.beaufort(o)}},computeMovement(){return function(a){var o,t;return(t=(o=a==null?void 0:a.forecasts)==null?void 0:o.find(b=>!b.disabled))==null?void 0:t.movement}}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.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())}},showTropicalsInfo:{handler(){this.$emit("tropical",this.showTropicalsInfo)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(){this.handleRefresh()}}},mounted(){},methods:{handleMenuToggle(){this.toggle=!this.toggle,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle?this.fetchTropicals():this.handleClear()},async fetchTropicals(){var p,c,i;const a=new Date().valueOf();let o=0,t=0,b=(p=C0.LayerHelper.WEATHER_LAYERS.find(M=>M.key==="tropicals"))==null?void 0:p.weight;if(b>0){const M=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],n=await r0.get(`${M}/api/arc/weather/layers2/links?l=${b}&v=${this.forecastModel}&t=${this.realTime}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(t=new Date().valueOf()-(a+o),console.log("weather links elapsed: ",t,", total: ",o+=t),((c=n==null?void 0:n.data)==null?void 0:c.code)===0){const s=(i=n==null?void 0:n.data)==null?void 0:i.data;await r0.get(s.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"},responseType:/\.(jpg|png)$/.test(s.tropicals)?"blob":"json"}).then(r=>{var h,R,C;const O=t0.TropicalHelper.convert2Geojson(((h=r==null?void 0:r.data)==null?void 0:h.data)||(r==null?void 0:r.data));((C=(R=r==null?void 0:r.config)==null?void 0:R.headers)==null?void 0:C.key)&&O&&(this.tropicals={data:O,active:!0,cached:!0,type:"json",etime:n.data.etime,version:Math.random()+1},this.handleInit())}).catch(r=>{console.log(`[${key}] fetch layer error: ${r}`)})}t=new Date().valueOf()-(a+o),console.log("tropicals elapsed: ",t,", total: ",o+=t)}},handleRefresh(){var o,t;(((t=(o=this.tropicals)==null?void 0:o.data)==null?void 0:t.features)||[]).forEach(b=>{var p,c;((p=b.geometry)==null?void 0:p.type)==="Point"&&((c=b.properties)!=null&&c.important)&&(b.properties.format=G(b.properties.date).utcOffset(this.timeZone).format(`MMM-DD/HHmm [(utc${this.computeTimezone})]`))}),this.handleInit()},handleInit(){var a;this.tropicals&&(this.handleRender(),(a=this.map)==null||a.on("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick))},handleRender(){var a,o,t,b,p,c,i,M,n,s;if(!this.map)setTimeout(()=>{this.handleRender()},500);else{if(this.tropicals){const O=new Date().valueOf();let m=0,h=0;(a=this.map)!=null&&a.getSource(this.source)?((t=this.map)==null||t.getSource(this.source).setData((o=this.tropicals)!=null&&o.active?this.tropicals.data:this.empty),h=new Date().valueOf()-(O+m),console.log("[tropicals] update elapsed: ",h,", total: ",m+=h)):(this.map.addSource(this.source,{type:"geojson",data:(b=this.tropicals)!=null&&b.active?(p=this.tropicals)==null?void 0:p.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":"#000","line-width":3,"line-opacity":.5}}),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","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#f2a0a0"],"line-width":3,"line-opacity":.9,"line-dasharray":[1,2]}}),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":13},paint:{"text-color":["match",["get","model"],"cma","#000","jma","#000","ecmwf","#fff","ukm","#fff","noaa-at","#fff","noaa-ep","#fff","#000"],"text-opacity":1,"text-halo-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#f2a0a0"],"text-halo-width":4}}),h=new Date().valueOf()-(O+m),console.log("[tropical] add elapsed: ",h,", total: ",m+=h)),(c=this.map)!=null&&c.getSource(this.clusterSource)?((M=this.map)==null||M.getSource(this.clusterSource).setData((i=this.tropicals)!=null&&i.active?this.tropicals.data:this.empty),h=new Date().valueOf()-(O+m),console.log("[tropical] update elapsed: ",h,", total: ",m+=h)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(n=this.tropicals)!=null&&n.active?(s=this.tropicals)==null?void 0:s.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":6,"circle-color":"#fff"}}),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]],"#03f869",["boolean",["<",["get","kts",["get","wind"]],32]],"#03f869",["boolean",["<",["get","kts",["get","wind"]],47]],"#f2f202",["boolean",["<",["get","kts",["get","wind"]],63]],"#ff9100",["boolean",["<",["get","kts",["get","wind"]],79]],"#f44336",["boolean",["<",["get","kts",["get","wind"]],94]],"#f903d0",["boolean",[">=",["get","kts",["get","wind"]],94]],"#8702f9","#fff"]}}),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),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":7,"circle-color":"#fff"}}),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.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.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["==","important",!0]],layout:{"text-field":["get","name"],"text-offset":[0,1.5],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#fff","text-halo-color":"#0033ff","text-halo-width":4}}),h=new Date().valueOf()-(O+m),console.log("[tropical] add elapsed: ",h,", total: ",m+=h))}this.handleDrawCircle();const r=t0.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(r)),this.handleDateChange()}},handleClear(){var a,o;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),(a=this.interpolateMarkers)==null||a.forEach(t=>t==null?void 0:t.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),this.map.getLayer(this.circleLayer)&&this.map.removeLayer(this.circleLayer),this.map.getSource(this.circleSource)&&this.map.removeSource(this.circleSource)),(o=this.map)==null||o.off("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick)},handleDateChange(){var a,o,t,b,p,c,i,M,n,s,r,O,m,h,R,C,w,B,L,g,x,u,W,q,v,j,F,H,Q,o0,Z,Y;if((a=this.interpolateMarkers)==null||a.forEach(e0=>e0==null?void 0:e0.remove()),this.circleSourceData.features=[],(o=this.interpolateData)!=null&&o.length&&this.tropicals.active){const e0=G(this.realTime).utc().set({minute:0,second:0,millisecond:0}),M0=this.interpolateData.filter(J=>J.properties.date===e0.format()&&!J.properties.disabled),s0=this.handleComputePolygons(M0),i0=I.featureCollection([...M0]);s0.forEach(J=>{i0.features.push(J)}),(t=this.map)!=null&&t.getSource(this.interpolateSource)?(b=this.map)==null||b.getSource(this.interpolateSource).setData(i0):((p=this.map)==null||p.addSource(this.interpolateSource,{type:"geojson",data:i0}),(c=this.map)==null||c.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,"#ff9100",10,"#f44336","#ffffff"],"line-width":1}})),this.interpolateMarkers=[];for(const J of M0)if(!J.properties.disabled){let T="#f44336";((M=(i=J.properties)==null?void 0:i.wind)==null?void 0:M.kts)<32||!((s=(n=J.properties)==null?void 0:n.wind)!=null&&s.kts)?T="#03f869":((O=(r=J.properties)==null?void 0:r.wind)==null?void 0:O.kts)>=32&&((h=(m=J.properties)==null?void 0:m.wind)==null?void 0:h.kts)<47?T="#f2f202":((C=(R=J.properties)==null?void 0:R.wind)==null?void 0:C.kts)>=47&&((B=(w=J.properties)==null?void 0:w.wind)==null?void 0:B.kts)<63?T="#ff9100":((g=(L=J.properties)==null?void 0:L.wind)==null?void 0:g.kts)>=63&&((u=(x=J.properties)==null?void 0:x.wind)==null?void 0:u.kts)<79?T="#f44336":((q=(W=J.properties)==null?void 0:W.wind)==null?void 0:q.kts)>=79&&((j=(v=J.properties)==null?void 0:v.wind)==null?void 0:j.kts)<94?T="#f903d0":((H=(F=J.properties)==null?void 0:F.wind)==null?void 0:H.kts)>=94?T="#8702f9":T="#f44336";const b0=`<svg t="1719918955501"
192
192
  class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="18382"
193
193
  xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
194
194
  <path
@@ -3,57 +3,63 @@ declare namespace _sfc_main {
3
3
  const name: string;
4
4
  const components: undefined;
5
5
  namespace props {
6
- namespace map {
7
- const type: ObjectConstructor;
6
+ namespace isLogin {
7
+ export const type: BooleanConstructor;
8
+ const _default: boolean;
9
+ export { _default as default };
8
10
  }
9
- namespace mapFeather {
10
- const type_1: StringConstructor;
11
+ namespace map {
12
+ const type_1: ObjectConstructor;
11
13
  export { type_1 as type };
12
14
  }
13
- namespace gateway {
15
+ namespace mapFeather {
14
16
  const type_2: StringConstructor;
15
17
  export { type_2 as type };
16
- const _default: string;
17
- export { _default as default };
18
18
  }
19
- namespace assistGateway {
20
- const type_3: ArrayConstructor;
19
+ namespace gateway {
20
+ const type_3: StringConstructor;
21
21
  export { type_3 as type };
22
- const _default_1: never[];
22
+ const _default_1: string;
23
23
  export { _default_1 as default };
24
24
  }
25
- namespace token {
26
- const type_4: StringConstructor;
25
+ namespace assistGateway {
26
+ const type_4: ArrayConstructor;
27
27
  export { type_4 as type };
28
+ const _default_2: never[];
29
+ export { _default_2 as default };
28
30
  }
29
- namespace defaultMeteoToken {
31
+ namespace token {
30
32
  const type_5: StringConstructor;
31
33
  export { type_5 as type };
32
34
  }
33
- namespace top {
34
- const type_6: NumberConstructor;
35
+ namespace defaultMeteoToken {
36
+ const type_6: StringConstructor;
35
37
  export { type_6 as type };
36
- const _default_2: number;
37
- export { _default_2 as default };
38
38
  }
39
- namespace menuToggle {
40
- const type_7: ObjectConstructor;
39
+ namespace top {
40
+ const type_7: NumberConstructor;
41
41
  export { type_7 as type };
42
- const _default_3: {};
42
+ const _default_3: number;
43
43
  export { _default_3 as default };
44
44
  }
45
- namespace realTime {
46
- const type_8: StringConstructor;
45
+ namespace menuToggle {
46
+ const type_8: ObjectConstructor;
47
47
  export { type_8 as type };
48
+ const _default_4: {};
49
+ export { _default_4 as default };
48
50
  }
49
- namespace forecastModel {
51
+ namespace realTime {
50
52
  const type_9: StringConstructor;
51
53
  export { type_9 as type };
52
54
  }
53
- namespace beforeLayer {
55
+ namespace forecastModel {
54
56
  const type_10: StringConstructor;
55
57
  export { type_10 as type };
56
58
  }
59
+ namespace beforeLayer {
60
+ const type_11: StringConstructor;
61
+ export { type_11 as type };
62
+ }
57
63
  }
58
64
  const emits: string[];
59
65
  function data(): {
@@ -113,10 +119,13 @@ declare namespace _sfc_main {
113
119
  handler(newV: any): void;
114
120
  };
115
121
  showCurrentParticle: {
116
- handler(newV: any, oldV: any): void;
122
+ handler(newV: any): void;
123
+ };
124
+ isLogin: {
125
+ handler(newV: any): void;
117
126
  };
118
127
  };
119
- function mounted(): Promise<void>;
128
+ function mounted(): void;
120
129
  namespace methods {
121
130
  function arraysEqual(arr1: any, arr2: any): boolean;
122
131
  function fetchCache(): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@idmwx/idmui-gl4",
3
3
  "private": false,
4
- "version": "0.3.5",
4
+ "version": "0.3.7",
5
5
  "description": "idm webgl4",
6
6
  "type": "module",
7
7
  "keywords": [