@idmwx/idmui-gl4 3.8.5 → 3.8.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/{chunk-3VYIPD3A-98ecbb08.js → chunk-3VYIPD3A-0288bf23.js} +1 -1
- package/dist/{chunk-ANSXOGKI-a836df13.js → chunk-ANSXOGKI-f8908b25.js} +1 -1
- package/dist/{chunk-T4JIPPZO-4866a352.js → chunk-T4JIPPZO-8cd08470.js} +1 -1
- package/dist/{download-2643c063.js → download-2923e3a4.js} +3 -3
- package/dist/{index-1f8cfea5.js → index-1e8b54cd.js} +18 -18
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/{rasterize-JS5G2XHH-1ac6547f.js → rasterize-JS5G2XHH-054abe64.js} +3 -3
- package/dist/{toBlob-b60b55dd.js → toBlob-657d5eea.js} +3 -3
- package/dist/{toCanvas-295e8484.js → toCanvas-2ee20ef2.js} +2 -2
- package/dist/{toImg-77e68994.js → toImg-4e7e4415.js} +3 -3
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as a } from "./chunk-3VYIPD3A-
|
|
1
|
+
import { W as a } from "./chunk-3VYIPD3A-0288bf23.js";
|
|
2
2
|
async function o(r, t) {
|
|
3
3
|
let i = await a(r, t), e = new Image();
|
|
4
4
|
return e.src = i.toDataURL(`image/${t.format}`, t.quality), await e.decode(), e.style.width = `${i.width / t.dpr}px`, e.style.height = `${i.height / t.dpr}px`, e;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as d } from "./chunk-T4JIPPZO-
|
|
2
|
-
import { W as f } from "./chunk-3VYIPD3A-
|
|
3
|
-
import "./index-
|
|
1
|
+
import { m as d } from "./chunk-T4JIPPZO-8cd08470.js";
|
|
2
|
+
import { W as f } from "./chunk-3VYIPD3A-0288bf23.js";
|
|
3
|
+
import "./index-1e8b54cd.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|
|
@@ -3367,7 +3367,7 @@ const dc = {
|
|
|
3367
3367
|
this.cache.v !== t && (localStorage.removeItem(this.cache.checkListKey), localStorage.removeItem(this.cache.followListKey), localStorage.removeItem(this.cache.mapFeatherKey), localStorage.removeItem(this.cache.nauticalKey), localStorage.setItem(this.cache.versionKey, this.cache.v));
|
|
3368
3368
|
let e = localStorage.getItem(this.cache.checkListKey);
|
|
3369
3369
|
this.checkList = JSON.parse(e || '["eca-zones"]'), localStorage.setItem(this.cache.checkListKey, JSON.stringify(this.checkList)), e = localStorage.getItem(this.cache.mapFeatherKey);
|
|
3370
|
-
const a = this.featherOptions.some((o) => o.value === e && !o.hide) ? e : ((i = this.featherOptions.find((o) => o.value === e)) == null ? void 0 : i.replace) || "dark";
|
|
3370
|
+
const a = this.featherOptions.some((o) => o.value === e && !o.hide) ? e : ((i = this.featherOptions.find((o) => o.value === e)) == null ? void 0 : i.replace) || this.mapFeather || "dark";
|
|
3371
3371
|
this.$emit("mapFeather", a), localStorage.setItem(this.cache.mapFeatherKey, a);
|
|
3372
3372
|
},
|
|
3373
3373
|
handleMenuToggle() {
|
|
@@ -3501,7 +3501,7 @@ function Ac(t, e, a, i, o, r) {
|
|
|
3501
3501
|
default: x(() => [
|
|
3502
3502
|
w(c, { class: "text-h6" }, {
|
|
3503
3503
|
default: x(() => [
|
|
3504
|
-
N(b(t.$t("layer.
|
|
3504
|
+
N(b(t.$t("layer.mapFeathers")), 1)
|
|
3505
3505
|
]),
|
|
3506
3506
|
_: 1
|
|
3507
3507
|
})
|
|
@@ -17802,52 +17802,52 @@ Te.capture = async (t, e, a) => {
|
|
|
17802
17802
|
if (a !== tl)
|
|
17803
17803
|
throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");
|
|
17804
17804
|
let i = await el(t, e), o = { img: async (u, h) => {
|
|
17805
|
-
let { toImg: y } = await import("./toImg-
|
|
17805
|
+
let { toImg: y } = await import("./toImg-4e7e4415.js");
|
|
17806
17806
|
return y(i, { ...u, ...h || {} });
|
|
17807
17807
|
}, svg: async (u, h) => {
|
|
17808
|
-
let { toSvg: y } = await import("./toImg-
|
|
17808
|
+
let { toSvg: y } = await import("./toImg-4e7e4415.js");
|
|
17809
17809
|
return y(i, { ...u, ...h || {} });
|
|
17810
17810
|
}, canvas: async (u, h) => {
|
|
17811
|
-
let { toCanvas: y } = await import("./toCanvas-
|
|
17811
|
+
let { toCanvas: y } = await import("./toCanvas-2ee20ef2.js");
|
|
17812
17812
|
return y(i, { ...u, ...h || {} });
|
|
17813
17813
|
}, blob: async (u, h) => {
|
|
17814
|
-
let { toBlob: y } = await import("./toBlob-
|
|
17814
|
+
let { toBlob: y } = await import("./toBlob-657d5eea.js");
|
|
17815
17815
|
return y(i, { ...u, ...h || {} });
|
|
17816
17816
|
}, png: async (u, h) => {
|
|
17817
|
-
let { rasterize: y } = await import("./rasterize-JS5G2XHH-
|
|
17817
|
+
let { rasterize: y } = await import("./rasterize-JS5G2XHH-054abe64.js");
|
|
17818
17818
|
return y(i, { ...u, ...h || {}, format: "png" });
|
|
17819
17819
|
}, jpeg: async (u, h) => {
|
|
17820
|
-
let { rasterize: y } = await import("./rasterize-JS5G2XHH-
|
|
17820
|
+
let { rasterize: y } = await import("./rasterize-JS5G2XHH-054abe64.js");
|
|
17821
17821
|
return y(i, { ...u, ...h || {}, format: "jpeg" });
|
|
17822
17822
|
}, webp: async (u, h) => {
|
|
17823
|
-
let { rasterize: y } = await import("./rasterize-JS5G2XHH-
|
|
17823
|
+
let { rasterize: y } = await import("./rasterize-JS5G2XHH-054abe64.js");
|
|
17824
17824
|
return y(i, { ...u, ...h || {}, format: "webp" });
|
|
17825
17825
|
}, download: async (u, h) => {
|
|
17826
|
-
let { download: y } = await import("./download-
|
|
17826
|
+
let { download: y } = await import("./download-2923e3a4.js");
|
|
17827
17827
|
return y(i, { ...u, ...h || {} });
|
|
17828
17828
|
} }, r = { ...e, export: { url: i }, exports: { svg: async (u) => {
|
|
17829
|
-
let { toSvg: h } = await import("./toImg-
|
|
17829
|
+
let { toSvg: h } = await import("./toImg-4e7e4415.js");
|
|
17830
17830
|
return h(i, { ...e, ...u || {}, [da]: !0 });
|
|
17831
17831
|
}, canvas: async (u) => {
|
|
17832
|
-
let { toCanvas: h } = await import("./toCanvas-
|
|
17832
|
+
let { toCanvas: h } = await import("./toCanvas-2ee20ef2.js");
|
|
17833
17833
|
return h(i, { ...e, ...u || {}, [da]: !0 });
|
|
17834
17834
|
}, png: async (u) => {
|
|
17835
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
17835
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-054abe64.js");
|
|
17836
17836
|
return h(i, { ...e, ...u || {}, format: "png", [da]: !0 });
|
|
17837
17837
|
}, jpeg: async (u) => {
|
|
17838
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
17838
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-054abe64.js");
|
|
17839
17839
|
return h(i, { ...e, ...u || {}, format: "jpeg", [da]: !0 });
|
|
17840
17840
|
}, jpg: async (u) => {
|
|
17841
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
17841
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-054abe64.js");
|
|
17842
17842
|
return h(i, { ...e, ...u || {}, format: "jpeg", [da]: !0 });
|
|
17843
17843
|
}, webp: async (u) => {
|
|
17844
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
17844
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-054abe64.js");
|
|
17845
17845
|
return h(i, { ...e, ...u || {}, format: "webp", [da]: !0 });
|
|
17846
17846
|
}, blob: async (u) => {
|
|
17847
|
-
let { toBlob: h } = await import("./toBlob-
|
|
17847
|
+
let { toBlob: h } = await import("./toBlob-657d5eea.js");
|
|
17848
17848
|
return h(i, { ...e, ...u || {}, [da]: !0 });
|
|
17849
17849
|
}, img: async (u) => {
|
|
17850
|
-
let { toImg: h } = await import("./toImg-
|
|
17850
|
+
let { toImg: h } = await import("./toImg-4e7e4415.js");
|
|
17851
17851
|
return h(i, { ...e, ...u || {}, [da]: !0 });
|
|
17852
17852
|
} } }, l = await qf("defineExports", r), s = Object.assign({}, ...l.filter((u) => u && typeof u == "object")), c = { ...o, ...s };
|
|
17853
17853
|
c.jpeg && !c.jpg && (c.jpg = (u, h) => c.jpeg(u, h));
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as g, c as n, D as x, L as D, a as T, b as W, M as h, f, e as k, P as y, S as B, T as V, V as d, W as u, d as v } from "./index-
|
|
1
|
+
import { B as g, c as n, D as x, L as D, a as T, b as W, M as h, f, e as k, P as y, S as B, T as V, V as d, W as u, d as v } from "./index-1e8b54cd.js";
|
|
2
2
|
import "axios";
|
|
3
3
|
import "vuetify";
|
|
4
4
|
import "vue";
|
package/dist/index.umd.cjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<span style="display:inline-block; height: 8px;width: 8px;border-radius: 50%;background-color: ${l.color}"></span>
|
|
8
8
|
<span>${l.seriesName} : </span>
|
|
9
9
|
<strong>${l.value[1]}m</strong>
|
|
10
|
-
</div>`)}),r}},legend:{show:!0,right:20,top:0,itemWidth:30,data:["Height"],textStyle:{color:this.Theme.current.value.colors["on-surface"]}},grid:{top:40,left:10,right:10,bottom:30,containLabel:!0},xAxis:[{type:"category",data:this.xDate,boundaryGap:!0,axisTick:{alignWithLabel:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLabel:{interval:"auto",margin:15,textStyle:{fontSize:12,color:this.Theme.current.value.colors["echart-axis"]}}}],yAxis:[{name:"(m)",show:!0,nameLocation:"end",position:"left",nameGap:15,splitNumber:5,splitLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-split"]}},alignTicks:!0,axisLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLabel:{textStyle:{fontSize:12,color:this.Theme.current.value.colors["echart-axis"]}}}],series:[{name:"Height",type:"line",showSymbol:!0,yAxisIndex:0,lineStyle:{color:this.Theme.current.value.colors["map-perple"]},itemStyle:{color:this.Theme.current.value.colors["map-perple"]},data:this.echartData.height}]};t==null||t.setOption(e)},handleClose(){this.$emit("close")}}},es={class:"d-flex justify-space-between align-center"},ts={class:"d-flex justify-start text-h5 my-2"},os={class:"d-flex justify-start align-center text-h6 text-label ga-3"},as={class:"summary-box w-100"},is={class:"d-flex justify-space-between align-center py-2"},rs={class:"d-flex justify-center align-center text-h6 ga-2"},ls={class:"multi-color-icon","aria-hidden":"true"},ns=["xlink:href"],ss={class:"gray-bg-2 rounded d-flex flex-column ga-4 pa-4"},cs={class:"w-100 d-flex justify-start align-center"},ms={class:"w-30 text-label font-weight-400"},ds={class:"flex-1-1-0"},hs={class:"w-100 d-flex justify-start align-center"},ps={class:"w-30 text-label font-weight-400"},gs={class:"flex-1-1-0"},us={class:"w-100 d-flex justify-start align-center"},fs={class:"w-30 text-label font-weight-400"},ys={class:"flex-1-1-0"},bs={class:"table-box w-100 mt-2 mb-4 d-flex flex-column justify-start align-center"},ws={class:"w-100 d-flex justify-space-between align-center py-2"},xs={class:"d-flex justify-center align-center text-h6 ga-2"},ks={class:"multi-color-icon","aria-hidden":"true"},As=["xlink:href"],Ls={ref:"tideEchart",class:"w-100",style:{height:"244px"}},vs={"fixed-header":"",density:"compact",class:"w-100 tide-table bg-none"},Cs={class:"px-1 text-center text-label font-weight-400",width:"120"},zs={class:"px-1 text-center text-label font-weight-400",width:"120"},_s={class:"px-1 text-center text-label font-weight-400",width:"120"},Ss={class:"px-1 text-center"},Ps={class:"px-1 text-center"},Ns={class:"px-1 text-center"};function Ms(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),s=o.resolveComponent("VCardTitle"),c=o.resolveComponent("VDivider"),m=o.resolveComponent("VBtnToggle"),d=o.resolveComponent("VCard");return o.openBlock(),o.createBlock(d,{class:o.normalizeClass(["tide-detail-container d-flex flex-column justify-start align-center",a.simple?"page":"dialog"])},{default:o.withCtx(()=>{var u,f;return[o.createVNode(s,{class:"w-100"},{default:o.withCtx(()=>{var g;return[o.createElementVNode("div",es,[o.createElementVNode("div",ts,[o.createElementVNode("div",null,o.toDisplayString((g=a.station)==null?void 0:g.name),1)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"",onClick:l.handleClose},{default:o.withCtx(()=>e[1]||(e[1]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[1]},8,["onClick"])]),o.createElementVNode("div",os,[o.createElementVNode("div",null,o.toDisplayString(t.$t("tide.tideStation")),1)])]}),_:1}),o.createVNode(c,{class:"w-100"}),o.createElementVNode("div",{class:o.normalizeClass(["w-100 pt-0 pb-0 overflow-y-auto scroll",a.simple?"px-3":"px-5"])},[o.createElementVNode("div",as,[o.createElementVNode("div",is,[o.createElementVNode("div",rs,[(o.openBlock(),o.createElementBlock("svg",ls,[o.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,ns)])),o.createElementVNode("div",null,o.toDisplayString(t.$t("detail.summary")),1)])]),o.createElementVNode("div",ss,[o.createElementVNode("div",cs,[o.createElementVNode("div",ms,o.toDisplayString(t.$t("tide.region")),1),o.createElementVNode("div",ds,o.toDisplayString(((u=a.station)==null?void 0:u.Country)??((f=a.station)==null?void 0:f.city)??"-"),1)]),o.createElementVNode("div",hs,[o.createElementVNode("div",ps,o.toDisplayString(t.$t("tide.position")),1),o.createElementVNode("div",gs,o.toDisplayString(l.computePosition(a.station)),1)]),o.createElementVNode("div",us,[o.createElementVNode("div",fs,o.toDisplayString(t.$t("time.localTime")),1),o.createElementVNode("div",ys,o.toDisplayString(l.computeLocalTime(a.realTime,a.station))+" "+o.toDisplayString(l.computeTimeOffset(a.station)),1)])])]),o.createElementVNode("div",bs,[o.createElementVNode("div",ws,[o.createElementVNode("div",xs,[(o.openBlock(),o.createElementBlock("svg",ks,[o.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,As)])),o.createElementVNode("div",null,o.toDisplayString(t.$t("tide.tideTimes")),1)]),e[2]||(e[2]=o.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),o.createElementVNode("div",{class:o.normalizeClass(["w-100 gray-bg-2 rounded",a.simple?"pa-2":"pa-4 py-2"])},[o.createVNode(m,{modelValue:i.currentIndex,"onUpdate:modelValue":e[0]||(e[0]=g=>i.currentIndex=g),class:"w-100 d-flex justify-space-around align-center ga-0 mb-4",density:"compact",group:"",height:"26","min-height":"26",rounded:"1",mandatory:""},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.dateList,g=>(o.openBlock(),o.createBlock(n,{key:g.label,class:o.normalizeClass(["text-none text-body-1 flex-1-1-0",`bg-${g.index===i.currentIndex?"bg-primary":"gray-bg-2"}`]),density:"compact",color:"primary",height:"26",value:g.index},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(g.label),1)]),_:2},1032,["class","value"]))),128))]),_:1},8,["modelValue"]),o.createElementVNode("div",Ls,null,512),o.createElementVNode("table",vs,[o.createElementVNode("tbody",null,[o.createElementVNode("tr",null,[o.createElementVNode("th",Cs,o.toDisplayString(t.$t("tide.tide")),1),o.createElementVNode("th",zs,o.toDisplayString(t.$t("time.time"))+" ( LT ) ",1),o.createElementVNode("th",_s,o.toDisplayString(t.$t("tide.height"))+" ( m )",1)]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tideTableData,(g,p)=>{var h;return o.openBlock(),o.createElementBlock("tr",{key:p},[o.createElementVNode("td",Ss,o.toDisplayString(t.$t(`tide.${(h=g==null?void 0:g.type)==null?void 0:h.toLowerCase()}`))+" "+o.toDisplayString(t.$t("tide.tide")),1),o.createElementVNode("td",Ps,o.toDisplayString(l.computeLocalTime(g==null?void 0:g.date,a.station,"MM-DD HH:mm")),1),o.createElementVNode("td",Ns,o.toDisplayString((g==null?void 0:g.height)??"-")+" m",1)])}),128))])])],2)])],2)]}),_:1},8,["class"])}const Ts=K($n,[["render",Ms],["__scopeId","data-v-5c51381d"]]),q1="",Vs={name:"IdmTideStations",components:{TideDetail:Ts},props:{map:{type:Object},show:{type:Boolean},locale:{type:String},beforeLayer:{type:String}},data(){return{layer:"tide-stations",showInfo:!1,hoverStation:void 0,marker:null,showDetail:!1,station:void 0}},watch:{show:{handler(){var t,e,a,r,i,l;this.show?(this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):(this.handleClear(),(r=this.map)==null||r.off("click",[this.layer],this.handleClick),(i=this.map)==null||i.off("mousemove",[this.layer],this.handleHover),(l=this.map)==null||l.off("mouseleave",[this.layer],this.handleLeave))},immediate:!0},locale:{handler(){this.show&&this.handleRender()},immediate:!0}},methods:{handleRender(){var t;(t=this.map)!=null&&t.getLayer(this.layer)&&(this.map.setLayoutProperty(this.layer,"visibility","visible"),this.map.setLayoutProperty(this.layer,"text-field",this.locale==="en"?"{Location_EN}":"{Location_CN}"))},handleClear(){var t;this.showInfo=!1,(t=this.map)!=null&&t.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none")},handleClick(t){const e=t.features[0];e.properties&&(this.station=e.properties,this.station.name=this.locale==="en"?e.properties.Location_EN:e.properties.Location_CN,this.station.lng=e.geometry.coordinates[0],this.station.lat=e.geometry.coordinates[1],this.showDetail=!0)},handleHover(t){var a,r;this.map.getCanvas().style.cursor="pointer";const e=t.features[0];if(e.properties){this.showInfo=!0,this.hoverStation=e.properties,this.hoverStation.name=this.locale==="en"?e.properties.Location_EN:e.properties.Location_CN,this.hoverStation.lng=e.geometry.coordinates[0],this.hoverStation.lat=e.geometry.coordinates[1],(a=this.marker)==null||a.remove();const i=(r=document.getElementById("idmTidalInfo"))==null?void 0:r.cloneNode(!0);this.marker=new pe.Marker(i).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-60]).addTo(this.map)}},handleLeave(){var t;this.showInfo=!1,this.hoverStation={},(t=this.marker)==null||t.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Es={class:"station-box d-flex flex-column justify-center align-start ga-1"},Rs={class:"d-flex justify-start align-center"},Ds={class:"d-flex justify-start align-center"},Bs={class:"text-label"};function Is(t,e,a,r,i,l){const n=o.resolveComponent("VCardText"),s=o.resolveComponent("VCard"),c=o.resolveComponent("TideDetail");return o.openBlock(),o.createElementBlock("div",null,[o.withDirectives(o.createVNode(s,{id:"idmTidalInfo"},{default:o.withCtx(()=>[o.createVNode(n,{class:"pr-8 text-body-1"},{default:o.withCtx(()=>{var m,d;return[o.createElementVNode("div",Es,[o.createElementVNode("div",Rs,o.toDisplayString(t.$t("tide.tideStation")),1),o.createElementVNode("div",Ds,[o.createElementVNode("label",Bs,o.toDisplayString((m=i.hoverStation)==null?void 0:m.name)+" , "+o.toDisplayString(((d=i.hoverStation)==null?void 0:d.Country)||"-"),1)])])]}),_:1})]),_:1},512),[[o.vShow,i.showInfo]]),i.showDetail?(o.openBlock(),o.createBlock(c,o.mergeProps({key:0,station:i.station},t.$attrs,{onClose:l.handleCloseDetail}),null,16,["station","onClose"])):o.createCommentVNode("",!0)])}const Fs=K(Vs,[["render",Is],["__scopeId","data-v-ad725d5e"]]),Gs={name:"IdmIceAreas",props:{map:{type:Object},show:{type:Boolean}},data(){return{lineLayer:"ice-area-line",fillLayer:"ice-area-fill"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t,e;(t=this.map)!=null&&t.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","visible"),(e=this.map)!=null&&e.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","visible")},handleClear(){var t,e;(t=this.map)!=null&&t.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","none"),(e=this.map)!=null&&e.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","none")}}};function js(t,e,a,r,i,l){return null}const Ws=K(Gs,[["render",js]]),$1="",Zs={name:"IdmLatLng",props:{simple:{type:Boolean,default:!1},map:{type:Object},show:{type:Boolean},mapFeather:{type:String},beforeLayer:{type:String},menuToggle:{type:Object}},data(){return{lngLat:{e:{lng:0,lat:0},lng:0,lat:0,str:""},source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},computed:{lineColor(){return["satellite","dark"].includes(this.mapFeather)?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.3)"},labelColor(){return["satellite","dark"].includes(this.mapFeather)?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.5)"}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var t;this.map&&((t=this.map)==null||t.on("mousemove",this.handleMouseMove))},immediate:!0},"menuToggle.v":{handler(){var t;this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10},immediate:!0},"lngLat.e":{handler(t){this.lngLat.lng=P.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty,this.lngLat.lat=P.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty,this.lngLat.str=`[${P.LngLatHelper.str2Lat(t==null?void 0:t.lat,4)}, ${P.LngLatHelper.str2Lng(t==null?void 0:t.lng,4)}]`},immediate:!0}},methods:{handleBind(){var t,e;this.show?((t=this.map)==null||t.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(t){this.lngLat.e=t.lngLat},handleComputeLatLngs(){var r;const t=(r=this.map)==null?void 0:r.getZoom();let e=30;t>4?e=10:t>3&&(e=15);const a=[];for(let i=-60;i<90;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,i],[180,i]]}});for(let i=-180;i<180;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[i,-90],[i,90]]}});for(let i=180;i>-180;i-=e)for(let l=-60;l<90;l+=e)a.push({type:"Feature",geometry:{type:"Point",coordinates:[i,l]},properties:{val:`${l>0?l+" N":l===0?l:l*-1+" S"}, ${i>0?i+" E":i*-1+" W"}`}});return a},handleZoomEnd(){var e;const t=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(V.featureCollection(t))},handleRender(){if(this.handleClear(),this.map){const t=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:t}}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":this.lineColor,"line-width":1}},this.beforeLayer),this.map.addLayer({id:this.labelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{val}","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":1,"text-color":this.labelColor}},this.beforeLayer)}},handleClear(){var t,e,a,r,i,l;(t=this.map)!=null&&t.getLayer(this.layer)&&((e=this.map)==null||e.removeLayer(this.layer)),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&((r=this.map)==null||r.removeLayer(this.labelLayer)),(i=this.map)!=null&&i.getSource(this.source)&&((l=this.map)==null||l.removeSource(this.source))}}};function Hs(t,e,a,r,i,l){var n,s,c;return a.simple?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:"idm-lat-lng-tip-gl4 pa-2 py-1 text-caption text-right rounded",style:o.normalizeStyle({right:i.right+"px"})},[o.createElementVNode("div",null,o.toDisplayString((n=i.lngLat)==null?void 0:n.lat),1),o.createElementVNode("div",null,o.toDisplayString((s=i.lngLat)==null?void 0:s.lng),1),o.createElementVNode("div",null,o.toDisplayString((c=i.lngLat)==null?void 0:c.str),1)],4))}const Xo=K(Zs,[["render",Hs]]),eb="",Xs={name:"IdmFollowPort",components:{PortDetail:Eo},props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array}},emits:["closeAllDetail"],setup(){return{Theme:be.useTheme()}},data(){return{source:"follow-port-source",layer:"follow-port-layer",showInfo:!1,portId:"",hoverPort:{},port:{},marker:void 0,showDetail:!1}},watch:{show:{handler(){var t,e,a;this.show?(this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var t,e,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var e,a;const t={features:[],type:"FeatureCollection"};(e=this.followList)==null||e.forEach(r=>{var i;if((i=r.port)!=null&&i.id){const l=r.port,n={type:"Feature",properties:l,geometry:{type:"Point",coordinates:[l.lng,l.lat]}};t.features.push(n)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(t):(this.map.addSource(this.source,{type:"geojson",data:t}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1,"icon-image":"port","icon-offset":[0,-13],"text-anchor":"bottom","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1.6]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var t,e,a;this.showInfo=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)},handleClick(t){const e=t.features[0];this.portId=e.properties.id,e.properties.id&&(this.port=e.properties,this.port.lng=e.geometry.coordinates[0],this.port.lat=e.geometry.coordinates[1],this.port.forecastModel=this.forecastModel,this.showDetail=!0)},handleHover(t){var r,i;this.map.getCanvas().style.cursor="pointer";const e=t.features[0];if(e.properties.id){this.showInfo=!0,this.hoverPort=e.properties,(r=this.marker)==null||r.remove();const l=(i=document.getElementById("idmFollowPortInfo"))==null?void 0:i.cloneNode(!0);this.marker=new pe.Marker(l).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var t;this.showInfo=!1,this.hoverPort={},(t=this.marker)==null||t.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Os={class:"port-box d-flex flex-column justify-center align-start ga-1"},Ys={class:"d-flex justify-start align-center text-label"},Us={class:"d-flex justify-start align-center text-label"};function Js(t,e,a,r,i,l){const n=o.resolveComponent("VCardText"),s=o.resolveComponent("VCard"),c=o.resolveComponent("PortDetail");return o.openBlock(),o.createElementBlock("div",null,[o.withDirectives(o.createVNode(s,{id:"idmFollowPortInfo",ref:"idmFollowPortInfo"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-body-1 pr-8"},{default:o.withCtx(()=>[o.createElementVNode("div",Os,[o.createElementVNode("div",null,o.toDisplayString(t.$t("port.port")),1),o.createElementVNode("div",Ys,[o.createElementVNode("span",null,o.toDisplayString(i.hoverPort.name??"-"),1)]),o.createElementVNode("div",Us,[e[1]||(e[1]=o.createElementVNode("label",{class:"pr-1"},"LoCode : ",-1)),o.createElementVNode("span",null,o.toDisplayString(i.hoverPort.loCode??"-"),1)])])]),_:1})]),_:1},512),[[o.vShow,i.showInfo]]),i.showDetail?(o.openBlock(),o.createBlock(c,o.mergeProps({key:0,"port-id":i.portId,port:i.port,"forecast-model":a.forecastModel,"follow-list":a.followList},t.$attrs,{onClose:l.handleCloseDetail,onCloseAllDetail:e[0]||(e[0]=m=>t.$emit("closeAllDetail",{followPort:!0}))}),null,16,["port-id","port","forecast-model","follow-list","onClose"])):o.createCommentVNode("",!0)])}const Ks=K(Xs,[["render",Js],["__scopeId","data-v-9b28c4ea"]]),tb="",Qs={name:"IdmFollowPosition",props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array},realTime:{type:String}},setup(){return{Theme:be.useTheme()}},data(){return{source:"follow-coordinate-source",layer:"follow-coordinate-layer",position:{},showInfo:!1,marker:null}},computed:{computePosition(){return function(t){return!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat)?"-":P.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty+" / "+P.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty}}},watch:{show:{handler(){var t,e,a;this.show?(this.handleClear(),this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var t,e,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var e,a;const t={features:[],type:"FeatureCollection"};(e=this.followList)==null||e.forEach(r=>{if(r.coordinate){const i=r.coordinate,l={type:"Feature",properties:{id:r.id,remark:r.remark,...r.coordinate},geometry:{type:"Point",coordinates:[i.lng,i.lat]}};t.features.push(l)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(t):(this.map.addSource(this.source,{type:"geojson",data:t}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1.1,"icon-image":"location","icon-offset":[0,-16]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var t,e,a;this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(t=this.map)==null||t.off("click",[this.layer],this.handleClick),(e=this.map)==null||e.off("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.off("mouseleave",[this.layer],this.handleLeave)},handleClick(t){var a,r,i,l,n,s,c,m,d;const e=t.features[0];if(e.properties){const u=e.properties;u.lng=e.geometry.coordinates[0],u.lat=e.geometry.coordinates[1];const f=z(),g=(a=z(this.realTime))==null?void 0:a.diff(f,"d",!0),p={followId:u.id,lat:u.lat,lng:u.lng,datetime:this.realTime,forecastModel:this.forecastModel};g>=0?(n=(l=(i=(r=this.$parent)==null?void 0:r.$parent)==null?void 0:i.$refs)==null?void 0:l.idmSpot)==null||n.fetchForecastData(p):(d=(m=(c=(s=this.$parent)==null?void 0:s.$parent)==null?void 0:c.$refs)==null?void 0:m.idmSpot)==null||d.fetchHistoryData(p)}},handleHover(t){var a;this.map.getCanvas().style.cursor="pointer";const e=t.features[0];if(e.properties.id){this.showInfo=!0,this.position=e.properties,(a=this.marker)==null||a.remove();const r=document.getElementById("idmFollowPositionInfo").cloneNode(!0);this.marker=new pe.Marker(r).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var t;this.showInfo=!1,(t=this.marker)==null||t.remove(),this.map.getCanvas().style.cursor="grab"}}},qs={class:"position-box d-flex flex-column justify-center align-start ga-1"},$s={class:"d-flex justify-start align-center text-label"},ec={key:0,class:"d-flex justify-start align-center text-label"};function tc(t,e,a,r,i,l){const n=o.resolveComponent("VCardText"),s=o.resolveComponent("VCard");return o.withDirectives((o.openBlock(),o.createBlock(s,{id:"idmFollowPositionInfo",ref:"idmFollowPositionInfo"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-body-1 pr-8"},{default:o.withCtx(()=>[o.createElementVNode("div",qs,[e[0]||(e[0]=o.createElementVNode("div",null,"Location",-1)),o.createElementVNode("div",$s,[o.createElementVNode("span",null,o.toDisplayString(l.computePosition(i.position)),1)]),i.position.remark?(o.openBlock(),o.createElementBlock("div",ec,[o.createElementVNode("span",null,o.toDisplayString(i.position.remark??"-"),1)])):o.createCommentVNode("",!0)])]),_:1})]),_:1},512)),[[o.vShow,i.showInfo]])}const oc=K(Qs,[["render",tc],["__scopeId","data-v-1de14e27"]]),ob="",ac={name:"IdmOtherLayerr",components:{IdmWarZone:rl,IdmGmdssArea:sl,IdmEcaZone:dl,IdmAlertZone:ul,IdmPort:Cn,IdmLoadLine:Sn,IdmTimezone:Mn,IdmVRA:En,IdmSpecialArea:Bn,IdmTerminator:Gn,IdmWorld12nm:Zn,IdmWorldMarine:On,IdmChinaRoute:Jn,IdmNsrAreas:qn,IdmTideStations:Fs,IdmIceAreas:Ws,IdmLatLng:Xo,IdmFollowPort:Ks,IdmFollowPosition:oc},props:{simple:{type:Boolean,default:!1},map:{type:Object},theme:{type:String},token:{type:String},isLogin:{type:Boolean,default:!1},defaultMeteoToken:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},top:{type:Number,default:0},paddingTop:{type:Number,default:8},menuHeight:{type:Number,default:248},menuToggle:{type:Object,default:{}},ts:{type:String},forecastModel:{type:String},realTime:{type:String},platform:{type:String},mapFeather:{type:String}},emits:["map","other","menuToggle","mapFeather","theme","followLayerList","otherCheckList"],data(){return{right:10,toggle:!1,mapboxFeather:void 0,tagLayers:[...no.LayerHelper.OTHER_LAYERS.filter(t=>t.enabled)],layerWeight:0,otherLayers:{},activeOtherLayers:[],cache:{v:"0.0.4",versionKey:"otherLayerCacheVersionGL4",checkListKey:"otherChecklistCacheGL4",followListKey:"otherFollowListCacheGL4",mapFeatherKey:"mapFeathersCacheGL4",nauticalKey:"nauticalLayerCacheGL4"},featherOptions:[{name:"Light Map",value:"light",locale:"lightMap"},{name:"Dark Map",value:"dark",locale:"darkMap"},{name:"Satelite Map",value:"satellite",locale:"satelliteMap",hide:this.platform==="ops",replace:"dark"},{name:"Nautical Map",value:"nautical",locale:"nauticalMap",hide:this.platform==="ops",replace:"light"}],checkList:[]}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}:{top:this.top+"px",right:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.otherLayers,this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},realTime:{handler(t,e){t&&e&&t!==e&&this.checkList.includes("day-night")&&this.fetchDayNightLayer()}},theme:{handler(){this.theme==="light"?this.mapboxFeather=["light","nautical"].includes(this.mapboxFeather)?this.mapboxFeather:"light":this.theme==="dark"&&(this.mapboxFeather=["dark","satellite"].includes(this.mapboxFeather)?this.mapboxFeather:"dark")}},mapFeather:{handler(t,e){t!==e&&(this.mapboxFeather=this.mapFeather)},immediate:!0},mapboxFeather:{handler(){localStorage.setItem(this.cache.mapFeatherKey,this.mapboxFeather),this.$emit("mapFeather",this.mapboxFeather),this.$emit("theme",["light","nautical"].includes(this.mapboxFeather)?"light":"dark")},immediate:!0},checkList:{handler(t,e){localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),this.activeOtherLayers=this.tagLayers.filter(l=>this.checkList.includes(l.key))||[];const a=t==null?void 0:t.filter(l=>!(e!=null&&e.includes(l))),r=e==null?void 0:e.filter(l=>!(t!=null&&t.includes(l))),i=t==null?void 0:t.filter(l=>e==null?void 0:e.includes(l));if((r==null?void 0:r.length)>0&&r.forEach(l=>{this.otherLayers[l]=void 0,delete this.otherLayers[l]}),(a==null?void 0:a.length)>0){const l=this.tagLayers.filter(n=>this.checkList.includes(n.key)&&!i.includes(n.key))||[];this.handleLayersChange(l)}this.$emit("otherCheckList",this.checkList)}}},async mounted(){this.fetchCache()},methods:{fetchCache(){var r;const t=localStorage.getItem(this.cache.versionKey);this.cache.v!==t&&(localStorage.removeItem(this.cache.checkListKey),localStorage.removeItem(this.cache.followListKey),localStorage.removeItem(this.cache.mapFeatherKey),localStorage.removeItem(this.cache.nauticalKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let e=localStorage.getItem(this.cache.checkListKey);this.checkList=JSON.parse(e||'["eca-zones"]'),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),e=localStorage.getItem(this.cache.mapFeatherKey);const a=this.featherOptions.some(i=>i.value===e&&!i.hide)?e:((r=this.featherOptions.find(i=>i.value===e))==null?void 0:r.replace)||"dark";this.$emit("mapFeather",a),localStorage.setItem(this.cache.mapFeatherKey,a)},handleMenuToggle(){this.$emit("menuToggle","otherLayers")},handleToggleMapFeather(t){this.mapboxFeather=t.value},async fetchOtherLayers(){var e,a;let t=this.layerWeight;if(t){const r=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],i=await he.get(`${r}/api/arc/other/layers/links?l=${t}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(((e=i==null?void 0:i.data)==null?void 0:e.code)===0){const l=(a=i==null?void 0:i.data)==null?void 0:a.data,n=[];for(const c in l)n.push(he.get(l[c],{headers:{Authorization:this.defaultMeteoToken,key:c}}));(await Promise.all(n)).map(c=>{var u,f,g;const m=((u=c==null?void 0:c.data)==null?void 0:u.data)||(c==null?void 0:c.data),d=(g=(f=c==null?void 0:c.config)==null?void 0:f.headers)==null?void 0:g.key;this.otherLayers[d]=m})}}},async fetchDayNightLayer(){var a,r;const t=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],e=await he.get(`${t}/api/arc/other/layers/links?l=1024&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});((a=e==null?void 0:e.data)==null?void 0:a.code)===0&&(this.otherLayers["day-night"]=((r=e==null?void 0:e.data)==null?void 0:r.data)||(e==null?void 0:e.data))},handleLayersChange(t){const e=t==null?void 0:t.reduce((a,r)=>a+(r==null?void 0:r.weight),0);this.layerWeight=e,this.fetchOtherLayers()}}},ic={class:"idm-gl4-other-layer"},rc={class:"header-box w-100 d-flex justify-space-between align-center px-4"},lc={class:"text-h5 font-weight-medium"},nc={class:"layers-body mt-4 mb-2 d-flex justify-start align-center flex-wrap"},sc=["onClick"],cc={key:0,src:"https://ossimg.ormwx.com/asset/dark-map.png",class:"border rounded-sm"},mc={key:1,src:"https://ossimg.ormwx.com/asset/nautical-map.png",class:"border rounded-sm"},dc={key:2,src:"https://ossimg.ormwx.com/asset/satellite-map.png",class:"border rounded-sm"},hc={key:3,src:"https://ossimg.ormwx.com/asset/light-map.png",class:"border rounded-sm"},pc={class:"text-body-2 text-center pt-2"};function gc(t,e,a,r,i,l){var le,S,W,Z,ee,j,B,J,E;const n=o.resolveComponent("VBtn"),s=o.resolveComponent("VTooltip"),c=o.resolveComponent("VCardTitle"),m=o.resolveComponent("VCardItem"),d=o.resolveComponent("VCheckbox"),u=o.resolveComponent("VCardText"),f=o.resolveComponent("VCard"),g=o.resolveComponent("IdmPort"),p=o.resolveComponent("IdmTideStations"),h=o.resolveComponent("IdmLatLng"),y=o.resolveComponent("IdmTerminator"),k=o.resolveComponent("IdmTimezone"),x=o.resolveComponent("IdmAlertZone"),b=o.resolveComponent("IdmEcaZone"),A=o.resolveComponent("IdmWarZone"),v=o.resolveComponent("IdmGmdssArea"),L=o.resolveComponent("IdmLoadLine"),C=o.resolveComponent("IdmWorldMarine"),_=o.resolveComponent("IdmVRA"),N=o.resolveComponent("IdmSpecialArea"),M=o.resolveComponent("IdmWorld12nm"),T=o.resolveComponent("IdmChinaRoute"),I=o.resolveComponent("IdmIceAreas"),X=o.resolveComponent("IdmNsrAreas"),Q=o.resolveComponent("IdmFollowPort"),q=o.resolveComponent("IdmFollowPosition");return o.openBlock(),o.createElementBlock("div",ic,[o.createElementVNode("div",{class:o.normalizeClass(["menu-bar-box transition px-1 rounded",a.simple?"simple":""]),style:o.normalizeStyle({top:a.top+10+"px",right:i.right+"px",paddingTop:a.paddingTop+"px",height:a.menuHeight+"px"})},[o.createVNode(s,{text:t.$t("layer.mapLayers"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:O})=>[o.createVNode(n,o.mergeProps(O,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[5]||(e[5]=[o.createElementVNode("i",{class:"iconfont icon-Layer text-h4"},null,-1)])),_:2,__:[5]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],6),o.createElementVNode("div",{class:o.normalizeClass(["available-layers transition d-flex flex-column justify-start align-start",i.toggle?"right-bar":""]),style:o.normalizeStyle(l.listStyle)},[o.createElementVNode("div",rc,[o.createElementVNode("div",lc,o.toDisplayString(t.$t("layer.layers")),1),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:o.withCtx(()=>e[6]||(e[6]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[6]},8,["onClick"])]),o.createElementVNode("div",{class:o.normalizeClass(["list-box w-100 flex-1-1-0 scroll overflow-y-auto",a.simple?"px-3":"pl-4 pr-2"])},[o.createVNode(f,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.featherOptions")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"pb-2"},{default:o.withCtx(()=>{var O;return[o.createElementVNode("div",nc,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((O=i.featherOptions)==null?void 0:O.filter($=>!$.hide),$=>(o.openBlock(),o.createElementBlock("div",{key:$.value,class:"mb-4 feather-item",onClick:de=>l.handleToggleMapFeather($)},[o.createElementVNode("div",{class:o.normalizeClass([i.mapboxFeather===$.value?"active":"","img-box"])},[$.value==="dark"?(o.openBlock(),o.createElementBlock("img",cc)):$.value==="nautical"?(o.openBlock(),o.createElementBlock("img",mc)):$.value==="satellite"?(o.openBlock(),o.createElementBlock("img",dc)):(o.openBlock(),o.createElementBlock("img",hc))],2),o.createElementVNode("div",pc,o.toDisplayString(t.$t(`layer.${$.locale}`)),1)],8,sc))),128))]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter($=>["graticule","day-night","time-zones"].includes($.key)),$=>(o.openBlock(),o.createBlock(d,{key:$.key,modelValue:i.checkList,"onUpdate:modelValue":e[0]||(e[0]=de=>i.checkList=de),value:$.key,label:t.$t(`layer.${$.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2 mx-n1","hide-details":""},null,8,["modelValue","value","label"]))),128))]}),_:1})]),_:1}),o.createVNode(f,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.pointsOfInteresting")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(O=>["ports","alert-zones","tidal-stations"].includes(O.key)),O=>(o.openBlock(),o.createBlock(d,{key:O.key,modelValue:i.checkList,"onUpdate:modelValue":e[1]||(e[1]=$=>i.checkList=$),value:O.key,label:t.$t(`layer.${O.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),o.createVNode(f,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.otherLayers")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(O=>!["graticule","day-night","time-zones","ports","alert-zones","tidal-stations"].includes(O.key)),O=>(o.openBlock(),o.createBlock(d,{key:O.key,modelValue:i.checkList,"onUpdate:modelValue":e[2]||(e[2]=$=>i.checkList=$),value:O.key,label:t.$t(`layer.${O.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),o.createVNode(f,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.myFollows")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[o.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":e[3]||(e[3]=O=>i.checkList=O),value:"follow-ports",label:t.$t("layer.ports"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"]),o.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":e[4]||(e[4]=O=>i.checkList=O),value:"follow-positions",label:t.$t("layer.locations"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"])]),_:1})]),_:1})],2)],6),a.map?(o.openBlock(),o.createBlock(g,o.mergeProps({key:0,ref:"idmPorts",simple:a.simple,map:a.map,ports:(le=i.otherLayers)==null?void 0:le.ports,gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,"real-time":a.realTime,theme:a.theme},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","ports","gateway","token","forecast-model","real-time","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(p,o.mergeProps({key:1,ref:"idmIideStation",simple:a.simple,map:a.map,gateway:a.gateway,token:a.token,"default-meteo-token":a.defaultMeteoToken,show:i.checkList.includes("tidal-stations"),theme:a.theme,"real-time":a.realTime,"forecast-model":a.forecastModel,"before-layer":"empty-layer-3"},t.$attrs),null,16,["simple","map","gateway","token","default-meteo-token","show","theme","real-time","forecast-model"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(h,o.mergeProps({key:2,simple:a.simple,map:a.map,"menu-toggle":a.menuToggle,show:i.checkList.includes("graticule")},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","menu-toggle","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(y,o.mergeProps({key:3,map:a.map,area:(S=i.otherLayers)==null?void 0:S["day-night"]},t.$attrs,{"before-layer":"empty-layer-2"}),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(k,o.mergeProps({key:4,map:a.map,zone:(W=i.otherLayers)==null?void 0:W["time-zones"],"real-time":a.realTime},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["map","zone","real-time"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(x,o.mergeProps({key:5,map:a.map,simple:a.simple,zone:(Z=i.otherLayers)==null?void 0:Z["alert-zones"]},t.$attrs,{"before-layer":"empty-layer-3",theme:a.theme}),null,16,["map","simple","zone","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(b,o.mergeProps({key:6,map:a.map,zone:(ee=i.otherLayers)==null?void 0:ee["eca-zones"]},t.$attrs),null,16,["map","zone"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(A,o.mergeProps({key:7,map:a.map,zone:(j=i.otherLayers)==null?void 0:j["war-zones"]},t.$attrs),null,16,["map","zone"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(v,o.mergeProps({key:8,map:a.map,area:(B=i.otherLayers)==null?void 0:B["gmdss-areas"]},t.$attrs),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(L,o.mergeProps({key:9,map:a.map,show:i.checkList.includes("load-lines")},t.$attrs),null,16,["map","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(C,o.mergeProps({key:10,map:a.map,token:a.token,show:i.checkList.includes("worldMarine")},t.$attrs),null,16,["map","token","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(_,o.mergeProps({key:11,map:a.map,area:(J=i.otherLayers)==null?void 0:J["voluntary-reporting-area"]},t.$attrs),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(N,o.mergeProps({key:12,map:a.map,area:(E=i.otherLayers)==null?void 0:E["special-area"]},t.$attrs),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(M,o.mergeProps({key:13,map:a.map,token:a.token,show:i.checkList.includes("world12nm")},t.$attrs),null,16,["map","token","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(T,o.mergeProps({key:14,map:a.map,token:a.token,show:i.checkList.includes("chinaRoute")},t.$attrs),null,16,["map","token","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(I,o.mergeProps({key:15,map:a.map,show:i.checkList.includes("ice-areas")},t.$attrs),null,16,["map","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(X,o.mergeProps({key:16,map:a.map,show:i.checkList.includes("nsr")},t.$attrs),null,16,["map","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(Q,o.mergeProps({key:17,ref:"idmFollowPort",simple:a.simple,map:a.map,show:i.checkList.includes("follow-ports"),gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,"real-time":a.realTime},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","show","gateway","token","forecast-model","real-time"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(q,o.mergeProps({key:18,ref:"idmFollowPosition",simple:a.simple,map:a.map,show:i.checkList.includes("follow-positions"),"forecast-model":a.forecastModel,"real-time":a.realTime},t.$attrs),null,16,["simple","map","show","forecast-model","real-time"])):o.createCommentVNode("",!0)])}const uc=K(ac,[["render",gc]]);class to{constructor(e){oe(this,"map");oe(this,"mercator");oe(this,"rampColorLayer");oe(this,"rampColorSource");oe(this,"particleLayer");oe(this,"particleSource");oe(this,"rampColorCanvas");oe(this,"particleCanvas");oe(this,"ratio");this.map=e,this.mercator=new $r,this.rampColorLayer="ramp-color-layer",this.rampColorSource="ramp-color-source",this.particleLayer="particle-layer",this.particleSource="particle-source",this.rampColorCanvas=document.createElement("canvas"),this.particleCanvas=document.createElement("canvas"),this.ratio=window.devicePixelRatio}convertNLng(e,a=0){return e>180?this.convertNLng(e-360,a+1):e<-180?this.convertNLng(e+360,a+1):[e,a]}getBoundLngLat(){var a;const e=(a=this.map)==null?void 0:a.getBounds();return e?[[e._sw.lng,e._ne.lat],[e._ne.lng,e._ne.lat],[e._ne.lng,e._sw.lat],[e._sw.lng,e._sw.lat]]:[]}getBoundPixel(){var p,h;const e=(p=this.map)==null?void 0:p.getBounds();if(!e)return[];const a=((h=this.map)==null?void 0:h.getZoom())+1,r=[e._ne.lng,e._ne.lat],i=[e._sw.lng,e._sw.lat],[l,n]=this.convertNLng(r[0]),[s,c]=this.convertNLng(i[0]),[m,d]=this.mercator.px([l,r[1]],a),[u,f]=this.mercator.px([s,i[1]],a),g=Math.round(this.mercator.size*Math.pow(2,a)*(n+c));return[u,f,m+g,d]}getBoundRange(){const e=this.map.getZoom()+1,a=this.mercator.size*Math.pow(2,e),r=this.getBoundPixel();return[r[0]/a,r[2]/a,r[3]/a,r[1]/a]}getWorldCopy(e,a){const r=2**a,[i,l,n,s]=e.map(d=>~~(d/(r*256))),c=[];for(let d=s;d<=l;d++)for(let u=i;u<=n;u++)c.push([u,d]);return c.map(d=>{const u=2**a*256;return[d[0]*u,d[1]*u,u]})}resize(){let e=this.map.getSource(this.rampColorSource);e==null||e.setCoordinates(this.getBoundLngLat()),e=this.map.getSource(this.particleSource),e==null||e.setCoordinates(this.getBoundLngLat());const a=this.map.getCanvas(),r=Math.max(1,a.clientWidth),i=Math.max(1,a.clientHeight);for(const l of[this.rampColorCanvas,this.particleCanvas])l.width!==r&&(l.width=r),l.height!==i&&(l.height=i)}toggle(e){var i;if(!((i=this.map)!=null&&i.getLayer(this.rampColorLayer)))return;const a=this.map.getLayoutProperty(this.rampColorLayer,"visibility"),r=e?"visible":"none";a!==r&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",r)}toggleParticle(e){var i;if(!((i=this.map)!=null&&i.getLayer(this.particleLayer)))return;const a=this.map.getLayoutProperty(this.particleLayer,"visibility"),r=e?"visible":"none";a!==r&&this.map.setLayoutProperty(this.particleLayer,"visibility",r)}}class $e{isWebGL2(e){return typeof e.createVertexArray=="function"}createContext(e,a={}){const r=["webgl2","webgl"];for(const i of r)try{const l=i==="webgl2"?e.getContext("webgl2",a):e.getContext("webgl",a);if(l)return console.info("[WebGL] Renderer:",this.isWebGL2(l)?"WebGL 2":"WebGL 1"),l}catch{}return null}createParticleContext(e){return this.createContext(e,{alpha:!0,depth:!1,stencil:!1,antialias:!1,preserveDrawingBuffer:!0})}createShader(e,a,r){const i=e.createShader(a);if(i){const l=this.isWebGL2(e)?fe.toWebGL2(r,a===e.VERTEX_SHADER?"vertex":"fragment"):r;if(e.shaderSource(i,l),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)){const n=e.getShaderInfoLog(i);throw e.deleteShader(i),new Error(n||"error happened while create shader...")}}return i}createTexture(e,a,r,i,l,n,s){const c=e.createTexture();e.bindTexture(e.TEXTURE_2D,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i);const m=this.isWebGL2(e)?e.RGBA8:e.RGBA;if(l===null||l instanceof Uint8Array){if(n===void 0||s===void 0)throw e.deleteTexture(c),new Error("Pixel textures require explicit dimensions.");e.texImage2D(e.TEXTURE_2D,0,m,n,s,0,e.RGBA,e.UNSIGNED_BYTE,l)}else e.texImage2D(e.TEXTURE_2D,0,m,e.RGBA,e.UNSIGNED_BYTE,l);return e.bindTexture(e.TEXTURE_2D,null),c}createDataBuffer(e,a,r){if(e){const i=e.createBuffer();return a==="array"?(e.bindBuffer(e.ARRAY_BUFFER,i),r&&e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW)):a==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i),r&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,r,e.STATIC_DRAW)),i}return null}createProgram(e,a,r){const i=e.createProgram(),l=this.createShader(e,e.VERTEX_SHADER,a),n=this.createShader(e,e.FRAGMENT_SHADER,r);if(i&&l&&n&&(e.attachShader(i,l),e.attachShader(i,n),e.linkProgram(i),e.deleteShader(l),e.deleteShader(n),!e.getProgramParameter(i,e.LINK_STATUS))){const s=e.getProgramInfoLog(i);throw e.deleteProgram(i),new Error(s||"error happened while creating ramp color program")}return i}createProgramWrapper(e,a,r){const i=this.createProgram(e,a,r);if(i){const l={program:i},n=e.getProgramParameter(i,e.ACTIVE_ATTRIBUTES);for(let c=0;c<n;c++){const m=e.getActiveAttrib(i,c);l[m.name]=e.getAttribLocation(i,m.name)}const s=e.getProgramParameter(i,e.ACTIVE_UNIFORMS);for(let c=0;c<s;c++){const m=e.getActiveUniform(i,c);l[m.name]=e.getUniformLocation(i,m.name)}return l}}setup(e,a,r=!1,i,l){const n=document.createElement("canvas");n.width=256,n.height=1;const s=n.getContext("2d");if(s&&e){const c=s==null?void 0:s.createLinearGradient(0,0,256,0);return a.forEach(([m,d])=>{c.addColorStop(m,d)}),s.fillStyle=c,s.fillRect(0,0,256,1),{canvas:n,texture:this.createTexture(e,e.LINEAR,e.LINEAR,e.CLAMP_TO_EDGE,r?new Uint8Array(s.getImageData(0,0,256,1).data):n,i,l)}}}setupParticle(e,a=1e3,r="points",i=!1){const l=Math.ceil(Math.sqrt(a)),n=l*l,s=n*(r==="lines"?2:1),c=new Uint8Array(n*4);for(let p=0;p<c.length;p++)c[p]=Math.floor(Math.random()*256);const m=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,c,l,l),d=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,c,l,l);let u=null;if(!this.isWebGL2(e)){const p=new Float32Array(s);for(let h=0;h<s;h++)p[h]=h;u=this.createDataBuffer(e,"array",p)}const f=i?this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,null,l,l):null,g=i?this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,null,l,l):null;return{resolution:l,total:n,texture0:m,texture1:d,indexBuffer:u,renderMode:r,lifecycleTexture0:f,lifecycleTexture1:g}}bind(e,a,r){if(!e)return{};const i=this.createProgram(e,a,r);if(i){const l=this.createDataBuffer(e,"array",void 0),n=e.getAttribLocation(i,"a_position");e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0);const s=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(e,"array",s);const c=e.getAttribLocation(i,"a_texCoord");return e.enableVertexAttribArray(c),e.vertexAttribPointer(c,2,e.FLOAT,!1,0,0),{program:i,aPositionBuffer:l}}return{}}bindParticle(e,a,r,i,l,n){const s=this.createProgramWrapper(e,a,r),c=this.createProgramWrapper(e,i,l),m=this.createProgramWrapper(e,i,n),u=this.isWebGL2(e)?null:this.createDataBuffer(e,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),f=this.isWebGL2(e)?e.createVertexArray():null,g=e.createFramebuffer();return{particle:s,screen:c,update:m,quadBuffer:u,frameBuffer:g,vertexArray:f}}draw(e,a,r,i,l,n,s){var c,m;if(a&&r){e.resize(),a==null||a.viewport(0,0,(c=a==null?void 0:a.canvas)==null?void 0:c.width,(m=a==null?void 0:a.canvas)==null?void 0:m.height),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);try{a.useProgram(r);const d={resolution:a.getUniformLocation(r,"u_resolution"),image:a.getUniformLocation(r,"u_image"),color:a.getUniformLocation(r,"u_color"),scale:a.getUniformLocation(r,"u_scale"),uvRange:a.getUniformLocation(r,"u_range_u_v"),sRange:a.getUniformLocation(r,"u_range_s")};d.resolution&&a.uniform2f(d.resolution,a.canvas.width*e.ratio,a.canvas.height*e.ratio),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,i),d.image&&a.uniform1i(d.image,0),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,l),d.color&&a.uniform1i(d.color,1),s!=null&&s.uvRange&&(s!=null&&s.sRange)&&(d.uvRange&&a.uniform2f(d.uvRange,s.uvRange[0],s.uvRange[1]),d.sRange&&a.uniform2f(d.sRange,s.sRange[0],s.sRange[1])),d.scale&&a.uniform1f(d.scale,(s==null?void 0:s.scale)||1);const u=e.getBoundPixel(),f=e.map.getZoom()+1,g=e.getWorldCopy(u,f);for(const p of g){const h=(p[0]-u[0])*e.ratio,y=(p[1]-u[3])*e.ratio,k=p[2]*e.ratio,[x,b,A,v]=[h,k+h,y,k+y],L=new Float32Array([x,A,b,A,x,v,x,v,b,A,b,v]);a.bindBuffer(a.ARRAY_BUFFER,n),a.bufferData(a.ARRAY_BUFFER,L,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6)}}catch(d){console.log(`render failed...${d}`)}}}drawParticle(e,a,r,i,l,n=0){!a||!i||!r||a.isContextLost()||((i.screenWidth!==a.canvas.width||i.screenHeight!==a.canvas.height)&&Object.assign(i,this.resize(e,a,i)),this.isWebGL2(a)&&a.bindVertexArray(i.vertexArray),a.disable(a.DEPTH_TEST),a.disable(a.STENCIL_TEST),a.disable(a.BLEND),a.disable(a.DITHER),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,r),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,i.texture0),i.lifecycleTexture0&&(a.activeTexture(a.TEXTURE3),a.bindTexture(a.TEXTURE_2D,i.lifecycleTexture0)),this.renderScreen(e,a,i,l),this.updateParticles(e,a,i,l,n),a.bindFramebuffer(a.FRAMEBUFFER,null),this.isWebGL2(a)&&a.bindVertexArray(null))}renderScreen(e,a,r,i){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.screenTexture,0),a.viewport(0,0,a.canvas.width,a.canvas.height),this.renderScreenTexture(a,r.backgroundTexture,r.screen,r.quadBuffer,i.fadeOpacity),this.renderParticles(e,a,r,i),a.bindFramebuffer(a.FRAMEBUFFER,null),this.renderScreenTexture(a,r.screenTexture,r.screen,r.quadBuffer,1);const l=r.backgroundTexture;r.backgroundTexture=r.screenTexture,r.screenTexture=l}renderScreenTexture(e,a,r,i,l){e&&(e.useProgram(r.program),this.isWebGL2(e)||(e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(r.a_pos),e.vertexAttribPointer(r.a_pos,2,e.FLOAT,!1,0,0)),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,a),e.uniform1i(r.u_screen,2),e.uniform1f(r.u_opacity,l),e.drawArrays(e.TRIANGLES,0,6))}renderParticles(e,a,r,i){if(a){a.useProgram(r.particle.program),this.isWebGL2(a)||(a.bindBuffer(a.ARRAY_BUFFER,r.indexBuffer),a.enableVertexAttribArray(r.particle.a_index),a.vertexAttribPointer(r.particle.a_index,1,a.FLOAT,!1,0,0)),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,r.color.texture),a.uniform1i(r.particle.u_factor,0),a.uniform1i(r.particle.u_particles,1),a.uniform1i(r.particle.u_color_ramp,2),a.uniform1f(r.particle.u_particles_resolution,r.resolution),a.uniform1f(r.particle.u_point,e.ratio);const l=e.getBoundRange();a.uniform4f(r.particle.u_viewport,l[0],l[1],l[2],l[3]),a.uniform2f(r.particle.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.particle.u_factor_max,i.uvRange[1],i.uvRange[1]),r.lifecycleTexture0&&(a.uniform1i(r.particle.u_lifecycle,3),a.uniform1i(r.particle.u_reset_lifecycle,r.resetLifecycle?1:0),a.enable(a.BLEND),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA)),r.renderMode==="lines"?(a.uniform2f(r.particle.u_resolution,a.canvas.width,a.canvas.height),a.uniform2f(r.particle.u_factor_res,r.image.width,r.image.height),a.uniform1f(r.particle.u_line_length,i.lineLength??6),a.uniform1f(r.particle.u_line_opacity,i.lineOpacity??1),a.lineWidth(1),a.drawArrays(a.LINES,0,r.total*2)):a.drawArrays(a.POINTS,0,r.total),r.lifecycleTexture0&&a.disable(a.BLEND)}}updateParticles(e,a,r,i,l=0){var s,c;if(a){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.texture1,0),a.viewport(0,0,r.resolution,r.resolution),a.useProgram(r.update.program),this.isWebGL2(a)||(a.bindBuffer(a.ARRAY_BUFFER,r.quadBuffer),a.enableVertexAttribArray(r.update.a_pos),a.vertexAttribPointer(r.update.a_pos,2,a.FLOAT,!1,0,0)),a.uniform1i(r.update.u_factor,0),a.uniform1i(r.update.u_particles,1);const m=e.getBoundRange();if(a.uniform4f(r.update.u_viewport,m[0],m[1],m[2],m[3]),a.uniform1f(r.update.u_rand_seed,Math.random()),a.uniform2f(r.update.u_factor_res,(s=r==null?void 0:r.image)==null?void 0:s.width,(c=r==null?void 0:r.image)==null?void 0:c.height),a.uniform2f(r.update.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.update.u_factor_max,i.uvRange[1],i.uvRange[1]),a.uniform1f(r.update.u_speed_factor,i.speedFactor*e.ratio),a.uniform1f(r.update.u_drop_rate,i.dropRate),a.uniform1f(r.update.u_drop_rate_bump,i.dropRateBump),r.lifecycleTexture0&&(a.uniform1i(r.update.u_lifecycle,3),a.uniform1i(r.update.u_reset_lifecycle,r.resetLifecycle?1:0),a.uniform1f(r.update.u_delta_seconds,Number.isFinite(l)?Math.max(0,l):0),a.uniform1i(r.update.u_write_lifecycle,0)),a.drawArrays(a.TRIANGLES,0,6),r.lifecycleTexture0){a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.lifecycleTexture1,0),a.uniform1i(r.update.u_write_lifecycle,1),a.drawArrays(a.TRIANGLES,0,6);const d=r.lifecycleTexture0;r.lifecycleTexture0=r.lifecycleTexture1,r.lifecycleTexture1=d,r.resetLifecycle=!1}}const n=r.texture0;r.texture0=r.texture1,r.texture1=n}resize(e,a,r){e.resize();const{width:i,height:l}=a.canvas;if((r==null?void 0:r.screenWidth)===i&&(r==null?void 0:r.screenHeight)===l)return r;r&&(a.deleteTexture(r.screenTexture||null),a.deleteTexture(r.backgroundTexture||null));const n=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,null,i,l),s=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,null,i,l);return{screenTexture:n,backgroundTexture:s,screenWidth:i,screenHeight:l}}destroyParticle(e,a){var r,i,l,n;if(!(!e||!a)){e.bindFramebuffer(e.FRAMEBUFFER,null),this.isWebGL2(e)&&(e.bindVertexArray(null),e.deleteVertexArray(a.vertexArray||null));for(const s of[a.texture0,a.texture1,a.screenTexture,a.backgroundTexture,(r=a.color)==null?void 0:r.texture])e.deleteTexture(s||null);a.lifecycleTexture0&&e.deleteTexture(a.lifecycleTexture0),a.lifecycleTexture1&&e.deleteTexture(a.lifecycleTexture1),e.deleteBuffer(a.indexBuffer||null),e.deleteBuffer(a.quadBuffer||null),e.deleteFramebuffer(a.frameBuffer||null);for(const s of[(i=a.particle)==null?void 0:i.program,(l=a.screen)==null?void 0:l.program,(n=a.update)==null?void 0:n.program])e.deleteProgram(s||null)}}async loadImg(e){return new Promise((a,r)=>{const i=typeof e!="string",l=i?URL.createObjectURL(new Blob([e],{type:e.type})):e,n=new Image,s=()=>{i&&URL.revokeObjectURL(l),n.onload=n.onerror=null};n.crossOrigin="anonymous",n.onload=()=>{s(),a(n)},n.onerror=()=>{s(),r(new Error("Unable to load weather texture."))},n.src=l})}}class fe{static toWebGL2(e,a){if(/^\s*#version\s+300\s+es\b/.test(e))return e;const r=e.replace(/^\s*#version\s+100\s*\n/,"").replace(/precision\s+(?:lowp|mediump|highp)\s+float\s*;/g,"").replace(/\battribute\b/g,"in").replace(/\bvarying\b/g,a==="vertex"?"out":"in").replace(/\btexture2D\b/g,"texture").replace(/\bgl_FragColor\b/g,"fragColor");return`#version 300 es
|
|
10
|
+
</div>`)}),r}},legend:{show:!0,right:20,top:0,itemWidth:30,data:["Height"],textStyle:{color:this.Theme.current.value.colors["on-surface"]}},grid:{top:40,left:10,right:10,bottom:30,containLabel:!0},xAxis:[{type:"category",data:this.xDate,boundaryGap:!0,axisTick:{alignWithLabel:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLabel:{interval:"auto",margin:15,textStyle:{fontSize:12,color:this.Theme.current.value.colors["echart-axis"]}}}],yAxis:[{name:"(m)",show:!0,nameLocation:"end",position:"left",nameGap:15,splitNumber:5,splitLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-split"]}},alignTicks:!0,axisLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLabel:{textStyle:{fontSize:12,color:this.Theme.current.value.colors["echart-axis"]}}}],series:[{name:"Height",type:"line",showSymbol:!0,yAxisIndex:0,lineStyle:{color:this.Theme.current.value.colors["map-perple"]},itemStyle:{color:this.Theme.current.value.colors["map-perple"]},data:this.echartData.height}]};t==null||t.setOption(e)},handleClose(){this.$emit("close")}}},es={class:"d-flex justify-space-between align-center"},ts={class:"d-flex justify-start text-h5 my-2"},os={class:"d-flex justify-start align-center text-h6 text-label ga-3"},as={class:"summary-box w-100"},is={class:"d-flex justify-space-between align-center py-2"},rs={class:"d-flex justify-center align-center text-h6 ga-2"},ls={class:"multi-color-icon","aria-hidden":"true"},ns=["xlink:href"],ss={class:"gray-bg-2 rounded d-flex flex-column ga-4 pa-4"},cs={class:"w-100 d-flex justify-start align-center"},ms={class:"w-30 text-label font-weight-400"},ds={class:"flex-1-1-0"},hs={class:"w-100 d-flex justify-start align-center"},ps={class:"w-30 text-label font-weight-400"},gs={class:"flex-1-1-0"},us={class:"w-100 d-flex justify-start align-center"},fs={class:"w-30 text-label font-weight-400"},ys={class:"flex-1-1-0"},bs={class:"table-box w-100 mt-2 mb-4 d-flex flex-column justify-start align-center"},ws={class:"w-100 d-flex justify-space-between align-center py-2"},xs={class:"d-flex justify-center align-center text-h6 ga-2"},ks={class:"multi-color-icon","aria-hidden":"true"},As=["xlink:href"],Ls={ref:"tideEchart",class:"w-100",style:{height:"244px"}},vs={"fixed-header":"",density:"compact",class:"w-100 tide-table bg-none"},Cs={class:"px-1 text-center text-label font-weight-400",width:"120"},zs={class:"px-1 text-center text-label font-weight-400",width:"120"},_s={class:"px-1 text-center text-label font-weight-400",width:"120"},Ss={class:"px-1 text-center"},Ps={class:"px-1 text-center"},Ns={class:"px-1 text-center"};function Ms(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),s=o.resolveComponent("VCardTitle"),c=o.resolveComponent("VDivider"),m=o.resolveComponent("VBtnToggle"),d=o.resolveComponent("VCard");return o.openBlock(),o.createBlock(d,{class:o.normalizeClass(["tide-detail-container d-flex flex-column justify-start align-center",a.simple?"page":"dialog"])},{default:o.withCtx(()=>{var u,f;return[o.createVNode(s,{class:"w-100"},{default:o.withCtx(()=>{var g;return[o.createElementVNode("div",es,[o.createElementVNode("div",ts,[o.createElementVNode("div",null,o.toDisplayString((g=a.station)==null?void 0:g.name),1)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"",onClick:l.handleClose},{default:o.withCtx(()=>e[1]||(e[1]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[1]},8,["onClick"])]),o.createElementVNode("div",os,[o.createElementVNode("div",null,o.toDisplayString(t.$t("tide.tideStation")),1)])]}),_:1}),o.createVNode(c,{class:"w-100"}),o.createElementVNode("div",{class:o.normalizeClass(["w-100 pt-0 pb-0 overflow-y-auto scroll",a.simple?"px-3":"px-5"])},[o.createElementVNode("div",as,[o.createElementVNode("div",is,[o.createElementVNode("div",rs,[(o.openBlock(),o.createElementBlock("svg",ls,[o.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,ns)])),o.createElementVNode("div",null,o.toDisplayString(t.$t("detail.summary")),1)])]),o.createElementVNode("div",ss,[o.createElementVNode("div",cs,[o.createElementVNode("div",ms,o.toDisplayString(t.$t("tide.region")),1),o.createElementVNode("div",ds,o.toDisplayString(((u=a.station)==null?void 0:u.Country)??((f=a.station)==null?void 0:f.city)??"-"),1)]),o.createElementVNode("div",hs,[o.createElementVNode("div",ps,o.toDisplayString(t.$t("tide.position")),1),o.createElementVNode("div",gs,o.toDisplayString(l.computePosition(a.station)),1)]),o.createElementVNode("div",us,[o.createElementVNode("div",fs,o.toDisplayString(t.$t("time.localTime")),1),o.createElementVNode("div",ys,o.toDisplayString(l.computeLocalTime(a.realTime,a.station))+" "+o.toDisplayString(l.computeTimeOffset(a.station)),1)])])]),o.createElementVNode("div",bs,[o.createElementVNode("div",ws,[o.createElementVNode("div",xs,[(o.openBlock(),o.createElementBlock("svg",ks,[o.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,As)])),o.createElementVNode("div",null,o.toDisplayString(t.$t("tide.tideTimes")),1)]),e[2]||(e[2]=o.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),o.createElementVNode("div",{class:o.normalizeClass(["w-100 gray-bg-2 rounded",a.simple?"pa-2":"pa-4 py-2"])},[o.createVNode(m,{modelValue:i.currentIndex,"onUpdate:modelValue":e[0]||(e[0]=g=>i.currentIndex=g),class:"w-100 d-flex justify-space-around align-center ga-0 mb-4",density:"compact",group:"",height:"26","min-height":"26",rounded:"1",mandatory:""},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.dateList,g=>(o.openBlock(),o.createBlock(n,{key:g.label,class:o.normalizeClass(["text-none text-body-1 flex-1-1-0",`bg-${g.index===i.currentIndex?"bg-primary":"gray-bg-2"}`]),density:"compact",color:"primary",height:"26",value:g.index},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(g.label),1)]),_:2},1032,["class","value"]))),128))]),_:1},8,["modelValue"]),o.createElementVNode("div",Ls,null,512),o.createElementVNode("table",vs,[o.createElementVNode("tbody",null,[o.createElementVNode("tr",null,[o.createElementVNode("th",Cs,o.toDisplayString(t.$t("tide.tide")),1),o.createElementVNode("th",zs,o.toDisplayString(t.$t("time.time"))+" ( LT ) ",1),o.createElementVNode("th",_s,o.toDisplayString(t.$t("tide.height"))+" ( m )",1)]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tideTableData,(g,p)=>{var h;return o.openBlock(),o.createElementBlock("tr",{key:p},[o.createElementVNode("td",Ss,o.toDisplayString(t.$t(`tide.${(h=g==null?void 0:g.type)==null?void 0:h.toLowerCase()}`))+" "+o.toDisplayString(t.$t("tide.tide")),1),o.createElementVNode("td",Ps,o.toDisplayString(l.computeLocalTime(g==null?void 0:g.date,a.station,"MM-DD HH:mm")),1),o.createElementVNode("td",Ns,o.toDisplayString((g==null?void 0:g.height)??"-")+" m",1)])}),128))])])],2)])],2)]}),_:1},8,["class"])}const Ts=K($n,[["render",Ms],["__scopeId","data-v-5c51381d"]]),q1="",Vs={name:"IdmTideStations",components:{TideDetail:Ts},props:{map:{type:Object},show:{type:Boolean},locale:{type:String},beforeLayer:{type:String}},data(){return{layer:"tide-stations",showInfo:!1,hoverStation:void 0,marker:null,showDetail:!1,station:void 0}},watch:{show:{handler(){var t,e,a,r,i,l;this.show?(this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):(this.handleClear(),(r=this.map)==null||r.off("click",[this.layer],this.handleClick),(i=this.map)==null||i.off("mousemove",[this.layer],this.handleHover),(l=this.map)==null||l.off("mouseleave",[this.layer],this.handleLeave))},immediate:!0},locale:{handler(){this.show&&this.handleRender()},immediate:!0}},methods:{handleRender(){var t;(t=this.map)!=null&&t.getLayer(this.layer)&&(this.map.setLayoutProperty(this.layer,"visibility","visible"),this.map.setLayoutProperty(this.layer,"text-field",this.locale==="en"?"{Location_EN}":"{Location_CN}"))},handleClear(){var t;this.showInfo=!1,(t=this.map)!=null&&t.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none")},handleClick(t){const e=t.features[0];e.properties&&(this.station=e.properties,this.station.name=this.locale==="en"?e.properties.Location_EN:e.properties.Location_CN,this.station.lng=e.geometry.coordinates[0],this.station.lat=e.geometry.coordinates[1],this.showDetail=!0)},handleHover(t){var a,r;this.map.getCanvas().style.cursor="pointer";const e=t.features[0];if(e.properties){this.showInfo=!0,this.hoverStation=e.properties,this.hoverStation.name=this.locale==="en"?e.properties.Location_EN:e.properties.Location_CN,this.hoverStation.lng=e.geometry.coordinates[0],this.hoverStation.lat=e.geometry.coordinates[1],(a=this.marker)==null||a.remove();const i=(r=document.getElementById("idmTidalInfo"))==null?void 0:r.cloneNode(!0);this.marker=new pe.Marker(i).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-60]).addTo(this.map)}},handleLeave(){var t;this.showInfo=!1,this.hoverStation={},(t=this.marker)==null||t.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Es={class:"station-box d-flex flex-column justify-center align-start ga-1"},Rs={class:"d-flex justify-start align-center"},Ds={class:"d-flex justify-start align-center"},Bs={class:"text-label"};function Is(t,e,a,r,i,l){const n=o.resolveComponent("VCardText"),s=o.resolveComponent("VCard"),c=o.resolveComponent("TideDetail");return o.openBlock(),o.createElementBlock("div",null,[o.withDirectives(o.createVNode(s,{id:"idmTidalInfo"},{default:o.withCtx(()=>[o.createVNode(n,{class:"pr-8 text-body-1"},{default:o.withCtx(()=>{var m,d;return[o.createElementVNode("div",Es,[o.createElementVNode("div",Rs,o.toDisplayString(t.$t("tide.tideStation")),1),o.createElementVNode("div",Ds,[o.createElementVNode("label",Bs,o.toDisplayString((m=i.hoverStation)==null?void 0:m.name)+" , "+o.toDisplayString(((d=i.hoverStation)==null?void 0:d.Country)||"-"),1)])])]}),_:1})]),_:1},512),[[o.vShow,i.showInfo]]),i.showDetail?(o.openBlock(),o.createBlock(c,o.mergeProps({key:0,station:i.station},t.$attrs,{onClose:l.handleCloseDetail}),null,16,["station","onClose"])):o.createCommentVNode("",!0)])}const Fs=K(Vs,[["render",Is],["__scopeId","data-v-ad725d5e"]]),Gs={name:"IdmIceAreas",props:{map:{type:Object},show:{type:Boolean}},data(){return{lineLayer:"ice-area-line",fillLayer:"ice-area-fill"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t,e;(t=this.map)!=null&&t.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","visible"),(e=this.map)!=null&&e.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","visible")},handleClear(){var t,e;(t=this.map)!=null&&t.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","none"),(e=this.map)!=null&&e.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","none")}}};function js(t,e,a,r,i,l){return null}const Ws=K(Gs,[["render",js]]),$1="",Zs={name:"IdmLatLng",props:{simple:{type:Boolean,default:!1},map:{type:Object},show:{type:Boolean},mapFeather:{type:String},beforeLayer:{type:String},menuToggle:{type:Object}},data(){return{lngLat:{e:{lng:0,lat:0},lng:0,lat:0,str:""},source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},computed:{lineColor(){return["satellite","dark"].includes(this.mapFeather)?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.3)"},labelColor(){return["satellite","dark"].includes(this.mapFeather)?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.5)"}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var t;this.map&&((t=this.map)==null||t.on("mousemove",this.handleMouseMove))},immediate:!0},"menuToggle.v":{handler(){var t;this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10},immediate:!0},"lngLat.e":{handler(t){this.lngLat.lng=P.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty,this.lngLat.lat=P.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty,this.lngLat.str=`[${P.LngLatHelper.str2Lat(t==null?void 0:t.lat,4)}, ${P.LngLatHelper.str2Lng(t==null?void 0:t.lng,4)}]`},immediate:!0}},methods:{handleBind(){var t,e;this.show?((t=this.map)==null||t.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(t){this.lngLat.e=t.lngLat},handleComputeLatLngs(){var r;const t=(r=this.map)==null?void 0:r.getZoom();let e=30;t>4?e=10:t>3&&(e=15);const a=[];for(let i=-60;i<90;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,i],[180,i]]}});for(let i=-180;i<180;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[i,-90],[i,90]]}});for(let i=180;i>-180;i-=e)for(let l=-60;l<90;l+=e)a.push({type:"Feature",geometry:{type:"Point",coordinates:[i,l]},properties:{val:`${l>0?l+" N":l===0?l:l*-1+" S"}, ${i>0?i+" E":i*-1+" W"}`}});return a},handleZoomEnd(){var e;const t=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(V.featureCollection(t))},handleRender(){if(this.handleClear(),this.map){const t=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:t}}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":this.lineColor,"line-width":1}},this.beforeLayer),this.map.addLayer({id:this.labelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{val}","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":1,"text-color":this.labelColor}},this.beforeLayer)}},handleClear(){var t,e,a,r,i,l;(t=this.map)!=null&&t.getLayer(this.layer)&&((e=this.map)==null||e.removeLayer(this.layer)),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&((r=this.map)==null||r.removeLayer(this.labelLayer)),(i=this.map)!=null&&i.getSource(this.source)&&((l=this.map)==null||l.removeSource(this.source))}}};function Hs(t,e,a,r,i,l){var n,s,c;return a.simple?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:"idm-lat-lng-tip-gl4 pa-2 py-1 text-caption text-right rounded",style:o.normalizeStyle({right:i.right+"px"})},[o.createElementVNode("div",null,o.toDisplayString((n=i.lngLat)==null?void 0:n.lat),1),o.createElementVNode("div",null,o.toDisplayString((s=i.lngLat)==null?void 0:s.lng),1),o.createElementVNode("div",null,o.toDisplayString((c=i.lngLat)==null?void 0:c.str),1)],4))}const Xo=K(Zs,[["render",Hs]]),eb="",Xs={name:"IdmFollowPort",components:{PortDetail:Eo},props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array}},emits:["closeAllDetail"],setup(){return{Theme:be.useTheme()}},data(){return{source:"follow-port-source",layer:"follow-port-layer",showInfo:!1,portId:"",hoverPort:{},port:{},marker:void 0,showDetail:!1}},watch:{show:{handler(){var t,e,a;this.show?(this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var t,e,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var e,a;const t={features:[],type:"FeatureCollection"};(e=this.followList)==null||e.forEach(r=>{var i;if((i=r.port)!=null&&i.id){const l=r.port,n={type:"Feature",properties:l,geometry:{type:"Point",coordinates:[l.lng,l.lat]}};t.features.push(n)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(t):(this.map.addSource(this.source,{type:"geojson",data:t}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1,"icon-image":"port","icon-offset":[0,-13],"text-anchor":"bottom","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1.6]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var t,e,a;this.showInfo=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)},handleClick(t){const e=t.features[0];this.portId=e.properties.id,e.properties.id&&(this.port=e.properties,this.port.lng=e.geometry.coordinates[0],this.port.lat=e.geometry.coordinates[1],this.port.forecastModel=this.forecastModel,this.showDetail=!0)},handleHover(t){var r,i;this.map.getCanvas().style.cursor="pointer";const e=t.features[0];if(e.properties.id){this.showInfo=!0,this.hoverPort=e.properties,(r=this.marker)==null||r.remove();const l=(i=document.getElementById("idmFollowPortInfo"))==null?void 0:i.cloneNode(!0);this.marker=new pe.Marker(l).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var t;this.showInfo=!1,this.hoverPort={},(t=this.marker)==null||t.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Os={class:"port-box d-flex flex-column justify-center align-start ga-1"},Ys={class:"d-flex justify-start align-center text-label"},Us={class:"d-flex justify-start align-center text-label"};function Js(t,e,a,r,i,l){const n=o.resolveComponent("VCardText"),s=o.resolveComponent("VCard"),c=o.resolveComponent("PortDetail");return o.openBlock(),o.createElementBlock("div",null,[o.withDirectives(o.createVNode(s,{id:"idmFollowPortInfo",ref:"idmFollowPortInfo"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-body-1 pr-8"},{default:o.withCtx(()=>[o.createElementVNode("div",Os,[o.createElementVNode("div",null,o.toDisplayString(t.$t("port.port")),1),o.createElementVNode("div",Ys,[o.createElementVNode("span",null,o.toDisplayString(i.hoverPort.name??"-"),1)]),o.createElementVNode("div",Us,[e[1]||(e[1]=o.createElementVNode("label",{class:"pr-1"},"LoCode : ",-1)),o.createElementVNode("span",null,o.toDisplayString(i.hoverPort.loCode??"-"),1)])])]),_:1})]),_:1},512),[[o.vShow,i.showInfo]]),i.showDetail?(o.openBlock(),o.createBlock(c,o.mergeProps({key:0,"port-id":i.portId,port:i.port,"forecast-model":a.forecastModel,"follow-list":a.followList},t.$attrs,{onClose:l.handleCloseDetail,onCloseAllDetail:e[0]||(e[0]=m=>t.$emit("closeAllDetail",{followPort:!0}))}),null,16,["port-id","port","forecast-model","follow-list","onClose"])):o.createCommentVNode("",!0)])}const Ks=K(Xs,[["render",Js],["__scopeId","data-v-9b28c4ea"]]),tb="",Qs={name:"IdmFollowPosition",props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array},realTime:{type:String}},setup(){return{Theme:be.useTheme()}},data(){return{source:"follow-coordinate-source",layer:"follow-coordinate-layer",position:{},showInfo:!1,marker:null}},computed:{computePosition(){return function(t){return!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat)?"-":P.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty+" / "+P.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty}}},watch:{show:{handler(){var t,e,a;this.show?(this.handleClear(),this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var t,e,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var e,a;const t={features:[],type:"FeatureCollection"};(e=this.followList)==null||e.forEach(r=>{if(r.coordinate){const i=r.coordinate,l={type:"Feature",properties:{id:r.id,remark:r.remark,...r.coordinate},geometry:{type:"Point",coordinates:[i.lng,i.lat]}};t.features.push(l)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(t):(this.map.addSource(this.source,{type:"geojson",data:t}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1.1,"icon-image":"location","icon-offset":[0,-16]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var t,e,a;this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(t=this.map)==null||t.off("click",[this.layer],this.handleClick),(e=this.map)==null||e.off("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.off("mouseleave",[this.layer],this.handleLeave)},handleClick(t){var a,r,i,l,n,s,c,m,d;const e=t.features[0];if(e.properties){const u=e.properties;u.lng=e.geometry.coordinates[0],u.lat=e.geometry.coordinates[1];const f=z(),g=(a=z(this.realTime))==null?void 0:a.diff(f,"d",!0),p={followId:u.id,lat:u.lat,lng:u.lng,datetime:this.realTime,forecastModel:this.forecastModel};g>=0?(n=(l=(i=(r=this.$parent)==null?void 0:r.$parent)==null?void 0:i.$refs)==null?void 0:l.idmSpot)==null||n.fetchForecastData(p):(d=(m=(c=(s=this.$parent)==null?void 0:s.$parent)==null?void 0:c.$refs)==null?void 0:m.idmSpot)==null||d.fetchHistoryData(p)}},handleHover(t){var a;this.map.getCanvas().style.cursor="pointer";const e=t.features[0];if(e.properties.id){this.showInfo=!0,this.position=e.properties,(a=this.marker)==null||a.remove();const r=document.getElementById("idmFollowPositionInfo").cloneNode(!0);this.marker=new pe.Marker(r).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var t;this.showInfo=!1,(t=this.marker)==null||t.remove(),this.map.getCanvas().style.cursor="grab"}}},qs={class:"position-box d-flex flex-column justify-center align-start ga-1"},$s={class:"d-flex justify-start align-center text-label"},ec={key:0,class:"d-flex justify-start align-center text-label"};function tc(t,e,a,r,i,l){const n=o.resolveComponent("VCardText"),s=o.resolveComponent("VCard");return o.withDirectives((o.openBlock(),o.createBlock(s,{id:"idmFollowPositionInfo",ref:"idmFollowPositionInfo"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-body-1 pr-8"},{default:o.withCtx(()=>[o.createElementVNode("div",qs,[e[0]||(e[0]=o.createElementVNode("div",null,"Location",-1)),o.createElementVNode("div",$s,[o.createElementVNode("span",null,o.toDisplayString(l.computePosition(i.position)),1)]),i.position.remark?(o.openBlock(),o.createElementBlock("div",ec,[o.createElementVNode("span",null,o.toDisplayString(i.position.remark??"-"),1)])):o.createCommentVNode("",!0)])]),_:1})]),_:1},512)),[[o.vShow,i.showInfo]])}const oc=K(Qs,[["render",tc],["__scopeId","data-v-1de14e27"]]),ob="",ac={name:"IdmOtherLayerr",components:{IdmWarZone:rl,IdmGmdssArea:sl,IdmEcaZone:dl,IdmAlertZone:ul,IdmPort:Cn,IdmLoadLine:Sn,IdmTimezone:Mn,IdmVRA:En,IdmSpecialArea:Bn,IdmTerminator:Gn,IdmWorld12nm:Zn,IdmWorldMarine:On,IdmChinaRoute:Jn,IdmNsrAreas:qn,IdmTideStations:Fs,IdmIceAreas:Ws,IdmLatLng:Xo,IdmFollowPort:Ks,IdmFollowPosition:oc},props:{simple:{type:Boolean,default:!1},map:{type:Object},theme:{type:String},token:{type:String},isLogin:{type:Boolean,default:!1},defaultMeteoToken:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},top:{type:Number,default:0},paddingTop:{type:Number,default:8},menuHeight:{type:Number,default:248},menuToggle:{type:Object,default:{}},ts:{type:String},forecastModel:{type:String},realTime:{type:String},platform:{type:String},mapFeather:{type:String}},emits:["map","other","menuToggle","mapFeather","theme","followLayerList","otherCheckList"],data(){return{right:10,toggle:!1,mapboxFeather:void 0,tagLayers:[...no.LayerHelper.OTHER_LAYERS.filter(t=>t.enabled)],layerWeight:0,otherLayers:{},activeOtherLayers:[],cache:{v:"0.0.4",versionKey:"otherLayerCacheVersionGL4",checkListKey:"otherChecklistCacheGL4",followListKey:"otherFollowListCacheGL4",mapFeatherKey:"mapFeathersCacheGL4",nauticalKey:"nauticalLayerCacheGL4"},featherOptions:[{name:"Light Map",value:"light",locale:"lightMap"},{name:"Dark Map",value:"dark",locale:"darkMap"},{name:"Satelite Map",value:"satellite",locale:"satelliteMap",hide:this.platform==="ops",replace:"dark"},{name:"Nautical Map",value:"nautical",locale:"nauticalMap",hide:this.platform==="ops",replace:"light"}],checkList:[]}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}:{top:this.top+"px",right:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.otherLayers,this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},realTime:{handler(t,e){t&&e&&t!==e&&this.checkList.includes("day-night")&&this.fetchDayNightLayer()}},theme:{handler(){this.theme==="light"?this.mapboxFeather=["light","nautical"].includes(this.mapboxFeather)?this.mapboxFeather:"light":this.theme==="dark"&&(this.mapboxFeather=["dark","satellite"].includes(this.mapboxFeather)?this.mapboxFeather:"dark")}},mapFeather:{handler(t,e){t!==e&&(this.mapboxFeather=this.mapFeather)},immediate:!0},mapboxFeather:{handler(){localStorage.setItem(this.cache.mapFeatherKey,this.mapboxFeather),this.$emit("mapFeather",this.mapboxFeather),this.$emit("theme",["light","nautical"].includes(this.mapboxFeather)?"light":"dark")},immediate:!0},checkList:{handler(t,e){localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),this.activeOtherLayers=this.tagLayers.filter(l=>this.checkList.includes(l.key))||[];const a=t==null?void 0:t.filter(l=>!(e!=null&&e.includes(l))),r=e==null?void 0:e.filter(l=>!(t!=null&&t.includes(l))),i=t==null?void 0:t.filter(l=>e==null?void 0:e.includes(l));if((r==null?void 0:r.length)>0&&r.forEach(l=>{this.otherLayers[l]=void 0,delete this.otherLayers[l]}),(a==null?void 0:a.length)>0){const l=this.tagLayers.filter(n=>this.checkList.includes(n.key)&&!i.includes(n.key))||[];this.handleLayersChange(l)}this.$emit("otherCheckList",this.checkList)}}},async mounted(){this.fetchCache()},methods:{fetchCache(){var r;const t=localStorage.getItem(this.cache.versionKey);this.cache.v!==t&&(localStorage.removeItem(this.cache.checkListKey),localStorage.removeItem(this.cache.followListKey),localStorage.removeItem(this.cache.mapFeatherKey),localStorage.removeItem(this.cache.nauticalKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let e=localStorage.getItem(this.cache.checkListKey);this.checkList=JSON.parse(e||'["eca-zones"]'),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),e=localStorage.getItem(this.cache.mapFeatherKey);const a=this.featherOptions.some(i=>i.value===e&&!i.hide)?e:((r=this.featherOptions.find(i=>i.value===e))==null?void 0:r.replace)||this.mapFeather||"dark";this.$emit("mapFeather",a),localStorage.setItem(this.cache.mapFeatherKey,a)},handleMenuToggle(){this.$emit("menuToggle","otherLayers")},handleToggleMapFeather(t){this.mapboxFeather=t.value},async fetchOtherLayers(){var e,a;let t=this.layerWeight;if(t){const r=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],i=await he.get(`${r}/api/arc/other/layers/links?l=${t}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(((e=i==null?void 0:i.data)==null?void 0:e.code)===0){const l=(a=i==null?void 0:i.data)==null?void 0:a.data,n=[];for(const c in l)n.push(he.get(l[c],{headers:{Authorization:this.defaultMeteoToken,key:c}}));(await Promise.all(n)).map(c=>{var u,f,g;const m=((u=c==null?void 0:c.data)==null?void 0:u.data)||(c==null?void 0:c.data),d=(g=(f=c==null?void 0:c.config)==null?void 0:f.headers)==null?void 0:g.key;this.otherLayers[d]=m})}}},async fetchDayNightLayer(){var a,r;const t=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],e=await he.get(`${t}/api/arc/other/layers/links?l=1024&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});((a=e==null?void 0:e.data)==null?void 0:a.code)===0&&(this.otherLayers["day-night"]=((r=e==null?void 0:e.data)==null?void 0:r.data)||(e==null?void 0:e.data))},handleLayersChange(t){const e=t==null?void 0:t.reduce((a,r)=>a+(r==null?void 0:r.weight),0);this.layerWeight=e,this.fetchOtherLayers()}}},ic={class:"idm-gl4-other-layer"},rc={class:"header-box w-100 d-flex justify-space-between align-center px-4"},lc={class:"text-h5 font-weight-medium"},nc={class:"layers-body mt-4 mb-2 d-flex justify-start align-center flex-wrap"},sc=["onClick"],cc={key:0,src:"https://ossimg.ormwx.com/asset/dark-map.png",class:"border rounded-sm"},mc={key:1,src:"https://ossimg.ormwx.com/asset/nautical-map.png",class:"border rounded-sm"},dc={key:2,src:"https://ossimg.ormwx.com/asset/satellite-map.png",class:"border rounded-sm"},hc={key:3,src:"https://ossimg.ormwx.com/asset/light-map.png",class:"border rounded-sm"},pc={class:"text-body-2 text-center pt-2"};function gc(t,e,a,r,i,l){var le,S,W,Z,ee,j,B,J,E;const n=o.resolveComponent("VBtn"),s=o.resolveComponent("VTooltip"),c=o.resolveComponent("VCardTitle"),m=o.resolveComponent("VCardItem"),d=o.resolveComponent("VCheckbox"),u=o.resolveComponent("VCardText"),f=o.resolveComponent("VCard"),g=o.resolveComponent("IdmPort"),p=o.resolveComponent("IdmTideStations"),h=o.resolveComponent("IdmLatLng"),y=o.resolveComponent("IdmTerminator"),k=o.resolveComponent("IdmTimezone"),x=o.resolveComponent("IdmAlertZone"),b=o.resolveComponent("IdmEcaZone"),A=o.resolveComponent("IdmWarZone"),v=o.resolveComponent("IdmGmdssArea"),L=o.resolveComponent("IdmLoadLine"),C=o.resolveComponent("IdmWorldMarine"),_=o.resolveComponent("IdmVRA"),N=o.resolveComponent("IdmSpecialArea"),M=o.resolveComponent("IdmWorld12nm"),T=o.resolveComponent("IdmChinaRoute"),I=o.resolveComponent("IdmIceAreas"),X=o.resolveComponent("IdmNsrAreas"),Q=o.resolveComponent("IdmFollowPort"),q=o.resolveComponent("IdmFollowPosition");return o.openBlock(),o.createElementBlock("div",ic,[o.createElementVNode("div",{class:o.normalizeClass(["menu-bar-box transition px-1 rounded",a.simple?"simple":""]),style:o.normalizeStyle({top:a.top+10+"px",right:i.right+"px",paddingTop:a.paddingTop+"px",height:a.menuHeight+"px"})},[o.createVNode(s,{text:t.$t("layer.mapLayers"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:O})=>[o.createVNode(n,o.mergeProps(O,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[5]||(e[5]=[o.createElementVNode("i",{class:"iconfont icon-Layer text-h4"},null,-1)])),_:2,__:[5]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],6),o.createElementVNode("div",{class:o.normalizeClass(["available-layers transition d-flex flex-column justify-start align-start",i.toggle?"right-bar":""]),style:o.normalizeStyle(l.listStyle)},[o.createElementVNode("div",rc,[o.createElementVNode("div",lc,o.toDisplayString(t.$t("layer.layers")),1),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:o.withCtx(()=>e[6]||(e[6]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[6]},8,["onClick"])]),o.createElementVNode("div",{class:o.normalizeClass(["list-box w-100 flex-1-1-0 scroll overflow-y-auto",a.simple?"px-3":"pl-4 pr-2"])},[o.createVNode(f,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.mapFeathers")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"pb-2"},{default:o.withCtx(()=>{var O;return[o.createElementVNode("div",nc,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((O=i.featherOptions)==null?void 0:O.filter($=>!$.hide),$=>(o.openBlock(),o.createElementBlock("div",{key:$.value,class:"mb-4 feather-item",onClick:de=>l.handleToggleMapFeather($)},[o.createElementVNode("div",{class:o.normalizeClass([i.mapboxFeather===$.value?"active":"","img-box"])},[$.value==="dark"?(o.openBlock(),o.createElementBlock("img",cc)):$.value==="nautical"?(o.openBlock(),o.createElementBlock("img",mc)):$.value==="satellite"?(o.openBlock(),o.createElementBlock("img",dc)):(o.openBlock(),o.createElementBlock("img",hc))],2),o.createElementVNode("div",pc,o.toDisplayString(t.$t(`layer.${$.locale}`)),1)],8,sc))),128))]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter($=>["graticule","day-night","time-zones"].includes($.key)),$=>(o.openBlock(),o.createBlock(d,{key:$.key,modelValue:i.checkList,"onUpdate:modelValue":e[0]||(e[0]=de=>i.checkList=de),value:$.key,label:t.$t(`layer.${$.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2 mx-n1","hide-details":""},null,8,["modelValue","value","label"]))),128))]}),_:1})]),_:1}),o.createVNode(f,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.pointsOfInteresting")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(O=>["ports","alert-zones","tidal-stations"].includes(O.key)),O=>(o.openBlock(),o.createBlock(d,{key:O.key,modelValue:i.checkList,"onUpdate:modelValue":e[1]||(e[1]=$=>i.checkList=$),value:O.key,label:t.$t(`layer.${O.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),o.createVNode(f,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.otherLayers")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(O=>!["graticule","day-night","time-zones","ports","alert-zones","tidal-stations"].includes(O.key)),O=>(o.openBlock(),o.createBlock(d,{key:O.key,modelValue:i.checkList,"onUpdate:modelValue":e[2]||(e[2]=$=>i.checkList=$),value:O.key,label:t.$t(`layer.${O.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),o.createVNode(f,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.myFollows")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[o.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":e[3]||(e[3]=O=>i.checkList=O),value:"follow-ports",label:t.$t("layer.ports"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"]),o.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":e[4]||(e[4]=O=>i.checkList=O),value:"follow-positions",label:t.$t("layer.locations"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"])]),_:1})]),_:1})],2)],6),a.map?(o.openBlock(),o.createBlock(g,o.mergeProps({key:0,ref:"idmPorts",simple:a.simple,map:a.map,ports:(le=i.otherLayers)==null?void 0:le.ports,gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,"real-time":a.realTime,theme:a.theme},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","ports","gateway","token","forecast-model","real-time","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(p,o.mergeProps({key:1,ref:"idmIideStation",simple:a.simple,map:a.map,gateway:a.gateway,token:a.token,"default-meteo-token":a.defaultMeteoToken,show:i.checkList.includes("tidal-stations"),theme:a.theme,"real-time":a.realTime,"forecast-model":a.forecastModel,"before-layer":"empty-layer-3"},t.$attrs),null,16,["simple","map","gateway","token","default-meteo-token","show","theme","real-time","forecast-model"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(h,o.mergeProps({key:2,simple:a.simple,map:a.map,"menu-toggle":a.menuToggle,show:i.checkList.includes("graticule")},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","menu-toggle","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(y,o.mergeProps({key:3,map:a.map,area:(S=i.otherLayers)==null?void 0:S["day-night"]},t.$attrs,{"before-layer":"empty-layer-2"}),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(k,o.mergeProps({key:4,map:a.map,zone:(W=i.otherLayers)==null?void 0:W["time-zones"],"real-time":a.realTime},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["map","zone","real-time"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(x,o.mergeProps({key:5,map:a.map,simple:a.simple,zone:(Z=i.otherLayers)==null?void 0:Z["alert-zones"]},t.$attrs,{"before-layer":"empty-layer-3",theme:a.theme}),null,16,["map","simple","zone","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(b,o.mergeProps({key:6,map:a.map,zone:(ee=i.otherLayers)==null?void 0:ee["eca-zones"]},t.$attrs),null,16,["map","zone"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(A,o.mergeProps({key:7,map:a.map,zone:(j=i.otherLayers)==null?void 0:j["war-zones"]},t.$attrs),null,16,["map","zone"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(v,o.mergeProps({key:8,map:a.map,area:(B=i.otherLayers)==null?void 0:B["gmdss-areas"]},t.$attrs),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(L,o.mergeProps({key:9,map:a.map,show:i.checkList.includes("load-lines")},t.$attrs),null,16,["map","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(C,o.mergeProps({key:10,map:a.map,token:a.token,show:i.checkList.includes("worldMarine")},t.$attrs),null,16,["map","token","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(_,o.mergeProps({key:11,map:a.map,area:(J=i.otherLayers)==null?void 0:J["voluntary-reporting-area"]},t.$attrs),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(N,o.mergeProps({key:12,map:a.map,area:(E=i.otherLayers)==null?void 0:E["special-area"]},t.$attrs),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(M,o.mergeProps({key:13,map:a.map,token:a.token,show:i.checkList.includes("world12nm")},t.$attrs),null,16,["map","token","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(T,o.mergeProps({key:14,map:a.map,token:a.token,show:i.checkList.includes("chinaRoute")},t.$attrs),null,16,["map","token","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(I,o.mergeProps({key:15,map:a.map,show:i.checkList.includes("ice-areas")},t.$attrs),null,16,["map","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(X,o.mergeProps({key:16,map:a.map,show:i.checkList.includes("nsr")},t.$attrs),null,16,["map","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(Q,o.mergeProps({key:17,ref:"idmFollowPort",simple:a.simple,map:a.map,show:i.checkList.includes("follow-ports"),gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,"real-time":a.realTime},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","show","gateway","token","forecast-model","real-time"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(q,o.mergeProps({key:18,ref:"idmFollowPosition",simple:a.simple,map:a.map,show:i.checkList.includes("follow-positions"),"forecast-model":a.forecastModel,"real-time":a.realTime},t.$attrs),null,16,["simple","map","show","forecast-model","real-time"])):o.createCommentVNode("",!0)])}const uc=K(ac,[["render",gc]]);class to{constructor(e){oe(this,"map");oe(this,"mercator");oe(this,"rampColorLayer");oe(this,"rampColorSource");oe(this,"particleLayer");oe(this,"particleSource");oe(this,"rampColorCanvas");oe(this,"particleCanvas");oe(this,"ratio");this.map=e,this.mercator=new $r,this.rampColorLayer="ramp-color-layer",this.rampColorSource="ramp-color-source",this.particleLayer="particle-layer",this.particleSource="particle-source",this.rampColorCanvas=document.createElement("canvas"),this.particleCanvas=document.createElement("canvas"),this.ratio=window.devicePixelRatio}convertNLng(e,a=0){return e>180?this.convertNLng(e-360,a+1):e<-180?this.convertNLng(e+360,a+1):[e,a]}getBoundLngLat(){var a;const e=(a=this.map)==null?void 0:a.getBounds();return e?[[e._sw.lng,e._ne.lat],[e._ne.lng,e._ne.lat],[e._ne.lng,e._sw.lat],[e._sw.lng,e._sw.lat]]:[]}getBoundPixel(){var p,h;const e=(p=this.map)==null?void 0:p.getBounds();if(!e)return[];const a=((h=this.map)==null?void 0:h.getZoom())+1,r=[e._ne.lng,e._ne.lat],i=[e._sw.lng,e._sw.lat],[l,n]=this.convertNLng(r[0]),[s,c]=this.convertNLng(i[0]),[m,d]=this.mercator.px([l,r[1]],a),[u,f]=this.mercator.px([s,i[1]],a),g=Math.round(this.mercator.size*Math.pow(2,a)*(n+c));return[u,f,m+g,d]}getBoundRange(){const e=this.map.getZoom()+1,a=this.mercator.size*Math.pow(2,e),r=this.getBoundPixel();return[r[0]/a,r[2]/a,r[3]/a,r[1]/a]}getWorldCopy(e,a){const r=2**a,[i,l,n,s]=e.map(d=>~~(d/(r*256))),c=[];for(let d=s;d<=l;d++)for(let u=i;u<=n;u++)c.push([u,d]);return c.map(d=>{const u=2**a*256;return[d[0]*u,d[1]*u,u]})}resize(){let e=this.map.getSource(this.rampColorSource);e==null||e.setCoordinates(this.getBoundLngLat()),e=this.map.getSource(this.particleSource),e==null||e.setCoordinates(this.getBoundLngLat());const a=this.map.getCanvas(),r=Math.max(1,a.clientWidth),i=Math.max(1,a.clientHeight);for(const l of[this.rampColorCanvas,this.particleCanvas])l.width!==r&&(l.width=r),l.height!==i&&(l.height=i)}toggle(e){var i;if(!((i=this.map)!=null&&i.getLayer(this.rampColorLayer)))return;const a=this.map.getLayoutProperty(this.rampColorLayer,"visibility"),r=e?"visible":"none";a!==r&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",r)}toggleParticle(e){var i;if(!((i=this.map)!=null&&i.getLayer(this.particleLayer)))return;const a=this.map.getLayoutProperty(this.particleLayer,"visibility"),r=e?"visible":"none";a!==r&&this.map.setLayoutProperty(this.particleLayer,"visibility",r)}}class $e{isWebGL2(e){return typeof e.createVertexArray=="function"}createContext(e,a={}){const r=["webgl2","webgl"];for(const i of r)try{const l=i==="webgl2"?e.getContext("webgl2",a):e.getContext("webgl",a);if(l)return console.info("[WebGL] Renderer:",this.isWebGL2(l)?"WebGL 2":"WebGL 1"),l}catch{}return null}createParticleContext(e){return this.createContext(e,{alpha:!0,depth:!1,stencil:!1,antialias:!1,preserveDrawingBuffer:!0})}createShader(e,a,r){const i=e.createShader(a);if(i){const l=this.isWebGL2(e)?fe.toWebGL2(r,a===e.VERTEX_SHADER?"vertex":"fragment"):r;if(e.shaderSource(i,l),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)){const n=e.getShaderInfoLog(i);throw e.deleteShader(i),new Error(n||"error happened while create shader...")}}return i}createTexture(e,a,r,i,l,n,s){const c=e.createTexture();e.bindTexture(e.TEXTURE_2D,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i);const m=this.isWebGL2(e)?e.RGBA8:e.RGBA;if(l===null||l instanceof Uint8Array){if(n===void 0||s===void 0)throw e.deleteTexture(c),new Error("Pixel textures require explicit dimensions.");e.texImage2D(e.TEXTURE_2D,0,m,n,s,0,e.RGBA,e.UNSIGNED_BYTE,l)}else e.texImage2D(e.TEXTURE_2D,0,m,e.RGBA,e.UNSIGNED_BYTE,l);return e.bindTexture(e.TEXTURE_2D,null),c}createDataBuffer(e,a,r){if(e){const i=e.createBuffer();return a==="array"?(e.bindBuffer(e.ARRAY_BUFFER,i),r&&e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW)):a==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i),r&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,r,e.STATIC_DRAW)),i}return null}createProgram(e,a,r){const i=e.createProgram(),l=this.createShader(e,e.VERTEX_SHADER,a),n=this.createShader(e,e.FRAGMENT_SHADER,r);if(i&&l&&n&&(e.attachShader(i,l),e.attachShader(i,n),e.linkProgram(i),e.deleteShader(l),e.deleteShader(n),!e.getProgramParameter(i,e.LINK_STATUS))){const s=e.getProgramInfoLog(i);throw e.deleteProgram(i),new Error(s||"error happened while creating ramp color program")}return i}createProgramWrapper(e,a,r){const i=this.createProgram(e,a,r);if(i){const l={program:i},n=e.getProgramParameter(i,e.ACTIVE_ATTRIBUTES);for(let c=0;c<n;c++){const m=e.getActiveAttrib(i,c);l[m.name]=e.getAttribLocation(i,m.name)}const s=e.getProgramParameter(i,e.ACTIVE_UNIFORMS);for(let c=0;c<s;c++){const m=e.getActiveUniform(i,c);l[m.name]=e.getUniformLocation(i,m.name)}return l}}setup(e,a,r=!1,i,l){const n=document.createElement("canvas");n.width=256,n.height=1;const s=n.getContext("2d");if(s&&e){const c=s==null?void 0:s.createLinearGradient(0,0,256,0);return a.forEach(([m,d])=>{c.addColorStop(m,d)}),s.fillStyle=c,s.fillRect(0,0,256,1),{canvas:n,texture:this.createTexture(e,e.LINEAR,e.LINEAR,e.CLAMP_TO_EDGE,r?new Uint8Array(s.getImageData(0,0,256,1).data):n,i,l)}}}setupParticle(e,a=1e3,r="points",i=!1){const l=Math.ceil(Math.sqrt(a)),n=l*l,s=n*(r==="lines"?2:1),c=new Uint8Array(n*4);for(let p=0;p<c.length;p++)c[p]=Math.floor(Math.random()*256);const m=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,c,l,l),d=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,c,l,l);let u=null;if(!this.isWebGL2(e)){const p=new Float32Array(s);for(let h=0;h<s;h++)p[h]=h;u=this.createDataBuffer(e,"array",p)}const f=i?this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,null,l,l):null,g=i?this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,null,l,l):null;return{resolution:l,total:n,texture0:m,texture1:d,indexBuffer:u,renderMode:r,lifecycleTexture0:f,lifecycleTexture1:g}}bind(e,a,r){if(!e)return{};const i=this.createProgram(e,a,r);if(i){const l=this.createDataBuffer(e,"array",void 0),n=e.getAttribLocation(i,"a_position");e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0);const s=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(e,"array",s);const c=e.getAttribLocation(i,"a_texCoord");return e.enableVertexAttribArray(c),e.vertexAttribPointer(c,2,e.FLOAT,!1,0,0),{program:i,aPositionBuffer:l}}return{}}bindParticle(e,a,r,i,l,n){const s=this.createProgramWrapper(e,a,r),c=this.createProgramWrapper(e,i,l),m=this.createProgramWrapper(e,i,n),u=this.isWebGL2(e)?null:this.createDataBuffer(e,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),f=this.isWebGL2(e)?e.createVertexArray():null,g=e.createFramebuffer();return{particle:s,screen:c,update:m,quadBuffer:u,frameBuffer:g,vertexArray:f}}draw(e,a,r,i,l,n,s){var c,m;if(a&&r){e.resize(),a==null||a.viewport(0,0,(c=a==null?void 0:a.canvas)==null?void 0:c.width,(m=a==null?void 0:a.canvas)==null?void 0:m.height),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);try{a.useProgram(r);const d={resolution:a.getUniformLocation(r,"u_resolution"),image:a.getUniformLocation(r,"u_image"),color:a.getUniformLocation(r,"u_color"),scale:a.getUniformLocation(r,"u_scale"),uvRange:a.getUniformLocation(r,"u_range_u_v"),sRange:a.getUniformLocation(r,"u_range_s")};d.resolution&&a.uniform2f(d.resolution,a.canvas.width*e.ratio,a.canvas.height*e.ratio),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,i),d.image&&a.uniform1i(d.image,0),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,l),d.color&&a.uniform1i(d.color,1),s!=null&&s.uvRange&&(s!=null&&s.sRange)&&(d.uvRange&&a.uniform2f(d.uvRange,s.uvRange[0],s.uvRange[1]),d.sRange&&a.uniform2f(d.sRange,s.sRange[0],s.sRange[1])),d.scale&&a.uniform1f(d.scale,(s==null?void 0:s.scale)||1);const u=e.getBoundPixel(),f=e.map.getZoom()+1,g=e.getWorldCopy(u,f);for(const p of g){const h=(p[0]-u[0])*e.ratio,y=(p[1]-u[3])*e.ratio,k=p[2]*e.ratio,[x,b,A,v]=[h,k+h,y,k+y],L=new Float32Array([x,A,b,A,x,v,x,v,b,A,b,v]);a.bindBuffer(a.ARRAY_BUFFER,n),a.bufferData(a.ARRAY_BUFFER,L,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6)}}catch(d){console.log(`render failed...${d}`)}}}drawParticle(e,a,r,i,l,n=0){!a||!i||!r||a.isContextLost()||((i.screenWidth!==a.canvas.width||i.screenHeight!==a.canvas.height)&&Object.assign(i,this.resize(e,a,i)),this.isWebGL2(a)&&a.bindVertexArray(i.vertexArray),a.disable(a.DEPTH_TEST),a.disable(a.STENCIL_TEST),a.disable(a.BLEND),a.disable(a.DITHER),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,r),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,i.texture0),i.lifecycleTexture0&&(a.activeTexture(a.TEXTURE3),a.bindTexture(a.TEXTURE_2D,i.lifecycleTexture0)),this.renderScreen(e,a,i,l),this.updateParticles(e,a,i,l,n),a.bindFramebuffer(a.FRAMEBUFFER,null),this.isWebGL2(a)&&a.bindVertexArray(null))}renderScreen(e,a,r,i){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.screenTexture,0),a.viewport(0,0,a.canvas.width,a.canvas.height),this.renderScreenTexture(a,r.backgroundTexture,r.screen,r.quadBuffer,i.fadeOpacity),this.renderParticles(e,a,r,i),a.bindFramebuffer(a.FRAMEBUFFER,null),this.renderScreenTexture(a,r.screenTexture,r.screen,r.quadBuffer,1);const l=r.backgroundTexture;r.backgroundTexture=r.screenTexture,r.screenTexture=l}renderScreenTexture(e,a,r,i,l){e&&(e.useProgram(r.program),this.isWebGL2(e)||(e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(r.a_pos),e.vertexAttribPointer(r.a_pos,2,e.FLOAT,!1,0,0)),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,a),e.uniform1i(r.u_screen,2),e.uniform1f(r.u_opacity,l),e.drawArrays(e.TRIANGLES,0,6))}renderParticles(e,a,r,i){if(a){a.useProgram(r.particle.program),this.isWebGL2(a)||(a.bindBuffer(a.ARRAY_BUFFER,r.indexBuffer),a.enableVertexAttribArray(r.particle.a_index),a.vertexAttribPointer(r.particle.a_index,1,a.FLOAT,!1,0,0)),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,r.color.texture),a.uniform1i(r.particle.u_factor,0),a.uniform1i(r.particle.u_particles,1),a.uniform1i(r.particle.u_color_ramp,2),a.uniform1f(r.particle.u_particles_resolution,r.resolution),a.uniform1f(r.particle.u_point,e.ratio);const l=e.getBoundRange();a.uniform4f(r.particle.u_viewport,l[0],l[1],l[2],l[3]),a.uniform2f(r.particle.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.particle.u_factor_max,i.uvRange[1],i.uvRange[1]),r.lifecycleTexture0&&(a.uniform1i(r.particle.u_lifecycle,3),a.uniform1i(r.particle.u_reset_lifecycle,r.resetLifecycle?1:0),a.enable(a.BLEND),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA)),r.renderMode==="lines"?(a.uniform2f(r.particle.u_resolution,a.canvas.width,a.canvas.height),a.uniform2f(r.particle.u_factor_res,r.image.width,r.image.height),a.uniform1f(r.particle.u_line_length,i.lineLength??6),a.uniform1f(r.particle.u_line_opacity,i.lineOpacity??1),a.lineWidth(1),a.drawArrays(a.LINES,0,r.total*2)):a.drawArrays(a.POINTS,0,r.total),r.lifecycleTexture0&&a.disable(a.BLEND)}}updateParticles(e,a,r,i,l=0){var s,c;if(a){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.texture1,0),a.viewport(0,0,r.resolution,r.resolution),a.useProgram(r.update.program),this.isWebGL2(a)||(a.bindBuffer(a.ARRAY_BUFFER,r.quadBuffer),a.enableVertexAttribArray(r.update.a_pos),a.vertexAttribPointer(r.update.a_pos,2,a.FLOAT,!1,0,0)),a.uniform1i(r.update.u_factor,0),a.uniform1i(r.update.u_particles,1);const m=e.getBoundRange();if(a.uniform4f(r.update.u_viewport,m[0],m[1],m[2],m[3]),a.uniform1f(r.update.u_rand_seed,Math.random()),a.uniform2f(r.update.u_factor_res,(s=r==null?void 0:r.image)==null?void 0:s.width,(c=r==null?void 0:r.image)==null?void 0:c.height),a.uniform2f(r.update.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.update.u_factor_max,i.uvRange[1],i.uvRange[1]),a.uniform1f(r.update.u_speed_factor,i.speedFactor*e.ratio),a.uniform1f(r.update.u_drop_rate,i.dropRate),a.uniform1f(r.update.u_drop_rate_bump,i.dropRateBump),r.lifecycleTexture0&&(a.uniform1i(r.update.u_lifecycle,3),a.uniform1i(r.update.u_reset_lifecycle,r.resetLifecycle?1:0),a.uniform1f(r.update.u_delta_seconds,Number.isFinite(l)?Math.max(0,l):0),a.uniform1i(r.update.u_write_lifecycle,0)),a.drawArrays(a.TRIANGLES,0,6),r.lifecycleTexture0){a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.lifecycleTexture1,0),a.uniform1i(r.update.u_write_lifecycle,1),a.drawArrays(a.TRIANGLES,0,6);const d=r.lifecycleTexture0;r.lifecycleTexture0=r.lifecycleTexture1,r.lifecycleTexture1=d,r.resetLifecycle=!1}}const n=r.texture0;r.texture0=r.texture1,r.texture1=n}resize(e,a,r){e.resize();const{width:i,height:l}=a.canvas;if((r==null?void 0:r.screenWidth)===i&&(r==null?void 0:r.screenHeight)===l)return r;r&&(a.deleteTexture(r.screenTexture||null),a.deleteTexture(r.backgroundTexture||null));const n=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,null,i,l),s=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,null,i,l);return{screenTexture:n,backgroundTexture:s,screenWidth:i,screenHeight:l}}destroyParticle(e,a){var r,i,l,n;if(!(!e||!a)){e.bindFramebuffer(e.FRAMEBUFFER,null),this.isWebGL2(e)&&(e.bindVertexArray(null),e.deleteVertexArray(a.vertexArray||null));for(const s of[a.texture0,a.texture1,a.screenTexture,a.backgroundTexture,(r=a.color)==null?void 0:r.texture])e.deleteTexture(s||null);a.lifecycleTexture0&&e.deleteTexture(a.lifecycleTexture0),a.lifecycleTexture1&&e.deleteTexture(a.lifecycleTexture1),e.deleteBuffer(a.indexBuffer||null),e.deleteBuffer(a.quadBuffer||null),e.deleteFramebuffer(a.frameBuffer||null);for(const s of[(i=a.particle)==null?void 0:i.program,(l=a.screen)==null?void 0:l.program,(n=a.update)==null?void 0:n.program])e.deleteProgram(s||null)}}async loadImg(e){return new Promise((a,r)=>{const i=typeof e!="string",l=i?URL.createObjectURL(new Blob([e],{type:e.type})):e,n=new Image,s=()=>{i&&URL.revokeObjectURL(l),n.onload=n.onerror=null};n.crossOrigin="anonymous",n.onload=()=>{s(),a(n)},n.onerror=()=>{s(),r(new Error("Unable to load weather texture."))},n.src=l})}}class fe{static toWebGL2(e,a){if(/^\s*#version\s+300\s+es\b/.test(e))return e;const r=e.replace(/^\s*#version\s+100\s*\n/,"").replace(/precision\s+(?:lowp|mediump|highp)\s+float\s*;/g,"").replace(/\battribute\b/g,"in").replace(/\bvarying\b/g,a==="vertex"?"out":"in").replace(/\btexture2D\b/g,"texture").replace(/\bgl_FragColor\b/g,"fragColor");return`#version 300 es
|
|
11
11
|
precision highp float;
|
|
12
12
|
${a==="fragment"?`out vec4 fragColor;
|
|
13
13
|
`:""}${r}`}}oe(fe,"vertexSchema",`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as l } from "./chunk-ANSXOGKI-
|
|
2
|
-
import "./chunk-3VYIPD3A-
|
|
3
|
-
import "./index-
|
|
1
|
+
import { d as l } from "./chunk-ANSXOGKI-f8908b25.js";
|
|
2
|
+
import "./chunk-3VYIPD3A-0288bf23.js";
|
|
3
|
+
import "./index-1e8b54cd.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as k } from "./chunk-T4JIPPZO-
|
|
2
|
-
import "./chunk-3VYIPD3A-
|
|
3
|
-
import "./index-
|
|
1
|
+
import { m as k } from "./chunk-T4JIPPZO-8cd08470.js";
|
|
2
|
+
import "./chunk-3VYIPD3A-0288bf23.js";
|
|
3
|
+
import "./index-1e8b54cd.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as u } from "./chunk-ANSXOGKI-
|
|
2
|
-
import { l as g } from "./index-
|
|
3
|
-
import "./chunk-3VYIPD3A-
|
|
1
|
+
import { d as u } from "./chunk-ANSXOGKI-f8908b25.js";
|
|
2
|
+
import { l as g } from "./index-1e8b54cd.js";
|
|
3
|
+
import "./chunk-3VYIPD3A-0288bf23.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|