@idmwx/idmui-gl3 4.4.5 → 4.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +82 -78
- package/dist/index.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(E,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("@turf/turf"),require("@mapbox/sphericalmercator"),require("moment"),require("mapbox-gl"),require("@idm-plugin/geo"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","@turf/turf","@mapbox/sphericalmercator","moment","mapbox-gl","@idm-plugin/geo","axios"],i):(E=typeof globalThis<"u"?globalThis:E||self,i(E["idm-gl"]={},E.Vue,E["@turf/turf"],E["@mapbox/sphericalmercator"],E.moment,E["mapbox-gl"],E["@idm-plugin/geo"],E.axios))})(this,function(E,i,ee,Oe,A,j,C,U){"use strict";var Po=Object.defineProperty;var No=(E,i,ee)=>i in E?Po(E,i,{enumerable:!0,configurable:!0,writable:!0,value:ee}):E[i]=ee;var z=(E,i,ee)=>(No(E,typeof i!="symbol"?i+"":i,ee),ee);function We(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const v=We(ee),To="";var Fe=Object.defineProperty,He=(a,e,t)=>e in a?Fe(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,me=(a,e,t)=>(He(a,typeof e!="symbol"?e+"":e,t),t);class ge{}me(ge,"LEVEL",{Basic:1,Prime:2,Supper:1024});class be{}me(be,"WEATHER_LAYERS",[{weight:1,name:"Wind",key:"wind",h5:!0,enabled:!0,type:"json",particle:!0},{weight:524288,name:"Wind Particle",key:"wind-particle",peer:{weight:1,key:"wind"},enabled:!0,hide:!0,type:"jpg"},{weight:16,name:"Sig Waves",key:"sig-wave-height",h5:!0,enabled:!0,type:"json"},{weight:4194304,name:"Sig Waves (JPG)",key:"sig-wave",peer:{weight:16,key:"sig-wave"},enabled:!0,hide:!0,type:"jpg"},{weight:8388608,name:"Sig Waves (Contour)",key:"sig-wave-height-contour",peer:{weight:16,key:"sig-wave-contour"},enabled:!0,hide:!0,type:"json"},{weight:96,name:"Current",key:"current",vendor:"cmems",merge:!0,h5:!0,enabled:!0,type:"json"},{weight:1048576,name:"Current Particle",key:"current-particle",vendor:"cmems",peer:{weight:96,key:"current"},enabled:!0,hide:!0,type:"jpg"},{weight:256,name:"Tropicals",key:"tropicals",h5:!0,enabled:!0,type:"json"},{weight:4096,name:"Pressure",h5:!0,key:"prmsl",enabled:!0,type:"json"},{weight:8192,name:"Visibility",vendor:"gfs",key:"visibility",h5:!0,enabled:!0,type:"jpg"},{weight:262144,name:"Precip Acc",key:"precip3h",h5:!0,enabled:!0,type:"jpg"},{weight:6,name:"Swell",key:"swell",merge:!0,h5:!0,enabled:!0,type:"json"},{weight:2,name:"Swell Height",key:"swell-height",partly:!0,enabled:!0,type:"json"},{weight:4,name:"Swell Direction",key:"swell-direction",partly:!0,enabled:!0,type:"json"},{weight:32,name:"Current Direction",key:"current-direction",vendor:"cmems",partly:!0,enabled:!0,type:"json"},{weight:64,name:"Current Speed",key:"current-speed",vendor:"cmems",partly:!0,enabled:!0,type:"json"},{weight:512,name:"Pressure Contour",key:"prmsl-contour",partly:!0,enabled:!0,hide:!0,type:"json"},{weight:1024,name:"Pressure Value",key:"prmsl-value",partly:!0,enabled:!0,hide:!0,type:"json"},{weight:2048,name:"Pressure Front",key:"prmsl-front",partly:!0,enabled:!0,hide:!0,type:"json"},{weight:16384,name:"Iceberg",key:"iceberg",vendor:"cmems",hide:!0,enabled:!1,type:"json"},{weight:32768,name:"Struct Ice",key:"struct-ice",vendor:"cmems",enabled:!1,hide:!0,type:"json"},{weight:65536,name:"Ice Edge",key:"arctic",vendor:"cmems",h5:!0,enabled:!0,type:"jpg"},{weight:131072,name:"Sea Surf. Temp.",key:"water-temp",vendor:"cmems",h5:!0,enabled:!0,type:"jpg"},{weight:2097152,name:"Temp.",key:"temp",h5:!0,enabled:!0,type:"jpg"}]),me(be,"OTHER_LAYERS",[{weight:1,name:"War Zones",key:"war-zones",h5:!0,enabled:!0,type:"json"},{weight:2,name:"GMDSS Areas",key:"gmdss-areas",h5:!0,enabled:!0,type:"json"},{weight:4,name:"ECA Zones",key:"eca-zones",h5:!0,enabled:!0,type:"json"},{weight:8,name:"Load Lines",key:"load-lines",h5:!0,enabled:!0,type:"json"},{weight:16,name:"HRA",key:"high-risk-area",enabled:!1,type:"json"},{weight:32,name:"Pirates",key:"pirates",enabled:!1,type:"json"},{weight:4096,name:"Alert Zones",key:"alert-zones",h5:!0,enabled:!0,type:"json"},{weight:64,name:"Ports",key:"ports",h5:!0,enabled:!0,type:"json"},{weight:128,name:"Time Zones",key:"time-zones",h5:!0,enabled:!0,type:"json"},{weight:256,name:"VRA",key:"voluntary-reporting-area",h5:!0,enabled:!0,type:"json"},{weight:512,name:"Special Areas",key:"special-area",h5:!0,enabled:!0,type:"json"},{weight:1024,name:"Day/Night",key:"day-night",h5:!0,enabled:!0,type:"json"},{weight:2048,name:"ENC",key:"enc",h5:!0,enabled:!0,type:"origin"},{weight:8192,name:"World-12nm",key:"world12nm",h5:!1,enabled:!0,type:"origin"}]);class Se{}me(Se,"WEATHER_TAG",[{weight:4,name:"Adverse Weather Dangerous",key:"DANGEROUS",positive:!0},{weight:2,name:"Adverse Weather Severe",key:"SEVERE",positive:!0},{weight:1,name:"Adverse Weather Heavy",key:"HEAVY",positive:!0}]),me(Se,"SAILING_TAG",[{weight:2048,name:"Deviation",key:"deviation",positive:!0},{weight:4096,name:"Stoppage",key:"stoppage",positive:!0},{weight:8192,name:"Deceleration",key:"deceleration",positive:!0},{weight:16384,name:"No Lane",key:"noLane",positive:!0},{weight:32768,name:"No Noon",key:"noNoon",positive:!0}]),me(Se,"OTHER_TAG",[{weight:2097152,name:"No CP",key:"noCp",positive:!0},{weight:4194304,name:"Send Rpt",key:"sendRpt",positive:!1},{weight:8388608,name:"Send Bps",key:"sendBps",positive:!1},{weight:16777216,name:"Send Pvar",key:"sendPvar",positive:!1},{weight:33554432,name:"Checked",key:"checked",positive:!1},{weight:67108864,name:"Send PWFR",key:"sendPwfr",positive:!1}]);const Io="",k=(a,e)=>{const t=a.__vccOpts||a;for(const[r,o]of e)t[r]=o;return t},Ue={name:"IdmGlLayer",props:{map:{type:Object},mapProjection:{type:String},top:{type:Number,default:60},layerToggle:{type:Boolean,default:!1},toggleVersion:{type:Number},isLogin:{type:Boolean,default:void 0}},emits:["weather","other","coordinate","measure","point","3d","layerToggle","handleToggleVersion"],data(){return{source:"",weatherLayers:[],activeWeatherLayers:[],autoActive:!0,otherLayers:[],layers:{weather:[...be.WEATHER_LAYERS.filter(a=>!["swell-height","swell-direction","current-direction","current-speed"].includes(a.key))],other:[...be.OTHER_LAYERS.filter(a=>a.key!=="world12nm"&&a.enabled)]},weatherLayersCache:"weatherLayersCache",autoActiveCache:"autoActiveCache",otherLayersCache:"otherLayersCache",collectedLayerCache:"collectedLayerCache",sourceCache:"defaultSourceCache",showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,version:{v:"0.0.7",k:"glCacheVersion"},right:10,rampColorLayers:["visibility","precip3h","temp","water-temp","arctic"]}},computed:{computeLayerClass(){return function(a,e){let t="layer flex-between";return e.some(r=>r.key===a.key)&&(t="layer flex-between active"),(!a.enabled||this.rampColorLayers.includes(a.key)&&this.mapProjection==="globe")&&(t="layer flex-between disabled"),t}}},watch:{toggleVersion:{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})}},source:{handler(a,e){a&&e&&a!==e&&this.handleConfirm()}}},mounted(){const a=localStorage.getItem(this.version.k);this.version.v!==a&&(localStorage.removeItem(this.weatherLayersCache),localStorage.removeItem(this.collectedLayerCache),localStorage.removeItem(this.otherLayersCache),localStorage.removeItem("windFeatherCache"),localStorage.removeItem("currentJsonCache"),localStorage.setItem(this.version.k,this.version.v));let e=localStorage.getItem(this.collectedLayerCache),t=JSON.parse(e||'[{"weight":1,"name":"Wind","key":"wind","collected":true},{"weight":4096,"name":"Pressure","key":"prmsl","collected":true},{"weight":256,"name":"Tropicals","key":"tropicals","collected":true}]');this.layers.weather.forEach(r=>{r.collected=!!t.some(o=>o.key===r.key&&o.collected)}),e=localStorage.getItem(this.autoActiveCache),this.autoActive=e!=="false",e=localStorage.getItem(this.weatherLayersCache),t=JSON.parse(e||'[{"weight":1,"name":"Wind","key":"wind","enabled":true,"type":"json","particle":true},{"weight":4096,"name":"Pressure","key":"prmsl","enabled":true,"type":"json"},{"weight":256,"name":"Tropicals","key":"tropicals","enabled":true,"type":"json"}]'),this.weatherLayers=t,this.autoActive&&(this.activeWeatherLayers=[...t]),e=localStorage.getItem(this.otherLayersCache),t=JSON.parse(e||'[{"weight":4,"name":"ECA Zones","key":"eca-zones","enabled":true,"type":"json"}]'),this.otherLayers=t,e=localStorage.getItem(this.sourceCache),this.source=e||"GFS",this.handleConfirm()},methods:{handleConfirm(){this.$emit("weather",this.weatherLayers,this.activeWeatherLayers,this.source),this.$emit("other",this.otherLayers),localStorage.setItem(this.autoActiveCache,this.autoActive),localStorage.setItem(this.sourceCache,this.source)},handleWeatherLayerPick(a){if(this.rampColorLayers.includes(a.key)&&this.mapProjection==="globe")return!1;this.weatherLayers.some(e=>e.key===a.key)?(this.weatherLayers=this.weatherLayers.filter(e=>e.key!==a.key),this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.key!==a.key)):this.weatherLayers.length<12&&a.enabled&&(["png","jpg"].includes(a.type)&&(this.weatherLayers=this.weatherLayers.filter(e=>e.type==="json"),this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.type==="json")),this.weatherLayers.push(a),this.activeWeatherLayers.push(a)),localStorage.setItem(this.weatherLayersCache,JSON.stringify(this.weatherLayers)),this.$emit("weather",this.weatherLayers,this.activeWeatherLayers,this.source),localStorage.setItem(this.autoActiveCache,this.autoActive),localStorage.setItem(this.sourceCache,this.source)},handleWeatherLayerCollect(a){var e;if(!a.collected&&((e=this.layers.weather.filter(t=>t.collected))==null?void 0:e.length)>=6)return!1;a.collected=!a.collected,localStorage.setItem(this.collectedLayerCache,JSON.stringify(this.layers.weather)),this.$emit("handleToggleVersion")},handleActiveWeatherLayerPick(a){if(this.rampColorLayers.includes(a.key)&&this.mapProjection==="globe")return!1;if(this.activeWeatherLayers.some(e=>e.key===a.key))this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.key!==a.key);else if(a.enabled){this.activeWeatherLayers.push(a);for(const e of this.weatherLayers)a.weight>e.weight&&a.weight&e.weight&&this.activeWeatherLayers.push(e)}this.handleWeatherLayerPick(a)},handleOtherLayerPick(a){this.otherLayers.some(e=>e.key===a.key)?this.otherLayers=this.otherLayers.filter(e=>e.key!==a.key):a.enabled&&this.otherLayers.push(a),localStorage.setItem(this.otherLayersCache,JSON.stringify(this.otherLayers)),this.$emit("other",this.otherLayers)},handleMenuToggle(){this.$emit("layerToggle",!this.layerToggle)},handleCoordToggle(){this.showCoord=!this.showCoord,this.$emit("coordinate",this.showCoord)},handlePointToggle(){this.isLogin?(this.showPoint=!this.showPoint,this.$emit("point",this.showPoint)):this.$emit("handleToggleVersion")},handleMeasureToggle(){this.showMeasure=!this.showMeasure,this.$emit("measure",this.showMeasure)},handle3DToggle(){this.show3d=!this.show3d,this.$emit("3d",this.show3d)}}},Ze={class:"idm-gl3-layer"},Ge={class:"bar-item layer-bars"},Je=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Xe={class:"bar-item tool-bars"},qe=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Ye=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Qe=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Ke=[i.createElementVNode("span",{class:"iconfont"},"",-1)],et=["onClick"],tt=i.createElementVNode("div",{class:"checkbox"},null,-1),at={class:"header-box flex-between"},it=i.createElementVNode("div",null,"Layers",-1),ot={class:"weather-layers card-bg"},rt=i.createElementVNode("div",{class:"layers-title flex-between"},[i.createElementVNode("div",null,"Weather Layers")],-1),st={class:"layers-body"},nt=["onClick"],lt=i.createElementVNode("div",{class:"checkbox"},null,-1),ct=["onClick"],ht={key:0,class:"iconfont bookmark active"},dt={key:1,class:"iconfont bookmark inactive"},pt=i.createElementVNode("div",{class:"tip flex-start"},[i.createElementVNode("i",{class:"iconfont bookmark",style:{"align-self":"flex-start",padding:"5px 5px 0 0"}},""),i.createElementVNode("div",null,"Bookmark your favorite layer to homepage(Max 6)")],-1),mt={class:"other-layers card-bg"},yt=i.createElementVNode("div",{class:"layers-title"},"Other Layers",-1),ft={class:"layers-body"},ut=["onClick"],gt={class:"flex-start"},bt=i.createElementVNode("div",{class:"switch flex-center"},[i.createElementVNode("i",{class:"iconfont open"},""),i.createElementVNode("i",{class:"iconfont close"},"")],-1),_t={class:"source-layers card-bg"},wt=i.createElementVNode("span",{class:"layers-title"},"Forecast Model",-1),Lt={class:"layers-body"};function vt(a,e,t,r,o,s){var p;const n=i.resolveComponent("ElTooltip"),l=i.resolveComponent("ElRadio"),c=i.resolveComponent("ElRadioGroup"),d=i.resolveComponent("ElScrollbar");return i.openBlock(),i.createElementBlock("div",Ze,[i.createElementVNode("div",{class:"menu-bar-box",style:i.normalizeStyle({top:t.top+10+"px",right:o.right+"px"})},[i.createElementVNode("div",Ge,[i.createVNode(n,{placement:"left",effect:"light",content:"Menu","show-after":2e3},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(t.layerToggle?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=(...h)=>s.handleMenuToggle&&s.handleMenuToggle(...h))},Je,2)]),_:1})])],4),i.createElementVNode("div",{class:"menu-bar-box",style:i.normalizeStyle({top:t.top+160+"px",right:o.right+"px"})},[i.createElementVNode("div",Xe,[i.createVNode(n,{placement:"left",effect:"light",content:"Measure"},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(o.showMeasure?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=(...h)=>s.handleMeasureToggle&&s.handleMeasureToggle(...h))},qe,2)]),_:1}),i.createVNode(n,{placement:"left",effect:"light",content:"Point Meteo"},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(o.showPoint?"menu-icon active":"menu-icon"),onClick:e[2]||(e[2]=(...h)=>s.handlePointToggle&&s.handlePointToggle(...h))},Ye,2)]),_:1}),i.createVNode(n,{placement:"left",effect:"light",content:"Grid"},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(o.showCoord?"menu-icon active":"menu-icon"),onClick:e[3]||(e[3]=(...h)=>s.handleCoordToggle&&s.handleCoordToggle(...h))},Qe,2)]),_:1}),i.createVNode(n,{placement:"left",effect:"light",content:"3D"},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(o.show3d?"menu-icon active":"menu-icon"),onClick:e[4]||(e[4]=(...h)=>s.handle3DToggle&&s.handle3DToggle(...h))},Ke,2)]),_:1})])],4),((p=o.layers.weather.filter(h=>h.collected))==null?void 0:p.length)>0?(i.openBlock(),i.createElementBlock("div",{key:0,class:"active-layers",style:i.normalizeStyle({right:o.right+"px",bottom:"100px"})},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.layers.weather.filter(h=>h.collected),h=>(i.openBlock(),i.createElementBlock("div",{key:h.key,class:i.normalizeClass(s.computeLayerClass(h,o.activeWeatherLayers)),onClick:g=>s.handleActiveWeatherLayerPick(h)},[tt,i.createElementVNode("span",null,i.toDisplayString(h.name),1)],10,et))),128))],4)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"available-layers flex-center",style:i.normalizeStyle({top:t.top+"px",right:t.layerToggle?"0px":"-240px"})},[i.createElementVNode("div",{class:i.normalizeClass(["list-box",t.layerToggle?"right-bar":""])},[i.createElementVNode("div",at,[it,i.createElementVNode("div",{class:"iconfont close-btn",onClick:e[5]||(e[5]=(...h)=>s.handleMenuToggle&&s.handleMenuToggle(...h))},"")]),i.createVNode(d,{style:{flex:"1"}},{default:i.withCtx(()=>[i.createElementVNode("div",ot,[rt,i.createElementVNode("div",st,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.layers.weather,h=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:h.key},[h.hide?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(s.computeLayerClass(h,o.weatherLayers))},[i.createElementVNode("div",{class:"flex-start",onClick:g=>s.handleWeatherLayerPick(h)},[lt,i.createElementVNode("span",null,i.toDisplayString(h.name),1)],8,nt),i.createElementVNode("div",{onClick:g=>s.handleWeatherLayerCollect(h)},[h.collected?(i.openBlock(),i.createElementBlock("i",ht,"")):(i.openBlock(),i.createElementBlock("i",dt,""))],8,ct)],2))],64))),128)),pt])]),i.createElementVNode("div",mt,[yt,i.createElementVNode("div",ft,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.layers.other,h=>(i.openBlock(),i.createElementBlock("div",{key:h.key,class:i.normalizeClass(s.computeLayerClass(h,o.otherLayers)),onClick:g=>s.handleOtherLayerPick(h)},[i.createElementVNode("div",gt,[bt,i.createElementVNode("span",null,i.toDisplayString(h.name),1)])],10,ut))),128))])]),i.createElementVNode("div",_t,[wt,i.createElementVNode("div",Lt,[i.createVNode(c,{modelValue:o.source,"onUpdate:modelValue":e[6]||(e[6]=h=>o.source=h),class:"layer-radio flex-col-center-start"},{default:i.withCtx(()=>[i.createVNode(l,{value:"GFS"},{default:i.withCtx(()=>[i.createTextVNode("GFS")]),_:1}),i.createVNode(l,{value:"CMEMS"},{default:i.withCtx(()=>[i.createTextVNode("CMEMS")]),_:1})]),_:1},8,["modelValue"])])])]),_:1})],2)],4)])}const xt=k(Ue,[["render",vt]]),Bo="",Ct={name:"IdmWindBarb",props:{map:{type:Object},wind:{type:Object},current:{type:Object},beforeLayer:{type:String},mapProjection:{type:String},showParticle:{type:Boolean,default:!1},toggleVersion:{type:Number}},emits:["particle"],data(){return{source:"wind-barb-source",barbs:[0,2,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105],empty:v.featureCollection([]),showFeather:localStorage.getItem("windFeatherCache")==="true"||!1,windFeatherCache:"windFeatherCache",right:10,bottom:125,windBarbLoaded:!1}},watch:{"wind.version":{handler(){var a;(a=this.wind)!=null&&a.active&&this.showFeather?this.handleRender():this.handleClear()},deep:!0},showParticle:{handler(){},immediate:!0},showFeather:{handler(){localStorage.setItem(this.windFeatherCache,this.showFeather),this.handleToggle()},immediate:!0},toggleVersion:{handler(){var a,e,t,r;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10,this.bottom=(e=this.current)!=null&&e.active?(((t=document.getElementsByClassName("active-layers")[0])==null?void 0:t.clientHeight)||0)+148:(((r=document.getElementsByClassName("active-layers")[0])==null?void 0:r.clientHeight)||0)+110},immediate:!0}},methods:{handleParticle(){this.$emit("particle",{particle:!this.showParticle,key:"wind",weight:1})},handleRender(){var a,e,t,r;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.wind){const o=new Date().valueOf();let s=0,n=0,l=this.empty;if((a=this.wind)!=null&&a.active&&(l=(e=this.wind)==null?void 0:e.data),(t=this.map)!=null&&t.getSource(this.source))(r=this.map)==null||r.getSource(this.source).setData(l),n=new Date().valueOf()-(o+s),console.log("[wind] update elapsed: ",n,", total: ",s+=n);else{this.map.addSource(this.source,{type:"geojson",data:l});for(let c=0;c<(this.barbs??[]).length-1;c++){const d=(this.barbs??[])[c]||0,p=(this.barbs??[])[c+1]||0,h=d<10?`00${d}kts`:d<100?`0${d}kts`:`${d}kts`;this.map.addLayer({id:h,type:"symbol",filter:["all",[">=","spd",d],["<","spd",p]],source:this.source,layout:{"symbol-placement":"point","icon-image":h,"icon-size":.14,"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":1,"text-color":"#222"}},this.beforeLayer)}this.windBarbLoaded=!0,n=new Date().valueOf()-(o+s),console.log("[wind] add elapsed: ",n,", total: ",s+=n)}}},handleToggle(){if(!this.windBarbLoaded)this.handleRender();else for(const a of this.barbs??[]){const e=a<10?`00${a}kts`:a<100?`0${a}kts`:`${a}kts`;this.map.getLayer(e)&&this.map.setLayoutProperty(e,"visibility",this.showFeather?"visible":"none")}},handleClear(){for(const a of this.barbs??[]){const e=a<10?`00${a}kts`:a<100?`0${a}kts`:`${a}kts`;this.map.getLayer(e)&&this.map.removeLayer(e)}this.map.getSource(this.source)&&this.map.removeSource(this.source),this.windBarbLoaded=!1}}},kt={key:0},St=[i.createElementVNode("div",{class:"checkbox"},null,-1),i.createElementVNode("span",null,"Wind Particles",-1)],Et=[i.createElementVNode("div",{class:"checkbox"},null,-1),i.createElementVNode("span",null,"Wind Feather",-1)];function zt(a,e,t,r,o,s){var n;return(n=t.wind)!=null&&n.active?(i.openBlock(),i.createElementBlock("div",kt,[i.createElementVNode("div",{class:"flex-center wind-tool-bars",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:o.bottom+"px"}])},[t.mapProjection==="mercator"?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["item-bar flex-start",t.showParticle?"active":"inactive"]),onClick:e[0]||(e[0]=(...l)=>s.handleParticle&&s.handleParticle(...l))},St,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["item-bar flex-start",o.showFeather?"active":"inactive"]),onClick:e[1]||(e[1]=l=>o.showFeather=!o.showFeather)},Et,2)],4)])):i.createCommentVNode("",!0)}const Pt=k(Ct,[["render",zt]]);class Ce{constructor(e){z(this,"map");z(this,"mercator");z(this,"rampColorLayer");z(this,"rampColorSource");z(this,"particleLayer");z(this,"particleSource");z(this,"rampColorCanvas");z(this,"particleCanvas");z(this,"ratio");this.map=e,this.mercator=new Oe,this.rampColorLayer="ramp-color-layer",this.rampColorSource="ramp-color-source",this.particleLayer="particle-layer",this.particleSource="particle-source",this.rampColorCanvas=document.createElement("canvas"),this.particleCanvas=document.createElement("canvas"),this.ratio=window.devicePixelRatio}convertNLng(e,t=0){return e>180?this.convertNLng(e-360,t+1):e<-180?this.convertNLng(e+360,t+1):[e,t]}getBoundLngLat(){const e=this.map.getBounds();return[[e._sw.lng,e._ne.lat],[e._ne.lng,e._ne.lat],[e._ne.lng,e._sw.lat],[e._sw.lng,e._sw.lat]]}getBoundPixel(){const e=this.map.getBounds(),t=this.map.getZoom()+1,r=[e._ne.lng,e._ne.lat],o=[e._sw.lng,e._sw.lat],[s,n]=this.convertNLng(r[0]),[l,c]=this.convertNLng(o[0]),[d,p]=this.mercator.px([s,r[1]],t),[h,g]=this.mercator.px([l,o[1]],t),y=Math.round(this.mercator.size*Math.pow(2,t)*(n+c));return[h,g,d+y,p]}getBoundRange(){const e=this.map.getZoom()+1,t=this.mercator.size*Math.pow(2,e),r=this.getBoundPixel();return[r[0]/t,r[2]/t,r[3]/t,r[1]/t]}getWorldCopy(e,t){const r=2**t,[o,s,n,l]=e.map(p=>~~(p/(r*256))),c=[];for(let p=l;p<=s;p++)for(let h=o;h<=n;h++)c.push([h,p]);return c.map(p=>{const h=2**t*256;return[p[0]*h,p[1]*h,h]})}resize(){let e=this.map.getSource(this.rampColorSource);e.setCoordinates(this.getBoundLngLat()),e=this.map.getSource(this.particleSource),e.setCoordinates(this.getBoundLngLat()),this.rampColorCanvas.width=this.map._canvas.clientWidth,this.rampColorCanvas.height=this.map._canvas.clientHeight,this.particleCanvas.width=this.map._canvas.clientWidth,this.particleCanvas.height=this.map._canvas.clientHeight}toggle(e){const t=this.map.getLayoutProperty(this.rampColorLayer,"visibility"),r=e?"visible":"none";t!==r&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",r)}toggleParticle(e){const t=this.map.getLayoutProperty(this.particleLayer,"visibility"),r=e?"visible":"none";t!==r&&this.map.setLayoutProperty(this.particleLayer,"visibility",r)}}class Z{createShader(e,t,r){const o=e.createShader(t);if(o&&(e.shaderSource(o,r),e.compileShader(o),!e.getShaderParameter(o,e.COMPILE_STATUS)))throw new Error(e.getShaderInfoLog(o)||"error happened while create shader...");return o}createTexture(e,t,r,o,s,n,l){const c=e.createTexture();return e.bindTexture(e.TEXTURE_2D,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,o),s instanceof Uint8Array?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,l,0,e.RGBA,e.UNSIGNED_BYTE,s):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,s),e.bindTexture(e.TEXTURE_2D,null),c}createDataBuffer(e,t,r){if(e){const o=e.createBuffer();return t==="array"?(e.bindBuffer(e.ARRAY_BUFFER,o),r&&e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW)):t==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,o),r&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,r,e.STATIC_DRAW)),o}return null}createProgram(e,t,r){const o=e.createProgram(),s=this.createShader(e,e.VERTEX_SHADER,t),n=this.createShader(e,e.FRAGMENT_SHADER,r);if(o&&s&&n&&(e.attachShader(o,s),e.attachShader(o,n),e.linkProgram(o),!e.getProgramParameter(o,e.LINK_STATUS)))throw new Error(e.getProgramInfoLog(o)||"error happened while creating ramp color program");return o}createProgramWrapper(e,t,r){const o=this.createProgram(e,t,r);if(o){const s={program:o},n=e.getProgramParameter(o,e.ACTIVE_ATTRIBUTES);for(let c=0;c<n;c++){const d=e.getActiveAttrib(o,c);s[d.name]=e.getAttribLocation(o,d.name)}const l=e.getProgramParameter(o,e.ACTIVE_UNIFORMS);for(let c=0;c<l;c++){const d=e.getActiveUniform(o,c);s[d.name]=e.getUniformLocation(o,d.name)}return s}}setup(e,t,r=!1,o,s){const n=document.createElement("canvas");n.width=256,n.height=1;const l=n.getContext("2d");if(l&&e){const c=l==null?void 0:l.createLinearGradient(0,0,256,0);return t.forEach(([d,p])=>{c.addColorStop(d,p)}),l.fillStyle=c,l.fillRect(0,0,256,1),{canvas:n,texture:this.createTexture(e,e.LINEAR,e.LINEAR,e.CLAMP_TO_EDGE,r?new Uint8Array(l.getImageData(0,0,256,1).data):n,o,s)}}}setupParticle(e,t=1e3){const r=Math.ceil(Math.sqrt(t)),o=r*r,s=new Uint8Array(o*4);for(let p=0;p<s.length;p++)s[p]=Math.floor(Math.random()*256);const n=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,r,r),l=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,r,r),c=new Float32Array(o);for(let p=0;p<o;p++)c[p]=p;const d=this.createDataBuffer(e,"array",c);return{resolution:r,total:o,texture0:n,texture1:l,indexBuffer:d}}bind(e,t,r){const o=this.createProgram(e,t,r);if(o){const s=this.createDataBuffer(e,"array",void 0),n=e.getAttribLocation(o,"a_position");e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0);const l=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(e,"array",l);const c=e.getAttribLocation(o,"a_texCoord");return e.enableVertexAttribArray(c),e.vertexAttribPointer(c,2,e.FLOAT,!1,0,0),{program:o,aPositionBuffer:s}}return{}}bindParticle(e,t,r,o,s,n){const l=this.createProgramWrapper(e,t,r),c=this.createProgramWrapper(e,o,s),d=this.createProgramWrapper(e,o,n),p=this.createDataBuffer(e,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),h=e.createFramebuffer();return{particle:l,screen:c,update:d,quadBuffer:p,frameBuffer:h}}draw(e,t,r,o,s,n,l){var c,d;if(t&&r){e.resize(),t==null||t.viewport(0,0,(c=t==null?void 0:t.canvas)==null?void 0:c.width,(d=t==null?void 0:t.canvas)==null?void 0:d.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);try{const p=t.getUniformLocation(r,"u_resolution"),h=t.getUniformLocation(r,"u_image"),g=t.getUniformLocation(r,"u_color");if(t.useProgram(r),t.uniform2f(p,t.canvas.width*e.ratio,t.canvas.height*e.ratio),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,o),t.uniform1i(h,0),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,s),t.uniform1i(g,1),l!=null&&l.uvRange&&(l!=null&&l.sRange)){const m=t.getUniformLocation(r,"u_range_u_v"),_=t.getUniformLocation(r,"u_range_s");t.uniform2f(m,l.uvRange[0],l.uvRange[1]),t.uniform2f(_,l.sRange[0],l.sRange[1])}const y=e.getBoundPixel(),f=e.map.getZoom()+1,u=e.getWorldCopy(y,f);for(const m of u){const _=(m[0]-y[0])*e.ratio,b=(m[1]-y[3])*e.ratio,L=m[2]*e.ratio,[x,w,P,N]=[_,L+_,b,L+b],I=new Float32Array([x,P,w,P,x,N,x,N,w,P,w,N]);t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,I,t.STATIC_DRAW),t.drawArrays(t.TRIANGLES,0,6)}}catch(p){console.log(`render failed...${p}`)}}}drawParticle(e,t,r,o,s){var n,l;t&&(t==null||t.viewport(0,0,(n=t==null?void 0:t.canvas)==null?void 0:n.width,(l=t==null?void 0:t.canvas)==null?void 0:l.height),t.disable(t.DEPTH_TEST),t.disable(t.STENCIL_TEST),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,r),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,o.texture0),this.renderScreen(e,t,o,s),this.updateParticles(e,t,o,s))}renderScreen(e,t,r,o){t.bindFramebuffer(t.FRAMEBUFFER,r.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r.screenTexture,0),t.viewport(0,0,t.canvas.width,t.canvas.height),this.renderScreenTexture(t,r.backgroundTexture,r.screen,r.quadBuffer,.95),this.renderParticles(e,t,r,o),t.bindFramebuffer(t.FRAMEBUFFER,null),this.renderScreenTexture(t,r.screenTexture,r.screen,r.quadBuffer,1);const s=r.backgroundTexture;r.backgroundTexture=r.screenTexture,r.screenTexture=s}renderScreenTexture(e,t,r,o,s){e&&(e.useProgram(r.program),e.bindBuffer(e.ARRAY_BUFFER,o),e.enableVertexAttribArray(r.a_pos),e.vertexAttribPointer(r.a_pos,2,e.FLOAT,!1,0,0),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t),e.uniform1i(r.u_screen,2),e.uniform1f(r.u_opacity,s),e.drawArrays(e.TRIANGLES,0,6))}renderParticles(e,t,r,o){if(t){t.useProgram(r.particle.program),t.bindBuffer(t.ARRAY_BUFFER,r.indexBuffer),t.enableVertexAttribArray(r.particle.a_index),t.vertexAttribPointer(r.particle.a_index,1,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,r.color.texture),t.uniform1i(r.particle.u_factor,0),t.uniform1i(r.particle.u_particles,1),t.uniform1i(r.particle.u_color_ramp,2),t.uniform1f(r.particle.u_particles_resolution,r.resolution*e.ratio),t.uniform1f(r.particle.u_point,e.ratio);const s=e.getBoundRange();t.uniform4f(r.particle.u_viewport,s[0],s[1],s[2],s[3]),t.uniform2f(r.particle.u_factor_min,o.uvRange[0],o.uvRange[0]),t.uniform2f(r.particle.u_factor_max,o.uvRange[1],o.uvRange[1]),t.drawArrays(t.POINTS,0,r.total)}}updateParticles(e,t,r,o){var n,l;if(t){t.bindFramebuffer(t.FRAMEBUFFER,r.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r.texture1,0),t.viewport(0,0,r.resolution,r.resolution),t.useProgram(r.update.program),t.bindBuffer(t.ARRAY_BUFFER,r.quadBuffer),t.enableVertexAttribArray(r.update.a_pos),t.vertexAttribPointer(r.update.a_pos,2,t.FLOAT,!1,0,0),t.uniform1i(r.update.u_factor,0),t.uniform1i(r.update.u_particles,1);const c=e.getBoundRange();t.uniform4f(r.update.u_viewport,c[0],c[1],c[2],c[3]),t.uniform1f(r.update.u_rand_seed,Math.random()),t.uniform2f(r.update.u_factor_res,(n=r==null?void 0:r.image)==null?void 0:n.width,(l=r==null?void 0:r.image)==null?void 0:l.height),t.uniform2f(r.update.u_factor_min,o.uvRange[0],o.uvRange[0]),t.uniform2f(r.update.u_factor_max,o.uvRange[1],o.uvRange[1]),t.uniform1f(r.update.u_speed_factor,o.speedFactor*e.ratio),t.uniform1f(r.update.u_drop_rate,o.dropRate),t.uniform1f(r.update.u_drop_rate_bump,o.dropRateBump),t.drawArrays(t.TRIANGLES,0,6)}const s=r.texture0;r.texture0=r.texture1,r.texture1=s}resize(e,t){e.resize();const r=new Uint8Array(t.canvas.width*t.canvas.height*4).fill(0,0,t.canvas.width*t.canvas.height*4),o=this.createTexture(t,t.NEAREST,t.NEAREST,t.CLAMP_TO_EDGE,r,t.canvas.width,t.canvas.height),s=this.createTexture(t,t.NEAREST,t.NEAREST,t.CLAMP_TO_EDGE,r,t.canvas.width,t.canvas.height);return{screenTexture:o,backgroundTexture:s}}async loadImg(e){return new Promise(t=>{const r=new Blob([e],{type:e.type}),o=URL.createObjectURL(r),s=new Image;s.crossOrigin="anonymous",s.src=o,s.onload=()=>t(s)})}}class T{}z(T,"vertexSchema",`
|
|
1
|
+
(function(E,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("@turf/turf"),require("@mapbox/sphericalmercator"),require("moment"),require("mapbox-gl"),require("@idm-plugin/geo"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","@turf/turf","@mapbox/sphericalmercator","moment","mapbox-gl","@idm-plugin/geo","axios"],i):(E=typeof globalThis<"u"?globalThis:E||self,i(E["idm-gl"]={},E.Vue,E["@turf/turf"],E["@mapbox/sphericalmercator"],E.moment,E["mapbox-gl"],E["@idm-plugin/geo"],E.axios))})(this,function(E,i,ee,Oe,A,j,C,U){"use strict";var Po=Object.defineProperty;var No=(E,i,ee)=>i in E?Po(E,i,{enumerable:!0,configurable:!0,writable:!0,value:ee}):E[i]=ee;var z=(E,i,ee)=>(No(E,typeof i!="symbol"?i+"":i,ee),ee);function We(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const v=We(ee),To="";var Fe=Object.defineProperty,He=(a,e,t)=>e in a?Fe(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,me=(a,e,t)=>(He(a,typeof e!="symbol"?e+"":e,t),t);class ge{}me(ge,"LEVEL",{Basic:1,Prime:2,Supper:1024});class be{}me(be,"WEATHER_LAYERS",[{weight:1,name:"Wind",key:"wind",h5:!0,enabled:!0,type:"json",particle:!0},{weight:524288,name:"Wind Particle",key:"wind-particle",peer:{weight:1,key:"wind"},enabled:!0,hide:!0,type:"jpg"},{weight:16,name:"Sig Waves",key:"sig-wave-height",h5:!0,enabled:!0,type:"json"},{weight:4194304,name:"Sig Waves (JPG)",key:"sig-wave",peer:{weight:16,key:"sig-wave"},enabled:!0,hide:!0,type:"jpg"},{weight:8388608,name:"Sig Waves (Contour)",key:"sig-wave-height-contour",peer:{weight:16,key:"sig-wave-contour"},enabled:!0,hide:!0,type:"json"},{weight:96,name:"Current",key:"current",vendor:"cmems",merge:!0,h5:!0,enabled:!0,type:"json"},{weight:1048576,name:"Current Particle",key:"current-particle",vendor:"cmems",peer:{weight:96,key:"current"},enabled:!0,hide:!0,type:"jpg"},{weight:256,name:"Tropicals",key:"tropicals",h5:!0,enabled:!0,type:"json"},{weight:4096,name:"Pressure",h5:!0,key:"prmsl",enabled:!0,type:"json"},{weight:8192,name:"Visibility",vendor:"gfs",key:"visibility",h5:!0,enabled:!0,type:"jpg"},{weight:262144,name:"Precip Acc",key:"precip3h",h5:!0,enabled:!0,type:"jpg"},{weight:6,name:"Swell",key:"swell",merge:!0,h5:!0,enabled:!0,type:"json"},{weight:2,name:"Swell Height",key:"swell-height",partly:!0,enabled:!0,type:"json"},{weight:4,name:"Swell Direction",key:"swell-direction",partly:!0,enabled:!0,type:"json"},{weight:32,name:"Current Direction",key:"current-direction",vendor:"cmems",partly:!0,enabled:!0,type:"json"},{weight:64,name:"Current Speed",key:"current-speed",vendor:"cmems",partly:!0,enabled:!0,type:"json"},{weight:512,name:"Pressure Contour",key:"prmsl-contour",partly:!0,enabled:!0,hide:!0,type:"json"},{weight:1024,name:"Pressure Value",key:"prmsl-value",partly:!0,enabled:!0,hide:!0,type:"json"},{weight:2048,name:"Pressure Front",key:"prmsl-front",partly:!0,enabled:!0,hide:!0,type:"json"},{weight:16384,name:"Iceberg",key:"iceberg",vendor:"cmems",hide:!0,enabled:!1,type:"json"},{weight:32768,name:"Struct Ice",key:"struct-ice",vendor:"cmems",enabled:!1,hide:!0,type:"json"},{weight:65536,name:"Ice Edge",key:"arctic",vendor:"cmems",h5:!0,enabled:!0,type:"jpg"},{weight:131072,name:"Sea Surf. Temp.",key:"water-temp",vendor:"cmems",h5:!0,enabled:!0,type:"jpg"},{weight:2097152,name:"Temp.",key:"temp",h5:!0,enabled:!0,type:"jpg"}]),me(be,"OTHER_LAYERS",[{weight:1,name:"War Zones",key:"war-zones",h5:!0,enabled:!0,type:"json"},{weight:2,name:"GMDSS Areas",key:"gmdss-areas",h5:!0,enabled:!0,type:"json"},{weight:4,name:"ECA Zones",key:"eca-zones",h5:!0,enabled:!0,type:"json"},{weight:8,name:"Load Lines",key:"load-lines",h5:!0,enabled:!0,type:"json"},{weight:16,name:"HRA",key:"high-risk-area",enabled:!1,type:"json"},{weight:32,name:"Pirates",key:"pirates",enabled:!1,type:"json"},{weight:4096,name:"Alert Zones",key:"alert-zones",h5:!0,enabled:!0,type:"json"},{weight:64,name:"Ports",key:"ports",h5:!0,enabled:!0,type:"json"},{weight:128,name:"Time Zones",key:"time-zones",h5:!0,enabled:!0,type:"json"},{weight:256,name:"VRA",key:"voluntary-reporting-area",h5:!0,enabled:!0,type:"json"},{weight:512,name:"Special Areas",key:"special-area",h5:!0,enabled:!0,type:"json"},{weight:1024,name:"Day/Night",key:"day-night",h5:!0,enabled:!0,type:"json"},{weight:2048,name:"ENC",key:"enc",h5:!0,enabled:!0,type:"origin"},{weight:8192,name:"World-12nm",key:"world12nm",h5:!1,enabled:!0,type:"origin"}]);class Se{}me(Se,"WEATHER_TAG",[{weight:4,name:"Adverse Weather Dangerous",key:"DANGEROUS",positive:!0},{weight:2,name:"Adverse Weather Severe",key:"SEVERE",positive:!0},{weight:1,name:"Adverse Weather Heavy",key:"HEAVY",positive:!0}]),me(Se,"SAILING_TAG",[{weight:2048,name:"Deviation",key:"deviation",positive:!0},{weight:4096,name:"Stoppage",key:"stoppage",positive:!0},{weight:8192,name:"Deceleration",key:"deceleration",positive:!0},{weight:16384,name:"No Lane",key:"noLane",positive:!0},{weight:32768,name:"No Noon",key:"noNoon",positive:!0}]),me(Se,"OTHER_TAG",[{weight:2097152,name:"No CP",key:"noCp",positive:!0},{weight:4194304,name:"Send Rpt",key:"sendRpt",positive:!1},{weight:8388608,name:"Send Bps",key:"sendBps",positive:!1},{weight:16777216,name:"Send Pvar",key:"sendPvar",positive:!1},{weight:33554432,name:"Checked",key:"checked",positive:!1},{weight:67108864,name:"Send PWFR",key:"sendPwfr",positive:!1}]);const Io="",k=(a,e)=>{const t=a.__vccOpts||a;for(const[r,o]of e)t[r]=o;return t},Ue={name:"IdmGlLayer",props:{map:{type:Object},mapProjection:{type:String},top:{type:Number,default:60},layerToggle:{type:Boolean,default:!1},toggleVersion:{type:Number},isLogin:{type:Boolean,default:void 0}},emits:["weather","other","coordinate","measure","point","3d","layerToggle","handleToggleVersion"],data(){return{source:"",weatherLayers:[],activeWeatherLayers:[],autoActive:!0,otherLayers:[],layers:{weather:[...be.WEATHER_LAYERS.filter(a=>!["swell-height","swell-direction","current-direction","current-speed"].includes(a.key))],other:[...be.OTHER_LAYERS.filter(a=>a.key!=="world12nm"&&a.enabled)]},weatherLayersCache:"weatherLayersCache",autoActiveCache:"autoActiveCache",otherLayersCache:"otherLayersCache",collectedLayerCache:"collectedLayerCache",sourceCache:"defaultSourceCache",showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,version:{v:"0.0.7",k:"glCacheVersion"},right:10,rampColorLayers:["visibility","precip3h","temp","water-temp","arctic"]}},computed:{computeLayerClass(){return function(a,e){let t="layer flex-between";return e.some(r=>r.key===a.key)&&(t="layer flex-between active"),(!a.enabled||this.rampColorLayers.includes(a.key)&&this.mapProjection==="globe")&&(t="layer flex-between disabled"),t}}},watch:{toggleVersion:{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})}},source:{handler(a,e){a&&e&&a!==e&&this.handleConfirm()}}},mounted(){const a=localStorage.getItem(this.version.k);this.version.v!==a&&(localStorage.removeItem(this.weatherLayersCache),localStorage.removeItem(this.collectedLayerCache),localStorage.removeItem(this.otherLayersCache),localStorage.removeItem("windFeatherCache"),localStorage.removeItem("currentJsonCache"),localStorage.setItem(this.version.k,this.version.v));let e=localStorage.getItem(this.collectedLayerCache),t=JSON.parse(e||'[{"weight":1,"name":"Wind","key":"wind","collected":true},{"weight":4096,"name":"Pressure","key":"prmsl","collected":true},{"weight":256,"name":"Tropicals","key":"tropicals","collected":true}]');this.layers.weather.forEach(r=>{r.collected=!!t.some(o=>o.key===r.key&&o.collected)}),e=localStorage.getItem(this.autoActiveCache),this.autoActive=e!=="false",e=localStorage.getItem(this.weatherLayersCache),t=JSON.parse(e||'[{"weight":1,"name":"Wind","key":"wind","enabled":true,"type":"json","particle":true},{"weight":4096,"name":"Pressure","key":"prmsl","enabled":true,"type":"json"},{"weight":256,"name":"Tropicals","key":"tropicals","enabled":true,"type":"json"}]'),this.weatherLayers=t,this.autoActive&&(this.activeWeatherLayers=[...t]),e=localStorage.getItem(this.otherLayersCache),t=JSON.parse(e||'[{"weight":4,"name":"ECA Zones","key":"eca-zones","enabled":true,"type":"json"}]'),this.otherLayers=t,e=localStorage.getItem(this.sourceCache),this.source=e||"GFS",this.handleConfirm()},methods:{handleConfirm(){this.$emit("weather",this.weatherLayers,this.activeWeatherLayers,this.source),this.$emit("other",this.otherLayers),localStorage.setItem(this.autoActiveCache,this.autoActive),localStorage.setItem(this.sourceCache,this.source)},handleWeatherLayerPick(a){if(this.rampColorLayers.includes(a.key)&&this.mapProjection==="globe")return!1;this.weatherLayers.some(e=>e.key===a.key)?(this.weatherLayers=this.weatherLayers.filter(e=>e.key!==a.key),this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.key!==a.key)):this.weatherLayers.length<12&&a.enabled&&(["png","jpg"].includes(a.type)&&(this.weatherLayers=this.weatherLayers.filter(e=>e.type==="json"),this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.type==="json")),this.weatherLayers.push(a),this.activeWeatherLayers.push(a)),localStorage.setItem(this.weatherLayersCache,JSON.stringify(this.weatherLayers)),this.$emit("weather",this.weatherLayers,this.activeWeatherLayers,this.source),localStorage.setItem(this.autoActiveCache,this.autoActive),localStorage.setItem(this.sourceCache,this.source)},handleWeatherLayerCollect(a){var e;if(!a.collected&&((e=this.layers.weather.filter(t=>t.collected))==null?void 0:e.length)>=6)return!1;a.collected=!a.collected,localStorage.setItem(this.collectedLayerCache,JSON.stringify(this.layers.weather)),this.$emit("handleToggleVersion")},handleActiveWeatherLayerPick(a){if(this.rampColorLayers.includes(a.key)&&this.mapProjection==="globe")return!1;if(this.activeWeatherLayers.some(e=>e.key===a.key))this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.key!==a.key);else if(a.enabled){this.activeWeatherLayers.push(a);for(const e of this.weatherLayers)a.weight>e.weight&&a.weight&e.weight&&this.activeWeatherLayers.push(e)}this.handleWeatherLayerPick(a)},handleOtherLayerPick(a){this.otherLayers.some(e=>e.key===a.key)?this.otherLayers=this.otherLayers.filter(e=>e.key!==a.key):a.enabled&&this.otherLayers.push(a),localStorage.setItem(this.otherLayersCache,JSON.stringify(this.otherLayers)),this.$emit("other",this.otherLayers)},handleMenuToggle(){this.$emit("layerToggle",!this.layerToggle)},handleCoordToggle(){this.showCoord=!this.showCoord,this.$emit("coordinate",this.showCoord)},handlePointToggle(){this.isLogin?(this.showPoint=!this.showPoint,this.$emit("point",this.showPoint)):this.$emit("handleToggleVersion")},handleMeasureToggle(){this.showMeasure=!this.showMeasure,this.$emit("measure",this.showMeasure)},handle3DToggle(){this.show3d=!this.show3d,this.$emit("3d",this.show3d)}}},Ze={class:"idm-gl3-layer"},Ge={class:"bar-item layer-bars"},Je=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Xe={class:"bar-item tool-bars"},qe=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Ye=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Qe=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Ke=[i.createElementVNode("span",{class:"iconfont"},"",-1)],et=["onClick"],tt=i.createElementVNode("div",{class:"checkbox"},null,-1),at={class:"header-box flex-between"},it=i.createElementVNode("div",null,"Layers",-1),ot={class:"weather-layers card-bg"},rt=i.createElementVNode("div",{class:"layers-title flex-between"},[i.createElementVNode("div",null,"Weather Layers")],-1),st={class:"layers-body"},nt=["onClick"],lt=i.createElementVNode("div",{class:"checkbox"},null,-1),ct=["onClick"],ht={key:0,class:"iconfont bookmark active"},dt={key:1,class:"iconfont bookmark inactive"},pt=i.createElementVNode("div",{class:"tip flex-start"},[i.createElementVNode("i",{class:"iconfont bookmark",style:{"align-self":"flex-start",padding:"5px 5px 0 0"}},""),i.createElementVNode("div",null,"Bookmark your favorite layer to homepage(Max 6)")],-1),mt={class:"other-layers card-bg"},yt=i.createElementVNode("div",{class:"layers-title"},"Other Layers",-1),ft={class:"layers-body"},ut=["onClick"],gt={class:"flex-start"},bt=i.createElementVNode("div",{class:"switch flex-center"},[i.createElementVNode("i",{class:"iconfont open"},""),i.createElementVNode("i",{class:"iconfont close"},"")],-1),_t={class:"source-layers card-bg"},wt=i.createElementVNode("span",{class:"layers-title"},"Forecast Model",-1),Lt={class:"layers-body"};function vt(a,e,t,r,o,s){var p;const n=i.resolveComponent("ElTooltip"),l=i.resolveComponent("ElRadio"),c=i.resolveComponent("ElRadioGroup"),d=i.resolveComponent("ElScrollbar");return i.openBlock(),i.createElementBlock("div",Ze,[i.createElementVNode("div",{class:"menu-bar-box",style:i.normalizeStyle({top:t.top+10+"px",right:o.right+"px"})},[i.createElementVNode("div",Ge,[i.createVNode(n,{placement:"left",effect:"light",content:"Menu","show-after":2e3},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(t.layerToggle?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=(...h)=>s.handleMenuToggle&&s.handleMenuToggle(...h))},Je,2)]),_:1})])],4),i.createElementVNode("div",{class:"menu-bar-box",style:i.normalizeStyle({top:t.top+160+"px",right:o.right+"px"})},[i.createElementVNode("div",Xe,[i.createVNode(n,{placement:"left",effect:"light",content:"Measure","show-after":2e3},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(o.showMeasure?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=(...h)=>s.handleMeasureToggle&&s.handleMeasureToggle(...h))},qe,2)]),_:1}),i.createVNode(n,{placement:"left",effect:"light",content:"Point Meteo","show-after":2e3},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(o.showPoint?"menu-icon active":"menu-icon"),onClick:e[2]||(e[2]=(...h)=>s.handlePointToggle&&s.handlePointToggle(...h))},Ye,2)]),_:1}),i.createVNode(n,{placement:"left",effect:"light",content:"Grid","show-after":2e3},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(o.showCoord?"menu-icon active":"menu-icon"),onClick:e[3]||(e[3]=(...h)=>s.handleCoordToggle&&s.handleCoordToggle(...h))},Qe,2)]),_:1}),i.createVNode(n,{placement:"left",effect:"light",content:"3D","show-after":2e3},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(o.show3d?"menu-icon active":"menu-icon"),onClick:e[4]||(e[4]=(...h)=>s.handle3DToggle&&s.handle3DToggle(...h))},Ke,2)]),_:1})])],4),((p=o.layers.weather.filter(h=>h.collected))==null?void 0:p.length)>0?(i.openBlock(),i.createElementBlock("div",{key:0,class:"active-layers",style:i.normalizeStyle({right:o.right+"px",bottom:"100px"})},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.layers.weather.filter(h=>h.collected),h=>(i.openBlock(),i.createElementBlock("div",{key:h.key,class:i.normalizeClass(s.computeLayerClass(h,o.activeWeatherLayers)),onClick:g=>s.handleActiveWeatherLayerPick(h)},[tt,i.createElementVNode("span",null,i.toDisplayString(h.name),1)],10,et))),128))],4)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"available-layers flex-center",style:i.normalizeStyle({top:t.top+"px",right:t.layerToggle?"0px":"-240px"})},[i.createElementVNode("div",{class:i.normalizeClass(["list-box",t.layerToggle?"right-bar":""])},[i.createElementVNode("div",at,[it,i.createElementVNode("div",{class:"iconfont close-btn",onClick:e[5]||(e[5]=(...h)=>s.handleMenuToggle&&s.handleMenuToggle(...h))},"")]),i.createVNode(d,{style:{flex:"1"}},{default:i.withCtx(()=>[i.createElementVNode("div",ot,[rt,i.createElementVNode("div",st,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.layers.weather,h=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:h.key},[h.hide?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(s.computeLayerClass(h,o.weatherLayers))},[i.createElementVNode("div",{class:"flex-start",onClick:g=>s.handleWeatherLayerPick(h)},[lt,i.createElementVNode("span",null,i.toDisplayString(h.name),1)],8,nt),i.createElementVNode("div",{onClick:g=>s.handleWeatherLayerCollect(h)},[h.collected?(i.openBlock(),i.createElementBlock("i",ht,"")):(i.openBlock(),i.createElementBlock("i",dt,""))],8,ct)],2))],64))),128)),pt])]),i.createElementVNode("div",mt,[yt,i.createElementVNode("div",ft,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.layers.other,h=>(i.openBlock(),i.createElementBlock("div",{key:h.key,class:i.normalizeClass(s.computeLayerClass(h,o.otherLayers)),onClick:g=>s.handleOtherLayerPick(h)},[i.createElementVNode("div",gt,[bt,i.createElementVNode("span",null,i.toDisplayString(h.name),1)])],10,ut))),128))])]),i.createElementVNode("div",_t,[wt,i.createElementVNode("div",Lt,[i.createVNode(c,{modelValue:o.source,"onUpdate:modelValue":e[6]||(e[6]=h=>o.source=h),class:"layer-radio flex-col-center-start"},{default:i.withCtx(()=>[i.createVNode(l,{value:"GFS"},{default:i.withCtx(()=>[i.createTextVNode("GFS")]),_:1}),i.createVNode(l,{value:"CMEMS"},{default:i.withCtx(()=>[i.createTextVNode("CMEMS")]),_:1})]),_:1},8,["modelValue"])])])]),_:1})],2)],4)])}const xt=k(Ue,[["render",vt]]),Bo="",Ct={name:"IdmWindBarb",props:{map:{type:Object},wind:{type:Object},current:{type:Object},beforeLayer:{type:String},mapProjection:{type:String},showParticle:{type:Boolean,default:!1},toggleVersion:{type:Number}},emits:["particle"],data(){return{source:"wind-barb-source",barbs:[0,2,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105],empty:v.featureCollection([]),showFeather:localStorage.getItem("windFeatherCache")==="true"||!1,windFeatherCache:"windFeatherCache",right:10,bottom:125,windBarbLoaded:!1}},watch:{"wind.version":{handler(){var a;(a=this.wind)!=null&&a.active&&this.showFeather?this.handleRender():this.handleClear()},deep:!0},showParticle:{handler(){},immediate:!0},showFeather:{handler(){localStorage.setItem(this.windFeatherCache,this.showFeather),this.handleToggle()},immediate:!0},toggleVersion:{handler(){var a,e,t,r;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10,this.bottom=(e=this.current)!=null&&e.active?(((t=document.getElementsByClassName("active-layers")[0])==null?void 0:t.clientHeight)||0)+148:(((r=document.getElementsByClassName("active-layers")[0])==null?void 0:r.clientHeight)||0)+110},immediate:!0}},methods:{handleParticle(){this.$emit("particle",{particle:!this.showParticle,key:"wind",weight:1})},handleRender(){var a,e,t,r;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.wind){const o=new Date().valueOf();let s=0,n=0,l=this.empty;if((a=this.wind)!=null&&a.active&&(l=(e=this.wind)==null?void 0:e.data),(t=this.map)!=null&&t.getSource(this.source))(r=this.map)==null||r.getSource(this.source).setData(l),n=new Date().valueOf()-(o+s),console.log("[wind] update elapsed: ",n,", total: ",s+=n);else{this.map.addSource(this.source,{type:"geojson",data:l});for(let c=0;c<(this.barbs??[]).length-1;c++){const d=(this.barbs??[])[c]||0,p=(this.barbs??[])[c+1]||0,h=d<10?`00${d}kts`:d<100?`0${d}kts`:`${d}kts`;this.map.addLayer({id:h,type:"symbol",filter:["all",[">=","spd",d],["<","spd",p]],source:this.source,layout:{"symbol-placement":"point","icon-image":h,"icon-size":.14,"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":1,"text-color":"#222"}},this.beforeLayer)}this.windBarbLoaded=!0,n=new Date().valueOf()-(o+s),console.log("[wind] add elapsed: ",n,", total: ",s+=n)}}},handleToggle(){if(!this.windBarbLoaded)this.handleRender();else for(const a of this.barbs??[]){const e=a<10?`00${a}kts`:a<100?`0${a}kts`:`${a}kts`;this.map.getLayer(e)&&this.map.setLayoutProperty(e,"visibility",this.showFeather?"visible":"none")}},handleClear(){for(const a of this.barbs??[]){const e=a<10?`00${a}kts`:a<100?`0${a}kts`:`${a}kts`;this.map.getLayer(e)&&this.map.removeLayer(e)}this.map.getSource(this.source)&&this.map.removeSource(this.source),this.windBarbLoaded=!1}}},kt={key:0},St=[i.createElementVNode("div",{class:"checkbox"},null,-1),i.createElementVNode("span",null,"Wind Particles",-1)],Et=[i.createElementVNode("div",{class:"checkbox"},null,-1),i.createElementVNode("span",null,"Wind Feather",-1)];function zt(a,e,t,r,o,s){var n;return(n=t.wind)!=null&&n.active?(i.openBlock(),i.createElementBlock("div",kt,[i.createElementVNode("div",{class:"flex-center wind-tool-bars",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:o.bottom+"px"}])},[t.mapProjection==="mercator"?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["item-bar flex-start",t.showParticle?"active":"inactive"]),onClick:e[0]||(e[0]=(...l)=>s.handleParticle&&s.handleParticle(...l))},St,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["item-bar flex-start",o.showFeather?"active":"inactive"]),onClick:e[1]||(e[1]=l=>o.showFeather=!o.showFeather)},Et,2)],4)])):i.createCommentVNode("",!0)}const Pt=k(Ct,[["render",zt]]);class Ce{constructor(e){z(this,"map");z(this,"mercator");z(this,"rampColorLayer");z(this,"rampColorSource");z(this,"particleLayer");z(this,"particleSource");z(this,"rampColorCanvas");z(this,"particleCanvas");z(this,"ratio");this.map=e,this.mercator=new Oe,this.rampColorLayer="ramp-color-layer",this.rampColorSource="ramp-color-source",this.particleLayer="particle-layer",this.particleSource="particle-source",this.rampColorCanvas=document.createElement("canvas"),this.particleCanvas=document.createElement("canvas"),this.ratio=window.devicePixelRatio}convertNLng(e,t=0){return e>180?this.convertNLng(e-360,t+1):e<-180?this.convertNLng(e+360,t+1):[e,t]}getBoundLngLat(){const e=this.map.getBounds();return[[e._sw.lng,e._ne.lat],[e._ne.lng,e._ne.lat],[e._ne.lng,e._sw.lat],[e._sw.lng,e._sw.lat]]}getBoundPixel(){const e=this.map.getBounds(),t=this.map.getZoom()+1,r=[e._ne.lng,e._ne.lat],o=[e._sw.lng,e._sw.lat],[s,n]=this.convertNLng(r[0]),[l,c]=this.convertNLng(o[0]),[d,p]=this.mercator.px([s,r[1]],t),[h,g]=this.mercator.px([l,o[1]],t),y=Math.round(this.mercator.size*Math.pow(2,t)*(n+c));return[h,g,d+y,p]}getBoundRange(){const e=this.map.getZoom()+1,t=this.mercator.size*Math.pow(2,e),r=this.getBoundPixel();return[r[0]/t,r[2]/t,r[3]/t,r[1]/t]}getWorldCopy(e,t){const r=2**t,[o,s,n,l]=e.map(p=>~~(p/(r*256))),c=[];for(let p=l;p<=s;p++)for(let h=o;h<=n;h++)c.push([h,p]);return c.map(p=>{const h=2**t*256;return[p[0]*h,p[1]*h,h]})}resize(){let e=this.map.getSource(this.rampColorSource);e.setCoordinates(this.getBoundLngLat()),e=this.map.getSource(this.particleSource),e.setCoordinates(this.getBoundLngLat()),this.rampColorCanvas.width=this.map._canvas.clientWidth,this.rampColorCanvas.height=this.map._canvas.clientHeight,this.particleCanvas.width=this.map._canvas.clientWidth,this.particleCanvas.height=this.map._canvas.clientHeight}toggle(e){const t=this.map.getLayoutProperty(this.rampColorLayer,"visibility"),r=e?"visible":"none";t!==r&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",r)}toggleParticle(e){const t=this.map.getLayoutProperty(this.particleLayer,"visibility"),r=e?"visible":"none";t!==r&&this.map.setLayoutProperty(this.particleLayer,"visibility",r)}}class Z{createShader(e,t,r){const o=e.createShader(t);if(o&&(e.shaderSource(o,r),e.compileShader(o),!e.getShaderParameter(o,e.COMPILE_STATUS)))throw new Error(e.getShaderInfoLog(o)||"error happened while create shader...");return o}createTexture(e,t,r,o,s,n,l){const c=e.createTexture();return e.bindTexture(e.TEXTURE_2D,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,o),s instanceof Uint8Array?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,l,0,e.RGBA,e.UNSIGNED_BYTE,s):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,s),e.bindTexture(e.TEXTURE_2D,null),c}createDataBuffer(e,t,r){if(e){const o=e.createBuffer();return t==="array"?(e.bindBuffer(e.ARRAY_BUFFER,o),r&&e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW)):t==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,o),r&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,r,e.STATIC_DRAW)),o}return null}createProgram(e,t,r){const o=e.createProgram(),s=this.createShader(e,e.VERTEX_SHADER,t),n=this.createShader(e,e.FRAGMENT_SHADER,r);if(o&&s&&n&&(e.attachShader(o,s),e.attachShader(o,n),e.linkProgram(o),!e.getProgramParameter(o,e.LINK_STATUS)))throw new Error(e.getProgramInfoLog(o)||"error happened while creating ramp color program");return o}createProgramWrapper(e,t,r){const o=this.createProgram(e,t,r);if(o){const s={program:o},n=e.getProgramParameter(o,e.ACTIVE_ATTRIBUTES);for(let c=0;c<n;c++){const d=e.getActiveAttrib(o,c);s[d.name]=e.getAttribLocation(o,d.name)}const l=e.getProgramParameter(o,e.ACTIVE_UNIFORMS);for(let c=0;c<l;c++){const d=e.getActiveUniform(o,c);s[d.name]=e.getUniformLocation(o,d.name)}return s}}setup(e,t,r=!1,o,s){const n=document.createElement("canvas");n.width=256,n.height=1;const l=n.getContext("2d");if(l&&e){const c=l==null?void 0:l.createLinearGradient(0,0,256,0);return t.forEach(([d,p])=>{c.addColorStop(d,p)}),l.fillStyle=c,l.fillRect(0,0,256,1),{canvas:n,texture:this.createTexture(e,e.LINEAR,e.LINEAR,e.CLAMP_TO_EDGE,r?new Uint8Array(l.getImageData(0,0,256,1).data):n,o,s)}}}setupParticle(e,t=1e3){const r=Math.ceil(Math.sqrt(t)),o=r*r,s=new Uint8Array(o*4);for(let p=0;p<s.length;p++)s[p]=Math.floor(Math.random()*256);const n=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,r,r),l=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,r,r),c=new Float32Array(o);for(let p=0;p<o;p++)c[p]=p;const d=this.createDataBuffer(e,"array",c);return{resolution:r,total:o,texture0:n,texture1:l,indexBuffer:d}}bind(e,t,r){const o=this.createProgram(e,t,r);if(o){const s=this.createDataBuffer(e,"array",void 0),n=e.getAttribLocation(o,"a_position");e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0);const l=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(e,"array",l);const c=e.getAttribLocation(o,"a_texCoord");return e.enableVertexAttribArray(c),e.vertexAttribPointer(c,2,e.FLOAT,!1,0,0),{program:o,aPositionBuffer:s}}return{}}bindParticle(e,t,r,o,s,n){const l=this.createProgramWrapper(e,t,r),c=this.createProgramWrapper(e,o,s),d=this.createProgramWrapper(e,o,n),p=this.createDataBuffer(e,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),h=e.createFramebuffer();return{particle:l,screen:c,update:d,quadBuffer:p,frameBuffer:h}}draw(e,t,r,o,s,n,l){var c,d;if(t&&r){e.resize(),t==null||t.viewport(0,0,(c=t==null?void 0:t.canvas)==null?void 0:c.width,(d=t==null?void 0:t.canvas)==null?void 0:d.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);try{const p=t.getUniformLocation(r,"u_resolution"),h=t.getUniformLocation(r,"u_image"),g=t.getUniformLocation(r,"u_color");if(t.useProgram(r),t.uniform2f(p,t.canvas.width*e.ratio,t.canvas.height*e.ratio),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,o),t.uniform1i(h,0),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,s),t.uniform1i(g,1),l!=null&&l.uvRange&&(l!=null&&l.sRange)){const m=t.getUniformLocation(r,"u_range_u_v"),_=t.getUniformLocation(r,"u_range_s");t.uniform2f(m,l.uvRange[0],l.uvRange[1]),t.uniform2f(_,l.sRange[0],l.sRange[1])}const y=e.getBoundPixel(),f=e.map.getZoom()+1,u=e.getWorldCopy(y,f);for(const m of u){const _=(m[0]-y[0])*e.ratio,b=(m[1]-y[3])*e.ratio,L=m[2]*e.ratio,[x,w,P,N]=[_,L+_,b,L+b],I=new Float32Array([x,P,w,P,x,N,x,N,w,P,w,N]);t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,I,t.STATIC_DRAW),t.drawArrays(t.TRIANGLES,0,6)}}catch(p){console.log(`render failed...${p}`)}}}drawParticle(e,t,r,o,s){var n,l;t&&(t==null||t.viewport(0,0,(n=t==null?void 0:t.canvas)==null?void 0:n.width,(l=t==null?void 0:t.canvas)==null?void 0:l.height),t.disable(t.DEPTH_TEST),t.disable(t.STENCIL_TEST),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,r),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,o.texture0),this.renderScreen(e,t,o,s),this.updateParticles(e,t,o,s))}renderScreen(e,t,r,o){t.bindFramebuffer(t.FRAMEBUFFER,r.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r.screenTexture,0),t.viewport(0,0,t.canvas.width,t.canvas.height),this.renderScreenTexture(t,r.backgroundTexture,r.screen,r.quadBuffer,.95),this.renderParticles(e,t,r,o),t.bindFramebuffer(t.FRAMEBUFFER,null),this.renderScreenTexture(t,r.screenTexture,r.screen,r.quadBuffer,1);const s=r.backgroundTexture;r.backgroundTexture=r.screenTexture,r.screenTexture=s}renderScreenTexture(e,t,r,o,s){e&&(e.useProgram(r.program),e.bindBuffer(e.ARRAY_BUFFER,o),e.enableVertexAttribArray(r.a_pos),e.vertexAttribPointer(r.a_pos,2,e.FLOAT,!1,0,0),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t),e.uniform1i(r.u_screen,2),e.uniform1f(r.u_opacity,s),e.drawArrays(e.TRIANGLES,0,6))}renderParticles(e,t,r,o){if(t){t.useProgram(r.particle.program),t.bindBuffer(t.ARRAY_BUFFER,r.indexBuffer),t.enableVertexAttribArray(r.particle.a_index),t.vertexAttribPointer(r.particle.a_index,1,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,r.color.texture),t.uniform1i(r.particle.u_factor,0),t.uniform1i(r.particle.u_particles,1),t.uniform1i(r.particle.u_color_ramp,2),t.uniform1f(r.particle.u_particles_resolution,r.resolution*e.ratio),t.uniform1f(r.particle.u_point,e.ratio);const s=e.getBoundRange();t.uniform4f(r.particle.u_viewport,s[0],s[1],s[2],s[3]),t.uniform2f(r.particle.u_factor_min,o.uvRange[0],o.uvRange[0]),t.uniform2f(r.particle.u_factor_max,o.uvRange[1],o.uvRange[1]),t.drawArrays(t.POINTS,0,r.total)}}updateParticles(e,t,r,o){var n,l;if(t){t.bindFramebuffer(t.FRAMEBUFFER,r.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r.texture1,0),t.viewport(0,0,r.resolution,r.resolution),t.useProgram(r.update.program),t.bindBuffer(t.ARRAY_BUFFER,r.quadBuffer),t.enableVertexAttribArray(r.update.a_pos),t.vertexAttribPointer(r.update.a_pos,2,t.FLOAT,!1,0,0),t.uniform1i(r.update.u_factor,0),t.uniform1i(r.update.u_particles,1);const c=e.getBoundRange();t.uniform4f(r.update.u_viewport,c[0],c[1],c[2],c[3]),t.uniform1f(r.update.u_rand_seed,Math.random()),t.uniform2f(r.update.u_factor_res,(n=r==null?void 0:r.image)==null?void 0:n.width,(l=r==null?void 0:r.image)==null?void 0:l.height),t.uniform2f(r.update.u_factor_min,o.uvRange[0],o.uvRange[0]),t.uniform2f(r.update.u_factor_max,o.uvRange[1],o.uvRange[1]),t.uniform1f(r.update.u_speed_factor,o.speedFactor*e.ratio),t.uniform1f(r.update.u_drop_rate,o.dropRate),t.uniform1f(r.update.u_drop_rate_bump,o.dropRateBump),t.drawArrays(t.TRIANGLES,0,6)}const s=r.texture0;r.texture0=r.texture1,r.texture1=s}resize(e,t){e.resize();const r=new Uint8Array(t.canvas.width*t.canvas.height*4).fill(0,0,t.canvas.width*t.canvas.height*4),o=this.createTexture(t,t.NEAREST,t.NEAREST,t.CLAMP_TO_EDGE,r,t.canvas.width,t.canvas.height),s=this.createTexture(t,t.NEAREST,t.NEAREST,t.CLAMP_TO_EDGE,r,t.canvas.width,t.canvas.height);return{screenTexture:o,backgroundTexture:s}}async loadImg(e){return new Promise(t=>{const r=new Blob([e],{type:e.type}),o=URL.createObjectURL(r),s=new Image;s.crossOrigin="anonymous",s.src=o,s.onload=()=>t(s)})}}class T{}z(T,"vertexSchema",`
|
|
2
2
|
//canvas 坐标系上的坐标 (x, y)
|
|
3
3
|
attribute vec2 a_position; //像素坐标
|
|
4
4
|
attribute vec2 a_texCoord; //纹理坐标
|
|
@@ -201,4 +201,4 @@
|
|
|
201
201
|
<path
|
|
202
202
|
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"
|
|
203
203
|
fill="#ffffff" p-id="18386"></path>
|
|
204
|
-
</svg>`,H=document.createElement("div");H.className="hurricane-hourly-marker",H.innerHTML=`<div class="${S.geometry.coordinates[1]>=0?"center north":"center south"}">${he}</div>`;const de=new j.Marker(H).setLngLat(S.geometry.coordinates).addTo(this.map);if(this.interpolateMarkers.push(de),(ae=S.properties)!=null&&ae.showCircle){const Y={radius:100,coordinates:S.geometry.coordinates},Q={radius:200,coordinates:S.geometry.coordinates},K={radius:500,coordinates:S.geometry.coordinates};(ie=this.circleSourceData)==null||ie.features.push(v.circle(Y.coordinates,Y.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(oe=this.circleSourceData)==null||oe.features.push(v.circle(Q.coordinates,Q.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(re=this.circleSourceData)==null||re.features.push(v.circle(K.coordinates,K.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}}))}(ne=(se=this.map)==null?void 0:se.getSource(this.circleSource))==null||ne.setData(this.circleSourceData)}}else(le=this.map)!=null&&le.getSource(this.interpolateSource)&&((q=this.map)==null||q.getSource(this.interpolateSource).setData(this.empty))},handleClick(a){var s,n,l,c,d,p,h,g;const e=a.features[0],t=(n=(s=this.tropicals)==null?void 0:s.data)==null?void 0:n.features.filter(y=>{var f;return y.geometry.type==="LineString"&&y.properties.type==="forecast"&&y.properties.name===((f=e==null?void 0:e.properties)==null?void 0:f.name)});t.sort((y,f)=>{var u,m,_,b;return((u=y.properties)==null?void 0:u.model)==="cma"?-1:((m=y.properties)==null?void 0:m.model)==="jma"?((_=f.properties)==null?void 0:_.model)==="cma"?1:-1:y.properties.model==="ecmwf"?["jma","cma"].includes((b=f.properties)==null?void 0:b.model)?1:-1:0});const r=(c=(l=this.tropicals)==null?void 0:l.data)==null?void 0:c.features.filter(y=>{var f;return y.geometry.type==="LineString"&&y.properties.type==="history"&&y.properties.name===((f=e==null?void 0:e.properties)==null?void 0:f.name)});this.activeTropicals={name:(d=e==null?void 0:e.properties)==null?void 0:d.name,forecasts:t.map(y=>y.properties),history:(p=r[0])==null?void 0:p.properties,showCircle:(g=(h=t[0])==null?void 0:h.properties)==null?void 0:g.showCircle},this.showTropicals=!0;const o=document.getElementById("active-tropical");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.activeTropicalsMarker=new j.Marker(o).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([220,0]).addTo(this.map)},handleForecastToggle(a){var r,o,s,n,l,c;a.disabled=!a.disabled;const e=`${a.name}-${a.model}`,t=(o=(r=this.map)==null?void 0:r.getSource(this.source)._data)==null?void 0:o.features;t.forEach(d=>{d.properties.category===e&&(d.properties.disabled=a.disabled)}),this.interpolateData.forEach(d=>{d.properties.category===e&&(d.properties.disabled=a.disabled)}),(n=(s=this.map)==null?void 0:s.getSource(this.source))==null||n.setData(v.featureCollection(t)),(c=(l=this.map)==null?void 0:l.getSource(this.clusterSource))==null||c.setData(v.featureCollection(t)),this.handleDateChange()},handleStrikeProbability(a){this.$emit("tropicalProbability",a)},handleToggleCircles(a){var e,t;a.showCircle=!a.showCircle,(t=(e=this.tropicals.data)==null?void 0:e.features)==null||t.forEach(r=>{r.properties.name===a.name&&(r.properties.showCircle=a.showCircle)}),this.handleRender()},handleDrawCircle(){var a,e;(a=this.map)!=null&&a.getSource(this.circleSource)?(e=this.map)==null||e.getSource(this.circleSource).setData(this.circleSourceData):(this.map.addSource(this.circleSource,{type:"geojson",data:this.circleSourceData}),this.map.addLayer({id:this.circleLayer,type:"line",source:this.circleSource,filter:["all",["==","$type","Polygon"],["==","type","tropicalCircle"]],paint:{"line-color":"#fff","line-width":2,"line-opacity":1,"line-dasharray":[1,1]}}))},handleComputePolygons(a){const e=[];for(const t of a){const r=t.properties.wind,o={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},s=this.handleComputeArc(t.geometry.coordinates,o,{...t.properties,level:7});e.push(s);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},l=this.handleComputeArc(t.geometry.coordinates,n,{...t.properties,level:10});e.push(l)}return e},handleComputeArc(a,e,t){var s;const r=[];for(const n in e){const l=e[n]??0;let c;switch(n){case"ne":c=v.lineArc(a,l*1.852,0,90,{steps:l>0?64:1});break;case"se":c=v.lineArc(a,l*1.852,90,180,{steps:l>0?64:1});break;case"sw":c=v.lineArc(a,l*1.852,180,270,{steps:l>0?64:1});break;case"nw":c=v.lineArc(a,l*1.852,270,360,{steps:l>0?64:1});break}r.push(...(s=c==null?void 0:c.geometry)==null?void 0:s.coordinates)}const o=v.lineString(r);return v.lineToPolygon(o,{properties:t})}}},Ee=a=>(i.pushScopeId("data-v-f0e05b29"),a=a(),i.popScopeId(),a),ra={id:"active-tropical",class:"active-tropical"},sa={class:"header-box"},na={class:"main"},la={key:0},ca={class:"sub"},ha={id:"meteoBox",class:"main-box"},da={class:"content"},pa={class:"row"},ma={class:"col col-left",style:{"justify-content":"flex-start"}},ya=Ee(()=>i.createElementVNode("label",null,"Wind speed : ",-1)),fa={class:"col col-right",style:{"justify-content":"flex-start"}},ua=Ee(()=>i.createElementVNode("label",null,"Pressure : ",-1)),ga={class:"row"},ba={class:"col col-24",style:{"justify-content":"flex-start"}},_a=Ee(()=>i.createElementVNode("label",{style:{width:"max-content"}},"Forecast Models : ",-1)),wa={class:"forecast-models"},La=["onClick"],va=i.createStaticVNode('<div class="row" style="padding:0;height:1px;margin:10px 0;background:var(--idm-black-1);" data-v-f0e05b29></div><div class="row" style="padding:2px 10px;" data-v-f0e05b29><div class="legend" data-v-f0e05b29><div class="icon td" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>TD</div></div><div class="legend" data-v-f0e05b29><div class="icon ts" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>TS</div></div><div class="legend" data-v-f0e05b29><div class="icon sts" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>STS</div></div><div class="legend" data-v-f0e05b29><div class="icon ty" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>TY</div></div><div class="legend" data-v-f0e05b29><div class="icon sty" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>STY</div></div><div class="legend" data-v-f0e05b29><div class="icon supper-ty" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>Super TY</div></div></div><div class="row" style="padding:2px 10px;" data-v-f0e05b29><div class="legend" data-v-f0e05b29><div class="icon history" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>History</div></div><div class="legend" data-v-f0e05b29><div class="icon r7" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>35kts Radii</div></div><div class="legend" data-v-f0e05b29><div class="icon r10" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>50kts Radii</div></div></div>',3),xa={class:"more"};function Ca(a,e,t,r,o,s){var n,l,c,d,p,h,g,y,f,u,m,_,b,L,x;return i.withDirectives((i.openBlock(),i.createElementBlock("div",ra,[i.createElementVNode("div",sa,[i.createElementVNode("div",{class:"iconfont close-btn",onClick:e[0]||(e[0]=w=>o.showTropicals=!1)},""),i.createElementVNode("div",na,[(l=(n=o.activeTropicals)==null?void 0:n.history)!=null&&l.level?(i.openBlock(),i.createElementBlock("span",la,i.toDisplayString((d=(c=o.activeTropicals)==null?void 0:c.history)==null?void 0:d.level)+" , ",1)):i.createCommentVNode("",!0),i.createTextVNode(i.toDisplayString((p=o.activeTropicals)==null?void 0:p.name),1)]),i.createElementVNode("div",ca," Last update: "+i.toDisplayString(s.computeTime(((g=(h=o.activeTropicals)==null?void 0:h.history)==null?void 0:g.updated)||((u=(f=(y=o.activeTropicals)==null?void 0:y.forecasts)==null?void 0:f.filter(w=>!w.disabled)[0])==null?void 0:u.date))),1)]),i.createElementVNode("div",ha,[i.createElementVNode("div",da,[i.createElementVNode("div",pa,[i.createElementVNode("div",ma,[ya,i.createElementVNode("span",null,i.toDisplayString(((_=(m=o.activeTropicals)==null?void 0:m.history)==null?void 0:_.kts)||"-")+"[kts]",1)]),i.createElementVNode("div",fa,[ua,i.createElementVNode("span",null,i.toDisplayString(((L=(b=o.activeTropicals)==null?void 0:b.history)==null?void 0:L.pressure)||"-")+"[hPa]",1)])]),i.createElementVNode("div",ga,[i.createElementVNode("div",ba,[_a,i.createElementVNode("div",wa,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList((x=o.activeTropicals)==null?void 0:x.forecasts,(w,P)=>{var N,I,R,D;return i.openBlock(),i.createElementBlock("div",{key:P,class:i.normalizeClass(["model",w.disabled?"":"active",P>0&&P<((I=(N=o.activeTropicals)==null?void 0:N.forecasts)==null?void 0:I.length)-1&&((D=(R=o.activeTropicals)==null?void 0:R.forecasts)==null?void 0:D.length)>2?"center-child":""]),onClick:B=>s.handleForecastToggle(w)},[i.createElementVNode("span",{class:i.normalizeClass(w.model)},i.toDisplayString(w.model),3)],10,La)}),128))])])]),va]),i.createElementVNode("div",xa,[i.createElementVNode("div",{class:"button",onClick:e[1]||(e[1]=w=>s.handleStrikeProbability(o.activeTropicals))},"Strike Probability >>")])])],512)),[[i.vShow,o.showTropicals&&!a.$attrs.hideTropicalsLegend]])}const ze=k(oa,[["render",Ca],["__scopeId","data-v-f0e05b29"]]),pr="",ka={name:"IdmPrecip3h",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[precip3h] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(59, 126, 162, 0)"],[14/255,"rgba(84,170,230, 0)"],[15/255,"rgba(172, 210, 255, 0.8)"],[20/255,"rgba(51,202,248,0.8)"],[30/255,"rgba(3,248,103,0.8)"],[49/255,"rgba(14,201,3,0.8)"],[57/255,"rgba(190,226,2,0.8)"],[73/255,"rgba(248,1,1,0.8)"],[82/255,"rgba(197,5,58,0.8)"],[1,"rgba(197,5,58,0.8)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},J=a=>(i.pushScopeId("data-v-9708a7a3"),a=a(),i.popScopeId(),a),Sa={key:0},Ea=[J(()=>i.createElementVNode("span",null,"mm",-1)),J(()=>i.createElementVNode("span",null,"1.5",-1)),J(()=>i.createElementVNode("span",null,"2",-1)),J(()=>i.createElementVNode("span",null,"3",-1)),J(()=>i.createElementVNode("span",null,"7",-1)),J(()=>i.createElementVNode("span",null,"10",-1)),J(()=>i.createElementVNode("span",null,"20",-1)),J(()=>i.createElementVNode("span",null,"30",-1))];function za(a,e,t,r,o,s){var n;return(n=t.factor)!=null&&n.active?(i.openBlock(),i.createElementBlock("div",Sa,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:t.bottom}])},Ea,4)])):i.createCommentVNode("",!0)}const Pa=k(ka,[["render",za],["__scopeId","data-v-9708a7a3"]]),Lr="",Na={name:"IdmVisibility",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[visibility] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(189,50,160,0.8)"],[8/255,"rgba(208,56,56,0.8)"],[27/255,"rgba(190,226,2,0.8)"],[60/255,"rgba(3,236,118,0.8)"],[160/255,"rgba(172, 210,255,0.8)"],[161/255,"rgba(172, 210,255,0)"],[1,"rgba(144,144,144,0)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ye=a=>(i.pushScopeId("data-v-f7b2fb08"),a=a(),i.popScopeId(),a),Ta={key:0},Ia=[ye(()=>i.createElementVNode("span",null,"nm",-1)),ye(()=>i.createElementVNode("span",null,"0",-1)),ye(()=>i.createElementVNode("span",null,"0.5",-1)),ye(()=>i.createElementVNode("span",null,"1.5",-1)),ye(()=>i.createElementVNode("span",null,"3",-1)),ye(()=>i.createElementVNode("span",null,"9",-1))];function Va(a,e,t,r,o,s){var n;return(n=t.factor)!=null&&n.active?(i.openBlock(),i.createElementBlock("div",Ta,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:a.right+"px",bottom:t.bottom}])},Ia,4)])):i.createCommentVNode("",!0)}const Ra=k(Na,[["render",Va],["__scopeId","data-v-f7b2fb08"]]),zr="",Da={name:"IdmWaterTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(95, 143, 197)"],[46/255,"rgba(95, 143, 197)"],[69/255,"rgb(80, 140, 62)"],[92/255,"rgb(121, 146, 28)"],[115/255,"rgb(171, 161, 14)"],[138/255,"rgb(223, 177, 69)"],[161/255,"rgb(243, 150, 6)"],[184/255,"rgb(236, 95, 21)"],[207/255,"rgb(190, 65, 18)"],[230/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},fe=a=>(i.pushScopeId("data-v-7521f582"),a=a(),i.popScopeId(),a),$a={key:0},Aa=[fe(()=>i.createElementVNode("span",null,"°C",-1)),fe(()=>i.createElementVNode("span",null,"0",-1)),fe(()=>i.createElementVNode("span",null,"10",-1)),fe(()=>i.createElementVNode("span",null,"20",-1)),fe(()=>i.createElementVNode("span",null,"30",-1)),fe(()=>i.createElementVNode("span",null,"40",-1))];function Ba(a,e,t,r,o,s){var n;return(n=t.factor)!=null&&n.active?(i.openBlock(),i.createElementBlock("div",$a,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:t.bottom}])},Aa,4)])):i.createCommentVNode("",!0)}const Ma=k(Da,[["render",Ba],["__scopeId","data-v-7521f582"]]),Dr="",ja={name:"IdmTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgb(149, 137, 211)"],[100/255,"rgb(149, 137, 211)"],[110/255,"rgb(150, 209, 216)"],[120/255,"rgb(129, 204, 197)"],[130/255,"rgb(103, 180, 186)"],[140/255,"rgb(95, 143, 197)"],[150/255,"rgb(80, 140, 62)"],[160/255,"rgb(121, 146, 28)"],[170/255,"rgb(171, 161, 14)"],[180/255,"rgb(223, 177, 6)"],[190/255,"rgb(243, 150, 6)"],[200/255,"rgb(236, 95, 21)"],[210/255,"rgb(190, 65, 18)"],[220/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},X=a=>(i.pushScopeId("data-v-25daaa82"),a=a(),i.popScopeId(),a),Oa={key:0},Wa=[X(()=>i.createElementVNode("span",null,"°C",-1)),X(()=>i.createElementVNode("span",null,"-20",-1)),X(()=>i.createElementVNode("span",null,"-10",-1)),X(()=>i.createElementVNode("span",null,"0",-1)),X(()=>i.createElementVNode("span",null,"10",-1)),X(()=>i.createElementVNode("span",null,"20",-1)),X(()=>i.createElementVNode("span",null,"30",-1)),X(()=>i.createElementVNode("span",null,"40",-1))];function Fa(a,e,t,r,o,s){var n;return(n=t.factor)!=null&&n.active?(i.openBlock(),i.createElementBlock("div",Oa,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:t.bottom}])},Wa,4)])):i.createCommentVNode("",!0)}const Ha=k(ja,[["render",Fa],["__scopeId","data-v-25daaa82"]]),Hr="",Ua={name:"IdmArctic",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(76, 165, 228, 0)"],[50/255,"rgba(76, 165, 228, 0)"],[51/255,"rgb(76, 165, 228)"],[102/255,"rgb(129, 204, 197)"],[153/255,"rgb(150, 209, 216)"],[204/255,"rgb(180, 209, 216)"],[1,"rgb(180, 209, 216)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ue=a=>(i.pushScopeId("data-v-5bb73794"),a=a(),i.popScopeId(),a),Za={key:0},Ga=[ue(()=>i.createElementVNode("span",null,"m",-1)),ue(()=>i.createElementVNode("span",null,"0",-1)),ue(()=>i.createElementVNode("span",null,"0.5",-1)),ue(()=>i.createElementVNode("span",null,"1",-1)),ue(()=>i.createElementVNode("span",null,"1.5",-1)),ue(()=>i.createElementVNode("span",null,"2",-1))];function Ja(a,e,t,r,o,s){var n;return(n=t.factor)!=null&&n.active?(i.openBlock(),i.createElementBlock("div",Za,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:t.bottom}])},Ga,4)])):i.createCommentVNode("",!0)}const Xa=k(Ua,[["render",Ja],["__scopeId","data-v-5bb73794"]]),Yr="",qa={name:"IdmPoint",emits:["point","more"],props:{map:{type:Object},show:{type:Boolean},timeZone:{type:Number,default:0},meteo:{type:Object}},data(){return{showMeteo:!1,meteoMarker:void 0,helper:ge}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){this.map&&this.show&&this.handleBind()}},meteo:{handler(){this.meteo?(this.showMeteo=!0,this.handleRender()):this.showMeteo=!1}}},computed:{computeTime(){return function(a){if(a){const e=A(a).utc().utcOffset(this.timeZone),t=this.timeZone<0?this.timeZone:"+"+this.timeZone;return`${e.format("MMM-DD,HHmm")} ( UTC ${t} )`}return"-"}},computeLat(){return function(a,e=4){return C.LngLatHelper.lat2pretty(a,e).pretty}},computeLng(){return function(a,e=4){return C.LngLatHelper.lng2pretty(a,e).pretty}},roundPrecision(){return function(a,e=4){return isNaN(a)?"-":C.LngLatHelper.roundPrecision(a,e)}}},methods:{handleBind(){var a,e;this.show?(a=this.map)==null||a.on("click",this.handleClick):((e=this.map)==null||e.off("click",this.handleClick),this.showMeteo=!1)},handleClick(a){a.originalEvent.stopPropagation();const e=a.originalEvent.target.className;e.indexOf("close")>-1?this.showMeteo=!1:e==="more"?this.$emit("more",this.meteo):this.$emit("point",a.lngLat)},handleRender(){var a;if(this.meteo){const e=document.getElementById("point-meteo");this.meteoMarker?(a=this.meteoMarker)==null||a.setLngLat([this.meteo.lng,this.meteo.lat]):this.meteoMarker=new j.Marker(e).setLngLat([this.meteo.lng,this.meteo.lat]).addTo(this.map)}}}},O=a=>(i.pushScopeId("data-v-efcf572f"),a=a(),i.popScopeId(),a),Ya={id:"point-meteo",class:"point-meteo"},Qa={class:"meteo-box"},Ka={class:"header-box"},ei={class:"main"},ti={class:"sub"},ai={class:"main-box"},ii={class:"flex-space"},oi=O(()=>i.createElementVNode("label",null,"Wind",-1)),ri={class:"flex-space"},si=O(()=>i.createElementVNode("label",null,"Wind.Wave",-1)),ni={class:"flex-space"},li=O(()=>i.createElementVNode("label",null,"Swell",-1)),ci={class:"flex-space"},hi=O(()=>i.createElementVNode("label",null,"Sig.Wave",-1)),di={class:"flex-space"},pi=O(()=>i.createElementVNode("label",null,"Current",-1)),mi={class:"flex-space"},yi=O(()=>i.createElementVNode("label",null,"Precip",-1)),fi={class:"flex-space"},ui=O(()=>i.createElementVNode("label",null,"Visibility",-1)),gi={class:"flex-space"},bi=O(()=>i.createElementVNode("label",null,"Temp",-1)),_i={class:"flex-space"},wi=O(()=>i.createElementVNode("label",null,"Water Temp",-1));function Li(a,e,t,r,o,s){var n,l,c,d,p,h,g,y,f,u,m,_,b,L,x,w,P,N,I,R,D,B,ae,ie,oe,re,se,ne,le,q,M,W,ce,F,S,$,he,H,de,Y,Q,K,_e,we,Le,ve,xe;return i.withDirectives((i.openBlock(),i.createElementBlock("div",Ya,[i.createElementVNode("div",Qa,[i.createElementVNode("div",Ka,[i.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=Ne=>o.showMeteo=!1)},""),i.createElementVNode("div",ei,i.toDisplayString(s.computeLat((n=t.meteo)==null?void 0:n.lat))+","+i.toDisplayString(s.computeLng((l=t.meteo)==null?void 0:l.lng)),1),i.createElementVNode("div",ti,i.toDisplayString(s.computeTime((c=t.meteo)==null?void 0:c.utc)),1)]),i.createElementVNode("div",ai,[i.createElementVNode("div",ii,[oi,i.createElementVNode("span",null,i.toDisplayString(((p=(d=t.meteo)==null?void 0:d.wind)==null?void 0:p.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((g=(h=t.meteo)==null?void 0:h.wind)==null?void 0:g.kts,1))+"[kts]/"+i.toDisplayString((f=(y=t.meteo)==null?void 0:y.wind)==null?void 0:f.scale)+"[BF]/"+i.toDisplayString(s.roundPrecision((m=(u=t.meteo)==null?void 0:u.gusts)==null?void 0:m.kts,1))+"[kts]",1)]),i.createElementVNode("div",ri,[si,i.createElementVNode("span",null,i.toDisplayString(((L=(b=(_=t.meteo)==null?void 0:_.wave)==null?void 0:b.wd)==null?void 0:L.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((P=(w=(x=t.meteo)==null?void 0:x.wave)==null?void 0:w.wd)==null?void 0:P.height,1))+"[m]/"+i.toDisplayString(s.roundPrecision((R=(I=(N=t.meteo)==null?void 0:N.wave)==null?void 0:I.wd)==null?void 0:R.period,1))+"[s]",1)]),i.createElementVNode("div",ni,[li,i.createElementVNode("span",null,i.toDisplayString(((ae=(B=(D=t.meteo)==null?void 0:D.wave)==null?void 0:B.swell)==null?void 0:ae.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((re=(oe=(ie=t.meteo)==null?void 0:ie.wave)==null?void 0:oe.swell)==null?void 0:re.height,1))+"[m]/"+i.toDisplayString(s.roundPrecision((le=(ne=(se=t.meteo)==null?void 0:se.wave)==null?void 0:ne.swell)==null?void 0:le.period,1))+"[s]",1)]),i.createElementVNode("div",ci,[hi,i.createElementVNode("span",null,i.toDisplayString(((W=(M=(q=t.meteo)==null?void 0:q.wave)==null?void 0:M.sig)==null?void 0:W.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((S=(F=(ce=t.meteo)==null?void 0:ce.wave)==null?void 0:F.sig)==null?void 0:S.height,1))+"[m]/"+i.toDisplayString(s.roundPrecision((H=(he=($=t.meteo)==null?void 0:$.wave)==null?void 0:he.sig)==null?void 0:H.period,1))+"[s]",1)]),i.createElementVNode("div",di,[pi,i.createElementVNode("span",null,i.toDisplayString(((Y=(de=t.meteo)==null?void 0:de.current)==null?void 0:Y.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((K=(Q=t.meteo)==null?void 0:Q.current)==null?void 0:K.kts,2))+"[kts]",1)]),i.createElementVNode("div",mi,[yi,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision((we=(_e=t.meteo)==null?void 0:_e.precip)==null?void 0:we.inter6h,2))+"[mm]",1)]),i.createElementVNode("div",fi,[ui,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision(((Le=t.meteo)==null?void 0:Le.visibility)/1852,0))+"[nm]",1)]),i.createElementVNode("div",gi,[bi,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision((ve=t.meteo)==null?void 0:ve.temp,0))+"[°C]",1)]),i.createElementVNode("div",_i,[wi,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision((xe=t.meteo)==null?void 0:xe.waterTemp,2))+"[°C]",1)])]),i.createCommentVNode("",!0)])],512)),[[i.vShow,o.showMeteo]])}const vi=k(qa,[["render",Li],["__scopeId","data-v-efcf572f"]]),xi={name:"IdmWarZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"war-zone-source",zoneLayer:"war-zone-layer",zoneLabelLayer:"war-zone-label-layer"}},watch:{zone:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-color":"#f44336","fill-opacity":.4}},this.beforeLayer),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"#f44336"}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-1]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLayer+"-border")&&this.map.removeLayer(this.zoneLayer+"-border"),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ci(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const ki=k(xi,[["render",Ci]]),Si={name:"IdmGmdssArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"gmdss-area-source",areaLayer:"gmdss-area-layer",areaLabelLayer:"gmdss-area-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["match",["get","val"],"AreaI","#EB8996","AreaII","#6F448B","AreaIII","#3E8BD3","AreaIV","#5EBCC4","AreaV","#00AAE7","AreaVI","#9CCE6D","AreaVII","#F4AE00","AreaVIII","#EF9A85","AreaIX","#00AAA7","AreaX","#7AC49F","AreaXI","#DFDFDF","AreaXII","#FFF974","AreaXIII","#EF9A85","AreaXIV","#86A2D1","AreaXV","#EC8972","AreaXVI","#EAC2DA","AreaXVII","#B9C8E7","AreaXVIII","#BBA1C8","AreaXIX","#FAE0BD","AreaXX","#DBECC8","AreaXXI","#D496AF","#ffffff"]}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-opacity":.8,"text-color":"#000"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ei(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const zi=k(Si,[["render",Ei]]),Pi={name:"IdmEcaZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"eca-zone-source",zoneLayer:"eca-zone-layer",zoneLabelLayer:"eca-zone-label-layer"}},watch:{zone:{handler(){this.zone?this.handleRender():this.handleClear()}}},methods:{handleRender(){var a;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.zone):(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":"#05f324"}}),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-color":"#04c021","line-width":1,"line-opacity":1}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-max-width":16,"text-justify":"left","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLayer+"-border")&&this.map.removeLayer(this.zoneLayer+"-border"),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ni(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Ti=k(Pi,[["render",Ni]]),Qr="",Ii={name:"IdmAlertZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"alert-zone-source",polygonLayer:"alert-zone-polygon-layer",polygonLabelLayer:"alert-zone-polygon-label-layer",lineLayer:"alert-zone-line-layer",lineLabelLayer:"alert-zone-line-label-layer",pointLayer:"alert-zone-point-layer",showZone:!1,form:{}}},watch:{zone:{handler(){var a,e;this.zone?(this.handleRender(),(a=this.map)==null||a.on("click",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleClick))}}},methods:{handleClick(a){var r;const e=a.features[0],t=(r=this.zone)==null?void 0:r.features.filter(o=>{var s;return o.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];if(t){this.showZone=!0,this.form={...t.properties};const o=document.getElementById("idm-gl3-zone-info");this.marker?this.marker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.marker=new j.Marker(o).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([0,0]).addTo(this.map)}},handleRender(){var a;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.zone):(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.polygonLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"fill-outline-color":"#d57d02","fill-opacity":.4,"fill-color":"#d57d02"}}),this.map.addLayer({id:this.polygonLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-width":1,"line-color":"#d57d02"}}),this.map.addLayer({id:this.lineLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],paint:{"line-color":"#d57d02","line-width":2}}),this.map.addLayer({id:this.polygonLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"alert","icon-size":.08,"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}}),this.map.addLayer({id:this.lineLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],layout:{"symbol-placement":"line-center","icon-image":"alert","icon-size":.08,"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}}),this.map.addLayer({id:this.pointLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"alert","icon-size":.08},paint:{"icon-opacity":.8}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.polygonLayer)&&this.map.removeLayer(this.polygonLayer),this.map.getLayer(this.polygonLayer+"-border")&&this.map.removeLayer(this.polygonLayer+"-border"),this.map.getLayer(this.polygonLabelLayer)&&this.map.removeLayer(this.polygonLabelLayer),this.map.getLayer(this.lineLayer)&&this.map.removeLayer(this.lineLayer),this.map.getLayer(this.lineLabelLayer)&&this.map.removeLayer(this.lineLabelLayer),this.map.getLayer(this.pointLayer)&&this.map.removeLayer(this.pointLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},Vi={id:"idm-gl3-zone-info"},Ri=["innerHTML"];function Di(a,e,t,r,o,s){var n;return i.withDirectives((i.openBlock(),i.createElementBlock("div",Vi,[i.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=l=>o.showZone=!1)},""),i.createElementVNode("div",{class:"rich-context",innerHTML:(n=o.form)==null?void 0:n.name},null,8,Ri)],512)),[[i.vShow,o.showZone]])}const $i=k(Ii,[["render",Di]]),Kr="",Ai={name:"IdmPort",props:{map:{type:Object},port:{type:Object},beforeLayer:{type:String}},emits:["port"],data(){return{source:"port-source",layer:"port-layer",showPort:!1,form:{},marker:void 0}},computed:{computeLat(){return function(a){return C.LngLatHelper.lat2pretty(a,4).pretty}},computeLng(){return function(a){return C.LngLatHelper.lng2pretty(a,4).pretty}}},watch:{port:{handler(){var a,e;this.port?(this.handleRender(),(a=this.map)==null||a.on("click",[this.layer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.layer],this.handleClick))}}},methods:{handleClick(a){var r;const e=a.features[0],t=(r=this.port)==null?void 0:r.features.filter(o=>{var s;return o.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];if(t){this.showPort=!0,this.form={...t.properties},this.form.lng=t.geometry.coordinates[0],this.form.lat=t.geometry.coordinates[1];const o=document.getElementById("port-info");this.marker?this.marker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.marker=new j.Marker(o).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([0,-85]).addTo(this.map)}},handleEmit(){this.$emit("port",this.form)},handleRender(){var a;this.map?this.port&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.port):(this.map.addSource(this.source,{type:"geojson",data:this.port}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"port","text-anchor":"left","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[1,0]},paint:{"text-color":"rgba(0, 0, 0, 0.8)","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.showPort=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},ke=a=>(i.pushScopeId("data-v-c07e4c45"),a=a(),i.popScopeId(),a),Bi={id:"port-info"},Mi={class:"port-box"},ji={class:"flex-start"},Oi=ke(()=>i.createElementVNode("label",null,"Name : ",-1)),Wi={class:"flex-start"},Fi=ke(()=>i.createElementVNode("label",null,"Position : ",-1)),Hi={class:"flex-start"},Ui=ke(()=>i.createElementVNode("label",null,"LoCode : ",-1)),Zi={class:"flex-start",style:{"align-items":"flex-start"}},Gi=ke(()=>i.createElementVNode("label",null,"Region : ",-1));function Ji(a,e,t,r,o,s){return i.withDirectives((i.openBlock(),i.createElementBlock("div",Bi,[i.createElementVNode("div",{class:"close iconfont",onClick:e[0]||(e[0]=n=>o.showPort=!1)},""),i.createElementVNode("div",Mi,[i.createElementVNode("div",ji,[Oi,i.createElementVNode("span",{onClick:e[1]||(e[1]=(...n)=>s.handleEmit&&s.handleEmit(...n))},i.toDisplayString(o.form.name),1)]),i.createElementVNode("div",Wi,[Fi,i.createElementVNode("span",null,i.toDisplayString(s.computeLat(o.form.lat))+", "+i.toDisplayString(s.computeLng(o.form.lng)),1)]),i.createElementVNode("div",Hi,[Ui,i.createElementVNode("span",null,i.toDisplayString(o.form.loCode||"-"),1)]),i.createElementVNode("div",Zi,[Gi,i.createElementVNode("span",null,i.toDisplayString(o.form.zoneName||"-"),1)])])],512)),[[i.vShow,o.showPort]])}const Xi=k(Ai,[["render",Ji],["__scopeId","data-v-c07e4c45"]]),qi={name:"IdmLoadLine",props:{map:{type:Object},line:{type:Object},beforeLayer:{type:String}},data(){return{source:"load-line-source",lineLayer:"load-line-layer",lineLabelLayer:"load-line-label-layer"}},watch:{line:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.line&&(this.map.addSource(this.source,{type:"geojson",data:this.line}),this.map.addLayer({id:this.lineLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.75,"fill-color":["match",["get","val"],"LLGreen","#A0C0C0","LLRed","#F5A39D","LLBlue","#6B94E4","#ffffff"]}},this.beforeLayer),this.map.addLayer({id:this.lineLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{lbl} (Length < {shipLength}, {start} - {end})","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":.8}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.lineLayer)&&this.map.removeLayer(this.lineLayer),this.map.getLayer(this.lineLabelLayer)&&this.map.removeLayer(this.lineLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Yi(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Qi=k(qi,[["render",Yi]]),Ki={name:"IdmTimezone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"time-zone-source",zoneLayer:"time-zone-layer",zoneLabelLayer:"time-zone-label-layer"}},watch:{zone:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["match",["get","offSet"],"-11.5","rgba(255,0,0,0.4)","-11","rgba(0,255,0,0.3)","-10.5","rgba(0,255,0,0.3)","-10","rgba(0,0,255,0.3)","-9.5","rgba(0,0,255,0.3)","-9","rgba(255,0,0,0.4)","-8.5","rgba(255,0,0,0.4)","-8","rgba(0,255,0,0.3)","-7.5","rgba(0,255,0,0.3)","-7","rgba(0,0,255,0.3)","-6.5","rgba(0,0,255,0.3)","-6","rgba(255,0,0,0.4)","-5.5","rgba(255,0,0,0.4)","-5","rgba(0,255,0,0.3)","-4.5","rgba(0,255,0,0.3)","-4","rgba(0,0,255,0.3)","-3.5","rgba(0,0,255,0.3)","-3","rgba(255,0,0,0.4)","-2.5","rgba(255,0,0,0.4)","-2","rgba(0,255,0,0.3)","-1.5","rgba(0,255,0,0.3)","-1","rgba(0,0,255,0.3)","-0.5","rgba(0,0,255,0.3)","+0","rgba(255,0,0,0.4)","+0.5","rgba(255,0,0,0.4)","+1","rgba(0,255,0,0.3)","+1.5","rgba(0,255,0,0.3)","+2","rgba(0,0,255,0.3)","+2.5","rgba(0,0,255,0.3)","+3","rgba(255,0,0,0.4)","+3.5","rgba(255,0,0,0.4)","+4","rgba(0,255,0,0.3)","+4.5","rgba(0,255,0,0.3)","+5","rgba(0,0,255,0.3)","+5.5","rgba(0,0,255,0.3)","+6","rgba(255,0,0,0.4)","+6.5","rgba(255,0,0,0.4)","+7","rgba(0,255,0,0.3)","+7.5","rgba(0,255,0,0.3)","+8","rgba(0,0,255,0.3)","+8.5","rgba(0,0,255,0.3)","+9","rgba(255,0,0,0.4)","+9.5","rgba(255,0,0,0.4)","+10","rgba(0,255,0,0.3)","+10.5","rgba(0,255,0,0.3)","+11","rgba(0,0,255,0.3)","+11.5","rgba(0,0,255,0.3)","rgba(255,0,0,0.4)"]}}),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{offSet}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,1]},paint:{"text-opacity":.8,"text-color":"#fff"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function eo(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const to=k(Ki,[["render",eo]]),ao={name:"IdmVoluntaryReportingArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"vra-source",areaLayer:"vra-layer",areaLabelLayer:"vra-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":"#9f30f9"}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"#9f30f9"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function io(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const oo=k(ao,[["render",io]]),ro={name:"IdmSpecialArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"special-area-source",areaLayer:"special-area-layer",areaLabelLayer:"special-area-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.area.features.forEach(a=>{a.geometry.type==="Polygon"&&a.geometry.coordinates.forEach(e=>C.LngLatHelper.convertToMonotonicLng2(e))}),this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":["match",["get","val"],"DefaultStyle","rgb(0,0,0)","JWCriskArea","rgb(0,0,0)","rgb(0,0,0)"]}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":.4,"line-color":"rgb(0,0,0)"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function so(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const no=k(ro,[["render",so]]),lo={name:"IdmTerminator",props:{map:{type:Object},area:{type:Object}},data(){return{source:"terminator-source",layer:"terminator-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.layer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":"rgba(0, 0, 0, 0.4)"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function co(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const ho=k(lo,[["render",co]]),es="",po={name:"IdmLatLng",props:{map:{type:Object},show:{type:Boolean},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{lngLat:void 0,source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var a;this.map&&((a=this.map)==null||a.on("mousemove",this.handleMouseMove))},immediate:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("legend-bars")[0])==null?void 0:a.clientWidth)||-10)+(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+20},immediate:!0}},methods:{handleBind(){var a,e;this.show?((a=this.map)==null||a.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(a){const e=a.lngLat,t=C.LngLatHelper.lng2pretty(e.lng,2),r=C.LngLatHelper.lat2pretty(e.lat,2);this.lngLat={lng:t,lat:r}},handleComputeLatLngs(){var r;const a=(r=this.map)==null?void 0:r.getZoom();console.log(a);let e=30;a>4?e=10:a>3&&(e=15);const t=[];for(let o=-60;o<90;o+=e)t.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,o],[180,o]]}});for(let o=-180;o<180;o+=e)t.push({type:"Feature",geometry:{type:"LineString",coordinates:[[o,-90],[o,90]]}});for(let o=180;o>-180;o-=e)for(let s=-60;s<90;s+=e)t.push({type:"Feature",geometry:{type:"Point",coordinates:[o,s]},properties:{val:`${s>0?s+" N":s===0?s:s*-1+" S"}, ${o>0?o+" E":o*-1+" W"}`}});return t},handleZoomEnd(){var e;const a=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(v.featureCollection(a))},handleRender(){if(this.map){const a=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:a}}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"rgba(0, 0, 0, 0.3)","line-width":1}}),this.map.addLayer({id:this.labelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{val}","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":.8}})}},handleClear(){var a,e,t,r,o,s;(a=this.map)!=null&&a.getLayer(this.layer)&&((e=this.map)==null||e.removeLayer(this.layer)),(t=this.map)!=null&&t.getLayer(this.labelLayer)&&((r=this.map)==null||r.removeLayer(this.labelLayer)),(o=this.map)!=null&&o.getSource(this.source)&&((s=this.map)==null||s.removeSource(this.source))}}},mo=(a=>(i.pushScopeId("data-v-73241fe7"),a=a(),i.popScopeId(),a))(()=>i.createElementVNode("span",null,", ",-1));function yo(a,e,t,r,o,s){return o.lngLat?(i.openBlock(),i.createElementBlock("div",{key:0,class:"lat-lng-tip",style:i.normalizeStyle({right:o.right+"px",bottom:t.bottom})},[i.createElementVNode("span",null,i.toDisplayString(o.lngLat.lat.pretty),1),mo,i.createElementVNode("span",null,i.toDisplayString(o.lngLat.lng.pretty),1)],4)):i.createCommentVNode("",!0)}const Pe=k(po,[["render",yo],["__scopeId","data-v-73241fe7"]]),fo={name:"IdmMeasure",props:{map:{type:Object},show:{type:Boolean}},data(){return{geojson:[],source:"measure-source",layer:"measure-layer",labelLayer:"measure-label-layer",tmpSource:"measure-tmp-source",tmpLayer:"measure-tmp-layer",tmpLabelLayer:"measure-tmp-label-layer",closeMarkers:{},pointMarkers:{},tipMarker:void 0,contextmenu:void 0,navigation:"RL"}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){this.map&&this.handleBind()}}},methods:{handleBind(){var a,e,t,r,o,s,n,l,c,d;if(this.show)(a=this.map)==null||a.getCanvas().addEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.on("mousemove",this.handleMove),(t=this.map)==null||t.on("dblclick",this.handleDblClick),(r=this.map)==null||r.on("click",this.handleClick),(o=this.map)==null||o.on("contextmenu",this.handleContextmenu),this.map&&(this.map.getCanvas().style.cursor="crosshair");else{(s=this.map)==null||s.getCanvas().removeEventListener("keydown",this.handleKeydown),(n=this.map)==null||n.off("mousemove",this.handleMove),(l=this.map)==null||l.off("dblclick",this.handleDblClick),(c=this.map)==null||c.off("click",this.handleClick),(d=this.map)==null||d.off("contextmenu",this.handleContextmenu);for(const p of this.geojson)this.handleClear(p,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")}},handleKeydown(a){if(a.key==="Shift"){this.navigation=this.navigation==="RL"?"GC":"RL";const t=this.geojson.at(-1).features.filter(r=>r.geometry.type==="Point");t.length&&(t.at(-1).properties.mode=this.navigation)}},handleDrag(a){var t,r,o,s,n,l,c,d,p,h;const e=(r=(t=a.target)==null?void 0:t._element)==null?void 0:r.id;if((e==null?void 0:e.split("-").length)===2){const g=this.geojson.filter(m=>m.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(m=>{var _;return((_=m._element)==null?void 0:_.id)===e})[0].setLngLat([(s=(o=a.target)==null?void 0:o._lngLat)==null?void 0:s.lng,(l=(n=a.target)==null?void 0:n._lngLat)==null?void 0:l.lat]);let f;g.features.forEach((m,_)=>{if(m.geometry.type==="Point"&&m.properties.id==e.split("-")[1]){f=_;return}});const u=g.features.filter(m=>m.geometry.type==="Point");this.handleTmpPointUpdate(g,u[f-1],{lng:(d=(c=a.target)==null?void 0:c._lngLat)==null?void 0:d.lng,lat:(h=(p=a.target)==null?void 0:p._lngLat)==null?void 0:h.lat,properties:u[f].properties},f===u.length-1?void 0:u[f+1])}},handleDragEnd(a){var t,r,o,s,n,l,c,d,p,h;const e=(r=(t=a.target)==null?void 0:t._element)==null?void 0:r.id;if((e==null?void 0:e.split("-").length)===2){const g=this.geojson.filter(u=>u.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(u=>{var m;return((m=u._element)==null?void 0:m.id)===e})[0].setLngLat([(s=(o=a.target)==null?void 0:o._lngLat)==null?void 0:s.lng,(l=(n=a.target)==null?void 0:n._lngLat)==null?void 0:l.lat]);const f=g.features.filter(u=>u.geometry.type==="Point"&&u.properties.id==e.split("-")[1])[0];f.geometry.coordinates=[(d=(c=a.target)==null?void 0:c._lngLat)==null?void 0:d.lng,(h=(p=a.target)==null?void 0:p._lngLat)==null?void 0:h.lat],g.features=g.features.filter(u=>u.geometry.type==="Point"),this.handlePointUpdate(g)}},handleContextmenu(a){var t,r,o,s;a.preventDefault(),(t=this.contextmenu)==null||t.remove();const e=(s=(o=(r=a.originalEvent)==null?void 0:r.target)==null?void 0:o.parentElement)==null?void 0:s.id;if((e==null?void 0:e.split("-").length)===2){const l=this.geojson.filter(c=>c.id===e.split("-")[0])[0].features.filter(c=>c.geometry.type==="Point");if(l.length>2&&l.filter(d=>d.properties.id===(e==null?void 0:e.split("-")[1]))[0]){const d=document.createElement("div");d.className="point-contextmenu-marker",d.innerHTML=`<span id="del-${e}" class="del-point">Del</span>`,this.contextmenu=new j.Marker(d).setOffset([24,0]).setLngLat([a.lngLat.lng,a.lngLat.lat]).addTo(this.map)}}},handleClick(a){var t,r,o,s,n;(t=this.contextmenu)==null||t.remove();const e=a.originalEvent.target.className;if(e==="marker-close"){const l=(o=(r=a.originalEvent)==null?void 0:r.srcElement)==null?void 0:o.id,c=this.geojson.filter(d=>d.id===l)[0];c&&this.handleClear(c,!0),this.geojson=this.geojson.filter(d=>d.id!==l)}else if(e==="del-point"){const l=(n=(s=a.originalEvent.target.id)==null?void 0:s.replace("del-",""))==null?void 0:n.split("-"),c=this.geojson.filter(d=>d.id===l[0])[0];c.features=c.features.filter(d=>d.geometry.type==="Point"&&d.properties.id!==l[1]),this.handlePointUpdate(c)}else if(e!=="marker-label"){let l=this.geojson.at(-1);l||(l=v.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(l)),l.features=l.features.filter(d=>d.geometry.type==="Point");const c=v.feature({type:"Point",coordinates:[a.lngLat.lng,a.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation});l.features.push(c),this.handlePointUpdate(l)}},handlePointUpdate(a){const e=a.features;if(e.length>1){let t=0;const r=[];for(let o=1;o<e.length;o++){const s=e[o-1],n=e[o],l=s.properties,c={lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1]},d={lng:n.geometry.coordinates[0],lat:n.geometry.coordinates[1]},p=C.LaneHelper.calculateDistance(c,d,l.mode==="RL",2),h=C.LaneHelper.calculateBearing(c,d,l.mode==="RL",2);t=C.LngLatHelper.roundPrecision(t+p,2);let g;l.mode==="RL"?g=C.LngLatHelper.convertToMonotonicLng([c,d]):g=C.LngLatHelper.convertToMonotonicLng(C.LaneHelper.interpolateCoordinates(c,d,200));const y=v.lineString(g.map(f=>[f.lng,f.lat]));y.properties.dist=p,y.properties.bearing=h,y.properties.total=t,r.push(y)}e.push(...r),a.total=t}return this.handleRender(a),a},handleTmpPointUpdate(a,e,t,r){const o=v.featureCollection([]);let s,n;if(e){const c=e.properties,d={lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]},p={lng:t.lng,lat:t.lat};s=C.LaneHelper.calculateDistance(d,p,c.mode==="RL",2),n=C.LaneHelper.calculateBearing(d,p,c.mode==="RL",2);let h;c.mode==="RL"?h=C.LngLatHelper.convertToMonotonicLng([d,p]):h=C.LngLatHelper.convertToMonotonicLng(C.LaneHelper.interpolateCoordinates(d,p,200));const g=v.lineString(h.map(y=>[y.lng,y.lat]));g.properties.dist=s,g.properties.bearing=n,o.features.push(g)}if(r){const c=t.properties,d=t,p={lng:r.geometry.coordinates[0],lat:r.geometry.coordinates[1]};s=C.LaneHelper.calculateDistance(d,p,c.mode==="RL",2),n=C.LaneHelper.calculateBearing(d,p,c.mode==="RL",2);let h;c.mode==="RL"?h=C.LngLatHelper.convertToMonotonicLng([d,p]):h=C.LngLatHelper.convertToMonotonicLng(C.LaneHelper.interpolateCoordinates(d,p,200));const g=v.lineString(h.map(y=>[y.lng,y.lat]));g.properties.dist=s,g.properties.bearing=n,o.features.push(g)}this.map.getSource(this.tmpSource)?this.map.getSource(this.tmpSource).setData(o):this.map.addSource(this.tmpSource,{type:"geojson",data:o}),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":"#F44336","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":12},paint:{"text-opacity":1,"text-color":"#fff","text-halo-color":"#F44336","text-halo-width":4,"text-halo-blur":0}});let l;if(r?l='<div class="marker-label">Drag and drop</div>':l=`<div class="marker-label">Tol distance: <b>${C.LngLatHelper.roundPrecision((a.total??0)+s,2)}</b>nm, bearing: <b>${n}</b>°</div><div class="marker-label">${this.navigation==="RL"?"RL":"GC"} mode, using 'Shift' to switch</div><div class="marker-label">Double click to end</div>`,this.tipMarker)this.tipMarker._element.innerHTML=l,this.tipMarker.setLngLat([t.lng,t.lat]);else{const c=document.createElement("div");c.className="tip-marker",c.innerHTML=l,this.tipMarker=new j.Marker(c).setOffset([140,0]).setLngLat([t.lng,t.lat]).addTo(this.map)}},handleMove(a){this.map.getCanvas().style.cursor="crosshair";let e=this.geojson.at(-1);e||(e=v.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e));const t=e.features.filter(r=>r.geometry.type==="Point");t!=null&&t.length&&this.handleTmpPointUpdate(e,t.at(-1),{lng:a.lngLat.lng,lat:a.lngLat.lat})},handleDblClick(a){a.preventDefault();let e=this.geojson.at(-1);e.closed=!0,this.handleRender(e),e=v.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e)},handleRender(a){var e;if((e=a==null?void 0:a.features)!=null&&e.length){const t=`${a.id}-${this.source}`,r=`${a.id}-${this.layer}`,o=`${a.id}-${this.labelLayer}`;this.map.getSource(t)?this.map.getSource(t).setData(a):this.map.addSource(t,{type:"geojson",data:a}),this.handleClear(a,!1),this.map.addLayer({id:r,type:"line",source:t,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F44336","line-width":2}}),this.map.addLayer({id:o,type:"symbol",source:t,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist}nm,{bearing}°","text-rotation-alignment":"map","text-size":12},paint:{"text-opacity":1,"text-color":"#fff","text-halo-color":"#F44336","text-halo-width":4,"text-halo-blur":0}});const s=a.features.filter(n=>n.geometry.type==="Point");for(const n of s){const l=document.createElement("div");l.id=`${a.id}-${n.properties.id}`,l.className=`${a.closed?"point-marker closed":"point-marker"}`,l.innerHTML='<div class="marker-circle"></div>';const c=new j.Marker({element:l,draggable:!0,contextmenu:!0}).setLngLat(n.geometry.coordinates).addTo(this.map);c.on("drag",this.handleDrag),c.on("dragend",this.handleDragEnd),this.pointMarkers[a.id]?this.pointMarkers[a.id].push(c):this.pointMarkers[a.id]=[c]}if(a.closed){const n=s.at(-1),c=a.features.filter(p=>p.geometry.type==="LineString").at(-1),d=document.createElement("div");d.className="point-summary-marker",d.innerHTML=`<div id="${a.id}" class="marker-close">×</div><div class="marker-label">Tol: ${c.properties.total}nm</div>`,this.closeMarkers[a.id]=new j.Marker(d).setOffset([60,0]).setLngLat(n.geometry.coordinates).addTo(this.map)}}},handleClear(a,e=!0){var s,n,l,c,d,p,h,g,y;const t=`${a.id}-${this.source}`,r=`${a.id}-${this.layer}`,o=`${a.id}-${this.labelLayer}`;(s=this.map)!=null&&s.getLayer(r)&&this.map.removeLayer(r),(n=this.map)!=null&&n.getLayer(o)&&this.map.removeLayer(o),(l=this.map)!=null&&l.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(c=this.map)!=null&&c.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(d=this.closeMarkers[a.id])==null||d.remove(),this.closeMarkers[a.id]=void 0,(p=this.pointMarkers[a.id])==null||p.forEach(f=>{f==null||f.remove()}),this.pointMarkers[a.id]=[],(h=this.tipMarker)==null||h.remove(),this.tipMarker=void 0,e&&((g=this.map)!=null&&g.getSource(t))&&this.map.removeSource(t),e&&((y=this.map)!=null&&y.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}};function uo(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const go=k(fo,[["render",uo]]),as="",bo={name:"IdmENC",props:{map:{type:Object},enabled:{type:Boolean},beforeLayer:{type:String,default:"grayland"},bottom:{type:String,default:"260px"},token:{type:String,default:""},toggleVersion:{type:Number},permission:{type:Number}},emits:["enc"],data(){return{helper:ge,vendor:this.$attrs.permission&ge.LEVEL.Supper?"hi":"i4",right:10}},watch:{vendor:{handler(){this.$emit("enc",this.vendor)},immediate:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{}},Ie=a=>(i.pushScopeId("data-v-8928221f"),a=a(),i.popScopeId(),a),_o={key:0},wo={class:"bar-item"},Lo=[Ie(()=>i.createElementVNode("span",{class:"iconfont"},"HI",-1))],vo=[Ie(()=>i.createElementVNode("span",{class:"iconfont"},"I4",-1))];function xo(a,e,t,r,o,s){const n=i.resolveComponent("ElTooltip");return t.enabled&&t.permission&o.helper.LEVEL.Supper?(i.openBlock(),i.createElementBlock("div",_o,[i.createElementVNode("div",{class:"menu-bar-box",style:i.normalizeStyle({position:"absolute",right:o.right+"px",bottom:t.bottom})},[i.createElementVNode("div",wo,[i.createVNode(n,{placement:"left",effect:"light",content:"Hifleet","show-after":2e3},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(o.vendor==="hi"?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=l=>o.vendor="hi")},Lo,2)]),_:1}),i.createVNode(n,{placement:"left",effect:"light",content:"I4insight","show-after":2e3},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(o.vendor==="i4"?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=l=>o.vendor="i4")},vo,2)]),_:1})])],4)])):i.createCommentVNode("",!0)}const Co=k(bo,[["render",xo],["__scopeId","data-v-8928221f"]]),rs="",ko={name:"IdmGLV2",components:{IdmGlLayer:xt,IdmWindBarb:Pt,IdmWindParticle:Rt,IdmCurrents:jt,IdmCurrentParticle:Ut,IdmSigWave:Jt,IdmSwell:Yt,IdmPrmsl:ea,IdmIceberg:ia,IdmTropicals:ze,IdmPrecip3h:Pa,IdmVisibility:Ra,IdmWaterTemp:Ma,IdmTemp:Ha,IdmArctic:Xa,IdmWarZone:ki,IdmGmdssArea:zi,IdmEcaZone:Ti,IdmAlertZone:$i,IdmPort:Xi,IdmLoadLine:Qi,IdmTimezone:to,IdmVRA:oo,IdmSpecialArea:no,IdmTerminator:ho,IdmLatLng:Pe,IdmMeasure:go,IdmPoint:vi,IdmENC:Co},props:{map:{type:Object,default:void 0},token:{type:String},ts:{type:String},beforeLayer:{type:String,default:""},toggleVersion:{type:Number}},emits:["toggleVersion"],data(){return{weatherLayers:{},activeWeatherLayers:[],weatherWeight:0,otherLayers:{},otherWeight:0,showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,meteo:void 0,source:"",gateway:"https://cbe.idmwx.com",mapProjection:"mercator",zoom:6,viewport:void 0,particleFactor:void 0,showRampColor:!1,activeWindLayer:!1,showWindParticle:!1,showCurrentParticle:!1,enc:"",defaultMeteoToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg",helper:new Te}},watch:{ts:{handler(a,e){a&&e&&A(a).utc().format("yyyy-MM-DD HH")!==A(e).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.handleDateChange({tropicals:!1})})},immediate:!0},map:{handler(){this.map&&(this.map.on("zoomend",this.handleDragEndWithZoom4Json),this.map.on("dragend",this.handleDragEndWithZoom4Json),this.map.on("move",this.handleDragEndWithZoom4Image),this.viewport=new Ce(this.map),this.handleRampColorInitial())},immediate:!0},enc:{handler(a,e){var t,r,o,s,n,l,c,d;a?((r=(t=this.map)==null?void 0:t.getLayer(a))==null||r.setLayoutProperty("visibility","visible"),(s=(o=this.map)==null?void 0:o.getLayer(e))==null||s.setLayoutProperty("visibility","none")):((l=(n=this.map)==null?void 0:n.getLayer("i4"))==null||l.setLayoutProperty("visibility","none"),(d=(c=this.map)==null?void 0:c.getLayer("hi"))==null||d.setLayoutProperty("visibility","none"))}},activeWeatherLayers:{handler(){var a,e,t,r,o,s,n,l,c,d,p,h,g,y,f,u,m,_;if(!this.map)return!1;this.activeWeatherLayers.length>0?((e=(a=this.map)==null?void 0:a.getLayer(this.enc))==null||e.setLayoutProperty("visibility","none"),(r=(t=this.map)==null?void 0:t.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||r.setLayoutProperty("visibility","visible"),(s=this.map)!=null&&s.getLayer((o=this.viewport)==null?void 0:o.rampColorLayer)&&((n=this.map)!=null&&n.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((c=this.map)==null||c.moveLayer((l=this.viewport)==null?void 0:l.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(p=this.map)!=null&&p.getLayer((d=this.viewport)==null?void 0:d.particleLayer)&&((h=this.map)!=null&&h.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((y=this.map)==null||y.moveLayer((g=this.viewport)==null?void 0:g.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id))):((u=(f=this.map)==null?void 0:f.getLayer(this.enc))==null||u.setLayoutProperty("visibility","visible"),(_=(m=this.map)==null?void 0:m.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||_.setLayoutProperty("visibility","none"))},immediate:!0}},methods:{async fetchWeatherLayers(a={tropicals:!1}){var o,s,n,l,c,d,p,h;const e=new Date().valueOf();let t=0,r=0;if(this.map){const g=((o=this.map)==null?void 0:o.getZoom())+1,y=(s=this.map)==null?void 0:s.getBounds(),f=`${y._sw.lng},${y._sw.lat},${y._ne.lng},${y._ne.lat}`;if(this.handleRampColorState(),this.particleFactor){const u=be.WEATHER_LAYERS.find(m=>{var _;return((_=m.peer)==null?void 0:_.weight)===this.particleFactor.weight});this.particleFactor.particle?this.weatherWeight=this.weatherWeight&u.weight?this.weatherWeight:this.weatherWeight+u.weight:this.weatherWeight=this.weatherWeight&u.weight?this.weatherWeight-u.weight:this.weatherWeight}if(this.weatherWeight>0){let u=this.weatherWeight,m;if(a.tropicals||this.weatherWeight&256&&(m=this.weatherLayers.tropicals,m&&(u-=256,m.version=Math.random()+1)),u>0){const _=await U.get(`${this.gateway}/api/arc/weather/layers/links?l=${u}&v=${this.source}&z=${g}&bbox=${f}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(r=new Date().valueOf()-(e+t),console.log("weather links elapsed: ",r,", total: ",t+=r),((n=_==null?void 0:_.data)==null?void 0:n.code)===0){const b=(l=_==null?void 0:_.data)==null?void 0:l.data,L=[];for(const w in b)w==="ice-edge"&&(b[w]="https://idm-hz.oss-cn-hangzhou.aliyuncs.com/test/sea_ice_contours.geojson"),w!=="tropicals"&&L.push(U.get(b[w],{headers:{Authorization:this.token||this.defaultMeteoToken,key:w},responseType:/\.(jpg|png)$/.test(b[w])?"blob":"json"}).catch(P=>{console.log(`[${w}] fetch layer error: ${P}`)}));const x=await Promise.all(L);this.weatherLayers={},x.map(w=>{var I,R,D,B;const P=((I=w==null?void 0:w.data)==null?void 0:I.data)||(w==null?void 0:w.data),N=(D=(R=w==null?void 0:w.config)==null?void 0:R.headers)==null?void 0:D.key;N&&P&&(this.weatherLayers[N]={raw:P,type:((B=w==null?void 0:w.config)==null?void 0:B.responseType)==="blob"?"image":"json",etime:this.ts})}),b.tropicals&&U.get(b.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"}}).then(w=>{var I,R,D;const P=C.TropicalHelper.convert2Geojson(((I=w==null?void 0:w.data)==null?void 0:I.data)||(w==null?void 0:w.data)),N=(D=(R=w==null?void 0:w.config)==null?void 0:R.headers)==null?void 0:D.key;this.weatherLayers[N]={data:P,active:!0,cached:!1,type:"json",etime:this.ts,version:Math.random()+1}})}if(r=new Date().valueOf()-(e+t),console.log("weather layers elapsed: ",r,", total: ",t+=r),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const b=(c=this.weatherLayers["swell-direction"])==null?void 0:c.raw,L=(d=this.weatherLayers["swell-height"])==null?void 0:d.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:b,height:{raw:L},etime:this.ts}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const b=(p=this.weatherLayers["current-direction"])==null?void 0:p.raw,L=(h=this.weatherLayers["current-speed"])==null?void 0:h.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:b,speed:{raw:L},etime:this.ts}}}m&&(m.etime=this.ts,m.cached=!0,this.weatherLayers.tropicals=m)}this.handleWeatherLayerToggle(),this.handleDragEndWithZoom4Json()}this.$emit("toggleVersion",Math.random())},async fetchOtherLayers(a={all:!1,dayNight:!1,enc:!1}){var e,t,r,o;if(this.map){let s=this.otherWeight;if(s){let n=!1;if(this.otherWeight&2048&&(s=this.otherWeight-2048,n=!0),s){if(a.all){const l=await U.get(`${this.gateway}/api/arc/other/layers/links?l=${s}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((e=l==null?void 0:l.data)==null?void 0:e.code)===0){const c=(t=l==null?void 0:l.data)==null?void 0:t.data,d=[];for(const h in c)d.push(U.get(c[h],{headers:{Authorization:this.token||this.defaultMeteoToken,key:h}}));const p=await Promise.all(d);this.otherLayers={enc:n},p.map(h=>{var f,u,m;const g=((f=h==null?void 0:h.data)==null?void 0:f.data)||(h==null?void 0:h.data),y=(m=(u=h==null?void 0:h.config)==null?void 0:u.headers)==null?void 0:m.key;this.otherLayers[y]=g})}}else if(a.dayNight&&s&1024){const l=await U.get(`${this.gateway}/api/arc/other/layers/links?l=1024&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((r=l==null?void 0:l.data)==null?void 0:r.code)===0){const c=(o=l==null?void 0:l.data)==null?void 0:o.data,d=[];for(const h in c)d.push(U.get(c[h],{headers:{Authorization:this.token||this.defaultMeteoToken,key:h}}));(await Promise.all(d)).map(h=>{var f,u,m;const g=((f=h==null?void 0:h.data)==null?void 0:f.data)||(h==null?void 0:h.data),y=(m=(u=h==null?void 0:h.config)==null?void 0:u.headers)==null?void 0:m.key;this.otherLayers[y]=g})}}}else this.otherLayers={enc:n}}else this.otherLayers={};this.handleBeforeLayerToggle()}},handleRampColorState(){var a;if(this.showRampColor=!1,this.showWindParticle=!1,this.showCurrentParticle=!1,(a=this.particleFactor)!=null&&a.particle)this.showRampColor=!0,this.showWindParticle=this.particleFactor.key==="wind",this.showCurrentParticle=this.particleFactor.key==="current",this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.type==="json");else for(const e of this.activeWeatherLayers)["png","jpg"].includes(e.type)&&(this.showRampColor=!0);this.activeWindLayer=!!this.activeWeatherLayers.find(e=>e.key==="wind"),this.$refs.layer&&(this.$refs.layer.activeWeatherLayers=this.activeWeatherLayers)},handleRampColorInitial(){var a,e,t,r,o,s,n,l,c,d,p,h;this.viewport.map.getSource((a=this.viewport)==null?void 0:a.rampColorSource)||this.viewport.map.addSource((e=this.viewport)==null?void 0:e.rampColorSource,{type:"canvas",canvas:(t=this.viewport)==null?void 0:t.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((r=this.viewport)==null?void 0:r.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(o=this.viewport)==null?void 0:o.rampColorLayer,source:(s=this.viewport)==null?void 0:s.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((n=this.viewport)==null?void 0:n.particleSource)||this.viewport.map.addSource((l=this.viewport)==null?void 0:l.particleSource,{type:"canvas",canvas:(c=this.viewport)==null?void 0:c.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((d=this.viewport)==null?void 0:d.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(p=this.viewport)==null?void 0:p.particleLayer,source:(h=this.viewport)==null?void 0:h.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDragEndWithZoom4Json(){var d,p,h,g;const a=new Date().valueOf();let e=0,t=0;const r=(d=this.map)==null?void 0:d.getBounds(),o=this.map.getZoom(),s=C.LngLatHelper.convertToStdLng(r._sw.lng),n=C.LngLatHelper.convertToStdLng(r._ne.lng),l=Math.floor(r._sw.lat),c=Math.ceil(r._ne.lat);for(const y in this.weatherLayers)if(this.weatherLayers[y].active&&this.weatherLayers[y].type==="json"){this.weatherLayers[y].active=!1,this.weatherLayers[y].version=Math.random()+1;let f=[];if(["swell","current"].includes(y)){const u=((p=this.weatherLayers[y])==null?void 0:p.direction)||{};for(const m in u)if(m>l&&m<c&&(!(o<=this.zoom)||m%(o<this.zoom/2?5:3)===0)){const _=u[m].lng;s>n?_.forEach((b,L)=>{var x;if((b>=s&&b<=180||b>=-180&&b<=n)&&(!(o<=this.zoom)||b%(o<this.zoom/2?5:3)===0)){const w=v.point([b,m],{val:u[m].val[L],spd:(x=u[m].spd)==null?void 0:x[L]});f.push(w)}}):_.forEach((b,L)=>{var x;if(b>=s&&b<=n&&(!(o<=this.zoom)||b%(o<this.zoom/2?5:3)===0)){const w=v.point([b,m],{val:u[m].val[L],spd:(x=u[m].spd)==null?void 0:x[L]});f.push(w)}})}if(t=new Date().valueOf()-(a+e),console.log("direction elapsed: ",t,", total: ",e+=t),y==="swell"){const m=this.weatherLayers[y].height;if(m){if(!m.data){const _=[];for(const b in(h=m.raw)==null?void 0:h.LineString){const L=m.raw.LineString[b];for(const x of L)_.push(v.lineString(x,{val:Number(b)}));m.data=v.featureCollection(_)}}if(m.data){const _=this.handleBboxClip(m.data,r);f=f.concat(_)}t=new Date().valueOf()-(a+e),console.log("height elapsed: ",t,", total: ",e+=t)}}if(y==="current"){const m=this.weatherLayers[y].speed;if(m){if(!m.data){const b=[];for(const L in(g=m.raw)==null?void 0:g.Polygon){const x=m.raw.Polygon[L];for(const w of x)b.push(v.polygon(w,{val:Number(L)}))}m.data=v.featureCollection(b)}const _=o<this.zoom?m.data.features.filter(b=>b.properties.val>.5):m.data.features;f=f.concat(_),t=new Date().valueOf()-(a+e),console.log("speed elapsed: ",t,", total: ",e+=t)}}}else if(y==="wind"){const u=this.weatherLayers.wind.raw;for(const m in u)if(m>l&&m<c&&(!(o<=this.zoom)||m%(o<this.zoom/2?5:3)===0)){const _=u[m].lng;s>n?_.forEach((b,L)=>{if((b>=s&&b<=180||b>=-180&&b<=n)&&(!(o<=this.zoom)||b%(o<this.zoom/2?5:3)===0)){const x=v.point([b,m],{val:u[m].val[L],spd:u[m].spd[L]});f.push(x)}}):_.forEach((b,L)=>{if(b>=s&&b<=n&&(!(o<=this.zoom)||b%(o<this.zoom/2?5:3)===0)){const x=v.point([b,m],{val:u[m].val[L],spd:u[m].spd[L]});f.push(x)}})}t=new Date().valueOf()-(a+e),console.log("wind barb elapsed: ",t,", total: ",e+=t)}else if(y==="sig-wave-height"){if(this.weatherLayers[y].data)f=this.weatherLayers[y].data;else{const u=this.weatherLayers[y].raw;if(u){const m=[];for(const _ in u.Polygon){const b=u.Polygon[_];for(const L of b)m.push(v.polygon(L,{val:Number(_)}))}for(const _ in u.Point){const b=u.Point[_];for(const L of b)m.push(...v.points(L,{val:Number(_)}).features)}f=f.concat(m)}}t=new Date().valueOf()-(a+e),console.log("sigWave elapsed: ",t,", total: ",e+=t)}else if(y==="prmsl"){if(this.weatherLayers[y].data)f=this.weatherLayers[y].data;else{const u=this.weatherLayers[y].raw;if(u){const m=[];for(const _ in u.LineString){const b=u.LineString[_];for(const L of b)m.push(v.lineString(L,{val:Number(_)}))}for(const _ in u.Point)u.Point[_].lng.forEach((b,L)=>{b=C.LngLatHelper.convertToStdLng(b),m.push(v.point([b,_],{val:u.Point[_].val[L],type:u.Point[_].type[L]}))});f=f.concat(m)}}t=new Date().valueOf()-(a+e),console.log("prmsl elapsed: ",t,", total: ",e+=t)}else if(y==="arctic"||y==="iceberg"){if(this.weatherLayers[y].data)f=this.weatherLayers[y].data;else{const u=this.weatherLayers[y].raw;if(u){const m=[];for(const _ in u.LineString){const b=u.LineString[_];for(const L of b)m.push(v.lineString(L,{val:Number(_)}))}f=f.concat(m)}}t=new Date().valueOf()-(a+e)}console.log(y," elapsed: ",t,", total: ",e+=t),f.length&&(this.weatherLayers[y].data=v.featureCollection(f)),this.weatherLayers[y].active=!0,this.weatherLayers[y].version=Math.random()+1}},handleDragEndWithZoom4Image(){for(const a in this.weatherLayers)this.weatherLayers[a].active&&this.weatherLayers[a].type==="image"&&(this.weatherLayers[a].active=!0,this.weatherLayers[a].version=Math.random()+1)},handleBboxClip(a,e){const t=[],r=C.LngLatHelper.convertToStdLng(e._sw.lng),o=C.LngLatHelper.convertToStdLng(e._ne.lng);return a.features.forEach(s=>{if(s.geometry.type!=="Point")if(r>o){let n=[r,e._sw.lat,180,e._ne.lat],l=v.bboxClip(s,n);l.geometry.coordinates.length&&t.push(l),n=[-180,e._sw.lat,o,e._ne.lat],l=v.bboxClip(s,n),l.geometry.coordinates.length&&t.push(l)}else{const n=[r,e._sw.lat,o,e._ne.lat],l=v.bboxClip(s,n);l.geometry.coordinates.length&&t.push(l)}else t.push(s)}),t},handleWeatherLayerToggle(){var a;for(const e in this.weatherLayers)this.weatherLayers[e].active=!1,this.weatherLayers[e].version=Math.random()+1;for(const e of this.activeWeatherLayers){let t=e.key;t.indexOf("swell")>-1?t="swell":t.indexOf("current")>-1&&(t="current"),this.weatherLayers[t]&&(this.weatherLayers[t].active=!0,this.weatherLayers[t].version=Math.random()+1,((a=this.particleFactor)==null?void 0:a.key)===t&&this.weatherLayers[`${t}-particle`]&&(this.weatherLayers[`${t}-particle`].active=this.particleFactor.particle))}this.handleBeforeLayerToggle()},handleBeforeLayerToggle(){var a,e,t,r,o,s,n,l,c,d,p,h,g;(a=this.map)!=null&&a.getLayer(this.beforeLayer)&&((e=this.activeWeatherLayers)!=null&&e.length||(t=this.otherLayers)!=null&&t["war-zones"]||(r=this.otherLayers)!=null&&r["gmdss-areas"]||(o=this.otherLayers)!=null&&o["load-lines"]||(s=this.otherLayers)!=null&&s["high-risk-area"]||(n=this.otherLayers)!=null&&n["time-zones"]||(l=this.otherLayers)!=null&&l.pirates||(c=this.otherLayers)!=null&&c.ports||(d=this.otherLayers)!=null&&d.enc||(p=this.otherLayers)!=null&&p["voluntary-reporting-area"]||(h=this.otherLayers)!=null&&h["eca-zones"]||(g=this.otherLayers)!=null&&g["special-area"])&&this.map.setLayoutProperty(this.beforeLayer,"visibility","visible")},handleDateChange(a={tropicals:!1}){this.fetchWeatherLayers(a),this.fetchOtherLayers({dayNight:!0})},handleWeatherLayerChange(a,e,t){if(!this.map)setTimeout(()=>{this.handleWeatherLayerChange(a,e,t)},500);else{this.activeWeatherLayers=e;const r=this.activeWeatherLayers.some(n=>{var l;return["wind","current"].includes(n.key)&&(!((l=Object.keys(n))!=null&&l.some(c=>c==="particle"))||!!n.particle)}),o=this.activeWeatherLayers.some(n=>["png","jpg"].includes(n.type));r&&!o?(this.activeWeatherLayers.forEach(n=>{["wind","current"].includes(n.key)&&(this.particleFactor=n)}),this.particleFactor.particle=!0):o&&this.particleFactor&&(this.particleFactor.particle=!1);const s=e==null?void 0:e.reduce((n,l)=>n+(n&(l==null?void 0:l.weight)?0:l==null?void 0:l.weight),0);this.weatherWeight!==s||this.source!==t?(this.source=t,this.weatherWeight=s,this.fetchWeatherLayers({tropicals:!1})):this.handleWeatherLayerToggle()}},handleOtherLayerChange(a){if(!this.map)setTimeout(()=>{this.handleOtherLayerChange(a)},500);else{const e=a==null?void 0:a.reduce((t,r)=>t+(r==null?void 0:r.weight),0);a.find(t=>t.key==="enc")?this.enc="i4":this.enc="",this.otherWeight!=e&&(this.otherWeight=e,this.fetchOtherLayers({all:!0}))}},async handlePointChange(a){const e=this.ts?A(this.ts):A(),t={lat:a.lat,lng:a.lng,ts:e.utc().format(),wt:!0,src:this.source},r=await U.get(`${this.gateway}/api/arc/meteo/query`,{params:t,headers:{Authorization:this.token||this.defaultMeteoToken}});(r==null?void 0:r.status)===200&&(this.meteo={...r==null?void 0:r.data,...a})},handle3dToggle(a){var e,t,r,o,s,n,l,c,d,p,h,g,y,f,u,m,_,b,L,x;a?(this.map.setProjection("globe"),this.mapProjection="globe",(t=this.map)!=null&&t.getLayer((e=this.viewport)==null?void 0:e.rampColorLayer)&&((r=this.map)!=null&&r.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((s=this.map)==null||s.moveLayer((o=this.viewport)==null?void 0:o.rampColorLayer,this.helper.mapboxCustomer.layers.water.id)),(l=this.map)!=null&&l.getLayer((n=this.viewport)==null?void 0:n.particleLayer)&&((c=this.map)!=null&&c.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((p=this.map)==null||p.moveLayer((d=this.viewport)==null?void 0:d.particleLayer,this.helper.mapboxCustomer.layers.water.id)),this.map.off("zoomend",this.handleDragEndWithZoom4Json),this.map.off("dragend",this.handleDragEndWithZoom4Json),this.map.off("move",this.handleDragEndWithZoom4Image)):(this.map.setProjection("mercator"),this.mapProjection="mercator",this.map.on("zoomend",this.handleDragEndWithZoom4Json),this.map.on("dragend",this.handleDragEndWithZoom4Json),this.map.on("move",this.handleDragEndWithZoom4Image),this.handleDragEndWithZoom4Image(),this.handleDragEndWithZoom4Json(),(g=this.map)!=null&&g.getLayer((h=this.viewport)==null?void 0:h.rampColorLayer)&&((y=this.map)!=null&&y.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((u=this.map)==null||u.moveLayer((f=this.viewport)==null?void 0:f.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(_=this.map)!=null&&_.getLayer((m=this.viewport)==null?void 0:m.particleLayer)&&((b=this.map)!=null&&b.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((x=this.map)==null||x.moveLayer((L=this.viewport)==null?void 0:L.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)))},handleParticle(a){this.particleFactor=a,this.weatherLayers[a.key]&&(this.weatherLayers[a.key].particle=a.particle),this.activeWeatherLayers.forEach(r=>{r.key===a.key&&(r.particle=a.particle)});let e=localStorage.getItem("weatherLayersCache");const t=JSON.parse(e)||[];t==null||t.forEach(r=>{r.key===a.key&&(r.particle=a.particle)}),localStorage.setItem("weatherLayersCache",JSON.stringify(t)),this.fetchWeatherLayers({tropicals:!1})},handleToggleVersion(){this.$emit("toggleVersion",Math.random())}}},So={key:0,className:"map-gl-home"};function Eo(a,e,t,r,o,s){var q,M,W,ce,F,S,$,he,H,de,Y,Q,K,_e,we,Le,ve,xe,Ne,Re,De,$e,Ae,Be,Me,je;const n=i.resolveComponent("IdmGlLayer"),l=i.resolveComponent("IdmENC"),c=i.resolveComponent("IdmSigWave"),d=i.resolveComponent("IdmSwell"),p=i.resolveComponent("IdmPrmsl"),h=i.resolveComponent("IdmIceberg"),g=i.resolveComponent("IdmTropicals"),y=i.resolveComponent("IdmCurrents"),f=i.resolveComponent("IdmCurrentParticle"),u=i.resolveComponent("IdmWindBarb"),m=i.resolveComponent("IdmWindParticle"),_=i.resolveComponent("IdmPrecip3h"),b=i.resolveComponent("IdmVisibility"),L=i.resolveComponent("IdmWaterTemp"),x=i.resolveComponent("IdmTemp"),w=i.resolveComponent("IdmArctic"),P=i.resolveComponent("IdmWarZone"),N=i.resolveComponent("IdmGmdssArea"),I=i.resolveComponent("IdmEcaZone"),R=i.resolveComponent("IdmAlertZone"),D=i.resolveComponent("IdmPort"),B=i.resolveComponent("IdmLoadLine"),ae=i.resolveComponent("IdmTimezone"),ie=i.resolveComponent("IdmVRA"),oe=i.resolveComponent("IdmSpecialArea"),re=i.resolveComponent("IdmTerminator"),se=i.resolveComponent("IdmLatLng"),ne=i.resolveComponent("IdmMeasure"),le=i.resolveComponent("IdmPoint");return t.map?(i.openBlock(),i.createElementBlock("div",So,[i.createVNode(n,i.mergeProps({ref:"layer",map:t.map,"toggle-version":t.toggleVersion,"map-projection":o.mapProjection},a.$attrs,{onWeather:s.handleWeatherLayerChange,onOther:s.handleOtherLayerChange,onCoordinate:e[0]||(e[0]=pe=>o.showCoord=pe),onMeasure:e[1]||(e[1]=pe=>o.showMeasure=pe),onPoint:e[2]||(e[2]=pe=>o.showPoint=pe),on3d:s.handle3dToggle,onHandleToggleVersion:s.handleToggleVersion}),null,16,["map","toggle-version","map-projection","onWeather","onOther","on3d","onHandleToggleVersion"]),i.createVNode(l,i.mergeProps({map:t.map,token:t.token,enabled:(q=o.otherLayers)==null?void 0:q.enc,"toggle-version":t.toggleVersion},a.$attrs,{onEnc:e[3]||(e[3]=pe=>o.enc=pe)}),null,16,["map","token","enabled","toggle-version"]),i.createVNode(c,i.mergeProps({map:t.map,"sig-wave":(M=o.weatherLayers)==null?void 0:M["sig-wave-height"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","sig-wave","before-layer"]),i.createVNode(d,i.mergeProps({map:t.map,swell:(W=o.weatherLayers)==null?void 0:W.swell,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","swell","before-layer"]),i.createVNode(p,i.mergeProps({map:t.map,prmsl:(ce=o.weatherLayers)==null?void 0:ce.prmsl,"before-layer":t.beforeLayer,"active-weather-layers":o.activeWeatherLayers},a.$attrs),null,16,["map","prmsl","before-layer","active-weather-layers"]),i.createVNode(h,i.mergeProps({map:t.map,iceberg:(F=o.weatherLayers)==null?void 0:F.iceberg,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","iceberg","before-layer"]),i.createVNode(g,i.mergeProps({map:t.map,date:t.ts,tropicals:(S=o.weatherLayers)==null?void 0:S.tropicals,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","date","tropicals","before-layer"]),i.createVNode(y,i.mergeProps({map:t.map,"map-projection":o.mapProjection,current:($=o.weatherLayers)==null?void 0:$.current,"before-layer":t.beforeLayer,"show-particle":o.showCurrentParticle,"margin-bottom":o.activeWindLayer?o.showRampColor?"84px":"56px":o.showRampColor?"56px":"30px","toggle-version":t.toggleVersion,"weather-layers":o.weatherLayers},a.$attrs,{onParticle:s.handleParticle,onHandleToggleVersion:s.handleToggleVersion}),null,16,["map","map-projection","current","before-layer","show-particle","margin-bottom","toggle-version","weather-layers","onParticle","onHandleToggleVersion"]),i.createVNode(f,i.mergeProps({viewport:o.viewport,factor:(he=o.weatherLayers)==null?void 0:he["current-particle"],"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(u,i.mergeProps({ref:"windBarb",map:t.map,"map-projection":o.mapProjection,wind:(H=o.weatherLayers)==null?void 0:H.wind,current:(de=o.weatherLayers)==null?void 0:de.current,"before-layer":t.beforeLayer,"margin-bottom":o.showRampColor?"56px":"30px","show-particle":o.showWindParticle},a.$attrs,{"toggle-version":t.toggleVersion,"weather-layers":o.weatherLayers,onParticle:s.handleParticle}),null,16,["map","map-projection","wind","current","before-layer","margin-bottom","show-particle","toggle-version","weather-layers","onParticle"]),i.createVNode(m,i.mergeProps({viewport:o.viewport,factor:(Y=o.weatherLayers)==null?void 0:Y["wind-particle"],"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(_,i.mergeProps({viewport:o.viewport,factor:(Q=o.weatherLayers)==null?void 0:Q.precip3h,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(b,i.mergeProps({viewport:o.viewport,factor:(K=o.weatherLayers)==null?void 0:K.visibility,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(L,i.mergeProps({viewport:o.viewport,factor:(_e=o.weatherLayers)==null?void 0:_e["water-temp"],"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(x,i.mergeProps({viewport:o.viewport,factor:(we=o.weatherLayers)==null?void 0:we.temp,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(w,i.mergeProps({viewport:o.viewport,factor:(Le=o.weatherLayers)==null?void 0:Le.arctic,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(P,i.mergeProps({map:t.map,zone:(ve=o.otherLayers)==null?void 0:ve["war-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(N,i.mergeProps({map:t.map,area:(xe=o.otherLayers)==null?void 0:xe["gmdss-areas"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),i.createVNode(I,i.mergeProps({map:t.map,zone:(Ne=o.otherLayers)==null?void 0:Ne["eca-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(R,i.mergeProps({map:t.map,zone:(Re=o.otherLayers)==null?void 0:Re["alert-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(D,i.mergeProps({map:t.map,port:(De=o.otherLayers)==null?void 0:De.ports,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","port","before-layer"]),i.createVNode(B,i.mergeProps({map:t.map,line:($e=o.otherLayers)==null?void 0:$e["load-lines"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","line","before-layer"]),i.createVNode(ae,i.mergeProps({map:t.map,zone:(Ae=o.otherLayers)==null?void 0:Ae["time-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(ie,i.mergeProps({map:t.map,area:(Be=o.otherLayers)==null?void 0:Be["voluntary-reporting-area"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),i.createVNode(oe,i.mergeProps({map:t.map,area:(Me=o.otherLayers)==null?void 0:Me["special-area"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),i.createVNode(re,i.mergeProps({map:t.map,area:(je=o.otherLayers)==null?void 0:je["day-night"]},a.$attrs),null,16,["map","area"]),i.createVNode(se,i.mergeProps({map:t.map,show:o.showCoord,"toggle-version":t.toggleVersion},a.$attrs),null,16,["map","show","toggle-version"]),i.createVNode(ne,i.mergeProps({map:t.map,show:o.showMeasure},a.$attrs),null,16,["map","show"]),i.createVNode(le,i.mergeProps({map:t.map,show:o.showPoint,meteo:o.meteo},a.$attrs,{onPoint:s.handlePointChange}),null,16,["map","show","meteo","onPoint"])])):i.createCommentVNode("",!0)}const Ve=k(ko,[["render",Eo]]),zo={install(a){a.component("MapboxGL",Ve),a.component("TropicalGL",ze),a.component("LatLngGL",Pe)}};E.LatLngGL=Pe,E.MapboxGL=Ve,E.MapboxGLPlugin=zo,E.MapboxHelper=Te,E.ParticleSchema=V,E.TropicalGL=ze,E.Viewport=Ce,E.WebGL=Z,E.WebGLSchema=T,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
204
|
+
</svg>`,H=document.createElement("div");H.className="hurricane-hourly-marker",H.innerHTML=`<div class="${S.geometry.coordinates[1]>=0?"center north":"center south"}">${he}</div>`;const de=new j.Marker(H).setLngLat(S.geometry.coordinates).addTo(this.map);if(this.interpolateMarkers.push(de),(ae=S.properties)!=null&&ae.showCircle){const Y={radius:100,coordinates:S.geometry.coordinates},Q={radius:200,coordinates:S.geometry.coordinates},K={radius:500,coordinates:S.geometry.coordinates};(ie=this.circleSourceData)==null||ie.features.push(v.circle(Y.coordinates,Y.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(oe=this.circleSourceData)==null||oe.features.push(v.circle(Q.coordinates,Q.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(re=this.circleSourceData)==null||re.features.push(v.circle(K.coordinates,K.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}}))}(ne=(se=this.map)==null?void 0:se.getSource(this.circleSource))==null||ne.setData(this.circleSourceData)}}else(le=this.map)!=null&&le.getSource(this.interpolateSource)&&((q=this.map)==null||q.getSource(this.interpolateSource).setData(this.empty))},handleClick(a){var s,n,l,c,d,p,h,g;const e=a.features[0],t=(n=(s=this.tropicals)==null?void 0:s.data)==null?void 0:n.features.filter(y=>{var f;return y.geometry.type==="LineString"&&y.properties.type==="forecast"&&y.properties.name===((f=e==null?void 0:e.properties)==null?void 0:f.name)});t.sort((y,f)=>{var u,m,_,b;return((u=y.properties)==null?void 0:u.model)==="cma"?-1:((m=y.properties)==null?void 0:m.model)==="jma"?((_=f.properties)==null?void 0:_.model)==="cma"?1:-1:y.properties.model==="ecmwf"?["jma","cma"].includes((b=f.properties)==null?void 0:b.model)?1:-1:0});const r=(c=(l=this.tropicals)==null?void 0:l.data)==null?void 0:c.features.filter(y=>{var f;return y.geometry.type==="LineString"&&y.properties.type==="history"&&y.properties.name===((f=e==null?void 0:e.properties)==null?void 0:f.name)});this.activeTropicals={name:(d=e==null?void 0:e.properties)==null?void 0:d.name,forecasts:t.map(y=>y.properties),history:(p=r[0])==null?void 0:p.properties,showCircle:(g=(h=t[0])==null?void 0:h.properties)==null?void 0:g.showCircle},this.showTropicals=!0;const o=document.getElementById("active-tropical");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.activeTropicalsMarker=new j.Marker(o).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([220,0]).addTo(this.map)},handleForecastToggle(a){var r,o,s,n,l,c;a.disabled=!a.disabled;const e=`${a.name}-${a.model}`,t=(o=(r=this.map)==null?void 0:r.getSource(this.source)._data)==null?void 0:o.features;t.forEach(d=>{d.properties.category===e&&(d.properties.disabled=a.disabled)}),this.interpolateData.forEach(d=>{d.properties.category===e&&(d.properties.disabled=a.disabled)}),(n=(s=this.map)==null?void 0:s.getSource(this.source))==null||n.setData(v.featureCollection(t)),(c=(l=this.map)==null?void 0:l.getSource(this.clusterSource))==null||c.setData(v.featureCollection(t)),this.handleDateChange()},handleStrikeProbability(a){this.$emit("tropicalProbability",a)},handleToggleCircles(a){var e,t;a.showCircle=!a.showCircle,(t=(e=this.tropicals.data)==null?void 0:e.features)==null||t.forEach(r=>{r.properties.name===a.name&&(r.properties.showCircle=a.showCircle)}),this.handleRender()},handleDrawCircle(){var a,e;(a=this.map)!=null&&a.getSource(this.circleSource)?(e=this.map)==null||e.getSource(this.circleSource).setData(this.circleSourceData):(this.map.addSource(this.circleSource,{type:"geojson",data:this.circleSourceData}),this.map.addLayer({id:this.circleLayer,type:"line",source:this.circleSource,filter:["all",["==","$type","Polygon"],["==","type","tropicalCircle"]],paint:{"line-color":"#fff","line-width":2,"line-opacity":1,"line-dasharray":[1,1]}}))},handleComputePolygons(a){const e=[];for(const t of a){const r=t.properties.wind,o={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},s=this.handleComputeArc(t.geometry.coordinates,o,{...t.properties,level:7});e.push(s);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},l=this.handleComputeArc(t.geometry.coordinates,n,{...t.properties,level:10});e.push(l)}return e},handleComputeArc(a,e,t){var s;const r=[];for(const n in e){const l=e[n]??0;let c;switch(n){case"ne":c=v.lineArc(a,l*1.852,0,90,{steps:l>0?64:1});break;case"se":c=v.lineArc(a,l*1.852,90,180,{steps:l>0?64:1});break;case"sw":c=v.lineArc(a,l*1.852,180,270,{steps:l>0?64:1});break;case"nw":c=v.lineArc(a,l*1.852,270,360,{steps:l>0?64:1});break}r.push(...(s=c==null?void 0:c.geometry)==null?void 0:s.coordinates)}const o=v.lineString(r);return v.lineToPolygon(o,{properties:t})}}},Ee=a=>(i.pushScopeId("data-v-f0e05b29"),a=a(),i.popScopeId(),a),ra={id:"active-tropical",class:"active-tropical"},sa={class:"header-box"},na={class:"main"},la={key:0},ca={class:"sub"},ha={id:"meteoBox",class:"main-box"},da={class:"content"},pa={class:"row"},ma={class:"col col-left",style:{"justify-content":"flex-start"}},ya=Ee(()=>i.createElementVNode("label",null,"Wind speed : ",-1)),fa={class:"col col-right",style:{"justify-content":"flex-start"}},ua=Ee(()=>i.createElementVNode("label",null,"Pressure : ",-1)),ga={class:"row"},ba={class:"col col-24",style:{"justify-content":"flex-start"}},_a=Ee(()=>i.createElementVNode("label",{style:{width:"max-content"}},"Forecast Models : ",-1)),wa={class:"forecast-models"},La=["onClick"],va=i.createStaticVNode('<div class="row" style="padding:0;height:1px;margin:10px 0;background:var(--idm-black-1);" data-v-f0e05b29></div><div class="row" style="padding:2px 10px;" data-v-f0e05b29><div class="legend" data-v-f0e05b29><div class="icon td" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>TD</div></div><div class="legend" data-v-f0e05b29><div class="icon ts" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>TS</div></div><div class="legend" data-v-f0e05b29><div class="icon sts" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>STS</div></div><div class="legend" data-v-f0e05b29><div class="icon ty" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>TY</div></div><div class="legend" data-v-f0e05b29><div class="icon sty" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>STY</div></div><div class="legend" data-v-f0e05b29><div class="icon supper-ty" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>Super TY</div></div></div><div class="row" style="padding:2px 10px;" data-v-f0e05b29><div class="legend" data-v-f0e05b29><div class="icon history" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>History</div></div><div class="legend" data-v-f0e05b29><div class="icon r7" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>35kts Radii</div></div><div class="legend" data-v-f0e05b29><div class="icon r10" data-v-f0e05b29></div><div class="label" data-v-f0e05b29>50kts Radii</div></div></div>',3),xa={class:"more"};function Ca(a,e,t,r,o,s){var n,l,c,d,p,h,g,y,f,u,m,_,b,L,x;return i.withDirectives((i.openBlock(),i.createElementBlock("div",ra,[i.createElementVNode("div",sa,[i.createElementVNode("div",{class:"iconfont close-btn",onClick:e[0]||(e[0]=w=>o.showTropicals=!1)},""),i.createElementVNode("div",na,[(l=(n=o.activeTropicals)==null?void 0:n.history)!=null&&l.level?(i.openBlock(),i.createElementBlock("span",la,i.toDisplayString((d=(c=o.activeTropicals)==null?void 0:c.history)==null?void 0:d.level)+" , ",1)):i.createCommentVNode("",!0),i.createTextVNode(i.toDisplayString((p=o.activeTropicals)==null?void 0:p.name),1)]),i.createElementVNode("div",ca," Last update: "+i.toDisplayString(s.computeTime(((g=(h=o.activeTropicals)==null?void 0:h.history)==null?void 0:g.updated)||((u=(f=(y=o.activeTropicals)==null?void 0:y.forecasts)==null?void 0:f.filter(w=>!w.disabled)[0])==null?void 0:u.date))),1)]),i.createElementVNode("div",ha,[i.createElementVNode("div",da,[i.createElementVNode("div",pa,[i.createElementVNode("div",ma,[ya,i.createElementVNode("span",null,i.toDisplayString(((_=(m=o.activeTropicals)==null?void 0:m.history)==null?void 0:_.kts)||"-")+"[kts]",1)]),i.createElementVNode("div",fa,[ua,i.createElementVNode("span",null,i.toDisplayString(((L=(b=o.activeTropicals)==null?void 0:b.history)==null?void 0:L.pressure)||"-")+"[hPa]",1)])]),i.createElementVNode("div",ga,[i.createElementVNode("div",ba,[_a,i.createElementVNode("div",wa,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList((x=o.activeTropicals)==null?void 0:x.forecasts,(w,P)=>{var N,I,R,D;return i.openBlock(),i.createElementBlock("div",{key:P,class:i.normalizeClass(["model",w.disabled?"":"active",P>0&&P<((I=(N=o.activeTropicals)==null?void 0:N.forecasts)==null?void 0:I.length)-1&&((D=(R=o.activeTropicals)==null?void 0:R.forecasts)==null?void 0:D.length)>2?"center-child":""]),onClick:B=>s.handleForecastToggle(w)},[i.createElementVNode("span",{class:i.normalizeClass(w.model)},i.toDisplayString(w.model),3)],10,La)}),128))])])]),va]),i.createElementVNode("div",xa,[i.createElementVNode("div",{class:"button",onClick:e[1]||(e[1]=w=>s.handleStrikeProbability(o.activeTropicals))},"Strike Probability >>")])])],512)),[[i.vShow,o.showTropicals&&!a.$attrs.hideTropicalsLegend]])}const ze=k(oa,[["render",Ca],["__scopeId","data-v-f0e05b29"]]),pr="",ka={name:"IdmPrecip3h",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[precip3h] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(59, 126, 162, 0)"],[14/255,"rgba(84,170,230, 0)"],[15/255,"rgba(172, 210, 255, 0.8)"],[20/255,"rgba(51,202,248,0.8)"],[30/255,"rgba(3,248,103,0.8)"],[49/255,"rgba(14,201,3,0.8)"],[57/255,"rgba(190,226,2,0.8)"],[73/255,"rgba(248,1,1,0.8)"],[82/255,"rgba(197,5,58,0.8)"],[1,"rgba(197,5,58,0.8)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},J=a=>(i.pushScopeId("data-v-9708a7a3"),a=a(),i.popScopeId(),a),Sa={key:0},Ea=[J(()=>i.createElementVNode("span",null,"mm",-1)),J(()=>i.createElementVNode("span",null,"1.5",-1)),J(()=>i.createElementVNode("span",null,"2",-1)),J(()=>i.createElementVNode("span",null,"3",-1)),J(()=>i.createElementVNode("span",null,"7",-1)),J(()=>i.createElementVNode("span",null,"10",-1)),J(()=>i.createElementVNode("span",null,"20",-1)),J(()=>i.createElementVNode("span",null,"30",-1))];function za(a,e,t,r,o,s){var n;return(n=t.factor)!=null&&n.active?(i.openBlock(),i.createElementBlock("div",Sa,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:t.bottom}])},Ea,4)])):i.createCommentVNode("",!0)}const Pa=k(ka,[["render",za],["__scopeId","data-v-9708a7a3"]]),Lr="",Na={name:"IdmVisibility",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[visibility] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(189,50,160,0.8)"],[8/255,"rgba(208,56,56,0.8)"],[27/255,"rgba(190,226,2,0.8)"],[60/255,"rgba(3,236,118,0.8)"],[160/255,"rgba(172, 210,255,0.8)"],[161/255,"rgba(172, 210,255,0)"],[1,"rgba(144,144,144,0)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ye=a=>(i.pushScopeId("data-v-f7b2fb08"),a=a(),i.popScopeId(),a),Ta={key:0},Ia=[ye(()=>i.createElementVNode("span",null,"nm",-1)),ye(()=>i.createElementVNode("span",null,"0",-1)),ye(()=>i.createElementVNode("span",null,"0.5",-1)),ye(()=>i.createElementVNode("span",null,"1.5",-1)),ye(()=>i.createElementVNode("span",null,"3",-1)),ye(()=>i.createElementVNode("span",null,"9",-1))];function Va(a,e,t,r,o,s){var n;return(n=t.factor)!=null&&n.active?(i.openBlock(),i.createElementBlock("div",Ta,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:a.right+"px",bottom:t.bottom}])},Ia,4)])):i.createCommentVNode("",!0)}const Ra=k(Na,[["render",Va],["__scopeId","data-v-f7b2fb08"]]),zr="",Da={name:"IdmWaterTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(95, 143, 197)"],[46/255,"rgba(95, 143, 197)"],[69/255,"rgb(80, 140, 62)"],[92/255,"rgb(121, 146, 28)"],[115/255,"rgb(171, 161, 14)"],[138/255,"rgb(223, 177, 69)"],[161/255,"rgb(243, 150, 6)"],[184/255,"rgb(236, 95, 21)"],[207/255,"rgb(190, 65, 18)"],[230/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},fe=a=>(i.pushScopeId("data-v-7521f582"),a=a(),i.popScopeId(),a),$a={key:0},Aa=[fe(()=>i.createElementVNode("span",null,"°C",-1)),fe(()=>i.createElementVNode("span",null,"0",-1)),fe(()=>i.createElementVNode("span",null,"10",-1)),fe(()=>i.createElementVNode("span",null,"20",-1)),fe(()=>i.createElementVNode("span",null,"30",-1)),fe(()=>i.createElementVNode("span",null,"40",-1))];function Ba(a,e,t,r,o,s){var n;return(n=t.factor)!=null&&n.active?(i.openBlock(),i.createElementBlock("div",$a,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:t.bottom}])},Aa,4)])):i.createCommentVNode("",!0)}const Ma=k(Da,[["render",Ba],["__scopeId","data-v-7521f582"]]),Dr="",ja={name:"IdmTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgb(149, 137, 211)"],[100/255,"rgb(149, 137, 211)"],[110/255,"rgb(150, 209, 216)"],[120/255,"rgb(129, 204, 197)"],[130/255,"rgb(103, 180, 186)"],[140/255,"rgb(95, 143, 197)"],[150/255,"rgb(80, 140, 62)"],[160/255,"rgb(121, 146, 28)"],[170/255,"rgb(171, 161, 14)"],[180/255,"rgb(223, 177, 6)"],[190/255,"rgb(243, 150, 6)"],[200/255,"rgb(236, 95, 21)"],[210/255,"rgb(190, 65, 18)"],[220/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},X=a=>(i.pushScopeId("data-v-25daaa82"),a=a(),i.popScopeId(),a),Oa={key:0},Wa=[X(()=>i.createElementVNode("span",null,"°C",-1)),X(()=>i.createElementVNode("span",null,"-20",-1)),X(()=>i.createElementVNode("span",null,"-10",-1)),X(()=>i.createElementVNode("span",null,"0",-1)),X(()=>i.createElementVNode("span",null,"10",-1)),X(()=>i.createElementVNode("span",null,"20",-1)),X(()=>i.createElementVNode("span",null,"30",-1)),X(()=>i.createElementVNode("span",null,"40",-1))];function Fa(a,e,t,r,o,s){var n;return(n=t.factor)!=null&&n.active?(i.openBlock(),i.createElementBlock("div",Oa,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:t.bottom}])},Wa,4)])):i.createCommentVNode("",!0)}const Ha=k(ja,[["render",Fa],["__scopeId","data-v-25daaa82"]]),Hr="",Ua={name:"IdmArctic",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(76, 165, 228, 0)"],[50/255,"rgba(76, 165, 228, 0)"],[51/255,"rgb(76, 165, 228)"],[102/255,"rgb(129, 204, 197)"],[153/255,"rgb(150, 209, 216)"],[204/255,"rgb(180, 209, 216)"],[1,"rgb(180, 209, 216)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ue=a=>(i.pushScopeId("data-v-5bb73794"),a=a(),i.popScopeId(),a),Za={key:0},Ga=[ue(()=>i.createElementVNode("span",null,"m",-1)),ue(()=>i.createElementVNode("span",null,"0",-1)),ue(()=>i.createElementVNode("span",null,"0.5",-1)),ue(()=>i.createElementVNode("span",null,"1",-1)),ue(()=>i.createElementVNode("span",null,"1.5",-1)),ue(()=>i.createElementVNode("span",null,"2",-1))];function Ja(a,e,t,r,o,s){var n;return(n=t.factor)!=null&&n.active?(i.openBlock(),i.createElementBlock("div",Za,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:t.bottom}])},Ga,4)])):i.createCommentVNode("",!0)}const Xa=k(Ua,[["render",Ja],["__scopeId","data-v-5bb73794"]]),Yr="",qa={name:"IdmPoint",emits:["point","more"],props:{map:{type:Object},show:{type:Boolean},timeZone:{type:Number,default:0},meteo:{type:Object}},data(){return{showMeteo:!1,meteoMarker:void 0,helper:ge}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){this.map&&this.show&&this.handleBind()}},meteo:{handler(){this.meteo?(this.showMeteo=!0,this.handleRender()):this.showMeteo=!1}}},computed:{computeTime(){return function(a){if(a){const e=A(a).utc().utcOffset(this.timeZone),t=this.timeZone<0?this.timeZone:"+"+this.timeZone;return`${e.format("MMM-DD,HHmm")} ( UTC ${t} )`}return"-"}},computeLat(){return function(a,e=4){return C.LngLatHelper.lat2pretty(a,e).pretty}},computeLng(){return function(a,e=4){return C.LngLatHelper.lng2pretty(a,e).pretty}},roundPrecision(){return function(a,e=4){return isNaN(a)?"-":C.LngLatHelper.roundPrecision(a,e)}}},methods:{handleBind(){var a,e;this.show?(a=this.map)==null||a.on("click",this.handleClick):((e=this.map)==null||e.off("click",this.handleClick),this.showMeteo=!1)},handleClick(a){a.originalEvent.stopPropagation();const e=a.originalEvent.target.className;e.indexOf("close")>-1?this.showMeteo=!1:e==="more"?this.$emit("more",this.meteo):this.$emit("point",a.lngLat)},handleRender(){var a;if(this.meteo){const e=document.getElementById("point-meteo");this.meteoMarker?(a=this.meteoMarker)==null||a.setLngLat([this.meteo.lng,this.meteo.lat]):this.meteoMarker=new j.Marker(e).setLngLat([this.meteo.lng,this.meteo.lat]).addTo(this.map)}}}},O=a=>(i.pushScopeId("data-v-efcf572f"),a=a(),i.popScopeId(),a),Ya={id:"point-meteo",class:"point-meteo"},Qa={class:"meteo-box"},Ka={class:"header-box"},ei={class:"main"},ti={class:"sub"},ai={class:"main-box"},ii={class:"flex-space"},oi=O(()=>i.createElementVNode("label",null,"Wind",-1)),ri={class:"flex-space"},si=O(()=>i.createElementVNode("label",null,"Wind.Wave",-1)),ni={class:"flex-space"},li=O(()=>i.createElementVNode("label",null,"Swell",-1)),ci={class:"flex-space"},hi=O(()=>i.createElementVNode("label",null,"Sig.Wave",-1)),di={class:"flex-space"},pi=O(()=>i.createElementVNode("label",null,"Current",-1)),mi={class:"flex-space"},yi=O(()=>i.createElementVNode("label",null,"Precip",-1)),fi={class:"flex-space"},ui=O(()=>i.createElementVNode("label",null,"Visibility",-1)),gi={class:"flex-space"},bi=O(()=>i.createElementVNode("label",null,"Temp",-1)),_i={class:"flex-space"},wi=O(()=>i.createElementVNode("label",null,"Water Temp",-1));function Li(a,e,t,r,o,s){var n,l,c,d,p,h,g,y,f,u,m,_,b,L,x,w,P,N,I,R,D,B,ae,ie,oe,re,se,ne,le,q,M,W,ce,F,S,$,he,H,de,Y,Q,K,_e,we,Le,ve,xe;return i.withDirectives((i.openBlock(),i.createElementBlock("div",Ya,[i.createElementVNode("div",Qa,[i.createElementVNode("div",Ka,[i.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=Ne=>o.showMeteo=!1)},""),i.createElementVNode("div",ei,i.toDisplayString(s.computeLat((n=t.meteo)==null?void 0:n.lat))+","+i.toDisplayString(s.computeLng((l=t.meteo)==null?void 0:l.lng)),1),i.createElementVNode("div",ti,i.toDisplayString(s.computeTime((c=t.meteo)==null?void 0:c.utc)),1)]),i.createElementVNode("div",ai,[i.createElementVNode("div",ii,[oi,i.createElementVNode("span",null,i.toDisplayString(((p=(d=t.meteo)==null?void 0:d.wind)==null?void 0:p.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((g=(h=t.meteo)==null?void 0:h.wind)==null?void 0:g.kts,1))+"[kts]/"+i.toDisplayString((f=(y=t.meteo)==null?void 0:y.wind)==null?void 0:f.scale)+"[BF]/"+i.toDisplayString(s.roundPrecision((m=(u=t.meteo)==null?void 0:u.gusts)==null?void 0:m.kts,1))+"[kts]",1)]),i.createElementVNode("div",ri,[si,i.createElementVNode("span",null,i.toDisplayString(((L=(b=(_=t.meteo)==null?void 0:_.wave)==null?void 0:b.wd)==null?void 0:L.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((P=(w=(x=t.meteo)==null?void 0:x.wave)==null?void 0:w.wd)==null?void 0:P.height,1))+"[m]/"+i.toDisplayString(s.roundPrecision((R=(I=(N=t.meteo)==null?void 0:N.wave)==null?void 0:I.wd)==null?void 0:R.period,1))+"[s]",1)]),i.createElementVNode("div",ni,[li,i.createElementVNode("span",null,i.toDisplayString(((ae=(B=(D=t.meteo)==null?void 0:D.wave)==null?void 0:B.swell)==null?void 0:ae.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((re=(oe=(ie=t.meteo)==null?void 0:ie.wave)==null?void 0:oe.swell)==null?void 0:re.height,1))+"[m]/"+i.toDisplayString(s.roundPrecision((le=(ne=(se=t.meteo)==null?void 0:se.wave)==null?void 0:ne.swell)==null?void 0:le.period,1))+"[s]",1)]),i.createElementVNode("div",ci,[hi,i.createElementVNode("span",null,i.toDisplayString(((W=(M=(q=t.meteo)==null?void 0:q.wave)==null?void 0:M.sig)==null?void 0:W.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((S=(F=(ce=t.meteo)==null?void 0:ce.wave)==null?void 0:F.sig)==null?void 0:S.height,1))+"[m]/"+i.toDisplayString(s.roundPrecision((H=(he=($=t.meteo)==null?void 0:$.wave)==null?void 0:he.sig)==null?void 0:H.period,1))+"[s]",1)]),i.createElementVNode("div",di,[pi,i.createElementVNode("span",null,i.toDisplayString(((Y=(de=t.meteo)==null?void 0:de.current)==null?void 0:Y.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((K=(Q=t.meteo)==null?void 0:Q.current)==null?void 0:K.kts,2))+"[kts]",1)]),i.createElementVNode("div",mi,[yi,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision((we=(_e=t.meteo)==null?void 0:_e.precip)==null?void 0:we.inter6h,2))+"[mm]",1)]),i.createElementVNode("div",fi,[ui,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision(((Le=t.meteo)==null?void 0:Le.visibility)/1852,0))+"[nm]",1)]),i.createElementVNode("div",gi,[bi,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision((ve=t.meteo)==null?void 0:ve.temp,0))+"[°C]",1)]),i.createElementVNode("div",_i,[wi,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision((xe=t.meteo)==null?void 0:xe.waterTemp,2))+"[°C]",1)])]),i.createCommentVNode("",!0)])],512)),[[i.vShow,o.showMeteo]])}const vi=k(qa,[["render",Li],["__scopeId","data-v-efcf572f"]]),xi={name:"IdmWarZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"war-zone-source",zoneLayer:"war-zone-layer",zoneLabelLayer:"war-zone-label-layer"}},watch:{zone:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-color":"#f44336","fill-opacity":.4}},this.beforeLayer),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"#f44336"}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-1]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLayer+"-border")&&this.map.removeLayer(this.zoneLayer+"-border"),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ci(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const ki=k(xi,[["render",Ci]]),Si={name:"IdmGmdssArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"gmdss-area-source",areaLayer:"gmdss-area-layer",areaLabelLayer:"gmdss-area-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["match",["get","val"],"AreaI","#EB8996","AreaII","#6F448B","AreaIII","#3E8BD3","AreaIV","#5EBCC4","AreaV","#00AAE7","AreaVI","#9CCE6D","AreaVII","#F4AE00","AreaVIII","#EF9A85","AreaIX","#00AAA7","AreaX","#7AC49F","AreaXI","#DFDFDF","AreaXII","#FFF974","AreaXIII","#EF9A85","AreaXIV","#86A2D1","AreaXV","#EC8972","AreaXVI","#EAC2DA","AreaXVII","#B9C8E7","AreaXVIII","#BBA1C8","AreaXIX","#FAE0BD","AreaXX","#DBECC8","AreaXXI","#D496AF","#ffffff"]}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-opacity":.8,"text-color":"#000"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ei(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const zi=k(Si,[["render",Ei]]),Pi={name:"IdmEcaZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"eca-zone-source",zoneLayer:"eca-zone-layer",zoneLabelLayer:"eca-zone-label-layer"}},watch:{zone:{handler(){this.zone?this.handleRender():this.handleClear()}}},methods:{handleRender(){var a;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.zone):(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":"#05f324"}}),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-color":"#04c021","line-width":1,"line-opacity":1}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-max-width":16,"text-justify":"left","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLayer+"-border")&&this.map.removeLayer(this.zoneLayer+"-border"),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ni(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Ti=k(Pi,[["render",Ni]]),Qr="",Ii={name:"IdmAlertZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"alert-zone-source",polygonLayer:"alert-zone-polygon-layer",polygonLabelLayer:"alert-zone-polygon-label-layer",lineLayer:"alert-zone-line-layer",lineLabelLayer:"alert-zone-line-label-layer",pointLayer:"alert-zone-point-layer",showZone:!1,form:{}}},watch:{zone:{handler(){var a,e;this.zone?(this.handleRender(),(a=this.map)==null||a.on("click",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleClick))}}},methods:{handleClick(a){var r;const e=a.features[0],t=(r=this.zone)==null?void 0:r.features.filter(o=>{var s;return o.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];if(t){this.showZone=!0,this.form={...t.properties};const o=document.getElementById("idm-gl3-zone-info");this.marker?this.marker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.marker=new j.Marker(o).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([0,0]).addTo(this.map)}},handleRender(){var a;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.zone):(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.polygonLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"fill-outline-color":"#d57d02","fill-opacity":.4,"fill-color":"#d57d02"}}),this.map.addLayer({id:this.polygonLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-width":1,"line-color":"#d57d02"}}),this.map.addLayer({id:this.lineLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],paint:{"line-color":"#d57d02","line-width":2}}),this.map.addLayer({id:this.polygonLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"alert","icon-size":.08,"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}}),this.map.addLayer({id:this.lineLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],layout:{"symbol-placement":"line-center","icon-image":"alert","icon-size":.08,"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}}),this.map.addLayer({id:this.pointLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"alert","icon-size":.08},paint:{"icon-opacity":.8}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.polygonLayer)&&this.map.removeLayer(this.polygonLayer),this.map.getLayer(this.polygonLayer+"-border")&&this.map.removeLayer(this.polygonLayer+"-border"),this.map.getLayer(this.polygonLabelLayer)&&this.map.removeLayer(this.polygonLabelLayer),this.map.getLayer(this.lineLayer)&&this.map.removeLayer(this.lineLayer),this.map.getLayer(this.lineLabelLayer)&&this.map.removeLayer(this.lineLabelLayer),this.map.getLayer(this.pointLayer)&&this.map.removeLayer(this.pointLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},Vi={id:"idm-gl3-zone-info"},Ri=["innerHTML"];function Di(a,e,t,r,o,s){var n;return i.withDirectives((i.openBlock(),i.createElementBlock("div",Vi,[i.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=l=>o.showZone=!1)},""),i.createElementVNode("div",{class:"rich-context",innerHTML:(n=o.form)==null?void 0:n.name},null,8,Ri)],512)),[[i.vShow,o.showZone]])}const $i=k(Ii,[["render",Di]]),Kr="",Ai={name:"IdmPort",props:{map:{type:Object},port:{type:Object},beforeLayer:{type:String}},emits:["port"],data(){return{source:"port-source",layer:"port-layer",showPort:!1,form:{},marker:void 0}},computed:{computeLat(){return function(a){return C.LngLatHelper.lat2pretty(a,4).pretty}},computeLng(){return function(a){return C.LngLatHelper.lng2pretty(a,4).pretty}}},watch:{port:{handler(){var a,e;this.port?(this.handleRender(),(a=this.map)==null||a.on("click",[this.layer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.layer],this.handleClick))}}},methods:{handleClick(a){var r;const e=a.features[0],t=(r=this.port)==null?void 0:r.features.filter(o=>{var s;return o.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];if(t){this.showPort=!0,this.form={...t.properties},this.form.lng=t.geometry.coordinates[0],this.form.lat=t.geometry.coordinates[1];const o=document.getElementById("port-info");this.marker?this.marker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.marker=new j.Marker(o).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([0,-85]).addTo(this.map)}},handleEmit(){this.$emit("port",this.form)},handleRender(){var a;this.map?this.port&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.port):(this.map.addSource(this.source,{type:"geojson",data:this.port}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"port","text-anchor":"left","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[1,0]},paint:{"text-color":"rgba(0, 0, 0, 0.8)","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.showPort=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},ke=a=>(i.pushScopeId("data-v-c07e4c45"),a=a(),i.popScopeId(),a),Bi={id:"port-info"},Mi={class:"port-box"},ji={class:"flex-start"},Oi=ke(()=>i.createElementVNode("label",null,"Name : ",-1)),Wi={class:"flex-start"},Fi=ke(()=>i.createElementVNode("label",null,"Position : ",-1)),Hi={class:"flex-start"},Ui=ke(()=>i.createElementVNode("label",null,"LoCode : ",-1)),Zi={class:"flex-start",style:{"align-items":"flex-start"}},Gi=ke(()=>i.createElementVNode("label",null,"Region : ",-1));function Ji(a,e,t,r,o,s){return i.withDirectives((i.openBlock(),i.createElementBlock("div",Bi,[i.createElementVNode("div",{class:"close iconfont",onClick:e[0]||(e[0]=n=>o.showPort=!1)},""),i.createElementVNode("div",Mi,[i.createElementVNode("div",ji,[Oi,i.createElementVNode("span",{onClick:e[1]||(e[1]=(...n)=>s.handleEmit&&s.handleEmit(...n))},i.toDisplayString(o.form.name),1)]),i.createElementVNode("div",Wi,[Fi,i.createElementVNode("span",null,i.toDisplayString(s.computeLat(o.form.lat))+", "+i.toDisplayString(s.computeLng(o.form.lng)),1)]),i.createElementVNode("div",Hi,[Ui,i.createElementVNode("span",null,i.toDisplayString(o.form.loCode||"-"),1)]),i.createElementVNode("div",Zi,[Gi,i.createElementVNode("span",null,i.toDisplayString(o.form.zoneName||"-"),1)])])],512)),[[i.vShow,o.showPort]])}const Xi=k(Ai,[["render",Ji],["__scopeId","data-v-c07e4c45"]]),qi={name:"IdmLoadLine",props:{map:{type:Object},line:{type:Object},beforeLayer:{type:String}},data(){return{source:"load-line-source",lineLayer:"load-line-layer",lineLabelLayer:"load-line-label-layer"}},watch:{line:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.line&&(this.map.addSource(this.source,{type:"geojson",data:this.line}),this.map.addLayer({id:this.lineLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.75,"fill-color":["match",["get","val"],"LLGreen","#A0C0C0","LLRed","#F5A39D","LLBlue","#6B94E4","#ffffff"]}},this.beforeLayer),this.map.addLayer({id:this.lineLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{lbl} (Length < {shipLength}, {start} - {end})","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":.8}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.lineLayer)&&this.map.removeLayer(this.lineLayer),this.map.getLayer(this.lineLabelLayer)&&this.map.removeLayer(this.lineLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Yi(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Qi=k(qi,[["render",Yi]]),Ki={name:"IdmTimezone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"time-zone-source",zoneLayer:"time-zone-layer",zoneLabelLayer:"time-zone-label-layer"}},watch:{zone:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["match",["get","offSet"],"-11.5","rgba(255,0,0,0.4)","-11","rgba(0,255,0,0.3)","-10.5","rgba(0,255,0,0.3)","-10","rgba(0,0,255,0.3)","-9.5","rgba(0,0,255,0.3)","-9","rgba(255,0,0,0.4)","-8.5","rgba(255,0,0,0.4)","-8","rgba(0,255,0,0.3)","-7.5","rgba(0,255,0,0.3)","-7","rgba(0,0,255,0.3)","-6.5","rgba(0,0,255,0.3)","-6","rgba(255,0,0,0.4)","-5.5","rgba(255,0,0,0.4)","-5","rgba(0,255,0,0.3)","-4.5","rgba(0,255,0,0.3)","-4","rgba(0,0,255,0.3)","-3.5","rgba(0,0,255,0.3)","-3","rgba(255,0,0,0.4)","-2.5","rgba(255,0,0,0.4)","-2","rgba(0,255,0,0.3)","-1.5","rgba(0,255,0,0.3)","-1","rgba(0,0,255,0.3)","-0.5","rgba(0,0,255,0.3)","+0","rgba(255,0,0,0.4)","+0.5","rgba(255,0,0,0.4)","+1","rgba(0,255,0,0.3)","+1.5","rgba(0,255,0,0.3)","+2","rgba(0,0,255,0.3)","+2.5","rgba(0,0,255,0.3)","+3","rgba(255,0,0,0.4)","+3.5","rgba(255,0,0,0.4)","+4","rgba(0,255,0,0.3)","+4.5","rgba(0,255,0,0.3)","+5","rgba(0,0,255,0.3)","+5.5","rgba(0,0,255,0.3)","+6","rgba(255,0,0,0.4)","+6.5","rgba(255,0,0,0.4)","+7","rgba(0,255,0,0.3)","+7.5","rgba(0,255,0,0.3)","+8","rgba(0,0,255,0.3)","+8.5","rgba(0,0,255,0.3)","+9","rgba(255,0,0,0.4)","+9.5","rgba(255,0,0,0.4)","+10","rgba(0,255,0,0.3)","+10.5","rgba(0,255,0,0.3)","+11","rgba(0,0,255,0.3)","+11.5","rgba(0,0,255,0.3)","rgba(255,0,0,0.4)"]}}),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{offSet}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,1]},paint:{"text-opacity":.8,"text-color":"#fff"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function eo(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const to=k(Ki,[["render",eo]]),ao={name:"IdmVoluntaryReportingArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"vra-source",areaLayer:"vra-layer",areaLabelLayer:"vra-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":"#9f30f9"}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"#9f30f9"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function io(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const oo=k(ao,[["render",io]]),ro={name:"IdmSpecialArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"special-area-source",areaLayer:"special-area-layer",areaLabelLayer:"special-area-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.area.features.forEach(a=>{a.geometry.type==="Polygon"&&a.geometry.coordinates.forEach(e=>C.LngLatHelper.convertToMonotonicLng2(e))}),this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":["match",["get","val"],"DefaultStyle","rgb(0,0,0)","JWCriskArea","rgb(0,0,0)","rgb(0,0,0)"]}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":.4,"line-color":"rgb(0,0,0)"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function so(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const no=k(ro,[["render",so]]),lo={name:"IdmTerminator",props:{map:{type:Object},area:{type:Object}},data(){return{source:"terminator-source",layer:"terminator-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.layer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":"rgba(0, 0, 0, 0.4)"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function co(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const ho=k(lo,[["render",co]]),es="",po={name:"IdmLatLng",props:{map:{type:Object},show:{type:Boolean},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{lngLat:void 0,source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var a;this.map&&((a=this.map)==null||a.on("mousemove",this.handleMouseMove))},immediate:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("legend-bars")[0])==null?void 0:a.clientWidth)||-10)+(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+20},immediate:!0}},methods:{handleBind(){var a,e;this.show?((a=this.map)==null||a.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(a){const e=a.lngLat,t=C.LngLatHelper.lng2pretty(e.lng,2),r=C.LngLatHelper.lat2pretty(e.lat,2);this.lngLat={lng:t,lat:r}},handleComputeLatLngs(){var r;const a=(r=this.map)==null?void 0:r.getZoom();console.log(a);let e=30;a>4?e=10:a>3&&(e=15);const t=[];for(let o=-60;o<90;o+=e)t.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,o],[180,o]]}});for(let o=-180;o<180;o+=e)t.push({type:"Feature",geometry:{type:"LineString",coordinates:[[o,-90],[o,90]]}});for(let o=180;o>-180;o-=e)for(let s=-60;s<90;s+=e)t.push({type:"Feature",geometry:{type:"Point",coordinates:[o,s]},properties:{val:`${s>0?s+" N":s===0?s:s*-1+" S"}, ${o>0?o+" E":o*-1+" W"}`}});return t},handleZoomEnd(){var e;const a=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(v.featureCollection(a))},handleRender(){if(this.map){const a=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:a}}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"rgba(0, 0, 0, 0.3)","line-width":1}}),this.map.addLayer({id:this.labelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{val}","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":.8}})}},handleClear(){var a,e,t,r,o,s;(a=this.map)!=null&&a.getLayer(this.layer)&&((e=this.map)==null||e.removeLayer(this.layer)),(t=this.map)!=null&&t.getLayer(this.labelLayer)&&((r=this.map)==null||r.removeLayer(this.labelLayer)),(o=this.map)!=null&&o.getSource(this.source)&&((s=this.map)==null||s.removeSource(this.source))}}},mo=(a=>(i.pushScopeId("data-v-73241fe7"),a=a(),i.popScopeId(),a))(()=>i.createElementVNode("span",null,", ",-1));function yo(a,e,t,r,o,s){return o.lngLat?(i.openBlock(),i.createElementBlock("div",{key:0,class:"lat-lng-tip",style:i.normalizeStyle({right:o.right+"px",bottom:t.bottom})},[i.createElementVNode("span",null,i.toDisplayString(o.lngLat.lat.pretty),1),mo,i.createElementVNode("span",null,i.toDisplayString(o.lngLat.lng.pretty),1)],4)):i.createCommentVNode("",!0)}const Pe=k(po,[["render",yo],["__scopeId","data-v-73241fe7"]]),fo={name:"IdmMeasure",props:{map:{type:Object},show:{type:Boolean}},data(){return{geojson:[],source:"measure-source",layer:"measure-layer",labelLayer:"measure-label-layer",tmpSource:"measure-tmp-source",tmpLayer:"measure-tmp-layer",tmpLabelLayer:"measure-tmp-label-layer",closeMarkers:{},pointMarkers:{},tipMarker:void 0,contextmenu:void 0,navigation:"RL"}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){this.map&&this.handleBind()}}},methods:{handleBind(){var a,e,t,r,o,s,n,l,c,d;if(this.show)(a=this.map)==null||a.getCanvas().addEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.on("mousemove",this.handleMove),(t=this.map)==null||t.on("dblclick",this.handleDblClick),(r=this.map)==null||r.on("click",this.handleClick),(o=this.map)==null||o.on("contextmenu",this.handleContextmenu),this.map&&(this.map.getCanvas().style.cursor="crosshair");else{(s=this.map)==null||s.getCanvas().removeEventListener("keydown",this.handleKeydown),(n=this.map)==null||n.off("mousemove",this.handleMove),(l=this.map)==null||l.off("dblclick",this.handleDblClick),(c=this.map)==null||c.off("click",this.handleClick),(d=this.map)==null||d.off("contextmenu",this.handleContextmenu);for(const p of this.geojson)this.handleClear(p,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")}},handleKeydown(a){if(a.key==="Shift"){this.navigation=this.navigation==="RL"?"GC":"RL";const t=this.geojson.at(-1).features.filter(r=>r.geometry.type==="Point");t.length&&(t.at(-1).properties.mode=this.navigation)}},handleDrag(a){var t,r,o,s,n,l,c,d,p,h;const e=(r=(t=a.target)==null?void 0:t._element)==null?void 0:r.id;if((e==null?void 0:e.split("-").length)===2){const g=this.geojson.filter(m=>m.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(m=>{var _;return((_=m._element)==null?void 0:_.id)===e})[0].setLngLat([(s=(o=a.target)==null?void 0:o._lngLat)==null?void 0:s.lng,(l=(n=a.target)==null?void 0:n._lngLat)==null?void 0:l.lat]);let f;g.features.forEach((m,_)=>{if(m.geometry.type==="Point"&&m.properties.id==e.split("-")[1]){f=_;return}});const u=g.features.filter(m=>m.geometry.type==="Point");this.handleTmpPointUpdate(g,u[f-1],{lng:(d=(c=a.target)==null?void 0:c._lngLat)==null?void 0:d.lng,lat:(h=(p=a.target)==null?void 0:p._lngLat)==null?void 0:h.lat,properties:u[f].properties},f===u.length-1?void 0:u[f+1])}},handleDragEnd(a){var t,r,o,s,n,l,c,d,p,h;const e=(r=(t=a.target)==null?void 0:t._element)==null?void 0:r.id;if((e==null?void 0:e.split("-").length)===2){const g=this.geojson.filter(u=>u.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(u=>{var m;return((m=u._element)==null?void 0:m.id)===e})[0].setLngLat([(s=(o=a.target)==null?void 0:o._lngLat)==null?void 0:s.lng,(l=(n=a.target)==null?void 0:n._lngLat)==null?void 0:l.lat]);const f=g.features.filter(u=>u.geometry.type==="Point"&&u.properties.id==e.split("-")[1])[0];f.geometry.coordinates=[(d=(c=a.target)==null?void 0:c._lngLat)==null?void 0:d.lng,(h=(p=a.target)==null?void 0:p._lngLat)==null?void 0:h.lat],g.features=g.features.filter(u=>u.geometry.type==="Point"),this.handlePointUpdate(g)}},handleContextmenu(a){var t,r,o,s;a.preventDefault(),(t=this.contextmenu)==null||t.remove();const e=(s=(o=(r=a.originalEvent)==null?void 0:r.target)==null?void 0:o.parentElement)==null?void 0:s.id;if((e==null?void 0:e.split("-").length)===2){const l=this.geojson.filter(c=>c.id===e.split("-")[0])[0].features.filter(c=>c.geometry.type==="Point");if(l.length>2&&l.filter(d=>d.properties.id===(e==null?void 0:e.split("-")[1]))[0]){const d=document.createElement("div");d.className="point-contextmenu-marker",d.innerHTML=`<span id="del-${e}" class="del-point">Del</span>`,this.contextmenu=new j.Marker(d).setOffset([24,0]).setLngLat([a.lngLat.lng,a.lngLat.lat]).addTo(this.map)}}},handleClick(a){var t,r,o,s,n;(t=this.contextmenu)==null||t.remove();const e=a.originalEvent.target.className;if(e==="marker-close"){const l=(o=(r=a.originalEvent)==null?void 0:r.srcElement)==null?void 0:o.id,c=this.geojson.filter(d=>d.id===l)[0];c&&this.handleClear(c,!0),this.geojson=this.geojson.filter(d=>d.id!==l)}else if(e==="del-point"){const l=(n=(s=a.originalEvent.target.id)==null?void 0:s.replace("del-",""))==null?void 0:n.split("-"),c=this.geojson.filter(d=>d.id===l[0])[0];c.features=c.features.filter(d=>d.geometry.type==="Point"&&d.properties.id!==l[1]),this.handlePointUpdate(c)}else if(e!=="marker-label"){let l=this.geojson.at(-1);l||(l=v.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(l)),l.features=l.features.filter(d=>d.geometry.type==="Point");const c=v.feature({type:"Point",coordinates:[a.lngLat.lng,a.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation});l.features.push(c),this.handlePointUpdate(l)}},handlePointUpdate(a){const e=a.features;if(e.length>1){let t=0;const r=[];for(let o=1;o<e.length;o++){const s=e[o-1],n=e[o],l=s.properties,c={lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1]},d={lng:n.geometry.coordinates[0],lat:n.geometry.coordinates[1]},p=C.LaneHelper.calculateDistance(c,d,l.mode==="RL",2),h=C.LaneHelper.calculateBearing(c,d,l.mode==="RL",2);t=C.LngLatHelper.roundPrecision(t+p,2);let g;l.mode==="RL"?g=C.LngLatHelper.convertToMonotonicLng([c,d]):g=C.LngLatHelper.convertToMonotonicLng(C.LaneHelper.interpolateCoordinates(c,d,200));const y=v.lineString(g.map(f=>[f.lng,f.lat]));y.properties.dist=p,y.properties.bearing=h,y.properties.total=t,r.push(y)}e.push(...r),a.total=t}return this.handleRender(a),a},handleTmpPointUpdate(a,e,t,r){const o=v.featureCollection([]);let s,n;if(e){const c=e.properties,d={lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]},p={lng:t.lng,lat:t.lat};s=C.LaneHelper.calculateDistance(d,p,c.mode==="RL",2),n=C.LaneHelper.calculateBearing(d,p,c.mode==="RL",2);let h;c.mode==="RL"?h=C.LngLatHelper.convertToMonotonicLng([d,p]):h=C.LngLatHelper.convertToMonotonicLng(C.LaneHelper.interpolateCoordinates(d,p,200));const g=v.lineString(h.map(y=>[y.lng,y.lat]));g.properties.dist=s,g.properties.bearing=n,o.features.push(g)}if(r){const c=t.properties,d=t,p={lng:r.geometry.coordinates[0],lat:r.geometry.coordinates[1]};s=C.LaneHelper.calculateDistance(d,p,c.mode==="RL",2),n=C.LaneHelper.calculateBearing(d,p,c.mode==="RL",2);let h;c.mode==="RL"?h=C.LngLatHelper.convertToMonotonicLng([d,p]):h=C.LngLatHelper.convertToMonotonicLng(C.LaneHelper.interpolateCoordinates(d,p,200));const g=v.lineString(h.map(y=>[y.lng,y.lat]));g.properties.dist=s,g.properties.bearing=n,o.features.push(g)}this.map.getSource(this.tmpSource)?this.map.getSource(this.tmpSource).setData(o):this.map.addSource(this.tmpSource,{type:"geojson",data:o}),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":"#F44336","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":12},paint:{"text-opacity":1,"text-color":"#fff","text-halo-color":"#F44336","text-halo-width":4,"text-halo-blur":0}});let l;if(r?l='<div class="marker-label">Drag and drop</div>':l=`<div class="marker-label">Tol distance: <b>${C.LngLatHelper.roundPrecision((a.total??0)+s,2)}</b>nm, bearing: <b>${n}</b>°</div><div class="marker-label">${this.navigation==="RL"?"RL":"GC"} mode, using 'Shift' to switch</div><div class="marker-label">Double click to end</div>`,this.tipMarker)this.tipMarker._element.innerHTML=l,this.tipMarker.setLngLat([t.lng,t.lat]);else{const c=document.createElement("div");c.className="tip-marker",c.innerHTML=l,this.tipMarker=new j.Marker(c).setOffset([140,0]).setLngLat([t.lng,t.lat]).addTo(this.map)}},handleMove(a){this.map.getCanvas().style.cursor="crosshair";let e=this.geojson.at(-1);e||(e=v.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e));const t=e.features.filter(r=>r.geometry.type==="Point");t!=null&&t.length&&this.handleTmpPointUpdate(e,t.at(-1),{lng:a.lngLat.lng,lat:a.lngLat.lat})},handleDblClick(a){a.preventDefault();let e=this.geojson.at(-1);e.closed=!0,this.handleRender(e),e=v.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e)},handleRender(a){var e;if((e=a==null?void 0:a.features)!=null&&e.length){const t=`${a.id}-${this.source}`,r=`${a.id}-${this.layer}`,o=`${a.id}-${this.labelLayer}`;this.map.getSource(t)?this.map.getSource(t).setData(a):this.map.addSource(t,{type:"geojson",data:a}),this.handleClear(a,!1),this.map.addLayer({id:r,type:"line",source:t,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F44336","line-width":2}}),this.map.addLayer({id:o,type:"symbol",source:t,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist}nm,{bearing}°","text-rotation-alignment":"map","text-size":12},paint:{"text-opacity":1,"text-color":"#fff","text-halo-color":"#F44336","text-halo-width":4,"text-halo-blur":0}});const s=a.features.filter(n=>n.geometry.type==="Point");for(const n of s){const l=document.createElement("div");l.id=`${a.id}-${n.properties.id}`,l.className=`${a.closed?"point-marker closed":"point-marker"}`,l.innerHTML='<div class="marker-circle"></div>';const c=new j.Marker({element:l,draggable:!0,contextmenu:!0}).setLngLat(n.geometry.coordinates).addTo(this.map);c.on("drag",this.handleDrag),c.on("dragend",this.handleDragEnd),this.pointMarkers[a.id]?this.pointMarkers[a.id].push(c):this.pointMarkers[a.id]=[c]}if(a.closed){const n=s.at(-1),c=a.features.filter(p=>p.geometry.type==="LineString").at(-1),d=document.createElement("div");d.className="point-summary-marker",d.innerHTML=`<div id="${a.id}" class="marker-close">×</div><div class="marker-label">Tol: ${c.properties.total}nm</div>`,this.closeMarkers[a.id]=new j.Marker(d).setOffset([60,0]).setLngLat(n.geometry.coordinates).addTo(this.map)}}},handleClear(a,e=!0){var s,n,l,c,d,p,h,g,y;const t=`${a.id}-${this.source}`,r=`${a.id}-${this.layer}`,o=`${a.id}-${this.labelLayer}`;(s=this.map)!=null&&s.getLayer(r)&&this.map.removeLayer(r),(n=this.map)!=null&&n.getLayer(o)&&this.map.removeLayer(o),(l=this.map)!=null&&l.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(c=this.map)!=null&&c.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(d=this.closeMarkers[a.id])==null||d.remove(),this.closeMarkers[a.id]=void 0,(p=this.pointMarkers[a.id])==null||p.forEach(f=>{f==null||f.remove()}),this.pointMarkers[a.id]=[],(h=this.tipMarker)==null||h.remove(),this.tipMarker=void 0,e&&((g=this.map)!=null&&g.getSource(t))&&this.map.removeSource(t),e&&((y=this.map)!=null&&y.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}};function uo(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const go=k(fo,[["render",uo]]),as="",bo={name:"IdmENC",props:{map:{type:Object},enabled:{type:Boolean},beforeLayer:{type:String,default:"grayland"},bottom:{type:String,default:"260px"},token:{type:String,default:""},toggleVersion:{type:Number},permission:{type:Number}},emits:["enc"],data(){return{helper:ge,vendor:this.$attrs.permission&ge.LEVEL.Supper?"hi":"i4",right:10}},watch:{vendor:{handler(){this.$emit("enc",this.vendor)},immediate:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{}},Ie=a=>(i.pushScopeId("data-v-8928221f"),a=a(),i.popScopeId(),a),_o={key:0},wo={class:"bar-item"},Lo=[Ie(()=>i.createElementVNode("span",{class:"iconfont"},"HI",-1))],vo=[Ie(()=>i.createElementVNode("span",{class:"iconfont"},"I4",-1))];function xo(a,e,t,r,o,s){const n=i.resolveComponent("ElTooltip");return t.enabled&&t.permission&o.helper.LEVEL.Supper?(i.openBlock(),i.createElementBlock("div",_o,[i.createElementVNode("div",{class:"menu-bar-box",style:i.normalizeStyle({position:"absolute",right:o.right+"px",bottom:t.bottom})},[i.createElementVNode("div",wo,[i.createVNode(n,{placement:"left",effect:"light",content:"Hifleet","show-after":2e3},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(o.vendor==="hi"?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=l=>o.vendor="hi")},Lo,2)]),_:1}),i.createVNode(n,{placement:"left",effect:"light",content:"I4insight","show-after":2e3},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(o.vendor==="i4"?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=l=>o.vendor="i4")},vo,2)]),_:1})])],4)])):i.createCommentVNode("",!0)}const Co=k(bo,[["render",xo],["__scopeId","data-v-8928221f"]]),rs="",ko={name:"IdmGLV2",components:{IdmGlLayer:xt,IdmWindBarb:Pt,IdmWindParticle:Rt,IdmCurrents:jt,IdmCurrentParticle:Ut,IdmSigWave:Jt,IdmSwell:Yt,IdmPrmsl:ea,IdmIceberg:ia,IdmTropicals:ze,IdmPrecip3h:Pa,IdmVisibility:Ra,IdmWaterTemp:Ma,IdmTemp:Ha,IdmArctic:Xa,IdmWarZone:ki,IdmGmdssArea:zi,IdmEcaZone:Ti,IdmAlertZone:$i,IdmPort:Xi,IdmLoadLine:Qi,IdmTimezone:to,IdmVRA:oo,IdmSpecialArea:no,IdmTerminator:ho,IdmLatLng:Pe,IdmMeasure:go,IdmPoint:vi,IdmENC:Co},props:{map:{type:Object,default:void 0},token:{type:String},ts:{type:String},beforeLayer:{type:String,default:""},toggleVersion:{type:Number}},emits:["toggleVersion","activeWeatherLayers"],data(){return{weatherLayers:{},activeWeatherLayers:[],weatherWeight:0,otherLayers:{},otherWeight:0,showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,meteo:void 0,source:"",gateway:"https://cbe.idmwx.com",mapProjection:"mercator",zoom:6,viewport:void 0,particleFactor:void 0,showRampColor:!1,activeWindLayer:!1,showWindParticle:!1,showCurrentParticle:!1,enc:"",defaultMeteoToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg",helper:new Te}},watch:{ts:{handler(a,e){a&&e&&A(a).utc().format("yyyy-MM-DD HH")!==A(e).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.handleDateChange({tropicals:!1})})},immediate:!0},map:{handler(){this.map&&(this.map.on("zoomend",this.handleDragEndWithZoom4Json),this.map.on("dragend",this.handleDragEndWithZoom4Json),this.map.on("move",this.handleDragEndWithZoom4Image),this.viewport=new Ce(this.map),this.handleRampColorInitial())},immediate:!0},enc:{handler(a,e){var t,r,o,s,n,l,c,d;a?((r=(t=this.map)==null?void 0:t.getLayer(a))==null||r.setLayoutProperty("visibility","visible"),(s=(o=this.map)==null?void 0:o.getLayer(e))==null||s.setLayoutProperty("visibility","none")):((l=(n=this.map)==null?void 0:n.getLayer("i4"))==null||l.setLayoutProperty("visibility","none"),(d=(c=this.map)==null?void 0:c.getLayer("hi"))==null||d.setLayoutProperty("visibility","none"))}},activeWeatherLayers:{handler(){var a,e,t,r,o,s,n,l,c,d,p,h,g,y,f,u,m,_;if(!this.map)return!1;this.activeWeatherLayers.length>0?((e=(a=this.map)==null?void 0:a.getLayer(this.enc))==null||e.setLayoutProperty("visibility","none"),(r=(t=this.map)==null?void 0:t.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||r.setLayoutProperty("visibility","visible"),(s=this.map)!=null&&s.getLayer((o=this.viewport)==null?void 0:o.rampColorLayer)&&((n=this.map)!=null&&n.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((c=this.map)==null||c.moveLayer((l=this.viewport)==null?void 0:l.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(p=this.map)!=null&&p.getLayer((d=this.viewport)==null?void 0:d.particleLayer)&&((h=this.map)!=null&&h.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((y=this.map)==null||y.moveLayer((g=this.viewport)==null?void 0:g.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id))):((u=(f=this.map)==null?void 0:f.getLayer(this.enc))==null||u.setLayoutProperty("visibility","visible"),(_=(m=this.map)==null?void 0:m.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||_.setLayoutProperty("visibility","none")),this.$emit("activeWeatherLayers",this.activeWeatherLayers)},immediate:!0}},methods:{async fetchWeatherLayers(a={tropicals:!1}){var o,s,n,l,c,d,p,h;const e=new Date().valueOf();let t=0,r=0;if(this.map){const g=((o=this.map)==null?void 0:o.getZoom())+1,y=(s=this.map)==null?void 0:s.getBounds(),f=`${y._sw.lng},${y._sw.lat},${y._ne.lng},${y._ne.lat}`;if(this.handleRampColorState(),this.particleFactor){const u=be.WEATHER_LAYERS.find(m=>{var _;return((_=m.peer)==null?void 0:_.weight)===this.particleFactor.weight});this.particleFactor.particle?this.weatherWeight=this.weatherWeight&u.weight?this.weatherWeight:this.weatherWeight+u.weight:this.weatherWeight=this.weatherWeight&u.weight?this.weatherWeight-u.weight:this.weatherWeight}if(this.weatherWeight>0){let u=this.weatherWeight,m;if(a.tropicals||this.weatherWeight&256&&(m=this.weatherLayers.tropicals,m&&(u-=256,m.version=Math.random()+1)),u>0){const _=await U.get(`${this.gateway}/api/arc/weather/layers/links?l=${u}&v=${this.source}&z=${g}&bbox=${f}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(r=new Date().valueOf()-(e+t),console.log("weather links elapsed: ",r,", total: ",t+=r),((n=_==null?void 0:_.data)==null?void 0:n.code)===0){const b=(l=_==null?void 0:_.data)==null?void 0:l.data,L=[];for(const w in b)w==="ice-edge"&&(b[w]="https://idm-hz.oss-cn-hangzhou.aliyuncs.com/test/sea_ice_contours.geojson"),w!=="tropicals"&&L.push(U.get(b[w],{headers:{Authorization:this.token||this.defaultMeteoToken,key:w},responseType:/\.(jpg|png)$/.test(b[w])?"blob":"json"}).catch(P=>{console.log(`[${w}] fetch layer error: ${P}`)}));const x=await Promise.all(L);this.weatherLayers={},x.map(w=>{var I,R,D,B;const P=((I=w==null?void 0:w.data)==null?void 0:I.data)||(w==null?void 0:w.data),N=(D=(R=w==null?void 0:w.config)==null?void 0:R.headers)==null?void 0:D.key;N&&P&&(this.weatherLayers[N]={raw:P,type:((B=w==null?void 0:w.config)==null?void 0:B.responseType)==="blob"?"image":"json",etime:this.ts})}),b.tropicals&&U.get(b.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"}}).then(w=>{var I,R,D;const P=C.TropicalHelper.convert2Geojson(((I=w==null?void 0:w.data)==null?void 0:I.data)||(w==null?void 0:w.data)),N=(D=(R=w==null?void 0:w.config)==null?void 0:R.headers)==null?void 0:D.key;this.weatherLayers[N]={data:P,active:!0,cached:!1,type:"json",etime:this.ts,version:Math.random()+1}})}if(r=new Date().valueOf()-(e+t),console.log("weather layers elapsed: ",r,", total: ",t+=r),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const b=(c=this.weatherLayers["swell-direction"])==null?void 0:c.raw,L=(d=this.weatherLayers["swell-height"])==null?void 0:d.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:b,height:{raw:L},etime:this.ts}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const b=(p=this.weatherLayers["current-direction"])==null?void 0:p.raw,L=(h=this.weatherLayers["current-speed"])==null?void 0:h.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:b,speed:{raw:L},etime:this.ts}}}m&&(m.etime=this.ts,m.cached=!0,this.weatherLayers.tropicals=m)}this.handleWeatherLayerToggle(),this.handleDragEndWithZoom4Json()}this.$emit("toggleVersion",Math.random())},async fetchOtherLayers(a={all:!1,dayNight:!1,enc:!1}){var e,t,r,o;if(this.map){let s=this.otherWeight;if(s){let n=!1;if(this.otherWeight&2048&&(s=this.otherWeight-2048,n=!0),s){if(a.all){const l=await U.get(`${this.gateway}/api/arc/other/layers/links?l=${s}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((e=l==null?void 0:l.data)==null?void 0:e.code)===0){const c=(t=l==null?void 0:l.data)==null?void 0:t.data,d=[];for(const h in c)d.push(U.get(c[h],{headers:{Authorization:this.token||this.defaultMeteoToken,key:h}}));const p=await Promise.all(d);this.otherLayers={enc:n},p.map(h=>{var f,u,m;const g=((f=h==null?void 0:h.data)==null?void 0:f.data)||(h==null?void 0:h.data),y=(m=(u=h==null?void 0:h.config)==null?void 0:u.headers)==null?void 0:m.key;this.otherLayers[y]=g})}}else if(a.dayNight&&s&1024){const l=await U.get(`${this.gateway}/api/arc/other/layers/links?l=1024&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((r=l==null?void 0:l.data)==null?void 0:r.code)===0){const c=(o=l==null?void 0:l.data)==null?void 0:o.data,d=[];for(const h in c)d.push(U.get(c[h],{headers:{Authorization:this.token||this.defaultMeteoToken,key:h}}));(await Promise.all(d)).map(h=>{var f,u,m;const g=((f=h==null?void 0:h.data)==null?void 0:f.data)||(h==null?void 0:h.data),y=(m=(u=h==null?void 0:h.config)==null?void 0:u.headers)==null?void 0:m.key;this.otherLayers[y]=g})}}}else this.otherLayers={enc:n}}else this.otherLayers={};this.handleBeforeLayerToggle()}},handleRampColorState(){var a;if(this.showRampColor=!1,this.showWindParticle=!1,this.showCurrentParticle=!1,(a=this.particleFactor)!=null&&a.particle)this.showRampColor=!0,this.showWindParticle=this.particleFactor.key==="wind",this.showCurrentParticle=this.particleFactor.key==="current",this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.type==="json");else for(const e of this.activeWeatherLayers)["png","jpg"].includes(e.type)&&(this.showRampColor=!0);this.activeWindLayer=!!this.activeWeatherLayers.find(e=>e.key==="wind"),this.$refs.layer&&(this.$refs.layer.activeWeatherLayers=this.activeWeatherLayers)},handleRampColorInitial(){var a,e,t,r,o,s,n,l,c,d,p,h;this.viewport.map.getSource((a=this.viewport)==null?void 0:a.rampColorSource)||this.viewport.map.addSource((e=this.viewport)==null?void 0:e.rampColorSource,{type:"canvas",canvas:(t=this.viewport)==null?void 0:t.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((r=this.viewport)==null?void 0:r.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(o=this.viewport)==null?void 0:o.rampColorLayer,source:(s=this.viewport)==null?void 0:s.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((n=this.viewport)==null?void 0:n.particleSource)||this.viewport.map.addSource((l=this.viewport)==null?void 0:l.particleSource,{type:"canvas",canvas:(c=this.viewport)==null?void 0:c.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((d=this.viewport)==null?void 0:d.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(p=this.viewport)==null?void 0:p.particleLayer,source:(h=this.viewport)==null?void 0:h.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDragEndWithZoom4Json(){var d,p,h,g;const a=new Date().valueOf();let e=0,t=0;const r=(d=this.map)==null?void 0:d.getBounds(),o=this.map.getZoom(),s=C.LngLatHelper.convertToStdLng(r._sw.lng),n=C.LngLatHelper.convertToStdLng(r._ne.lng),l=Math.floor(r._sw.lat),c=Math.ceil(r._ne.lat);for(const y in this.weatherLayers)if(this.weatherLayers[y].active&&this.weatherLayers[y].type==="json"){this.weatherLayers[y].active=!1,this.weatherLayers[y].version=Math.random()+1;let f=[];if(["swell","current"].includes(y)){const u=((p=this.weatherLayers[y])==null?void 0:p.direction)||{};for(const m in u)if(m>l&&m<c&&(!(o<=this.zoom)||m%(o<this.zoom/2?5:3)===0)){const _=u[m].lng;s>n?_.forEach((b,L)=>{var x;if((b>=s&&b<=180||b>=-180&&b<=n)&&(!(o<=this.zoom)||b%(o<this.zoom/2?5:3)===0)){const w=v.point([b,m],{val:u[m].val[L],spd:(x=u[m].spd)==null?void 0:x[L]});f.push(w)}}):_.forEach((b,L)=>{var x;if(b>=s&&b<=n&&(!(o<=this.zoom)||b%(o<this.zoom/2?5:3)===0)){const w=v.point([b,m],{val:u[m].val[L],spd:(x=u[m].spd)==null?void 0:x[L]});f.push(w)}})}if(t=new Date().valueOf()-(a+e),console.log("direction elapsed: ",t,", total: ",e+=t),y==="swell"){const m=this.weatherLayers[y].height;if(m){if(!m.data){const _=[];for(const b in(h=m.raw)==null?void 0:h.LineString){const L=m.raw.LineString[b];for(const x of L)_.push(v.lineString(x,{val:Number(b)}));m.data=v.featureCollection(_)}}if(m.data){const _=this.handleBboxClip(m.data,r);f=f.concat(_)}t=new Date().valueOf()-(a+e),console.log("height elapsed: ",t,", total: ",e+=t)}}if(y==="current"){const m=this.weatherLayers[y].speed;if(m){if(!m.data){const b=[];for(const L in(g=m.raw)==null?void 0:g.Polygon){const x=m.raw.Polygon[L];for(const w of x)b.push(v.polygon(w,{val:Number(L)}))}m.data=v.featureCollection(b)}const _=o<this.zoom?m.data.features.filter(b=>b.properties.val>.5):m.data.features;f=f.concat(_),t=new Date().valueOf()-(a+e),console.log("speed elapsed: ",t,", total: ",e+=t)}}}else if(y==="wind"){const u=this.weatherLayers.wind.raw;for(const m in u)if(m>l&&m<c&&(!(o<=this.zoom)||m%(o<this.zoom/2?5:3)===0)){const _=u[m].lng;s>n?_.forEach((b,L)=>{if((b>=s&&b<=180||b>=-180&&b<=n)&&(!(o<=this.zoom)||b%(o<this.zoom/2?5:3)===0)){const x=v.point([b,m],{val:u[m].val[L],spd:u[m].spd[L]});f.push(x)}}):_.forEach((b,L)=>{if(b>=s&&b<=n&&(!(o<=this.zoom)||b%(o<this.zoom/2?5:3)===0)){const x=v.point([b,m],{val:u[m].val[L],spd:u[m].spd[L]});f.push(x)}})}t=new Date().valueOf()-(a+e),console.log("wind barb elapsed: ",t,", total: ",e+=t)}else if(y==="sig-wave-height"){if(this.weatherLayers[y].data)f=this.weatherLayers[y].data;else{const u=this.weatherLayers[y].raw;if(u){const m=[];for(const _ in u.Polygon){const b=u.Polygon[_];for(const L of b)m.push(v.polygon(L,{val:Number(_)}))}for(const _ in u.Point){const b=u.Point[_];for(const L of b)m.push(...v.points(L,{val:Number(_)}).features)}f=f.concat(m)}}t=new Date().valueOf()-(a+e),console.log("sigWave elapsed: ",t,", total: ",e+=t)}else if(y==="prmsl"){if(this.weatherLayers[y].data)f=this.weatherLayers[y].data;else{const u=this.weatherLayers[y].raw;if(u){const m=[];for(const _ in u.LineString){const b=u.LineString[_];for(const L of b)m.push(v.lineString(L,{val:Number(_)}))}for(const _ in u.Point)u.Point[_].lng.forEach((b,L)=>{b=C.LngLatHelper.convertToStdLng(b),m.push(v.point([b,_],{val:u.Point[_].val[L],type:u.Point[_].type[L]}))});f=f.concat(m)}}t=new Date().valueOf()-(a+e),console.log("prmsl elapsed: ",t,", total: ",e+=t)}else if(y==="arctic"||y==="iceberg"){if(this.weatherLayers[y].data)f=this.weatherLayers[y].data;else{const u=this.weatherLayers[y].raw;if(u){const m=[];for(const _ in u.LineString){const b=u.LineString[_];for(const L of b)m.push(v.lineString(L,{val:Number(_)}))}f=f.concat(m)}}t=new Date().valueOf()-(a+e)}console.log(y," elapsed: ",t,", total: ",e+=t),f.length&&(this.weatherLayers[y].data=v.featureCollection(f)),this.weatherLayers[y].active=!0,this.weatherLayers[y].version=Math.random()+1}},handleDragEndWithZoom4Image(){for(const a in this.weatherLayers)this.weatherLayers[a].active&&this.weatherLayers[a].type==="image"&&(this.weatherLayers[a].active=!0,this.weatherLayers[a].version=Math.random()+1)},handleBboxClip(a,e){const t=[],r=C.LngLatHelper.convertToStdLng(e._sw.lng),o=C.LngLatHelper.convertToStdLng(e._ne.lng);return a.features.forEach(s=>{if(s.geometry.type!=="Point")if(r>o){let n=[r,e._sw.lat,180,e._ne.lat],l=v.bboxClip(s,n);l.geometry.coordinates.length&&t.push(l),n=[-180,e._sw.lat,o,e._ne.lat],l=v.bboxClip(s,n),l.geometry.coordinates.length&&t.push(l)}else{const n=[r,e._sw.lat,o,e._ne.lat],l=v.bboxClip(s,n);l.geometry.coordinates.length&&t.push(l)}else t.push(s)}),t},handleWeatherLayerToggle(){var a;for(const e in this.weatherLayers)this.weatherLayers[e].active=!1,this.weatherLayers[e].version=Math.random()+1;for(const e of this.activeWeatherLayers){let t=e.key;t.indexOf("swell")>-1?t="swell":t.indexOf("current")>-1&&(t="current"),this.weatherLayers[t]&&(this.weatherLayers[t].active=!0,this.weatherLayers[t].version=Math.random()+1,((a=this.particleFactor)==null?void 0:a.key)===t&&this.weatherLayers[`${t}-particle`]&&(this.weatherLayers[`${t}-particle`].active=this.particleFactor.particle))}this.handleBeforeLayerToggle()},handleBeforeLayerToggle(){var a,e,t,r,o,s,n,l,c,d,p,h,g;(a=this.map)!=null&&a.getLayer(this.beforeLayer)&&((e=this.activeWeatherLayers)!=null&&e.length||(t=this.otherLayers)!=null&&t["war-zones"]||(r=this.otherLayers)!=null&&r["gmdss-areas"]||(o=this.otherLayers)!=null&&o["load-lines"]||(s=this.otherLayers)!=null&&s["high-risk-area"]||(n=this.otherLayers)!=null&&n["time-zones"]||(l=this.otherLayers)!=null&&l.pirates||(c=this.otherLayers)!=null&&c.ports||(d=this.otherLayers)!=null&&d.enc||(p=this.otherLayers)!=null&&p["voluntary-reporting-area"]||(h=this.otherLayers)!=null&&h["eca-zones"]||(g=this.otherLayers)!=null&&g["special-area"])&&this.map.setLayoutProperty(this.beforeLayer,"visibility","visible")},handleDateChange(a={tropicals:!1}){this.fetchWeatherLayers(a),this.fetchOtherLayers({dayNight:!0})},handleWeatherLayerChange(a,e,t){if(!this.map)setTimeout(()=>{this.handleWeatherLayerChange(a,e,t)},500);else{this.activeWeatherLayers=e;const r=this.activeWeatherLayers.some(n=>{var l;return["wind","current"].includes(n.key)&&(!((l=Object.keys(n))!=null&&l.some(c=>c==="particle"))||!!n.particle)}),o=this.activeWeatherLayers.some(n=>["png","jpg"].includes(n.type));r&&!o?(this.activeWeatherLayers.forEach(n=>{["wind","current"].includes(n.key)&&(this.particleFactor=n)}),this.particleFactor.particle=!0):o&&this.particleFactor&&(this.particleFactor.particle=!1);const s=e==null?void 0:e.reduce((n,l)=>n+(n&(l==null?void 0:l.weight)?0:l==null?void 0:l.weight),0);this.weatherWeight!==s||this.source!==t?(this.source=t,this.weatherWeight=s,this.fetchWeatherLayers({tropicals:!1})):this.handleWeatherLayerToggle()}},handleOtherLayerChange(a){if(!this.map)setTimeout(()=>{this.handleOtherLayerChange(a)},500);else{const e=a==null?void 0:a.reduce((t,r)=>t+(r==null?void 0:r.weight),0);a.find(t=>t.key==="enc")?this.enc="i4":this.enc="",this.otherWeight!=e&&(this.otherWeight=e,this.fetchOtherLayers({all:!0}))}},async handlePointChange(a){const e=this.ts?A(this.ts):A(),t={lat:a.lat,lng:a.lng,ts:e.utc().format(),wt:!0,src:this.source},r=await U.get(`${this.gateway}/api/arc/meteo/query`,{params:t,headers:{Authorization:this.token||this.defaultMeteoToken}});(r==null?void 0:r.status)===200&&(this.meteo={...r==null?void 0:r.data,...a})},handle3dToggle(a){var e,t,r,o,s,n,l,c,d,p,h,g,y,f,u,m,_,b,L,x;a?(this.map.setProjection("globe"),this.mapProjection="globe",(t=this.map)!=null&&t.getLayer((e=this.viewport)==null?void 0:e.rampColorLayer)&&((r=this.map)!=null&&r.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((s=this.map)==null||s.moveLayer((o=this.viewport)==null?void 0:o.rampColorLayer,this.helper.mapboxCustomer.layers.water.id)),(l=this.map)!=null&&l.getLayer((n=this.viewport)==null?void 0:n.particleLayer)&&((c=this.map)!=null&&c.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((p=this.map)==null||p.moveLayer((d=this.viewport)==null?void 0:d.particleLayer,this.helper.mapboxCustomer.layers.water.id)),this.map.off("zoomend",this.handleDragEndWithZoom4Json),this.map.off("dragend",this.handleDragEndWithZoom4Json),this.map.off("move",this.handleDragEndWithZoom4Image)):(this.map.setProjection("mercator"),this.mapProjection="mercator",this.map.on("zoomend",this.handleDragEndWithZoom4Json),this.map.on("dragend",this.handleDragEndWithZoom4Json),this.map.on("move",this.handleDragEndWithZoom4Image),this.handleDragEndWithZoom4Image(),this.handleDragEndWithZoom4Json(),(g=this.map)!=null&&g.getLayer((h=this.viewport)==null?void 0:h.rampColorLayer)&&((y=this.map)!=null&&y.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((u=this.map)==null||u.moveLayer((f=this.viewport)==null?void 0:f.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(_=this.map)!=null&&_.getLayer((m=this.viewport)==null?void 0:m.particleLayer)&&((b=this.map)!=null&&b.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((x=this.map)==null||x.moveLayer((L=this.viewport)==null?void 0:L.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)))},handleParticle(a){this.particleFactor=a,this.weatherLayers[a.key]&&(this.weatherLayers[a.key].particle=a.particle),this.activeWeatherLayers.forEach(r=>{r.key===a.key&&(r.particle=a.particle)});let e=localStorage.getItem("weatherLayersCache");const t=JSON.parse(e)||[];t==null||t.forEach(r=>{r.key===a.key&&(r.particle=a.particle)}),localStorage.setItem("weatherLayersCache",JSON.stringify(t)),this.fetchWeatherLayers({tropicals:!1})},handleToggleVersion(){this.$emit("toggleVersion",Math.random())}}},So={key:0,className:"map-gl-home"};function Eo(a,e,t,r,o,s){var q,M,W,ce,F,S,$,he,H,de,Y,Q,K,_e,we,Le,ve,xe,Ne,Re,De,$e,Ae,Be,Me,je;const n=i.resolveComponent("IdmGlLayer"),l=i.resolveComponent("IdmENC"),c=i.resolveComponent("IdmSigWave"),d=i.resolveComponent("IdmSwell"),p=i.resolveComponent("IdmPrmsl"),h=i.resolveComponent("IdmIceberg"),g=i.resolveComponent("IdmTropicals"),y=i.resolveComponent("IdmCurrents"),f=i.resolveComponent("IdmCurrentParticle"),u=i.resolveComponent("IdmWindBarb"),m=i.resolveComponent("IdmWindParticle"),_=i.resolveComponent("IdmPrecip3h"),b=i.resolveComponent("IdmVisibility"),L=i.resolveComponent("IdmWaterTemp"),x=i.resolveComponent("IdmTemp"),w=i.resolveComponent("IdmArctic"),P=i.resolveComponent("IdmWarZone"),N=i.resolveComponent("IdmGmdssArea"),I=i.resolveComponent("IdmEcaZone"),R=i.resolveComponent("IdmAlertZone"),D=i.resolveComponent("IdmPort"),B=i.resolveComponent("IdmLoadLine"),ae=i.resolveComponent("IdmTimezone"),ie=i.resolveComponent("IdmVRA"),oe=i.resolveComponent("IdmSpecialArea"),re=i.resolveComponent("IdmTerminator"),se=i.resolveComponent("IdmLatLng"),ne=i.resolveComponent("IdmMeasure"),le=i.resolveComponent("IdmPoint");return t.map?(i.openBlock(),i.createElementBlock("div",So,[i.createVNode(n,i.mergeProps({ref:"layer",map:t.map,"toggle-version":t.toggleVersion,"map-projection":o.mapProjection},a.$attrs,{onWeather:s.handleWeatherLayerChange,onOther:s.handleOtherLayerChange,onCoordinate:e[0]||(e[0]=pe=>o.showCoord=pe),onMeasure:e[1]||(e[1]=pe=>o.showMeasure=pe),onPoint:e[2]||(e[2]=pe=>o.showPoint=pe),on3d:s.handle3dToggle,onHandleToggleVersion:s.handleToggleVersion}),null,16,["map","toggle-version","map-projection","onWeather","onOther","on3d","onHandleToggleVersion"]),i.createVNode(l,i.mergeProps({map:t.map,token:t.token,enabled:(q=o.otherLayers)==null?void 0:q.enc,"toggle-version":t.toggleVersion},a.$attrs,{onEnc:e[3]||(e[3]=pe=>o.enc=pe)}),null,16,["map","token","enabled","toggle-version"]),i.createVNode(c,i.mergeProps({map:t.map,"sig-wave":(M=o.weatherLayers)==null?void 0:M["sig-wave-height"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","sig-wave","before-layer"]),i.createVNode(d,i.mergeProps({map:t.map,swell:(W=o.weatherLayers)==null?void 0:W.swell,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","swell","before-layer"]),i.createVNode(p,i.mergeProps({map:t.map,prmsl:(ce=o.weatherLayers)==null?void 0:ce.prmsl,"before-layer":t.beforeLayer,"active-weather-layers":o.activeWeatherLayers},a.$attrs),null,16,["map","prmsl","before-layer","active-weather-layers"]),i.createVNode(h,i.mergeProps({map:t.map,iceberg:(F=o.weatherLayers)==null?void 0:F.iceberg,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","iceberg","before-layer"]),i.createVNode(g,i.mergeProps({map:t.map,date:t.ts,tropicals:(S=o.weatherLayers)==null?void 0:S.tropicals,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","date","tropicals","before-layer"]),i.createVNode(y,i.mergeProps({map:t.map,"map-projection":o.mapProjection,current:($=o.weatherLayers)==null?void 0:$.current,"before-layer":t.beforeLayer,"show-particle":o.showCurrentParticle,"margin-bottom":o.activeWindLayer?o.showRampColor?"84px":"56px":o.showRampColor?"56px":"30px","toggle-version":t.toggleVersion,"weather-layers":o.weatherLayers},a.$attrs,{onParticle:s.handleParticle,onHandleToggleVersion:s.handleToggleVersion}),null,16,["map","map-projection","current","before-layer","show-particle","margin-bottom","toggle-version","weather-layers","onParticle","onHandleToggleVersion"]),i.createVNode(f,i.mergeProps({viewport:o.viewport,factor:(he=o.weatherLayers)==null?void 0:he["current-particle"],"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(u,i.mergeProps({ref:"windBarb",map:t.map,"map-projection":o.mapProjection,wind:(H=o.weatherLayers)==null?void 0:H.wind,current:(de=o.weatherLayers)==null?void 0:de.current,"before-layer":t.beforeLayer,"margin-bottom":o.showRampColor?"56px":"30px","show-particle":o.showWindParticle},a.$attrs,{"toggle-version":t.toggleVersion,"weather-layers":o.weatherLayers,onParticle:s.handleParticle}),null,16,["map","map-projection","wind","current","before-layer","margin-bottom","show-particle","toggle-version","weather-layers","onParticle"]),i.createVNode(m,i.mergeProps({viewport:o.viewport,factor:(Y=o.weatherLayers)==null?void 0:Y["wind-particle"],"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(_,i.mergeProps({viewport:o.viewport,factor:(Q=o.weatherLayers)==null?void 0:Q.precip3h,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(b,i.mergeProps({viewport:o.viewport,factor:(K=o.weatherLayers)==null?void 0:K.visibility,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(L,i.mergeProps({viewport:o.viewport,factor:(_e=o.weatherLayers)==null?void 0:_e["water-temp"],"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(x,i.mergeProps({viewport:o.viewport,factor:(we=o.weatherLayers)==null?void 0:we.temp,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(w,i.mergeProps({viewport:o.viewport,factor:(Le=o.weatherLayers)==null?void 0:Le.arctic,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(P,i.mergeProps({map:t.map,zone:(ve=o.otherLayers)==null?void 0:ve["war-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(N,i.mergeProps({map:t.map,area:(xe=o.otherLayers)==null?void 0:xe["gmdss-areas"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),i.createVNode(I,i.mergeProps({map:t.map,zone:(Ne=o.otherLayers)==null?void 0:Ne["eca-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(R,i.mergeProps({map:t.map,zone:(Re=o.otherLayers)==null?void 0:Re["alert-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(D,i.mergeProps({map:t.map,port:(De=o.otherLayers)==null?void 0:De.ports,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","port","before-layer"]),i.createVNode(B,i.mergeProps({map:t.map,line:($e=o.otherLayers)==null?void 0:$e["load-lines"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","line","before-layer"]),i.createVNode(ae,i.mergeProps({map:t.map,zone:(Ae=o.otherLayers)==null?void 0:Ae["time-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(ie,i.mergeProps({map:t.map,area:(Be=o.otherLayers)==null?void 0:Be["voluntary-reporting-area"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),i.createVNode(oe,i.mergeProps({map:t.map,area:(Me=o.otherLayers)==null?void 0:Me["special-area"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),i.createVNode(re,i.mergeProps({map:t.map,area:(je=o.otherLayers)==null?void 0:je["day-night"]},a.$attrs),null,16,["map","area"]),i.createVNode(se,i.mergeProps({map:t.map,show:o.showCoord,"toggle-version":t.toggleVersion},a.$attrs),null,16,["map","show","toggle-version"]),i.createVNode(ne,i.mergeProps({map:t.map,show:o.showMeasure},a.$attrs),null,16,["map","show"]),i.createVNode(le,i.mergeProps({map:t.map,show:o.showPoint,meteo:o.meteo},a.$attrs,{onPoint:s.handlePointChange}),null,16,["map","show","meteo","onPoint"])])):i.createCommentVNode("",!0)}const Ve=k(ko,[["render",Eo]]),zo={install(a){a.component("MapboxGL",Ve),a.component("TropicalGL",ze),a.component("LatLngGL",Pe)}};E.LatLngGL=Pe,E.MapboxGL=Ve,E.MapboxGLPlugin=zo,E.MapboxHelper=Te,E.ParticleSchema=V,E.TropicalGL=ze,E.Viewport=Ce,E.WebGL=Z,E.WebGLSchema=T,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|