@idmwx/idmui-gl4 3.1.6 → 3.1.8
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-c3f2a279.js → chunk-3VYIPD3A-1e694a3f.js} +1 -1
- package/dist/{chunk-ANSXOGKI-fafedfce.js → chunk-ANSXOGKI-1d61ad85.js} +1 -1
- package/dist/{chunk-T4JIPPZO-d3551934.js → chunk-T4JIPPZO-4aa92758.js} +1 -1
- package/dist/{download-d2ace138.js → download-bb602102.js} +3 -3
- package/dist/{index-24eb91d3.js → index-0bd6af2f.js} +20 -20
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/{rasterize-JS5G2XHH-89cfe273.js → rasterize-JS5G2XHH-070ec2c8.js} +3 -3
- package/dist/{toBlob-0271f0b1.js → toBlob-22c8db01.js} +3 -3
- package/dist/{toCanvas-32be45c3.js → toCanvas-00bde3ed.js} +2 -2
- package/dist/{toImg-f7528e1e.js → toImg-434da3cd.js} +3 -3
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as a } from "./chunk-3VYIPD3A-
|
|
1
|
+
import { W as a } from "./chunk-3VYIPD3A-1e694a3f.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-4aa92758.js";
|
|
2
|
+
import { W as f } from "./chunk-3VYIPD3A-1e694a3f.js";
|
|
3
|
+
import "./index-0bd6af2f.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|
|
@@ -11144,9 +11144,9 @@ const bp = {
|
|
|
11144
11144
|
filter: ["==", "$type", "LineString"],
|
|
11145
11145
|
layout: {
|
|
11146
11146
|
"symbol-placement": "line-center",
|
|
11147
|
-
"text-field": "{dist}
|
|
11147
|
+
"text-field": "{dist}nm / {bearing}°",
|
|
11148
11148
|
"text-rotation-alignment": "map",
|
|
11149
|
-
"text-size":
|
|
11149
|
+
"text-size": 11,
|
|
11150
11150
|
"text-offset": [0, -1]
|
|
11151
11151
|
},
|
|
11152
11152
|
paint: {
|
|
@@ -11214,9 +11214,9 @@ const bp = {
|
|
|
11214
11214
|
filter: ["==", "$type", "LineString"],
|
|
11215
11215
|
layout: {
|
|
11216
11216
|
"symbol-placement": "line-center",
|
|
11217
|
-
"text-field": "{dist}
|
|
11217
|
+
"text-field": "{dist}nm / {bearing}°",
|
|
11218
11218
|
"text-rotation-alignment": "map",
|
|
11219
|
-
"text-size":
|
|
11219
|
+
"text-size": 11,
|
|
11220
11220
|
"text-offset": [0, -1]
|
|
11221
11221
|
},
|
|
11222
11222
|
paint: {
|
|
@@ -17052,52 +17052,52 @@ Se.capture = async (t, e, a) => {
|
|
|
17052
17052
|
if (a !== br)
|
|
17053
17053
|
throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");
|
|
17054
17054
|
let i = await yr(t, e), o = { img: async (g, h) => {
|
|
17055
|
-
let { toImg: f } = await import("./toImg-
|
|
17055
|
+
let { toImg: f } = await import("./toImg-434da3cd.js");
|
|
17056
17056
|
return f(i, { ...g, ...h || {} });
|
|
17057
17057
|
}, svg: async (g, h) => {
|
|
17058
|
-
let { toSvg: f } = await import("./toImg-
|
|
17058
|
+
let { toSvg: f } = await import("./toImg-434da3cd.js");
|
|
17059
17059
|
return f(i, { ...g, ...h || {} });
|
|
17060
17060
|
}, canvas: async (g, h) => {
|
|
17061
|
-
let { toCanvas: f } = await import("./toCanvas-
|
|
17061
|
+
let { toCanvas: f } = await import("./toCanvas-00bde3ed.js");
|
|
17062
17062
|
return f(i, { ...g, ...h || {} });
|
|
17063
17063
|
}, blob: async (g, h) => {
|
|
17064
|
-
let { toBlob: f } = await import("./toBlob-
|
|
17064
|
+
let { toBlob: f } = await import("./toBlob-22c8db01.js");
|
|
17065
17065
|
return f(i, { ...g, ...h || {} });
|
|
17066
17066
|
}, png: async (g, h) => {
|
|
17067
|
-
let { rasterize: f } = await import("./rasterize-JS5G2XHH-
|
|
17067
|
+
let { rasterize: f } = await import("./rasterize-JS5G2XHH-070ec2c8.js");
|
|
17068
17068
|
return f(i, { ...g, ...h || {}, format: "png" });
|
|
17069
17069
|
}, jpeg: async (g, h) => {
|
|
17070
|
-
let { rasterize: f } = await import("./rasterize-JS5G2XHH-
|
|
17070
|
+
let { rasterize: f } = await import("./rasterize-JS5G2XHH-070ec2c8.js");
|
|
17071
17071
|
return f(i, { ...g, ...h || {}, format: "jpeg" });
|
|
17072
17072
|
}, webp: async (g, h) => {
|
|
17073
|
-
let { rasterize: f } = await import("./rasterize-JS5G2XHH-
|
|
17073
|
+
let { rasterize: f } = await import("./rasterize-JS5G2XHH-070ec2c8.js");
|
|
17074
17074
|
return f(i, { ...g, ...h || {}, format: "webp" });
|
|
17075
17075
|
}, download: async (g, h) => {
|
|
17076
|
-
let { download: f } = await import("./download-
|
|
17076
|
+
let { download: f } = await import("./download-bb602102.js");
|
|
17077
17077
|
return f(i, { ...g, ...h || {} });
|
|
17078
17078
|
} }, r = { ...e, export: { url: i }, exports: { svg: async (g) => {
|
|
17079
|
-
let { toSvg: h } = await import("./toImg-
|
|
17079
|
+
let { toSvg: h } = await import("./toImg-434da3cd.js");
|
|
17080
17080
|
return h(i, { ...e, ...g || {}, [qe]: !0 });
|
|
17081
17081
|
}, canvas: async (g) => {
|
|
17082
|
-
let { toCanvas: h } = await import("./toCanvas-
|
|
17082
|
+
let { toCanvas: h } = await import("./toCanvas-00bde3ed.js");
|
|
17083
17083
|
return h(i, { ...e, ...g || {}, [qe]: !0 });
|
|
17084
17084
|
}, png: async (g) => {
|
|
17085
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
17085
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-070ec2c8.js");
|
|
17086
17086
|
return h(i, { ...e, ...g || {}, format: "png", [qe]: !0 });
|
|
17087
17087
|
}, jpeg: async (g) => {
|
|
17088
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
17088
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-070ec2c8.js");
|
|
17089
17089
|
return h(i, { ...e, ...g || {}, format: "jpeg", [qe]: !0 });
|
|
17090
17090
|
}, jpg: async (g) => {
|
|
17091
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
17091
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-070ec2c8.js");
|
|
17092
17092
|
return h(i, { ...e, ...g || {}, format: "jpeg", [qe]: !0 });
|
|
17093
17093
|
}, webp: async (g) => {
|
|
17094
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
17094
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-070ec2c8.js");
|
|
17095
17095
|
return h(i, { ...e, ...g || {}, format: "webp", [qe]: !0 });
|
|
17096
17096
|
}, blob: async (g) => {
|
|
17097
|
-
let { toBlob: h } = await import("./toBlob-
|
|
17097
|
+
let { toBlob: h } = await import("./toBlob-22c8db01.js");
|
|
17098
17098
|
return h(i, { ...e, ...g || {}, [qe]: !0 });
|
|
17099
17099
|
}, img: async (g) => {
|
|
17100
|
-
let { toImg: h } = await import("./toImg-
|
|
17100
|
+
let { toImg: h } = await import("./toImg-434da3cd.js");
|
|
17101
17101
|
return h(i, { ...e, ...g || {}, [qe]: !0 });
|
|
17102
17102
|
} } }, l = await Fg("defineExports", r), c = Object.assign({}, ...l.filter((g) => g && typeof g == "object")), s = { ...o, ...c };
|
|
17103
17103
|
s.jpeg && !s.jpg && (s.jpg = (g, h) => s.jpeg(g, h));
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as n, D as x, L as D, a as T, b as S, M as W, g as f, f as h, P as k, d as y, T as V, V as d, W as u, e as w } from "./index-
|
|
1
|
+
import { c as n, D as x, L as D, a as T, b as S, M as W, g as f, f as h, P as k, d as y, T as V, V as d, W as u, e as w } from "./index-0bd6af2f.js";
|
|
2
2
|
import "axios";
|
|
3
3
|
import "vuetify";
|
|
4
4
|
import "vue";
|
package/dist/index.umd.cjs
CHANGED
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
<path
|
|
215
215
|
d="M420.66666667 959.17a16.08 16.08 0 0 1-15.91-13.49A15.89 15.89 0 0 1 415.50666667 928c1.49-0.55 38.88-14.76 72.79-65.52A354.55 354.55 0 0 1 162.66666667 509.17a450.14 450.14 0 0 1 450.5-450.5 16.07 16.07 0 0 1 15.91 13.48 15.88 15.88 0 0 1-10.75 17.66c-1.58 0.58-39.13 14.9-73.07 65.95A354.22 354.22 0 0 1 871.66666667 509.17a16 16 0 0 1-0.52 4.05A450.14 450.14 0 0 1 420.66666667 959.17zM554.80666667 94.72C351.57666667 123.2 194.66666667 298.21 194.66666667 509.17c0 177.08 144.06 321.74 321.13 322.48a16 16 0 0 1 14.07 23.49c-16.11 30.42-34.27 52.37-50.85 68C682.25666667 894.63 839.16666667 719.63 839.16666667 508.67a15.94 15.94 0 0 1 0.47-3.86C837.30666667 329.33 693.82666667 187 517.80666667 186.67A16 16 0 0 1 503.66666667 163.21c16.21-30.69 34.47-52.79 51.14-68.49z"
|
|
216
216
|
fill="#ffffff" p-id="18386"></path>
|
|
217
|
-
</svg>`,he=document.createElement("div");he.className="idm-tropical-gl4-hourly-marker",he.innerHTML=`<div class="${N.geometry.coordinates[1]>=0?"center north":"center south"}">${re}</div>`;const ge=new ne.Marker(he).setLngLat(N.geometry.coordinates).addTo(this.map);this.interpolateMarkers.push(ge)}this.$emit("tropicalCenterPoints",j)}else(V=this.map)!=null&&V.getSource(this.interpolateSource)&&((G=this.map)==null||G.getSource(this.interpolateSource).setData(this.empty))},handleClick(t){var i,l,n,c,s,d,m,p,g,y,u;const e=t.features[0],a=(l=(i=this.tropicals)==null?void 0:i.data)==null?void 0:l.features.filter(h=>{var f;return h.geometry.type==="LineString"&&h.properties.type==="forecast"&&h.properties.name===((f=e==null?void 0:e.properties)==null?void 0:f.name)}),r=(c=(n=this.tropicals)==null?void 0:n.data)==null?void 0:c.features.filter(h=>{var f;return h.geometry.type==="LineString"&&h.properties.type==="history"&&h.properties.name===((f=e==null?void 0:e.properties)==null?void 0:f.name)});this.activeTropicals={name:((s=e==null?void 0:e.properties)==null?void 0:s.name)||"-",nameCn:((d=e==null?void 0:e.properties)==null?void 0:d.nameCn)||((m=e==null?void 0:e.properties)==null?void 0:m.name)||"-",Name:((p=e==null?void 0:e.properties)==null?void 0:p.Name)||"-",forecasts:a.map(h=>h.properties),history:(g=r[0])==null?void 0:g.properties,showCircle:(u=(y=a[0])==null?void 0:y.properties)==null?void 0:u.showCircle},this.showTropicalsInfo=!0,this.simple||this.drawTropicalsInfoMaker([t.lngLat.lng,t.lngLat.lat])},drawTropicalsInfoMaker(t){this.$nextTick(()=>{const e=document.getElementById("idm-tropical-gl4-info");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat(t).setOffset([220,0]):this.activeTropicalsMarker=new ne.Marker(e).setLngLat(t).setOffset([220,0]).addTo(this.map)})},handleCloseInfoMarker(){this.showTropicalsInfo=!1,this.$nextTick(()=>{var t;(t=this.activeTropicalsMarker)==null||t.remove(),this.activeTropicalsMarker=void 0})},handleForecastToggle(t){var r,i,l,n,c,s;t.disabled=!t.disabled;const e=`${t.name}-${t.model}`,a=(i=(r=this.map)==null?void 0:r.getSource(this.source)._data)==null?void 0:i.features;a.forEach(d=>{d.properties.category===e&&(d.properties.disabled=t.disabled)}),this.interpolateData.forEach(d=>{d.properties.category===e&&(d.properties.disabled=t.disabled)}),(n=(l=this.map)==null?void 0:l.getSource(this.source))==null||n.setData(D.featureCollection(a)),(s=(c=this.map)==null?void 0:c.getSource(this.clusterSource))==null||s.setData(D.featureCollection(a)),this.handleDateChange()},handleStrikeProbability(t){this.$emit("tropicalProbability",t)},handleToggleCircles(t){var e,a;t.showCircle=!t.showCircle,(a=(e=this.tropicals.data)==null?void 0:e.features)==null||a.forEach(r=>{r.properties.name===t.name&&(r.properties.showCircle=t.showCircle)}),this.handleRender()},handleComputePolygons(t){const e=[];for(const a of t){const r=a.properties.wind,i={ne:r.r7ne>=0?r.r7ne:void 0,se:r.r7se>=0?r.r7se:void 0,sw:r.r7sw>=0?r.r7sw:void 0,nw:r.r7nw>=0?r.r7nw:void 0},l=this.handleComputeArc(a.geometry.coordinates,i,{...a.properties,level:7});e.push(l);const n={ne:r.r10ne>=0?r.r10ne:void 0,se:r.r10se>=0?r.r10se:void 0,sw:r.r10sw>=0?r.r10sw:void 0,nw:r.r10nw>=0?r.r10nw:void 0},c=this.handleComputeArc(a.geometry.coordinates,n,{...a.properties,level:10});e.push(c)}return e},handleComputeArc(t,e,a){var l;const r=[];for(const n in e){const c=e[n]??0;let s;switch(n){case"ne":s=D.lineArc(t,c,0,90,{steps:c>0?32:1,units:"nauticalmiles"});break;case"se":s=D.lineArc(t,c,90,180,{steps:c>0?32:1,units:"nauticalmiles"});break;case"sw":s=D.lineArc(t,c,180,270,{steps:c>0?32:1,units:"nauticalmiles"});break;case"nw":s=D.lineArc(t,c,270,360,{steps:c>0?32:1,units:"nauticalmiles"});break}r.push(...(l=s==null?void 0:s.geometry)==null?void 0:l.coordinates)}const i=D.lineString(r);return D.lineToPolygon(i,{properties:a})},handleNotification(t){this.$emit("tropicalNotification",t)},handleHover(t){var i,l,n,c,s;this.map.getCanvas().style.cursor="pointer";const a=this.map.queryRenderedFeatures(t.point,{layers:[this.pointCircleLayer,this.pointCircleLayer+"-border",this.historyPointCircleLayer,this.historyPointCircleLayer+"-border",this.historyPointCircleLayer+"-inner"]})[0];this.hoverPoint=a==null?void 0:a.properties;const r=(l=(i=this.tropicals)==null?void 0:i.data)==null?void 0:l.features.filter(d=>{var m;return d.geometry.type==="LineString"&&d.properties.type==="forecast"&&d.properties.name===((m=a==null?void 0:a.properties)==null?void 0:m.name)});this.hoverPoint&&(this.hoverPoint.lng=a.geometry.coordinates[0],this.hoverPoint.lat=a.geometry.coordinates[1],this.hoverPoint.update=(c=(n=r==null?void 0:r[0])==null?void 0:n.properties)==null?void 0:c.date,(s=this.hoverMarker)==null||s.remove(),this.showHoverPoint=!0,this.$nextTick(()=>{const d=document.getElementById("tropicalHoverMarkerInfo").cloneNode(!0);this.hoverMarker=new ne.Marker(d).setLngLat(a.geometry.coordinates).setOffset([160,0]).addTo(this.map)}))},handleLeave(){var t;this.map.getCanvas().style.cursor="grab",this.showHoverPoint=!1,(t=this.hoverMarker)==null||t.remove(),this.hoverMarker=void 0}}},km={class:"idm-tropical-gl4"},_m={class:"pb-1"},Lm={class:"text-h5 font-weight-600"},zm={key:0,class:"text-h5 font-weight-600"},Cm={class:"text-body-1"},vm={class:"text-label"},Sm={class:"d-flex justify-space-between align-center"},Nm={class:"w-60"},Vm={class:"text-label pr-1"},Pm={class:"flex-1-1-0"},Mm={class:"text-label pr-1"},Tm={class:"py-2 d-flex justify-space-between align-center"},Em={class:"w-60"},Dm={class:"text-label pr-1"},Rm={class:"flex-1-1-0"},Bm={class:"text-label pr-1"},Im={class:"d-flex align-center flex-1-1-100 justify-space-between mt-n1"},Am={class:"text-label pr-1",style:{width:"70px"}},Fm={class:"model-box d-flex justify-end align-center flex-wrap ga-1 pa-1"},Gm={class:"more"},Wm={key:0,class:"w-100 d-flex justify-space-between align-center px-2"},Om={class:"pa-1"},Zm={class:"legend d-flex justify-start align-center py-2"},jm={class:"label"},Hm={class:"legend d-flex justify-start align-center py-2"},Xm={class:"label"},Ym={class:"legend d-flex justify-start align-center py-2"},Um={class:"label"},$m={class:"pa-1"},Jm={class:"legend d-flex justify-start align-center py-2"},Km={class:"label"},qm={class:"legend d-flex justify-start align-center py-2"},Qm={class:"label"},ed={class:"legend d-flex justify-start align-center py-2"},td={class:"label"},od={class:"pa-1"},ad={class:"w-100 legend d-flex justify-start align-center py-2 ga-2"},id={class:"label"},rd={class:"label"},ld={class:"w-100 legend d-flex justify-start align-center py-2"},nd={class:"label"},sd={class:"w-100 legend d-flex justify-start align-center py-2"},cd={class:"label"},md={key:1,class:"my-3 w-100",style:{height:"80px"}},dd={class:"legend d-flex justify-start align-center"},hd={class:"label"},pd={class:"legend d-flex justify-start align-center"},gd={class:"label"},ud={class:"legend d-flex justify-start align-center"},fd={class:"label"},yd={class:"legend d-flex justify-start align-center"},bd={class:"label"},wd={class:"legend d-flex justify-start align-center"},xd={class:"label"},kd={class:"legend d-flex justify-start align-center"},_d={class:"label"},Ld={class:"legend d-flex justify-start align-center"},zd={class:"label"},Cd={class:"legend d-flex justify-start align-center"},vd={class:"label"},Sd={class:"legend d-flex justify-start align-center"},Nd={class:"label"},Vd={class:"legend d-flex justify-start align-center"},Pd={class:"label"},Md={class:"d-flex justify-star align-center"},Td={class:"font-weight-600 mr-1"},Ed={class:""},Dd={class:"port-box d-flex flex-column justify-center align-start ga-2"},Rd={key:0,class:"d-flex justify-start align-center"},Bd={class:"text-label pr-1"},Id={key:1,class:"d-flex justify-start align-center"},Ad={class:"text-label pr-1"},Fd={key:2,class:"d-flex justify-start align-center"},Gd={class:"text-label pr-1"},Wd={key:3,class:"d-flex justify-start align-center"},Od={class:"text-label pr-1"},Zd={key:4,class:"d-flex justify-start align-center"},jd={class:"text-label pr-1"},Hd={key:5,class:"d-flex justify-start align-center"},Xd={class:"text-label pr-1"},Yd={class:"d-flex justify-start align-center"},Ud={class:"text-label pr-1"},$d={key:6,class:"d-flex justify-start align-center"},Jd={class:"text-label pr-1"},Kd={key:7,class:"d-flex justify-start align-center"},qd={class:"text-label pr-1"},Qd={class:"d-flex justify-start align-center"},eh={class:"text-label pr-1"};function th(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCardText"),d=o.resolveComponent("VDivider"),m=o.resolveComponent("VCardActions"),p=o.resolveComponent("VCard"),g=o.resolveComponent("VCardTitle");return o.openBlock(),o.createElementBlock("div",km,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+86+"px",right:i.right+"px"})},[o.createVNode(c,{text:t.$t("tropical.tropicals"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:y})=>[o.createVNode(n,o.mergeProps(y,{"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[2]||(e[2]=[o.createElementVNode("i",{class:"iconfont icon-Tropical text-h4"},null,-1)])),_:2,__:[2]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),i.showTropicalsInfo&&!t.$attrs.hideTropicalsLegend?(o.openBlock(),o.createElementBlock("div",{key:0,id:"idm-tropical-gl4-info",ref:"tropicalsInfo",class:o.normalizeClass(["idm-tropical-gl4-info",a.simple?"page":"dialog"])},[o.createVNode(p,{class:o.normalizeClass(["w-100",a.simple?"rounded-t-4 bg-none":""]),elevation:a.simple?0:16},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>{var y,u,h,f,k,w,b,x,C,L,z,v;return[o.createElementVNode("div",_m,[o.createElementVNode("span",Lm,o.toDisplayString(a.locale==="en"?(y=i.activeTropicals)==null?void 0:y.Name:((u=i.activeTropicals)==null?void 0:u.nameCn)||((h=i.activeTropicals)==null?void 0:h.Name)||"-"),1),(k=(f=i.activeTropicals)==null?void 0:f.history)!=null&&k.levelI18n?(o.openBlock(),o.createElementBlock("span",zm," , "+o.toDisplayString(t.$t("tropical."+((b=(w=i.activeTropicals)==null?void 0:w.history)==null?void 0:b.levelI18n))),1)):o.createCommentVNode("",!0)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"close",onClick:o.withModifiers(l.handleCloseInfoMarker,["stop"])},{default:o.withCtx(()=>e[3]||(e[3]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[3]},8,["onClick"]),o.createElementVNode("div",Cm,[o.createElementVNode("span",vm,o.toDisplayString(t.$t("actions.lastUpdate"))+": ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTime(((C=(x=i.activeTropicals)==null?void 0:x.history)==null?void 0:C.updated)||((v=(z=(L=i.activeTropicals)==null?void 0:L.forecasts)==null?void 0:z.filter(M=>!M.disabled)[0])==null?void 0:v.date),a.timeZone)),1)])]}),_:1}),o.createVNode(d),o.createVNode(s,{class:"text-body-1 py-3"},{default:o.withCtx(()=>{var y,u,h,f,k,w,b,x,C;return[o.createElementVNode("div",Sm,[o.createElementVNode("div",Nm,[o.createElementVNode("label",Vm,o.toDisplayString(t.$t("weather.windSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((u=(y=i.activeTropicals)==null?void 0:y.history)==null?void 0:u.kts)||"-")+" kts",1),o.createElementVNode("span",null,", BF "+o.toDisplayString(l.computeBF(((f=(h=i.activeTropicals)==null?void 0:h.history)==null?void 0:f.kts)||"-")),1)]),o.createElementVNode("div",Pm,[o.createElementVNode("label",Mm,o.toDisplayString(t.$t("weather.pressure"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((w=(k=i.activeTropicals)==null?void 0:k.history)==null?void 0:w.pressure)||"-")+" hPa",1)])]),o.createElementVNode("div",Tm,[o.createElementVNode("div",Em,[o.createElementVNode("label",Dm,o.toDisplayString(t.$t("tropical.moveSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((b=l.computeMovement(i.activeTropicals))==null?void 0:b.kts)||"-")+" kts",1)]),o.createElementVNode("div",Rm,[o.createElementVNode("label",Bm,o.toDisplayString(t.$t("tropical.moveDir"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((x=l.computeMovement(i.activeTropicals))==null?void 0:x.deg)||"-")+"°",1)])]),o.createElementVNode("div",Im,[o.createElementVNode("label",Am,o.toDisplayString(t.$t("tropical.models"))+" : ",1),o.createElementVNode("div",Fm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((C=i.activeTropicals)==null?void 0:C.forecasts,(L,z)=>(o.openBlock(),o.createBlock(n,{key:z,density:"compact",variant:L.disabled?"text":"flat",color:L.disabled?"":"primary","min-width":30,class:o.normalizeClass(["model text-none text-body-1 px-1",L.disabled?"btn-border-1 btn-bg-1":""]),onClick:o.withModifiers(v=>l.handleForecastToggle(L),["stop"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(L.model),1)]),_:2},1032,["variant","color","class","onClick"]))),128))])])]}),_:1}),o.createVNode(d),a.simple?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(m,{key:0,class:"d-flex justify-space-between"},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact","prepend-icon":"",variant:"text",color:i.showLegend?"primary":"",class:"text-none text-body-1",onClick:e[0]||(e[0]=o.withModifiers(y=>i.showLegend=!i.showLegend,["stop"]))},{prepend:o.withCtx(()=>e[4]||(e[4]=[o.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(t.$t("weather.legend")),1)]),_:1},8,["color"]),o.createElementVNode("div",Gm,[o.createVNode(n,{variant:"text",density:"compact","append-icon":"mdi-chevron-right",class:"text-none text-body-1",onClick:e[1]||(e[1]=o.withModifiers(y=>l.handleStrikeProbability(i.activeTropicals),["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.viewReport")),1)]),_:1})])]),_:1}))]),_:1},8,["class","elevation"]),a.simple?(o.openBlock(),o.createElementBlock("div",Wm,[o.createElementVNode("div",Om,[o.createElementVNode("div",Zm,[e[5]||(e[5]=o.createElementVNode("div",{class:"icon td"},null,-1)),o.createElementVNode("div",jm,o.toDisplayString(t.$t("tropical.td")),1)]),o.createElementVNode("div",Hm,[e[6]||(e[6]=o.createElementVNode("div",{class:"icon sts"},null,-1)),o.createElementVNode("div",Xm,o.toDisplayString(t.$t("tropical.sts")),1)]),o.createElementVNode("div",Ym,[e[7]||(e[7]=o.createElementVNode("div",{class:"icon sty"},null,-1)),o.createElementVNode("div",Um,o.toDisplayString(t.$t("tropical.sty")),1)])]),o.createElementVNode("div",$m,[o.createElementVNode("div",Jm,[e[8]||(e[8]=o.createElementVNode("div",{class:"icon ts"},null,-1)),o.createElementVNode("div",Km,o.toDisplayString(t.$t("tropical.ts")),1)]),o.createElementVNode("div",qm,[e[9]||(e[9]=o.createElementVNode("div",{class:"icon ty"},null,-1)),o.createElementVNode("div",Qm,o.toDisplayString(t.$t("tropical.ty")),1)]),o.createElementVNode("div",ed,[e[10]||(e[10]=o.createElementVNode("div",{class:"icon supper-ty"},null,-1)),o.createElementVNode("div",td,o.toDisplayString(t.$t("tropical.superTy")),1)])]),o.createElementVNode("div",od,[o.createElementVNode("div",ad,[e[11]||(e[11]=o.createElementVNode("div",{class:"icon history"},null,-1)),o.createElementVNode("div",id,o.toDisplayString(t.$t("tropical.history")),1),e[12]||(e[12]=o.createElementVNode("div",{class:"icon forecast"},null,-1)),o.createElementVNode("div",rd,o.toDisplayString(t.$t("tropical.forecast")),1)]),o.createElementVNode("div",ld,[e[13]||(e[13]=o.createElementVNode("div",{class:"icon r7"},null,-1)),o.createElementVNode("div",nd,"35kts "+o.toDisplayString(t.$t("tropical.radii")),1)]),o.createElementVNode("div",sd,[e[14]||(e[14]=o.createElementVNode("div",{class:"icon r10"},null,-1)),o.createElementVNode("div",cd,"50kts "+o.toDisplayString(t.$t("tropical.radii")),1)])])])):(o.openBlock(),o.createElementBlock("div",md,[o.withDirectives(o.createVNode(p,{elevation:"16"},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(["pa-1 d-flex justify-space-between align-center flex-wrap",a.locale==="zhHans"?" ga-2":" ga-3"])},[o.createElementVNode("div",dd,[e[15]||(e[15]=o.createElementVNode("div",{class:"icon td"},null,-1)),o.createElementVNode("div",hd,o.toDisplayString(t.$t("tropical.td")),1)]),o.createElementVNode("div",pd,[e[16]||(e[16]=o.createElementVNode("div",{class:"icon ts"},null,-1)),o.createElementVNode("div",gd,o.toDisplayString(t.$t("tropical.ts")),1)]),o.createElementVNode("div",ud,[e[17]||(e[17]=o.createElementVNode("div",{class:"icon sts"},null,-1)),o.createElementVNode("div",fd,o.toDisplayString(t.$t("tropical.sts")),1)]),o.createElementVNode("div",yd,[e[18]||(e[18]=o.createElementVNode("div",{class:"icon ty"},null,-1)),o.createElementVNode("div",bd,o.toDisplayString(t.$t("tropical.ty")),1)]),o.createElementVNode("div",wd,[e[19]||(e[19]=o.createElementVNode("div",{class:"icon sty"},null,-1)),o.createElementVNode("div",xd,o.toDisplayString(t.$t("tropical.sty")),1)]),o.createElementVNode("div",kd,[e[20]||(e[20]=o.createElementVNode("div",{class:"icon supper-ty"},null,-1)),o.createElementVNode("div",_d,o.toDisplayString(t.$t("tropical.superTy")),1)]),o.createElementVNode("div",Ld,[e[21]||(e[21]=o.createElementVNode("div",{class:"icon history"},null,-1)),o.createElementVNode("div",zd,o.toDisplayString(t.$t("tropical.history")),1)]),o.createElementVNode("div",Cd,[e[22]||(e[22]=o.createElementVNode("div",{class:"icon forecast"},null,-1)),o.createElementVNode("div",vd,o.toDisplayString(t.$t("tropical.forecast")),1)]),o.createElementVNode("div",Sd,[e[23]||(e[23]=o.createElementVNode("div",{class:"icon r7"},null,-1)),o.createElementVNode("div",Nd,"35kts "+o.toDisplayString(t.$t("tropical.radii")),1)]),o.createElementVNode("div",Vd,[e[24]||(e[24]=o.createElementVNode("div",{class:"icon r10"},null,-1)),o.createElementVNode("div",Pd,"50kts "+o.toDisplayString(t.$t("tropical.radii")),1)])],2),[[o.vShow,i.showLegend]])]),_:1})]),_:1},512),[[o.vShow,i.showLegend]])]))],2)):o.createCommentVNode("",!0),o.withDirectives(o.createVNode(p,{id:"tropicalHoverMarkerInfo",elevation:"16","max-width":"280"},{default:o.withCtx(()=>[o.createVNode(g,null,{default:o.withCtx(()=>{var y,u,h,f;return[o.createElementVNode("div",Md,[o.createElementVNode("span",Td,o.toDisplayString(a.locale==="en"?(y=i.hoverPoint)==null?void 0:y.Name:((u=i.hoverPoint)==null?void 0:u.nameCn)||((h=i.hoverPoint)==null?void 0:h.Name)),1),o.createElementVNode("span",Ed," ["+o.toDisplayString(t.$t("tropical."+((f=i.hoverPoint)==null?void 0:f.levelI18n)))+"]",1)])]}),_:1}),o.createVNode(d),o.createVNode(s,{class:"text-body-1"},{default:o.withCtx(()=>{var y,u,h,f,k,w,b,x,C,L,z,v,M,T,E,I,Z,Y,$,ae;return[o.createElementVNode("div",Dd,[((y=i.hoverPoint)==null?void 0:y.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Rd,[o.createElementVNode("label",Bd,o.toDisplayString(t.$t("tropical.updated"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((u=i.hoverPoint)==null?void 0:u.update,a.timeZone)),1)])):o.createCommentVNode("",!0),((h=i.hoverPoint)==null?void 0:h.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Id,[o.createElementVNode("label",Ad,o.toDisplayString(t.$t("tropical.forecast"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((f=i.hoverPoint)==null?void 0:f.date,a.timeZone)),1)])):o.createCommentVNode("",!0),((k=i.hoverPoint)==null?void 0:k.type)==="history"?(o.openBlock(),o.createElementBlock("div",Fd,[o.createElementVNode("label",Gd,o.toDisplayString(t.$t("tropical.forecast"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((w=i.hoverPoint)==null?void 0:w.date,a.timeZone)),1)])):o.createCommentVNode("",!0),((b=i.hoverPoint)==null?void 0:b.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Wd,[o.createElementVNode("label",Od,o.toDisplayString(t.$t("tropical.model"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((x=i.hoverPoint)==null?void 0:x.model)??"-"),1)])):o.createCommentVNode("",!0),((C=i.hoverPoint)==null?void 0:C.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Zd,[o.createElementVNode("label",jd,o.toDisplayString(t.$t("weather.wind"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((z=JSON.parse((L=i.hoverPoint)==null?void 0:L.wind))==null?void 0:z.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),((v=i.hoverPoint)==null?void 0:v.type)==="history"?(o.openBlock(),o.createElementBlock("div",Hd,[o.createElementVNode("label",Xd,o.toDisplayString(t.$t("weather.wind"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((M=i.hoverPoint)==null?void 0:M.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),o.createElementVNode("div",Yd,[o.createElementVNode("label",Ud,o.toDisplayString(t.$t("weather.pressure"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((T=i.hoverPoint)==null?void 0:T.pressure)??"-")+" hPa",1)]),((E=i.hoverPoint)==null?void 0:E.type)==="history"?(o.openBlock(),o.createElementBlock("div",$d,[o.createElementVNode("label",Jd,o.toDisplayString(t.$t("tropical.moveSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((Z=JSON.parse((I=i.hoverPoint)==null?void 0:I.movement))==null?void 0:Z.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),((Y=i.hoverPoint)==null?void 0:Y.type)==="history"?(o.openBlock(),o.createElementBlock("div",Kd,[o.createElementVNode("label",qd,o.toDisplayString(t.$t("tropical.moveDir"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((ae=JSON.parse(($=i.hoverPoint)==null?void 0:$.movement))==null?void 0:ae.deg)??"-")+" °",1)])):o.createCommentVNode("",!0),o.createElementVNode("div",Qd,[o.createElementVNode("label",eh,o.toDisplayString(t.$t("tropical.position"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computePosition(i.hoverPoint)),1)])])]}),_:1})]),_:1},512),[[o.vShow,i.showHoverPoint]])])}const jo=X(xm,[["render",th]]),By="",oh={name:"DateTimePicker",props:{width:{type:Number,default:null},height:{type:Number,default:30},position:{type:String,default:"top"},bgClass:{type:String,default:""},locale:{type:String,default:"en"},style:{type:Object,default:{}},intervalHour:{type:Number,default:3},timeZone:{type:Number},dateTime:{type:String},dayAbout:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1}},emits:["dateTime","currentTimestamp","currentRealTime","minTimestamp","maxTimestamp"],data(){return{showDatePicker:!1,minDate:void 0,maxDate:void 0,minTimestamp:void 0,maxTimestamp:void 0,currentDate:void 0,currentTime:void 0,currentTimestamp:void 0,currentDateTimeZ:void 0,currentDateTime:void 0,currentRealTime:void 0,timer:null}},computed:{getStyle(){const t=this.width||220;return this.position==="top"?{bottom:"40px",left:`-${(420-t)/2}px`}:this.position==="bottom"?{top:"40px",left:`-${(420-t)/2}px`}:this.position==="left"?{bottom:"-140px",left:"-428px"}:this.position==="right"?{bottom:"-140px",right:"-428px"}:{bottom:"40px",left:`-${(420-t)/2}px`}},hourOptions(){const t=[];for(let e=0;e<24;e++)t.push(e<10?`0${e}:00`:`${e}:00`);return t.filter((e,a)=>(a-this.timeZone)%this.intervalHour===0)},timeZoneNames(){return S.tz.names()},timeZoneName(){var t;return(t=this.timeZoneNames.filter(e=>S.tz(S(),e).utcOffset()===this.timeZone*60))==null?void 0:t[0]},utcTimeZoneName(){return"Africa/Abidjan"},localTimeZoneName(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"Asia/Shanghai"}},watch:{timeZone:{handler(t,e){t!==e&&(this.handleResetDateTime(this.dateTime),this.handleResetMinMax())}},dateTime:{handler(t,e){t&&this.handleResetDateTime(this.dateTime)},immediate:!0},currentTimestamp:{handler(){this.currentDateTimeZ=S(this.currentTimestamp).utc().format("yyyy-MM-DD HH:00[Z]"),this.$emit("dateTime",this.currentDateTimeZ),this.$emit("currentTimestamp",this.currentTimestamp),this.currentDateTime=`${S.tz(this.currentTimestamp,this.timeZoneName).clone().format("yyyy-MM-DD : HH:00")}`},immediate:!0},currentRealTime:{handler(t,e){t!==e&&this.$emit("currentRealTime",this.currentRealTime)}}},mounted(){this.timer=setInterval(()=>{this.currentRealTime=`${S.tz(S().unix()*1e3,this.timeZoneName).clone().format("HH:mm")}`},100),document.addEventListener("click",this.handleClickOutside)},unmounted(){clearInterval(this.timer),this.handleCancelDate(),document.removeEventListener("click",this.handleClickOutside)},methods:{handleReset(){this.handleResetDateTime(),this.handleResetMinMax()},handleResetDateTime(t){var i;const e=S(t).utc().date(),a=Math.ceil(S(t).utc().hour()/this.intervalHour)*this.intervalHour;this.currentTimestamp=((i=S(t))==null?void 0:i.utc().set({date:e,hour:a,minute:0,second:0,millisecond:0}).unix())*1e3;const r=S.tz(this.currentTimestamp,this.timeZoneName).clone();this.currentDate=r.clone().format("YYYY-MM-DD"),this.currentTime=r.clone().format("HH:00"),this.currentDateTime=`${S.tz(this.currentTimestamp,this.timeZoneName).clone().format("yyyy-MM-DD : HH:00")}`,this.currentRealTime=`${S.tz(S().unix()*1e3,this.timeZoneName).clone().format("HH:mm")}`},handleResetMinMax(){var i,l,n,c,s;if(!this.dayAbout.h||!this.dayAbout.f)return;const t=S().utc().date(),e=Math.ceil(S().utc().hour()/this.intervalHour)*this.intervalHour,a=((i=S())==null?void 0:i.utc().set({date:t,hour:e,minute:0,second:0,millisecond:0}).unix())*1e3,r=S.tz(a,this.timeZoneName).clone();this.minDate=r.clone().add(this.dayAbout.h,"day").format("yyyy-MM-DD"),this.maxDate=r.clone().add(this.dayAbout.f,"day").format("yyyy-MM-DD"),this.minTimestamp=((n=(l=S())==null?void 0:l.utc())==null?void 0:n.set({date:t+this.dayAbout.h,hour:0,minute:0,second:0,millisecond:0}).unix())*1e3,this.maxTimestamp=((s=(c=S())==null?void 0:c.utc())==null?void 0:s.set({date:t+this.dayAbout.f,hour:0,minute:0,second:0,millisecond:0}).unix())*1e3,this.$emit("minTimestamp",this.minTimestamp),this.$emit("maxTimestamp",this.maxTimestamp)},handleOpenDatePicker(){this.disabled||(this.showDatePicker=!this.showDatePicker)},handleUpdateMonth(t){const e=t||S.tz(this.currentTimestamp,this.timeZoneName).clone().month(),a=this.locale==="en"?S.tz(this.currentTimestamp,this.timeZoneName).set({month:e}).clone().format("MMM"):S.tz(this.currentTimestamp,this.timeZoneName).set({month:e}).clone().format("M月");this.$nextTick(()=>{const r=document.querySelector(".v-date-picker-controls__month-btn");r.innerText=a})},handleConfirmDate(){const t=S(this.currentDate).format("yyyy-MM-DD"),e=this.currentTime,a=`${t} ${e}`,r=S.tz(a,"YYYY-MM-DD HH:00",this.timeZoneName).clone().tz(this.localTimeZoneName);this.currentTimestamp=r.unix()*1e3,this.showDatePicker=!1},handleCancelDate(){this.showDatePicker=!1;const t=S.tz(this.currentTimestamp,this.timeZoneName).clone();this.currentDate=t.clone().format("YYYY-MM-DD"),this.currentTime=t.clone().format("HH:00")},handleClickOutside(t){const e=this.$refs.idmGl4Timepicker;e&&!e.contains(t.target)&&(this.showDatePicker=!1)}}},ah={ref:"idmGl4Timepicker",class:"idm-gl4-time-picker"},ih={class:"pa-0",style:{width:"320px"}},rh={class:"h-100 pa-0 d-flex flex-column justify-start align-center",style:{width:"100px"}},lh={class:"d-flex justify-center align-center text-body-2",style:{height:"44px"}};function nh(t,e,a,r,i,l){const n=o.resolveComponent("VDatePicker"),c=o.resolveComponent("VDivider"),s=o.resolveComponent("VListItemTitle"),d=o.resolveComponent("VListItem"),m=o.resolveComponent("VList"),p=o.resolveComponent("VCardText"),g=o.resolveComponent("VBtn"),y=o.resolveComponent("VCardActions"),u=o.resolveComponent("VCard");return o.openBlock(),o.createElementBlock("div",ah,[o.createElementVNode("div",{style:o.normalizeStyle({height:a.height+"px",width:a.width?a.width+"px":"auto"}),class:o.normalizeClass([[a.bgClass,{"cursor-pointer":!a.disabled}],"rounded text-body-1 btn-border-1 btn-bg-1 d-flex align-center justify-center px-2"]),onClick:e[0]||(e[0]=(...h)=>l.handleOpenDatePicker&&l.handleOpenDatePicker(...h))},o.toDisplayString(i.currentDateTime)+" | UTC "+o.toDisplayString(a.timeZone<0?a.timeZone:"+"+a.timeZone),7),i.showDatePicker?(o.openBlock(),o.createBlock(u,{key:0,class:"card-box d-flex flex-column border elevation-12",style:o.normalizeStyle(l.getStyle)},{default:o.withCtx(()=>[o.createVNode(p,{class:"w-100 flex-1-1-0 d-flex pa-0 text-body-1"},{default:o.withCtx(()=>[o.createElementVNode("div",ih,[o.createVNode(n,{modelValue:i.currentDate,"onUpdate:modelValue":e[1]||(e[1]=h=>i.currentDate=h),min:i.minDate,max:i.maxDate,"weekday-format":"narrow",color:"primary",density:"compact",class:"w-100","hide-header":""},null,8,["modelValue","min","max"])]),o.createVNode(c,{class:"h-100",vertical:""}),o.createElementVNode("div",rh,[o.createElementVNode("div",lh,o.toDisplayString(t.$t("time.time")),1),o.createVNode(m,{class:"pa-0 flex-1-1-0 scroll"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.hourOptions,(h,f)=>(o.openBlock(),o.createBlock(d,{key:f,value:h,color:"primary",active:i.currentTime===h,rounded:"",height:"26","min-height":"26",class:"rounded-xl",variant:i.currentTime===h?"flat":"text"},{default:o.withCtx(()=>[o.createVNode(s,{class:"text-body-2 font-weight-600 text-center",onClick:k=>i.currentTime=h},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h),1)]),_:2},1032,["onClick"])]),_:2},1032,["value","active","variant"]))),128))]),_:1})])]),_:1}),o.createVNode(c),o.createVNode(y,{class:"w-100 d-flex justify-end align-center px-4 ga-4",style:{height:"50px"}},{default:o.withCtx(()=>[o.createVNode(g,{size:"small",variant:"tonal",class:"text-none text-body-1 px-4",onClick:l.handleCancelDate},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.cancel")),1)]),_:1},8,["onClick"]),o.createVNode(g,{size:"small",variant:"flat",color:"primary",class:"text-none text-body-1 px-4",onClick:l.handleConfirmDate},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.confirm")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["style"])):o.createCommentVNode("",!0)],512)}const qe=X(oh,[["render",nh]]),Iy="",sh={name:"IdmPoint",components:{DateTimePicker:qe},props:{simple:{type:Boolean,default:!1},isLogin:{type:Boolean,default:!1},token:{type:String},defaultMeteoToken:{type:String},theme:{type:String,default:"zh"},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},gateway:{type:String},timeZone:{type:Number},forecastModel:{type:String},realTime:{type:String},followList:{type:Array,default:()=>[]}},emits:["meteoMore","follow","cancelFollow","login"],data(){return{right:10,toggle:!1,showForm:!1,showMeteo:!1,loading:!1,form:{lng:void 0,lngDegree:void 0,lngMinute:void 0,lngDirection:"E",lat:void 0,latDegree:void 0,latMinute:void 0,latDirection:"N",dateTime:void 0,forecastModel:""},formRules:{lngDegree:[t=>t!=null&&t!==""||"required",t=>/^\d{1,3}$/.test(t)||"number",t=>parseInt(t)>=0&&parseInt(t)<=180||"0 ~ 180"],lngMinute:[t=>t===void 0||t===null&&t===""||/^\d{1,2}(\.\d+)?$/.test(t)||"number",t=>t===void 0||t===null&&t===""||parseInt(t)>=0&&parseInt(t)<=59||"0 ~ 59"],latDegree:[t=>t!=null&&t!==""||"required",t=>/^\d{1,2}$/.test(t)||"number",t=>parseInt(t)>=0&&parseInt(t)<=90||"0 ~ 90"],latMinute:[t=>t===void 0||t===null&&t===""||/^\d{1,2}(\.\d+)?$/.test(t)||"number",t=>t===void 0||t===null&&t===""||parseInt(t)>=0&&parseInt(t)<=59||"0 ~ 59"]},meteoData:void 0,currentHourData:{},positionOffset:void 0,positionGmt:void 0,positionMarker:void 0,meteoInfoMarker:void 0}},computed:{timeZoneNames(){return S.tz.names()},timeZoneName(){var t;return(t=this.timeZoneNames.filter(e=>S.tz(S(),e).utcOffset()===this.timeZone*60))==null?void 0:t[0]},computedTzTime(){return t=>S.tz(S(t),this.timeZoneName).clone().format("YYYY-MM-DD HHmm")+" (UTC "+(this.timeZone>=0?"+":"")+this.timeZone+")"},computedLocalTime(){return t=>{var r,i,l;const e=Number((r=this.positionOffset)==null?void 0:r.slice(1,3))*(+(((i=this.positionOffset)==null?void 0:i.slice(1))==="+")?1:-1),a=(l=this.timeZoneNames.filter(n=>S.tz(S(),n).utcOffset()===e*60))==null?void 0:l[0];return t?S.tz(S(t),a).clone().format("YYYY-MM-DD HHmm")+" (UTC "+(e>=0?"+":"")+e+")":"-"}},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}},computeRoundPrecision(){return function(t,e=4){return t==null||isNaN(t)||isNaN(e)?"-":P.LngLatHelper.roundPrecision(t,e)}}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},toggle:{handler(){this.toggle?this.showForm=!0:(this.showForm=!1,this.showMeteo=!1),this.map&&this.handleBind()},immediate:!0},map:{handler(){this.toggle=!1,this.map&&this.toggle&&this.handleBind()}},showForm:{handler(){this.showForm?this.$nextTick(()=>{var t;(t=this.$refs.spotForm)==null||t.resetValidation()}):this.handleCloseForm()}},showMeteo:{handler(){var t,e,a,r,i,l;this.showMeteo?((a=(e=(t=this.$parent)==null?void 0:t.$refs)==null?void 0:e.idmBottomBar)==null||a.handleToggle("spot",!0),this.simple&&this.$nextTick(()=>{var n,c;this.$parent.playerBottom=((c=(n=this.$refs.spotMeteo)==null?void 0:n.$el)==null?void 0:c.clientHeight)+10})):((l=(i=(r=this.$parent)==null?void 0:r.$refs)==null?void 0:i.idmBottomBar)==null||l.handleToggle("spot",!1),this.simple&&(this.$parent.playerBottom=30))}},realTime:{handler(){this.realTime&&(this.form.dateTime=this.realTime,this.showMeteo&&this.fetchData())}},forecastModel:{handler(){this.form.forecastModel=this.forecastModel},immediate:!0},"form.forecastModel":{handler(t,e){!t&&e&&(this.form.forecastModel=e==="GFS"?"ECMWF":"GFS")}}},methods:{handleMenuToggle(){this.isLogin?this.toggle=!this.toggle:this.$emit("login")},submitForm(){this.handleCloseMeteo(),this.$refs.spotForm.validate().then(async t=>{t!=null&&t.valid&&this.fetchData()})},cancelForm(){var t;(t=this.$refs.spotForm)==null||t.reset(),this.form={lng:void 0,lngDegree:void 0,lngMinute:void 0,lngDirection:"E",lat:void 0,latDegree:void 0,latMinute:void 0,latDirection:"N",dateTime:void 0,forecastModel:this.forecastModel}},handleCloseForm(){this.showForm=!1,this.cancelForm(),this.toggle=!1},async fetchData(){var a;if(isNaN(this.form.latDegree)||isNaN(this.form.latMinute)||isNaN(this.form.lngDegree)||isNaN(this.form.lngMinute))return!1;this.form.lat=(Number(this.form.latDegree??0)+Number(this.form.latMinute??0)/60)*(this.form.latDirection==="N"?1:-1),this.form.lng=(Number(this.form.lngDegree??0)+Number(this.form.lngMinute??0)/60)*(this.form.lngDirection==="E"?1:-1);const t=S();((a=S(this.realTime))==null?void 0:a.diff(t,"d",!0))>=0?await this.fetchForecastData(this.form):await this.fetchHistoryData(this.form)},async fetchForecastData(t){this.loading=!0,this.showMeteo=!0,this.form.lng=t.lng,this.form.lat=t.lat,this.form.followId=t.followId,this.handleDrawInfoMarker([t.lng,t.lat]),this.meteoData=[];const{weatherModels:e,marineModels:a}=Ae.Meteo2Assist.autoPickMeteoModel(t.forecastModel);let r={lat:t.lat,lng:t.lng,datetime:S(t.dateTime).utc().format(),forecastDays:t.day??3,weatherModels:e,marineModels:a};await le.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,r,{headers:{Authorization:this.token||this.defaultMeteoToken}}).then(i=>{(i==null?void 0:i.data.code)===0?(this.meteoData=i==null?void 0:i.data.data,this.meteoData.lng=t.lng,this.meteoData.lat=t.lat,this.initTableData(this.meteoData),this.loading=!1):this.loading=!1}).catch(()=>{this.loading=!1})},async fetchHistoryData(t){this.loading=!0,this.showMeteo=!0,this.form.lng=t.lng,this.form.lat=t.lat,this.form.followId=t.followId,this.handleDrawInfoMarker([t.lng,t.lat]),this.meteoData=[];const{weatherModels:e,marineModels:a}=Ae.Meteo2Assist.autoPickMeteoModel(t.forecastModel),r={lat:t.lat,lng:t.lng,datetime:S(t.dateTime).utc().format(),forecastDays:2,pastDays:1,weatherModels:e,marineModels:a};await le.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,r,{headers:{Authorization:this.token||this.defaultMeteoToken}}).then(i=>{(i==null?void 0:i.data.code)===0?(this.meteoData=i==null?void 0:i.data.data,this.meteoData.lng=t.lng,this.meteoData.lat=t.lat,this.initTableData(this.meteoData),this.loading=!1):this.loading=!1}).catch(()=>{this.loading=!1}),this.loading=!1},initTableData(t){var a,r,i,l,n,c,s,d,m,p,g,y,u,h,f,k,w,b,x,C,L,z,v,M,T,E,I,Z,Y,$,ae,V,G,W,U,A,B,j,N,q,re;this.currentHourData={},this.positionGmt=(r=(a=t==null?void 0:t.weather)==null?void 0:a[0])==null?void 0:r.timezone,this.positionOffset=(l=(i=t==null?void 0:t.weather)==null?void 0:i[0])==null?void 0:l.offset;const e=((n=Ae.Meteo2Assist.pickHourly(t,S(this.form.dateTime)))==null?void 0:n[0])||{};this.currentHourData.utc=e.utc,this.currentHourData.lat=t.lat,this.currentHourData.lng=t.lng,this.currentHourData.temp=this.computeRoundPrecision((c=e==null?void 0:e.weather)==null?void 0:c.temp,0)??"-",this.currentHourData.precipProbability=this.computeRoundPrecision((d=(s=e==null?void 0:e.weather)==null?void 0:s.precip)==null?void 0:d.probability,0)??"-",this.currentHourData.precip1h=this.computeRoundPrecision((p=(m=e==null?void 0:e.weather)==null?void 0:m.precip)==null?void 0:p.sum,0)??"-",this.currentHourData.visibility=this.computeRoundPrecision((g=e==null?void 0:e.weather)==null?void 0:g.visibility,0)??"-",this.currentHourData.windSpeed=this.computeRoundPrecision((u=(y=e==null?void 0:e.weather)==null?void 0:y.wind)==null?void 0:u.kts,1)??"-",this.currentHourData.windDir=((f=(h=e==null?void 0:e.weather)==null?void 0:h.wind)==null?void 0:f.direction)??"-",this.currentHourData.windLevel=this.computeRoundPrecision((w=(k=e==null?void 0:e.weather)==null?void 0:k.wind)==null?void 0:w.scale,0)??"-",this.currentHourData.windGust=this.computeRoundPrecision((x=(b=e==null?void 0:e.weather)==null?void 0:b.wind)==null?void 0:x.gusts,1)??"-",this.currentHourData.sigwaveHeight=this.computeRoundPrecision((L=(C=e==null?void 0:e.wave)==null?void 0:C.sig)==null?void 0:L.height,1)??"-",this.currentHourData.sigwaveDir=(v=(z=e==null?void 0:e.wave)==null?void 0:z.sig)==null?void 0:v.direction,this.currentHourData.sigwavePeriod=this.computeRoundPrecision((T=(M=e==null?void 0:e.wave)==null?void 0:M.sig)==null?void 0:T.period,1)??"-",this.currentHourData.windwaveHeight=this.computeRoundPrecision((I=(E=e==null?void 0:e.wave)==null?void 0:E.wd)==null?void 0:I.height,1)??"-",this.currentHourData.windwaveDir=(Y=(Z=e==null?void 0:e.wave)==null?void 0:Z.wd)==null?void 0:Y.direction,this.currentHourData.windwavePeriod=this.computeRoundPrecision((ae=($=e==null?void 0:e.wave)==null?void 0:$.wd)==null?void 0:ae.period,1)??"-",this.currentHourData.swellHeight=this.computeRoundPrecision((G=(V=e==null?void 0:e.wave)==null?void 0:V.swell)==null?void 0:G.height,1)??"-",this.currentHourData.swellDir=(U=(W=e==null?void 0:e.wave)==null?void 0:W.swell)==null?void 0:U.direction,this.currentHourData.swellPeriod=this.computeRoundPrecision((B=(A=e==null?void 0:e.wave)==null?void 0:A.swell)==null?void 0:B.period,1)??"-",this.currentHourData.currentSpeed=this.computeRoundPrecision((j=e==null?void 0:e.current)==null?void 0:j.speed,1)??"-",this.currentHourData.currentDir=(N=e==null?void 0:e.current)==null?void 0:N.direction,this.currentHourData.currentSpeed=this.computeRoundPrecision((q=e==null?void 0:e.current)==null?void 0:q.speed,1)??"-",this.currentHourData.seaLevel=this.computeRoundPrecision(e==null?void 0:e.height,1)??"-",this.currentHourData.seaTemp=this.computeRoundPrecision(e==null?void 0:e.sst,0)??"-",this.currentHourData.weatherUrls=(re=e==null?void 0:e.weather)==null?void 0:re.url},handleBind(){var t,e;this.toggle?((t=this.map)==null||t.on("click",this.handleClick),this.map&&(this.map.getCanvas().style.cursor="crosshair")):((e=this.map)==null||e.off("click",this.handleClick),this.handleCloseMeteo(),this.map&&(this.map.getCanvas().style.cursor="grab"))},handleClick(t){if(t.originalEvent.stopPropagation(),t.originalEvent.target.className==="mapboxgl-canvas")this.handleGetPosition(t.lngLat),this.$nextTick(()=>{this.fetchData()});else return!1},handleGetPosition(t){if(isNaN(t.lat)||isNaN(t.lng))return!1;this.form.latDegree=Number(P.LngLatHelper.lat2pretty(t.lat).degree),this.form.latMinute=Number(P.LngLatHelper.lat2pretty(t.lat).minute),this.form.latDirection=P.LngLatHelper.lat2pretty(t.lat).direction,this.form.lngDegree=Number(P.LngLatHelper.lng2pretty(t.lng).degree),this.form.lngMinute=Number(P.LngLatHelper.lng2pretty(t.lng).minute),this.form.lngDirection=P.LngLatHelper.lng2pretty(t.lng).direction},handleDrawInfoMarker(t){this.drawPositionMarker(t),this.simple||this.drawMeteoInfoMarker(t)},drawPositionMarker(t){t&&(this.map.flyTo({center:t,duration:300}),this.$nextTick(()=>{var a,r;(a=this.positionMarker)==null||a.remove();const e=(r=document.getElementById("idm-position-icon"))==null?void 0:r.cloneNode(!0);this.positionMarker=new ne.Marker(e).setLngLat(t).setOffset([0,-15]).addTo(this.map)}))},drawMeteoInfoMarker(t){this.$nextTick(()=>{var a;const e=document.getElementById("idm-gl4-spot-meteo");this.meteoInfoMarker?(a=this.meteoInfoMarker)==null||a.setLngLat(t):this.meteoInfoMarker=new ne.Marker(e).setLngLat(t).setOffset([0,-190]).addTo(this.map)})},handleMeteoMore(){this.form.forecastModel=this.forecastModel,this.$emit("meteoMore",this.form)},handleCloseMeteo(){this.showMeteo=!1,this.$nextTick(()=>{var t,e;(t=this.positionMarker)==null||t.remove(),this.positionMarker=void 0,(e=this.meteoInfoMarker)==null||e.remove(),this.meteoInfoMarker=void 0})},handleFollow(){this.$emit("follow",this.form)},handleCancelFollow(){var e,a,r;const t=((e=this.form)==null?void 0:e.followId)||((r=(a=this.followList)==null?void 0:a.find(i=>{var l,n;return(i==null?void 0:i.id)===this.form.followId||((l=i==null?void 0:i.coordinate)==null?void 0:l.lng)===this.form.lng&&((n=i==null?void 0:i.coordinate)==null?void 0:n.lat)===this.form.lat}))==null?void 0:r.id);this.$emit("cancelFollow",t)}}},ch={class:"idm-gl4-spot"},mh={class:"d-flex justify-start align-center"},dh={class:"text-h6 font-weight-600"},hh={class:"d-flex justify-start align-center ga-1 mb-2"},ph={class:"text-label"},gh={class:"d-flex justify-start align-center ga-1 mb-2"},uh={class:"text-label"},fh={class:"d-flex justify-start align-center ga-1 mb-2"},yh={class:"text-label"},bh={class:"d-flex justify-start align-center ga-1 mb-2"},wh={class:"text-label"},xh={class:"d-flex justify-start align-center"},kh={class:"mx-2"},_h={class:"mx-0 py-2 d-flex align-center justify-start"},Lh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},zh={class:"pa-0 px-0"},Ch={class:"mx-0 py-2 d-flex align-center justify-start"},vh={cols:"9",class:"pa-0 px-0"},Sh={class:"mx-0 py-2 d-flex align-center justify-start"},Nh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},Vh={style:{width:"150px"},class:"pa-0 text-left"},Ph={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Mh={cols:"3",class:"pa-0 px-0 text-left"},Th={class:"mx-0 py-2 d-flex align-center justify-start"},Eh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},Dh={style:{width:"150px"},class:"pa-0 text-left"},Rh={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Bh={cols:"3",class:"pa-0 text-left"},Ih={class:"mx-0 py-2 d-flex align-center justify-start"},Ah={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},Fh={style:{width:"150px"},class:"pa-0 text-left"},Gh={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Wh={class:"pa-0 text-left"},Oh={class:"d-flex justify-space-between align-center"},Zh={class:"d-flex justify-start align-center"},jh={class:"mx-1"},Hh={class:"d-flex justify-end align-center"},Xh={class:"mx-0 py-1 d-flex align-center justify-start"},Yh={style:{width:"60px"},class:"pa-0 pr-2 text-right opacity-50"},Uh={class:"pa-0 px-0"},$h={class:"mx-0 py-1 d-flex align-center justify-start"},Jh={class:"pa-0 px-0"},Kh={class:"gray-bg-2 mx-4 my-2 py-3 px-2 rounded text-font-13 d-flex align-center justify-space-between"},qh={class:"d-flex flex-column align-start justify-center ga-3"},Qh={class:"text-label pr-2"},ep={class:"text-label pr-2"},tp={class:"text-label pr-2"},op={class:"d-flex flex-column align-start justify-center ga-3"},ap={class:"text-label pr-2"},ip={class:"text-label pr-2"},rp={class:"text-label pr-2"},lp={id:"idm-position-icon"},np={class:"multi-color-icon",style:{height:"30px",width:"30px"},"aria-hidden":"true"},sp=["xlink:href"];function cp(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCardTitle"),d=o.resolveComponent("VDivider"),m=o.resolveComponent("VTextField"),p=o.resolveComponent("VCol"),g=o.resolveComponent("VRow"),y=o.resolveComponent("DateTimePicker"),u=o.resolveComponent("VBtnToggle"),h=o.resolveComponent("VCardText"),f=o.resolveComponent("VCardActions"),k=o.resolveComponent("VForm"),w=o.resolveComponent("VCard");return o.openBlock(),o.createElementBlock("div",ch,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+126+"px",right:i.right+"px"})},[o.createVNode(c,{text:t.$t("spot.spotsMeteo"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:b})=>[o.createVNode(n,o.mergeProps(b,{"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[8]||(e[8]=[o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h4"},null,-1)])),_:2,__:[8]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),i.showForm&&!a.simple?(o.openBlock(),o.createBlock(w,{key:0,class:"spot-form-card",style:o.normalizeStyle({top:a.top+a.paddingTop+126+"px",right:i.right+50+"px"})},{default:o.withCtx(()=>[o.createVNode(s,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("div",mh,[o.createElementVNode("div",dh,o.toDisplayString(t.$t("spot.spotWeather")),1)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleCloseForm},{default:o.withCtx(()=>e[9]||(e[9]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[9]},8,["onClick"])]),_:1}),o.createVNode(d),o.createVNode(k,{ref:"spotForm",autocomplete:"off",class:"form-box",onSubmit:o.withModifiers(l.submitForm,["prevent"])},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-body-1 pa-4"},{default:o.withCtx(()=>[o.createElementVNode("div",hh,[o.createElementVNode("div",ph,[o.createTextVNode(o.toDisplayString(t.$t("spot.lat")),1),e[10]||(e[10]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.latDegree,"onUpdate:modelValue":e[0]||(e[0]=b=>i.form.latDegree=b),rules:i.formRules.latDegree,label:"",density:"compact",variant:"outlined",height:"32px","min-height":"32px",required:"",dense:"",class:"text-body-1 input-btn-bg-1"},null,8,["modelValue","rules"]),e[11]||(e[11]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[11]}),o.createVNode(p,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.latMinute,"onUpdate:modelValue":e[1]||(e[1]=b=>i.form.latMinute=b),rules:i.formRules.latMinute,label:"",density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),e[12]||(e[12]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[12]}),o.createVNode(p,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 bg-primary",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:e[2]||(e[2]=b=>i.form.latDirection=i.form.latDirection==="N"?"S":"N")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.latDirection),1)]),_:1})]),_:1})]),_:1}),o.createElementVNode("div",gh,[o.createElementVNode("div",uh,[o.createTextVNode(o.toDisplayString(t.$t("spot.lng")),1),e[13]||(e[13]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.lngDegree,"onUpdate:modelValue":e[3]||(e[3]=b=>i.form.lngDegree=b),rules:i.formRules.lngDegree,density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),e[14]||(e[14]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[14]}),o.createVNode(p,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.lngMinute,"onUpdate:modelValue":e[4]||(e[4]=b=>i.form.lngMinute=b),rules:i.formRules.lngMinute,label:"",density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),e[15]||(e[15]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[15]}),o.createVNode(p,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 bg-primary",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:e[5]||(e[5]=b=>i.form.lngDirection=i.form.lngDirection==="E"?"W":"E")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.lngDirection),1)]),_:1})]),_:1})]),_:1}),o.createElementVNode("div",fh,[o.createElementVNode("div",yh,[o.createTextVNode(o.toDisplayString(t.$t("spot.dateTime")),1),e[16]||(e[16]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0 mb-4"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"12",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(y,o.mergeProps({"date-time":i.form.dateTime,"time-zone":a.timeZone},t.$attrs,{onDateTime:e[6]||(e[6]=b=>i.form.dateTime=b)}),null,16,["date-time","time-zone"])]),_:1})]),_:1}),o.createElementVNode("div",bh,[o.createElementVNode("div",wh,[o.createTextVNode(o.toDisplayString(t.$t("weather.forecastModel")),1),e[17]||(e[17]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0 mb-2"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"12",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(u,{modelValue:i.form.forecastModel,"onUpdate:modelValue":e[7]||(e[7]=b=>i.form.forecastModel=b),class:"w-100",rounded:"",height:"30",density:"compact",group:""},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"GFS",class:o.normalizeClass(["text-none flex-1-1-0",i.form.forecastModel==="GFS"?"":"btn-border-1 btn-bg-1"]),color:i.form.forecastModel==="GFS"?"primary":"","base-color":""},{default:o.withCtx(()=>e[18]||(e[18]=[o.createTextVNode(" NOAA ",-1)])),_:1,__:[18]},8,["class","color"]),o.createVNode(n,{density:"compact",height:"30",class:o.normalizeClass(["text-none flex-1-1-0",i.form.forecastModel==="ECMWF"?"":"btn-border-1 btn-bg-1"]),color:i.form.forecastModel==="ECMWF"?"primary":"","base-color":"",value:"ECMWF"},{default:o.withCtx(()=>e[19]||(e[19]=[o.createTextVNode(" ECMWF ",-1)])),_:1,__:[19]},8,["class","color"])]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),o.createVNode(d),o.createVNode(f,{class:"d-flex justify-end align-center ga-4 pa-4"},{default:o.withCtx(()=>[o.createVNode(n,{size:"small",variant:"tonal",class:"text-none text-body-1 btn-bg-1",onClick:l.cancelForm},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.clear")),1)]),_:1},8,["onClick"]),o.createVNode(n,{ref:"submitSpot",loading:i.loading,size:"small",variant:"flat",color:"primary",type:"submit",class:"text-none text-body-1"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.confirm")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["onSubmit"])]),_:1},8,["style"])):o.createCommentVNode("",!0),i.showMeteo&&!a.simple?(o.openBlock(),o.createBlock(w,{key:1,id:"idm-gl4-spot-meteo",class:"spot-meteo",style:{width:"490px","z-index":"9"}},{default:o.withCtx(()=>[o.createVNode(s,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("div",xh,[e[20]||(e[20]=o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h5 map-icon-aqua"},null,-1)),o.createElementVNode("div",kh,o.toDisplayString(l.computePosition(i.form||i.currentHourData)),1)]),o.createVNode(n,{class:"mr-n2",density:"comfortable",icon:"",variant:"plain",onClick:o.withModifiers(l.handleCloseMeteo,["stop"])},{default:o.withCtx(()=>e[21]||(e[21]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[21]},8,["onClick"])]),_:1}),o.createVNode(d),o.createVNode(h,{class:"text-body-1 px-0 py-1"},{default:o.withCtx(()=>{var b,x;return[o.createElementVNode("div",_h,[o.createElementVNode("div",Lh,o.toDisplayString(t.$t("time.time")),1),o.createElementVNode("div",zh,o.toDisplayString(l.computedTzTime((b=i.currentHourData)==null?void 0:b.utc)),1)]),o.createElementVNode("div",Ch,[e[22]||(e[22]=o.createElementVNode("div",{style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},"LT",-1)),o.createElementVNode("div",vh,o.toDisplayString(l.computedLocalTime((x=i.currentHourData)==null?void 0:x.utc)),1)]),o.createElementVNode("div",Sh,[o.createElementVNode("div",Nh,o.toDisplayString(t.$t("weather.wind")),1),o.createElementVNode("div",Vh,o.toDisplayString(i.currentHourData.windDir??"-")+"/"+o.toDisplayString(i.currentHourData.windSpeed??"-")+"kts/BF"+o.toDisplayString(i.currentHourData.windLevel??"-"),1),o.createElementVNode("div",Ph,o.toDisplayString(t.$t("weather.sigWave")),1),o.createElementVNode("div",Mh,o.toDisplayString(i.currentHourData.sigwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.sigwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.sigwavePeriod??"-")+"s ",1)]),o.createElementVNode("div",Th,[o.createElementVNode("div",Eh,o.toDisplayString(t.$t("weather.windWave")),1),o.createElementVNode("div",Dh,o.toDisplayString(i.currentHourData.windwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.windwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.windwavePeriod??"-")+"s ",1),o.createElementVNode("div",Rh,o.toDisplayString(t.$t("weather.swell")),1),o.createElementVNode("div",Bh,o.toDisplayString(i.currentHourData.swellDir??"-")+"/"+o.toDisplayString(i.currentHourData.swellHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.swellPeriod??"-")+"s ",1)]),o.createElementVNode("div",Ih,[o.createElementVNode("div",Ah,o.toDisplayString(t.$t("weather.current")),1),o.createElementVNode("div",Fh,o.toDisplayString(i.currentHourData.currentDir??"-")+"/"+o.toDisplayString(i.currentHourData.currentSpeed??"-")+"kts",1),o.createElementVNode("div",Gh,o.toDisplayString(t.$t("weather.visibility")),1),o.createElementVNode("div",Wh,o.toDisplayString(i.currentHourData.visibility??"-")+" nm",1)])]}),_:1}),o.createVNode(d),o.createVNode(f,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>{var b;return[(b=a.followList)!=null&&b.some(x=>{var C,L;return(x==null?void 0:x.id)===i.form.followId||((C=x==null?void 0:x.coordinate)==null?void 0:C.lng)===i.form.lng&&((L=x==null?void 0:x.coordinate)==null?void 0:L.lat)===i.form.lat})?(o.openBlock(),o.createBlock(n,{key:0,id:"idm-gl4-spot-meteo-follow",class:"text-none text-body-1",variant:"text",density:"compact",height:"32",onClick:o.withModifiers(l.handleCancelFollow,["stop"])},{prepend:o.withCtx(()=>e[23]||(e[23]=[o.createElementVNode("i",{class:"iconfont icon-yishoucang text-h6 text-warning"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(t.$t("actions.unfollow")),1)]),_:1},8,["onClick"])):(o.openBlock(),o.createBlock(n,{key:1,id:"idm-gl4-spot-meteo-unfollow",class:"text-none text-body-1",variant:"text",density:"compact",height:"32",onClick:o.withModifiers(l.handleFollow,["stop"])},{prepend:o.withCtx(()=>e[24]||(e[24]=[o.createElementVNode("i",{class:"iconfont icon-weishoucang text-h6"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.follow"))+" ",1)]),_:1},8,["onClick"])),o.createVNode(n,{height:"32",variant:"text",density:"compact","append-icon":"mdi-chevron-right",class:"text-none text-body-1",onClick:o.withModifiers(l.handleMeteoMore,["stop"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("spot.forecast")),1)]),_:1},8,["onClick"])]}),_:1})]),_:1})):o.createCommentVNode("",!0),i.showMeteo&&a.simple?(o.openBlock(),o.createBlock(w,{key:2,ref:"spotMeteo",class:"position-absolute bottom-0 rounded-t-4",style:{width:"100vw","z-index":"1001"}},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>{var b;return[o.createElementVNode("div",Oh,[o.createElementVNode("div",Zh,[e[25]||(e[25]=o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h5 map-icon-aqua"},null,-1)),o.createElementVNode("div",jh,o.toDisplayString(l.computePosition(i.form||i.currentHourData)),1)]),o.createElementVNode("div",Hh,[(b=a.followList)!=null&&b.some(x=>{var C,L;return(x==null?void 0:x.id)===i.form.followId||((C=x==null?void 0:x.coordinate)==null?void 0:C.lng)===i.form.lng&&((L=x==null?void 0:x.coordinate)==null?void 0:L.lat)===i.form.lat})?(o.openBlock(),o.createBlock(n,{key:0,class:"text-none text-body-1 rounded-circle",variant:"text",density:"compact",height:"32",width:"28","min-width":"28",onClick:o.withModifiers(l.handleCancelFollow,["stop"])},{default:o.withCtx(()=>e[26]||(e[26]=[o.createElementVNode("i",{class:"iconfont icon-yishoucang text-h4 text-warning"},null,-1)])),_:1,__:[26]},8,["onClick"])):(o.openBlock(),o.createBlock(n,{key:1,class:"text-none text-body-1 rounded-circle",variant:"plain",density:"compact",height:"32",width:"28","min-width":"28",onClick:o.withModifiers(l.handleFollow,["stop"])},{default:o.withCtx(()=>e[27]||(e[27]=[o.createElementVNode("i",{class:"iconfont icon-weishoucang text-h4"},null,-1)])),_:1,__:[27]},8,["onClick"])),o.createVNode(n,{class:"mr-n2",density:"comfortable",icon:"",variant:"plain",onClick:o.withModifiers(l.handleCloseMeteo,["stop"])},{default:o.withCtx(()=>e[28]||(e[28]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[28]},8,["onClick"])])]),e[29]||(e[29]=o.createElementVNode("div",{class:"px-5 py-0 text-label text-body-1"},"Spot Weather",-1))]}),_:1,__:[29]}),o.createVNode(d),o.createVNode(h,{class:"text-body-1 px-0 py-2"},{default:o.withCtx(()=>{var b,x;return[o.createElementVNode("div",Xh,[o.createElementVNode("div",Yh,o.toDisplayString(t.$t("time.time")),1),o.createElementVNode("div",Uh,o.toDisplayString(l.computedTzTime((b=i.currentHourData)==null?void 0:b.utc)),1)]),o.createElementVNode("div",$h,[e[30]||(e[30]=o.createElementVNode("div",{style:{width:"60px"},class:"pa-0 pr-2 text-right opacity-50"},"LT",-1)),o.createElementVNode("div",Jh,o.toDisplayString(l.computedLocalTime((x=i.currentHourData)==null?void 0:x.utc)),1)]),o.createElementVNode("div",Kh,[o.createElementVNode("div",qh,[o.createElementVNode("div",null,[o.createElementVNode("span",Qh,o.toDisplayString(t.$t("weather.wind")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.windDir??"-")+"/"+o.toDisplayString(i.currentHourData.windSpeed??"-")+"kts/BF"+o.toDisplayString(i.currentHourData.windLevel??"-"),1)]),o.createElementVNode("div",null,[o.createElementVNode("span",ep,o.toDisplayString(t.$t("weather.sigWave")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.sigwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.sigwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.sigwavePeriod??"-")+"s",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",tp,o.toDisplayString(t.$t("weather.windWave")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.windwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.windwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.windwavePeriod??"-")+"s",1)])]),o.createElementVNode("div",op,[o.createElementVNode("div",null,[o.createElementVNode("span",ap,o.toDisplayString(t.$t("weather.swell")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.swellDir??"-")+"/"+o.toDisplayString(i.currentHourData.swellHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.swellPeriod??"-")+"s",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",ip,o.toDisplayString(t.$t("weather.current")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.currentDir??"-")+"/"+o.toDisplayString(i.currentHourData.currentSpeed??"-")+"kts",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",rp,o.toDisplayString(t.$t("weather.visibility")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.visibility??"-")+" nm",1)])])])]}),_:1})]),_:1},512)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",lp,[(o.openBlock(),o.createElementBlock("svg",np,[o.createElementVNode("use",{"xlink:href":`#icon-spot-${a.theme}`},null,8,sp)]))],512),[[o.vShow,i.showMeteo]])])}const mp=X(sh,[["render",cp]]),Ay="",dp={name:"IdmMeasure",props:{simple:{type:Boolean,default:!1},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}}},setup(){return{Theme:fe.useTheme()}},data(){return{right:10,toggle:!1,geojson:[],source:"measure-source",layer:"measure-layer",labelLayer:"measure-label-layer",sumLayer:"measure-suml-layer",tmpSource:"measure-tmp-source",tmpLayer:"measure-tmp-layer",tmpLabelLayer:"measure-tmp-label-layer",closeMarkers:{},pointMarkers:{},tipMarker:void 0,contextmenu:void 0,navigation:"RL",currentLineIndex:1}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},toggle:{handler(){var t,e,a;if(this.toggle)this.handleBind();else{(t=this.map)==null||t.getCanvas().removeEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.off("mousemove",this.handleMove),(a=this.map)==null||a.off("dblclick",this.handleDblClick),this.map;let r=this.geojson.find(i=>!i.closed);r&&this.handleClear(r,!0),this.geojson=this.geojson.filter(i=>!!i.closed),r=D.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(r)}},immediate:!0},map:{handler(){this.map&&(this.toggle?this.handleBind():this.handleUnbind())}}},methods:{handleMenuToggle(){this.toggle=!this.toggle},handleBind(){var t,e,a,r,i;(t=this.map)==null||t.getCanvas().addEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.on("mousemove",this.handleMove),(a=this.map)==null||a.on("dblclick",this.handleDblClick),(r=this.map)==null||r.on("click",this.handleClick),(i=this.map)==null||i.on("contextmenu",this.handleContextmenu),this.map&&(this.map.getCanvas().style.cursor="crosshair")},handleUnbind(){var t,e,a,r,i;(t=this.map)==null||t.getCanvas().removeEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.off("mousemove",this.handleMove),(a=this.map)==null||a.off("dblclick",this.handleDblClick),(r=this.map)==null||r.off("click",this.handleClick),(i=this.map)==null||i.off("contextmenu",this.handleContextmenu);for(const l of this.geojson)this.handleClear(l,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")},handleKeydown(t){if(t.key==="Shift"){this.navigation=this.navigation==="RL"?"GC":"RL";const e=this.geojson.at(-1),a=e.features.filter(r=>r.geometry.type==="Point");a!=null&&a.length&&(a.at(-1).properties.mode=this.navigation),this.handleRender(e)}},handleDrag(t){var a,r,i,l,n,c,s,d,m,p;const e=(r=(a=t.target)==null?void 0:a._element)==null?void 0:r.id;if((e==null?void 0:e.split("-").length)===2){const g=this.geojson.filter(f=>f.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(f=>{var k;return((k=f._element)==null?void 0:k.id)===e})[0].setLngLat([(l=(i=t.target)==null?void 0:i._lngLat)==null?void 0:l.lng,(c=(n=t.target)==null?void 0:n._lngLat)==null?void 0:c.lat]);let u;g.features.forEach((f,k)=>{if(f.geometry.type==="Point"&&f.properties.id===e.split("-")[1]){u=k;return}});const h=g.features.filter(f=>f.geometry.type==="Point");this.handleTmpPointUpdate(g,h[u-1],{lng:(d=(s=t.target)==null?void 0:s._lngLat)==null?void 0:d.lng,lat:(p=(m=t.target)==null?void 0:m._lngLat)==null?void 0:p.lat,properties:h[u].properties},u===h.length-1?void 0:h[u+1])}},handleDragEnd(t){var a,r,i,l,n,c,s,d,m,p;const e=(r=(a=t.target)==null?void 0:a._element)==null?void 0:r.id;if((e==null?void 0:e.split("-").length)===2){const g=this.geojson.filter(h=>h.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(h=>{var f;return((f=h._element)==null?void 0:f.id)===e})[0].setLngLat([(l=(i=t.target)==null?void 0:i._lngLat)==null?void 0:l.lng,(c=(n=t.target)==null?void 0:n._lngLat)==null?void 0:c.lat]);const u=g.features.filter(h=>h.geometry.type==="Point"&&h.properties.id===e.split("-")[1])[0];u.geometry.coordinates=[(d=(s=t.target)==null?void 0:s._lngLat)==null?void 0:d.lng,(p=(m=t.target)==null?void 0:m._lngLat)==null?void 0:p.lat],g.features=g.features.filter(h=>h.geometry.type==="Point"),this.handlePointUpdate(g)}},handleContextmenu(t){var a,r,i,l;t.preventDefault(),(a=this.contextmenu)==null||a.remove();const e=(l=(i=(r=t.originalEvent)==null?void 0:r.target)==null?void 0:i.parentElement)==null?void 0:l.id;if((e==null?void 0:e.split("-").length)===2){const c=this.geojson.filter(s=>s.id===e.split("-")[0])[0].features.filter(s=>s.geometry.type==="Point");if(c.length>2&&c.filter(d=>d.properties.id===(e==null?void 0:e.split("-")[1]))[0]){const d=document.createElement("div");d.className="idm-gl4-measure-contextmenu-marker",d.innerHTML=`<span id="del-${e}" class="del-point">${this.$t("actions.detele")}</span>`,this.contextmenu=new ne.Marker(d).setOffset([24,0]).setLngLat([t.lngLat.lng,t.lngLat.lat]).addTo(this.map)}}},handleClick(t){var a,r,i,l,n,c;(a=this.contextmenu)==null||a.remove();const e=t.originalEvent.target.className;if(e==="marker-close"){const s=(i=(r=t.originalEvent)==null?void 0:r.srcElement)==null?void 0:i.id,d=this.geojson.filter(m=>m.id===s)[0];d&&this.handleClear(d,!0),this.geojson=this.geojson.filter(m=>m.id!==s),!this.toggle&&!((l=this.geojson)!=null&&l.some(m=>m.closed))&&this.handleUnbind()}else if(e==="del-point"){const s=(c=(n=t.originalEvent.target.id)==null?void 0:n.replace("del-",""))==null?void 0:c.split("-"),d=this.geojson.filter(m=>m.id===s[0])[0];d.features=d.features.filter(m=>m.geometry.type==="Point"&&m.properties.id!==s[1]),this.handlePointUpdate(d)}else if(e!=="marker-label"&&this.toggle){let s=this.geojson.at(-1);s||(s=D.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(s)),s.features=s.features.filter(m=>m.geometry.type==="Point");const d=D.feature({type:"Point",coordinates:[t.lngLat.lng,t.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation,sumLabel:"Start"});s.features.push(d),this.handlePointUpdate(s)}},handlePointUpdate(t){const e=t.features;if(e.length>1){let a=0;const r=[];for(let i=1;i<e.length;i++){const l=e[i-1],n=e[i],c=l.properties,s={lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]},d={lng:n.geometry.coordinates[0],lat:n.geometry.coordinates[1]},m=P.LaneHelper.calculateDistance(s,d,c.mode==="RL",4),p=P.LaneHelper.calculateBearing(s,d,c.mode==="RL",2);a=P.LngLatHelper.roundPrecision(a+m,4);let g;c.mode==="RL"?g=P.LngLatHelper.convertToMonotonicLng([s,d]):g=P.LngLatHelper.convertToMonotonicLng(P.LaneHelper.interpolateCoordinates(s,d,200));const y=D.lineString(g.map(h=>[h.lng,h.lat]));y.properties.dist=m,y.properties.bearing=p,y.properties.total=a,y.properties.name="Line "+this.currentLineIndex,r.push(y);const u=e[i];u.properties.totalDist=P.LngLatHelper.roundPrecision((c.totalDist?c.totalDist:0)+m,4),u.properties.sumLabel=u.properties.totalDist+" nm"}e.push(...r),t.total=a}return this.handleRender(t),t},handleTmpPointUpdate(t,e,a,r){const i=D.featureCollection([]);let l,n;if(e){const s=e.properties,d={lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]},m={lng:a.lng,lat:a.lat};l=P.LaneHelper.calculateDistance(d,m,s.mode==="RL",4),n=P.LaneHelper.calculateBearing(d,m,s.mode==="RL",2);let p;s.mode==="RL"?p=P.LngLatHelper.convertToMonotonicLng([d,m]):p=P.LngLatHelper.convertToMonotonicLng(P.LaneHelper.interpolateCoordinates(d,m,200));const g=D.lineString(p.map(y=>[y.lng,y.lat]));g.properties.dist=l,g.properties.bearing=n,i.features.push(g)}if(r){const s=a.properties,d=a,m={lng:r.geometry.coordinates[0],lat:r.geometry.coordinates[1]};l=P.LaneHelper.calculateDistance(d,m,s.mode==="RL",4),n=P.LaneHelper.calculateBearing(d,m,s.mode==="RL",2);let p;s.mode==="RL"?p=P.LngLatHelper.convertToMonotonicLng([d,m]):p=P.LngLatHelper.convertToMonotonicLng(P.LaneHelper.interpolateCoordinates(d,m,200));const g=D.lineString(p.map(y=>[y.lng,y.lat]));g.properties.dist=l,g.properties.bearing=n,i.features.push(g)}this.map.getSource(this.tmpSource)?this.map.getSource(this.tmpSource).setData(i):this.map.addSource(this.tmpSource,{type:"geojson",data:i}),this.map.getLayer(this.tmpLayer)||this.map.addLayer({id:this.tmpLayer,type:"line",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["map-orange"],"line-width":2,"line-opacity":1,"line-dasharray":[3,2]}}),this.map.getLayer(this.tmpLabelLayer)||this.map.addLayer({id:this.tmpLabelLayer,type:"symbol",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist} nm","text-rotation-alignment":"map","text-size":10,"text-offset":[0,-1]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}});let c;if(r)c=`<div class="marker-label">${this.$t("measure.dragTips")}</div>`;else{const s=P.LngLatHelper.roundPrecision((t.total??0)+l,1);c=`<div class="marker-label">${this.$t("measure.totalDistance")}: <b>${s}</b>nm, ${this.$t("measure.bearing")}: <b>${n}</b>°</div><div class="marker-label"> ${this.$t("measure.mode")}${this.navigation==="RL"?"RL":"GC"}, ${this.$t("measure.switchTips")}</div><div class="marker-label">${this.$t("measure.clickTips")}</div>`}if(this.tipMarker)this.tipMarker._element.innerHTML=c,this.tipMarker.setLngLat([a.lng,a.lat]);else{const s=document.createElement("div");s.className="idm-gl4-measure-tip-marker",s.innerHTML=c,this.tipMarker=new ne.Marker(s).setOffset([140,0]).setLngLat([a.lng,a.lat]).addTo(this.map)}},handleMove(t){this.map.getCanvas().style.cursor="crosshair";let e=this.geojson.at(-1);e||(e=D.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e));const a=e.features.filter(r=>r.geometry.type==="Point");a!=null&&a.length&&this.handleTmpPointUpdate(e,a.at(-1),{lng:t.lngLat.lng,lat:t.lngLat.lat})},handleDblClick(t){t.preventDefault();let e=this.geojson.at(-1);e.closed=!0,this.handleRender(e),e=D.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e),this.currentLineIndex++},handleRender(t){var e;if((e=t==null?void 0:t.features)!=null&&e.length){const a=`${t.id}-${this.source}`,r=`${t.id}-${this.layer}`,i=`${t.id}-${this.labelLayer}`,l=`${t.id}-${this.sumLayer}`;this.map.getSource(a)?this.map.getSource(a).setData(t):this.map.addSource(a,{type:"geojson",data:t}),this.handleClear(t,!1),this.map.addLayer({id:r,type:"line",source:a,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["map-orange"],"line-width":2}}),this.map.addLayer({id:i,type:"symbol",source:a,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist} nm","text-rotation-alignment":"map","text-size":10,"text-offset":[0,-1]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}}),this.map.addLayer({id:l,type:"symbol",source:a,filter:["==","$type","Point"],layout:{"text-field":"{sumLabel}","text-rotation-alignment":"map","text-size":12,"text-offset":[0,1.5]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}});const n=t.features.filter(c=>c.geometry.type==="Point");for(const c of n){const s=document.createElement("div");s.id=`${t.id}-${c.properties.id}`,s.className=`${t.closed?"idm-gl4-measure-marker closed":"idm-gl4-measure-marker"}`,s.innerHTML='<div class="marker-circle"></div>';const d=new ne.Marker({element:s,draggable:!0,contextmenu:!0}).setLngLat(c.geometry.coordinates).addTo(this.map);d.on("drag",this.handleDrag),d.on("dragend",this.handleDragEnd),this.pointMarkers[t.id]?this.pointMarkers[t.id].push(d):this.pointMarkers[t.id]=[d]}if(t.closed){const c=n.at(-1),d=t.features.filter(p=>p.geometry.type==="LineString").at(-1),m=document.createElement("div");m.className="idm-gl4-measure-summary-marker",m.innerHTML=`<div class="marker-label">${d.properties.name}</div><div id="${t.id}" class="marker-close">X</div>`,this.closeMarkers[t.id]=new ne.Marker(m).setOffset([0,-30]).setLngLat(c.geometry.coordinates).addTo(this.map)}}},handleClear(t,e=!0){var n,c,s,d,m,p,g,y,u,h;const a=`${t.id}-${this.source}`,r=`${t.id}-${this.layer}`,i=`${t.id}-${this.labelLayer}`,l=`${t.id}-${this.sumLayer}`;(n=this.map)!=null&&n.getLayer(r)&&this.map.removeLayer(r),(c=this.map)!=null&&c.getLayer(i)&&this.map.removeLayer(i),(s=this.map)!=null&&s.getLayer(l)&&this.map.removeLayer(l),(d=this.map)!=null&&d.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(m=this.map)!=null&&m.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(p=this.closeMarkers[t.id])==null||p.remove(),this.closeMarkers[t.id]=void 0,(g=this.pointMarkers[t.id])==null||g.forEach(f=>{f==null||f.remove()}),this.pointMarkers[t.id]=[],(y=this.tipMarker)==null||y.remove(),this.tipMarker=void 0,e&&((u=this.map)!=null&&u.getSource(a))&&this.map.removeSource(a),e&&((h=this.map)!=null&&h.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}},hp={class:"idm-gl4-measure"};function pp(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip");return o.openBlock(),o.createElementBlock("div",hp,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+166+"px",right:i.right+"px"})},[o.createVNode(c,{text:t.$t("measure.measure"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:s})=>[o.createVNode(n,o.mergeProps(s,{"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[0]||(e[0]=[o.createElementVNode("i",{class:"iconfont icon-a-Measuredistance text-h4"},null,-1)])),_:2,__:[0]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4)])}const gp=X(dp,[["render",pp]]),Fy="",up={name:"IdmDrawMarker",props:{map:{type:Object},gateway:{type:String},token:{type:String},simple:{type:Boolean,default:!1},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:()=>({})},editLayer:{type:Object,default:null},group:{type:Object,default:()=>({})}},emits:["close","save","hideLayer"],setup(){return{Theme:fe.useTheme()}},data(){var t;return{markerType:"Point",form:{latDegree:"",latMinute:"",latDir:"N",lngDegree:"",lngMinute:"",lngDir:"E",areaType:"Polygon",color:(t=this.Theme.current.value.colors)==null?void 0:t["map-green"],name:""},formRules:{lngDegree:[e=>e!=null&&e!==""||"required",e=>/^\d{1,3}$/.test(e)||"number",e=>parseInt(e)>=0&&parseInt(e)<=180||"0 ~ 180"],lngMinute:[e=>e==null||e===""||/^\d{1,2}(\.\d+)?$/.test(e)||"number",e=>e==null||e===""||parseInt(e)>=0&&parseInt(e)<=59||"0 ~ 59"],latDegree:[e=>e!=null&&e!==""||"required",e=>/^\d{1,2}$/.test(e)||"number",e=>parseInt(e)>=0&&parseInt(e)<=90||"0 ~ 90"],latMinute:[e=>e==null||e===""||/^\d{1,2}(\.\d+)?$/.test(e)||"number",e=>e==null||e===""||parseInt(e)>=0&&parseInt(e)<=59||"0 ~ 59"],color:[e=>e!=null&&e!==""||"required"],name:[e=>e!=null&&e!==""||"required"]},saving:!1,drawSource:"draw-marker-source",drawPointLayer:"draw-marker-point-layer",drawLineLayer:"draw-marker-line-layer",drawFillLayer:"draw-marker-fill-layer",drawTmpSource:"draw-marker-tmp-source",drawTmpLayer:"draw-marker-tmp-layer",drawCoords:[],rectCornerMarkers:[],polygonVertexMarkers:[],circleMarkers:[],drawRadiusSource:"draw-marker-radius-source",drawRadiusLayer:"draw-marker-radius-layer",tipMarker:null,pointMarker:null,pointHighlightMarker:null,editMarkers:[],deleteBtn:null,originalProperties:{}}},watch:{markerType:{handler(){var t;(t=this.editLayer)!=null&&t.id||(this.markerType==="Area"?this.form.name=`${this.form.areaType} 1`:this.form.name=`${this.markerType} 1`,this.handleClearDraw())},immediate:!0},"form.areaType"(){var t;(t=this.editLayer)!=null&&t.id||(this.markerType==="Area"?this.form.name=`${this.form.areaType} 1`:this.form.name=`${this.markerType} 1`,this.handleClearDraw())},map:{handler(){var t;this.map&&(this.handleBindMap(),(t=this.editLayer)!=null&&t.id&&this.loadEditLayer())},immediate:!0},"form.color":{handler(){this.handleChangePoint(),this.handleUpdateLayerColors()},immediate:!0}},beforeUnmount(){this.handleClearDraw(!0),this.handleUnbindMap()},methods:{handleClose(){this.handleClearDraw(!0),this.handleUnbindMap(),this.$emit("close")},handleBindMap(){var t,e;this.map&&(this.markerType==="Point"?(this.map.on("click",this.handleMapClickPoint),this.map.getCanvas().style.cursor="crosshair"):this.markerType==="Line"&&!((t=this.editLayer)!=null&&t.id)?(this.map.on("click",this.handleMapClickLine),this.map.on("mousemove",this.handleMapMoveLine),this.map.on("dblclick",this.handleMapDblClickLine),this.map.getCanvas().style.cursor="crosshair"):this.markerType==="Area"&&!((e=this.editLayer)!=null&&e.id)&&(this.form.areaType==="Polygon"?(this.map.on("click",this.handleMapClickPolygon),this.map.on("mousemove",this.handleMapMovePolygon),this.map.on("dblclick",this.handleMapDblClickPolygon)):this.form.areaType==="Circle"?(this.map.on("click",this.handleMapClickCircle),this.map.on("mousemove",this.handleMapMoveCircle)):this.form.areaType==="Rect"&&(this.map.on("click",this.handleMapClickRect),this.map.on("mousemove",this.handleMapMoveRect)),this.map.getCanvas().style.cursor="crosshair"))},handleUnbindMap(){this.map&&(this.map.off("click",this.handleMapClickPoint),this.map.off("click",this.handleMapClickLine),this.map.off("mousemove",this.handleMapMoveLine),this.map.off("dblclick",this.handleMapDblClickLine),this.map.off("click",this.handleMapClickPolygon),this.map.off("mousemove",this.handleMapMovePolygon),this.map.off("dblclick",this.handleMapDblClickPolygon),this.map.off("click",this.handleMapClickCircle),this.map.off("mousemove",this.handleMapMoveCircle),this.map.off("click",this.handleMapClickRect),this.map.off("mousemove",this.handleMapMoveRect),this.map.getCanvas().style.cursor="grab")},handleRebindMap(){this.handleUnbindMap(),this.handleBindMap()},loadEditLayer(){var i,l,n,c,s,d;if(!((i=this.editLayer)!=null&&i.extend)||!this.map)return;const t=typeof this.editLayer.extend=="string"?JSON.parse(this.editLayer.extend):this.editLayer.extend;if(!t)return;const a=(t.features||(t.type==="Feature"?[t]:[]))[0];if(!a)return;this.originalProperties=a.properties||{},this.form.name=this.editLayer.name||"",this.form.color=this.editLayer.color||((l=this.originalProperties)==null?void 0:l.color)||((n=this.Theme.current.value.colors)==null?void 0:n["map-green"])||"#4CAF50";const r=(c=a.geometry)==null?void 0:c.type;if(r==="Point"){this.markerType="Point";const[m,p]=a.geometry.coordinates;this.drawCoords=[[m,p]],this.form.latDegree=Number(P.LngLatHelper.lat2pretty(p).degree),this.form.latMinute=Number(P.LngLatHelper.lat2pretty(p).minute),this.form.latDir=P.LngLatHelper.lat2pretty(p).direction,this.form.lngDegree=Number(P.LngLatHelper.lng2pretty(m).degree),this.form.lngMinute=Number(P.LngLatHelper.lng2pretty(m).minute),this.form.lngDir=P.LngLatHelper.lng2pretty(m).direction,this.handleRenderPoint(this.drawCoords,this.form.color),this.setupPointEdit()}else r==="LineString"?(this.markerType="Line",this.$nextTick(()=>{this.handlerRenderEditLine(a),this.setupLineEdit(),this.handleUnbindMap()})):r==="Polygon"&&(this.markerType="Area",this.form.areaType=(d=(s=this.originalProperties)==null?void 0:s.shape)==null?void 0:d.toLowerCase(),this.$nextTick(()=>{this.handlerRenderEditPolygon(t),this.setupPolygonEdit(a),this.handleUnbindMap()}));this.$emit("hideLayer",this.editLayer.id)},setupPointEdit(){var a;if(!this.pointMarker)return;this.pointMarker.setDraggable(!0),this.pointMarker.off("drag",this.handlePointDrag),this.pointMarker.on("drag",this.handlePointDrag),this.pointMarker.off("dragend",this.handlePointDrag),this.pointMarker.on("dragend",this.handlePointDrag),(a=this.pointHighlightMarker)==null||a.remove();const t=document.createElement("div");t.className="idm-gl4-point-center-ring";const e=this.pointMarker.getLngLat();this.pointHighlightMarker=new ne.Marker({element:t,anchor:"center",offset:[0,0]}).setLngLat(e).addTo(this.map),this.pointMarker.on("drag",()=>{var r;(r=this.pointHighlightMarker)==null||r.setLngLat(this.pointMarker.getLngLat())})},handlePointDrag(){const{lng:t,lat:e}=this.pointMarker.getLngLat();this.drawCoords=[[t,e]],this.form.latDegree=Number(P.LngLatHelper.lat2pretty(e).degree),this.form.latMinute=Number(P.LngLatHelper.lat2pretty(e).minute),this.form.latDir=P.LngLatHelper.lat2pretty(e).direction,this.form.lngDegree=Number(P.LngLatHelper.lng2pretty(t).degree),this.form.lngMinute=Number(P.LngLatHelper.lng2pretty(t).minute),this.form.lngDir=P.LngLatHelper.lng2pretty(t).direction},clearEditMarkers(){this.editMarkers.forEach(t=>t.remove()),this.editMarkers=[],this._edgeContextMenuHandler&&this.map&&(this.map.off("contextmenu",this._edgeContextMenuHandler),this._edgeContextMenuHandler=null)},handlerRenderEditLine(t){this.drawCoords=t.geometry.coordinates.map(r=>[...r]);const e=D.featureCollection([t,...this.drawCoords.map(r=>D.point(r))]);this.handleSetDrawSource(e);const a=3;this.map.getLayer(this.drawLineLayer)||this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":a}})},setupLineEdit(){this.clearEditMarkers(),this.drawCoords.forEach((e,a)=>{const r=document.createElement("div");r.className="idm-gl4-edit-vertex",r.style.backgroundColor=this.form.color;const i=new ne.Marker({element:r,draggable:!0}).setLngLat(e).addTo(this.map);i.on("dragstart",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:l,lat:n}=i.getLngLat();this.handleRenderVertexLabel([l,n],40)}),i.on("drag",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:l,lat:n}=i.getLngLat();this.handleUpdateVertexLabel([l,n]),this.drawCoords[a]=[l,n],this.handlerRenderEditLine(D.lineString(this.drawCoords,{type:"Line",color:this.form.color}))}),i.on("dragend",()=>{this.map.getCanvas().style.cursor="grab";const{lng:l,lat:n}=i.getLngLat();this.drawCoords[a]=[l,n],this.handlerRenderEditLine(D.lineString(this.drawCoords,{type:"Line",color:this.form.color})),this.handleClearVertexLabels()}),r.addEventListener("contextmenu",l=>{l.preventDefault(),l.stopPropagation(),this.drawCoords.length>2&&this.showDeleteButton(e,()=>{this.drawCoords.splice(a,1),this.handlerRenderEditLine(D.lineString(this.drawCoords,{type:"Line",color:this.form.color})),this.setupLineEdit()})}),this.editMarkers.push(i)});const t=e=>{e.preventDefault();const{lng:a,lat:r}=e.lngLat,i=D.point([a,r]),l=D.lineString(this.drawCoords),n=D.nearestPointOnLine(l,i);if(n){const c=n.properties.index;this.showDeleteButton([a,r],()=>{this.drawCoords.splice(c+1,0,[a,r]),this.handlerRenderEditLine(D.lineString(this.drawCoords,{type:"Line",color:this.form.color})),this.setupLineEdit()},this.$t("actions.add")||"新增","add")}};this.map.on("contextmenu",t),this._edgeContextMenuHandler=t},showDeleteButton(t,e,a,r="delete"){this.hideDeleteButton();const i=this.map.getContainer(),l=document.createElement("button");l.textContent=a||this.$t("actions.delete"),l.className=r==="add"?"idm-gl4-edit-add-btn":"idm-gl4-edit-delete-btn";const n=this.map.project(t);l.style.left=`${n.x}px`,l.style.top=`${n.y}px`;const c=s=>{s.stopPropagation(),e(),this.hideDeleteButton()};l.addEventListener("click",c),i.appendChild(l),this.deleteBtn=l,this.map.once("click",()=>this.hideDeleteButton())},hideDeleteButton(){this.deleteBtn&&(this.deleteBtn.remove(),this.deleteBtn=null)},handlerRenderEditPolygon(t){this.handleSetDrawSource(t);const e=3;this.map.getLayer(this.drawFillLayer)?(this.map.setPaintProperty(this.drawLineLayer,"line-width",e),this.map.getLayer(this.drawPointLayer)&&this.map.setPaintProperty(this.drawPointLayer,"circle-color",this.form.color)):(this.map.addLayer({id:this.drawFillLayer,type:"fill",source:this.drawSource,filter:["==","$type","Polygon"],paint:{"fill-color":this.form.color,"fill-opacity":.35}}),this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","Polygon"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":e}}),this.map.addLayer({id:this.drawPointLayer,type:"circle",source:this.drawSource,filter:["==","$type","Point"],paint:{"circle-radius":3,"circle-color":this.form.color,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}))},setupPolygonEdit(t){this.clearEditMarkers();const e=t.geometry.coordinates[0].slice(0,-1);this.drawCoords=e.map(r=>[...r]),this.drawCoords.forEach((r,i)=>{const l=document.createElement("div");l.className="idm-gl4-edit-vertex",l.style.backgroundColor=this.form.color;const n=new ne.Marker({element:l,draggable:!0}).setLngLat(r).addTo(this.map);n.on("dragstart",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:c,lat:s}=n.getLngLat();this.handleRenderVertexLabel([c,s])}),n.on("drag",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:c,lat:s}=n.getLngLat();this.handleUpdateVertexLabel([c,s]),this.drawCoords[i]=[c,s],this.handleRenderPolygonFill(this.drawCoords)}),n.on("dragend",()=>{this.map.getCanvas().style.cursor="grab";const{lng:c,lat:s}=n.getLngLat();this.drawCoords[i]=[c,s],this.handleRenderPolygonFill(this.drawCoords),this.handleClearVertexLabels()}),l.addEventListener("contextmenu",c=>{c.preventDefault(),c.stopPropagation(),this.drawCoords.length>3&&this.showDeleteButton(r,()=>{this.drawCoords.splice(i,1),this.handleRenderPolygonFill(this.drawCoords),this.handleClearVertexLabels(),this.setupPolygonEdit({geometry:{type:"Polygon",coordinates:[[...this.drawCoords,this.drawCoords[0]]]},properties:this.originalProperties})})}),this.editMarkers.push(n)});const a=r=>{r.preventDefault();const{lng:i,lat:l}=r.lngLat,n=D.point([i,l]),c=D.lineString([...this.drawCoords,this.drawCoords[0]]),s=D.nearestPointOnLine(c,n);if(s){const d=s.properties.index,m=d>=this.drawCoords.length-1?this.drawCoords.length-1:d;this.showDeleteButton([i,l],()=>{this.drawCoords.splice(m+1,0,[i,l]),this.handleRenderPolygonFill(this.drawCoords),this.handleClearVertexLabels(),this.setupPolygonEdit({geometry:{type:"Polygon",coordinates:[[...this.drawCoords,this.drawCoords[0]]]},properties:this.originalProperties})},this.$t("actions.add")||"新增","add")}};this.map.on("contextmenu",a),this._edgeContextMenuHandler=a},handleMapClickPoint(t){var r;const{lng:e,lat:a}=t.lngLat;this.drawCoords=[[e,a]],this.form.latDegree=Number(P.LngLatHelper.lat2pretty(a).degree),this.form.latMinute=Number(P.LngLatHelper.lat2pretty(a).minute),this.form.latDir=P.LngLatHelper.lat2pretty(a).direction,this.form.lngDegree=Number(P.LngLatHelper.lng2pretty(e).degree),this.form.lngMinute=Number(P.LngLatHelper.lng2pretty(e).minute),this.form.lngDir=P.LngLatHelper.lng2pretty(e).direction,this.handleRenderPoint(this.drawCoords,this.form.color),(r=this.editLayer)!=null&&r.id&&this.setupPointEdit()},handleChangePoint(){var g;const{latDegree:t,latMinute:e,latDir:a,lngDegree:r,lngMinute:i,lngDir:l}=this.form,n=parseFloat(t),c=parseFloat(e),s=parseFloat(r),d=parseFloat(i);if(isNaN(n)||isNaN(s))return;const m=(n+(isNaN(c)?0:c)/60)*(a==="S"?-1:1),p=(s+(isNaN(d)?0:d)/60)*(l==="W"?-1:1);this.drawCoords=[[p,m]],this.handleRenderPoint(this.drawCoords,this.form.color),(g=this.editLayer)!=null&&g.id&&this.setupPointEdit()},handleRenderPoint(t,e){var i;if((i=this.pointMarker)==null||i.remove(),!t||!t.length)return;const[a,r]=t[0];this.pointMarker=new ne.Marker({color:e}).setLngLat([a,r]).addTo(this.map)},handleMapClickLine(t){var r;const{lng:e,lat:a}=t.lngLat;this.drawCoords.push([e,a]),this.handleRenderLine(this.drawCoords),(r=this.editLayer)!=null&&r.id&&this.setupLineEdit()},handleMapMoveLine(t){if(!this.drawCoords.length)return;const{lng:e,lat:a}=t.lngLat;this.handleRenderTmpLine(this.drawCoords.at(-1),[e,a])},handleMapDblClickLine(t){t.preventDefault(),this.drawCoords.length>1&&this.drawCoords.pop(),this.handleRenderLine(this.drawCoords),this.handleClearTmp(),this.map.off("click",this.handleMapClickLine),this.map.off("mousemove",this.handleMapMoveLine),this.map.off("dblclick",this.handleMapDblClickLine)},handleRenderLine(t){if(!t||t.length<1)return;const e=[];t==null||t.forEach((i,l)=>{e.push(P.GeoJsonHelper.drawPoint(i==null?void 0:i[1],i==null?void 0:i[0]))}),(t==null?void 0:t.length)>=2&&e.push(P.GeoJsonHelper.drawLine(t));const a=2,r=D.featureCollection(e);this.handleSetDrawSource(r),this.map.getLayer(this.drawLineLayer)?(this.map.setPaintProperty(this.drawLineLayer,"line-color",this.form.color),this.map.setPaintProperty(this.drawLineLayer,"line-width",a),this.map.getLayer(this.drawPointLayer)&&this.map.setPaintProperty(this.drawPointLayer,"circle-color",this.form.color)):(this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":a}}),this.map.addLayer({id:this.drawPointLayer,type:"circle",source:this.drawSource,filter:["==","$type","Point"],paint:{"circle-radius":3,"circle-color":this.form.color,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}))},handleRenderTmpLine(t,e){const a=P.GeoJsonHelper.drawLine([t,e]),r=D.featureCollection([a]);this.map.getSource(this.drawTmpSource)?this.map.getSource(this.drawTmpSource).setData(r):this.map.addSource(this.drawTmpSource,{type:"geojson",data:r}),this.map.getLayer(this.drawTmpLayer)||this.map.addLayer({id:this.drawTmpLayer,type:"line",source:this.drawTmpSource,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":2,"line-dasharray":[3,2]}});const i={lng:t[0],lat:t[1]},l={lng:e[0],lat:e[1]},n=P.LaneHelper.calculateDistance(i,l,!0,2),c=P.LaneHelper.calculateBearing(i,l,!0,2);let s=0;for(let m=1;m<this.drawCoords.length;m++){const p={lng:this.drawCoords[m-1][0],lat:this.drawCoords[m-1][1]},g={lng:this.drawCoords[m][0],lat:this.drawCoords[m][1]};s+=P.LaneHelper.calculateDistance(p,g,!0,4)}s=P.LngLatHelper.roundPrecision(s+n,1);const d=`
|
|
217
|
+
</svg>`,he=document.createElement("div");he.className="idm-tropical-gl4-hourly-marker",he.innerHTML=`<div class="${N.geometry.coordinates[1]>=0?"center north":"center south"}">${re}</div>`;const ge=new ne.Marker(he).setLngLat(N.geometry.coordinates).addTo(this.map);this.interpolateMarkers.push(ge)}this.$emit("tropicalCenterPoints",j)}else(V=this.map)!=null&&V.getSource(this.interpolateSource)&&((G=this.map)==null||G.getSource(this.interpolateSource).setData(this.empty))},handleClick(t){var i,l,n,c,s,d,m,p,g,y,u;const e=t.features[0],a=(l=(i=this.tropicals)==null?void 0:i.data)==null?void 0:l.features.filter(h=>{var f;return h.geometry.type==="LineString"&&h.properties.type==="forecast"&&h.properties.name===((f=e==null?void 0:e.properties)==null?void 0:f.name)}),r=(c=(n=this.tropicals)==null?void 0:n.data)==null?void 0:c.features.filter(h=>{var f;return h.geometry.type==="LineString"&&h.properties.type==="history"&&h.properties.name===((f=e==null?void 0:e.properties)==null?void 0:f.name)});this.activeTropicals={name:((s=e==null?void 0:e.properties)==null?void 0:s.name)||"-",nameCn:((d=e==null?void 0:e.properties)==null?void 0:d.nameCn)||((m=e==null?void 0:e.properties)==null?void 0:m.name)||"-",Name:((p=e==null?void 0:e.properties)==null?void 0:p.Name)||"-",forecasts:a.map(h=>h.properties),history:(g=r[0])==null?void 0:g.properties,showCircle:(u=(y=a[0])==null?void 0:y.properties)==null?void 0:u.showCircle},this.showTropicalsInfo=!0,this.simple||this.drawTropicalsInfoMaker([t.lngLat.lng,t.lngLat.lat])},drawTropicalsInfoMaker(t){this.$nextTick(()=>{const e=document.getElementById("idm-tropical-gl4-info");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat(t).setOffset([220,0]):this.activeTropicalsMarker=new ne.Marker(e).setLngLat(t).setOffset([220,0]).addTo(this.map)})},handleCloseInfoMarker(){this.showTropicalsInfo=!1,this.$nextTick(()=>{var t;(t=this.activeTropicalsMarker)==null||t.remove(),this.activeTropicalsMarker=void 0})},handleForecastToggle(t){var r,i,l,n,c,s;t.disabled=!t.disabled;const e=`${t.name}-${t.model}`,a=(i=(r=this.map)==null?void 0:r.getSource(this.source)._data)==null?void 0:i.features;a.forEach(d=>{d.properties.category===e&&(d.properties.disabled=t.disabled)}),this.interpolateData.forEach(d=>{d.properties.category===e&&(d.properties.disabled=t.disabled)}),(n=(l=this.map)==null?void 0:l.getSource(this.source))==null||n.setData(D.featureCollection(a)),(s=(c=this.map)==null?void 0:c.getSource(this.clusterSource))==null||s.setData(D.featureCollection(a)),this.handleDateChange()},handleStrikeProbability(t){this.$emit("tropicalProbability",t)},handleToggleCircles(t){var e,a;t.showCircle=!t.showCircle,(a=(e=this.tropicals.data)==null?void 0:e.features)==null||a.forEach(r=>{r.properties.name===t.name&&(r.properties.showCircle=t.showCircle)}),this.handleRender()},handleComputePolygons(t){const e=[];for(const a of t){const r=a.properties.wind,i={ne:r.r7ne>=0?r.r7ne:void 0,se:r.r7se>=0?r.r7se:void 0,sw:r.r7sw>=0?r.r7sw:void 0,nw:r.r7nw>=0?r.r7nw:void 0},l=this.handleComputeArc(a.geometry.coordinates,i,{...a.properties,level:7});e.push(l);const n={ne:r.r10ne>=0?r.r10ne:void 0,se:r.r10se>=0?r.r10se:void 0,sw:r.r10sw>=0?r.r10sw:void 0,nw:r.r10nw>=0?r.r10nw:void 0},c=this.handleComputeArc(a.geometry.coordinates,n,{...a.properties,level:10});e.push(c)}return e},handleComputeArc(t,e,a){var l;const r=[];for(const n in e){const c=e[n]??0;let s;switch(n){case"ne":s=D.lineArc(t,c,0,90,{steps:c>0?32:1,units:"nauticalmiles"});break;case"se":s=D.lineArc(t,c,90,180,{steps:c>0?32:1,units:"nauticalmiles"});break;case"sw":s=D.lineArc(t,c,180,270,{steps:c>0?32:1,units:"nauticalmiles"});break;case"nw":s=D.lineArc(t,c,270,360,{steps:c>0?32:1,units:"nauticalmiles"});break}r.push(...(l=s==null?void 0:s.geometry)==null?void 0:l.coordinates)}const i=D.lineString(r);return D.lineToPolygon(i,{properties:a})},handleNotification(t){this.$emit("tropicalNotification",t)},handleHover(t){var i,l,n,c,s;this.map.getCanvas().style.cursor="pointer";const a=this.map.queryRenderedFeatures(t.point,{layers:[this.pointCircleLayer,this.pointCircleLayer+"-border",this.historyPointCircleLayer,this.historyPointCircleLayer+"-border",this.historyPointCircleLayer+"-inner"]})[0];this.hoverPoint=a==null?void 0:a.properties;const r=(l=(i=this.tropicals)==null?void 0:i.data)==null?void 0:l.features.filter(d=>{var m;return d.geometry.type==="LineString"&&d.properties.type==="forecast"&&d.properties.name===((m=a==null?void 0:a.properties)==null?void 0:m.name)});this.hoverPoint&&(this.hoverPoint.lng=a.geometry.coordinates[0],this.hoverPoint.lat=a.geometry.coordinates[1],this.hoverPoint.update=(c=(n=r==null?void 0:r[0])==null?void 0:n.properties)==null?void 0:c.date,(s=this.hoverMarker)==null||s.remove(),this.showHoverPoint=!0,this.$nextTick(()=>{const d=document.getElementById("tropicalHoverMarkerInfo").cloneNode(!0);this.hoverMarker=new ne.Marker(d).setLngLat(a.geometry.coordinates).setOffset([160,0]).addTo(this.map)}))},handleLeave(){var t;this.map.getCanvas().style.cursor="grab",this.showHoverPoint=!1,(t=this.hoverMarker)==null||t.remove(),this.hoverMarker=void 0}}},km={class:"idm-tropical-gl4"},_m={class:"pb-1"},Lm={class:"text-h5 font-weight-600"},zm={key:0,class:"text-h5 font-weight-600"},Cm={class:"text-body-1"},vm={class:"text-label"},Sm={class:"d-flex justify-space-between align-center"},Nm={class:"w-60"},Vm={class:"text-label pr-1"},Pm={class:"flex-1-1-0"},Mm={class:"text-label pr-1"},Tm={class:"py-2 d-flex justify-space-between align-center"},Em={class:"w-60"},Dm={class:"text-label pr-1"},Rm={class:"flex-1-1-0"},Bm={class:"text-label pr-1"},Im={class:"d-flex align-center flex-1-1-100 justify-space-between mt-n1"},Am={class:"text-label pr-1",style:{width:"70px"}},Fm={class:"model-box d-flex justify-end align-center flex-wrap ga-1 pa-1"},Gm={class:"more"},Wm={key:0,class:"w-100 d-flex justify-space-between align-center px-2"},Om={class:"pa-1"},Zm={class:"legend d-flex justify-start align-center py-2"},jm={class:"label"},Hm={class:"legend d-flex justify-start align-center py-2"},Xm={class:"label"},Ym={class:"legend d-flex justify-start align-center py-2"},Um={class:"label"},$m={class:"pa-1"},Jm={class:"legend d-flex justify-start align-center py-2"},Km={class:"label"},qm={class:"legend d-flex justify-start align-center py-2"},Qm={class:"label"},ed={class:"legend d-flex justify-start align-center py-2"},td={class:"label"},od={class:"pa-1"},ad={class:"w-100 legend d-flex justify-start align-center py-2 ga-2"},id={class:"label"},rd={class:"label"},ld={class:"w-100 legend d-flex justify-start align-center py-2"},nd={class:"label"},sd={class:"w-100 legend d-flex justify-start align-center py-2"},cd={class:"label"},md={key:1,class:"my-3 w-100",style:{height:"80px"}},dd={class:"legend d-flex justify-start align-center"},hd={class:"label"},pd={class:"legend d-flex justify-start align-center"},gd={class:"label"},ud={class:"legend d-flex justify-start align-center"},fd={class:"label"},yd={class:"legend d-flex justify-start align-center"},bd={class:"label"},wd={class:"legend d-flex justify-start align-center"},xd={class:"label"},kd={class:"legend d-flex justify-start align-center"},_d={class:"label"},Ld={class:"legend d-flex justify-start align-center"},zd={class:"label"},Cd={class:"legend d-flex justify-start align-center"},vd={class:"label"},Sd={class:"legend d-flex justify-start align-center"},Nd={class:"label"},Vd={class:"legend d-flex justify-start align-center"},Pd={class:"label"},Md={class:"d-flex justify-star align-center"},Td={class:"font-weight-600 mr-1"},Ed={class:""},Dd={class:"port-box d-flex flex-column justify-center align-start ga-2"},Rd={key:0,class:"d-flex justify-start align-center"},Bd={class:"text-label pr-1"},Id={key:1,class:"d-flex justify-start align-center"},Ad={class:"text-label pr-1"},Fd={key:2,class:"d-flex justify-start align-center"},Gd={class:"text-label pr-1"},Wd={key:3,class:"d-flex justify-start align-center"},Od={class:"text-label pr-1"},Zd={key:4,class:"d-flex justify-start align-center"},jd={class:"text-label pr-1"},Hd={key:5,class:"d-flex justify-start align-center"},Xd={class:"text-label pr-1"},Yd={class:"d-flex justify-start align-center"},Ud={class:"text-label pr-1"},$d={key:6,class:"d-flex justify-start align-center"},Jd={class:"text-label pr-1"},Kd={key:7,class:"d-flex justify-start align-center"},qd={class:"text-label pr-1"},Qd={class:"d-flex justify-start align-center"},eh={class:"text-label pr-1"};function th(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCardText"),d=o.resolveComponent("VDivider"),m=o.resolveComponent("VCardActions"),p=o.resolveComponent("VCard"),g=o.resolveComponent("VCardTitle");return o.openBlock(),o.createElementBlock("div",km,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+86+"px",right:i.right+"px"})},[o.createVNode(c,{text:t.$t("tropical.tropicals"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:y})=>[o.createVNode(n,o.mergeProps(y,{"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[2]||(e[2]=[o.createElementVNode("i",{class:"iconfont icon-Tropical text-h4"},null,-1)])),_:2,__:[2]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),i.showTropicalsInfo&&!t.$attrs.hideTropicalsLegend?(o.openBlock(),o.createElementBlock("div",{key:0,id:"idm-tropical-gl4-info",ref:"tropicalsInfo",class:o.normalizeClass(["idm-tropical-gl4-info",a.simple?"page":"dialog"])},[o.createVNode(p,{class:o.normalizeClass(["w-100",a.simple?"rounded-t-4 bg-none":""]),elevation:a.simple?0:16},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>{var y,u,h,f,k,w,b,x,C,L,z,v;return[o.createElementVNode("div",_m,[o.createElementVNode("span",Lm,o.toDisplayString(a.locale==="en"?(y=i.activeTropicals)==null?void 0:y.Name:((u=i.activeTropicals)==null?void 0:u.nameCn)||((h=i.activeTropicals)==null?void 0:h.Name)||"-"),1),(k=(f=i.activeTropicals)==null?void 0:f.history)!=null&&k.levelI18n?(o.openBlock(),o.createElementBlock("span",zm," , "+o.toDisplayString(t.$t("tropical."+((b=(w=i.activeTropicals)==null?void 0:w.history)==null?void 0:b.levelI18n))),1)):o.createCommentVNode("",!0)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"close",onClick:o.withModifiers(l.handleCloseInfoMarker,["stop"])},{default:o.withCtx(()=>e[3]||(e[3]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[3]},8,["onClick"]),o.createElementVNode("div",Cm,[o.createElementVNode("span",vm,o.toDisplayString(t.$t("actions.lastUpdate"))+": ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTime(((C=(x=i.activeTropicals)==null?void 0:x.history)==null?void 0:C.updated)||((v=(z=(L=i.activeTropicals)==null?void 0:L.forecasts)==null?void 0:z.filter(M=>!M.disabled)[0])==null?void 0:v.date),a.timeZone)),1)])]}),_:1}),o.createVNode(d),o.createVNode(s,{class:"text-body-1 py-3"},{default:o.withCtx(()=>{var y,u,h,f,k,w,b,x,C;return[o.createElementVNode("div",Sm,[o.createElementVNode("div",Nm,[o.createElementVNode("label",Vm,o.toDisplayString(t.$t("weather.windSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((u=(y=i.activeTropicals)==null?void 0:y.history)==null?void 0:u.kts)||"-")+" kts",1),o.createElementVNode("span",null,", BF "+o.toDisplayString(l.computeBF(((f=(h=i.activeTropicals)==null?void 0:h.history)==null?void 0:f.kts)||"-")),1)]),o.createElementVNode("div",Pm,[o.createElementVNode("label",Mm,o.toDisplayString(t.$t("weather.pressure"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((w=(k=i.activeTropicals)==null?void 0:k.history)==null?void 0:w.pressure)||"-")+" hPa",1)])]),o.createElementVNode("div",Tm,[o.createElementVNode("div",Em,[o.createElementVNode("label",Dm,o.toDisplayString(t.$t("tropical.moveSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((b=l.computeMovement(i.activeTropicals))==null?void 0:b.kts)||"-")+" kts",1)]),o.createElementVNode("div",Rm,[o.createElementVNode("label",Bm,o.toDisplayString(t.$t("tropical.moveDir"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((x=l.computeMovement(i.activeTropicals))==null?void 0:x.deg)||"-")+"°",1)])]),o.createElementVNode("div",Im,[o.createElementVNode("label",Am,o.toDisplayString(t.$t("tropical.models"))+" : ",1),o.createElementVNode("div",Fm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((C=i.activeTropicals)==null?void 0:C.forecasts,(L,z)=>(o.openBlock(),o.createBlock(n,{key:z,density:"compact",variant:L.disabled?"text":"flat",color:L.disabled?"":"primary","min-width":30,class:o.normalizeClass(["model text-none text-body-1 px-1",L.disabled?"btn-border-1 btn-bg-1":""]),onClick:o.withModifiers(v=>l.handleForecastToggle(L),["stop"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(L.model),1)]),_:2},1032,["variant","color","class","onClick"]))),128))])])]}),_:1}),o.createVNode(d),a.simple?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(m,{key:0,class:"d-flex justify-space-between"},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact","prepend-icon":"",variant:"text",color:i.showLegend?"primary":"",class:"text-none text-body-1",onClick:e[0]||(e[0]=o.withModifiers(y=>i.showLegend=!i.showLegend,["stop"]))},{prepend:o.withCtx(()=>e[4]||(e[4]=[o.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(t.$t("weather.legend")),1)]),_:1},8,["color"]),o.createElementVNode("div",Gm,[o.createVNode(n,{variant:"text",density:"compact","append-icon":"mdi-chevron-right",class:"text-none text-body-1",onClick:e[1]||(e[1]=o.withModifiers(y=>l.handleStrikeProbability(i.activeTropicals),["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.viewReport")),1)]),_:1})])]),_:1}))]),_:1},8,["class","elevation"]),a.simple?(o.openBlock(),o.createElementBlock("div",Wm,[o.createElementVNode("div",Om,[o.createElementVNode("div",Zm,[e[5]||(e[5]=o.createElementVNode("div",{class:"icon td"},null,-1)),o.createElementVNode("div",jm,o.toDisplayString(t.$t("tropical.td")),1)]),o.createElementVNode("div",Hm,[e[6]||(e[6]=o.createElementVNode("div",{class:"icon sts"},null,-1)),o.createElementVNode("div",Xm,o.toDisplayString(t.$t("tropical.sts")),1)]),o.createElementVNode("div",Ym,[e[7]||(e[7]=o.createElementVNode("div",{class:"icon sty"},null,-1)),o.createElementVNode("div",Um,o.toDisplayString(t.$t("tropical.sty")),1)])]),o.createElementVNode("div",$m,[o.createElementVNode("div",Jm,[e[8]||(e[8]=o.createElementVNode("div",{class:"icon ts"},null,-1)),o.createElementVNode("div",Km,o.toDisplayString(t.$t("tropical.ts")),1)]),o.createElementVNode("div",qm,[e[9]||(e[9]=o.createElementVNode("div",{class:"icon ty"},null,-1)),o.createElementVNode("div",Qm,o.toDisplayString(t.$t("tropical.ty")),1)]),o.createElementVNode("div",ed,[e[10]||(e[10]=o.createElementVNode("div",{class:"icon supper-ty"},null,-1)),o.createElementVNode("div",td,o.toDisplayString(t.$t("tropical.superTy")),1)])]),o.createElementVNode("div",od,[o.createElementVNode("div",ad,[e[11]||(e[11]=o.createElementVNode("div",{class:"icon history"},null,-1)),o.createElementVNode("div",id,o.toDisplayString(t.$t("tropical.history")),1),e[12]||(e[12]=o.createElementVNode("div",{class:"icon forecast"},null,-1)),o.createElementVNode("div",rd,o.toDisplayString(t.$t("tropical.forecast")),1)]),o.createElementVNode("div",ld,[e[13]||(e[13]=o.createElementVNode("div",{class:"icon r7"},null,-1)),o.createElementVNode("div",nd,"35kts "+o.toDisplayString(t.$t("tropical.radii")),1)]),o.createElementVNode("div",sd,[e[14]||(e[14]=o.createElementVNode("div",{class:"icon r10"},null,-1)),o.createElementVNode("div",cd,"50kts "+o.toDisplayString(t.$t("tropical.radii")),1)])])])):(o.openBlock(),o.createElementBlock("div",md,[o.withDirectives(o.createVNode(p,{elevation:"16"},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(["pa-1 d-flex justify-space-between align-center flex-wrap",a.locale==="zhHans"?" ga-2":" ga-3"])},[o.createElementVNode("div",dd,[e[15]||(e[15]=o.createElementVNode("div",{class:"icon td"},null,-1)),o.createElementVNode("div",hd,o.toDisplayString(t.$t("tropical.td")),1)]),o.createElementVNode("div",pd,[e[16]||(e[16]=o.createElementVNode("div",{class:"icon ts"},null,-1)),o.createElementVNode("div",gd,o.toDisplayString(t.$t("tropical.ts")),1)]),o.createElementVNode("div",ud,[e[17]||(e[17]=o.createElementVNode("div",{class:"icon sts"},null,-1)),o.createElementVNode("div",fd,o.toDisplayString(t.$t("tropical.sts")),1)]),o.createElementVNode("div",yd,[e[18]||(e[18]=o.createElementVNode("div",{class:"icon ty"},null,-1)),o.createElementVNode("div",bd,o.toDisplayString(t.$t("tropical.ty")),1)]),o.createElementVNode("div",wd,[e[19]||(e[19]=o.createElementVNode("div",{class:"icon sty"},null,-1)),o.createElementVNode("div",xd,o.toDisplayString(t.$t("tropical.sty")),1)]),o.createElementVNode("div",kd,[e[20]||(e[20]=o.createElementVNode("div",{class:"icon supper-ty"},null,-1)),o.createElementVNode("div",_d,o.toDisplayString(t.$t("tropical.superTy")),1)]),o.createElementVNode("div",Ld,[e[21]||(e[21]=o.createElementVNode("div",{class:"icon history"},null,-1)),o.createElementVNode("div",zd,o.toDisplayString(t.$t("tropical.history")),1)]),o.createElementVNode("div",Cd,[e[22]||(e[22]=o.createElementVNode("div",{class:"icon forecast"},null,-1)),o.createElementVNode("div",vd,o.toDisplayString(t.$t("tropical.forecast")),1)]),o.createElementVNode("div",Sd,[e[23]||(e[23]=o.createElementVNode("div",{class:"icon r7"},null,-1)),o.createElementVNode("div",Nd,"35kts "+o.toDisplayString(t.$t("tropical.radii")),1)]),o.createElementVNode("div",Vd,[e[24]||(e[24]=o.createElementVNode("div",{class:"icon r10"},null,-1)),o.createElementVNode("div",Pd,"50kts "+o.toDisplayString(t.$t("tropical.radii")),1)])],2),[[o.vShow,i.showLegend]])]),_:1})]),_:1},512),[[o.vShow,i.showLegend]])]))],2)):o.createCommentVNode("",!0),o.withDirectives(o.createVNode(p,{id:"tropicalHoverMarkerInfo",elevation:"16","max-width":"280"},{default:o.withCtx(()=>[o.createVNode(g,null,{default:o.withCtx(()=>{var y,u,h,f;return[o.createElementVNode("div",Md,[o.createElementVNode("span",Td,o.toDisplayString(a.locale==="en"?(y=i.hoverPoint)==null?void 0:y.Name:((u=i.hoverPoint)==null?void 0:u.nameCn)||((h=i.hoverPoint)==null?void 0:h.Name)),1),o.createElementVNode("span",Ed," ["+o.toDisplayString(t.$t("tropical."+((f=i.hoverPoint)==null?void 0:f.levelI18n)))+"]",1)])]}),_:1}),o.createVNode(d),o.createVNode(s,{class:"text-body-1"},{default:o.withCtx(()=>{var y,u,h,f,k,w,b,x,C,L,z,v,M,T,E,I,Z,Y,$,ae;return[o.createElementVNode("div",Dd,[((y=i.hoverPoint)==null?void 0:y.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Rd,[o.createElementVNode("label",Bd,o.toDisplayString(t.$t("tropical.updated"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((u=i.hoverPoint)==null?void 0:u.update,a.timeZone)),1)])):o.createCommentVNode("",!0),((h=i.hoverPoint)==null?void 0:h.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Id,[o.createElementVNode("label",Ad,o.toDisplayString(t.$t("tropical.forecast"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((f=i.hoverPoint)==null?void 0:f.date,a.timeZone)),1)])):o.createCommentVNode("",!0),((k=i.hoverPoint)==null?void 0:k.type)==="history"?(o.openBlock(),o.createElementBlock("div",Fd,[o.createElementVNode("label",Gd,o.toDisplayString(t.$t("tropical.forecast"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((w=i.hoverPoint)==null?void 0:w.date,a.timeZone)),1)])):o.createCommentVNode("",!0),((b=i.hoverPoint)==null?void 0:b.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Wd,[o.createElementVNode("label",Od,o.toDisplayString(t.$t("tropical.model"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((x=i.hoverPoint)==null?void 0:x.model)??"-"),1)])):o.createCommentVNode("",!0),((C=i.hoverPoint)==null?void 0:C.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Zd,[o.createElementVNode("label",jd,o.toDisplayString(t.$t("weather.wind"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((z=JSON.parse((L=i.hoverPoint)==null?void 0:L.wind))==null?void 0:z.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),((v=i.hoverPoint)==null?void 0:v.type)==="history"?(o.openBlock(),o.createElementBlock("div",Hd,[o.createElementVNode("label",Xd,o.toDisplayString(t.$t("weather.wind"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((M=i.hoverPoint)==null?void 0:M.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),o.createElementVNode("div",Yd,[o.createElementVNode("label",Ud,o.toDisplayString(t.$t("weather.pressure"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((T=i.hoverPoint)==null?void 0:T.pressure)??"-")+" hPa",1)]),((E=i.hoverPoint)==null?void 0:E.type)==="history"?(o.openBlock(),o.createElementBlock("div",$d,[o.createElementVNode("label",Jd,o.toDisplayString(t.$t("tropical.moveSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((Z=JSON.parse((I=i.hoverPoint)==null?void 0:I.movement))==null?void 0:Z.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),((Y=i.hoverPoint)==null?void 0:Y.type)==="history"?(o.openBlock(),o.createElementBlock("div",Kd,[o.createElementVNode("label",qd,o.toDisplayString(t.$t("tropical.moveDir"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((ae=JSON.parse(($=i.hoverPoint)==null?void 0:$.movement))==null?void 0:ae.deg)??"-")+" °",1)])):o.createCommentVNode("",!0),o.createElementVNode("div",Qd,[o.createElementVNode("label",eh,o.toDisplayString(t.$t("tropical.position"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computePosition(i.hoverPoint)),1)])])]}),_:1})]),_:1},512),[[o.vShow,i.showHoverPoint]])])}const jo=X(xm,[["render",th]]),By="",oh={name:"DateTimePicker",props:{width:{type:Number,default:null},height:{type:Number,default:30},position:{type:String,default:"top"},bgClass:{type:String,default:""},locale:{type:String,default:"en"},style:{type:Object,default:{}},intervalHour:{type:Number,default:3},timeZone:{type:Number},dateTime:{type:String},dayAbout:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1}},emits:["dateTime","currentTimestamp","currentRealTime","minTimestamp","maxTimestamp"],data(){return{showDatePicker:!1,minDate:void 0,maxDate:void 0,minTimestamp:void 0,maxTimestamp:void 0,currentDate:void 0,currentTime:void 0,currentTimestamp:void 0,currentDateTimeZ:void 0,currentDateTime:void 0,currentRealTime:void 0,timer:null}},computed:{getStyle(){const t=this.width||220;return this.position==="top"?{bottom:"40px",left:`-${(420-t)/2}px`}:this.position==="bottom"?{top:"40px",left:`-${(420-t)/2}px`}:this.position==="left"?{bottom:"-140px",left:"-428px"}:this.position==="right"?{bottom:"-140px",right:"-428px"}:{bottom:"40px",left:`-${(420-t)/2}px`}},hourOptions(){const t=[];for(let e=0;e<24;e++)t.push(e<10?`0${e}:00`:`${e}:00`);return t.filter((e,a)=>(a-this.timeZone)%this.intervalHour===0)},timeZoneNames(){return S.tz.names()},timeZoneName(){var t;return(t=this.timeZoneNames.filter(e=>S.tz(S(),e).utcOffset()===this.timeZone*60))==null?void 0:t[0]},utcTimeZoneName(){return"Africa/Abidjan"},localTimeZoneName(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"Asia/Shanghai"}},watch:{timeZone:{handler(t,e){t!==e&&(this.handleResetDateTime(this.dateTime),this.handleResetMinMax())}},dateTime:{handler(t,e){t&&this.handleResetDateTime(this.dateTime)},immediate:!0},currentTimestamp:{handler(){this.currentDateTimeZ=S(this.currentTimestamp).utc().format("yyyy-MM-DD HH:00[Z]"),this.$emit("dateTime",this.currentDateTimeZ),this.$emit("currentTimestamp",this.currentTimestamp),this.currentDateTime=`${S.tz(this.currentTimestamp,this.timeZoneName).clone().format("yyyy-MM-DD : HH:00")}`},immediate:!0},currentRealTime:{handler(t,e){t!==e&&this.$emit("currentRealTime",this.currentRealTime)}}},mounted(){this.timer=setInterval(()=>{this.currentRealTime=`${S.tz(S().unix()*1e3,this.timeZoneName).clone().format("HH:mm")}`},100),document.addEventListener("click",this.handleClickOutside)},unmounted(){clearInterval(this.timer),this.handleCancelDate(),document.removeEventListener("click",this.handleClickOutside)},methods:{handleReset(){this.handleResetDateTime(),this.handleResetMinMax()},handleResetDateTime(t){var i;const e=S(t).utc().date(),a=Math.ceil(S(t).utc().hour()/this.intervalHour)*this.intervalHour;this.currentTimestamp=((i=S(t))==null?void 0:i.utc().set({date:e,hour:a,minute:0,second:0,millisecond:0}).unix())*1e3;const r=S.tz(this.currentTimestamp,this.timeZoneName).clone();this.currentDate=r.clone().format("YYYY-MM-DD"),this.currentTime=r.clone().format("HH:00"),this.currentDateTime=`${S.tz(this.currentTimestamp,this.timeZoneName).clone().format("yyyy-MM-DD : HH:00")}`,this.currentRealTime=`${S.tz(S().unix()*1e3,this.timeZoneName).clone().format("HH:mm")}`},handleResetMinMax(){var i,l,n,c,s;if(!this.dayAbout.h||!this.dayAbout.f)return;const t=S().utc().date(),e=Math.ceil(S().utc().hour()/this.intervalHour)*this.intervalHour,a=((i=S())==null?void 0:i.utc().set({date:t,hour:e,minute:0,second:0,millisecond:0}).unix())*1e3,r=S.tz(a,this.timeZoneName).clone();this.minDate=r.clone().add(this.dayAbout.h,"day").format("yyyy-MM-DD"),this.maxDate=r.clone().add(this.dayAbout.f,"day").format("yyyy-MM-DD"),this.minTimestamp=((n=(l=S())==null?void 0:l.utc())==null?void 0:n.set({date:t+this.dayAbout.h,hour:0,minute:0,second:0,millisecond:0}).unix())*1e3,this.maxTimestamp=((s=(c=S())==null?void 0:c.utc())==null?void 0:s.set({date:t+this.dayAbout.f,hour:0,minute:0,second:0,millisecond:0}).unix())*1e3,this.$emit("minTimestamp",this.minTimestamp),this.$emit("maxTimestamp",this.maxTimestamp)},handleOpenDatePicker(){this.disabled||(this.showDatePicker=!this.showDatePicker)},handleUpdateMonth(t){const e=t||S.tz(this.currentTimestamp,this.timeZoneName).clone().month(),a=this.locale==="en"?S.tz(this.currentTimestamp,this.timeZoneName).set({month:e}).clone().format("MMM"):S.tz(this.currentTimestamp,this.timeZoneName).set({month:e}).clone().format("M月");this.$nextTick(()=>{const r=document.querySelector(".v-date-picker-controls__month-btn");r.innerText=a})},handleConfirmDate(){const t=S(this.currentDate).format("yyyy-MM-DD"),e=this.currentTime,a=`${t} ${e}`,r=S.tz(a,"YYYY-MM-DD HH:00",this.timeZoneName).clone().tz(this.localTimeZoneName);this.currentTimestamp=r.unix()*1e3,this.showDatePicker=!1},handleCancelDate(){this.showDatePicker=!1;const t=S.tz(this.currentTimestamp,this.timeZoneName).clone();this.currentDate=t.clone().format("YYYY-MM-DD"),this.currentTime=t.clone().format("HH:00")},handleClickOutside(t){const e=this.$refs.idmGl4Timepicker;e&&!e.contains(t.target)&&(this.showDatePicker=!1)}}},ah={ref:"idmGl4Timepicker",class:"idm-gl4-time-picker"},ih={class:"pa-0",style:{width:"320px"}},rh={class:"h-100 pa-0 d-flex flex-column justify-start align-center",style:{width:"100px"}},lh={class:"d-flex justify-center align-center text-body-2",style:{height:"44px"}};function nh(t,e,a,r,i,l){const n=o.resolveComponent("VDatePicker"),c=o.resolveComponent("VDivider"),s=o.resolveComponent("VListItemTitle"),d=o.resolveComponent("VListItem"),m=o.resolveComponent("VList"),p=o.resolveComponent("VCardText"),g=o.resolveComponent("VBtn"),y=o.resolveComponent("VCardActions"),u=o.resolveComponent("VCard");return o.openBlock(),o.createElementBlock("div",ah,[o.createElementVNode("div",{style:o.normalizeStyle({height:a.height+"px",width:a.width?a.width+"px":"auto"}),class:o.normalizeClass([[a.bgClass,{"cursor-pointer":!a.disabled}],"rounded text-body-1 btn-border-1 btn-bg-1 d-flex align-center justify-center px-2"]),onClick:e[0]||(e[0]=(...h)=>l.handleOpenDatePicker&&l.handleOpenDatePicker(...h))},o.toDisplayString(i.currentDateTime)+" | UTC "+o.toDisplayString(a.timeZone<0?a.timeZone:"+"+a.timeZone),7),i.showDatePicker?(o.openBlock(),o.createBlock(u,{key:0,class:"card-box d-flex flex-column border elevation-12",style:o.normalizeStyle(l.getStyle)},{default:o.withCtx(()=>[o.createVNode(p,{class:"w-100 flex-1-1-0 d-flex pa-0 text-body-1"},{default:o.withCtx(()=>[o.createElementVNode("div",ih,[o.createVNode(n,{modelValue:i.currentDate,"onUpdate:modelValue":e[1]||(e[1]=h=>i.currentDate=h),min:i.minDate,max:i.maxDate,"weekday-format":"narrow",color:"primary",density:"compact",class:"w-100","hide-header":""},null,8,["modelValue","min","max"])]),o.createVNode(c,{class:"h-100",vertical:""}),o.createElementVNode("div",rh,[o.createElementVNode("div",lh,o.toDisplayString(t.$t("time.time")),1),o.createVNode(m,{class:"pa-0 flex-1-1-0 scroll"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.hourOptions,(h,f)=>(o.openBlock(),o.createBlock(d,{key:f,value:h,color:"primary",active:i.currentTime===h,rounded:"",height:"26","min-height":"26",class:"rounded-xl",variant:i.currentTime===h?"flat":"text"},{default:o.withCtx(()=>[o.createVNode(s,{class:"text-body-2 font-weight-600 text-center",onClick:k=>i.currentTime=h},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h),1)]),_:2},1032,["onClick"])]),_:2},1032,["value","active","variant"]))),128))]),_:1})])]),_:1}),o.createVNode(c),o.createVNode(y,{class:"w-100 d-flex justify-end align-center px-4 ga-4",style:{height:"50px"}},{default:o.withCtx(()=>[o.createVNode(g,{size:"small",variant:"tonal",class:"text-none text-body-1 px-4",onClick:l.handleCancelDate},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.cancel")),1)]),_:1},8,["onClick"]),o.createVNode(g,{size:"small",variant:"flat",color:"primary",class:"text-none text-body-1 px-4",onClick:l.handleConfirmDate},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.confirm")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["style"])):o.createCommentVNode("",!0)],512)}const qe=X(oh,[["render",nh]]),Iy="",sh={name:"IdmPoint",components:{DateTimePicker:qe},props:{simple:{type:Boolean,default:!1},isLogin:{type:Boolean,default:!1},token:{type:String},defaultMeteoToken:{type:String},theme:{type:String,default:"zh"},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},gateway:{type:String},timeZone:{type:Number},forecastModel:{type:String},realTime:{type:String},followList:{type:Array,default:()=>[]}},emits:["meteoMore","follow","cancelFollow","login"],data(){return{right:10,toggle:!1,showForm:!1,showMeteo:!1,loading:!1,form:{lng:void 0,lngDegree:void 0,lngMinute:void 0,lngDirection:"E",lat:void 0,latDegree:void 0,latMinute:void 0,latDirection:"N",dateTime:void 0,forecastModel:""},formRules:{lngDegree:[t=>t!=null&&t!==""||"required",t=>/^\d{1,3}$/.test(t)||"number",t=>parseInt(t)>=0&&parseInt(t)<=180||"0 ~ 180"],lngMinute:[t=>t===void 0||t===null&&t===""||/^\d{1,2}(\.\d+)?$/.test(t)||"number",t=>t===void 0||t===null&&t===""||parseInt(t)>=0&&parseInt(t)<=59||"0 ~ 59"],latDegree:[t=>t!=null&&t!==""||"required",t=>/^\d{1,2}$/.test(t)||"number",t=>parseInt(t)>=0&&parseInt(t)<=90||"0 ~ 90"],latMinute:[t=>t===void 0||t===null&&t===""||/^\d{1,2}(\.\d+)?$/.test(t)||"number",t=>t===void 0||t===null&&t===""||parseInt(t)>=0&&parseInt(t)<=59||"0 ~ 59"]},meteoData:void 0,currentHourData:{},positionOffset:void 0,positionGmt:void 0,positionMarker:void 0,meteoInfoMarker:void 0}},computed:{timeZoneNames(){return S.tz.names()},timeZoneName(){var t;return(t=this.timeZoneNames.filter(e=>S.tz(S(),e).utcOffset()===this.timeZone*60))==null?void 0:t[0]},computedTzTime(){return t=>S.tz(S(t),this.timeZoneName).clone().format("YYYY-MM-DD HHmm")+" (UTC "+(this.timeZone>=0?"+":"")+this.timeZone+")"},computedLocalTime(){return t=>{var r,i,l;const e=Number((r=this.positionOffset)==null?void 0:r.slice(1,3))*(+(((i=this.positionOffset)==null?void 0:i.slice(1))==="+")?1:-1),a=(l=this.timeZoneNames.filter(n=>S.tz(S(),n).utcOffset()===e*60))==null?void 0:l[0];return t?S.tz(S(t),a).clone().format("YYYY-MM-DD HHmm")+" (UTC "+(e>=0?"+":"")+e+")":"-"}},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}},computeRoundPrecision(){return function(t,e=4){return t==null||isNaN(t)||isNaN(e)?"-":P.LngLatHelper.roundPrecision(t,e)}}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},toggle:{handler(){this.toggle?this.showForm=!0:(this.showForm=!1,this.showMeteo=!1),this.map&&this.handleBind()},immediate:!0},map:{handler(){this.toggle=!1,this.map&&this.toggle&&this.handleBind()}},showForm:{handler(){this.showForm?this.$nextTick(()=>{var t;(t=this.$refs.spotForm)==null||t.resetValidation()}):this.handleCloseForm()}},showMeteo:{handler(){var t,e,a,r,i,l;this.showMeteo?((a=(e=(t=this.$parent)==null?void 0:t.$refs)==null?void 0:e.idmBottomBar)==null||a.handleToggle("spot",!0),this.simple&&this.$nextTick(()=>{var n,c;this.$parent.playerBottom=((c=(n=this.$refs.spotMeteo)==null?void 0:n.$el)==null?void 0:c.clientHeight)+10})):((l=(i=(r=this.$parent)==null?void 0:r.$refs)==null?void 0:i.idmBottomBar)==null||l.handleToggle("spot",!1),this.simple&&(this.$parent.playerBottom=30))}},realTime:{handler(){this.realTime&&(this.form.dateTime=this.realTime,this.showMeteo&&this.fetchData())}},forecastModel:{handler(){this.form.forecastModel=this.forecastModel},immediate:!0},"form.forecastModel":{handler(t,e){!t&&e&&(this.form.forecastModel=e==="GFS"?"ECMWF":"GFS")}}},methods:{handleMenuToggle(){this.isLogin?this.toggle=!this.toggle:this.$emit("login")},submitForm(){this.handleCloseMeteo(),this.$refs.spotForm.validate().then(async t=>{t!=null&&t.valid&&this.fetchData()})},cancelForm(){var t;(t=this.$refs.spotForm)==null||t.reset(),this.form={lng:void 0,lngDegree:void 0,lngMinute:void 0,lngDirection:"E",lat:void 0,latDegree:void 0,latMinute:void 0,latDirection:"N",dateTime:void 0,forecastModel:this.forecastModel}},handleCloseForm(){this.showForm=!1,this.cancelForm(),this.toggle=!1},async fetchData(){var a;if(isNaN(this.form.latDegree)||isNaN(this.form.latMinute)||isNaN(this.form.lngDegree)||isNaN(this.form.lngMinute))return!1;this.form.lat=(Number(this.form.latDegree??0)+Number(this.form.latMinute??0)/60)*(this.form.latDirection==="N"?1:-1),this.form.lng=(Number(this.form.lngDegree??0)+Number(this.form.lngMinute??0)/60)*(this.form.lngDirection==="E"?1:-1);const t=S();((a=S(this.realTime))==null?void 0:a.diff(t,"d",!0))>=0?await this.fetchForecastData(this.form):await this.fetchHistoryData(this.form)},async fetchForecastData(t){this.loading=!0,this.showMeteo=!0,this.form.lng=t.lng,this.form.lat=t.lat,this.form.followId=t.followId,this.handleDrawInfoMarker([t.lng,t.lat]),this.meteoData=[];const{weatherModels:e,marineModels:a}=Ae.Meteo2Assist.autoPickMeteoModel(t.forecastModel);let r={lat:t.lat,lng:t.lng,datetime:S(t.dateTime).utc().format(),forecastDays:t.day??3,weatherModels:e,marineModels:a};await le.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,r,{headers:{Authorization:this.token||this.defaultMeteoToken}}).then(i=>{(i==null?void 0:i.data.code)===0?(this.meteoData=i==null?void 0:i.data.data,this.meteoData.lng=t.lng,this.meteoData.lat=t.lat,this.initTableData(this.meteoData),this.loading=!1):this.loading=!1}).catch(()=>{this.loading=!1})},async fetchHistoryData(t){this.loading=!0,this.showMeteo=!0,this.form.lng=t.lng,this.form.lat=t.lat,this.form.followId=t.followId,this.handleDrawInfoMarker([t.lng,t.lat]),this.meteoData=[];const{weatherModels:e,marineModels:a}=Ae.Meteo2Assist.autoPickMeteoModel(t.forecastModel),r={lat:t.lat,lng:t.lng,datetime:S(t.dateTime).utc().format(),forecastDays:2,pastDays:1,weatherModels:e,marineModels:a};await le.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,r,{headers:{Authorization:this.token||this.defaultMeteoToken}}).then(i=>{(i==null?void 0:i.data.code)===0?(this.meteoData=i==null?void 0:i.data.data,this.meteoData.lng=t.lng,this.meteoData.lat=t.lat,this.initTableData(this.meteoData),this.loading=!1):this.loading=!1}).catch(()=>{this.loading=!1}),this.loading=!1},initTableData(t){var a,r,i,l,n,c,s,d,m,p,g,y,u,h,f,k,w,b,x,C,L,z,v,M,T,E,I,Z,Y,$,ae,V,G,W,U,A,B,j,N,q,re;this.currentHourData={},this.positionGmt=(r=(a=t==null?void 0:t.weather)==null?void 0:a[0])==null?void 0:r.timezone,this.positionOffset=(l=(i=t==null?void 0:t.weather)==null?void 0:i[0])==null?void 0:l.offset;const e=((n=Ae.Meteo2Assist.pickHourly(t,S(this.form.dateTime)))==null?void 0:n[0])||{};this.currentHourData.utc=e.utc,this.currentHourData.lat=t.lat,this.currentHourData.lng=t.lng,this.currentHourData.temp=this.computeRoundPrecision((c=e==null?void 0:e.weather)==null?void 0:c.temp,0)??"-",this.currentHourData.precipProbability=this.computeRoundPrecision((d=(s=e==null?void 0:e.weather)==null?void 0:s.precip)==null?void 0:d.probability,0)??"-",this.currentHourData.precip1h=this.computeRoundPrecision((p=(m=e==null?void 0:e.weather)==null?void 0:m.precip)==null?void 0:p.sum,0)??"-",this.currentHourData.visibility=this.computeRoundPrecision((g=e==null?void 0:e.weather)==null?void 0:g.visibility,0)??"-",this.currentHourData.windSpeed=this.computeRoundPrecision((u=(y=e==null?void 0:e.weather)==null?void 0:y.wind)==null?void 0:u.kts,1)??"-",this.currentHourData.windDir=((f=(h=e==null?void 0:e.weather)==null?void 0:h.wind)==null?void 0:f.direction)??"-",this.currentHourData.windLevel=this.computeRoundPrecision((w=(k=e==null?void 0:e.weather)==null?void 0:k.wind)==null?void 0:w.scale,0)??"-",this.currentHourData.windGust=this.computeRoundPrecision((x=(b=e==null?void 0:e.weather)==null?void 0:b.wind)==null?void 0:x.gusts,1)??"-",this.currentHourData.sigwaveHeight=this.computeRoundPrecision((L=(C=e==null?void 0:e.wave)==null?void 0:C.sig)==null?void 0:L.height,1)??"-",this.currentHourData.sigwaveDir=(v=(z=e==null?void 0:e.wave)==null?void 0:z.sig)==null?void 0:v.direction,this.currentHourData.sigwavePeriod=this.computeRoundPrecision((T=(M=e==null?void 0:e.wave)==null?void 0:M.sig)==null?void 0:T.period,1)??"-",this.currentHourData.windwaveHeight=this.computeRoundPrecision((I=(E=e==null?void 0:e.wave)==null?void 0:E.wd)==null?void 0:I.height,1)??"-",this.currentHourData.windwaveDir=(Y=(Z=e==null?void 0:e.wave)==null?void 0:Z.wd)==null?void 0:Y.direction,this.currentHourData.windwavePeriod=this.computeRoundPrecision((ae=($=e==null?void 0:e.wave)==null?void 0:$.wd)==null?void 0:ae.period,1)??"-",this.currentHourData.swellHeight=this.computeRoundPrecision((G=(V=e==null?void 0:e.wave)==null?void 0:V.swell)==null?void 0:G.height,1)??"-",this.currentHourData.swellDir=(U=(W=e==null?void 0:e.wave)==null?void 0:W.swell)==null?void 0:U.direction,this.currentHourData.swellPeriod=this.computeRoundPrecision((B=(A=e==null?void 0:e.wave)==null?void 0:A.swell)==null?void 0:B.period,1)??"-",this.currentHourData.currentSpeed=this.computeRoundPrecision((j=e==null?void 0:e.current)==null?void 0:j.speed,1)??"-",this.currentHourData.currentDir=(N=e==null?void 0:e.current)==null?void 0:N.direction,this.currentHourData.currentSpeed=this.computeRoundPrecision((q=e==null?void 0:e.current)==null?void 0:q.speed,1)??"-",this.currentHourData.seaLevel=this.computeRoundPrecision(e==null?void 0:e.height,1)??"-",this.currentHourData.seaTemp=this.computeRoundPrecision(e==null?void 0:e.sst,0)??"-",this.currentHourData.weatherUrls=(re=e==null?void 0:e.weather)==null?void 0:re.url},handleBind(){var t,e;this.toggle?((t=this.map)==null||t.on("click",this.handleClick),this.map&&(this.map.getCanvas().style.cursor="crosshair")):((e=this.map)==null||e.off("click",this.handleClick),this.handleCloseMeteo(),this.map&&(this.map.getCanvas().style.cursor="grab"))},handleClick(t){if(t.originalEvent.stopPropagation(),t.originalEvent.target.className==="mapboxgl-canvas")this.handleGetPosition(t.lngLat),this.$nextTick(()=>{this.fetchData()});else return!1},handleGetPosition(t){if(isNaN(t.lat)||isNaN(t.lng))return!1;this.form.latDegree=Number(P.LngLatHelper.lat2pretty(t.lat).degree),this.form.latMinute=Number(P.LngLatHelper.lat2pretty(t.lat).minute),this.form.latDirection=P.LngLatHelper.lat2pretty(t.lat).direction,this.form.lngDegree=Number(P.LngLatHelper.lng2pretty(t.lng).degree),this.form.lngMinute=Number(P.LngLatHelper.lng2pretty(t.lng).minute),this.form.lngDirection=P.LngLatHelper.lng2pretty(t.lng).direction},handleDrawInfoMarker(t){this.drawPositionMarker(t),this.simple||this.drawMeteoInfoMarker(t)},drawPositionMarker(t){t&&(this.map.flyTo({center:t,duration:300}),this.$nextTick(()=>{var a,r;(a=this.positionMarker)==null||a.remove();const e=(r=document.getElementById("idm-position-icon"))==null?void 0:r.cloneNode(!0);this.positionMarker=new ne.Marker(e).setLngLat(t).setOffset([0,-15]).addTo(this.map)}))},drawMeteoInfoMarker(t){this.$nextTick(()=>{var a;const e=document.getElementById("idm-gl4-spot-meteo");this.meteoInfoMarker?(a=this.meteoInfoMarker)==null||a.setLngLat(t):this.meteoInfoMarker=new ne.Marker(e).setLngLat(t).setOffset([0,-190]).addTo(this.map)})},handleMeteoMore(){this.form.forecastModel=this.forecastModel,this.$emit("meteoMore",this.form)},handleCloseMeteo(){this.showMeteo=!1,this.$nextTick(()=>{var t,e;(t=this.positionMarker)==null||t.remove(),this.positionMarker=void 0,(e=this.meteoInfoMarker)==null||e.remove(),this.meteoInfoMarker=void 0})},handleFollow(){this.$emit("follow",this.form)},handleCancelFollow(){var e,a,r;const t=((e=this.form)==null?void 0:e.followId)||((r=(a=this.followList)==null?void 0:a.find(i=>{var l,n;return(i==null?void 0:i.id)===this.form.followId||((l=i==null?void 0:i.coordinate)==null?void 0:l.lng)===this.form.lng&&((n=i==null?void 0:i.coordinate)==null?void 0:n.lat)===this.form.lat}))==null?void 0:r.id);this.$emit("cancelFollow",t)}}},ch={class:"idm-gl4-spot"},mh={class:"d-flex justify-start align-center"},dh={class:"text-h6 font-weight-600"},hh={class:"d-flex justify-start align-center ga-1 mb-2"},ph={class:"text-label"},gh={class:"d-flex justify-start align-center ga-1 mb-2"},uh={class:"text-label"},fh={class:"d-flex justify-start align-center ga-1 mb-2"},yh={class:"text-label"},bh={class:"d-flex justify-start align-center ga-1 mb-2"},wh={class:"text-label"},xh={class:"d-flex justify-start align-center"},kh={class:"mx-2"},_h={class:"mx-0 py-2 d-flex align-center justify-start"},Lh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},zh={class:"pa-0 px-0"},Ch={class:"mx-0 py-2 d-flex align-center justify-start"},vh={cols:"9",class:"pa-0 px-0"},Sh={class:"mx-0 py-2 d-flex align-center justify-start"},Nh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},Vh={style:{width:"150px"},class:"pa-0 text-left"},Ph={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Mh={cols:"3",class:"pa-0 px-0 text-left"},Th={class:"mx-0 py-2 d-flex align-center justify-start"},Eh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},Dh={style:{width:"150px"},class:"pa-0 text-left"},Rh={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Bh={cols:"3",class:"pa-0 text-left"},Ih={class:"mx-0 py-2 d-flex align-center justify-start"},Ah={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},Fh={style:{width:"150px"},class:"pa-0 text-left"},Gh={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Wh={class:"pa-0 text-left"},Oh={class:"d-flex justify-space-between align-center"},Zh={class:"d-flex justify-start align-center"},jh={class:"mx-1"},Hh={class:"d-flex justify-end align-center"},Xh={class:"mx-0 py-1 d-flex align-center justify-start"},Yh={style:{width:"60px"},class:"pa-0 pr-2 text-right opacity-50"},Uh={class:"pa-0 px-0"},$h={class:"mx-0 py-1 d-flex align-center justify-start"},Jh={class:"pa-0 px-0"},Kh={class:"gray-bg-2 mx-4 my-2 py-3 px-2 rounded text-font-13 d-flex align-center justify-space-between"},qh={class:"d-flex flex-column align-start justify-center ga-3"},Qh={class:"text-label pr-2"},ep={class:"text-label pr-2"},tp={class:"text-label pr-2"},op={class:"d-flex flex-column align-start justify-center ga-3"},ap={class:"text-label pr-2"},ip={class:"text-label pr-2"},rp={class:"text-label pr-2"},lp={id:"idm-position-icon"},np={class:"multi-color-icon",style:{height:"30px",width:"30px"},"aria-hidden":"true"},sp=["xlink:href"];function cp(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCardTitle"),d=o.resolveComponent("VDivider"),m=o.resolveComponent("VTextField"),p=o.resolveComponent("VCol"),g=o.resolveComponent("VRow"),y=o.resolveComponent("DateTimePicker"),u=o.resolveComponent("VBtnToggle"),h=o.resolveComponent("VCardText"),f=o.resolveComponent("VCardActions"),k=o.resolveComponent("VForm"),w=o.resolveComponent("VCard");return o.openBlock(),o.createElementBlock("div",ch,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+126+"px",right:i.right+"px"})},[o.createVNode(c,{text:t.$t("spot.spotsMeteo"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:b})=>[o.createVNode(n,o.mergeProps(b,{"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[8]||(e[8]=[o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h4"},null,-1)])),_:2,__:[8]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),i.showForm&&!a.simple?(o.openBlock(),o.createBlock(w,{key:0,class:"spot-form-card",style:o.normalizeStyle({top:a.top+a.paddingTop+126+"px",right:i.right+50+"px"})},{default:o.withCtx(()=>[o.createVNode(s,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("div",mh,[o.createElementVNode("div",dh,o.toDisplayString(t.$t("spot.spotWeather")),1)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleCloseForm},{default:o.withCtx(()=>e[9]||(e[9]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[9]},8,["onClick"])]),_:1}),o.createVNode(d),o.createVNode(k,{ref:"spotForm",autocomplete:"off",class:"form-box",onSubmit:o.withModifiers(l.submitForm,["prevent"])},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-body-1 pa-4"},{default:o.withCtx(()=>[o.createElementVNode("div",hh,[o.createElementVNode("div",ph,[o.createTextVNode(o.toDisplayString(t.$t("spot.lat")),1),e[10]||(e[10]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.latDegree,"onUpdate:modelValue":e[0]||(e[0]=b=>i.form.latDegree=b),rules:i.formRules.latDegree,label:"",density:"compact",variant:"outlined",height:"32px","min-height":"32px",required:"",dense:"",class:"text-body-1 input-btn-bg-1"},null,8,["modelValue","rules"]),e[11]||(e[11]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[11]}),o.createVNode(p,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.latMinute,"onUpdate:modelValue":e[1]||(e[1]=b=>i.form.latMinute=b),rules:i.formRules.latMinute,label:"",density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),e[12]||(e[12]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[12]}),o.createVNode(p,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 bg-primary",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:e[2]||(e[2]=b=>i.form.latDirection=i.form.latDirection==="N"?"S":"N")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.latDirection),1)]),_:1})]),_:1})]),_:1}),o.createElementVNode("div",gh,[o.createElementVNode("div",uh,[o.createTextVNode(o.toDisplayString(t.$t("spot.lng")),1),e[13]||(e[13]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.lngDegree,"onUpdate:modelValue":e[3]||(e[3]=b=>i.form.lngDegree=b),rules:i.formRules.lngDegree,density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),e[14]||(e[14]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[14]}),o.createVNode(p,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.lngMinute,"onUpdate:modelValue":e[4]||(e[4]=b=>i.form.lngMinute=b),rules:i.formRules.lngMinute,label:"",density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),e[15]||(e[15]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[15]}),o.createVNode(p,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 bg-primary",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:e[5]||(e[5]=b=>i.form.lngDirection=i.form.lngDirection==="E"?"W":"E")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.lngDirection),1)]),_:1})]),_:1})]),_:1}),o.createElementVNode("div",fh,[o.createElementVNode("div",yh,[o.createTextVNode(o.toDisplayString(t.$t("spot.dateTime")),1),e[16]||(e[16]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0 mb-4"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"12",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(y,o.mergeProps({"date-time":i.form.dateTime,"time-zone":a.timeZone},t.$attrs,{onDateTime:e[6]||(e[6]=b=>i.form.dateTime=b)}),null,16,["date-time","time-zone"])]),_:1})]),_:1}),o.createElementVNode("div",bh,[o.createElementVNode("div",wh,[o.createTextVNode(o.toDisplayString(t.$t("weather.forecastModel")),1),e[17]||(e[17]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0 mb-2"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"12",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(u,{modelValue:i.form.forecastModel,"onUpdate:modelValue":e[7]||(e[7]=b=>i.form.forecastModel=b),class:"w-100",rounded:"",height:"30",density:"compact",group:""},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"GFS",class:o.normalizeClass(["text-none flex-1-1-0",i.form.forecastModel==="GFS"?"":"btn-border-1 btn-bg-1"]),color:i.form.forecastModel==="GFS"?"primary":"","base-color":""},{default:o.withCtx(()=>e[18]||(e[18]=[o.createTextVNode(" NOAA ",-1)])),_:1,__:[18]},8,["class","color"]),o.createVNode(n,{density:"compact",height:"30",class:o.normalizeClass(["text-none flex-1-1-0",i.form.forecastModel==="ECMWF"?"":"btn-border-1 btn-bg-1"]),color:i.form.forecastModel==="ECMWF"?"primary":"","base-color":"",value:"ECMWF"},{default:o.withCtx(()=>e[19]||(e[19]=[o.createTextVNode(" ECMWF ",-1)])),_:1,__:[19]},8,["class","color"])]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),o.createVNode(d),o.createVNode(f,{class:"d-flex justify-end align-center ga-4 pa-4"},{default:o.withCtx(()=>[o.createVNode(n,{size:"small",variant:"tonal",class:"text-none text-body-1 btn-bg-1",onClick:l.cancelForm},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.clear")),1)]),_:1},8,["onClick"]),o.createVNode(n,{ref:"submitSpot",loading:i.loading,size:"small",variant:"flat",color:"primary",type:"submit",class:"text-none text-body-1"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.confirm")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["onSubmit"])]),_:1},8,["style"])):o.createCommentVNode("",!0),i.showMeteo&&!a.simple?(o.openBlock(),o.createBlock(w,{key:1,id:"idm-gl4-spot-meteo",class:"spot-meteo",style:{width:"490px","z-index":"9"}},{default:o.withCtx(()=>[o.createVNode(s,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("div",xh,[e[20]||(e[20]=o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h5 map-icon-aqua"},null,-1)),o.createElementVNode("div",kh,o.toDisplayString(l.computePosition(i.form||i.currentHourData)),1)]),o.createVNode(n,{class:"mr-n2",density:"comfortable",icon:"",variant:"plain",onClick:o.withModifiers(l.handleCloseMeteo,["stop"])},{default:o.withCtx(()=>e[21]||(e[21]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[21]},8,["onClick"])]),_:1}),o.createVNode(d),o.createVNode(h,{class:"text-body-1 px-0 py-1"},{default:o.withCtx(()=>{var b,x;return[o.createElementVNode("div",_h,[o.createElementVNode("div",Lh,o.toDisplayString(t.$t("time.time")),1),o.createElementVNode("div",zh,o.toDisplayString(l.computedTzTime((b=i.currentHourData)==null?void 0:b.utc)),1)]),o.createElementVNode("div",Ch,[e[22]||(e[22]=o.createElementVNode("div",{style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},"LT",-1)),o.createElementVNode("div",vh,o.toDisplayString(l.computedLocalTime((x=i.currentHourData)==null?void 0:x.utc)),1)]),o.createElementVNode("div",Sh,[o.createElementVNode("div",Nh,o.toDisplayString(t.$t("weather.wind")),1),o.createElementVNode("div",Vh,o.toDisplayString(i.currentHourData.windDir??"-")+"/"+o.toDisplayString(i.currentHourData.windSpeed??"-")+"kts/BF"+o.toDisplayString(i.currentHourData.windLevel??"-"),1),o.createElementVNode("div",Ph,o.toDisplayString(t.$t("weather.sigWave")),1),o.createElementVNode("div",Mh,o.toDisplayString(i.currentHourData.sigwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.sigwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.sigwavePeriod??"-")+"s ",1)]),o.createElementVNode("div",Th,[o.createElementVNode("div",Eh,o.toDisplayString(t.$t("weather.windWave")),1),o.createElementVNode("div",Dh,o.toDisplayString(i.currentHourData.windwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.windwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.windwavePeriod??"-")+"s ",1),o.createElementVNode("div",Rh,o.toDisplayString(t.$t("weather.swell")),1),o.createElementVNode("div",Bh,o.toDisplayString(i.currentHourData.swellDir??"-")+"/"+o.toDisplayString(i.currentHourData.swellHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.swellPeriod??"-")+"s ",1)]),o.createElementVNode("div",Ih,[o.createElementVNode("div",Ah,o.toDisplayString(t.$t("weather.current")),1),o.createElementVNode("div",Fh,o.toDisplayString(i.currentHourData.currentDir??"-")+"/"+o.toDisplayString(i.currentHourData.currentSpeed??"-")+"kts",1),o.createElementVNode("div",Gh,o.toDisplayString(t.$t("weather.visibility")),1),o.createElementVNode("div",Wh,o.toDisplayString(i.currentHourData.visibility??"-")+" nm",1)])]}),_:1}),o.createVNode(d),o.createVNode(f,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>{var b;return[(b=a.followList)!=null&&b.some(x=>{var C,L;return(x==null?void 0:x.id)===i.form.followId||((C=x==null?void 0:x.coordinate)==null?void 0:C.lng)===i.form.lng&&((L=x==null?void 0:x.coordinate)==null?void 0:L.lat)===i.form.lat})?(o.openBlock(),o.createBlock(n,{key:0,id:"idm-gl4-spot-meteo-follow",class:"text-none text-body-1",variant:"text",density:"compact",height:"32",onClick:o.withModifiers(l.handleCancelFollow,["stop"])},{prepend:o.withCtx(()=>e[23]||(e[23]=[o.createElementVNode("i",{class:"iconfont icon-yishoucang text-h6 text-warning"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(t.$t("actions.unfollow")),1)]),_:1},8,["onClick"])):(o.openBlock(),o.createBlock(n,{key:1,id:"idm-gl4-spot-meteo-unfollow",class:"text-none text-body-1",variant:"text",density:"compact",height:"32",onClick:o.withModifiers(l.handleFollow,["stop"])},{prepend:o.withCtx(()=>e[24]||(e[24]=[o.createElementVNode("i",{class:"iconfont icon-weishoucang text-h6"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.follow"))+" ",1)]),_:1},8,["onClick"])),o.createVNode(n,{height:"32",variant:"text",density:"compact","append-icon":"mdi-chevron-right",class:"text-none text-body-1",onClick:o.withModifiers(l.handleMeteoMore,["stop"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("spot.forecast")),1)]),_:1},8,["onClick"])]}),_:1})]),_:1})):o.createCommentVNode("",!0),i.showMeteo&&a.simple?(o.openBlock(),o.createBlock(w,{key:2,ref:"spotMeteo",class:"position-absolute bottom-0 rounded-t-4",style:{width:"100vw","z-index":"1001"}},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>{var b;return[o.createElementVNode("div",Oh,[o.createElementVNode("div",Zh,[e[25]||(e[25]=o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h5 map-icon-aqua"},null,-1)),o.createElementVNode("div",jh,o.toDisplayString(l.computePosition(i.form||i.currentHourData)),1)]),o.createElementVNode("div",Hh,[(b=a.followList)!=null&&b.some(x=>{var C,L;return(x==null?void 0:x.id)===i.form.followId||((C=x==null?void 0:x.coordinate)==null?void 0:C.lng)===i.form.lng&&((L=x==null?void 0:x.coordinate)==null?void 0:L.lat)===i.form.lat})?(o.openBlock(),o.createBlock(n,{key:0,class:"text-none text-body-1 rounded-circle",variant:"text",density:"compact",height:"32",width:"28","min-width":"28",onClick:o.withModifiers(l.handleCancelFollow,["stop"])},{default:o.withCtx(()=>e[26]||(e[26]=[o.createElementVNode("i",{class:"iconfont icon-yishoucang text-h4 text-warning"},null,-1)])),_:1,__:[26]},8,["onClick"])):(o.openBlock(),o.createBlock(n,{key:1,class:"text-none text-body-1 rounded-circle",variant:"plain",density:"compact",height:"32",width:"28","min-width":"28",onClick:o.withModifiers(l.handleFollow,["stop"])},{default:o.withCtx(()=>e[27]||(e[27]=[o.createElementVNode("i",{class:"iconfont icon-weishoucang text-h4"},null,-1)])),_:1,__:[27]},8,["onClick"])),o.createVNode(n,{class:"mr-n2",density:"comfortable",icon:"",variant:"plain",onClick:o.withModifiers(l.handleCloseMeteo,["stop"])},{default:o.withCtx(()=>e[28]||(e[28]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[28]},8,["onClick"])])]),e[29]||(e[29]=o.createElementVNode("div",{class:"px-5 py-0 text-label text-body-1"},"Spot Weather",-1))]}),_:1,__:[29]}),o.createVNode(d),o.createVNode(h,{class:"text-body-1 px-0 py-2"},{default:o.withCtx(()=>{var b,x;return[o.createElementVNode("div",Xh,[o.createElementVNode("div",Yh,o.toDisplayString(t.$t("time.time")),1),o.createElementVNode("div",Uh,o.toDisplayString(l.computedTzTime((b=i.currentHourData)==null?void 0:b.utc)),1)]),o.createElementVNode("div",$h,[e[30]||(e[30]=o.createElementVNode("div",{style:{width:"60px"},class:"pa-0 pr-2 text-right opacity-50"},"LT",-1)),o.createElementVNode("div",Jh,o.toDisplayString(l.computedLocalTime((x=i.currentHourData)==null?void 0:x.utc)),1)]),o.createElementVNode("div",Kh,[o.createElementVNode("div",qh,[o.createElementVNode("div",null,[o.createElementVNode("span",Qh,o.toDisplayString(t.$t("weather.wind")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.windDir??"-")+"/"+o.toDisplayString(i.currentHourData.windSpeed??"-")+"kts/BF"+o.toDisplayString(i.currentHourData.windLevel??"-"),1)]),o.createElementVNode("div",null,[o.createElementVNode("span",ep,o.toDisplayString(t.$t("weather.sigWave")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.sigwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.sigwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.sigwavePeriod??"-")+"s",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",tp,o.toDisplayString(t.$t("weather.windWave")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.windwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.windwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.windwavePeriod??"-")+"s",1)])]),o.createElementVNode("div",op,[o.createElementVNode("div",null,[o.createElementVNode("span",ap,o.toDisplayString(t.$t("weather.swell")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.swellDir??"-")+"/"+o.toDisplayString(i.currentHourData.swellHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.swellPeriod??"-")+"s",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",ip,o.toDisplayString(t.$t("weather.current")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.currentDir??"-")+"/"+o.toDisplayString(i.currentHourData.currentSpeed??"-")+"kts",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",rp,o.toDisplayString(t.$t("weather.visibility")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.visibility??"-")+" nm",1)])])])]}),_:1})]),_:1},512)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",lp,[(o.openBlock(),o.createElementBlock("svg",np,[o.createElementVNode("use",{"xlink:href":`#icon-spot-${a.theme}`},null,8,sp)]))],512),[[o.vShow,i.showMeteo]])])}const mp=X(sh,[["render",cp]]),Ay="",dp={name:"IdmMeasure",props:{simple:{type:Boolean,default:!1},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}}},setup(){return{Theme:fe.useTheme()}},data(){return{right:10,toggle:!1,geojson:[],source:"measure-source",layer:"measure-layer",labelLayer:"measure-label-layer",sumLayer:"measure-suml-layer",tmpSource:"measure-tmp-source",tmpLayer:"measure-tmp-layer",tmpLabelLayer:"measure-tmp-label-layer",closeMarkers:{},pointMarkers:{},tipMarker:void 0,contextmenu:void 0,navigation:"RL",currentLineIndex:1}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},toggle:{handler(){var t,e,a;if(this.toggle)this.handleBind();else{(t=this.map)==null||t.getCanvas().removeEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.off("mousemove",this.handleMove),(a=this.map)==null||a.off("dblclick",this.handleDblClick),this.map;let r=this.geojson.find(i=>!i.closed);r&&this.handleClear(r,!0),this.geojson=this.geojson.filter(i=>!!i.closed),r=D.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(r)}},immediate:!0},map:{handler(){this.map&&(this.toggle?this.handleBind():this.handleUnbind())}}},methods:{handleMenuToggle(){this.toggle=!this.toggle},handleBind(){var t,e,a,r,i;(t=this.map)==null||t.getCanvas().addEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.on("mousemove",this.handleMove),(a=this.map)==null||a.on("dblclick",this.handleDblClick),(r=this.map)==null||r.on("click",this.handleClick),(i=this.map)==null||i.on("contextmenu",this.handleContextmenu),this.map&&(this.map.getCanvas().style.cursor="crosshair")},handleUnbind(){var t,e,a,r,i;(t=this.map)==null||t.getCanvas().removeEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.off("mousemove",this.handleMove),(a=this.map)==null||a.off("dblclick",this.handleDblClick),(r=this.map)==null||r.off("click",this.handleClick),(i=this.map)==null||i.off("contextmenu",this.handleContextmenu);for(const l of this.geojson)this.handleClear(l,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")},handleKeydown(t){if(t.key==="Shift"){this.navigation=this.navigation==="RL"?"GC":"RL";const e=this.geojson.at(-1),a=e.features.filter(r=>r.geometry.type==="Point");a!=null&&a.length&&(a.at(-1).properties.mode=this.navigation),this.handleRender(e)}},handleDrag(t){var a,r,i,l,n,c,s,d,m,p;const e=(r=(a=t.target)==null?void 0:a._element)==null?void 0:r.id;if((e==null?void 0:e.split("-").length)===2){const g=this.geojson.filter(f=>f.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(f=>{var k;return((k=f._element)==null?void 0:k.id)===e})[0].setLngLat([(l=(i=t.target)==null?void 0:i._lngLat)==null?void 0:l.lng,(c=(n=t.target)==null?void 0:n._lngLat)==null?void 0:c.lat]);let u;g.features.forEach((f,k)=>{if(f.geometry.type==="Point"&&f.properties.id===e.split("-")[1]){u=k;return}});const h=g.features.filter(f=>f.geometry.type==="Point");this.handleTmpPointUpdate(g,h[u-1],{lng:(d=(s=t.target)==null?void 0:s._lngLat)==null?void 0:d.lng,lat:(p=(m=t.target)==null?void 0:m._lngLat)==null?void 0:p.lat,properties:h[u].properties},u===h.length-1?void 0:h[u+1])}},handleDragEnd(t){var a,r,i,l,n,c,s,d,m,p;const e=(r=(a=t.target)==null?void 0:a._element)==null?void 0:r.id;if((e==null?void 0:e.split("-").length)===2){const g=this.geojson.filter(h=>h.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(h=>{var f;return((f=h._element)==null?void 0:f.id)===e})[0].setLngLat([(l=(i=t.target)==null?void 0:i._lngLat)==null?void 0:l.lng,(c=(n=t.target)==null?void 0:n._lngLat)==null?void 0:c.lat]);const u=g.features.filter(h=>h.geometry.type==="Point"&&h.properties.id===e.split("-")[1])[0];u.geometry.coordinates=[(d=(s=t.target)==null?void 0:s._lngLat)==null?void 0:d.lng,(p=(m=t.target)==null?void 0:m._lngLat)==null?void 0:p.lat],g.features=g.features.filter(h=>h.geometry.type==="Point"),this.handlePointUpdate(g)}},handleContextmenu(t){var a,r,i,l;t.preventDefault(),(a=this.contextmenu)==null||a.remove();const e=(l=(i=(r=t.originalEvent)==null?void 0:r.target)==null?void 0:i.parentElement)==null?void 0:l.id;if((e==null?void 0:e.split("-").length)===2){const c=this.geojson.filter(s=>s.id===e.split("-")[0])[0].features.filter(s=>s.geometry.type==="Point");if(c.length>2&&c.filter(d=>d.properties.id===(e==null?void 0:e.split("-")[1]))[0]){const d=document.createElement("div");d.className="idm-gl4-measure-contextmenu-marker",d.innerHTML=`<span id="del-${e}" class="del-point">${this.$t("actions.detele")}</span>`,this.contextmenu=new ne.Marker(d).setOffset([24,0]).setLngLat([t.lngLat.lng,t.lngLat.lat]).addTo(this.map)}}},handleClick(t){var a,r,i,l,n,c;(a=this.contextmenu)==null||a.remove();const e=t.originalEvent.target.className;if(e==="marker-close"){const s=(i=(r=t.originalEvent)==null?void 0:r.srcElement)==null?void 0:i.id,d=this.geojson.filter(m=>m.id===s)[0];d&&this.handleClear(d,!0),this.geojson=this.geojson.filter(m=>m.id!==s),!this.toggle&&!((l=this.geojson)!=null&&l.some(m=>m.closed))&&this.handleUnbind()}else if(e==="del-point"){const s=(c=(n=t.originalEvent.target.id)==null?void 0:n.replace("del-",""))==null?void 0:c.split("-"),d=this.geojson.filter(m=>m.id===s[0])[0];d.features=d.features.filter(m=>m.geometry.type==="Point"&&m.properties.id!==s[1]),this.handlePointUpdate(d)}else if(e!=="marker-label"&&this.toggle){let s=this.geojson.at(-1);s||(s=D.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(s)),s.features=s.features.filter(m=>m.geometry.type==="Point");const d=D.feature({type:"Point",coordinates:[t.lngLat.lng,t.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation,sumLabel:"Start"});s.features.push(d),this.handlePointUpdate(s)}},handlePointUpdate(t){const e=t.features;if(e.length>1){let a=0;const r=[];for(let i=1;i<e.length;i++){const l=e[i-1],n=e[i],c=l.properties,s={lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]},d={lng:n.geometry.coordinates[0],lat:n.geometry.coordinates[1]},m=P.LaneHelper.calculateDistance(s,d,c.mode==="RL",4),p=P.LaneHelper.calculateBearing(s,d,c.mode==="RL",2);a=P.LngLatHelper.roundPrecision(a+m,4);let g;c.mode==="RL"?g=P.LngLatHelper.convertToMonotonicLng([s,d]):g=P.LngLatHelper.convertToMonotonicLng(P.LaneHelper.interpolateCoordinates(s,d,200));const y=D.lineString(g.map(h=>[h.lng,h.lat]));y.properties.dist=m,y.properties.bearing=p,y.properties.total=a,y.properties.name="Line "+this.currentLineIndex,r.push(y);const u=e[i];u.properties.totalDist=P.LngLatHelper.roundPrecision((c.totalDist?c.totalDist:0)+m,4),u.properties.sumLabel=u.properties.totalDist+" nm"}e.push(...r),t.total=a}return this.handleRender(t),t},handleTmpPointUpdate(t,e,a,r){const i=D.featureCollection([]);let l,n;if(e){const s=e.properties,d={lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]},m={lng:a.lng,lat:a.lat};l=P.LaneHelper.calculateDistance(d,m,s.mode==="RL",4),n=P.LaneHelper.calculateBearing(d,m,s.mode==="RL",2);let p;s.mode==="RL"?p=P.LngLatHelper.convertToMonotonicLng([d,m]):p=P.LngLatHelper.convertToMonotonicLng(P.LaneHelper.interpolateCoordinates(d,m,200));const g=D.lineString(p.map(y=>[y.lng,y.lat]));g.properties.dist=l,g.properties.bearing=n,i.features.push(g)}if(r){const s=a.properties,d=a,m={lng:r.geometry.coordinates[0],lat:r.geometry.coordinates[1]};l=P.LaneHelper.calculateDistance(d,m,s.mode==="RL",4),n=P.LaneHelper.calculateBearing(d,m,s.mode==="RL",2);let p;s.mode==="RL"?p=P.LngLatHelper.convertToMonotonicLng([d,m]):p=P.LngLatHelper.convertToMonotonicLng(P.LaneHelper.interpolateCoordinates(d,m,200));const g=D.lineString(p.map(y=>[y.lng,y.lat]));g.properties.dist=l,g.properties.bearing=n,i.features.push(g)}this.map.getSource(this.tmpSource)?this.map.getSource(this.tmpSource).setData(i):this.map.addSource(this.tmpSource,{type:"geojson",data:i}),this.map.getLayer(this.tmpLayer)||this.map.addLayer({id:this.tmpLayer,type:"line",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["map-orange"],"line-width":2,"line-opacity":1,"line-dasharray":[3,2]}}),this.map.getLayer(this.tmpLabelLayer)||this.map.addLayer({id:this.tmpLabelLayer,type:"symbol",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist}nm / {bearing}°","text-rotation-alignment":"map","text-size":11,"text-offset":[0,-1]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}});let c;if(r)c=`<div class="marker-label">${this.$t("measure.dragTips")}</div>`;else{const s=P.LngLatHelper.roundPrecision((t.total??0)+l,1);c=`<div class="marker-label">${this.$t("measure.totalDistance")}: <b>${s}</b>nm, ${this.$t("measure.bearing")}: <b>${n}</b>°</div><div class="marker-label"> ${this.$t("measure.mode")}${this.navigation==="RL"?"RL":"GC"}, ${this.$t("measure.switchTips")}</div><div class="marker-label">${this.$t("measure.clickTips")}</div>`}if(this.tipMarker)this.tipMarker._element.innerHTML=c,this.tipMarker.setLngLat([a.lng,a.lat]);else{const s=document.createElement("div");s.className="idm-gl4-measure-tip-marker",s.innerHTML=c,this.tipMarker=new ne.Marker(s).setOffset([140,0]).setLngLat([a.lng,a.lat]).addTo(this.map)}},handleMove(t){this.map.getCanvas().style.cursor="crosshair";let e=this.geojson.at(-1);e||(e=D.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e));const a=e.features.filter(r=>r.geometry.type==="Point");a!=null&&a.length&&this.handleTmpPointUpdate(e,a.at(-1),{lng:t.lngLat.lng,lat:t.lngLat.lat})},handleDblClick(t){t.preventDefault();let e=this.geojson.at(-1);e.closed=!0,this.handleRender(e),e=D.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e),this.currentLineIndex++},handleRender(t){var e;if((e=t==null?void 0:t.features)!=null&&e.length){const a=`${t.id}-${this.source}`,r=`${t.id}-${this.layer}`,i=`${t.id}-${this.labelLayer}`,l=`${t.id}-${this.sumLayer}`;this.map.getSource(a)?this.map.getSource(a).setData(t):this.map.addSource(a,{type:"geojson",data:t}),this.handleClear(t,!1),this.map.addLayer({id:r,type:"line",source:a,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["map-orange"],"line-width":2}}),this.map.addLayer({id:i,type:"symbol",source:a,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist}nm / {bearing}°","text-rotation-alignment":"map","text-size":11,"text-offset":[0,-1]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}}),this.map.addLayer({id:l,type:"symbol",source:a,filter:["==","$type","Point"],layout:{"text-field":"{sumLabel}","text-rotation-alignment":"map","text-size":12,"text-offset":[0,1.5]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}});const n=t.features.filter(c=>c.geometry.type==="Point");for(const c of n){const s=document.createElement("div");s.id=`${t.id}-${c.properties.id}`,s.className=`${t.closed?"idm-gl4-measure-marker closed":"idm-gl4-measure-marker"}`,s.innerHTML='<div class="marker-circle"></div>';const d=new ne.Marker({element:s,draggable:!0,contextmenu:!0}).setLngLat(c.geometry.coordinates).addTo(this.map);d.on("drag",this.handleDrag),d.on("dragend",this.handleDragEnd),this.pointMarkers[t.id]?this.pointMarkers[t.id].push(d):this.pointMarkers[t.id]=[d]}if(t.closed){const c=n.at(-1),d=t.features.filter(p=>p.geometry.type==="LineString").at(-1),m=document.createElement("div");m.className="idm-gl4-measure-summary-marker",m.innerHTML=`<div class="marker-label">${d.properties.name}</div><div id="${t.id}" class="marker-close">X</div>`,this.closeMarkers[t.id]=new ne.Marker(m).setOffset([0,-30]).setLngLat(c.geometry.coordinates).addTo(this.map)}}},handleClear(t,e=!0){var n,c,s,d,m,p,g,y,u,h;const a=`${t.id}-${this.source}`,r=`${t.id}-${this.layer}`,i=`${t.id}-${this.labelLayer}`,l=`${t.id}-${this.sumLayer}`;(n=this.map)!=null&&n.getLayer(r)&&this.map.removeLayer(r),(c=this.map)!=null&&c.getLayer(i)&&this.map.removeLayer(i),(s=this.map)!=null&&s.getLayer(l)&&this.map.removeLayer(l),(d=this.map)!=null&&d.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(m=this.map)!=null&&m.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(p=this.closeMarkers[t.id])==null||p.remove(),this.closeMarkers[t.id]=void 0,(g=this.pointMarkers[t.id])==null||g.forEach(f=>{f==null||f.remove()}),this.pointMarkers[t.id]=[],(y=this.tipMarker)==null||y.remove(),this.tipMarker=void 0,e&&((u=this.map)!=null&&u.getSource(a))&&this.map.removeSource(a),e&&((h=this.map)!=null&&h.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}},hp={class:"idm-gl4-measure"};function pp(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip");return o.openBlock(),o.createElementBlock("div",hp,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+166+"px",right:i.right+"px"})},[o.createVNode(c,{text:t.$t("measure.measure"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:s})=>[o.createVNode(n,o.mergeProps(s,{"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[0]||(e[0]=[o.createElementVNode("i",{class:"iconfont icon-a-Measuredistance text-h4"},null,-1)])),_:2,__:[0]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4)])}const gp=X(dp,[["render",pp]]),Fy="",up={name:"IdmDrawMarker",props:{map:{type:Object},gateway:{type:String},token:{type:String},simple:{type:Boolean,default:!1},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:()=>({})},editLayer:{type:Object,default:null},group:{type:Object,default:()=>({})}},emits:["close","save","hideLayer"],setup(){return{Theme:fe.useTheme()}},data(){var t;return{markerType:"Point",form:{latDegree:"",latMinute:"",latDir:"N",lngDegree:"",lngMinute:"",lngDir:"E",areaType:"Polygon",color:(t=this.Theme.current.value.colors)==null?void 0:t["map-green"],name:""},formRules:{lngDegree:[e=>e!=null&&e!==""||"required",e=>/^\d{1,3}$/.test(e)||"number",e=>parseInt(e)>=0&&parseInt(e)<=180||"0 ~ 180"],lngMinute:[e=>e==null||e===""||/^\d{1,2}(\.\d+)?$/.test(e)||"number",e=>e==null||e===""||parseInt(e)>=0&&parseInt(e)<=59||"0 ~ 59"],latDegree:[e=>e!=null&&e!==""||"required",e=>/^\d{1,2}$/.test(e)||"number",e=>parseInt(e)>=0&&parseInt(e)<=90||"0 ~ 90"],latMinute:[e=>e==null||e===""||/^\d{1,2}(\.\d+)?$/.test(e)||"number",e=>e==null||e===""||parseInt(e)>=0&&parseInt(e)<=59||"0 ~ 59"],color:[e=>e!=null&&e!==""||"required"],name:[e=>e!=null&&e!==""||"required"]},saving:!1,drawSource:"draw-marker-source",drawPointLayer:"draw-marker-point-layer",drawLineLayer:"draw-marker-line-layer",drawFillLayer:"draw-marker-fill-layer",drawTmpSource:"draw-marker-tmp-source",drawTmpLayer:"draw-marker-tmp-layer",drawCoords:[],rectCornerMarkers:[],polygonVertexMarkers:[],circleMarkers:[],drawRadiusSource:"draw-marker-radius-source",drawRadiusLayer:"draw-marker-radius-layer",tipMarker:null,pointMarker:null,pointHighlightMarker:null,editMarkers:[],deleteBtn:null,originalProperties:{}}},watch:{markerType:{handler(){var t;(t=this.editLayer)!=null&&t.id||(this.markerType==="Area"?this.form.name=`${this.form.areaType} 1`:this.form.name=`${this.markerType} 1`,this.handleClearDraw())},immediate:!0},"form.areaType"(){var t;(t=this.editLayer)!=null&&t.id||(this.markerType==="Area"?this.form.name=`${this.form.areaType} 1`:this.form.name=`${this.markerType} 1`,this.handleClearDraw())},map:{handler(){var t;this.map&&(this.handleBindMap(),(t=this.editLayer)!=null&&t.id&&this.loadEditLayer())},immediate:!0},"form.color":{handler(){this.handleChangePoint(),this.handleUpdateLayerColors()},immediate:!0}},beforeUnmount(){this.handleClearDraw(!0),this.handleUnbindMap()},methods:{handleClose(){this.handleClearDraw(!0),this.handleUnbindMap(),this.$emit("close")},handleBindMap(){var t,e;this.map&&(this.markerType==="Point"?(this.map.on("click",this.handleMapClickPoint),this.map.getCanvas().style.cursor="crosshair"):this.markerType==="Line"&&!((t=this.editLayer)!=null&&t.id)?(this.map.on("click",this.handleMapClickLine),this.map.on("mousemove",this.handleMapMoveLine),this.map.on("dblclick",this.handleMapDblClickLine),this.map.getCanvas().style.cursor="crosshair"):this.markerType==="Area"&&!((e=this.editLayer)!=null&&e.id)&&(this.form.areaType==="Polygon"?(this.map.on("click",this.handleMapClickPolygon),this.map.on("mousemove",this.handleMapMovePolygon),this.map.on("dblclick",this.handleMapDblClickPolygon)):this.form.areaType==="Circle"?(this.map.on("click",this.handleMapClickCircle),this.map.on("mousemove",this.handleMapMoveCircle)):this.form.areaType==="Rect"&&(this.map.on("click",this.handleMapClickRect),this.map.on("mousemove",this.handleMapMoveRect)),this.map.getCanvas().style.cursor="crosshair"))},handleUnbindMap(){this.map&&(this.map.off("click",this.handleMapClickPoint),this.map.off("click",this.handleMapClickLine),this.map.off("mousemove",this.handleMapMoveLine),this.map.off("dblclick",this.handleMapDblClickLine),this.map.off("click",this.handleMapClickPolygon),this.map.off("mousemove",this.handleMapMovePolygon),this.map.off("dblclick",this.handleMapDblClickPolygon),this.map.off("click",this.handleMapClickCircle),this.map.off("mousemove",this.handleMapMoveCircle),this.map.off("click",this.handleMapClickRect),this.map.off("mousemove",this.handleMapMoveRect),this.map.getCanvas().style.cursor="grab")},handleRebindMap(){this.handleUnbindMap(),this.handleBindMap()},loadEditLayer(){var i,l,n,c,s,d;if(!((i=this.editLayer)!=null&&i.extend)||!this.map)return;const t=typeof this.editLayer.extend=="string"?JSON.parse(this.editLayer.extend):this.editLayer.extend;if(!t)return;const a=(t.features||(t.type==="Feature"?[t]:[]))[0];if(!a)return;this.originalProperties=a.properties||{},this.form.name=this.editLayer.name||"",this.form.color=this.editLayer.color||((l=this.originalProperties)==null?void 0:l.color)||((n=this.Theme.current.value.colors)==null?void 0:n["map-green"])||"#4CAF50";const r=(c=a.geometry)==null?void 0:c.type;if(r==="Point"){this.markerType="Point";const[m,p]=a.geometry.coordinates;this.drawCoords=[[m,p]],this.form.latDegree=Number(P.LngLatHelper.lat2pretty(p).degree),this.form.latMinute=Number(P.LngLatHelper.lat2pretty(p).minute),this.form.latDir=P.LngLatHelper.lat2pretty(p).direction,this.form.lngDegree=Number(P.LngLatHelper.lng2pretty(m).degree),this.form.lngMinute=Number(P.LngLatHelper.lng2pretty(m).minute),this.form.lngDir=P.LngLatHelper.lng2pretty(m).direction,this.handleRenderPoint(this.drawCoords,this.form.color),this.setupPointEdit()}else r==="LineString"?(this.markerType="Line",this.$nextTick(()=>{this.handlerRenderEditLine(a),this.setupLineEdit(),this.handleUnbindMap()})):r==="Polygon"&&(this.markerType="Area",this.form.areaType=(d=(s=this.originalProperties)==null?void 0:s.shape)==null?void 0:d.toLowerCase(),this.$nextTick(()=>{this.handlerRenderEditPolygon(t),this.setupPolygonEdit(a),this.handleUnbindMap()}));this.$emit("hideLayer",this.editLayer.id)},setupPointEdit(){var a;if(!this.pointMarker)return;this.pointMarker.setDraggable(!0),this.pointMarker.off("drag",this.handlePointDrag),this.pointMarker.on("drag",this.handlePointDrag),this.pointMarker.off("dragend",this.handlePointDrag),this.pointMarker.on("dragend",this.handlePointDrag),(a=this.pointHighlightMarker)==null||a.remove();const t=document.createElement("div");t.className="idm-gl4-point-center-ring";const e=this.pointMarker.getLngLat();this.pointHighlightMarker=new ne.Marker({element:t,anchor:"center",offset:[0,0]}).setLngLat(e).addTo(this.map),this.pointMarker.on("drag",()=>{var r;(r=this.pointHighlightMarker)==null||r.setLngLat(this.pointMarker.getLngLat())})},handlePointDrag(){const{lng:t,lat:e}=this.pointMarker.getLngLat();this.drawCoords=[[t,e]],this.form.latDegree=Number(P.LngLatHelper.lat2pretty(e).degree),this.form.latMinute=Number(P.LngLatHelper.lat2pretty(e).minute),this.form.latDir=P.LngLatHelper.lat2pretty(e).direction,this.form.lngDegree=Number(P.LngLatHelper.lng2pretty(t).degree),this.form.lngMinute=Number(P.LngLatHelper.lng2pretty(t).minute),this.form.lngDir=P.LngLatHelper.lng2pretty(t).direction},clearEditMarkers(){this.editMarkers.forEach(t=>t.remove()),this.editMarkers=[],this._edgeContextMenuHandler&&this.map&&(this.map.off("contextmenu",this._edgeContextMenuHandler),this._edgeContextMenuHandler=null)},handlerRenderEditLine(t){this.drawCoords=t.geometry.coordinates.map(r=>[...r]);const e=D.featureCollection([t,...this.drawCoords.map(r=>D.point(r))]);this.handleSetDrawSource(e);const a=3;this.map.getLayer(this.drawLineLayer)||this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":a}})},setupLineEdit(){this.clearEditMarkers(),this.drawCoords.forEach((e,a)=>{const r=document.createElement("div");r.className="idm-gl4-edit-vertex",r.style.backgroundColor=this.form.color;const i=new ne.Marker({element:r,draggable:!0}).setLngLat(e).addTo(this.map);i.on("dragstart",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:l,lat:n}=i.getLngLat();this.handleRenderVertexLabel([l,n],40)}),i.on("drag",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:l,lat:n}=i.getLngLat();this.handleUpdateVertexLabel([l,n]),this.drawCoords[a]=[l,n],this.handlerRenderEditLine(D.lineString(this.drawCoords,{type:"Line",color:this.form.color}))}),i.on("dragend",()=>{this.map.getCanvas().style.cursor="grab";const{lng:l,lat:n}=i.getLngLat();this.drawCoords[a]=[l,n],this.handlerRenderEditLine(D.lineString(this.drawCoords,{type:"Line",color:this.form.color})),this.handleClearVertexLabels()}),r.addEventListener("contextmenu",l=>{l.preventDefault(),l.stopPropagation(),this.drawCoords.length>2&&this.showDeleteButton(e,()=>{this.drawCoords.splice(a,1),this.handlerRenderEditLine(D.lineString(this.drawCoords,{type:"Line",color:this.form.color})),this.setupLineEdit()})}),this.editMarkers.push(i)});const t=e=>{e.preventDefault();const{lng:a,lat:r}=e.lngLat,i=D.point([a,r]),l=D.lineString(this.drawCoords),n=D.nearestPointOnLine(l,i);if(n){const c=n.properties.index;this.showDeleteButton([a,r],()=>{this.drawCoords.splice(c+1,0,[a,r]),this.handlerRenderEditLine(D.lineString(this.drawCoords,{type:"Line",color:this.form.color})),this.setupLineEdit()},this.$t("actions.add")||"新增","add")}};this.map.on("contextmenu",t),this._edgeContextMenuHandler=t},showDeleteButton(t,e,a,r="delete"){this.hideDeleteButton();const i=this.map.getContainer(),l=document.createElement("button");l.textContent=a||this.$t("actions.delete"),l.className=r==="add"?"idm-gl4-edit-add-btn":"idm-gl4-edit-delete-btn";const n=this.map.project(t);l.style.left=`${n.x}px`,l.style.top=`${n.y}px`;const c=s=>{s.stopPropagation(),e(),this.hideDeleteButton()};l.addEventListener("click",c),i.appendChild(l),this.deleteBtn=l,this.map.once("click",()=>this.hideDeleteButton())},hideDeleteButton(){this.deleteBtn&&(this.deleteBtn.remove(),this.deleteBtn=null)},handlerRenderEditPolygon(t){this.handleSetDrawSource(t);const e=3;this.map.getLayer(this.drawFillLayer)?(this.map.setPaintProperty(this.drawLineLayer,"line-width",e),this.map.getLayer(this.drawPointLayer)&&this.map.setPaintProperty(this.drawPointLayer,"circle-color",this.form.color)):(this.map.addLayer({id:this.drawFillLayer,type:"fill",source:this.drawSource,filter:["==","$type","Polygon"],paint:{"fill-color":this.form.color,"fill-opacity":.35}}),this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","Polygon"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":e}}),this.map.addLayer({id:this.drawPointLayer,type:"circle",source:this.drawSource,filter:["==","$type","Point"],paint:{"circle-radius":3,"circle-color":this.form.color,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}))},setupPolygonEdit(t){this.clearEditMarkers();const e=t.geometry.coordinates[0].slice(0,-1);this.drawCoords=e.map(r=>[...r]),this.drawCoords.forEach((r,i)=>{const l=document.createElement("div");l.className="idm-gl4-edit-vertex",l.style.backgroundColor=this.form.color;const n=new ne.Marker({element:l,draggable:!0}).setLngLat(r).addTo(this.map);n.on("dragstart",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:c,lat:s}=n.getLngLat();this.handleRenderVertexLabel([c,s])}),n.on("drag",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:c,lat:s}=n.getLngLat();this.handleUpdateVertexLabel([c,s]),this.drawCoords[i]=[c,s],this.handleRenderPolygonFill(this.drawCoords)}),n.on("dragend",()=>{this.map.getCanvas().style.cursor="grab";const{lng:c,lat:s}=n.getLngLat();this.drawCoords[i]=[c,s],this.handleRenderPolygonFill(this.drawCoords),this.handleClearVertexLabels()}),l.addEventListener("contextmenu",c=>{c.preventDefault(),c.stopPropagation(),this.drawCoords.length>3&&this.showDeleteButton(r,()=>{this.drawCoords.splice(i,1),this.handleRenderPolygonFill(this.drawCoords),this.handleClearVertexLabels(),this.setupPolygonEdit({geometry:{type:"Polygon",coordinates:[[...this.drawCoords,this.drawCoords[0]]]},properties:this.originalProperties})})}),this.editMarkers.push(n)});const a=r=>{r.preventDefault();const{lng:i,lat:l}=r.lngLat,n=D.point([i,l]),c=D.lineString([...this.drawCoords,this.drawCoords[0]]),s=D.nearestPointOnLine(c,n);if(s){const d=s.properties.index,m=d>=this.drawCoords.length-1?this.drawCoords.length-1:d;this.showDeleteButton([i,l],()=>{this.drawCoords.splice(m+1,0,[i,l]),this.handleRenderPolygonFill(this.drawCoords),this.handleClearVertexLabels(),this.setupPolygonEdit({geometry:{type:"Polygon",coordinates:[[...this.drawCoords,this.drawCoords[0]]]},properties:this.originalProperties})},this.$t("actions.add")||"新增","add")}};this.map.on("contextmenu",a),this._edgeContextMenuHandler=a},handleMapClickPoint(t){var r;const{lng:e,lat:a}=t.lngLat;this.drawCoords=[[e,a]],this.form.latDegree=Number(P.LngLatHelper.lat2pretty(a).degree),this.form.latMinute=Number(P.LngLatHelper.lat2pretty(a).minute),this.form.latDir=P.LngLatHelper.lat2pretty(a).direction,this.form.lngDegree=Number(P.LngLatHelper.lng2pretty(e).degree),this.form.lngMinute=Number(P.LngLatHelper.lng2pretty(e).minute),this.form.lngDir=P.LngLatHelper.lng2pretty(e).direction,this.handleRenderPoint(this.drawCoords,this.form.color),(r=this.editLayer)!=null&&r.id&&this.setupPointEdit()},handleChangePoint(){var g;const{latDegree:t,latMinute:e,latDir:a,lngDegree:r,lngMinute:i,lngDir:l}=this.form,n=parseFloat(t),c=parseFloat(e),s=parseFloat(r),d=parseFloat(i);if(isNaN(n)||isNaN(s))return;const m=(n+(isNaN(c)?0:c)/60)*(a==="S"?-1:1),p=(s+(isNaN(d)?0:d)/60)*(l==="W"?-1:1);this.drawCoords=[[p,m]],this.handleRenderPoint(this.drawCoords,this.form.color),(g=this.editLayer)!=null&&g.id&&this.setupPointEdit()},handleRenderPoint(t,e){var i;if((i=this.pointMarker)==null||i.remove(),!t||!t.length)return;const[a,r]=t[0];this.pointMarker=new ne.Marker({color:e}).setLngLat([a,r]).addTo(this.map)},handleMapClickLine(t){var r;const{lng:e,lat:a}=t.lngLat;this.drawCoords.push([e,a]),this.handleRenderLine(this.drawCoords),(r=this.editLayer)!=null&&r.id&&this.setupLineEdit()},handleMapMoveLine(t){if(!this.drawCoords.length)return;const{lng:e,lat:a}=t.lngLat;this.handleRenderTmpLine(this.drawCoords.at(-1),[e,a])},handleMapDblClickLine(t){t.preventDefault(),this.drawCoords.length>1&&this.drawCoords.pop(),this.handleRenderLine(this.drawCoords),this.handleClearTmp(),this.map.off("click",this.handleMapClickLine),this.map.off("mousemove",this.handleMapMoveLine),this.map.off("dblclick",this.handleMapDblClickLine)},handleRenderLine(t){if(!t||t.length<1)return;const e=[];t==null||t.forEach((i,l)=>{e.push(P.GeoJsonHelper.drawPoint(i==null?void 0:i[1],i==null?void 0:i[0]))}),(t==null?void 0:t.length)>=2&&e.push(P.GeoJsonHelper.drawLine(t));const a=2,r=D.featureCollection(e);this.handleSetDrawSource(r),this.map.getLayer(this.drawLineLayer)?(this.map.setPaintProperty(this.drawLineLayer,"line-color",this.form.color),this.map.setPaintProperty(this.drawLineLayer,"line-width",a),this.map.getLayer(this.drawPointLayer)&&this.map.setPaintProperty(this.drawPointLayer,"circle-color",this.form.color)):(this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":a}}),this.map.addLayer({id:this.drawPointLayer,type:"circle",source:this.drawSource,filter:["==","$type","Point"],paint:{"circle-radius":3,"circle-color":this.form.color,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}))},handleRenderTmpLine(t,e){const a=P.GeoJsonHelper.drawLine([t,e]),r=D.featureCollection([a]);this.map.getSource(this.drawTmpSource)?this.map.getSource(this.drawTmpSource).setData(r):this.map.addSource(this.drawTmpSource,{type:"geojson",data:r}),this.map.getLayer(this.drawTmpLayer)||this.map.addLayer({id:this.drawTmpLayer,type:"line",source:this.drawTmpSource,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":2,"line-dasharray":[3,2]}});const i={lng:t[0],lat:t[1]},l={lng:e[0],lat:e[1]},n=P.LaneHelper.calculateDistance(i,l,!0,2),c=P.LaneHelper.calculateBearing(i,l,!0,2);let s=0;for(let m=1;m<this.drawCoords.length;m++){const p={lng:this.drawCoords[m-1][0],lat:this.drawCoords[m-1][1]},g={lng:this.drawCoords[m][0],lat:this.drawCoords[m][1]};s+=P.LaneHelper.calculateDistance(p,g,!0,4)}s=P.LngLatHelper.roundPrecision(s+n,1);const d=`
|
|
218
218
|
<div class="marker-label">${this.$t("measure.totalDistance")}: <b>${s}</b>nm, ${this.$t("measure.bearing")}: <b>${c}</b>°</div>
|
|
219
219
|
<div class="marker-label"> ${this.$t("measure.clickTips")}</div>`;if(this.tipMarker)this.tipMarker._element.innerHTML=d,this.tipMarker.setLngLat([e[0],e[1]]);else{const m=document.createElement("div");m.className="idm-gl4-draw-tip-marker",m.innerHTML=d,this.tipMarker=new ne.Marker(m).setOffset([140,0]).setLngLat([e[0],e[1]]).addTo(this.map)}},handleRefreshLine(){this.drawCoords.length>=1&&this.handleRenderLine(this.drawCoords)},handleMapClickPolygon(t){var r;const{lng:e,lat:a}=t.lngLat;this.drawCoords.push([e,a]),this.drawCoords.length>=3&&this.handleRenderPolygonFill(this.drawCoords),this.handleRenderAllVertexLabels(this.drawCoords),(r=this.editLayer)!=null&&r.id&&this.setupPolygonEdit()},handleMapMovePolygon(t){if(!this.drawCoords.length)return;const{lng:e,lat:a}=t.lngLat,r=[...this.drawCoords,[e,a]];r.length>=1&&this.handleRenderPolygonFill(r),this.handleRenderAllVertexLabels(r)},handleMapDblClickPolygon(t){t.preventDefault(),this.drawCoords.length>=1&&this.drawCoords.pop(),this.drawCoords.length>=1&&this.handleRenderPolygonFill(this.drawCoords),this.handleRenderAllVertexLabels(this.drawCoords),this.map.off("click",this.handleMapClickPolygon),this.map.off("mousemove",this.handleMapMovePolygon),this.map.off("dblclick",this.handleMapDblClickPolygon)},handleRenderPolygonFill(t){var i;let e=[];if(t==null||t.forEach((l,n)=>{e.push(D.point(l))}),(t==null?void 0:t.length)>2){const l=[...t,t[0]];e.push(P.GeoJsonHelper.drawPolygon(l,{...this.originalProperties}))}const a=D.featureCollection(e);this.handleSetDrawSource(a);const r=(i=this.editLayer)!=null&&i.id?3:2;this.map.getLayer(this.drawFillLayer)?(this.map.setPaintProperty(this.drawLineLayer,"line-width",r),this.map.getLayer(this.drawPointLayer)&&this.map.setPaintProperty(this.drawPointLayer,"circle-color",this.form.color)):(this.map.addLayer({id:this.drawFillLayer,type:"fill",source:this.drawSource,filter:["==","$type","Polygon"],paint:{"fill-color":this.form.color,"fill-opacity":.35}}),this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","Polygon"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":r}}),this.map.addLayer({id:this.drawPointLayer,type:"circle",source:this.drawSource,filter:["==","$type","Point"],paint:{"circle-radius":3,"circle-color":this.form.color,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}))},handleRenderVertexLabel(t,e=8){this.handleClearVertexLabels();const a=P.LngLatHelper.lat2pretty(t[1],4).pretty,r=P.LngLatHelper.lng2pretty(t[0],4).pretty,i=document.createElement("div");i.className="idm-gl4-draw-corner-label center",i.innerHTML=`<span class="corner-text">${a} <br/> ${r}</span>`;const l=new ne.Marker(i,{anchor:"bottom",offset:[0,e]}).setLngLat(t).addTo(this.map);this.polygonVertexMarkers.push(l)},handleRenderAllVertexLabels(t){this.handleClearVertexLabels();const e=t.reduce((a,r)=>[a[0]+r[0],a[1]+r[1]],[0,0]);e[0]/=t.length,e[1]/=t.length,t.forEach(a=>{const r=a[0]-e[0],i=a[1]-e[1];let l="center";i>=0&&r>=0?l="bottom-left":i>=0&&r<0?l="bottom-right":i<0&&r>=0?l="top-left":l="top-right";const n=P.LngLatHelper.lat2pretty(a[1],4).pretty,c=P.LngLatHelper.lng2pretty(a[0],4).pretty,s=document.createElement("div");s.className="idm-gl4-draw-corner-label "+l,s.innerHTML=`<span class="corner-text">${n} <br/> ${c}</span>`;const d=new ne.Marker(s,{anchor:l}).setLngLat(a).addTo(this.map);this.polygonVertexMarkers.push(d)})},handleUpdateVertexLabel(t){if(!this.polygonVertexMarkers.length)return;const e=this.polygonVertexMarkers[0];e.setLngLat(t);const a=P.LngLatHelper.lat2pretty(t[1],4).pretty,r=P.LngLatHelper.lng2pretty(t[0],4).pretty,i=e.getElement().querySelector(".corner-text");i&&(i.innerHTML=`${a} <br/> ${r}`)},handleClearVertexLabels(){this.polygonVertexMarkers.forEach(t=>t.remove()),this.polygonVertexMarkers=[]},handleMapClickCircle(t){const{lng:e,lat:a}=t.lngLat;if(this.drawCoords.length===0){this.drawCoords.push([e,a]);const r=D.featureCollection([D.point([e,a])]);this.handleSetDrawSource(r),this.map.getLayer(this.drawPointLayer)||this.map.addLayer({id:this.drawPointLayer,type:"circle",source:this.drawSource,filter:["==","$type","Point"],paint:{"circle-radius":3,"circle-color":this.form.color,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}),this.handleRenderCircleCenterLabel([e,a])}else{const r=this.drawCoords[0],i=[e,a],l=D.distance(D.point(r),D.point(i),{units:"nauticalmiles"}),n=P.GeoJsonHelper.drawCircle(r[0],r[1],l),c=D.featureCollection([D.point(r),n]);this.handleSetDrawSource(c),this.handleRenderAreaLayers(),this.handleRenderRadiusLine(r,i,l),this.drawCoords=[r,i],this.map.off("click",this.handleMapClickCircle),this.map.off("mousemove",this.handleMapMoveCircle)}},handleMapMoveCircle(t){if(this.drawCoords.length!==1)return;const e=this.drawCoords[0],a=[t.lngLat.lng,t.lngLat.lat],r=D.distance(D.point(e),D.point(a),{units:"nauticalmiles"}),i=P.GeoJsonHelper.drawCircle(e[0],e[1],r),l=D.featureCollection([D.point(e),i]);this.handleSetDrawSource(l),this.map.getLayer(this.drawFillLayer)||this.handleRenderAreaLayers(),this.handleRenderRadiusLine(e,a,r)},handleRenderCircleCenterLabel(t){const e=P.LngLatHelper.lat2pretty(t[1],4).pretty,a=P.LngLatHelper.lng2pretty(t[0],4).pretty,r=document.createElement("div");r.className="idm-gl4-draw-corner-label bottom-right",r.innerHTML=`<span class="corner-text">${e} <br/> ${a}</span>`;const i=new ne.Marker(r,{anchor:"bottom-right"}).setLngLat(t).addTo(this.map);this.circleMarkers.push(i)},handleRenderRadiusLine(t,e,a){const r=P.LngLatHelper.roundPrecision(a,2),i=D.featureCollection([D.lineString([t,e])]);this.map.getSource(this.drawRadiusSource)?this.map.getSource(this.drawRadiusSource).setData(i):this.map.addSource(this.drawRadiusSource,{type:"geojson",data:i}),this.map.getLayer(this.drawRadiusLayer)||this.map.addLayer({id:this.drawRadiusLayer,type:"line",source:this.drawRadiusSource,layout:{"line-cap":"round"},paint:{"line-color":this.form.color,"line-width":1.5,"line-dasharray":[4,3]}});const l=[(t[0]+e[0])/2,(t[1]+e[1])/2],n=this.map.project(t),c=this.map.project(e),s=c.x-n.x,d=c.y-n.y;let m=Math.atan2(d,s)*180/Math.PI;m>90&&(m-=180),m<-90&&(m+=180);const p=16,g=(m-90)*Math.PI/180,y=Math.round(Math.cos(g)*p),u=Math.round(Math.sin(g)*p);this.circleMarkers.length>1&&(this.circleMarkers[1].remove(),this.circleMarkers.splice(1,1));const h=document.createElement("div"),f=document.createElement("span");f.className="idm-gl4-draw-radius-label",f.style.transform=`rotate(${m}deg)`,f.style.transformOrigin="center",f.style.display="inline-block",f.textContent=`${r} nm`,h.appendChild(f);const k=new ne.Marker(h,{anchor:"center",offset:[y,u]}).setLngLat(l).addTo(this.map);this.circleMarkers.push(k)},handleClearCircleLabels(){var t,e;this.circleMarkers.forEach(a=>a.remove()),this.circleMarkers=[],(t=this.map)!=null&&t.getLayer(this.drawRadiusLayer)&&this.map.removeLayer(this.drawRadiusLayer),(e=this.map)!=null&&e.getSource(this.drawRadiusSource)&&this.map.removeSource(this.drawRadiusSource)},buildRectFeatureCollection(t,e){const a=Math.min(t[0],e[0]),r=Math.max(t[0],e[0]),i=Math.min(t[1],e[1]),l=Math.max(t[1],e[1]);return[[a,l],[r,l],[r,i],[a,i]]},handleMapClickRect(t){const{lng:e,lat:a}=t.lngLat;if(this.drawCoords.length===0)this.drawCoords.push([e,a]);else{const r=this.drawCoords[0],i=[e,a],l=P.GeoJsonHelper.drawRect(r,i);delete l.bbox;const n=this.buildRectFeatureCollection(r,i),c=D.featureCollection([l,...n.map(s=>D.point(s))]);this.handleSetDrawSource(c),this.handleRenderRectLayers(),this.handleRenderRectCorners(r,i),this.drawCoords=[r,i],this.map.off("click",this.handleMapClickRect),this.map.off("mousemove",this.handleMapMoveRect)}},handleMapMoveRect(t){if(this.drawCoords.length!==1)return;const e=this.drawCoords[0],a=[t.lngLat.lng,t.lngLat.lat],r=P.GeoJsonHelper.drawRect(e,a),i=this.buildRectFeatureCollection(e,a),l=D.featureCollection([r,...i.map(n=>D.point(n))]);this.handleSetDrawSource(l),this.map.getLayer(this.drawFillLayer)||this.handleRenderRectLayers(),this.handleRenderRectCorners(e,a)},handleRenderRectLayers(){var e;const t=(e=this.editLayer)!=null&&e.id?3:2;this.map.getLayer(this.drawFillLayer)||this.map.addLayer({id:this.drawFillLayer,type:"fill",source:this.drawSource,filter:["==","$type","Polygon"],paint:{"fill-color":this.form.color,"fill-opacity":.35}}),this.map.getLayer(this.drawLineLayer)?this.map.setPaintProperty(this.drawLineLayer,"line-width",t):this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","Polygon"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":t}}),this.map.getLayer(this.drawPointLayer)||this.map.addLayer({id:this.drawPointLayer,type:"circle",source:this.drawSource,filter:["==","$type","Point"],paint:{"circle-radius":3,"circle-color":this.form.color,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}})},handleRenderRectCorners(t,e){const a=Math.min(t[0],e[0]),r=Math.max(t[0],e[0]),i=Math.min(t[1],e[1]),l=Math.max(t[1],e[1]),n=[{coord:[a,l],anchor:"bottom-right"},{coord:[r,l],anchor:"bottom-left"},{coord:[r,i],anchor:"top-left"},{coord:[a,i],anchor:"top-right"}];this.handleClearRectCorners(),n.forEach(({coord:c,anchor:s})=>{const d=P.LngLatHelper.lat2pretty(c[1],4).pretty,m=P.LngLatHelper.lng2pretty(c[0],4).pretty,p=document.createElement("div");p.className="idm-gl4-draw-corner-label "+s,p.innerHTML=`<span class="corner-text">${d} <br/> ${m}</span>`;const g=new ne.Marker(p,{anchor:s}).setLngLat(c).addTo(this.map);this.rectCornerMarkers.push(g)})},handleClearRectCorners(){this.rectCornerMarkers.forEach(t=>t.remove()),this.rectCornerMarkers=[]},handleRenderAreaLayers(){var e;const t=(e=this.editLayer)!=null&&e.id?3:2;this.map.getLayer(this.drawFillLayer)||this.map.addLayer({id:this.drawFillLayer,type:"fill",source:this.drawSource,filter:["==","$type","Polygon"],paint:{"fill-color":this.form.color,"fill-opacity":.35}}),this.map.getLayer(this.drawLineLayer)?this.map.setPaintProperty(this.drawLineLayer,"line-width",t):this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","Polygon"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":t}})},handleSetDrawSource(t){this.map.getSource(this.drawSource)?this.map.getSource(this.drawSource).setData(t):this.map.addSource(this.drawSource,{type:"geojson",data:t})},handleClearTmp(){var t,e,a;(t=this.map)!=null&&t.getLayer(this.drawTmpLayer)&&this.map.removeLayer(this.drawTmpLayer),(e=this.map)!=null&&e.getSource(this.drawTmpSource)&&this.map.removeSource(this.drawTmpSource),(a=this.tipMarker)==null||a.remove(),this.tipMarker=null},handleUpdateLayerColors(){if(!this.map)return;const t=this.form.color;this.map.getLayer(this.drawPointLayer)&&this.map.setPaintProperty(this.drawPointLayer,"circle-color",t),this.map.getLayer(this.drawLineLayer)&&this.map.setPaintProperty(this.drawLineLayer,"line-color",t),this.map.getLayer(this.drawFillLayer)&&this.map.setPaintProperty(this.drawFillLayer,"fill-color",t),this.map.getLayer(this.drawRadiusLayer)&&this.map.setPaintProperty(this.drawRadiusLayer,"line-color",t),this.map.getLayer(this.drawTmpLayer)&&this.map.setPaintProperty(this.drawTmpLayer,"line-color",t),this.editMarkers.forEach(e=>{e.getElement()&&(e.getElement().style.backgroundColor=t)})},handleClearDraw(t=!1){var a,r,i,l,n;this.handleClearTmp(),this.hideDeleteButton();const e=[this.drawPointLayer,this.drawLineLayer,this.drawFillLayer];for(const c of e)(a=this.map)!=null&&a.getLayer(c)&&((r=this.map)==null||r.removeLayer(c));(i=this.map)!=null&&i.getSource(this.drawSource)&&this.map.removeSource(this.drawSource),this.drawCoords=[],this.originalProperties={},this.handleClearRectCorners(),this.handleClearVertexLabels(),this.handleClearCircleLabels(),(l=this.pointMarker)==null||l.remove(),this.pointMarker=null,(n=this.pointHighlightMarker)==null||n.remove(),this.pointHighlightMarker=null,this.clearEditMarkers(),this.handleRebindMap()},async handleSave(){var r,i;let t=null;if(this.markerType==="Point"?await this.$refs.pointForm.validate().then(l=>{var n;if(l!=null&&l.valid){if(!this.drawCoords.length)return;const[c,s]=this.drawCoords[0];t=D.featureCollection([P.GeoJsonHelper.drawPoint(s,c,{...this.originalProperties,color:this.form.color,name:this.form.name})]),(n=t.features)==null||n.forEach(d=>{d.properties.color=this.form.color,d.properties.name=this.form.name})}}):this.markerType==="Line"?await this.$refs.lineForm.validate().then(l=>{if(l!=null&&l.valid){if(this.drawCoords.length<2)return;const n=[],c=P.LaneHelper.generateRouteAccordingToWaypoints(this.drawCoords.map(s=>({lng:s==null?void 0:s[0],lat:s==null?void 0:s[1]})));for(const s of c)s.length>1&&n.push(P.GeoJsonHelper.drawLine(s,{properties:{...this.originalProperties,color:this.form.color,name:this.form.name}}));t=D.featureCollection(n)}}):this.markerType==="Area"&&await this.$refs.areaForm.validate().then(l=>{var n,c,s;if(l!=null&&l.valid){const d=(n=this.map)==null?void 0:n.getSource(this.drawSource);if(!d)return;const m=d._data;if(!((c=m==null?void 0:m.features)!=null&&c.length))return;let p=((s=m.features)==null?void 0:s.filter(g=>g.geometry.type==="Polygon"))||[];if(p=p==null?void 0:p.map(g=>(g.properties.name=this.form.name,g.properties.color=this.form.color,g)),!p.length)return;t=D.featureCollection(p)}}),!t)return!1;const e={name:this.form.name,format:"geojson",color:this.form.color,extend:t};this.saving=!0,await((r=this.editLayer)!=null&&r.id?le.put(`${this.gateway}/api/arc/layers/${this.editLayer.id}`,e,{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}}):le.post(`${this.gateway}/api/arc/lygroups/${(i=this.group)==null?void 0:i.id}/layers`,e,{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}})).then(l=>{var n,c,s,d;((n=l.data)==null?void 0:n.code)===0&&this.$emit("save",{...e,id:((c=this.editLayer)==null?void 0:c.id)||((d=(s=l.data)==null?void 0:s.data)==null?void 0:d.id)}),this.saving=!1}).catch(l=>{console.error("save marker error",l),this.saving=!1})}}},fp={class:"text-h6 font-weight-600"},yp={class:"text-label mb-1"},bp={class:"text-label mb-1"},wp={class:"mb-1"},xp={class:"text-label mb-1"},kp={class:"mb-1"},_p={class:"text-label mb-1"},Lp={class:"mb-1"},zp={class:"text-label mb-1"},Cp={class:"color-picker-row d-flex align-start ga-2"},vp=["value"],Sp={class:"mb-n2"},Np={class:"text-label mb-1"},Vp={class:"mb-1"},Pp={class:"text-label mb-1"},Mp={class:"color-picker-row d-flex align-start ga-2"},Tp=["value"],Ep={class:"mb-n2"},Dp={class:"text-label mb-1"},Rp={key:0,class:"mb-3"},Bp={class:"text-label mb-1"},Ip={class:"mb-1"},Ap={class:"text-label mb-1"},Fp={class:"color-picker-row d-flex align-start ga-2"},Gp=["value"],Wp={class:"mb-n2"},Op={class:"text-label mb-1"};function Zp(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VCardTitle"),s=o.resolveComponent("VDivider"),d=o.resolveComponent("VTextField"),m=o.resolveComponent("VCardText"),p=o.resolveComponent("VBtnToggle"),g=o.resolveComponent("VCol"),y=o.resolveComponent("VRow"),u=o.resolveComponent("VCardActions"),h=o.resolveComponent("VForm"),f=o.resolveComponent("VCard");return o.openBlock(),o.createBlock(f,{class:"idm-gl4-draw-dialog-card",elevation:"4"},{default:o.withCtx(()=>{var k;return[o.createVNode(c,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>{var w;return[o.createElementVNode("span",fp,o.toDisplayString((w=a.editLayer)!=null&&w.id?t.$t("actions.edit"):t.$t("actions.addMarker")),1),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleClose},{default:o.withCtx(()=>e[21]||(e[21]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[21]},8,["onClick"])]}),_:1}),o.createVNode(s),o.createVNode(m,{class:"text-body-1 px-4 pb-0"},{default:o.withCtx(()=>{var w;return[o.createElementVNode("div",yp,o.toDisplayString(t.$t("marker.group")),1),o.createVNode(d,{"model-value":(w=a.group)==null?void 0:w.name,density:"compact",variant:"outlined","hide-details":"",disabled:"",class:"input-btn-bg-1"},null,8,["model-value"])]}),_:1}),(k=a.editLayer)!=null&&k.id?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(m,{key:0,class:"text-body-1 px-4 pb-0"},{default:o.withCtx(()=>{var w;return[o.createElementVNode("div",bp,[o.createTextVNode(o.toDisplayString(t.$t("marker.markerType")),1),e[22]||(e[22]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(p,{modelValue:i.markerType,"onUpdate:modelValue":e[0]||(e[0]=b=>i.markerType=b),mandatory:"",group:"",density:"compact",variant:"flat",class:"w-100",disabled:!!((w=a.editLayer)!=null&&w.id)},{default:o.withCtx(()=>[o.createVNode(n,{value:"Point",class:o.normalizeClass(["flex-1-1-0 text-none text-body-1",i.markerType==="Point"?"":"btn-border-1 btn-bg-1"]),color:i.markerType==="Point"?"primary":"","base-color":"",height:"32px","min-height":"32px"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("marker.point")),1)]),_:1},8,["class","color"]),o.createVNode(n,{value:"Line",class:o.normalizeClass(["flex-1-1-0 text-none text-body-1",i.markerType==="Line"?"":"btn-border-1 btn-bg-1"]),style:{"border-left":"0 !important","border-right":"0 !important"},color:i.markerType==="Line"?"primary":"",height:"32px","min-height":"32px"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("marker.line")),1)]),_:1},8,["class","color"]),o.createVNode(n,{value:"Area",class:o.normalizeClass(["flex-1-1-0 text-none text-body-1",i.markerType==="Area"?"":"btn-border-1 btn-bg-1"]),color:i.markerType==="Area"?"primary":"",height:"32px","min-height":"32px"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("marker.area")),1)]),_:1},8,["class","color"])]),_:1},8,["modelValue","disabled"])]}),_:1})),i.markerType==="Point"?(o.openBlock(),o.createBlock(h,{key:1,ref:"pointForm",autocomplete:"off",class:"form-box",onSubmit:o.withModifiers(l.handleSave,["prevent"])},{default:o.withCtx(()=>[o.createVNode(m,{class:"px-4 text-body-1"},{default:o.withCtx(()=>[o.createElementVNode("div",wp,[o.createElementVNode("div",xp,[o.createTextVNode(o.toDisplayString(t.$t("marker.lat")),1),e[23]||(e[23]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(y,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(g,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(d,{modelValue:i.form.latDegree,"onUpdate:modelValue":[e[1]||(e[1]=w=>i.form.latDegree=w),e[2]||(e[2]=w=>l.handleChangePoint())],rules:i.formRules.latDegree,label:"",autocomplete:"off",density:"compact",variant:"outlined",height:"32px","min-height":"32px",required:"",dense:"",class:"text-body-1 input-btn-bg-1"},null,8,["modelValue","rules"]),e[24]||(e[24]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[24]}),o.createVNode(g,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(d,{modelValue:i.form.latMinute,"onUpdate:modelValue":[e[3]||(e[3]=w=>i.form.latMinute=w),e[4]||(e[4]=w=>l.handleChangePoint())],rules:i.formRules.latMinute,label:"",height:"32px","min-height":"32px",autocomplete:"off",density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),e[25]||(e[25]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[25]}),o.createVNode(g,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 bg-primary",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:e[5]||(e[5]=w=>{i.form.latDir=i.form.latDir==="N"?"S":"N",l.handleChangePoint()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.latDir),1)]),_:1})]),_:1})]),_:1})]),o.createElementVNode("div",kp,[o.createElementVNode("div",_p,[o.createTextVNode(o.toDisplayString(t.$t("marker.lng")),1),e[26]||(e[26]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(y,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(g,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(d,{modelValue:i.form.lngDegree,"onUpdate:modelValue":[e[6]||(e[6]=w=>i.form.lngDegree=w),e[7]||(e[7]=w=>l.handleChangePoint())],rules:i.formRules.lngDegree,density:"compact",variant:"outlined",autocomplete:"off",class:"text-body-1 input-btn-bg-1"},null,8,["modelValue","rules"]),e[27]||(e[27]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[27]}),o.createVNode(g,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(d,{modelValue:i.form.lngMinute,"onUpdate:modelValue":[e[8]||(e[8]=w=>i.form.lngMinute=w),e[9]||(e[9]=w=>l.handleChangePoint())],rules:i.formRules.lngMinute,density:"compact",variant:"outlined",autocomplete:"off",class:"text-body-1 input-btn-bg-1"},null,8,["modelValue","rules"]),e[28]||(e[28]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[28]}),o.createVNode(g,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 bg-primary",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:e[10]||(e[10]=w=>{i.form.lngDir=i.form.lngDir==="E"?"W":"E",l.handleChangePoint()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.lngDir),1)]),_:1})]),_:1})]),_:1})]),o.createElementVNode("div",Lp,[o.createElementVNode("div",zp,[o.createTextVNode(o.toDisplayString(t.$t("marker.color")),1),e[29]||(e[29]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createElementVNode("div",Cp,[o.createElementVNode("input",{type:"color",value:i.form.color,class:"native-color-picker cursor-pointer",onInput:e[11]||(e[11]=w=>i.form.color=w.target.value)},null,40,vp),o.createVNode(d,{modelValue:i.form.color,"onUpdate:modelValue":e[12]||(e[12]=w=>i.form.color=w),rules:i.formRules.color,density:"compact",variant:"outlined",class:"flex-1-1-0 input-btn-bg-1"},null,8,["modelValue","rules"])])]),o.createElementVNode("div",Sp,[o.createElementVNode("div",Np,[o.createTextVNode(o.toDisplayString(t.$t("marker.name")),1),e[30]||(e[30]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(d,{modelValue:i.form.name,"onUpdate:modelValue":e[13]||(e[13]=w=>i.form.name=w),density:"compact",variant:"outlined",rules:i.formRules.name,autocomplete:"off",class:"input-btn-bg-1"},null,8,["modelValue","rules"])])]),_:1}),o.createVNode(s),o.createVNode(u,{class:"w-100 d-flex justify-end align-center ga-4 pa-4"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-none text-body-1",variant:"tonal",density:"comfortable",onClick:l.handleClearDraw},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.clear")),1)]),_:1},8,["onClick"]),o.createVNode(n,{class:"text-none text-body-1",variant:"flat",color:"primary",density:"comfortable",type:"submit",loading:i.saving},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.save")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["onSubmit"])):o.createCommentVNode("",!0),i.markerType==="Line"?(o.openBlock(),o.createBlock(h,{key:2,ref:"lineForm",autocomplete:"off",class:"form-box",onSubmit:o.withModifiers(l.handleSave,["prevent"])},{default:o.withCtx(()=>[o.createVNode(m,{class:"px-4 text-body-1"},{default:o.withCtx(()=>[o.createElementVNode("div",Vp,[o.createElementVNode("div",Pp,[o.createTextVNode(o.toDisplayString(t.$t("marker.color")),1),e[31]||(e[31]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createElementVNode("div",Mp,[o.createElementVNode("input",{type:"color",value:i.form.color,class:"native-color-picker cursor-pointer",onInput:e[14]||(e[14]=w=>i.form.color=w.target.value)},null,40,Tp),o.createVNode(d,{modelValue:i.form.color,"onUpdate:modelValue":e[15]||(e[15]=w=>i.form.color=w),rules:i.formRules.color,density:"compact",variant:"outlined",class:"flex-1-1-0 input-btn-bg-1"},null,8,["modelValue","rules"])])]),o.createElementVNode("div",Ep,[o.createElementVNode("div",Dp,[o.createTextVNode(o.toDisplayString(t.$t("marker.name")),1),e[32]||(e[32]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(d,{modelValue:i.form.name,"onUpdate:modelValue":e[16]||(e[16]=w=>i.form.name=w),density:"compact",variant:"outlined",rules:i.formRules.name,autocomplete:"off",class:"input-btn-bg-1"},null,8,["modelValue","rules"])])]),_:1}),o.createVNode(s),o.createVNode(u,{class:"w-100 d-flex justify-end align-center ga-4 pa-4"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-none text-body-1",variant:"tonal",density:"comfortable",onClick:l.handleClearDraw},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.clear")),1)]),_:1},8,["onClick"]),o.createVNode(n,{class:"text-none text-body-1",variant:"flat",color:"primary",density:"comfortable",type:"submit",loading:i.saving},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.save")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["onSubmit"])):o.createCommentVNode("",!0),i.markerType==="Area"?(o.openBlock(),o.createBlock(h,{key:3,ref:"areaForm",autocomplete:"off",class:"form-box",onSubmit:o.withModifiers(l.handleSave,["prevent"])},{default:o.withCtx(()=>[o.createVNode(m,{class:"px-4 text-body-1"},{default:o.withCtx(()=>{var w,b;return[(w=a.editLayer)!=null&&w.id?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Rp,[o.createElementVNode("div",Bp,[o.createTextVNode(o.toDisplayString(t.$t("marker.areaType")),1),e[33]||(e[33]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(p,{modelValue:i.form.areaType,"onUpdate:modelValue":e[17]||(e[17]=x=>i.form.areaType=x),mandatory:"",group:"",density:"compact",variant:"flat",color:"primary",class:"w-100",disabled:!!((b=a.editLayer)!=null&&b.id)},{default:o.withCtx(()=>[o.createVNode(n,{value:"Polygon",class:o.normalizeClass(["flex-1-1-0 text-none text-body-1",i.form.areaType==="Polygon"?"":"btn-border-1 btn-bg-1"]),color:i.form.areaType==="Polygon"?"primary":"","base-color":"",height:"32px","min-height":"32px"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("marker.polygon")),1)]),_:1},8,["class","color"]),o.createVNode(n,{value:"Circle",class:o.normalizeClass(["flex-1-1-0 text-none text-body-1",i.form.areaType==="Circle"?"":"btn-border-1 btn-bg-1"]),style:{"border-left":"0 !important","border-right":"0 !important"},color:i.form.areaType==="Circle"?"primary":"","base-color":"",height:"32px","min-height":"32px"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("marker.circle")),1)]),_:1},8,["class","color"]),o.createVNode(n,{value:"Rect",class:o.normalizeClass(["flex-1-1-0 text-none text-body-1",i.form.areaType==="Rect"?"":"btn-border-1 btn-bg-1"]),color:i.form.areaType==="Rect"?"primary":"","base-color":"",height:"32px","min-height":"32px"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("marker.rect")),1)]),_:1},8,["class","color"])]),_:1},8,["modelValue","disabled"])])),o.createElementVNode("div",Ip,[o.createElementVNode("div",Ap,[o.createTextVNode(o.toDisplayString(t.$t("marker.color")),1),e[34]||(e[34]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createElementVNode("div",Fp,[o.createElementVNode("input",{type:"color",value:i.form.color,class:"native-color-picker cursor-pointer",onInput:e[18]||(e[18]=x=>i.form.color=x.target.value)},null,40,Gp),o.createVNode(d,{modelValue:i.form.color,"onUpdate:modelValue":e[19]||(e[19]=x=>i.form.color=x),rules:i.formRules.color,density:"compact",variant:"outlined",class:"flex-1-1-0 input-btn-bg-1"},null,8,["modelValue","rules"])])]),o.createElementVNode("div",Wp,[o.createElementVNode("div",Op,[o.createTextVNode(o.toDisplayString(t.$t("marker.name")),1),e[35]||(e[35]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(d,{modelValue:i.form.name,"onUpdate:modelValue":e[20]||(e[20]=x=>i.form.name=x),density:"compact",variant:"outlined",rules:i.formRules.name,autocomplete:"off",class:"input-btn-bg-1"},null,8,["modelValue","rules"])])]}),_:1}),o.createVNode(s),o.createVNode(u,{class:"w-100 d-flex justify-end align-center ga-4 pa-4"},{default:o.withCtx(()=>{var w;return[(w=a.editLayer)!=null&&w.id?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(n,{key:0,class:"text-none text-body-1",variant:"tonal",density:"comfortable",onClick:l.handleClearDraw},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.clear")),1)]),_:1},8,["onClick"])),o.createVNode(n,{class:"text-none text-body-1",variant:"flat",color:"primary",density:"comfortable",type:"submit",loading:i.saving},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.save")),1)]),_:1},8,["loading"])]}),_:1})]),_:1},8,["onSubmit"])):o.createCommentVNode("",!0)]}),_:1})}const jp=X(up,[["render",Zp]]),Gy="",Hp={name:"IdmImportMarker",props:{map:{type:Object},gateway:{type:String},token:{type:String},defaultMeteoToken:{type:String},group:{type:Object,default:null}},emits:["close","import"],setup(){return{Theme:fe.useTheme()}},data(){var t;return{form:{groupName:"",name:"",file:null,format:"",extend:void 0,color:(t=this.Theme.current.value.colors)==null?void 0:t["map-green"]},formRules:{groupName:[e=>e!=null&&e!==""||"required"],color:[e=>e!=null&&e!==""||"required"]},isDragOver:!1,uploading:!1,fileError:"",previewSourceId:"__import_preview__",previewMarkers:[]}},watch:{"form.color":{handler(t){var e;(e=this.form.extend)!=null&&e.features&&this.form.extend.features.forEach(a=>{a.properties.color=t}),this.handleDrawLayers()},immediate:!0}},mounted(){var t;this.form.groupName=((t=this.group)==null?void 0:t.name)||"Import layer 1"},beforeUnmount(){this.handleClearPreview()},methods:{handleClose(){this.$emit("close")},handleReset(){var t;this.form={groupName:((t=this.group)==null?void 0:t.name)||"Import layer 1",file:null,format:"",extend:void 0},this.fileError=""},handleSelectFile(){this.$refs.fileInput.click()},handleFileChange(t){const e=t.target.files[0];e&&this.onUpload(e)},handleDrop(t){this.isDragOver=!1;const e=t.dataTransfer.files[0];e&&this.onUpload(e)},async onUpload(t){var r,i,l,n;if(t.size>10485760){this.fileError=this.$t("marker.fileTooLarge");return}this.form.file=t,this.fileError="",this.form.name=(r=t.name.split("."))==null?void 0:r[0];const a=(i=t.name.split(".").pop())==null?void 0:i.toLowerCase();try{let c;if(a==="json"||a==="geojson"){const s=await t.text();c=JSON.parse(s)}else if(a==="kml"){const s=await t.text();c=await P.GeoJsonHelper.convertKML2GeoJSON(s)}else if(a==="kmz"){const s=await t.arrayBuffer();c=await P.GeoJsonHelper.convertKMZ2GeoJSON(s)}else if(a==="zip"||a==="shp"){const s=await t.arrayBuffer();c=await P.GeoJsonHelper.convertZIP2GeoJSON(s)}else{this.fileError="Unsupported format: "+a;return}this.form.extend=c,this.form.format="geojson",(n=(l=this.form.extend)==null?void 0:l.features)==null||n.forEach(s=>{s.properties.color=this.form.color}),this.handleDrawLayers()}catch{this.fileError="Failed to parse file",this.form.file=null}},handleRemoveFile(){this.form.file=null,this.$refs.fileInput.value="",this.handleClearPreview()},async handleConfirm(){const{valid:t}=await this.$refs.importForm.validate();if(!t)return;if(!this.form.file){this.fileError=this.$t("marker.fileRequired");return}this.uploading=!0;let e=this.group.id;if(e||await le.post(`${this.gateway}/api/arc/lygroups`,{name:this.form.groupName},{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}}).then(r=>{var i,l;((i=r.data)==null?void 0:i.code)===0&&(e=(l=r.data.data)==null?void 0:l.id)}),!e){this.uploading=!1;return}const a={format:this.form.format,extend:this.form.extend};le.post(`${this.gateway}/api/arc/lygroups/${e}/layers`,a,{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}}).then(r=>{var i;((i=r.data)==null?void 0:i.code)===0&&(this.$emit("import"),this.uploading=!1)}).catch(r=>{this.uploading=!1})},handleDrawLayers(){if(!this.map||!this.form.extend)return;const t=this.form.extend,e=this.previewSourceId,a=t.features||(t.type==="Feature"?[t]:[]);a.forEach(i=>{var n,c,s;const l=((n=i==null?void 0:i.properties)==null?void 0:n.color)||((c=this.Theme.current.value.colors)==null?void 0:c["map-green"]);if(((s=i.geometry)==null?void 0:s.type)==="Point"){const[d,m]=i.geometry.coordinates;this.previewMarkers.push(new ne.Marker({color:l}).setLngLat([d,m]).addTo(this.map))}i.properties.color||(i.properties.color=l)}),this.map.getSource(e)?this.map.getSource(e).setData(t):this.map.addSource(e,{type:"geojson",data:t});const r=new Set(a.map(i=>{var l;return(l=i.geometry)==null?void 0:l.type}));(r.has("LineString")||r.has("MultiLineString"))&&!this.map.getLayer(`${e}-line`)&&this.map.addLayer({id:`${e}-line`,type:"line",source:e,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["get","color"],"line-width":2}}),(r.has("Polygon")||r.has("MultiPolygon"))&&(this.map.getLayer(`${e}-fill`)||this.map.addLayer({id:`${e}-fill`,type:"fill",source:e,filter:["==","$type","Polygon"],paint:{"fill-color":["get","color"],"fill-opacity":.35}}),this.map.getLayer(`${e}-outline`)||this.map.addLayer({id:`${e}-outline`,type:"line",source:e,filter:["==","$type","Polygon"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["get","color"],"line-width":2}}))},handleClearPreview(){if(!this.map)return;this.previewMarkers.forEach(a=>a.remove()),this.previewMarkers=[];const t=this.previewSourceId;[`${t}-vertex`,`${t}-point`,`${t}-line`,`${t}-fill`,`${t}-outline`].forEach(a=>{this.map.getLayer(a)&&this.map.removeLayer(a)}),this.map.getSource(t)&&this.map.removeSource(t)}}},Xp={class:"text-h6 font-weight-600"},Yp={class:"mb-4"},Up={class:"text-label mb-1"},$p={class:"mb-1"},Jp={class:"text-label mb-1"},Kp={class:"color-picker-row d-flex align-start ga-2"},qp=["value"],Qp={class:"text-body-2 text-center text-label"},eg={class:"text-body-1 text-primary mt-2 cursor-pointer"},tg={class:"text-body-2 text-left text-label mt-1"},og={key:0,class:"text-body-2 text-left text-danger mt-1"},ag={key:1,class:"file-item d-flex align-center justify-space-between mt-2 gray-bg-1 pa-1"},ig={class:"text-body-2 text-truncate"};function rg(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VCardTitle"),s=o.resolveComponent("VDivider"),d=o.resolveComponent("VTextField"),m=o.resolveComponent("VIcon"),p=o.resolveComponent("VCardText"),g=o.resolveComponent("VCardActions"),y=o.resolveComponent("VForm"),u=o.resolveComponent("VCard");return o.openBlock(),o.createBlock(u,{class:"idm-gl4-import-dialog-card",elevation:"4"},{default:o.withCtx(()=>[o.createVNode(c,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("span",Xp,o.toDisplayString(t.$t("marker.importLayer")),1),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleClose},{default:o.withCtx(()=>e[9]||(e[9]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[9]},8,["onClick"])]),_:1}),o.createVNode(s),o.createVNode(y,{ref:"importForm",autocomplete:"off",class:"form-box",onSubmit:o.withModifiers(l.handleConfirm,["prevent"])},{default:o.withCtx(()=>[o.createVNode(p,{class:"px-4 text-body-1"},{default:o.withCtx(()=>[o.createElementVNode("div",Yp,[o.createElementVNode("div",Up,[o.createTextVNode(o.toDisplayString(t.$t("marker.group")),1),e[10]||(e[10]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(d,{modelValue:i.form.groupName,"onUpdate:modelValue":e[0]||(e[0]=h=>i.form.groupName=h),density:"compact",variant:"outlined","hide-details":"",class:"input-btn-bg-1"},null,8,["modelValue"])]),o.createElementVNode("div",$p,[o.createElementVNode("div",Jp,[o.createTextVNode(o.toDisplayString(t.$t("marker.color")),1),e[11]||(e[11]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createElementVNode("div",Kp,[o.createElementVNode("input",{type:"color",value:i.form.color,class:"native-color-picker cursor-pointer",onInput:e[1]||(e[1]=h=>i.form.color=h.target.value)},null,40,qp),o.createVNode(d,{modelValue:i.form.color,"onUpdate:modelValue":e[2]||(e[2]=h=>i.form.color=h),rules:i.formRules.color,density:"compact",variant:"outlined",class:"flex-1-1-0 input-btn-bg-1"},null,8,["modelValue","rules"])])]),o.createElementVNode("div",{class:o.normalizeClass(["upload-area btn-bg-1 d-flex flex-column justify-center align-center pa-4",{"drag-over":i.isDragOver,"upload-error":i.fileError}]),onDragenter:e[4]||(e[4]=o.withModifiers(h=>i.isDragOver=!0,["prevent"])),onDragleave:e[5]||(e[5]=o.withModifiers(h=>i.isDragOver=!1,["prevent"])),onDragover:e[6]||(e[6]=o.withModifiers(()=>{},["prevent"])),onDrop:e[7]||(e[7]=o.withModifiers((...h)=>l.handleDrop&&l.handleDrop(...h),["prevent"])),onClick:e[8]||(e[8]=(...h)=>l.handleSelectFile&&l.handleSelectFile(...h))},[o.createVNode(m,{size:"36",color:"grey",class:"mb-2"},{default:o.withCtx(()=>e[12]||(e[12]=[o.createTextVNode("mdi-cloud-upload-outline",-1)])),_:1,__:[12]}),o.createElementVNode("div",Qp,o.toDisplayString(t.$t("marker.uploadHint")),1),o.createElementVNode("div",eg,o.toDisplayString(t.$t("marker.selectFile")),1),o.createElementVNode("input",{ref:"fileInput",type:"file",style:{display:"none"},accept:".json,.geojson,.zip,.shp,.kml,.kmz",onChange:e[3]||(e[3]=(...h)=>l.handleFileChange&&l.handleFileChange(...h))},null,544)],34),o.createElementVNode("div",tg,o.toDisplayString(t.$t("marker.uploadLimit")),1),i.fileError?(o.openBlock(),o.createElementBlock("div",og,o.toDisplayString(i.fileError),1)):o.createCommentVNode("",!0),i.form.file?(o.openBlock(),o.createElementBlock("div",ag,[o.createElementVNode("span",ig,[o.createVNode(m,{size:"16",color:"success",class:"mr-1"},{default:o.withCtx(()=>e[13]||(e[13]=[o.createTextVNode("mdi-check-circle",-1)])),_:1,__:[13]}),o.createTextVNode(" "+o.toDisplayString(i.form.file.name),1)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",size:"small",class:"file-remove-btn",onClick:l.handleRemoveFile},{default:o.withCtx(()=>[o.createVNode(m,{size:"16"},{default:o.withCtx(()=>e[14]||(e[14]=[o.createTextVNode("mdi-close",-1)])),_:1,__:[14]})]),_:1},8,["onClick"])])):o.createCommentVNode("",!0)]),_:1}),o.createVNode(s),o.createVNode(g,{class:"w-100 d-flex justify-end align-center ga-4 pa-4"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-none text-body-1",variant:"tonal",density:"comfortable",onClick:l.handleReset},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.reset")),1)]),_:1},8,["onClick"]),o.createVNode(n,{class:"text-none text-body-1",variant:"flat",color:"primary",density:"comfortable",type:"submit",loading:i.uploading},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.confirm")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["onSubmit"])]),_:1})}const lg=X(Hp,[["render",rg]]),Wy="",ng={name:"IdmGroupDialog",props:{modelValue:{type:Boolean,default:!1},group:{type:Object,default:null},gateway:{type:String},token:{type:String},defaultMeteoToken:{type:String}},emits:["update:modelValue","saved"],data(){return{localName:"",saving:!1}},watch:{group:{handler(t){this.localName=(t==null?void 0:t.name)||""},immediate:!0}},methods:{handleClose(){this.$emit("update:modelValue",!1)},async handleConfirm(){var t;!this.group||!((t=this.localName)!=null&&t.trim())||(this.saving=!0,await le.put(`${this.gateway}/api/arc/lygroups/${this.group.id}`,{name:this.localName},{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}}).then(e=>{var a;((a=e.data)==null?void 0:a.code)===0&&this.$emit("saved")}).finally(()=>{this.saving=!1}))}}},sg={class:"text-h6 font-weight-600"},cg={class:"text-label mb-2"};function mg(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VCardTitle"),s=o.resolveComponent("VDivider"),d=o.resolveComponent("VTextField"),m=o.resolveComponent("VCardText"),p=o.resolveComponent("VCardActions"),g=o.resolveComponent("VCard"),y=o.resolveComponent("VDialog");return o.openBlock(),o.createBlock(y,{"model-value":a.modelValue,"max-width":"320",persistent:"","onUpdate:modelValue":e[1]||(e[1]=u=>t.$emit("update:modelValue",u))},{default:o.withCtx(()=>[o.createVNode(g,{class:"",elevation:"4"},{default:o.withCtx(()=>[o.createVNode(c,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("span",sg,o.toDisplayString(t.$t("actions.editGroup")),1),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleClose},{default:o.withCtx(()=>e[2]||(e[2]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[2]},8,["onClick"])]),_:1}),o.createVNode(s),o.createVNode(m,{class:"px-4 text-body-1"},{default:o.withCtx(()=>[o.createElementVNode("div",cg,[o.createTextVNode(o.toDisplayString(t.$t("marker.groupName")),1),e[3]||(e[3]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(d,{modelValue:i.localName,"onUpdate:modelValue":e[0]||(e[0]=u=>i.localName=u),density:"compact",variant:"outlined","hide-details":"",autocomplete:"off",height:"32px","min-height":"32px",class:"input-btn-bg-1"},null,8,["modelValue"])]),_:1}),o.createVNode(s),o.createVNode(p,{class:"w-100 d-flex justify-end align-center ga-4 pa-4"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-none text-body-1",variant:"tonal",density:"comfortable",onClick:l.handleClose},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.cancel")),1)]),_:1},8,["onClick"]),o.createVNode(n,{class:"text-none text-body-1",variant:"flat",color:"primary",density:"comfortable",loading:i.saving,onClick:l.handleConfirm},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.confirm")),1)]),_:1},8,["loading","onClick"])]),_:1})]),_:1})]),_:1},8,["model-value"])}const dg=X(ng,[["render",mg]]),hg={name:"DeleteDialog",props:{title:{type:String},tips:{type:String},loading:{type:Boolean,default:!1}},emits:["close","delete"],data(){return{showDialog:!1}},methods:{handleClose(){this.showDialog=!1},handleDelete(){this.$emit("delete")},open(){this.showDialog=!0}}},pg={class:"text-body-1 pb-1"},gg={class:"text-body-1"};function ug(t,e,a,r,i,l){const n=o.resolveComponent("VIcon"),c=o.resolveComponent("VBtn"),s=o.resolveComponent("VCardTitle"),d=o.resolveComponent("VCardText"),m=o.resolveComponent("VCardActions"),p=o.resolveComponent("VCard"),g=o.resolveComponent("VDialog");return o.openBlock(),o.createBlock(g,{modelValue:i.showDialog,"onUpdate:modelValue":e[0]||(e[0]=y=>i.showDialog=y),width:"500","min-width":"500","max-width":"500"},{default:o.withCtx(()=>[o.createVNode(p,{class:""},{default:o.withCtx(()=>[o.createVNode(s,{class:"text-h6 font-weight-600 d-flex justify-center align-center py-4"},{default:o.withCtx(()=>[o.createVNode(n,{color:"warning",icon:"mdi-alert-circle",size:"small",class:"mr-2"}),o.createElementVNode("div",null,o.toDisplayString(a.title),1),o.createVNode(c,{icon:"",density:"compact",variant:"plain",class:"position-absolute top-0 right-0 mt-2 mr-2",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"])]),_:1}),o.createVNode(d,{class:"py-4 text-center"},{default:o.withCtx(()=>[o.createElementVNode("p",pg,o.toDisplayString(a.tips),1),o.createElementVNode("p",gg,o.toDisplayString(t.$t("tips.doYouWantToContinue")),1)]),_:1}),o.createVNode(m,{class:"w-100 d-flex justify-center align-center ga-8 py-6"},{default:o.withCtx(()=>[o.createVNode(c,{variant:"tonal",class:"text-none text-body-1",height:"32",onClick:l.handleClose},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.cancel")),1)]),_:1},8,["onClick"]),o.createVNode(c,{loading:a.loading,variant:"flat",color:"danger",class:"text-none text-body-1",height:"32",onClick:l.handleDelete},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.delete")),1)]),_:1},8,["loading","onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"])}const fg=X(hg,[["render",ug]]),Oy="",Zy="",yg={name:"IdmMarker",components:{IdmDrawMarker:jp,IdmImportMarker:lg,IdmGroupDialog:dg,DeleteDialog:fg},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},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}}},emits:["map","menuToggle","theme","login"],setup(){return{Theme:fe.useTheme()}},data(){return{right:10,toggle:!1,autoActive:localStorage.getItem("autoActiveMarkersGL4")==="true"||void 0,keyword:"",drawDialog:!1,importDialog:!1,loading:!1,deleteDialog:!1,deleteLoading:!1,layerGroup:[],layers:[],groupIndex:0,currentLayer:void 0,drawnLayerIds:[],layerMarkers:{},groupDialog:!1,currentGroup:null,currentGroupId:"",currentGroupName:""}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px"}:{top:this.top+"px",right:this.toggle?"0px":"-280px"}}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.markerLayers,this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},toggle:{async handler(){this.toggle&&(localStorage.getItem("autoActiveMarkersGL4")||(this.autoActive=!0))}},autoActive:{async handler(){(this.autoActive===!0||this.autoActive===!1)&&localStorage.setItem("autoActiveMarkersGL4",this.autoActive),this.layerGroup.length===0&&await this.fetchAllLayers(),this.autoActive?this.handleDrawAllLayers():this.handleClearAllLayers()},immediate:!0},map:{handler(){this.map&&(this.handleDrawAllLayers(),this.map.on("zoom",this.handleZoomChange))}}},methods:{handleMenuToggle(){this.isLogin?(this.toggle=!this.toggle,this.$emit("menuToggle","markerLayers")):this.$emit("login")},handleEditGroup(t){this.drawDialog=!1,this.importDialog=!1,this.currentGroup=t,this.groupDialog=!0},handleSaveGroup(){this.fetchAllLayers(),this.groupDialog=!1,this.currentGroup=void 0},handleOpenDelete(t,e){t==="group"?(this.currentGroup=e,this.currentLayer=void 0):t==="layer"&&(this.currentGroup=void 0,this.currentLayer=e),this.$refs.deleteDialog.open()},confirmDelete(){var t;this.currentGroup?this.handleDeleteGroup((t=this.currentGroup)==null?void 0:t.id):this.currentLayer&&this.handleDeleteLayer(this.currentLayer)},async handleDeleteGroup(t){t&&(this.deleteLoading=!0,await le.delete(`${this.gateway}/api/arc/lygroups/${t}`,{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}}).then(e=>{var a;((a=e.data)==null?void 0:a.code)===0&&(this.fetchAllLayers(),this.currentGroup=void 0,this.$refs.deleteDialog.handleClose(),this.deleteLoading=!1)}).catch(()=>{this.deleteLoading=!1}))},handleOpenDrawMarkers(t){this.handleCloseDraw(),this.currentGroup=t||this.layerGroup.find(e=>e.name==="Custom Layers"),this.importDialog=!1,this.drawDialog=!0},handleOpenImportDialog(t){this.drawDialog=!1,this.handleCloseDraw(),this.currentGroup=t||void 0,this.importDialog=!0},handleImportLayer(t){this.fetchAllLayers(),this.importDialog=!1},handleSaveMarker(t){this.fetchAllLayers(),this.drawDialog=!1,this.currentLayer=null},handleCloseDraw(){this.drawDialog=!1,this.currentLayer=null,this.autoActive&&this.handleDrawAllLayers(),this.currentGroup=void 0},handleEditLayer(t,e){var a;this.importDialog=!1,this.drawDialog&&((a=this.currentLayer)!=null&&a.id)&&this.currentLayer.id!==e.id&&this.autoActive&&this.handleDrawAllLayers(),this.currentGroup=t,this.currentLayer=e,this.drawDialog=!0},async fetchAllLayers(){this.loading=!0,this.layerGroup=[],await le.get(`${this.gateway}/api/arc/lygroups/my`,{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}}).then(t=>{var e,a,r,i,l,n;if(((e=t.data)==null?void 0:e.code)===0){this.loading=!1,this.layerGroup=((i=(r=(a=t.data)==null?void 0:a.data)==null?void 0:r.rows)==null?void 0:i.reverse())||[];const c=[];(l=this.layerGroup)==null||l.forEach(s=>{var d;s.show=!0,(d=s.layers)==null||d.forEach(m=>{var g;m.layerGroupId=s.id;const p=typeof m.extend=="string"?JSON.parse(m.extend):m.extend;(g=p==null?void 0:p.features)==null||g.forEach(y=>{y.properties.lgId=s.id,y.properties.layerId=m.id,y.properties.name||(y.properties.name=m.name)}),c.push(m)})}),this.layers=c,this.handleDrawAllLayers(),(n=this.$refs.drawDialog)==null||n.handleClearDraw()}}).catch(()=>{this.loading=!1})},async handleDeleteLayer(t){this.deleteLoading=!0,await le.delete(`${this.gateway}/api/arc/layers/${t.id}`,{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}}).then(e=>{var a;((a=e.data)==null?void 0:a.code)===0&&(this.deleteLoading=!1,this.fetchAllLayers(),this.$refs.deleteDialog.handleClose())}).catch(()=>{this.deleteLoading=!1})},handleRenderLayer(t){if(!this.map||!(t!=null&&t.extend))return;const e=typeof t.extend=="string"?JSON.parse(t.extend):t.extend;if(!e)return;const a=`marker-layer-${t.id}`;this.handleClearLayerMarkers(t.id);const r=e.features||(e.type==="Feature"?[e]:[]);if(r.some(c=>{var s,d;return(((s=c.geometry)==null?void 0:s.type)==="Point"||((d=c.geometry)==null?void 0:d.type)==="MultiPoint")&&c.properties.shape==="point"})){const c=[];r.forEach(s=>{var g,y,u,h;const d=(g=s.geometry)==null?void 0:g.type,m=((y=s.properties)==null?void 0:y.name)||"",p=((u=s.properties)==null?void 0:u.color)||t.color||((h=this.Theme.current.value.colors)==null?void 0:h["map-green"]);if(d==="Point"){const[f,k]=s.geometry.coordinates,w=`<div style="font-size:12px;line-height:1.5;">
|
|
220
220
|
<div style="font-weight:600;">${m}</div>
|
|
@@ -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-1d61ad85.js";
|
|
2
|
+
import "./chunk-3VYIPD3A-1e694a3f.js";
|
|
3
|
+
import "./index-0bd6af2f.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-4aa92758.js";
|
|
2
|
+
import "./chunk-3VYIPD3A-1e694a3f.js";
|
|
3
|
+
import "./index-0bd6af2f.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-1d61ad85.js";
|
|
2
|
+
import { l as g } from "./index-0bd6af2f.js";
|
|
3
|
+
import "./chunk-3VYIPD3A-1e694a3f.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idmwx/idmui-gl4",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.8",
|
|
5
5
|
"description": "idm webgl4",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"release": "yarn build && yarn publish --access public"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@idm-plugin/aliclient": "^0.0
|
|
31
|
+
"@idm-plugin/aliclient": "^0.1.0",
|
|
32
32
|
"@mapbox/sphericalmercator": "^1.2.0",
|
|
33
33
|
"@zumer/snapdom": "^2.0.1",
|
|
34
34
|
"js-md5": "^0.7.3",
|